commit 33a6761b7d73c3fd4faf936ef4a5718fc4930fd2 Author: Nick Date: Wed Mar 6 11:57:49 2024 +0100 new build diff --git a/Frameworks/BVLinearGradient.xcframework/Info.plist b/Frameworks/BVLinearGradient.xcframework/Info.plist new file mode 100644 index 0000000..74c0409 --- /dev/null +++ b/Frameworks/BVLinearGradient.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libBVLinearGradient.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libBVLinearGradient.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libBVLinearGradient.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libBVLinearGradient.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradient.h b/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradient.h new file mode 100644 index 0000000..74a3f87 --- /dev/null +++ b/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradient.h @@ -0,0 +1,13 @@ +#import + +@interface BVLinearGradient : RCTView + +@property (nullable, nonatomic, copy) NSArray *colors; +@property (nullable, nonatomic, copy) NSArray *locations; +@property (nonatomic) CGPoint startPoint; +@property (nonatomic) CGPoint endPoint; +@property (nonatomic) BOOL useAngle; +@property (nonatomic) CGPoint angleCenter; +@property (nonatomic) CGFloat angle; + +@end diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradientLayer.h b/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradientLayer.h new file mode 100644 index 0000000..9283fe0 --- /dev/null +++ b/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradientLayer.h @@ -0,0 +1,16 @@ +#import +#import + +@class UIColor; + +@interface BVLinearGradientLayer : CALayer + +@property (nullable, nonatomic, copy) NSArray *colors; +@property (nullable, nonatomic, copy) NSArray *locations; +@property (nonatomic) CGPoint startPoint; +@property (nonatomic) CGPoint endPoint; +@property (nonatomic) BOOL useAngle; +@property (nonatomic) CGPoint angleCenter; +@property (nonatomic) CGFloat angle; + +@end diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradientManager.h b/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradientManager.h new file mode 100644 index 0000000..49f46f2 --- /dev/null +++ b/Frameworks/BVLinearGradient.xcframework/ios-arm64/Headers/BVLinearGradientManager.h @@ -0,0 +1,5 @@ +#import + +@interface BVLinearGradientManager : RCTViewManager + +@end diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64/libBVLinearGradient.a b/Frameworks/BVLinearGradient.xcframework/ios-arm64/libBVLinearGradient.a new file mode 100644 index 0000000..e254329 Binary files /dev/null and b/Frameworks/BVLinearGradient.xcframework/ios-arm64/libBVLinearGradient.a differ diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradient.h b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradient.h new file mode 100644 index 0000000..74a3f87 --- /dev/null +++ b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradient.h @@ -0,0 +1,13 @@ +#import + +@interface BVLinearGradient : RCTView + +@property (nullable, nonatomic, copy) NSArray *colors; +@property (nullable, nonatomic, copy) NSArray *locations; +@property (nonatomic) CGPoint startPoint; +@property (nonatomic) CGPoint endPoint; +@property (nonatomic) BOOL useAngle; +@property (nonatomic) CGPoint angleCenter; +@property (nonatomic) CGFloat angle; + +@end diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradientLayer.h b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradientLayer.h new file mode 100644 index 0000000..9283fe0 --- /dev/null +++ b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradientLayer.h @@ -0,0 +1,16 @@ +#import +#import + +@class UIColor; + +@interface BVLinearGradientLayer : CALayer + +@property (nullable, nonatomic, copy) NSArray *colors; +@property (nullable, nonatomic, copy) NSArray *locations; +@property (nonatomic) CGPoint startPoint; +@property (nonatomic) CGPoint endPoint; +@property (nonatomic) BOOL useAngle; +@property (nonatomic) CGPoint angleCenter; +@property (nonatomic) CGFloat angle; + +@end diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradientManager.h b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradientManager.h new file mode 100644 index 0000000..49f46f2 --- /dev/null +++ b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/Headers/BVLinearGradientManager.h @@ -0,0 +1,5 @@ +#import + +@interface BVLinearGradientManager : RCTViewManager + +@end diff --git a/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/libBVLinearGradient.a b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/libBVLinearGradient.a new file mode 100644 index 0000000..d61f8d6 Binary files /dev/null and b/Frameworks/BVLinearGradient.xcframework/ios-arm64_x86_64-simulator/libBVLinearGradient.a differ diff --git a/Frameworks/DoubleConversion.xcframework/Info.plist b/Frameworks/DoubleConversion.xcframework/Info.plist new file mode 100644 index 0000000..e682d29 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libDoubleConversion.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libDoubleConversion.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libDoubleConversion.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libDoubleConversion.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/bignum-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/bignum-dtoa.h new file mode 100644 index 0000000..34b9619 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/bignum-dtoa.h @@ -0,0 +1,84 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_DTOA_H_ +#define DOUBLE_CONVERSION_BIGNUM_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum BignumDtoaMode { + // Return the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate but + // correct) 0.3. + BIGNUM_DTOA_SHORTEST, + // Same as BIGNUM_DTOA_SHORTEST but for single-precision floats. + BIGNUM_DTOA_SHORTEST_SINGLE, + // Return a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + BIGNUM_DTOA_FIXED, + // Return a fixed number of digits, no matter what the exponent is. + BIGNUM_DTOA_PRECISION +}; + +// Converts the given double 'v' to ascii. +// The result should be interpreted as buffer * 10^(point-length). +// The buffer will be null-terminated. +// +// The input v must be > 0 and different from NaN, and Infinity. +// +// The output depends on the given mode: +// - SHORTEST: produce the least amount of digits for which the internal +// identity requirement is still satisfied. If the digits are printed +// (together with the correct exponent) then reading this number will give +// 'v' again. The buffer will choose the representation that is closest to +// 'v'. If there are two at the same distance, than the number is round up. +// In this mode the 'requested_digits' parameter is ignored. +// - FIXED: produces digits necessary to print a given number with +// 'requested_digits' digits after the decimal point. The produced digits +// might be too short in which case the caller has to fill the gaps with '0's. +// Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. +// Halfway cases are rounded up. The call toFixed(0.15, 2) thus returns +// buffer="2", point=0. +// Note: the length of the returned buffer has no meaning wrt the significance +// of its digits. That is, just because it contains '0's does not mean that +// any other digit would not satisfy the internal identity requirement. +// - PRECISION: produces 'requested_digits' where the first digit is not '0'. +// Even though the length of produced digits usually equals +// 'requested_digits', the function is allowed to return fewer digits, in +// which case the caller has to fill the missing digits with '0's. +// Halfway cases are again rounded up. +// 'BignumDtoa' expects the given buffer to be big enough to hold all digits +// and a terminating null-character. +void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, + Vector buffer, int* length, int* point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/bignum.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/bignum.h new file mode 100644 index 0000000..5ec3544 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/bignum.h @@ -0,0 +1,145 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_H_ +#define DOUBLE_CONVERSION_BIGNUM_H_ + +#include "utils.h" + +namespace double_conversion { + +class Bignum { + public: + // 3584 = 128 * 28. We can represent 2^3584 > 10^1000 accurately. + // This bignum can encode much bigger numbers, since it contains an + // exponent. + static const int kMaxSignificantBits = 3584; + + Bignum(); + void AssignUInt16(uint16_t value); + void AssignUInt64(uint64_t value); + void AssignBignum(const Bignum& other); + + void AssignDecimalString(Vector value); + void AssignHexString(Vector value); + + void AssignPowerUInt16(uint16_t base, int exponent); + + void AddUInt16(uint16_t operand); + void AddUInt64(uint64_t operand); + void AddBignum(const Bignum& other); + // Precondition: this >= other. + void SubtractBignum(const Bignum& other); + + void Square(); + void ShiftLeft(int shift_amount); + void MultiplyByUInt32(uint32_t factor); + void MultiplyByUInt64(uint64_t factor); + void MultiplyByPowerOfTen(int exponent); + void Times10() { return MultiplyByUInt32(10); } + // Pseudocode: + // int result = this / other; + // this = this % other; + // In the worst case this function is in O(this/other). + uint16_t DivideModuloIntBignum(const Bignum& other); + + bool ToHexString(char* buffer, int buffer_size) const; + + // Returns + // -1 if a < b, + // 0 if a == b, and + // +1 if a > b. + static int Compare(const Bignum& a, const Bignum& b); + static bool Equal(const Bignum& a, const Bignum& b) { + return Compare(a, b) == 0; + } + static bool LessEqual(const Bignum& a, const Bignum& b) { + return Compare(a, b) <= 0; + } + static bool Less(const Bignum& a, const Bignum& b) { + return Compare(a, b) < 0; + } + // Returns Compare(a + b, c); + static int PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c); + // Returns a + b == c + static bool PlusEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) == 0; + } + // Returns a + b <= c + static bool PlusLessEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) <= 0; + } + // Returns a + b < c + static bool PlusLess(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) < 0; + } + private: + typedef uint32_t Chunk; + typedef uint64_t DoubleChunk; + + static const int kChunkSize = sizeof(Chunk) * 8; + static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8; + // With bigit size of 28 we loose some bits, but a double still fits easily + // into two chunks, and more importantly we can use the Comba multiplication. + static const int kBigitSize = 28; + static const Chunk kBigitMask = (1 << kBigitSize) - 1; + // Every instance allocates kBigitLength chunks on the stack. Bignums cannot + // grow. There are no checks if the stack-allocated space is sufficient. + static const int kBigitCapacity = kMaxSignificantBits / kBigitSize; + + void EnsureCapacity(int size) { + if (size > kBigitCapacity) { + UNREACHABLE(); + } + } + void Align(const Bignum& other); + void Clamp(); + bool IsClamped() const; + void Zero(); + // Requires this to have enough capacity (no tests done). + // Updates used_digits_ if necessary. + // shift_amount must be < kBigitSize. + void BigitsShiftLeft(int shift_amount); + // BigitLength includes the "hidden" digits encoded in the exponent. + int BigitLength() const { return used_digits_ + exponent_; } + Chunk BigitAt(int index) const; + void SubtractTimes(const Bignum& other, int factor); + + Chunk bigits_buffer_[kBigitCapacity]; + // A vector backed by bigits_buffer_. This way accesses to the array are + // checked for out-of-bounds errors. + Vector bigits_; + int used_digits_; + // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize). + int exponent_; + + DISALLOW_COPY_AND_ASSIGN(Bignum); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/cached-powers.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/cached-powers.h new file mode 100644 index 0000000..61a5061 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/cached-powers.h @@ -0,0 +1,64 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_CACHED_POWERS_H_ +#define DOUBLE_CONVERSION_CACHED_POWERS_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +class PowersOfTenCache { + public: + + // Not all powers of ten are cached. The decimal exponent of two neighboring + // cached numbers will differ by kDecimalExponentDistance. + static const int kDecimalExponentDistance; + + static const int kMinDecimalExponent; + static const int kMaxDecimalExponent; + + // Returns a cached power-of-ten with a binary exponent in the range + // [min_exponent; max_exponent] (boundaries included). + static void GetCachedPowerForBinaryExponentRange(int min_exponent, + int max_exponent, + DiyFp* power, + int* decimal_exponent); + + // Returns a cached power of ten x ~= 10^k such that + // k <= decimal_exponent < k + kCachedPowersDecimalDistance. + // The given decimal_exponent must satisfy + // kMinDecimalExponent <= requested_exponent, and + // requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance. + static void GetCachedPowerForDecimalExponent(int requested_exponent, + DiyFp* power, + int* found_exponent); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_CACHED_POWERS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/diy-fp.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/diy-fp.h new file mode 100644 index 0000000..9dcf8fb --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/diy-fp.h @@ -0,0 +1,118 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DIY_FP_H_ +#define DOUBLE_CONVERSION_DIY_FP_H_ + +#include "utils.h" + +namespace double_conversion { + +// This "Do It Yourself Floating Point" class implements a floating-point number +// with a uint64 significand and an int exponent. Normalized DiyFp numbers will +// have the most significant bit of the significand set. +// Multiplication and Subtraction do not normalize their results. +// DiyFp are not designed to contain special doubles (NaN and Infinity). +class DiyFp { + public: + static const int kSignificandSize = 64; + + DiyFp() : f_(0), e_(0) {} + DiyFp(uint64_t f, int e) : f_(f), e_(e) {} + + // this = this - other. + // The exponents of both numbers must be the same and the significand of this + // must be bigger than the significand of other. + // The result will not be normalized. + void Subtract(const DiyFp& other) { + ASSERT(e_ == other.e_); + ASSERT(f_ >= other.f_); + f_ -= other.f_; + } + + // Returns a - b. + // The exponents of both numbers must be the same and this must be bigger + // than other. The result will not be normalized. + static DiyFp Minus(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Subtract(b); + return result; + } + + + // this = this * other. + void Multiply(const DiyFp& other); + + // returns a * b; + static DiyFp Times(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Multiply(b); + return result; + } + + void Normalize() { + ASSERT(f_ != 0); + uint64_t f = f_; + int e = e_; + + // This method is mainly called for normalizing boundaries. In general + // boundaries need to be shifted by 10 bits. We thus optimize for this case. + const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000); + while ((f & k10MSBits) == 0) { + f <<= 10; + e -= 10; + } + while ((f & kUint64MSB) == 0) { + f <<= 1; + e--; + } + f_ = f; + e_ = e; + } + + static DiyFp Normalize(const DiyFp& a) { + DiyFp result = a; + result.Normalize(); + return result; + } + + uint64_t f() const { return f_; } + int e() const { return e_; } + + void set_f(uint64_t new_value) { f_ = new_value; } + void set_e(int new_value) { e_ = new_value; } + + private: + static const uint64_t kUint64MSB = UINT64_2PART_C(0x80000000, 00000000); + + uint64_t f_; + int e_; +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DIY_FP_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/double-conversion.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/double-conversion.h new file mode 100644 index 0000000..1c3387d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/double-conversion.h @@ -0,0 +1,536 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ +#define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ + +#include "utils.h" + +namespace double_conversion { + +class DoubleToStringConverter { + public: + // When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint + // or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the + // function returns false. + static const int kMaxFixedDigitsBeforePoint = 60; + static const int kMaxFixedDigitsAfterPoint = 60; + + // When calling ToExponential with a requested_digits + // parameter > kMaxExponentialDigits then the function returns false. + static const int kMaxExponentialDigits = 120; + + // When calling ToPrecision with a requested_digits + // parameter < kMinPrecisionDigits or requested_digits > kMaxPrecisionDigits + // then the function returns false. + static const int kMinPrecisionDigits = 1; + static const int kMaxPrecisionDigits = 120; + + enum Flags { + NO_FLAGS = 0, + EMIT_POSITIVE_EXPONENT_SIGN = 1, + EMIT_TRAILING_DECIMAL_POINT = 2, + EMIT_TRAILING_ZERO_AFTER_POINT = 4, + UNIQUE_ZERO = 8 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - EMIT_POSITIVE_EXPONENT_SIGN: when the number is converted into exponent + // form, emits a '+' for positive exponents. Example: 1.2e+2. + // - EMIT_TRAILING_DECIMAL_POINT: when the input number is an integer and is + // converted into decimal format then a trailing decimal point is appended. + // Example: 2345.0 is converted to "2345.". + // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point + // emits a trailing '0'-character. This flag requires the + // EXMIT_TRAILING_DECIMAL_POINT flag. + // Example: 2345.0 is converted to "2345.0". + // - UNIQUE_ZERO: "-0.0" is converted to "0.0". + // + // Infinity symbol and nan_symbol provide the string representation for these + // special values. If the string is NULL and the special value is encountered + // then the conversion functions return false. + // + // The exponent_character is used in exponential representations. It is + // usually 'e' or 'E'. + // + // When converting to the shortest representation the converter will + // represent input numbers in decimal format if they are in the interval + // [10^decimal_in_shortest_low; 10^decimal_in_shortest_high[ + // (lower boundary included, greater boundary excluded). + // Example: with decimal_in_shortest_low = -6 and + // decimal_in_shortest_high = 21: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // When converting to precision mode the converter may add + // max_leading_padding_zeroes before returning the number in exponential + // format. + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + DoubleToStringConverter(int flags, + const char* infinity_symbol, + const char* nan_symbol, + char exponent_character, + int decimal_in_shortest_low, + int decimal_in_shortest_high, + int max_leading_padding_zeroes_in_precision_mode, + int max_trailing_padding_zeroes_in_precision_mode) + : flags_(flags), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol), + exponent_character_(exponent_character), + decimal_in_shortest_low_(decimal_in_shortest_low), + decimal_in_shortest_high_(decimal_in_shortest_high), + max_leading_padding_zeroes_in_precision_mode_( + max_leading_padding_zeroes_in_precision_mode), + max_trailing_padding_zeroes_in_precision_mode_( + max_trailing_padding_zeroes_in_precision_mode) { + // When 'trailing zero after the point' is set, then 'trailing point' + // must be set too. + ASSERT(((flags & EMIT_TRAILING_DECIMAL_POINT) != 0) || + !((flags & EMIT_TRAILING_ZERO_AFTER_POINT) != 0)); + } + + // Returns a converter following the EcmaScript specification. + static const DoubleToStringConverter& EcmaScriptConverter(); + + // Computes the shortest string of digits that correctly represent the input + // number. Depending on decimal_in_shortest_low and decimal_in_shortest_high + // (see constructor) it then either returns a decimal representation, or an + // exponential representation. + // Example with decimal_in_shortest_low = -6, + // decimal_in_shortest_high = 21, + // EMIT_POSITIVE_EXPONENT_SIGN activated, and + // EMIT_TRAILING_DECIMAL_POINT deactived: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // Note: the conversion may round the output if the returned string + // is accurate enough to uniquely identify the input-number. + // For example the most precise representation of the double 9e59 equals + // "899999999999999918767229449717619953810131273674690656206848", but + // the converter will return the shorter (but still correct) "9e59". + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except when the input value is special and no infinity_symbol or + // nan_symbol has been given to the constructor. + bool ToShortest(double value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST); + } + + // Same as ToShortest, but for single-precision floats. + bool ToShortestSingle(float value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST_SINGLE); + } + + + // Computes a decimal representation with a fixed number of digits after the + // decimal point. The last emitted digit is rounded. + // + // Examples: + // ToFixed(3.12, 1) -> "3.1" + // ToFixed(3.1415, 3) -> "3.142" + // ToFixed(1234.56789, 4) -> "1234.5679" + // ToFixed(1.23, 5) -> "1.23000" + // ToFixed(0.1, 4) -> "0.1000" + // ToFixed(1e30, 2) -> "1000000000000000019884624838656.00" + // ToFixed(0.1, 30) -> "0.100000000000000005551115123126" + // ToFixed(0.1, 17) -> "0.10000000000000001" + // + // If requested_digits equals 0, then the tail of the result depends on + // the EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples, for requested_digits == 0, + // let EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT be + // - false and false: then 123.45 -> 123 + // 0.678 -> 1 + // - true and false: then 123.45 -> 123. + // 0.678 -> 1. + // - true and true: then 123.45 -> 123.0 + // 0.678 -> 1.0 + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'value' > 10^kMaxFixedDigitsBeforePoint, or + // - 'requested_digits' > kMaxFixedDigitsAfterPoint. + // The last two conditions imply that the result will never contain more than + // 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters + // (one additional character for the sign, and one for the decimal point). + bool ToFixed(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes a representation in exponential format with requested_digits + // after the decimal point. The last emitted digit is rounded. + // If requested_digits equals -1, then the shortest exponential representation + // is computed. + // + // Examples with EMIT_POSITIVE_EXPONENT_SIGN deactivated, and + // exponent_character set to 'e'. + // ToExponential(3.12, 1) -> "3.1e0" + // ToExponential(5.0, 3) -> "5.000e0" + // ToExponential(0.001, 2) -> "1.00e-3" + // ToExponential(3.1415, -1) -> "3.1415e0" + // ToExponential(3.1415, 4) -> "3.1415e0" + // ToExponential(3.1415, 3) -> "3.142e0" + // ToExponential(123456789000000, 3) -> "1.235e14" + // ToExponential(1000000000000000019884624838656.0, -1) -> "1e30" + // ToExponential(1000000000000000019884624838656.0, 32) -> + // "1.00000000000000001988462483865600e30" + // ToExponential(1234, 0) -> "1e3" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'requested_digits' > kMaxExponentialDigits. + // The last condition implies that the result will never contain more than + // kMaxExponentialDigits + 8 characters (the sign, the digit before the + // decimal point, the decimal point, the exponent character, the + // exponent's sign, and at most 3 exponent digits). + bool ToExponential(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes 'precision' leading digits of the given 'value' and returns them + // either in exponential or decimal format, depending on + // max_{leading|trailing}_padding_zeroes_in_precision_mode (given to the + // constructor). + // The last computed digit is rounded. + // + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 3, and no + // EMIT_TRAILING_ZERO_AFTER_POINT: + // ToPrecision(123450.0, 6) -> "123450" + // ToPrecision(123450.0, 5) -> "123450" + // ToPrecision(123450.0, 4) -> "123500" + // ToPrecision(123450.0, 3) -> "123000" + // ToPrecision(123450.0, 2) -> "1.2e5" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - precision < kMinPericisionDigits + // - precision > kMaxPrecisionDigits + // The last condition implies that the result will never contain more than + // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the + // exponent character, the exponent's sign, and at most 3 exponent digits). + bool ToPrecision(double value, + int precision, + StringBuilder* result_builder) const; + + enum DtoaMode { + // Produce the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate + // but correct) 0.3. + SHORTEST, + // Same as SHORTEST, but for single-precision floats. + SHORTEST_SINGLE, + // Produce a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + FIXED, + // Fixed number of digits (independent of the decimal point). + PRECISION + }; + + // The maximal number of digits that are needed to emit a double in base 10. + // A higher precision can be achieved by using more digits, but the shortest + // accurate representation of any double will never use more digits than + // kBase10MaximalLength. + // Note that DoubleToAscii null-terminates its input. So the given buffer + // should be at least kBase10MaximalLength + 1 characters long. + static const int kBase10MaximalLength = 17; + + // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or + // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v' + // after it has been casted to a single-precision float. That is, in this + // mode static_cast(v) must not be NaN, +Infinity or -Infinity. + // + // The result should be interpreted as buffer * 10^(point-length). + // + // The output depends on the given mode: + // - SHORTEST: produce the least amount of digits for which the internal + // identity requirement is still satisfied. If the digits are printed + // (together with the correct exponent) then reading this number will give + // 'v' again. The buffer will choose the representation that is closest to + // 'v'. If there are two at the same distance, than the one farther away + // from 0 is chosen (halfway cases - ending with 5 - are rounded up). + // In this mode the 'requested_digits' parameter is ignored. + // - SHORTEST_SINGLE: same as SHORTEST but with single-precision. + // - FIXED: produces digits necessary to print a given number with + // 'requested_digits' digits after the decimal point. The produced digits + // might be too short in which case the caller has to fill the remainder + // with '0's. + // Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. + // Halfway cases are rounded towards +/-Infinity (away from 0). The call + // toFixed(0.15, 2) thus returns buffer="2", point=0. + // The returned buffer may contain digits that would be truncated from the + // shortest representation of the input. + // - PRECISION: produces 'requested_digits' where the first digit is not '0'. + // Even though the length of produced digits usually equals + // 'requested_digits', the function is allowed to return fewer digits, in + // which case the caller has to fill the missing digits with '0's. + // Halfway cases are again rounded away from 0. + // DoubleToAscii expects the given buffer to be big enough to hold all + // digits and a terminating null-character. In SHORTEST-mode it expects a + // buffer of at least kBase10MaximalLength + 1. In all other modes the + // requested_digits parameter and the padding-zeroes limit the size of the + // output. Don't forget the decimal point, the exponent character and the + // terminating null-character when computing the maximal output size. + // The given length is only used in debug mode to ensure the buffer is big + // enough. + static void DoubleToAscii(double v, + DtoaMode mode, + int requested_digits, + char* buffer, + int buffer_length, + bool* sign, + int* length, + int* point); + + private: + // Implementation for ToShortest and ToShortestSingle. + bool ToShortestIeeeNumber(double value, + StringBuilder* result_builder, + DtoaMode mode) const; + + // If the value is a special value (NaN or Infinity) constructs the + // corresponding string using the configured infinity/nan-symbol. + // If either of them is NULL or the value is not special then the + // function returns false. + bool HandleSpecialValues(double value, StringBuilder* result_builder) const; + // Constructs an exponential representation (i.e. 1.234e56). + // The given exponent assumes a decimal point after the first decimal digit. + void CreateExponentialRepresentation(const char* decimal_digits, + int length, + int exponent, + StringBuilder* result_builder) const; + // Creates a decimal representation (i.e 1234.5678). + void CreateDecimalRepresentation(const char* decimal_digits, + int length, + int decimal_point, + int digits_after_point, + StringBuilder* result_builder) const; + + const int flags_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + const char exponent_character_; + const int decimal_in_shortest_low_; + const int decimal_in_shortest_high_; + const int max_leading_padding_zeroes_in_precision_mode_; + const int max_trailing_padding_zeroes_in_precision_mode_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter); +}; + + +class StringToDoubleConverter { + public: + // Enumeration for allowing octals and ignoring junk when converting + // strings to numbers. + enum Flags { + NO_FLAGS = 0, + ALLOW_HEX = 1, + ALLOW_OCTALS = 2, + ALLOW_TRAILING_JUNK = 4, + ALLOW_LEADING_SPACES = 8, + ALLOW_TRAILING_SPACES = 16, + ALLOW_SPACES_AFTER_SIGN = 32 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - ALLOW_HEX: recognizes the prefix "0x". Hex numbers may only be integers. + // Ex: StringToDouble("0x1234") -> 4660.0 + // In StringToDouble("0x1234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // With this flag "0x" is a junk-string. Even with ALLOW_TRAILING_JUNK, + // the string will not be parsed as "0" followed by junk. + // + // - ALLOW_OCTALS: recognizes the prefix "0" for octals: + // If a sequence of octal digits starts with '0', then the number is + // read as octal integer. Octal numbers may only be integers. + // Ex: StringToDouble("01234") -> 668.0 + // StringToDouble("012349") -> 12349.0 // Not a sequence of octal + // // digits. + // In StringToDouble("01234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // In StringToDouble("01234e56") the characters "e56" are trailing + // junk, too. + // - ALLOW_TRAILING_JUNK: ignore trailing characters that are not part of + // a double literal. + // - ALLOW_LEADING_SPACES: skip over leading spaces. + // - ALLOW_TRAILING_SPACES: ignore trailing spaces. + // - ALLOW_SPACES_AFTER_SIGN: ignore spaces after the sign. + // Ex: StringToDouble("- 123.2") -> -123.2. + // StringToDouble("+ 123.2") -> 123.2 + // + // empty_string_value is returned when an empty string is given as input. + // If ALLOW_LEADING_SPACES or ALLOW_TRAILING_SPACES are set, then a string + // containing only spaces is converted to the 'empty_string_value', too. + // + // junk_string_value is returned when + // a) ALLOW_TRAILING_JUNK is not set, and a junk character (a character not + // part of a double-literal) is found. + // b) ALLOW_TRAILING_JUNK is set, but the string does not start with a + // double literal. + // + // infinity_symbol and nan_symbol are strings that are used to detect + // inputs that represent infinity and NaN. They can be null, in which case + // they are ignored. + // The conversion routine first reads any possible signs. Then it compares the + // following character of the input-string with the first character of + // the infinity, and nan-symbol. If either matches, the function assumes, that + // a match has been found, and expects the following input characters to match + // the remaining characters of the special-value symbol. + // This means that the following restrictions apply to special-value symbols: + // - they must not start with signs ('+', or '-'), + // - they must not have the same first character. + // - they must not start with digits. + // + // Examples: + // flags = ALLOW_HEX | ALLOW_TRAILING_JUNK, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = "infinity", + // nan_symbol = "nan": + // StringToDouble("0x1234") -> 4660.0. + // StringToDouble("0x1234K") -> 4660.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> NaN // junk_string_value. + // StringToDouble(" 1") -> NaN // junk_string_value. + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("-123.45") -> -123.45. + // StringToDouble("--123.45") -> NaN // junk_string_value. + // StringToDouble("123e45") -> 123e45. + // StringToDouble("123E45") -> 123e45. + // StringToDouble("123e+45") -> 123e45. + // StringToDouble("123E-45") -> 123e-45. + // StringToDouble("123e") -> 123.0 // trailing junk ignored. + // StringToDouble("123e-") -> 123.0 // trailing junk ignored. + // StringToDouble("+NaN") -> NaN // NaN string literal. + // StringToDouble("-infinity") -> -inf. // infinity literal. + // StringToDouble("Infinity") -> NaN // junk_string_value. + // + // flags = ALLOW_OCTAL | ALLOW_LEADING_SPACES, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = NULL, + // nan_symbol = NULL: + // StringToDouble("0x1234") -> NaN // junk_string_value. + // StringToDouble("01234") -> 668.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> 0.0 // empty_string_value. + // StringToDouble(" 1") -> 1.0 + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("0123e45") -> NaN // junk_string_value. + // StringToDouble("01239E45") -> 1239e45. + // StringToDouble("-infinity") -> NaN // junk_string_value. + // StringToDouble("NaN") -> NaN // junk_string_value. + StringToDoubleConverter(int flags, + double empty_string_value, + double junk_string_value, + const char* infinity_symbol, + const char* nan_symbol) + : flags_(flags), + empty_string_value_(empty_string_value), + junk_string_value_(junk_string_value), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol) { + } + + // Performs the conversion. + // The output parameter 'processed_characters_count' is set to the number + // of characters that have been processed to read the number. + // Spaces than are processed with ALLOW_{LEADING|TRAILING}_SPACES are included + // in the 'processed_characters_count'. Trailing junk is never included. + double StringToDouble(const char* buffer, + int length, + int* processed_characters_count) const { + return StringToIeee(buffer, length, processed_characters_count, true); + } + + // Same as StringToDouble but reads a float. + // Note that this is not equivalent to static_cast(StringToDouble(...)) + // due to potential double-rounding. + float StringToFloat(const char* buffer, + int length, + int* processed_characters_count) const { + return static_cast(StringToIeee(buffer, length, + processed_characters_count, false)); + } + + private: + const int flags_; + const double empty_string_value_; + const double junk_string_value_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + + double StringToIeee(const char* buffer, + int length, + int* processed_characters_count, + bool read_as_double) const; + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/fast-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/fast-dtoa.h new file mode 100644 index 0000000..5f1e8ee --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/fast-dtoa.h @@ -0,0 +1,88 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FAST_DTOA_H_ +#define DOUBLE_CONVERSION_FAST_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum FastDtoaMode { + // Computes the shortest representation of the given input. The returned + // result will be the most accurate number of this length. Longer + // representations might be more accurate. + FAST_DTOA_SHORTEST, + // Same as FAST_DTOA_SHORTEST but for single-precision floats. + FAST_DTOA_SHORTEST_SINGLE, + // Computes a representation where the precision (number of digits) is + // given as input. The precision is independent of the decimal point. + FAST_DTOA_PRECISION +}; + +// FastDtoa will produce at most kFastDtoaMaximalLength digits. This does not +// include the terminating '\0' character. +static const int kFastDtoaMaximalLength = 17; +// Same for single-precision numbers. +static const int kFastDtoaMaximalSingleLength = 9; + +// Provides a decimal representation of v. +// The result should be interpreted as buffer * 10^(point - length). +// +// Precondition: +// * v must be a strictly positive finite double. +// +// Returns true if it succeeds, otherwise the result can not be trusted. +// There will be *length digits inside the buffer followed by a null terminator. +// If the function returns true and mode equals +// - FAST_DTOA_SHORTEST, then +// the parameter requested_digits is ignored. +// The result satisfies +// v == (double) (buffer * 10^(point - length)). +// The digits in the buffer are the shortest representation possible. E.g. +// if 0.099999999999 and 0.1 represent the same double then "1" is returned +// with point = 0. +// The last digit will be closest to the actual v. That is, even if several +// digits might correctly yield 'v' when read again, the buffer will contain +// the one closest to v. +// - FAST_DTOA_PRECISION, then +// the buffer contains requested_digits digits. +// the difference v - (buffer * 10^(point-length)) is closest to zero for +// all possible representations of requested_digits digits. +// If there are two values that are equally close, then FastDtoa returns +// false. +// For both modes the buffer must be large enough to hold the result. +bool FastDtoa(double d, + FastDtoaMode mode, + int requested_digits, + Vector buffer, + int* length, + int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FAST_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/fixed-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/fixed-dtoa.h new file mode 100644 index 0000000..3bdd08e --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/fixed-dtoa.h @@ -0,0 +1,56 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FIXED_DTOA_H_ +#define DOUBLE_CONVERSION_FIXED_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +// Produces digits necessary to print a given number with +// 'fractional_count' digits after the decimal point. +// The buffer must be big enough to hold the result plus one terminating null +// character. +// +// The produced digits might be too short in which case the caller has to fill +// the gaps with '0's. +// Example: FastFixedDtoa(0.001, 5, ...) is allowed to return buffer = "1", and +// decimal_point = -2. +// Halfway cases are rounded towards +/-Infinity (away from 0). The call +// FastFixedDtoa(0.15, 2, ...) thus returns buffer = "2", decimal_point = 0. +// The returned buffer may contain digits that would be truncated from the +// shortest representation of the input. +// +// This method only works for some parameters. If it can't handle the input it +// returns false. The output is null-terminated when the function succeeds. +bool FastFixedDtoa(double v, int fractional_count, + Vector buffer, int* length, int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FIXED_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/ieee.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/ieee.h new file mode 100644 index 0000000..661141d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/ieee.h @@ -0,0 +1,402 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_H_ +#define DOUBLE_CONVERSION_DOUBLE_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +// We assume that doubles and uint64_t have the same endianness. +static uint64_t double_to_uint64(double d) { return BitCast(d); } +static double uint64_to_double(uint64_t d64) { return BitCast(d64); } +static uint32_t float_to_uint32(float f) { return BitCast(f); } +static float uint32_to_float(uint32_t d32) { return BitCast(d32); } + +// Helper functions for doubles. +class Double { + public: + static const uint64_t kSignMask = UINT64_2PART_C(0x80000000, 00000000); + static const uint64_t kExponentMask = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kSignificandMask = UINT64_2PART_C(0x000FFFFF, FFFFFFFF); + static const uint64_t kHiddenBit = UINT64_2PART_C(0x00100000, 00000000); + static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. + static const int kSignificandSize = 53; + + Double() : d64_(0) {} + explicit Double(double d) : d64_(double_to_uint64(d)) {} + explicit Double(uint64_t d64) : d64_(d64) {} + explicit Double(DiyFp diy_fp) + : d64_(DiyFpToUint64(diy_fp)) {} + + // The value encoded by this Double must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // The value encoded by this Double must be strictly greater than 0. + DiyFp AsNormalizedDiyFp() const { + ASSERT(value() > 0.0); + uint64_t f = Significand(); + int e = Exponent(); + + // The current double could be a denormal. + while ((f & kHiddenBit) == 0) { + f <<= 1; + e--; + } + // Do the final shifts in one go. + f <<= DiyFp::kSignificandSize - kSignificandSize; + e -= DiyFp::kSignificandSize - kSignificandSize; + return DiyFp(f, e); + } + + // Returns the double's bit as uint64. + uint64_t AsUint64() const { + return d64_; + } + + // Returns the next greater double. Returns +infinity on input +infinity. + double NextDouble() const { + if (d64_ == kInfinity) return Double(kInfinity).value(); + if (Sign() < 0 && Significand() == 0) { + // -0.0 + return 0.0; + } + if (Sign() < 0) { + return Double(d64_ - 1).value(); + } else { + return Double(d64_ + 1).value(); + } + } + + double PreviousDouble() const { + if (d64_ == (kInfinity | kSignMask)) return -Double::Infinity(); + if (Sign() < 0) { + return Double(d64_ + 1).value(); + } else { + if (Significand() == 0) return -0.0; + return Double(d64_ - 1).value(); + } + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint64_t d64 = AsUint64(); + int biased_e = + static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint64_t Significand() const { + uint64_t d64 = AsUint64(); + uint64_t significand = d64 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the double is a denormal. + bool IsDenormal() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) == 0); + } + + int Sign() const { + uint64_t d64 = AsUint64(); + return (d64 & kSignMask) == 0? 1: -1; + } + + // Precondition: the value encoded by this Double must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Double must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint64() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + double value() const { return uint64_to_double(d64_); } + + // Returns the significand size for a given order of magnitude. + // If v = f*2^e with 2^p-1 <= f <= 2^p then p+e is v's order of magnitude. + // This function returns the number of significant binary digits v will have + // once it's encoded into a double. In almost all cases this is equal to + // kSignificandSize. The only exceptions are denormals. They start with + // leading zeroes and their effective significand-size is hence smaller. + static int SignificandSizeForOrderOfMagnitude(int order) { + if (order >= (kDenormalExponent + kSignificandSize)) { + return kSignificandSize; + } + if (order <= kDenormalExponent) return 0; + return order - kDenormalExponent; + } + + static double Infinity() { + return Double(kInfinity).value(); + } + + static double NaN() { + return Double(kNaN).value(); + } + + private: + static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0x7FF - kExponentBias; + static const uint64_t kInfinity = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kNaN = UINT64_2PART_C(0x7FF80000, 00000000); + + const uint64_t d64_; + + static uint64_t DiyFpToUint64(DiyFp diy_fp) { + uint64_t significand = diy_fp.f(); + int exponent = diy_fp.e(); + while (significand > kHiddenBit + kSignificandMask) { + significand >>= 1; + exponent++; + } + if (exponent >= kMaxExponent) { + return kInfinity; + } + if (exponent < kDenormalExponent) { + return 0; + } + while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { + significand <<= 1; + exponent--; + } + uint64_t biased_exponent; + if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { + biased_exponent = 0; + } else { + biased_exponent = static_cast(exponent + kExponentBias); + } + return (significand & kSignificandMask) | + (biased_exponent << kPhysicalSignificandSize); + } + + DISALLOW_COPY_AND_ASSIGN(Double); +}; + +class Single { + public: + static const uint32_t kSignMask = 0x80000000; + static const uint32_t kExponentMask = 0x7F800000; + static const uint32_t kSignificandMask = 0x007FFFFF; + static const uint32_t kHiddenBit = 0x00800000; + static const int kPhysicalSignificandSize = 23; // Excludes the hidden bit. + static const int kSignificandSize = 24; + + Single() : d32_(0) {} + explicit Single(float f) : d32_(float_to_uint32(f)) {} + explicit Single(uint32_t d32) : d32_(d32) {} + + // The value encoded by this Single must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // Returns the single's bit as uint64. + uint32_t AsUint32() const { + return d32_; + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint32_t d32 = AsUint32(); + int biased_e = + static_cast((d32 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint32_t Significand() const { + uint32_t d32 = AsUint32(); + uint32_t significand = d32 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the single is a denormal. + bool IsDenormal() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) == 0); + } + + int Sign() const { + uint32_t d32 = AsUint32(); + return (d32 & kSignMask) == 0? 1: -1; + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Single must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + // Precondition: the value encoded by this Single must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint32() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + float value() const { return uint32_to_float(d32_); } + + static float Infinity() { + return Single(kInfinity).value(); + } + + static float NaN() { + return Single(kNaN).value(); + } + + private: + static const int kExponentBias = 0x7F + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0xFF - kExponentBias; + static const uint32_t kInfinity = 0x7F800000; + static const uint32_t kNaN = 0x7FC00000; + + const uint32_t d32_; + + DISALLOW_COPY_AND_ASSIGN(Single); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/strtod.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/strtod.h new file mode 100644 index 0000000..ed0293b --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/strtod.h @@ -0,0 +1,45 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_STRTOD_H_ +#define DOUBLE_CONVERSION_STRTOD_H_ + +#include "utils.h" + +namespace double_conversion { + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +double Strtod(Vector buffer, int exponent); + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +float Strtof(Vector buffer, int exponent); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_STRTOD_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/utils.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/utils.h new file mode 100644 index 0000000..a7c9b42 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/DoubleConversion/double-conversion/utils.h @@ -0,0 +1,324 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_UTILS_H_ +#define DOUBLE_CONVERSION_UTILS_H_ + +#include +#include + +#include +#ifndef ASSERT +#define ASSERT(condition) \ + assert(condition); +#endif +#ifndef UNIMPLEMENTED +#define UNIMPLEMENTED() (abort()) +#endif +#ifndef UNREACHABLE +#define UNREACHABLE() (abort()) +#endif + +// Double operations detection based on target architecture. +// Linux uses a 80bit wide floating point stack on x86. This induces double +// rounding, which in turn leads to wrong results. +// An easy way to test if the floating-point operations are correct is to +// evaluate: 89255.0/1e22. If the floating-point stack is 64 bits wide then +// the result is equal to 89255e-22. +// The best way to test this, is to create a division-function and to compare +// the output of the division with the expected result. (Inlining must be +// disabled.) +// On Linux,x86 89255e-22 != Div_double(89255.0/1e22) +#if defined(_M_X64) || defined(__x86_64__) || \ + defined(__ARMEL__) || defined(__avr32__) || \ + defined(__hppa__) || defined(__ia64__) || \ + defined(__mips__) || \ + defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || \ + defined(__AARCH64EL__) +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#elif defined(__mc68000__) +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#elif defined(_M_IX86) || defined(__i386__) || defined(__i386) +#if defined(_WIN32) +// Windows uses a 64bit wide floating point stack. +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#else +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#endif // _WIN32 +#else +#error Target architecture was not detected as supported by Double-Conversion. +#endif + +#if defined(__GNUC__) +#define DOUBLE_CONVERSION_UNUSED __attribute__((unused)) +#else +#define DOUBLE_CONVERSION_UNUSED +#endif + +#if defined(_WIN32) && !defined(__MINGW32__) + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; // NOLINT +typedef unsigned short uint16_t; // NOLINT +typedef int int32_t; +typedef unsigned int uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +// intptr_t and friends are defined in crtdefs.h through stdio.h. + +#else + +#include + +#endif + +// The following macro works on both 32 and 64-bit platforms. +// Usage: instead of writing 0x1234567890123456 +// write UINT64_2PART_C(0x12345678,90123456); +#define UINT64_2PART_C(a, b) (((static_cast(a) << 32) + 0x##b##u)) + + +// The expression ARRAY_SIZE(a) is a compile-time constant of type +// size_t which represents the number of elements of the given +// array. You should only use ARRAY_SIZE on statically allocated +// arrays. +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) \ + ((sizeof(a) / sizeof(*(a))) / \ + static_cast(!(sizeof(a) % sizeof(*(a))))) +#endif + +// A macro to disallow the evil copy constructor and operator= functions +// This should be used in the private: declarations for a class +#ifndef DISALLOW_COPY_AND_ASSIGN +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) +#endif + +// A macro to disallow all the implicit constructors, namely the +// default constructor, copy constructor and operator= functions. +// +// This should be used in the private: declarations for a class +// that wants to prevent anyone from instantiating it. This is +// especially useful for classes containing only static methods. +#ifndef DISALLOW_IMPLICIT_CONSTRUCTORS +#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName(); \ + DISALLOW_COPY_AND_ASSIGN(TypeName) +#endif + +namespace double_conversion { + +static const int kCharSize = sizeof(char); + +// Returns the maximum of the two parameters. +template +static T Max(T a, T b) { + return a < b ? b : a; +} + + +// Returns the minimum of the two parameters. +template +static T Min(T a, T b) { + return a < b ? a : b; +} + + +inline int StrLength(const char* string) { + size_t length = strlen(string); + ASSERT(length == static_cast(static_cast(length))); + return static_cast(length); +} + +// This is a simplified version of V8's Vector class. +template +class Vector { + public: + Vector() : start_(NULL), length_(0) {} + Vector(T* data, int length) : start_(data), length_(length) { + ASSERT(length == 0 || (length > 0 && data != NULL)); + } + + // Returns a vector using the same backing storage as this one, + // spanning from and including 'from', to but not including 'to'. + Vector SubVector(int from, int to) { + ASSERT(to <= length_); + ASSERT(from < to); + ASSERT(0 <= from); + return Vector(start() + from, to - from); + } + + // Returns the length of the vector. + int length() const { return length_; } + + // Returns whether or not the vector is empty. + bool is_empty() const { return length_ == 0; } + + // Returns the pointer to the start of the data in the vector. + T* start() const { return start_; } + + // Access individual vector elements - checks bounds in debug mode. + T& operator[](int index) const { + ASSERT(0 <= index && index < length_); + return start_[index]; + } + + T& first() { return start_[0]; } + + T& last() { return start_[length_ - 1]; } + + private: + T* start_; + int length_; +}; + + +// Helper class for building result strings in a character buffer. The +// purpose of the class is to use safe operations that checks the +// buffer bounds on all operations in debug mode. +class StringBuilder { + public: + StringBuilder(char* buffer, int size) + : buffer_(buffer, size), position_(0) { } + + ~StringBuilder() { if (!is_finalized()) Finalize(); } + + int size() const { return buffer_.length(); } + + // Get the current position in the builder. + int position() const { + ASSERT(!is_finalized()); + return position_; + } + + // Reset the position. + void Reset() { position_ = 0; } + + // Add a single character to the builder. It is not allowed to add + // 0-characters; use the Finalize() method to terminate the string + // instead. + void AddCharacter(char c) { + ASSERT(c != '\0'); + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_++] = c; + } + + // Add an entire string to the builder. Uses strlen() internally to + // compute the length of the input string. + void AddString(const char* s) { + AddSubstring(s, StrLength(s)); + } + + // Add the first 'n' characters of the given string 's' to the + // builder. The input string must have enough characters. + void AddSubstring(const char* s, int n) { + ASSERT(!is_finalized() && position_ + n < buffer_.length()); + ASSERT(static_cast(n) <= strlen(s)); + memmove(&buffer_[position_], s, n * kCharSize); + position_ += n; + } + + + // Add character padding to the builder. If count is non-positive, + // nothing is added to the builder. + void AddPadding(char c, int count) { + for (int i = 0; i < count; i++) { + AddCharacter(c); + } + } + + // Finalize the string by 0-terminating it and returning the buffer. + char* Finalize() { + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_] = '\0'; + // Make sure nobody managed to add a 0-character to the + // buffer while building the string. + ASSERT(strlen(buffer_.start()) == static_cast(position_)); + position_ = -1; + ASSERT(is_finalized()); + return buffer_.start(); + } + + private: + Vector buffer_; + int position_; + + bool is_finalized() const { return position_ < 0; } + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); +}; + +// The type-based aliasing rule allows the compiler to assume that pointers of +// different types (for some definition of different) never alias each other. +// Thus the following code does not work: +// +// float f = foo(); +// int fbits = *(int*)(&f); +// +// The compiler 'knows' that the int pointer can't refer to f since the types +// don't match, so the compiler may cache f in a register, leaving random data +// in fbits. Using C++ style casts makes no difference, however a pointer to +// char data is assumed to alias any other pointer. This is the 'memcpy +// exception'. +// +// Bit_cast uses the memcpy exception to move the bits from a variable of one +// type of a variable of another type. Of course the end result is likely to +// be implementation dependent. Most compilers (gcc-4.2 and MSVC 2005) +// will completely optimize BitCast away. +// +// There is an additional use for BitCast. +// Recent gccs will warn when they see casts that may result in breakage due to +// the type-based aliasing rule. If you have checked that there is no breakage +// you can use BitCast to cast one pointer type to another. This confuses gcc +// enough that it can no longer see that you have cast one pointer type to +// another thus avoiding the warning. +template +inline Dest BitCast(const Source& source) { + // Compile time assertion: sizeof(Dest) == sizeof(Source) + // A compile error here means your Dest and Source have different sizes. + DOUBLE_CONVERSION_UNUSED + typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; + + Dest dest; + memmove(&dest, &source, sizeof(dest)); + return dest; +} + +template +inline Dest BitCast(Source* source) { + return BitCast(reinterpret_cast(source)); +} + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_UTILS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/bignum-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/bignum-dtoa.h new file mode 100644 index 0000000..34b9619 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/bignum-dtoa.h @@ -0,0 +1,84 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_DTOA_H_ +#define DOUBLE_CONVERSION_BIGNUM_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum BignumDtoaMode { + // Return the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate but + // correct) 0.3. + BIGNUM_DTOA_SHORTEST, + // Same as BIGNUM_DTOA_SHORTEST but for single-precision floats. + BIGNUM_DTOA_SHORTEST_SINGLE, + // Return a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + BIGNUM_DTOA_FIXED, + // Return a fixed number of digits, no matter what the exponent is. + BIGNUM_DTOA_PRECISION +}; + +// Converts the given double 'v' to ascii. +// The result should be interpreted as buffer * 10^(point-length). +// The buffer will be null-terminated. +// +// The input v must be > 0 and different from NaN, and Infinity. +// +// The output depends on the given mode: +// - SHORTEST: produce the least amount of digits for which the internal +// identity requirement is still satisfied. If the digits are printed +// (together with the correct exponent) then reading this number will give +// 'v' again. The buffer will choose the representation that is closest to +// 'v'. If there are two at the same distance, than the number is round up. +// In this mode the 'requested_digits' parameter is ignored. +// - FIXED: produces digits necessary to print a given number with +// 'requested_digits' digits after the decimal point. The produced digits +// might be too short in which case the caller has to fill the gaps with '0's. +// Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. +// Halfway cases are rounded up. The call toFixed(0.15, 2) thus returns +// buffer="2", point=0. +// Note: the length of the returned buffer has no meaning wrt the significance +// of its digits. That is, just because it contains '0's does not mean that +// any other digit would not satisfy the internal identity requirement. +// - PRECISION: produces 'requested_digits' where the first digit is not '0'. +// Even though the length of produced digits usually equals +// 'requested_digits', the function is allowed to return fewer digits, in +// which case the caller has to fill the missing digits with '0's. +// Halfway cases are again rounded up. +// 'BignumDtoa' expects the given buffer to be big enough to hold all digits +// and a terminating null-character. +void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, + Vector buffer, int* length, int* point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/bignum.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/bignum.h new file mode 100644 index 0000000..5ec3544 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/bignum.h @@ -0,0 +1,145 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_H_ +#define DOUBLE_CONVERSION_BIGNUM_H_ + +#include "utils.h" + +namespace double_conversion { + +class Bignum { + public: + // 3584 = 128 * 28. We can represent 2^3584 > 10^1000 accurately. + // This bignum can encode much bigger numbers, since it contains an + // exponent. + static const int kMaxSignificantBits = 3584; + + Bignum(); + void AssignUInt16(uint16_t value); + void AssignUInt64(uint64_t value); + void AssignBignum(const Bignum& other); + + void AssignDecimalString(Vector value); + void AssignHexString(Vector value); + + void AssignPowerUInt16(uint16_t base, int exponent); + + void AddUInt16(uint16_t operand); + void AddUInt64(uint64_t operand); + void AddBignum(const Bignum& other); + // Precondition: this >= other. + void SubtractBignum(const Bignum& other); + + void Square(); + void ShiftLeft(int shift_amount); + void MultiplyByUInt32(uint32_t factor); + void MultiplyByUInt64(uint64_t factor); + void MultiplyByPowerOfTen(int exponent); + void Times10() { return MultiplyByUInt32(10); } + // Pseudocode: + // int result = this / other; + // this = this % other; + // In the worst case this function is in O(this/other). + uint16_t DivideModuloIntBignum(const Bignum& other); + + bool ToHexString(char* buffer, int buffer_size) const; + + // Returns + // -1 if a < b, + // 0 if a == b, and + // +1 if a > b. + static int Compare(const Bignum& a, const Bignum& b); + static bool Equal(const Bignum& a, const Bignum& b) { + return Compare(a, b) == 0; + } + static bool LessEqual(const Bignum& a, const Bignum& b) { + return Compare(a, b) <= 0; + } + static bool Less(const Bignum& a, const Bignum& b) { + return Compare(a, b) < 0; + } + // Returns Compare(a + b, c); + static int PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c); + // Returns a + b == c + static bool PlusEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) == 0; + } + // Returns a + b <= c + static bool PlusLessEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) <= 0; + } + // Returns a + b < c + static bool PlusLess(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) < 0; + } + private: + typedef uint32_t Chunk; + typedef uint64_t DoubleChunk; + + static const int kChunkSize = sizeof(Chunk) * 8; + static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8; + // With bigit size of 28 we loose some bits, but a double still fits easily + // into two chunks, and more importantly we can use the Comba multiplication. + static const int kBigitSize = 28; + static const Chunk kBigitMask = (1 << kBigitSize) - 1; + // Every instance allocates kBigitLength chunks on the stack. Bignums cannot + // grow. There are no checks if the stack-allocated space is sufficient. + static const int kBigitCapacity = kMaxSignificantBits / kBigitSize; + + void EnsureCapacity(int size) { + if (size > kBigitCapacity) { + UNREACHABLE(); + } + } + void Align(const Bignum& other); + void Clamp(); + bool IsClamped() const; + void Zero(); + // Requires this to have enough capacity (no tests done). + // Updates used_digits_ if necessary. + // shift_amount must be < kBigitSize. + void BigitsShiftLeft(int shift_amount); + // BigitLength includes the "hidden" digits encoded in the exponent. + int BigitLength() const { return used_digits_ + exponent_; } + Chunk BigitAt(int index) const; + void SubtractTimes(const Bignum& other, int factor); + + Chunk bigits_buffer_[kBigitCapacity]; + // A vector backed by bigits_buffer_. This way accesses to the array are + // checked for out-of-bounds errors. + Vector bigits_; + int used_digits_; + // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize). + int exponent_; + + DISALLOW_COPY_AND_ASSIGN(Bignum); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/cached-powers.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/cached-powers.h new file mode 100644 index 0000000..61a5061 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/cached-powers.h @@ -0,0 +1,64 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_CACHED_POWERS_H_ +#define DOUBLE_CONVERSION_CACHED_POWERS_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +class PowersOfTenCache { + public: + + // Not all powers of ten are cached. The decimal exponent of two neighboring + // cached numbers will differ by kDecimalExponentDistance. + static const int kDecimalExponentDistance; + + static const int kMinDecimalExponent; + static const int kMaxDecimalExponent; + + // Returns a cached power-of-ten with a binary exponent in the range + // [min_exponent; max_exponent] (boundaries included). + static void GetCachedPowerForBinaryExponentRange(int min_exponent, + int max_exponent, + DiyFp* power, + int* decimal_exponent); + + // Returns a cached power of ten x ~= 10^k such that + // k <= decimal_exponent < k + kCachedPowersDecimalDistance. + // The given decimal_exponent must satisfy + // kMinDecimalExponent <= requested_exponent, and + // requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance. + static void GetCachedPowerForDecimalExponent(int requested_exponent, + DiyFp* power, + int* found_exponent); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_CACHED_POWERS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/diy-fp.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/diy-fp.h new file mode 100644 index 0000000..9dcf8fb --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/diy-fp.h @@ -0,0 +1,118 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DIY_FP_H_ +#define DOUBLE_CONVERSION_DIY_FP_H_ + +#include "utils.h" + +namespace double_conversion { + +// This "Do It Yourself Floating Point" class implements a floating-point number +// with a uint64 significand and an int exponent. Normalized DiyFp numbers will +// have the most significant bit of the significand set. +// Multiplication and Subtraction do not normalize their results. +// DiyFp are not designed to contain special doubles (NaN and Infinity). +class DiyFp { + public: + static const int kSignificandSize = 64; + + DiyFp() : f_(0), e_(0) {} + DiyFp(uint64_t f, int e) : f_(f), e_(e) {} + + // this = this - other. + // The exponents of both numbers must be the same and the significand of this + // must be bigger than the significand of other. + // The result will not be normalized. + void Subtract(const DiyFp& other) { + ASSERT(e_ == other.e_); + ASSERT(f_ >= other.f_); + f_ -= other.f_; + } + + // Returns a - b. + // The exponents of both numbers must be the same and this must be bigger + // than other. The result will not be normalized. + static DiyFp Minus(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Subtract(b); + return result; + } + + + // this = this * other. + void Multiply(const DiyFp& other); + + // returns a * b; + static DiyFp Times(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Multiply(b); + return result; + } + + void Normalize() { + ASSERT(f_ != 0); + uint64_t f = f_; + int e = e_; + + // This method is mainly called for normalizing boundaries. In general + // boundaries need to be shifted by 10 bits. We thus optimize for this case. + const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000); + while ((f & k10MSBits) == 0) { + f <<= 10; + e -= 10; + } + while ((f & kUint64MSB) == 0) { + f <<= 1; + e--; + } + f_ = f; + e_ = e; + } + + static DiyFp Normalize(const DiyFp& a) { + DiyFp result = a; + result.Normalize(); + return result; + } + + uint64_t f() const { return f_; } + int e() const { return e_; } + + void set_f(uint64_t new_value) { f_ = new_value; } + void set_e(int new_value) { e_ = new_value; } + + private: + static const uint64_t kUint64MSB = UINT64_2PART_C(0x80000000, 00000000); + + uint64_t f_; + int e_; +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DIY_FP_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/double-conversion.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/double-conversion.h new file mode 100644 index 0000000..1c3387d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/double-conversion.h @@ -0,0 +1,536 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ +#define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ + +#include "utils.h" + +namespace double_conversion { + +class DoubleToStringConverter { + public: + // When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint + // or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the + // function returns false. + static const int kMaxFixedDigitsBeforePoint = 60; + static const int kMaxFixedDigitsAfterPoint = 60; + + // When calling ToExponential with a requested_digits + // parameter > kMaxExponentialDigits then the function returns false. + static const int kMaxExponentialDigits = 120; + + // When calling ToPrecision with a requested_digits + // parameter < kMinPrecisionDigits or requested_digits > kMaxPrecisionDigits + // then the function returns false. + static const int kMinPrecisionDigits = 1; + static const int kMaxPrecisionDigits = 120; + + enum Flags { + NO_FLAGS = 0, + EMIT_POSITIVE_EXPONENT_SIGN = 1, + EMIT_TRAILING_DECIMAL_POINT = 2, + EMIT_TRAILING_ZERO_AFTER_POINT = 4, + UNIQUE_ZERO = 8 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - EMIT_POSITIVE_EXPONENT_SIGN: when the number is converted into exponent + // form, emits a '+' for positive exponents. Example: 1.2e+2. + // - EMIT_TRAILING_DECIMAL_POINT: when the input number is an integer and is + // converted into decimal format then a trailing decimal point is appended. + // Example: 2345.0 is converted to "2345.". + // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point + // emits a trailing '0'-character. This flag requires the + // EXMIT_TRAILING_DECIMAL_POINT flag. + // Example: 2345.0 is converted to "2345.0". + // - UNIQUE_ZERO: "-0.0" is converted to "0.0". + // + // Infinity symbol and nan_symbol provide the string representation for these + // special values. If the string is NULL and the special value is encountered + // then the conversion functions return false. + // + // The exponent_character is used in exponential representations. It is + // usually 'e' or 'E'. + // + // When converting to the shortest representation the converter will + // represent input numbers in decimal format if they are in the interval + // [10^decimal_in_shortest_low; 10^decimal_in_shortest_high[ + // (lower boundary included, greater boundary excluded). + // Example: with decimal_in_shortest_low = -6 and + // decimal_in_shortest_high = 21: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // When converting to precision mode the converter may add + // max_leading_padding_zeroes before returning the number in exponential + // format. + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + DoubleToStringConverter(int flags, + const char* infinity_symbol, + const char* nan_symbol, + char exponent_character, + int decimal_in_shortest_low, + int decimal_in_shortest_high, + int max_leading_padding_zeroes_in_precision_mode, + int max_trailing_padding_zeroes_in_precision_mode) + : flags_(flags), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol), + exponent_character_(exponent_character), + decimal_in_shortest_low_(decimal_in_shortest_low), + decimal_in_shortest_high_(decimal_in_shortest_high), + max_leading_padding_zeroes_in_precision_mode_( + max_leading_padding_zeroes_in_precision_mode), + max_trailing_padding_zeroes_in_precision_mode_( + max_trailing_padding_zeroes_in_precision_mode) { + // When 'trailing zero after the point' is set, then 'trailing point' + // must be set too. + ASSERT(((flags & EMIT_TRAILING_DECIMAL_POINT) != 0) || + !((flags & EMIT_TRAILING_ZERO_AFTER_POINT) != 0)); + } + + // Returns a converter following the EcmaScript specification. + static const DoubleToStringConverter& EcmaScriptConverter(); + + // Computes the shortest string of digits that correctly represent the input + // number. Depending on decimal_in_shortest_low and decimal_in_shortest_high + // (see constructor) it then either returns a decimal representation, or an + // exponential representation. + // Example with decimal_in_shortest_low = -6, + // decimal_in_shortest_high = 21, + // EMIT_POSITIVE_EXPONENT_SIGN activated, and + // EMIT_TRAILING_DECIMAL_POINT deactived: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // Note: the conversion may round the output if the returned string + // is accurate enough to uniquely identify the input-number. + // For example the most precise representation of the double 9e59 equals + // "899999999999999918767229449717619953810131273674690656206848", but + // the converter will return the shorter (but still correct) "9e59". + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except when the input value is special and no infinity_symbol or + // nan_symbol has been given to the constructor. + bool ToShortest(double value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST); + } + + // Same as ToShortest, but for single-precision floats. + bool ToShortestSingle(float value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST_SINGLE); + } + + + // Computes a decimal representation with a fixed number of digits after the + // decimal point. The last emitted digit is rounded. + // + // Examples: + // ToFixed(3.12, 1) -> "3.1" + // ToFixed(3.1415, 3) -> "3.142" + // ToFixed(1234.56789, 4) -> "1234.5679" + // ToFixed(1.23, 5) -> "1.23000" + // ToFixed(0.1, 4) -> "0.1000" + // ToFixed(1e30, 2) -> "1000000000000000019884624838656.00" + // ToFixed(0.1, 30) -> "0.100000000000000005551115123126" + // ToFixed(0.1, 17) -> "0.10000000000000001" + // + // If requested_digits equals 0, then the tail of the result depends on + // the EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples, for requested_digits == 0, + // let EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT be + // - false and false: then 123.45 -> 123 + // 0.678 -> 1 + // - true and false: then 123.45 -> 123. + // 0.678 -> 1. + // - true and true: then 123.45 -> 123.0 + // 0.678 -> 1.0 + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'value' > 10^kMaxFixedDigitsBeforePoint, or + // - 'requested_digits' > kMaxFixedDigitsAfterPoint. + // The last two conditions imply that the result will never contain more than + // 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters + // (one additional character for the sign, and one for the decimal point). + bool ToFixed(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes a representation in exponential format with requested_digits + // after the decimal point. The last emitted digit is rounded. + // If requested_digits equals -1, then the shortest exponential representation + // is computed. + // + // Examples with EMIT_POSITIVE_EXPONENT_SIGN deactivated, and + // exponent_character set to 'e'. + // ToExponential(3.12, 1) -> "3.1e0" + // ToExponential(5.0, 3) -> "5.000e0" + // ToExponential(0.001, 2) -> "1.00e-3" + // ToExponential(3.1415, -1) -> "3.1415e0" + // ToExponential(3.1415, 4) -> "3.1415e0" + // ToExponential(3.1415, 3) -> "3.142e0" + // ToExponential(123456789000000, 3) -> "1.235e14" + // ToExponential(1000000000000000019884624838656.0, -1) -> "1e30" + // ToExponential(1000000000000000019884624838656.0, 32) -> + // "1.00000000000000001988462483865600e30" + // ToExponential(1234, 0) -> "1e3" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'requested_digits' > kMaxExponentialDigits. + // The last condition implies that the result will never contain more than + // kMaxExponentialDigits + 8 characters (the sign, the digit before the + // decimal point, the decimal point, the exponent character, the + // exponent's sign, and at most 3 exponent digits). + bool ToExponential(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes 'precision' leading digits of the given 'value' and returns them + // either in exponential or decimal format, depending on + // max_{leading|trailing}_padding_zeroes_in_precision_mode (given to the + // constructor). + // The last computed digit is rounded. + // + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 3, and no + // EMIT_TRAILING_ZERO_AFTER_POINT: + // ToPrecision(123450.0, 6) -> "123450" + // ToPrecision(123450.0, 5) -> "123450" + // ToPrecision(123450.0, 4) -> "123500" + // ToPrecision(123450.0, 3) -> "123000" + // ToPrecision(123450.0, 2) -> "1.2e5" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - precision < kMinPericisionDigits + // - precision > kMaxPrecisionDigits + // The last condition implies that the result will never contain more than + // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the + // exponent character, the exponent's sign, and at most 3 exponent digits). + bool ToPrecision(double value, + int precision, + StringBuilder* result_builder) const; + + enum DtoaMode { + // Produce the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate + // but correct) 0.3. + SHORTEST, + // Same as SHORTEST, but for single-precision floats. + SHORTEST_SINGLE, + // Produce a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + FIXED, + // Fixed number of digits (independent of the decimal point). + PRECISION + }; + + // The maximal number of digits that are needed to emit a double in base 10. + // A higher precision can be achieved by using more digits, but the shortest + // accurate representation of any double will never use more digits than + // kBase10MaximalLength. + // Note that DoubleToAscii null-terminates its input. So the given buffer + // should be at least kBase10MaximalLength + 1 characters long. + static const int kBase10MaximalLength = 17; + + // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or + // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v' + // after it has been casted to a single-precision float. That is, in this + // mode static_cast(v) must not be NaN, +Infinity or -Infinity. + // + // The result should be interpreted as buffer * 10^(point-length). + // + // The output depends on the given mode: + // - SHORTEST: produce the least amount of digits for which the internal + // identity requirement is still satisfied. If the digits are printed + // (together with the correct exponent) then reading this number will give + // 'v' again. The buffer will choose the representation that is closest to + // 'v'. If there are two at the same distance, than the one farther away + // from 0 is chosen (halfway cases - ending with 5 - are rounded up). + // In this mode the 'requested_digits' parameter is ignored. + // - SHORTEST_SINGLE: same as SHORTEST but with single-precision. + // - FIXED: produces digits necessary to print a given number with + // 'requested_digits' digits after the decimal point. The produced digits + // might be too short in which case the caller has to fill the remainder + // with '0's. + // Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. + // Halfway cases are rounded towards +/-Infinity (away from 0). The call + // toFixed(0.15, 2) thus returns buffer="2", point=0. + // The returned buffer may contain digits that would be truncated from the + // shortest representation of the input. + // - PRECISION: produces 'requested_digits' where the first digit is not '0'. + // Even though the length of produced digits usually equals + // 'requested_digits', the function is allowed to return fewer digits, in + // which case the caller has to fill the missing digits with '0's. + // Halfway cases are again rounded away from 0. + // DoubleToAscii expects the given buffer to be big enough to hold all + // digits and a terminating null-character. In SHORTEST-mode it expects a + // buffer of at least kBase10MaximalLength + 1. In all other modes the + // requested_digits parameter and the padding-zeroes limit the size of the + // output. Don't forget the decimal point, the exponent character and the + // terminating null-character when computing the maximal output size. + // The given length is only used in debug mode to ensure the buffer is big + // enough. + static void DoubleToAscii(double v, + DtoaMode mode, + int requested_digits, + char* buffer, + int buffer_length, + bool* sign, + int* length, + int* point); + + private: + // Implementation for ToShortest and ToShortestSingle. + bool ToShortestIeeeNumber(double value, + StringBuilder* result_builder, + DtoaMode mode) const; + + // If the value is a special value (NaN or Infinity) constructs the + // corresponding string using the configured infinity/nan-symbol. + // If either of them is NULL or the value is not special then the + // function returns false. + bool HandleSpecialValues(double value, StringBuilder* result_builder) const; + // Constructs an exponential representation (i.e. 1.234e56). + // The given exponent assumes a decimal point after the first decimal digit. + void CreateExponentialRepresentation(const char* decimal_digits, + int length, + int exponent, + StringBuilder* result_builder) const; + // Creates a decimal representation (i.e 1234.5678). + void CreateDecimalRepresentation(const char* decimal_digits, + int length, + int decimal_point, + int digits_after_point, + StringBuilder* result_builder) const; + + const int flags_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + const char exponent_character_; + const int decimal_in_shortest_low_; + const int decimal_in_shortest_high_; + const int max_leading_padding_zeroes_in_precision_mode_; + const int max_trailing_padding_zeroes_in_precision_mode_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter); +}; + + +class StringToDoubleConverter { + public: + // Enumeration for allowing octals and ignoring junk when converting + // strings to numbers. + enum Flags { + NO_FLAGS = 0, + ALLOW_HEX = 1, + ALLOW_OCTALS = 2, + ALLOW_TRAILING_JUNK = 4, + ALLOW_LEADING_SPACES = 8, + ALLOW_TRAILING_SPACES = 16, + ALLOW_SPACES_AFTER_SIGN = 32 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - ALLOW_HEX: recognizes the prefix "0x". Hex numbers may only be integers. + // Ex: StringToDouble("0x1234") -> 4660.0 + // In StringToDouble("0x1234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // With this flag "0x" is a junk-string. Even with ALLOW_TRAILING_JUNK, + // the string will not be parsed as "0" followed by junk. + // + // - ALLOW_OCTALS: recognizes the prefix "0" for octals: + // If a sequence of octal digits starts with '0', then the number is + // read as octal integer. Octal numbers may only be integers. + // Ex: StringToDouble("01234") -> 668.0 + // StringToDouble("012349") -> 12349.0 // Not a sequence of octal + // // digits. + // In StringToDouble("01234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // In StringToDouble("01234e56") the characters "e56" are trailing + // junk, too. + // - ALLOW_TRAILING_JUNK: ignore trailing characters that are not part of + // a double literal. + // - ALLOW_LEADING_SPACES: skip over leading spaces. + // - ALLOW_TRAILING_SPACES: ignore trailing spaces. + // - ALLOW_SPACES_AFTER_SIGN: ignore spaces after the sign. + // Ex: StringToDouble("- 123.2") -> -123.2. + // StringToDouble("+ 123.2") -> 123.2 + // + // empty_string_value is returned when an empty string is given as input. + // If ALLOW_LEADING_SPACES or ALLOW_TRAILING_SPACES are set, then a string + // containing only spaces is converted to the 'empty_string_value', too. + // + // junk_string_value is returned when + // a) ALLOW_TRAILING_JUNK is not set, and a junk character (a character not + // part of a double-literal) is found. + // b) ALLOW_TRAILING_JUNK is set, but the string does not start with a + // double literal. + // + // infinity_symbol and nan_symbol are strings that are used to detect + // inputs that represent infinity and NaN. They can be null, in which case + // they are ignored. + // The conversion routine first reads any possible signs. Then it compares the + // following character of the input-string with the first character of + // the infinity, and nan-symbol. If either matches, the function assumes, that + // a match has been found, and expects the following input characters to match + // the remaining characters of the special-value symbol. + // This means that the following restrictions apply to special-value symbols: + // - they must not start with signs ('+', or '-'), + // - they must not have the same first character. + // - they must not start with digits. + // + // Examples: + // flags = ALLOW_HEX | ALLOW_TRAILING_JUNK, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = "infinity", + // nan_symbol = "nan": + // StringToDouble("0x1234") -> 4660.0. + // StringToDouble("0x1234K") -> 4660.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> NaN // junk_string_value. + // StringToDouble(" 1") -> NaN // junk_string_value. + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("-123.45") -> -123.45. + // StringToDouble("--123.45") -> NaN // junk_string_value. + // StringToDouble("123e45") -> 123e45. + // StringToDouble("123E45") -> 123e45. + // StringToDouble("123e+45") -> 123e45. + // StringToDouble("123E-45") -> 123e-45. + // StringToDouble("123e") -> 123.0 // trailing junk ignored. + // StringToDouble("123e-") -> 123.0 // trailing junk ignored. + // StringToDouble("+NaN") -> NaN // NaN string literal. + // StringToDouble("-infinity") -> -inf. // infinity literal. + // StringToDouble("Infinity") -> NaN // junk_string_value. + // + // flags = ALLOW_OCTAL | ALLOW_LEADING_SPACES, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = NULL, + // nan_symbol = NULL: + // StringToDouble("0x1234") -> NaN // junk_string_value. + // StringToDouble("01234") -> 668.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> 0.0 // empty_string_value. + // StringToDouble(" 1") -> 1.0 + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("0123e45") -> NaN // junk_string_value. + // StringToDouble("01239E45") -> 1239e45. + // StringToDouble("-infinity") -> NaN // junk_string_value. + // StringToDouble("NaN") -> NaN // junk_string_value. + StringToDoubleConverter(int flags, + double empty_string_value, + double junk_string_value, + const char* infinity_symbol, + const char* nan_symbol) + : flags_(flags), + empty_string_value_(empty_string_value), + junk_string_value_(junk_string_value), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol) { + } + + // Performs the conversion. + // The output parameter 'processed_characters_count' is set to the number + // of characters that have been processed to read the number. + // Spaces than are processed with ALLOW_{LEADING|TRAILING}_SPACES are included + // in the 'processed_characters_count'. Trailing junk is never included. + double StringToDouble(const char* buffer, + int length, + int* processed_characters_count) const { + return StringToIeee(buffer, length, processed_characters_count, true); + } + + // Same as StringToDouble but reads a float. + // Note that this is not equivalent to static_cast(StringToDouble(...)) + // due to potential double-rounding. + float StringToFloat(const char* buffer, + int length, + int* processed_characters_count) const { + return static_cast(StringToIeee(buffer, length, + processed_characters_count, false)); + } + + private: + const int flags_; + const double empty_string_value_; + const double junk_string_value_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + + double StringToIeee(const char* buffer, + int length, + int* processed_characters_count, + bool read_as_double) const; + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/fast-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/fast-dtoa.h new file mode 100644 index 0000000..5f1e8ee --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/fast-dtoa.h @@ -0,0 +1,88 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FAST_DTOA_H_ +#define DOUBLE_CONVERSION_FAST_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum FastDtoaMode { + // Computes the shortest representation of the given input. The returned + // result will be the most accurate number of this length. Longer + // representations might be more accurate. + FAST_DTOA_SHORTEST, + // Same as FAST_DTOA_SHORTEST but for single-precision floats. + FAST_DTOA_SHORTEST_SINGLE, + // Computes a representation where the precision (number of digits) is + // given as input. The precision is independent of the decimal point. + FAST_DTOA_PRECISION +}; + +// FastDtoa will produce at most kFastDtoaMaximalLength digits. This does not +// include the terminating '\0' character. +static const int kFastDtoaMaximalLength = 17; +// Same for single-precision numbers. +static const int kFastDtoaMaximalSingleLength = 9; + +// Provides a decimal representation of v. +// The result should be interpreted as buffer * 10^(point - length). +// +// Precondition: +// * v must be a strictly positive finite double. +// +// Returns true if it succeeds, otherwise the result can not be trusted. +// There will be *length digits inside the buffer followed by a null terminator. +// If the function returns true and mode equals +// - FAST_DTOA_SHORTEST, then +// the parameter requested_digits is ignored. +// The result satisfies +// v == (double) (buffer * 10^(point - length)). +// The digits in the buffer are the shortest representation possible. E.g. +// if 0.099999999999 and 0.1 represent the same double then "1" is returned +// with point = 0. +// The last digit will be closest to the actual v. That is, even if several +// digits might correctly yield 'v' when read again, the buffer will contain +// the one closest to v. +// - FAST_DTOA_PRECISION, then +// the buffer contains requested_digits digits. +// the difference v - (buffer * 10^(point-length)) is closest to zero for +// all possible representations of requested_digits digits. +// If there are two values that are equally close, then FastDtoa returns +// false. +// For both modes the buffer must be large enough to hold the result. +bool FastDtoa(double d, + FastDtoaMode mode, + int requested_digits, + Vector buffer, + int* length, + int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FAST_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/fixed-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/fixed-dtoa.h new file mode 100644 index 0000000..3bdd08e --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/fixed-dtoa.h @@ -0,0 +1,56 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FIXED_DTOA_H_ +#define DOUBLE_CONVERSION_FIXED_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +// Produces digits necessary to print a given number with +// 'fractional_count' digits after the decimal point. +// The buffer must be big enough to hold the result plus one terminating null +// character. +// +// The produced digits might be too short in which case the caller has to fill +// the gaps with '0's. +// Example: FastFixedDtoa(0.001, 5, ...) is allowed to return buffer = "1", and +// decimal_point = -2. +// Halfway cases are rounded towards +/-Infinity (away from 0). The call +// FastFixedDtoa(0.15, 2, ...) thus returns buffer = "2", decimal_point = 0. +// The returned buffer may contain digits that would be truncated from the +// shortest representation of the input. +// +// This method only works for some parameters. If it can't handle the input it +// returns false. The output is null-terminated when the function succeeds. +bool FastFixedDtoa(double v, int fractional_count, + Vector buffer, int* length, int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FIXED_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/ieee.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/ieee.h new file mode 100644 index 0000000..661141d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/ieee.h @@ -0,0 +1,402 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_H_ +#define DOUBLE_CONVERSION_DOUBLE_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +// We assume that doubles and uint64_t have the same endianness. +static uint64_t double_to_uint64(double d) { return BitCast(d); } +static double uint64_to_double(uint64_t d64) { return BitCast(d64); } +static uint32_t float_to_uint32(float f) { return BitCast(f); } +static float uint32_to_float(uint32_t d32) { return BitCast(d32); } + +// Helper functions for doubles. +class Double { + public: + static const uint64_t kSignMask = UINT64_2PART_C(0x80000000, 00000000); + static const uint64_t kExponentMask = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kSignificandMask = UINT64_2PART_C(0x000FFFFF, FFFFFFFF); + static const uint64_t kHiddenBit = UINT64_2PART_C(0x00100000, 00000000); + static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. + static const int kSignificandSize = 53; + + Double() : d64_(0) {} + explicit Double(double d) : d64_(double_to_uint64(d)) {} + explicit Double(uint64_t d64) : d64_(d64) {} + explicit Double(DiyFp diy_fp) + : d64_(DiyFpToUint64(diy_fp)) {} + + // The value encoded by this Double must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // The value encoded by this Double must be strictly greater than 0. + DiyFp AsNormalizedDiyFp() const { + ASSERT(value() > 0.0); + uint64_t f = Significand(); + int e = Exponent(); + + // The current double could be a denormal. + while ((f & kHiddenBit) == 0) { + f <<= 1; + e--; + } + // Do the final shifts in one go. + f <<= DiyFp::kSignificandSize - kSignificandSize; + e -= DiyFp::kSignificandSize - kSignificandSize; + return DiyFp(f, e); + } + + // Returns the double's bit as uint64. + uint64_t AsUint64() const { + return d64_; + } + + // Returns the next greater double. Returns +infinity on input +infinity. + double NextDouble() const { + if (d64_ == kInfinity) return Double(kInfinity).value(); + if (Sign() < 0 && Significand() == 0) { + // -0.0 + return 0.0; + } + if (Sign() < 0) { + return Double(d64_ - 1).value(); + } else { + return Double(d64_ + 1).value(); + } + } + + double PreviousDouble() const { + if (d64_ == (kInfinity | kSignMask)) return -Double::Infinity(); + if (Sign() < 0) { + return Double(d64_ + 1).value(); + } else { + if (Significand() == 0) return -0.0; + return Double(d64_ - 1).value(); + } + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint64_t d64 = AsUint64(); + int biased_e = + static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint64_t Significand() const { + uint64_t d64 = AsUint64(); + uint64_t significand = d64 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the double is a denormal. + bool IsDenormal() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) == 0); + } + + int Sign() const { + uint64_t d64 = AsUint64(); + return (d64 & kSignMask) == 0? 1: -1; + } + + // Precondition: the value encoded by this Double must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Double must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint64() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + double value() const { return uint64_to_double(d64_); } + + // Returns the significand size for a given order of magnitude. + // If v = f*2^e with 2^p-1 <= f <= 2^p then p+e is v's order of magnitude. + // This function returns the number of significant binary digits v will have + // once it's encoded into a double. In almost all cases this is equal to + // kSignificandSize. The only exceptions are denormals. They start with + // leading zeroes and their effective significand-size is hence smaller. + static int SignificandSizeForOrderOfMagnitude(int order) { + if (order >= (kDenormalExponent + kSignificandSize)) { + return kSignificandSize; + } + if (order <= kDenormalExponent) return 0; + return order - kDenormalExponent; + } + + static double Infinity() { + return Double(kInfinity).value(); + } + + static double NaN() { + return Double(kNaN).value(); + } + + private: + static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0x7FF - kExponentBias; + static const uint64_t kInfinity = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kNaN = UINT64_2PART_C(0x7FF80000, 00000000); + + const uint64_t d64_; + + static uint64_t DiyFpToUint64(DiyFp diy_fp) { + uint64_t significand = diy_fp.f(); + int exponent = diy_fp.e(); + while (significand > kHiddenBit + kSignificandMask) { + significand >>= 1; + exponent++; + } + if (exponent >= kMaxExponent) { + return kInfinity; + } + if (exponent < kDenormalExponent) { + return 0; + } + while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { + significand <<= 1; + exponent--; + } + uint64_t biased_exponent; + if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { + biased_exponent = 0; + } else { + biased_exponent = static_cast(exponent + kExponentBias); + } + return (significand & kSignificandMask) | + (biased_exponent << kPhysicalSignificandSize); + } + + DISALLOW_COPY_AND_ASSIGN(Double); +}; + +class Single { + public: + static const uint32_t kSignMask = 0x80000000; + static const uint32_t kExponentMask = 0x7F800000; + static const uint32_t kSignificandMask = 0x007FFFFF; + static const uint32_t kHiddenBit = 0x00800000; + static const int kPhysicalSignificandSize = 23; // Excludes the hidden bit. + static const int kSignificandSize = 24; + + Single() : d32_(0) {} + explicit Single(float f) : d32_(float_to_uint32(f)) {} + explicit Single(uint32_t d32) : d32_(d32) {} + + // The value encoded by this Single must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // Returns the single's bit as uint64. + uint32_t AsUint32() const { + return d32_; + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint32_t d32 = AsUint32(); + int biased_e = + static_cast((d32 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint32_t Significand() const { + uint32_t d32 = AsUint32(); + uint32_t significand = d32 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the single is a denormal. + bool IsDenormal() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) == 0); + } + + int Sign() const { + uint32_t d32 = AsUint32(); + return (d32 & kSignMask) == 0? 1: -1; + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Single must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + // Precondition: the value encoded by this Single must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint32() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + float value() const { return uint32_to_float(d32_); } + + static float Infinity() { + return Single(kInfinity).value(); + } + + static float NaN() { + return Single(kNaN).value(); + } + + private: + static const int kExponentBias = 0x7F + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0xFF - kExponentBias; + static const uint32_t kInfinity = 0x7F800000; + static const uint32_t kNaN = 0x7FC00000; + + const uint32_t d32_; + + DISALLOW_COPY_AND_ASSIGN(Single); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/strtod.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/strtod.h new file mode 100644 index 0000000..ed0293b --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/strtod.h @@ -0,0 +1,45 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_STRTOD_H_ +#define DOUBLE_CONVERSION_STRTOD_H_ + +#include "utils.h" + +namespace double_conversion { + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +double Strtod(Vector buffer, int exponent); + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +float Strtof(Vector buffer, int exponent); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_STRTOD_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/utils.h b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/utils.h new file mode 100644 index 0000000..a7c9b42 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64/Headers/double-conversion/utils.h @@ -0,0 +1,324 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_UTILS_H_ +#define DOUBLE_CONVERSION_UTILS_H_ + +#include +#include + +#include +#ifndef ASSERT +#define ASSERT(condition) \ + assert(condition); +#endif +#ifndef UNIMPLEMENTED +#define UNIMPLEMENTED() (abort()) +#endif +#ifndef UNREACHABLE +#define UNREACHABLE() (abort()) +#endif + +// Double operations detection based on target architecture. +// Linux uses a 80bit wide floating point stack on x86. This induces double +// rounding, which in turn leads to wrong results. +// An easy way to test if the floating-point operations are correct is to +// evaluate: 89255.0/1e22. If the floating-point stack is 64 bits wide then +// the result is equal to 89255e-22. +// The best way to test this, is to create a division-function and to compare +// the output of the division with the expected result. (Inlining must be +// disabled.) +// On Linux,x86 89255e-22 != Div_double(89255.0/1e22) +#if defined(_M_X64) || defined(__x86_64__) || \ + defined(__ARMEL__) || defined(__avr32__) || \ + defined(__hppa__) || defined(__ia64__) || \ + defined(__mips__) || \ + defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || \ + defined(__AARCH64EL__) +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#elif defined(__mc68000__) +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#elif defined(_M_IX86) || defined(__i386__) || defined(__i386) +#if defined(_WIN32) +// Windows uses a 64bit wide floating point stack. +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#else +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#endif // _WIN32 +#else +#error Target architecture was not detected as supported by Double-Conversion. +#endif + +#if defined(__GNUC__) +#define DOUBLE_CONVERSION_UNUSED __attribute__((unused)) +#else +#define DOUBLE_CONVERSION_UNUSED +#endif + +#if defined(_WIN32) && !defined(__MINGW32__) + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; // NOLINT +typedef unsigned short uint16_t; // NOLINT +typedef int int32_t; +typedef unsigned int uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +// intptr_t and friends are defined in crtdefs.h through stdio.h. + +#else + +#include + +#endif + +// The following macro works on both 32 and 64-bit platforms. +// Usage: instead of writing 0x1234567890123456 +// write UINT64_2PART_C(0x12345678,90123456); +#define UINT64_2PART_C(a, b) (((static_cast(a) << 32) + 0x##b##u)) + + +// The expression ARRAY_SIZE(a) is a compile-time constant of type +// size_t which represents the number of elements of the given +// array. You should only use ARRAY_SIZE on statically allocated +// arrays. +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) \ + ((sizeof(a) / sizeof(*(a))) / \ + static_cast(!(sizeof(a) % sizeof(*(a))))) +#endif + +// A macro to disallow the evil copy constructor and operator= functions +// This should be used in the private: declarations for a class +#ifndef DISALLOW_COPY_AND_ASSIGN +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) +#endif + +// A macro to disallow all the implicit constructors, namely the +// default constructor, copy constructor and operator= functions. +// +// This should be used in the private: declarations for a class +// that wants to prevent anyone from instantiating it. This is +// especially useful for classes containing only static methods. +#ifndef DISALLOW_IMPLICIT_CONSTRUCTORS +#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName(); \ + DISALLOW_COPY_AND_ASSIGN(TypeName) +#endif + +namespace double_conversion { + +static const int kCharSize = sizeof(char); + +// Returns the maximum of the two parameters. +template +static T Max(T a, T b) { + return a < b ? b : a; +} + + +// Returns the minimum of the two parameters. +template +static T Min(T a, T b) { + return a < b ? a : b; +} + + +inline int StrLength(const char* string) { + size_t length = strlen(string); + ASSERT(length == static_cast(static_cast(length))); + return static_cast(length); +} + +// This is a simplified version of V8's Vector class. +template +class Vector { + public: + Vector() : start_(NULL), length_(0) {} + Vector(T* data, int length) : start_(data), length_(length) { + ASSERT(length == 0 || (length > 0 && data != NULL)); + } + + // Returns a vector using the same backing storage as this one, + // spanning from and including 'from', to but not including 'to'. + Vector SubVector(int from, int to) { + ASSERT(to <= length_); + ASSERT(from < to); + ASSERT(0 <= from); + return Vector(start() + from, to - from); + } + + // Returns the length of the vector. + int length() const { return length_; } + + // Returns whether or not the vector is empty. + bool is_empty() const { return length_ == 0; } + + // Returns the pointer to the start of the data in the vector. + T* start() const { return start_; } + + // Access individual vector elements - checks bounds in debug mode. + T& operator[](int index) const { + ASSERT(0 <= index && index < length_); + return start_[index]; + } + + T& first() { return start_[0]; } + + T& last() { return start_[length_ - 1]; } + + private: + T* start_; + int length_; +}; + + +// Helper class for building result strings in a character buffer. The +// purpose of the class is to use safe operations that checks the +// buffer bounds on all operations in debug mode. +class StringBuilder { + public: + StringBuilder(char* buffer, int size) + : buffer_(buffer, size), position_(0) { } + + ~StringBuilder() { if (!is_finalized()) Finalize(); } + + int size() const { return buffer_.length(); } + + // Get the current position in the builder. + int position() const { + ASSERT(!is_finalized()); + return position_; + } + + // Reset the position. + void Reset() { position_ = 0; } + + // Add a single character to the builder. It is not allowed to add + // 0-characters; use the Finalize() method to terminate the string + // instead. + void AddCharacter(char c) { + ASSERT(c != '\0'); + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_++] = c; + } + + // Add an entire string to the builder. Uses strlen() internally to + // compute the length of the input string. + void AddString(const char* s) { + AddSubstring(s, StrLength(s)); + } + + // Add the first 'n' characters of the given string 's' to the + // builder. The input string must have enough characters. + void AddSubstring(const char* s, int n) { + ASSERT(!is_finalized() && position_ + n < buffer_.length()); + ASSERT(static_cast(n) <= strlen(s)); + memmove(&buffer_[position_], s, n * kCharSize); + position_ += n; + } + + + // Add character padding to the builder. If count is non-positive, + // nothing is added to the builder. + void AddPadding(char c, int count) { + for (int i = 0; i < count; i++) { + AddCharacter(c); + } + } + + // Finalize the string by 0-terminating it and returning the buffer. + char* Finalize() { + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_] = '\0'; + // Make sure nobody managed to add a 0-character to the + // buffer while building the string. + ASSERT(strlen(buffer_.start()) == static_cast(position_)); + position_ = -1; + ASSERT(is_finalized()); + return buffer_.start(); + } + + private: + Vector buffer_; + int position_; + + bool is_finalized() const { return position_ < 0; } + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); +}; + +// The type-based aliasing rule allows the compiler to assume that pointers of +// different types (for some definition of different) never alias each other. +// Thus the following code does not work: +// +// float f = foo(); +// int fbits = *(int*)(&f); +// +// The compiler 'knows' that the int pointer can't refer to f since the types +// don't match, so the compiler may cache f in a register, leaving random data +// in fbits. Using C++ style casts makes no difference, however a pointer to +// char data is assumed to alias any other pointer. This is the 'memcpy +// exception'. +// +// Bit_cast uses the memcpy exception to move the bits from a variable of one +// type of a variable of another type. Of course the end result is likely to +// be implementation dependent. Most compilers (gcc-4.2 and MSVC 2005) +// will completely optimize BitCast away. +// +// There is an additional use for BitCast. +// Recent gccs will warn when they see casts that may result in breakage due to +// the type-based aliasing rule. If you have checked that there is no breakage +// you can use BitCast to cast one pointer type to another. This confuses gcc +// enough that it can no longer see that you have cast one pointer type to +// another thus avoiding the warning. +template +inline Dest BitCast(const Source& source) { + // Compile time assertion: sizeof(Dest) == sizeof(Source) + // A compile error here means your Dest and Source have different sizes. + DOUBLE_CONVERSION_UNUSED + typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; + + Dest dest; + memmove(&dest, &source, sizeof(dest)); + return dest; +} + +template +inline Dest BitCast(Source* source) { + return BitCast(reinterpret_cast(source)); +} + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_UTILS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64/libDoubleConversion.a b/Frameworks/DoubleConversion.xcframework/ios-arm64/libDoubleConversion.a new file mode 100644 index 0000000..10e6cef Binary files /dev/null and b/Frameworks/DoubleConversion.xcframework/ios-arm64/libDoubleConversion.a differ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/bignum-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/bignum-dtoa.h new file mode 100644 index 0000000..34b9619 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/bignum-dtoa.h @@ -0,0 +1,84 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_DTOA_H_ +#define DOUBLE_CONVERSION_BIGNUM_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum BignumDtoaMode { + // Return the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate but + // correct) 0.3. + BIGNUM_DTOA_SHORTEST, + // Same as BIGNUM_DTOA_SHORTEST but for single-precision floats. + BIGNUM_DTOA_SHORTEST_SINGLE, + // Return a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + BIGNUM_DTOA_FIXED, + // Return a fixed number of digits, no matter what the exponent is. + BIGNUM_DTOA_PRECISION +}; + +// Converts the given double 'v' to ascii. +// The result should be interpreted as buffer * 10^(point-length). +// The buffer will be null-terminated. +// +// The input v must be > 0 and different from NaN, and Infinity. +// +// The output depends on the given mode: +// - SHORTEST: produce the least amount of digits for which the internal +// identity requirement is still satisfied. If the digits are printed +// (together with the correct exponent) then reading this number will give +// 'v' again. The buffer will choose the representation that is closest to +// 'v'. If there are two at the same distance, than the number is round up. +// In this mode the 'requested_digits' parameter is ignored. +// - FIXED: produces digits necessary to print a given number with +// 'requested_digits' digits after the decimal point. The produced digits +// might be too short in which case the caller has to fill the gaps with '0's. +// Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. +// Halfway cases are rounded up. The call toFixed(0.15, 2) thus returns +// buffer="2", point=0. +// Note: the length of the returned buffer has no meaning wrt the significance +// of its digits. That is, just because it contains '0's does not mean that +// any other digit would not satisfy the internal identity requirement. +// - PRECISION: produces 'requested_digits' where the first digit is not '0'. +// Even though the length of produced digits usually equals +// 'requested_digits', the function is allowed to return fewer digits, in +// which case the caller has to fill the missing digits with '0's. +// Halfway cases are again rounded up. +// 'BignumDtoa' expects the given buffer to be big enough to hold all digits +// and a terminating null-character. +void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, + Vector buffer, int* length, int* point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/bignum.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/bignum.h new file mode 100644 index 0000000..5ec3544 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/bignum.h @@ -0,0 +1,145 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_H_ +#define DOUBLE_CONVERSION_BIGNUM_H_ + +#include "utils.h" + +namespace double_conversion { + +class Bignum { + public: + // 3584 = 128 * 28. We can represent 2^3584 > 10^1000 accurately. + // This bignum can encode much bigger numbers, since it contains an + // exponent. + static const int kMaxSignificantBits = 3584; + + Bignum(); + void AssignUInt16(uint16_t value); + void AssignUInt64(uint64_t value); + void AssignBignum(const Bignum& other); + + void AssignDecimalString(Vector value); + void AssignHexString(Vector value); + + void AssignPowerUInt16(uint16_t base, int exponent); + + void AddUInt16(uint16_t operand); + void AddUInt64(uint64_t operand); + void AddBignum(const Bignum& other); + // Precondition: this >= other. + void SubtractBignum(const Bignum& other); + + void Square(); + void ShiftLeft(int shift_amount); + void MultiplyByUInt32(uint32_t factor); + void MultiplyByUInt64(uint64_t factor); + void MultiplyByPowerOfTen(int exponent); + void Times10() { return MultiplyByUInt32(10); } + // Pseudocode: + // int result = this / other; + // this = this % other; + // In the worst case this function is in O(this/other). + uint16_t DivideModuloIntBignum(const Bignum& other); + + bool ToHexString(char* buffer, int buffer_size) const; + + // Returns + // -1 if a < b, + // 0 if a == b, and + // +1 if a > b. + static int Compare(const Bignum& a, const Bignum& b); + static bool Equal(const Bignum& a, const Bignum& b) { + return Compare(a, b) == 0; + } + static bool LessEqual(const Bignum& a, const Bignum& b) { + return Compare(a, b) <= 0; + } + static bool Less(const Bignum& a, const Bignum& b) { + return Compare(a, b) < 0; + } + // Returns Compare(a + b, c); + static int PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c); + // Returns a + b == c + static bool PlusEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) == 0; + } + // Returns a + b <= c + static bool PlusLessEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) <= 0; + } + // Returns a + b < c + static bool PlusLess(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) < 0; + } + private: + typedef uint32_t Chunk; + typedef uint64_t DoubleChunk; + + static const int kChunkSize = sizeof(Chunk) * 8; + static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8; + // With bigit size of 28 we loose some bits, but a double still fits easily + // into two chunks, and more importantly we can use the Comba multiplication. + static const int kBigitSize = 28; + static const Chunk kBigitMask = (1 << kBigitSize) - 1; + // Every instance allocates kBigitLength chunks on the stack. Bignums cannot + // grow. There are no checks if the stack-allocated space is sufficient. + static const int kBigitCapacity = kMaxSignificantBits / kBigitSize; + + void EnsureCapacity(int size) { + if (size > kBigitCapacity) { + UNREACHABLE(); + } + } + void Align(const Bignum& other); + void Clamp(); + bool IsClamped() const; + void Zero(); + // Requires this to have enough capacity (no tests done). + // Updates used_digits_ if necessary. + // shift_amount must be < kBigitSize. + void BigitsShiftLeft(int shift_amount); + // BigitLength includes the "hidden" digits encoded in the exponent. + int BigitLength() const { return used_digits_ + exponent_; } + Chunk BigitAt(int index) const; + void SubtractTimes(const Bignum& other, int factor); + + Chunk bigits_buffer_[kBigitCapacity]; + // A vector backed by bigits_buffer_. This way accesses to the array are + // checked for out-of-bounds errors. + Vector bigits_; + int used_digits_; + // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize). + int exponent_; + + DISALLOW_COPY_AND_ASSIGN(Bignum); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/cached-powers.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/cached-powers.h new file mode 100644 index 0000000..61a5061 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/cached-powers.h @@ -0,0 +1,64 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_CACHED_POWERS_H_ +#define DOUBLE_CONVERSION_CACHED_POWERS_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +class PowersOfTenCache { + public: + + // Not all powers of ten are cached. The decimal exponent of two neighboring + // cached numbers will differ by kDecimalExponentDistance. + static const int kDecimalExponentDistance; + + static const int kMinDecimalExponent; + static const int kMaxDecimalExponent; + + // Returns a cached power-of-ten with a binary exponent in the range + // [min_exponent; max_exponent] (boundaries included). + static void GetCachedPowerForBinaryExponentRange(int min_exponent, + int max_exponent, + DiyFp* power, + int* decimal_exponent); + + // Returns a cached power of ten x ~= 10^k such that + // k <= decimal_exponent < k + kCachedPowersDecimalDistance. + // The given decimal_exponent must satisfy + // kMinDecimalExponent <= requested_exponent, and + // requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance. + static void GetCachedPowerForDecimalExponent(int requested_exponent, + DiyFp* power, + int* found_exponent); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_CACHED_POWERS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/diy-fp.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/diy-fp.h new file mode 100644 index 0000000..9dcf8fb --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/diy-fp.h @@ -0,0 +1,118 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DIY_FP_H_ +#define DOUBLE_CONVERSION_DIY_FP_H_ + +#include "utils.h" + +namespace double_conversion { + +// This "Do It Yourself Floating Point" class implements a floating-point number +// with a uint64 significand and an int exponent. Normalized DiyFp numbers will +// have the most significant bit of the significand set. +// Multiplication and Subtraction do not normalize their results. +// DiyFp are not designed to contain special doubles (NaN and Infinity). +class DiyFp { + public: + static const int kSignificandSize = 64; + + DiyFp() : f_(0), e_(0) {} + DiyFp(uint64_t f, int e) : f_(f), e_(e) {} + + // this = this - other. + // The exponents of both numbers must be the same and the significand of this + // must be bigger than the significand of other. + // The result will not be normalized. + void Subtract(const DiyFp& other) { + ASSERT(e_ == other.e_); + ASSERT(f_ >= other.f_); + f_ -= other.f_; + } + + // Returns a - b. + // The exponents of both numbers must be the same and this must be bigger + // than other. The result will not be normalized. + static DiyFp Minus(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Subtract(b); + return result; + } + + + // this = this * other. + void Multiply(const DiyFp& other); + + // returns a * b; + static DiyFp Times(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Multiply(b); + return result; + } + + void Normalize() { + ASSERT(f_ != 0); + uint64_t f = f_; + int e = e_; + + // This method is mainly called for normalizing boundaries. In general + // boundaries need to be shifted by 10 bits. We thus optimize for this case. + const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000); + while ((f & k10MSBits) == 0) { + f <<= 10; + e -= 10; + } + while ((f & kUint64MSB) == 0) { + f <<= 1; + e--; + } + f_ = f; + e_ = e; + } + + static DiyFp Normalize(const DiyFp& a) { + DiyFp result = a; + result.Normalize(); + return result; + } + + uint64_t f() const { return f_; } + int e() const { return e_; } + + void set_f(uint64_t new_value) { f_ = new_value; } + void set_e(int new_value) { e_ = new_value; } + + private: + static const uint64_t kUint64MSB = UINT64_2PART_C(0x80000000, 00000000); + + uint64_t f_; + int e_; +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DIY_FP_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/double-conversion.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/double-conversion.h new file mode 100644 index 0000000..1c3387d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/double-conversion.h @@ -0,0 +1,536 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ +#define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ + +#include "utils.h" + +namespace double_conversion { + +class DoubleToStringConverter { + public: + // When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint + // or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the + // function returns false. + static const int kMaxFixedDigitsBeforePoint = 60; + static const int kMaxFixedDigitsAfterPoint = 60; + + // When calling ToExponential with a requested_digits + // parameter > kMaxExponentialDigits then the function returns false. + static const int kMaxExponentialDigits = 120; + + // When calling ToPrecision with a requested_digits + // parameter < kMinPrecisionDigits or requested_digits > kMaxPrecisionDigits + // then the function returns false. + static const int kMinPrecisionDigits = 1; + static const int kMaxPrecisionDigits = 120; + + enum Flags { + NO_FLAGS = 0, + EMIT_POSITIVE_EXPONENT_SIGN = 1, + EMIT_TRAILING_DECIMAL_POINT = 2, + EMIT_TRAILING_ZERO_AFTER_POINT = 4, + UNIQUE_ZERO = 8 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - EMIT_POSITIVE_EXPONENT_SIGN: when the number is converted into exponent + // form, emits a '+' for positive exponents. Example: 1.2e+2. + // - EMIT_TRAILING_DECIMAL_POINT: when the input number is an integer and is + // converted into decimal format then a trailing decimal point is appended. + // Example: 2345.0 is converted to "2345.". + // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point + // emits a trailing '0'-character. This flag requires the + // EXMIT_TRAILING_DECIMAL_POINT flag. + // Example: 2345.0 is converted to "2345.0". + // - UNIQUE_ZERO: "-0.0" is converted to "0.0". + // + // Infinity symbol and nan_symbol provide the string representation for these + // special values. If the string is NULL and the special value is encountered + // then the conversion functions return false. + // + // The exponent_character is used in exponential representations. It is + // usually 'e' or 'E'. + // + // When converting to the shortest representation the converter will + // represent input numbers in decimal format if they are in the interval + // [10^decimal_in_shortest_low; 10^decimal_in_shortest_high[ + // (lower boundary included, greater boundary excluded). + // Example: with decimal_in_shortest_low = -6 and + // decimal_in_shortest_high = 21: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // When converting to precision mode the converter may add + // max_leading_padding_zeroes before returning the number in exponential + // format. + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + DoubleToStringConverter(int flags, + const char* infinity_symbol, + const char* nan_symbol, + char exponent_character, + int decimal_in_shortest_low, + int decimal_in_shortest_high, + int max_leading_padding_zeroes_in_precision_mode, + int max_trailing_padding_zeroes_in_precision_mode) + : flags_(flags), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol), + exponent_character_(exponent_character), + decimal_in_shortest_low_(decimal_in_shortest_low), + decimal_in_shortest_high_(decimal_in_shortest_high), + max_leading_padding_zeroes_in_precision_mode_( + max_leading_padding_zeroes_in_precision_mode), + max_trailing_padding_zeroes_in_precision_mode_( + max_trailing_padding_zeroes_in_precision_mode) { + // When 'trailing zero after the point' is set, then 'trailing point' + // must be set too. + ASSERT(((flags & EMIT_TRAILING_DECIMAL_POINT) != 0) || + !((flags & EMIT_TRAILING_ZERO_AFTER_POINT) != 0)); + } + + // Returns a converter following the EcmaScript specification. + static const DoubleToStringConverter& EcmaScriptConverter(); + + // Computes the shortest string of digits that correctly represent the input + // number. Depending on decimal_in_shortest_low and decimal_in_shortest_high + // (see constructor) it then either returns a decimal representation, or an + // exponential representation. + // Example with decimal_in_shortest_low = -6, + // decimal_in_shortest_high = 21, + // EMIT_POSITIVE_EXPONENT_SIGN activated, and + // EMIT_TRAILING_DECIMAL_POINT deactived: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // Note: the conversion may round the output if the returned string + // is accurate enough to uniquely identify the input-number. + // For example the most precise representation of the double 9e59 equals + // "899999999999999918767229449717619953810131273674690656206848", but + // the converter will return the shorter (but still correct) "9e59". + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except when the input value is special and no infinity_symbol or + // nan_symbol has been given to the constructor. + bool ToShortest(double value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST); + } + + // Same as ToShortest, but for single-precision floats. + bool ToShortestSingle(float value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST_SINGLE); + } + + + // Computes a decimal representation with a fixed number of digits after the + // decimal point. The last emitted digit is rounded. + // + // Examples: + // ToFixed(3.12, 1) -> "3.1" + // ToFixed(3.1415, 3) -> "3.142" + // ToFixed(1234.56789, 4) -> "1234.5679" + // ToFixed(1.23, 5) -> "1.23000" + // ToFixed(0.1, 4) -> "0.1000" + // ToFixed(1e30, 2) -> "1000000000000000019884624838656.00" + // ToFixed(0.1, 30) -> "0.100000000000000005551115123126" + // ToFixed(0.1, 17) -> "0.10000000000000001" + // + // If requested_digits equals 0, then the tail of the result depends on + // the EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples, for requested_digits == 0, + // let EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT be + // - false and false: then 123.45 -> 123 + // 0.678 -> 1 + // - true and false: then 123.45 -> 123. + // 0.678 -> 1. + // - true and true: then 123.45 -> 123.0 + // 0.678 -> 1.0 + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'value' > 10^kMaxFixedDigitsBeforePoint, or + // - 'requested_digits' > kMaxFixedDigitsAfterPoint. + // The last two conditions imply that the result will never contain more than + // 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters + // (one additional character for the sign, and one for the decimal point). + bool ToFixed(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes a representation in exponential format with requested_digits + // after the decimal point. The last emitted digit is rounded. + // If requested_digits equals -1, then the shortest exponential representation + // is computed. + // + // Examples with EMIT_POSITIVE_EXPONENT_SIGN deactivated, and + // exponent_character set to 'e'. + // ToExponential(3.12, 1) -> "3.1e0" + // ToExponential(5.0, 3) -> "5.000e0" + // ToExponential(0.001, 2) -> "1.00e-3" + // ToExponential(3.1415, -1) -> "3.1415e0" + // ToExponential(3.1415, 4) -> "3.1415e0" + // ToExponential(3.1415, 3) -> "3.142e0" + // ToExponential(123456789000000, 3) -> "1.235e14" + // ToExponential(1000000000000000019884624838656.0, -1) -> "1e30" + // ToExponential(1000000000000000019884624838656.0, 32) -> + // "1.00000000000000001988462483865600e30" + // ToExponential(1234, 0) -> "1e3" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'requested_digits' > kMaxExponentialDigits. + // The last condition implies that the result will never contain more than + // kMaxExponentialDigits + 8 characters (the sign, the digit before the + // decimal point, the decimal point, the exponent character, the + // exponent's sign, and at most 3 exponent digits). + bool ToExponential(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes 'precision' leading digits of the given 'value' and returns them + // either in exponential or decimal format, depending on + // max_{leading|trailing}_padding_zeroes_in_precision_mode (given to the + // constructor). + // The last computed digit is rounded. + // + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 3, and no + // EMIT_TRAILING_ZERO_AFTER_POINT: + // ToPrecision(123450.0, 6) -> "123450" + // ToPrecision(123450.0, 5) -> "123450" + // ToPrecision(123450.0, 4) -> "123500" + // ToPrecision(123450.0, 3) -> "123000" + // ToPrecision(123450.0, 2) -> "1.2e5" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - precision < kMinPericisionDigits + // - precision > kMaxPrecisionDigits + // The last condition implies that the result will never contain more than + // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the + // exponent character, the exponent's sign, and at most 3 exponent digits). + bool ToPrecision(double value, + int precision, + StringBuilder* result_builder) const; + + enum DtoaMode { + // Produce the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate + // but correct) 0.3. + SHORTEST, + // Same as SHORTEST, but for single-precision floats. + SHORTEST_SINGLE, + // Produce a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + FIXED, + // Fixed number of digits (independent of the decimal point). + PRECISION + }; + + // The maximal number of digits that are needed to emit a double in base 10. + // A higher precision can be achieved by using more digits, but the shortest + // accurate representation of any double will never use more digits than + // kBase10MaximalLength. + // Note that DoubleToAscii null-terminates its input. So the given buffer + // should be at least kBase10MaximalLength + 1 characters long. + static const int kBase10MaximalLength = 17; + + // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or + // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v' + // after it has been casted to a single-precision float. That is, in this + // mode static_cast(v) must not be NaN, +Infinity or -Infinity. + // + // The result should be interpreted as buffer * 10^(point-length). + // + // The output depends on the given mode: + // - SHORTEST: produce the least amount of digits for which the internal + // identity requirement is still satisfied. If the digits are printed + // (together with the correct exponent) then reading this number will give + // 'v' again. The buffer will choose the representation that is closest to + // 'v'. If there are two at the same distance, than the one farther away + // from 0 is chosen (halfway cases - ending with 5 - are rounded up). + // In this mode the 'requested_digits' parameter is ignored. + // - SHORTEST_SINGLE: same as SHORTEST but with single-precision. + // - FIXED: produces digits necessary to print a given number with + // 'requested_digits' digits after the decimal point. The produced digits + // might be too short in which case the caller has to fill the remainder + // with '0's. + // Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. + // Halfway cases are rounded towards +/-Infinity (away from 0). The call + // toFixed(0.15, 2) thus returns buffer="2", point=0. + // The returned buffer may contain digits that would be truncated from the + // shortest representation of the input. + // - PRECISION: produces 'requested_digits' where the first digit is not '0'. + // Even though the length of produced digits usually equals + // 'requested_digits', the function is allowed to return fewer digits, in + // which case the caller has to fill the missing digits with '0's. + // Halfway cases are again rounded away from 0. + // DoubleToAscii expects the given buffer to be big enough to hold all + // digits and a terminating null-character. In SHORTEST-mode it expects a + // buffer of at least kBase10MaximalLength + 1. In all other modes the + // requested_digits parameter and the padding-zeroes limit the size of the + // output. Don't forget the decimal point, the exponent character and the + // terminating null-character when computing the maximal output size. + // The given length is only used in debug mode to ensure the buffer is big + // enough. + static void DoubleToAscii(double v, + DtoaMode mode, + int requested_digits, + char* buffer, + int buffer_length, + bool* sign, + int* length, + int* point); + + private: + // Implementation for ToShortest and ToShortestSingle. + bool ToShortestIeeeNumber(double value, + StringBuilder* result_builder, + DtoaMode mode) const; + + // If the value is a special value (NaN or Infinity) constructs the + // corresponding string using the configured infinity/nan-symbol. + // If either of them is NULL or the value is not special then the + // function returns false. + bool HandleSpecialValues(double value, StringBuilder* result_builder) const; + // Constructs an exponential representation (i.e. 1.234e56). + // The given exponent assumes a decimal point after the first decimal digit. + void CreateExponentialRepresentation(const char* decimal_digits, + int length, + int exponent, + StringBuilder* result_builder) const; + // Creates a decimal representation (i.e 1234.5678). + void CreateDecimalRepresentation(const char* decimal_digits, + int length, + int decimal_point, + int digits_after_point, + StringBuilder* result_builder) const; + + const int flags_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + const char exponent_character_; + const int decimal_in_shortest_low_; + const int decimal_in_shortest_high_; + const int max_leading_padding_zeroes_in_precision_mode_; + const int max_trailing_padding_zeroes_in_precision_mode_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter); +}; + + +class StringToDoubleConverter { + public: + // Enumeration for allowing octals and ignoring junk when converting + // strings to numbers. + enum Flags { + NO_FLAGS = 0, + ALLOW_HEX = 1, + ALLOW_OCTALS = 2, + ALLOW_TRAILING_JUNK = 4, + ALLOW_LEADING_SPACES = 8, + ALLOW_TRAILING_SPACES = 16, + ALLOW_SPACES_AFTER_SIGN = 32 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - ALLOW_HEX: recognizes the prefix "0x". Hex numbers may only be integers. + // Ex: StringToDouble("0x1234") -> 4660.0 + // In StringToDouble("0x1234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // With this flag "0x" is a junk-string. Even with ALLOW_TRAILING_JUNK, + // the string will not be parsed as "0" followed by junk. + // + // - ALLOW_OCTALS: recognizes the prefix "0" for octals: + // If a sequence of octal digits starts with '0', then the number is + // read as octal integer. Octal numbers may only be integers. + // Ex: StringToDouble("01234") -> 668.0 + // StringToDouble("012349") -> 12349.0 // Not a sequence of octal + // // digits. + // In StringToDouble("01234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // In StringToDouble("01234e56") the characters "e56" are trailing + // junk, too. + // - ALLOW_TRAILING_JUNK: ignore trailing characters that are not part of + // a double literal. + // - ALLOW_LEADING_SPACES: skip over leading spaces. + // - ALLOW_TRAILING_SPACES: ignore trailing spaces. + // - ALLOW_SPACES_AFTER_SIGN: ignore spaces after the sign. + // Ex: StringToDouble("- 123.2") -> -123.2. + // StringToDouble("+ 123.2") -> 123.2 + // + // empty_string_value is returned when an empty string is given as input. + // If ALLOW_LEADING_SPACES or ALLOW_TRAILING_SPACES are set, then a string + // containing only spaces is converted to the 'empty_string_value', too. + // + // junk_string_value is returned when + // a) ALLOW_TRAILING_JUNK is not set, and a junk character (a character not + // part of a double-literal) is found. + // b) ALLOW_TRAILING_JUNK is set, but the string does not start with a + // double literal. + // + // infinity_symbol and nan_symbol are strings that are used to detect + // inputs that represent infinity and NaN. They can be null, in which case + // they are ignored. + // The conversion routine first reads any possible signs. Then it compares the + // following character of the input-string with the first character of + // the infinity, and nan-symbol. If either matches, the function assumes, that + // a match has been found, and expects the following input characters to match + // the remaining characters of the special-value symbol. + // This means that the following restrictions apply to special-value symbols: + // - they must not start with signs ('+', or '-'), + // - they must not have the same first character. + // - they must not start with digits. + // + // Examples: + // flags = ALLOW_HEX | ALLOW_TRAILING_JUNK, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = "infinity", + // nan_symbol = "nan": + // StringToDouble("0x1234") -> 4660.0. + // StringToDouble("0x1234K") -> 4660.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> NaN // junk_string_value. + // StringToDouble(" 1") -> NaN // junk_string_value. + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("-123.45") -> -123.45. + // StringToDouble("--123.45") -> NaN // junk_string_value. + // StringToDouble("123e45") -> 123e45. + // StringToDouble("123E45") -> 123e45. + // StringToDouble("123e+45") -> 123e45. + // StringToDouble("123E-45") -> 123e-45. + // StringToDouble("123e") -> 123.0 // trailing junk ignored. + // StringToDouble("123e-") -> 123.0 // trailing junk ignored. + // StringToDouble("+NaN") -> NaN // NaN string literal. + // StringToDouble("-infinity") -> -inf. // infinity literal. + // StringToDouble("Infinity") -> NaN // junk_string_value. + // + // flags = ALLOW_OCTAL | ALLOW_LEADING_SPACES, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = NULL, + // nan_symbol = NULL: + // StringToDouble("0x1234") -> NaN // junk_string_value. + // StringToDouble("01234") -> 668.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> 0.0 // empty_string_value. + // StringToDouble(" 1") -> 1.0 + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("0123e45") -> NaN // junk_string_value. + // StringToDouble("01239E45") -> 1239e45. + // StringToDouble("-infinity") -> NaN // junk_string_value. + // StringToDouble("NaN") -> NaN // junk_string_value. + StringToDoubleConverter(int flags, + double empty_string_value, + double junk_string_value, + const char* infinity_symbol, + const char* nan_symbol) + : flags_(flags), + empty_string_value_(empty_string_value), + junk_string_value_(junk_string_value), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol) { + } + + // Performs the conversion. + // The output parameter 'processed_characters_count' is set to the number + // of characters that have been processed to read the number. + // Spaces than are processed with ALLOW_{LEADING|TRAILING}_SPACES are included + // in the 'processed_characters_count'. Trailing junk is never included. + double StringToDouble(const char* buffer, + int length, + int* processed_characters_count) const { + return StringToIeee(buffer, length, processed_characters_count, true); + } + + // Same as StringToDouble but reads a float. + // Note that this is not equivalent to static_cast(StringToDouble(...)) + // due to potential double-rounding. + float StringToFloat(const char* buffer, + int length, + int* processed_characters_count) const { + return static_cast(StringToIeee(buffer, length, + processed_characters_count, false)); + } + + private: + const int flags_; + const double empty_string_value_; + const double junk_string_value_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + + double StringToIeee(const char* buffer, + int length, + int* processed_characters_count, + bool read_as_double) const; + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/fast-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/fast-dtoa.h new file mode 100644 index 0000000..5f1e8ee --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/fast-dtoa.h @@ -0,0 +1,88 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FAST_DTOA_H_ +#define DOUBLE_CONVERSION_FAST_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum FastDtoaMode { + // Computes the shortest representation of the given input. The returned + // result will be the most accurate number of this length. Longer + // representations might be more accurate. + FAST_DTOA_SHORTEST, + // Same as FAST_DTOA_SHORTEST but for single-precision floats. + FAST_DTOA_SHORTEST_SINGLE, + // Computes a representation where the precision (number of digits) is + // given as input. The precision is independent of the decimal point. + FAST_DTOA_PRECISION +}; + +// FastDtoa will produce at most kFastDtoaMaximalLength digits. This does not +// include the terminating '\0' character. +static const int kFastDtoaMaximalLength = 17; +// Same for single-precision numbers. +static const int kFastDtoaMaximalSingleLength = 9; + +// Provides a decimal representation of v. +// The result should be interpreted as buffer * 10^(point - length). +// +// Precondition: +// * v must be a strictly positive finite double. +// +// Returns true if it succeeds, otherwise the result can not be trusted. +// There will be *length digits inside the buffer followed by a null terminator. +// If the function returns true and mode equals +// - FAST_DTOA_SHORTEST, then +// the parameter requested_digits is ignored. +// The result satisfies +// v == (double) (buffer * 10^(point - length)). +// The digits in the buffer are the shortest representation possible. E.g. +// if 0.099999999999 and 0.1 represent the same double then "1" is returned +// with point = 0. +// The last digit will be closest to the actual v. That is, even if several +// digits might correctly yield 'v' when read again, the buffer will contain +// the one closest to v. +// - FAST_DTOA_PRECISION, then +// the buffer contains requested_digits digits. +// the difference v - (buffer * 10^(point-length)) is closest to zero for +// all possible representations of requested_digits digits. +// If there are two values that are equally close, then FastDtoa returns +// false. +// For both modes the buffer must be large enough to hold the result. +bool FastDtoa(double d, + FastDtoaMode mode, + int requested_digits, + Vector buffer, + int* length, + int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FAST_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/fixed-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/fixed-dtoa.h new file mode 100644 index 0000000..3bdd08e --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/fixed-dtoa.h @@ -0,0 +1,56 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FIXED_DTOA_H_ +#define DOUBLE_CONVERSION_FIXED_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +// Produces digits necessary to print a given number with +// 'fractional_count' digits after the decimal point. +// The buffer must be big enough to hold the result plus one terminating null +// character. +// +// The produced digits might be too short in which case the caller has to fill +// the gaps with '0's. +// Example: FastFixedDtoa(0.001, 5, ...) is allowed to return buffer = "1", and +// decimal_point = -2. +// Halfway cases are rounded towards +/-Infinity (away from 0). The call +// FastFixedDtoa(0.15, 2, ...) thus returns buffer = "2", decimal_point = 0. +// The returned buffer may contain digits that would be truncated from the +// shortest representation of the input. +// +// This method only works for some parameters. If it can't handle the input it +// returns false. The output is null-terminated when the function succeeds. +bool FastFixedDtoa(double v, int fractional_count, + Vector buffer, int* length, int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FIXED_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/ieee.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/ieee.h new file mode 100644 index 0000000..661141d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/ieee.h @@ -0,0 +1,402 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_H_ +#define DOUBLE_CONVERSION_DOUBLE_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +// We assume that doubles and uint64_t have the same endianness. +static uint64_t double_to_uint64(double d) { return BitCast(d); } +static double uint64_to_double(uint64_t d64) { return BitCast(d64); } +static uint32_t float_to_uint32(float f) { return BitCast(f); } +static float uint32_to_float(uint32_t d32) { return BitCast(d32); } + +// Helper functions for doubles. +class Double { + public: + static const uint64_t kSignMask = UINT64_2PART_C(0x80000000, 00000000); + static const uint64_t kExponentMask = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kSignificandMask = UINT64_2PART_C(0x000FFFFF, FFFFFFFF); + static const uint64_t kHiddenBit = UINT64_2PART_C(0x00100000, 00000000); + static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. + static const int kSignificandSize = 53; + + Double() : d64_(0) {} + explicit Double(double d) : d64_(double_to_uint64(d)) {} + explicit Double(uint64_t d64) : d64_(d64) {} + explicit Double(DiyFp diy_fp) + : d64_(DiyFpToUint64(diy_fp)) {} + + // The value encoded by this Double must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // The value encoded by this Double must be strictly greater than 0. + DiyFp AsNormalizedDiyFp() const { + ASSERT(value() > 0.0); + uint64_t f = Significand(); + int e = Exponent(); + + // The current double could be a denormal. + while ((f & kHiddenBit) == 0) { + f <<= 1; + e--; + } + // Do the final shifts in one go. + f <<= DiyFp::kSignificandSize - kSignificandSize; + e -= DiyFp::kSignificandSize - kSignificandSize; + return DiyFp(f, e); + } + + // Returns the double's bit as uint64. + uint64_t AsUint64() const { + return d64_; + } + + // Returns the next greater double. Returns +infinity on input +infinity. + double NextDouble() const { + if (d64_ == kInfinity) return Double(kInfinity).value(); + if (Sign() < 0 && Significand() == 0) { + // -0.0 + return 0.0; + } + if (Sign() < 0) { + return Double(d64_ - 1).value(); + } else { + return Double(d64_ + 1).value(); + } + } + + double PreviousDouble() const { + if (d64_ == (kInfinity | kSignMask)) return -Double::Infinity(); + if (Sign() < 0) { + return Double(d64_ + 1).value(); + } else { + if (Significand() == 0) return -0.0; + return Double(d64_ - 1).value(); + } + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint64_t d64 = AsUint64(); + int biased_e = + static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint64_t Significand() const { + uint64_t d64 = AsUint64(); + uint64_t significand = d64 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the double is a denormal. + bool IsDenormal() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) == 0); + } + + int Sign() const { + uint64_t d64 = AsUint64(); + return (d64 & kSignMask) == 0? 1: -1; + } + + // Precondition: the value encoded by this Double must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Double must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint64() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + double value() const { return uint64_to_double(d64_); } + + // Returns the significand size for a given order of magnitude. + // If v = f*2^e with 2^p-1 <= f <= 2^p then p+e is v's order of magnitude. + // This function returns the number of significant binary digits v will have + // once it's encoded into a double. In almost all cases this is equal to + // kSignificandSize. The only exceptions are denormals. They start with + // leading zeroes and their effective significand-size is hence smaller. + static int SignificandSizeForOrderOfMagnitude(int order) { + if (order >= (kDenormalExponent + kSignificandSize)) { + return kSignificandSize; + } + if (order <= kDenormalExponent) return 0; + return order - kDenormalExponent; + } + + static double Infinity() { + return Double(kInfinity).value(); + } + + static double NaN() { + return Double(kNaN).value(); + } + + private: + static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0x7FF - kExponentBias; + static const uint64_t kInfinity = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kNaN = UINT64_2PART_C(0x7FF80000, 00000000); + + const uint64_t d64_; + + static uint64_t DiyFpToUint64(DiyFp diy_fp) { + uint64_t significand = diy_fp.f(); + int exponent = diy_fp.e(); + while (significand > kHiddenBit + kSignificandMask) { + significand >>= 1; + exponent++; + } + if (exponent >= kMaxExponent) { + return kInfinity; + } + if (exponent < kDenormalExponent) { + return 0; + } + while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { + significand <<= 1; + exponent--; + } + uint64_t biased_exponent; + if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { + biased_exponent = 0; + } else { + biased_exponent = static_cast(exponent + kExponentBias); + } + return (significand & kSignificandMask) | + (biased_exponent << kPhysicalSignificandSize); + } + + DISALLOW_COPY_AND_ASSIGN(Double); +}; + +class Single { + public: + static const uint32_t kSignMask = 0x80000000; + static const uint32_t kExponentMask = 0x7F800000; + static const uint32_t kSignificandMask = 0x007FFFFF; + static const uint32_t kHiddenBit = 0x00800000; + static const int kPhysicalSignificandSize = 23; // Excludes the hidden bit. + static const int kSignificandSize = 24; + + Single() : d32_(0) {} + explicit Single(float f) : d32_(float_to_uint32(f)) {} + explicit Single(uint32_t d32) : d32_(d32) {} + + // The value encoded by this Single must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // Returns the single's bit as uint64. + uint32_t AsUint32() const { + return d32_; + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint32_t d32 = AsUint32(); + int biased_e = + static_cast((d32 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint32_t Significand() const { + uint32_t d32 = AsUint32(); + uint32_t significand = d32 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the single is a denormal. + bool IsDenormal() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) == 0); + } + + int Sign() const { + uint32_t d32 = AsUint32(); + return (d32 & kSignMask) == 0? 1: -1; + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Single must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + // Precondition: the value encoded by this Single must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint32() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + float value() const { return uint32_to_float(d32_); } + + static float Infinity() { + return Single(kInfinity).value(); + } + + static float NaN() { + return Single(kNaN).value(); + } + + private: + static const int kExponentBias = 0x7F + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0xFF - kExponentBias; + static const uint32_t kInfinity = 0x7F800000; + static const uint32_t kNaN = 0x7FC00000; + + const uint32_t d32_; + + DISALLOW_COPY_AND_ASSIGN(Single); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/strtod.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/strtod.h new file mode 100644 index 0000000..ed0293b --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/strtod.h @@ -0,0 +1,45 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_STRTOD_H_ +#define DOUBLE_CONVERSION_STRTOD_H_ + +#include "utils.h" + +namespace double_conversion { + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +double Strtod(Vector buffer, int exponent); + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +float Strtof(Vector buffer, int exponent); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_STRTOD_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/utils.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/utils.h new file mode 100644 index 0000000..a7c9b42 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/DoubleConversion/double-conversion/utils.h @@ -0,0 +1,324 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_UTILS_H_ +#define DOUBLE_CONVERSION_UTILS_H_ + +#include +#include + +#include +#ifndef ASSERT +#define ASSERT(condition) \ + assert(condition); +#endif +#ifndef UNIMPLEMENTED +#define UNIMPLEMENTED() (abort()) +#endif +#ifndef UNREACHABLE +#define UNREACHABLE() (abort()) +#endif + +// Double operations detection based on target architecture. +// Linux uses a 80bit wide floating point stack on x86. This induces double +// rounding, which in turn leads to wrong results. +// An easy way to test if the floating-point operations are correct is to +// evaluate: 89255.0/1e22. If the floating-point stack is 64 bits wide then +// the result is equal to 89255e-22. +// The best way to test this, is to create a division-function and to compare +// the output of the division with the expected result. (Inlining must be +// disabled.) +// On Linux,x86 89255e-22 != Div_double(89255.0/1e22) +#if defined(_M_X64) || defined(__x86_64__) || \ + defined(__ARMEL__) || defined(__avr32__) || \ + defined(__hppa__) || defined(__ia64__) || \ + defined(__mips__) || \ + defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || \ + defined(__AARCH64EL__) +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#elif defined(__mc68000__) +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#elif defined(_M_IX86) || defined(__i386__) || defined(__i386) +#if defined(_WIN32) +// Windows uses a 64bit wide floating point stack. +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#else +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#endif // _WIN32 +#else +#error Target architecture was not detected as supported by Double-Conversion. +#endif + +#if defined(__GNUC__) +#define DOUBLE_CONVERSION_UNUSED __attribute__((unused)) +#else +#define DOUBLE_CONVERSION_UNUSED +#endif + +#if defined(_WIN32) && !defined(__MINGW32__) + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; // NOLINT +typedef unsigned short uint16_t; // NOLINT +typedef int int32_t; +typedef unsigned int uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +// intptr_t and friends are defined in crtdefs.h through stdio.h. + +#else + +#include + +#endif + +// The following macro works on both 32 and 64-bit platforms. +// Usage: instead of writing 0x1234567890123456 +// write UINT64_2PART_C(0x12345678,90123456); +#define UINT64_2PART_C(a, b) (((static_cast(a) << 32) + 0x##b##u)) + + +// The expression ARRAY_SIZE(a) is a compile-time constant of type +// size_t which represents the number of elements of the given +// array. You should only use ARRAY_SIZE on statically allocated +// arrays. +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) \ + ((sizeof(a) / sizeof(*(a))) / \ + static_cast(!(sizeof(a) % sizeof(*(a))))) +#endif + +// A macro to disallow the evil copy constructor and operator= functions +// This should be used in the private: declarations for a class +#ifndef DISALLOW_COPY_AND_ASSIGN +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) +#endif + +// A macro to disallow all the implicit constructors, namely the +// default constructor, copy constructor and operator= functions. +// +// This should be used in the private: declarations for a class +// that wants to prevent anyone from instantiating it. This is +// especially useful for classes containing only static methods. +#ifndef DISALLOW_IMPLICIT_CONSTRUCTORS +#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName(); \ + DISALLOW_COPY_AND_ASSIGN(TypeName) +#endif + +namespace double_conversion { + +static const int kCharSize = sizeof(char); + +// Returns the maximum of the two parameters. +template +static T Max(T a, T b) { + return a < b ? b : a; +} + + +// Returns the minimum of the two parameters. +template +static T Min(T a, T b) { + return a < b ? a : b; +} + + +inline int StrLength(const char* string) { + size_t length = strlen(string); + ASSERT(length == static_cast(static_cast(length))); + return static_cast(length); +} + +// This is a simplified version of V8's Vector class. +template +class Vector { + public: + Vector() : start_(NULL), length_(0) {} + Vector(T* data, int length) : start_(data), length_(length) { + ASSERT(length == 0 || (length > 0 && data != NULL)); + } + + // Returns a vector using the same backing storage as this one, + // spanning from and including 'from', to but not including 'to'. + Vector SubVector(int from, int to) { + ASSERT(to <= length_); + ASSERT(from < to); + ASSERT(0 <= from); + return Vector(start() + from, to - from); + } + + // Returns the length of the vector. + int length() const { return length_; } + + // Returns whether or not the vector is empty. + bool is_empty() const { return length_ == 0; } + + // Returns the pointer to the start of the data in the vector. + T* start() const { return start_; } + + // Access individual vector elements - checks bounds in debug mode. + T& operator[](int index) const { + ASSERT(0 <= index && index < length_); + return start_[index]; + } + + T& first() { return start_[0]; } + + T& last() { return start_[length_ - 1]; } + + private: + T* start_; + int length_; +}; + + +// Helper class for building result strings in a character buffer. The +// purpose of the class is to use safe operations that checks the +// buffer bounds on all operations in debug mode. +class StringBuilder { + public: + StringBuilder(char* buffer, int size) + : buffer_(buffer, size), position_(0) { } + + ~StringBuilder() { if (!is_finalized()) Finalize(); } + + int size() const { return buffer_.length(); } + + // Get the current position in the builder. + int position() const { + ASSERT(!is_finalized()); + return position_; + } + + // Reset the position. + void Reset() { position_ = 0; } + + // Add a single character to the builder. It is not allowed to add + // 0-characters; use the Finalize() method to terminate the string + // instead. + void AddCharacter(char c) { + ASSERT(c != '\0'); + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_++] = c; + } + + // Add an entire string to the builder. Uses strlen() internally to + // compute the length of the input string. + void AddString(const char* s) { + AddSubstring(s, StrLength(s)); + } + + // Add the first 'n' characters of the given string 's' to the + // builder. The input string must have enough characters. + void AddSubstring(const char* s, int n) { + ASSERT(!is_finalized() && position_ + n < buffer_.length()); + ASSERT(static_cast(n) <= strlen(s)); + memmove(&buffer_[position_], s, n * kCharSize); + position_ += n; + } + + + // Add character padding to the builder. If count is non-positive, + // nothing is added to the builder. + void AddPadding(char c, int count) { + for (int i = 0; i < count; i++) { + AddCharacter(c); + } + } + + // Finalize the string by 0-terminating it and returning the buffer. + char* Finalize() { + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_] = '\0'; + // Make sure nobody managed to add a 0-character to the + // buffer while building the string. + ASSERT(strlen(buffer_.start()) == static_cast(position_)); + position_ = -1; + ASSERT(is_finalized()); + return buffer_.start(); + } + + private: + Vector buffer_; + int position_; + + bool is_finalized() const { return position_ < 0; } + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); +}; + +// The type-based aliasing rule allows the compiler to assume that pointers of +// different types (for some definition of different) never alias each other. +// Thus the following code does not work: +// +// float f = foo(); +// int fbits = *(int*)(&f); +// +// The compiler 'knows' that the int pointer can't refer to f since the types +// don't match, so the compiler may cache f in a register, leaving random data +// in fbits. Using C++ style casts makes no difference, however a pointer to +// char data is assumed to alias any other pointer. This is the 'memcpy +// exception'. +// +// Bit_cast uses the memcpy exception to move the bits from a variable of one +// type of a variable of another type. Of course the end result is likely to +// be implementation dependent. Most compilers (gcc-4.2 and MSVC 2005) +// will completely optimize BitCast away. +// +// There is an additional use for BitCast. +// Recent gccs will warn when they see casts that may result in breakage due to +// the type-based aliasing rule. If you have checked that there is no breakage +// you can use BitCast to cast one pointer type to another. This confuses gcc +// enough that it can no longer see that you have cast one pointer type to +// another thus avoiding the warning. +template +inline Dest BitCast(const Source& source) { + // Compile time assertion: sizeof(Dest) == sizeof(Source) + // A compile error here means your Dest and Source have different sizes. + DOUBLE_CONVERSION_UNUSED + typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; + + Dest dest; + memmove(&dest, &source, sizeof(dest)); + return dest; +} + +template +inline Dest BitCast(Source* source) { + return BitCast(reinterpret_cast(source)); +} + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_UTILS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/bignum-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/bignum-dtoa.h new file mode 100644 index 0000000..34b9619 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/bignum-dtoa.h @@ -0,0 +1,84 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_DTOA_H_ +#define DOUBLE_CONVERSION_BIGNUM_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum BignumDtoaMode { + // Return the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate but + // correct) 0.3. + BIGNUM_DTOA_SHORTEST, + // Same as BIGNUM_DTOA_SHORTEST but for single-precision floats. + BIGNUM_DTOA_SHORTEST_SINGLE, + // Return a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + BIGNUM_DTOA_FIXED, + // Return a fixed number of digits, no matter what the exponent is. + BIGNUM_DTOA_PRECISION +}; + +// Converts the given double 'v' to ascii. +// The result should be interpreted as buffer * 10^(point-length). +// The buffer will be null-terminated. +// +// The input v must be > 0 and different from NaN, and Infinity. +// +// The output depends on the given mode: +// - SHORTEST: produce the least amount of digits for which the internal +// identity requirement is still satisfied. If the digits are printed +// (together with the correct exponent) then reading this number will give +// 'v' again. The buffer will choose the representation that is closest to +// 'v'. If there are two at the same distance, than the number is round up. +// In this mode the 'requested_digits' parameter is ignored. +// - FIXED: produces digits necessary to print a given number with +// 'requested_digits' digits after the decimal point. The produced digits +// might be too short in which case the caller has to fill the gaps with '0's. +// Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. +// Halfway cases are rounded up. The call toFixed(0.15, 2) thus returns +// buffer="2", point=0. +// Note: the length of the returned buffer has no meaning wrt the significance +// of its digits. That is, just because it contains '0's does not mean that +// any other digit would not satisfy the internal identity requirement. +// - PRECISION: produces 'requested_digits' where the first digit is not '0'. +// Even though the length of produced digits usually equals +// 'requested_digits', the function is allowed to return fewer digits, in +// which case the caller has to fill the missing digits with '0's. +// Halfway cases are again rounded up. +// 'BignumDtoa' expects the given buffer to be big enough to hold all digits +// and a terminating null-character. +void BignumDtoa(double v, BignumDtoaMode mode, int requested_digits, + Vector buffer, int* length, int* point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/bignum.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/bignum.h new file mode 100644 index 0000000..5ec3544 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/bignum.h @@ -0,0 +1,145 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_BIGNUM_H_ +#define DOUBLE_CONVERSION_BIGNUM_H_ + +#include "utils.h" + +namespace double_conversion { + +class Bignum { + public: + // 3584 = 128 * 28. We can represent 2^3584 > 10^1000 accurately. + // This bignum can encode much bigger numbers, since it contains an + // exponent. + static const int kMaxSignificantBits = 3584; + + Bignum(); + void AssignUInt16(uint16_t value); + void AssignUInt64(uint64_t value); + void AssignBignum(const Bignum& other); + + void AssignDecimalString(Vector value); + void AssignHexString(Vector value); + + void AssignPowerUInt16(uint16_t base, int exponent); + + void AddUInt16(uint16_t operand); + void AddUInt64(uint64_t operand); + void AddBignum(const Bignum& other); + // Precondition: this >= other. + void SubtractBignum(const Bignum& other); + + void Square(); + void ShiftLeft(int shift_amount); + void MultiplyByUInt32(uint32_t factor); + void MultiplyByUInt64(uint64_t factor); + void MultiplyByPowerOfTen(int exponent); + void Times10() { return MultiplyByUInt32(10); } + // Pseudocode: + // int result = this / other; + // this = this % other; + // In the worst case this function is in O(this/other). + uint16_t DivideModuloIntBignum(const Bignum& other); + + bool ToHexString(char* buffer, int buffer_size) const; + + // Returns + // -1 if a < b, + // 0 if a == b, and + // +1 if a > b. + static int Compare(const Bignum& a, const Bignum& b); + static bool Equal(const Bignum& a, const Bignum& b) { + return Compare(a, b) == 0; + } + static bool LessEqual(const Bignum& a, const Bignum& b) { + return Compare(a, b) <= 0; + } + static bool Less(const Bignum& a, const Bignum& b) { + return Compare(a, b) < 0; + } + // Returns Compare(a + b, c); + static int PlusCompare(const Bignum& a, const Bignum& b, const Bignum& c); + // Returns a + b == c + static bool PlusEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) == 0; + } + // Returns a + b <= c + static bool PlusLessEqual(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) <= 0; + } + // Returns a + b < c + static bool PlusLess(const Bignum& a, const Bignum& b, const Bignum& c) { + return PlusCompare(a, b, c) < 0; + } + private: + typedef uint32_t Chunk; + typedef uint64_t DoubleChunk; + + static const int kChunkSize = sizeof(Chunk) * 8; + static const int kDoubleChunkSize = sizeof(DoubleChunk) * 8; + // With bigit size of 28 we loose some bits, but a double still fits easily + // into two chunks, and more importantly we can use the Comba multiplication. + static const int kBigitSize = 28; + static const Chunk kBigitMask = (1 << kBigitSize) - 1; + // Every instance allocates kBigitLength chunks on the stack. Bignums cannot + // grow. There are no checks if the stack-allocated space is sufficient. + static const int kBigitCapacity = kMaxSignificantBits / kBigitSize; + + void EnsureCapacity(int size) { + if (size > kBigitCapacity) { + UNREACHABLE(); + } + } + void Align(const Bignum& other); + void Clamp(); + bool IsClamped() const; + void Zero(); + // Requires this to have enough capacity (no tests done). + // Updates used_digits_ if necessary. + // shift_amount must be < kBigitSize. + void BigitsShiftLeft(int shift_amount); + // BigitLength includes the "hidden" digits encoded in the exponent. + int BigitLength() const { return used_digits_ + exponent_; } + Chunk BigitAt(int index) const; + void SubtractTimes(const Bignum& other, int factor); + + Chunk bigits_buffer_[kBigitCapacity]; + // A vector backed by bigits_buffer_. This way accesses to the array are + // checked for out-of-bounds errors. + Vector bigits_; + int used_digits_; + // The Bignum's value equals value(bigits_) * 2^(exponent_ * kBigitSize). + int exponent_; + + DISALLOW_COPY_AND_ASSIGN(Bignum); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_BIGNUM_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/cached-powers.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/cached-powers.h new file mode 100644 index 0000000..61a5061 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/cached-powers.h @@ -0,0 +1,64 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_CACHED_POWERS_H_ +#define DOUBLE_CONVERSION_CACHED_POWERS_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +class PowersOfTenCache { + public: + + // Not all powers of ten are cached. The decimal exponent of two neighboring + // cached numbers will differ by kDecimalExponentDistance. + static const int kDecimalExponentDistance; + + static const int kMinDecimalExponent; + static const int kMaxDecimalExponent; + + // Returns a cached power-of-ten with a binary exponent in the range + // [min_exponent; max_exponent] (boundaries included). + static void GetCachedPowerForBinaryExponentRange(int min_exponent, + int max_exponent, + DiyFp* power, + int* decimal_exponent); + + // Returns a cached power of ten x ~= 10^k such that + // k <= decimal_exponent < k + kCachedPowersDecimalDistance. + // The given decimal_exponent must satisfy + // kMinDecimalExponent <= requested_exponent, and + // requested_exponent < kMaxDecimalExponent + kDecimalExponentDistance. + static void GetCachedPowerForDecimalExponent(int requested_exponent, + DiyFp* power, + int* found_exponent); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_CACHED_POWERS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/diy-fp.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/diy-fp.h new file mode 100644 index 0000000..9dcf8fb --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/diy-fp.h @@ -0,0 +1,118 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DIY_FP_H_ +#define DOUBLE_CONVERSION_DIY_FP_H_ + +#include "utils.h" + +namespace double_conversion { + +// This "Do It Yourself Floating Point" class implements a floating-point number +// with a uint64 significand and an int exponent. Normalized DiyFp numbers will +// have the most significant bit of the significand set. +// Multiplication and Subtraction do not normalize their results. +// DiyFp are not designed to contain special doubles (NaN and Infinity). +class DiyFp { + public: + static const int kSignificandSize = 64; + + DiyFp() : f_(0), e_(0) {} + DiyFp(uint64_t f, int e) : f_(f), e_(e) {} + + // this = this - other. + // The exponents of both numbers must be the same and the significand of this + // must be bigger than the significand of other. + // The result will not be normalized. + void Subtract(const DiyFp& other) { + ASSERT(e_ == other.e_); + ASSERT(f_ >= other.f_); + f_ -= other.f_; + } + + // Returns a - b. + // The exponents of both numbers must be the same and this must be bigger + // than other. The result will not be normalized. + static DiyFp Minus(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Subtract(b); + return result; + } + + + // this = this * other. + void Multiply(const DiyFp& other); + + // returns a * b; + static DiyFp Times(const DiyFp& a, const DiyFp& b) { + DiyFp result = a; + result.Multiply(b); + return result; + } + + void Normalize() { + ASSERT(f_ != 0); + uint64_t f = f_; + int e = e_; + + // This method is mainly called for normalizing boundaries. In general + // boundaries need to be shifted by 10 bits. We thus optimize for this case. + const uint64_t k10MSBits = UINT64_2PART_C(0xFFC00000, 00000000); + while ((f & k10MSBits) == 0) { + f <<= 10; + e -= 10; + } + while ((f & kUint64MSB) == 0) { + f <<= 1; + e--; + } + f_ = f; + e_ = e; + } + + static DiyFp Normalize(const DiyFp& a) { + DiyFp result = a; + result.Normalize(); + return result; + } + + uint64_t f() const { return f_; } + int e() const { return e_; } + + void set_f(uint64_t new_value) { f_ = new_value; } + void set_e(int new_value) { e_ = new_value; } + + private: + static const uint64_t kUint64MSB = UINT64_2PART_C(0x80000000, 00000000); + + uint64_t f_; + int e_; +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DIY_FP_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/double-conversion.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/double-conversion.h new file mode 100644 index 0000000..1c3387d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/double-conversion.h @@ -0,0 +1,536 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ +#define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ + +#include "utils.h" + +namespace double_conversion { + +class DoubleToStringConverter { + public: + // When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint + // or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the + // function returns false. + static const int kMaxFixedDigitsBeforePoint = 60; + static const int kMaxFixedDigitsAfterPoint = 60; + + // When calling ToExponential with a requested_digits + // parameter > kMaxExponentialDigits then the function returns false. + static const int kMaxExponentialDigits = 120; + + // When calling ToPrecision with a requested_digits + // parameter < kMinPrecisionDigits or requested_digits > kMaxPrecisionDigits + // then the function returns false. + static const int kMinPrecisionDigits = 1; + static const int kMaxPrecisionDigits = 120; + + enum Flags { + NO_FLAGS = 0, + EMIT_POSITIVE_EXPONENT_SIGN = 1, + EMIT_TRAILING_DECIMAL_POINT = 2, + EMIT_TRAILING_ZERO_AFTER_POINT = 4, + UNIQUE_ZERO = 8 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - EMIT_POSITIVE_EXPONENT_SIGN: when the number is converted into exponent + // form, emits a '+' for positive exponents. Example: 1.2e+2. + // - EMIT_TRAILING_DECIMAL_POINT: when the input number is an integer and is + // converted into decimal format then a trailing decimal point is appended. + // Example: 2345.0 is converted to "2345.". + // - EMIT_TRAILING_ZERO_AFTER_POINT: in addition to a trailing decimal point + // emits a trailing '0'-character. This flag requires the + // EXMIT_TRAILING_DECIMAL_POINT flag. + // Example: 2345.0 is converted to "2345.0". + // - UNIQUE_ZERO: "-0.0" is converted to "0.0". + // + // Infinity symbol and nan_symbol provide the string representation for these + // special values. If the string is NULL and the special value is encountered + // then the conversion functions return false. + // + // The exponent_character is used in exponential representations. It is + // usually 'e' or 'E'. + // + // When converting to the shortest representation the converter will + // represent input numbers in decimal format if they are in the interval + // [10^decimal_in_shortest_low; 10^decimal_in_shortest_high[ + // (lower boundary included, greater boundary excluded). + // Example: with decimal_in_shortest_low = -6 and + // decimal_in_shortest_high = 21: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // When converting to precision mode the converter may add + // max_leading_padding_zeroes before returning the number in exponential + // format. + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + DoubleToStringConverter(int flags, + const char* infinity_symbol, + const char* nan_symbol, + char exponent_character, + int decimal_in_shortest_low, + int decimal_in_shortest_high, + int max_leading_padding_zeroes_in_precision_mode, + int max_trailing_padding_zeroes_in_precision_mode) + : flags_(flags), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol), + exponent_character_(exponent_character), + decimal_in_shortest_low_(decimal_in_shortest_low), + decimal_in_shortest_high_(decimal_in_shortest_high), + max_leading_padding_zeroes_in_precision_mode_( + max_leading_padding_zeroes_in_precision_mode), + max_trailing_padding_zeroes_in_precision_mode_( + max_trailing_padding_zeroes_in_precision_mode) { + // When 'trailing zero after the point' is set, then 'trailing point' + // must be set too. + ASSERT(((flags & EMIT_TRAILING_DECIMAL_POINT) != 0) || + !((flags & EMIT_TRAILING_ZERO_AFTER_POINT) != 0)); + } + + // Returns a converter following the EcmaScript specification. + static const DoubleToStringConverter& EcmaScriptConverter(); + + // Computes the shortest string of digits that correctly represent the input + // number. Depending on decimal_in_shortest_low and decimal_in_shortest_high + // (see constructor) it then either returns a decimal representation, or an + // exponential representation. + // Example with decimal_in_shortest_low = -6, + // decimal_in_shortest_high = 21, + // EMIT_POSITIVE_EXPONENT_SIGN activated, and + // EMIT_TRAILING_DECIMAL_POINT deactived: + // ToShortest(0.000001) -> "0.000001" + // ToShortest(0.0000001) -> "1e-7" + // ToShortest(111111111111111111111.0) -> "111111111111111110000" + // ToShortest(100000000000000000000.0) -> "100000000000000000000" + // ToShortest(1111111111111111111111.0) -> "1.1111111111111111e+21" + // + // Note: the conversion may round the output if the returned string + // is accurate enough to uniquely identify the input-number. + // For example the most precise representation of the double 9e59 equals + // "899999999999999918767229449717619953810131273674690656206848", but + // the converter will return the shorter (but still correct) "9e59". + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except when the input value is special and no infinity_symbol or + // nan_symbol has been given to the constructor. + bool ToShortest(double value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST); + } + + // Same as ToShortest, but for single-precision floats. + bool ToShortestSingle(float value, StringBuilder* result_builder) const { + return ToShortestIeeeNumber(value, result_builder, SHORTEST_SINGLE); + } + + + // Computes a decimal representation with a fixed number of digits after the + // decimal point. The last emitted digit is rounded. + // + // Examples: + // ToFixed(3.12, 1) -> "3.1" + // ToFixed(3.1415, 3) -> "3.142" + // ToFixed(1234.56789, 4) -> "1234.5679" + // ToFixed(1.23, 5) -> "1.23000" + // ToFixed(0.1, 4) -> "0.1000" + // ToFixed(1e30, 2) -> "1000000000000000019884624838656.00" + // ToFixed(0.1, 30) -> "0.100000000000000005551115123126" + // ToFixed(0.1, 17) -> "0.10000000000000001" + // + // If requested_digits equals 0, then the tail of the result depends on + // the EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples, for requested_digits == 0, + // let EMIT_TRAILING_DECIMAL_POINT and EMIT_TRAILING_ZERO_AFTER_POINT be + // - false and false: then 123.45 -> 123 + // 0.678 -> 1 + // - true and false: then 123.45 -> 123. + // 0.678 -> 1. + // - true and true: then 123.45 -> 123.0 + // 0.678 -> 1.0 + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'value' > 10^kMaxFixedDigitsBeforePoint, or + // - 'requested_digits' > kMaxFixedDigitsAfterPoint. + // The last two conditions imply that the result will never contain more than + // 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters + // (one additional character for the sign, and one for the decimal point). + bool ToFixed(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes a representation in exponential format with requested_digits + // after the decimal point. The last emitted digit is rounded. + // If requested_digits equals -1, then the shortest exponential representation + // is computed. + // + // Examples with EMIT_POSITIVE_EXPONENT_SIGN deactivated, and + // exponent_character set to 'e'. + // ToExponential(3.12, 1) -> "3.1e0" + // ToExponential(5.0, 3) -> "5.000e0" + // ToExponential(0.001, 2) -> "1.00e-3" + // ToExponential(3.1415, -1) -> "3.1415e0" + // ToExponential(3.1415, 4) -> "3.1415e0" + // ToExponential(3.1415, 3) -> "3.142e0" + // ToExponential(123456789000000, 3) -> "1.235e14" + // ToExponential(1000000000000000019884624838656.0, -1) -> "1e30" + // ToExponential(1000000000000000019884624838656.0, 32) -> + // "1.00000000000000001988462483865600e30" + // ToExponential(1234, 0) -> "1e3" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - 'requested_digits' > kMaxExponentialDigits. + // The last condition implies that the result will never contain more than + // kMaxExponentialDigits + 8 characters (the sign, the digit before the + // decimal point, the decimal point, the exponent character, the + // exponent's sign, and at most 3 exponent digits). + bool ToExponential(double value, + int requested_digits, + StringBuilder* result_builder) const; + + // Computes 'precision' leading digits of the given 'value' and returns them + // either in exponential or decimal format, depending on + // max_{leading|trailing}_padding_zeroes_in_precision_mode (given to the + // constructor). + // The last computed digit is rounded. + // + // Example with max_leading_padding_zeroes_in_precision_mode = 6. + // ToPrecision(0.0000012345, 2) -> "0.0000012" + // ToPrecision(0.00000012345, 2) -> "1.2e-7" + // Similarily the converter may add up to + // max_trailing_padding_zeroes_in_precision_mode in precision mode to avoid + // returning an exponential representation. A zero added by the + // EMIT_TRAILING_ZERO_AFTER_POINT flag is counted for this limit. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 1: + // ToPrecision(230.0, 2) -> "230" + // ToPrecision(230.0, 2) -> "230." with EMIT_TRAILING_DECIMAL_POINT. + // ToPrecision(230.0, 2) -> "2.3e2" with EMIT_TRAILING_ZERO_AFTER_POINT. + // Examples for max_trailing_padding_zeroes_in_precision_mode = 3, and no + // EMIT_TRAILING_ZERO_AFTER_POINT: + // ToPrecision(123450.0, 6) -> "123450" + // ToPrecision(123450.0, 5) -> "123450" + // ToPrecision(123450.0, 4) -> "123500" + // ToPrecision(123450.0, 3) -> "123000" + // ToPrecision(123450.0, 2) -> "1.2e5" + // + // Returns true if the conversion succeeds. The conversion always succeeds + // except for the following cases: + // - the input value is special and no infinity_symbol or nan_symbol has + // been provided to the constructor, + // - precision < kMinPericisionDigits + // - precision > kMaxPrecisionDigits + // The last condition implies that the result will never contain more than + // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the + // exponent character, the exponent's sign, and at most 3 exponent digits). + bool ToPrecision(double value, + int precision, + StringBuilder* result_builder) const; + + enum DtoaMode { + // Produce the shortest correct representation. + // For example the output of 0.299999999999999988897 is (the less accurate + // but correct) 0.3. + SHORTEST, + // Same as SHORTEST, but for single-precision floats. + SHORTEST_SINGLE, + // Produce a fixed number of digits after the decimal point. + // For instance fixed(0.1, 4) becomes 0.1000 + // If the input number is big, the output will be big. + FIXED, + // Fixed number of digits (independent of the decimal point). + PRECISION + }; + + // The maximal number of digits that are needed to emit a double in base 10. + // A higher precision can be achieved by using more digits, but the shortest + // accurate representation of any double will never use more digits than + // kBase10MaximalLength. + // Note that DoubleToAscii null-terminates its input. So the given buffer + // should be at least kBase10MaximalLength + 1 characters long. + static const int kBase10MaximalLength = 17; + + // Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or + // -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v' + // after it has been casted to a single-precision float. That is, in this + // mode static_cast(v) must not be NaN, +Infinity or -Infinity. + // + // The result should be interpreted as buffer * 10^(point-length). + // + // The output depends on the given mode: + // - SHORTEST: produce the least amount of digits for which the internal + // identity requirement is still satisfied. If the digits are printed + // (together with the correct exponent) then reading this number will give + // 'v' again. The buffer will choose the representation that is closest to + // 'v'. If there are two at the same distance, than the one farther away + // from 0 is chosen (halfway cases - ending with 5 - are rounded up). + // In this mode the 'requested_digits' parameter is ignored. + // - SHORTEST_SINGLE: same as SHORTEST but with single-precision. + // - FIXED: produces digits necessary to print a given number with + // 'requested_digits' digits after the decimal point. The produced digits + // might be too short in which case the caller has to fill the remainder + // with '0's. + // Example: toFixed(0.001, 5) is allowed to return buffer="1", point=-2. + // Halfway cases are rounded towards +/-Infinity (away from 0). The call + // toFixed(0.15, 2) thus returns buffer="2", point=0. + // The returned buffer may contain digits that would be truncated from the + // shortest representation of the input. + // - PRECISION: produces 'requested_digits' where the first digit is not '0'. + // Even though the length of produced digits usually equals + // 'requested_digits', the function is allowed to return fewer digits, in + // which case the caller has to fill the missing digits with '0's. + // Halfway cases are again rounded away from 0. + // DoubleToAscii expects the given buffer to be big enough to hold all + // digits and a terminating null-character. In SHORTEST-mode it expects a + // buffer of at least kBase10MaximalLength + 1. In all other modes the + // requested_digits parameter and the padding-zeroes limit the size of the + // output. Don't forget the decimal point, the exponent character and the + // terminating null-character when computing the maximal output size. + // The given length is only used in debug mode to ensure the buffer is big + // enough. + static void DoubleToAscii(double v, + DtoaMode mode, + int requested_digits, + char* buffer, + int buffer_length, + bool* sign, + int* length, + int* point); + + private: + // Implementation for ToShortest and ToShortestSingle. + bool ToShortestIeeeNumber(double value, + StringBuilder* result_builder, + DtoaMode mode) const; + + // If the value is a special value (NaN or Infinity) constructs the + // corresponding string using the configured infinity/nan-symbol. + // If either of them is NULL or the value is not special then the + // function returns false. + bool HandleSpecialValues(double value, StringBuilder* result_builder) const; + // Constructs an exponential representation (i.e. 1.234e56). + // The given exponent assumes a decimal point after the first decimal digit. + void CreateExponentialRepresentation(const char* decimal_digits, + int length, + int exponent, + StringBuilder* result_builder) const; + // Creates a decimal representation (i.e 1234.5678). + void CreateDecimalRepresentation(const char* decimal_digits, + int length, + int decimal_point, + int digits_after_point, + StringBuilder* result_builder) const; + + const int flags_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + const char exponent_character_; + const int decimal_in_shortest_low_; + const int decimal_in_shortest_high_; + const int max_leading_padding_zeroes_in_precision_mode_; + const int max_trailing_padding_zeroes_in_precision_mode_; + + DISALLOW_IMPLICIT_CONSTRUCTORS(DoubleToStringConverter); +}; + + +class StringToDoubleConverter { + public: + // Enumeration for allowing octals and ignoring junk when converting + // strings to numbers. + enum Flags { + NO_FLAGS = 0, + ALLOW_HEX = 1, + ALLOW_OCTALS = 2, + ALLOW_TRAILING_JUNK = 4, + ALLOW_LEADING_SPACES = 8, + ALLOW_TRAILING_SPACES = 16, + ALLOW_SPACES_AFTER_SIGN = 32 + }; + + // Flags should be a bit-or combination of the possible Flags-enum. + // - NO_FLAGS: no special flags. + // - ALLOW_HEX: recognizes the prefix "0x". Hex numbers may only be integers. + // Ex: StringToDouble("0x1234") -> 4660.0 + // In StringToDouble("0x1234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // With this flag "0x" is a junk-string. Even with ALLOW_TRAILING_JUNK, + // the string will not be parsed as "0" followed by junk. + // + // - ALLOW_OCTALS: recognizes the prefix "0" for octals: + // If a sequence of octal digits starts with '0', then the number is + // read as octal integer. Octal numbers may only be integers. + // Ex: StringToDouble("01234") -> 668.0 + // StringToDouble("012349") -> 12349.0 // Not a sequence of octal + // // digits. + // In StringToDouble("01234.56") the characters ".56" are trailing + // junk. The result of the call is hence dependent on + // the ALLOW_TRAILING_JUNK flag and/or the junk value. + // In StringToDouble("01234e56") the characters "e56" are trailing + // junk, too. + // - ALLOW_TRAILING_JUNK: ignore trailing characters that are not part of + // a double literal. + // - ALLOW_LEADING_SPACES: skip over leading spaces. + // - ALLOW_TRAILING_SPACES: ignore trailing spaces. + // - ALLOW_SPACES_AFTER_SIGN: ignore spaces after the sign. + // Ex: StringToDouble("- 123.2") -> -123.2. + // StringToDouble("+ 123.2") -> 123.2 + // + // empty_string_value is returned when an empty string is given as input. + // If ALLOW_LEADING_SPACES or ALLOW_TRAILING_SPACES are set, then a string + // containing only spaces is converted to the 'empty_string_value', too. + // + // junk_string_value is returned when + // a) ALLOW_TRAILING_JUNK is not set, and a junk character (a character not + // part of a double-literal) is found. + // b) ALLOW_TRAILING_JUNK is set, but the string does not start with a + // double literal. + // + // infinity_symbol and nan_symbol are strings that are used to detect + // inputs that represent infinity and NaN. They can be null, in which case + // they are ignored. + // The conversion routine first reads any possible signs. Then it compares the + // following character of the input-string with the first character of + // the infinity, and nan-symbol. If either matches, the function assumes, that + // a match has been found, and expects the following input characters to match + // the remaining characters of the special-value symbol. + // This means that the following restrictions apply to special-value symbols: + // - they must not start with signs ('+', or '-'), + // - they must not have the same first character. + // - they must not start with digits. + // + // Examples: + // flags = ALLOW_HEX | ALLOW_TRAILING_JUNK, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = "infinity", + // nan_symbol = "nan": + // StringToDouble("0x1234") -> 4660.0. + // StringToDouble("0x1234K") -> 4660.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> NaN // junk_string_value. + // StringToDouble(" 1") -> NaN // junk_string_value. + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("-123.45") -> -123.45. + // StringToDouble("--123.45") -> NaN // junk_string_value. + // StringToDouble("123e45") -> 123e45. + // StringToDouble("123E45") -> 123e45. + // StringToDouble("123e+45") -> 123e45. + // StringToDouble("123E-45") -> 123e-45. + // StringToDouble("123e") -> 123.0 // trailing junk ignored. + // StringToDouble("123e-") -> 123.0 // trailing junk ignored. + // StringToDouble("+NaN") -> NaN // NaN string literal. + // StringToDouble("-infinity") -> -inf. // infinity literal. + // StringToDouble("Infinity") -> NaN // junk_string_value. + // + // flags = ALLOW_OCTAL | ALLOW_LEADING_SPACES, + // empty_string_value = 0.0, + // junk_string_value = NaN, + // infinity_symbol = NULL, + // nan_symbol = NULL: + // StringToDouble("0x1234") -> NaN // junk_string_value. + // StringToDouble("01234") -> 668.0. + // StringToDouble("") -> 0.0 // empty_string_value. + // StringToDouble(" ") -> 0.0 // empty_string_value. + // StringToDouble(" 1") -> 1.0 + // StringToDouble("0x") -> NaN // junk_string_value. + // StringToDouble("0123e45") -> NaN // junk_string_value. + // StringToDouble("01239E45") -> 1239e45. + // StringToDouble("-infinity") -> NaN // junk_string_value. + // StringToDouble("NaN") -> NaN // junk_string_value. + StringToDoubleConverter(int flags, + double empty_string_value, + double junk_string_value, + const char* infinity_symbol, + const char* nan_symbol) + : flags_(flags), + empty_string_value_(empty_string_value), + junk_string_value_(junk_string_value), + infinity_symbol_(infinity_symbol), + nan_symbol_(nan_symbol) { + } + + // Performs the conversion. + // The output parameter 'processed_characters_count' is set to the number + // of characters that have been processed to read the number. + // Spaces than are processed with ALLOW_{LEADING|TRAILING}_SPACES are included + // in the 'processed_characters_count'. Trailing junk is never included. + double StringToDouble(const char* buffer, + int length, + int* processed_characters_count) const { + return StringToIeee(buffer, length, processed_characters_count, true); + } + + // Same as StringToDouble but reads a float. + // Note that this is not equivalent to static_cast(StringToDouble(...)) + // due to potential double-rounding. + float StringToFloat(const char* buffer, + int length, + int* processed_characters_count) const { + return static_cast(StringToIeee(buffer, length, + processed_characters_count, false)); + } + + private: + const int flags_; + const double empty_string_value_; + const double junk_string_value_; + const char* const infinity_symbol_; + const char* const nan_symbol_; + + double StringToIeee(const char* buffer, + int length, + int* processed_characters_count, + bool read_as_double) const; + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringToDoubleConverter); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/fast-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/fast-dtoa.h new file mode 100644 index 0000000..5f1e8ee --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/fast-dtoa.h @@ -0,0 +1,88 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FAST_DTOA_H_ +#define DOUBLE_CONVERSION_FAST_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +enum FastDtoaMode { + // Computes the shortest representation of the given input. The returned + // result will be the most accurate number of this length. Longer + // representations might be more accurate. + FAST_DTOA_SHORTEST, + // Same as FAST_DTOA_SHORTEST but for single-precision floats. + FAST_DTOA_SHORTEST_SINGLE, + // Computes a representation where the precision (number of digits) is + // given as input. The precision is independent of the decimal point. + FAST_DTOA_PRECISION +}; + +// FastDtoa will produce at most kFastDtoaMaximalLength digits. This does not +// include the terminating '\0' character. +static const int kFastDtoaMaximalLength = 17; +// Same for single-precision numbers. +static const int kFastDtoaMaximalSingleLength = 9; + +// Provides a decimal representation of v. +// The result should be interpreted as buffer * 10^(point - length). +// +// Precondition: +// * v must be a strictly positive finite double. +// +// Returns true if it succeeds, otherwise the result can not be trusted. +// There will be *length digits inside the buffer followed by a null terminator. +// If the function returns true and mode equals +// - FAST_DTOA_SHORTEST, then +// the parameter requested_digits is ignored. +// The result satisfies +// v == (double) (buffer * 10^(point - length)). +// The digits in the buffer are the shortest representation possible. E.g. +// if 0.099999999999 and 0.1 represent the same double then "1" is returned +// with point = 0. +// The last digit will be closest to the actual v. That is, even if several +// digits might correctly yield 'v' when read again, the buffer will contain +// the one closest to v. +// - FAST_DTOA_PRECISION, then +// the buffer contains requested_digits digits. +// the difference v - (buffer * 10^(point-length)) is closest to zero for +// all possible representations of requested_digits digits. +// If there are two values that are equally close, then FastDtoa returns +// false. +// For both modes the buffer must be large enough to hold the result. +bool FastDtoa(double d, + FastDtoaMode mode, + int requested_digits, + Vector buffer, + int* length, + int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FAST_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/fixed-dtoa.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/fixed-dtoa.h new file mode 100644 index 0000000..3bdd08e --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/fixed-dtoa.h @@ -0,0 +1,56 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_FIXED_DTOA_H_ +#define DOUBLE_CONVERSION_FIXED_DTOA_H_ + +#include "utils.h" + +namespace double_conversion { + +// Produces digits necessary to print a given number with +// 'fractional_count' digits after the decimal point. +// The buffer must be big enough to hold the result plus one terminating null +// character. +// +// The produced digits might be too short in which case the caller has to fill +// the gaps with '0's. +// Example: FastFixedDtoa(0.001, 5, ...) is allowed to return buffer = "1", and +// decimal_point = -2. +// Halfway cases are rounded towards +/-Infinity (away from 0). The call +// FastFixedDtoa(0.15, 2, ...) thus returns buffer = "2", decimal_point = 0. +// The returned buffer may contain digits that would be truncated from the +// shortest representation of the input. +// +// This method only works for some parameters. If it can't handle the input it +// returns false. The output is null-terminated when the function succeeds. +bool FastFixedDtoa(double v, int fractional_count, + Vector buffer, int* length, int* decimal_point); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_FIXED_DTOA_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/ieee.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/ieee.h new file mode 100644 index 0000000..661141d --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/ieee.h @@ -0,0 +1,402 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_DOUBLE_H_ +#define DOUBLE_CONVERSION_DOUBLE_H_ + +#include "diy-fp.h" + +namespace double_conversion { + +// We assume that doubles and uint64_t have the same endianness. +static uint64_t double_to_uint64(double d) { return BitCast(d); } +static double uint64_to_double(uint64_t d64) { return BitCast(d64); } +static uint32_t float_to_uint32(float f) { return BitCast(f); } +static float uint32_to_float(uint32_t d32) { return BitCast(d32); } + +// Helper functions for doubles. +class Double { + public: + static const uint64_t kSignMask = UINT64_2PART_C(0x80000000, 00000000); + static const uint64_t kExponentMask = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kSignificandMask = UINT64_2PART_C(0x000FFFFF, FFFFFFFF); + static const uint64_t kHiddenBit = UINT64_2PART_C(0x00100000, 00000000); + static const int kPhysicalSignificandSize = 52; // Excludes the hidden bit. + static const int kSignificandSize = 53; + + Double() : d64_(0) {} + explicit Double(double d) : d64_(double_to_uint64(d)) {} + explicit Double(uint64_t d64) : d64_(d64) {} + explicit Double(DiyFp diy_fp) + : d64_(DiyFpToUint64(diy_fp)) {} + + // The value encoded by this Double must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // The value encoded by this Double must be strictly greater than 0. + DiyFp AsNormalizedDiyFp() const { + ASSERT(value() > 0.0); + uint64_t f = Significand(); + int e = Exponent(); + + // The current double could be a denormal. + while ((f & kHiddenBit) == 0) { + f <<= 1; + e--; + } + // Do the final shifts in one go. + f <<= DiyFp::kSignificandSize - kSignificandSize; + e -= DiyFp::kSignificandSize - kSignificandSize; + return DiyFp(f, e); + } + + // Returns the double's bit as uint64. + uint64_t AsUint64() const { + return d64_; + } + + // Returns the next greater double. Returns +infinity on input +infinity. + double NextDouble() const { + if (d64_ == kInfinity) return Double(kInfinity).value(); + if (Sign() < 0 && Significand() == 0) { + // -0.0 + return 0.0; + } + if (Sign() < 0) { + return Double(d64_ - 1).value(); + } else { + return Double(d64_ + 1).value(); + } + } + + double PreviousDouble() const { + if (d64_ == (kInfinity | kSignMask)) return -Double::Infinity(); + if (Sign() < 0) { + return Double(d64_ + 1).value(); + } else { + if (Significand() == 0) return -0.0; + return Double(d64_ - 1).value(); + } + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint64_t d64 = AsUint64(); + int biased_e = + static_cast((d64 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint64_t Significand() const { + uint64_t d64 = AsUint64(); + uint64_t significand = d64 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the double is a denormal. + bool IsDenormal() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint64_t d64 = AsUint64(); + return (d64 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint64_t d64 = AsUint64(); + return ((d64 & kExponentMask) == kExponentMask) && + ((d64 & kSignificandMask) == 0); + } + + int Sign() const { + uint64_t d64 = AsUint64(); + return (d64 & kSignMask) == 0? 1: -1; + } + + // Precondition: the value encoded by this Double must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Double must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint64() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + double value() const { return uint64_to_double(d64_); } + + // Returns the significand size for a given order of magnitude. + // If v = f*2^e with 2^p-1 <= f <= 2^p then p+e is v's order of magnitude. + // This function returns the number of significant binary digits v will have + // once it's encoded into a double. In almost all cases this is equal to + // kSignificandSize. The only exceptions are denormals. They start with + // leading zeroes and their effective significand-size is hence smaller. + static int SignificandSizeForOrderOfMagnitude(int order) { + if (order >= (kDenormalExponent + kSignificandSize)) { + return kSignificandSize; + } + if (order <= kDenormalExponent) return 0; + return order - kDenormalExponent; + } + + static double Infinity() { + return Double(kInfinity).value(); + } + + static double NaN() { + return Double(kNaN).value(); + } + + private: + static const int kExponentBias = 0x3FF + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0x7FF - kExponentBias; + static const uint64_t kInfinity = UINT64_2PART_C(0x7FF00000, 00000000); + static const uint64_t kNaN = UINT64_2PART_C(0x7FF80000, 00000000); + + const uint64_t d64_; + + static uint64_t DiyFpToUint64(DiyFp diy_fp) { + uint64_t significand = diy_fp.f(); + int exponent = diy_fp.e(); + while (significand > kHiddenBit + kSignificandMask) { + significand >>= 1; + exponent++; + } + if (exponent >= kMaxExponent) { + return kInfinity; + } + if (exponent < kDenormalExponent) { + return 0; + } + while (exponent > kDenormalExponent && (significand & kHiddenBit) == 0) { + significand <<= 1; + exponent--; + } + uint64_t biased_exponent; + if (exponent == kDenormalExponent && (significand & kHiddenBit) == 0) { + biased_exponent = 0; + } else { + biased_exponent = static_cast(exponent + kExponentBias); + } + return (significand & kSignificandMask) | + (biased_exponent << kPhysicalSignificandSize); + } + + DISALLOW_COPY_AND_ASSIGN(Double); +}; + +class Single { + public: + static const uint32_t kSignMask = 0x80000000; + static const uint32_t kExponentMask = 0x7F800000; + static const uint32_t kSignificandMask = 0x007FFFFF; + static const uint32_t kHiddenBit = 0x00800000; + static const int kPhysicalSignificandSize = 23; // Excludes the hidden bit. + static const int kSignificandSize = 24; + + Single() : d32_(0) {} + explicit Single(float f) : d32_(float_to_uint32(f)) {} + explicit Single(uint32_t d32) : d32_(d32) {} + + // The value encoded by this Single must be greater or equal to +0.0. + // It must not be special (infinity, or NaN). + DiyFp AsDiyFp() const { + ASSERT(Sign() > 0); + ASSERT(!IsSpecial()); + return DiyFp(Significand(), Exponent()); + } + + // Returns the single's bit as uint64. + uint32_t AsUint32() const { + return d32_; + } + + int Exponent() const { + if (IsDenormal()) return kDenormalExponent; + + uint32_t d32 = AsUint32(); + int biased_e = + static_cast((d32 & kExponentMask) >> kPhysicalSignificandSize); + return biased_e - kExponentBias; + } + + uint32_t Significand() const { + uint32_t d32 = AsUint32(); + uint32_t significand = d32 & kSignificandMask; + if (!IsDenormal()) { + return significand + kHiddenBit; + } else { + return significand; + } + } + + // Returns true if the single is a denormal. + bool IsDenormal() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == 0; + } + + // We consider denormals not to be special. + // Hence only Infinity and NaN are special. + bool IsSpecial() const { + uint32_t d32 = AsUint32(); + return (d32 & kExponentMask) == kExponentMask; + } + + bool IsNan() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) != 0); + } + + bool IsInfinite() const { + uint32_t d32 = AsUint32(); + return ((d32 & kExponentMask) == kExponentMask) && + ((d32 & kSignificandMask) == 0); + } + + int Sign() const { + uint32_t d32 = AsUint32(); + return (d32 & kSignMask) == 0? 1: -1; + } + + // Computes the two boundaries of this. + // The bigger boundary (m_plus) is normalized. The lower boundary has the same + // exponent as m_plus. + // Precondition: the value encoded by this Single must be greater than 0. + void NormalizedBoundaries(DiyFp* out_m_minus, DiyFp* out_m_plus) const { + ASSERT(value() > 0.0); + DiyFp v = this->AsDiyFp(); + DiyFp m_plus = DiyFp::Normalize(DiyFp((v.f() << 1) + 1, v.e() - 1)); + DiyFp m_minus; + if (LowerBoundaryIsCloser()) { + m_minus = DiyFp((v.f() << 2) - 1, v.e() - 2); + } else { + m_minus = DiyFp((v.f() << 1) - 1, v.e() - 1); + } + m_minus.set_f(m_minus.f() << (m_minus.e() - m_plus.e())); + m_minus.set_e(m_plus.e()); + *out_m_plus = m_plus; + *out_m_minus = m_minus; + } + + // Precondition: the value encoded by this Single must be greater or equal + // than +0.0. + DiyFp UpperBoundary() const { + ASSERT(Sign() > 0); + return DiyFp(Significand() * 2 + 1, Exponent() - 1); + } + + bool LowerBoundaryIsCloser() const { + // The boundary is closer if the significand is of the form f == 2^p-1 then + // the lower boundary is closer. + // Think of v = 1000e10 and v- = 9999e9. + // Then the boundary (== (v - v-)/2) is not just at a distance of 1e9 but + // at a distance of 1e8. + // The only exception is for the smallest normal: the largest denormal is + // at the same distance as its successor. + // Note: denormals have the same exponent as the smallest normals. + bool physical_significand_is_zero = ((AsUint32() & kSignificandMask) == 0); + return physical_significand_is_zero && (Exponent() != kDenormalExponent); + } + + float value() const { return uint32_to_float(d32_); } + + static float Infinity() { + return Single(kInfinity).value(); + } + + static float NaN() { + return Single(kNaN).value(); + } + + private: + static const int kExponentBias = 0x7F + kPhysicalSignificandSize; + static const int kDenormalExponent = -kExponentBias + 1; + static const int kMaxExponent = 0xFF - kExponentBias; + static const uint32_t kInfinity = 0x7F800000; + static const uint32_t kNaN = 0x7FC00000; + + const uint32_t d32_; + + DISALLOW_COPY_AND_ASSIGN(Single); +}; + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_DOUBLE_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/strtod.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/strtod.h new file mode 100644 index 0000000..ed0293b --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/strtod.h @@ -0,0 +1,45 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_STRTOD_H_ +#define DOUBLE_CONVERSION_STRTOD_H_ + +#include "utils.h" + +namespace double_conversion { + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +double Strtod(Vector buffer, int exponent); + +// The buffer must only contain digits in the range [0-9]. It must not +// contain a dot or a sign. It must not start with '0', and must not be empty. +float Strtof(Vector buffer, int exponent); + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_STRTOD_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/utils.h b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/utils.h new file mode 100644 index 0000000..a7c9b42 --- /dev/null +++ b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/Headers/double-conversion/utils.h @@ -0,0 +1,324 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef DOUBLE_CONVERSION_UTILS_H_ +#define DOUBLE_CONVERSION_UTILS_H_ + +#include +#include + +#include +#ifndef ASSERT +#define ASSERT(condition) \ + assert(condition); +#endif +#ifndef UNIMPLEMENTED +#define UNIMPLEMENTED() (abort()) +#endif +#ifndef UNREACHABLE +#define UNREACHABLE() (abort()) +#endif + +// Double operations detection based on target architecture. +// Linux uses a 80bit wide floating point stack on x86. This induces double +// rounding, which in turn leads to wrong results. +// An easy way to test if the floating-point operations are correct is to +// evaluate: 89255.0/1e22. If the floating-point stack is 64 bits wide then +// the result is equal to 89255e-22. +// The best way to test this, is to create a division-function and to compare +// the output of the division with the expected result. (Inlining must be +// disabled.) +// On Linux,x86 89255e-22 != Div_double(89255.0/1e22) +#if defined(_M_X64) || defined(__x86_64__) || \ + defined(__ARMEL__) || defined(__avr32__) || \ + defined(__hppa__) || defined(__ia64__) || \ + defined(__mips__) || \ + defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__) || \ + defined(__sparc__) || defined(__sparc) || defined(__s390__) || \ + defined(__SH4__) || defined(__alpha__) || \ + defined(_MIPS_ARCH_MIPS32R2) || \ + defined(__AARCH64EL__) +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#elif defined(__mc68000__) +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#elif defined(_M_IX86) || defined(__i386__) || defined(__i386) +#if defined(_WIN32) +// Windows uses a 64bit wide floating point stack. +#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1 +#else +#undef DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS +#endif // _WIN32 +#else +#error Target architecture was not detected as supported by Double-Conversion. +#endif + +#if defined(__GNUC__) +#define DOUBLE_CONVERSION_UNUSED __attribute__((unused)) +#else +#define DOUBLE_CONVERSION_UNUSED +#endif + +#if defined(_WIN32) && !defined(__MINGW32__) + +typedef signed char int8_t; +typedef unsigned char uint8_t; +typedef short int16_t; // NOLINT +typedef unsigned short uint16_t; // NOLINT +typedef int int32_t; +typedef unsigned int uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; +// intptr_t and friends are defined in crtdefs.h through stdio.h. + +#else + +#include + +#endif + +// The following macro works on both 32 and 64-bit platforms. +// Usage: instead of writing 0x1234567890123456 +// write UINT64_2PART_C(0x12345678,90123456); +#define UINT64_2PART_C(a, b) (((static_cast(a) << 32) + 0x##b##u)) + + +// The expression ARRAY_SIZE(a) is a compile-time constant of type +// size_t which represents the number of elements of the given +// array. You should only use ARRAY_SIZE on statically allocated +// arrays. +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(a) \ + ((sizeof(a) / sizeof(*(a))) / \ + static_cast(!(sizeof(a) % sizeof(*(a))))) +#endif + +// A macro to disallow the evil copy constructor and operator= functions +// This should be used in the private: declarations for a class +#ifndef DISALLOW_COPY_AND_ASSIGN +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) +#endif + +// A macro to disallow all the implicit constructors, namely the +// default constructor, copy constructor and operator= functions. +// +// This should be used in the private: declarations for a class +// that wants to prevent anyone from instantiating it. This is +// especially useful for classes containing only static methods. +#ifndef DISALLOW_IMPLICIT_CONSTRUCTORS +#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName(); \ + DISALLOW_COPY_AND_ASSIGN(TypeName) +#endif + +namespace double_conversion { + +static const int kCharSize = sizeof(char); + +// Returns the maximum of the two parameters. +template +static T Max(T a, T b) { + return a < b ? b : a; +} + + +// Returns the minimum of the two parameters. +template +static T Min(T a, T b) { + return a < b ? a : b; +} + + +inline int StrLength(const char* string) { + size_t length = strlen(string); + ASSERT(length == static_cast(static_cast(length))); + return static_cast(length); +} + +// This is a simplified version of V8's Vector class. +template +class Vector { + public: + Vector() : start_(NULL), length_(0) {} + Vector(T* data, int length) : start_(data), length_(length) { + ASSERT(length == 0 || (length > 0 && data != NULL)); + } + + // Returns a vector using the same backing storage as this one, + // spanning from and including 'from', to but not including 'to'. + Vector SubVector(int from, int to) { + ASSERT(to <= length_); + ASSERT(from < to); + ASSERT(0 <= from); + return Vector(start() + from, to - from); + } + + // Returns the length of the vector. + int length() const { return length_; } + + // Returns whether or not the vector is empty. + bool is_empty() const { return length_ == 0; } + + // Returns the pointer to the start of the data in the vector. + T* start() const { return start_; } + + // Access individual vector elements - checks bounds in debug mode. + T& operator[](int index) const { + ASSERT(0 <= index && index < length_); + return start_[index]; + } + + T& first() { return start_[0]; } + + T& last() { return start_[length_ - 1]; } + + private: + T* start_; + int length_; +}; + + +// Helper class for building result strings in a character buffer. The +// purpose of the class is to use safe operations that checks the +// buffer bounds on all operations in debug mode. +class StringBuilder { + public: + StringBuilder(char* buffer, int size) + : buffer_(buffer, size), position_(0) { } + + ~StringBuilder() { if (!is_finalized()) Finalize(); } + + int size() const { return buffer_.length(); } + + // Get the current position in the builder. + int position() const { + ASSERT(!is_finalized()); + return position_; + } + + // Reset the position. + void Reset() { position_ = 0; } + + // Add a single character to the builder. It is not allowed to add + // 0-characters; use the Finalize() method to terminate the string + // instead. + void AddCharacter(char c) { + ASSERT(c != '\0'); + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_++] = c; + } + + // Add an entire string to the builder. Uses strlen() internally to + // compute the length of the input string. + void AddString(const char* s) { + AddSubstring(s, StrLength(s)); + } + + // Add the first 'n' characters of the given string 's' to the + // builder. The input string must have enough characters. + void AddSubstring(const char* s, int n) { + ASSERT(!is_finalized() && position_ + n < buffer_.length()); + ASSERT(static_cast(n) <= strlen(s)); + memmove(&buffer_[position_], s, n * kCharSize); + position_ += n; + } + + + // Add character padding to the builder. If count is non-positive, + // nothing is added to the builder. + void AddPadding(char c, int count) { + for (int i = 0; i < count; i++) { + AddCharacter(c); + } + } + + // Finalize the string by 0-terminating it and returning the buffer. + char* Finalize() { + ASSERT(!is_finalized() && position_ < buffer_.length()); + buffer_[position_] = '\0'; + // Make sure nobody managed to add a 0-character to the + // buffer while building the string. + ASSERT(strlen(buffer_.start()) == static_cast(position_)); + position_ = -1; + ASSERT(is_finalized()); + return buffer_.start(); + } + + private: + Vector buffer_; + int position_; + + bool is_finalized() const { return position_ < 0; } + + DISALLOW_IMPLICIT_CONSTRUCTORS(StringBuilder); +}; + +// The type-based aliasing rule allows the compiler to assume that pointers of +// different types (for some definition of different) never alias each other. +// Thus the following code does not work: +// +// float f = foo(); +// int fbits = *(int*)(&f); +// +// The compiler 'knows' that the int pointer can't refer to f since the types +// don't match, so the compiler may cache f in a register, leaving random data +// in fbits. Using C++ style casts makes no difference, however a pointer to +// char data is assumed to alias any other pointer. This is the 'memcpy +// exception'. +// +// Bit_cast uses the memcpy exception to move the bits from a variable of one +// type of a variable of another type. Of course the end result is likely to +// be implementation dependent. Most compilers (gcc-4.2 and MSVC 2005) +// will completely optimize BitCast away. +// +// There is an additional use for BitCast. +// Recent gccs will warn when they see casts that may result in breakage due to +// the type-based aliasing rule. If you have checked that there is no breakage +// you can use BitCast to cast one pointer type to another. This confuses gcc +// enough that it can no longer see that you have cast one pointer type to +// another thus avoiding the warning. +template +inline Dest BitCast(const Source& source) { + // Compile time assertion: sizeof(Dest) == sizeof(Source) + // A compile error here means your Dest and Source have different sizes. + DOUBLE_CONVERSION_UNUSED + typedef char VerifySizesAreEqual[sizeof(Dest) == sizeof(Source) ? 1 : -1]; + + Dest dest; + memmove(&dest, &source, sizeof(dest)); + return dest; +} + +template +inline Dest BitCast(Source* source) { + return BitCast(reinterpret_cast(source)); +} + +} // namespace double_conversion + +#endif // DOUBLE_CONVERSION_UTILS_H_ diff --git a/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/libDoubleConversion.a b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/libDoubleConversion.a new file mode 100644 index 0000000..1bbfa8e Binary files /dev/null and b/Frameworks/DoubleConversion.xcframework/ios-arm64_x86_64-simulator/libDoubleConversion.a differ diff --git a/Frameworks/DynamicFonts.xcframework/Info.plist b/Frameworks/DynamicFonts.xcframework/Info.plist new file mode 100644 index 0000000..02c73bf --- /dev/null +++ b/Frameworks/DynamicFonts.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libDynamicFonts.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libDynamicFonts.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libDynamicFonts.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libDynamicFonts.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/DynamicFonts.xcframework/ios-arm64/Headers/DynamicFonts.h b/Frameworks/DynamicFonts.xcframework/ios-arm64/Headers/DynamicFonts.h new file mode 100644 index 0000000..2c0e21b --- /dev/null +++ b/Frameworks/DynamicFonts.xcframework/ios-arm64/Headers/DynamicFonts.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2017-present, Wyatt Greenway. All rights reserved. + * + * This source code is licensed under the MIT license found in the LICENSE file in the root + * directory of this source tree. + */ + +#import + +@interface DynamicFonts: NSObject + +@end diff --git a/Frameworks/DynamicFonts.xcframework/ios-arm64/libDynamicFonts.a b/Frameworks/DynamicFonts.xcframework/ios-arm64/libDynamicFonts.a new file mode 100644 index 0000000..c823b43 Binary files /dev/null and b/Frameworks/DynamicFonts.xcframework/ios-arm64/libDynamicFonts.a differ diff --git a/Frameworks/DynamicFonts.xcframework/ios-arm64_x86_64-simulator/Headers/DynamicFonts.h b/Frameworks/DynamicFonts.xcframework/ios-arm64_x86_64-simulator/Headers/DynamicFonts.h new file mode 100644 index 0000000..2c0e21b --- /dev/null +++ b/Frameworks/DynamicFonts.xcframework/ios-arm64_x86_64-simulator/Headers/DynamicFonts.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2017-present, Wyatt Greenway. All rights reserved. + * + * This source code is licensed under the MIT license found in the LICENSE file in the root + * directory of this source tree. + */ + +#import + +@interface DynamicFonts: NSObject + +@end diff --git a/Frameworks/DynamicFonts.xcframework/ios-arm64_x86_64-simulator/libDynamicFonts.a b/Frameworks/DynamicFonts.xcframework/ios-arm64_x86_64-simulator/libDynamicFonts.a new file mode 100644 index 0000000..f6216b2 Binary files /dev/null and b/Frameworks/DynamicFonts.xcframework/ios-arm64_x86_64-simulator/libDynamicFonts.a differ diff --git a/Frameworks/FBReactNativeSpec.xcframework/Info.plist b/Frameworks/FBReactNativeSpec.xcframework/Info.plist new file mode 100644 index 0000000..605d372 --- /dev/null +++ b/Frameworks/FBReactNativeSpec.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libFBReactNativeSpec.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libFBReactNativeSpec.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libFBReactNativeSpec.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libFBReactNativeSpec.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/FBReactNativeSpec.xcframework/ios-arm64/Headers/FBReactNativeSpec/FBReactNativeSpec.h b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64/Headers/FBReactNativeSpec/FBReactNativeSpec.h new file mode 100644 index 0000000..95f3661 --- /dev/null +++ b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64/Headers/FBReactNativeSpec/FBReactNativeSpec.h @@ -0,0 +1,2566 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleObjCpp + * + * We create an umbrella header (and corresponding implementation) here since + * Cxx compilation in BUCK has a limitation: source-code producing genrule()s + * must have a single output. More files => more genrule()s => slower builds. + */ + +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + + +@protocol NativeAccessibilityInfoSpec + +- (void)isReduceMotionEnabled:(RCTResponseSenderBlock)onSuccess; +- (void)isTouchExplorationEnabled:(RCTResponseSenderBlock)onSuccess; +- (void)setAccessibilityFocus:(double)reactTag; +- (void)announceForAccessibility:(NSString *)announcement; +- (void)getRecommendedTimeoutMillis:(double)mSec + onSuccess:(RCTResponseSenderBlock)onSuccess; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAccessibilityInfo' + */ + class JSI_EXPORT NativeAccessibilityInfoSpecJSI : public ObjCTurboModule { + public: + NativeAccessibilityInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAccessibilityManager { + struct SpecSetAccessibilityContentSizeMultipliersJSMultipliers { + folly::Optional extraSmall() const; + folly::Optional small() const; + folly::Optional medium() const; + folly::Optional large() const; + folly::Optional extraLarge() const; + folly::Optional extraExtraLarge() const; + folly::Optional extraExtraExtraLarge() const; + folly::Optional accessibilityMedium() const; + folly::Optional accessibilityLarge() const; + folly::Optional accessibilityExtraLarge() const; + folly::Optional accessibilityExtraExtraLarge() const; + folly::Optional accessibilityExtraExtraExtraLarge() const; + + SpecSetAccessibilityContentSizeMultipliersJSMultipliers(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers) ++ (RCTManagedPointer *)JS_NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers:(id)json; +@end +@protocol NativeAccessibilityManagerSpec + +- (void)getCurrentBoldTextState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentGrayscaleState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentInvertColorsState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentReduceMotionState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentReduceTransparencyState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentVoiceOverState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)setAccessibilityContentSizeMultipliers:(JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers &)JSMultipliers; +- (void)setAccessibilityFocus:(double)reactTag; +- (void)announceForAccessibility:(NSString *)announcement; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAccessibilityManager' + */ + class JSI_EXPORT NativeAccessibilityManagerSpecJSI : public ObjCTurboModule { + public: + NativeAccessibilityManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeActionSheetManager { + struct SpecShowActionSheetWithOptionsOptions { + NSString *title() const; + NSString *message() const; + folly::Optional> options() const; + folly::Optional> destructiveButtonIndices() const; + folly::Optional cancelButtonIndex() const; + folly::Optional anchor() const; + folly::Optional tintColor() const; + folly::Optional cancelButtonTintColor() const; + NSString *userInterfaceStyle() const; + folly::Optional> disabledButtonIndices() const; + + SpecShowActionSheetWithOptionsOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions) ++ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions:(id)json; +@end +namespace JS { + namespace NativeActionSheetManager { + struct SpecShowShareActionSheetWithOptionsOptions { + NSString *message() const; + NSString *url() const; + NSString *subject() const; + folly::Optional anchor() const; + folly::Optional tintColor() const; + folly::Optional cancelButtonTintColor() const; + folly::Optional> excludedActivityTypes() const; + NSString *userInterfaceStyle() const; + + SpecShowShareActionSheetWithOptionsOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions) ++ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions:(id)json; +@end +@protocol NativeActionSheetManagerSpec + +- (void)showActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions &)options + callback:(RCTResponseSenderBlock)callback; +- (void)showShareActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &)options + failureCallback:(RCTResponseSenderBlock)failureCallback + successCallback:(RCTResponseSenderBlock)successCallback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeActionSheetManager' + */ + class JSI_EXPORT NativeActionSheetManagerSpecJSI : public ObjCTurboModule { + public: + NativeActionSheetManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAlertManager { + struct Args { + NSString *title() const; + NSString *message() const; + folly::Optional >> buttons() const; + NSString *type() const; + NSString *defaultValue() const; + NSString *cancelButtonKey() const; + NSString *destructiveButtonKey() const; + NSString *keyboardType() const; + + Args(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAlertManager_Args) ++ (RCTManagedPointer *)JS_NativeAlertManager_Args:(id)json; +@end +@protocol NativeAlertManagerSpec + +- (void)alertWithArgs:(JS::NativeAlertManager::Args &)args + callback:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAlertManager' + */ + class JSI_EXPORT NativeAlertManagerSpecJSI : public ObjCTurboModule { + public: + NativeAlertManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAnimatedModule { + struct EventMapping { + facebook::react::LazyVector nativeEventPath() const; + folly::Optional animatedValueTag() const; + + EventMapping(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAnimatedModule_EventMapping) ++ (RCTManagedPointer *)JS_NativeAnimatedModule_EventMapping:(id)json; +@end +@protocol NativeAnimatedModuleSpec + +- (void)startOperationBatch; +- (void)finishOperationBatch; +- (void)createAnimatedNode:(double)tag + config:(NSDictionary *)config; +- (void)getValue:(double)tag +saveValueCallback:(RCTResponseSenderBlock)saveValueCallback; +- (void)startListeningToAnimatedNodeValue:(double)tag; +- (void)stopListeningToAnimatedNodeValue:(double)tag; +- (void)connectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)disconnectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)startAnimatingNode:(double)animationId + nodeTag:(double)nodeTag + config:(NSDictionary *)config + endCallback:(RCTResponseSenderBlock)endCallback; +- (void)stopAnimation:(double)animationId; +- (void)setAnimatedNodeValue:(double)nodeTag + value:(double)value; +- (void)setAnimatedNodeOffset:(double)nodeTag + offset:(double)offset; +- (void)flattenAnimatedNodeOffset:(double)nodeTag; +- (void)extractAnimatedNodeOffset:(double)nodeTag; +- (void)connectAnimatedNodeToView:(double)nodeTag + viewTag:(double)viewTag; +- (void)disconnectAnimatedNodeFromView:(double)nodeTag + viewTag:(double)viewTag; +- (void)restoreDefaultValues:(double)nodeTag; +- (void)dropAnimatedNode:(double)tag; +- (void)addAnimatedEventToView:(double)viewTag + eventName:(NSString *)eventName + eventMapping:(JS::NativeAnimatedModule::EventMapping &)eventMapping; +- (void)removeAnimatedEventFromView:(double)viewTag + eventName:(NSString *)eventName + animatedNodeTag:(double)animatedNodeTag; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAnimatedModule' + */ + class JSI_EXPORT NativeAnimatedModuleSpecJSI : public ObjCTurboModule { + public: + NativeAnimatedModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAnimatedTurboModule { + struct EventMapping { + facebook::react::LazyVector nativeEventPath() const; + folly::Optional animatedValueTag() const; + + EventMapping(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAnimatedTurboModule_EventMapping) ++ (RCTManagedPointer *)JS_NativeAnimatedTurboModule_EventMapping:(id)json; +@end +@protocol NativeAnimatedTurboModuleSpec + +- (void)startOperationBatch; +- (void)finishOperationBatch; +- (void)createAnimatedNode:(double)tag + config:(NSDictionary *)config; +- (void)getValue:(double)tag +saveValueCallback:(RCTResponseSenderBlock)saveValueCallback; +- (void)startListeningToAnimatedNodeValue:(double)tag; +- (void)stopListeningToAnimatedNodeValue:(double)tag; +- (void)connectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)disconnectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)startAnimatingNode:(double)animationId + nodeTag:(double)nodeTag + config:(NSDictionary *)config + endCallback:(RCTResponseSenderBlock)endCallback; +- (void)stopAnimation:(double)animationId; +- (void)setAnimatedNodeValue:(double)nodeTag + value:(double)value; +- (void)setAnimatedNodeOffset:(double)nodeTag + offset:(double)offset; +- (void)flattenAnimatedNodeOffset:(double)nodeTag; +- (void)extractAnimatedNodeOffset:(double)nodeTag; +- (void)connectAnimatedNodeToView:(double)nodeTag + viewTag:(double)viewTag; +- (void)disconnectAnimatedNodeFromView:(double)nodeTag + viewTag:(double)viewTag; +- (void)restoreDefaultValues:(double)nodeTag; +- (void)dropAnimatedNode:(double)tag; +- (void)addAnimatedEventToView:(double)viewTag + eventName:(NSString *)eventName + eventMapping:(JS::NativeAnimatedTurboModule::EventMapping &)eventMapping; +- (void)removeAnimatedEventFromView:(double)viewTag + eventName:(NSString *)eventName + animatedNodeTag:(double)animatedNodeTag; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAnimatedTurboModule' + */ + class JSI_EXPORT NativeAnimatedTurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeAnimatedTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAnimationsDebugModuleSpec + +- (void)startRecordingFps; +- (void)stopRecordingFps:(double)animationStopTimeMs; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAnimationsDebugModule' + */ + class JSI_EXPORT NativeAnimationsDebugModuleSpecJSI : public ObjCTurboModule { + public: + NativeAnimationsDebugModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAppState { + struct Constants { + + struct Builder { + struct Input { + RCTRequired initialAppState; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeAppStateSpec + +- (void)getCurrentAppState:(RCTResponseSenderBlock)success + error:(RCTResponseSenderBlock)error; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAppState' + */ + class JSI_EXPORT NativeAppStateSpecJSI : public ObjCTurboModule { + public: + NativeAppStateSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAppearanceSpec + +- (NSString * _Nullable)getColorScheme; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAppearance' + */ + class JSI_EXPORT NativeAppearanceSpecJSI : public ObjCTurboModule { + public: + NativeAppearanceSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAsyncLocalStorageSpec + +- (void)multiGet:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)multiSet:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiMerge:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiRemove:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)clear:(RCTResponseSenderBlock)callback; +- (void)getAllKeys:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAsyncLocalStorage' + */ + class JSI_EXPORT NativeAsyncLocalStorageSpecJSI : public ObjCTurboModule { + public: + NativeAsyncLocalStorageSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAsyncSQLiteDBStorageSpec + +- (void)multiGet:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)multiSet:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiMerge:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiRemove:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)clear:(RCTResponseSenderBlock)callback; +- (void)getAllKeys:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAsyncSQLiteDBStorage' + */ + class JSI_EXPORT NativeAsyncSQLiteDBStorageSpecJSI : public ObjCTurboModule { + public: + NativeAsyncSQLiteDBStorageSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeBlobModule { + struct Constants { + + struct Builder { + struct Input { + RCTRequired BLOB_URI_SCHEME; + RCTRequired BLOB_URI_HOST; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeBlobModuleSpec + +- (void)addNetworkingHandler; +- (void)addWebSocketHandler:(double)id; +- (void)removeWebSocketHandler:(double)id; +- (void)sendOverSocket:(NSDictionary *)blob + socketID:(double)socketID; +- (void)createFromParts:(NSArray *)parts + withId:(NSString *)withId; +- (void)release:(NSString *)blobId; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeBlobModule' + */ + class JSI_EXPORT NativeBlobModuleSpecJSI : public ObjCTurboModule { + public: + NativeBlobModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeBugReportingSpec + +- (void)startReportAProblemFlow; +- (void)setExtraData:(NSDictionary *)extraData + extraFiles:(NSDictionary *)extraFiles; +- (void)setCategoryID:(NSString *)categoryID; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeBugReporting' + */ + class JSI_EXPORT NativeBugReportingSpecJSI : public ObjCTurboModule { + public: + NativeBugReportingSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeClipboardSpec + +- (void)getString:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)setString:(NSString *)content; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeClipboard' + */ + class JSI_EXPORT NativeClipboardSpecJSI : public ObjCTurboModule { + public: + NativeClipboardSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevLoadingViewSpec + +- (void)showMessage:(NSString *)message + withColor:(NSNumber *)withColor +withBackgroundColor:(NSNumber *)withBackgroundColor; +- (void)hide; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevLoadingView' + */ + class JSI_EXPORT NativeDevLoadingViewSpecJSI : public ObjCTurboModule { + public: + NativeDevLoadingViewSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevMenuSpec + +- (void)show; +- (void)reload; +- (void)debugRemotely:(BOOL)enableDebug; +- (void)setProfilingEnabled:(BOOL)enabled; +- (void)setHotLoadingEnabled:(BOOL)enabled; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevMenu' + */ + class JSI_EXPORT NativeDevMenuSpecJSI : public ObjCTurboModule { + public: + NativeDevMenuSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevSettingsSpec + +- (void)reload; +- (void)reloadWithReason:(NSString *)reason; +- (void)onFastRefresh; +- (void)setHotLoadingEnabled:(BOOL)isHotLoadingEnabled; +- (void)setIsDebuggingRemotely:(BOOL)isDebuggingRemotelyEnabled; +- (void)setProfilingEnabled:(BOOL)isProfilingEnabled; +- (void)toggleElementInspector; +- (void)addMenuItem:(NSString *)title; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; +- (void)setIsShakeToShowDevMenuEnabled:(BOOL)enabled; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevSettings' + */ + class JSI_EXPORT NativeDevSettingsSpecJSI : public ObjCTurboModule { + public: + NativeDevSettingsSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevSplitBundleLoaderSpec + +- (void)loadBundle:(NSString *)bundlePath + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevSplitBundleLoader' + */ + class JSI_EXPORT NativeDevSplitBundleLoaderSpecJSI : public ObjCTurboModule { + public: + NativeDevSplitBundleLoaderSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDeviceEventManagerSpec + +- (void)invokeDefaultBackPressHandler; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDeviceEventManager' + */ + class JSI_EXPORT NativeDeviceEventManagerSpecJSI : public ObjCTurboModule { + public: + NativeDeviceEventManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeDeviceInfo { + struct DisplayMetrics { + + struct Builder { + struct Input { + RCTRequired width; + RCTRequired height; + RCTRequired scale; + RCTRequired fontScale; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing DisplayMetrics */ + Builder(DisplayMetrics i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static DisplayMetrics fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + DisplayMetrics(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativeDeviceInfo { + struct DisplayMetricsAndroid { + + struct Builder { + struct Input { + RCTRequired width; + RCTRequired height; + RCTRequired scale; + RCTRequired fontScale; + RCTRequired densityDpi; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing DisplayMetricsAndroid */ + Builder(DisplayMetricsAndroid i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static DisplayMetricsAndroid fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + DisplayMetricsAndroid(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativeDeviceInfo { + struct DimensionsPayload { + + struct Builder { + struct Input { + folly::Optional window; + folly::Optional screen; + folly::Optional windowPhysicalPixels; + folly::Optional screenPhysicalPixels; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing DimensionsPayload */ + Builder(DimensionsPayload i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static DimensionsPayload fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + DimensionsPayload(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativeDeviceInfo { + struct Constants { + + struct Builder { + struct Input { + RCTRequired Dimensions; + folly::Optional isIPhoneX_deprecated; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeDeviceInfoSpec + +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDeviceInfo' + */ + class JSI_EXPORT NativeDeviceInfoSpecJSI : public ObjCTurboModule { + public: + NativeDeviceInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeExceptionsManager { + struct StackFrame { + folly::Optional column() const; + NSString *file() const; + folly::Optional lineNumber() const; + NSString *methodName() const; + folly::Optional collapse() const; + + StackFrame(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeExceptionsManager_StackFrame) ++ (RCTManagedPointer *)JS_NativeExceptionsManager_StackFrame:(id)json; +@end +namespace JS { + namespace NativeExceptionsManager { + struct ExceptionData { + NSString *message() const; + NSString *originalMessage() const; + NSString *name() const; + NSString *componentStack() const; + facebook::react::LazyVector stack() const; + double id_() const; + bool isFatal() const; + id _Nullable extraData() const; + + ExceptionData(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeExceptionsManager_ExceptionData) ++ (RCTManagedPointer *)JS_NativeExceptionsManager_ExceptionData:(id)json; +@end +@protocol NativeExceptionsManagerSpec + +- (void)reportFatalException:(NSString *)message + stack:(NSArray *)stack + exceptionId:(double)exceptionId; +- (void)reportSoftException:(NSString *)message + stack:(NSArray *)stack + exceptionId:(double)exceptionId; +- (void)reportException:(JS::NativeExceptionsManager::ExceptionData &)data; +- (void)updateExceptionMessage:(NSString *)message + stack:(NSArray *)stack + exceptionId:(double)exceptionId; +- (void)dismissRedbox; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeExceptionsManager' + */ + class JSI_EXPORT NativeExceptionsManagerSpecJSI : public ObjCTurboModule { + public: + NativeExceptionsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeFileReaderModuleSpec + +- (void)readAsDataURL:(NSDictionary *)data + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)readAsText:(NSDictionary *)data + encoding:(NSString *)encoding + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeFileReaderModule' + */ + class JSI_EXPORT NativeFileReaderModuleSpecJSI : public ObjCTurboModule { + public: + NativeFileReaderModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeFrameRateLogger { + struct SpecSetGlobalOptionsOptions { + folly::Optional debug() const; + folly::Optional reportStackTraces() const; + + SpecSetGlobalOptionsOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeFrameRateLogger_SpecSetGlobalOptionsOptions) ++ (RCTManagedPointer *)JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:(id)json; +@end +@protocol NativeFrameRateLoggerSpec + +- (void)setGlobalOptions:(JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions &)options; +- (void)setContext:(NSString *)context; +- (void)beginScroll; +- (void)endScroll; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeFrameRateLogger' + */ + class JSI_EXPORT NativeFrameRateLoggerSpecJSI : public ObjCTurboModule { + public: + NativeFrameRateLoggerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeHeadlessJsTaskSupportSpec + +- (void)notifyTaskFinished:(double)taskId; +- (void)notifyTaskRetry:(double)taskId + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeHeadlessJsTaskSupport' + */ + class JSI_EXPORT NativeHeadlessJsTaskSupportSpecJSI : public ObjCTurboModule { + public: + NativeHeadlessJsTaskSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeI18nManager { + struct Constants { + + struct Builder { + struct Input { + RCTRequired isRTL; + RCTRequired doLeftAndRightSwapInRTL; + RCTRequired localeIdentifier; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeI18nManagerSpec + +- (void)allowRTL:(BOOL)allowRTL; +- (void)forceRTL:(BOOL)forceRTL; +- (void)swapLeftAndRightInRTL:(BOOL)flipStyles; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeI18nManager' + */ + class JSI_EXPORT NativeI18nManagerSpecJSI : public ObjCTurboModule { + public: + NativeI18nManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeImageEditor { + struct OptionsOffset { + double x() const; + double y() const; + + OptionsOffset(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_OptionsOffset) ++ (RCTManagedPointer *)JS_NativeImageEditor_OptionsOffset:(id)json; +@end +namespace JS { + namespace NativeImageEditor { + struct OptionsSize { + double width() const; + double height() const; + + OptionsSize(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_OptionsSize) ++ (RCTManagedPointer *)JS_NativeImageEditor_OptionsSize:(id)json; +@end +namespace JS { + namespace NativeImageEditor { + struct OptionsDisplaySize { + double width() const; + double height() const; + + OptionsDisplaySize(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_OptionsDisplaySize) ++ (RCTManagedPointer *)JS_NativeImageEditor_OptionsDisplaySize:(id)json; +@end +namespace JS { + namespace NativeImageEditor { + struct Options { + JS::NativeImageEditor::OptionsOffset offset() const; + JS::NativeImageEditor::OptionsSize size() const; + folly::Optional displaySize() const; + NSString *resizeMode() const; + folly::Optional allowExternalStorage() const; + + Options(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_Options) ++ (RCTManagedPointer *)JS_NativeImageEditor_Options:(id)json; +@end +@protocol NativeImageEditorSpec + +- (void)cropImage:(NSString *)uri + cropData:(JS::NativeImageEditor::Options &)cropData + successCallback:(RCTResponseSenderBlock)successCallback + errorCallback:(RCTResponseSenderBlock)errorCallback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImageEditor' + */ + class JSI_EXPORT NativeImageEditorSpecJSI : public ObjCTurboModule { + public: + NativeImageEditorSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeImageLoaderIOSSpec + +- (void)getSize:(NSString *)uri + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)getSizeWithHeaders:(NSString *)uri + headers:(NSDictionary *)headers + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)prefetchImage:(NSString *)uri + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)prefetchImageWithMetadata:(NSString *)uri + queryRootName:(NSString *)queryRootName + rootTag:(double)rootTag + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)queryCache:(NSArray *)uris + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImageLoaderIOS' + */ + class JSI_EXPORT NativeImageLoaderIOSSpecJSI : public ObjCTurboModule { + public: + NativeImageLoaderIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeImagePickerIOS { + struct SpecOpenCameraDialogConfig { + bool unmirrorFrontFacingCamera() const; + bool videoMode() const; + + SpecOpenCameraDialogConfig(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImagePickerIOS_SpecOpenCameraDialogConfig) ++ (RCTManagedPointer *)JS_NativeImagePickerIOS_SpecOpenCameraDialogConfig:(id)json; +@end +namespace JS { + namespace NativeImagePickerIOS { + struct SpecOpenSelectDialogConfig { + bool showImages() const; + bool showVideos() const; + + SpecOpenSelectDialogConfig(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImagePickerIOS_SpecOpenSelectDialogConfig) ++ (RCTManagedPointer *)JS_NativeImagePickerIOS_SpecOpenSelectDialogConfig:(id)json; +@end +@protocol NativeImagePickerIOSSpec + +- (void)canRecordVideos:(RCTResponseSenderBlock)callback; +- (void)canUseCamera:(RCTResponseSenderBlock)callback; +- (void)openCameraDialog:(JS::NativeImagePickerIOS::SpecOpenCameraDialogConfig &)config + successCallback:(RCTResponseSenderBlock)successCallback + cancelCallback:(RCTResponseSenderBlock)cancelCallback; +- (void)openSelectDialog:(JS::NativeImagePickerIOS::SpecOpenSelectDialogConfig &)config + successCallback:(RCTResponseSenderBlock)successCallback + cancelCallback:(RCTResponseSenderBlock)cancelCallback; +- (void)clearAllPendingVideos; +- (void)removePendingVideo:(NSString *)url; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImagePickerIOS' + */ + class JSI_EXPORT NativeImagePickerIOSSpecJSI : public ObjCTurboModule { + public: + NativeImagePickerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeImageStoreIOSSpec + +- (void)getBase64ForTag:(NSString *)uri + successCallback:(RCTResponseSenderBlock)successCallback + errorCallback:(RCTResponseSenderBlock)errorCallback; +- (void)hasImageForTag:(NSString *)uri + callback:(RCTResponseSenderBlock)callback; +- (void)removeImageForTag:(NSString *)uri; +- (void)addImageFromBase64:(NSString *)base64ImageData + successCallback:(RCTResponseSenderBlock)successCallback + errorCallback:(RCTResponseSenderBlock)errorCallback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImageStoreIOS' + */ + class JSI_EXPORT NativeImageStoreIOSSpecJSI : public ObjCTurboModule { + public: + NativeImageStoreIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeJSCHeapCaptureSpec + +- (void)captureComplete:(NSString *)path + error:(NSString * _Nullable)error; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeJSCHeapCapture' + */ + class JSI_EXPORT NativeJSCHeapCaptureSpecJSI : public ObjCTurboModule { + public: + NativeJSCHeapCaptureSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeJSCSamplingProfilerSpec + +- (void)operationComplete:(double)token + result:(NSString * _Nullable)result + error:(NSString * _Nullable)error; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeJSCSamplingProfiler' + */ + class JSI_EXPORT NativeJSCSamplingProfilerSpecJSI : public ObjCTurboModule { + public: + NativeJSCSamplingProfilerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeJSDevSupport { + struct Constants { + + struct Builder { + struct Input { + RCTRequired ERROR_CODE_EXCEPTION; + RCTRequired ERROR_CODE_VIEW_NOT_FOUND; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeJSDevSupportSpec + +- (void)onSuccess:(NSString *)data; +- (void)onFailure:(double)errorCode + error:(NSString *)error; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeJSDevSupport' + */ + class JSI_EXPORT NativeJSDevSupportSpecJSI : public ObjCTurboModule { + public: + NativeJSDevSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeKeyboardObserverSpec + +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeKeyboardObserver' + */ + class JSI_EXPORT NativeKeyboardObserverSpecJSI : public ObjCTurboModule { + public: + NativeKeyboardObserverSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeLinkingManagerSpec + +- (void)getInitialURL:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)canOpenURL:(NSString *)url + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)openURL:(NSString *)url + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)openSettings:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeLinkingManager' + */ + class JSI_EXPORT NativeLinkingManagerSpecJSI : public ObjCTurboModule { + public: + NativeLinkingManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeLogBoxSpec + +- (void)show; +- (void)hide; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeLogBox' + */ + class JSI_EXPORT NativeLogBoxSpecJSI : public ObjCTurboModule { + public: + NativeLogBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeModalManagerSpec + +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeModalManager' + */ + class JSI_EXPORT NativeModalManagerSpecJSI : public ObjCTurboModule { + public: + NativeModalManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeNetworkingIOS { + struct SpecSendRequestQuery { + NSString *method() const; + NSString *url() const; + id data() const; + id headers() const; + NSString *responseType() const; + bool incrementalUpdates() const; + double timeout() const; + bool withCredentials() const; + + SpecSendRequestQuery(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeNetworkingIOS_SpecSendRequestQuery) ++ (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json; +@end +@protocol NativeNetworkingIOSSpec + +- (void)sendRequest:(JS::NativeNetworkingIOS::SpecSendRequestQuery &)query + callback:(RCTResponseSenderBlock)callback; +- (void)abortRequest:(double)requestId; +- (void)clearCookies:(RCTResponseSenderBlock)callback; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeNetworkingIOS' + */ + class JSI_EXPORT NativeNetworkingIOSSpecJSI : public ObjCTurboModule { + public: + NativeNetworkingIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativePlatformConstantsIOS { + struct ConstantsReactNativeVersion { + + struct Builder { + struct Input { + RCTRequired major; + RCTRequired minor; + RCTRequired patch; + RCTRequired> prerelease; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing ConstantsReactNativeVersion */ + Builder(ConstantsReactNativeVersion i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static ConstantsReactNativeVersion fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + ConstantsReactNativeVersion(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativePlatformConstantsIOS { + struct Constants { + + struct Builder { + struct Input { + RCTRequired isTesting; + RCTRequired reactNativeVersion; + RCTRequired forceTouchAvailable; + RCTRequired osVersion; + RCTRequired systemName; + RCTRequired interfaceIdiom; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativePlatformConstantsIOSSpec + +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativePlatformConstantsIOS' + */ + class JSI_EXPORT NativePlatformConstantsIOSSpecJSI : public ObjCTurboModule { + public: + NativePlatformConstantsIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativePushNotificationManagerIOS { + struct SpecRequestPermissionsPermission { + bool alert() const; + bool badge() const; + bool sound() const; + + SpecRequestPermissionsPermission(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativePushNotificationManagerIOS_SpecRequestPermissionsPermission) ++ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_SpecRequestPermissionsPermission:(id)json; +@end +namespace JS { + namespace NativePushNotificationManagerIOS { + struct Notification { + NSString *alertTitle() const; + folly::Optional fireDate() const; + NSString *alertBody() const; + NSString *alertAction() const; + id _Nullable userInfo() const; + NSString *category() const; + NSString *repeatInterval() const; + folly::Optional applicationIconBadgeNumber() const; + folly::Optional isSilent() const; + + Notification(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativePushNotificationManagerIOS_Notification) ++ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json; +@end +@protocol NativePushNotificationManagerIOSSpec + +- (void)onFinishRemoteNotification:(NSString *)notificationId + fetchResult:(NSString *)fetchResult; +- (void)setApplicationIconBadgeNumber:(double)num; +- (void)getApplicationIconBadgeNumber:(RCTResponseSenderBlock)callback; +- (void)requestPermissions:(JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission &)permission + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)abandonPermissions; +- (void)checkPermissions:(RCTResponseSenderBlock)callback; +- (void)presentLocalNotification:(JS::NativePushNotificationManagerIOS::Notification &)notification; +- (void)scheduleLocalNotification:(JS::NativePushNotificationManagerIOS::Notification &)notification; +- (void)cancelAllLocalNotifications; +- (void)cancelLocalNotifications:(NSDictionary *)userInfo; +- (void)getInitialNotification:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)getScheduledLocalNotifications:(RCTResponseSenderBlock)callback; +- (void)removeAllDeliveredNotifications; +- (void)removeDeliveredNotifications:(NSArray *)identifiers; +- (void)getDeliveredNotifications:(RCTResponseSenderBlock)callback; +- (void)getAuthorizationStatus:(RCTResponseSenderBlock)callback; +- (void)addListener:(NSString *)eventType; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativePushNotificationManagerIOS' + */ + class JSI_EXPORT NativePushNotificationManagerIOSSpecJSI : public ObjCTurboModule { + public: + NativePushNotificationManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeRedBoxSpec + +- (void)setExtraData:(NSDictionary *)extraData + forIdentifier:(NSString *)forIdentifier; +- (void)dismiss; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeRedBox' + */ + class JSI_EXPORT NativeRedBoxSpecJSI : public ObjCTurboModule { + public: + NativeRedBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeSegmentFetcherSpec + +- (void)fetchSegment:(double)segmentId + options:(NSDictionary *)options + callback:(RCTResponseSenderBlock)callback; +- (void)getSegment:(double)segmentId + options:(NSDictionary *)options + callback:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSegmentFetcher' + */ + class JSI_EXPORT NativeSegmentFetcherSpecJSI : public ObjCTurboModule { + public: + NativeSegmentFetcherSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeSettingsManager { + struct Constants { + + struct Builder { + struct Input { + RCTRequired > settings; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeSettingsManagerSpec + +- (void)setValues:(NSDictionary *)values; +- (void)deleteValues:(NSArray *)values; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSettingsManager' + */ + class JSI_EXPORT NativeSettingsManagerSpecJSI : public ObjCTurboModule { + public: + NativeSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeShareModule { + struct SpecShareContent { + NSString *title() const; + NSString *message() const; + + SpecShareContent(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeShareModule_SpecShareContent) ++ (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json; +@end +@protocol NativeShareModuleSpec + +- (void)share:(JS::NativeShareModule::SpecShareContent &)content + dialogTitle:(NSString *)dialogTitle + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeShareModule' + */ + class JSI_EXPORT NativeShareModuleSpecJSI : public ObjCTurboModule { + public: + NativeShareModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeSoundManagerSpec + +- (void)playTouchSound; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSoundManager' + */ + class JSI_EXPORT NativeSoundManagerSpecJSI : public ObjCTurboModule { + public: + NativeSoundManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeSourceCode { + struct Constants { + + struct Builder { + struct Input { + RCTRequired scriptURL; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeSourceCodeSpec + +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSourceCode' + */ + class JSI_EXPORT NativeSourceCodeSpecJSI : public ObjCTurboModule { + public: + NativeSourceCodeSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeStatusBarManagerIOS { + struct Constants { + + struct Builder { + struct Input { + RCTRequired HEIGHT; + folly::Optional DEFAULT_BACKGROUND_COLOR; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeStatusBarManagerIOSSpec + +- (void)getHeight:(RCTResponseSenderBlock)callback; +- (void)setNetworkActivityIndicatorVisible:(BOOL)visible; +- (void)addListener:(NSString *)eventType; +- (void)removeListeners:(double)count; +- (void)setStyle:(NSString * _Nullable)statusBarStyle + animated:(BOOL)animated; +- (void)setHidden:(BOOL)hidden + withAnimation:(NSString *)withAnimation; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeStatusBarManagerIOS' + */ + class JSI_EXPORT NativeStatusBarManagerIOSSpecJSI : public ObjCTurboModule { + public: + NativeStatusBarManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeTimingSpec + +- (void)createTimer:(double)callbackID + duration:(double)duration + jsSchedulingTime:(double)jsSchedulingTime + repeats:(BOOL)repeats; +- (void)deleteTimer:(double)timerID; +- (void)setSendIdleEvents:(BOOL)sendIdleEvents; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeTiming' + */ + class JSI_EXPORT NativeTimingSpecJSI : public ObjCTurboModule { + public: + NativeTimingSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeVibrationSpec + +- (void)vibrate:(double)pattern; +- (void)vibrateByPattern:(NSArray *)pattern + repeat:(double)repeat; +- (void)cancel; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeVibration' + */ + class JSI_EXPORT NativeVibrationSpecJSI : public ObjCTurboModule { + public: + NativeVibrationSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeWebSocketModule { + struct SpecConnectOptions { + id _Nullable headers() const; + + SpecConnectOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeWebSocketModule_SpecConnectOptions) ++ (RCTManagedPointer *)JS_NativeWebSocketModule_SpecConnectOptions:(id)json; +@end +@protocol NativeWebSocketModuleSpec + +- (void)connect:(NSString *)url + protocols:(NSArray * _Nullable)protocols + options:(JS::NativeWebSocketModule::SpecConnectOptions &)options + socketID:(double)socketID; +- (void)send:(NSString *)message + forSocketID:(double)forSocketID; +- (void)sendBinary:(NSString *)base64String + forSocketID:(double)forSocketID; +- (void)ping:(double)socketID; +- (void)close:(double)code + reason:(NSString *)reason + socketID:(double)socketID; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeWebSocketModule' + */ + class JSI_EXPORT NativeWebSocketModuleSpecJSI : public ObjCTurboModule { + public: + NativeWebSocketModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraSmall() const +{ + id const p = _v[@"extraSmall"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::small() const +{ + id const p = _v[@"small"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::medium() const +{ + id const p = _v[@"medium"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::large() const +{ + id const p = _v[@"large"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraLarge() const +{ + id const p = _v[@"extraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraExtraLarge() const +{ + id const p = _v[@"extraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraExtraExtraLarge() const +{ + id const p = _v[@"extraExtraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityMedium() const +{ + id const p = _v[@"accessibilityMedium"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityLarge() const +{ + id const p = _v[@"accessibilityLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraLarge() const +{ + id const p = _v[@"accessibilityExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraExtraLarge() const +{ + id const p = _v[@"accessibilityExtraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraExtraExtraLarge() const +{ + id const p = _v[@"accessibilityExtraExtraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::title() const +{ + id const p = _v[@"title"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::options() const +{ + id const p = _v[@"options"]; + return RCTBridgingToOptionalVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::destructiveButtonIndices() const +{ + id const p = _v[@"destructiveButtonIndices"]; + return RCTBridgingToOptionalVec(p, ^double(id itemValue_0) { return RCTBridgingToDouble(itemValue_0); }); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::cancelButtonIndex() const +{ + id const p = _v[@"cancelButtonIndex"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::anchor() const +{ + id const p = _v[@"anchor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::tintColor() const +{ + id const p = _v[@"tintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::cancelButtonTintColor() const +{ + id const p = _v[@"cancelButtonTintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::userInterfaceStyle() const +{ + id const p = _v[@"userInterfaceStyle"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::disabledButtonIndices() const +{ + id const p = _v[@"disabledButtonIndices"]; + return RCTBridgingToOptionalVec(p, ^double(id itemValue_0) { return RCTBridgingToDouble(itemValue_0); }); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::url() const +{ + id const p = _v[@"url"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::subject() const +{ + id const p = _v[@"subject"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::anchor() const +{ + id const p = _v[@"anchor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::tintColor() const +{ + id const p = _v[@"tintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::cancelButtonTintColor() const +{ + id const p = _v[@"cancelButtonTintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::excludedActivityTypes() const +{ + id const p = _v[@"excludedActivityTypes"]; + return RCTBridgingToOptionalVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::userInterfaceStyle() const +{ + id const p = _v[@"userInterfaceStyle"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::title() const +{ + id const p = _v[@"title"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional >> JS::NativeAlertManager::Args::buttons() const +{ + id const p = _v[@"buttons"]; + return RCTBridgingToOptionalVec(p, ^id (id itemValue_0) { return itemValue_0; }); +} +inline NSString *JS::NativeAlertManager::Args::type() const +{ + id const p = _v[@"type"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::defaultValue() const +{ + id const p = _v[@"defaultValue"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::cancelButtonKey() const +{ + id const p = _v[@"cancelButtonKey"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::destructiveButtonKey() const +{ + id const p = _v[@"destructiveButtonKey"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::keyboardType() const +{ + id const p = _v[@"keyboardType"]; + return RCTBridgingToOptionalString(p); +} +inline facebook::react::LazyVector JS::NativeAnimatedModule::EventMapping::nativeEventPath() const +{ + id const p = _v[@"nativeEventPath"]; + return RCTBridgingToVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline folly::Optional JS::NativeAnimatedModule::EventMapping::animatedValueTag() const +{ + id const p = _v[@"animatedValueTag"]; + return RCTBridgingToOptionalDouble(p); +} +inline facebook::react::LazyVector JS::NativeAnimatedTurboModule::EventMapping::nativeEventPath() const +{ + id const p = _v[@"nativeEventPath"]; + return RCTBridgingToVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline folly::Optional JS::NativeAnimatedTurboModule::EventMapping::animatedValueTag() const +{ + id const p = _v[@"animatedValueTag"]; + return RCTBridgingToOptionalDouble(p); +} + +inline JS::NativeAppState::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto initialAppState = i.initialAppState.get(); + d[@"initialAppState"] = initialAppState; + return d; +}) {} +inline JS::NativeAppState::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + + +inline JS::NativeBlobModule::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto BLOB_URI_SCHEME = i.BLOB_URI_SCHEME.get(); + d[@"BLOB_URI_SCHEME"] = BLOB_URI_SCHEME; + auto BLOB_URI_HOST = i.BLOB_URI_HOST.get(); + d[@"BLOB_URI_HOST"] = BLOB_URI_HOST; + return d; +}) {} +inline JS::NativeBlobModule::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + + + + + + +inline JS::NativeDeviceInfo::DisplayMetrics::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto width = i.width.get(); + d[@"width"] = @(width); + auto height = i.height.get(); + d[@"height"] = @(height); + auto scale = i.scale.get(); + d[@"scale"] = @(scale); + auto fontScale = i.fontScale.get(); + d[@"fontScale"] = @(fontScale); + return d; +}) {} +inline JS::NativeDeviceInfo::DisplayMetrics::Builder::Builder(DisplayMetrics i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeDeviceInfo::DisplayMetricsAndroid::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto width = i.width.get(); + d[@"width"] = @(width); + auto height = i.height.get(); + d[@"height"] = @(height); + auto scale = i.scale.get(); + d[@"scale"] = @(scale); + auto fontScale = i.fontScale.get(); + d[@"fontScale"] = @(fontScale); + auto densityDpi = i.densityDpi.get(); + d[@"densityDpi"] = @(densityDpi); + return d; +}) {} +inline JS::NativeDeviceInfo::DisplayMetricsAndroid::Builder::Builder(DisplayMetricsAndroid i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeDeviceInfo::DimensionsPayload::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto window = i.window; + d[@"window"] = window.hasValue() ? window.value().buildUnsafeRawValue() : nil; + auto screen = i.screen; + d[@"screen"] = screen.hasValue() ? screen.value().buildUnsafeRawValue() : nil; + auto windowPhysicalPixels = i.windowPhysicalPixels; + d[@"windowPhysicalPixels"] = windowPhysicalPixels.hasValue() ? windowPhysicalPixels.value().buildUnsafeRawValue() : nil; + auto screenPhysicalPixels = i.screenPhysicalPixels; + d[@"screenPhysicalPixels"] = screenPhysicalPixels.hasValue() ? screenPhysicalPixels.value().buildUnsafeRawValue() : nil; + return d; +}) {} +inline JS::NativeDeviceInfo::DimensionsPayload::Builder::Builder(DimensionsPayload i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeDeviceInfo::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto Dimensions = i.Dimensions.get(); + d[@"Dimensions"] = Dimensions.buildUnsafeRawValue(); + auto isIPhoneX_deprecated = i.isIPhoneX_deprecated; + d[@"isIPhoneX_deprecated"] = isIPhoneX_deprecated.hasValue() ? @((BOOL)isIPhoneX_deprecated.value()) : nil; + return d; +}) {} +inline JS::NativeDeviceInfo::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline folly::Optional JS::NativeExceptionsManager::StackFrame::column() const +{ + id const p = _v[@"column"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeExceptionsManager::StackFrame::file() const +{ + id const p = _v[@"file"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativeExceptionsManager::StackFrame::lineNumber() const +{ + id const p = _v[@"lineNumber"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeExceptionsManager::StackFrame::methodName() const +{ + id const p = _v[@"methodName"]; + return RCTBridgingToString(p); +} +inline folly::Optional JS::NativeExceptionsManager::StackFrame::collapse() const +{ + id const p = _v[@"collapse"]; + return RCTBridgingToOptionalBool(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToString(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::originalMessage() const +{ + id const p = _v[@"originalMessage"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::name() const +{ + id const p = _v[@"name"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::componentStack() const +{ + id const p = _v[@"componentStack"]; + return RCTBridgingToOptionalString(p); +} +inline facebook::react::LazyVector JS::NativeExceptionsManager::ExceptionData::stack() const +{ + id const p = _v[@"stack"]; + return RCTBridgingToVec(p, ^JS::NativeExceptionsManager::StackFrame(id itemValue_0) { return JS::NativeExceptionsManager::StackFrame(itemValue_0); }); +} +inline double JS::NativeExceptionsManager::ExceptionData::id_() const +{ + id const p = _v[@"id"]; + return RCTBridgingToDouble(p); +} +inline bool JS::NativeExceptionsManager::ExceptionData::isFatal() const +{ + id const p = _v[@"isFatal"]; + return RCTBridgingToBool(p); +} +inline id _Nullable JS::NativeExceptionsManager::ExceptionData::extraData() const +{ + id const p = _v[@"extraData"]; + return p; +} + +inline folly::Optional JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions::debug() const +{ + id const p = _v[@"debug"]; + return RCTBridgingToOptionalBool(p); +} +inline folly::Optional JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions::reportStackTraces() const +{ + id const p = _v[@"reportStackTraces"]; + return RCTBridgingToOptionalBool(p); +} + +inline JS::NativeI18nManager::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto isRTL = i.isRTL.get(); + d[@"isRTL"] = @(isRTL); + auto doLeftAndRightSwapInRTL = i.doLeftAndRightSwapInRTL.get(); + d[@"doLeftAndRightSwapInRTL"] = @(doLeftAndRightSwapInRTL); + auto localeIdentifier = i.localeIdentifier.get(); + d[@"localeIdentifier"] = localeIdentifier; + return d; +}) {} +inline JS::NativeI18nManager::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline double JS::NativeImageEditor::OptionsOffset::x() const +{ + id const p = _v[@"x"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsOffset::y() const +{ + id const p = _v[@"y"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsSize::width() const +{ + id const p = _v[@"width"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsSize::height() const +{ + id const p = _v[@"height"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsDisplaySize::width() const +{ + id const p = _v[@"width"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsDisplaySize::height() const +{ + id const p = _v[@"height"]; + return RCTBridgingToDouble(p); +} +inline JS::NativeImageEditor::OptionsOffset JS::NativeImageEditor::Options::offset() const +{ + id const p = _v[@"offset"]; + return JS::NativeImageEditor::OptionsOffset(p); +} +inline JS::NativeImageEditor::OptionsSize JS::NativeImageEditor::Options::size() const +{ + id const p = _v[@"size"]; + return JS::NativeImageEditor::OptionsSize(p); +} +inline folly::Optional JS::NativeImageEditor::Options::displaySize() const +{ + id const p = _v[@"displaySize"]; + return (p == nil ? folly::none : folly::make_optional(JS::NativeImageEditor::OptionsDisplaySize(p))); +} +inline NSString *JS::NativeImageEditor::Options::resizeMode() const +{ + id const p = _v[@"resizeMode"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativeImageEditor::Options::allowExternalStorage() const +{ + id const p = _v[@"allowExternalStorage"]; + return RCTBridgingToOptionalBool(p); +} + +inline bool JS::NativeImagePickerIOS::SpecOpenCameraDialogConfig::unmirrorFrontFacingCamera() const +{ + id const p = _v[@"unmirrorFrontFacingCamera"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativeImagePickerIOS::SpecOpenCameraDialogConfig::videoMode() const +{ + id const p = _v[@"videoMode"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativeImagePickerIOS::SpecOpenSelectDialogConfig::showImages() const +{ + id const p = _v[@"showImages"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativeImagePickerIOS::SpecOpenSelectDialogConfig::showVideos() const +{ + id const p = _v[@"showVideos"]; + return RCTBridgingToBool(p); +} + + + +inline JS::NativeJSDevSupport::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto ERROR_CODE_EXCEPTION = i.ERROR_CODE_EXCEPTION.get(); + d[@"ERROR_CODE_EXCEPTION"] = @(ERROR_CODE_EXCEPTION); + auto ERROR_CODE_VIEW_NOT_FOUND = i.ERROR_CODE_VIEW_NOT_FOUND.get(); + d[@"ERROR_CODE_VIEW_NOT_FOUND"] = @(ERROR_CODE_VIEW_NOT_FOUND); + return d; +}) {} +inline JS::NativeJSDevSupport::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + + + +inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::method() const +{ + id const p = _v[@"method"]; + return RCTBridgingToString(p); +} +inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::url() const +{ + id const p = _v[@"url"]; + return RCTBridgingToString(p); +} +inline id JS::NativeNetworkingIOS::SpecSendRequestQuery::data() const +{ + id const p = _v[@"data"]; + return p; +} +inline id JS::NativeNetworkingIOS::SpecSendRequestQuery::headers() const +{ + id const p = _v[@"headers"]; + return p; +} +inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::responseType() const +{ + id const p = _v[@"responseType"]; + return RCTBridgingToString(p); +} +inline bool JS::NativeNetworkingIOS::SpecSendRequestQuery::incrementalUpdates() const +{ + id const p = _v[@"incrementalUpdates"]; + return RCTBridgingToBool(p); +} +inline double JS::NativeNetworkingIOS::SpecSendRequestQuery::timeout() const +{ + id const p = _v[@"timeout"]; + return RCTBridgingToDouble(p); +} +inline bool JS::NativeNetworkingIOS::SpecSendRequestQuery::withCredentials() const +{ + id const p = _v[@"withCredentials"]; + return RCTBridgingToBool(p); +} +inline JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto major = i.major.get(); + d[@"major"] = @(major); + auto minor = i.minor.get(); + d[@"minor"] = @(minor); + auto patch = i.patch.get(); + d[@"patch"] = @(patch); + auto prerelease = i.prerelease.get(); + d[@"prerelease"] = prerelease.hasValue() ? @((double)prerelease.value()) : nil; + return d; +}) {} +inline JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder::Builder(ConstantsReactNativeVersion i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativePlatformConstantsIOS::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto isTesting = i.isTesting.get(); + d[@"isTesting"] = @(isTesting); + auto reactNativeVersion = i.reactNativeVersion.get(); + d[@"reactNativeVersion"] = reactNativeVersion.buildUnsafeRawValue(); + auto forceTouchAvailable = i.forceTouchAvailable.get(); + d[@"forceTouchAvailable"] = @(forceTouchAvailable); + auto osVersion = i.osVersion.get(); + d[@"osVersion"] = osVersion; + auto systemName = i.systemName.get(); + d[@"systemName"] = systemName; + auto interfaceIdiom = i.interfaceIdiom.get(); + d[@"interfaceIdiom"] = interfaceIdiom; + return d; +}) {} +inline JS::NativePlatformConstantsIOS::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::alert() const +{ + id const p = _v[@"alert"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::badge() const +{ + id const p = _v[@"badge"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::sound() const +{ + id const p = _v[@"sound"]; + return RCTBridgingToBool(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertTitle() const +{ + id const p = _v[@"alertTitle"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativePushNotificationManagerIOS::Notification::fireDate() const +{ + id const p = _v[@"fireDate"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertBody() const +{ + id const p = _v[@"alertBody"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertAction() const +{ + id const p = _v[@"alertAction"]; + return RCTBridgingToOptionalString(p); +} +inline id _Nullable JS::NativePushNotificationManagerIOS::Notification::userInfo() const +{ + id const p = _v[@"userInfo"]; + return p; +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::category() const +{ + id const p = _v[@"category"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::repeatInterval() const +{ + id const p = _v[@"repeatInterval"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativePushNotificationManagerIOS::Notification::applicationIconBadgeNumber() const +{ + id const p = _v[@"applicationIconBadgeNumber"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativePushNotificationManagerIOS::Notification::isSilent() const +{ + id const p = _v[@"isSilent"]; + return RCTBridgingToOptionalBool(p); +} + + +inline JS::NativeSettingsManager::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto settings = i.settings.get(); + d[@"settings"] = settings; + return d; +}) {} +inline JS::NativeSettingsManager::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline NSString *JS::NativeShareModule::SpecShareContent::title() const +{ + id const p = _v[@"title"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeShareModule::SpecShareContent::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} + +inline JS::NativeSourceCode::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto scriptURL = i.scriptURL.get(); + d[@"scriptURL"] = scriptURL; + return d; +}) {} +inline JS::NativeSourceCode::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeStatusBarManagerIOS::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto HEIGHT = i.HEIGHT.get(); + d[@"HEIGHT"] = @(HEIGHT); + auto DEFAULT_BACKGROUND_COLOR = i.DEFAULT_BACKGROUND_COLOR; + d[@"DEFAULT_BACKGROUND_COLOR"] = DEFAULT_BACKGROUND_COLOR.hasValue() ? @((double)DEFAULT_BACKGROUND_COLOR.value()) : nil; + return d; +}) {} +inline JS::NativeStatusBarManagerIOS::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + +inline id _Nullable JS::NativeWebSocketModule::SpecConnectOptions::headers() const +{ + id const p = _v[@"headers"]; + return p; +} diff --git a/Frameworks/FBReactNativeSpec.xcframework/ios-arm64/libFBReactNativeSpec.a b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64/libFBReactNativeSpec.a new file mode 100644 index 0000000..186f7d6 Binary files /dev/null and b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64/libFBReactNativeSpec.a differ diff --git a/Frameworks/FBReactNativeSpec.xcframework/ios-arm64_x86_64-simulator/Headers/FBReactNativeSpec/FBReactNativeSpec.h b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64_x86_64-simulator/Headers/FBReactNativeSpec/FBReactNativeSpec.h new file mode 100644 index 0000000..95f3661 --- /dev/null +++ b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64_x86_64-simulator/Headers/FBReactNativeSpec/FBReactNativeSpec.h @@ -0,0 +1,2566 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by codegen project: GenerateModuleObjCpp + * + * We create an umbrella header (and corresponding implementation) here since + * Cxx compilation in BUCK has a limitation: source-code producing genrule()s + * must have a single output. More files => more genrule()s => slower builds. + */ + +#ifndef __cplusplus +#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm. +#endif +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + + +@protocol NativeAccessibilityInfoSpec + +- (void)isReduceMotionEnabled:(RCTResponseSenderBlock)onSuccess; +- (void)isTouchExplorationEnabled:(RCTResponseSenderBlock)onSuccess; +- (void)setAccessibilityFocus:(double)reactTag; +- (void)announceForAccessibility:(NSString *)announcement; +- (void)getRecommendedTimeoutMillis:(double)mSec + onSuccess:(RCTResponseSenderBlock)onSuccess; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAccessibilityInfo' + */ + class JSI_EXPORT NativeAccessibilityInfoSpecJSI : public ObjCTurboModule { + public: + NativeAccessibilityInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAccessibilityManager { + struct SpecSetAccessibilityContentSizeMultipliersJSMultipliers { + folly::Optional extraSmall() const; + folly::Optional small() const; + folly::Optional medium() const; + folly::Optional large() const; + folly::Optional extraLarge() const; + folly::Optional extraExtraLarge() const; + folly::Optional extraExtraExtraLarge() const; + folly::Optional accessibilityMedium() const; + folly::Optional accessibilityLarge() const; + folly::Optional accessibilityExtraLarge() const; + folly::Optional accessibilityExtraExtraLarge() const; + folly::Optional accessibilityExtraExtraExtraLarge() const; + + SpecSetAccessibilityContentSizeMultipliersJSMultipliers(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers) ++ (RCTManagedPointer *)JS_NativeAccessibilityManager_SpecSetAccessibilityContentSizeMultipliersJSMultipliers:(id)json; +@end +@protocol NativeAccessibilityManagerSpec + +- (void)getCurrentBoldTextState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentGrayscaleState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentInvertColorsState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentReduceMotionState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentReduceTransparencyState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)getCurrentVoiceOverState:(RCTResponseSenderBlock)onSuccess + onError:(RCTResponseSenderBlock)onError; +- (void)setAccessibilityContentSizeMultipliers:(JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers &)JSMultipliers; +- (void)setAccessibilityFocus:(double)reactTag; +- (void)announceForAccessibility:(NSString *)announcement; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAccessibilityManager' + */ + class JSI_EXPORT NativeAccessibilityManagerSpecJSI : public ObjCTurboModule { + public: + NativeAccessibilityManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeActionSheetManager { + struct SpecShowActionSheetWithOptionsOptions { + NSString *title() const; + NSString *message() const; + folly::Optional> options() const; + folly::Optional> destructiveButtonIndices() const; + folly::Optional cancelButtonIndex() const; + folly::Optional anchor() const; + folly::Optional tintColor() const; + folly::Optional cancelButtonTintColor() const; + NSString *userInterfaceStyle() const; + folly::Optional> disabledButtonIndices() const; + + SpecShowActionSheetWithOptionsOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions) ++ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowActionSheetWithOptionsOptions:(id)json; +@end +namespace JS { + namespace NativeActionSheetManager { + struct SpecShowShareActionSheetWithOptionsOptions { + NSString *message() const; + NSString *url() const; + NSString *subject() const; + folly::Optional anchor() const; + folly::Optional tintColor() const; + folly::Optional cancelButtonTintColor() const; + folly::Optional> excludedActivityTypes() const; + NSString *userInterfaceStyle() const; + + SpecShowShareActionSheetWithOptionsOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions) ++ (RCTManagedPointer *)JS_NativeActionSheetManager_SpecShowShareActionSheetWithOptionsOptions:(id)json; +@end +@protocol NativeActionSheetManagerSpec + +- (void)showActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions &)options + callback:(RCTResponseSenderBlock)callback; +- (void)showShareActionSheetWithOptions:(JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &)options + failureCallback:(RCTResponseSenderBlock)failureCallback + successCallback:(RCTResponseSenderBlock)successCallback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeActionSheetManager' + */ + class JSI_EXPORT NativeActionSheetManagerSpecJSI : public ObjCTurboModule { + public: + NativeActionSheetManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAlertManager { + struct Args { + NSString *title() const; + NSString *message() const; + folly::Optional >> buttons() const; + NSString *type() const; + NSString *defaultValue() const; + NSString *cancelButtonKey() const; + NSString *destructiveButtonKey() const; + NSString *keyboardType() const; + + Args(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAlertManager_Args) ++ (RCTManagedPointer *)JS_NativeAlertManager_Args:(id)json; +@end +@protocol NativeAlertManagerSpec + +- (void)alertWithArgs:(JS::NativeAlertManager::Args &)args + callback:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAlertManager' + */ + class JSI_EXPORT NativeAlertManagerSpecJSI : public ObjCTurboModule { + public: + NativeAlertManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAnimatedModule { + struct EventMapping { + facebook::react::LazyVector nativeEventPath() const; + folly::Optional animatedValueTag() const; + + EventMapping(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAnimatedModule_EventMapping) ++ (RCTManagedPointer *)JS_NativeAnimatedModule_EventMapping:(id)json; +@end +@protocol NativeAnimatedModuleSpec + +- (void)startOperationBatch; +- (void)finishOperationBatch; +- (void)createAnimatedNode:(double)tag + config:(NSDictionary *)config; +- (void)getValue:(double)tag +saveValueCallback:(RCTResponseSenderBlock)saveValueCallback; +- (void)startListeningToAnimatedNodeValue:(double)tag; +- (void)stopListeningToAnimatedNodeValue:(double)tag; +- (void)connectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)disconnectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)startAnimatingNode:(double)animationId + nodeTag:(double)nodeTag + config:(NSDictionary *)config + endCallback:(RCTResponseSenderBlock)endCallback; +- (void)stopAnimation:(double)animationId; +- (void)setAnimatedNodeValue:(double)nodeTag + value:(double)value; +- (void)setAnimatedNodeOffset:(double)nodeTag + offset:(double)offset; +- (void)flattenAnimatedNodeOffset:(double)nodeTag; +- (void)extractAnimatedNodeOffset:(double)nodeTag; +- (void)connectAnimatedNodeToView:(double)nodeTag + viewTag:(double)viewTag; +- (void)disconnectAnimatedNodeFromView:(double)nodeTag + viewTag:(double)viewTag; +- (void)restoreDefaultValues:(double)nodeTag; +- (void)dropAnimatedNode:(double)tag; +- (void)addAnimatedEventToView:(double)viewTag + eventName:(NSString *)eventName + eventMapping:(JS::NativeAnimatedModule::EventMapping &)eventMapping; +- (void)removeAnimatedEventFromView:(double)viewTag + eventName:(NSString *)eventName + animatedNodeTag:(double)animatedNodeTag; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAnimatedModule' + */ + class JSI_EXPORT NativeAnimatedModuleSpecJSI : public ObjCTurboModule { + public: + NativeAnimatedModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAnimatedTurboModule { + struct EventMapping { + facebook::react::LazyVector nativeEventPath() const; + folly::Optional animatedValueTag() const; + + EventMapping(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeAnimatedTurboModule_EventMapping) ++ (RCTManagedPointer *)JS_NativeAnimatedTurboModule_EventMapping:(id)json; +@end +@protocol NativeAnimatedTurboModuleSpec + +- (void)startOperationBatch; +- (void)finishOperationBatch; +- (void)createAnimatedNode:(double)tag + config:(NSDictionary *)config; +- (void)getValue:(double)tag +saveValueCallback:(RCTResponseSenderBlock)saveValueCallback; +- (void)startListeningToAnimatedNodeValue:(double)tag; +- (void)stopListeningToAnimatedNodeValue:(double)tag; +- (void)connectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)disconnectAnimatedNodes:(double)parentTag + childTag:(double)childTag; +- (void)startAnimatingNode:(double)animationId + nodeTag:(double)nodeTag + config:(NSDictionary *)config + endCallback:(RCTResponseSenderBlock)endCallback; +- (void)stopAnimation:(double)animationId; +- (void)setAnimatedNodeValue:(double)nodeTag + value:(double)value; +- (void)setAnimatedNodeOffset:(double)nodeTag + offset:(double)offset; +- (void)flattenAnimatedNodeOffset:(double)nodeTag; +- (void)extractAnimatedNodeOffset:(double)nodeTag; +- (void)connectAnimatedNodeToView:(double)nodeTag + viewTag:(double)viewTag; +- (void)disconnectAnimatedNodeFromView:(double)nodeTag + viewTag:(double)viewTag; +- (void)restoreDefaultValues:(double)nodeTag; +- (void)dropAnimatedNode:(double)tag; +- (void)addAnimatedEventToView:(double)viewTag + eventName:(NSString *)eventName + eventMapping:(JS::NativeAnimatedTurboModule::EventMapping &)eventMapping; +- (void)removeAnimatedEventFromView:(double)viewTag + eventName:(NSString *)eventName + animatedNodeTag:(double)animatedNodeTag; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAnimatedTurboModule' + */ + class JSI_EXPORT NativeAnimatedTurboModuleSpecJSI : public ObjCTurboModule { + public: + NativeAnimatedTurboModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAnimationsDebugModuleSpec + +- (void)startRecordingFps; +- (void)stopRecordingFps:(double)animationStopTimeMs; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAnimationsDebugModule' + */ + class JSI_EXPORT NativeAnimationsDebugModuleSpecJSI : public ObjCTurboModule { + public: + NativeAnimationsDebugModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeAppState { + struct Constants { + + struct Builder { + struct Input { + RCTRequired initialAppState; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeAppStateSpec + +- (void)getCurrentAppState:(RCTResponseSenderBlock)success + error:(RCTResponseSenderBlock)error; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAppState' + */ + class JSI_EXPORT NativeAppStateSpecJSI : public ObjCTurboModule { + public: + NativeAppStateSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAppearanceSpec + +- (NSString * _Nullable)getColorScheme; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAppearance' + */ + class JSI_EXPORT NativeAppearanceSpecJSI : public ObjCTurboModule { + public: + NativeAppearanceSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAsyncLocalStorageSpec + +- (void)multiGet:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)multiSet:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiMerge:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiRemove:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)clear:(RCTResponseSenderBlock)callback; +- (void)getAllKeys:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAsyncLocalStorage' + */ + class JSI_EXPORT NativeAsyncLocalStorageSpecJSI : public ObjCTurboModule { + public: + NativeAsyncLocalStorageSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeAsyncSQLiteDBStorageSpec + +- (void)multiGet:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)multiSet:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiMerge:(NSArray *)kvPairs + callback:(RCTResponseSenderBlock)callback; +- (void)multiRemove:(NSArray *)keys + callback:(RCTResponseSenderBlock)callback; +- (void)clear:(RCTResponseSenderBlock)callback; +- (void)getAllKeys:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeAsyncSQLiteDBStorage' + */ + class JSI_EXPORT NativeAsyncSQLiteDBStorageSpecJSI : public ObjCTurboModule { + public: + NativeAsyncSQLiteDBStorageSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeBlobModule { + struct Constants { + + struct Builder { + struct Input { + RCTRequired BLOB_URI_SCHEME; + RCTRequired BLOB_URI_HOST; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeBlobModuleSpec + +- (void)addNetworkingHandler; +- (void)addWebSocketHandler:(double)id; +- (void)removeWebSocketHandler:(double)id; +- (void)sendOverSocket:(NSDictionary *)blob + socketID:(double)socketID; +- (void)createFromParts:(NSArray *)parts + withId:(NSString *)withId; +- (void)release:(NSString *)blobId; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeBlobModule' + */ + class JSI_EXPORT NativeBlobModuleSpecJSI : public ObjCTurboModule { + public: + NativeBlobModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeBugReportingSpec + +- (void)startReportAProblemFlow; +- (void)setExtraData:(NSDictionary *)extraData + extraFiles:(NSDictionary *)extraFiles; +- (void)setCategoryID:(NSString *)categoryID; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeBugReporting' + */ + class JSI_EXPORT NativeBugReportingSpecJSI : public ObjCTurboModule { + public: + NativeBugReportingSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeClipboardSpec + +- (void)getString:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)setString:(NSString *)content; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeClipboard' + */ + class JSI_EXPORT NativeClipboardSpecJSI : public ObjCTurboModule { + public: + NativeClipboardSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevLoadingViewSpec + +- (void)showMessage:(NSString *)message + withColor:(NSNumber *)withColor +withBackgroundColor:(NSNumber *)withBackgroundColor; +- (void)hide; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevLoadingView' + */ + class JSI_EXPORT NativeDevLoadingViewSpecJSI : public ObjCTurboModule { + public: + NativeDevLoadingViewSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevMenuSpec + +- (void)show; +- (void)reload; +- (void)debugRemotely:(BOOL)enableDebug; +- (void)setProfilingEnabled:(BOOL)enabled; +- (void)setHotLoadingEnabled:(BOOL)enabled; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevMenu' + */ + class JSI_EXPORT NativeDevMenuSpecJSI : public ObjCTurboModule { + public: + NativeDevMenuSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevSettingsSpec + +- (void)reload; +- (void)reloadWithReason:(NSString *)reason; +- (void)onFastRefresh; +- (void)setHotLoadingEnabled:(BOOL)isHotLoadingEnabled; +- (void)setIsDebuggingRemotely:(BOOL)isDebuggingRemotelyEnabled; +- (void)setProfilingEnabled:(BOOL)isProfilingEnabled; +- (void)toggleElementInspector; +- (void)addMenuItem:(NSString *)title; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; +- (void)setIsShakeToShowDevMenuEnabled:(BOOL)enabled; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevSettings' + */ + class JSI_EXPORT NativeDevSettingsSpecJSI : public ObjCTurboModule { + public: + NativeDevSettingsSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDevSplitBundleLoaderSpec + +- (void)loadBundle:(NSString *)bundlePath + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDevSplitBundleLoader' + */ + class JSI_EXPORT NativeDevSplitBundleLoaderSpecJSI : public ObjCTurboModule { + public: + NativeDevSplitBundleLoaderSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeDeviceEventManagerSpec + +- (void)invokeDefaultBackPressHandler; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDeviceEventManager' + */ + class JSI_EXPORT NativeDeviceEventManagerSpecJSI : public ObjCTurboModule { + public: + NativeDeviceEventManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeDeviceInfo { + struct DisplayMetrics { + + struct Builder { + struct Input { + RCTRequired width; + RCTRequired height; + RCTRequired scale; + RCTRequired fontScale; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing DisplayMetrics */ + Builder(DisplayMetrics i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static DisplayMetrics fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + DisplayMetrics(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativeDeviceInfo { + struct DisplayMetricsAndroid { + + struct Builder { + struct Input { + RCTRequired width; + RCTRequired height; + RCTRequired scale; + RCTRequired fontScale; + RCTRequired densityDpi; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing DisplayMetricsAndroid */ + Builder(DisplayMetricsAndroid i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static DisplayMetricsAndroid fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + DisplayMetricsAndroid(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativeDeviceInfo { + struct DimensionsPayload { + + struct Builder { + struct Input { + folly::Optional window; + folly::Optional screen; + folly::Optional windowPhysicalPixels; + folly::Optional screenPhysicalPixels; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing DimensionsPayload */ + Builder(DimensionsPayload i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static DimensionsPayload fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + DimensionsPayload(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativeDeviceInfo { + struct Constants { + + struct Builder { + struct Input { + RCTRequired Dimensions; + folly::Optional isIPhoneX_deprecated; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeDeviceInfoSpec + +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeDeviceInfo' + */ + class JSI_EXPORT NativeDeviceInfoSpecJSI : public ObjCTurboModule { + public: + NativeDeviceInfoSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeExceptionsManager { + struct StackFrame { + folly::Optional column() const; + NSString *file() const; + folly::Optional lineNumber() const; + NSString *methodName() const; + folly::Optional collapse() const; + + StackFrame(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeExceptionsManager_StackFrame) ++ (RCTManagedPointer *)JS_NativeExceptionsManager_StackFrame:(id)json; +@end +namespace JS { + namespace NativeExceptionsManager { + struct ExceptionData { + NSString *message() const; + NSString *originalMessage() const; + NSString *name() const; + NSString *componentStack() const; + facebook::react::LazyVector stack() const; + double id_() const; + bool isFatal() const; + id _Nullable extraData() const; + + ExceptionData(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeExceptionsManager_ExceptionData) ++ (RCTManagedPointer *)JS_NativeExceptionsManager_ExceptionData:(id)json; +@end +@protocol NativeExceptionsManagerSpec + +- (void)reportFatalException:(NSString *)message + stack:(NSArray *)stack + exceptionId:(double)exceptionId; +- (void)reportSoftException:(NSString *)message + stack:(NSArray *)stack + exceptionId:(double)exceptionId; +- (void)reportException:(JS::NativeExceptionsManager::ExceptionData &)data; +- (void)updateExceptionMessage:(NSString *)message + stack:(NSArray *)stack + exceptionId:(double)exceptionId; +- (void)dismissRedbox; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeExceptionsManager' + */ + class JSI_EXPORT NativeExceptionsManagerSpecJSI : public ObjCTurboModule { + public: + NativeExceptionsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeFileReaderModuleSpec + +- (void)readAsDataURL:(NSDictionary *)data + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)readAsText:(NSDictionary *)data + encoding:(NSString *)encoding + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeFileReaderModule' + */ + class JSI_EXPORT NativeFileReaderModuleSpecJSI : public ObjCTurboModule { + public: + NativeFileReaderModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeFrameRateLogger { + struct SpecSetGlobalOptionsOptions { + folly::Optional debug() const; + folly::Optional reportStackTraces() const; + + SpecSetGlobalOptionsOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeFrameRateLogger_SpecSetGlobalOptionsOptions) ++ (RCTManagedPointer *)JS_NativeFrameRateLogger_SpecSetGlobalOptionsOptions:(id)json; +@end +@protocol NativeFrameRateLoggerSpec + +- (void)setGlobalOptions:(JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions &)options; +- (void)setContext:(NSString *)context; +- (void)beginScroll; +- (void)endScroll; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeFrameRateLogger' + */ + class JSI_EXPORT NativeFrameRateLoggerSpecJSI : public ObjCTurboModule { + public: + NativeFrameRateLoggerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeHeadlessJsTaskSupportSpec + +- (void)notifyTaskFinished:(double)taskId; +- (void)notifyTaskRetry:(double)taskId + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeHeadlessJsTaskSupport' + */ + class JSI_EXPORT NativeHeadlessJsTaskSupportSpecJSI : public ObjCTurboModule { + public: + NativeHeadlessJsTaskSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeI18nManager { + struct Constants { + + struct Builder { + struct Input { + RCTRequired isRTL; + RCTRequired doLeftAndRightSwapInRTL; + RCTRequired localeIdentifier; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeI18nManagerSpec + +- (void)allowRTL:(BOOL)allowRTL; +- (void)forceRTL:(BOOL)forceRTL; +- (void)swapLeftAndRightInRTL:(BOOL)flipStyles; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeI18nManager' + */ + class JSI_EXPORT NativeI18nManagerSpecJSI : public ObjCTurboModule { + public: + NativeI18nManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeImageEditor { + struct OptionsOffset { + double x() const; + double y() const; + + OptionsOffset(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_OptionsOffset) ++ (RCTManagedPointer *)JS_NativeImageEditor_OptionsOffset:(id)json; +@end +namespace JS { + namespace NativeImageEditor { + struct OptionsSize { + double width() const; + double height() const; + + OptionsSize(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_OptionsSize) ++ (RCTManagedPointer *)JS_NativeImageEditor_OptionsSize:(id)json; +@end +namespace JS { + namespace NativeImageEditor { + struct OptionsDisplaySize { + double width() const; + double height() const; + + OptionsDisplaySize(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_OptionsDisplaySize) ++ (RCTManagedPointer *)JS_NativeImageEditor_OptionsDisplaySize:(id)json; +@end +namespace JS { + namespace NativeImageEditor { + struct Options { + JS::NativeImageEditor::OptionsOffset offset() const; + JS::NativeImageEditor::OptionsSize size() const; + folly::Optional displaySize() const; + NSString *resizeMode() const; + folly::Optional allowExternalStorage() const; + + Options(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImageEditor_Options) ++ (RCTManagedPointer *)JS_NativeImageEditor_Options:(id)json; +@end +@protocol NativeImageEditorSpec + +- (void)cropImage:(NSString *)uri + cropData:(JS::NativeImageEditor::Options &)cropData + successCallback:(RCTResponseSenderBlock)successCallback + errorCallback:(RCTResponseSenderBlock)errorCallback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImageEditor' + */ + class JSI_EXPORT NativeImageEditorSpecJSI : public ObjCTurboModule { + public: + NativeImageEditorSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeImageLoaderIOSSpec + +- (void)getSize:(NSString *)uri + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)getSizeWithHeaders:(NSString *)uri + headers:(NSDictionary *)headers + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)prefetchImage:(NSString *)uri + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)prefetchImageWithMetadata:(NSString *)uri + queryRootName:(NSString *)queryRootName + rootTag:(double)rootTag + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)queryCache:(NSArray *)uris + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImageLoaderIOS' + */ + class JSI_EXPORT NativeImageLoaderIOSSpecJSI : public ObjCTurboModule { + public: + NativeImageLoaderIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeImagePickerIOS { + struct SpecOpenCameraDialogConfig { + bool unmirrorFrontFacingCamera() const; + bool videoMode() const; + + SpecOpenCameraDialogConfig(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImagePickerIOS_SpecOpenCameraDialogConfig) ++ (RCTManagedPointer *)JS_NativeImagePickerIOS_SpecOpenCameraDialogConfig:(id)json; +@end +namespace JS { + namespace NativeImagePickerIOS { + struct SpecOpenSelectDialogConfig { + bool showImages() const; + bool showVideos() const; + + SpecOpenSelectDialogConfig(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeImagePickerIOS_SpecOpenSelectDialogConfig) ++ (RCTManagedPointer *)JS_NativeImagePickerIOS_SpecOpenSelectDialogConfig:(id)json; +@end +@protocol NativeImagePickerIOSSpec + +- (void)canRecordVideos:(RCTResponseSenderBlock)callback; +- (void)canUseCamera:(RCTResponseSenderBlock)callback; +- (void)openCameraDialog:(JS::NativeImagePickerIOS::SpecOpenCameraDialogConfig &)config + successCallback:(RCTResponseSenderBlock)successCallback + cancelCallback:(RCTResponseSenderBlock)cancelCallback; +- (void)openSelectDialog:(JS::NativeImagePickerIOS::SpecOpenSelectDialogConfig &)config + successCallback:(RCTResponseSenderBlock)successCallback + cancelCallback:(RCTResponseSenderBlock)cancelCallback; +- (void)clearAllPendingVideos; +- (void)removePendingVideo:(NSString *)url; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImagePickerIOS' + */ + class JSI_EXPORT NativeImagePickerIOSSpecJSI : public ObjCTurboModule { + public: + NativeImagePickerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeImageStoreIOSSpec + +- (void)getBase64ForTag:(NSString *)uri + successCallback:(RCTResponseSenderBlock)successCallback + errorCallback:(RCTResponseSenderBlock)errorCallback; +- (void)hasImageForTag:(NSString *)uri + callback:(RCTResponseSenderBlock)callback; +- (void)removeImageForTag:(NSString *)uri; +- (void)addImageFromBase64:(NSString *)base64ImageData + successCallback:(RCTResponseSenderBlock)successCallback + errorCallback:(RCTResponseSenderBlock)errorCallback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeImageStoreIOS' + */ + class JSI_EXPORT NativeImageStoreIOSSpecJSI : public ObjCTurboModule { + public: + NativeImageStoreIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeJSCHeapCaptureSpec + +- (void)captureComplete:(NSString *)path + error:(NSString * _Nullable)error; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeJSCHeapCapture' + */ + class JSI_EXPORT NativeJSCHeapCaptureSpecJSI : public ObjCTurboModule { + public: + NativeJSCHeapCaptureSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeJSCSamplingProfilerSpec + +- (void)operationComplete:(double)token + result:(NSString * _Nullable)result + error:(NSString * _Nullable)error; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeJSCSamplingProfiler' + */ + class JSI_EXPORT NativeJSCSamplingProfilerSpecJSI : public ObjCTurboModule { + public: + NativeJSCSamplingProfilerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeJSDevSupport { + struct Constants { + + struct Builder { + struct Input { + RCTRequired ERROR_CODE_EXCEPTION; + RCTRequired ERROR_CODE_VIEW_NOT_FOUND; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeJSDevSupportSpec + +- (void)onSuccess:(NSString *)data; +- (void)onFailure:(double)errorCode + error:(NSString *)error; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeJSDevSupport' + */ + class JSI_EXPORT NativeJSDevSupportSpecJSI : public ObjCTurboModule { + public: + NativeJSDevSupportSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeKeyboardObserverSpec + +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeKeyboardObserver' + */ + class JSI_EXPORT NativeKeyboardObserverSpecJSI : public ObjCTurboModule { + public: + NativeKeyboardObserverSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeLinkingManagerSpec + +- (void)getInitialURL:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)canOpenURL:(NSString *)url + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)openURL:(NSString *)url + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)openSettings:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeLinkingManager' + */ + class JSI_EXPORT NativeLinkingManagerSpecJSI : public ObjCTurboModule { + public: + NativeLinkingManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeLogBoxSpec + +- (void)show; +- (void)hide; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeLogBox' + */ + class JSI_EXPORT NativeLogBoxSpecJSI : public ObjCTurboModule { + public: + NativeLogBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeModalManagerSpec + +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeModalManager' + */ + class JSI_EXPORT NativeModalManagerSpecJSI : public ObjCTurboModule { + public: + NativeModalManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeNetworkingIOS { + struct SpecSendRequestQuery { + NSString *method() const; + NSString *url() const; + id data() const; + id headers() const; + NSString *responseType() const; + bool incrementalUpdates() const; + double timeout() const; + bool withCredentials() const; + + SpecSendRequestQuery(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeNetworkingIOS_SpecSendRequestQuery) ++ (RCTManagedPointer *)JS_NativeNetworkingIOS_SpecSendRequestQuery:(id)json; +@end +@protocol NativeNetworkingIOSSpec + +- (void)sendRequest:(JS::NativeNetworkingIOS::SpecSendRequestQuery &)query + callback:(RCTResponseSenderBlock)callback; +- (void)abortRequest:(double)requestId; +- (void)clearCookies:(RCTResponseSenderBlock)callback; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeNetworkingIOS' + */ + class JSI_EXPORT NativeNetworkingIOSSpecJSI : public ObjCTurboModule { + public: + NativeNetworkingIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativePlatformConstantsIOS { + struct ConstantsReactNativeVersion { + + struct Builder { + struct Input { + RCTRequired major; + RCTRequired minor; + RCTRequired patch; + RCTRequired> prerelease; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing ConstantsReactNativeVersion */ + Builder(ConstantsReactNativeVersion i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static ConstantsReactNativeVersion fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + ConstantsReactNativeVersion(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +namespace JS { + namespace NativePlatformConstantsIOS { + struct Constants { + + struct Builder { + struct Input { + RCTRequired isTesting; + RCTRequired reactNativeVersion; + RCTRequired forceTouchAvailable; + RCTRequired osVersion; + RCTRequired systemName; + RCTRequired interfaceIdiom; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativePlatformConstantsIOSSpec + +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativePlatformConstantsIOS' + */ + class JSI_EXPORT NativePlatformConstantsIOSSpecJSI : public ObjCTurboModule { + public: + NativePlatformConstantsIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativePushNotificationManagerIOS { + struct SpecRequestPermissionsPermission { + bool alert() const; + bool badge() const; + bool sound() const; + + SpecRequestPermissionsPermission(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativePushNotificationManagerIOS_SpecRequestPermissionsPermission) ++ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_SpecRequestPermissionsPermission:(id)json; +@end +namespace JS { + namespace NativePushNotificationManagerIOS { + struct Notification { + NSString *alertTitle() const; + folly::Optional fireDate() const; + NSString *alertBody() const; + NSString *alertAction() const; + id _Nullable userInfo() const; + NSString *category() const; + NSString *repeatInterval() const; + folly::Optional applicationIconBadgeNumber() const; + folly::Optional isSilent() const; + + Notification(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativePushNotificationManagerIOS_Notification) ++ (RCTManagedPointer *)JS_NativePushNotificationManagerIOS_Notification:(id)json; +@end +@protocol NativePushNotificationManagerIOSSpec + +- (void)onFinishRemoteNotification:(NSString *)notificationId + fetchResult:(NSString *)fetchResult; +- (void)setApplicationIconBadgeNumber:(double)num; +- (void)getApplicationIconBadgeNumber:(RCTResponseSenderBlock)callback; +- (void)requestPermissions:(JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission &)permission + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)abandonPermissions; +- (void)checkPermissions:(RCTResponseSenderBlock)callback; +- (void)presentLocalNotification:(JS::NativePushNotificationManagerIOS::Notification &)notification; +- (void)scheduleLocalNotification:(JS::NativePushNotificationManagerIOS::Notification &)notification; +- (void)cancelAllLocalNotifications; +- (void)cancelLocalNotifications:(NSDictionary *)userInfo; +- (void)getInitialNotification:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; +- (void)getScheduledLocalNotifications:(RCTResponseSenderBlock)callback; +- (void)removeAllDeliveredNotifications; +- (void)removeDeliveredNotifications:(NSArray *)identifiers; +- (void)getDeliveredNotifications:(RCTResponseSenderBlock)callback; +- (void)getAuthorizationStatus:(RCTResponseSenderBlock)callback; +- (void)addListener:(NSString *)eventType; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativePushNotificationManagerIOS' + */ + class JSI_EXPORT NativePushNotificationManagerIOSSpecJSI : public ObjCTurboModule { + public: + NativePushNotificationManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeRedBoxSpec + +- (void)setExtraData:(NSDictionary *)extraData + forIdentifier:(NSString *)forIdentifier; +- (void)dismiss; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeRedBox' + */ + class JSI_EXPORT NativeRedBoxSpecJSI : public ObjCTurboModule { + public: + NativeRedBoxSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeSegmentFetcherSpec + +- (void)fetchSegment:(double)segmentId + options:(NSDictionary *)options + callback:(RCTResponseSenderBlock)callback; +- (void)getSegment:(double)segmentId + options:(NSDictionary *)options + callback:(RCTResponseSenderBlock)callback; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSegmentFetcher' + */ + class JSI_EXPORT NativeSegmentFetcherSpecJSI : public ObjCTurboModule { + public: + NativeSegmentFetcherSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeSettingsManager { + struct Constants { + + struct Builder { + struct Input { + RCTRequired > settings; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeSettingsManagerSpec + +- (void)setValues:(NSDictionary *)values; +- (void)deleteValues:(NSArray *)values; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSettingsManager' + */ + class JSI_EXPORT NativeSettingsManagerSpecJSI : public ObjCTurboModule { + public: + NativeSettingsManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeShareModule { + struct SpecShareContent { + NSString *title() const; + NSString *message() const; + + SpecShareContent(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeShareModule_SpecShareContent) ++ (RCTManagedPointer *)JS_NativeShareModule_SpecShareContent:(id)json; +@end +@protocol NativeShareModuleSpec + +- (void)share:(JS::NativeShareModule::SpecShareContent &)content + dialogTitle:(NSString *)dialogTitle + resolve:(RCTPromiseResolveBlock)resolve + reject:(RCTPromiseRejectBlock)reject; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeShareModule' + */ + class JSI_EXPORT NativeShareModuleSpecJSI : public ObjCTurboModule { + public: + NativeShareModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeSoundManagerSpec + +- (void)playTouchSound; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSoundManager' + */ + class JSI_EXPORT NativeSoundManagerSpecJSI : public ObjCTurboModule { + public: + NativeSoundManagerSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeSourceCode { + struct Constants { + + struct Builder { + struct Input { + RCTRequired scriptURL; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeSourceCodeSpec + +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeSourceCode' + */ + class JSI_EXPORT NativeSourceCodeSpecJSI : public ObjCTurboModule { + public: + NativeSourceCodeSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeStatusBarManagerIOS { + struct Constants { + + struct Builder { + struct Input { + RCTRequired HEIGHT; + folly::Optional DEFAULT_BACKGROUND_COLOR; + }; + + /** Initialize with a set of values */ + Builder(const Input i); + /** Initialize with an existing Constants */ + Builder(Constants i); + /** Builds the object. Generally used only by the infrastructure. */ + NSDictionary *buildUnsafeRawValue() const { return _factory(); }; + private: + NSDictionary *(^_factory)(void); + }; + + static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; } + NSDictionary *unsafeRawValue() const { return _v; } + private: + Constants(NSDictionary *const v) : _v(v) {} + NSDictionary *_v; + }; + } +} +@protocol NativeStatusBarManagerIOSSpec + +- (void)getHeight:(RCTResponseSenderBlock)callback; +- (void)setNetworkActivityIndicatorVisible:(BOOL)visible; +- (void)addListener:(NSString *)eventType; +- (void)removeListeners:(double)count; +- (void)setStyle:(NSString * _Nullable)statusBarStyle + animated:(BOOL)animated; +- (void)setHidden:(BOOL)hidden + withAnimation:(NSString *)withAnimation; +- (facebook::react::ModuleConstants)constantsToExport; +- (facebook::react::ModuleConstants)getConstants; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeStatusBarManagerIOS' + */ + class JSI_EXPORT NativeStatusBarManagerIOSSpecJSI : public ObjCTurboModule { + public: + NativeStatusBarManagerIOSSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeTimingSpec + +- (void)createTimer:(double)callbackID + duration:(double)duration + jsSchedulingTime:(double)jsSchedulingTime + repeats:(BOOL)repeats; +- (void)deleteTimer:(double)timerID; +- (void)setSendIdleEvents:(BOOL)sendIdleEvents; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeTiming' + */ + class JSI_EXPORT NativeTimingSpecJSI : public ObjCTurboModule { + public: + NativeTimingSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +@protocol NativeVibrationSpec + +- (void)vibrate:(double)pattern; +- (void)vibrateByPattern:(NSArray *)pattern + repeat:(double)repeat; +- (void)cancel; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeVibration' + */ + class JSI_EXPORT NativeVibrationSpecJSI : public ObjCTurboModule { + public: + NativeVibrationSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook +namespace JS { + namespace NativeWebSocketModule { + struct SpecConnectOptions { + id _Nullable headers() const; + + SpecConnectOptions(NSDictionary *const v) : _v(v) {} + private: + NSDictionary *_v; + }; + } +} + +@interface RCTCxxConvert (NativeWebSocketModule_SpecConnectOptions) ++ (RCTManagedPointer *)JS_NativeWebSocketModule_SpecConnectOptions:(id)json; +@end +@protocol NativeWebSocketModuleSpec + +- (void)connect:(NSString *)url + protocols:(NSArray * _Nullable)protocols + options:(JS::NativeWebSocketModule::SpecConnectOptions &)options + socketID:(double)socketID; +- (void)send:(NSString *)message + forSocketID:(double)forSocketID; +- (void)sendBinary:(NSString *)base64String + forSocketID:(double)forSocketID; +- (void)ping:(double)socketID; +- (void)close:(double)code + reason:(NSString *)reason + socketID:(double)socketID; +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end +namespace facebook { + namespace react { + /** + * ObjC++ class for module 'NativeWebSocketModule' + */ + class JSI_EXPORT NativeWebSocketModuleSpecJSI : public ObjCTurboModule { + public: + NativeWebSocketModuleSpecJSI(const ObjCTurboModule::InitParams ¶ms); + }; + } // namespace react +} // namespace facebook + +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraSmall() const +{ + id const p = _v[@"extraSmall"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::small() const +{ + id const p = _v[@"small"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::medium() const +{ + id const p = _v[@"medium"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::large() const +{ + id const p = _v[@"large"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraLarge() const +{ + id const p = _v[@"extraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraExtraLarge() const +{ + id const p = _v[@"extraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::extraExtraExtraLarge() const +{ + id const p = _v[@"extraExtraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityMedium() const +{ + id const p = _v[@"accessibilityMedium"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityLarge() const +{ + id const p = _v[@"accessibilityLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraLarge() const +{ + id const p = _v[@"accessibilityExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraExtraLarge() const +{ + id const p = _v[@"accessibilityExtraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeAccessibilityManager::SpecSetAccessibilityContentSizeMultipliersJSMultipliers::accessibilityExtraExtraExtraLarge() const +{ + id const p = _v[@"accessibilityExtraExtraExtraLarge"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::title() const +{ + id const p = _v[@"title"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::options() const +{ + id const p = _v[@"options"]; + return RCTBridgingToOptionalVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::destructiveButtonIndices() const +{ + id const p = _v[@"destructiveButtonIndices"]; + return RCTBridgingToOptionalVec(p, ^double(id itemValue_0) { return RCTBridgingToDouble(itemValue_0); }); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::cancelButtonIndex() const +{ + id const p = _v[@"cancelButtonIndex"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::anchor() const +{ + id const p = _v[@"anchor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::tintColor() const +{ + id const p = _v[@"tintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::cancelButtonTintColor() const +{ + id const p = _v[@"cancelButtonTintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::userInterfaceStyle() const +{ + id const p = _v[@"userInterfaceStyle"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowActionSheetWithOptionsOptions::disabledButtonIndices() const +{ + id const p = _v[@"disabledButtonIndices"]; + return RCTBridgingToOptionalVec(p, ^double(id itemValue_0) { return RCTBridgingToDouble(itemValue_0); }); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::url() const +{ + id const p = _v[@"url"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::subject() const +{ + id const p = _v[@"subject"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::anchor() const +{ + id const p = _v[@"anchor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::tintColor() const +{ + id const p = _v[@"tintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::cancelButtonTintColor() const +{ + id const p = _v[@"cancelButtonTintColor"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional> JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::excludedActivityTypes() const +{ + id const p = _v[@"excludedActivityTypes"]; + return RCTBridgingToOptionalVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline NSString *JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions::userInterfaceStyle() const +{ + id const p = _v[@"userInterfaceStyle"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::title() const +{ + id const p = _v[@"title"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional >> JS::NativeAlertManager::Args::buttons() const +{ + id const p = _v[@"buttons"]; + return RCTBridgingToOptionalVec(p, ^id (id itemValue_0) { return itemValue_0; }); +} +inline NSString *JS::NativeAlertManager::Args::type() const +{ + id const p = _v[@"type"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::defaultValue() const +{ + id const p = _v[@"defaultValue"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::cancelButtonKey() const +{ + id const p = _v[@"cancelButtonKey"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::destructiveButtonKey() const +{ + id const p = _v[@"destructiveButtonKey"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeAlertManager::Args::keyboardType() const +{ + id const p = _v[@"keyboardType"]; + return RCTBridgingToOptionalString(p); +} +inline facebook::react::LazyVector JS::NativeAnimatedModule::EventMapping::nativeEventPath() const +{ + id const p = _v[@"nativeEventPath"]; + return RCTBridgingToVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline folly::Optional JS::NativeAnimatedModule::EventMapping::animatedValueTag() const +{ + id const p = _v[@"animatedValueTag"]; + return RCTBridgingToOptionalDouble(p); +} +inline facebook::react::LazyVector JS::NativeAnimatedTurboModule::EventMapping::nativeEventPath() const +{ + id const p = _v[@"nativeEventPath"]; + return RCTBridgingToVec(p, ^NSString *(id itemValue_0) { return RCTBridgingToString(itemValue_0); }); +} +inline folly::Optional JS::NativeAnimatedTurboModule::EventMapping::animatedValueTag() const +{ + id const p = _v[@"animatedValueTag"]; + return RCTBridgingToOptionalDouble(p); +} + +inline JS::NativeAppState::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto initialAppState = i.initialAppState.get(); + d[@"initialAppState"] = initialAppState; + return d; +}) {} +inline JS::NativeAppState::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + + +inline JS::NativeBlobModule::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto BLOB_URI_SCHEME = i.BLOB_URI_SCHEME.get(); + d[@"BLOB_URI_SCHEME"] = BLOB_URI_SCHEME; + auto BLOB_URI_HOST = i.BLOB_URI_HOST.get(); + d[@"BLOB_URI_HOST"] = BLOB_URI_HOST; + return d; +}) {} +inline JS::NativeBlobModule::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + + + + + + +inline JS::NativeDeviceInfo::DisplayMetrics::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto width = i.width.get(); + d[@"width"] = @(width); + auto height = i.height.get(); + d[@"height"] = @(height); + auto scale = i.scale.get(); + d[@"scale"] = @(scale); + auto fontScale = i.fontScale.get(); + d[@"fontScale"] = @(fontScale); + return d; +}) {} +inline JS::NativeDeviceInfo::DisplayMetrics::Builder::Builder(DisplayMetrics i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeDeviceInfo::DisplayMetricsAndroid::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto width = i.width.get(); + d[@"width"] = @(width); + auto height = i.height.get(); + d[@"height"] = @(height); + auto scale = i.scale.get(); + d[@"scale"] = @(scale); + auto fontScale = i.fontScale.get(); + d[@"fontScale"] = @(fontScale); + auto densityDpi = i.densityDpi.get(); + d[@"densityDpi"] = @(densityDpi); + return d; +}) {} +inline JS::NativeDeviceInfo::DisplayMetricsAndroid::Builder::Builder(DisplayMetricsAndroid i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeDeviceInfo::DimensionsPayload::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto window = i.window; + d[@"window"] = window.hasValue() ? window.value().buildUnsafeRawValue() : nil; + auto screen = i.screen; + d[@"screen"] = screen.hasValue() ? screen.value().buildUnsafeRawValue() : nil; + auto windowPhysicalPixels = i.windowPhysicalPixels; + d[@"windowPhysicalPixels"] = windowPhysicalPixels.hasValue() ? windowPhysicalPixels.value().buildUnsafeRawValue() : nil; + auto screenPhysicalPixels = i.screenPhysicalPixels; + d[@"screenPhysicalPixels"] = screenPhysicalPixels.hasValue() ? screenPhysicalPixels.value().buildUnsafeRawValue() : nil; + return d; +}) {} +inline JS::NativeDeviceInfo::DimensionsPayload::Builder::Builder(DimensionsPayload i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeDeviceInfo::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto Dimensions = i.Dimensions.get(); + d[@"Dimensions"] = Dimensions.buildUnsafeRawValue(); + auto isIPhoneX_deprecated = i.isIPhoneX_deprecated; + d[@"isIPhoneX_deprecated"] = isIPhoneX_deprecated.hasValue() ? @((BOOL)isIPhoneX_deprecated.value()) : nil; + return d; +}) {} +inline JS::NativeDeviceInfo::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline folly::Optional JS::NativeExceptionsManager::StackFrame::column() const +{ + id const p = _v[@"column"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeExceptionsManager::StackFrame::file() const +{ + id const p = _v[@"file"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativeExceptionsManager::StackFrame::lineNumber() const +{ + id const p = _v[@"lineNumber"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativeExceptionsManager::StackFrame::methodName() const +{ + id const p = _v[@"methodName"]; + return RCTBridgingToString(p); +} +inline folly::Optional JS::NativeExceptionsManager::StackFrame::collapse() const +{ + id const p = _v[@"collapse"]; + return RCTBridgingToOptionalBool(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToString(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::originalMessage() const +{ + id const p = _v[@"originalMessage"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::name() const +{ + id const p = _v[@"name"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeExceptionsManager::ExceptionData::componentStack() const +{ + id const p = _v[@"componentStack"]; + return RCTBridgingToOptionalString(p); +} +inline facebook::react::LazyVector JS::NativeExceptionsManager::ExceptionData::stack() const +{ + id const p = _v[@"stack"]; + return RCTBridgingToVec(p, ^JS::NativeExceptionsManager::StackFrame(id itemValue_0) { return JS::NativeExceptionsManager::StackFrame(itemValue_0); }); +} +inline double JS::NativeExceptionsManager::ExceptionData::id_() const +{ + id const p = _v[@"id"]; + return RCTBridgingToDouble(p); +} +inline bool JS::NativeExceptionsManager::ExceptionData::isFatal() const +{ + id const p = _v[@"isFatal"]; + return RCTBridgingToBool(p); +} +inline id _Nullable JS::NativeExceptionsManager::ExceptionData::extraData() const +{ + id const p = _v[@"extraData"]; + return p; +} + +inline folly::Optional JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions::debug() const +{ + id const p = _v[@"debug"]; + return RCTBridgingToOptionalBool(p); +} +inline folly::Optional JS::NativeFrameRateLogger::SpecSetGlobalOptionsOptions::reportStackTraces() const +{ + id const p = _v[@"reportStackTraces"]; + return RCTBridgingToOptionalBool(p); +} + +inline JS::NativeI18nManager::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto isRTL = i.isRTL.get(); + d[@"isRTL"] = @(isRTL); + auto doLeftAndRightSwapInRTL = i.doLeftAndRightSwapInRTL.get(); + d[@"doLeftAndRightSwapInRTL"] = @(doLeftAndRightSwapInRTL); + auto localeIdentifier = i.localeIdentifier.get(); + d[@"localeIdentifier"] = localeIdentifier; + return d; +}) {} +inline JS::NativeI18nManager::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline double JS::NativeImageEditor::OptionsOffset::x() const +{ + id const p = _v[@"x"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsOffset::y() const +{ + id const p = _v[@"y"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsSize::width() const +{ + id const p = _v[@"width"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsSize::height() const +{ + id const p = _v[@"height"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsDisplaySize::width() const +{ + id const p = _v[@"width"]; + return RCTBridgingToDouble(p); +} +inline double JS::NativeImageEditor::OptionsDisplaySize::height() const +{ + id const p = _v[@"height"]; + return RCTBridgingToDouble(p); +} +inline JS::NativeImageEditor::OptionsOffset JS::NativeImageEditor::Options::offset() const +{ + id const p = _v[@"offset"]; + return JS::NativeImageEditor::OptionsOffset(p); +} +inline JS::NativeImageEditor::OptionsSize JS::NativeImageEditor::Options::size() const +{ + id const p = _v[@"size"]; + return JS::NativeImageEditor::OptionsSize(p); +} +inline folly::Optional JS::NativeImageEditor::Options::displaySize() const +{ + id const p = _v[@"displaySize"]; + return (p == nil ? folly::none : folly::make_optional(JS::NativeImageEditor::OptionsDisplaySize(p))); +} +inline NSString *JS::NativeImageEditor::Options::resizeMode() const +{ + id const p = _v[@"resizeMode"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativeImageEditor::Options::allowExternalStorage() const +{ + id const p = _v[@"allowExternalStorage"]; + return RCTBridgingToOptionalBool(p); +} + +inline bool JS::NativeImagePickerIOS::SpecOpenCameraDialogConfig::unmirrorFrontFacingCamera() const +{ + id const p = _v[@"unmirrorFrontFacingCamera"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativeImagePickerIOS::SpecOpenCameraDialogConfig::videoMode() const +{ + id const p = _v[@"videoMode"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativeImagePickerIOS::SpecOpenSelectDialogConfig::showImages() const +{ + id const p = _v[@"showImages"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativeImagePickerIOS::SpecOpenSelectDialogConfig::showVideos() const +{ + id const p = _v[@"showVideos"]; + return RCTBridgingToBool(p); +} + + + +inline JS::NativeJSDevSupport::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto ERROR_CODE_EXCEPTION = i.ERROR_CODE_EXCEPTION.get(); + d[@"ERROR_CODE_EXCEPTION"] = @(ERROR_CODE_EXCEPTION); + auto ERROR_CODE_VIEW_NOT_FOUND = i.ERROR_CODE_VIEW_NOT_FOUND.get(); + d[@"ERROR_CODE_VIEW_NOT_FOUND"] = @(ERROR_CODE_VIEW_NOT_FOUND); + return d; +}) {} +inline JS::NativeJSDevSupport::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + + + +inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::method() const +{ + id const p = _v[@"method"]; + return RCTBridgingToString(p); +} +inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::url() const +{ + id const p = _v[@"url"]; + return RCTBridgingToString(p); +} +inline id JS::NativeNetworkingIOS::SpecSendRequestQuery::data() const +{ + id const p = _v[@"data"]; + return p; +} +inline id JS::NativeNetworkingIOS::SpecSendRequestQuery::headers() const +{ + id const p = _v[@"headers"]; + return p; +} +inline NSString *JS::NativeNetworkingIOS::SpecSendRequestQuery::responseType() const +{ + id const p = _v[@"responseType"]; + return RCTBridgingToString(p); +} +inline bool JS::NativeNetworkingIOS::SpecSendRequestQuery::incrementalUpdates() const +{ + id const p = _v[@"incrementalUpdates"]; + return RCTBridgingToBool(p); +} +inline double JS::NativeNetworkingIOS::SpecSendRequestQuery::timeout() const +{ + id const p = _v[@"timeout"]; + return RCTBridgingToDouble(p); +} +inline bool JS::NativeNetworkingIOS::SpecSendRequestQuery::withCredentials() const +{ + id const p = _v[@"withCredentials"]; + return RCTBridgingToBool(p); +} +inline JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto major = i.major.get(); + d[@"major"] = @(major); + auto minor = i.minor.get(); + d[@"minor"] = @(minor); + auto patch = i.patch.get(); + d[@"patch"] = @(patch); + auto prerelease = i.prerelease.get(); + d[@"prerelease"] = prerelease.hasValue() ? @((double)prerelease.value()) : nil; + return d; +}) {} +inline JS::NativePlatformConstantsIOS::ConstantsReactNativeVersion::Builder::Builder(ConstantsReactNativeVersion i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativePlatformConstantsIOS::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto isTesting = i.isTesting.get(); + d[@"isTesting"] = @(isTesting); + auto reactNativeVersion = i.reactNativeVersion.get(); + d[@"reactNativeVersion"] = reactNativeVersion.buildUnsafeRawValue(); + auto forceTouchAvailable = i.forceTouchAvailable.get(); + d[@"forceTouchAvailable"] = @(forceTouchAvailable); + auto osVersion = i.osVersion.get(); + d[@"osVersion"] = osVersion; + auto systemName = i.systemName.get(); + d[@"systemName"] = systemName; + auto interfaceIdiom = i.interfaceIdiom.get(); + d[@"interfaceIdiom"] = interfaceIdiom; + return d; +}) {} +inline JS::NativePlatformConstantsIOS::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::alert() const +{ + id const p = _v[@"alert"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::badge() const +{ + id const p = _v[@"badge"]; + return RCTBridgingToBool(p); +} +inline bool JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission::sound() const +{ + id const p = _v[@"sound"]; + return RCTBridgingToBool(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertTitle() const +{ + id const p = _v[@"alertTitle"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativePushNotificationManagerIOS::Notification::fireDate() const +{ + id const p = _v[@"fireDate"]; + return RCTBridgingToOptionalDouble(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertBody() const +{ + id const p = _v[@"alertBody"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::alertAction() const +{ + id const p = _v[@"alertAction"]; + return RCTBridgingToOptionalString(p); +} +inline id _Nullable JS::NativePushNotificationManagerIOS::Notification::userInfo() const +{ + id const p = _v[@"userInfo"]; + return p; +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::category() const +{ + id const p = _v[@"category"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativePushNotificationManagerIOS::Notification::repeatInterval() const +{ + id const p = _v[@"repeatInterval"]; + return RCTBridgingToOptionalString(p); +} +inline folly::Optional JS::NativePushNotificationManagerIOS::Notification::applicationIconBadgeNumber() const +{ + id const p = _v[@"applicationIconBadgeNumber"]; + return RCTBridgingToOptionalDouble(p); +} +inline folly::Optional JS::NativePushNotificationManagerIOS::Notification::isSilent() const +{ + id const p = _v[@"isSilent"]; + return RCTBridgingToOptionalBool(p); +} + + +inline JS::NativeSettingsManager::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto settings = i.settings.get(); + d[@"settings"] = settings; + return d; +}) {} +inline JS::NativeSettingsManager::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline NSString *JS::NativeShareModule::SpecShareContent::title() const +{ + id const p = _v[@"title"]; + return RCTBridgingToOptionalString(p); +} +inline NSString *JS::NativeShareModule::SpecShareContent::message() const +{ + id const p = _v[@"message"]; + return RCTBridgingToOptionalString(p); +} + +inline JS::NativeSourceCode::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto scriptURL = i.scriptURL.get(); + d[@"scriptURL"] = scriptURL; + return d; +}) {} +inline JS::NativeSourceCode::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} +inline JS::NativeStatusBarManagerIOS::Constants::Builder::Builder(const Input i) : _factory(^{ + NSMutableDictionary *d = [NSMutableDictionary new]; + auto HEIGHT = i.HEIGHT.get(); + d[@"HEIGHT"] = @(HEIGHT); + auto DEFAULT_BACKGROUND_COLOR = i.DEFAULT_BACKGROUND_COLOR; + d[@"DEFAULT_BACKGROUND_COLOR"] = DEFAULT_BACKGROUND_COLOR.hasValue() ? @((double)DEFAULT_BACKGROUND_COLOR.value()) : nil; + return d; +}) {} +inline JS::NativeStatusBarManagerIOS::Constants::Builder::Builder(Constants i) : _factory(^{ + return i.unsafeRawValue(); +}) {} + + +inline id _Nullable JS::NativeWebSocketModule::SpecConnectOptions::headers() const +{ + id const p = _v[@"headers"]; + return p; +} diff --git a/Frameworks/FBReactNativeSpec.xcframework/ios-arm64_x86_64-simulator/libFBReactNativeSpec.a b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64_x86_64-simulator/libFBReactNativeSpec.a new file mode 100644 index 0000000..d1829cf Binary files /dev/null and b/Frameworks/FBReactNativeSpec.xcframework/ios-arm64_x86_64-simulator/libFBReactNativeSpec.a differ diff --git a/Frameworks/Newsmemory.xcframework/Info.plist b/Frameworks/Newsmemory.xcframework/Info.plist new file mode 100644 index 0000000..6a0ef53 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libNewsmemory.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libNewsmemory.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libNewsmemory.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libNewsmemory.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory-umbrella.h b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory-umbrella.h new file mode 100644 index 0000000..6a3b411 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory-umbrella.h @@ -0,0 +1,19 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "Newsmemory.h" +#import "NewsmemorySDKBridge.h" +#import "TANewsmemoryViewController.h" + +FOUNDATION_EXPORT double NewsmemoryVersionNumber; +FOUNDATION_EXPORT const unsigned char NewsmemoryVersionString[]; + diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory.h b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory.h new file mode 100644 index 0000000..4619806 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory.h @@ -0,0 +1,38 @@ +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol NewsmemoryDelegate +@optional +- (void)onNewsmemoryClose; +- (BOOL)newsmemoryWillOpenURL:(NSString *)url; +- (void)onNewsmemoryTrackAction:(NSDictionary *)data; +- (void)onNewsmemoryReload; +@end + +/// The RN library API +@interface Newsmemory : NSObject + +/// The way in which we communicate with React Native +@property (nonatomic, strong, readonly) RCTBridge *bridge; + +/// The single instance of a Newsmemory ++ (instancetype)sharedInstance; ++ (void)setDelegate:(id )delegate; ++ (void)setDebugMode:(BOOL)debug; ++ (void)setPSetup:(NSString *)pSetup; ++ (void)setServer:(NSString *)server; ++ (void)setToken:(NSString *)token; ++ (void)setNeedsCloseButton:(BOOL)need; ++ (void)setNeedsSafeArea:(BOOL)need; ++ (void)setAPIKey:(NSString *)key; + +- (instancetype)init; +- (RCTRootView *)getView; +- (id )getDelegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory.modulemap b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory.modulemap new file mode 100644 index 0000000..5d7bcfb --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/Newsmemory.modulemap @@ -0,0 +1,6 @@ +module Newsmemory { + umbrella header "Newsmemory-umbrella.h" + + export * + module * { export * } +} diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/NewsmemorySDKBridge.h b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/NewsmemorySDKBridge.h new file mode 100644 index 0000000..9741409 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/NewsmemorySDKBridge.h @@ -0,0 +1,6 @@ +#import +#import + +@interface NewsmemorySDKBridge : NSObject + +@end diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/TANewsmemoryViewController.h b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/TANewsmemoryViewController.h new file mode 100644 index 0000000..cbeb624 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64/Headers/Newsmemory/TANewsmemoryViewController.h @@ -0,0 +1,4 @@ +#import + +@interface TANewsmemoryViewController : UIViewController +@end diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64/libNewsmemory.a b/Frameworks/Newsmemory.xcframework/ios-arm64/libNewsmemory.a new file mode 100644 index 0000000..58588ef Binary files /dev/null and b/Frameworks/Newsmemory.xcframework/ios-arm64/libNewsmemory.a differ diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory-umbrella.h b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory-umbrella.h new file mode 100644 index 0000000..6a3b411 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory-umbrella.h @@ -0,0 +1,19 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "Newsmemory.h" +#import "NewsmemorySDKBridge.h" +#import "TANewsmemoryViewController.h" + +FOUNDATION_EXPORT double NewsmemoryVersionNumber; +FOUNDATION_EXPORT const unsigned char NewsmemoryVersionString[]; + diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory.h b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory.h new file mode 100644 index 0000000..4619806 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory.h @@ -0,0 +1,38 @@ +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol NewsmemoryDelegate +@optional +- (void)onNewsmemoryClose; +- (BOOL)newsmemoryWillOpenURL:(NSString *)url; +- (void)onNewsmemoryTrackAction:(NSDictionary *)data; +- (void)onNewsmemoryReload; +@end + +/// The RN library API +@interface Newsmemory : NSObject + +/// The way in which we communicate with React Native +@property (nonatomic, strong, readonly) RCTBridge *bridge; + +/// The single instance of a Newsmemory ++ (instancetype)sharedInstance; ++ (void)setDelegate:(id )delegate; ++ (void)setDebugMode:(BOOL)debug; ++ (void)setPSetup:(NSString *)pSetup; ++ (void)setServer:(NSString *)server; ++ (void)setToken:(NSString *)token; ++ (void)setNeedsCloseButton:(BOOL)need; ++ (void)setNeedsSafeArea:(BOOL)need; ++ (void)setAPIKey:(NSString *)key; + +- (instancetype)init; +- (RCTRootView *)getView; +- (id )getDelegate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory.modulemap b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory.modulemap new file mode 100644 index 0000000..5d7bcfb --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/Newsmemory.modulemap @@ -0,0 +1,6 @@ +module Newsmemory { + umbrella header "Newsmemory-umbrella.h" + + export * + module * { export * } +} diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/NewsmemorySDKBridge.h b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/NewsmemorySDKBridge.h new file mode 100644 index 0000000..9741409 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/NewsmemorySDKBridge.h @@ -0,0 +1,6 @@ +#import +#import + +@interface NewsmemorySDKBridge : NSObject + +@end diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/TANewsmemoryViewController.h b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/TANewsmemoryViewController.h new file mode 100644 index 0000000..cbeb624 --- /dev/null +++ b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/Headers/Newsmemory/TANewsmemoryViewController.h @@ -0,0 +1,4 @@ +#import + +@interface TANewsmemoryViewController : UIViewController +@end diff --git a/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/libNewsmemory.a b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/libNewsmemory.a new file mode 100644 index 0000000..4c2468d Binary files /dev/null and b/Frameworks/Newsmemory.xcframework/ios-arm64_x86_64-simulator/libNewsmemory.a differ diff --git a/Frameworks/RCT-Folly.xcframework/Info.plist b/Frameworks/RCT-Folly.xcframework/Info.plist new file mode 100644 index 0000000..81fab39 --- /dev/null +++ b/Frameworks/RCT-Folly.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libRCT-Folly.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRCT-Folly.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRCT-Folly.a + LibraryIdentifier + ios-arm64 + LibraryPath + libRCT-Folly.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RCT-Folly.xcframework/ios-arm64/libRCT-Folly.a b/Frameworks/RCT-Folly.xcframework/ios-arm64/libRCT-Folly.a new file mode 100644 index 0000000..8acbe41 Binary files /dev/null and b/Frameworks/RCT-Folly.xcframework/ios-arm64/libRCT-Folly.a differ diff --git a/Frameworks/RCT-Folly.xcframework/ios-arm64_x86_64-simulator/libRCT-Folly.a b/Frameworks/RCT-Folly.xcframework/ios-arm64_x86_64-simulator/libRCT-Folly.a new file mode 100644 index 0000000..65d24a5 Binary files /dev/null and b/Frameworks/RCT-Folly.xcframework/ios-arm64_x86_64-simulator/libRCT-Folly.a differ diff --git a/Frameworks/RCTTypeSafety.xcframework/Info.plist b/Frameworks/RCTTypeSafety.xcframework/Info.plist new file mode 100644 index 0000000..d9913d3 --- /dev/null +++ b/Frameworks/RCTTypeSafety.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRCTTypeSafety.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRCTTypeSafety.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRCTTypeSafety.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRCTTypeSafety.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RCTTypeSafety.xcframework/ios-arm64/Headers/RCTTypeSafety/RCTConvertHelpers.h b/Frameworks/RCTTypeSafety.xcframework/ios-arm64/Headers/RCTTypeSafety/RCTConvertHelpers.h new file mode 100644 index 0000000..0b7144b --- /dev/null +++ b/Frameworks/RCTTypeSafety.xcframework/ios-arm64/Headers/RCTTypeSafety/RCTConvertHelpers.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import +#import + +namespace facebook { +namespace react { + template + using LazyVector = FB::LazyVector; +}} + +template +NSArray *RCTConvertVecToArray(const ContainerT &vec, id (^convertor)(typename ContainerT::value_type element)) +{ + NSMutableArray *array = [NSMutableArray new]; + for (size_t i = 0, size = vec.size(); i < size; ++i) { + id object = convertor(vec[i]); + array[i] = object ?: (id)kCFNull; + } + return array; +} +template +NSArray *RCTConvertVecToArray(const ContainerT &vec) +{ + return RCTConvertVecToArray(vec, ^id(typename ContainerT::value_type element) { return element; }); +} + +template +NSArray *RCTConvertOptionalVecToArray(const folly::Optional &vec, id (^convertor)(typename ContainerT::value_type element)) +{ + return vec.hasValue() ? RCTConvertVecToArray(vec.value(), convertor) : nil; +} + +template +NSArray *RCTConvertOptionalVecToArray(const folly::Optional &vec) +{ + return vec.hasValue() ? RCTConvertVecToArray(vec.value(), ^id(typename ContainerT::value_type element) { return element; }) : nil; +} + +bool RCTBridgingToBool(id value); +folly::Optional RCTBridgingToOptionalBool(id value); +NSString *RCTBridgingToString(id value); +NSString *RCTBridgingToOptionalString(id value); +folly::Optional RCTBridgingToOptionalDouble(id value); +double RCTBridgingToDouble(id value); +NSArray *RCTBridgingToArray(id value); + +template +facebook::react::LazyVector RCTBridgingToVec(id value, T (^ctor)(id element)) +{ + NSArray *array = RCTBridgingToArray(value); + typedef typename facebook::react::LazyVector::size_type _size_t; + _size_t size = static_cast<_size_t>(array.count); + return facebook::react::LazyVector::fromUnsafeRawValue(array, size, ctor); +} + +template +folly::Optional> RCTBridgingToOptionalVec(id value, T (^ctor)(id element)) +{ + if (value == nil || value == (id)kCFNull) { + return folly::none; + } else { + return RCTBridgingToVec(value, ctor); + } +} diff --git a/Frameworks/RCTTypeSafety.xcframework/ios-arm64/Headers/RCTTypeSafety/RCTTypedModuleConstants.h b/Frameworks/RCTTypeSafety.xcframework/ios-arm64/Headers/RCTTypeSafety/RCTTypedModuleConstants.h new file mode 100644 index 0000000..b3514c0 --- /dev/null +++ b/Frameworks/RCTTypeSafety.xcframework/ios-arm64/Headers/RCTTypeSafety/RCTTypedModuleConstants.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +#import + +#import +#import + +/** + * Interop type layer for RN's exportedConstants and the C++ structs generated by our typesafety codegen. + * + * The NativeModuleSpec will define a constantsToExport method which you can implement as follows: + * + * - (nonnull ModuleConstants)constantsToExport + * { + * return typedConstants({ ... }); + * } + */ + +// Internal container for module constants. Do not use yourself directly, instead use the typedConstants helpers below. +@interface _RCTTypedModuleConstants : NSDictionary + ++ (instancetype)newWithUnsafeDictionary:(NSDictionary *)dictionary; + +@end + +namespace facebook { +namespace react { + +// Objective-C doesn't allow arbitrary types in its lightweight generics, only object and block types. We can work +// around that by having the struct type we care about be a block-argument. The block never exists at runtime. +template +using ModuleConstants = _RCTTypedModuleConstants *; + +template +ModuleConstants typedConstants(typename T::Builder::Input &&value) { + typename T::Builder builder(std::move(value)); + return [_RCTTypedModuleConstants newWithUnsafeDictionary:builder.buildUnsafeRawValue()]; +} + +} } diff --git a/Frameworks/RCTTypeSafety.xcframework/ios-arm64/libRCTTypeSafety.a b/Frameworks/RCTTypeSafety.xcframework/ios-arm64/libRCTTypeSafety.a new file mode 100644 index 0000000..38820ce Binary files /dev/null and b/Frameworks/RCTTypeSafety.xcframework/ios-arm64/libRCTTypeSafety.a differ diff --git a/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/Headers/RCTTypeSafety/RCTConvertHelpers.h b/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/Headers/RCTTypeSafety/RCTConvertHelpers.h new file mode 100644 index 0000000..0b7144b --- /dev/null +++ b/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/Headers/RCTTypeSafety/RCTConvertHelpers.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import +#import + +namespace facebook { +namespace react { + template + using LazyVector = FB::LazyVector; +}} + +template +NSArray *RCTConvertVecToArray(const ContainerT &vec, id (^convertor)(typename ContainerT::value_type element)) +{ + NSMutableArray *array = [NSMutableArray new]; + for (size_t i = 0, size = vec.size(); i < size; ++i) { + id object = convertor(vec[i]); + array[i] = object ?: (id)kCFNull; + } + return array; +} +template +NSArray *RCTConvertVecToArray(const ContainerT &vec) +{ + return RCTConvertVecToArray(vec, ^id(typename ContainerT::value_type element) { return element; }); +} + +template +NSArray *RCTConvertOptionalVecToArray(const folly::Optional &vec, id (^convertor)(typename ContainerT::value_type element)) +{ + return vec.hasValue() ? RCTConvertVecToArray(vec.value(), convertor) : nil; +} + +template +NSArray *RCTConvertOptionalVecToArray(const folly::Optional &vec) +{ + return vec.hasValue() ? RCTConvertVecToArray(vec.value(), ^id(typename ContainerT::value_type element) { return element; }) : nil; +} + +bool RCTBridgingToBool(id value); +folly::Optional RCTBridgingToOptionalBool(id value); +NSString *RCTBridgingToString(id value); +NSString *RCTBridgingToOptionalString(id value); +folly::Optional RCTBridgingToOptionalDouble(id value); +double RCTBridgingToDouble(id value); +NSArray *RCTBridgingToArray(id value); + +template +facebook::react::LazyVector RCTBridgingToVec(id value, T (^ctor)(id element)) +{ + NSArray *array = RCTBridgingToArray(value); + typedef typename facebook::react::LazyVector::size_type _size_t; + _size_t size = static_cast<_size_t>(array.count); + return facebook::react::LazyVector::fromUnsafeRawValue(array, size, ctor); +} + +template +folly::Optional> RCTBridgingToOptionalVec(id value, T (^ctor)(id element)) +{ + if (value == nil || value == (id)kCFNull) { + return folly::none; + } else { + return RCTBridgingToVec(value, ctor); + } +} diff --git a/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/Headers/RCTTypeSafety/RCTTypedModuleConstants.h b/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/Headers/RCTTypeSafety/RCTTypedModuleConstants.h new file mode 100644 index 0000000..b3514c0 --- /dev/null +++ b/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/Headers/RCTTypeSafety/RCTTypedModuleConstants.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +#import + +#import +#import + +/** + * Interop type layer for RN's exportedConstants and the C++ structs generated by our typesafety codegen. + * + * The NativeModuleSpec will define a constantsToExport method which you can implement as follows: + * + * - (nonnull ModuleConstants)constantsToExport + * { + * return typedConstants({ ... }); + * } + */ + +// Internal container for module constants. Do not use yourself directly, instead use the typedConstants helpers below. +@interface _RCTTypedModuleConstants : NSDictionary + ++ (instancetype)newWithUnsafeDictionary:(NSDictionary *)dictionary; + +@end + +namespace facebook { +namespace react { + +// Objective-C doesn't allow arbitrary types in its lightweight generics, only object and block types. We can work +// around that by having the struct type we care about be a block-argument. The block never exists at runtime. +template +using ModuleConstants = _RCTTypedModuleConstants *; + +template +ModuleConstants typedConstants(typename T::Builder::Input &&value) { + typename T::Builder builder(std::move(value)); + return [_RCTTypedModuleConstants newWithUnsafeDictionary:builder.buildUnsafeRawValue()]; +} + +} } diff --git a/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/libRCTTypeSafety.a b/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/libRCTTypeSafety.a new file mode 100644 index 0000000..2b3979c Binary files /dev/null and b/Frameworks/RCTTypeSafety.xcframework/ios-arm64_x86_64-simulator/libRCTTypeSafety.a differ diff --git a/Frameworks/RNCAsyncStorage.xcframework/Info.plist b/Frameworks/RNCAsyncStorage.xcframework/Info.plist new file mode 100644 index 0000000..97773c4 --- /dev/null +++ b/Frameworks/RNCAsyncStorage.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNCAsyncStorage.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNCAsyncStorage.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNCAsyncStorage.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNCAsyncStorage.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/Headers/RNCAsyncStorage.h b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/Headers/RNCAsyncStorage.h new file mode 100644 index 0000000..5dfac04 --- /dev/null +++ b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/Headers/RNCAsyncStorage.h @@ -0,0 +1,51 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +#import "RNCAsyncStorageDelegate.h" + +/** + * A simple, asynchronous, persistent, key-value storage system designed as a + * backend to the AsyncStorage JS module, which is modeled after LocalStorage. + * + * Current implementation stores small values in serialized dictionary and + * larger values in separate files. Since we use a serial file queue + * `RKFileQueue`, reading/writing from multiple threads should be perceived as + * being atomic, unless someone bypasses the `RNCAsyncStorage` API. + * + * Keys and values must always be strings or an error is returned. + */ +@interface RNCAsyncStorage : NSObject + +@property (nonatomic, weak, nullable) id delegate; + +@property (nonatomic, assign) BOOL clearOnInvalidate; + +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +// Clear the RNCAsyncStorage data from native code +- (void)clearAllData; + +// For clearing data when the bridge may not exist, e.g. when logging out. ++ (void)clearAllData; + +// Grab data from the cache. ResponseBlock result array will have an error at position 0, and an +// array of arrays at position 1. +- (void)multiGet:(NSArray *)keys callback:(RCTResponseSenderBlock)callback; + +// Add multiple key value pairs to the cache. +- (void)multiSet:(NSArray *> *)kvPairs + callback:(RCTResponseSenderBlock)callback; + +// Interface for natively fetching all the keys from the storage data. +- (void)getAllKeys:(RCTResponseSenderBlock)callback; + +@end diff --git a/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/Headers/RNCAsyncStorageDelegate.h b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/Headers/RNCAsyncStorageDelegate.h new file mode 100644 index 0000000..8298099 --- /dev/null +++ b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/Headers/RNCAsyncStorageDelegate.h @@ -0,0 +1,73 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^RNCAsyncStorageCompletion)(NSError *_Nullable error); +typedef void (^RNCAsyncStorageResultCallback)(NSArray> *valuesOrErrors); + +@protocol RNCAsyncStorageDelegate + +/*! + * Returns all keys currently stored. If none, an empty array is returned. + * @param block Block to call with result. + */ +- (void)allKeys:(RNCAsyncStorageResultCallback)block; + +/*! + * Merges values with the corresponding values stored at specified keys. + * @param values Values to merge. + * @param keys Keys to the values that should be merged with. + * @param block Block to call with merged result. + */ +- (void)mergeValues:(NSArray *)values + forKeys:(NSArray *)keys + completion:(RNCAsyncStorageResultCallback)block; + +/*! + * Removes all values from the store. + * @param block Block to call with result. + */ +- (void)removeAllValues:(RNCAsyncStorageCompletion)block; + +/*! + * Removes all values associated with specified keys. + * @param keys Keys of values to remove. + * @param block Block to call with result. + */ +- (void)removeValuesForKeys:(NSArray *)keys + completion:(RNCAsyncStorageResultCallback)block; + +/*! + * Sets specified key-value pairs. + * @param values Values to set. + * @param keys Keys of specified values to set. + * @param block Block to call with result. + */ +- (void)setValues:(NSArray *)values + forKeys:(NSArray *)keys + completion:(RNCAsyncStorageResultCallback)block; + +/*! + * Returns values associated with specified keys. + * @param keys Keys of values to return. + * @param block Block to call with result. + */ +- (void)valuesForKeys:(NSArray *)keys completion:(RNCAsyncStorageResultCallback)block; + +@optional + +/*! + * Returns whether the delegate should be treated as a passthrough. + */ +@property (nonatomic, readonly, getter=isPassthrough) BOOL passthrough; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/libRNCAsyncStorage.a b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/libRNCAsyncStorage.a new file mode 100644 index 0000000..ce1b6bd Binary files /dev/null and b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64/libRNCAsyncStorage.a differ diff --git a/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/Headers/RNCAsyncStorage.h b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/Headers/RNCAsyncStorage.h new file mode 100644 index 0000000..5dfac04 --- /dev/null +++ b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/Headers/RNCAsyncStorage.h @@ -0,0 +1,51 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +#import "RNCAsyncStorageDelegate.h" + +/** + * A simple, asynchronous, persistent, key-value storage system designed as a + * backend to the AsyncStorage JS module, which is modeled after LocalStorage. + * + * Current implementation stores small values in serialized dictionary and + * larger values in separate files. Since we use a serial file queue + * `RKFileQueue`, reading/writing from multiple threads should be perceived as + * being atomic, unless someone bypasses the `RNCAsyncStorage` API. + * + * Keys and values must always be strings or an error is returned. + */ +@interface RNCAsyncStorage : NSObject + +@property (nonatomic, weak, nullable) id delegate; + +@property (nonatomic, assign) BOOL clearOnInvalidate; + +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +// Clear the RNCAsyncStorage data from native code +- (void)clearAllData; + +// For clearing data when the bridge may not exist, e.g. when logging out. ++ (void)clearAllData; + +// Grab data from the cache. ResponseBlock result array will have an error at position 0, and an +// array of arrays at position 1. +- (void)multiGet:(NSArray *)keys callback:(RCTResponseSenderBlock)callback; + +// Add multiple key value pairs to the cache. +- (void)multiSet:(NSArray *> *)kvPairs + callback:(RCTResponseSenderBlock)callback; + +// Interface for natively fetching all the keys from the storage data. +- (void)getAllKeys:(RCTResponseSenderBlock)callback; + +@end diff --git a/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/Headers/RNCAsyncStorageDelegate.h b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/Headers/RNCAsyncStorageDelegate.h new file mode 100644 index 0000000..8298099 --- /dev/null +++ b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/Headers/RNCAsyncStorageDelegate.h @@ -0,0 +1,73 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^RNCAsyncStorageCompletion)(NSError *_Nullable error); +typedef void (^RNCAsyncStorageResultCallback)(NSArray> *valuesOrErrors); + +@protocol RNCAsyncStorageDelegate + +/*! + * Returns all keys currently stored. If none, an empty array is returned. + * @param block Block to call with result. + */ +- (void)allKeys:(RNCAsyncStorageResultCallback)block; + +/*! + * Merges values with the corresponding values stored at specified keys. + * @param values Values to merge. + * @param keys Keys to the values that should be merged with. + * @param block Block to call with merged result. + */ +- (void)mergeValues:(NSArray *)values + forKeys:(NSArray *)keys + completion:(RNCAsyncStorageResultCallback)block; + +/*! + * Removes all values from the store. + * @param block Block to call with result. + */ +- (void)removeAllValues:(RNCAsyncStorageCompletion)block; + +/*! + * Removes all values associated with specified keys. + * @param keys Keys of values to remove. + * @param block Block to call with result. + */ +- (void)removeValuesForKeys:(NSArray *)keys + completion:(RNCAsyncStorageResultCallback)block; + +/*! + * Sets specified key-value pairs. + * @param values Values to set. + * @param keys Keys of specified values to set. + * @param block Block to call with result. + */ +- (void)setValues:(NSArray *)values + forKeys:(NSArray *)keys + completion:(RNCAsyncStorageResultCallback)block; + +/*! + * Returns values associated with specified keys. + * @param keys Keys of values to return. + * @param block Block to call with result. + */ +- (void)valuesForKeys:(NSArray *)keys completion:(RNCAsyncStorageResultCallback)block; + +@optional + +/*! + * Returns whether the delegate should be treated as a passthrough. + */ +@property (nonatomic, readonly, getter=isPassthrough) BOOL passthrough; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/libRNCAsyncStorage.a b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/libRNCAsyncStorage.a new file mode 100644 index 0000000..4d8ebbd Binary files /dev/null and b/Frameworks/RNCAsyncStorage.xcframework/ios-arm64_x86_64-simulator/libRNCAsyncStorage.a differ diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/Info.plist b/Frameworks/RNColorMatrixImageFilters.xcframework/Info.plist new file mode 100644 index 0000000..d5b907a --- /dev/null +++ b/Frameworks/RNColorMatrixImageFilters.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNColorMatrixImageFilters.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNColorMatrixImageFilters.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNColorMatrixImageFilters.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNColorMatrixImageFilters.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFColorMatrixImageFilter.h b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFColorMatrixImageFilter.h new file mode 100644 index 0000000..4b3a291 --- /dev/null +++ b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFColorMatrixImageFilter.h @@ -0,0 +1,8 @@ +#import +#import + +@interface CMIFColorMatrixImageFilter : RCTView + +@property (nonatomic, strong) NSArray *matrix; + +@end diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFColorMatrixImageFilterManager.h b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFColorMatrixImageFilterManager.h new file mode 100644 index 0000000..73fbbf7 --- /dev/null +++ b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFColorMatrixImageFilterManager.h @@ -0,0 +1,5 @@ +#import + +@interface CMIFColorMatrixImageFilterManager : RCTViewManager + +@end diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFImageView.h b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFImageView.h new file mode 100644 index 0000000..52ad3e4 --- /dev/null +++ b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/Headers/CMIFImageView.h @@ -0,0 +1,11 @@ +#ifndef CMIFImageView_h +#define CMIFImageView_h + +@protocol CMIFImageView + +- (UIImage *)image; +- (void)setImage:(UIImage *)image; + +@end + +#endif /* CMIFImageView_h */ diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/libRNColorMatrixImageFilters.a b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/libRNColorMatrixImageFilters.a new file mode 100644 index 0000000..b62fdfe Binary files /dev/null and b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64/libRNColorMatrixImageFilters.a differ diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFColorMatrixImageFilter.h b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFColorMatrixImageFilter.h new file mode 100644 index 0000000..4b3a291 --- /dev/null +++ b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFColorMatrixImageFilter.h @@ -0,0 +1,8 @@ +#import +#import + +@interface CMIFColorMatrixImageFilter : RCTView + +@property (nonatomic, strong) NSArray *matrix; + +@end diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFColorMatrixImageFilterManager.h b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFColorMatrixImageFilterManager.h new file mode 100644 index 0000000..73fbbf7 --- /dev/null +++ b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFColorMatrixImageFilterManager.h @@ -0,0 +1,5 @@ +#import + +@interface CMIFColorMatrixImageFilterManager : RCTViewManager + +@end diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFImageView.h b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFImageView.h new file mode 100644 index 0000000..52ad3e4 --- /dev/null +++ b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/Headers/CMIFImageView.h @@ -0,0 +1,11 @@ +#ifndef CMIFImageView_h +#define CMIFImageView_h + +@protocol CMIFImageView + +- (UIImage *)image; +- (void)setImage:(UIImage *)image; + +@end + +#endif /* CMIFImageView_h */ diff --git a/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/libRNColorMatrixImageFilters.a b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/libRNColorMatrixImageFilters.a new file mode 100644 index 0000000..e76aa7b Binary files /dev/null and b/Frameworks/RNColorMatrixImageFilters.xcframework/ios-arm64_x86_64-simulator/libRNColorMatrixImageFilters.a differ diff --git a/Frameworks/RNDateTimePicker.xcframework/Info.plist b/Frameworks/RNDateTimePicker.xcframework/Info.plist new file mode 100644 index 0000000..d2a2f90 --- /dev/null +++ b/Frameworks/RNDateTimePicker.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNDateTimePicker.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNDateTimePicker.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNDateTimePicker.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNDateTimePicker.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePicker.h b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePicker.h new file mode 100644 index 0000000..00dd45d --- /dev/null +++ b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePicker.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNDateTimePicker : UIDatePicker + +@end diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePickerManager.h b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePickerManager.h new file mode 100644 index 0000000..a619db6 --- /dev/null +++ b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePickerManager.h @@ -0,0 +1,19 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTConvert(UIDatePicker) + ++ (UIDatePickerMode)UIDatePickerMode:(id)json; + +@end + +@interface RNDateTimePickerManager : RCTViewManager + +@end diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePickerShadowView.h b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePickerShadowView.h new file mode 100644 index 0000000..04578ee --- /dev/null +++ b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/Headers/RNDateTimePickerShadowView.h @@ -0,0 +1,12 @@ +#import +#import "RNDateTimePicker.h" + +@interface RNDateTimePickerShadowView : RCTShadowView + +@property (nullable, nonatomic, strong) RNDateTimePicker *picker; +@property (nonatomic) UIDatePickerMode mode; +@property (nullable, nonatomic, strong) NSDate *date; +@property (nullable, nonatomic, strong) NSLocale *locale; +@property (nonatomic, assign) UIDatePickerStyle displayIOS API_AVAILABLE(ios(13.4)); + +@end diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64/libRNDateTimePicker.a b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/libRNDateTimePicker.a new file mode 100644 index 0000000..3a7bf83 Binary files /dev/null and b/Frameworks/RNDateTimePicker.xcframework/ios-arm64/libRNDateTimePicker.a differ diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePicker.h b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePicker.h new file mode 100644 index 0000000..00dd45d --- /dev/null +++ b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePicker.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNDateTimePicker : UIDatePicker + +@end diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePickerManager.h b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePickerManager.h new file mode 100644 index 0000000..a619db6 --- /dev/null +++ b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePickerManager.h @@ -0,0 +1,19 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTConvert(UIDatePicker) + ++ (UIDatePickerMode)UIDatePickerMode:(id)json; + +@end + +@interface RNDateTimePickerManager : RCTViewManager + +@end diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePickerShadowView.h b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePickerShadowView.h new file mode 100644 index 0000000..04578ee --- /dev/null +++ b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/Headers/RNDateTimePickerShadowView.h @@ -0,0 +1,12 @@ +#import +#import "RNDateTimePicker.h" + +@interface RNDateTimePickerShadowView : RCTShadowView + +@property (nullable, nonatomic, strong) RNDateTimePicker *picker; +@property (nonatomic) UIDatePickerMode mode; +@property (nullable, nonatomic, strong) NSDate *date; +@property (nullable, nonatomic, strong) NSLocale *locale; +@property (nonatomic, assign) UIDatePickerStyle displayIOS API_AVAILABLE(ios(13.4)); + +@end diff --git a/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/libRNDateTimePicker.a b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/libRNDateTimePicker.a new file mode 100644 index 0000000..c4d6646 Binary files /dev/null and b/Frameworks/RNDateTimePicker.xcframework/ios-arm64_x86_64-simulator/libRNDateTimePicker.a differ diff --git a/Frameworks/RNDefaultPreference.xcframework/Info.plist b/Frameworks/RNDefaultPreference.xcframework/Info.plist new file mode 100644 index 0000000..38f600b --- /dev/null +++ b/Frameworks/RNDefaultPreference.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNDefaultPreference.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNDefaultPreference.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNDefaultPreference.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNDefaultPreference.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNDefaultPreference.xcframework/ios-arm64/Headers/RNDefaultPreference.h b/Frameworks/RNDefaultPreference.xcframework/ios-arm64/Headers/RNDefaultPreference.h new file mode 100644 index 0000000..663cf83 --- /dev/null +++ b/Frameworks/RNDefaultPreference.xcframework/ios-arm64/Headers/RNDefaultPreference.h @@ -0,0 +1,7 @@ + +// import RCTBridgeModule +#import + +@interface RNDefaultPreference : NSObject + +@end diff --git a/Frameworks/RNDefaultPreference.xcframework/ios-arm64/libRNDefaultPreference.a b/Frameworks/RNDefaultPreference.xcframework/ios-arm64/libRNDefaultPreference.a new file mode 100644 index 0000000..3dfe817 Binary files /dev/null and b/Frameworks/RNDefaultPreference.xcframework/ios-arm64/libRNDefaultPreference.a differ diff --git a/Frameworks/RNDefaultPreference.xcframework/ios-arm64_x86_64-simulator/Headers/RNDefaultPreference.h b/Frameworks/RNDefaultPreference.xcframework/ios-arm64_x86_64-simulator/Headers/RNDefaultPreference.h new file mode 100644 index 0000000..663cf83 --- /dev/null +++ b/Frameworks/RNDefaultPreference.xcframework/ios-arm64_x86_64-simulator/Headers/RNDefaultPreference.h @@ -0,0 +1,7 @@ + +// import RCTBridgeModule +#import + +@interface RNDefaultPreference : NSObject + +@end diff --git a/Frameworks/RNDefaultPreference.xcframework/ios-arm64_x86_64-simulator/libRNDefaultPreference.a b/Frameworks/RNDefaultPreference.xcframework/ios-arm64_x86_64-simulator/libRNDefaultPreference.a new file mode 100644 index 0000000..436bb57 Binary files /dev/null and b/Frameworks/RNDefaultPreference.xcframework/ios-arm64_x86_64-simulator/libRNDefaultPreference.a differ diff --git a/Frameworks/RNDeviceInfo.xcframework/Info.plist b/Frameworks/RNDeviceInfo.xcframework/Info.plist new file mode 100644 index 0000000..f059466 --- /dev/null +++ b/Frameworks/RNDeviceInfo.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNDeviceInfo.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNDeviceInfo.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNDeviceInfo.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNDeviceInfo.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/DeviceUID.h b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/DeviceUID.h new file mode 100644 index 0000000..65c1368 --- /dev/null +++ b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/DeviceUID.h @@ -0,0 +1,6 @@ +#import + +@interface DeviceUID : NSObject ++ (NSString *)syncUid; ++ (NSString *)uid; +@end diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/EnvironmentUtil.h b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/EnvironmentUtil.h new file mode 100644 index 0000000..4e6122a --- /dev/null +++ b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/EnvironmentUtil.h @@ -0,0 +1,39 @@ +// +// EnvironmentUtil.h +// RNDeviceInfo +// +// Created by Dima Portenko on 10.04.2021. +// Copyright © 2021 Learnium. All rights reserved. +// + +#import + +/** + * App environment + */ +typedef NS_ENUM(NSInteger, MSACEnvironment) { + + /** + * App has been downloaded from the AppStore. + */ + MSACEnvironmentAppStore = 0, + + /** + * App has been downloaded from TestFlight. + */ + MSACEnvironmentTestFlight = 1, + + /** + * App has been installed by some other mechanism. + * This could be Ad-Hoc, Enterprise, etc. + */ + MSACEnvironmentOther = 2 +}; + +#define EnvironmentValues [NSArray arrayWithObjects: @"AppStore", @"TestFlight", @"Other", nil] + +@interface EnvironmentUtil : NSObject + ++ (MSACEnvironment)currentAppEnvironment; + +@end diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/RNDeviceInfo.h b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/RNDeviceInfo.h new file mode 100644 index 0000000..f77b052 --- /dev/null +++ b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/Headers/RNDeviceInfo.h @@ -0,0 +1,20 @@ +// +// RNDeviceInfo.h +// Learnium +// +// Created by Rebecca Hughes on 03/08/2015. +// Copyright © 2015 Learnium Limited. All rights reserved. +// + +#import +#import +#import +#import +#import +#import + +@interface RNDeviceInfo : RCTEventEmitter + +@property (nonatomic) float lowBatteryThreshold; + +@end diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64/libRNDeviceInfo.a b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/libRNDeviceInfo.a new file mode 100644 index 0000000..c0f8a38 Binary files /dev/null and b/Frameworks/RNDeviceInfo.xcframework/ios-arm64/libRNDeviceInfo.a differ diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/DeviceUID.h b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/DeviceUID.h new file mode 100644 index 0000000..65c1368 --- /dev/null +++ b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/DeviceUID.h @@ -0,0 +1,6 @@ +#import + +@interface DeviceUID : NSObject ++ (NSString *)syncUid; ++ (NSString *)uid; +@end diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/EnvironmentUtil.h b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/EnvironmentUtil.h new file mode 100644 index 0000000..4e6122a --- /dev/null +++ b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/EnvironmentUtil.h @@ -0,0 +1,39 @@ +// +// EnvironmentUtil.h +// RNDeviceInfo +// +// Created by Dima Portenko on 10.04.2021. +// Copyright © 2021 Learnium. All rights reserved. +// + +#import + +/** + * App environment + */ +typedef NS_ENUM(NSInteger, MSACEnvironment) { + + /** + * App has been downloaded from the AppStore. + */ + MSACEnvironmentAppStore = 0, + + /** + * App has been downloaded from TestFlight. + */ + MSACEnvironmentTestFlight = 1, + + /** + * App has been installed by some other mechanism. + * This could be Ad-Hoc, Enterprise, etc. + */ + MSACEnvironmentOther = 2 +}; + +#define EnvironmentValues [NSArray arrayWithObjects: @"AppStore", @"TestFlight", @"Other", nil] + +@interface EnvironmentUtil : NSObject + ++ (MSACEnvironment)currentAppEnvironment; + +@end diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNDeviceInfo.h b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNDeviceInfo.h new file mode 100644 index 0000000..f77b052 --- /dev/null +++ b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNDeviceInfo.h @@ -0,0 +1,20 @@ +// +// RNDeviceInfo.h +// Learnium +// +// Created by Rebecca Hughes on 03/08/2015. +// Copyright © 2015 Learnium Limited. All rights reserved. +// + +#import +#import +#import +#import +#import +#import + +@interface RNDeviceInfo : RCTEventEmitter + +@property (nonatomic) float lowBatteryThreshold; + +@end diff --git a/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/libRNDeviceInfo.a b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/libRNDeviceInfo.a new file mode 100644 index 0000000..3424dea Binary files /dev/null and b/Frameworks/RNDeviceInfo.xcframework/ios-arm64_x86_64-simulator/libRNDeviceInfo.a differ diff --git a/Frameworks/RNFS.xcframework/Info.plist b/Frameworks/RNFS.xcframework/Info.plist new file mode 100644 index 0000000..c0b3934 --- /dev/null +++ b/Frameworks/RNFS.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNFS.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNFS.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNFS.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNFS.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNFS.xcframework/ios-arm64/Headers/Downloader.h b/Frameworks/RNFS.xcframework/ios-arm64/Headers/Downloader.h new file mode 100644 index 0000000..8204252 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64/Headers/Downloader.h @@ -0,0 +1,37 @@ +#import + +typedef void (^DownloadCompleteCallback)(NSNumber*, NSNumber*); +typedef void (^ErrorCallback)(NSError*); +typedef void (^BeginCallback)(NSNumber*, NSNumber*, NSDictionary*); +typedef void (^ProgressCallback)(NSNumber*, NSNumber*); +typedef void (^ResumableCallback)(void); + +@interface RNFSDownloadParams : NSObject + +@property (copy) NSString* fromUrl; +@property (copy) NSString* toFile; +@property (copy) NSDictionary* headers; +@property (copy) DownloadCompleteCallback completeCallback; // Download has finished (data written) +@property (copy) ErrorCallback errorCallback; // Something went wrong +@property (copy) BeginCallback beginCallback; // Download has started (headers received) +@property (copy) ProgressCallback progressCallback; // Download is progressing +@property (copy) ResumableCallback resumableCallback; // Download has stopped but is resumable +@property bool background; // Whether to continue download when app is in background +@property bool discretionary; // Whether the file may be downloaded at the OS's discretion (iOS only) +@property bool cacheable; // Whether the file may be stored in the shared NSURLCache (iOS only) +@property (copy) NSNumber* progressInterval; +@property (copy) NSNumber* progressDivider; +@property (copy) NSNumber* readTimeout; // How long (in milliseconds) a task should wait for additional data to arrive before giving up +@property (copy) NSNumber* backgroundTimeout; // How long (in milliseconds) to wait for an entire resource to transfer before giving up + + +@end + +@interface RNFSDownloader : NSObject + +- (NSString *)downloadFile:(RNFSDownloadParams*)params; +- (void)stopDownload; +- (void)resumeDownload; +- (BOOL)isResumable; + +@end diff --git a/Frameworks/RNFS.xcframework/ios-arm64/Headers/NSArray+Map.h b/Frameworks/RNFS.xcframework/ios-arm64/Headers/NSArray+Map.h new file mode 100644 index 0000000..dbdd0d3 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64/Headers/NSArray+Map.h @@ -0,0 +1,13 @@ +// +// NSArray+Map.h +// RNFS +// +// taken from http://stackoverflow.com/questions/6127638/nsarray-equivalent-of-map + +#import + +@interface NSArray (Map) + +- (NSArray *)rnfs_mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block; + +@end \ No newline at end of file diff --git a/Frameworks/RNFS.xcframework/ios-arm64/Headers/RNFSManager.h b/Frameworks/RNFS.xcframework/ios-arm64/Headers/RNFSManager.h new file mode 100644 index 0000000..8ef10e4 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64/Headers/RNFSManager.h @@ -0,0 +1,19 @@ +// +// RNFSManager.h +// RNFSManager +// +// Created by Johannes Lumpe on 08/05/15. +// Copyright (c) 2015 Johannes Lumpe. All rights reserved. +// + +#import +#import +#import + +typedef void (^CompletionHandler)(void); + +@interface RNFSManager : RCTEventEmitter + ++(void)setCompletionHandlerForIdentifier: (NSString *)identifier completionHandler: (CompletionHandler)completionHandler; + +@end diff --git a/Frameworks/RNFS.xcframework/ios-arm64/Headers/Uploader.h b/Frameworks/RNFS.xcframework/ios-arm64/Headers/Uploader.h new file mode 100644 index 0000000..e75cef0 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64/Headers/Uploader.h @@ -0,0 +1,32 @@ +#import + +#if !TARGET_OS_OSX +#import +#endif + +typedef void (^UploadCompleteCallback)(NSString*, NSURLResponse *); +typedef void (^UploadErrorCallback)(NSError*); +typedef void (^UploadBeginCallback)(void); +typedef void (^UploadProgressCallback)(NSNumber*, NSNumber*); + +@interface RNFSUploadParams : NSObject + +@property (copy) NSString* toUrl; +@property (copy) NSArray* files; +@property (copy) NSDictionary* headers; +@property (copy) NSDictionary* fields; +@property (copy) NSString* method; +@property (assign) BOOL binaryStreamOnly; +@property (copy) UploadCompleteCallback completeCallback; // Upload has finished (data written) +@property (copy) UploadErrorCallback errorCallback; // Something gone wrong +@property (copy) UploadBeginCallback beginCallback; // Upload has started +@property (copy) UploadProgressCallback progressCallback; // Upload is progressing + +@end + +@interface RNFSUploader : NSObject + +- (void)uploadFiles:(RNFSUploadParams*)params; +- (void)stopUpload; + +@end diff --git a/Frameworks/RNFS.xcframework/ios-arm64/libRNFS.a b/Frameworks/RNFS.xcframework/ios-arm64/libRNFS.a new file mode 100644 index 0000000..37cd3ba Binary files /dev/null and b/Frameworks/RNFS.xcframework/ios-arm64/libRNFS.a differ diff --git a/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/Downloader.h b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/Downloader.h new file mode 100644 index 0000000..8204252 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/Downloader.h @@ -0,0 +1,37 @@ +#import + +typedef void (^DownloadCompleteCallback)(NSNumber*, NSNumber*); +typedef void (^ErrorCallback)(NSError*); +typedef void (^BeginCallback)(NSNumber*, NSNumber*, NSDictionary*); +typedef void (^ProgressCallback)(NSNumber*, NSNumber*); +typedef void (^ResumableCallback)(void); + +@interface RNFSDownloadParams : NSObject + +@property (copy) NSString* fromUrl; +@property (copy) NSString* toFile; +@property (copy) NSDictionary* headers; +@property (copy) DownloadCompleteCallback completeCallback; // Download has finished (data written) +@property (copy) ErrorCallback errorCallback; // Something went wrong +@property (copy) BeginCallback beginCallback; // Download has started (headers received) +@property (copy) ProgressCallback progressCallback; // Download is progressing +@property (copy) ResumableCallback resumableCallback; // Download has stopped but is resumable +@property bool background; // Whether to continue download when app is in background +@property bool discretionary; // Whether the file may be downloaded at the OS's discretion (iOS only) +@property bool cacheable; // Whether the file may be stored in the shared NSURLCache (iOS only) +@property (copy) NSNumber* progressInterval; +@property (copy) NSNumber* progressDivider; +@property (copy) NSNumber* readTimeout; // How long (in milliseconds) a task should wait for additional data to arrive before giving up +@property (copy) NSNumber* backgroundTimeout; // How long (in milliseconds) to wait for an entire resource to transfer before giving up + + +@end + +@interface RNFSDownloader : NSObject + +- (NSString *)downloadFile:(RNFSDownloadParams*)params; +- (void)stopDownload; +- (void)resumeDownload; +- (BOOL)isResumable; + +@end diff --git a/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/NSArray+Map.h b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/NSArray+Map.h new file mode 100644 index 0000000..dbdd0d3 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/NSArray+Map.h @@ -0,0 +1,13 @@ +// +// NSArray+Map.h +// RNFS +// +// taken from http://stackoverflow.com/questions/6127638/nsarray-equivalent-of-map + +#import + +@interface NSArray (Map) + +- (NSArray *)rnfs_mapObjectsUsingBlock:(id (^)(id obj, NSUInteger idx))block; + +@end \ No newline at end of file diff --git a/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/RNFSManager.h b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/RNFSManager.h new file mode 100644 index 0000000..8ef10e4 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/RNFSManager.h @@ -0,0 +1,19 @@ +// +// RNFSManager.h +// RNFSManager +// +// Created by Johannes Lumpe on 08/05/15. +// Copyright (c) 2015 Johannes Lumpe. All rights reserved. +// + +#import +#import +#import + +typedef void (^CompletionHandler)(void); + +@interface RNFSManager : RCTEventEmitter + ++(void)setCompletionHandlerForIdentifier: (NSString *)identifier completionHandler: (CompletionHandler)completionHandler; + +@end diff --git a/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/Uploader.h b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/Uploader.h new file mode 100644 index 0000000..e75cef0 --- /dev/null +++ b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/Headers/Uploader.h @@ -0,0 +1,32 @@ +#import + +#if !TARGET_OS_OSX +#import +#endif + +typedef void (^UploadCompleteCallback)(NSString*, NSURLResponse *); +typedef void (^UploadErrorCallback)(NSError*); +typedef void (^UploadBeginCallback)(void); +typedef void (^UploadProgressCallback)(NSNumber*, NSNumber*); + +@interface RNFSUploadParams : NSObject + +@property (copy) NSString* toUrl; +@property (copy) NSArray* files; +@property (copy) NSDictionary* headers; +@property (copy) NSDictionary* fields; +@property (copy) NSString* method; +@property (assign) BOOL binaryStreamOnly; +@property (copy) UploadCompleteCallback completeCallback; // Upload has finished (data written) +@property (copy) UploadErrorCallback errorCallback; // Something gone wrong +@property (copy) UploadBeginCallback beginCallback; // Upload has started +@property (copy) UploadProgressCallback progressCallback; // Upload is progressing + +@end + +@interface RNFSUploader : NSObject + +- (void)uploadFiles:(RNFSUploadParams*)params; +- (void)stopUpload; + +@end diff --git a/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/libRNFS.a b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/libRNFS.a new file mode 100644 index 0000000..4fcbaf8 Binary files /dev/null and b/Frameworks/RNFS.xcframework/ios-arm64_x86_64-simulator/libRNFS.a differ diff --git a/Frameworks/RNFastImage.xcframework/Info.plist b/Frameworks/RNFastImage.xcframework/Info.plist new file mode 100644 index 0000000..4dae2c6 --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNFastImage.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNFastImage.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNFastImage.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNFastImage.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageSource.h b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageSource.h new file mode 100644 index 0000000..7f97869 --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageSource.h @@ -0,0 +1,33 @@ +#import +#import + +typedef NS_ENUM(NSInteger, FFFPriority) { + FFFPriorityLow, + FFFPriorityNormal, + FFFPriorityHigh +}; + +typedef NS_ENUM(NSInteger, FFFCacheControl) { + FFFCacheControlImmutable, + FFFCacheControlWeb, + FFFCacheControlCacheOnly +}; + +// Object containing an image uri and metadata. +@interface FFFastImageSource : NSObject + +// uri for image, or base64 +@property (nonatomic) NSURL* url; +// priority for image request +@property (nonatomic) FFFPriority priority; +// headers for the image request +@property (nonatomic) NSDictionary *headers; +// cache control mode +@property (nonatomic) FFFCacheControl cacheControl; + +- (instancetype)initWithURL:(NSURL *)url + priority:(FFFPriority)priority + headers:(NSDictionary *)headers + cacheControl:(FFFCacheControl)cacheControl; + +@end diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageView.h b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageView.h new file mode 100644 index 0000000..fb557cf --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageView.h @@ -0,0 +1,23 @@ +#import + +#import +#import + +#import +#import + +#import "FFFastImageSource.h" + +@interface FFFastImageView : SDAnimatedImageView + +@property (nonatomic, copy) RCTDirectEventBlock onFastImageLoadStart; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageProgress; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageError; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageLoad; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageLoadEnd; +@property (nonatomic, assign) RCTResizeMode resizeMode; +@property (nonatomic, strong) FFFastImageSource *source; +@property (nonatomic, strong) UIColor *imageColor; + +@end + diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageViewManager.h b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageViewManager.h new file mode 100644 index 0000000..8ba6020 --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/FFFastImageViewManager.h @@ -0,0 +1,5 @@ +#import + +@interface FFFastImageViewManager : RCTViewManager + +@end diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/RCTConvert+FFFastImage.h b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/RCTConvert+FFFastImage.h new file mode 100644 index 0000000..f1070c9 --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64/Headers/RCTConvert+FFFastImage.h @@ -0,0 +1,9 @@ +#import + +@class FFFastImageSource; + +@interface RCTConvert (FFFastImage) + ++ (FFFastImageSource *)FFFastImageSource:(id)json; + +@end diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64/libRNFastImage.a b/Frameworks/RNFastImage.xcframework/ios-arm64/libRNFastImage.a new file mode 100644 index 0000000..d719067 Binary files /dev/null and b/Frameworks/RNFastImage.xcframework/ios-arm64/libRNFastImage.a differ diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageSource.h b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageSource.h new file mode 100644 index 0000000..7f97869 --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageSource.h @@ -0,0 +1,33 @@ +#import +#import + +typedef NS_ENUM(NSInteger, FFFPriority) { + FFFPriorityLow, + FFFPriorityNormal, + FFFPriorityHigh +}; + +typedef NS_ENUM(NSInteger, FFFCacheControl) { + FFFCacheControlImmutable, + FFFCacheControlWeb, + FFFCacheControlCacheOnly +}; + +// Object containing an image uri and metadata. +@interface FFFastImageSource : NSObject + +// uri for image, or base64 +@property (nonatomic) NSURL* url; +// priority for image request +@property (nonatomic) FFFPriority priority; +// headers for the image request +@property (nonatomic) NSDictionary *headers; +// cache control mode +@property (nonatomic) FFFCacheControl cacheControl; + +- (instancetype)initWithURL:(NSURL *)url + priority:(FFFPriority)priority + headers:(NSDictionary *)headers + cacheControl:(FFFCacheControl)cacheControl; + +@end diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageView.h b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageView.h new file mode 100644 index 0000000..fb557cf --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageView.h @@ -0,0 +1,23 @@ +#import + +#import +#import + +#import +#import + +#import "FFFastImageSource.h" + +@interface FFFastImageView : SDAnimatedImageView + +@property (nonatomic, copy) RCTDirectEventBlock onFastImageLoadStart; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageProgress; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageError; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageLoad; +@property (nonatomic, copy) RCTDirectEventBlock onFastImageLoadEnd; +@property (nonatomic, assign) RCTResizeMode resizeMode; +@property (nonatomic, strong) FFFastImageSource *source; +@property (nonatomic, strong) UIColor *imageColor; + +@end + diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageViewManager.h b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageViewManager.h new file mode 100644 index 0000000..8ba6020 --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/FFFastImageViewManager.h @@ -0,0 +1,5 @@ +#import + +@interface FFFastImageViewManager : RCTViewManager + +@end diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+FFFastImage.h b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+FFFastImage.h new file mode 100644 index 0000000..f1070c9 --- /dev/null +++ b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+FFFastImage.h @@ -0,0 +1,9 @@ +#import + +@class FFFastImageSource; + +@interface RCTConvert (FFFastImage) + ++ (FFFastImageSource *)FFFastImageSource:(id)json; + +@end diff --git a/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/libRNFastImage.a b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/libRNFastImage.a new file mode 100644 index 0000000..310406f Binary files /dev/null and b/Frameworks/RNFastImage.xcframework/ios-arm64_x86_64-simulator/libRNFastImage.a differ diff --git a/Frameworks/RNGestureHandler.xcframework/Info.plist b/Frameworks/RNGestureHandler.xcframework/Info.plist new file mode 100644 index 0000000..e4b82b7 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNGestureHandler.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNGestureHandler.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNGestureHandler.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNGestureHandler.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNFlingHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNFlingHandler.h new file mode 100644 index 0000000..b10d778 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNFlingHandler.h @@ -0,0 +1,4 @@ +#import "RNGestureHandler.h" + +@interface RNFlingGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNForceTouchHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNForceTouchHandler.h new file mode 100644 index 0000000..b71fb78 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNForceTouchHandler.h @@ -0,0 +1,4 @@ +#import "RNGestureHandler.h" + +@interface RNForceTouchHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandler.h new file mode 100644 index 0000000..f952c15 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandler.h @@ -0,0 +1,73 @@ +#import "RNGestureHandlerState.h" +#import "RNGestureHandlerDirection.h" +#import "RNGestureHandlerEvents.h" + +#import +#import +#import + +#define VEC_LEN_SQ(pt) (pt.x * pt.x + pt.y * pt.y) +#define TEST_MIN_IF_NOT_NAN(value, limit) \ +(!isnan(limit) && ((limit < 0 && value <= limit) || (limit >= 0 && value >= limit))) + +#define TEST_MAX_IF_NOT_NAN(value, max) \ +(!isnan(max) && ((max < 0 && value < max) || (max >= 0 && value > max))) + +#define APPLY_PROP(recognizer, config, type, prop, propName) do { \ +id value = config[propName]; \ +if (value != nil) recognizer.prop = [RCTConvert type:value]; \ +} while(0) + +#define APPLY_FLOAT_PROP(prop) do { APPLY_PROP(recognizer, config, CGFloat, prop, @#prop); } while(0) +#define APPLY_INT_PROP(prop) do { APPLY_PROP(recognizer, config, NSInteger, prop, @#prop); } while(0) +#define APPLY_NAMED_INT_PROP(prop, propName) do { APPLY_PROP(recognizer, config, NSInteger, prop, propName); } while(0) + +@protocol RNGestureHandlerEventEmitter + +- (void)sendTouchEvent:(nonnull RNGestureHandlerEvent *)event; + +- (void)sendStateChangeEvent:(nonnull RNGestureHandlerStateChange *)event; + +@end + + +@protocol RNRootViewGestureRecognizerDelegate + +- (void)gestureRecognizer:(nullable UIGestureRecognizer *)gestureRecognizer + didActivateInRootView:(nullable UIView *)rootView; + +@end + + +@interface RNGestureHandler : NSObject { + +@protected UIGestureRecognizer *_recognizer; +@protected RNGestureHandlerState _lastState; + +} + ++ (nullable RNGestureHandler *)findGestureHandlerByRecognizer:(nonnull UIGestureRecognizer *)recognizer; + +- (nonnull instancetype)initWithTag:(nonnull NSNumber *)tag; + +@property (nonatomic, readonly, nonnull) NSNumber *tag; +@property (nonatomic, weak, nullable) id emitter; +@property (nonatomic, readonly, nullable) UIGestureRecognizer *recognizer; +@property (nonatomic) BOOL enabled; +@property(nonatomic) BOOL shouldCancelWhenOutside; + +- (void)bindToView:(nonnull UIView *)view; +- (void)unbindFromView; +- (void)configure:(nullable NSDictionary *)config NS_REQUIRES_SUPER; +- (void)handleGesture:(nonnull id)recognizer; +- (BOOL)containsPointInView; +- (RNGestureHandlerState)state; +- (nullable RNGestureHandlerEventExtraData *)eventExtraData:(nonnull id)recognizer; + +- (void)reset; +- (void)sendEventsInState:(RNGestureHandlerState)state + forViewWithTag:(nonnull NSNumber *)reactTag + withExtraData:(RNGestureHandlerEventExtraData *)extraData; + +@end + diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerButton.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerButton.h new file mode 100644 index 0000000..bfbbf7b --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerButton.h @@ -0,0 +1,18 @@ +// +// RNGestureHandlerButton.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNGestureHandlerButton : UIControl + +/** + * Insets used when hit testing inside this view. + */ +@property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerDirection.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerDirection.h new file mode 100644 index 0000000..84e4f18 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerDirection.h @@ -0,0 +1,8 @@ +#import + +typedef NS_ENUM(NSInteger, RNGestureHandlerDirection) { + RNGestureHandlerDirectionRight = 1, + RNGestureHandlerDirectionLeft = 2, + RNGestureHandlerDirectionUp = 4, + RNGestureHandlerDirectionDown = 8, +}; diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerEvents.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerEvents.h new file mode 100644 index 0000000..85f1620 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerEvents.h @@ -0,0 +1,56 @@ +#import + +#import +#import + +#import "RNGestureHandlerState.h" + +@interface RNGestureHandlerEventExtraData : NSObject + +@property (readonly) NSDictionary *data; + +- (instancetype)initWithData:(NSDictionary *)data; + ++ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position + withAbsolutePosition:(CGPoint)absolutePosition + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forPan:(CGPoint)position + withAbsolutePosition:(CGPoint)absolutePosition + withTranslation:(CGPoint)translation + withVelocity:(CGPoint)velocity + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forForce:(CGFloat)force + forPosition:(CGPoint)position + withAbsolutePosition:(CGPoint)absolutePosition + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forPinch:(CGFloat)scale + withFocalPoint:(CGPoint)focalPoint + withVelocity:(CGFloat)velocity + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forRotation:(CGFloat)rotation + withAnchorPoint:(CGPoint)anchorPoint + withVelocity:(CGFloat)velocity + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forPointerInside:(BOOL)pointerInside; +@end + +@interface RNGestureHandlerEvent : NSObject + +- (instancetype)initWithReactTag:(NSNumber *)reactTag + handlerTag:(NSNumber *)handlerTag + state:(RNGestureHandlerState)state + extraData:(RNGestureHandlerEventExtraData*)extraData + coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER; + +@end + + +@interface RNGestureHandlerStateChange : NSObject + +- (instancetype)initWithReactTag:(NSNumber *)reactTag + handlerTag:(NSNumber *)handlerTag + state:(RNGestureHandlerState)state + prevState:(RNGestureHandlerState)prevState + extraData:(RNGestureHandlerEventExtraData*)extraData NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerManager.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerManager.h new file mode 100644 index 0000000..382d446 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerManager.h @@ -0,0 +1,29 @@ +#import + +#import + +@class RCTUIManager; +@class RCTEventDispatcher; + +@interface RNGestureHandlerManager : NSObject + +- (nonnull instancetype)initWithUIManager:(nonnull RCTUIManager *)uiManager + eventDispatcher:(nonnull RCTEventDispatcher *)eventDispatcher; + +- (void)createGestureHandler:(nonnull NSString *)handlerName + tag:(nonnull NSNumber *)handlerTag + config:(nonnull NSDictionary *)config; + +- (void)attachGestureHandler:(nonnull NSNumber *)handlerTag + toViewWithTag:(nonnull NSNumber *)viewTag; + +- (void)updateGestureHandler:(nonnull NSNumber *)handlerTag config:(nonnull NSDictionary *)config; + +- (void)dropGestureHandler:(nonnull NSNumber *)handlerTag; + +- (void)handleSetJSResponder:(nonnull NSNumber *)viewTag + blockNativeResponder:(nonnull NSNumber *)blockNativeResponder; + +- (void)handleClearJSResponder; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerModule.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerModule.h new file mode 100644 index 0000000..b5b1cc9 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerModule.h @@ -0,0 +1,8 @@ +#import +#import +#import + +@interface RNGestureHandlerModule : RCTEventEmitter + +@end + diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerRegistry.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerRegistry.h new file mode 100644 index 0000000..d65ede2 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerRegistry.h @@ -0,0 +1,18 @@ +// +// RNGestureHandlerRegistry.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNGestureHandlerRegistry : NSObject + +- (nullable RNGestureHandler *)handlerWithTag:(nonnull NSNumber *)handlerTag; +- (void)registerGestureHandler:(nonnull RNGestureHandler *)gestureHandler; +- (void)attachHandlerWithTag:(nonnull NSNumber *)handlerTag toView:(nonnull UIView *)view; +- (void)dropHandlerWithTag:(nonnull NSNumber *)handlerTag; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerState.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerState.h new file mode 100644 index 0000000..b550697 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNGestureHandlerState.h @@ -0,0 +1,10 @@ +#import + +typedef NS_ENUM(NSInteger, RNGestureHandlerState) { + RNGestureHandlerStateUndetermined = 0, + RNGestureHandlerStateFailed, + RNGestureHandlerStateBegan, + RNGestureHandlerStateCancelled, + RNGestureHandlerStateActive, + RNGestureHandlerStateEnd, +}; diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNLongPressHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNLongPressHandler.h new file mode 100644 index 0000000..db0ddce --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNLongPressHandler.h @@ -0,0 +1,12 @@ +// +// RNLongPressHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNLongPressGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNNativeViewHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNNativeViewHandler.h new file mode 100644 index 0000000..cd7996e --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNNativeViewHandler.h @@ -0,0 +1,15 @@ +// +// RNNativeViewHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNDummyGestureRecognizer : UIGestureRecognizer +@end + +@interface RNNativeViewGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNPanHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNPanHandler.h new file mode 100644 index 0000000..dae819a --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNPanHandler.h @@ -0,0 +1,12 @@ +// +// RNPanHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNPanGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNPinchHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNPinchHandler.h new file mode 100644 index 0000000..afca530 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNPinchHandler.h @@ -0,0 +1,12 @@ +// +// RNPinchHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNPinchGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNRootViewGestureRecognizer.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNRootViewGestureRecognizer.h new file mode 100644 index 0000000..a57dfc6 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNRootViewGestureRecognizer.h @@ -0,0 +1,17 @@ +// +// RNRootViewGestureRecognizer.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNRootViewGestureRecognizer : UIGestureRecognizer + +@property (nullable, nonatomic, weak) id delegate; + +- (void)blockOtherRecognizers; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNRotationHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNRotationHandler.h new file mode 100644 index 0000000..ca8b0ef --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNRotationHandler.h @@ -0,0 +1,12 @@ +// +// RNRotationHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNRotationGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNTapHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNTapHandler.h new file mode 100644 index 0000000..53f53d1 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64/Headers/RNTapHandler.h @@ -0,0 +1,12 @@ +// +// RNTapHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNTapGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64/libRNGestureHandler.a b/Frameworks/RNGestureHandler.xcframework/ios-arm64/libRNGestureHandler.a new file mode 100644 index 0000000..fccf593 Binary files /dev/null and b/Frameworks/RNGestureHandler.xcframework/ios-arm64/libRNGestureHandler.a differ diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNFlingHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNFlingHandler.h new file mode 100644 index 0000000..b10d778 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNFlingHandler.h @@ -0,0 +1,4 @@ +#import "RNGestureHandler.h" + +@interface RNFlingGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNForceTouchHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNForceTouchHandler.h new file mode 100644 index 0000000..b71fb78 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNForceTouchHandler.h @@ -0,0 +1,4 @@ +#import "RNGestureHandler.h" + +@interface RNForceTouchHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandler.h new file mode 100644 index 0000000..f952c15 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandler.h @@ -0,0 +1,73 @@ +#import "RNGestureHandlerState.h" +#import "RNGestureHandlerDirection.h" +#import "RNGestureHandlerEvents.h" + +#import +#import +#import + +#define VEC_LEN_SQ(pt) (pt.x * pt.x + pt.y * pt.y) +#define TEST_MIN_IF_NOT_NAN(value, limit) \ +(!isnan(limit) && ((limit < 0 && value <= limit) || (limit >= 0 && value >= limit))) + +#define TEST_MAX_IF_NOT_NAN(value, max) \ +(!isnan(max) && ((max < 0 && value < max) || (max >= 0 && value > max))) + +#define APPLY_PROP(recognizer, config, type, prop, propName) do { \ +id value = config[propName]; \ +if (value != nil) recognizer.prop = [RCTConvert type:value]; \ +} while(0) + +#define APPLY_FLOAT_PROP(prop) do { APPLY_PROP(recognizer, config, CGFloat, prop, @#prop); } while(0) +#define APPLY_INT_PROP(prop) do { APPLY_PROP(recognizer, config, NSInteger, prop, @#prop); } while(0) +#define APPLY_NAMED_INT_PROP(prop, propName) do { APPLY_PROP(recognizer, config, NSInteger, prop, propName); } while(0) + +@protocol RNGestureHandlerEventEmitter + +- (void)sendTouchEvent:(nonnull RNGestureHandlerEvent *)event; + +- (void)sendStateChangeEvent:(nonnull RNGestureHandlerStateChange *)event; + +@end + + +@protocol RNRootViewGestureRecognizerDelegate + +- (void)gestureRecognizer:(nullable UIGestureRecognizer *)gestureRecognizer + didActivateInRootView:(nullable UIView *)rootView; + +@end + + +@interface RNGestureHandler : NSObject { + +@protected UIGestureRecognizer *_recognizer; +@protected RNGestureHandlerState _lastState; + +} + ++ (nullable RNGestureHandler *)findGestureHandlerByRecognizer:(nonnull UIGestureRecognizer *)recognizer; + +- (nonnull instancetype)initWithTag:(nonnull NSNumber *)tag; + +@property (nonatomic, readonly, nonnull) NSNumber *tag; +@property (nonatomic, weak, nullable) id emitter; +@property (nonatomic, readonly, nullable) UIGestureRecognizer *recognizer; +@property (nonatomic) BOOL enabled; +@property(nonatomic) BOOL shouldCancelWhenOutside; + +- (void)bindToView:(nonnull UIView *)view; +- (void)unbindFromView; +- (void)configure:(nullable NSDictionary *)config NS_REQUIRES_SUPER; +- (void)handleGesture:(nonnull id)recognizer; +- (BOOL)containsPointInView; +- (RNGestureHandlerState)state; +- (nullable RNGestureHandlerEventExtraData *)eventExtraData:(nonnull id)recognizer; + +- (void)reset; +- (void)sendEventsInState:(RNGestureHandlerState)state + forViewWithTag:(nonnull NSNumber *)reactTag + withExtraData:(RNGestureHandlerEventExtraData *)extraData; + +@end + diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerButton.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerButton.h new file mode 100644 index 0000000..bfbbf7b --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerButton.h @@ -0,0 +1,18 @@ +// +// RNGestureHandlerButton.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNGestureHandlerButton : UIControl + +/** + * Insets used when hit testing inside this view. + */ +@property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerDirection.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerDirection.h new file mode 100644 index 0000000..84e4f18 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerDirection.h @@ -0,0 +1,8 @@ +#import + +typedef NS_ENUM(NSInteger, RNGestureHandlerDirection) { + RNGestureHandlerDirectionRight = 1, + RNGestureHandlerDirectionLeft = 2, + RNGestureHandlerDirectionUp = 4, + RNGestureHandlerDirectionDown = 8, +}; diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerEvents.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerEvents.h new file mode 100644 index 0000000..85f1620 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerEvents.h @@ -0,0 +1,56 @@ +#import + +#import +#import + +#import "RNGestureHandlerState.h" + +@interface RNGestureHandlerEventExtraData : NSObject + +@property (readonly) NSDictionary *data; + +- (instancetype)initWithData:(NSDictionary *)data; + ++ (RNGestureHandlerEventExtraData *)forPosition:(CGPoint)position + withAbsolutePosition:(CGPoint)absolutePosition + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forPan:(CGPoint)position + withAbsolutePosition:(CGPoint)absolutePosition + withTranslation:(CGPoint)translation + withVelocity:(CGPoint)velocity + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forForce:(CGFloat)force + forPosition:(CGPoint)position + withAbsolutePosition:(CGPoint)absolutePosition + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forPinch:(CGFloat)scale + withFocalPoint:(CGPoint)focalPoint + withVelocity:(CGFloat)velocity + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forRotation:(CGFloat)rotation + withAnchorPoint:(CGPoint)anchorPoint + withVelocity:(CGFloat)velocity + withNumberOfTouches:(NSUInteger)numberOfTouches; ++ (RNGestureHandlerEventExtraData *)forPointerInside:(BOOL)pointerInside; +@end + +@interface RNGestureHandlerEvent : NSObject + +- (instancetype)initWithReactTag:(NSNumber *)reactTag + handlerTag:(NSNumber *)handlerTag + state:(RNGestureHandlerState)state + extraData:(RNGestureHandlerEventExtraData*)extraData + coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER; + +@end + + +@interface RNGestureHandlerStateChange : NSObject + +- (instancetype)initWithReactTag:(NSNumber *)reactTag + handlerTag:(NSNumber *)handlerTag + state:(RNGestureHandlerState)state + prevState:(RNGestureHandlerState)prevState + extraData:(RNGestureHandlerEventExtraData*)extraData NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerManager.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerManager.h new file mode 100644 index 0000000..382d446 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerManager.h @@ -0,0 +1,29 @@ +#import + +#import + +@class RCTUIManager; +@class RCTEventDispatcher; + +@interface RNGestureHandlerManager : NSObject + +- (nonnull instancetype)initWithUIManager:(nonnull RCTUIManager *)uiManager + eventDispatcher:(nonnull RCTEventDispatcher *)eventDispatcher; + +- (void)createGestureHandler:(nonnull NSString *)handlerName + tag:(nonnull NSNumber *)handlerTag + config:(nonnull NSDictionary *)config; + +- (void)attachGestureHandler:(nonnull NSNumber *)handlerTag + toViewWithTag:(nonnull NSNumber *)viewTag; + +- (void)updateGestureHandler:(nonnull NSNumber *)handlerTag config:(nonnull NSDictionary *)config; + +- (void)dropGestureHandler:(nonnull NSNumber *)handlerTag; + +- (void)handleSetJSResponder:(nonnull NSNumber *)viewTag + blockNativeResponder:(nonnull NSNumber *)blockNativeResponder; + +- (void)handleClearJSResponder; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerModule.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerModule.h new file mode 100644 index 0000000..b5b1cc9 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerModule.h @@ -0,0 +1,8 @@ +#import +#import +#import + +@interface RNGestureHandlerModule : RCTEventEmitter + +@end + diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerRegistry.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerRegistry.h new file mode 100644 index 0000000..d65ede2 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerRegistry.h @@ -0,0 +1,18 @@ +// +// RNGestureHandlerRegistry.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNGestureHandlerRegistry : NSObject + +- (nullable RNGestureHandler *)handlerWithTag:(nonnull NSNumber *)handlerTag; +- (void)registerGestureHandler:(nonnull RNGestureHandler *)gestureHandler; +- (void)attachHandlerWithTag:(nonnull NSNumber *)handlerTag toView:(nonnull UIView *)view; +- (void)dropHandlerWithTag:(nonnull NSNumber *)handlerTag; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerState.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerState.h new file mode 100644 index 0000000..b550697 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNGestureHandlerState.h @@ -0,0 +1,10 @@ +#import + +typedef NS_ENUM(NSInteger, RNGestureHandlerState) { + RNGestureHandlerStateUndetermined = 0, + RNGestureHandlerStateFailed, + RNGestureHandlerStateBegan, + RNGestureHandlerStateCancelled, + RNGestureHandlerStateActive, + RNGestureHandlerStateEnd, +}; diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNLongPressHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNLongPressHandler.h new file mode 100644 index 0000000..db0ddce --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNLongPressHandler.h @@ -0,0 +1,12 @@ +// +// RNLongPressHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNLongPressGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNNativeViewHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNNativeViewHandler.h new file mode 100644 index 0000000..cd7996e --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNNativeViewHandler.h @@ -0,0 +1,15 @@ +// +// RNNativeViewHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNDummyGestureRecognizer : UIGestureRecognizer +@end + +@interface RNNativeViewGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNPanHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNPanHandler.h new file mode 100644 index 0000000..dae819a --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNPanHandler.h @@ -0,0 +1,12 @@ +// +// RNPanHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNPanGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNPinchHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNPinchHandler.h new file mode 100644 index 0000000..afca530 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNPinchHandler.h @@ -0,0 +1,12 @@ +// +// RNPinchHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNPinchGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNRootViewGestureRecognizer.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNRootViewGestureRecognizer.h new file mode 100644 index 0000000..a57dfc6 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNRootViewGestureRecognizer.h @@ -0,0 +1,17 @@ +// +// RNRootViewGestureRecognizer.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNRootViewGestureRecognizer : UIGestureRecognizer + +@property (nullable, nonatomic, weak) id delegate; + +- (void)blockOtherRecognizers; + +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNRotationHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNRotationHandler.h new file mode 100644 index 0000000..ca8b0ef --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNRotationHandler.h @@ -0,0 +1,12 @@ +// +// RNRotationHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNRotationGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNTapHandler.h b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNTapHandler.h new file mode 100644 index 0000000..53f53d1 --- /dev/null +++ b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/Headers/RNTapHandler.h @@ -0,0 +1,12 @@ +// +// RNTapHandler.h +// RNGestureHandler +// +// Created by Krzysztof Magiera on 12/10/2017. +// Copyright © 2017 Software Mansion. All rights reserved. +// + +#import "RNGestureHandler.h" + +@interface RNTapGestureHandler : RNGestureHandler +@end diff --git a/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/libRNGestureHandler.a b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/libRNGestureHandler.a new file mode 100644 index 0000000..e4ebcd7 Binary files /dev/null and b/Frameworks/RNGestureHandler.xcframework/ios-arm64_x86_64-simulator/libRNGestureHandler.a differ diff --git a/Frameworks/RNIap.xcframework/Info.plist b/Frameworks/RNIap.xcframework/Info.plist new file mode 100644 index 0000000..0aeec16 --- /dev/null +++ b/Frameworks/RNIap.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNIap.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNIap.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNIap.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNIap.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIap-umbrella.h b/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIap-umbrella.h new file mode 100644 index 0000000..9eb6449 --- /dev/null +++ b/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIap-umbrella.h @@ -0,0 +1,17 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "RNIapIos-Bridging-Header.h" + +FOUNDATION_EXPORT double RNIapVersionNumber; +FOUNDATION_EXPORT const unsigned char RNIapVersionString[]; + diff --git a/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIap.modulemap b/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIap.modulemap new file mode 100644 index 0000000..ac9fd07 --- /dev/null +++ b/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIap.modulemap @@ -0,0 +1,6 @@ +module RNIap { + umbrella header "RNIap-umbrella.h" + + export * + module * { export * } +} diff --git a/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIapIos-Bridging-Header.h b/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIapIos-Bridging-Header.h new file mode 100644 index 0000000..dea7ff6 --- /dev/null +++ b/Frameworks/RNIap.xcframework/ios-arm64/Headers/RNIapIos-Bridging-Header.h @@ -0,0 +1,2 @@ +#import +#import diff --git a/Frameworks/RNIap.xcframework/ios-arm64/libRNIap.a b/Frameworks/RNIap.xcframework/ios-arm64/libRNIap.a new file mode 100644 index 0000000..d67352d Binary files /dev/null and b/Frameworks/RNIap.xcframework/ios-arm64/libRNIap.a differ diff --git a/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIap-umbrella.h b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIap-umbrella.h new file mode 100644 index 0000000..9eb6449 --- /dev/null +++ b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIap-umbrella.h @@ -0,0 +1,17 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "RNIapIos-Bridging-Header.h" + +FOUNDATION_EXPORT double RNIapVersionNumber; +FOUNDATION_EXPORT const unsigned char RNIapVersionString[]; + diff --git a/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIap.modulemap b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIap.modulemap new file mode 100644 index 0000000..ac9fd07 --- /dev/null +++ b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIap.modulemap @@ -0,0 +1,6 @@ +module RNIap { + umbrella header "RNIap-umbrella.h" + + export * + module * { export * } +} diff --git a/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIapIos-Bridging-Header.h b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIapIos-Bridging-Header.h new file mode 100644 index 0000000..dea7ff6 --- /dev/null +++ b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/Headers/RNIapIos-Bridging-Header.h @@ -0,0 +1,2 @@ +#import +#import diff --git a/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/libRNIap.a b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/libRNIap.a new file mode 100644 index 0000000..fffa0d4 Binary files /dev/null and b/Frameworks/RNIap.xcframework/ios-arm64_x86_64-simulator/libRNIap.a differ diff --git a/Frameworks/RNOpenAppSettings.xcframework/Info.plist b/Frameworks/RNOpenAppSettings.xcframework/Info.plist new file mode 100644 index 0000000..d8e2150 --- /dev/null +++ b/Frameworks/RNOpenAppSettings.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNOpenAppSettings.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNOpenAppSettings.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNOpenAppSettings.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNOpenAppSettings.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNOpenAppSettings.xcframework/ios-arm64/Headers/RNOpenAppSettings.h b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64/Headers/RNOpenAppSettings.h new file mode 100644 index 0000000..de5f445 --- /dev/null +++ b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64/Headers/RNOpenAppSettings.h @@ -0,0 +1,7 @@ +#import +#import + +@interface RNOpenAppSettings : NSObject + +@end + diff --git a/Frameworks/RNOpenAppSettings.xcframework/ios-arm64/libRNOpenAppSettings.a b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64/libRNOpenAppSettings.a new file mode 100644 index 0000000..66998e4 Binary files /dev/null and b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64/libRNOpenAppSettings.a differ diff --git a/Frameworks/RNOpenAppSettings.xcframework/ios-arm64_x86_64-simulator/Headers/RNOpenAppSettings.h b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64_x86_64-simulator/Headers/RNOpenAppSettings.h new file mode 100644 index 0000000..de5f445 --- /dev/null +++ b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64_x86_64-simulator/Headers/RNOpenAppSettings.h @@ -0,0 +1,7 @@ +#import +#import + +@interface RNOpenAppSettings : NSObject + +@end + diff --git a/Frameworks/RNOpenAppSettings.xcframework/ios-arm64_x86_64-simulator/libRNOpenAppSettings.a b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64_x86_64-simulator/libRNOpenAppSettings.a new file mode 100644 index 0000000..c4a4323 Binary files /dev/null and b/Frameworks/RNOpenAppSettings.xcframework/ios-arm64_x86_64-simulator/libRNOpenAppSettings.a differ diff --git a/Frameworks/RNReanimated.xcframework/Info.plist b/Frameworks/RNReanimated.xcframework/Info.plist new file mode 100644 index 0000000..5d4b798 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNReanimated.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNReanimated.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNReanimated.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNReanimated.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/RCTConvert+REATransition.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/RCTConvert+REATransition.h new file mode 100644 index 0000000..17ebf0d --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/RCTConvert+REATransition.h @@ -0,0 +1,12 @@ +#import + +#import "REATransition.h" + +@interface RCTConvert (REATransition) + ++ (REATransitionType)REATransitionType:(id)json; ++ (REATransitionAnimationType)REATransitionAnimationType:(id)json; ++ (REATransitionInterpolationType)REATransitionInterpolationType:(id)json; ++ (REATransitionPropagationType)REATransitionPropagationType:(id)json; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAAllTransitions.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAAllTransitions.h new file mode 100644 index 0000000..8ab0480 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAAllTransitions.h @@ -0,0 +1,26 @@ +#import "REATransition.h" + +@interface REATransitionGroup : REATransition +@property (nonatomic) BOOL sequence; +@property (nonatomic) NSArray *transitions; +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAVisibilityTransition : REATransition +@property (nonatomic) REATransitionAnimationType animationType; +- (REATransitionAnimation *)appearView:(UIView*)view inParent:(UIView*)parent; +- (REATransitionAnimation *)disappearView:(UIView*)view fromParent:(UIView*)parent; +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAInTransition : REAVisibilityTransition +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAOutTransition : REAVisibilityTransition +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAChangeTransition : REATransition +- (instancetype)initWithConfig:(NSDictionary *)config; +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAAlwaysNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAAlwaysNode.h new file mode 100644 index 0000000..589251c --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAAlwaysNode.h @@ -0,0 +1,4 @@ +#import "REANode.h" + +@interface REAAlwaysNode : REANode +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REABezierNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REABezierNode.h new file mode 100644 index 0000000..0e0a953 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REABezierNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REABezierNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REABlockNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REABlockNode.h new file mode 100644 index 0000000..54f412c --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REABlockNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REABlockNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REACallFuncNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REACallFuncNode.h new file mode 100644 index 0000000..4502724 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REACallFuncNode.h @@ -0,0 +1,7 @@ + +#import "REANode.h" + +@interface REACallFuncNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAClockNodes.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAClockNodes.h new file mode 100644 index 0000000..fc0fc08 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAClockNodes.h @@ -0,0 +1,19 @@ +#import "REANode.h" + +@interface REAClockNode : REANode +@property (nonatomic, readonly) BOOL isRunning; +- (void)start; +- (void)stop; +@end + +@interface REAClockOpNode : REANode +@end + +@interface REAClockStartNode : REAClockOpNode +@end + +@interface REAClockStopNode : REAClockOpNode +@end + +@interface REAClockTestNode : REAClockOpNode +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAConcatNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAConcatNode.h new file mode 100644 index 0000000..d275eec --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAConcatNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REAConcatNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REACondNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REACondNode.h new file mode 100644 index 0000000..3e4a173 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REACondNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REACondNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/READebugNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/READebugNode.h new file mode 100644 index 0000000..cd7cd3e --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/READebugNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface READebugNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAEventNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAEventNode.h new file mode 100644 index 0000000..73027f1 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAEventNode.h @@ -0,0 +1,9 @@ +#import "REANode.h" + +#import + +@interface REAEventNode : REANode + +- (void)processEvent:(id)event; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAFunctionNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAFunctionNode.h new file mode 100644 index 0000000..4b6ef73 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAFunctionNode.h @@ -0,0 +1,7 @@ + +#import "REANode.h" + +@interface REAFunctionNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAJSCallNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAJSCallNode.h new file mode 100644 index 0000000..f13a803 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAJSCallNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REAJSCallNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAModule.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAModule.h new file mode 100644 index 0000000..ed60267 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAModule.h @@ -0,0 +1,12 @@ +#import +#import +#import +#import +#import +#import + +#import "REAValueNode.h" + +@interface REAModule : RCTEventEmitter + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REANode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REANode.h new file mode 100644 index 0000000..0874400 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REANode.h @@ -0,0 +1,39 @@ +#import +#import + +@class REANodesManager; + +typedef NSNumber* REANodeID; + +@protocol REAFinalNode + +- (void)update; + +@end + +@interface REAUpdateContext : NSObject +@property (nonatomic) NSString* callID; +@end + +@interface REANode : NSObject + ++ (void)runPropUpdates:(nonnull REAUpdateContext *)context; + +- (instancetype)initWithID:(REANodeID)nodeID + config:(NSDictionary *)config NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, weak, nullable) REANodesManager *nodesManager; +@property (nonatomic, nullable) REAUpdateContext *updateContext; +@property (nonatomic, readonly, nonnull) REANodeID nodeID; + +- (_Nullable id)evaluate; +- (_Nullable id)value; +- (void)markUpdated; + +- (void)addChild:(REANode *)child NS_REQUIRES_SUPER; +- (void)removeChild:(REANode *)child NS_REQUIRES_SUPER; + +- (void)dangerouslyRescheduleEvaluate; +- (void)forceUpdateMemoizedValue:(id)value; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REANodesManager.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REANodesManager.h new file mode 100644 index 0000000..9597166 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REANodesManager.h @@ -0,0 +1,79 @@ +#import + +#import "REANode.h" +#import +#import + +@class REAModule; + +typedef void (^REAOnAnimationCallback)(CADisplayLink *displayLink); +typedef void (^REANativeAnimationOp)(RCTUIManager *uiManager); + +@interface REANodesManager : NSObject + +@property (nonatomic, weak, nullable) RCTUIManager *uiManager; +@property (nonatomic, weak, nullable) REAModule *reanimatedModule; +@property (nonatomic, readonly) CFTimeInterval currentAnimationTimestamp; + +@property (nonatomic, nullable) NSSet *uiProps; +@property (nonatomic, nullable) NSSet *nativeProps; + +- (nonnull instancetype)initWithModule:(REAModule *)reanimatedModule + uiManager:(nonnull RCTUIManager *)uiManager; + +- (REANode* _Nullable)findNodeByID:(nonnull REANodeID)nodeID; + +- (void)invalidate; + +- (void)operationsBatchDidComplete; + +// + +- (void)postOnAnimation:(REAOnAnimationCallback)clb; +- (void)postRunUpdatesAfterAnimation; +- (void)enqueueUpdateViewOnNativeThread:(nonnull NSNumber *)reactTag + viewName:(NSString *) viewName + nativeProps:(NSMutableDictionary *)nativeProps; +- (void)getValue:(REANodeID)nodeID + callback:(RCTResponseSenderBlock)callback; + +// graph + +- (void)createNode:(nonnull REANodeID)tag + config:(NSDictionary *__nonnull)config; + +- (void)dropNode:(nonnull REANodeID)tag; + +- (void)connectNodes:(nonnull REANodeID)parentID + childID:(nonnull REANodeID)childID; + +- (void)disconnectNodes:(nonnull REANodeID)parentID + childID:(nonnull REANodeID)childID; + +- (void)connectNodeToView:(nonnull REANodeID)nodeID + viewTag:(nonnull NSNumber *)viewTag + viewName:(nonnull NSString *)viewName; + +- (void)disconnectNodeFromView:(nonnull REANodeID)nodeID + viewTag:(nonnull NSNumber *)viewTag; + +- (void)attachEvent:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + eventNodeID:(nonnull REANodeID)eventNodeID; + +- (void)detachEvent:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + eventNodeID:(nonnull REANodeID)eventNodeID; + +// configuration + +- (void)configureProps:(nonnull NSSet *)nativeProps + uiProps:(nonnull NSSet *)uiProps; + +// events + +- (void)dispatchEvent:(id)event; + +- (void)setValueForNodeID:(nonnull NSNumber *)nodeID value:(nonnull NSNumber *)newValue; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAOperatorNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAOperatorNode.h new file mode 100644 index 0000000..50c1689 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAOperatorNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REAOperatorNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAParamNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAParamNode.h new file mode 100644 index 0000000..b5e97e8 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAParamNode.h @@ -0,0 +1,12 @@ +#import "REAValueNode.h" + +@interface REAParamNode : REAValueNode + +- (void)beginContext:(NSNumber*) ref + prevCallID:(NSNumber*) prevCallID; +- (void)endContext; +- (void)start; +- (void)stop; +- (BOOL)isRunning; +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAPropsNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAPropsNode.h new file mode 100644 index 0000000..05171f1 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAPropsNode.h @@ -0,0 +1,11 @@ +#import "REANode.h" + +@interface REAPropsNode : REANode + +- (void)connectToView:(NSNumber *_Nonnull)viewTag + viewName:(NSString *_Nonnull)viewName; + +- (void)disconnectFromView:(NSNumber *_Nonnull)viewTag; + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REASetNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REASetNode.h new file mode 100644 index 0000000..5bc6a38 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REASetNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REASetNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAStyleNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAStyleNode.h new file mode 100644 index 0000000..58bc7ba --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAStyleNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REAStyleNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransformNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransformNode.h new file mode 100644 index 0000000..51ae259 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransformNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REATransformNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransition.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransition.h new file mode 100644 index 0000000..6d4d1f0 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransition.h @@ -0,0 +1,64 @@ +#import +#import +#import + +#import "REATransitionAnimation.h" +#import "REATransitionValues.h" + +// TODO: fix below implementation +#define IS_LAYOUT_ONLY(view) ([view isKindOfClass:[RCTView class]] && view.backgroundColor == nil) + +typedef NS_ENUM(NSInteger, REATransitionType) { + REATransitionTypeNone = 0, + REATransitionTypeGroup, + REATransitionTypeIn, + REATransitionTypeOut, + REATransitionTypeChange +}; + +typedef NS_ENUM(NSInteger, REATransitionAnimationType) { + REATransitionAnimationTypeNone = 0, + REATransitionAnimationTypeFade, + REATransitionAnimationTypeScale, + REATransitionAnimationTypeSlideTop, + REATransitionAnimationTypeSlideBottom, + REATransitionAnimationTypeSlideRight, + REATransitionAnimationTypeSlideLeft, +}; + +typedef NS_ENUM(NSInteger, REATransitionInterpolationType) { + REATransitionInterpolationLinear = 0, + REATransitionInterpolationEaseIn, + REATransitionInterpolationEaseOut, + REATransitionInterpolationEaseInOut, +}; + +typedef NS_ENUM(NSInteger, REATransitionPropagationType) { + REATransitionPropagationNone = 0, + REATransitionPropagationTop, + REATransitionPropagationBottom, + REATransitionPropagationLeft, + REATransitionPropagationRight, +}; + +@interface REATransition : NSObject +@property (nonatomic, weak) REATransition *parent; +@property (nonatomic) CFTimeInterval duration; +@property (nonatomic) CFTimeInterval delay; +@property (nonatomic) REATransitionInterpolationType interpolation; +@property (nonatomic) REATransitionPropagationType propagation; +- (instancetype)initWithConfig:(NSDictionary *)config; +- (CAMediaTimingFunction *)mediaTiming; +- (void)startCaptureInRoot:(UIView *)root; +- (void)playInRoot:(UIView *)root; +- (REATransitionValues *)findStartValuesForKey:(NSNumber *)key; +- (REATransitionValues *)findEndValuesForKey:(NSNumber *)key; +- (REATransitionAnimation *)animationForTransitioning:(REATransitionValues*)startValues + endValues:(REATransitionValues*)endValues + forRoot:(UIView *)root; +- (NSArray *)animationsForTransitioning:(NSMutableDictionary *)startValues + endValues:(NSMutableDictionary *)endValues + forRoot:(UIView *)root; + ++ (REATransition *)inflate:(NSDictionary *)config; +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionAnimation.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionAnimation.h new file mode 100644 index 0000000..b9efb93 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionAnimation.h @@ -0,0 +1,17 @@ +#import + +@interface REATransitionAnimation : NSObject + +@property (nonatomic) CAAnimation *animation; +@property (nonatomic) CALayer *layer; +@property (nonatomic) NSString *keyPath; + ++ (REATransitionAnimation *)transitionWithAnimation:(CAAnimation *)animation + layer:(CALayer *)layer + andKeyPath:(NSString*)keyPath; +- (void)play; +- (void)delayBy:(CFTimeInterval)delay; +- (CFTimeInterval)finishTime; +- (CFTimeInterval)duration; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionManager.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionManager.h new file mode 100644 index 0000000..d3a3844 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionManager.h @@ -0,0 +1,9 @@ +#import +#import + +@interface REATransitionManager : NSObject + +- (instancetype)initWithUIManager:(RCTUIManager *)uiManager; +- (void)animateNextTransitionInRoot:(nonnull NSNumber *)reactTag withConfig:(NSDictionary *)config; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionValues.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionValues.h new file mode 100644 index 0000000..a1f739d --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REATransitionValues.h @@ -0,0 +1,15 @@ +#import + +@interface REATransitionValues : NSObject + +@property (nonatomic) CGPoint center; +@property (nonatomic) CGRect bounds; +@property (nonatomic) CGPoint centerRelativeToRoot; +@property (nonatomic, retain) UIView *view; +@property (nonatomic, retain) UIView *parent; +@property (nonatomic, retain) UIView *reactParent; +@property (nonatomic) CGPoint centerInReactParent; + +- (instancetype)initWithView:(UIView *)view forRoot:(UIView *)root; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAUtils.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAUtils.h new file mode 100644 index 0000000..1eb8ad7 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAUtils.h @@ -0,0 +1,5 @@ +#import + +#define REA_LOG_ERROR_IF_NIL(value, errorMsg) ({\ + if (value == nil) RCTLogError(errorMsg);\ +}) diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAValueNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAValueNode.h new file mode 100644 index 0000000..8de5023 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64/Headers/REAValueNode.h @@ -0,0 +1,11 @@ +#import + +#import "REANode.h" + +@class REAValueNode; + +@interface REAValueNode : REANode + +- (void)setValue:(NSNumber *)value; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64/libRNReanimated.a b/Frameworks/RNReanimated.xcframework/ios-arm64/libRNReanimated.a new file mode 100644 index 0000000..963bae4 Binary files /dev/null and b/Frameworks/RNReanimated.xcframework/ios-arm64/libRNReanimated.a differ diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+REATransition.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+REATransition.h new file mode 100644 index 0000000..17ebf0d --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+REATransition.h @@ -0,0 +1,12 @@ +#import + +#import "REATransition.h" + +@interface RCTConvert (REATransition) + ++ (REATransitionType)REATransitionType:(id)json; ++ (REATransitionAnimationType)REATransitionAnimationType:(id)json; ++ (REATransitionInterpolationType)REATransitionInterpolationType:(id)json; ++ (REATransitionPropagationType)REATransitionPropagationType:(id)json; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAAllTransitions.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAAllTransitions.h new file mode 100644 index 0000000..8ab0480 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAAllTransitions.h @@ -0,0 +1,26 @@ +#import "REATransition.h" + +@interface REATransitionGroup : REATransition +@property (nonatomic) BOOL sequence; +@property (nonatomic) NSArray *transitions; +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAVisibilityTransition : REATransition +@property (nonatomic) REATransitionAnimationType animationType; +- (REATransitionAnimation *)appearView:(UIView*)view inParent:(UIView*)parent; +- (REATransitionAnimation *)disappearView:(UIView*)view fromParent:(UIView*)parent; +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAInTransition : REAVisibilityTransition +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAOutTransition : REAVisibilityTransition +- (instancetype)initWithConfig:(NSDictionary *)config; +@end + +@interface REAChangeTransition : REATransition +- (instancetype)initWithConfig:(NSDictionary *)config; +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAAlwaysNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAAlwaysNode.h new file mode 100644 index 0000000..589251c --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAAlwaysNode.h @@ -0,0 +1,4 @@ +#import "REANode.h" + +@interface REAAlwaysNode : REANode +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REABezierNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REABezierNode.h new file mode 100644 index 0000000..0e0a953 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REABezierNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REABezierNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REABlockNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REABlockNode.h new file mode 100644 index 0000000..54f412c --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REABlockNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REABlockNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REACallFuncNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REACallFuncNode.h new file mode 100644 index 0000000..4502724 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REACallFuncNode.h @@ -0,0 +1,7 @@ + +#import "REANode.h" + +@interface REACallFuncNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAClockNodes.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAClockNodes.h new file mode 100644 index 0000000..fc0fc08 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAClockNodes.h @@ -0,0 +1,19 @@ +#import "REANode.h" + +@interface REAClockNode : REANode +@property (nonatomic, readonly) BOOL isRunning; +- (void)start; +- (void)stop; +@end + +@interface REAClockOpNode : REANode +@end + +@interface REAClockStartNode : REAClockOpNode +@end + +@interface REAClockStopNode : REAClockOpNode +@end + +@interface REAClockTestNode : REAClockOpNode +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAConcatNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAConcatNode.h new file mode 100644 index 0000000..d275eec --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAConcatNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REAConcatNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REACondNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REACondNode.h new file mode 100644 index 0000000..3e4a173 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REACondNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REACondNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/READebugNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/READebugNode.h new file mode 100644 index 0000000..cd7cd3e --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/READebugNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface READebugNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAEventNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAEventNode.h new file mode 100644 index 0000000..73027f1 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAEventNode.h @@ -0,0 +1,9 @@ +#import "REANode.h" + +#import + +@interface REAEventNode : REANode + +- (void)processEvent:(id)event; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAFunctionNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAFunctionNode.h new file mode 100644 index 0000000..4b6ef73 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAFunctionNode.h @@ -0,0 +1,7 @@ + +#import "REANode.h" + +@interface REAFunctionNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAJSCallNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAJSCallNode.h new file mode 100644 index 0000000..f13a803 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAJSCallNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REAJSCallNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAModule.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAModule.h new file mode 100644 index 0000000..ed60267 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAModule.h @@ -0,0 +1,12 @@ +#import +#import +#import +#import +#import +#import + +#import "REAValueNode.h" + +@interface REAModule : RCTEventEmitter + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REANode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REANode.h new file mode 100644 index 0000000..0874400 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REANode.h @@ -0,0 +1,39 @@ +#import +#import + +@class REANodesManager; + +typedef NSNumber* REANodeID; + +@protocol REAFinalNode + +- (void)update; + +@end + +@interface REAUpdateContext : NSObject +@property (nonatomic) NSString* callID; +@end + +@interface REANode : NSObject + ++ (void)runPropUpdates:(nonnull REAUpdateContext *)context; + +- (instancetype)initWithID:(REANodeID)nodeID + config:(NSDictionary *)config NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, weak, nullable) REANodesManager *nodesManager; +@property (nonatomic, nullable) REAUpdateContext *updateContext; +@property (nonatomic, readonly, nonnull) REANodeID nodeID; + +- (_Nullable id)evaluate; +- (_Nullable id)value; +- (void)markUpdated; + +- (void)addChild:(REANode *)child NS_REQUIRES_SUPER; +- (void)removeChild:(REANode *)child NS_REQUIRES_SUPER; + +- (void)dangerouslyRescheduleEvaluate; +- (void)forceUpdateMemoizedValue:(id)value; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REANodesManager.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REANodesManager.h new file mode 100644 index 0000000..9597166 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REANodesManager.h @@ -0,0 +1,79 @@ +#import + +#import "REANode.h" +#import +#import + +@class REAModule; + +typedef void (^REAOnAnimationCallback)(CADisplayLink *displayLink); +typedef void (^REANativeAnimationOp)(RCTUIManager *uiManager); + +@interface REANodesManager : NSObject + +@property (nonatomic, weak, nullable) RCTUIManager *uiManager; +@property (nonatomic, weak, nullable) REAModule *reanimatedModule; +@property (nonatomic, readonly) CFTimeInterval currentAnimationTimestamp; + +@property (nonatomic, nullable) NSSet *uiProps; +@property (nonatomic, nullable) NSSet *nativeProps; + +- (nonnull instancetype)initWithModule:(REAModule *)reanimatedModule + uiManager:(nonnull RCTUIManager *)uiManager; + +- (REANode* _Nullable)findNodeByID:(nonnull REANodeID)nodeID; + +- (void)invalidate; + +- (void)operationsBatchDidComplete; + +// + +- (void)postOnAnimation:(REAOnAnimationCallback)clb; +- (void)postRunUpdatesAfterAnimation; +- (void)enqueueUpdateViewOnNativeThread:(nonnull NSNumber *)reactTag + viewName:(NSString *) viewName + nativeProps:(NSMutableDictionary *)nativeProps; +- (void)getValue:(REANodeID)nodeID + callback:(RCTResponseSenderBlock)callback; + +// graph + +- (void)createNode:(nonnull REANodeID)tag + config:(NSDictionary *__nonnull)config; + +- (void)dropNode:(nonnull REANodeID)tag; + +- (void)connectNodes:(nonnull REANodeID)parentID + childID:(nonnull REANodeID)childID; + +- (void)disconnectNodes:(nonnull REANodeID)parentID + childID:(nonnull REANodeID)childID; + +- (void)connectNodeToView:(nonnull REANodeID)nodeID + viewTag:(nonnull NSNumber *)viewTag + viewName:(nonnull NSString *)viewName; + +- (void)disconnectNodeFromView:(nonnull REANodeID)nodeID + viewTag:(nonnull NSNumber *)viewTag; + +- (void)attachEvent:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + eventNodeID:(nonnull REANodeID)eventNodeID; + +- (void)detachEvent:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + eventNodeID:(nonnull REANodeID)eventNodeID; + +// configuration + +- (void)configureProps:(nonnull NSSet *)nativeProps + uiProps:(nonnull NSSet *)uiProps; + +// events + +- (void)dispatchEvent:(id)event; + +- (void)setValueForNodeID:(nonnull NSNumber *)nodeID value:(nonnull NSNumber *)newValue; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAOperatorNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAOperatorNode.h new file mode 100644 index 0000000..50c1689 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAOperatorNode.h @@ -0,0 +1,5 @@ +#import "REANode.h" + +@interface REAOperatorNode : REANode + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAParamNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAParamNode.h new file mode 100644 index 0000000..b5e97e8 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAParamNode.h @@ -0,0 +1,12 @@ +#import "REAValueNode.h" + +@interface REAParamNode : REAValueNode + +- (void)beginContext:(NSNumber*) ref + prevCallID:(NSNumber*) prevCallID; +- (void)endContext; +- (void)start; +- (void)stop; +- (BOOL)isRunning; +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAPropsNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAPropsNode.h new file mode 100644 index 0000000..05171f1 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAPropsNode.h @@ -0,0 +1,11 @@ +#import "REANode.h" + +@interface REAPropsNode : REANode + +- (void)connectToView:(NSNumber *_Nonnull)viewTag + viewName:(NSString *_Nonnull)viewName; + +- (void)disconnectFromView:(NSNumber *_Nonnull)viewTag; + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REASetNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REASetNode.h new file mode 100644 index 0000000..5bc6a38 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REASetNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REASetNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAStyleNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAStyleNode.h new file mode 100644 index 0000000..58bc7ba --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAStyleNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REAStyleNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransformNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransformNode.h new file mode 100644 index 0000000..51ae259 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransformNode.h @@ -0,0 +1,6 @@ +#import "REANode.h" + +@interface REATransformNode : REANode + +@end + diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransition.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransition.h new file mode 100644 index 0000000..6d4d1f0 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransition.h @@ -0,0 +1,64 @@ +#import +#import +#import + +#import "REATransitionAnimation.h" +#import "REATransitionValues.h" + +// TODO: fix below implementation +#define IS_LAYOUT_ONLY(view) ([view isKindOfClass:[RCTView class]] && view.backgroundColor == nil) + +typedef NS_ENUM(NSInteger, REATransitionType) { + REATransitionTypeNone = 0, + REATransitionTypeGroup, + REATransitionTypeIn, + REATransitionTypeOut, + REATransitionTypeChange +}; + +typedef NS_ENUM(NSInteger, REATransitionAnimationType) { + REATransitionAnimationTypeNone = 0, + REATransitionAnimationTypeFade, + REATransitionAnimationTypeScale, + REATransitionAnimationTypeSlideTop, + REATransitionAnimationTypeSlideBottom, + REATransitionAnimationTypeSlideRight, + REATransitionAnimationTypeSlideLeft, +}; + +typedef NS_ENUM(NSInteger, REATransitionInterpolationType) { + REATransitionInterpolationLinear = 0, + REATransitionInterpolationEaseIn, + REATransitionInterpolationEaseOut, + REATransitionInterpolationEaseInOut, +}; + +typedef NS_ENUM(NSInteger, REATransitionPropagationType) { + REATransitionPropagationNone = 0, + REATransitionPropagationTop, + REATransitionPropagationBottom, + REATransitionPropagationLeft, + REATransitionPropagationRight, +}; + +@interface REATransition : NSObject +@property (nonatomic, weak) REATransition *parent; +@property (nonatomic) CFTimeInterval duration; +@property (nonatomic) CFTimeInterval delay; +@property (nonatomic) REATransitionInterpolationType interpolation; +@property (nonatomic) REATransitionPropagationType propagation; +- (instancetype)initWithConfig:(NSDictionary *)config; +- (CAMediaTimingFunction *)mediaTiming; +- (void)startCaptureInRoot:(UIView *)root; +- (void)playInRoot:(UIView *)root; +- (REATransitionValues *)findStartValuesForKey:(NSNumber *)key; +- (REATransitionValues *)findEndValuesForKey:(NSNumber *)key; +- (REATransitionAnimation *)animationForTransitioning:(REATransitionValues*)startValues + endValues:(REATransitionValues*)endValues + forRoot:(UIView *)root; +- (NSArray *)animationsForTransitioning:(NSMutableDictionary *)startValues + endValues:(NSMutableDictionary *)endValues + forRoot:(UIView *)root; + ++ (REATransition *)inflate:(NSDictionary *)config; +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionAnimation.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionAnimation.h new file mode 100644 index 0000000..b9efb93 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionAnimation.h @@ -0,0 +1,17 @@ +#import + +@interface REATransitionAnimation : NSObject + +@property (nonatomic) CAAnimation *animation; +@property (nonatomic) CALayer *layer; +@property (nonatomic) NSString *keyPath; + ++ (REATransitionAnimation *)transitionWithAnimation:(CAAnimation *)animation + layer:(CALayer *)layer + andKeyPath:(NSString*)keyPath; +- (void)play; +- (void)delayBy:(CFTimeInterval)delay; +- (CFTimeInterval)finishTime; +- (CFTimeInterval)duration; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionManager.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionManager.h new file mode 100644 index 0000000..d3a3844 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionManager.h @@ -0,0 +1,9 @@ +#import +#import + +@interface REATransitionManager : NSObject + +- (instancetype)initWithUIManager:(RCTUIManager *)uiManager; +- (void)animateNextTransitionInRoot:(nonnull NSNumber *)reactTag withConfig:(NSDictionary *)config; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionValues.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionValues.h new file mode 100644 index 0000000..a1f739d --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REATransitionValues.h @@ -0,0 +1,15 @@ +#import + +@interface REATransitionValues : NSObject + +@property (nonatomic) CGPoint center; +@property (nonatomic) CGRect bounds; +@property (nonatomic) CGPoint centerRelativeToRoot; +@property (nonatomic, retain) UIView *view; +@property (nonatomic, retain) UIView *parent; +@property (nonatomic, retain) UIView *reactParent; +@property (nonatomic) CGPoint centerInReactParent; + +- (instancetype)initWithView:(UIView *)view forRoot:(UIView *)root; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAUtils.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAUtils.h new file mode 100644 index 0000000..1eb8ad7 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAUtils.h @@ -0,0 +1,5 @@ +#import + +#define REA_LOG_ERROR_IF_NIL(value, errorMsg) ({\ + if (value == nil) RCTLogError(errorMsg);\ +}) diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAValueNode.h b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAValueNode.h new file mode 100644 index 0000000..8de5023 --- /dev/null +++ b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/Headers/REAValueNode.h @@ -0,0 +1,11 @@ +#import + +#import "REANode.h" + +@class REAValueNode; + +@interface REAValueNode : REANode + +- (void)setValue:(NSNumber *)value; + +@end diff --git a/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/libRNReanimated.a b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/libRNReanimated.a new file mode 100644 index 0000000..20bb346 Binary files /dev/null and b/Frameworks/RNReanimated.xcframework/ios-arm64_x86_64-simulator/libRNReanimated.a differ diff --git a/Frameworks/RNSVG.xcframework/Info.plist b/Frameworks/RNSVG.xcframework/Info.plist new file mode 100644 index 0000000..651a8a6 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNSVG.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNSVG.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNSVG.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNSVG.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RCTConvert+RNSVG.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RCTConvert+RNSVG.h new file mode 100644 index 0000000..4388e0c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RCTConvert+RNSVG.h @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RCTConvert+RNSVG.h" +#import +#import "RNSVGCGFCRule.h" +#import "RNSVGVBMOS.h" +#import "RNSVGUnits.h" +#import "RNSVGLength.h" +#import "RNSVGPathParser.h" + +@class RNSVGBrush; + +@interface RCTConvert (RNSVG) + ++ (RNSVGLength*)RNSVGLength:(id)json; ++ (NSArray*)RNSVGLengthArray:(id)json; ++ (RNSVGCGFCRule)RNSVGCGFCRule:(id)json; ++ (RNSVGVBMOS)RNSVGVBMOS:(id)json; ++ (RNSVGUnits)RNSVGUnits:(id)json; ++ (RNSVGBrush *)RNSVGBrush:(id)json; ++ (RNSVGPathParser *)RNSVGCGPath:(NSString *)d; ++ (CGRect)RNSVGCGRect:(id)json offset:(NSUInteger)offset; ++ (CGColorRef)RNSVGCGColor:(id)json offset:(NSUInteger)offset; ++ (CGGradientRef)RNSVGCGGradient:(id)json; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBezierElement.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBezierElement.h new file mode 100644 index 0000000..eefbbf1 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBezierElement.h @@ -0,0 +1,25 @@ +/* + + Erica Sadun, http://ericasadun.com + https://github.com/erica/iOS-Drawing/tree/master/C08/Quartz%20Book%20Pack/Bezier + */ + +#import +#import + +#define RNSVGNULLPOINT CGRectNull.origin + +@interface RNSVGBezierElement : NSObject + +// Element storage +@property (nonatomic, assign) CGPathElementType elementType; +@property (nonatomic, assign) CGPoint point; +@property (nonatomic, assign) CGPoint controlPoint1; +@property (nonatomic, assign) CGPoint controlPoint2; + +// Instance creation ++ (instancetype) elementWithPathElement: (CGPathElement) element; ++ (NSArray *) elementsFromCGPath:(CGPathRef)path; + +@end + diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBrush.h new file mode 100644 index 0000000..edf3fc4 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBrush.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGPainter.h" + +@interface RNSVGBrush : NSObject + +@property (nonatomic, strong) NSString* brushRef; + +/* @abstract */ +- (instancetype)initWithArray:(NSArray *)data; + +/** + * @abstract + * For certain brushes we can fast path a combined fill and stroke. + * For those brushes we override applyFillColor which sets the fill + * color to be used by those batch paints. Those return YES. + * We can't batch gradient painting in CoreGraphics, so those will + * return NO and paint gets called instead. + */ +- (BOOL)applyFillColor:(CGContextRef)context opacity:(CGFloat)opacity; + +- (BOOL)applyStrokeColor:(CGContextRef)context opacity:(CGFloat)opacity; + +- (CGColorRef)getColorWithOpacity:(CGFloat)opacity; + +/** + * @abstract + * paint fills the context with a brush. The context is assumed to + * be clipped. + */ +- (void)paint:(CGContextRef)context opacity:(CGFloat)opacity painter:(RNSVGPainter *)painter bounds:(CGRect)bounds; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBrushType.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBrushType.h new file mode 100644 index 0000000..3cc4a30 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGBrushType.h @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef enum { + kRNSVGUndefinedType, + kRNSVGLinearGradient, + kRNSVGRadialGradient, + kRNSVGPattern +} RNSVGBrushType; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCGFCRule.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCGFCRule.h new file mode 100644 index 0000000..160b0ef --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCGFCRule.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGCGFCRule) { + kRNSVGCGFCRuleEvenodd, + kRNSVGCGFCRuleNonzero +}; \ No newline at end of file diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCircle.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCircle.h new file mode 100644 index 0000000..f4e411a --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCircle.h @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGCircle : RNSVGRenderable + +@property (nonatomic, strong) RNSVGLength* cx; +@property (nonatomic, strong) RNSVGLength* cy; +@property (nonatomic, strong) RNSVGLength* r; + +@end + diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCircleManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCircleManager.h new file mode 100644 index 0000000..30b6c1c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGCircleManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGCircleManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGClipPath.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGClipPath.h new file mode 100644 index 0000000..27697e2 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGClipPath.h @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGContainer.h" +#import "RNSVGGroup.h" +#import "RNSVGSvgView.h" + +@interface RNSVGClipPath : RNSVGGroup + +- (BOOL)isSimpleClipPath; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGClipPathManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGClipPathManager.h new file mode 100644 index 0000000..111c7e4 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGClipPathManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGClipPathManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGContainer.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGContainer.h new file mode 100644 index 0000000..4d16332 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGContainer.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RNSVGContainer + +// This is used as a hook for child to mark it's parent as dirty. +// This bubbles up to the root which gets marked as dirty. +- (void)invalidate; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGContextBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGContextBrush.h new file mode 100644 index 0000000..269f46c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGContextBrush.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, react-native-community. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGBrush.h" + +@interface RNSVGContextBrush : RNSVGBrush + +- (instancetype)initFill; +- (instancetype)initStroke; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGDefs.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGDefs.h new file mode 100644 index 0000000..9e58b40 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGDefs.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" + +/** + * RNSVG defination are implemented as abstract UIViews for all elements inside Defs. + */ + +@interface RNSVGDefs : RNSVGNode + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGDefsManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGDefsManager.h new file mode 100644 index 0000000..591ba68 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGDefsManager.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNSVGDefsManager : RCTViewManager + +@end + +#import "RNSVGNode.h" diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGEllipse.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGEllipse.h new file mode 100644 index 0000000..8ca56cc --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGEllipse.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGEllipse : RNSVGRenderable +@property (nonatomic, strong) RNSVGLength* cx; +@property (nonatomic, strong) RNSVGLength* cy; +@property (nonatomic, strong) RNSVGLength* rx; +@property (nonatomic, strong) RNSVGLength* ry; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGEllipseManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGEllipseManager.h new file mode 100644 index 0000000..3f6c001 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGEllipseManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGEllipseManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGFontData.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGFontData.h new file mode 100644 index 0000000..a988ca4 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGFontData.h @@ -0,0 +1,36 @@ +#import +#import + +#import "RNSVGTextProperties.h" +#import "RNSVGPropHelper.h" + +@interface RNSVGFontData : NSObject { +@public + CGFloat fontSize; + NSString * fontSize_; + NSString *fontFamily; + enum RNSVGFontStyle fontStyle; + NSDictionary * fontData; + enum RNSVGFontWeight fontWeight; + int absoluteFontWeight; + NSString *fontFeatureSettings; + enum RNSVGFontVariantLigatures fontVariantLigatures; + enum RNSVGTextAnchor textAnchor; + enum RNSVGTextDecoration textDecoration; + CGFloat kerning; + CGFloat wordSpacing; + CGFloat letterSpacing; + bool manualKerning; +} + ++ (instancetype)Defaults; + ++ (CGFloat)toAbsoluteWithNSString:(NSString *)string + fontSize:(CGFloat)fontSize; + ++ (instancetype)initWithNSDictionary:(NSDictionary *)font + parent:(RNSVGFontData *)parent; + +@end + +#define RNSVGFontData_DEFAULT_FONT_SIZE 12.0 diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGForeignObject.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGForeignObject.h new file mode 100644 index 0000000..346b204 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGForeignObject.h @@ -0,0 +1,12 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" + +@interface RNSVGForeignObject : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *foreignObjectwidth; +@property (nonatomic, strong) RNSVGLength *foreignObjectheight; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGForeignObjectManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGForeignObjectManager.h new file mode 100644 index 0000000..845a6db --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGForeignObjectManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGForeignObjectManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGlyphContext.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGlyphContext.h new file mode 100644 index 0000000..de49110 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGlyphContext.h @@ -0,0 +1,49 @@ +#import +#import +#import "RNSVGFontData.h" + +@class RNSVGText; +@class RNSVGGroup; +@class RNSVGGlyphContext; + +@interface RNSVGGlyphContext : NSObject + +- (CTFontRef)getGlyphFont; + +- (instancetype)initWithWidth:(CGFloat)width + height:(CGFloat)height; + +- (RNSVGFontData *)getFont; + +- (CGFloat)getFontSize; + +- (CGFloat)getHeight; + +- (CGFloat)getWidth; + +- (CGFloat)nextDeltaX; + +- (CGFloat)nextDeltaY; + +- (CGFloat)nextRotation; + +- (CGFloat)nextXWithDouble:(CGFloat)advance; + +- (CGFloat)nextY; + +- (void)popContext; + +- (void)pushContext:(RNSVGText*)node + font:(NSDictionary*)font + x:(NSArray*)x + y:(NSArray*)y + deltaX:(NSArray*)deltaX + deltaY:(NSArray*)deltaY + rotate:(NSArray*)rotate; + +- (void)pushContext:(RNSVGGroup*)node + font:(NSDictionary *)font; + +- (NSArray*)getFontContext; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGroup.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGroup.h new file mode 100644 index 0000000..4402014 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGroup.h @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGContainer.h" +#import "RNSVGCGFCRule.h" +#import "RNSVGSvgView.h" +#import "RNSVGPath.h" +#import "RNSVGGlyphContext.h" + +@interface RNSVGGroup : RNSVGPath + +@property (nonatomic, strong) NSDictionary *font; + +- (void)renderPathTo:(CGContextRef)context rect:(CGRect)rect; +- (void)renderGroupTo:(CGContextRef)context rect:(CGRect)rect; + +- (RNSVGGlyphContext *)getGlyphContext; +- (void)pushGlyphContext; +- (void)popGlyphContext; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGroupManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGroupManager.h new file mode 100644 index 0000000..84f7c82 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGGroupManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGGroupManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGImage.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGImage.h new file mode 100644 index 0000000..dc7e78d --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGImage.h @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import "RNSVGRenderable.h" +#import "RNSVGVBMOS.h" +#import "RNSVGLength.h" + +@interface RNSVGImage : RNSVGRenderable + +@property (nonatomic, weak) RCTBridge *bridge; +@property (nonatomic, assign) id src; +@property (nonatomic, strong) RNSVGLength* x; +@property (nonatomic, strong) RNSVGLength* y; +@property (nonatomic, strong) RNSVGLength* imagewidth; +@property (nonatomic, strong) RNSVGLength* imageheight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGImageManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGImageManager.h new file mode 100644 index 0000000..c799d3e --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGImageManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGImageManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLength.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLength.h new file mode 100644 index 0000000..ba7fb09 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLength.h @@ -0,0 +1,32 @@ +#import + +#ifndef RNSVGLength_h +#define RNSVGLength_h + +// https://www.w3.org/TR/SVG/types.html#InterfaceSVGLength +typedef CF_ENUM(unsigned short, RNSVGLengthUnitType) { + SVG_LENGTHTYPE_UNKNOWN, + SVG_LENGTHTYPE_NUMBER, + SVG_LENGTHTYPE_PERCENTAGE, + SVG_LENGTHTYPE_EMS, + SVG_LENGTHTYPE_EXS, + SVG_LENGTHTYPE_PX, + SVG_LENGTHTYPE_CM, + SVG_LENGTHTYPE_MM, + SVG_LENGTHTYPE_IN, + SVG_LENGTHTYPE_PT, + SVG_LENGTHTYPE_PC, +}; + +@interface RNSVGLength : NSObject + +@property (nonatomic, assign) CGFloat value; +@property (nonatomic, assign) RNSVGLengthUnitType unit; + ++ (instancetype) lengthWithNumber: (CGFloat) number; ++ (instancetype) lengthWithString: (NSString *) lengthString; +- (BOOL) isEqualTo: (RNSVGLength *)other; + +@end + +#endif /* RNSVGLength_h */ diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLine.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLine.h new file mode 100644 index 0000000..1183902 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLine.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGLine : RNSVGRenderable +@property (nonatomic, strong) RNSVGLength* x1; +@property (nonatomic, strong) RNSVGLength* y1; +@property (nonatomic, strong) RNSVGLength* x2; +@property (nonatomic, strong) RNSVGLength* y2; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLineManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLineManager.h new file mode 100644 index 0000000..51ed2f2 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLineManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGLineManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLinearGradient.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLinearGradient.h new file mode 100644 index 0000000..30e577a --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLinearGradient.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" +#import "RNSVGLength.h" + +@interface RNSVGLinearGradient : RNSVGNode + +@property (nonatomic, strong) RNSVGLength *x1; +@property (nonatomic, strong) RNSVGLength *y1; +@property (nonatomic, strong) RNSVGLength *x2; +@property (nonatomic, strong) RNSVGLength *y2; +@property (nonatomic, copy) NSArray *gradient; +@property (nonatomic, assign) RNSVGUnits gradientUnits; +@property (nonatomic, assign) CGAffineTransform gradientTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLinearGradientManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLinearGradientManager.h new file mode 100644 index 0000000..4927884 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGLinearGradientManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGLinearGradientManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarker.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarker.h new file mode 100644 index 0000000..a0744b9 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarker.h @@ -0,0 +1,24 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" +#import "RNSVGMarkerPosition.h" + +@interface RNSVGMarker : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *refX; +@property (nonatomic, strong) RNSVGLength *refY; +@property (nonatomic, strong) RNSVGLength *markerWidth; +@property (nonatomic, strong) RNSVGLength *markerHeight; +@property (nonatomic, strong) NSString *markerUnits; +@property (nonatomic, strong) NSString *orient; + +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +- (void)renderMarker:(CGContextRef)context rect:(CGRect)rect position:(RNSVGMarkerPosition*)position strokeWidth:(CGFloat)strokeWidth; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarkerManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarkerManager.h new file mode 100644 index 0000000..da10481 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarkerManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGMarkerManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarkerPosition.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarkerPosition.h new file mode 100644 index 0000000..bf7b3c0 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMarkerPosition.h @@ -0,0 +1,25 @@ + +#import +#import + +typedef enum RNSVGMarkerType { + kStartMarker, + kMidMarker, + kEndMarker +} RNSVGMarkerType; + +#define RNSVGZEROPOINT CGRectZero.origin + +@interface RNSVGMarkerPosition : NSObject + +// Element storage +@property (nonatomic, assign) RNSVGMarkerType type; +@property (nonatomic, assign) CGPoint origin; +@property (nonatomic, assign) float angle; + +// Instance creation ++ (instancetype) markerPosition:(RNSVGMarkerType)type origin:(CGPoint)origin angle:(float)angle; + ++ (NSArray*) fromCGPath:(CGPathRef)path; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMask.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMask.h new file mode 100644 index 0000000..a710c76 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMask.h @@ -0,0 +1,15 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" + +@interface RNSVGMask : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *maskwidth; +@property (nonatomic, strong) RNSVGLength *maskheight; +@property (nonatomic, assign) RNSVGUnits maskUnits; +@property (nonatomic, assign) RNSVGUnits maskContentUnits; +@property (nonatomic, assign) CGAffineTransform maskTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMaskManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMaskManager.h new file mode 100644 index 0000000..bb5fa53 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGMaskManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGMaskManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGNode.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGNode.h new file mode 100644 index 0000000..81513b3 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGNode.h @@ -0,0 +1,141 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGCGFCRule.h" +#import "RNSVGSvgView.h" +@class RNSVGGroup; + +/** + * RNSVG nodes are implemented as base UIViews. They should be implementation for all basic + *interfaces for all non-definition nodes. + */ + +@interface RNSVGNode : UIView + +/* + N[1/Sqrt[2], 36] + The inverse of the square root of 2. + Provide enough digits for the 128-bit IEEE quad (36 significant digits). + */ +extern CGFloat const RNSVG_M_SQRT1_2l; +extern CGFloat const RNSVG_DEFAULT_FONT_SIZE; + +@property (nonatomic, strong) NSString *name; +@property (nonatomic, strong) NSString *display; +@property (nonatomic, assign) CGFloat opacity; +@property (nonatomic, assign) RNSVGCGFCRule clipRule; +@property (nonatomic, strong) NSString *clipPath; +@property (nonatomic, strong) NSString *mask; +@property (nonatomic, strong) NSString *markerStart; +@property (nonatomic, strong) NSString *markerMid; +@property (nonatomic, strong) NSString *markerEnd; + +/** + * Used to control how touch events are processed. + */ +@property (nonatomic, assign) RCTPointerEvents pointerEvents; +@property (nonatomic, assign) BOOL responsible; + +@property (nonatomic, assign) CGAffineTransform ctm; +@property (nonatomic, assign) CGAffineTransform screenCTM; +@property (nonatomic, assign) CGAffineTransform matrix; +@property (nonatomic, assign) CGAffineTransform transforms; +@property (nonatomic, assign) CGAffineTransform invmatrix; +@property (nonatomic, assign) CGAffineTransform invTransform; +@property (nonatomic, assign) BOOL active; +@property (nonatomic, assign) BOOL dirty; +@property (nonatomic, assign) BOOL merging; +@property (nonatomic, assign) BOOL skip; +@property (nonatomic, assign) CGPathRef path; +@property (nonatomic, assign) CGPathRef strokePath; +@property (nonatomic, assign) CGPathRef markerPath; +@property (nonatomic, assign) CGRect clientRect; +@property (nonatomic, assign) CGRect pathBounds; +@property (nonatomic, assign) CGRect fillBounds; +@property (nonatomic, assign) CGRect strokeBounds; +@property (nonatomic, assign) CGRect markerBounds; +@property (nonatomic, copy) RCTDirectEventBlock onLayout; + + +/** + * RNSVGSvgView which ownes current RNSVGNode + */ +@property (nonatomic, readonly, weak) RNSVGSvgView *svgView; +@property (nonatomic, readonly, weak) RNSVGGroup *textRoot; + +- (void)invalidate; + +- (RNSVGGroup *)getParentTextRoot; + +- (void)renderTo:(CGContextRef)context rect:(CGRect)rect; + +/** + * @abstract + * renderTo will take opacity into account and draw renderLayerTo off-screen if there is opacity + * specified, then composite that onto the context. renderLayerTo always draws at opacity=1. + */ +- (void)renderLayerTo:(CGContextRef)context rect:(CGRect)rect; + +/** + * get clipPath from cache + */ +- (CGPathRef)getClipPath; + +/** + * get clipPath through context + */ +- (CGPathRef)getClipPath:(CGContextRef)context; + +/** + * clip node by clipPath + */ +- (void)clip:(CGContextRef)context; + +/** + * getPath will return the path inside node as a ClipPath. + */ +- (CGPathRef)getPath:(CGContextRef) context; + +- (CGFloat)relativeOnWidthString:(NSString *)length; + +- (CGFloat)relativeOnHeightString:(NSString *)length; + +- (CGFloat)relativeOnOtherString:(NSString *)length; + +- (CGFloat)relativeOn:(RNSVGLength *)length relative:(CGFloat)relative; + +- (CGFloat)relativeOnWidth:(RNSVGLength *)length; + +- (CGFloat)relativeOnHeight:(RNSVGLength *)length; + +- (CGFloat)relativeOnOther:(RNSVGLength *)length; + +- (CGFloat)getFontSizeFromContext; + +- (CGFloat)getContextWidth; + +- (CGFloat)getContextHeight; + +/** + * save element`s reference into svg element. + */ +- (void)parseReference; + +- (void)beginTransparencyLayer:(CGContextRef)context; + +- (void)endTransparencyLayer:(CGContextRef)context; + +- (void)traverseSubviews:(BOOL (^)(__kindof UIView *node))block; + +- (void)clearChildCache; + +- (void)clearPath; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGNodeManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGNodeManager.h new file mode 100644 index 0000000..2075bf6 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGNodeManager.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" +#import + +@interface RNSVGNodeManager : RCTViewManager + +- (RNSVGNode *)node; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPainter.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPainter.h new file mode 100644 index 0000000..f7e7385 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPainter.h @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTConvert+RNSVG.h" +#import "RNSVGBrushType.h" +#import "RNSVGUnits.h" +#import "RNSVGLength.h" + +@class RNSVGPattern; + +@interface RNSVGPainter : NSObject + +@property (nonatomic, assign) RNSVGPattern* pattern; +@property (nonatomic, assign) CGRect paintBounds; +@property (nonatomic, assign) bool useObjectBoundingBoxForContentUnits; +@property (nonatomic, assign) CGRect bounds; + +- (instancetype)initWithPointsArray:(NSArray *)pointsArray NS_DESIGNATED_INITIALIZER; + +- (void)paint:(CGContextRef)context bounds:(CGRect)bounds; + +- (void)setUnits:(RNSVGUnits)unit; + +- (void)setContentUnits:(RNSVGUnits)unit; + +- (void)setUserSpaceBoundingBox:(CGRect)userSpaceBoundingBox; + +- (void)setTransform:(CGAffineTransform)transform; + +- (void)setLinearGradientColors:(NSArray *)colors; + +- (void)setRadialGradientColors:(NSArray *)colors; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPainterBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPainterBrush.h new file mode 100644 index 0000000..e075d58 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPainterBrush.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGBrush.h" + +@interface RNSVGPainterBrush : RNSVGBrush + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPath.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPath.h new file mode 100644 index 0000000..2caf060 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPath.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGPathParser.h" +#import "RNSVGRenderable.h" + +@interface RNSVGPath : RNSVGRenderable + +@property (nonatomic, strong) RNSVGPathParser *d; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathManager.h new file mode 100644 index 0000000..4b13dff --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGPathManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathMeasure.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathMeasure.h new file mode 100644 index 0000000..42b16fd --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathMeasure.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2015-present, react-native-community. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNSVGPathMeasure : NSObject + +@property CGFloat pathLength; +@property CGPathRef path; +@property NSMutableArray *lengths; +@property NSMutableArray *lines; +@property NSUInteger lineCount; +@property BOOL isClosed; + +- (void)reset; +- (void)extractPathData:(CGPathRef)path; +- (void)getPosAndTan:(CGFloat *)angle midPoint:(CGFloat)midPoint x:(CGFloat *)x y:(CGFloat *)y; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathParser.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathParser.h new file mode 100644 index 0000000..5ea68b8 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPathParser.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + + +#import + +@interface RNSVGPathParser : NSObject + +- (instancetype) initWithPathString:(NSString *)d; +- (CGPathRef)getPath; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPattern.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPattern.h new file mode 100644 index 0000000..87f5290 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPattern.h @@ -0,0 +1,22 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" + +@interface RNSVGPattern : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *patternwidth; +@property (nonatomic, strong) RNSVGLength *patternheight; +@property (nonatomic, assign) RNSVGUnits patternUnits; +@property (nonatomic, assign) RNSVGUnits patternContentUnits; +@property (nonatomic, assign) CGAffineTransform patternTransform; + +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPatternManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPatternManager.h new file mode 100644 index 0000000..05d546b --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPatternManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGPatternManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPropHelper.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPropHelper.h new file mode 100644 index 0000000..ce89239 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGPropHelper.h @@ -0,0 +1,22 @@ +#import +#import +#import "RNSVGLength.h" + +#ifndef RNSVGPropHelper_h +#define RNSVGPropHelper_h + +@interface RNSVGPropHelper : NSObject + ++ (CGFloat) fromRelativeWithNSString:(NSString *)length + relative:(CGFloat)relative + fontSize:(CGFloat)fontSize; + ++ (CGFloat) fromRelative:(RNSVGLength*)length + relative:(CGFloat)relative + fontSize:(CGFloat)fontSize; + ++ (CGFloat)fromRelative:(RNSVGLength*)length + relative:(CGFloat)relative; +@end + +#endif diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRadialGradient.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRadialGradient.h new file mode 100644 index 0000000..deb8e03 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRadialGradient.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" +#import "RNSVGLength.h" + +@interface RNSVGRadialGradient : RNSVGNode + +@property (nonatomic, strong) RNSVGLength *fx; +@property (nonatomic, strong) RNSVGLength *fy; +@property (nonatomic, strong) RNSVGLength *rx; +@property (nonatomic, strong) RNSVGLength *ry; +@property (nonatomic, strong) RNSVGLength *cx; +@property (nonatomic, strong) RNSVGLength *cy; +@property (nonatomic, copy) NSArray *gradient; +@property (nonatomic, assign) RNSVGUnits gradientUnits; +@property (nonatomic, assign) CGAffineTransform gradientTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRadialGradientManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRadialGradientManager.h new file mode 100644 index 0000000..60c6055 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRadialGradientManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGRadialGradientManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRect.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRect.h new file mode 100644 index 0000000..04eea2c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRect.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGRect : RNSVGRenderable + +@property (nonatomic, strong) RNSVGLength* x; +@property (nonatomic, strong) RNSVGLength* y; +@property (nonatomic, strong) RNSVGLength* rectwidth; +@property (nonatomic, strong) RNSVGLength* rectheight; +@property (nonatomic, strong) RNSVGLength* rx; +@property (nonatomic, strong) RNSVGLength* ry; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRectManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRectManager.h new file mode 100644 index 0000000..fd16811 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRectManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGRectManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRenderable.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRenderable.h new file mode 100644 index 0000000..7ae0489 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRenderable.h @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGBrush.h" +#import "RNSVGCGFCRule.h" +#import "RNSVGNode.h" +#import "RNSVGLength.h" +#import "RNSVGVectorEffect.h" + +@interface RNSVGRenderable : RNSVGNode + +@property (class) RNSVGRenderable *contextElement; +@property (nonatomic, strong) RNSVGBrush *fill; +@property (nonatomic, assign) CGFloat fillOpacity; +@property (nonatomic, assign) RNSVGCGFCRule fillRule; +@property (nonatomic, strong) RNSVGBrush *stroke; +@property (nonatomic, assign) CGFloat strokeOpacity; +@property (nonatomic, strong) RNSVGLength *strokeWidth; +@property (nonatomic, assign) CGLineCap strokeLinecap; +@property (nonatomic, assign) CGLineJoin strokeLinejoin; +@property (nonatomic, assign) CGFloat strokeMiterlimit; +@property (nonatomic, strong) NSArray *strokeDasharray; +@property (nonatomic, assign) CGFloat strokeDashoffset; +@property (nonatomic, assign) RNSVGVectorEffect vectorEffect; +@property (nonatomic, copy) NSArray *propList; +@property (nonatomic, assign) CGPathRef hitArea; + +- (void)setHitArea:(CGPathRef)path; + +- (NSArray *)getAttributeList; + +- (void)mergeProperties:(__kindof RNSVGRenderable *)target; + +- (void)resetProperties; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRenderableManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRenderableManager.h new file mode 100644 index 0000000..1a9eea7 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGRenderableManager.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" +#import "RNSVGRenderable.h" + +@interface RNSVGRenderableManager : RNSVGNodeManager + +- (RNSVGRenderable *)node; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSolidColorBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSolidColorBrush.h new file mode 100644 index 0000000..6e12929 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSolidColorBrush.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGBrush.h" + +@interface RNSVGSolidColorBrush : RNSVGBrush + +- (instancetype)initWithNumber:(NSNumber *)number; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSvgView.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSvgView.h new file mode 100644 index 0000000..6510e1b --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSvgView.h @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGPainter.h" +#import "RNSVGContainer.h" +#import "RNSVGVBMOS.h" + +@class RNSVGNode; + +@interface RNSVGSvgView : UIView + +@property (nonatomic, strong) RNSVGLength *bbWidth; +@property (nonatomic, strong) RNSVGLength *bbHeight; +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; +@property (nonatomic, assign) BOOL responsible; +@property (nonatomic, assign) BOOL active; +@property (nonatomic, assign) CGRect boundingBox; +@property (nonatomic, assign) CGAffineTransform initialCTM; +@property (nonatomic, assign) CGAffineTransform invInitialCTM; +@property (nonatomic, assign) CGAffineTransform viewBoxTransform; + + + +/** + * define content as clipPath template. + */ +- (void)defineClipPath:(__kindof RNSVGNode *)clipPath clipPathName:(NSString *)clipPathName; + +- (RNSVGNode *)getDefinedClipPath:(NSString *)clipPathName; + +- (void)defineTemplate:(__kindof RNSVGNode *)template templateName:(NSString *)templateName; + +- (RNSVGNode *)getDefinedTemplate:(NSString *)templateName; + +- (void)definePainter:(RNSVGPainter *)painter painterName:(NSString *)painterName; + +- (RNSVGPainter *)getDefinedPainter:(NSString *)painterName; + +- (void)defineMarker:(RNSVGNode *)marker markerName:(NSString *)markerName; + +- (RNSVGNode *)getDefinedMarker:(NSString *)markerName; + +- (void)defineMask:(RNSVGNode *)mask maskName:(NSString *)maskName; + +- (RNSVGNode *)getDefinedMask:(NSString *)maskName; + +- (NSString *)getDataURL; + +- (NSString *)getDataURLwithBounds:(CGRect)bounds; + +- (CGRect)getContextBounds; + +- (void)drawRect:(CGRect)rect; + +- (void)drawToContext:(CGContextRef)context withRect:(CGRect)rect; + +- (CGAffineTransform)getViewBoxTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSvgViewManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSvgViewManager.h new file mode 100644 index 0000000..adbb664 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSvgViewManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNSVGSvgViewManager : RCTViewManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSymbol.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSymbol.h new file mode 100644 index 0000000..b9297b2 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSymbol.h @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroup.h" + +/** + * RNSVG defination are implemented as abstract UIViews for all elements inside Defs. + */ + +@interface RNSVGSymbol : RNSVGGroup + +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +- (void)renderSymbolTo:(CGContextRef)context width:(CGFloat)width height:(CGFloat)height; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSymbolManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSymbolManager.h new file mode 100644 index 0000000..6001344 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGSymbolManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGSymbolManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTSpan.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTSpan.h new file mode 100644 index 0000000..9b7509f --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTSpan.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ +#import +#import +#import +#import "RNSVGText.h" + +@interface RNSVGTSpan : RNSVGText + +@property (nonatomic, strong) NSString *content; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTSpanManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTSpanManager.h new file mode 100644 index 0000000..fa4c5f0 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTSpanManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGTextManager.h" + +@interface RNSVGTSpanManager : RNSVGTextManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGText.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGText.h new file mode 100644 index 0000000..71ec946 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGText.h @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGGroup.h" + +@interface RNSVGText : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *inlineSize; +@property (nonatomic, strong) RNSVGLength *textLength; +@property (nonatomic, strong) NSString *baselineShift; +@property (nonatomic, strong) NSString *lengthAdjust; +@property (nonatomic, strong) NSString *alignmentBaseline; +@property (nonatomic, strong) NSArray *deltaX; +@property (nonatomic, strong) NSArray *deltaY; +@property (nonatomic, strong) NSArray *positionX; +@property (nonatomic, strong) NSArray *positionY; +@property (nonatomic, strong) NSArray *rotate; + +- (CGPathRef)getGroupPath:(CGContextRef)context; +- (CTFontRef)getFontFromContext; +- (CGFloat)getSubtreeTextChunksTotalAdvance; +- (RNSVGText*)getTextAnchorRoot; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextManager.h new file mode 100644 index 0000000..1885846 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGTextManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextPath.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextPath.h new file mode 100644 index 0000000..820f575 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextPath.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGText.h" +#import "RNSVGLength.h" + +@interface RNSVGTextPath : RNSVGText + +@property (nonatomic, strong) NSString *href; +@property (nonatomic, strong) NSString *side; +@property (nonatomic, strong) NSString *method; +@property (nonatomic, strong) NSString *midLine; +@property (nonatomic, strong) NSString *spacing; +@property (nonatomic, strong) RNSVGLength *startOffset; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextPathManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextPathManager.h new file mode 100644 index 0000000..165db27 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextPathManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGTextManager.h" + +@interface RNSVGTextPathManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextProperties.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextProperties.h new file mode 100644 index 0000000..527ce3f --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGTextProperties.h @@ -0,0 +1,217 @@ +#import + +#ifndef RNTextProperties_h +#define RNTextProperties_h + +typedef NS_ENUM(NSInteger, RNSVGAlignmentBaseline) { + RNSVGAlignmentBaselineBaseline, + RNSVGAlignmentBaselineTextBottom, + RNSVGAlignmentBaselineAlphabetic, + RNSVGAlignmentBaselineIdeographic, + RNSVGAlignmentBaselineMiddle, + RNSVGAlignmentBaselineCentral, + RNSVGAlignmentBaselineMathematical, + RNSVGAlignmentBaselineTextTop, + RNSVGAlignmentBaselineBottom, + RNSVGAlignmentBaselineCenter, + RNSVGAlignmentBaselineTop, + /* + SVG implementations may support the following aliases in order to support legacy content: + + text-before-edge = text-top + text-after-edge = text-bottom + */ + RNSVGAlignmentBaselineTextBeforeEdge, + RNSVGAlignmentBaselineTextAfterEdge, + // SVG 1.1 + RNSVGAlignmentBaselineBeforeEdge, + RNSVGAlignmentBaselineAfterEdge, + RNSVGAlignmentBaselineHanging, + RNSVGAlignmentBaselineDEFAULT = RNSVGAlignmentBaselineBaseline +}; + +static NSString* const RNSVGAlignmentBaselineStrings[] = { + @"baseline", + @"text-bottom", + @"alphabetic", + @"ideographic", + @"middle", + @"central", + @"mathematical", + @"text-top", + @"bottom", + @"center", + @"top", + @"text-before-edge", + @"text-after-edge", + @"before-edge", + @"after-edge", + @"hanging", + @"central", + @"mathematical", + @"text-top", + @"bottom", + @"center", + @"top", + nil +}; + +NSString* RNSVGAlignmentBaselineToString( enum RNSVGAlignmentBaseline fw ); + +enum RNSVGAlignmentBaseline RNSVGAlignmentBaselineFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGFontStyle) { + RNSVGFontStyleNormal, + RNSVGFontStyleItalic, + RNSVGFontStyleOblique, + RNSVGFontStyleDEFAULT = RNSVGFontStyleNormal, +}; + +static NSString* const RNSVGFontStyleStrings[] = {@"normal", @"italic", @"oblique", nil}; + +NSString* RNSVGFontStyleToString( enum RNSVGFontStyle fw ); + +enum RNSVGFontStyle RNSVGFontStyleFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGFontVariantLigatures) { + RNSVGFontVariantLigaturesNormal, + RNSVGFontVariantLigaturesNone, + RNSVGFontVariantLigaturesDEFAULT = RNSVGFontVariantLigaturesNormal, +}; + +static NSString* const RNSVGFontVariantLigaturesStrings[] = {@"normal", @"none", nil}; + +NSString* RNSVGFontVariantLigaturesToString( enum RNSVGFontVariantLigatures fw ); + +enum RNSVGFontVariantLigatures RNSVGFontVariantLigaturesFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGFontWeight) { + // Absolute + RNSVGFontWeightNormal, + RNSVGFontWeightBold, + RNSVGFontWeight100, + RNSVGFontWeight200, + RNSVGFontWeight300, + RNSVGFontWeight400, + RNSVGFontWeight500, + RNSVGFontWeight600, + RNSVGFontWeight700, + RNSVGFontWeight800, + RNSVGFontWeight900, + // Relative + RNSVGFontWeightBolder, + RNSVGFontWeightLighter, + RNSVGFontWeightDEFAULT = RNSVGFontWeightNormal, +}; + +static NSString* const RNSVGFontWeightStrings[] = {@"normal", @"bold", @"100", @"200", @"300", @"400", @"500", @"600", @"700", @"800", @"900", @"bolder", @"lighter", nil}; + +static int const RNSVGAbsoluteFontWeights[] = {400, 700, 100, 200, 300, 400, 500, 600, 700, 800, 900}; + +static RNSVGFontWeight const RNSVGFontWeights[] = { + RNSVGFontWeight100, + RNSVGFontWeight100, + RNSVGFontWeight200, + RNSVGFontWeight300, + RNSVGFontWeightNormal, + RNSVGFontWeight500, + RNSVGFontWeight600, + RNSVGFontWeightBold, + RNSVGFontWeight800, + RNSVGFontWeight900, + RNSVGFontWeight900 +}; + +NSString* RNSVGFontWeightToString( enum RNSVGFontWeight fw ); + +enum RNSVGFontWeight RNSVGFontWeightFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextAnchor) { + RNSVGTextAnchorStart, + RNSVGTextAnchorMiddle, + RNSVGTextAnchorEnd, + RNSVGTextAnchorDEFAULT = RNSVGTextAnchorStart, +}; + +static NSString* const RNSVGTextAnchorStrings[] = {@"start", @"middle", @"end", nil}; + +NSString* RNSVGTextAnchorToString( enum RNSVGTextAnchor fw ); + +enum RNSVGTextAnchor RNSVGTextAnchorFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextDecoration) { + RNSVGTextDecorationNone, + RNSVGTextDecorationUnderline, + RNSVGTextDecorationOverline, + RNSVGTextDecorationLineThrough, + RNSVGTextDecorationBlink, + RNSVGTextDecorationDEFAULT = RNSVGTextDecorationNone, +}; + +static NSString* const RNSVGTextDecorationStrings[] = {@"None", @"Underline", @"Overline", @"LineThrough", @"Blink", nil}; + +NSString* RNSVGTextDecorationToString( enum RNSVGTextDecoration fw ); + +enum RNSVGTextDecoration RNSVGTextDecorationFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextLengthAdjust) { + RNSVGTextLengthAdjustSpacing, + RNSVGTextLengthAdjustSpacingAndGlyphs, + RNSVGTextLengthAdjustDEFAULT = RNSVGTextLengthAdjustSpacing, +}; + +static NSString* const RNSVGTextLengthAdjustStrings[] = {@"spacing", @"spacingAndGlyphs", nil}; + +NSString* RNSVGTextLengthAdjustToString( enum RNSVGTextLengthAdjust fw ); + +enum RNSVGTextLengthAdjust RNSVGTextLengthAdjustFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathMethod) { + RNSVGTextPathMethodAlign, + RNSVGTextPathMethodStretch, + RNSVGTextPathMethodDEFAULT = RNSVGTextPathMethodAlign, +}; + +static NSString* const RNSVGTextPathMethodStrings[] = {@"align", @"stretch", nil}; + +NSString* RNSVGTextPathMethodToString( enum RNSVGTextPathMethod fw ); + +enum RNSVGTextPathMethod RNSVGTextPathMethodFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathMidLine) { + RNSVGTextPathMidLineSharp, + RNSVGTextPathMidLineSmooth, + RNSVGTextPathMidLineDEFAULT = RNSVGTextPathMidLineSharp, +}; + +static NSString* const RNSVGTextPathMidLineStrings[] = {@"sharp", @"smooth", nil}; + +NSString* RNSVGTextPathMidLineToString( enum RNSVGTextPathMidLine fw ); + +enum RNSVGTextPathMidLine RNSVGTextPathMidLineFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathSide) { + RNSVGTextPathSideLeft, + RNSVGTextPathSideRight, + RNSVGTextPathSideDEFAULT = RNSVGTextPathSideLeft, +}; + +static NSString* const RNSVGTextPathSideStrings[] = {@"left", @"right", nil}; + +NSString* RNSVGTextPathSideToString( enum RNSVGTextPathSide fw ); + +enum RNSVGTextPathSide RNSVGTextPathSideFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathSpacing) { + RNSVGTextPathSpacingAutoSpacing, + RNSVGTextPathSpacingExact, + RNSVGTextPathSpacingDEFAULT = RNSVGTextPathSpacingAutoSpacing, +}; + +static NSString* const RNSVGTextPathSpacingStrings[] = {@"auto", @"exact", nil}; + +NSString* RNSVGTextPathSpacingToString( enum RNSVGTextPathSpacing fw ); + +enum RNSVGTextPathSpacing RNSVGTextPathSpacingFromString( NSString* s ); + +#endif diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUnits.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUnits.h new file mode 100644 index 0000000..0592bc5 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUnits.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGUnits) { + kRNSVGUnitsObjectBoundingBox, + kRNSVGUnitsUserSpaceOnUse +}; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUse.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUse.h new file mode 100644 index 0000000..6d0f3dd --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUse.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderable.h" +#import "RNSVGLength.h" + +/** + * RNSVG defination are implemented as abstract UIViews for all elements inside Defs. + */ + +@interface RNSVGUse : RNSVGRenderable + +@property (nonatomic, strong) NSString *href; +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *usewidth; +@property (nonatomic, strong) RNSVGLength *useheight; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUseManager.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUseManager.h new file mode 100644 index 0000000..aa6bc34 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGUseManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGUseManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGVBMOS.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGVBMOS.h new file mode 100644 index 0000000..24c404a --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGVBMOS.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGVBMOS) { + kRNSVGVBMOSMeet, + kRNSVGVBMOSSlice, + kRNSVGVBMOSNone +}; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGVectorEffect.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGVectorEffect.h new file mode 100644 index 0000000..0ab1703 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGVectorEffect.h @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2015-present, react-native-community. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGVectorEffect) { + kRNSVGVectorEffectDefault, + kRNSVGVectorEffectNonScalingStroke, + kRNSVGVectorEffectInherit, + kRNSVGVectorEffectUri +}; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGViewBox.h b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGViewBox.h new file mode 100644 index 0000000..746ae79 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64/Headers/RNSVGViewBox.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGVBMOS.h" + +@interface RNSVGViewBox : NSObject + ++ (CGAffineTransform)getTransform:(CGRect)vbRect eRect:(CGRect)eRect align:(NSString *)align meetOrSlice:(RNSVGVBMOS)meetOrSlice; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64/libRNSVG.a b/Frameworks/RNSVG.xcframework/ios-arm64/libRNSVG.a new file mode 100644 index 0000000..089bf81 Binary files /dev/null and b/Frameworks/RNSVG.xcframework/ios-arm64/libRNSVG.a differ diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+RNSVG.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+RNSVG.h new file mode 100644 index 0000000..4388e0c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+RNSVG.h @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RCTConvert+RNSVG.h" +#import +#import "RNSVGCGFCRule.h" +#import "RNSVGVBMOS.h" +#import "RNSVGUnits.h" +#import "RNSVGLength.h" +#import "RNSVGPathParser.h" + +@class RNSVGBrush; + +@interface RCTConvert (RNSVG) + ++ (RNSVGLength*)RNSVGLength:(id)json; ++ (NSArray*)RNSVGLengthArray:(id)json; ++ (RNSVGCGFCRule)RNSVGCGFCRule:(id)json; ++ (RNSVGVBMOS)RNSVGVBMOS:(id)json; ++ (RNSVGUnits)RNSVGUnits:(id)json; ++ (RNSVGBrush *)RNSVGBrush:(id)json; ++ (RNSVGPathParser *)RNSVGCGPath:(NSString *)d; ++ (CGRect)RNSVGCGRect:(id)json offset:(NSUInteger)offset; ++ (CGColorRef)RNSVGCGColor:(id)json offset:(NSUInteger)offset; ++ (CGGradientRef)RNSVGCGGradient:(id)json; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBezierElement.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBezierElement.h new file mode 100644 index 0000000..eefbbf1 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBezierElement.h @@ -0,0 +1,25 @@ +/* + + Erica Sadun, http://ericasadun.com + https://github.com/erica/iOS-Drawing/tree/master/C08/Quartz%20Book%20Pack/Bezier + */ + +#import +#import + +#define RNSVGNULLPOINT CGRectNull.origin + +@interface RNSVGBezierElement : NSObject + +// Element storage +@property (nonatomic, assign) CGPathElementType elementType; +@property (nonatomic, assign) CGPoint point; +@property (nonatomic, assign) CGPoint controlPoint1; +@property (nonatomic, assign) CGPoint controlPoint2; + +// Instance creation ++ (instancetype) elementWithPathElement: (CGPathElement) element; ++ (NSArray *) elementsFromCGPath:(CGPathRef)path; + +@end + diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBrush.h new file mode 100644 index 0000000..edf3fc4 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBrush.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGPainter.h" + +@interface RNSVGBrush : NSObject + +@property (nonatomic, strong) NSString* brushRef; + +/* @abstract */ +- (instancetype)initWithArray:(NSArray *)data; + +/** + * @abstract + * For certain brushes we can fast path a combined fill and stroke. + * For those brushes we override applyFillColor which sets the fill + * color to be used by those batch paints. Those return YES. + * We can't batch gradient painting in CoreGraphics, so those will + * return NO and paint gets called instead. + */ +- (BOOL)applyFillColor:(CGContextRef)context opacity:(CGFloat)opacity; + +- (BOOL)applyStrokeColor:(CGContextRef)context opacity:(CGFloat)opacity; + +- (CGColorRef)getColorWithOpacity:(CGFloat)opacity; + +/** + * @abstract + * paint fills the context with a brush. The context is assumed to + * be clipped. + */ +- (void)paint:(CGContextRef)context opacity:(CGFloat)opacity painter:(RNSVGPainter *)painter bounds:(CGRect)bounds; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBrushType.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBrushType.h new file mode 100644 index 0000000..3cc4a30 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGBrushType.h @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef enum { + kRNSVGUndefinedType, + kRNSVGLinearGradient, + kRNSVGRadialGradient, + kRNSVGPattern +} RNSVGBrushType; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCGFCRule.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCGFCRule.h new file mode 100644 index 0000000..160b0ef --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCGFCRule.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGCGFCRule) { + kRNSVGCGFCRuleEvenodd, + kRNSVGCGFCRuleNonzero +}; \ No newline at end of file diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCircle.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCircle.h new file mode 100644 index 0000000..f4e411a --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCircle.h @@ -0,0 +1,20 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGCircle : RNSVGRenderable + +@property (nonatomic, strong) RNSVGLength* cx; +@property (nonatomic, strong) RNSVGLength* cy; +@property (nonatomic, strong) RNSVGLength* r; + +@end + diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCircleManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCircleManager.h new file mode 100644 index 0000000..30b6c1c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGCircleManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGCircleManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGClipPath.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGClipPath.h new file mode 100644 index 0000000..27697e2 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGClipPath.h @@ -0,0 +1,19 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGContainer.h" +#import "RNSVGGroup.h" +#import "RNSVGSvgView.h" + +@interface RNSVGClipPath : RNSVGGroup + +- (BOOL)isSimpleClipPath; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGClipPathManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGClipPathManager.h new file mode 100644 index 0000000..111c7e4 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGClipPathManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGClipPathManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGContainer.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGContainer.h new file mode 100644 index 0000000..4d16332 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGContainer.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RNSVGContainer + +// This is used as a hook for child to mark it's parent as dirty. +// This bubbles up to the root which gets marked as dirty. +- (void)invalidate; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGContextBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGContextBrush.h new file mode 100644 index 0000000..269f46c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGContextBrush.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, react-native-community. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGBrush.h" + +@interface RNSVGContextBrush : RNSVGBrush + +- (instancetype)initFill; +- (instancetype)initStroke; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGDefs.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGDefs.h new file mode 100644 index 0000000..9e58b40 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGDefs.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" + +/** + * RNSVG defination are implemented as abstract UIViews for all elements inside Defs. + */ + +@interface RNSVGDefs : RNSVGNode + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGDefsManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGDefsManager.h new file mode 100644 index 0000000..591ba68 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGDefsManager.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNSVGDefsManager : RCTViewManager + +@end + +#import "RNSVGNode.h" diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGEllipse.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGEllipse.h new file mode 100644 index 0000000..8ca56cc --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGEllipse.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGEllipse : RNSVGRenderable +@property (nonatomic, strong) RNSVGLength* cx; +@property (nonatomic, strong) RNSVGLength* cy; +@property (nonatomic, strong) RNSVGLength* rx; +@property (nonatomic, strong) RNSVGLength* ry; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGEllipseManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGEllipseManager.h new file mode 100644 index 0000000..3f6c001 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGEllipseManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGEllipseManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGFontData.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGFontData.h new file mode 100644 index 0000000..a988ca4 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGFontData.h @@ -0,0 +1,36 @@ +#import +#import + +#import "RNSVGTextProperties.h" +#import "RNSVGPropHelper.h" + +@interface RNSVGFontData : NSObject { +@public + CGFloat fontSize; + NSString * fontSize_; + NSString *fontFamily; + enum RNSVGFontStyle fontStyle; + NSDictionary * fontData; + enum RNSVGFontWeight fontWeight; + int absoluteFontWeight; + NSString *fontFeatureSettings; + enum RNSVGFontVariantLigatures fontVariantLigatures; + enum RNSVGTextAnchor textAnchor; + enum RNSVGTextDecoration textDecoration; + CGFloat kerning; + CGFloat wordSpacing; + CGFloat letterSpacing; + bool manualKerning; +} + ++ (instancetype)Defaults; + ++ (CGFloat)toAbsoluteWithNSString:(NSString *)string + fontSize:(CGFloat)fontSize; + ++ (instancetype)initWithNSDictionary:(NSDictionary *)font + parent:(RNSVGFontData *)parent; + +@end + +#define RNSVGFontData_DEFAULT_FONT_SIZE 12.0 diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGForeignObject.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGForeignObject.h new file mode 100644 index 0000000..346b204 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGForeignObject.h @@ -0,0 +1,12 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" + +@interface RNSVGForeignObject : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *foreignObjectwidth; +@property (nonatomic, strong) RNSVGLength *foreignObjectheight; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGForeignObjectManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGForeignObjectManager.h new file mode 100644 index 0000000..845a6db --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGForeignObjectManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGForeignObjectManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGlyphContext.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGlyphContext.h new file mode 100644 index 0000000..de49110 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGlyphContext.h @@ -0,0 +1,49 @@ +#import +#import +#import "RNSVGFontData.h" + +@class RNSVGText; +@class RNSVGGroup; +@class RNSVGGlyphContext; + +@interface RNSVGGlyphContext : NSObject + +- (CTFontRef)getGlyphFont; + +- (instancetype)initWithWidth:(CGFloat)width + height:(CGFloat)height; + +- (RNSVGFontData *)getFont; + +- (CGFloat)getFontSize; + +- (CGFloat)getHeight; + +- (CGFloat)getWidth; + +- (CGFloat)nextDeltaX; + +- (CGFloat)nextDeltaY; + +- (CGFloat)nextRotation; + +- (CGFloat)nextXWithDouble:(CGFloat)advance; + +- (CGFloat)nextY; + +- (void)popContext; + +- (void)pushContext:(RNSVGText*)node + font:(NSDictionary*)font + x:(NSArray*)x + y:(NSArray*)y + deltaX:(NSArray*)deltaX + deltaY:(NSArray*)deltaY + rotate:(NSArray*)rotate; + +- (void)pushContext:(RNSVGGroup*)node + font:(NSDictionary *)font; + +- (NSArray*)getFontContext; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGroup.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGroup.h new file mode 100644 index 0000000..4402014 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGroup.h @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGContainer.h" +#import "RNSVGCGFCRule.h" +#import "RNSVGSvgView.h" +#import "RNSVGPath.h" +#import "RNSVGGlyphContext.h" + +@interface RNSVGGroup : RNSVGPath + +@property (nonatomic, strong) NSDictionary *font; + +- (void)renderPathTo:(CGContextRef)context rect:(CGRect)rect; +- (void)renderGroupTo:(CGContextRef)context rect:(CGRect)rect; + +- (RNSVGGlyphContext *)getGlyphContext; +- (void)pushGlyphContext; +- (void)popGlyphContext; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGroupManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGroupManager.h new file mode 100644 index 0000000..84f7c82 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGGroupManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGGroupManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGImage.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGImage.h new file mode 100644 index 0000000..dc7e78d --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGImage.h @@ -0,0 +1,27 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import "RNSVGRenderable.h" +#import "RNSVGVBMOS.h" +#import "RNSVGLength.h" + +@interface RNSVGImage : RNSVGRenderable + +@property (nonatomic, weak) RCTBridge *bridge; +@property (nonatomic, assign) id src; +@property (nonatomic, strong) RNSVGLength* x; +@property (nonatomic, strong) RNSVGLength* y; +@property (nonatomic, strong) RNSVGLength* imagewidth; +@property (nonatomic, strong) RNSVGLength* imageheight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGImageManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGImageManager.h new file mode 100644 index 0000000..c799d3e --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGImageManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGImageManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLength.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLength.h new file mode 100644 index 0000000..ba7fb09 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLength.h @@ -0,0 +1,32 @@ +#import + +#ifndef RNSVGLength_h +#define RNSVGLength_h + +// https://www.w3.org/TR/SVG/types.html#InterfaceSVGLength +typedef CF_ENUM(unsigned short, RNSVGLengthUnitType) { + SVG_LENGTHTYPE_UNKNOWN, + SVG_LENGTHTYPE_NUMBER, + SVG_LENGTHTYPE_PERCENTAGE, + SVG_LENGTHTYPE_EMS, + SVG_LENGTHTYPE_EXS, + SVG_LENGTHTYPE_PX, + SVG_LENGTHTYPE_CM, + SVG_LENGTHTYPE_MM, + SVG_LENGTHTYPE_IN, + SVG_LENGTHTYPE_PT, + SVG_LENGTHTYPE_PC, +}; + +@interface RNSVGLength : NSObject + +@property (nonatomic, assign) CGFloat value; +@property (nonatomic, assign) RNSVGLengthUnitType unit; + ++ (instancetype) lengthWithNumber: (CGFloat) number; ++ (instancetype) lengthWithString: (NSString *) lengthString; +- (BOOL) isEqualTo: (RNSVGLength *)other; + +@end + +#endif /* RNSVGLength_h */ diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLine.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLine.h new file mode 100644 index 0000000..1183902 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLine.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGLine : RNSVGRenderable +@property (nonatomic, strong) RNSVGLength* x1; +@property (nonatomic, strong) RNSVGLength* y1; +@property (nonatomic, strong) RNSVGLength* x2; +@property (nonatomic, strong) RNSVGLength* y2; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLineManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLineManager.h new file mode 100644 index 0000000..51ed2f2 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLineManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGLineManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLinearGradient.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLinearGradient.h new file mode 100644 index 0000000..30e577a --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLinearGradient.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" +#import "RNSVGLength.h" + +@interface RNSVGLinearGradient : RNSVGNode + +@property (nonatomic, strong) RNSVGLength *x1; +@property (nonatomic, strong) RNSVGLength *y1; +@property (nonatomic, strong) RNSVGLength *x2; +@property (nonatomic, strong) RNSVGLength *y2; +@property (nonatomic, copy) NSArray *gradient; +@property (nonatomic, assign) RNSVGUnits gradientUnits; +@property (nonatomic, assign) CGAffineTransform gradientTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLinearGradientManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLinearGradientManager.h new file mode 100644 index 0000000..4927884 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGLinearGradientManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGLinearGradientManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarker.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarker.h new file mode 100644 index 0000000..a0744b9 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarker.h @@ -0,0 +1,24 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" +#import "RNSVGMarkerPosition.h" + +@interface RNSVGMarker : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *refX; +@property (nonatomic, strong) RNSVGLength *refY; +@property (nonatomic, strong) RNSVGLength *markerWidth; +@property (nonatomic, strong) RNSVGLength *markerHeight; +@property (nonatomic, strong) NSString *markerUnits; +@property (nonatomic, strong) NSString *orient; + +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +- (void)renderMarker:(CGContextRef)context rect:(CGRect)rect position:(RNSVGMarkerPosition*)position strokeWidth:(CGFloat)strokeWidth; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarkerManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarkerManager.h new file mode 100644 index 0000000..da10481 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarkerManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGMarkerManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarkerPosition.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarkerPosition.h new file mode 100644 index 0000000..bf7b3c0 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMarkerPosition.h @@ -0,0 +1,25 @@ + +#import +#import + +typedef enum RNSVGMarkerType { + kStartMarker, + kMidMarker, + kEndMarker +} RNSVGMarkerType; + +#define RNSVGZEROPOINT CGRectZero.origin + +@interface RNSVGMarkerPosition : NSObject + +// Element storage +@property (nonatomic, assign) RNSVGMarkerType type; +@property (nonatomic, assign) CGPoint origin; +@property (nonatomic, assign) float angle; + +// Instance creation ++ (instancetype) markerPosition:(RNSVGMarkerType)type origin:(CGPoint)origin angle:(float)angle; + ++ (NSArray*) fromCGPath:(CGPathRef)path; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMask.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMask.h new file mode 100644 index 0000000..a710c76 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMask.h @@ -0,0 +1,15 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" + +@interface RNSVGMask : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *maskwidth; +@property (nonatomic, strong) RNSVGLength *maskheight; +@property (nonatomic, assign) RNSVGUnits maskUnits; +@property (nonatomic, assign) RNSVGUnits maskContentUnits; +@property (nonatomic, assign) CGAffineTransform maskTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMaskManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMaskManager.h new file mode 100644 index 0000000..bb5fa53 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGMaskManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGMaskManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGNode.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGNode.h new file mode 100644 index 0000000..81513b3 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGNode.h @@ -0,0 +1,141 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGCGFCRule.h" +#import "RNSVGSvgView.h" +@class RNSVGGroup; + +/** + * RNSVG nodes are implemented as base UIViews. They should be implementation for all basic + *interfaces for all non-definition nodes. + */ + +@interface RNSVGNode : UIView + +/* + N[1/Sqrt[2], 36] + The inverse of the square root of 2. + Provide enough digits for the 128-bit IEEE quad (36 significant digits). + */ +extern CGFloat const RNSVG_M_SQRT1_2l; +extern CGFloat const RNSVG_DEFAULT_FONT_SIZE; + +@property (nonatomic, strong) NSString *name; +@property (nonatomic, strong) NSString *display; +@property (nonatomic, assign) CGFloat opacity; +@property (nonatomic, assign) RNSVGCGFCRule clipRule; +@property (nonatomic, strong) NSString *clipPath; +@property (nonatomic, strong) NSString *mask; +@property (nonatomic, strong) NSString *markerStart; +@property (nonatomic, strong) NSString *markerMid; +@property (nonatomic, strong) NSString *markerEnd; + +/** + * Used to control how touch events are processed. + */ +@property (nonatomic, assign) RCTPointerEvents pointerEvents; +@property (nonatomic, assign) BOOL responsible; + +@property (nonatomic, assign) CGAffineTransform ctm; +@property (nonatomic, assign) CGAffineTransform screenCTM; +@property (nonatomic, assign) CGAffineTransform matrix; +@property (nonatomic, assign) CGAffineTransform transforms; +@property (nonatomic, assign) CGAffineTransform invmatrix; +@property (nonatomic, assign) CGAffineTransform invTransform; +@property (nonatomic, assign) BOOL active; +@property (nonatomic, assign) BOOL dirty; +@property (nonatomic, assign) BOOL merging; +@property (nonatomic, assign) BOOL skip; +@property (nonatomic, assign) CGPathRef path; +@property (nonatomic, assign) CGPathRef strokePath; +@property (nonatomic, assign) CGPathRef markerPath; +@property (nonatomic, assign) CGRect clientRect; +@property (nonatomic, assign) CGRect pathBounds; +@property (nonatomic, assign) CGRect fillBounds; +@property (nonatomic, assign) CGRect strokeBounds; +@property (nonatomic, assign) CGRect markerBounds; +@property (nonatomic, copy) RCTDirectEventBlock onLayout; + + +/** + * RNSVGSvgView which ownes current RNSVGNode + */ +@property (nonatomic, readonly, weak) RNSVGSvgView *svgView; +@property (nonatomic, readonly, weak) RNSVGGroup *textRoot; + +- (void)invalidate; + +- (RNSVGGroup *)getParentTextRoot; + +- (void)renderTo:(CGContextRef)context rect:(CGRect)rect; + +/** + * @abstract + * renderTo will take opacity into account and draw renderLayerTo off-screen if there is opacity + * specified, then composite that onto the context. renderLayerTo always draws at opacity=1. + */ +- (void)renderLayerTo:(CGContextRef)context rect:(CGRect)rect; + +/** + * get clipPath from cache + */ +- (CGPathRef)getClipPath; + +/** + * get clipPath through context + */ +- (CGPathRef)getClipPath:(CGContextRef)context; + +/** + * clip node by clipPath + */ +- (void)clip:(CGContextRef)context; + +/** + * getPath will return the path inside node as a ClipPath. + */ +- (CGPathRef)getPath:(CGContextRef) context; + +- (CGFloat)relativeOnWidthString:(NSString *)length; + +- (CGFloat)relativeOnHeightString:(NSString *)length; + +- (CGFloat)relativeOnOtherString:(NSString *)length; + +- (CGFloat)relativeOn:(RNSVGLength *)length relative:(CGFloat)relative; + +- (CGFloat)relativeOnWidth:(RNSVGLength *)length; + +- (CGFloat)relativeOnHeight:(RNSVGLength *)length; + +- (CGFloat)relativeOnOther:(RNSVGLength *)length; + +- (CGFloat)getFontSizeFromContext; + +- (CGFloat)getContextWidth; + +- (CGFloat)getContextHeight; + +/** + * save element`s reference into svg element. + */ +- (void)parseReference; + +- (void)beginTransparencyLayer:(CGContextRef)context; + +- (void)endTransparencyLayer:(CGContextRef)context; + +- (void)traverseSubviews:(BOOL (^)(__kindof UIView *node))block; + +- (void)clearChildCache; + +- (void)clearPath; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGNodeManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGNodeManager.h new file mode 100644 index 0000000..2075bf6 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGNodeManager.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" +#import + +@interface RNSVGNodeManager : RCTViewManager + +- (RNSVGNode *)node; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPainter.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPainter.h new file mode 100644 index 0000000..f7e7385 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPainter.h @@ -0,0 +1,39 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTConvert+RNSVG.h" +#import "RNSVGBrushType.h" +#import "RNSVGUnits.h" +#import "RNSVGLength.h" + +@class RNSVGPattern; + +@interface RNSVGPainter : NSObject + +@property (nonatomic, assign) RNSVGPattern* pattern; +@property (nonatomic, assign) CGRect paintBounds; +@property (nonatomic, assign) bool useObjectBoundingBoxForContentUnits; +@property (nonatomic, assign) CGRect bounds; + +- (instancetype)initWithPointsArray:(NSArray *)pointsArray NS_DESIGNATED_INITIALIZER; + +- (void)paint:(CGContextRef)context bounds:(CGRect)bounds; + +- (void)setUnits:(RNSVGUnits)unit; + +- (void)setContentUnits:(RNSVGUnits)unit; + +- (void)setUserSpaceBoundingBox:(CGRect)userSpaceBoundingBox; + +- (void)setTransform:(CGAffineTransform)transform; + +- (void)setLinearGradientColors:(NSArray *)colors; + +- (void)setRadialGradientColors:(NSArray *)colors; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPainterBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPainterBrush.h new file mode 100644 index 0000000..e075d58 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPainterBrush.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGBrush.h" + +@interface RNSVGPainterBrush : RNSVGBrush + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPath.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPath.h new file mode 100644 index 0000000..2caf060 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPath.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGPathParser.h" +#import "RNSVGRenderable.h" + +@interface RNSVGPath : RNSVGRenderable + +@property (nonatomic, strong) RNSVGPathParser *d; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathManager.h new file mode 100644 index 0000000..4b13dff --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGPathManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathMeasure.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathMeasure.h new file mode 100644 index 0000000..42b16fd --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathMeasure.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2015-present, react-native-community. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNSVGPathMeasure : NSObject + +@property CGFloat pathLength; +@property CGPathRef path; +@property NSMutableArray *lengths; +@property NSMutableArray *lines; +@property NSUInteger lineCount; +@property BOOL isClosed; + +- (void)reset; +- (void)extractPathData:(CGPathRef)path; +- (void)getPosAndTan:(CGFloat *)angle midPoint:(CGFloat)midPoint x:(CGFloat *)x y:(CGFloat *)y; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathParser.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathParser.h new file mode 100644 index 0000000..5ea68b8 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPathParser.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + + +#import + +@interface RNSVGPathParser : NSObject + +- (instancetype) initWithPathString:(NSString *)d; +- (CGPathRef)getPath; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPattern.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPattern.h new file mode 100644 index 0000000..87f5290 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPattern.h @@ -0,0 +1,22 @@ + +#import "RNSVGGroup.h" +#import "RNSVGLength.h" + +@interface RNSVGPattern : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *patternwidth; +@property (nonatomic, strong) RNSVGLength *patternheight; +@property (nonatomic, assign) RNSVGUnits patternUnits; +@property (nonatomic, assign) RNSVGUnits patternContentUnits; +@property (nonatomic, assign) CGAffineTransform patternTransform; + +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPatternManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPatternManager.h new file mode 100644 index 0000000..05d546b --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPatternManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroupManager.h" + +@interface RNSVGPatternManager : RNSVGGroupManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPropHelper.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPropHelper.h new file mode 100644 index 0000000..ce89239 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGPropHelper.h @@ -0,0 +1,22 @@ +#import +#import +#import "RNSVGLength.h" + +#ifndef RNSVGPropHelper_h +#define RNSVGPropHelper_h + +@interface RNSVGPropHelper : NSObject + ++ (CGFloat) fromRelativeWithNSString:(NSString *)length + relative:(CGFloat)relative + fontSize:(CGFloat)fontSize; + ++ (CGFloat) fromRelative:(RNSVGLength*)length + relative:(CGFloat)relative + fontSize:(CGFloat)fontSize; + ++ (CGFloat)fromRelative:(RNSVGLength*)length + relative:(CGFloat)relative; +@end + +#endif diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRadialGradient.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRadialGradient.h new file mode 100644 index 0000000..deb8e03 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRadialGradient.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNode.h" +#import "RNSVGLength.h" + +@interface RNSVGRadialGradient : RNSVGNode + +@property (nonatomic, strong) RNSVGLength *fx; +@property (nonatomic, strong) RNSVGLength *fy; +@property (nonatomic, strong) RNSVGLength *rx; +@property (nonatomic, strong) RNSVGLength *ry; +@property (nonatomic, strong) RNSVGLength *cx; +@property (nonatomic, strong) RNSVGLength *cy; +@property (nonatomic, copy) NSArray *gradient; +@property (nonatomic, assign) RNSVGUnits gradientUnits; +@property (nonatomic, assign) CGAffineTransform gradientTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRadialGradientManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRadialGradientManager.h new file mode 100644 index 0000000..60c6055 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRadialGradientManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGRadialGradientManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRect.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRect.h new file mode 100644 index 0000000..04eea2c --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRect.h @@ -0,0 +1,22 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGPath.h" + +@interface RNSVGRect : RNSVGRenderable + +@property (nonatomic, strong) RNSVGLength* x; +@property (nonatomic, strong) RNSVGLength* y; +@property (nonatomic, strong) RNSVGLength* rectwidth; +@property (nonatomic, strong) RNSVGLength* rectheight; +@property (nonatomic, strong) RNSVGLength* rx; +@property (nonatomic, strong) RNSVGLength* ry; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRectManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRectManager.h new file mode 100644 index 0000000..fd16811 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRectManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGRectManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRenderable.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRenderable.h new file mode 100644 index 0000000..7ae0489 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRenderable.h @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RNSVGBrush.h" +#import "RNSVGCGFCRule.h" +#import "RNSVGNode.h" +#import "RNSVGLength.h" +#import "RNSVGVectorEffect.h" + +@interface RNSVGRenderable : RNSVGNode + +@property (class) RNSVGRenderable *contextElement; +@property (nonatomic, strong) RNSVGBrush *fill; +@property (nonatomic, assign) CGFloat fillOpacity; +@property (nonatomic, assign) RNSVGCGFCRule fillRule; +@property (nonatomic, strong) RNSVGBrush *stroke; +@property (nonatomic, assign) CGFloat strokeOpacity; +@property (nonatomic, strong) RNSVGLength *strokeWidth; +@property (nonatomic, assign) CGLineCap strokeLinecap; +@property (nonatomic, assign) CGLineJoin strokeLinejoin; +@property (nonatomic, assign) CGFloat strokeMiterlimit; +@property (nonatomic, strong) NSArray *strokeDasharray; +@property (nonatomic, assign) CGFloat strokeDashoffset; +@property (nonatomic, assign) RNSVGVectorEffect vectorEffect; +@property (nonatomic, copy) NSArray *propList; +@property (nonatomic, assign) CGPathRef hitArea; + +- (void)setHitArea:(CGPathRef)path; + +- (NSArray *)getAttributeList; + +- (void)mergeProperties:(__kindof RNSVGRenderable *)target; + +- (void)resetProperties; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRenderableManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRenderableManager.h new file mode 100644 index 0000000..1a9eea7 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGRenderableManager.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" +#import "RNSVGRenderable.h" + +@interface RNSVGRenderableManager : RNSVGNodeManager + +- (RNSVGRenderable *)node; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSolidColorBrush.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSolidColorBrush.h new file mode 100644 index 0000000..6e12929 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSolidColorBrush.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGBrush.h" + +@interface RNSVGSolidColorBrush : RNSVGBrush + +- (instancetype)initWithNumber:(NSNumber *)number; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSvgView.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSvgView.h new file mode 100644 index 0000000..6510e1b --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSvgView.h @@ -0,0 +1,70 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGPainter.h" +#import "RNSVGContainer.h" +#import "RNSVGVBMOS.h" + +@class RNSVGNode; + +@interface RNSVGSvgView : UIView + +@property (nonatomic, strong) RNSVGLength *bbWidth; +@property (nonatomic, strong) RNSVGLength *bbHeight; +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; +@property (nonatomic, assign) BOOL responsible; +@property (nonatomic, assign) BOOL active; +@property (nonatomic, assign) CGRect boundingBox; +@property (nonatomic, assign) CGAffineTransform initialCTM; +@property (nonatomic, assign) CGAffineTransform invInitialCTM; +@property (nonatomic, assign) CGAffineTransform viewBoxTransform; + + + +/** + * define content as clipPath template. + */ +- (void)defineClipPath:(__kindof RNSVGNode *)clipPath clipPathName:(NSString *)clipPathName; + +- (RNSVGNode *)getDefinedClipPath:(NSString *)clipPathName; + +- (void)defineTemplate:(__kindof RNSVGNode *)template templateName:(NSString *)templateName; + +- (RNSVGNode *)getDefinedTemplate:(NSString *)templateName; + +- (void)definePainter:(RNSVGPainter *)painter painterName:(NSString *)painterName; + +- (RNSVGPainter *)getDefinedPainter:(NSString *)painterName; + +- (void)defineMarker:(RNSVGNode *)marker markerName:(NSString *)markerName; + +- (RNSVGNode *)getDefinedMarker:(NSString *)markerName; + +- (void)defineMask:(RNSVGNode *)mask maskName:(NSString *)maskName; + +- (RNSVGNode *)getDefinedMask:(NSString *)maskName; + +- (NSString *)getDataURL; + +- (NSString *)getDataURLwithBounds:(CGRect)bounds; + +- (CGRect)getContextBounds; + +- (void)drawRect:(CGRect)rect; + +- (void)drawToContext:(CGContextRef)context withRect:(CGRect)rect; + +- (CGAffineTransform)getViewBoxTransform; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSvgViewManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSvgViewManager.h new file mode 100644 index 0000000..adbb664 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSvgViewManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNSVGSvgViewManager : RCTViewManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSymbol.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSymbol.h new file mode 100644 index 0000000..b9297b2 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSymbol.h @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGGroup.h" + +/** + * RNSVG defination are implemented as abstract UIViews for all elements inside Defs. + */ + +@interface RNSVGSymbol : RNSVGGroup + +@property (nonatomic, assign) CGFloat minX; +@property (nonatomic, assign) CGFloat minY; +@property (nonatomic, assign) CGFloat vbWidth; +@property (nonatomic, assign) CGFloat vbHeight; +@property (nonatomic, strong) NSString *align; +@property (nonatomic, assign) RNSVGVBMOS meetOrSlice; + +- (void)renderSymbolTo:(CGContextRef)context width:(CGFloat)width height:(CGFloat)height; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSymbolManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSymbolManager.h new file mode 100644 index 0000000..6001344 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGSymbolManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGNodeManager.h" + +@interface RNSVGSymbolManager : RNSVGNodeManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTSpan.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTSpan.h new file mode 100644 index 0000000..9b7509f --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTSpan.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ +#import +#import +#import +#import "RNSVGText.h" + +@interface RNSVGTSpan : RNSVGText + +@property (nonatomic, strong) NSString *content; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTSpanManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTSpanManager.h new file mode 100644 index 0000000..fa4c5f0 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTSpanManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGTextManager.h" + +@interface RNSVGTSpanManager : RNSVGTextManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGText.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGText.h new file mode 100644 index 0000000..71ec946 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGText.h @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGGroup.h" + +@interface RNSVGText : RNSVGGroup + +@property (nonatomic, strong) RNSVGLength *inlineSize; +@property (nonatomic, strong) RNSVGLength *textLength; +@property (nonatomic, strong) NSString *baselineShift; +@property (nonatomic, strong) NSString *lengthAdjust; +@property (nonatomic, strong) NSString *alignmentBaseline; +@property (nonatomic, strong) NSArray *deltaX; +@property (nonatomic, strong) NSArray *deltaY; +@property (nonatomic, strong) NSArray *positionX; +@property (nonatomic, strong) NSArray *positionY; +@property (nonatomic, strong) NSArray *rotate; + +- (CGPathRef)getGroupPath:(CGContextRef)context; +- (CTFontRef)getFontFromContext; +- (CGFloat)getSubtreeTextChunksTotalAdvance; +- (RNSVGText*)getTextAnchorRoot; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextManager.h new file mode 100644 index 0000000..1885846 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGTextManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextPath.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextPath.h new file mode 100644 index 0000000..820f575 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextPath.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import "RNSVGText.h" +#import "RNSVGLength.h" + +@interface RNSVGTextPath : RNSVGText + +@property (nonatomic, strong) NSString *href; +@property (nonatomic, strong) NSString *side; +@property (nonatomic, strong) NSString *method; +@property (nonatomic, strong) NSString *midLine; +@property (nonatomic, strong) NSString *spacing; +@property (nonatomic, strong) RNSVGLength *startOffset; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextPathManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextPathManager.h new file mode 100644 index 0000000..165db27 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextPathManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGTextManager.h" + +@interface RNSVGTextPathManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextProperties.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextProperties.h new file mode 100644 index 0000000..527ce3f --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGTextProperties.h @@ -0,0 +1,217 @@ +#import + +#ifndef RNTextProperties_h +#define RNTextProperties_h + +typedef NS_ENUM(NSInteger, RNSVGAlignmentBaseline) { + RNSVGAlignmentBaselineBaseline, + RNSVGAlignmentBaselineTextBottom, + RNSVGAlignmentBaselineAlphabetic, + RNSVGAlignmentBaselineIdeographic, + RNSVGAlignmentBaselineMiddle, + RNSVGAlignmentBaselineCentral, + RNSVGAlignmentBaselineMathematical, + RNSVGAlignmentBaselineTextTop, + RNSVGAlignmentBaselineBottom, + RNSVGAlignmentBaselineCenter, + RNSVGAlignmentBaselineTop, + /* + SVG implementations may support the following aliases in order to support legacy content: + + text-before-edge = text-top + text-after-edge = text-bottom + */ + RNSVGAlignmentBaselineTextBeforeEdge, + RNSVGAlignmentBaselineTextAfterEdge, + // SVG 1.1 + RNSVGAlignmentBaselineBeforeEdge, + RNSVGAlignmentBaselineAfterEdge, + RNSVGAlignmentBaselineHanging, + RNSVGAlignmentBaselineDEFAULT = RNSVGAlignmentBaselineBaseline +}; + +static NSString* const RNSVGAlignmentBaselineStrings[] = { + @"baseline", + @"text-bottom", + @"alphabetic", + @"ideographic", + @"middle", + @"central", + @"mathematical", + @"text-top", + @"bottom", + @"center", + @"top", + @"text-before-edge", + @"text-after-edge", + @"before-edge", + @"after-edge", + @"hanging", + @"central", + @"mathematical", + @"text-top", + @"bottom", + @"center", + @"top", + nil +}; + +NSString* RNSVGAlignmentBaselineToString( enum RNSVGAlignmentBaseline fw ); + +enum RNSVGAlignmentBaseline RNSVGAlignmentBaselineFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGFontStyle) { + RNSVGFontStyleNormal, + RNSVGFontStyleItalic, + RNSVGFontStyleOblique, + RNSVGFontStyleDEFAULT = RNSVGFontStyleNormal, +}; + +static NSString* const RNSVGFontStyleStrings[] = {@"normal", @"italic", @"oblique", nil}; + +NSString* RNSVGFontStyleToString( enum RNSVGFontStyle fw ); + +enum RNSVGFontStyle RNSVGFontStyleFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGFontVariantLigatures) { + RNSVGFontVariantLigaturesNormal, + RNSVGFontVariantLigaturesNone, + RNSVGFontVariantLigaturesDEFAULT = RNSVGFontVariantLigaturesNormal, +}; + +static NSString* const RNSVGFontVariantLigaturesStrings[] = {@"normal", @"none", nil}; + +NSString* RNSVGFontVariantLigaturesToString( enum RNSVGFontVariantLigatures fw ); + +enum RNSVGFontVariantLigatures RNSVGFontVariantLigaturesFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGFontWeight) { + // Absolute + RNSVGFontWeightNormal, + RNSVGFontWeightBold, + RNSVGFontWeight100, + RNSVGFontWeight200, + RNSVGFontWeight300, + RNSVGFontWeight400, + RNSVGFontWeight500, + RNSVGFontWeight600, + RNSVGFontWeight700, + RNSVGFontWeight800, + RNSVGFontWeight900, + // Relative + RNSVGFontWeightBolder, + RNSVGFontWeightLighter, + RNSVGFontWeightDEFAULT = RNSVGFontWeightNormal, +}; + +static NSString* const RNSVGFontWeightStrings[] = {@"normal", @"bold", @"100", @"200", @"300", @"400", @"500", @"600", @"700", @"800", @"900", @"bolder", @"lighter", nil}; + +static int const RNSVGAbsoluteFontWeights[] = {400, 700, 100, 200, 300, 400, 500, 600, 700, 800, 900}; + +static RNSVGFontWeight const RNSVGFontWeights[] = { + RNSVGFontWeight100, + RNSVGFontWeight100, + RNSVGFontWeight200, + RNSVGFontWeight300, + RNSVGFontWeightNormal, + RNSVGFontWeight500, + RNSVGFontWeight600, + RNSVGFontWeightBold, + RNSVGFontWeight800, + RNSVGFontWeight900, + RNSVGFontWeight900 +}; + +NSString* RNSVGFontWeightToString( enum RNSVGFontWeight fw ); + +enum RNSVGFontWeight RNSVGFontWeightFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextAnchor) { + RNSVGTextAnchorStart, + RNSVGTextAnchorMiddle, + RNSVGTextAnchorEnd, + RNSVGTextAnchorDEFAULT = RNSVGTextAnchorStart, +}; + +static NSString* const RNSVGTextAnchorStrings[] = {@"start", @"middle", @"end", nil}; + +NSString* RNSVGTextAnchorToString( enum RNSVGTextAnchor fw ); + +enum RNSVGTextAnchor RNSVGTextAnchorFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextDecoration) { + RNSVGTextDecorationNone, + RNSVGTextDecorationUnderline, + RNSVGTextDecorationOverline, + RNSVGTextDecorationLineThrough, + RNSVGTextDecorationBlink, + RNSVGTextDecorationDEFAULT = RNSVGTextDecorationNone, +}; + +static NSString* const RNSVGTextDecorationStrings[] = {@"None", @"Underline", @"Overline", @"LineThrough", @"Blink", nil}; + +NSString* RNSVGTextDecorationToString( enum RNSVGTextDecoration fw ); + +enum RNSVGTextDecoration RNSVGTextDecorationFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextLengthAdjust) { + RNSVGTextLengthAdjustSpacing, + RNSVGTextLengthAdjustSpacingAndGlyphs, + RNSVGTextLengthAdjustDEFAULT = RNSVGTextLengthAdjustSpacing, +}; + +static NSString* const RNSVGTextLengthAdjustStrings[] = {@"spacing", @"spacingAndGlyphs", nil}; + +NSString* RNSVGTextLengthAdjustToString( enum RNSVGTextLengthAdjust fw ); + +enum RNSVGTextLengthAdjust RNSVGTextLengthAdjustFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathMethod) { + RNSVGTextPathMethodAlign, + RNSVGTextPathMethodStretch, + RNSVGTextPathMethodDEFAULT = RNSVGTextPathMethodAlign, +}; + +static NSString* const RNSVGTextPathMethodStrings[] = {@"align", @"stretch", nil}; + +NSString* RNSVGTextPathMethodToString( enum RNSVGTextPathMethod fw ); + +enum RNSVGTextPathMethod RNSVGTextPathMethodFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathMidLine) { + RNSVGTextPathMidLineSharp, + RNSVGTextPathMidLineSmooth, + RNSVGTextPathMidLineDEFAULT = RNSVGTextPathMidLineSharp, +}; + +static NSString* const RNSVGTextPathMidLineStrings[] = {@"sharp", @"smooth", nil}; + +NSString* RNSVGTextPathMidLineToString( enum RNSVGTextPathMidLine fw ); + +enum RNSVGTextPathMidLine RNSVGTextPathMidLineFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathSide) { + RNSVGTextPathSideLeft, + RNSVGTextPathSideRight, + RNSVGTextPathSideDEFAULT = RNSVGTextPathSideLeft, +}; + +static NSString* const RNSVGTextPathSideStrings[] = {@"left", @"right", nil}; + +NSString* RNSVGTextPathSideToString( enum RNSVGTextPathSide fw ); + +enum RNSVGTextPathSide RNSVGTextPathSideFromString( NSString* s ); + +typedef NS_ENUM(NSInteger, RNSVGTextPathSpacing) { + RNSVGTextPathSpacingAutoSpacing, + RNSVGTextPathSpacingExact, + RNSVGTextPathSpacingDEFAULT = RNSVGTextPathSpacingAutoSpacing, +}; + +static NSString* const RNSVGTextPathSpacingStrings[] = {@"auto", @"exact", nil}; + +NSString* RNSVGTextPathSpacingToString( enum RNSVGTextPathSpacing fw ); + +enum RNSVGTextPathSpacing RNSVGTextPathSpacingFromString( NSString* s ); + +#endif diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUnits.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUnits.h new file mode 100644 index 0000000..0592bc5 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUnits.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGUnits) { + kRNSVGUnitsObjectBoundingBox, + kRNSVGUnitsUserSpaceOnUse +}; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUse.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUse.h new file mode 100644 index 0000000..6d0f3dd --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUse.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderable.h" +#import "RNSVGLength.h" + +/** + * RNSVG defination are implemented as abstract UIViews for all elements inside Defs. + */ + +@interface RNSVGUse : RNSVGRenderable + +@property (nonatomic, strong) NSString *href; +@property (nonatomic, strong) RNSVGLength *x; +@property (nonatomic, strong) RNSVGLength *y; +@property (nonatomic, strong) RNSVGLength *usewidth; +@property (nonatomic, strong) RNSVGLength *useheight; +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUseManager.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUseManager.h new file mode 100644 index 0000000..aa6bc34 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGUseManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RNSVGRenderableManager.h" + +@interface RNSVGUseManager : RNSVGRenderableManager + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGVBMOS.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGVBMOS.h new file mode 100644 index 0000000..24c404a --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGVBMOS.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGVBMOS) { + kRNSVGVBMOSMeet, + kRNSVGVBMOSSlice, + kRNSVGVBMOSNone +}; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGVectorEffect.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGVectorEffect.h new file mode 100644 index 0000000..0ab1703 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGVectorEffect.h @@ -0,0 +1,14 @@ +/** + * Copyright (c) 2015-present, react-native-community. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef CF_ENUM(int32_t, RNSVGVectorEffect) { + kRNSVGVectorEffectDefault, + kRNSVGVectorEffectNonScalingStroke, + kRNSVGVectorEffectInherit, + kRNSVGVectorEffectUri +}; diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGViewBox.h b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGViewBox.h new file mode 100644 index 0000000..746ae79 --- /dev/null +++ b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/Headers/RNSVGViewBox.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) 2015-present, Horcrux. + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNSVGVBMOS.h" + +@interface RNSVGViewBox : NSObject + ++ (CGAffineTransform)getTransform:(CGRect)vbRect eRect:(CGRect)eRect align:(NSString *)align meetOrSlice:(RNSVGVBMOS)meetOrSlice; + +@end diff --git a/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/libRNSVG.a b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/libRNSVG.a new file mode 100644 index 0000000..3802d07 Binary files /dev/null and b/Frameworks/RNSVG.xcframework/ios-arm64_x86_64-simulator/libRNSVG.a differ diff --git a/Frameworks/RNScreens.xcframework/Info.plist b/Frameworks/RNScreens.xcframework/Info.plist new file mode 100644 index 0000000..b966bb8 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNScreens.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNScreens.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNScreens.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNScreens.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSFullWindowOverlay.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSFullWindowOverlay.h new file mode 100644 index 0000000..3ed1743 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSFullWindowOverlay.h @@ -0,0 +1,15 @@ +#import +#import +#import + +@interface RNSFullWindowOverlayManager : RCTViewManager + +@end + +@interface RNSFullWindowOverlayContainer : UIView + +@end + +@interface RNSFullWindowOverlay : RCTView + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreen.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreen.h new file mode 100644 index 0000000..95353c0 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreen.h @@ -0,0 +1,126 @@ +#import +#import +#import + +#import "RNSScreenContainer.h" + +typedef NS_ENUM(NSInteger, RNSScreenStackPresentation) { + RNSScreenStackPresentationPush, + RNSScreenStackPresentationModal, + RNSScreenStackPresentationTransparentModal, + RNSScreenStackPresentationContainedModal, + RNSScreenStackPresentationContainedTransparentModal, + RNSScreenStackPresentationFullScreenModal, + RNSScreenStackPresentationFormSheet +}; + +typedef NS_ENUM(NSInteger, RNSScreenStackAnimation) { + RNSScreenStackAnimationDefault, + RNSScreenStackAnimationNone, + RNSScreenStackAnimationFade, + RNSScreenStackAnimationFadeFromBottom, + RNSScreenStackAnimationFlip, + RNSScreenStackAnimationSlideFromBottom, + RNSScreenStackAnimationSimplePush, +}; + +typedef NS_ENUM(NSInteger, RNSScreenReplaceAnimation) { + RNSScreenReplaceAnimationPop, + RNSScreenReplaceAnimationPush, +}; + +typedef NS_ENUM(NSInteger, RNSScreenSwipeDirection) { + RNSScreenSwipeDirectionHorizontal, + RNSScreenSwipeDirectionVertical, +}; + +typedef NS_ENUM(NSInteger, RNSActivityState) { + RNSActivityStateInactive = 0, + RNSActivityStateTransitioningOrBelowTop = 1, + RNSActivityStateOnTop = 2 +}; + +typedef NS_ENUM(NSInteger, RNSStatusBarStyle) { + RNSStatusBarStyleAuto, + RNSStatusBarStyleInverted, + RNSStatusBarStyleLight, + RNSStatusBarStyleDark, +}; + +typedef NS_ENUM(NSInteger, RNSWindowTrait) { + RNSWindowTraitStyle, + RNSWindowTraitAnimation, + RNSWindowTraitHidden, + RNSWindowTraitOrientation, + RNSWindowTraitHomeIndicatorHidden, +}; + +@interface RCTConvert (RNSScreen) + ++ (RNSScreenStackPresentation)RNSScreenStackPresentation:(id)json; ++ (RNSScreenStackAnimation)RNSScreenStackAnimation:(id)json; + +#if !TARGET_OS_TV ++ (RNSStatusBarStyle)RNSStatusBarStyle:(id)json; ++ (UIInterfaceOrientationMask)UIInterfaceOrientationMask:(id)json; +#endif + +@end + +@interface RNSScreen : UIViewController + +- (instancetype)initWithView:(UIView *)view; +- (void)notifyFinishTransitioning; +- (UIViewController *)findChildVCForConfigAndTrait:(RNSWindowTrait)trait includingModals:(BOOL)includingModals; + +@end + +@interface RNSScreenManager : RCTViewManager + +@end + +@interface RNSScreenView : RCTView + +@property (nonatomic, copy) RCTDirectEventBlock onAppear; +@property (nonatomic, copy) RCTDirectEventBlock onDisappear; +@property (nonatomic, copy) RCTDirectEventBlock onDismissed; +@property (nonatomic, copy) RCTDirectEventBlock onWillAppear; +@property (nonatomic, copy) RCTDirectEventBlock onWillDisappear; +@property (nonatomic, copy) RCTDirectEventBlock onNativeDismissCancelled; +@property (nonatomic, copy) RCTDirectEventBlock onTransitionProgress; + +@property (weak, nonatomic) UIView *reactSuperview; +@property (nonatomic, retain) UIViewController *controller; +@property (nonatomic, readonly) BOOL dismissed; +@property (nonatomic) int activityState; +@property (nonatomic) BOOL gestureEnabled; +@property (nonatomic) RNSScreenStackAnimation stackAnimation; +@property (nonatomic) RNSScreenStackPresentation stackPresentation; +@property (nonatomic) RNSScreenReplaceAnimation replaceAnimation; +@property (nonatomic) RNSScreenSwipeDirection swipeDirection; +@property (nonatomic) BOOL preventNativeDismiss; +@property (nonatomic) BOOL hasOrientationSet; +@property (nonatomic) BOOL hasStatusBarStyleSet; +@property (nonatomic) BOOL hasStatusBarAnimationSet; +@property (nonatomic) BOOL hasStatusBarHiddenSet; +@property (nonatomic) BOOL hasHomeIndicatorHiddenSet; +@property (nonatomic) BOOL customAnimationOnSwipe; +@property (nonatomic) BOOL fullScreenSwipeEnabled; +@property (nonatomic, retain) NSNumber *transitionDuration; + +#if !TARGET_OS_TV +@property (nonatomic) RNSStatusBarStyle statusBarStyle; +@property (nonatomic) UIStatusBarAnimation statusBarAnimation; +@property (nonatomic) BOOL statusBarHidden; +@property (nonatomic) UIInterfaceOrientationMask screenOrientation; +@property (nonatomic) BOOL homeIndicatorHidden; +#endif + +- (void)notifyFinishTransitioning; +- (void)notifyTransitionProgress:(double)progress closing:(BOOL)closing goingForward:(BOOL)goingForward; + +@end + +@interface UIView (RNSScreen) +- (UIViewController *)parentViewController; +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenComponentView.h new file mode 100644 index 0000000..4fd3044 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenComponentView.h @@ -0,0 +1,23 @@ +#import + +#import +#import "RNSScreenController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RNSScreenComponentView : RCTViewComponentView + +@property (weak, nonatomic) UIView *reactSuperview; +@property (weak, nonatomic) UIView *config; +@property (nonatomic, retain) RNSScreenController *controller; + +- (void)notifyWillAppear; +- (void)notifyWillDisappear; +- (void)notifyAppear; +- (void)notifyDisappear; +- (void)updateBounds; +- (void)notifyDismissedWithCount:(int)dismissCount; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenContainer.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenContainer.h new file mode 100644 index 0000000..0493e81 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenContainer.h @@ -0,0 +1,31 @@ +#import + +@protocol RNSScreenContainerDelegate + +- (void)markChildUpdated; +- (void)updateContainer; + +@end + +@protocol RNScreensViewControllerDelegate + +@end + +@interface RNScreensViewController : UIViewController + +- (UIViewController *)findActiveChildVC; + +@end + +@interface RNSScreenContainerManager : RCTViewManager + +@end + +@interface RNSScreenContainerView : UIView + +@property (nonatomic, retain) UIViewController *controller; +@property (nonatomic, retain) NSMutableArray *reactSubviews; + +- (void)maybeDismissVC; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenController.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenController.h new file mode 100644 index 0000000..889a493 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenController.h @@ -0,0 +1,10 @@ +#import + +@interface RNSScreenController : UIViewController + +- (instancetype)initWithView:(UIView *)view; +- (void)takeSnapshot; +- (void)setViewToSnapshot; +- (void)resetViewToScreen; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenNavigationContainer.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenNavigationContainer.h new file mode 100644 index 0000000..bec5abe --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenNavigationContainer.h @@ -0,0 +1,16 @@ +#import + +#import "RNSScreenContainer.h" +#import "RNSScreenStack.h" + +@interface RNScreensContainerNavigationController : RNScreensNavigationController + +@end + +@interface RNSScreenNavigationContainerView : RNSScreenContainerView + +@end + +@interface RNSScreenNavigationContainerManager : RNSScreenContainerManager + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStack.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStack.h new file mode 100644 index 0000000..a383cd2 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStack.h @@ -0,0 +1,21 @@ +#import +#import + +#import "RNSScreenContainer.h" + +@interface RNScreensNavigationController : UINavigationController + +@end + +@interface RNSScreenStackView : UIView + +@property (nonatomic, copy) RCTDirectEventBlock onFinishTransitioning; + +- (void)markChildUpdated; +- (void)didUpdateChildren; + +@end + +@interface RNSScreenStackManager : RCTViewManager + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackAnimator.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackAnimator.h new file mode 100644 index 0000000..f96eae7 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackAnimator.h @@ -0,0 +1,8 @@ +#import "RNSScreen.h" + +@interface RNSScreenStackAnimator : NSObject + +- (instancetype)initWithOperation:(UINavigationControllerOperation)operation; ++ (BOOL)isCustomAnimation:(RNSScreenStackAnimation)animation; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackComponentView.h new file mode 100644 index 0000000..e7b0f1a --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackComponentView.h @@ -0,0 +1,15 @@ +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNSScreenStackComponentView : RCTViewComponentView + +@end + +@interface RNSScreenStackView : UIView +- (instancetype)initWithComponentView:(RNSScreenStackComponentView *)component; +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderConfig.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderConfig.h new file mode 100644 index 0000000..d3d9832 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderConfig.h @@ -0,0 +1,68 @@ +#import +#import + +#import "RNSScreen.h" +#import "RNSSearchBar.h" + +@interface RNSScreenStackHeaderConfig : UIView + +@property (nonatomic, weak) RNSScreenView *screenView; + +@property (nonatomic, retain) NSString *title; +@property (nonatomic, retain) NSString *titleFontFamily; +@property (nonatomic, retain) NSNumber *titleFontSize; +@property (nonatomic, retain) NSString *titleFontWeight; +@property (nonatomic, retain) UIColor *titleColor; +@property (nonatomic, retain) NSString *backTitle; +@property (nonatomic, retain) NSString *backTitleFontFamily; +@property (nonatomic, retain) NSNumber *backTitleFontSize; +@property (nonatomic, retain) UIColor *backgroundColor; +@property (nonatomic) UIBlurEffectStyle blurEffect; +@property (nonatomic, retain) UIColor *color; +@property (nonatomic) BOOL hide; +@property (nonatomic) BOOL largeTitle; +@property (nonatomic, retain) NSString *largeTitleFontFamily; +@property (nonatomic, retain) NSNumber *largeTitleFontSize; +@property (nonatomic, retain) NSString *largeTitleFontWeight; +@property (nonatomic, retain) UIColor *largeTitleBackgroundColor; +@property (nonatomic) BOOL largeTitleHideShadow; +@property (nonatomic, retain) UIColor *largeTitleColor; +@property (nonatomic) BOOL hideBackButton; +@property (nonatomic) BOOL backButtonInCustomView; +@property (nonatomic) BOOL disableBackButtonMenu; +@property (nonatomic) BOOL hideShadow; +@property (nonatomic) BOOL translucent; +@property (nonatomic) UISemanticContentAttribute direction; + ++ (void)willShowViewController:(UIViewController *)vc + animated:(BOOL)animated + withConfig:(RNSScreenStackHeaderConfig *)config; + +@end + +@interface RNSScreenStackHeaderConfigManager : RCTViewManager + +@end + +typedef NS_ENUM(NSInteger, RNSScreenStackHeaderSubviewType) { + RNSScreenStackHeaderSubviewTypeBackButton, + RNSScreenStackHeaderSubviewTypeLeft, + RNSScreenStackHeaderSubviewTypeRight, + RNSScreenStackHeaderSubviewTypeTitle, + RNSScreenStackHeaderSubviewTypeCenter, + RNSScreenStackHeaderSubviewTypeSearchBar, +}; + +@interface RCTConvert (RNSScreenStackHeader) + ++ (RNSScreenStackHeaderSubviewType)RNSScreenStackHeaderSubviewType:(id)json; ++ (UIBlurEffectStyle)UIBlurEffectStyle:(id)json; ++ (UISemanticContentAttribute)UISemanticContentAttribute:(id)json; + +@end + +@interface RNSScreenStackHeaderSubviewManager : RCTViewManager + +@property (nonatomic) RNSScreenStackHeaderSubviewType type; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderConfigComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderConfigComponentView.h new file mode 100644 index 0000000..7fd944f --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderConfigComponentView.h @@ -0,0 +1,42 @@ +#import + +#import + +#import "RNSScreenComponentView.h" +#import "RNSScreenStackHeaderSubviewComponentView.h" + +@interface RNSScreenStackHeaderConfigComponentView : RCTViewComponentView + +@property (nonatomic, weak) RNSScreenComponentView *screenView; +@property (nonatomic) NSMutableArray *reactSubviews; + +// Properties from props +@property (nonatomic) BOOL show; +@property (nonatomic) BOOL translucent; +@property (nonatomic) BOOL hideShadow; +@property (nonatomic, retain) NSString *title; +@property (nonatomic, retain) NSString *titleFontFamily; +@property (nonatomic, retain) NSNumber *titleFontSize; +@property (nonatomic, retain) NSString *titleFontWeight; +@property (nonatomic, retain) UIColor *titleColor; +@property (nonatomic) BOOL largeTitle; +@property (nonatomic, retain) NSString *largeTitleFontFamily; +@property (nonatomic, retain) NSNumber *largeTitleFontSize; +@property (nonatomic, retain) NSString *largeTitleFontWeight; +@property (nonatomic, retain) UIColor *largeTitleBackgroundColor; +@property (nonatomic) BOOL largeTitleHideShadow; +@property (nonatomic, retain) UIColor *largeTitleColor; +@property (nonatomic, retain) UIColor *backgroundColor; +@property (nonatomic, retain) UIColor *color; +@property (nonatomic) UISemanticContentAttribute direction; +@property (nonatomic, retain) NSString *backTitle; +@property (nonatomic, retain) NSString *backTitleFontFamily; +@property (nonatomic, retain) NSNumber *backTitleFontSize; +@property (nonatomic) BOOL disableBackButtonMenu; +@property (nonatomic) BOOL hideBackButton; + ++ (void)willShowViewController:(UIViewController *)vc + animated:(BOOL)animated + withConfig:(RNSScreenStackHeaderConfigComponentView *)config; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderSubviewComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderSubviewComponentView.h new file mode 100644 index 0000000..eaaa920 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenStackHeaderSubviewComponentView.h @@ -0,0 +1,14 @@ +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNSScreenStackHeaderSubviewComponentView : RCTViewComponentView + +@property (nonatomic) facebook::react::RNSScreenStackHeaderSubviewType type; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenWindowTraits.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenWindowTraits.h new file mode 100644 index 0000000..1970b9d --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSScreenWindowTraits.h @@ -0,0 +1,26 @@ +#import "RNSScreen.h" + +@interface RNSScreenWindowTraits : NSObject + ++ (void)updateWindowTraits; + +#if !TARGET_OS_TV ++ (void)assertViewControllerBasedStatusBarAppearenceSet; +#endif ++ (void)updateStatusBarAppearance; ++ (void)enforceDesiredDeviceOrientation; ++ (void)updateHomeIndicatorAutoHidden; + +#if !TARGET_OS_TV ++ (UIStatusBarStyle)statusBarStyleForRNSStatusBarStyle:(RNSStatusBarStyle)statusBarStyle; ++ (UIInterfaceOrientation)defaultOrientationForOrientationMask:(UIInterfaceOrientationMask)orientationMask; ++ (UIInterfaceOrientation)interfaceOrientationFromDeviceOrientation:(UIDeviceOrientation)deviceOrientation; ++ (UIInterfaceOrientationMask)maskFromOrientation:(UIInterfaceOrientation)orientation; +#endif + ++ (BOOL)shouldAskScreensForTrait:(RNSWindowTrait)trait + includingModals:(BOOL)includingModals + inViewController:(UIViewController *)vc; ++ (BOOL)shouldAskScreensForScreenOrientationInViewController:(UIViewController *)vc; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSSearchBar.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSSearchBar.h new file mode 100644 index 0000000..bf6476e --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSSearchBar.h @@ -0,0 +1,22 @@ +#import + +#import +#import +#import + +@interface RNSSearchBar : UIView + +@property (nonatomic) BOOL hideWhenScrolling; + +@property (nonatomic, retain) UISearchController *controller; +@property (nonatomic, copy) RCTBubblingEventBlock onChangeText; +@property (nonatomic, copy) RCTBubblingEventBlock onCancelButtonPress; +@property (nonatomic, copy) RCTBubblingEventBlock onSearchButtonPress; +@property (nonatomic, copy) RCTBubblingEventBlock onFocus; +@property (nonatomic, copy) RCTBubblingEventBlock onBlur; + +@end + +@interface RNSSearchBarManager : RCTViewManager + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSUIBarButtonItem.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSUIBarButtonItem.h new file mode 100644 index 0000000..e35f290 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/RNSUIBarButtonItem.h @@ -0,0 +1,5 @@ +@interface RNSUIBarButtonItem : UIBarButtonItem + +@property (nonatomic) BOOL menuHidden; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/UIViewController+RNScreens.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/UIViewController+RNScreens.h new file mode 100644 index 0000000..4c1c2d0 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/UIViewController+RNScreens.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIViewController (RNScreens) + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/Headers/UIWindow+RNScreens.h b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/UIWindow+RNScreens.h new file mode 100644 index 0000000..77484b7 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64/Headers/UIWindow+RNScreens.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIWindow (RNScreens) + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64/libRNScreens.a b/Frameworks/RNScreens.xcframework/ios-arm64/libRNScreens.a new file mode 100644 index 0000000..c512319 Binary files /dev/null and b/Frameworks/RNScreens.xcframework/ios-arm64/libRNScreens.a differ diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSFullWindowOverlay.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSFullWindowOverlay.h new file mode 100644 index 0000000..3ed1743 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSFullWindowOverlay.h @@ -0,0 +1,15 @@ +#import +#import +#import + +@interface RNSFullWindowOverlayManager : RCTViewManager + +@end + +@interface RNSFullWindowOverlayContainer : UIView + +@end + +@interface RNSFullWindowOverlay : RCTView + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreen.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreen.h new file mode 100644 index 0000000..95353c0 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreen.h @@ -0,0 +1,126 @@ +#import +#import +#import + +#import "RNSScreenContainer.h" + +typedef NS_ENUM(NSInteger, RNSScreenStackPresentation) { + RNSScreenStackPresentationPush, + RNSScreenStackPresentationModal, + RNSScreenStackPresentationTransparentModal, + RNSScreenStackPresentationContainedModal, + RNSScreenStackPresentationContainedTransparentModal, + RNSScreenStackPresentationFullScreenModal, + RNSScreenStackPresentationFormSheet +}; + +typedef NS_ENUM(NSInteger, RNSScreenStackAnimation) { + RNSScreenStackAnimationDefault, + RNSScreenStackAnimationNone, + RNSScreenStackAnimationFade, + RNSScreenStackAnimationFadeFromBottom, + RNSScreenStackAnimationFlip, + RNSScreenStackAnimationSlideFromBottom, + RNSScreenStackAnimationSimplePush, +}; + +typedef NS_ENUM(NSInteger, RNSScreenReplaceAnimation) { + RNSScreenReplaceAnimationPop, + RNSScreenReplaceAnimationPush, +}; + +typedef NS_ENUM(NSInteger, RNSScreenSwipeDirection) { + RNSScreenSwipeDirectionHorizontal, + RNSScreenSwipeDirectionVertical, +}; + +typedef NS_ENUM(NSInteger, RNSActivityState) { + RNSActivityStateInactive = 0, + RNSActivityStateTransitioningOrBelowTop = 1, + RNSActivityStateOnTop = 2 +}; + +typedef NS_ENUM(NSInteger, RNSStatusBarStyle) { + RNSStatusBarStyleAuto, + RNSStatusBarStyleInverted, + RNSStatusBarStyleLight, + RNSStatusBarStyleDark, +}; + +typedef NS_ENUM(NSInteger, RNSWindowTrait) { + RNSWindowTraitStyle, + RNSWindowTraitAnimation, + RNSWindowTraitHidden, + RNSWindowTraitOrientation, + RNSWindowTraitHomeIndicatorHidden, +}; + +@interface RCTConvert (RNSScreen) + ++ (RNSScreenStackPresentation)RNSScreenStackPresentation:(id)json; ++ (RNSScreenStackAnimation)RNSScreenStackAnimation:(id)json; + +#if !TARGET_OS_TV ++ (RNSStatusBarStyle)RNSStatusBarStyle:(id)json; ++ (UIInterfaceOrientationMask)UIInterfaceOrientationMask:(id)json; +#endif + +@end + +@interface RNSScreen : UIViewController + +- (instancetype)initWithView:(UIView *)view; +- (void)notifyFinishTransitioning; +- (UIViewController *)findChildVCForConfigAndTrait:(RNSWindowTrait)trait includingModals:(BOOL)includingModals; + +@end + +@interface RNSScreenManager : RCTViewManager + +@end + +@interface RNSScreenView : RCTView + +@property (nonatomic, copy) RCTDirectEventBlock onAppear; +@property (nonatomic, copy) RCTDirectEventBlock onDisappear; +@property (nonatomic, copy) RCTDirectEventBlock onDismissed; +@property (nonatomic, copy) RCTDirectEventBlock onWillAppear; +@property (nonatomic, copy) RCTDirectEventBlock onWillDisappear; +@property (nonatomic, copy) RCTDirectEventBlock onNativeDismissCancelled; +@property (nonatomic, copy) RCTDirectEventBlock onTransitionProgress; + +@property (weak, nonatomic) UIView *reactSuperview; +@property (nonatomic, retain) UIViewController *controller; +@property (nonatomic, readonly) BOOL dismissed; +@property (nonatomic) int activityState; +@property (nonatomic) BOOL gestureEnabled; +@property (nonatomic) RNSScreenStackAnimation stackAnimation; +@property (nonatomic) RNSScreenStackPresentation stackPresentation; +@property (nonatomic) RNSScreenReplaceAnimation replaceAnimation; +@property (nonatomic) RNSScreenSwipeDirection swipeDirection; +@property (nonatomic) BOOL preventNativeDismiss; +@property (nonatomic) BOOL hasOrientationSet; +@property (nonatomic) BOOL hasStatusBarStyleSet; +@property (nonatomic) BOOL hasStatusBarAnimationSet; +@property (nonatomic) BOOL hasStatusBarHiddenSet; +@property (nonatomic) BOOL hasHomeIndicatorHiddenSet; +@property (nonatomic) BOOL customAnimationOnSwipe; +@property (nonatomic) BOOL fullScreenSwipeEnabled; +@property (nonatomic, retain) NSNumber *transitionDuration; + +#if !TARGET_OS_TV +@property (nonatomic) RNSStatusBarStyle statusBarStyle; +@property (nonatomic) UIStatusBarAnimation statusBarAnimation; +@property (nonatomic) BOOL statusBarHidden; +@property (nonatomic) UIInterfaceOrientationMask screenOrientation; +@property (nonatomic) BOOL homeIndicatorHidden; +#endif + +- (void)notifyFinishTransitioning; +- (void)notifyTransitionProgress:(double)progress closing:(BOOL)closing goingForward:(BOOL)goingForward; + +@end + +@interface UIView (RNSScreen) +- (UIViewController *)parentViewController; +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenComponentView.h new file mode 100644 index 0000000..4fd3044 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenComponentView.h @@ -0,0 +1,23 @@ +#import + +#import +#import "RNSScreenController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RNSScreenComponentView : RCTViewComponentView + +@property (weak, nonatomic) UIView *reactSuperview; +@property (weak, nonatomic) UIView *config; +@property (nonatomic, retain) RNSScreenController *controller; + +- (void)notifyWillAppear; +- (void)notifyWillDisappear; +- (void)notifyAppear; +- (void)notifyDisappear; +- (void)updateBounds; +- (void)notifyDismissedWithCount:(int)dismissCount; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenContainer.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenContainer.h new file mode 100644 index 0000000..0493e81 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenContainer.h @@ -0,0 +1,31 @@ +#import + +@protocol RNSScreenContainerDelegate + +- (void)markChildUpdated; +- (void)updateContainer; + +@end + +@protocol RNScreensViewControllerDelegate + +@end + +@interface RNScreensViewController : UIViewController + +- (UIViewController *)findActiveChildVC; + +@end + +@interface RNSScreenContainerManager : RCTViewManager + +@end + +@interface RNSScreenContainerView : UIView + +@property (nonatomic, retain) UIViewController *controller; +@property (nonatomic, retain) NSMutableArray *reactSubviews; + +- (void)maybeDismissVC; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenController.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenController.h new file mode 100644 index 0000000..889a493 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenController.h @@ -0,0 +1,10 @@ +#import + +@interface RNSScreenController : UIViewController + +- (instancetype)initWithView:(UIView *)view; +- (void)takeSnapshot; +- (void)setViewToSnapshot; +- (void)resetViewToScreen; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenNavigationContainer.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenNavigationContainer.h new file mode 100644 index 0000000..bec5abe --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenNavigationContainer.h @@ -0,0 +1,16 @@ +#import + +#import "RNSScreenContainer.h" +#import "RNSScreenStack.h" + +@interface RNScreensContainerNavigationController : RNScreensNavigationController + +@end + +@interface RNSScreenNavigationContainerView : RNSScreenContainerView + +@end + +@interface RNSScreenNavigationContainerManager : RNSScreenContainerManager + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStack.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStack.h new file mode 100644 index 0000000..a383cd2 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStack.h @@ -0,0 +1,21 @@ +#import +#import + +#import "RNSScreenContainer.h" + +@interface RNScreensNavigationController : UINavigationController + +@end + +@interface RNSScreenStackView : UIView + +@property (nonatomic, copy) RCTDirectEventBlock onFinishTransitioning; + +- (void)markChildUpdated; +- (void)didUpdateChildren; + +@end + +@interface RNSScreenStackManager : RCTViewManager + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackAnimator.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackAnimator.h new file mode 100644 index 0000000..f96eae7 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackAnimator.h @@ -0,0 +1,8 @@ +#import "RNSScreen.h" + +@interface RNSScreenStackAnimator : NSObject + +- (instancetype)initWithOperation:(UINavigationControllerOperation)operation; ++ (BOOL)isCustomAnimation:(RNSScreenStackAnimation)animation; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackComponentView.h new file mode 100644 index 0000000..e7b0f1a --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackComponentView.h @@ -0,0 +1,15 @@ +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNSScreenStackComponentView : RCTViewComponentView + +@end + +@interface RNSScreenStackView : UIView +- (instancetype)initWithComponentView:(RNSScreenStackComponentView *)component; +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderConfig.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderConfig.h new file mode 100644 index 0000000..d3d9832 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderConfig.h @@ -0,0 +1,68 @@ +#import +#import + +#import "RNSScreen.h" +#import "RNSSearchBar.h" + +@interface RNSScreenStackHeaderConfig : UIView + +@property (nonatomic, weak) RNSScreenView *screenView; + +@property (nonatomic, retain) NSString *title; +@property (nonatomic, retain) NSString *titleFontFamily; +@property (nonatomic, retain) NSNumber *titleFontSize; +@property (nonatomic, retain) NSString *titleFontWeight; +@property (nonatomic, retain) UIColor *titleColor; +@property (nonatomic, retain) NSString *backTitle; +@property (nonatomic, retain) NSString *backTitleFontFamily; +@property (nonatomic, retain) NSNumber *backTitleFontSize; +@property (nonatomic, retain) UIColor *backgroundColor; +@property (nonatomic) UIBlurEffectStyle blurEffect; +@property (nonatomic, retain) UIColor *color; +@property (nonatomic) BOOL hide; +@property (nonatomic) BOOL largeTitle; +@property (nonatomic, retain) NSString *largeTitleFontFamily; +@property (nonatomic, retain) NSNumber *largeTitleFontSize; +@property (nonatomic, retain) NSString *largeTitleFontWeight; +@property (nonatomic, retain) UIColor *largeTitleBackgroundColor; +@property (nonatomic) BOOL largeTitleHideShadow; +@property (nonatomic, retain) UIColor *largeTitleColor; +@property (nonatomic) BOOL hideBackButton; +@property (nonatomic) BOOL backButtonInCustomView; +@property (nonatomic) BOOL disableBackButtonMenu; +@property (nonatomic) BOOL hideShadow; +@property (nonatomic) BOOL translucent; +@property (nonatomic) UISemanticContentAttribute direction; + ++ (void)willShowViewController:(UIViewController *)vc + animated:(BOOL)animated + withConfig:(RNSScreenStackHeaderConfig *)config; + +@end + +@interface RNSScreenStackHeaderConfigManager : RCTViewManager + +@end + +typedef NS_ENUM(NSInteger, RNSScreenStackHeaderSubviewType) { + RNSScreenStackHeaderSubviewTypeBackButton, + RNSScreenStackHeaderSubviewTypeLeft, + RNSScreenStackHeaderSubviewTypeRight, + RNSScreenStackHeaderSubviewTypeTitle, + RNSScreenStackHeaderSubviewTypeCenter, + RNSScreenStackHeaderSubviewTypeSearchBar, +}; + +@interface RCTConvert (RNSScreenStackHeader) + ++ (RNSScreenStackHeaderSubviewType)RNSScreenStackHeaderSubviewType:(id)json; ++ (UIBlurEffectStyle)UIBlurEffectStyle:(id)json; ++ (UISemanticContentAttribute)UISemanticContentAttribute:(id)json; + +@end + +@interface RNSScreenStackHeaderSubviewManager : RCTViewManager + +@property (nonatomic) RNSScreenStackHeaderSubviewType type; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderConfigComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderConfigComponentView.h new file mode 100644 index 0000000..7fd944f --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderConfigComponentView.h @@ -0,0 +1,42 @@ +#import + +#import + +#import "RNSScreenComponentView.h" +#import "RNSScreenStackHeaderSubviewComponentView.h" + +@interface RNSScreenStackHeaderConfigComponentView : RCTViewComponentView + +@property (nonatomic, weak) RNSScreenComponentView *screenView; +@property (nonatomic) NSMutableArray *reactSubviews; + +// Properties from props +@property (nonatomic) BOOL show; +@property (nonatomic) BOOL translucent; +@property (nonatomic) BOOL hideShadow; +@property (nonatomic, retain) NSString *title; +@property (nonatomic, retain) NSString *titleFontFamily; +@property (nonatomic, retain) NSNumber *titleFontSize; +@property (nonatomic, retain) NSString *titleFontWeight; +@property (nonatomic, retain) UIColor *titleColor; +@property (nonatomic) BOOL largeTitle; +@property (nonatomic, retain) NSString *largeTitleFontFamily; +@property (nonatomic, retain) NSNumber *largeTitleFontSize; +@property (nonatomic, retain) NSString *largeTitleFontWeight; +@property (nonatomic, retain) UIColor *largeTitleBackgroundColor; +@property (nonatomic) BOOL largeTitleHideShadow; +@property (nonatomic, retain) UIColor *largeTitleColor; +@property (nonatomic, retain) UIColor *backgroundColor; +@property (nonatomic, retain) UIColor *color; +@property (nonatomic) UISemanticContentAttribute direction; +@property (nonatomic, retain) NSString *backTitle; +@property (nonatomic, retain) NSString *backTitleFontFamily; +@property (nonatomic, retain) NSNumber *backTitleFontSize; +@property (nonatomic) BOOL disableBackButtonMenu; +@property (nonatomic) BOOL hideBackButton; + ++ (void)willShowViewController:(UIViewController *)vc + animated:(BOOL)animated + withConfig:(RNSScreenStackHeaderConfigComponentView *)config; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderSubviewComponentView.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderSubviewComponentView.h new file mode 100644 index 0000000..eaaa920 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenStackHeaderSubviewComponentView.h @@ -0,0 +1,14 @@ +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNSScreenStackHeaderSubviewComponentView : RCTViewComponentView + +@property (nonatomic) facebook::react::RNSScreenStackHeaderSubviewType type; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenWindowTraits.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenWindowTraits.h new file mode 100644 index 0000000..1970b9d --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSScreenWindowTraits.h @@ -0,0 +1,26 @@ +#import "RNSScreen.h" + +@interface RNSScreenWindowTraits : NSObject + ++ (void)updateWindowTraits; + +#if !TARGET_OS_TV ++ (void)assertViewControllerBasedStatusBarAppearenceSet; +#endif ++ (void)updateStatusBarAppearance; ++ (void)enforceDesiredDeviceOrientation; ++ (void)updateHomeIndicatorAutoHidden; + +#if !TARGET_OS_TV ++ (UIStatusBarStyle)statusBarStyleForRNSStatusBarStyle:(RNSStatusBarStyle)statusBarStyle; ++ (UIInterfaceOrientation)defaultOrientationForOrientationMask:(UIInterfaceOrientationMask)orientationMask; ++ (UIInterfaceOrientation)interfaceOrientationFromDeviceOrientation:(UIDeviceOrientation)deviceOrientation; ++ (UIInterfaceOrientationMask)maskFromOrientation:(UIInterfaceOrientation)orientation; +#endif + ++ (BOOL)shouldAskScreensForTrait:(RNSWindowTrait)trait + includingModals:(BOOL)includingModals + inViewController:(UIViewController *)vc; ++ (BOOL)shouldAskScreensForScreenOrientationInViewController:(UIViewController *)vc; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSSearchBar.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSSearchBar.h new file mode 100644 index 0000000..bf6476e --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSSearchBar.h @@ -0,0 +1,22 @@ +#import + +#import +#import +#import + +@interface RNSSearchBar : UIView + +@property (nonatomic) BOOL hideWhenScrolling; + +@property (nonatomic, retain) UISearchController *controller; +@property (nonatomic, copy) RCTBubblingEventBlock onChangeText; +@property (nonatomic, copy) RCTBubblingEventBlock onCancelButtonPress; +@property (nonatomic, copy) RCTBubblingEventBlock onSearchButtonPress; +@property (nonatomic, copy) RCTBubblingEventBlock onFocus; +@property (nonatomic, copy) RCTBubblingEventBlock onBlur; + +@end + +@interface RNSSearchBarManager : RCTViewManager + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSUIBarButtonItem.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSUIBarButtonItem.h new file mode 100644 index 0000000..e35f290 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/RNSUIBarButtonItem.h @@ -0,0 +1,5 @@ +@interface RNSUIBarButtonItem : UIBarButtonItem + +@property (nonatomic) BOOL menuHidden; + +@end diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/UIViewController+RNScreens.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/UIViewController+RNScreens.h new file mode 100644 index 0000000..4c1c2d0 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/UIViewController+RNScreens.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIViewController (RNScreens) + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/UIWindow+RNScreens.h b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/UIWindow+RNScreens.h new file mode 100644 index 0000000..77484b7 --- /dev/null +++ b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/Headers/UIWindow+RNScreens.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIWindow (RNScreens) + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/libRNScreens.a b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/libRNScreens.a new file mode 100644 index 0000000..5d85202 Binary files /dev/null and b/Frameworks/RNScreens.xcframework/ios-arm64_x86_64-simulator/libRNScreens.a differ diff --git a/Frameworks/RNShare.xcframework/Info.plist b/Frameworks/RNShare.xcframework/Info.plist new file mode 100644 index 0000000..278a0fc --- /dev/null +++ b/Frameworks/RNShare.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNShare.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNShare.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNShare.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNShare.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/EmailShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/EmailShare.h new file mode 100644 index 0000000..5b54c08 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/EmailShare.h @@ -0,0 +1,25 @@ +// +// EmailShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// + + +#import +// import RCTConvertttt +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +#import +@interface EmailShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/FacebookStories.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/FacebookStories.h new file mode 100644 index 0000000..0e7dfc7 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/FacebookStories.h @@ -0,0 +1,24 @@ +// +// FacebookStories.h +// RNShare +// +// Created by Quynh Nguyen on 4/13/20. +// Link: https://github.com/Quynh-Nguyen +// Copyright © 2020 Facebook. All rights reserved. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface FacebookStories : NSObject + +- (void *) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/GenericShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/GenericShare.h new file mode 100644 index 0000000..98fa989 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/GenericShare.h @@ -0,0 +1,26 @@ +// +// GenericShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// + + +#import +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface GenericShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback serviceType:(NSString*)serviceType + inAppBaseUrl:(NSString *)inAppBaseUrl; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/GooglePlusShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/GooglePlusShare.h new file mode 100644 index 0000000..ffae815 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/GooglePlusShare.h @@ -0,0 +1,22 @@ +// +// GooglePlusShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface GooglePlusShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/InstagramShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/InstagramShare.h new file mode 100644 index 0000000..6ee51cb --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/InstagramShare.h @@ -0,0 +1,25 @@ +// +// InstagramShare.h +// RNShare +// +// Created by Ralf Nieuwenhuizen on 12-04-17. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface InstagramShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +- (void)shareSingleImage:(NSDictionary *)options + failureCallback:(RCTResponseErrorBlock)failureCallback + successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/InstagramStories.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/InstagramStories.h new file mode 100644 index 0000000..56757da --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/InstagramStories.h @@ -0,0 +1,23 @@ +// +// InstagramStories.h +// RNShare +// +// Created by Nikita Logachev on 13.02.2019. +// link: https://github.com/loga4 +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface InstagramStories : NSObject + +- (void *) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/MessengerShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/MessengerShare.h new file mode 100644 index 0000000..01aa7c0 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/MessengerShare.h @@ -0,0 +1,8 @@ +#import + +#import + +@interface MessengerShare : NSObject + +- (void)shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShare.h new file mode 100644 index 0000000..1b0ef16 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShare.h @@ -0,0 +1,7 @@ +@import UIKit; +// import RCTBridgeModule +#import + +@interface RNShare : NSObject + +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShareActivityItemSource.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShareActivityItemSource.h new file mode 100644 index 0000000..43c6c1c --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShareActivityItemSource.h @@ -0,0 +1,12 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNShareActivityItemSource : NSObject + +- (instancetype)initWithOptions:(NSDictionary *)options; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShareUtils.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShareUtils.h new file mode 100644 index 0000000..6475423 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/RNShareUtils.h @@ -0,0 +1,6 @@ +#import + +@interface RNShareUtils : NSObject ++(NSString*)getExtensionFromBase64:(NSString*)base64String; ++(NSURL*)getPathFromBase64:(NSString*)base64String with:(NSData*)data; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/TelegramShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/TelegramShare.h new file mode 100644 index 0000000..5533ad3 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/TelegramShare.h @@ -0,0 +1,23 @@ +// +// TelegranShare.h +// RNShare +// +// Created by Akinn Rosa on 07-27-21. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface TelegramShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; + +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/ViberShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/ViberShare.h new file mode 100644 index 0000000..c3bbcf3 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/ViberShare.h @@ -0,0 +1,21 @@ +// +// TelegranShare.h +// RNShare +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface ViberShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; + +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/Headers/WhatsAppShare.h b/Frameworks/RNShare.xcframework/ios-arm64/Headers/WhatsAppShare.h new file mode 100644 index 0000000..9c338f2 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64/Headers/WhatsAppShare.h @@ -0,0 +1,23 @@ +// +// WhatsAppShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface WhatsAppShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64/libRNShare.a b/Frameworks/RNShare.xcframework/ios-arm64/libRNShare.a new file mode 100644 index 0000000..0a962da Binary files /dev/null and b/Frameworks/RNShare.xcframework/ios-arm64/libRNShare.a differ diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/EmailShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/EmailShare.h new file mode 100644 index 0000000..5b54c08 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/EmailShare.h @@ -0,0 +1,25 @@ +// +// EmailShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// + + +#import +// import RCTConvertttt +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +#import +@interface EmailShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/FacebookStories.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/FacebookStories.h new file mode 100644 index 0000000..0e7dfc7 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/FacebookStories.h @@ -0,0 +1,24 @@ +// +// FacebookStories.h +// RNShare +// +// Created by Quynh Nguyen on 4/13/20. +// Link: https://github.com/Quynh-Nguyen +// Copyright © 2020 Facebook. All rights reserved. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface FacebookStories : NSObject + +- (void *) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/GenericShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/GenericShare.h new file mode 100644 index 0000000..98fa989 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/GenericShare.h @@ -0,0 +1,26 @@ +// +// GenericShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// + + +#import +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface GenericShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback serviceType:(NSString*)serviceType + inAppBaseUrl:(NSString *)inAppBaseUrl; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/GooglePlusShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/GooglePlusShare.h new file mode 100644 index 0000000..ffae815 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/GooglePlusShare.h @@ -0,0 +1,22 @@ +// +// GooglePlusShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface GooglePlusShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/InstagramShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/InstagramShare.h new file mode 100644 index 0000000..6ee51cb --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/InstagramShare.h @@ -0,0 +1,25 @@ +// +// InstagramShare.h +// RNShare +// +// Created by Ralf Nieuwenhuizen on 12-04-17. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface InstagramShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +- (void)shareSingleImage:(NSDictionary *)options + failureCallback:(RCTResponseErrorBlock)failureCallback + successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/InstagramStories.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/InstagramStories.h new file mode 100644 index 0000000..56757da --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/InstagramStories.h @@ -0,0 +1,23 @@ +// +// InstagramStories.h +// RNShare +// +// Created by Nikita Logachev on 13.02.2019. +// link: https://github.com/loga4 +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface InstagramStories : NSObject + +- (void *) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/MessengerShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/MessengerShare.h new file mode 100644 index 0000000..01aa7c0 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/MessengerShare.h @@ -0,0 +1,8 @@ +#import + +#import + +@interface MessengerShare : NSObject + +- (void)shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShare.h new file mode 100644 index 0000000..1b0ef16 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShare.h @@ -0,0 +1,7 @@ +@import UIKit; +// import RCTBridgeModule +#import + +@interface RNShare : NSObject + +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShareActivityItemSource.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShareActivityItemSource.h new file mode 100644 index 0000000..43c6c1c --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShareActivityItemSource.h @@ -0,0 +1,12 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNShareActivityItemSource : NSObject + +- (instancetype)initWithOptions:(NSDictionary *)options; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShareUtils.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShareUtils.h new file mode 100644 index 0000000..6475423 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/RNShareUtils.h @@ -0,0 +1,6 @@ +#import + +@interface RNShareUtils : NSObject ++(NSString*)getExtensionFromBase64:(NSString*)base64String; ++(NSURL*)getPathFromBase64:(NSString*)base64String with:(NSData*)data; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/TelegramShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/TelegramShare.h new file mode 100644 index 0000000..5533ad3 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/TelegramShare.h @@ -0,0 +1,23 @@ +// +// TelegranShare.h +// RNShare +// +// Created by Akinn Rosa on 07-27-21. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface TelegramShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; + +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/ViberShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/ViberShare.h new file mode 100644 index 0000000..c3bbcf3 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/ViberShare.h @@ -0,0 +1,21 @@ +// +// TelegranShare.h +// RNShare +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface ViberShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; + +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/WhatsAppShare.h b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/WhatsAppShare.h new file mode 100644 index 0000000..9c338f2 --- /dev/null +++ b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/Headers/WhatsAppShare.h @@ -0,0 +1,23 @@ +// +// WhatsAppShare.h +// RNShare +// +// Created by Diseño Uno BBCL on 23-07-16. +// Copyright © 2016 Facebook. All rights reserved. +// + +#import +// import RCTConvert +#import +// import RCTBridge +#import +// import RCTUIManager +#import +// import RCTLog +#import +// import RCTUtils +#import +@interface WhatsAppShare : NSObject + +- (void) shareSingle:(NSDictionary *)options failureCallback:(RCTResponseErrorBlock)failureCallback successCallback:(RCTResponseSenderBlock)successCallback; +@end diff --git a/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/libRNShare.a b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/libRNShare.a new file mode 100644 index 0000000..9d0eb0d Binary files /dev/null and b/Frameworks/RNShare.xcframework/ios-arm64_x86_64-simulator/libRNShare.a differ diff --git a/Frameworks/RNTextSize.xcframework/Info.plist b/Frameworks/RNTextSize.xcframework/Info.plist new file mode 100644 index 0000000..413fc65 --- /dev/null +++ b/Frameworks/RNTextSize.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNTextSize.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNTextSize.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNTextSize.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNTextSize.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNTextSize.xcframework/ios-arm64/Headers/RNTextSize.h b/Frameworks/RNTextSize.xcframework/ios-arm64/Headers/RNTextSize.h new file mode 100644 index 0000000..f07d337 --- /dev/null +++ b/Frameworks/RNTextSize.xcframework/ios-arm64/Headers/RNTextSize.h @@ -0,0 +1,10 @@ +#if __has_include() +#import +#import +#else +#import "React/RCTBridgeModule.h" +#import "React/RCTAccessibilityManager.h" +#endif + +@interface RNTextSize : NSObject +@end diff --git a/Frameworks/RNTextSize.xcframework/ios-arm64/libRNTextSize.a b/Frameworks/RNTextSize.xcframework/ios-arm64/libRNTextSize.a new file mode 100644 index 0000000..42554f8 Binary files /dev/null and b/Frameworks/RNTextSize.xcframework/ios-arm64/libRNTextSize.a differ diff --git a/Frameworks/RNTextSize.xcframework/ios-arm64_x86_64-simulator/Headers/RNTextSize.h b/Frameworks/RNTextSize.xcframework/ios-arm64_x86_64-simulator/Headers/RNTextSize.h new file mode 100644 index 0000000..f07d337 --- /dev/null +++ b/Frameworks/RNTextSize.xcframework/ios-arm64_x86_64-simulator/Headers/RNTextSize.h @@ -0,0 +1,10 @@ +#if __has_include() +#import +#import +#else +#import "React/RCTBridgeModule.h" +#import "React/RCTAccessibilityManager.h" +#endif + +@interface RNTextSize : NSObject +@end diff --git a/Frameworks/RNTextSize.xcframework/ios-arm64_x86_64-simulator/libRNTextSize.a b/Frameworks/RNTextSize.xcframework/ios-arm64_x86_64-simulator/libRNTextSize.a new file mode 100644 index 0000000..150c105 Binary files /dev/null and b/Frameworks/RNTextSize.xcframework/ios-arm64_x86_64-simulator/libRNTextSize.a differ diff --git a/Frameworks/RNVectorIcons.xcframework/Info.plist b/Frameworks/RNVectorIcons.xcframework/Info.plist new file mode 100644 index 0000000..1567cf0 --- /dev/null +++ b/Frameworks/RNVectorIcons.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNVectorIcons.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNVectorIcons.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libRNVectorIcons.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNVectorIcons.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNVectorIcons.xcframework/ios-arm64/Headers/RNVectorIconsManager.h b/Frameworks/RNVectorIcons.xcframework/ios-arm64/Headers/RNVectorIconsManager.h new file mode 100644 index 0000000..45b5411 --- /dev/null +++ b/Frameworks/RNVectorIcons.xcframework/ios-arm64/Headers/RNVectorIconsManager.h @@ -0,0 +1,37 @@ +// +// RNVectorIconsManager.h +// RNVectorIconsManager +// +// Created by Joel Arvidsson on 2015-05-29. +// Copyright (c) 2015 Joel Arvidsson. All rights reserved. +// + +#if __has_include() +#import +#else // Compatibility for RN version < 0.40 +#import "RCTBridgeModule.h" +#endif +#if __has_include() +#import +#else // Compatibility for RN version < 0.40 +#import "RCTLog.h" +#endif + +FOUNDATION_EXPORT NSString *const RNVIErrorDomain; + +enum { + RNVIGenericError = 1000, +}; + +@interface RNVectorIconsManager : NSObject + +- (NSString *)hexStringFromColor:(UIColor *)color; +- (NSString *)generateFilePath:(NSString *)glyph withFontName:(NSString *)fontName + withFontSize:(CGFloat)fontSize + withColor:(UIColor *)color + withExtraIdentifier:(NSString *)identifier; +- (BOOL)createAndSaveGlyphImage:(NSString *)glyph withFont:(UIFont *)font + withFilePath:(NSString *)filePath + withColor:(UIColor *)color; + +@end diff --git a/Frameworks/RNVectorIcons.xcframework/ios-arm64/libRNVectorIcons.a b/Frameworks/RNVectorIcons.xcframework/ios-arm64/libRNVectorIcons.a new file mode 100644 index 0000000..8146f11 Binary files /dev/null and b/Frameworks/RNVectorIcons.xcframework/ios-arm64/libRNVectorIcons.a differ diff --git a/Frameworks/RNVectorIcons.xcframework/ios-arm64_x86_64-simulator/Headers/RNVectorIconsManager.h b/Frameworks/RNVectorIcons.xcframework/ios-arm64_x86_64-simulator/Headers/RNVectorIconsManager.h new file mode 100644 index 0000000..45b5411 --- /dev/null +++ b/Frameworks/RNVectorIcons.xcframework/ios-arm64_x86_64-simulator/Headers/RNVectorIconsManager.h @@ -0,0 +1,37 @@ +// +// RNVectorIconsManager.h +// RNVectorIconsManager +// +// Created by Joel Arvidsson on 2015-05-29. +// Copyright (c) 2015 Joel Arvidsson. All rights reserved. +// + +#if __has_include() +#import +#else // Compatibility for RN version < 0.40 +#import "RCTBridgeModule.h" +#endif +#if __has_include() +#import +#else // Compatibility for RN version < 0.40 +#import "RCTLog.h" +#endif + +FOUNDATION_EXPORT NSString *const RNVIErrorDomain; + +enum { + RNVIGenericError = 1000, +}; + +@interface RNVectorIconsManager : NSObject + +- (NSString *)hexStringFromColor:(UIColor *)color; +- (NSString *)generateFilePath:(NSString *)glyph withFontName:(NSString *)fontName + withFontSize:(CGFloat)fontSize + withColor:(UIColor *)color + withExtraIdentifier:(NSString *)identifier; +- (BOOL)createAndSaveGlyphImage:(NSString *)glyph withFont:(UIFont *)font + withFilePath:(NSString *)filePath + withColor:(UIColor *)color; + +@end diff --git a/Frameworks/RNVectorIcons.xcframework/ios-arm64_x86_64-simulator/libRNVectorIcons.a b/Frameworks/RNVectorIcons.xcframework/ios-arm64_x86_64-simulator/libRNVectorIcons.a new file mode 100644 index 0000000..36e6022 Binary files /dev/null and b/Frameworks/RNVectorIcons.xcframework/ios-arm64_x86_64-simulator/libRNVectorIcons.a differ diff --git a/Frameworks/RNVolumeController.xcframework/Info.plist b/Frameworks/RNVolumeController.xcframework/Info.plist new file mode 100644 index 0000000..aee0e85 --- /dev/null +++ b/Frameworks/RNVolumeController.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libRNVolumeController.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libRNVolumeController.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libRNVolumeController.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libRNVolumeController.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/RNVolumeController.xcframework/ios-arm64/Headers/RNVolumeControl.h b/Frameworks/RNVolumeController.xcframework/ios-arm64/Headers/RNVolumeControl.h new file mode 100644 index 0000000..28c57e8 --- /dev/null +++ b/Frameworks/RNVolumeController.xcframework/ios-arm64/Headers/RNVolumeControl.h @@ -0,0 +1,14 @@ +// ReactNativeVolumeController +// +// Created by Tyler Malone on 03/18/19 +// Copyright © 2019. All rights reserved. +// + +#import +#import + +@interface RNVolumeControl : RCTEventEmitter + +- (void)initVolumeView; +- (void)setVolume:(float)volumeValue; +@end diff --git a/Frameworks/RNVolumeController.xcframework/ios-arm64/libRNVolumeController.a b/Frameworks/RNVolumeController.xcframework/ios-arm64/libRNVolumeController.a new file mode 100644 index 0000000..2ea9fb3 Binary files /dev/null and b/Frameworks/RNVolumeController.xcframework/ios-arm64/libRNVolumeController.a differ diff --git a/Frameworks/RNVolumeController.xcframework/ios-arm64_x86_64-simulator/Headers/RNVolumeControl.h b/Frameworks/RNVolumeController.xcframework/ios-arm64_x86_64-simulator/Headers/RNVolumeControl.h new file mode 100644 index 0000000..28c57e8 --- /dev/null +++ b/Frameworks/RNVolumeController.xcframework/ios-arm64_x86_64-simulator/Headers/RNVolumeControl.h @@ -0,0 +1,14 @@ +// ReactNativeVolumeController +// +// Created by Tyler Malone on 03/18/19 +// Copyright © 2019. All rights reserved. +// + +#import +#import + +@interface RNVolumeControl : RCTEventEmitter + +- (void)initVolumeView; +- (void)setVolume:(float)volumeValue; +@end diff --git a/Frameworks/RNVolumeController.xcframework/ios-arm64_x86_64-simulator/libRNVolumeController.a b/Frameworks/RNVolumeController.xcframework/ios-arm64_x86_64-simulator/libRNVolumeController.a new file mode 100644 index 0000000..5c431f5 Binary files /dev/null and b/Frameworks/RNVolumeController.xcframework/ios-arm64_x86_64-simulator/libRNVolumeController.a differ diff --git a/Frameworks/React-Core.xcframework/Info.plist b/Frameworks/React-Core.xcframework/Info.plist new file mode 100644 index 0000000..e129825 --- /dev/null +++ b/Frameworks/React-Core.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-Core.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-Core.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-Core.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-Core.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/CoreModulesPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/CoreModulesPlugins.h new file mode 100644 index 0000000..0dd2130 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/CoreModulesPlugins.h @@ -0,0 +1,64 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBCoreModulesPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTCoreModulesClassProvider(const char *name); + +// Lookup functions +Class RCTAccessibilityManagerCls(void) __attribute__((used)); +Class RCTAppearanceCls(void) __attribute__((used)); +Class RCTDeviceInfoCls(void) __attribute__((used)); +Class RCTExceptionsManagerCls(void) __attribute__((used)); +Class RCTPlatformCls(void) __attribute__((used)); +Class RCTClipboardCls(void) __attribute__((used)); +Class RCTI18nManagerCls(void) __attribute__((used)); +Class RCTSourceCodeCls(void) __attribute__((used)); +Class RCTActionSheetManagerCls(void) __attribute__((used)); +Class RCTAlertManagerCls(void) __attribute__((used)); +Class RCTAsyncLocalStorageCls(void) __attribute__((used)); +Class RCTTimingCls(void) __attribute__((used)); +Class RCTStatusBarManagerCls(void) __attribute__((used)); +Class RCTKeyboardObserverCls(void) __attribute__((used)); +Class RCTAppStateCls(void) __attribute__((used)); +Class RCTPerfMonitorCls(void) __attribute__((used)); +Class RCTDevMenuCls(void) __attribute__((used)); +Class RCTDevSettingsCls(void) __attribute__((used)); +Class RCTRedBoxCls(void) __attribute__((used)); +Class RCTLogBoxCls(void) __attribute__((used)); +Class RCTWebSocketExecutorCls(void) __attribute__((used)); +Class RCTWebSocketModuleCls(void) __attribute__((used)); +Class RCTDevLoadingViewCls(void) __attribute__((used)); +Class RCTDevSplitBundleLoaderCls(void) __attribute__((used)); +Class RCTEventDispatcherCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/NSTextStorage+FontScaling.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/NSTextStorage+FontScaling.h new file mode 100644 index 0000000..61b1634 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/NSTextStorage+FontScaling.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface NSTextStorage (FontScaling) + +- (void)scaleFontSizeToFitSize:(CGSize)size + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +- (void)scaleFontSizeWithRatio:(CGFloat)ratio + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAccessibilityManager+Internal.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAccessibilityManager+Internal.h new file mode 100644 index 0000000..e01e800 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAccessibilityManager+Internal.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAccessibilityManager.h" + +#import + +NS_ASSUME_NONNULL_BEGIN + +RCT_EXTERN_C_BEGIN + +// Only to be used for testing and internal tooling. Do not use this in +// production. +void RCTAccessibilityManagerSetIsVoiceOverEnabled( + RCTAccessibilityManager *accessibiltyManager, + BOOL isVoiceOverEnabled); + +RCT_EXTERN_C_END + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAccessibilityManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAccessibilityManager.h new file mode 100644 index 0000000..7b5a132 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAccessibilityManager.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; // posted when multiplier is changed + +@interface RCTAccessibilityManager : NSObject + +@property (nonatomic, readonly) CGFloat multiplier; + +/// map from UIKit categories to multipliers +@property (nonatomic, copy) NSDictionary *multipliers; + +@property (nonatomic, assign) BOOL isBoldTextEnabled; +@property (nonatomic, assign) BOOL isGrayscaleEnabled; +@property (nonatomic, assign) BOOL isInvertColorsEnabled; +@property (nonatomic, assign) BOOL isReduceMotionEnabled; +@property (nonatomic, assign) BOOL isReduceTransparencyEnabled; +@property (nonatomic, assign) BOOL isVoiceOverEnabled; + +@end + +@interface RCTBridge (RCTAccessibilityManager) + +@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActionSheetManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActionSheetManager.h new file mode 100644 index 0000000..858afcf --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActionSheetManager.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTActionSheetManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActivityIndicatorView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActivityIndicatorView.h new file mode 100644 index 0000000..62d5f32 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActivityIndicatorView.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTActivityIndicatorView : UIActivityIndicatorView +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActivityIndicatorViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActivityIndicatorViewManager.h new file mode 100644 index 0000000..61bbd72 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTActivityIndicatorViewManager.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTConvert (UIActivityIndicatorView) + ++ (UIActivityIndicatorViewStyle)UIActivityIndicatorViewStyle:(id)json; + +@end + +@interface RCTActivityIndicatorViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAdditionAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAdditionAnimatedNode.h new file mode 100644 index 0000000..50f3bc1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAdditionAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTAdditionAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAlertController.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAlertController.h new file mode 100644 index 0000000..f5c206c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAlertController.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTAlertController : UIAlertController + +- (void)show:(BOOL)animated completion:(void (^)(void))completion; +- (void)hide; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAlertManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAlertManager.h new file mode 100644 index 0000000..8ea1d9b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAlertManager.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef NS_ENUM(NSInteger, RCTAlertViewStyle) { + RCTAlertViewStyleDefault = 0, + RCTAlertViewStyleSecureTextInput, + RCTAlertViewStylePlainTextInput, + RCTAlertViewStyleLoginAndPasswordInput +}; + +@interface RCTAlertManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimatedImage.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimatedImage.h new file mode 100644 index 0000000..933a492 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimatedImage.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTAnimatedImage +@property (nonatomic, assign, readonly) NSUInteger animatedImageFrameCount; +@property (nonatomic, assign, readonly) NSUInteger animatedImageLoopCount; + +- (nullable UIImage *)animatedImageFrameAtIndex:(NSUInteger)index; +- (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index; + +@end + +@interface RCTAnimatedImage : UIImage + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimatedNode.h new file mode 100644 index 0000000..24c0fb3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimatedNode.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTNativeAnimatedNodesManager; + +@interface RCTAnimatedNode : NSObject + +- (instancetype)initWithTag:(NSNumber *)tag + config:(NSDictionary *)config NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, readonly) NSNumber *nodeTag; +@property (nonatomic, weak) RCTNativeAnimatedNodesManager *manager; +@property (nonatomic, copy, readonly) NSDictionary *config; + +@property (nonatomic, copy, readonly) NSMapTable *childNodes; +@property (nonatomic, copy, readonly) NSMapTable *parentNodes; + +@property (nonatomic, readonly) BOOL needsUpdate; + +-(BOOL)isManagedByFabric; + +/** + * Marks a node and its children as needing update. + */ +- (void)setNeedsUpdate NS_REQUIRES_SUPER; + +/** + * The node will update its value if necessary and only after its parents have updated. + */ +- (void)updateNodeIfNecessary NS_REQUIRES_SUPER; + +/** + * Where the actual update code lives. Called internally from updateNodeIfNecessary + */ +- (void)performUpdate NS_REQUIRES_SUPER; + +- (void)addChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER; +- (void)removeChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER; + +- (void)onAttachedToNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER; +- (void)onDetachedFromNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER; + +- (void)detachNode NS_REQUIRES_SUPER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationDriver.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationDriver.h new file mode 100644 index 0000000..256464b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationDriver.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +static CGFloat RCTSingleFrameInterval = (CGFloat)(1.0 / 60.0); + +@class RCTValueAnimatedNode; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTAnimationDriver + +@property (nonatomic, readonly) NSNumber *animationId; +@property (nonatomic, readonly) RCTValueAnimatedNode *valueNode; +@property (nonatomic, readonly) BOOL animationHasBegun; +@property (nonatomic, readonly) BOOL animationHasFinished; + +- (instancetype)initWithId:(NSNumber *)animationId + config:(NSDictionary *)config + forNode:(RCTValueAnimatedNode *)valueNode + callBack:(nullable RCTResponseSenderBlock)callback; + +- (void)startAnimation; +- (void)stepAnimationWithTime:(NSTimeInterval)currentTime; +- (void)stopAnimation; +- (void)resetAnimationConfig:(NSDictionary *)config; + +NS_ASSUME_NONNULL_END + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationPlugins.h new file mode 100644 index 0000000..406eb68 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationPlugins.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTAnimationPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTAnimationClassProvider(const char *name); + +// Lookup functions +Class RCTNativeAnimatedModuleCls(void) __attribute__((used)); +Class RCTNativeAnimatedTurboModuleCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationType.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationType.h new file mode 100644 index 0000000..4dcb316 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationType.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTAnimationType) { + RCTAnimationTypeSpring = 0, + RCTAnimationTypeLinear, + RCTAnimationTypeEaseIn, + RCTAnimationTypeEaseOut, + RCTAnimationTypeEaseInEaseOut, + RCTAnimationTypeKeyboard, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationUtils.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationUtils.h new file mode 100644 index 0000000..1f1afa9 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAnimationUtils.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +static NSString *const EXTRAPOLATE_TYPE_IDENTITY = @"identity"; +static NSString *const EXTRAPOLATE_TYPE_CLAMP = @"clamp"; +static NSString *const EXTRAPOLATE_TYPE_EXTEND = @"extend"; + +RCT_EXTERN CGFloat RCTInterpolateValueInRange(CGFloat value, + NSArray *inputRange, + NSArray *outputRange, + NSString *extrapolateLeft, + NSString *extrapolateRight); + +RCT_EXTERN CGFloat RCTInterpolateValue(CGFloat value, + CGFloat inputMin, + CGFloat inputMax, + CGFloat outputMin, + CGFloat outputMax, + NSString *extrapolateLeft, + NSString *extrapolateRight); + +RCT_EXTERN CGFloat RCTRadiansToDegrees(CGFloat radians); +RCT_EXTERN CGFloat RCTDegreesToRadians(CGFloat degrees); + +/** + * Coefficient to slow down animations, respects the ios + * simulator `Slow Animations (⌘T)` option. + */ +RCT_EXTERN CGFloat RCTAnimationDragCoefficient(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAppState.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAppState.h new file mode 100644 index 0000000..0921f70 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAppState.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTAppState : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAppearance.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAppearance.h new file mode 100644 index 0000000..d8c3585 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAppearance.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +RCT_EXTERN void RCTEnableAppearancePreference(BOOL enabled); +RCT_EXTERN void RCTOverrideAppearancePreference(NSString *const); +RCT_EXTERN NSString *RCTColorSchemePreference(UITraitCollection *traitCollection); + +@interface RCTAppearance : RCTEventEmitter +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAssert.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAssert.h new file mode 100644 index 0000000..e4c7790 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAssert.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/* + * Defined in RCTUtils.m + */ +RCT_EXTERN BOOL RCTIsMainQueue(void); + +/** + * This is the main assert macro that you should use. Asserts should be compiled out + * in production builds. You can customize the assert behaviour by setting a custom + * assert handler through `RCTSetAssertFunction`. + */ +#ifndef NS_BLOCK_ASSERTIONS +#define RCTAssert(condition, ...) \ + do { \ + if ((condition) == 0) { \ + _RCTAssertFormat(#condition, __FILE__, __LINE__, __func__, __VA_ARGS__); \ + if (RCT_NSASSERT) { \ + [[NSAssertionHandler currentHandler] handleFailureInFunction:(NSString *_Nonnull)@(__func__) \ + file:(NSString *_Nonnull)@(__FILE__) \ + lineNumber:__LINE__ \ + description:__VA_ARGS__]; \ + } \ + } \ + } while (false) +#else +#define RCTAssert(condition, ...) \ + do { \ + } while (false) +#endif +RCT_EXTERN void _RCTAssertFormat(const char *, const char *, int, const char *, NSString *, ...) + NS_FORMAT_FUNCTION(5, 6); + +/** + * Report a fatal condition when executing. These calls will _NOT_ be compiled out + * in production, and crash the app by default. You can customize the fatal behaviour + * by setting a custom fatal handler through `RCTSetFatalHandler` and + * `RCTSetFatalExceptionHandler`. + */ +RCT_EXTERN void RCTFatal(NSError *error); +RCT_EXTERN void RCTFatalException(NSException *exception); + +/** + * The default error domain to be used for React errors. + */ +RCT_EXTERN NSString *const RCTErrorDomain; + +/** + * JS Stack trace provided as part of an NSError's userInfo + */ +RCT_EXTERN NSString *const RCTJSStackTraceKey; + +/** + * Raw JS Stack trace string provided as part of an NSError's userInfo + */ +RCT_EXTERN NSString *const RCTJSRawStackTraceKey; + +/** + * Objective-C stack trace string provided as part of an NSError's userInfo + */ +RCT_EXTERN NSString *const RCTObjCStackTraceKey; + +/** + * Name of fatal exceptions generated by RCTFatal + */ +RCT_EXTERN NSString *const RCTFatalExceptionName; + +/** + * A block signature to be used for custom assertion handling. + */ +typedef void (^RCTAssertFunction)( + NSString *condition, + NSString *fileName, + NSNumber *lineNumber, + NSString *function, + NSString *message); + +typedef void (^RCTFatalHandler)(NSError *error); +typedef void (^RCTFatalExceptionHandler)(NSException *exception); + +/** + * Convenience macro for asserting that a parameter is non-nil/non-zero. + */ +#define RCTAssertParam(name) RCTAssert(name, @"'%s' is a required parameter", #name) + +/** + * Convenience macro for asserting that we're running on main queue. + */ +#define RCTAssertMainQueue() RCTAssert(RCTIsMainQueue(), @"This function must be called on the main queue") + +/** + * Convenience macro for asserting that we're running off the main queue. + */ +#define RCTAssertNotMainQueue() RCTAssert(!RCTIsMainQueue(), @"This function must not be called on the main queue") + +/** + * These methods get and set the current assert function called by the RCTAssert + * macros. You can use these to replace the standard behavior with custom assert + * functionality. + */ +RCT_EXTERN void RCTSetAssertFunction(RCTAssertFunction assertFunction); +RCT_EXTERN RCTAssertFunction RCTGetAssertFunction(void); + +/** + * This appends additional code to the existing assert function, without + * replacing the existing functionality. Useful if you just want to forward + * assert info to an extra service without changing the default behavior. + */ +RCT_EXTERN void RCTAddAssertFunction(RCTAssertFunction assertFunction); + +/** + * This method temporarily overrides the assert function while performing the + * specified block. This is useful for testing purposes (to detect if a given + * function asserts something) or to suppress or override assertions temporarily. + */ +RCT_EXTERN void RCTPerformBlockWithAssertFunction(void (^block)(void), RCTAssertFunction assertFunction); + +/** + * These methods get and set the current fatal handler called by the `RCTFatal` + * and `RCTFatalException` methods. + */ +RCT_EXTERN void RCTSetFatalHandler(RCTFatalHandler fatalHandler); +RCT_EXTERN RCTFatalHandler RCTGetFatalHandler(void); +RCT_EXTERN void RCTSetFatalExceptionHandler(RCTFatalExceptionHandler fatalExceptionHandler); +RCT_EXTERN RCTFatalExceptionHandler RCTGetFatalExceptionHandler(void); + +/** + * Get the current thread's name (or the current queue, if in debug mode) + */ +RCT_EXTERN NSString *RCTCurrentThreadName(void); + +/** + * Helper to get generate exception message from NSError + */ +RCT_EXTERN NSString * +RCTFormatError(NSString *message, NSArray *> *stacktrace, NSUInteger maxMessageLength); + +/** + * Formats a JS stack trace for logging. + */ +RCT_EXTERN NSString *RCTFormatStackTrace(NSArray *> *stackTrace); + +/** + * Convenience macro to assert which thread is currently running (DEBUG mode only) + */ +#if DEBUG + +#define RCTAssertThread(thread, format...) \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") RCTAssert( \ + [(id)thread isKindOfClass:[NSString class]] ? [RCTCurrentThreadName() isEqualToString:(NSString *)thread] \ + : [(id)thread isKindOfClass:[NSThread class]] ? [NSThread currentThread] == (NSThread *)thread \ + : dispatch_get_current_queue() == (dispatch_queue_t)thread, \ + format); \ + _Pragma("clang diagnostic pop") + +#else + +#define RCTAssertThread(thread, format...) \ + do { \ + } while (0) + +#endif + +/** + * Controls for ensuring the new architecture runtime assumption holds. + * Note: this is work in progress. + */ + +// Enable reporting of any violation related to the new React Native architecture. +// If RCT_NEW_ARCHITECTURE is defined, it is already enabled by default, otherwise, no violation will be +// reported until enabled. +// Note: enabling this at runtime is not early enough to report issues within ObjC class +load execution. +__attribute__((used)) RCT_EXTERN void RCTEnableNewArchitectureViolationReporting(BOOL enabled); + +// When reporting is enabled, trigger an assertion. +__attribute__((used)) RCT_EXTERN void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra); + +// When reporting is enabled, warn about the violation. Use this to prepare a specific callsite +// for stricter enforcement. When ready, switch it to use the variant above. +__attribute__((used)) RCT_EXTERN void RCTWarnNotAllowedForNewArchitecture(id context, NSString *extra); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAsyncLocalStorage.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAsyncLocalStorage.h new file mode 100644 index 0000000..d43281c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAsyncLocalStorage.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * A simple, asynchronous, persistent, key-value storage system designed as a + * backend to the AsyncStorage JS module, which is modeled after LocalStorage. + * + * Current implementation stores small values in serialized dictionary and + * larger values in separate files. Since we use a serial file queue + * `RKFileQueue`, reading/writing from multiple threads should be perceived as + * being atomic, unless someone bypasses the `RCTAsyncLocalStorage` API. + * + * Keys and values must always be strings or an error is returned. + */ +@interface RCTAsyncLocalStorage : NSObject + +@property (nonatomic, assign) BOOL clearOnInvalidate; + +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +// Clear the RCTAsyncLocalStorage data from native code +- (void)clearAllData; + +// For clearing data when the bridge may not exist, e.g. when logging out. ++ (void)clearAllData; + +// Grab data from the cache. ResponseBlock result array will have an error at position 0, and an array of arrays at +// position 1. +- (void)multiGet:(NSArray *)keys callback:(RCTResponseSenderBlock)callback; + +// Add multiple key value pairs to the cache. +- (void)multiSet:(NSArray *> *)kvPairs callback:(RCTResponseSenderBlock)callback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAutoInsetsProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAutoInsetsProtocol.h new file mode 100644 index 0000000..fc18a9a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTAutoInsetsProtocol.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * Defines a View that wants to support auto insets adjustment + */ +@protocol RCTAutoInsetsProtocol + +@property (nonatomic, assign, readwrite) UIEdgeInsets contentInset; +@property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets; + +/** + * Automatically adjusted content inset depends on view controller's top and bottom + * layout guides so if you've changed one of them (e.g. after rotation or manually) you should call this method + * to recalculate and refresh content inset. + * To handle case with changing navigation bar height call this method from viewDidLayoutSubviews: + * of your view controller. + */ +- (void)refreshContentInset; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputDelegate.h new file mode 100644 index 0000000..3e1839b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputDelegate.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputViewProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputDelegate + +- (BOOL)textInputShouldBeginEditing; // Return `NO` to disallow editing. +- (void)textInputDidBeginEditing; + +- (BOOL)textInputShouldEndEditing; // Return `YES` to allow editing to stop and to resign first responder status. `NO` to disallow the editing session to end. +- (void)textInputDidEndEditing; // May be called if forced even if `textInputShouldEndEditing` returns `NO` (e.g. view removed from window) or `[textInput endEditing:YES]` called. + +- (BOOL)textInputShouldReturn; // May be called right before `textInputShouldEndEditing` if "Return" button was pressed. +- (void)textInputDidReturn; + +/* + * Called before any change in the TextInput. The delegate has the opportunity to change the replacement string or reject the change completely. + * To change the replacement, return the changed version of the `text`. + * To accept the change, return `text` argument as-is. + * To reject the change, return `nil`. + */ +- (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range; +- (void)textInputDidChange; + +- (void)textInputDidChangeSelection; + +@optional + +- (void)scrollViewDidScroll:(UIScrollView *)scrollView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputDelegateAdapter.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputDelegateAdapter.h new file mode 100644 index 0000000..a7f3251 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputDelegateAdapter.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBackedTextInputViewProtocol.h" +#import "RCTBackedTextInputDelegate.h" + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField) + +@interface RCTBackedTextFieldDelegateAdapter : NSObject + +- (instancetype)initWithTextField:(UITextField *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; +- (void)selectedTextRangeWasSet; + +@end + +#pragma mark - RCTBackedTextViewDelegateAdapter (for UITextView) + +@interface RCTBackedTextViewDelegateAdapter : NSObject + +- (instancetype)initWithTextView:(UITextView *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputViewProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputViewProtocol.h new file mode 100644 index 0000000..09f4fe2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBackedTextInputViewProtocol.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputDelegate; +@class RCTTextAttributes; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputViewProtocol + +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, strong, nullable) UIView *inputAccessoryView; +@property (nonatomic, strong, nullable) UIView *inputView; +@property (nonatomic, weak, nullable) id textInputDelegate; +@property (nonatomic, readonly) CGSize contentSize; +@property (nonatomic, strong, nullable) NSDictionary *defaultTextAttributes; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL enablesReturnKeyAutomatically; +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +// This protocol disallows direct access to `selectedTextRange` property because +// unwise usage of it can break the `delegate` behavior. So, we always have to +// explicitly specify should `delegate` be notified about the change or not. +// If the change was initiated programmatically, we must NOT notify the delegate. +// If the change was a result of user actions (like typing or touches), we MUST notify the delegate. +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange NS_UNAVAILABLE; +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange notifyDelegate:(BOOL)notifyDelegate; + +// This protocol disallows direct access to `text` property because +// unwise usage of it can break the `attributeText` behavior. +// Use `attributedText.string` instead. +@property (nonatomic, copy, nullable) NSString *text NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputShadowView.h new file mode 100644 index 0000000..44b46db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputShadowView.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, copy, nullable) NSString *text; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputView.h new file mode 100644 index 0000000..d73f082 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputView.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTBackedTextInputDelegate.h" +#import "RCTBackedTextInputViewProtocol.h" + +@class RCTBridge; +@class RCTTextAttributes; +@class RCTTextSelection; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; + +@property (nonatomic, readonly) UIView *backedTextInputView; + +@property (nonatomic, strong, nullable) RCTTextAttributes *textAttributes; +@property (nonatomic, assign) UIEdgeInsets reactPaddingInsets; +@property (nonatomic, assign) UIEdgeInsets reactBorderInsets; + +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onSelectionChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onTextInput; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onScroll; + +@property (nonatomic, assign) NSInteger mostRecentEventCount; +@property (nonatomic, assign, readonly) NSInteger nativeEventCount; +@property (nonatomic, assign) BOOL autoFocus; +@property (nonatomic, assign) BOOL blurOnSubmit; +@property (nonatomic, assign) BOOL selectTextOnFocus; +@property (nonatomic, assign) BOOL clearTextOnFocus; +@property (nonatomic, assign) BOOL secureTextEntry; +@property (nonatomic, copy) RCTTextSelection *selection; +@property (nonatomic, strong, nullable) NSNumber *maxLength; +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy) NSString *inputAccessoryViewID; +@property (nonatomic, assign) UIKeyboardType keyboardType; +@property (nonatomic, assign) BOOL showSoftInputOnFocus; + +/** + Sets selection intext input if both start and end are within range of the text input. + **/ +- (void)setSelectionStart:(NSInteger)start + selectionEnd:(NSInteger)end; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputViewManager.h new file mode 100644 index 0000000..5201bdb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextInputViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTBaseTextInputViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextShadowView.h new file mode 100644 index 0000000..9f2c944 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextShadowView.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextAttributes.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTBaseTextShadowViewEmbeddedShadowViewAttributeName; + +@interface RCTBaseTextShadowView : RCTShadowView { + @protected NSAttributedString *_Nullable cachedAttributedText; + @protected RCTTextAttributes *_Nullable cachedTextAttributes; +} + +@property (nonatomic, strong) RCTTextAttributes *textAttributes; + +- (NSAttributedString *)attributedTextWithBaseTextAttributes:(nullable RCTTextAttributes *)baseTextAttributes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextViewManager.h new file mode 100644 index 0000000..b0f9470 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBaseTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBlobManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBlobManager.h new file mode 100755 index 0000000..04b905c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBlobManager.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import + +@interface RCTBlobManager : NSObject + +- (NSString *)store:(NSData *)data; + +- (void)store:(NSData *)data withId:(NSString *)blobId; + +- (NSData *)resolve:(NSDictionary *)blob; + +- (NSData *)resolve:(NSString *)blobId offset:(NSInteger)offset size:(NSInteger)size; + +- (NSData *)resolveURL:(NSURL *)url; + +- (void)remove:(NSString *)blobId; + +- (void)createFromParts:(NSArray *> *)parts withId:(NSString *)blobId; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBorderDrawing.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBorderDrawing.h new file mode 100644 index 0000000..884aa79 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBorderDrawing.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef struct { + CGFloat topLeft; + CGFloat topRight; + CGFloat bottomLeft; + CGFloat bottomRight; +} RCTCornerRadii; + +typedef struct { + CGSize topLeft; + CGSize topRight; + CGSize bottomLeft; + CGSize bottomRight; +} RCTCornerInsets; + +typedef struct { + CGColorRef top; + CGColorRef left; + CGColorRef bottom; + CGColorRef right; +} RCTBorderColors; + +/** + * Determine if the border widths, colors and radii are all equal. + */ +RCT_EXTERN BOOL RCTBorderInsetsAreEqual(UIEdgeInsets borderInsets); +RCT_EXTERN BOOL RCTCornerRadiiAreEqual(RCTCornerRadii cornerRadii); +RCT_EXTERN BOOL RCTBorderColorsAreEqual(RCTBorderColors borderColors); + +/** + * Convert RCTCornerRadii to RCTCornerInsets by applying border insets. + * Effectively, returns radius - inset, with a lower bound of 0.0. + */ +RCT_EXTERN RCTCornerInsets RCTGetCornerInsets(RCTCornerRadii cornerRadii, UIEdgeInsets borderInsets); + +/** + * Create a CGPath representing a rounded rectangle with the specified bounds + * and corner insets. Note that the CGPathRef must be released by the caller. + */ +RCT_EXTERN CGPathRef +RCTPathCreateWithRoundedRect(CGRect bounds, RCTCornerInsets cornerInsets, const CGAffineTransform *transform); + +/** + * Draw a CSS-compliant border as an image. You can determine if it's scalable + * by inspecting the image's `capInsets`. + * + * `borderInsets` defines the border widths for each edge. + */ +RCT_EXTERN UIImage *RCTGetBorderImage( + RCTBorderStyle borderStyle, + CGSize viewSize, + RCTCornerRadii cornerRadii, + UIEdgeInsets borderInsets, + RCTBorderColors borderColors, + CGColorRef backgroundColor, + BOOL drawToEdge); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBorderStyle.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBorderStyle.h new file mode 100644 index 0000000..70d6d72 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBorderStyle.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTBorderStyle) { + RCTBorderStyleUnset = 0, + RCTBorderStyleSolid, + RCTBorderStyleDotted, + RCTBorderStyleDashed, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridge+Private.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridge+Private.h new file mode 100644 index 0000000..9dd96a5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridge+Private.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTModuleRegistry; +@class RCTModuleData; +@protocol RCTJavaScriptExecutor; + +RCT_EXTERN NSArray *RCTGetModuleClasses(void); +RCT_EXTERN void RCTRegisterModule(Class); + +@interface RCTBridge () + +// Private designated initializer +- (instancetype)initWithDelegate:(id)delegate + bundleURL:(NSURL *)bundleURL + moduleProvider:(RCTBridgeModuleListProvider)block + launchOptions:(NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER; + +// Used for the profiler flow events between JS and native +@property (nonatomic, assign) int64_t flowID; +@property (nonatomic, assign) CFMutableDictionaryRef flowIDMap; +@property (nonatomic, strong) NSLock *flowIDMapLock; + +// Used by RCTDevMenu +@property (nonatomic, copy) NSString *bridgeDescription; + ++ (instancetype)currentBridge; ++ (void)setCurrentBridge:(RCTBridge *)bridge; + +/** + * Bridge setup code - creates an instance of RCTBachedBridge. Exposed for + * test only + */ +- (void)setUp; + +/** + * This method is used to invoke a callback that was registered in the + * JavaScript application context. Safe to call from any thread. + */ +- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args; + +/** + * This property is mostly used on the main thread, but may be touched from + * a background thread if the RCTBridge happens to deallocate on a background + * thread. Therefore, we want all writes to it to be seen atomically. + */ +@property (atomic, strong) RCTBridge *batchedBridge; + +/** + * The block that creates the modules' instances to be added to the bridge. + * Exposed for RCTCxxBridge + */ +@property (nonatomic, copy, readonly) RCTBridgeModuleListProvider moduleProvider; + +/** + * Used by RCTDevMenu to override the `hot` param of the current bundleURL. + */ +@property (nonatomic, strong, readwrite) NSURL *bundleURL; + +/** + * An object that allows one to require NativeModules/TurboModules. + * RCTModuleRegistry is implemented in bridgeless mode and bridge mode. + * Used by RCTRootView. + */ +@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; + +@end + +@interface RCTBridge (RCTCxxBridge) + +/** + * Used by RCTModuleData + */ + +@property (nonatomic, weak, readonly) RCTBridge *parentBridge; + +/** + * Used by RCTModuleData + */ +@property (nonatomic, assign, readonly) BOOL moduleSetupComplete; + +/** + * Called on the child bridge to run the executor and start loading. + */ +- (void)start; + +/** + * Used by RCTModuleData to register the module for frame updates after it is + * lazily initialized. + */ +- (void)registerModuleForFrameUpdates:(id)module withModuleData:(RCTModuleData *)moduleData; + +/** + * Dispatch work to a module's queue - this is also suports the fake RCTJSThread + * queue. Exposed for the RCTProfiler + */ +- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue; + +/** + * Get the module data for a given module name. Used by UIManager to implement + * the `dispatchViewManagerCommand` method. + */ +- (RCTModuleData *)moduleDataForName:(NSString *)moduleName; + +/** + * Registers additional classes with the ModuleRegistry. + */ +- (void)registerAdditionalModuleClasses:(NSArray *)newModules; + +/** + * Updates the ModuleRegistry with a pre-initialized instance. + */ +- (void)updateModuleWithInstance:(id)instance; + +/** + * Systrace profiler toggling methods exposed for the RCTDevMenu + */ +- (void)startProfiling; +- (void)stopProfiling:(void (^)(NSData *))callback; + +/** + * Synchronously call a specific native module's method and return the result + */ +- (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:(NSArray *)params; + +/** + * Hook exposed for RCTLog to send logs to JavaScript when not running in JSC + */ +- (void)logMessage:(NSString *)message level:(NSString *)level; + +/** + * Allow super fast, one time, timers to skip the queue and be directly executed + */ +- (void)_immediatelyCallTimer:(NSNumber *)timer; + +@end + +@interface RCTBridge (Inspector) + +@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable; + +@end + +@interface RCTCxxBridge : RCTBridge + +// TODO(cjhopman): this seems unsafe unless we require that it is only called on the main js queue. +@property (nonatomic, readonly) void *runtime; + +- (instancetype)initWithParentBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridge.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridge.h new file mode 100644 index 0000000..8eef1ce --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridge.h @@ -0,0 +1,337 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import + +@class JSValue; +@class RCTBridge; +@class RCTPerformanceLogger; + +/** + * This notification fires when the bridge initializes. + */ +RCT_EXTERN NSString *const RCTJavaScriptWillStartLoadingNotification; + +/** + * This notification fires when the bridge starts executing the JS bundle. + */ +RCT_EXTERN NSString *const RCTJavaScriptWillStartExecutingNotification; + +/** + * This notification fires when the bridge has finished loading the JS bundle. + */ +RCT_EXTERN NSString *const RCTJavaScriptDidLoadNotification; + +/** + * This notification fires when the bridge failed to load the JS bundle. The + * `error` key can be used to determine the error that occurred. + */ +RCT_EXTERN NSString *const RCTJavaScriptDidFailToLoadNotification; + +/** + * This notification fires each time a native module is instantiated. The + * `module` key will contain a reference to the newly-created module instance. + * Note that this notification may be fired before the module is available via + * the `[bridge moduleForClass:]` method. + */ +RCT_EXTERN NSString *const RCTDidInitializeModuleNotification; + +/** + * This notification fires each time a module is setup after it is initialized. The + * `RCTDidSetupModuleNotificationModuleNameKey` key will contain a reference to the module name and + * `RCTDidSetupModuleNotificationSetupTimeKey` will contain the setup time in ms. + */ +RCT_EXTERN NSString *const RCTDidSetupModuleNotification; + +/** + * Key for the module name (NSString) in the + * RCTDidSetupModuleNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTDidSetupModuleNotificationModuleNameKey; + +/** + * Key for the setup time (NSNumber) in the + * RCTDidSetupModuleNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTDidSetupModuleNotificationSetupTimeKey; + +/** + * DEPRECATED - Use RCTReloadCommand instead. This notification fires just before the bridge starts + * processing a request to reload. + */ +RCT_EXTERN NSString *const RCTBridgeWillReloadNotification; + +/** + * This notification fires whenever a fast refresh happens. + */ +RCT_EXTERN NSString *const RCTBridgeFastRefreshNotification; + +/** + * This notification fires just before the bridge begins downloading a script + * from the packager. + */ +RCT_EXTERN NSString *const RCTBridgeWillDownloadScriptNotification; + +/** + * This notification fires just after the bridge finishes downloading a script + * from the packager. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotification; + +/** + * This notification fires right after the bridge is about to invalidate NativeModule + * instances during teardown. Handle this notification to perform additional invalidation. + */ +RCT_EXTERN NSString *const RCTBridgeWillInvalidateModulesNotification; + +/** + * This notification fires right after the bridge finishes invalidating NativeModule + * instances during teardown. Handle this notification to perform additional invalidation. + */ +RCT_EXTERN NSString *const RCTBridgeDidInvalidateModulesNotification; + +/** + * This notification fires right before the bridge starting invalidation process. + * Handle this notification to perform additional invalidation. + * The notification can be issued on any thread. + */ +RCT_EXTERN NSString *const RCTBridgeWillBeInvalidatedNotification; + +/** + * Key for the RCTSource object in the RCTBridgeDidDownloadScriptNotification + * userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationSourceKey; + +/** + * Key for the reload reason in the RCTBridgeWillReloadNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationReasonKey; + +/** + * Key for the bridge description (NSString_ in the + * RCTBridgeDidDownloadScriptNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationBridgeDescriptionKey; + +/** + * This block can be used to instantiate modules that require additional + * init parameters, or additional configuration prior to being used. + * The bridge will call this block to instantiate the modules, and will + * be responsible for invalidating/releasing them when the bridge is destroyed. + * For this reason, the block should always return new module instances, and + * module instances should not be shared between bridges. + */ +typedef NSArray> * (^RCTBridgeModuleListProvider)(void); + +/** + * These blocks are used to report whether an additional bundle + * fails or succeeds loading. + */ +typedef void (^RCTLoadAndExecuteErrorBlock)(NSError *error); + +/** + * This function returns the module name for a given class. + */ +RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass); + +/** + * Experimental. + * Check/set if JSI-bound NativeModule is enabled. By default it's off. + */ +RCT_EXTERN BOOL RCTTurboModuleEnabled(void); +RCT_EXTERN void RCTEnableTurboModule(BOOL enabled); + +// Turn on TurboModule eager initialization +RCT_EXTERN BOOL RCTTurboModuleEagerInitEnabled(void); +RCT_EXTERN void RCTEnableTurboModuleEagerInit(BOOL enabled); + +// Turn on TurboModule shared mutex initialization +RCT_EXTERN BOOL RCTTurboModuleSharedMutexInitEnabled(void); +RCT_EXTERN void RCTEnableTurboModuleSharedMutexInit(BOOL enabled); + +// Turn off TurboModule delegate locking +RCT_EXTERN BOOL RCTTurboModuleManagerDelegateLockingDisabled(void); +RCT_EXTERN void RCTDisableTurboModuleManagerDelegateLocking(BOOL enabled); + +typedef enum { + kRCTGlobalScope, + kRCTGlobalScopeUsingRetainJSCallback, + kRCTTurboModuleManagerScope, +} RCTTurboModuleCleanupMode; + +RCT_EXTERN RCTTurboModuleCleanupMode RCTGetTurboModuleCleanupMode(void); +RCT_EXTERN void RCTSetTurboModuleCleanupMode(RCTTurboModuleCleanupMode mode); + +/** + * Async batched bridge used to communicate with the JavaScript application. + */ +@interface RCTBridge : NSObject + +/** + * Creates a new bridge with a custom RCTBridgeDelegate. + * + * All the interaction with the JavaScript context should be done using the bridge + * instance of the RCTBridgeModules. Modules will be automatically instantiated + * using the default contructor, but you can optionally pass in an array of + * pre-initialized module instances if they require additional init parameters + * or configuration. + */ +- (instancetype)initWithDelegate:(id)delegate launchOptions:(NSDictionary *)launchOptions; + +/** + * DEPRECATED: Use initWithDelegate:launchOptions: instead + * + * The designated initializer. This creates a new bridge on top of the specified + * executor. The bridge should then be used for all subsequent communication + * with the JavaScript code running in the executor. Modules will be automatically + * instantiated using the default contructor, but you can optionally pass in an + * array of pre-initialized module instances if they require additional init + * parameters or configuration. + */ +- (instancetype)initWithBundleURL:(NSURL *)bundleURL + moduleProvider:(RCTBridgeModuleListProvider)block + launchOptions:(NSDictionary *)launchOptions; + +/** + * This method is used to call functions in the JavaScript application context. + * It is primarily intended for use by modules that require two-way communication + * with the JavaScript code. Safe to call from any thread. + */ +- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args; +- (void)enqueueJSCall:(NSString *)module + method:(NSString *)method + args:(NSArray *)args + completion:(dispatch_block_t)completion; + +/** + * This method registers the file path of an additional JS segment by its ID. + * + * @experimental + */ +- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path; + +/** + * Retrieve a bridge module instance by name or class. Note that modules are + * lazily instantiated, so calling these methods for the first time with a given + * module name/class may cause the class to be synchronously instantiated, + * potentially blocking both the calling thread and main thread for a short time. + * + * Note: This method does NOT lazily load the particular module if it's not yet loaded. + */ +- (id)moduleForName:(NSString *)moduleName; +- (id)moduleForName:(NSString *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad; +// Note: This method lazily load the module as necessary. +- (id)moduleForClass:(Class)moduleClass; + +/** + * When a NativeModule performs a lookup for a TurboModule, we need to query + * the TurboModuleRegistry. + */ +- (void)setRCTTurboModuleRegistry:(id)turboModuleRegistry; + +/** + * This hook is called by the TurboModule infra with every TurboModule that's created. + * It allows the bridge to attach properties to TurboModules that give TurboModules + * access to Bridge APIs. + */ +- (void)attachBridgeAPIsToTurboModule:(id)module; + +/** + * Convenience method for retrieving all modules conforming to a given protocol. + * Modules will be synchronously instantiated if they haven't already been, + * potentially blocking both the calling thread and main thread for a short time. + */ +- (NSArray *)modulesConformingToProtocol:(Protocol *)protocol; + +/** + * Test if a module has been initialized. Use this prior to calling + * `moduleForClass:` or `moduleForName:` if you do not want to cause the module + * to be instantiated if it hasn't been already. + */ +- (BOOL)moduleIsInitialized:(Class)moduleClass; + +/** + * All registered bridge module classes. + */ +@property (nonatomic, copy, readonly) NSArray *moduleClasses; + +/** + * URL of the script that was loaded into the bridge. + */ +@property (nonatomic, strong, readonly) NSURL *bundleURL; + +/** + * The class of the executor currently being used. Changes to this value will + * take effect after the bridge is reloaded. + */ +@property (nonatomic, strong) Class executorClass; + +/** + * The delegate provided during the bridge initialization + */ +@property (nonatomic, weak, readonly) id delegate; + +/** + * The launch options that were used to initialize the bridge. + */ +@property (nonatomic, copy, readonly) NSDictionary *launchOptions; + +/** + * Use this to check if the bridge is currently loading. + */ +@property (nonatomic, readonly, getter=isLoading) BOOL loading; + +/** + * Use this to check if the bridge has been invalidated. + */ +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +/** + * Link to the Performance Logger that logs React Native perf events. + */ +@property (nonatomic, readonly, strong) RCTPerformanceLogger *performanceLogger; + +/** + * Reload the bundle and reset executor & modules. Safe to call from any thread. + */ +- (void)reload __deprecated_msg("Use RCTReloadCommand instead"); + +/** + * Reload the bundle and reset executor & modules. Safe to call from any thread. + */ +- (void)reloadWithReason:(NSString *)reason __deprecated_msg("Use RCTReloadCommand instead"); + +/** + * Handle notifications for a fast refresh. Safe to call from any thread. + */ +- (void)onFastRefresh; + +/** + * Inform the bridge, and anything subscribing to it, that it should reload. + */ +- (void)requestReload __deprecated_msg("Use RCTReloadCommand instead"); + +/** + * Says whether bridge has started receiving calls from JavaScript. + */ +- (BOOL)isBatchActive; + +/** + * Loads and executes additional bundles in the VM for development. + */ +- (void)loadAndExecuteSplitBundleURL:(NSURL *)bundleURL + onError:(RCTLoadAndExecuteErrorBlock)onError + onComplete:(dispatch_block_t)onComplete; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeDelegate.h new file mode 100644 index 0000000..00c26f2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeDelegate.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; +@protocol RCTBridgeModule; + +@protocol RCTBridgeDelegate + +/** + * The location of the JavaScript source file. When running from the packager + * this should be an absolute URL, e.g. `http://localhost:8081/index.ios.bundle`. + * When running from a locally bundled JS file, this should be a `file://` url + * pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`. + */ +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge; + +@optional + +/** + * The bridge initializes any registered RCTBridgeModules automatically, however + * if you wish to instantiate your own module instances, you can return them + * from this method. + * + * Note: You should always return a new instance for each call, rather than + * returning the same instance each time the bridge is reloaded. Module instances + * should not be shared between bridges, and this may cause unexpected behavior. + * + * It is also possible to override standard modules with your own implementations + * by returning a class with the same `moduleName` from this method, but this is + * not recommended in most cases - if the module methods and behavior do not + * match exactly, it may lead to bugs or crashes. + */ +- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge; + +/** + * Configure whether the JSCExecutor created should use the system JSC API or + * alternative hooks provided. When returning YES from this method, you must have + * previously called facebook::react::setCustomJSCWrapper. + * + * @experimental + */ +- (BOOL)shouldBridgeUseCustomJSC:(RCTBridge *)bridge; + +/** + * The bridge will call this method when a module been called from JS + * cannot be found among registered modules. + * It should return YES if the module with name 'moduleName' was registered + * in the implementation, and the system must attempt to look for it again among registered. + * If the module was not registered, return NO to prevent further searches. + */ +- (BOOL)bridge:(RCTBridge *)bridge didNotFindModule:(NSString *)moduleName; + +/** + * The bridge will automatically attempt to load the JS source code from the + * location specified by the `sourceURLForBridge:` method, however, if you want + * to handle loading the JS yourself, you can do so by implementing this method. + */ +- (void)loadSourceForBridge:(RCTBridge *)bridge + onProgress:(RCTSourceLoadProgressBlock)onProgress + onComplete:(RCTSourceLoadBlock)loadCallback; + +/** + * Similar to loadSourceForBridge:onProgress:onComplete: but without progress + * reporting. + */ +- (void)loadSourceForBridge:(RCTBridge *)bridge withBlock:(RCTSourceLoadBlock)loadCallback; + +/** + * Retrieve the list of lazy-native-modules names for the given bridge. + */ +- (NSDictionary *)extraLazyModuleClassesForBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeMethod.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeMethod.h new file mode 100644 index 0000000..35d2b89 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeMethod.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; + +typedef NS_ENUM(NSUInteger, RCTFunctionType) { + RCTFunctionTypeNormal, + RCTFunctionTypePromise, + RCTFunctionTypeSync, +}; + +static inline const char *RCTFunctionDescriptorFromType(RCTFunctionType type) +{ + switch (type) { + case RCTFunctionTypeNormal: + return "async"; + case RCTFunctionTypePromise: + return "promise"; + case RCTFunctionTypeSync: + return "sync"; + } +}; + +@protocol RCTBridgeMethod + +@property (nonatomic, readonly) const char *JSMethodName; +@property (nonatomic, readonly) RCTFunctionType functionType; + +- (id)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray *)arguments; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeModule.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeModule.h new file mode 100644 index 0000000..fff361a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBridgeModule.h @@ -0,0 +1,469 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import +#import + +@class RCTBridge; +@protocol RCTBridgeMethod; +@class RCTModuleRegistry; +@class RCTViewRegistry; +@class RCTBundleManager; +@class RCTCallableJSModules; + +/** + * The type of a block that is capable of sending a response to a bridged + * operation. Use this for returning callback methods to JS. + */ +typedef void (^RCTResponseSenderBlock)(NSArray *response); + +/** + * The type of a block that is capable of sending an error response to a + * bridged operation. Use this for returning error information to JS. + */ +typedef void (^RCTResponseErrorBlock)(NSError *error); + +/** + * Block that bridge modules use to resolve the JS promise waiting for a result. + * Nil results are supported and are converted to JS's undefined value. + */ +typedef void (^RCTPromiseResolveBlock)(id result); + +/** + * Block that bridge modules use to reject the JS promise waiting for a result. + * The error may be nil but it is preferable to pass an NSError object for more + * precise error messages. + */ +typedef void (^RCTPromiseRejectBlock)(NSString *code, NSString *message, NSError *error); + +RCT_EXTERN_C_BEGIN + +typedef struct RCTMethodInfo { + const char *const jsName; + const char *const objcName; + const BOOL isSync; +} RCTMethodInfo; + +RCT_EXTERN_C_END + +/** + * Provides the interface needed to register a bridge module. + */ +@protocol RCTBridgeModule + +/** + * Place this macro in your class implementation to automatically register + * your module with the bridge when it loads. The optional js_name argument + * will be used as the JS module name. If omitted, the JS module name will + * match the Objective-C class name. + */ +#define RCT_EXPORT_MODULE(js_name) \ + RCT_EXTERN void RCTRegisterModule(Class); \ + +(NSString *)moduleName \ + { \ + return @ #js_name; \ + } \ + +(void)load \ + { \ + RCTRegisterModule(self); \ + } + +/** + * Same as RCT_EXPORT_MODULE, but uses __attribute__((constructor)) for module + * registration. Useful for registering swift classes that forbids use of load + * Used in RCT_EXTERN_REMAP_MODULE + */ +#define RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) \ + RCT_EXTERN void RCTRegisterModule(Class); \ + +(NSString *)moduleName \ + { \ + return @ #js_name; \ + } \ + __attribute__((constructor)) static void RCT_CONCAT(initialize_, objc_name)() \ + { \ + RCTRegisterModule([objc_name class]); \ + } + +/** + * To improve startup performance users may want to generate their module lists + * at build time and hook the delegate to merge with the runtime list. This + * macro takes the place of the above for those cases by omitting the +load + * generation. + * + */ +#define RCT_EXPORT_PRE_REGISTERED_MODULE(js_name) \ + +(NSString *)moduleName \ + { \ + return @ #js_name; \ + } + +// Implemented by RCT_EXPORT_MODULE ++ (NSString *)moduleName; + +@optional + +/** + * A reference to the RCTModuleRegistry. Useful for modules that require access + * to other NativeModules. To implement this in your module, just add `@synthesize + * moduleRegistry = _moduleRegistry;`. If using Swift, add + * `@objc var moduleRegistry: RCTModuleRegistry!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTModuleRegistry *moduleRegistry; + +/** + * A reference to the RCTViewRegistry. Useful for modules that query UIViews, + * given a react tag. This API is deprecated, and only exists to help migrate + * NativeModules to Venice. + * + * To implement this in your module, just add `@synthesize + * viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;`. If using Swift, add + * `@objc var viewRegistry_DEPRECATED: RCTViewRegistry!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTViewRegistry *viewRegistry_DEPRECATED; + +/** + * A reference to the RCTBundleManager. Useful for modules that need to read + * or write to the app's bundle URL. + * + * To implement this in your module, just add `@synthesize bundleManager = + * _bundleManager;`. If using Swift, add `@objc var bundleManager: + * RCTBundleManager!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTBundleManager *bundleManager; + +/** + * A reference to an RCTCallableJSModules. Useful for modules that need to + * call into methods on JavaScript modules registered as callable with + * React Native. + * + * To implement this in your module, just add `@synthesize callableJSModules = + * _callableJSModules;`. If using Swift, add `@objc var callableJSModules: + * RCTCallableJSModules!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTCallableJSModules *callableJSModules; + +/** + * A reference to the RCTBridge. Useful for modules that require access + * to bridge features, such as sending events or making JS calls. This + * will be set automatically by the bridge when it initializes the module. + * To implement this in your module, just add `@synthesize bridge = _bridge;` + * If using Swift, add `@objc var bridge: RCTBridge!` to your module. + */ +@property (nonatomic, weak, readonly) RCTBridge *bridge; + +/** + * The queue that will be used to call all exported methods. If omitted, this + * will call on a default background queue, which is avoids blocking the main + * thread. + * + * If the methods in your module need to interact with UIKit methods, they will + * probably need to call those on the main thread, as most of UIKit is main- + * thread-only. You can tell React Native to call your module methods on the + * main thread by returning a reference to the main queue, like this: + * + * - (dispatch_queue_t)methodQueue + * { + * return dispatch_get_main_queue(); + * } + * + * If you don't want to specify the queue yourself, but you need to use it + * inside your class (e.g. if you have internal methods that need to dispatch + * onto that queue), you can just add `@synthesize methodQueue = _methodQueue;` + * and the bridge will populate the methodQueue property for you automatically + * when it initializes the module. + */ +@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue; + +/** + * Wrap the parameter line of your method implementation with this macro to + * expose it to JS. By default the exposed method will match the first part of + * the Objective-C method selector name (up to the first colon). Use + * RCT_REMAP_METHOD to specify the JS name of the method. + * + * For example, in ModuleName.m: + * + * - (void)doSomething:(NSString *)aString withA:(NSInteger)a andB:(NSInteger)b + * { ... } + * + * becomes + * + * RCT_EXPORT_METHOD(doSomething:(NSString *)aString + * withA:(NSInteger)a + * andB:(NSInteger)b) + * { ... } + * + * and is exposed to JavaScript as `NativeModules.ModuleName.doSomething`. + * + * ## Promises + * + * Bridge modules can also define methods that are exported to JavaScript as + * methods that return a Promise, and are compatible with JS async functions. + * + * Declare the last two parameters of your native method to be a resolver block + * and a rejecter block. The resolver block must precede the rejecter block. + * + * For example: + * + * RCT_EXPORT_METHOD(doSomethingAsync:(NSString *)aString + * resolver:(RCTPromiseResolveBlock)resolve + * rejecter:(RCTPromiseRejectBlock)reject + * { ... } + * + * Calling `NativeModules.ModuleName.doSomethingAsync(aString)` from + * JavaScript will return a promise that is resolved or rejected when your + * native method implementation calls the respective block. + * + */ +#define RCT_EXPORT_METHOD(method) RCT_REMAP_METHOD(, method) + +/** + * Same as RCT_EXPORT_METHOD but the method is called from JS + * synchronously **on the JS thread**, possibly returning a result. + * + * WARNING: in the vast majority of cases, you should use RCT_EXPORT_METHOD which + * allows your native module methods to be called asynchronously: calling + * methods synchronously can have strong performance penalties and introduce + * threading-related bugs to your native modules. + * + * The return type must be of object type (id) and should be serializable + * to JSON. This means that the hook can only return nil or JSON values + * (e.g. NSNumber, NSString, NSArray, NSDictionary). + * + * Calling these methods when running under the websocket executor + * is currently not supported. + */ +#define RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(method) RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(id, method) + +#define RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(returnType, method) \ + RCT_REMAP_BLOCKING_SYNCHRONOUS_METHOD(, returnType, method) + +/** + * Similar to RCT_EXPORT_METHOD but lets you set the JS name of the exported + * method. Example usage: + * + * RCT_REMAP_METHOD(executeQueryWithParameters, + * executeQuery:(NSString *)query parameters:(NSDictionary *)parameters) + * { ... } + */ +#define RCT_REMAP_METHOD(js_name, method) \ + _RCT_EXTERN_REMAP_METHOD(js_name, method, NO) \ + -(void)method RCT_DYNAMIC; + +/** + * Similar to RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD but lets you set + * the JS name of the exported method. Example usage: + * + * RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(executeQueryWithParameters, + * executeQuery:(NSString *)query parameters:(NSDictionary *)parameters) + * { ... } + */ +#define RCT_REMAP_BLOCKING_SYNCHRONOUS_METHOD(js_name, returnType, method) \ + _RCT_EXTERN_REMAP_METHOD(js_name, method, YES) \ + -(returnType)method RCT_DYNAMIC; + +/** + * Use this macro in a private Objective-C implementation file to automatically + * register an external module with the bridge when it loads. This allows you to + * register Swift or private Objective-C classes with the bridge. + * + * For example if one wanted to export a Swift class to the bridge: + * + * MyModule.swift: + * + * @objc(MyModule) class MyModule: NSObject { + * + * @objc func doSomething(string: String! withFoo a: Int, bar b: Int) { ... } + * + * } + * + * MyModuleExport.m: + * + * #import + * + * @interface RCT_EXTERN_MODULE(MyModule, NSObject) + * + * RCT_EXTERN_METHOD(doSomething:(NSString *)string withFoo:(NSInteger)a bar:(NSInteger)b) + * + * @end + * + * This will now expose MyModule and the method to JavaScript via + * `NativeModules.MyModule.doSomething` + */ +#define RCT_EXTERN_MODULE(objc_name, objc_supername) RCT_EXTERN_REMAP_MODULE(, objc_name, objc_supername) + +/** + * Like RCT_EXTERN_MODULE, but allows setting a custom JavaScript name. + */ +#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \ + objc_name: \ + objc_supername @ \ + end @interface objc_name(RCTExternModule) \ + @end \ + @implementation objc_name (RCTExternModule) \ + RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) + +/** + * Use this macro in accordance with RCT_EXTERN_MODULE to export methods + * of an external module. + */ +#define RCT_EXTERN_METHOD(method) _RCT_EXTERN_REMAP_METHOD(, method, NO) + +/** + * Use this macro in accordance with RCT_EXTERN_MODULE to export methods + * of an external module that should be invoked synchronously. + */ +#define RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(method) _RCT_EXTERN_REMAP_METHOD(, method, YES) + +/** + * Like RCT_EXTERN_REMAP_METHOD, but allows setting a custom JavaScript name + * and also whether this method is synchronous. + */ +#define _RCT_EXTERN_REMAP_METHOD(js_name, method, is_blocking_synchronous_method) \ + +(const RCTMethodInfo *)RCT_CONCAT(__rct_export__, RCT_CONCAT(js_name, RCT_CONCAT(__LINE__, __COUNTER__))) \ + { \ + static RCTMethodInfo config = {#js_name, #method, is_blocking_synchronous_method}; \ + return &config; \ + } + +/** + * Most modules can be used from any thread. All of the modules exported non-sync method will be called on its + * methodQueue, and the module will be constructed lazily when its first invoked. Some modules have main need to access + * information that's main queue only (e.g. most UIKit classes). Since we don't want to dispatch synchronously to the + * main thread to this safely, we construct these modules and export their constants ahead-of-time. + * + * Note that when set to false, the module constructor will be called from any thread. + * + * This requirement is currently inferred by checking if the module has a custom initializer or if there's exported + * constants. In the future, we'll stop automatically inferring this and instead only rely on this method. + */ ++ (BOOL)requiresMainQueueSetup; + +/** + * Injects methods into JS. Entries in this array are used in addition to any + * methods defined using the macros above. This method is called only once, + * before registration. + */ +- (NSArray> *)methodsToExport; + +/** + * Injects constants into JS. These constants are made accessible via NativeModules.ModuleName.X. It is only called once + * for the lifetime of the bridge, so it is not suitable for returning dynamic values, but may be used for long-lived + * values such as session keys, that are regenerated only as part of a reload of the entire React application. + * + * If you implement this method and do not implement `requiresMainQueueSetup`, you will trigger deprecated logic + * that eagerly initializes your module on bridge startup. In the future, this behaviour will be changed to default + * to initializing lazily, and even modules with constants will be initialized lazily. + */ +- (NSDictionary *)constantsToExport; + +/** + * Notifies the module that a batch of JS method invocations has just completed. + */ +- (void)batchDidComplete; + +/** + * Notifies the module that the active batch of JS method invocations has been + * partially flushed. + * + * This occurs before -batchDidComplete, and more frequently. + */ +- (void)partialBatchDidFlush; + +@end + +/** + * A protocol that allows TurboModules to do lookup on other TurboModules. + * Calling these methods may cause a module to be synchronously instantiated. + */ +@protocol RCTTurboModuleRegistry +- (id)moduleForName:(const char *)moduleName; + +/** + * Rationale: + * When TurboModules lookup other modules by name, we first check the TurboModule + * registry to see if a TurboModule exists with the respective name. In this case, + * we don't want a RedBox to be raised if the TurboModule isn't found. + * + * This method is deprecated and will be deleted after the migration from + * TurboModules to TurboModules is complete. + */ +- (id)moduleForName:(const char *)moduleName warnOnLookupFailure:(BOOL)warnOnLookupFailure; +- (BOOL)moduleIsInitialized:(const char *)moduleName; + +- (NSArray *)eagerInitModuleNames; +- (NSArray *)eagerInitMainQueueModuleNames; +@end + +/** + * Experimental. + * A protocol to declare that a class supports TurboModule. + * This may be removed in the future. + * See RCTTurboModule.h for actual signature. + */ +@protocol RCTTurboModule; + +/** + * A class that allows NativeModules and TurboModules to look up one another. + */ +@interface RCTModuleRegistry : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setTurboModuleRegistry:(id)turboModuleRegistry; + +- (id)moduleForName:(const char *)moduleName; +- (id)moduleForName:(const char *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad; +@end + +typedef void (^RCTBridgelessBundleURLSetter)(NSURL *bundleURL); +typedef NSURL * (^RCTBridgelessBundleURLGetter)(void); + +/** + * A class that allows NativeModules/TurboModules to read/write the bundleURL, with or without the bridge. + */ +@interface RCTBundleManager : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setBridgelessBundleURLGetter:(RCTBridgelessBundleURLGetter)getter + andSetter:(RCTBridgelessBundleURLSetter)setter + andDefaultGetter:(RCTBridgelessBundleURLGetter)defaultGetter; +- (void)resetBundleURL; +@property NSURL *bundleURL; +@end + +typedef UIView * (^RCTBridgelessComponentViewProvider)(NSNumber *); + +/** + * A class that allows NativeModules to query for views, given React Tags. + */ +@interface RCTViewRegistry : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setBridgelessComponentViewProvider:(RCTBridgelessComponentViewProvider)bridgelessComponentViewProvider; + +- (UIView *)viewForReactTag:(NSNumber *)reactTag; +@end + +typedef void (^RCTBridgelessJSModuleMethodInvoker)( + NSString *moduleName, + NSString *methodName, + NSArray *args, + dispatch_block_t onComplete); + +/** + * A class that allows NativeModules to call methods on JavaScript modules registered + * as callable with React Native. + */ +@interface RCTCallableJSModules : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setBridgelessJSModuleMethodInvoker:(RCTBridgelessJSModuleMethodInvoker)bridgelessJSModuleMethodInvoker; + +- (void)invokeModule:(NSString *)moduleName method:(NSString *)methodName withArgs:(NSArray *)args; +- (void)invokeModule:(NSString *)moduleName + method:(NSString *)methodName + withArgs:(NSArray *)args + onComplete:(dispatch_block_t)onComplete; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBundleURLProvider.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBundleURLProvider.h new file mode 100644 index 0000000..26fbbd0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTBundleURLProvider.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTDefines.h" + +RCT_EXTERN NSString *const RCTBundleURLProviderUpdatedNotification; +RCT_EXTERN const NSUInteger kRCTBundleURLProviderDefaultPort; + +#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY +/** + * Allow/disallow accessing the packager server for various runtime scenario. + * For instance, if a test run should never access the packager, disable it + * by calling this function before initializing React Native (RCTBridge etc). + * By default the access is enabled. + */ +RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); +#endif + +@interface RCTBundleURLProvider : NSObject + +/** + * Set default settings on NSUserDefaults. + */ +- (void)setDefaults; + +/** + * Reset every settings to default. + */ +- (void)resetToDefaults; + +/** + * Return the server host. If its a development build and there's no jsLocation defined, + * it will return the server host IP address + */ +- (NSString *)packagerServerHost; + +/** + * Return the server host with optional port. If its a development build and there's no jsLocation defined, + * it will return the server host IP address + */ +- (NSString *)packagerServerHostPort; + +/** + * Returns if there's a packager running at the given host port. + * The port is optional, if not specified, kRCTBundleURLProviderDefaultPort will be used + */ ++ (BOOL)isPackagerRunning:(NSString *)hostPort; + +/** + * Returns if there's a packager running at the given scheme://host:port. + * The port is optional, if not specified, kRCTBundleURLProviderDefaultPort will be used + * The scheme is also optional, if not specified, a default http protocol will be used + */ ++ (BOOL)isPackagerRunning:(NSString *)hostPort scheme:(NSString *)scheme; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle if the packager is not running. + */ +- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackURLProvider:(NSURL * (^)(void))fallbackURLProvider; + +/** + * Returns the jsBundleURL for a given split bundle entrypoint in development + */ +- (NSURL *)jsBundleURLForSplitBundleRoot:(NSString *)bundleRoot; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle if the packager is not running. + * if resourceName or extension are nil, "main" and "jsbundle" will be + * used, respectively. + */ +- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + fallbackResource:(NSString *)resourceName + fallbackExtension:(NSString *)extension; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle if the packager is not running. + */ +- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackResource:(NSString *)resourceName; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle. If resourceName or extension + * are nil, "main" and "jsbundle" will be used, respectively. + */ +- (NSURL *)jsBundleURLForFallbackResource:(NSString *)resourceName fallbackExtension:(NSString *)extension; + +/** + * Returns the resourceURL for a given bundle entrypoint and + * the fallback offline resource file if the packager is not running. + */ +- (NSURL *)resourceURLForResourceRoot:(NSString *)root + resourceName:(NSString *)name + resourceExtension:(NSString *)extension + offlineBundle:(NSBundle *)offlineBundle; + +/** + * The IP address or hostname of the packager. + */ +@property (nonatomic, copy) NSString *jsLocation; + +@property (nonatomic, assign) BOOL enableMinification; +@property (nonatomic, assign) BOOL enableDev; + +/** + * The scheme/protocol used of the packager, the default is the http protocol + */ +@property (nonatomic, copy) NSString *packagerScheme; + ++ (instancetype)sharedSettings; + +/** + * Given a hostname for the packager and a bundle root, returns the URL to the js bundle. Generally you should use the + * instance method -jsBundleURLForBundleRoot:fallbackResource: which includes logic to guess if the packager is running + * and fall back to a pre-packaged bundle if it is not. + * + * The options here mirror some of Metro's Bundling Options: + * - enableDev: Whether to keep or remove `__DEV__` blocks from the bundle. + * - enableMinification: Enables or disables minification. Usually production bundles are minified and development + * bundles are not. + * - modulesOnly: When true, will only send module definitions without polyfills and without the require-runtime. + * - runModule: When true, will run the main module after defining all modules. This is used in the main bundle but not + * in split bundles. + */ ++ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerHost:(NSString *)packagerHost + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification; + ++ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerHost:(NSString *)packagerHost + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification + modulesOnly:(BOOL)modulesOnly + runModule:(BOOL)runModule; + ++ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerHost:(NSString *)packagerHost + packagerScheme:(NSString *)scheme + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification + modulesOnly:(BOOL)modulesOnly + runModule:(BOOL)runModule; +/** + * Given a hostname for the packager and a resource path (including "/"), return the URL to the resource. + * In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged + * resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle: + */ ++ (NSURL *)resourceURLForResourcePath:(NSString *)path packagerHost:(NSString *)packagerHost query:(NSString *)query; + ++ (NSURL *)resourceURLForResourcePath:(NSString *)path + packagerHost:(NSString *)packagerHost + scheme:(NSString *)scheme + query:(NSString *)query; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTClipboard.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTClipboard.h new file mode 100644 index 0000000..1dd9789 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTClipboard.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTClipboard : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponent.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponent.h new file mode 100644 index 0000000..4258334 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponent.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * These block types can be used for mapping input event handlers from JS to view + * properties. Unlike JS method callbacks, these can be called multiple times. + */ +typedef void (^RCTDirectEventBlock)(NSDictionary *body); +typedef void (^RCTBubblingEventBlock)(NSDictionary *body); + +/** + * Logical node in a tree of application components. Both `ShadowView` and + * `UIView` conforms to this. Allows us to write utilities that reason about + * trees generally. + */ +@protocol RCTComponent + +@property (nonatomic, copy) NSNumber *reactTag; +@property (nonatomic, copy) NSNumber *rootTag; + +- (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; +- (void)removeReactSubview:(id)subview; +- (NSArray> *)reactSubviews; +- (id)reactSuperview; +- (NSNumber *)reactTagAtPoint:(CGPoint)point; + +// View/ShadowView is a root view +- (BOOL)isReactRootView; + +/** + * Called each time props have been set. + * Not all props have to be set - React can set only changed ones. + * @param changedProps String names of all set props. + */ +- (void)didSetProps:(NSArray *)changedProps; + +/** + * Called each time subviews have been updated + */ +- (void)didUpdateReactSubviews; + +@end + +// TODO: this is kinda dumb - let's come up with a +// better way of identifying root React views please! +static inline BOOL RCTIsReactRootView(NSNumber *reactTag) +{ + return reactTag.integerValue % 10 == 1; +} diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponentData.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponentData.h new file mode 100644 index 0000000..6a1fdb7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponentData.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; +@class RCTShadowView; +@class UIView; +@class RCTEventDispatcherProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTComponentData : NSObject + +@property (nonatomic, readonly) Class managerClass; +@property (nonatomic, copy, readonly) NSString *name; +@property (nonatomic, weak, readonly) RCTViewManager *manager; +/* + * When running React Native with the bridge, view managers are retained by the + * bridge. When running in bridgeless mode, allocate and retain view managers + * in this class. + */ +@property (nonatomic, strong, readonly) RCTViewManager *bridgelessViewManager; + +- (instancetype)initWithManagerClass:(Class)managerClass + bridge:(RCTBridge *)bridge + eventDispatcher:(id)eventDispatcher NS_DESIGNATED_INITIALIZER; + +- (UIView *)createViewWithTag:(nullable NSNumber *)tag rootTag:(nullable NSNumber *)rootTag; +- (RCTShadowView *)createShadowViewWithTag:(NSNumber *)tag; +- (void)setProps:(NSDictionary *)props forView:(id)view; +- (void)setProps:(NSDictionary *)props forShadowView:(RCTShadowView *)shadowView; + +@property (nonatomic, copy, nullable) void (^eventInterceptor) + (NSString *eventName, NSDictionary *event, NSNumber *reactTag); + +- (NSDictionary *)viewConfig; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponentEvent.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponentEvent.h new file mode 100644 index 0000000..0467f8c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTComponentEvent.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Generic untyped event for Components. Used internally by RCTDirectEventBlock and + * RCTBubblingEventBlock, for other use cases prefer using a class that implements + * RCTEvent to have a type safe way to initialize it. + */ +@interface RCTComponentEvent : NSObject + +- (instancetype)initWithName:(NSString *)name viewTag:(NSNumber *)viewTag body:(NSDictionary *)body; + +NS_ASSUME_NONNULL_END + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConstants.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConstants.h new file mode 100644 index 0000000..c92fc10 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConstants.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotification; +RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey; + +/* + * Preemptive View Allocation + */ +RCT_EXTERN BOOL RCTExperimentGetPreemptiveViewAllocationDisabled(void); +RCT_EXTERN void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value); + +/* + * Remove clipped subviews + */ +RCT_EXTERN BOOL RCTGetRemoveClippedSubviewsEnabled(void); +RCT_EXTERN void RCTSetRemoveClippedSubviewsEnabled(BOOL value); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+CoreLocation.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+CoreLocation.h new file mode 100644 index 0000000..251202f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+CoreLocation.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTConvert (CoreLocation) + ++ (CLLocationDegrees)CLLocationDegrees:(id)json; ++ (CLLocationDistance)CLLocationDistance:(id)json; ++ (CLLocationCoordinate2D)CLLocationCoordinate2D:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+Text.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+Text.h new file mode 100644 index 0000000..eafbdb3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+Text.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTConvert (Text) + ++ (UITextAutocorrectionType)UITextAutocorrectionType:(nullable id)json; ++ (UITextSpellCheckingType)UITextSpellCheckingType:(nullable id)json; ++ (RCTTextTransform)RCTTextTransform:(nullable id)json; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+Transform.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+Transform.h new file mode 100644 index 0000000..07a7b2c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert+Transform.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTConvert.h" + +@interface RCTConvert (Transform) + ++ (CATransform3D)CATransform3D:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert.h new file mode 100644 index 0000000..09a380e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTConvert.h @@ -0,0 +1,263 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#if TARGET_OS_IPHONE +#import +#endif + +/** + * This class provides a collection of conversion functions for mapping + * JSON objects to native types and classes. These are useful when writing + * custom RCTViewManager setter methods. + */ +@interface RCTConvert : NSObject + ++ (id)id:(id)json; + ++ (BOOL)BOOL:(id)json; ++ (double)double:(id)json; ++ (float)float:(id)json; ++ (int)int:(id)json; + ++ (int64_t)int64_t:(id)json; ++ (uint64_t)uint64_t:(id)json; + ++ (NSInteger)NSInteger:(id)json; ++ (NSUInteger)NSUInteger:(id)json; + ++ (NSArray *)NSArray:(id)json; ++ (NSDictionary *)NSDictionary:(id)json; ++ (NSString *)NSString:(id)json; ++ (NSNumber *)NSNumber:(id)json; + ++ (NSSet *)NSSet:(id)json; ++ (NSData *)NSData:(id)json; ++ (NSIndexSet *)NSIndexSet:(id)json; + ++ (NSURLRequestCachePolicy)NSURLRequestCachePolicy:(id)json; ++ (NSURL *)NSURL:(id)json; ++ (NSURLRequest *)NSURLRequest:(id)json; + +typedef NSURL RCTFileURL; ++ (RCTFileURL *)RCTFileURL:(id)json; + ++ (NSDate *)NSDate:(id)json; ++ (NSLocale *)NSLocale:(id)json; ++ (NSTimeZone *)NSTimeZone:(id)json; ++ (NSTimeInterval)NSTimeInterval:(id)json; + ++ (NSLineBreakMode)NSLineBreakMode:(id)json; ++ (NSTextAlignment)NSTextAlignment:(id)json; ++ (NSUnderlineStyle)NSUnderlineStyle:(id)json; ++ (NSWritingDirection)NSWritingDirection:(id)json; ++ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; ++ (UITextFieldViewMode)UITextFieldViewMode:(id)json; ++ (UIKeyboardType)UIKeyboardType:(id)json; ++ (UIKeyboardAppearance)UIKeyboardAppearance:(id)json; ++ (UIReturnKeyType)UIReturnKeyType:(id)json; +#if !TARGET_OS_TV ++ (UIDataDetectorTypes)UIDataDetectorTypes:(id)json; +#endif + +#if TARGET_OS_IPHONE ++ (WKDataDetectorTypes)WKDataDetectorTypes:(id)json; +#endif + ++ (UIViewContentMode)UIViewContentMode:(id)json; +#if !TARGET_OS_TV ++ (UIBarStyle)UIBarStyle:(id)json; +#endif + ++ (CGFloat)CGFloat:(id)json; ++ (CGPoint)CGPoint:(id)json; ++ (CGSize)CGSize:(id)json; ++ (CGRect)CGRect:(id)json; ++ (UIEdgeInsets)UIEdgeInsets:(id)json; + ++ (CGLineCap)CGLineCap:(id)json; ++ (CGLineJoin)CGLineJoin:(id)json; + ++ (CGAffineTransform)CGAffineTransform:(id)json; + ++ (UIColor *)UIColor:(id)json; ++ (CGColorRef)CGColor:(id)json CF_RETURNS_NOT_RETAINED; + ++ (YGValue)YGValue:(id)json; + ++ (NSArray *)NSArrayArray:(id)json; ++ (NSArray *)NSStringArray:(id)json; ++ (NSArray *> *)NSStringArrayArray:(id)json; ++ (NSArray *)NSDictionaryArray:(id)json; ++ (NSArray *)NSURLArray:(id)json; ++ (NSArray *)RCTFileURLArray:(id)json; ++ (NSArray *)NSNumberArray:(id)json; ++ (NSArray *)UIColorArray:(id)json; + +typedef NSArray CGColorArray; ++ (CGColorArray *)CGColorArray:(id)json; + +/** + * Convert a JSON object to a Plist-safe equivalent by stripping null values. + */ +typedef id NSPropertyList; ++ (NSPropertyList)NSPropertyList:(id)json; + +typedef BOOL css_backface_visibility_t; ++ (YGOverflow)YGOverflow:(id)json; ++ (YGDisplay)YGDisplay:(id)json; ++ (css_backface_visibility_t)css_backface_visibility_t:(id)json; ++ (YGFlexDirection)YGFlexDirection:(id)json; ++ (YGJustify)YGJustify:(id)json; ++ (YGAlign)YGAlign:(id)json; ++ (YGPositionType)YGPositionType:(id)json; ++ (YGWrap)YGWrap:(id)json; ++ (YGDirection)YGDirection:(id)json; + ++ (RCTPointerEvents)RCTPointerEvents:(id)json; ++ (RCTAnimationType)RCTAnimationType:(id)json; ++ (RCTBorderStyle)RCTBorderStyle:(id)json; ++ (RCTTextDecorationLineType)RCTTextDecorationLineType:(id)json; + +@end + +@interface RCTConvert (Deprecated) + +/** + * Use lightweight generics syntax instead, e.g. NSArray + */ +typedef NSArray NSArrayArray __deprecated_msg("Use NSArray"); +typedef NSArray NSStringArray __deprecated_msg("Use NSArray"); +typedef NSArray NSStringArrayArray __deprecated_msg("Use NSArray *>"); +typedef NSArray NSDictionaryArray __deprecated_msg("Use NSArray"); +typedef NSArray NSURLArray __deprecated_msg("Use NSArray"); +typedef NSArray RCTFileURLArray __deprecated_msg("Use NSArray"); +typedef NSArray NSNumberArray __deprecated_msg("Use NSArray"); +typedef NSArray UIColorArray __deprecated_msg("Use NSArray"); + +/** + * Synchronous image loading is generally a bad idea for performance reasons. + * If you need to pass image references, try to use `RCTImageSource` and then + * `RCTImageLoader` instead of converting directly to a UIImage. + */ ++ (UIImage *)UIImage:(id)json; ++ (CGImageRef)CGImage:(id)json CF_RETURNS_NOT_RETAINED; + +@end + +/** + * Underlying implementations of RCT_XXX_CONVERTER macros. Ignore these. + */ +RCT_EXTERN NSNumber *RCTConvertEnumValue(const char *, NSDictionary *, NSNumber *, id); +RCT_EXTERN NSNumber *RCTConvertMultiEnumValue(const char *, NSDictionary *, NSNumber *, id); +RCT_EXTERN NSArray *RCTConvertArrayValue(SEL, id); + +/** + * This macro is used for logging conversion errors. This is just used to + * avoid repeating the same boilerplate for every error message. + */ +#define RCTLogConvertError(json, typeName) \ + RCTLogError(@"JSON value '%@' of type %@ cannot be converted to %@", json, [json classForCoder], typeName) + +/** + * This macro is used for creating simple converter functions that just call + * the specified getter method on the json value. + */ +#define RCT_CONVERTER(type, name, getter) RCT_CUSTOM_CONVERTER(type, name, [json getter]) + +/** + * This macro is used for creating converter functions with arbitrary logic. + */ +#define RCT_CUSTOM_CONVERTER(type, name, code) \ + +(type)name : (id)json RCT_DYNAMIC \ + { \ + if (!RCT_DEBUG) { \ + return code; \ + } else { \ + @try { \ + return code; \ + } @catch (__unused NSException * e) { \ + RCTLogConvertError(json, @ #type); \ + json = nil; \ + return code; \ + } \ + } \ + } + +/** + * This macro is similar to RCT_CONVERTER, but specifically geared towards + * numeric types. It will handle string input correctly, and provides more + * detailed error reporting if an invalid value is passed in. + */ +#define RCT_NUMBER_CONVERTER(type, getter) \ + RCT_CUSTOM_CONVERTER(type, type, [RCT_DEBUG ? [self NSNumber:json] : json getter]) + +/** + * When using RCT_ENUM_CONVERTER in ObjC, the compiler is OK with us returning + * the underlying NSInteger/NSUInteger. In ObjC++, this is a type mismatch and + * we need to explicitly cast the return value to expected enum return type. + */ +#ifdef __cplusplus +#define _RCT_CAST(type, expr) static_cast(expr) +#else +#define _RCT_CAST(type, expr) expr +#endif + +/** + * This macro is used for creating converters for enum types. + */ +#define RCT_ENUM_CONVERTER(type, values, default, getter) \ + +(type)type : (id)json RCT_DYNAMIC \ + { \ + static NSDictionary *mapping; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ + return _RCT_CAST(type, [RCTConvertEnumValue(#type, mapping, @(default), json) getter]); \ + } + +/** + * This macro is used for creating converters for enum types for + * multiple enum values combined with | operator + */ +#define RCT_MULTI_ENUM_CONVERTER(type, values, default, getter) \ + +(type)type : (id)json RCT_DYNAMIC \ + { \ + static NSDictionary *mapping; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ + return _RCT_CAST(type, [RCTConvertMultiEnumValue(#type, mapping, @(default), json) getter]); \ + } + +/** + * This macro is used for creating explicitly-named converter functions + * for typed arrays. + */ +#define RCT_ARRAY_CONVERTER_NAMED(type, name) \ + +(NSArray *)name##Array : (id)json RCT_DYNAMIC \ + { \ + return RCTConvertArrayValue(@selector(name:), json); \ + } + +/** + * This macro is used for creating converter functions for typed arrays. + * RCT_ARRAY_CONVERTER_NAMED may be used when type contains characters + * which are disallowed in selector names. + */ +#define RCT_ARRAY_CONVERTER(type) RCT_ARRAY_CONVERTER_NAMED(type, type) diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTCxxConvert.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTCxxConvert.h new file mode 100644 index 0000000..261e61f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTCxxConvert.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * This class provides a collection of conversion functions for mapping + * JSON objects to cxx types. Extensible via categories. + * Convert methods are expected to return cxx objects wrapped in RCTManagedPointer. + */ + +@interface RCTCxxConvert : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDataRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDataRequestHandler.h new file mode 100644 index 0000000..f0b2c68 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDataRequestHandler.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * This is the default RCTURLRequestHandler implementation for data URL requests. + */ +@interface RCTDataRequestHandler : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDatePicker.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDatePicker.h new file mode 100644 index 0000000..14f9a2e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDatePicker.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTDatePicker : UIDatePicker + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDatePickerManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDatePickerManager.h new file mode 100644 index 0000000..bd14cd3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDatePickerManager.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTConvert (UIDatePicker) + ++ (UIDatePickerMode)UIDatePickerMode:(id)json; + +@end + +@interface RCTDatePickerManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDecayAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDecayAnimation.h new file mode 100644 index 0000000..e68450e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDecayAnimation.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimationDriver.h" + +@interface RCTDecayAnimation : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDefines.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDefines.h new file mode 100644 index 0000000..4b9517e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDefines.h @@ -0,0 +1,163 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __OBJC__ +#import +#endif + +/** + * Make global functions usable in C++ + */ +#if defined(__cplusplus) +#define RCT_EXTERN extern "C" __attribute__((visibility("default"))) +#define RCT_EXTERN_C_BEGIN extern "C" { +#define RCT_EXTERN_C_END } +#else +#define RCT_EXTERN extern __attribute__((visibility("default"))) +#define RCT_EXTERN_C_BEGIN +#define RCT_EXTERN_C_END +#endif + +/** + * The RCT_DEBUG macro can be used to exclude error checking and logging code + * from release builds to improve performance and reduce binary size. + */ +#ifndef RCT_DEBUG +#if DEBUG +#define RCT_DEBUG 1 +#else +#define RCT_DEBUG 0 +#endif +#endif + +/** + * The RCT_DEV macro can be used to enable or disable development tools + * such as the debug executors, dev menu, red box, etc. + */ +#ifndef RCT_DEV +#if DEBUG +#define RCT_DEV 1 +#else +#define RCT_DEV 0 +#endif +#endif + +/** + * RCT_DEV_MENU can be used to toggle the dev menu separately from RCT_DEV. + * By default though, it will inherit from RCT_DEV. + */ +#ifndef RCT_DEV_MENU +#define RCT_DEV_MENU RCT_DEV +#endif + +/** + * Controls for the core packgaer loading functionality + * By default, this inherits from RCT_DEV_MENU but it also gives the capability to + * enable the packager functionality without the rest of the dev tools from RCT_DEV_MENU + */ +#ifndef RCT_ENABLE_LOADING_FROM_PACKAGER +#define RCT_ENABLE_LOADING_FROM_PACKAGER RCT_DEV_MENU +#endif + +#ifndef RCT_ENABLE_INSPECTOR +#if RCT_DEV && __has_include() +#define RCT_ENABLE_INSPECTOR 1 +#else +#define RCT_ENABLE_INSPECTOR 0 +#endif +#endif + +#ifndef RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION +#if RCT_DEV && (__has_include("RCTPackagerConnection.h") || __has_include()) +#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 1 +#else +#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 0 +#endif +#endif + +#if RCT_DEV +#define RCT_IF_DEV(...) __VA_ARGS__ +#else +#define RCT_IF_DEV(...) +#endif + +#ifndef RCT_PROFILE +#define RCT_PROFILE RCT_DEV +#endif + +/** + * Add the default Metro packager port number + */ +#ifndef RCT_METRO_PORT +#define RCT_METRO_PORT 8081 +#else +// test if RCT_METRO_PORT is empty +#define RCT_METRO_PORT_DO_EXPAND(VAL) VAL##1 +#define RCT_METRO_PORT_EXPAND(VAL) RCT_METRO_PORT_DO_EXPAND(VAL) +#if !defined(RCT_METRO_PORT) || (RCT_METRO_PORT_EXPAND(RCT_METRO_PORT) == 1) +// Only here if RCT_METRO_PORT is not defined +// OR RCT_METRO_PORT is the empty string +#undef RCT_METRO_PORT +#define RCT_METRO_PORT 8081 +#endif +#endif + +/** + * Add the default packager name + */ +#ifndef RCT_PACKAGER_NAME +#define RCT_PACKAGER_NAME @"Metro" +#endif + +/** + * By default, only raise an NSAssertion in debug mode + * (custom assert functions will still be called). + */ +#ifndef RCT_NSASSERT +#define RCT_NSASSERT RCT_DEBUG +#endif + +/** + * Concat two literals. Supports macro expansions, + * e.g. RCT_CONCAT(foo, __FILE__). + */ +#define RCT_CONCAT2(A, B) A##B +#define RCT_CONCAT(A, B) RCT_CONCAT2(A, B) + +/** + * This attribute is used for static analysis. + */ +#if !defined RCT_DYNAMIC +#if __has_attribute(objc_dynamic) +#define RCT_DYNAMIC __attribute__((objc_dynamic)) +#else +#define RCT_DYNAMIC +#endif +#endif + +/** + * Throw an assertion for unimplemented methods. + */ +#define RCT_NOT_IMPLEMENTED(method) \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wmissing-method-return-type\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-parameter\"") \ + RCT_EXTERN NSException *_RCTNotImplementedException(SEL, Class); \ + method NS_UNAVAILABLE \ + { \ + @throw _RCTNotImplementedException(_cmd, [self class]); \ + } \ + _Pragma("clang diagnostic pop") + +/** + * Controls for activating the new architecture without the legacy system. + * Note: this is work in progress. + */ +#ifdef REACT_NATIVE_FORCE_NEW_ARCHITECTURE +#define RCT_NEW_ARCHITECTURE 1 +#else +#define RCT_NEW_ARCHITECTURE 0 +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingView.h new file mode 100644 index 0000000..da5ad2d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingView.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTDevLoadingView : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingViewProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingViewProtocol.h new file mode 100644 index 0000000..001a18e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingViewProtocol.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTLoadingProgress; + +@protocol RCTDevLoadingViewProtocol ++ (void)setEnabled:(BOOL)enabled; +- (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor; +- (void)showWithURL:(NSURL *)URL; +- (void)updateProgress:(RCTLoadingProgress *)progress; +- (void)hide; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingViewSetEnabled.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingViewSetEnabled.h new file mode 100644 index 0000000..1ad1825 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevLoadingViewSetEnabled.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +RCT_EXTERN void RCTDevLoadingViewSetEnabled(BOOL enabled); +RCT_EXTERN BOOL RCTDevLoadingViewGetEnabled(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevMenu.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevMenu.h new file mode 100644 index 0000000..b322afb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevMenu.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +#if RCT_DEV_MENU + +RCT_EXTERN NSString *const RCTShowDevMenuNotification; + +#endif + +@class RCTDevMenuItem; + +/** + * Developer menu, useful for exposing extra functionality when debugging. + */ +@interface RCTDevMenu : NSObject + +/** + * Deprecated, use RCTDevSettings instead. + */ +@property (nonatomic, assign) BOOL shakeToShow DEPRECATED_ATTRIBUTE; + +/** + * Deprecated, use RCTDevSettings instead. + */ +@property (nonatomic, assign) BOOL profilingEnabled DEPRECATED_ATTRIBUTE; + +/** + * Deprecated, use RCTDevSettings instead. + */ +@property (nonatomic, assign) BOOL hotLoadingEnabled DEPRECATED_ATTRIBUTE; + +/** + * Presented items in development menu + */ +@property (nonatomic, copy, readonly) NSArray *presentedItems; + +/** + * Detect if actions sheet (development menu) is shown + */ +- (BOOL)isActionSheetShown; + +/** + * Manually show the dev menu (can be called from JS). + */ +- (void)show; + +/** + * Deprecated, use `RCTReloadCommand` instead. + */ +- (void)reload DEPRECATED_ATTRIBUTE; + +/** + * Deprecated. Use the `-addItem:` method instead. + */ +- (void)addItem:(NSString *)title handler:(void (^)(void))handler DEPRECATED_ATTRIBUTE; + +/** + * Add custom item to the development menu. The handler will be called + * when user selects the item. + */ +- (void)addItem:(RCTDevMenuItem *)item; + +@end + +typedef NSString * (^RCTDevMenuItemTitleBlock)(void); + +/** + * Developer menu item, used to expose additional functionality via the menu. + */ +@interface RCTDevMenuItem : NSObject + +/** + * This creates an item with a simple push-button interface, used to trigger an + * action. + */ ++ (instancetype)buttonItemWithTitle:(NSString *)title handler:(dispatch_block_t)handler; + +/** + * This creates an item with a simple push-button interface, used to trigger an + * action. getTitleForPresentation is called each time the item is about to be + * presented, and should return the item's title. + */ ++ (instancetype)buttonItemWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock handler:(dispatch_block_t)handler; + +@end + +/** + * This category makes the developer menu instance available via the + * RCTBridge, which is useful for any class that needs to access the menu. + */ +@interface RCTBridge (RCTDevMenu) + +@property (nonatomic, readonly) RCTDevMenu *devMenu; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevSettings.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevSettings.h new file mode 100644 index 0000000..9661caf --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevSettings.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import + +@protocol RCTPackagerClientMethod; + +/** + * An abstraction for a key-value store to manage RCTDevSettings behavior. + * The default implementation persists settings using NSUserDefaults. + */ +@protocol RCTDevSettingsDataSource + +/** + * Updates the setting with the given key to the given value. + * How the data source's state changes depends on the implementation. + */ +- (void)updateSettingWithValue:(id)value forKey:(NSString *)key; + +/** + * Returns the value for the setting with the given key. + */ +- (id)settingForKey:(NSString *)key; + +@end + +@protocol RCTDevSettingsInspectable + +/** + * Whether current jsi::Runtime is inspectable. + * Only set when using as a bridgeless turbo module. + */ +@property (nonatomic, assign, readwrite) BOOL isInspectable; + +@end + +@interface RCTDevSettings : RCTEventEmitter + +- (instancetype)initWithDataSource:(id)dataSource; + +@property (nonatomic, readonly) BOOL isHotLoadingAvailable; +@property (nonatomic, readonly) BOOL isRemoteDebuggingAvailable; +@property (nonatomic, readonly) BOOL isDeviceDebuggingAvailable; +@property (nonatomic, readonly) BOOL isJSCSamplingProfilerAvailable; + +/** + * Whether the bridge is connected to a remote JS executor. + */ +@property (nonatomic, assign) BOOL isDebuggingRemotely; + +/* + * Whether shaking will show RCTDevMenu. The menu is enabled by default if RCT_DEV=1, but + * you may wish to disable it so that you can provide your own shake handler. + */ +@property (nonatomic, assign) BOOL isShakeToShowDevMenuEnabled; + +/** + * Whether performance profiling is enabled. + */ +@property (nonatomic, assign, setter=setProfilingEnabled:) BOOL isProfilingEnabled; + +/** + * Whether hot loading is enabled. + */ +@property (nonatomic, assign, setter=setHotLoadingEnabled:) BOOL isHotLoadingEnabled; + +/** + * Enables starting of profiling sampler on launch + */ +@property (nonatomic, assign) BOOL startSamplingProfilerOnLaunch; + +/** + * Whether the element inspector is visible. + */ +@property (nonatomic, readonly) BOOL isElementInspectorShown; + +/** + * Whether the performance monitor is visible. + */ +@property (nonatomic, assign) BOOL isPerfMonitorShown; + +/** + * Toggle the element inspector. + */ +- (void)toggleElementInspector; + +/** + * Set up the HMRClient if loading the bundle from Metro. + */ +- (void)setupHMRClientWithBundleURL:(NSURL *)bundleURL; + +/** + * Register additional bundles with the HMRClient. + */ +- (void)setupHMRClientWithAdditionalBundleURL:(NSURL *)bundleURL; + +#if RCT_DEV_MENU +- (void)addHandler:(id)handler + forPackagerMethod:(NSString *)name __deprecated_msg("Use RCTPackagerConnection directly instead"); +#endif + +@end + +@interface RCTBridge (RCTDevSettings) + +@property (nonatomic, readonly) RCTDevSettings *devSettings; + +@end + +// In debug builds, the dev menu is enabled by default but it is further customizable using this method. +// However, this method only has an effect in builds where the dev menu is actually compiled in. +// (i.e. RCT_DEV or RCT_DEV_MENU is set) +RCT_EXTERN void RCTDevSettingsSetEnabled(BOOL enabled); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevSplitBundleLoader.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevSplitBundleLoader.h new file mode 100644 index 0000000..52a115c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDevSplitBundleLoader.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTDevSplitBundleLoader : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDeviceInfo.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDeviceInfo.h new file mode 100644 index 0000000..cef03be --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDeviceInfo.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTDeviceInfo : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDiffClampAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDiffClampAnimatedNode.h new file mode 100644 index 0000000..085fb3d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDiffClampAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTDiffClampAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDisplayLink.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDisplayLink.h new file mode 100644 index 0000000..1e79c0b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDisplayLink.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBridgeModule; +@class RCTModuleData; + +@interface RCTDisplayLink : NSObject + +- (instancetype)init; +- (void)invalidate; +- (void)registerModuleForFrameUpdates:(id)module withModuleData:(RCTModuleData *)moduleData; +- (void)addToRunLoop:(NSRunLoop *)runLoop; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDisplayWeakRefreshable.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDisplayWeakRefreshable.h new file mode 100644 index 0000000..c1ea105 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDisplayWeakRefreshable.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTDisplayRefreshable + +- (void)displayDidRefresh:(CADisplayLink *)displayLink; + +@end + +@interface RCTDisplayWeakRefreshable : NSObject + +@property (nonatomic, weak) id refreshable; + ++ (CADisplayLink *)displayLinkWithWeakRefreshable:(id)refreshable; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDivisionAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDivisionAnimatedNode.h new file mode 100644 index 0000000..006fd5a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTDivisionAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTDivisionAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTErrorCustomizer.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTErrorCustomizer.h new file mode 100644 index 0000000..aa65296 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTErrorCustomizer.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTErrorInfo; + +/** + * Provides an interface to customize React Native error messages and stack + * traces from exceptions. + */ +@protocol RCTErrorCustomizer + +/** + * Customizes the given error, returning the passed info argument if no + * customization is required. + */ +- (nonnull RCTErrorInfo *)customizeErrorInfo:(nonnull RCTErrorInfo *)info; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTErrorInfo.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTErrorInfo.h new file mode 100644 index 0000000..a5d74d8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTErrorInfo.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTJSStackFrame; + +/** + * An ObjC wrapper for React Native errors. + */ +@interface RCTErrorInfo : NSObject +@property (nonatomic, copy, readonly) NSString *errorMessage; +@property (nonatomic, copy, readonly) NSArray *stack; + +- (instancetype)initWithErrorMessage:(NSString *)errorMessage stack:(NSArray *)stack; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventAnimation.h new file mode 100644 index 0000000..c63c1f4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventAnimation.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTValueAnimatedNode.h" + +@interface RCTEventAnimation : NSObject + +@property (nonatomic, readonly, weak) RCTValueAnimatedNode *valueNode; + +- (instancetype)initWithEventPath:(NSArray *)eventPath + valueNode:(RCTValueAnimatedNode *)valueNode; + +- (void)updateWithEvent:(id)event; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventDispatcher.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventDispatcher.h new file mode 100644 index 0000000..bbcd643 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventDispatcher.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +/** + * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and + * provides some convenience methods for generating event calls. + */ +@interface RCTEventDispatcher : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventDispatcherProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventDispatcherProtocol.h new file mode 100644 index 0000000..913cf85 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventDispatcherProtocol.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * The threshold at which text inputs will start warning that the JS thread + * has fallen behind (resulting in poor input performance, missed keys, etc.) + */ +RCT_EXTERN const NSInteger RCTTextUpdateLagWarningThreshold; + +/** + * Takes an input event name and normalizes it to the form that is required + * by the events system (currently that means starting with the "top" prefix, + * but that's an implementation detail that may change in future). + */ +RCT_EXTERN NSString *RCTNormalizeInputEventName(NSString *eventName); + +typedef NS_ENUM(NSInteger, RCTTextEventType) { + RCTTextEventTypeFocus, + RCTTextEventTypeBlur, + RCTTextEventTypeChange, + RCTTextEventTypeSubmit, + RCTTextEventTypeEnd, + RCTTextEventTypeKeyPress +}; + +@protocol RCTEvent +@required + +@property (nonatomic, strong, readonly) NSNumber *viewTag; +@property (nonatomic, copy, readonly) NSString *eventName; + +- (BOOL)canCoalesce; + +/** used directly for doing a JS call */ ++ (NSString *)moduleDotMethod; + +/** must contain only JSON compatible values */ +- (NSArray *)arguments; + +@optional + +/** + * Coalescing related methods must only be implemented if canCoalesce + * returns YES. + */ +@property (nonatomic, assign, readonly) uint16_t coalescingKey; +- (id)coalesceWithEvent:(id)newEvent; + +@end + +/** + * This protocol allows observing events dispatched by RCTEventDispatcher. + */ +@protocol RCTEventDispatcherObserver + +/** + * Called before dispatching an event, on the same thread the event was + * dispatched from. + */ +- (void)eventDispatcherWillDispatchEvent:(id)event; + +@end + +@protocol RCTJSDispatcherModule + +@property (nonatomic, copy) void (^dispatchToJSThread)(dispatch_block_t block); + +@end + +/** + * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and + * provides some convenience methods for generating event calls. + */ +@protocol RCTEventDispatcherProtocol + +- (void)sendViewEventWithName:(NSString *)name reactTag:(NSNumber *)reactTag; + +/** + * Deprecated, do not use. + */ +- (void)sendAppEventWithName:(NSString *)name body:(id)body __deprecated_msg("Subclass RCTEventEmitter instead"); + +/** + * Deprecated, do not use. + */ +- (void)sendDeviceEventWithName:(NSString *)name body:(id)body __deprecated_msg("Subclass RCTEventEmitter instead"); + +/** + * Send a text input/focus event. For internal use only. + */ +- (void)sendTextEventWithType:(RCTTextEventType)type + reactTag:(NSNumber *)reactTag + text:(NSString *)text + key:(NSString *)key + eventCount:(NSInteger)eventCount; + +/** + * Send a pre-prepared event object. + * + * Events are sent to JS as soon as the thread is free to process them. + * If an event can be coalesced and there is another compatible event waiting, the coalescing will happen immediately. + */ +- (void)sendEvent:(id)event; + +/** + * Add an event dispatcher observer. + */ +- (void)addDispatchObserver:(id)observer; + +/** + * Remove an event dispatcher observer. + */ +- (void)removeDispatchObserver:(id)observer; + +@end + +@interface RCTBridge (RCTEventDispatcher) + +- (id)eventDispatcher; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventEmitter.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventEmitter.h new file mode 100644 index 0000000..e3bb12f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTEventEmitter.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * RCTEventEmitter is an abstract base class to be used for modules that emit + * events to be observed by JS. + */ +@interface RCTEventEmitter : NSObject + +@property (nonatomic, weak) RCTBridge *bridge; +@property (nonatomic, weak) RCTModuleRegistry *moduleRegistry; +@property (nonatomic, weak) RCTViewRegistry *viewRegistry_DEPRECATED; + +- (instancetype)initWithDisabledObservation; + +/** + * Override this method to return an array of supported event names. Attempting + * to observe or send an event that isn't included in this list will result in + * an error. + */ +- (NSArray *)supportedEvents; + +/** + * Send an event that does not relate to a specific view, e.g. a navigation + * or data update notification. + */ +- (void)sendEventWithName:(NSString *)name body:(id)body; + +/** + * These methods will be called when the first observer is added and when the + * last observer is removed (or when dealloc is called), respectively. These + * should be overridden in your subclass in order to start/stop sending events. + */ +- (void)startObserving; +- (void)stopObserving; + +- (void)invalidate NS_REQUIRES_SUPER; + +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTExceptionsManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTExceptionsManager.h new file mode 100644 index 0000000..28ae105 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTExceptionsManager.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTExceptionsManagerDelegate + +- (void)handleSoftJSExceptionWithMessage:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(NSNumber *)exceptionId; +- (void)handleFatalJSExceptionWithMessage:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(NSNumber *)exceptionId; + +@optional +- (void)updateJSExceptionWithMessage:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(NSNumber *)exceptionId; + +@end + +@interface RCTExceptionsManager : NSObject + +- (instancetype)initWithDelegate:(id)delegate; + +- (void)reportSoftException:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(double)exceptionId; +- (void)reportFatalException:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(double)exceptionId; + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, assign) NSUInteger maxReloadAttempts; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFPSGraph.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFPSGraph.h new file mode 100644 index 0000000..73dd6bd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFPSGraph.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#if RCT_DEV + +@interface RCTFPSGraph : UIView + +@property (nonatomic, assign, readonly) NSUInteger FPS; +@property (nonatomic, assign, readonly) NSUInteger maxFPS; +@property (nonatomic, assign, readonly) NSUInteger minFPS; + +- (instancetype)initWithFrame:(CGRect)frame color:(UIColor *)color NS_DESIGNATED_INITIALIZER; + +- (void)onTick:(NSTimeInterval)timestamp; + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFileReaderModule.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFileReaderModule.h new file mode 100644 index 0000000..0eb246b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFileReaderModule.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTFileReaderModule : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFileRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFileRequestHandler.h new file mode 100644 index 0000000..7faf39d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFileRequestHandler.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * This is the default RCTURLRequestHandler implementation for file requests. + */ +@interface RCTFileRequestHandler : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFont.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFont.h new file mode 100644 index 0000000..15437dd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFont.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +typedef UIFont * (^RCTFontHandler)(CGFloat fontSize, NSString *fontWeightDescription); + +/** + * React Native will use the System font for rendering by default. If you want to + * provide a different base font, use this override. The font weight supplied to your + * handler will be one of "ultralight", "thin", "light", "regular", "medium", + * "semibold", "extrabold", "bold", "heavy", or "black". + */ +RCT_EXTERN void RCTSetDefaultFontHandler(RCTFontHandler handler); +RCT_EXTERN BOOL RCTHasFontHandlerSet(void); + +@interface RCTFont : NSObject + +/** + * Update a font with a given font-family, size, weight and style. + * If parameters are not specified, they'll be kept as-is. + * If font is nil, the default system font of size 14 will be used. + */ ++ (UIFont *)updateFont:(UIFont *)font + withFamily:(NSString *)family + size:(NSNumber *)size + weight:(NSString *)weight + style:(NSString *)style + variant:(NSArray *)variant + scaleMultiplier:(CGFloat)scaleMultiplier; + ++ (UIFont *)updateFont:(UIFont *)font withFamily:(NSString *)family; ++ (UIFont *)updateFont:(UIFont *)font withSize:(NSNumber *)size; ++ (UIFont *)updateFont:(UIFont *)font withWeight:(NSString *)weight; ++ (UIFont *)updateFont:(UIFont *)font withStyle:(NSString *)style; + +@end + +@interface RCTConvert (RCTFont) + ++ (UIFont *)UIFont:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFrameAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFrameAnimation.h new file mode 100644 index 0000000..610d3ff --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFrameAnimation.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimationDriver.h" + +@interface RCTFrameAnimation : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFrameUpdate.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFrameUpdate.h new file mode 100644 index 0000000..07f0889 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTFrameUpdate.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class CADisplayLink; + +/** + * Interface containing the information about the last screen refresh. + */ +@interface RCTFrameUpdate : NSObject + +/** + * Timestamp for the actual screen refresh + */ +@property (nonatomic, readonly) NSTimeInterval timestamp; + +/** + * Time since the last frame update ( >= 16.6ms ) + */ +@property (nonatomic, readonly) NSTimeInterval deltaTime; + +- (instancetype)initWithDisplayLink:(CADisplayLink *)displayLink NS_DESIGNATED_INITIALIZER; + +@end + +/** + * Protocol that must be implemented for subscribing to display refreshes (DisplayLink updates) + */ +@protocol RCTFrameUpdateObserver + +/** + * Method called on every screen refresh (if paused != YES) + */ +- (void)didUpdateFrame:(RCTFrameUpdate *)update; + +/** + * Synthesize and set to true to pause the calls to -[didUpdateFrame:] + */ +@property (nonatomic, readonly, getter=isPaused) BOOL paused; + +/** + * Callback for pause/resume observer. + * Observer should call it when paused property is changed. + */ +@property (nonatomic, copy) dispatch_block_t pauseCallback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTGIFImageDecoder.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTGIFImageDecoder.h new file mode 100644 index 0000000..2d56637 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTGIFImageDecoder.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTGIFImageDecoder : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTHTTPRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTHTTPRequestHandler.h new file mode 100644 index 0000000..5a91bd0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTHTTPRequestHandler.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +typedef NSURLSessionConfiguration* (^NSURLSessionConfigurationProvider)(void); +/** + * The block provided via this function will provide the NSURLSessionConfiguration for all HTTP requests made by the app. +*/ +RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider); +/** + * This is the default RCTURLRequestHandler implementation for HTTP requests. + */ +@interface RCTHTTPRequestHandler : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTI18nManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTI18nManager.h new file mode 100644 index 0000000..5f21ec4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTI18nManager.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * @experimental + * This is a experimental module for RTL support + * This module bridges the i18n utility from RCTI18nUtil + */ +@interface RCTI18nManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTI18nUtil.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTI18nUtil.h new file mode 100644 index 0000000..f3a1550 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTI18nUtil.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * @experimental + * This is a experimental module for to expose constance IsRTL to js about the RTL status. + * And it allows js to force RLT status for development propose. + * This will also provide other i18n related utilities in the future. + */ +@interface RCTI18nUtil : NSObject + ++ (instancetype)sharedInstance; + +- (BOOL)isRTL; +- (BOOL)isRTLAllowed; +- (void)allowRTL:(BOOL)value; +- (BOOL)isRTLForced; +- (void)forceRTL:(BOOL)value; +- (BOOL)doLeftAndRightSwapInRTL; +- (void)swapLeftAndRightInRTL:(BOOL)value; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageBlurUtils.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageBlurUtils.h new file mode 100644 index 0000000..18a286e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageBlurUtils.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +RCT_EXTERN UIImage *RCTBlurredImageWithRadius(UIImage *inputImage, CGFloat radius); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageCache.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageCache.h new file mode 100644 index 0000000..a4d15b4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageCache.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +@interface UIImage (React) + +/** + * Memory bytes of the image with the default calculation of static image or GIF. Custom calculations of decoded bytes can be assigned manually. + */ +@property (nonatomic, assign) NSInteger reactDecodedImageBytes; + +@end + +/** + * Provides an interface to use for providing a image caching strategy. + */ +@protocol RCTImageCache + +- (UIImage *)imageForUrl:(NSString *)url + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode; + +- (void)addImageToCache:(UIImage *)image + URL:(NSString *)url + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + response:(NSURLResponse *)response; + +@end + +@interface RCTImageCache : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageDataDecoder.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageDataDecoder.h new file mode 100644 index 0000000..b7fbb00 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageDataDecoder.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +/** + * Provides the interface needed to register an image decoder. Image decoders + * are also bridge modules, so should be registered using RCT_EXPORT_MODULE(). + */ +@protocol RCTImageDataDecoder + +/** + * Indicates whether this handler is capable of decoding the specified data. + * Typically the handler would examine some sort of header data to determine + * this. + */ +- (BOOL)canDecodeImageData:(NSData *)imageData; + +/** + * Decode an image from the data object. The method should call the + * completionHandler when the decoding operation has finished. The method + * should also return a cancellation block, if applicable. + * + * If you provide a custom image decoder, you most implement scheduling yourself, + * to avoid decoding large amounts of images at the same time. + */ +- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + completionHandler:(RCTImageLoaderCompletionBlock)completionHandler; + +@optional + +/** + * If more than one RCTImageDataDecoder responds YES to `-canDecodeImageData:` + * then `decoderPriority` is used to determine which one to use. The decoder + * with the highest priority will be selected. Default priority is zero. + * If two or more valid decoders have the same priority, the selection order is + * undefined. + */ +- (float)decoderPriority; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageEditingManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageEditingManager.h new file mode 100644 index 0000000..216b622 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageEditingManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTImageEditingManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoader.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoader.h new file mode 100644 index 0000000..da0df28 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoader.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +@interface RCTImageLoader : NSObject +- (instancetype)init; +- (instancetype)initWithRedirectDelegate:(id)redirectDelegate NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithRedirectDelegate:(id)redirectDelegate + loadersProvider:(NSArray> * (^)(RCTModuleRegistry *))getLoaders + decodersProvider:(NSArray> * (^)(RCTModuleRegistry *))getDecoders; +@end + +/** + * DEPRECATED!! DO NOT USE + * Instead use `[_bridge moduleForClass:[RCTImageLoader class]]` + */ +@interface RCTBridge (RCTImageLoader) + +@property (nonatomic, readonly) RCTImageLoader *imageLoader; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderLoggable.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderLoggable.h new file mode 100644 index 0000000..3b78c48 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderLoggable.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * The image loader (i.e. RCTImageLoader) implement this to declare whether image performance should be logged. + */ +@protocol RCTImageLoaderLoggableProtocol + +/** + * Image instrumentation - declares whether its caller should log images + */ +- (BOOL)shouldEnablePerfLoggingForRequestUrl:(NSURL *)url; + +@end + +/** + * Image handlers in the image loader implement this to declare whether image performance should be logged. + */ +@protocol RCTImageLoaderLoggable + +/** + * Image instrumentation - declares whether its caller should log images + */ +- (BOOL)shouldEnablePerfLogging; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderProtocol.h new file mode 100644 index 0000000..f1bb268 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderProtocol.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * If available, RCTImageRedirectProtocol is invoked before loading an asset. + * Implementation should return either a new URL or nil when redirection is + * not needed. + */ + +@protocol RCTImageRedirectProtocol + +- (NSURL *)redirectAssetsURL:(NSURL *)URL; + +@end + +/** + * Image Downloading priority. + * Use PriorityImmediate to download images at the highest priority. + * Use PriorityPrefetch to prefetch images at a lower priority. + * The priority logic is up to each @RCTImageLoaderProtocol implementation + */ +typedef NS_ENUM(NSUInteger, RCTImageLoaderPriority) { + RCTImageLoaderPriorityImmediate, + RCTImageLoaderPriorityPrefetch +}; + +@protocol RCTImageLoaderProtocol + +/** + * The maximum number of concurrent image loading tasks. Loading and decoding + * images can consume a lot of memory, so setting this to a higher value may + * cause memory to spike. If you are seeing out-of-memory crashes, try reducing + * this value. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentLoadingTasks; + +/** + * The maximum number of concurrent image decoding tasks. Decoding large + * images can be especially CPU and memory intensive, so if your are decoding a + * lot of large images in your app, you may wish to adjust this value. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentDecodingTasks; + +/** + * Decoding large images can use a lot of memory, and potentially cause the app + * to crash. This value allows you to throttle the amount of memory used by the + * decoder independently of the number of concurrent threads. This means you can + * still decode a lot of small images in parallel, without allowing the decoder + * to try to decompress multiple huge images at once. Note that this value is + * only a hint, and not an indicator of the total memory used by the app. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentDecodingBytes; + +/** + * Loads the specified image at the highest available resolution. + * Can be called from any thread, will call back on an unspecified thread. + */ +- (nullable RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + callback:(RCTImageLoaderCompletionBlock)callback; +/** + * As above, but includes download `priority`. + */ +- (nullable RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + priority:(RCTImageLoaderPriority)priority + callback:(RCTImageLoaderCompletionBlock)callback; + +/** +* As above, but includes target `size`, `scale` and `resizeMode`, which are used to +* select the optimal dimensions for the loaded image. The `clipped` option +* controls whether the image will be clipped to fit the specified size exactly, +* or if the original aspect ratio should be retained. +* `partialLoadBlock` is meant for custom image loaders that do not ship with the core RN library. +* It is meant to be called repeatedly while loading the image as higher quality versions are decoded, +* for instance with progressive JPEGs. +*/ +- (nullable RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + size:(CGSize)size + scale:(CGFloat)scale + clipped:(BOOL)clipped + resizeMode:(RCTResizeMode)resizeMode + progressBlock:(RCTImageLoaderProgressBlock)progressBlock + partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock + completionBlock:(RCTImageLoaderCompletionBlock)completionBlock; + +/** + * Finds an appropriate image decoder and passes the target `size`, `scale` and + * `resizeMode` for optimal image decoding. The `clipped` option controls + * whether the image will be clipped to fit the specified size exactly, or + * if the original aspect ratio should be retained. Can be called from any + * thread, will call callback on an unspecified thread. + */ +- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData + size:(CGSize)size + scale:(CGFloat)scale + clipped:(BOOL)clipped + resizeMode:(RCTResizeMode)resizeMode + completionBlock:(RCTImageLoaderCompletionBlock)completionBlock; + +/** + * Get image size, in pixels. This method will do the least work possible to get + * the information, and won't decode the image if it doesn't have to. + */ +- (RCTImageLoaderCancellationBlock)getImageSizeForURLRequest:(NSURLRequest *)imageURLRequest + block:(void(^)(NSError *error, CGSize size))completionBlock; +/** + * Determines whether given image URLs are cached locally. The `requests` array is expected + * to contain objects convertible to NSURLRequest. The return value maps URLs to strings: + * "disk" for images known to be cached in non-volatile storage, "memory" for images known + * to be cached in memory. Dictionary items corresponding to images that are not known to be + * cached are simply missing. + */ +- (NSDictionary *)getImageCacheStatus:(NSArray *)requests; + +/** + * Allows developers to set their own caching implementation for + * decoded images as long as it conforms to the RCTImageCache + * protocol. This method should be called in bridgeDidInitializeModule. + */ +- (void)setImageCache:(id)cache; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderWithAttributionProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderWithAttributionProtocol.h new file mode 100644 index 0000000..07aab9d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageLoaderWithAttributionProtocol.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +RCT_EXTERN BOOL RCTImageLoadingPerfInstrumentationEnabled(void); +RCT_EXTERN void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled); + +@protocol RCTImageLoaderWithAttributionProtocol + +// TODO (T61325135): Remove C++ checks +#ifdef __cplusplus +/** + * Same as the variant in RCTImageURLLoaderProtocol, but allows passing attribution + * information that each image URL loader can process. + */ +- (RCTImageURLLoaderRequest *)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + size:(CGSize)size + scale:(CGFloat)scale + clipped:(BOOL)clipped + resizeMode:(RCTResizeMode)resizeMode + priority: (RCTImageLoaderPriority)priority + attribution:(const facebook::react::ImageURLLoaderAttribution &)attribution + progressBlock:(RCTImageLoaderProgressBlock)progressBlock + partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock + completionBlock:(RCTImageLoaderCompletionBlockWithMetadata)completionBlock; +#endif + +/** + * Image instrumentation - start tracking the on-screen visibility of the native image view. + */ +- (void)trackURLImageVisibilityForRequest:(RCTImageURLLoaderRequest *)loaderRequest imageView:(UIView *)imageView; + +/** + * Image instrumentation - notify that the request was cancelled. + */ +- (void)trackURLImageRequestDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +/** + * Image instrumentation - notify that the native image view was destroyed. + */ +- (void)trackURLImageDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImagePlugins.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImagePlugins.h new file mode 100644 index 0000000..1e943d8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImagePlugins.h @@ -0,0 +1,44 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTImagePlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTImageClassProvider(const char *name); + +// Lookup functions +Class RCTGIFImageDecoderCls(void) __attribute__((used)); +Class RCTImageEditingManagerCls(void) __attribute__((used)); +Class RCTImageLoaderCls(void) __attribute__((used)); +Class RCTImageStoreManagerCls(void) __attribute__((used)); +Class RCTLocalAssetImageLoaderCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageShadowView.h new file mode 100644 index 0000000..3057118 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTImageShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageSource.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageSource.h new file mode 100644 index 0000000..928657c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageSource.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * Object containing an image URL and associated metadata. + */ +@interface RCTImageSource : NSObject + +@property (nonatomic, copy, readonly) NSURLRequest *request; +@property (nonatomic, assign, readonly) CGSize size; +@property (nonatomic, assign, readonly) CGFloat scale; + +/** + * Create a new image source object. + * Pass a size of CGSizeZero if you do not know or wish to specify the image + * size. Pass a scale of zero if you do not know or wish to specify the scale. + */ +- (instancetype)initWithURLRequest:(NSURLRequest *)request size:(CGSize)size scale:(CGFloat)scale; + +/** + * Create a copy of the image source with the specified size and scale. + */ +- (instancetype)imageSourceWithSize:(CGSize)size scale:(CGFloat)scale; + +@end + +@interface RCTConvert (ImageSource) + ++ (RCTImageSource *)RCTImageSource:(id)json; ++ (NSArray *)RCTImageSourceArray:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageStoreManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageStoreManager.h new file mode 100644 index 0000000..0073381 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageStoreManager.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTImageStoreManager : NSObject + +/** + * Set and get cached image data asynchronously. It is safe to call these from any + * thread. The callbacks will be called on an unspecified thread. + */ +- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block; +- (void)storeImageData:(NSData *)imageData withBlock:(void (^)(NSString *imageTag))block; +- (void)getImageDataForTag:(NSString *)imageTag withBlock:(void (^)(NSData *imageData))block; + +/** + * Convenience method to store an image directly (image is converted to data + * internally, so any metadata such as scale or orientation will be lost). + */ +- (void)storeImage:(UIImage *)image withBlock:(void (^)(NSString *imageTag))block; + +@end + +@interface RCTImageStoreManager (Deprecated) + +/** + * These methods are deprecated - use the data-based alternatives instead. + */ +- (NSString *)storeImage:(UIImage *)image __deprecated; +- (UIImage *)imageForTag:(NSString *)imageTag __deprecated; +- (void)getImageForTag:(NSString *)imageTag withBlock:(void (^)(UIImage *image))block __deprecated; + +@end + +@interface RCTBridge (RCTImageStoreManager) + +@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageURLLoader.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageURLLoader.h new file mode 100644 index 0000000..e49ed11 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageURLLoader.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^RCTImageLoaderProgressBlock)(int64_t progress, int64_t total); +typedef void (^RCTImageLoaderPartialLoadBlock)(UIImage *image); +typedef void (^RCTImageLoaderCompletionBlock)(NSError * _Nullable error, UIImage * _Nullable image); +// Metadata is passed as a id in an additional parameter because there are forks of RN without this parameter, +// and the complexity of RCTImageLoader would make using protocols here difficult to typecheck. +typedef void (^RCTImageLoaderCompletionBlockWithMetadata)(NSError * _Nullable error, UIImage * _Nullable image, id _Nullable metadata); +typedef dispatch_block_t RCTImageLoaderCancellationBlock; + +/** + * Provides the interface needed to register an image loader. Image data + * loaders are also bridge modules, so should be registered using + * RCT_EXPORT_MODULE(). + */ +@protocol RCTImageURLLoader + +/** + * Indicates whether this data loader is capable of processing the specified + * request URL. Typically the handler would examine the scheme/protocol of the + * URL to determine this. + */ +- (BOOL)canLoadImageURL:(NSURL *)requestURL; + +/** + * Send a network request to load the request URL. The method should call the + * progressHandler (if applicable) and the completionHandler when the request + * has finished. The method should also return a cancellation block, if + * applicable. + */ +- (nullable RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + progressHandler:(RCTImageLoaderProgressBlock)progressHandler + partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler + completionHandler:(RCTImageLoaderCompletionBlock)completionHandler; + +@optional + +/** + * If more than one RCTImageURLLoader responds YES to `-canLoadImageURL:` + * then `loaderPriority` is used to determine which one to use. The loader + * with the highest priority will be selected. Default priority is zero. If + * two or more valid loaders have the same priority, the selection order is + * undefined. + */ +- (float)loaderPriority; + +/** + * If the loader must be called on the serial url cache queue, and whether the completion + * block should be dispatched off the main thread. If this is NO, the loader will be + * called from the main queue. Defaults to YES. + * + * Use with care: disabling scheduling will reduce RCTImageLoader's ability to throttle + * network requests. + */ +- (BOOL)requiresScheduling; + +/** + * If images loaded by the loader should be cached in the decoded image cache. + * Defaults to YES. + */ +- (BOOL)shouldCacheLoadedImages; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageURLLoaderWithAttribution.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageURLLoaderWithAttribution.h new file mode 100644 index 0000000..118bed1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageURLLoaderWithAttribution.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +// TODO (T61325135): Remove C++ checks +#ifdef __cplusplus +namespace facebook { +namespace react { + +struct ImageURLLoaderAttribution { + int32_t nativeViewTag = 0; + int32_t surfaceId = 0; + std::string queryRootName; + NSString *analyticTag; +}; + +} // namespace react +} // namespace facebook +#endif + +@interface RCTImageURLLoaderRequest : NSObject + +@property (nonatomic, strong, readonly) NSString *requestId; +@property (nonatomic, strong, readonly) NSURL *imageURL; +@property (nonatomic, copy, readonly) RCTImageLoaderCancellationBlock cancellationBlock; + +- (instancetype)initWithRequestId:(NSString *)requestId imageURL:(NSURL *)imageURL cancellationBlock:(RCTImageLoaderCancellationBlock)cancellationBlock; +- (void)cancel; + +@end + +/** + * Same as the RCTImageURLLoader interface, but allows passing in optional `attribution` information. + * This is useful for per-app logging and other instrumentation. + */ +@protocol RCTImageURLLoaderWithAttribution + +// TODO (T61325135): Remove C++ checks +#ifdef __cplusplus +/** + * Same as the RCTImageURLLoader variant above, but allows optional `attribution` information. + * Caller may also specify a preferred requestId for tracking purpose. + */ +- (RCTImageURLLoaderRequest *)loadImageForURL:(NSURL *)imageURL + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + requestId:(NSString *)requestId + priority: (RCTImageLoaderPriority)priority + attribution:(const facebook::react::ImageURLLoaderAttribution &)attribution + progressHandler:(RCTImageLoaderProgressBlock)progressHandler + partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler + completionHandler:(RCTImageLoaderCompletionBlockWithMetadata)completionHandler; +#endif + +/** + * Image instrumentation - start tracking the on-screen visibility of the native image view. + */ +- (void)trackURLImageVisibilityForRequest:(RCTImageURLLoaderRequest *)loaderRequest imageView:(UIView *)imageView; + +/** + * Image instrumentation - notify that the request was destroyed. + */ +- (void)trackURLImageRequestDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +/** + * Image instrumentation - notify that the native image view was destroyed. + */ +- (void)trackURLImageDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageUtils.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageUtils.h new file mode 100644 index 0000000..df04a2c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageUtils.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This function takes an source size (typically from an image), a target size + * and scale that it will be drawn at (typically in a CGContext) and then + * calculates the rectangle to draw the image into so that it will be sized and + * positioned correctly according to the specified resizeMode. + */ +RCT_EXTERN CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize, + CGFloat destScale, RCTResizeMode resizeMode); + +/** + * This function takes a source size (typically from an image), a target rect + * that it will be drawn into (typically relative to a CGContext), and works out + * the transform needed to draw the image at the correct scale and position. + */ +RCT_EXTERN CGAffineTransform RCTTransformFromTargetRect(CGSize sourceSize, + CGRect targetRect); + +/** + * This function takes an input content size & scale (typically from an image), + * a target size & scale at which it will be displayed (typically in a + * UIImageView) and then calculates the optimal size at which to redraw the + * image so that it will be displayed correctly with the specified resizeMode. + */ +RCT_EXTERN CGSize RCTTargetSize(CGSize sourceSize, CGFloat sourceScale, + CGSize destSize, CGFloat destScale, + RCTResizeMode resizeMode, BOOL allowUpscaling); + +/** + * This function takes an input content size & scale (typically from an image), + * a target size & scale that it will be displayed at, and determines if the + * source will need to be upscaled to fit (which may result in pixelization). + */ +RCT_EXTERN BOOL RCTUpscalingRequired(CGSize sourceSize, CGFloat sourceScale, + CGSize destSize, CGFloat destScale, + RCTResizeMode resizeMode); + +/** + * This function takes the source data for an image and decodes it at the + * specified size. If the original image is smaller than the destination size, + * the resultant image's scale will be decreased to compensate, so the + * width/height of the returned image is guaranteed to be >= destSize. + * Pass a destSize of CGSizeZero to decode the image at its original size. + */ +RCT_EXTERN UIImage *__nullable RCTDecodeImageWithData(NSData *data, + CGSize destSize, + CGFloat destScale, + RCTResizeMode resizeMode); + +/** + * This function takes the source data for an image and decodes just the + * metadata, without decompressing the image itself. + */ +RCT_EXTERN NSDictionary *__nullable RCTGetImageMetadata(NSData *data); + +/** + * Convert an image back into data. Images with an alpha channel will be + * converted to lossless PNG data. Images without alpha will be converted to + * JPEG. The `quality` argument controls the compression ratio of the JPEG + * conversion, with 1.0 being maximum quality. It has no effect for images + * using PNG compression. + */ +RCT_EXTERN NSData *__nullable RCTGetImageData(UIImage *image, float quality); + +/** + * This function transforms an image. `destSize` is the size of the final image, + * and `destScale` is its scale. The `transform` argument controls how the + * source image will be mapped to the destination image. + */ +RCT_EXTERN UIImage *__nullable RCTTransformImage(UIImage *image, + CGSize destSize, + CGFloat destScale, + CGAffineTransform transform); + +/* + * Return YES if image has an alpha component + */ +RCT_EXTERN BOOL RCTImageHasAlpha(CGImageRef image); + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageView.h new file mode 100644 index 0000000..c895a53 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageView.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@class RCTBridge; +@class RCTImageSource; + +@interface RCTImageView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, assign) UIEdgeInsets capInsets; +@property (nonatomic, strong) UIImage *defaultImage; +@property (nonatomic, assign) UIImageRenderingMode renderingMode; +@property (nonatomic, copy) NSArray *imageSources; +@property (nonatomic, assign) CGFloat blurRadius; +@property (nonatomic, assign) RCTResizeMode resizeMode; +@property (nonatomic, copy) NSString *internal_analyticTag; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageViewManager.h new file mode 100644 index 0000000..9431f35 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTImageViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTImageViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInitializing.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInitializing.h new file mode 100644 index 0000000..56b14b1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInitializing.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTInitializing + +- (void)initialize; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryShadowView.h new file mode 100644 index 0000000..8ed5110 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryView.h new file mode 100644 index 0000000..d4c48ce --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryView.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; +@class RCTInputAccessoryViewContent; + +@interface RCTInputAccessoryView : UIView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryViewContent.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryViewContent.h new file mode 100644 index 0000000..f65eea7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryViewContent.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewContent : UIView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryViewManager.h new file mode 100644 index 0000000..251048d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInputAccessoryViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspector.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspector.h new file mode 100644 index 0000000..97c8d2e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspector.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if RCT_DEV + +@class RCTInspectorRemoteConnection; + +@interface RCTInspectorLocalConnection : NSObject +- (void)sendMessage:(NSString *)message; +- (void)disconnect; +@end + +@interface RCTInspectorPage : NSObject +@property (nonatomic, readonly) NSInteger id; +@property (nonatomic, readonly) NSString *title; +@property (nonatomic, readonly) NSString *vm; +@end + +@interface RCTInspector : NSObject ++ (NSArray *)pages; ++ (RCTInspectorLocalConnection *)connectPage:(NSInteger)pageId + forRemoteConnection:(RCTInspectorRemoteConnection *)remote; +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspectorDevServerHelper.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspectorDevServerHelper.h new file mode 100644 index 0000000..b69fa02 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspectorDevServerHelper.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import +#import + +#if RCT_DEV + +@interface RCTInspectorDevServerHelper : NSObject + ++ (RCTInspectorPackagerConnection *)connectWithBundleURL:(NSURL *)bundleURL; ++ (void)disableDebugger; ++ (void)openURL:(NSString *)url withBundleURL:(NSURL *)bundleURL withErrorMessage:(NSString *)errorMessage; +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspectorPackagerConnection.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspectorPackagerConnection.h new file mode 100644 index 0000000..de08694 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInspectorPackagerConnection.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if RCT_DEV + +@interface RCTBundleStatus : NSObject +@property (atomic, assign) BOOL isLastBundleDownloadSuccess; +@property (atomic, assign) NSTimeInterval bundleUpdateTimestamp; +@end + +typedef RCTBundleStatus * (^RCTBundleStatusProvider)(void); + +@interface RCTInspectorPackagerConnection : NSObject +- (instancetype)initWithURL:(NSURL *)url; + +- (bool)isConnected; +- (void)connect; +- (void)closeQuietly; +- (void)sendEventToAllConnections:(NSString *)event; +- (void)setBundleStatusProvider:(RCTBundleStatusProvider)bundleStatusProvider; +@end + +@interface RCTInspectorRemoteConnection : NSObject +- (void)onMessage:(NSString *)message; +- (void)onDisconnect; +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInterpolationAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInterpolationAnimatedNode.h new file mode 100644 index 0000000..8ec4101 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInterpolationAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTInterpolationAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInvalidating.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInvalidating.h new file mode 100644 index 0000000..bc144cd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTInvalidating.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTInvalidating + +- (void)invalidate; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSScriptLoaderModule.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSScriptLoaderModule.h new file mode 100644 index 0000000..a0ba36e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSScriptLoaderModule.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +@class RCTSource; + +/** + * This protocol should be adopted when a turbo module needs to tell React Native to load a script. + * In bridge-less React Native, it is a replacement for [_bridge loadAndExecuteSplitBundleURL:]. + */ +@protocol RCTJSScriptLoaderModule + +@property (nonatomic, copy, nonnull) void (^loadScript)(RCTSource *source); + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSStackFrame.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSStackFrame.h new file mode 100644 index 0000000..1a66e29 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSStackFrame.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTJSStackFrame : NSObject + +@property (nonatomic, copy, readonly) NSString *methodName; +@property (nonatomic, copy, readonly) NSString *file; +@property (nonatomic, readonly) NSInteger lineNumber; +@property (nonatomic, readonly) NSInteger column; +@property (nonatomic, readonly) BOOL collapse; + +- (instancetype)initWithMethodName:(NSString *)methodName + file:(NSString *)file + lineNumber:(NSInteger)lineNumber + column:(NSInteger)column + collapse:(BOOL)collapse; +- (NSDictionary *)toDictionary; + ++ (instancetype)stackFrameWithLine:(NSString *)line; ++ (instancetype)stackFrameWithDictionary:(NSDictionary *)dict; ++ (NSArray *)stackFramesWithLines:(NSString *)lines; ++ (NSArray *)stackFramesWithDictionaries:(NSArray *)dicts; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSThread.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSThread.h new file mode 100644 index 0000000..8f1bc76 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJSThread.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +/** + * This constant can be returned from +methodQueue to force module + * methods to be called on the JavaScript thread. This can have serious + * implications for performance, so only use this if you're sure it's what + * you need. + * + * NOTE: RCTJSThread is not a real libdispatch queue + */ +RCT_EXTERN dispatch_queue_t RCTJSThread; + +/** + * Initializes the RCTJSThread constant. + * Exported because the bridgeless initialization layer needs to initialize + * RCTJSThread. In bridgeless mode, RCTBridge isn't accessed, and RCTJSThread + * therefore isn't initialized. + */ +RCT_EXTERN void _RCTInitializeJSThreadConstantInternal(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJavaScriptExecutor.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJavaScriptExecutor.h new file mode 100644 index 0000000..c42fb05 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJavaScriptExecutor.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); +typedef void (^RCTJavaScriptCallback)(id result, NSError *error); + +/** + * Abstracts away a JavaScript execution context - we may be running code in a + * web view (for debugging purposes), or may be running code in a `JSContext`. + */ +@protocol RCTJavaScriptExecutor + +/** + * Used to set up the executor after the bridge has been fully initialized. + * Do any expensive setup in this method instead of `-init`. + */ +- (void)setUp; + +/** + * Whether the executor has been invalidated + */ +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +/** + * Executes BatchedBridge.flushedQueue on JS thread and calls the given callback + * with JSValue, containing the next queue, and JSContext. + */ +- (void)flushedQueue:(RCTJavaScriptCallback)onComplete; + +/** + * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module name, + * method name and optional additional arguments on the JS thread and calls the + * given callback with JSValue, containing the next queue, and JSContext. + */ +- (void)callFunctionOnModule:(NSString *)module + method:(NSString *)method + arguments:(NSArray *)args + callback:(RCTJavaScriptCallback)onComplete; + +/** + * Executes BatchedBridge.invokeCallbackAndReturnFlushedQueue with the cbID, + * and optional additional arguments on the JS thread and calls the + * given callback with JSValue, containing the next queue, and JSContext. + */ +- (void)invokeCallbackID:(NSNumber *)cbID arguments:(NSArray *)args callback:(RCTJavaScriptCallback)onComplete; + +/** + * Runs an application script, and notifies of the script load being complete via `onComplete`. + */ +- (void)executeApplicationScript:(NSData *)script + sourceURL:(NSURL *)sourceURL + onComplete:(RCTJavaScriptCompleteBlock)onComplete; + +- (void)injectJSONText:(NSString *)script + asGlobalObjectNamed:(NSString *)objectName + callback:(RCTJavaScriptCompleteBlock)onComplete; + +/** + * Enqueue a block to run in the executors JS thread. Fallback to `dispatch_async` + * on the main queue if the executor doesn't own a thread. + */ +- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block; + +/** + * Special case for Timers + ContextExecutor - instead of the default + * if jsthread then call else dispatch call on jsthread + * ensure the call is made async on the jsthread + */ +- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJavaScriptLoader.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJavaScriptLoader.h new file mode 100755 index 0000000..729fa37 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTJavaScriptLoader.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +extern NSString *const RCTJavaScriptLoaderErrorDomain; + +extern const UInt32 RCT_BYTECODE_ALIGNMENT; + +UInt32 RCTReadUInt32LE(NSData *script, UInt32 offset); +bool RCTIsBytecodeBundle(NSData *script); + +NS_ENUM(NSInteger){ + RCTJavaScriptLoaderErrorNoScriptURL = 1, + RCTJavaScriptLoaderErrorFailedOpeningFile = 2, + RCTJavaScriptLoaderErrorFailedReadingFile = 3, + RCTJavaScriptLoaderErrorFailedStatingFile = 3, + RCTJavaScriptLoaderErrorURLLoadFailed = 3, + RCTJavaScriptLoaderErrorBCVersion = 4, + RCTJavaScriptLoaderErrorBCNotSupported = 4, + + RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously = 1000, +}; + +NS_ENUM(NSInteger){ + RCTSourceFilesChangedCountNotBuiltByBundler = -2, + RCTSourceFilesChangedCountRebuiltFromScratch = -1, +}; + +@interface RCTLoadingProgress : NSObject + +@property (nonatomic, copy) NSString *status; +@property (strong, nonatomic) NSNumber *done; +@property (strong, nonatomic) NSNumber *total; + +@end + +@interface RCTSource : NSObject + +/** + * URL of the source object. + */ +@property (strong, nonatomic, readonly) NSURL *url; + +/** + * JS source (or simply the binary header in the case of a RAM bundle). + */ +@property (strong, nonatomic, readonly) NSData *data; + +/** + * Length of the entire JS bundle. Note that self.length != self.data.length in the case of certain bundle formats. For + * instance, when using RAM bundles: + * + * - self.data will point to the bundle header + * - self.data.length is the length of the bundle header, i.e. sizeof(facebook::react::BundleHeader) + * - self.length is the length of the entire bundle file (header + contents) + */ +@property (nonatomic, readonly) NSUInteger length; + +/** + * Returns number of files changed when building this bundle: + * + * - RCTSourceFilesChangedCountNotBuiltByBundler if the source wasn't built by the bundler (e.g. read from disk) + * - RCTSourceFilesChangedCountRebuiltFromScratch if the source was rebuilt from scratch by the bundler + * - Otherwise, the number of files changed when incrementally rebuilding the source + */ +@property (nonatomic, readonly) NSInteger filesChangedCount; + +@end + +typedef void (^RCTSourceLoadProgressBlock)(RCTLoadingProgress *progressData); +typedef void (^RCTSourceLoadBlock)(NSError *error, RCTSource *source); + +@interface RCTJavaScriptLoader : NSObject + ++ (void)loadBundleAtURL:(NSURL *)scriptURL + onProgress:(RCTSourceLoadProgressBlock)onProgress + onComplete:(RCTSourceLoadBlock)onComplete; + +/** + * @experimental + * Attempts to synchronously load the script at the given URL. The following two conditions must be met: + * 1. It must be a file URL. + * 2. It must not point to a text/javascript file. + * If the URL does not meet those conditions, this method will return nil and supply an error with the domain + * RCTJavaScriptLoaderErrorDomain and the code RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously. + */ ++ (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL + sourceLength:(int64_t *)sourceLength + error:(NSError **)error; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTKeyCommands.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTKeyCommands.h new file mode 100644 index 0000000..2bdefcf --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTKeyCommands.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTKeyCommands : NSObject + ++ (instancetype)sharedInstance; + +/** + * Register a keyboard command. + */ +- (void)registerKeyCommandWithInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags + action:(void (^)(UIKeyCommand *command))block; + +/** + * Unregister a keyboard command. + */ +- (void)unregisterKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags; + +/** + * Check if a command is registered. + */ +- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTKeyboardObserver.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTKeyboardObserver.h new file mode 100644 index 0000000..320b65d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTKeyboardObserver.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTKeyboardObserver : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayout.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayout.h new file mode 100644 index 0000000..d838032 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayout.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTShadowView; + +typedef NS_ENUM(NSInteger, RCTDisplayType) { + RCTDisplayTypeNone, + RCTDisplayTypeFlex, + RCTDisplayTypeInline, +}; + +struct RCTLayoutMetrics { + CGRect frame; + CGRect contentFrame; + UIEdgeInsets borderWidth; + RCTDisplayType displayType; + UIUserInterfaceLayoutDirection layoutDirection; +}; +typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics; + +struct RCTLayoutContext { + CGPoint absolutePosition; + __unsafe_unretained NSHashTable *_Nonnull affectedShadowViews; + __unsafe_unretained NSHashTable *_Nonnull other; +}; +typedef struct CG_BOXABLE RCTLayoutContext RCTLayoutContext; + +static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b) +{ + return CGRectEqualToRect(a.frame, b.frame) && CGRectEqualToRect(a.contentFrame, b.contentFrame) && + UIEdgeInsetsEqualToEdgeInsets(a.borderWidth, b.borderWidth) && a.displayType == b.displayType && + a.layoutDirection == b.layoutDirection; +} + +RCT_EXTERN RCTLayoutMetrics RCTLayoutMetricsFromYogaNode(YGNodeRef yogaNode); + +/** + * Converts float values between Yoga and CoreGraphics representations, + * especially in terms of edge cases. + */ +RCT_EXTERN float RCTYogaFloatFromCoreGraphicsFloat(CGFloat value); +RCT_EXTERN CGFloat RCTCoreGraphicsFloatFromYogaFloat(float value); + +/** + * Converts compound `YGValue` to simple `CGFloat` value. + */ +RCT_EXTERN CGFloat RCTCoreGraphicsFloatFromYogaValue(YGValue value, CGFloat baseFloatValue); + +/** + * Converts `YGDirection` to `UIUserInterfaceLayoutDirection` and vise versa. + */ +RCT_EXTERN YGDirection RCTYogaLayoutDirectionFromUIKitLayoutDirection(UIUserInterfaceLayoutDirection direction); +RCT_EXTERN UIUserInterfaceLayoutDirection RCTUIKitLayoutDirectionFromYogaLayoutDirection(YGDirection direction); + +/** + * Converts `YGDisplay` to `RCTDisplayType` and vise versa. + */ +RCT_EXTERN YGDisplay RCTYogaDisplayTypeFromReactDisplayType(RCTDisplayType displayType); +RCT_EXTERN RCTDisplayType RCTReactDisplayTypeFromYogaDisplayType(YGDisplay displayType); + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayoutAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayoutAnimation.h new file mode 100644 index 0000000..e907a99 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayoutAnimation.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTLayoutAnimation : NSObject + +@property (nonatomic, readonly) NSTimeInterval duration; +@property (nonatomic, readonly) NSTimeInterval delay; +@property (nonatomic, readonly, copy) NSString *property ; +@property (nonatomic, readonly) CGFloat springDamping; +@property (nonatomic, readonly) CGFloat initialVelocity; +@property (nonatomic, readonly) RCTAnimationType animationType; + ++ (void)initializeStatics; + +- (instancetype)initWithDuration:(NSTimeInterval)duration + delay:(NSTimeInterval)delay + property:(NSString *)property + springDamping:(CGFloat)springDamping + initialVelocity:(CGFloat)initialVelocity + animationType:(RCTAnimationType)animationType; + +- (instancetype)initWithDuration:(NSTimeInterval)duration config:(NSDictionary *)config; + +- (void)performAnimations:(void (^)(void))animations withCompletionBlock:(void (^)(BOOL completed))completionBlock; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayoutAnimationGroup.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayoutAnimationGroup.h new file mode 100644 index 0000000..f13d046 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLayoutAnimationGroup.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@class RCTLayoutAnimation; + +@interface RCTLayoutAnimationGroup : NSObject + +@property (nonatomic, readonly) RCTLayoutAnimation *creatingLayoutAnimation; +@property (nonatomic, readonly) RCTLayoutAnimation *updatingLayoutAnimation; +@property (nonatomic, readonly) RCTLayoutAnimation *deletingLayoutAnimation; + +@property (nonatomic, copy) RCTResponseSenderBlock callback; + +- (instancetype)initWithCreatingLayoutAnimation:(RCTLayoutAnimation *)creatingLayoutAnimation + updatingLayoutAnimation:(RCTLayoutAnimation *)updatingLayoutAnimation + deletingLayoutAnimation:(RCTLayoutAnimation *)deletingLayoutAnimation + callback:(RCTResponseSenderBlock)callback; + +- (instancetype)initWithConfig:(NSDictionary *)config callback:(RCTResponseSenderBlock)callback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLinkingManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLinkingManager.h new file mode 100644 index 0000000..02de122 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLinkingManager.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 12000) /* __IPHONE_12_0 */ +#import +#endif +#import + +@interface RCTLinkingManager : RCTEventEmitter + ++ (BOOL)application:(nonnull UIApplication *)app + openURL:(nonnull NSURL *)URL + options:(nonnull NSDictionary *)options; + ++ (BOOL)application:(nonnull UIApplication *)application + openURL:(nonnull NSURL *)URL + sourceApplication:(nullable NSString *)sourceApplication + annotation:(nonnull id)annotation; + ++ (BOOL)application:(nonnull UIApplication *)application + continueUserActivity:(nonnull NSUserActivity *)userActivity + restorationHandler: + #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 12000) /* __IPHONE_12_0 */ + (nonnull void (^)(NSArray> *_Nullable))restorationHandler; + #else + (nonnull void (^)(NSArray *_Nullable))restorationHandler; + #endif + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLinkingPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLinkingPlugins.h new file mode 100644 index 0000000..17e3d6c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLinkingPlugins.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTLinkingPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTLinkingClassProvider(const char *name); + +// Lookup functions +Class RCTLinkingManagerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLocalAssetImageLoader.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLocalAssetImageLoader.h new file mode 100644 index 0000000..c04f21e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLocalAssetImageLoader.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTLocalAssetImageLoader : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLog.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLog.h new file mode 100644 index 0000000..0d79797 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLog.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +#ifndef RCTLOG_ENABLED +#define RCTLOG_ENABLED 1 +#endif + +/** + * Thresholds for logs to display a redbox. You can override these values when debugging + * in order to tweak the default logging behavior. + */ +#ifndef RCTLOG_REDBOX_LEVEL +#define RCTLOG_REDBOX_LEVEL RCTLogLevelError +#endif + +/** + * Logging macros. Use these to log information, warnings and errors in your + * own code. + */ +#define RCTLog(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__) +#define RCTLogTrace(...) _RCTLog(RCTLogLevelTrace, __VA_ARGS__) +#define RCTLogInfo(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__) +#define RCTLogAdvice(string, ...) RCTLogWarn([@"(ADVICE) " stringByAppendingString:(NSString *)string], __VA_ARGS__) +#define RCTLogWarn(...) _RCTLog(RCTLogLevelWarning, __VA_ARGS__) +#define RCTLogError(...) _RCTLog(RCTLogLevelError, __VA_ARGS__) + +/** + * An enum representing the severity of the log message. + */ +typedef NS_ENUM(NSInteger, RCTLogLevel) { + RCTLogLevelTrace = 0, + RCTLogLevelInfo = 1, + RCTLogLevelWarning = 2, + RCTLogLevelError = 3, + RCTLogLevelFatal = 4 +}; + +/** + * An enum representing the source of a log message. + */ +typedef NS_ENUM(NSInteger, RCTLogSource) { RCTLogSourceNative = 1, RCTLogSourceJavaScript = 2 }; + +/** + * A block signature to be used for custom logging functions. In most cases you + * will want to pass these arguments to the RCTFormatLog function in order to + * generate a string. + */ +typedef void (^RCTLogFunction)( + RCTLogLevel level, + RCTLogSource source, + NSString *fileName, + NSNumber *lineNumber, + NSString *message); + +/** + * A method to generate a string from a collection of log data. To omit any + * particular data from the log, just pass nil or zero for the argument. + */ +RCT_EXTERN NSString * +RCTFormatLog(NSDate *timestamp, RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message); + +/** + * A method to generate a string RCTLogLevel + */ +RCT_EXTERN NSString *RCTFormatLogLevel(RCTLogLevel); + +/** + * A method to generate a string from a RCTLogSource + */ +RCT_EXTERN NSString *RCTFormatLogSource(RCTLogSource); + +/** + * The default logging function used by RCTLogXX. + */ +extern RCTLogFunction RCTDefaultLogFunction; + +/** + * These methods get and set the global logging threshold. This is the level + * below which logs will be ignored. Default is RCTLogLevelInfo for debug and + * RCTLogLevelError for production. + */ +RCT_EXTERN void RCTSetLogThreshold(RCTLogLevel threshold); +RCT_EXTERN RCTLogLevel RCTGetLogThreshold(void); + +/** + * These methods get and set the global logging function called by the RCTLogXX + * macros. You can use these to replace the standard behavior with custom log + * functionality. + */ +RCT_EXTERN void RCTSetLogFunction(RCTLogFunction logFunction); +RCT_EXTERN RCTLogFunction RCTGetLogFunction(void); + +/** + * This appends additional code to the existing log function, without replacing + * the existing functionality. Useful if you just want to forward logs to an + * extra service without changing the default behavior. + */ +RCT_EXTERN void RCTAddLogFunction(RCTLogFunction logFunction); + +/** + * This method temporarily overrides the log function while performing the + * specified block. This is useful for testing purposes (to detect if a given + * function logs something) or to suppress or override logging temporarily. + */ +RCT_EXTERN void RCTPerformBlockWithLogFunction(void (^block)(void), RCTLogFunction logFunction); + +/** + * This method adds a conditional prefix to any messages logged within the scope + * of the passed block. This is useful for adding additional context to log + * messages. The block will be performed synchronously on the current thread. + */ +RCT_EXTERN void RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix); + +/** + * Private logging function - ignore this. + */ +#if RCTLOG_ENABLED +#define _RCTLog(lvl, ...) _RCTLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__) +#else +#define _RCTLog(lvl, ...) \ + do { \ + } while (0) +#endif + +RCT_EXTERN void _RCTLogNativeInternal(RCTLogLevel, const char *, int, NSString *, ...) NS_FORMAT_FUNCTION(4, 5); +RCT_EXTERN void _RCTLogJavaScriptInternal(RCTLogLevel, NSString *); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLogBox.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLogBox.h new file mode 100644 index 0000000..e3bf6ad --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLogBox.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RCTLogBoxView.h" + +@interface RCTLogBox : NSObject + +#if RCT_DEV_MENU + +- (void)setRCTLogBoxView:(RCTLogBoxView *)view; + +#endif + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLogBoxView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLogBoxView.h new file mode 100644 index 0000000..7c05bcb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTLogBoxView.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTLogBoxView : UIWindow + +- (instancetype)initWithFrame:(CGRect)frame; + +- (void)createRootViewController:(UIView *)view; + +- (instancetype)initWithFrame:(CGRect)frame bridge:(RCTBridge *)bridge; + +- (void)show; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMacros.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMacros.h new file mode 100644 index 0000000..9144bbe --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMacros.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#define _CONCAT(A, B) A##B +#define CONCAT(A, B) _CONCAT(A, B) + +#if !defined(PIC_MODIFIER) +#define PIC_MODIFIER +#endif + +#define SYMBOL_NAME(name) CONCAT(__USER_LABEL_PREFIX__, name) +#define SYMBOL_NAME_PIC(name) CONCAT(SYMBOL_NAME(name), PIC_MODIFIER) diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTManagedPointer.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTManagedPointer.h new file mode 100644 index 0000000..4ed6616 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTManagedPointer.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifdef __cplusplus + +#include + +#import + +/** + * Type erased wrapper over any cxx value that can be passed as an argument + * to native method. + */ + +@interface RCTManagedPointer : NSObject + +@property (nonatomic, readonly) void *voidPointer; + +- (instancetype)initWithPointer:(std::shared_ptr)pointer; + +@end + +namespace facebook { +namespace react { + +template +RCTManagedPointer *managedPointer(P initializer) +{ + auto ptr = std::shared_ptr(new T(initializer)); + return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)]; +} + +} +} + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMaskedView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMaskedView.h new file mode 100644 index 0000000..4628240 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMaskedView.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTMaskedView : RCTView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMaskedViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMaskedViewManager.h new file mode 100644 index 0000000..a37f85a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMaskedViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTMaskedViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostView.h new file mode 100644 index 0000000..01d3861 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostView.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; +@class RCTModalHostViewController; + +@protocol RCTModalHostViewInteractor; + +@interface RCTModalHostView : UIView + +@property (nonatomic, copy) NSString *animationType; +@property (nonatomic, assign) UIModalPresentationStyle presentationStyle; +@property (nonatomic, assign, getter=isTransparent) BOOL transparent; + +@property (nonatomic, copy) RCTDirectEventBlock onShow; +@property (nonatomic, assign) BOOL visible; + +@property (nonatomic, copy) NSNumber *identifier; + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, copy) NSArray *supportedOrientations; +@property (nonatomic, copy) RCTDirectEventBlock onOrientationChange; + +// Fabric only +@property (nonatomic, copy) RCTBubblingEventBlock onDismiss; + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +@end + +@protocol RCTModalHostViewInteractor + +- (void)presentModalHostView:(RCTModalHostView *)modalHostView + withViewController:(RCTModalHostViewController *)viewController + animated:(BOOL)animated; +- (void)dismissModalHostView:(RCTModalHostView *)modalHostView + withViewController:(RCTModalHostViewController *)viewController + animated:(BOOL)animated; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostViewController.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostViewController.h new file mode 100644 index 0000000..a3f66b6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostViewController.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTModalHostViewController : UIViewController + +@property (nonatomic, copy) void (^boundsDidChangeBlock)(CGRect newBounds); + +@property (nonatomic, assign) UIInterfaceOrientationMask supportedInterfaceOrientations; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostViewManager.h new file mode 100644 index 0000000..e5b0815 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalHostViewManager.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTConvert (RCTModalHostView) + ++ (UIModalPresentationStyle)UIModalPresentationStyle:(id)json; + +@end + +typedef void (^RCTModalViewInteractionBlock)( + UIViewController *reactViewController, + UIViewController *viewController, + BOOL animated, + dispatch_block_t completionBlock); + +@interface RCTModalHostViewManager : RCTViewManager + +/** + * `presentationBlock` and `dismissalBlock` allow you to control how a Modal interacts with your case, + * e.g. in case you have a native navigator that has its own way to display a modal. + * If these are not specified, it falls back to the UIViewController standard way of presenting. + */ +@property (nonatomic, strong) RCTModalViewInteractionBlock presentationBlock; +@property (nonatomic, strong) RCTModalViewInteractionBlock dismissalBlock; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalManager.h new file mode 100644 index 0000000..4fbe6df --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModalManager.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTModalManager : RCTEventEmitter + +- (void)modalDismissed:(NSNumber *)modalID; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuleData.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuleData.h new file mode 100644 index 0000000..71e1950 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuleData.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import "RCTDefines.h" + +@protocol RCTBridgeMethod; +@protocol RCTBridgeModule; +@class RCTBridge; +@class RCTModuleRegistry; +@class RCTViewRegistry; +@class RCTBundleManager; +@class RCTCallableJSModules; + +typedef id (^RCTBridgeModuleProvider)(void); + +@interface RCTModuleData : NSObject + +- (instancetype)initWithModuleClass:(Class)moduleClass + bridge:(RCTBridge *)bridge + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules; + +- (instancetype)initWithModuleClass:(Class)moduleClass + moduleProvider:(RCTBridgeModuleProvider)moduleProvider + bridge:(RCTBridge *)bridge + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithModuleInstance:(id)instance + bridge:(RCTBridge *)bridge + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules NS_DESIGNATED_INITIALIZER; + +/** + * Calls `constantsToExport` on the module and stores the result. Note that + * this will init the module if it has not already been created. This method + * can be called on any thread, but may block the main thread briefly if the + * module implements `constantsToExport`. + */ +- (void)gatherConstants; + +@property (nonatomic, strong, readonly) Class moduleClass; +@property (nonatomic, copy, readonly) NSString *name; + +/** + * Returns the module methods. Note that this will gather the methods the first + * time it is called and then memoize the results. + */ +@property (nonatomic, copy, readonly) NSArray> *methods; + +/** + * Returns a map of the module methods. Note that this will gather the methods the first + * time it is called and then memoize the results. + */ +@property (nonatomic, copy, readonly) NSDictionary> *methodsByName; + +/** + * Returns the module's constants, if it exports any + */ +@property (nonatomic, copy, readonly) NSDictionary *exportedConstants; + +/** + * Returns YES if module instance has already been initialized; NO otherwise. + */ +@property (nonatomic, assign, readonly) BOOL hasInstance; + +/** + * Returns YES if module instance must be created on the main thread. + */ +@property (nonatomic, assign) BOOL requiresMainQueueSetup; + +/** + * Returns YES if module has constants to export. + */ +@property (nonatomic, assign, readonly) BOOL hasConstantsToExport; + +/** + * Returns the current module instance. Note that this will init the instance + * if it has not already been created. To check if the module instance exists + * without causing it to be created, use `hasInstance` instead. + */ +@property (nonatomic, strong, readwrite) id instance; + +/** + * Returns the module method dispatch queue. Note that this will init both the + * queue and the module itself if they have not already been created. + */ +@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue; + +/** + * Whether the receiver has a valid `instance` which implements -batchDidComplete. + */ +@property (nonatomic, assign, readonly) BOOL implementsBatchDidComplete; + +/** + * Whether the receiver has a valid `instance` which implements + * -partialBatchDidFlush. + */ +@property (nonatomic, assign, readonly) BOOL implementsPartialBatchDidFlush; + +@end + +RCT_EXTERN void RCTSetIsMainQueueExecutionOfConstantsToExportDisabled(BOOL val); +RCT_EXTERN BOOL RCTIsMainQueueExecutionOfConstantsToExportDisabled(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuleMethod.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuleMethod.h new file mode 100644 index 0000000..c93a060 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuleMethod.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; + +@interface RCTMethodArgument : NSObject + +@property (nonatomic, copy, readonly) NSString *type; +@property (nonatomic, readonly) RCTNullability nullability; +@property (nonatomic, readonly) BOOL unused; + +@end + +@interface RCTModuleMethod : NSObject + +@property (nonatomic, readonly) Class moduleClass; +@property (nonatomic, readonly) SEL selector; + +- (instancetype)initWithExportedMethod:(const RCTMethodInfo *)exportMethod + moduleClass:(Class)moduleClass NS_DESIGNATED_INITIALIZER; + +@end + +RCT_EXTERN NSString *RCTParseMethodSignature(const char *input, NSArray **arguments); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuloAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuloAnimatedNode.h new file mode 100644 index 0000000..fc7f69d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTModuloAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTModuloAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultilineTextInputView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultilineTextInputView.h new file mode 100644 index 0000000..0efd63a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultilineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultilineTextInputViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultilineTextInputViewManager.h new file mode 100644 index 0000000..3347fbb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultilineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultipartDataTask.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultipartDataTask.h new file mode 100644 index 0000000..bcf0c57 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultipartDataTask.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +typedef void (^RCTMultipartDataTaskCallback)( + NSInteger statusCode, + NSDictionary *headers, + NSData *content, + NSError *error, + BOOL done); + +@interface RCTMultipartDataTask : NSObject + +- (instancetype)initWithURL:(NSURL *)url + partHandler:(RCTMultipartDataTaskCallback)partHandler + progressHandler:(RCTMultipartProgressCallback)progressHandler; + +- (void)startTask; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultipartStreamReader.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultipartStreamReader.h new file mode 100644 index 0000000..5ef5b61 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultipartStreamReader.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef void (^RCTMultipartCallback)(NSDictionary *headers, NSData *content, BOOL done); +typedef void (^RCTMultipartProgressCallback)(NSDictionary *headers, NSNumber *loaded, NSNumber *total); + +// RCTMultipartStreamReader can be used to parse responses with Content-Type: multipart/mixed +// See https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html +@interface RCTMultipartStreamReader : NSObject + +- (instancetype)initWithInputStream:(NSInputStream *)stream boundary:(NSString *)boundary; +- (BOOL)readAllPartsWithCompletionCallback:(RCTMultipartCallback)callback + progressCallback:(RCTMultipartProgressCallback)progressCallback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultiplicationAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultiplicationAnimatedNode.h new file mode 100644 index 0000000..bb8b3b2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTMultiplicationAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTMultiplicationAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedModule.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedModule.h new file mode 100644 index 0000000..13b40fd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedModule.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import +#import +#import +#import + +#import "RCTValueAnimatedNode.h" + +// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. +// NOTE: This module is temporarily forked (see RCTNativeAnimatedTurboModule). +// When making any changes, be sure to apply them to the fork as well. +@interface RCTNativeAnimatedModule : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedNodesManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedNodesManager.h new file mode 100644 index 0000000..7832538 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedNodesManager.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import +#import + +@protocol RCTValueAnimatedNodeObserver; + +@interface RCTNativeAnimatedNodesManager : NSObject + +- (nonnull instancetype)initWithBridge:(RCTBridge *)bridge + surfacePresenter:(id)surfacePresenter; + +- (void)updateAnimations; + +- (void)stepAnimations:(nonnull CADisplayLink *)displaylink; + +- (BOOL)isNodeManagedByFabric:(nonnull NSNumber *)tag; + +- (void)getValue:(nonnull NSNumber *)nodeTag + saveCallback:(nullable RCTResponseSenderBlock)saveCallback; + +// graph + +- (void)createAnimatedNode:(nonnull NSNumber *)tag + config:(NSDictionary *__nonnull)config; + +- (void)connectAnimatedNodes:(nonnull NSNumber *)parentTag + childTag:(nonnull NSNumber *)childTag; + +- (void)disconnectAnimatedNodes:(nonnull NSNumber *)parentTag + childTag:(nonnull NSNumber *)childTag; + +- (void)connectAnimatedNodeToView:(nonnull NSNumber *)nodeTag + viewTag:(nonnull NSNumber *)viewTag + viewName:(nonnull NSString *)viewName; + +- (void)restoreDefaultValues:(nonnull NSNumber *)nodeTag; + +- (void)disconnectAnimatedNodeFromView:(nonnull NSNumber *)nodeTag + viewTag:(nonnull NSNumber *)viewTag; + +- (void)dropAnimatedNode:(nonnull NSNumber *)tag; + +// mutations + +- (void)setAnimatedNodeValue:(nonnull NSNumber *)nodeTag + value:(nonnull NSNumber *)value; + +- (void)setAnimatedNodeOffset:(nonnull NSNumber *)nodeTag + offset:(nonnull NSNumber *)offset; + +- (void)flattenAnimatedNodeOffset:(nonnull NSNumber *)nodeTag; + +- (void)extractAnimatedNodeOffset:(nonnull NSNumber *)nodeTag; + +// drivers + +- (void)startAnimatingNode:(nonnull NSNumber *)animationId + nodeTag:(nonnull NSNumber *)nodeTag + config:(NSDictionary *__nonnull)config + endCallback:(nullable RCTResponseSenderBlock)callBack; + +- (void)stopAnimation:(nonnull NSNumber *)animationId; + +- (void)stopAnimationLoop; + +// events + +- (void)addAnimatedEventToView:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + eventMapping:(NSDictionary *__nonnull)eventMapping; + +- (void)removeAnimatedEventFromView:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + animatedNodeTag:(nonnull NSNumber *)animatedNodeTag; + +- (void)handleAnimatedEvent:(nonnull id)event; + +// listeners + +- (void)startListeningToAnimatedNodeValue:(nonnull NSNumber *)tag + valueObserver:(nonnull id)valueObserver; + +- (void)stopListeningToAnimatedNodeValue:(nonnull NSNumber *)tag; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedTurboModule.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedTurboModule.h new file mode 100644 index 0000000..2da04a1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNativeAnimatedTurboModule.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import +#import +#import +#import + +#import "RCTValueAnimatedNode.h" + +// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. +// NOTE: This module is temporarily forked (see RCTNativeAnimatedModule). +// When making any changes, be sure to apply them to the fork as well. +@interface RCTNativeAnimatedTurboModule: RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworkPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworkPlugins.h new file mode 100644 index 0000000..b8ea7cd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworkPlugins.h @@ -0,0 +1,43 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTNetworkPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTNetworkClassProvider(const char *name); + +// Lookup functions +Class RCTNetworkingCls(void) __attribute__((used)); +Class RCTDataRequestHandlerCls(void) __attribute__((used)); +Class RCTFileRequestHandlerCls(void) __attribute__((used)); +Class RCTHTTPRequestHandlerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworkTask.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworkTask.h new file mode 100644 index 0000000..716a090 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworkTask.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef void (^RCTURLRequestCompletionBlock)(NSURLResponse *response, NSData *data, NSError *error); +typedef void (^RCTURLRequestCancellationBlock)(void); +typedef void (^RCTURLRequestIncrementalDataBlock)(NSData *data, int64_t progress, int64_t total); +typedef void (^RCTURLRequestProgressBlock)(int64_t progress, int64_t total); +typedef void (^RCTURLRequestResponseBlock)(NSURLResponse *response); + +typedef NS_ENUM(NSInteger, RCTNetworkTaskStatus) { + RCTNetworkTaskPending = 0, + RCTNetworkTaskInProgress, + RCTNetworkTaskFinished, +}; + +@interface RCTNetworkTask : NSObject + +@property (nonatomic, readonly) NSURLRequest *request; +@property (nonatomic, readonly) NSNumber *requestID; +@property (nonatomic, readonly, weak) id requestToken; +@property (nonatomic, readonly) NSURLResponse *response; + +@property (nonatomic, copy) RCTURLRequestCompletionBlock completionBlock; +@property (nonatomic, copy) RCTURLRequestProgressBlock downloadProgressBlock; +@property (nonatomic, copy) RCTURLRequestIncrementalDataBlock incrementalDataBlock; +@property (nonatomic, copy) RCTURLRequestResponseBlock responseBlock; +@property (nonatomic, copy) RCTURLRequestProgressBlock uploadProgressBlock; + +@property (nonatomic, readonly) RCTNetworkTaskStatus status; + +- (instancetype)initWithRequest:(NSURLRequest *)request + handler:(id)handler + callbackQueue:(dispatch_queue_t)callbackQueue NS_DESIGNATED_INITIALIZER; + +- (void)start; +- (void)cancel; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworking.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworking.h new file mode 100644 index 0000000..2068f32 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNetworking.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@protocol RCTNetworkingRequestHandler + +// @lint-ignore FBOBJCUNTYPEDCOLLECTION1 +- (BOOL)canHandleNetworkingRequest:(NSDictionary *)data; +// @lint-ignore FBOBJCUNTYPEDCOLLECTION1 +- (NSDictionary *)handleNetworkingRequest:(NSDictionary *)data; + +@end + +@protocol RCTNetworkingResponseHandler + +- (BOOL)canHandleNetworkingResponse:(NSString *)responseType; +- (id)handleNetworkingResponse:(NSURLResponse *)response data:(NSData *)data; + +@end + +@interface RCTNetworking : RCTEventEmitter + +/** + * Allows RCTNetworking instances to be initialized with handlers. + * The handlers will be requested via the bridge's moduleForName method when required. + */ +- (instancetype)initWithHandlersProvider:(NSArray> * (^)(RCTModuleRegistry *))getHandlers; + +/** + * Does a handler exist for the specified request? + */ +- (BOOL)canHandleRequest:(NSURLRequest *)request; + +/** + * Return an RCTNetworkTask for the specified request. This is useful for + * invoking the React Native networking stack from within native code. + */ +- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request + completionBlock:(RCTURLRequestCompletionBlock)completionBlock; + +- (void)addRequestHandler:(id)handler; + +- (void)addResponseHandler:(id)handler; + +- (void)removeRequestHandler:(id)handler; + +- (void)removeResponseHandler:(id)handler; + +@end + +@interface RCTBridge (RCTNetworking) + +@property (nonatomic, readonly) RCTNetworking *networking; + +@end + +// HACK: When uploading images/video from PHAssetLibrary, we change the URL scheme to be +// ph-upload://. This is to ensure that we upload a full video when given a ph-upload:// URL, +// instead of just the thumbnail. Consider the following problem: +// The user has a video in their camera roll with URL ph://1B3E2DDB-0AD3-4E33-A7A1-9F4AA9A762AA/L0/001 +// 1. We want to display that video in an and show the thumbnail +// 2. We later want to upload that video. +// At this point, if we use the same URL for both uses, there is no way to distinguish the intent +// and we will either upload the thumbnail (bad!) or try to show the video in an (bad!). +// Our solution is to change the URL scheme in the uploader. +extern NSString *const RCTNetworkingPHUploadHackScheme; diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNullability.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNullability.h new file mode 100644 index 0000000..f08d276 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTNullability.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSUInteger, RCTNullability) { + RCTNullabilityUnspecified, + RCTNullable, + RCTNonnullable, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPackagerClient.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPackagerClient.h new file mode 100644 index 0000000..3a7a3fd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPackagerClient.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#if RCT_DEV // Only supported in dev mode + +@class RCTPackagerClientResponder; +@class RCTReconnectingWebSocket; + +#if defined(__cplusplus) +extern "C" { +#endif + +extern const int RCT_PACKAGER_CLIENT_PROTOCOL_VERSION; + +#if defined(__cplusplus) +} +#endif + +@protocol RCTPackagerClientMethod + +- (void)handleRequest:(NSDictionary *)params withResponder:(RCTPackagerClientResponder *)responder; +- (void)handleNotification:(NSDictionary *)params; + +@optional + +/** By default object will receive its methods on the main queue, unless this method is overridden. */ +- (dispatch_queue_t)methodQueue; + +@end + +@interface RCTPackagerClientResponder : NSObject + +- (instancetype)initWithId:(id)msgId socket:(RCTReconnectingWebSocket *)socket; +- (void)respondWithResult:(id)result; +- (void)respondWithError:(id)error; + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPackagerConnection.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPackagerConnection.h new file mode 100644 index 0000000..795a3fc --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPackagerConnection.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#if RCT_DEV + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTPackagerClientMethod; +@class RCTPackagerClientResponder; + +typedef uint32_t RCTHandlerToken; +typedef void (^RCTNotificationHandler)(NSDictionary *); +typedef void (^RCTRequestHandler)(NSDictionary *, RCTPackagerClientResponder *); +typedef void (^RCTConnectedHandler)(void); + +/** Encapsulates singleton connection to React Native packager. */ +@interface RCTPackagerConnection : NSObject + ++ (instancetype)sharedPackagerConnection; + +/** + * Registers a handler for a notification broadcast from the packager. An + * example is "reload" - an instruction to reload from the packager. + * If multiple notification handlers are registered for the same method, they + * will all be invoked sequentially. + */ +- (RCTHandlerToken)addNotificationHandler:(RCTNotificationHandler)handler + queue:(dispatch_queue_t)queue + forMethod:(NSString *)method; + +/** + * Registers a handler for a request from the packager. An example is + * pokeSamplingProfiler; it asks for profile data from the client. + * Only one handler can be registered for a given method; calling this + * displaces any previous request handler registered for that method. + */ +- (RCTHandlerToken)addRequestHandler:(RCTRequestHandler)handler + queue:(dispatch_queue_t)queue + forMethod:(NSString *)method; + +/** + * Registers a handler that runs at most once, when the connection to the + * packager has been established. The handler will be dispatched immediately + * if the connection is already established. + */ +- (RCTHandlerToken)addConnectedHandler:(RCTConnectedHandler)handler queue:(dispatch_queue_t)queue; + +/** Removes a handler. Silently does nothing if the token is not valid. */ +- (void)removeHandler:(RCTHandlerToken)token; + +/** Disconnects and removes all handlers. */ +- (void)stop; + +/** Reconnect with given packager server. */ +- (void)reconnect:(NSString *)packagerServerHostPort; + +/** + * Historically no distinction was made between notification and request + * handlers. If you use this method, it will be registered as *both* a + * notification handler *and* a request handler. You should migrate to the + * new block-based API instead. + */ +- (void)addHandler:(id)handler + forMethod:(NSString *)method __deprecated_msg("Use addRequestHandler or addNotificationHandler instead"); + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTParserUtils.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTParserUtils.h new file mode 100644 index 0000000..15701f4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTParserUtils.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTParserUtils : NSObject + +/** + * Generic utility functions for parsing Objective-C source code. + */ +RCT_EXTERN BOOL RCTReadChar(const char **input, char c); +RCT_EXTERN BOOL RCTReadString(const char **input, const char *string); +RCT_EXTERN void RCTSkipWhitespace(const char **input); +RCT_EXTERN BOOL RCTParseSelectorIdentifier(const char **input, NSString **string); +RCT_EXTERN BOOL RCTParseArgumentIdentifier(const char **input, NSString **string); + +/** + * Parse an Objective-C type into a form that can be used by RCTConvert. + * This doesn't really belong here, but it's used by both RCTConvert and + * RCTModuleMethod, which makes it difficult to find a better home for it. + */ +RCT_EXTERN NSString *RCTParseType(const char **input); + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPerformanceLogger.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPerformanceLogger.h new file mode 100644 index 0000000..b0e4a4e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPerformanceLogger.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +// Keep this in sync with _labelsForTags +typedef NS_ENUM(NSUInteger, RCTPLTag) { + RCTPLScriptDownload = 0, + RCTPLScriptExecution, + RCTPLRAMBundleLoad, + RCTPLRAMStartupCodeSize, + RCTPLRAMStartupNativeRequires, + RCTPLRAMStartupNativeRequiresCount, + RCTPLRAMNativeRequires, + RCTPLRAMNativeRequiresCount, + RCTPLNativeModuleInit, + RCTPLNativeModuleMainThread, + RCTPLNativeModulePrepareConfig, + RCTPLNativeModuleMainThreadUsesCount, + RCTPLNativeModuleSetup, + RCTPLTurboModuleSetup, + RCTPLJSCWrapperOpenLibrary, + RCTPLBridgeStartup, + RCTPLTTI, + RCTPLBundleSize, + RCTPLReactInstanceInit, + RCTPLSize // This is used to count the size +}; + +@interface RCTPerformanceLogger : NSObject + +/** + * Starts measuring a metric with the given tag. + * Overrides previous value if the measurement has been already started. + * If RCTProfile is enabled it also begins appropriate async event. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)markStartForTag:(RCTPLTag)tag; + +/** + * Stops measuring a metric with given tag. + * Checks if RCTPerformanceLoggerStart() has been called before + * and doesn't do anything and log a message if it hasn't. + * If RCTProfile is enabled it also ends appropriate async event. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)markStopForTag:(RCTPLTag)tag; + +/** + * Sets given value for a metric with given tag. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)setValue:(int64_t)value forTag:(RCTPLTag)tag; + +/** + * Adds given value to the current value for a metric with given tag. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)addValue:(int64_t)value forTag:(RCTPLTag)tag; + +/** + * Starts an additional measurement for a metric with given tag. + * It doesn't override previous measurement, instead it'll append a new value + * to the old one. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)appendStartForTag:(RCTPLTag)tag; + +/** + * Stops measurement and appends the result to the metric with given tag. + * Checks if RCTPerformanceLoggerAppendStart() has been called before + * and doesn't do anything and log a message if it hasn't. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)appendStopForTag:(RCTPLTag)tag; + +/** + * Returns an array with values for all tags. + * Use RCTPLTag to go over the array, there's a pair of values + * for each tag: start and stop (with indexes 2 * tag and 2 * tag + 1). + */ +- (NSArray *)valuesForTags; + +/** + * Returns a duration in ms (stop_time - start_time) for given RCTPLTag. + */ +- (int64_t)durationForTag:(RCTPLTag)tag; + +/** + * Returns a value for given RCTPLTag. + */ +- (int64_t)valueForTag:(RCTPLTag)tag; + +/** + * Returns an array with values for all tags. + * Use RCTPLTag to go over the array. + */ +- (NSArray *)labelsForTags; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPlatform.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPlatform.h new file mode 100644 index 0000000..64ce567 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPlatform.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTPlatform : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPointerEvents.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPointerEvents.h new file mode 100644 index 0000000..001c85f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPointerEvents.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTPointerEvents) { + RCTPointerEventsUnspecified = 0, // Default + RCTPointerEventsNone, + RCTPointerEventsBoxNone, + RCTPointerEventsBoxOnly, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTProfile.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTProfile.h new file mode 100644 index 0000000..7c6dec1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTProfile.h @@ -0,0 +1,226 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +/** + * RCTProfile + * + * This file provides a set of functions and macros for performance profiling + * + * NOTE: This API is a work in progress, please consider carefully before + * using it. + */ + +RCT_EXTERN NSString *const RCTProfileDidStartProfiling; +RCT_EXTERN NSString *const RCTProfileDidEndProfiling; + +RCT_EXTERN const uint64_t RCTProfileTagAlways; + +#if RCT_PROFILE + +@class RCTBridge; + +#define RCTProfileBeginFlowEvent() \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wshadow\"") NSUInteger __rct_profile_flow_id = \ + _RCTProfileBeginFlowEvent(); \ + _Pragma("clang diagnostic pop") + +#define RCTProfileEndFlowEvent() _RCTProfileEndFlowEvent(__rct_profile_flow_id) + +RCT_EXTERN dispatch_queue_t RCTProfileGetQueue(void); + +RCT_EXTERN NSUInteger _RCTProfileBeginFlowEvent(void); +RCT_EXTERN void _RCTProfileEndFlowEvent(NSUInteger); + +/** + * Returns YES if the profiling information is currently being collected + */ +RCT_EXTERN BOOL RCTProfileIsProfiling(void); + +/** + * Start collecting profiling information + */ +RCT_EXTERN void RCTProfileInit(RCTBridge *); + +/** + * Stop profiling and return a JSON string of the collected data - The data + * returned is compliant with google's trace event format - the format used + * as input to trace-viewer + */ +RCT_EXTERN void RCTProfileEnd(RCTBridge *, void (^)(NSString *)); + +/** + * Collects the initial event information for the event and returns a reference ID + */ +RCT_EXTERN void _RCTProfileBeginEvent( + NSThread *calleeThread, + NSTimeInterval time, + uint64_t tag, + NSString *name, + NSDictionary *args); +#define RCT_PROFILE_BEGIN_EVENT(tag, name, args) \ + do { \ + if (RCTProfileIsProfiling()) { \ + NSThread *__calleeThread = [NSThread currentThread]; \ + NSTimeInterval __time = CACurrentMediaTime(); \ + _RCTProfileBeginEvent(__calleeThread, __time, tag, name, args); \ + } \ + } while (0) + +/** + * The ID returned by BeginEvent should then be passed into EndEvent, with the + * rest of the event information. Just at this point the event will actually be + * registered + */ +RCT_EXTERN void _RCTProfileEndEvent( + NSThread *calleeThread, + NSString *threadName, + NSTimeInterval time, + uint64_t tag, + NSString *category); + +#define RCT_PROFILE_END_EVENT(tag, category) \ + do { \ + if (RCTProfileIsProfiling()) { \ + NSThread *__calleeThread = [NSThread currentThread]; \ + NSString *__threadName = RCTCurrentThreadName(); \ + NSTimeInterval __time = CACurrentMediaTime(); \ + _RCTProfileEndEvent(__calleeThread, __threadName, __time, tag, category); \ + } \ + } while (0) + +/** + * Collects the initial event information for the event and returns a reference ID + */ +RCT_EXTERN NSUInteger +RCTProfileBeginAsyncEvent(uint64_t tag, NSString *name, NSDictionary *args); + +/** + * The ID returned by BeginEvent should then be passed into EndEvent, with the + * rest of the event information. Just at this point the event will actually be + * registered + */ +RCT_EXTERN void +RCTProfileEndAsyncEvent(uint64_t tag, NSString *category, NSUInteger cookie, NSString *name, NSString *threadName); + +/** + * An event that doesn't have a duration (i.e. Notification, VSync, etc) + */ +RCT_EXTERN void RCTProfileImmediateEvent(uint64_t tag, NSString *name, NSTimeInterval time, char scope); + +/** + * Helper to profile the duration of the execution of a block. This method uses + * self and _cmd to name this event for simplicity sake. + * + * NOTE: The block can't expect any argument + * + * DEPRECATED: this approach breaks debugging and stepping through instrumented block functions + */ +#define RCTProfileBlock(block, tag, category, arguments) \ + ^{ \ + RCT_PROFILE_BEGIN_EVENT(tag, @(__PRETTY_FUNCTION__), nil); \ + block(); \ + RCT_PROFILE_END_EVENT(tag, category, arguments); \ + } + +/** + * Hook into a bridge instance to log all bridge module's method calls + */ +RCT_EXTERN void RCTProfileHookModules(RCTBridge *); + +/** + * Unhook from a given bridge instance's modules + */ +RCT_EXTERN void RCTProfileUnhookModules(RCTBridge *); + +/** + * Hook into all of a module's methods + */ +RCT_EXTERN void RCTProfileHookInstance(id instance); + +/** + * Send systrace or cpu profiling information to the packager + * to present to the user + */ +RCT_EXTERN void RCTProfileSendResult(RCTBridge *bridge, NSString *route, NSData *profileData); + +/** + * Systrace gluecode + * + * allow to use systrace to back RCTProfile + */ + +typedef struct { + const char *key; + unsigned long key_len; + const char *value; + unsigned long value_len; +} systrace_arg_t; + +typedef struct { + char *(*start)(void); + void (*stop)(void); + + void (*begin_section)(uint64_t tag, const char *name, size_t numArgs, systrace_arg_t *args); + void (*end_section)(uint64_t tag, size_t numArgs, systrace_arg_t *args); + + void (*begin_async_section)(uint64_t tag, const char *name, int cookie, size_t numArgs, systrace_arg_t *args); + void (*end_async_section)(uint64_t tag, const char *name, int cookie, size_t numArgs, systrace_arg_t *args); + + void (*instant_section)(uint64_t tag, const char *name, char scope); + + void (*begin_async_flow)(uint64_t tag, const char *name, int cookie); + void (*end_async_flow)(uint64_t tag, const char *name, int cookie); +} RCTProfileCallbacks; + +RCT_EXTERN void RCTProfileRegisterCallbacks(RCTProfileCallbacks *); + +/** + * Systrace control window + */ +RCT_EXTERN void RCTProfileShowControls(void); +RCT_EXTERN void RCTProfileHideControls(void); + +#else + +#define RCTProfileBeginFlowEvent() +#define _RCTProfileBeginFlowEvent() @0 + +#define RCTProfileEndFlowEvent() +#define _RCTProfileEndFlowEvent(...) + +#define RCTProfileIsProfiling(...) NO +#define RCTProfileInit(...) +#define RCTProfileEnd(...) @"" + +#define _RCTProfileBeginEvent(...) +#define _RCTProfileEndEvent(...) + +#define RCT_PROFILE_BEGIN_EVENT(...) +#define RCT_PROFILE_END_EVENT(...) + +#define RCTProfileBeginAsyncEvent(...) 0 +#define RCTProfileEndAsyncEvent(...) + +#define RCTProfileImmediateEvent(...) + +#define RCTProfileBlock(block, ...) block + +#define RCTProfileHookModules(...) +#define RCTProfileHookInstance(...) +#define RCTProfileUnhookModules(...) + +#define RCTProfileSendResult(...) + +#define RCTProfileShowControls(...) +#define RCTProfileHideControls(...) + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTProgressViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTProgressViewManager.h new file mode 100644 index 0000000..32b0988 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTProgressViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTProgressViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPropsAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPropsAnimatedNode.h new file mode 100644 index 0000000..0b5f532 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTPropsAnimatedNode.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + +#import + +@class RCTBridge; +@class RCTViewPropertyMapper; + +@interface RCTPropsAnimatedNode : RCTAnimatedNode + +- (void)connectToView:(NSNumber *)viewTag + viewName:(NSString *)viewName + bridge:(RCTBridge *)bridge + surfacePresenter:(id)surfacePresenter; + +- (void)disconnectFromView:(NSNumber *)viewTag; + +- (void)restoreDefaultValues; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRawTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRawTextShadowView.h new file mode 100644 index 0000000..1b63014 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRawTextShadowView.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextShadowView : RCTShadowView + +@property (nonatomic, copy, nullable) NSString *text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRawTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRawTextViewManager.h new file mode 100644 index 0000000..ef9a076 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRawTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTReconnectingWebSocket.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTReconnectingWebSocket.h new file mode 100644 index 0000000..25aa3ef --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTReconnectingWebSocket.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#if RCT_DEV // Only supported in dev mode + +@class RCTReconnectingWebSocket; + +@protocol RCTReconnectingWebSocketDelegate +- (void)reconnectingWebSocketDidOpen:(RCTReconnectingWebSocket *)webSocket; +- (void)reconnectingWebSocket:(RCTReconnectingWebSocket *)webSocket didReceiveMessage:(id)message; +/** Sent when the socket has closed due to error or clean shutdown. An automatic reconnect will start shortly. */ +- (void)reconnectingWebSocketDidClose:(RCTReconnectingWebSocket *)webSocket; +@end + +@interface RCTReconnectingWebSocket : NSObject + +/** Delegate will be messaged on the given queue (required). */ +- (instancetype)initWithURL:(NSURL *)url queue:(dispatch_queue_t)queue; + +@property (nonatomic, weak) id delegate; +- (void)send:(id)data; +- (void)start; +- (void)stop; + +- (instancetype)initWithURL:(NSURL *)url __deprecated_msg("Use initWithURL:queue: instead"); +/** @brief Must be set before -start to have effect */ +@property (nonatomic, strong) dispatch_queue_t delegateDispatchQueue __deprecated_msg("Use initWithURL:queue: instead"); + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBox.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBox.h new file mode 100644 index 0000000..d468f44 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBox.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTJSStackFrame; + +typedef void (^RCTRedBoxButtonPressHandler)(void); + +@interface RCTRedBox : NSObject + +- (void)registerErrorCustomizer:(id)errorCustomizer; +- (void)showError:(NSError *)error; +- (void)showErrorMessage:(NSString *)message; +- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details; +- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack; +- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack errorCookie:(int)errorCookie; +- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack; +- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack; +- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack errorCookie:(int)errorCookie; +- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack errorCookie:(int)errorCookie; +- (void)showErrorMessage:(NSString *)message withParsedStack:(NSArray *)stack; +- (void)updateErrorMessage:(NSString *)message withParsedStack:(NSArray *)stack; +- (void)showErrorMessage:(NSString *)message + withParsedStack:(NSArray *)stack + errorCookie:(int)errorCookie; +- (void)updateErrorMessage:(NSString *)message + withParsedStack:(NSArray *)stack + errorCookie:(int)errorCookie; + +- (void)dismiss; + +- (void)addCustomButton:(NSString *)title onPressHandler:(RCTRedBoxButtonPressHandler)handler; + +/** Overrides bridge.bundleURL. Modify on main thread only. You shouldn't need to use this. */ +@property (nonatomic, strong) NSURL *overrideBundleURL; + +/** Overrides the default behavior of calling [bridge reload] on reload. You shouldn't need to use this. */ +@property (nonatomic, strong) dispatch_block_t overrideReloadAction; + +@end + +/** + * This category makes the red box instance available via the RCTBridge, which + * is useful for any class that needs to access the red box or error log. + */ +@interface RCTBridge (RCTRedBox) + +@property (nonatomic, readonly) RCTRedBox *redBox; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBoxExtraDataViewController.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBoxExtraDataViewController.h new file mode 100644 index 0000000..8d2b4c2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBoxExtraDataViewController.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTRedBoxExtraDataActionDelegate +- (void)reload; +@end + +@interface RCTRedBoxExtraDataViewController : UIViewController + +@property (nonatomic, weak) id actionDelegate; + +- (void)addExtraData:(NSDictionary *)data forIdentifier:(NSString *)identifier; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBoxSetEnabled.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBoxSetEnabled.h new file mode 100644 index 0000000..fd53eb7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRedBoxSetEnabled.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +// In debug builds, the red box is enabled by default but it is further +// customizable using this method. However, this method only has an effect in +// builds where RCTRedBox is actually compiled in. +RCT_EXTERN void RCTRedBoxSetEnabled(BOOL enabled); +RCT_EXTERN BOOL RCTRedBoxGetEnabled(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshControl.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshControl.h new file mode 100644 index 0000000..c17b226 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshControl.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTRefreshControl : UIRefreshControl + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) RCTDirectEventBlock onRefresh; +@property (nonatomic, weak) UIScrollView *scrollView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshControlManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshControlManager.h new file mode 100644 index 0000000..107a9db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshControlManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTRefreshControlManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshableProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshableProtocol.h new file mode 100644 index 0000000..9271e2d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRefreshableProtocol.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * Protocol used to dispatch commands in `RCTRefreshControlManager.h`. + * This is in order to support commands for both Paper and Fabric components + * during migration. + */ +@protocol RCTRefreshableProtocol + +- (void)setRefreshing:(BOOL)refreshing; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTReloadCommand.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTReloadCommand.h new file mode 100644 index 0000000..4846275 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTReloadCommand.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * A protocol which should be conformed to in order to be notified of RN reload events. These events can be + * created by CMD+R or dev menu during development, or anywhere the trigger is exposed to JS. + * The listener must also register itself using the method below. + */ +@protocol RCTReloadListener +- (void)didReceiveReloadCommand; +@end + +/** + * Registers a weakly-held observer of RN reload events. + */ +RCT_EXTERN void RCTRegisterReloadCommandListener(id listener); + +/** + * Triggers a reload for all current listeners. Replaces [_bridge reload]. + */ +RCT_EXTERN void RCTTriggerReloadCommandListeners(NSString *reason); + +/** + * This notification fires anytime RCTTriggerReloadCommandListeners() is called. + */ +RCT_EXTERN NSString *const RCTTriggerReloadCommandNotification; +RCT_EXTERN NSString *const RCTTriggerReloadCommandReasonKey; +RCT_EXTERN NSString *const RCTTriggerReloadCommandBundleURLKey; + +RCT_EXTERN void RCTReloadCommandSetBundleURL(NSURL *URL); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTResizeMode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTResizeMode.h new file mode 100644 index 0000000..468a58a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTResizeMode.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTResizeMode) { + RCTResizeModeCover = UIViewContentModeScaleAspectFill, + RCTResizeModeContain = UIViewContentModeScaleAspectFit, + RCTResizeModeStretch = UIViewContentModeScaleToFill, + RCTResizeModeCenter = UIViewContentModeCenter, + RCTResizeModeRepeat = -1, // Use negative values to avoid conflicts with iOS enum values. +}; + +@interface RCTConvert(RCTResizeMode) + ++ (RCTResizeMode)RCTResizeMode:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootContentView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootContentView.h new file mode 100644 index 0000000..dfc6d03 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootContentView.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; +@class RCTTouchHandler; + +@interface RCTRootContentView : RCTView + +@property (nonatomic, readonly, weak) RCTBridge *bridge; +@property (nonatomic, readonly, assign) BOOL contentHasAppeared; +@property (nonatomic, readonly, strong) RCTTouchHandler *touchHandler; +@property (nonatomic, readonly, assign) CGSize availableSize; + +@property (nonatomic, assign) BOOL passThroughTouches; +@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility; + +- (instancetype)initWithFrame:(CGRect)frame + bridge:(RCTBridge *)bridge + reactTag:(NSNumber *)reactTag + sizeFlexiblity:(RCTRootViewSizeFlexibility)sizeFlexibility NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootShadowView.h new file mode 100644 index 0000000..74af7e8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootShadowView.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTRootShadowView : RCTShadowView + +/** + * Minimum size to layout all views. + * Defaults to CGSizeZero + */ +@property (nonatomic, assign) CGSize minimumSize; + +/** + * Available size to layout all views. + * Defaults to {INFINITY, INFINITY} + */ +@property (nonatomic, assign) CGSize availableSize; + +/** + * Layout direction (LTR or RTL) inherited from native environment and + * is using as a base direction value in layout engine. + * Defaults to value inferred from current locale. + */ +@property (nonatomic, assign) YGDirection baseDirection; + +- (void)layoutWithAffectedShadowViews:(NSHashTable *)affectedShadowViews; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootView.h new file mode 100644 index 0000000..dd56345 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootView.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@protocol RCTRootViewDelegate; + +/** + * This enum is used to define size flexibility type of the root view. + * If a dimension is flexible, the view will recalculate that dimension + * so the content fits. Recalculations are performed when the root's frame, + * size flexibility mode or content size changes. After a recalculation, + * rootViewDidChangeIntrinsicSize method of the RCTRootViewDelegate will be called. + */ +typedef NS_ENUM(NSInteger, RCTRootViewSizeFlexibility) { + RCTRootViewSizeFlexibilityNone = 0, + RCTRootViewSizeFlexibilityWidth = 1 << 0, + RCTRootViewSizeFlexibilityHeight = 1 << 1, + RCTRootViewSizeFlexibilityWidthAndHeight = RCTRootViewSizeFlexibilityWidth | RCTRootViewSizeFlexibilityHeight, +}; + +/** + * This notification is sent when the first subviews are added to the root view + * after the application has loaded. This is used to hide the `loadingView`, and + * is a good indicator that the application is ready to use. + */ +#if defined(__cplusplus) +extern "C" +#else +extern +#endif + + NS_ASSUME_NONNULL_BEGIN + + NSString *const RCTContentDidAppearNotification; + +/** + * Native view used to host React-managed views within the app. Can be used just + * like any ordinary UIView. You can have multiple RCTRootViews on screen at + * once, all controlled by the same JavaScript application. + */ +@interface RCTRootView : UIView + +/** + * - Designated initializer - + */ +- (instancetype)initWithFrame:(CGRect)frame + bridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(nullable NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER; + +/** + * - Convenience initializer - + * The frame will default to CGRectZero. + */ +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(nullable NSDictionary *)initialProperties; + +/** + * - Convenience initializer - + * A bridge will be created internally. + * This initializer is intended to be used when the app has a single RCTRootView, + * otherwise create an `RCTBridge` and pass it in via `initWithBridge:moduleName:` + * to all the instances. + */ +- (instancetype)initWithBundleURL:(NSURL *)bundleURL + moduleName:(NSString *)moduleName + initialProperties:(nullable NSDictionary *)initialProperties + launchOptions:(nullable NSDictionary *)launchOptions; + +/** + * This API allows RCTRootView users to know if the root view is backed by the bridge. + */ +@property (nonatomic, readonly) BOOL hasBridge; + +/** + * This API allows users of RCTRootView to access other NativeModules, without + * directly accessing the bridge. + */ +@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; + +@property (nonatomic, strong, readonly) id eventDispatcher; + +/** + * The name of the JavaScript module to execute within the + * specified scriptURL (required). Setting this will not have + * any immediate effect, but it must be done prior to loading + * the script. + */ +@property (nonatomic, copy, readonly) NSString *moduleName; + +/** + * The bridge used by the root view. Bridges can be shared between multiple + * root views, so you can use this property to initialize another RCTRootView. + */ +@property (nonatomic, strong, readonly) RCTBridge *bridge; + +/** + * The properties to apply to the view. Use this property to update + * application properties and rerender the view. Initialized with + * initialProperties argument of the initializer. + * + * Set this property only on the main thread. + */ +@property (nonatomic, copy, readwrite, nullable) NSDictionary *appProperties; + +/** + * The size flexibility mode of the root view. + */ +@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility; + +/* + * The minimum size of the root view, defaults to CGSizeZero. + */ +@property (nonatomic, assign) CGSize minimumSize; + +/** + * The delegate that handles intrinsic size updates. + */ +@property (nonatomic, weak, nullable) id delegate; + +/** + * The backing view controller of the root view. + */ +@property (nonatomic, weak, nullable) UIViewController *reactViewController; + +/** + * The React-managed contents view of the root view. + */ +@property (nonatomic, strong, readonly) UIView *contentView; + +/** + * A view to display while the JavaScript is loading, so users aren't presented + * with a blank screen. By default this is nil, but you can override it with + * (for example) a UIActivityIndicatorView or a placeholder image. + */ +@property (nonatomic, strong, nullable) UIView *loadingView; + +/** + * When set, any touches on the RCTRootView that are not matched up to any of the child + * views will be passed to siblings of the RCTRootView. See -[UIView hitTest:withEvent:] + * for details on iOS hit testing. + * + * Enable this to support a semi-transparent RN view that occupies the whole screen but + * has visible content below it that the user can interact with. + * + * The default value is NO. + */ +@property (nonatomic, assign) BOOL passThroughTouches; + +/** + * Timings for hiding the loading view after the content has loaded. Both of + * these values default to 0.25 seconds. + */ +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay; +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration; + +@end + +@interface RCTRootView (Deprecated) + +/** + * The intrinsic size of the root view's content. This is set right before the + * `rootViewDidChangeIntrinsicSize` method of `RCTRootViewDelegate` is called. + * This property is deprecated and will be removed in next releases. + * Use UIKit `intrinsicContentSize` property instead. + */ +@property (readonly, nonatomic, assign) CGSize intrinsicSize __deprecated_msg("Use `intrinsicContentSize` instead."); + +/** + * This methods is deprecated and will be removed soon. + * To interrupt a React Native gesture recognizer, use the standard + * `UIGestureRecognizer` negotiation process. + * See `UIGestureRecognizerDelegate` for more details. + */ +- (void)cancelTouches; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootViewDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootViewDelegate.h new file mode 100644 index 0000000..5749157 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootViewDelegate.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTRootView; + +@protocol RCTRootViewDelegate + +/** + * Called after the root view's intrinsic content size is changed. + * + * The method is not called when both old size and new size have + * a dimension that equals to zero. + * + * The delegate can use this callback to appropriately resize + * the root view's frame to fit the new intrinsic content view size, + * but usually it is not necessary because the root view will also call + * `setNeedsLayout` for its superview which in its turn will trigger relayout. + * + * The new intrinsic content size is available via the `intrinsicContentSize` + * property of the root view. The view will not resize itself. + */ +- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootViewInternal.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootViewInternal.h new file mode 100644 index 0000000..8e28dd4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTRootViewInternal.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * The interface provides a set of functions that allow other internal framework + * classes to change the RCTRootViews's internal state. + */ +@interface RCTRootView () + +/** + * This setter should be used only by RCTUIManager on react root view + * intrinsic content size update. + */ +@property (readwrite, nonatomic, assign) CGSize intrinsicContentSize; + +- (void)contentViewInvalidated; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSRWebSocket.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSRWebSocket.h new file mode 100644 index 0000000..1b17cff --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSRWebSocket.h @@ -0,0 +1,132 @@ +// +// Copyright 2012 Square Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import +#import + +typedef NS_ENUM(unsigned int, RCTSRReadyState) { + RCTSR_CONNECTING = 0, + RCTSR_OPEN = 1, + RCTSR_CLOSING = 2, + RCTSR_CLOSED = 3, +}; + +typedef NS_ENUM(NSInteger, RCTSRStatusCode) { + RCTSRStatusCodeNormal = 1000, + RCTSRStatusCodeGoingAway = 1001, + RCTSRStatusCodeProtocolError = 1002, + RCTSRStatusCodeUnhandledType = 1003, + // 1004 reserved. + RCTSRStatusNoStatusReceived = 1005, + // 1004-1006 reserved. + RCTSRStatusCodeInvalidUTF8 = 1007, + RCTSRStatusCodePolicyViolated = 1008, + RCTSRStatusCodeMessageTooBig = 1009, +}; + +@class RCTSRWebSocket; + +extern NSString *const RCTSRWebSocketErrorDomain; +extern NSString *const RCTSRHTTPResponseErrorKey; + +#pragma mark - RCTSRWebSocketDelegate + +@protocol RCTSRWebSocketDelegate; + +#pragma mark - RCTSRWebSocket + +@interface RCTSRWebSocket : NSObject + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, readonly) RCTSRReadyState readyState; +@property (nonatomic, readonly, strong) NSURL *url; + +// This returns the negotiated protocol. +// It will be nil until after the handshake completes. +@property (nonatomic, readonly, copy) NSString *protocol; + +// Protocols should be an array of strings that turn into Sec-WebSocket-Protocol. +- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithURLRequest:(NSURLRequest *)request; + +// Some helper constructors. +- (instancetype)initWithURL:(NSURL *)url protocols:(NSArray *)protocols; +- (instancetype)initWithURL:(NSURL *)url; + +// Delegate queue will be dispatch_main_queue by default. +// You cannot set both OperationQueue and dispatch_queue. +- (void)setDelegateOperationQueue:(NSOperationQueue *)queue; +- (void)setDelegateDispatchQueue:(dispatch_queue_t)queue; + +// By default, it will schedule itself on +[NSRunLoop RCTSR_networkRunLoop] using defaultModes. +- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; +- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; + +// RCTSRWebSockets are intended for one-time-use only. Open should be called once and only once. +- (void)open; + +- (void)close; +- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason; + +// Send a UTF8 String or Data. +- (void)send:(id)data; + +// Send Data (can be nil) in a ping message. +- (void)sendPing:(NSData *)data; + +@end + +#pragma mark - RCTSRWebSocketDelegate + +@protocol RCTSRWebSocketDelegate + +// message will either be an NSString if the server is using text +// or NSData if the server is using binary. +- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message; + +@optional + +- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket; +- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error; +- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; +- (void)webSocket:(RCTSRWebSocket *)webSocket didReceivePong:(NSData *)pongPayload; + +@end + +#pragma mark - NSURLRequest (CertificateAdditions) + +@interface NSURLRequest (CertificateAdditions) + +@property (nonatomic, readonly, copy) NSArray *RCTSR_SSLPinnedCertificates; + +@end + +#pragma mark - NSMutableURLRequest (CertificateAdditions) + +@interface NSMutableURLRequest (CertificateAdditions) + +@property (nonatomic, copy) NSArray *RCTSR_SSLPinnedCertificates; + +@end + +#pragma mark - NSRunLoop (RCTSRWebSocket) + +@interface NSRunLoop (RCTSRWebSocket) + ++ (NSRunLoop *)RCTSR_networkRunLoop; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaShadowView.h new file mode 100644 index 0000000..784a4e0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaShadowView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSafeAreaShadowView : RCTShadowView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaView.h new file mode 100644 index 0000000..ae1b6b3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaView.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTBridge; + +@interface RCTSafeAreaView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) BOOL emulateUnlessSupported; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaViewLocalData.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaViewLocalData.h new file mode 100644 index 0000000..24c776c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaViewLocalData.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSafeAreaViewLocalData : NSObject + +- (instancetype)initWithInsets:(UIEdgeInsets)insets; + +@property (atomic, readonly) UIEdgeInsets insets; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaViewManager.h new file mode 100644 index 0000000..71dcc3c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSafeAreaViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSafeAreaViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentShadowView.h new file mode 100644 index 0000000..ecae476 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentShadowView.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTScrollContentShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentView.h new file mode 100644 index 0000000..8d33a5a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentView.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTScrollContentView : RCTView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentViewManager.h new file mode 100644 index 0000000..7645c04 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollContentViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTScrollContentViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollEvent.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollEvent.h new file mode 100644 index 0000000..29a645d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollEvent.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTScrollEvent : NSObject + +- (instancetype)initWithEventName:(NSString *)eventName + reactTag:(NSNumber *)reactTag + scrollViewContentOffset:(CGPoint)scrollViewContentOffset + scrollViewContentInset:(UIEdgeInsets)scrollViewContentInset + scrollViewContentSize:(CGSize)scrollViewContentSize + scrollViewFrame:(CGRect)scrollViewFrame + scrollViewZoomScale:(CGFloat)scrollViewZoomScale + userData:(NSDictionary *)userData + coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollView.h new file mode 100644 index 0000000..ea1522b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollView.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import + +@protocol UIScrollViewDelegate; + +@interface RCTScrollView : RCTView + +- (instancetype)initWithEventDispatcher:(id)eventDispatcher NS_DESIGNATED_INITIALIZER; + +/** + * The `RCTScrollView` may have at most one single subview. This will ensure + * that the scroll view's `contentSize` will be efficiently set to the size of + * the single subview's frame. That frame size will be determined somewhat + * efficiently since it will have already been computed by the off-main-thread + * layout system. + */ +@property (nonatomic, readonly) UIView *contentView; + +/** + * The underlying scrollView (TODO: can we remove this?) + */ +@property (nonatomic, readonly) UIScrollView *scrollView; + +@property (nonatomic, assign) UIEdgeInsets contentInset; +@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; +@property (nonatomic, assign) BOOL DEPRECATED_sendUpdatedChildFrames; +@property (nonatomic, assign) NSTimeInterval scrollEventThrottle; +@property (nonatomic, assign) BOOL centerContent; +@property (nonatomic, copy) NSDictionary *maintainVisibleContentPosition; +@property (nonatomic, assign) BOOL scrollToOverflowEnabled; +@property (nonatomic, assign) int snapToInterval; +@property (nonatomic, assign) BOOL disableIntervalMomentum; +@property (nonatomic, copy) NSArray *snapToOffsets; +@property (nonatomic, assign) BOOL snapToStart; +@property (nonatomic, assign) BOOL snapToEnd; +@property (nonatomic, copy) NSString *snapToAlignment; +@property (nonatomic, assign) BOOL inverted; +@property (nonatomic, assign) int minPointers; + +// NOTE: currently these event props are only declared so we can export the +// event names to JS - we don't call the blocks directly because scroll events +// need to be coalesced before sending, for performance reasons. +@property (nonatomic, copy) RCTDirectEventBlock onScrollBeginDrag; +@property (nonatomic, copy) RCTDirectEventBlock onScroll; +@property (nonatomic, copy) RCTDirectEventBlock onScrollToTop; +@property (nonatomic, copy) RCTDirectEventBlock onScrollEndDrag; +@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollBegin; +@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollEnd; + +@end + +@interface RCTScrollView (Internal) + +- (void)updateContentSizeIfNeeded; + +@end + +RCT_EXTERN void RCTSendFakeScrollEvent(id eventDispatcher, NSNumber *reactTag); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollViewManager.h new file mode 100644 index 0000000..94f6e19 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollViewManager.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTConvert (UIScrollView) + ++ (UIScrollViewKeyboardDismissMode)UIScrollViewKeyboardDismissMode:(id)json; + +@end + +@interface RCTScrollViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollableProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollableProtocol.h new file mode 100644 index 0000000..ec6772e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTScrollableProtocol.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * Contains any methods related to scrolling. Any `RCTView` that has scrolling + * features should implement these methods. + */ +@protocol RCTScrollableProtocol + +@property (nonatomic, readonly) CGSize contentSize; + +- (void)scrollToOffset:(CGPoint)offset; +- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated; +/** + * If this is a vertical scroll view, scrolls to the bottom. + * If this is a horizontal scroll view, scrolls to the right. + */ +- (void)scrollToEnd:(BOOL)animated; +- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated; + +- (void)addScrollListener:(NSObject *)scrollListener; +- (void)removeScrollListener:(NSObject *)scrollListener; + +@end + +/** + * Denotes a view which implements custom pull to refresh functionality. + */ +@protocol RCTCustomRefreshContolProtocol + +@property (nonatomic, copy) RCTDirectEventBlock onRefresh; +@property (nonatomic, readonly, getter=isRefreshing) BOOL refreshing; + +@optional +@property (nonatomic, weak) UIScrollView *scrollView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSegmentedControl.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSegmentedControl.h new file mode 100644 index 0000000..b428f4d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSegmentedControl.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSegmentedControl : UISegmentedControl + +@property (nonatomic, copy) NSArray *values; +@property (nonatomic, assign) NSInteger selectedIndex; +@property (nonatomic, copy) RCTBubblingEventBlock onChange; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSegmentedControlManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSegmentedControlManager.h new file mode 100644 index 0000000..edc9df9 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSegmentedControlManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTSegmentedControlManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSettingsManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSettingsManager.h new file mode 100644 index 0000000..4e76780 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSettingsManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSettingsManager : NSObject + +- (instancetype)initWithUserDefaults:(NSUserDefaults *)defaults NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSettingsPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSettingsPlugins.h new file mode 100644 index 0000000..cf79705 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSettingsPlugins.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTSettingsPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTSettingsClassProvider(const char *name); + +// Lookup functions +Class RCTSettingsManagerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView+Internal.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView+Internal.h new file mode 100644 index 0000000..b871ce6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView+Internal.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@class RCTRootShadowView; + +@interface RCTShadowView (Internal) + +@property (nonatomic, weak, readwrite) RCTRootShadowView *rootView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView+Layout.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView+Layout.h new file mode 100644 index 0000000..7e09674 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView+Layout.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTShadowView (Layout) + +#pragma mark - Computed Layout-Inferred Metrics + +@property (nonatomic, readonly) UIEdgeInsets paddingAsInsets; +@property (nonatomic, readonly) UIEdgeInsets borderAsInsets; +@property (nonatomic, readonly) UIEdgeInsets compoundInsets; +@property (nonatomic, readonly) CGSize availableSize; +@property (nonatomic, readonly) CGRect contentFrame; + +#pragma mark - Dirty Propagation Control + +/** + * Designated method to control dirty propagation mechanism. + * Dirties the shadow view (and all affected shadow views, usually a superview) + * in terms of layout. + * The default implementation does nothing. + */ +- (void)dirtyLayout; + +/** + * Designated method to control dirty propagation mechanism. + * Clears (makes not dirty) the shadow view. + * The default implementation does nothing. + */ +- (void)clearLayout; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView.h new file mode 100644 index 0000000..4696b14 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTShadowView.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +@class RCTRootShadowView; +@class RCTSparseArray; + +typedef void (^RCTApplierBlock)(NSDictionary *viewRegistry); + +/** + * ShadowView tree mirrors RCT view tree. Every node is highly stateful. + * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. + * 1. RCTBridge may call any of the padding/margin/width/height/top/left setters. A setter would dirty + * the node and all of its ancestors. + * 2. At the end of each Bridge transaction, we call layoutWithMinimumSize:maximumSize:layoutDirection:layoutContext + * at the root node to recursively lay out the entire hierarchy. + * 3. If a node is "computed" and the constraint passed from above is identical to the constraint used to + * perform the last computation, we skip laying out the subtree entirely. + */ +@interface RCTShadowView : NSObject + +/** + * Yoga Config which will be used to create `yogaNode` property. + * Override in subclass to enable special Yoga features. + * Defaults to suitable to current device configuration. + */ ++ (YGConfigRef)yogaConfig; + +/** + * RCTComponent interface. + */ +- (NSArray *)reactSubviews NS_REQUIRES_SUPER; +- (RCTShadowView *)reactSuperview NS_REQUIRES_SUPER; +- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex NS_REQUIRES_SUPER; +- (void)removeReactSubview:(RCTShadowView *)subview NS_REQUIRES_SUPER; + +@property (nonatomic, weak, readonly) RCTRootShadowView *rootView; +@property (nonatomic, weak, readonly) RCTShadowView *superview; +@property (nonatomic, assign, readonly) YGNodeRef yogaNode; +@property (nonatomic, copy) NSString *viewName; +@property (nonatomic, copy) RCTDirectEventBlock onLayout; + +/** + * Computed layout of the view. + */ +@property (nonatomic, assign) RCTLayoutMetrics layoutMetrics; + +/** + * In some cases we need a way to specify some environmental data to shadow view + * to improve layout (or do something similar), so `localData` serves these needs. + * For example, any stateful embedded native views may benefit from this. + * Have in mind that this data is not supposed to interfere with the state of + * the shadow view. + * Please respect one-directional data flow of React. + * Use `-[RCTUIManager setLocalData:forView:]` to set this property + * (to provide local/environmental data for a shadow view) from the main thread. + */ +- (void)setLocalData:(NSObject *)localData; + +/** + * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is + * set to NO in RCTUIManager after the layout pass is done and all frames have been extracted to be applied to the + * corresponding UIViews. + */ +@property (nonatomic, assign, getter=isNewView) BOOL newView; + +/** + * Position and dimensions. + * Defaults to { 0, 0, NAN, NAN }. + */ +@property (nonatomic, assign) YGValue top; +@property (nonatomic, assign) YGValue left; +@property (nonatomic, assign) YGValue bottom; +@property (nonatomic, assign) YGValue right; +@property (nonatomic, assign) YGValue start; +@property (nonatomic, assign) YGValue end; + +@property (nonatomic, assign) YGValue width; +@property (nonatomic, assign) YGValue height; + +@property (nonatomic, assign) YGValue minWidth; +@property (nonatomic, assign) YGValue maxWidth; +@property (nonatomic, assign) YGValue minHeight; +@property (nonatomic, assign) YGValue maxHeight; + +/** + * Convenient alias to `width` and `height` in pixels. + * Defaults to NAN in case of non-pixel dimension. + */ +@property (nonatomic, assign) CGSize size; + +/** + * Border. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) float borderWidth; +@property (nonatomic, assign) float borderTopWidth; +@property (nonatomic, assign) float borderLeftWidth; +@property (nonatomic, assign) float borderBottomWidth; +@property (nonatomic, assign) float borderRightWidth; +@property (nonatomic, assign) float borderStartWidth; +@property (nonatomic, assign) float borderEndWidth; + +/** + * Margin. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) YGValue margin; +@property (nonatomic, assign) YGValue marginVertical; +@property (nonatomic, assign) YGValue marginHorizontal; +@property (nonatomic, assign) YGValue marginTop; +@property (nonatomic, assign) YGValue marginLeft; +@property (nonatomic, assign) YGValue marginBottom; +@property (nonatomic, assign) YGValue marginRight; +@property (nonatomic, assign) YGValue marginStart; +@property (nonatomic, assign) YGValue marginEnd; + +/** + * Padding. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) YGValue padding; +@property (nonatomic, assign) YGValue paddingVertical; +@property (nonatomic, assign) YGValue paddingHorizontal; +@property (nonatomic, assign) YGValue paddingTop; +@property (nonatomic, assign) YGValue paddingLeft; +@property (nonatomic, assign) YGValue paddingBottom; +@property (nonatomic, assign) YGValue paddingRight; +@property (nonatomic, assign) YGValue paddingStart; +@property (nonatomic, assign) YGValue paddingEnd; + +/** + * Flexbox properties. All zero/disabled by default + */ +@property (nonatomic, assign) YGFlexDirection flexDirection; +@property (nonatomic, assign) YGJustify justifyContent; +@property (nonatomic, assign) YGAlign alignSelf; +@property (nonatomic, assign) YGAlign alignItems; +@property (nonatomic, assign) YGAlign alignContent; +@property (nonatomic, assign) YGPositionType position; +@property (nonatomic, assign) YGWrap flexWrap; +@property (nonatomic, assign) YGDisplay display; + +@property (nonatomic, assign) float flex; +@property (nonatomic, assign) float flexGrow; +@property (nonatomic, assign) float flexShrink; +@property (nonatomic, assign) YGValue flexBasis; + +@property (nonatomic, assign) float aspectRatio; + +/** + * Interface direction (LTR or RTL) + */ +@property (nonatomic, assign) YGDirection direction; + +/** + * Clipping properties + */ +@property (nonatomic, assign) YGOverflow overflow; + +/** + * Represents the natural size of the view, which is used when explicit size is not set or is ambiguous. + * Defaults to `{UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric}`. + */ +@property (nonatomic, assign) CGSize intrinsicContentSize; + +#pragma mark - Layout + +/** + * Initiates layout starts from the view. + */ +- (void)layoutWithMinimumSize:(CGSize)minimumSize + maximumSize:(CGSize)maximumSize + layoutDirection:(UIUserInterfaceLayoutDirection)layoutDirection + layoutContext:(RCTLayoutContext)layoutContext; + +/** + * Applies computed layout metrics to the view. + */ +- (void)layoutWithMetrics:(RCTLayoutMetrics)layoutMetrics layoutContext:(RCTLayoutContext)layoutContext; + +/** + * Calculates (if needed) and applies layout to subviews. + */ +- (void)layoutSubviewsWithContext:(RCTLayoutContext)layoutContext; + +/** + * Measures shadow view without side-effects. + * Default implementation uses Yoga for measuring. + */ +- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize; + +/** + * Returns whether or not this view can have any subviews. + * Adding/inserting a child view to leaf view (`canHaveSubviews` equals `NO`) + * will throw an error. + * Return `NO` for components which must not have any descendants + * (like , for example.) + * Defaults to `YES`. Can be overridden in subclasses. + * Don't confuse this with `isYogaLeafNode`. + */ +- (BOOL)canHaveSubviews; + +/** + * Returns whether or not this node acts as a leaf node in the eyes of Yoga. + * For example `RCTTextShadowView` has children which it does not want Yoga + * to lay out so in the eyes of Yoga it is a leaf node. + * Defaults to `NO`. Can be overridden in subclasses. + * Don't confuse this with `canHaveSubviews`. + */ +- (BOOL)isYogaLeafNode; + +/** + * As described in RCTComponent protocol. + */ +- (void)didUpdateReactSubviews NS_REQUIRES_SUPER; +- (void)didSetProps:(NSArray *)changedProps NS_REQUIRES_SUPER; + +/** + * Computes the recursive offset, meaning the sum of all descendant offsets - + * this is the sum of all positions inset from parents. This is not merely the + * sum of `top`/`left`s, as this function uses the *actual* positions of + * children, not the style specified positions - it computes this based on the + * resulting layout. It does not yet compensate for native scroll view insets or + * transforms or anchor points. + */ +- (CGRect)measureLayoutRelativeToAncestor:(RCTShadowView *)ancestor; + +/** + * Checks if the current shadow view is a descendant of the provided `ancestor` + */ +- (BOOL)viewIsDescendantOf:(RCTShadowView *)ancestor; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSinglelineTextInputView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSinglelineTextInputView.h new file mode 100644 index 0000000..d9450db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSinglelineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSinglelineTextInputViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSinglelineTextInputViewManager.h new file mode 100644 index 0000000..314993a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSinglelineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSlider.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSlider.h new file mode 100644 index 0000000..355cc36 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSlider.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSlider : UISlider + +@property (nonatomic, copy) RCTBubblingEventBlock onValueChange; +@property (nonatomic, copy) RCTDirectEventBlock onSlidingComplete; + +@property (nonatomic, assign) float step; +@property (nonatomic, assign) float lastValue; + +@property (nonatomic, strong) UIImage *trackImage; +@property (nonatomic, strong) UIImage *minimumTrackImage; +@property (nonatomic, strong) UIImage *maximumTrackImage; + +@property (nonatomic, strong) UIImage *thumbImage; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSliderManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSliderManager.h new file mode 100644 index 0000000..49de42c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSliderManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTSliderManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSourceCode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSourceCode.h new file mode 100644 index 0000000..fd0e387 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSourceCode.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSourceCode : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSpringAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSpringAnimation.h new file mode 100644 index 0000000..0c031ec --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSpringAnimation.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimationDriver.h" + +@interface RCTSpringAnimation : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTStatusBarManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTStatusBarManager.h new file mode 100644 index 0000000..db02b91 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTStatusBarManager.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTConvert (UIStatusBar) + ++ (UIStatusBarStyle)UIStatusBarStyle:(id)json; ++ (UIStatusBarAnimation)UIStatusBarAnimation:(id)json; + +@end + +@interface RCTStatusBarManager : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTStyleAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTStyleAnimatedNode.h new file mode 100644 index 0000000..cdcaca4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTStyleAnimatedNode.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + +@interface RCTStyleAnimatedNode : RCTAnimatedNode + +- (NSDictionary *)propsDictionary; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSubtractionAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSubtractionAnimatedNode.h new file mode 100644 index 0000000..e8ec799 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSubtractionAnimatedNode.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTSubtractionAnimatedNode : RCTValueAnimatedNode + +@end + diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurface.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurface.h new file mode 100644 index 0000000..b776443 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurface.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTBridge; +@class RCTSurfaceView; +@protocol RCTSurfaceDelegate; + +/** + * RCTSurface instance represents React Native-powered piece of a user interface + * which can be a full-screen app, separate modal view controller, + * or even small widget. + * It is called "Surface". + * + * The RCTSurface instance is completely thread-safe by design; + * it can be created on any thread, and any its method can be called from + * any thread (if the opposite is not mentioned explicitly). + * + * The primary goals of the RCTSurface are: + * * ability to measure and layout the surface in a thread-safe + * and synchronous manner; + * * ability to create a UIView instance on demand (later); + * * ability to communicate the current stage of the surface granularly. + */ +@interface RCTSurface : NSObject + +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties; + +#pragma mark - Layout: Setting the size constrains + +/** + * Previously set `minimumSize` layout constraint. + * Defaults to `{0, 0}`. + */ +@property (atomic, assign, readonly) CGSize minimumSize; + +/** + * Previously set `maximumSize` layout constraint. + * Defaults to `{CGFLOAT_MAX, CGFLOAT_MAX}`. + */ +@property (atomic, assign, readonly) CGSize maximumSize; + +/** + * Simple shortcut to `-[RCTSurface setMinimumSize:size maximumSize:size]`. + */ +- (void)setSize:(CGSize)size; + +#pragma mark - Synchronous waiting + +/** + * Synchronously blocks the current thread up to given `timeout` until + * the Surface reaches `stage`. + * Limitations: + * - Do nothing, if called on `UIManager` queue. + * - Calling on the main queue with `RCTSurfaceStageSurfaceDidInitialMounting` + * stage temporary is not supported; in this case the stage will be + * downgraded to `RCTSurfaceStageSurfaceDidInitialLayout`. + */ +- (BOOL)synchronouslyWaitForStage:(RCTSurfaceStage)stage timeout:(NSTimeInterval)timeout; + +#pragma mark - Mounting/Unmounting of React components + +/** + * Mount the React component specified by the given moduleName. This is typically + * calling runApplication.js from the native side. + */ +- (void)mountReactComponentWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + params:(NSDictionary *)params; + +/** + * Unmount the React component specified by the given rootViewTag, called from native. + */ +- (void)unmountReactComponentWithBridge:(RCTBridge *)bridge rootViewTag:(NSNumber *)rootViewTag; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceDelegate.h new file mode 100644 index 0000000..895c2eb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceDelegate.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurface; + +@protocol RCTSurfaceDelegate + +@optional + +/** + * Notifies a receiver that a surface transitioned to a new stage. + * See `RCTSurfaceStage` for more details. + */ +- (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage; + +/** + * Notifies a receiver that root view got a new (intrinsic) size during the last + * layout pass. + */ +- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceHostingProxyRootView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceHostingProxyRootView.h new file mode 100644 index 0000000..a7077a5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceHostingProxyRootView.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +#import "RCTSurfaceHostingView.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * This is a RCTRootView-compatible implementation of RCTSurfaceHostingView. + * Use this class to replace all usages of RCTRootView in the app for easier migration + * to RCTSurfaceHostingView. + * + * WARNING: In the future, RCTRootView will be deprecated in favor of RCTSurfaceHostingView. + */ +@interface RCTSurfaceHostingProxyRootView : RCTSurfaceHostingView + +#pragma mark RCTRootView compatibility - keep these sync'ed with RCTRootView.h + +@property (nonatomic, copy, readonly) NSString *moduleName; +@property (nonatomic, strong, readonly) RCTBridge *bridge; +@property (nonatomic, readonly) BOOL hasBridge; +@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; +@property (nonatomic, strong, readonly) id eventDispatcher; +@property (nonatomic, copy, readwrite) NSDictionary *appProperties; +@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility; +@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) UIViewController *reactViewController; +@property (nonatomic, strong, readonly) UIView *contentView; +@property (nonatomic, strong) UIView *loadingView; +@property (nonatomic, assign) BOOL passThroughTouches; +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay; +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration; +@property (nonatomic, assign) CGSize minimumSize; + +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithBundleURL:(NSURL *)bundleURL + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties + launchOptions:(NSDictionary *)launchOptions; + +/** + * Bridgeless mode initializer + */ +- (instancetype)initWithSurface:(id)surface + sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode + moduleRegistry:(RCTModuleRegistry *)moduleRegistry; + +- (void)cancelTouches; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceHostingView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceHostingView.h new file mode 100644 index 0000000..0fbbdab --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceHostingView.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +@class RCTBridge; +@class RCTSurface; + +typedef UIView *_Nullable (^RCTSurfaceHostingViewActivityIndicatorViewFactory)(void); + +NS_ASSUME_NONNULL_BEGIN + +/** + * UIView subclass which providers interoperability between UIKit and + * Surface regarding layout and life-cycle. + * This class can be used as easy-to-use general purpose integration point + * of ReactNative-powered experiences in UIKit based apps. + */ +@interface RCTSurfaceHostingView : UIView + +/** + * Create an instance of RCTSurface to be hosted. + */ ++ (RCTSurface *)createSurfaceWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties; + +/** + * Designated initializer. + * Instanciates a view with given Surface object. + * Note: The view retains the surface object. + */ +- (instancetype)initWithSurface:(id)surface + sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode NS_DESIGNATED_INITIALIZER; + +/** + * Convenience initializer. + * Instanciates a Surface object with given `bridge`, `moduleName`, and + * `initialProperties`, and then use it to instanciate a view. + */ +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties + sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode; + +/** + * Surface object which is currently using to power the view. + * Read-only. + */ +@property (nonatomic, strong, readonly) id surface; + +/** + * Size measure mode which are defining relationship between UIKit and ReactNative + * layout approaches. + * Defaults to `RCTSurfaceSizeMeasureModeWidthAtMost | RCTSurfaceSizeMeasureModeHeightAtMost`. + */ +@property (nonatomic, assign) RCTSurfaceSizeMeasureMode sizeMeasureMode; + +/** + * Activity indicator factory. + * A hosting view may use this block to instantiate and display custom activity + * (loading) indicator (aka "spinner") when it needed. + * Defaults to `nil` (no activity indicator). + */ +@property (nonatomic, copy, nullable) RCTSurfaceHostingViewActivityIndicatorViewFactory activityIndicatorViewFactory; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfacePresenterStub.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfacePresenterStub.h new file mode 100644 index 0000000..32a2b80 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfacePresenterStub.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +// TODO: Eventually this should go away and files should just include RCTSurfacePresenter.h, but +// that pulls in all of fabric which doesn't compile in open source yet, so we mirror the protocol +// and duplicate the category here for now. + +@protocol RCTSurfacePresenterObserver + +@optional + +- (void)willMountComponentsWithRootTag:(NSInteger)rootTag; +- (void)didMountComponentsWithRootTag:(NSInteger)rootTag; + +@end + +@protocol RCTSurfacePresenterStub + +- (nullable UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag; +- (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; +- (void)addObserver:(id)observer; +- (void)removeObserver:(id)observer; + +@end + +@interface RCTBridge (RCTSurfacePresenterStub) + +- (id)surfacePresenter; +- (void)setSurfacePresenter:(id)presenter; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceProtocol.h new file mode 100644 index 0000000..c274df7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceProtocol.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurfaceView; +@protocol RCTSurfaceDelegate; + +@protocol RCTSurfaceProtocol + +@property (atomic, readonly) RCTSurfaceStage stage; +@property (atomic, readonly) NSString *moduleName; +@property (atomic, readwrite, weak, nullable) id delegate; + +/** + * Deprecated. Use `rootTag` instead. + */ +@property (atomic, readonly) NSNumber *rootViewTag; +@property (atomic, copy, readwrite) NSDictionary *properties; +@property (atomic, readonly) NSInteger rootTag; + +/** + * Sets `minimumSize` and `maximumSize` layout constraints for the Surface. + */ +- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize; + +/** + * Sets `minimumSize`, `maximumSize`, and `viewportOffset` layout constraints for the Surface. + * `viewportOffset` is ignored in `RCTSurface` but used in `RCTFabricSurface`. + */ +- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize viewportOffset:(CGPoint)viewportOffset; + +#pragma mark - Dealing with UIView representation, the Main thread only access + +/** + * Creates (if needed) and returns `UIView` instance which represents the Surface. + * The Surface will cache and *retain* this object. + * Returning the UIView instance does not mean that the Surface is ready + * to execute and layout. It can be just a handler which Surface will use later + * to mount the actual views. + * RCTSurface does not control (or influence in any way) the size or origin + * of this view. Some superview (or another owner) must use other methods + * of this class to setup proper layout and interop interactions with UIKit + * or another UI framework. + * This method must be called only from the main queue. + */ +- (RCTSurfaceView *)view; + +#pragma mark - Layout: Measuring + +/** + * Measures the Surface with given constraints. + * This method does not cause any side effects on the surface object. + */ +- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize; + +/** + * Return the current size of the root view based on (but not clamp by) current + * size constraints. + */ +@property (atomic, assign, readonly) CGSize intrinsicSize; + +#pragma mark - Start & Stop + +/** + * Starts or stops the Surface. + * Those methods are a no-op for regular RCTSurface (for now), but all call sites must call them appropriately. + */ +- (BOOL)start; +- (BOOL)stop; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootShadowView.h new file mode 100644 index 0000000..cab8b4a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootShadowView.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTSurfaceRootShadowView : RCTShadowView + +@property (nonatomic, assign, readonly) CGSize minimumSize; +@property (nonatomic, assign, readonly) CGSize maximumSize; + +- (void)setMinimumSize:(CGSize)size maximumSize:(CGSize)maximumSize; + +@property (nonatomic, assign, readonly) CGSize intrinsicSize; + +@property (nonatomic, weak) id delegate; + +/** + * Layout direction (LTR or RTL) inherited from native environment and + * is using as a base direction value in layout engine. + * Defaults to value inferred from current locale. + */ +@property (nonatomic, assign) YGDirection baseDirection; + +- (void)layoutWithAffectedShadowViews:(NSHashTable *)affectedShadowViews; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootShadowViewDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootShadowViewDelegate.h new file mode 100644 index 0000000..6ad7337 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootShadowViewDelegate.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurfaceRootShadowView; + +@protocol RCTSurfaceRootShadowViewDelegate + +- (void)rootShadowView:(RCTSurfaceRootShadowView *)rootShadowView didChangeIntrinsicSize:(CGSize)instrinsicSize; +- (void)rootShadowViewDidStartRendering:(RCTSurfaceRootShadowView *)rootShadowView; +- (void)rootShadowViewDidStartLayingOut:(RCTSurfaceRootShadowView *)rootShadowView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootView.h new file mode 100644 index 0000000..052476a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceRootView.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Internal class represents Surface's root view. + */ +@interface RCTSurfaceRootView : RCTView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceSizeMeasureMode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceSizeMeasureMode.h new file mode 100644 index 0000000..0ca27cd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceSizeMeasureMode.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * Bitmask defines how size constrains from `-[UIView sizeThatFits:]` + * are translated to `-[RCTSurface sizeThatFitsMinimumSize:maximumSize:]`. + */ +typedef NS_OPTIONS(NSInteger, RCTSurfaceSizeMeasureMode) { + RCTSurfaceSizeMeasureModeWidthUndefined = 0 << 0, + RCTSurfaceSizeMeasureModeWidthExact = 1 << 0, + RCTSurfaceSizeMeasureModeWidthAtMost = 2 << 0, + RCTSurfaceSizeMeasureModeHeightUndefined = 0 << 2, + RCTSurfaceSizeMeasureModeHeightExact = 1 << 2, + RCTSurfaceSizeMeasureModeHeightAtMost = 2 << 2, +}; + +/** + * Returns size constraints based on `size` and `sizeMeasureMode`. + */ +RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode( + CGSize size, + RCTSurfaceSizeMeasureMode sizeMeasureMode, + CGSize *minimumSize, + CGSize *maximumSize); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceStage.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceStage.h new file mode 100644 index 0000000..87bf915 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceStage.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * The stage of the Surface + */ +typedef NS_OPTIONS(NSInteger, RCTSurfaceStage) { + RCTSurfaceStageSurfaceDidInitialize = 1 << 0, // Surface object was created + RCTSurfaceStageBridgeDidLoad = 1 << 1, // Bridge was loaded + RCTSurfaceStageModuleDidLoad = 1 << 2, // Module (JavaScript code) was loaded + RCTSurfaceStageSurfaceDidRun = 1 << 3, // Module (JavaScript code) was run + RCTSurfaceStageSurfaceDidInitialRendering = 1 << 4, // UIManager created the first shadow views + RCTSurfaceStageSurfaceDidInitialLayout = 1 << 5, // UIManager completed the first layout pass + RCTSurfaceStageSurfaceDidInitialMounting = 1 << 6, // UIManager completed the first mounting pass + RCTSurfaceStageSurfaceDidStop = 1 << 7, // Surface stopped + + // Most of the previously existed stages make no sense in the new architecture; + // now Surface exposes only two simple stages: + RCTSurfaceStagePreparing = RCTSurfaceStageSurfaceDidInitialize | RCTSurfaceStageBridgeDidLoad | + RCTSurfaceStageModuleDidLoad, + RCTSurfaceStageRunning = RCTSurfaceStagePreparing | RCTSurfaceStageSurfaceDidRun | + RCTSurfaceStageSurfaceDidInitialRendering | RCTSurfaceStageSurfaceDidInitialLayout | + RCTSurfaceStageSurfaceDidInitialMounting, +}; + +/** + * Returns `YES` if the stage is suitable for displaying normal React Native app. + */ +RCT_EXTERN BOOL RCTSurfaceStageIsRunning(RCTSurfaceStage stage); + +/** + * Returns `YES` if the stage is suitable for displaying activity indicator. + */ +RCT_EXTERN BOOL RCTSurfaceStageIsPreparing(RCTSurfaceStage stage); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceView+Internal.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceView+Internal.h new file mode 100644 index 0000000..ac4f59f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceView+Internal.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@class RCTSurfaceRootView; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSurfaceView (Internal) + +@property (nonatomic, nullable, strong) RCTSurfaceRootView *rootView; +@property (nonatomic, assign) RCTSurfaceStage stage; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceView.h new file mode 100644 index 0000000..a61e28c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSurfaceView.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurface; + +/** + * UIView instance which represents the Surface + */ +@interface RCTSurfaceView : UIView + +- (instancetype)initWithSurface:(RCTSurface *)surface NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, weak, readonly, nullable) RCTSurface *surface; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSwitch.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSwitch.h new file mode 100644 index 0000000..3b42a50 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSwitch.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSwitch : UISwitch + +@property (nonatomic, assign) BOOL wasOn; +@property (nonatomic, copy) RCTBubblingEventBlock onChange; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSwitchManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSwitchManager.h new file mode 100644 index 0000000..06015b1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTSwitchManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTSwitchManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextAttributes.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextAttributes.h new file mode 100644 index 0000000..ce04362 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextAttributes.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTTextAttributesIsHighlightedAttributeName; +extern NSString *const RCTTextAttributesTagAttributeName; + +/** + * Represents knowledge about all supported *text* attributes + * assigned to some text component such as , , + * and . + */ +@interface RCTTextAttributes : NSObject + +// Color +@property (nonatomic, strong, nullable) UIColor *foregroundColor; +@property (nonatomic, strong, nullable) UIColor *backgroundColor; +@property (nonatomic, assign) CGFloat opacity; +// Font +@property (nonatomic, copy, nullable) NSString *fontFamily; +@property (nonatomic, assign) CGFloat fontSize; +@property (nonatomic, assign) CGFloat fontSizeMultiplier; +@property (nonatomic, assign) CGFloat maxFontSizeMultiplier; +@property (nonatomic, copy, nullable) NSString *fontWeight; +@property (nonatomic, copy, nullable) NSString *fontStyle; +@property (nonatomic, copy, nullable) NSArray *fontVariant; +@property (nonatomic, assign) BOOL allowFontScaling; +@property (nonatomic, assign) CGFloat letterSpacing; +// Paragraph Styles +@property (nonatomic, assign) CGFloat lineHeight; +@property (nonatomic, assign) NSTextAlignment alignment; +@property (nonatomic, assign) NSWritingDirection baseWritingDirection; +// Decoration +@property (nonatomic, strong, nullable) UIColor *textDecorationColor; +@property (nonatomic, assign) NSUnderlineStyle textDecorationStyle; +@property (nonatomic, assign) RCTTextDecorationLineType textDecorationLine; +// Shadow +@property (nonatomic, assign) CGSize textShadowOffset; +@property (nonatomic, assign) CGFloat textShadowRadius; +@property (nonatomic, strong, nullable) UIColor *textShadowColor; +// Special +@property (nonatomic, assign) BOOL isHighlighted; +@property (nonatomic, strong, nullable) NSNumber *tag; +@property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection; +@property (nonatomic, assign) RCTTextTransform textTransform; + +#pragma mark - Inheritance + +- (void)applyTextAttributes:(RCTTextAttributes *)textAttributes; + +#pragma mark - Adapters + +/** + * Text attributes in NSAttributedString terms. + */ +- (NSDictionary *)effectiveTextAttributes; + +/** + * Constructed paragraph style. + */ +- (NSParagraphStyle *_Nullable)effectiveParagraphStyle; + +/** + * Constructed font. + */ +- (UIFont *)effectiveFont; + +/** + * Font size multiplier reflects `allowFontScaling`, `fontSizeMultiplier`, and `maxFontSizeMultiplier`. + */ +- (CGFloat)effectiveFontSizeMultiplier; + +/** + * Foreground and background colors with opacity and right defaults. + */ +- (UIColor *)effectiveForegroundColor; +- (UIColor *)effectiveBackgroundColor; + +/** + * Text transformed per 'none', 'uppercase', 'lowercase', 'capitalize' + */ +- (NSString *)applyTextAttributesToText:(NSString *)text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextDecorationLineType.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextDecorationLineType.h new file mode 100644 index 0000000..ddf9195 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextDecorationLineType.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTTextDecorationLineType) { + RCTTextDecorationLineTypeNone = 0, + RCTTextDecorationLineTypeUnderline, + RCTTextDecorationLineTypeStrikethrough, + RCTTextDecorationLineTypeUnderlineStrikethrough, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextSelection.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextSelection.h new file mode 100644 index 0000000..0bb7583 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextSelection.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * Object containing information about a TextInput's selection. + */ +@interface RCTTextSelection : NSObject + +@property (nonatomic, assign, readonly) NSInteger start; +@property (nonatomic, assign, readonly) NSInteger end; + +- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end; + +@end + +@interface RCTConvert (RCTTextSelection) + ++ (RCTTextSelection *)RCTTextSelection:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextShadowView.h new file mode 100644 index 0000000..d364db5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextShadowView.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, assign) NSLineBreakMode lineBreakMode; +@property (nonatomic, assign) BOOL adjustsFontSizeToFit; +@property (nonatomic, assign) CGFloat minimumFontScale; +@property (nonatomic, copy) RCTDirectEventBlock onTextLayout; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextTransform.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextTransform.h new file mode 100644 index 0000000..15d328c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextTransform.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTTextTransform) { + RCTTextTransformUndefined = 0, + RCTTextTransformNone, + RCTTextTransformCapitalize, + RCTTextTransformUppercase, + RCTTextTransformLowercase, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextView.h new file mode 100644 index 0000000..5928b70 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextView.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextView : UIView + +@property (nonatomic, assign) BOOL selectable; + +- (void)setTextStorage:(NSTextStorage *)textStorage + contentFrame:(CGRect)contentFrame + descendantViews:(NSArray *)descendantViews; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextViewManager.h new file mode 100644 index 0000000..446a5db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTextViewManager.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextViewManager.h" + +@interface RCTTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTiming.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTiming.h new file mode 100644 index 0000000..7c197aa --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTiming.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +@protocol RCTTimingDelegate + +- (void)callTimers:(NSArray *)timers; +- (void)immediatelyCallTimer:(nonnull NSNumber *)callbackID; +- (void)callIdleCallbacks:(nonnull NSNumber *)absoluteFrameStartMS; + +@end + +@interface RCTTiming : NSObject + +- (instancetype)initWithDelegate:(id)delegate; +- (void)createTimerForNextFrame:(nonnull NSNumber *)callbackID + duration:(NSTimeInterval)jsDuration + jsSchedulingTime:(NSDate *)jsSchedulingTime + repeats:(BOOL)repeats; +- (void)deleteTimer:(double)timerID; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTouchEvent.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTouchEvent.h new file mode 100644 index 0000000..9f3cc4f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTouchEvent.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * Represents a touch event, which may be composed of several touches (one for every finger). + * For more information on contents of passed data structures see RCTTouchHandler. + */ +@interface RCTTouchEvent : NSObject + +- (instancetype)initWithEventName:(NSString *)eventName + reactTag:(NSNumber *)reactTag + reactTouches:(NSArray *)reactTouches + changedIndexes:(NSArray *)changedIndexes + coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTouchHandler.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTouchHandler.h new file mode 100644 index 0000000..8481a27 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTouchHandler.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@class RCTBridge; + +@interface RCTTouchHandler : UIGestureRecognizer + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +- (void)attachToView:(UIView *)view; +- (void)detachFromView:(UIView *)view; + +- (void)cancel; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTrackingAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTrackingAnimatedNode.h new file mode 100644 index 0000000..27d61fa --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTrackingAnimatedNode.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + + +@interface RCTTrackingAnimatedNode : RCTAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTransformAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTransformAnimatedNode.h new file mode 100644 index 0000000..fe16bd2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTTransformAnimatedNode.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + +@interface RCTTransformAnimatedNode : RCTAnimatedNode + +- (NSDictionary *)propsDictionary; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIImageViewAnimated.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIImageViewAnimated.h new file mode 100644 index 0000000..9af8d4e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIImageViewAnimated.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTUIImageViewAnimated : UIImageView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManager.h new file mode 100644 index 0000000..65309cc --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManager.h @@ -0,0 +1,174 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import + +/** + * Posted right before re-render happens. This is a chance for views to invalidate their state so + * next render cycle will pick up updated views and layout appropriately. + */ +RCT_EXTERN NSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification; + +@class RCTLayoutAnimationGroup; +@class RCTUIManagerObserverCoordinator; + +/** + * The RCTUIManager is the module responsible for updating the view hierarchy. + */ +@interface RCTUIManager : NSObject + +/** + * Register a root view tag and creates corresponding `rootView` and + * `rootShadowView`. + */ +- (void)registerRootViewTag:(NSNumber *)rootTag; + +/** + * Register a root view with the RCTUIManager. + */ +- (void)registerRootView:(UIView *)rootView; + +/** + * Gets the view name associated with a reactTag. + */ +- (NSString *)viewNameForReactTag:(NSNumber *)reactTag; + +/** + * Gets the view associated with a reactTag. + */ +- (UIView *)viewForReactTag:(NSNumber *)reactTag; + +/** + * Gets the shadow view associated with a reactTag. + */ +- (RCTShadowView *)shadowViewForReactTag:(NSNumber *)reactTag; + +/** + * Set the available size (`availableSize` property) for a root view. + * This might be used in response to changes in external layout constraints. + * This value will be directly trasmitted to layout engine and defines how big viewport is; + * this value does not affect root node size style properties. + * Can be considered as something similar to `setSize:forView:` but applicable only for root view. + */ +- (void)setAvailableSize:(CGSize)availableSize forRootView:(UIView *)rootView; + +/** + * Sets local data for a shadow view corresponded with given view. + * In some cases we need a way to specify some environmental data to shadow view + * to improve layout (or do something similar), so `localData` serves these needs. + * For example, any stateful embedded native views may benefit from this. + * Have in mind that this data is not supposed to interfere with the state of + * the shadow view. + * Please respect one-directional data flow of React. + */ +- (void)setLocalData:(NSObject *)localData forView:(UIView *)view; + +/** + * Set the size of a view. This might be in response to a screen rotation + * or some other layout event outside of the React-managed view hierarchy. + */ +- (void)setSize:(CGSize)size forView:(UIView *)view; + +/** + * Set the natural size of a view, which is used when no explicit size is set. + * Use `UIViewNoIntrinsicMetric` to ignore a dimension. + * The `size` must NOT include padding and border. + */ +- (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize forView:(UIView *)view; + +/** + * Sets up layout animation which will perform on next layout pass. + * The animation will affect only one next layout pass. + * Must be called on the main queue. + */ +- (void)setNextLayoutAnimationGroup:(RCTLayoutAnimationGroup *)layoutAnimationGroup; + +/** + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic after all currently queued view updates have completed. + */ +- (void)addUIBlock:(RCTViewManagerUIBlock)block; + +/** + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic before all currently queued view updates have completed. + */ +- (void)prependUIBlock:(RCTViewManagerUIBlock)block; + +/** + * Used by native animated module to bypass the process of updating the values through the shadow + * view hierarchy. This method will directly update native views, which means that updates for + * layout-related propertied won't be handled properly. + * Make sure you know what you're doing before calling this method :) + */ +- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag + viewName:(NSString *)viewName + props:(NSDictionary *)props; + +/** + * Given a reactTag from a component, find its root view, if possible. + * Otherwise, this will give back nil. + * + * @param reactTag the component tag + * @param completion the completion block that will hand over the rootView, if any. + * + */ +- (void)rootViewForReactTag:(NSNumber *)reactTag withCompletion:(void (^)(UIView *view))completion; + +/** + * Finds a view that is tagged with nativeID as its nativeID prop + * with the associated rootTag root tag view hierarchy. Returns the + * view if found, nil otherwise. + * + * @param nativeID the id reference to native component relative to root view. + * @param rootTag the react tag of root view hierarchy from which to find the view. + */ +- (UIView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag; + +/** + * Register a view that is tagged with nativeID as its nativeID prop + * + * @param nativeID the id reference to native component relative to root view. + * @param view the view that is tagged with nativeID as its nativeID prop. + */ +- (void)setNativeID:(NSString *)nativeID forView:(UIView *)view; + +/** + * The view that is currently first responder, according to the JS context. + */ ++ (UIView *)JSResponder; + +/** + * In some cases we might want to trigger layout from native side. + * React won't be aware of this, so we need to make sure it happens. + */ +- (void)setNeedsLayout; + +/** + * Dedicated object for subscribing for UIManager events. + * See `RCTUIManagerObserver` protocol for more details. + */ +@property (atomic, retain, readonly) RCTUIManagerObserverCoordinator *observerCoordinator; + +@end + +/** + * This category makes the current RCTUIManager instance available via the + * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that + * need to access the RCTUIManager. + */ +@interface RCTBridge (RCTUIManager) + +@property (nonatomic, readonly) RCTUIManager *uiManager; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManagerObserverCoordinator.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManagerObserverCoordinator.h new file mode 100644 index 0000000..f351159 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManagerObserverCoordinator.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +typedef dispatch_block_t RCTUIManagerMountingBlock; + +/** + * Allows hooking into UIManager internals. This can be used to execute code at + * specific points during the view updating process. + * New observers must not be added inside observer handlers. + * The particular order of handler invocation is not guaranteed. + * All observer handlers are called on UIManager queue. + */ +@protocol RCTUIManagerObserver + +@optional + +/** + * Called just before the UIManager layout views. + * It allows performing some operation for components which contain custom + * layout logic right before regular Yoga based layout. So, for instance, + * some components which have own React-independent state can compute and cache + * own intrinsic content size (which will be used by Yoga) at this point. + */ +- (void)uiManagerWillPerformLayout:(RCTUIManager *)manager; + +/** + * Called just after the UIManager layout views. + * It allows performing custom layout logic right after regular Yoga based layout. + * So, for instance, this can be used for computing final layout for a component, + * since it has its final frame set by Yoga at this point. + */ +- (void)uiManagerDidPerformLayout:(RCTUIManager *)manager; + +/** + * Called before flushing UI blocks at the end of a batch. + * This is called from the UIManager queue. Can be used to add UI operations in that batch. + */ +- (void)uiManagerWillPerformMounting:(RCTUIManager *)manager; + +/** + * Called right before flushing UI blocks and allows to intercept the mounting process. + * Return `YES` to cancel default execution of the `block` (and perform the + * execution later). + */ +- (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block; + +/** + * Called just after flushing UI blocks. + * This is called from the UIManager queue. + */ +- (void)uiManagerDidPerformMounting:(RCTUIManager *)manager; + +@end + +/** + * Simple helper which take care of RCTUIManager's observers. + */ +@interface RCTUIManagerObserverCoordinator : NSObject + +/** + * Add a UIManagerObserver. See the `RCTUIManagerObserver` protocol for more info. + * References to observers are held weakly. + * This method can be called safely from any queue. + */ +- (void)addObserver:(id)observer; + +/** + * Remove a `UIManagerObserver`. + * This method can be called safely from any queue. + */ +- (void)removeObserver:(id)observer; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManagerUtils.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManagerUtils.h new file mode 100644 index 0000000..2bf9f57 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIManagerUtils.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +/** + * Queues Problem Intro: + * UIManager queue is a special queue because it has a special relationship with + * the Main queue. + * + * This particular relationship comes from two key factors: + * 1. UIManager initiates execution of many blocks on the Main queue; + * 2. In some cases, we want to initiate (and wait for) some UIManager's work *synchronously* from + * the Main queue. + * + * So, how can we meet these criteria? + * "Pseudo UIManager queue" comes to rescue! + * + * "Pseudo UIManager queue" means the safe execution of typical UIManager's work + * on the Main queue while the UIManager queue is explicitly blocked for preventing + * simultaneous/concurrent memory access. + * + * So, how can we technically do this? + * 1. `RCTAssertUIManagerQueue` is okay with execution on both actual UIManager and + * Pseudo UIManager queues. + * 2. Both `RCTExecuteOnUIManagerQueue` and `RCTUnsafeExecuteOnUIManagerQueueSync` + * execute given block *synchronously* if they were called on actual UIManager + * or Pseudo UIManager queues. + * 3. `RCTExecuteOnMainQueue` executes given block *synchronously* if we already on + * the Main queue. + * 4. `RCTUnsafeExecuteOnUIManagerQueueSync` is smart enough to do the trick: + * It detects calling on the Main queue and in this case, instead of doing + * trivial *synchronous* dispatch, it does: + * - Block the Main queue; + * - Dispatch the special block on UIManager queue to block the queue and + * concurrent memory access; + * - Execute the given block on the Main queue; + * - Unblock the UIManager queue. + * + * Imagine the analogy: We have two queues: the Main one and UIManager one. + * And these queues are two lanes of railway that go in parallel. Then, + * at some point, we merge UIManager lane with the Main lane, and all cars use + * the unified the Main lane. + * And then we split lanes again. + * + * This solution assumes that the code running on UIManager queue will never + * *explicitly* block the Main queue via calling `RCTUnsafeExecuteOnMainQueueSync`. + * Otherwise, it can cause a deadlock. + */ + +/** + * Returns UIManager queue. + */ +RCT_EXTERN dispatch_queue_t RCTGetUIManagerQueue(void); + +/** + * Default name for the UIManager queue. + */ +RCT_EXTERN char *const RCTUIManagerQueueName; + +/** + * Check if we are currently on UIManager queue. + * Please do not use this unless you really know what you're doing. + */ +RCT_EXTERN BOOL RCTIsUIManagerQueue(void); + +/** + * Check if we are currently on Pseudo UIManager queue. + * Please do not use this unless you really know what you're doing. + */ +RCT_EXTERN BOOL RCTIsPseudoUIManagerQueue(void); + +/** + * *Asynchronously* executes the specified block on the UIManager queue. + * Unlike `dispatch_async()` this will execute the block immediately + * if we're already on the UIManager queue. + */ +RCT_EXTERN void RCTExecuteOnUIManagerQueue(dispatch_block_t block); + +/** + * *Synchronously* executes the specified block on the UIManager queue. + * Unlike `dispatch_sync()` this will execute the block immediately + * if we're already on the UIManager queue. + * Please do not use this unless you really know what you're doing. + */ +RCT_EXTERN void RCTUnsafeExecuteOnUIManagerQueueSync(dispatch_block_t block); + +/** + * Convenience macro for asserting that we're running on UIManager queue. + */ +#define RCTAssertUIManagerQueue() \ + RCTAssert( \ + RCTIsUIManagerQueue() || RCTIsPseudoUIManagerQueue(), @"This function must be called on the UIManager queue") + +/** + * Returns new unique root view tag. + */ +RCT_EXTERN NSNumber *RCTAllocateRootViewTag(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUITextField.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUITextField.h new file mode 100644 index 0000000..f3b3492 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUITextField.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextField... but much better! + */ +@interface RCTUITextField : UITextField + +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUITextView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUITextView.h new file mode 100644 index 0000000..5cb03ee --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUITextView.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextView... but much better! + */ +@interface RCTUITextView : UITextView + +- (instancetype)initWithFrame:(CGRect)frame textContainer:(nullable NSTextContainer *)textContainer NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; + +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +// The `clearButtonMode` property actually is not supported yet; +// it's declared here only to conform to the interface. +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; + +@property (nonatomic, assign) BOOL caretHidden; + +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIUtils.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIUtils.h new file mode 100644 index 0000000..14fadee --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUIUtils.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus +extern "C" { +#endif + +// Get window and screen dimensions +typedef struct { + struct { + CGFloat width, height, scale, fontScale; + } window, screen; +} RCTDimensions; +extern __attribute__((visibility("default"))) RCTDimensions RCTGetDimensions(CGFloat fontScale); + +// Get font size multiplier for font base size (Large) by content size category +extern __attribute__((visibility("default"))) CGFloat RCTGetMultiplierForContentSizeCategory( + UIContentSizeCategory category); + +#ifdef __cplusplus +} +#endif + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTURLRequestDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTURLRequestDelegate.h new file mode 100644 index 0000000..8a9e03f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTURLRequestDelegate.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * An abstract interface used by request handler modules to send + * data back over the bridge back to JS. + */ +@protocol RCTURLRequestDelegate + +/** + * Call this when you send request data to the server. This is used to track + * upload progress, so should be called multiple times for large request bodies. + */ +- (void)URLRequest:(id)requestToken didSendDataWithProgress:(int64_t)bytesSent; + +/** + * Call this when you first receives a response from the server. This should + * include response headers, etc. + */ +- (void)URLRequest:(id)requestToken didReceiveResponse:(NSURLResponse *)response; + +/** + * Call this when you receive data from the server. This can be called multiple + * times with partial data chunks, or just once with the full data packet. + */ +- (void)URLRequest:(id)requestToken didReceiveData:(NSData *)data; + +/** + * Call this when the request is complete and/or if an error is encountered. + * For a successful request, the error parameter should be nil. + */ +- (void)URLRequest:(id)requestToken didCompleteWithError:(NSError *)error; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTURLRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTURLRequestHandler.h new file mode 100644 index 0000000..89f48f5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTURLRequestHandler.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * Provides the interface needed to register a request handler. Request handlers + * are also bridge modules, so should be registered using RCT_EXPORT_MODULE(). + */ +@protocol RCTURLRequestHandler + +/** + * Indicates whether this handler is capable of processing the specified + * request. Typically the handler would examine the scheme/protocol of the + * request URL (and possibly the HTTP method and/or headers) to determine this. + */ +- (BOOL)canHandleRequest:(NSURLRequest *)request; + +/** + * Send a network request and call the delegate with the response data. The + * method should return a token, which can be anything, including the request + * itself. This will be used later to refer to the request in callbacks. The + * `sendRequest:withDelegate:` method *must* return before calling any of the + * delegate methods, or the delegate won't recognize the token. + * Following common Objective-C pattern, `delegate` will not be retained. + */ +- (id)sendRequest:(NSURLRequest *)request withDelegate:(id)delegate; + +@optional + +/** + * Not all request types can be cancelled, but this method can be implemented + * for ones that can. It should be used to free up any resources on ongoing + * processes associated with the request. + */ +- (void)cancelRequest:(id)requestToken; + +/** + * If more than one RCTURLRequestHandler responds YES to `canHandleRequest:` + * then `handlerPriority` is used to determine which one to use. The handler + * with the highest priority will be selected. Default priority is zero. If + * two or more valid handlers have the same priority, the selection order is + * undefined. + */ +- (float)handlerPriority; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUtils.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUtils.h new file mode 100644 index 0000000..ecb7915 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUtils.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +// JSON serialization/deserialization +RCT_EXTERN NSString *__nullable RCTJSONStringify(id __nullable jsonObject, NSError **error); +RCT_EXTERN id __nullable RCTJSONParse(NSString *__nullable jsonString, NSError **error); +RCT_EXTERN id __nullable RCTJSONParseMutable(NSString *__nullable jsonString, NSError **error); + +// Sanitize a JSON object by stripping invalid types and/or NaN values +RCT_EXTERN id RCTJSONClean(id object); + +// Get MD5 hash of a string +RCT_EXTERN NSString *RCTMD5Hash(NSString *string); + +// Check if we are currently on the main queue (not to be confused with +// the main thread, which is not necessarily the same thing) +// https://twitter.com/olebegemann/status/738656134731599872 +RCT_EXTERN BOOL RCTIsMainQueue(void); + +// Execute the specified block on the main queue. Unlike dispatch_async() +// this will execute immediately if we're already on the main queue. +RCT_EXTERN void RCTExecuteOnMainQueue(dispatch_block_t block); + +// Legacy function to execute the specified block on the main queue synchronously. +// Please do not use this unless you know what you're doing. +RCT_EXTERN void RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block); + +// Get screen scale, can be only used on main +RCT_EXTERN void RCTComputeScreenScale(void); + +// Get screen metrics in a thread-safe way +RCT_EXTERN CGFloat RCTScreenScale(void); +RCT_EXTERN CGFloat RCTFontSizeMultiplier(void); +RCT_EXTERN CGSize RCTScreenSize(void); +RCT_EXTERN CGSize RCTViewportSize(void); + +// Round float coordinates to nearest whole screen pixel (not point) +RCT_EXTERN CGFloat RCTRoundPixelValue(CGFloat value); +RCT_EXTERN CGFloat RCTCeilPixelValue(CGFloat value); +RCT_EXTERN CGFloat RCTFloorPixelValue(CGFloat value); + +// Convert a size in points to pixels, rounded up to the nearest integral size +RCT_EXTERN CGSize RCTSizeInPixels(CGSize pointSize, CGFloat scale); + +// Method swizzling +RCT_EXTERN void RCTSwapClassMethods(Class cls, SEL original, SEL replacement); +RCT_EXTERN void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); +RCT_EXTERN void RCTSwapInstanceMethodWithBlock(Class cls, SEL original, id replacementBlock, SEL replacementSelector); + +// Module subclass support +RCT_EXTERN BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); +RCT_EXTERN BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); + +// Creates a standardized error object to return in callbacks +RCT_EXTERN NSDictionary + *RCTMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); +RCT_EXTERN NSDictionary * +RCTMakeAndLogError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); +RCT_EXTERN NSDictionary *RCTJSErrorFromNSError(NSError *error); +RCT_EXTERN NSDictionary + *RCTJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error); + +// The default error code to use as the `code` property for callback error objects +RCT_EXTERN NSString *const RCTErrorUnspecified; + +// Returns YES if React is running in a test environment +RCT_EXTERN BOOL RCTRunningInTestEnvironment(void); + +// Returns YES if React is running in an iOS App Extension +RCT_EXTERN BOOL RCTRunningInAppExtension(void); + +// Returns the shared UIApplication instance, or nil if running in an App Extension +RCT_EXTERN UIApplication *__nullable RCTSharedApplication(void); + +// Returns the current main window, useful if you need to access the root view +// or view controller +RCT_EXTERN UIWindow *__nullable RCTKeyWindow(void); + +// Returns the presented view controller, useful if you need +// e.g. to present a modal view controller or alert over it +RCT_EXTERN UIViewController *__nullable RCTPresentedViewController(void); + +// Does this device support force touch (aka 3D Touch)? +RCT_EXTERN BOOL RCTForceTouchAvailable(void); + +// Create an NSError in the RCTErrorDomain +RCT_EXTERN NSError *RCTErrorWithMessage(NSString *message); + +// Creates an NSError from given an NSException +RCT_EXTERN NSError *RCTErrorWithNSException(NSException *exception); + +// Convert nil values to NSNull, and vice-versa +#define RCTNullIfNil(value) ((value) ?: (id)kCFNull) +#define RCTNilIfNull(value) \ + ({ \ + __typeof__(value) t = (value); \ + (id) t == (id)kCFNull ? (__typeof(value))nil : t; \ + }) + +// Convert NaN or infinite values to zero, as these aren't JSON-safe +RCT_EXTERN double RCTZeroIfNaN(double value); + +// Returns `0` and log special warning if value is NaN or INF. +RCT_EXTERN double RCTSanitizeNaNValue(double value, NSString *property); + +// Convert data to a Base64-encoded data URL +RCT_EXTERN NSURL *RCTDataURL(NSString *mimeType, NSData *data); + +// Gzip functionality - compression level in range 0 - 1 (-1 for default) +RCT_EXTERN NSData *__nullable RCTGzipData(NSData *__nullable data, float level); + +// Returns the relative path within the main bundle for an absolute URL +// (or nil, if the URL does not specify a path within the main bundle) +RCT_EXTERN NSString *__nullable RCTBundlePathForURL(NSURL *__nullable URL); + +// Returns the Path of Library directory +RCT_EXTERN NSString *__nullable RCTLibraryPath(void); + +// Returns the relative path within the library for an absolute URL +// (or nil, if the URL does not specify a path within the Library directory) +RCT_EXTERN NSString *__nullable RCTLibraryPathForURL(NSURL *__nullable URL); + +// Determines if a given image URL refers to a image in bundle +RCT_EXTERN BOOL RCTIsBundleAssetURL(NSURL *__nullable imageURL); + +// Determines if a given image URL refers to a image in library +RCT_EXTERN BOOL RCTIsLibraryAssetURL(NSURL *__nullable imageURL); + +// Determines if a given image URL refers to a local image +RCT_EXTERN BOOL RCTIsLocalAssetURL(NSURL *__nullable imageURL); + +// Returns an UIImage for a local image asset. Returns nil if the URL +// does not correspond to a local asset. +RCT_EXTERN UIImage *__nullable RCTImageFromLocalAssetURL(NSURL *imageURL); + +// Only used in case when RCTImageFromLocalAssetURL fails to get an image +// This method basically checks for the image in the bundle location, instead +// of the CodePush location +RCT_EXTERN UIImage *__nullable RCTImageFromLocalBundleAssetURL(NSURL *imageURL); + +// Creates a new, unique temporary file path with the specified extension +RCT_EXTERN NSString *__nullable RCTTempFilePath(NSString *__nullable extension, NSError **error); + +// Get RGBA components of CGColor +RCT_EXTERN void RCTGetRGBAColorComponents(CGColorRef color, CGFloat rgba[_Nonnull 4]); + +// Converts a CGColor to a hex string +RCT_EXTERN NSString *RCTColorToHexString(CGColorRef color); + +// Get standard localized string (if it exists) +RCT_EXTERN NSString *RCTUIKitLocalizedString(NSString *string); + +// Get a human readable type string from an NSObject. For example NSString becomes string +RCT_EXTERN NSString *RCTHumanReadableType(NSObject *obj); + +// URL manipulation +RCT_EXTERN NSString *__nullable RCTGetURLQueryParam(NSURL *__nullable URL, NSString *param); +RCT_EXTERN NSURL *__nullable +RCTURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value); + +// Given a string, drop common RN prefixes (RCT, RK, etc.) +RCT_EXTERN NSString *RCTDropReactPrefixes(NSString *s); + +RCT_EXTERN BOOL RCTUIManagerTypeForTagIsFabric(NSNumber *reactTag); + +RCT_EXTERN BOOL RCTValidateTypeOfViewCommandArgument( + NSObject *obj, + id expectedClass, + NSString const *expectedType, + NSString const *componentName, + NSString const *commandName, + NSString const *argPos); + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUtilsUIOverride.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUtilsUIOverride.h new file mode 100644 index 0000000..c6988c6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTUtilsUIOverride.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTUtilsUIOverride : NSObject +/** + Set the global presented view controller instance override. + */ ++ (void)setPresentedViewController:(UIViewController *)presentedViewController; ++ (UIViewController *)presentedViewController; ++ (BOOL)hasPresentedViewController; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTValueAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTValueAnimatedNode.h new file mode 100644 index 0000000..a388d00 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTValueAnimatedNode.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTAnimatedNode.h" + +@class RCTValueAnimatedNode; + +@protocol RCTValueAnimatedNodeObserver + +- (void)animatedNode:(RCTValueAnimatedNode *)node didUpdateValue:(CGFloat)value; + +@end + +@interface RCTValueAnimatedNode : RCTAnimatedNode + +- (void)setOffset:(CGFloat)offset; +- (void)flattenOffset; +- (void)extractOffset; + +@property (nonatomic, assign) CGFloat value; +@property (nonatomic, strong) id animatedObject; +@property (nonatomic, weak) id valueObserver; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVersion.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVersion.h new file mode 100644 index 0000000..5bc858d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVersion.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +RCT_EXTERN NSString *const RCTVersionMajor; +RCT_EXTERN NSString *const RCTVersionMinor; +RCT_EXTERN NSString *const RCTVersionPatch; +RCT_EXTERN NSString *const RCTVersionPrerelease; + +RCT_EXTERN NSDictionary *RCTGetReactNativeVersion(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVibration.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVibration.h new file mode 100644 index 0000000..1f6ced3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVibration.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTVibration : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVibrationPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVibrationPlugins.h new file mode 100644 index 0000000..0676192 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVibrationPlugins.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTVibrationPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTVibrationClassProvider(const char *name); + +// Lookup functions +Class RCTVibrationCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTView.h new file mode 100644 index 0000000..c82242d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTView.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +extern const UIAccessibilityTraits SwitchAccessibilityTrait; + +@protocol RCTAutoInsetsProtocol; + +@class RCTView; + +@interface RCTView : UIView + +/** + * Accessibility event handlers + */ +@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityAction; +@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityTap; +@property (nonatomic, copy) RCTDirectEventBlock onMagicTap; +@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityEscape; + +/** + * Used to control how touch events are processed. + */ +@property (nonatomic, assign) RCTPointerEvents pointerEvents; + ++ (void)autoAdjustInsetsForView:(UIView *)parentView + withScrollView:(UIScrollView *)scrollView + updateOffset:(BOOL)updateOffset; + +/** + * Find the first view controller whose view, or any subview is the specified view. + */ ++ (UIEdgeInsets)contentInsetsForView:(UIView *)curView; + +/** + * Layout direction of the view. + * This is inherited from UIView+React, but we override it here + * to improve performance and make subclassing/overriding possible/easier. + */ +@property (nonatomic, assign) UIUserInterfaceLayoutDirection reactLayoutDirection; + +/** + * This is an optimization used to improve performance + * for large scrolling views with many subviews, such as a + * list or table. If set to YES, any clipped subviews will + * be removed from the view hierarchy whenever -updateClippedSubviews + * is called. This would typically be triggered by a scroll event + */ +@property (nonatomic, assign) BOOL removeClippedSubviews; + +/** + * Hide subviews if they are outside the view bounds. + * This is an optimisation used predominantly with RKScrollViews + * but it is applied recursively to all subviews that have + * removeClippedSubviews set to YES + */ +- (void)updateClippedSubviews; + +/** + * Border radii. + */ +@property (nonatomic, assign) CGFloat borderRadius; +@property (nonatomic, assign) CGFloat borderTopLeftRadius; +@property (nonatomic, assign) CGFloat borderTopRightRadius; +@property (nonatomic, assign) CGFloat borderTopStartRadius; +@property (nonatomic, assign) CGFloat borderTopEndRadius; +@property (nonatomic, assign) CGFloat borderBottomLeftRadius; +@property (nonatomic, assign) CGFloat borderBottomRightRadius; +@property (nonatomic, assign) CGFloat borderBottomStartRadius; +@property (nonatomic, assign) CGFloat borderBottomEndRadius; + +/** + * Border colors (actually retained). + */ +@property (nonatomic, strong) UIColor *borderTopColor; +@property (nonatomic, strong) UIColor *borderRightColor; +@property (nonatomic, strong) UIColor *borderBottomColor; +@property (nonatomic, strong) UIColor *borderLeftColor; +@property (nonatomic, strong) UIColor *borderStartColor; +@property (nonatomic, strong) UIColor *borderEndColor; +@property (nonatomic, strong) UIColor *borderColor; + +/** + * Border widths. + */ +@property (nonatomic, assign) CGFloat borderTopWidth; +@property (nonatomic, assign) CGFloat borderRightWidth; +@property (nonatomic, assign) CGFloat borderBottomWidth; +@property (nonatomic, assign) CGFloat borderLeftWidth; +@property (nonatomic, assign) CGFloat borderStartWidth; +@property (nonatomic, assign) CGFloat borderEndWidth; +@property (nonatomic, assign) CGFloat borderWidth; + +/** + * Border styles. + */ +@property (nonatomic, assign) RCTBorderStyle borderStyle; + +/** + * Insets used when hit testing inside this view. + */ +@property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTViewManager.h new file mode 100644 index 0000000..5c1eba4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTViewManager.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import +#import + +@class RCTBridge; +@class RCTShadowView; +@class RCTSparseArray; +@class RCTUIManager; + +typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, NSDictionary *viewRegistry); + +@interface RCTViewManager : NSObject + +/** + * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher, + * allowing the manager (or the views that it manages) to manipulate the view + * hierarchy and send events back to the JS context. + */ +@property (nonatomic, weak) RCTBridge *bridge; + +/** + * This method instantiates a native view to be managed by the module. Override + * this to return a custom view instance, which may be preconfigured with default + * properties, subviews, etc. This method will be called many times, and should + * return a fresh instance each time. The view module MUST NOT cache the returned + * view and return the same instance for subsequent calls. + */ +- (UIView *)view; + +/** + * This method instantiates a shadow view to be managed by the module. If omitted, + * an ordinary RCTShadowView instance will be created, which is typically fine for + * most view types. As with the -view method, the -shadowView method should return + * a fresh instance each time it is called. + */ +- (RCTShadowView *)shadowView; + +/** + * DEPRECATED: declare properties of type RCTBubblingEventBlock instead + * + * Returns an array of names of events that can be sent by native views. This + * should return bubbling, directly-dispatched event types. The event name + * should not include a prefix such as 'on' or 'top', as this will be applied + * as needed. When subscribing to the event, use the 'Captured' suffix to + * indicate the captured form, or omit the suffix for the bubbling form. + * + * Note that this method is not inherited when you subclass a view module, and + * you should not call [super customBubblingEventTypes] when overriding it. + */ +- (NSArray *)customBubblingEventTypes __deprecated_msg("Use RCTBubblingEventBlock props instead."); + +/** + * This handles the simple case, where JS and native property names match. + */ +#define RCT_EXPORT_VIEW_PROPERTY(name, type) \ + +(NSArray *)propConfig_##name RCT_DYNAMIC \ + { \ + return @[ @ #type ]; \ + } + +/** + * This macro maps a named property to an arbitrary key path in the view. + */ +#define RCT_REMAP_VIEW_PROPERTY(name, keyPath, type) \ + +(NSArray *)propConfig_##name RCT_DYNAMIC \ + { \ + return @[ @ #type, @ #keyPath ]; \ + } + +/** + * This macro can be used when you need to provide custom logic for setting + * view properties. The macro should be followed by a method body, which can + * refer to "json", "view" and "defaultView" to implement the required logic. + */ +#define RCT_CUSTOM_VIEW_PROPERTY(name, type, viewClass) \ + RCT_REMAP_VIEW_PROPERTY(name, __custom__, type) \ + -(void)set_##name : (id)json forView : (viewClass *)view withDefaultView : (viewClass *)defaultView RCT_DYNAMIC + +/** + * This macro is used to map properties to the shadow view, instead of the view. + */ +#define RCT_EXPORT_SHADOW_PROPERTY(name, type) \ + +(NSArray *)propConfigShadow_##name RCT_DYNAMIC \ + { \ + return @[ @ #type ]; \ + } + +/** + * This macro maps a named property to an arbitrary key path in the shadow view. + */ +#define RCT_REMAP_SHADOW_PROPERTY(name, keyPath, type) \ + +(NSArray *)propConfigShadow_##name RCT_DYNAMIC \ + { \ + return @[ @ #type, @ #keyPath ]; \ + } + +/** + * This macro can be used when you need to provide custom logic for setting + * shadow view properties. The macro should be followed by a method body, which can + * refer to "json" and "view". + */ +#define RCT_CUSTOM_SHADOW_PROPERTY(name, type, viewClass) \ + RCT_REMAP_SHADOW_PROPERTY(name, __custom__, type) \ + -(void)set_##name : (id)json forShadowView : (viewClass *)view RCT_DYNAMIC + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVirtualTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVirtualTextShadowView.h new file mode 100644 index 0000000..bce9ea8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVirtualTextShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +@interface RCTVirtualTextShadowView : RCTBaseTextShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVirtualTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVirtualTextViewManager.h new file mode 100644 index 0000000..91d4f78 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTVirtualTextViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTVirtualTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWeakProxy.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWeakProxy.h new file mode 100644 index 0000000..472f7f0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWeakProxy.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTWeakProxy : NSObject + +@property (nonatomic, weak, readonly) id target; + ++ (instancetype)weakProxyWithTarget:(id)target; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWeakViewHolder.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWeakViewHolder.h new file mode 100644 index 0000000..ce39eee --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWeakViewHolder.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* + * THIS IS A HACK + * This protocol should only be used for Paper ViewManagers which need to + * use the Fabric Interop layer, and also need to reference their created + * views. This protocol allows the view manager to store a weak reference to + * any created views. It will not affect view lifecycle in any way. + */ +@protocol RCTWeakViewHolder + +@property (nonatomic, strong) NSMapTable *weakViews; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWebSocketExecutor.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWebSocketExecutor.h new file mode 100644 index 0000000..499664b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWebSocketExecutor.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if RCT_DEV // Debug executors are only supported in dev mode + +@interface RCTWebSocketExecutor : NSObject + +- (instancetype)initWithURL:(NSURL *)URL; + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWebSocketModule.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWebSocketModule.h new file mode 100644 index 0000000..c1a48d3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWebSocketModule.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTWebSocketContentHandler + +- (id)processWebsocketMessage:(id __nullable)message + forSocketID:(NSNumber *)socketID + withType:(NSString *__nonnull __autoreleasing *__nonnull)type; + +@end + +@interface RCTWebSocketModule : RCTEventEmitter + +// Register a custom handler for a specific websocket. The handler will be strongly held by the WebSocketModule. +- (void)setContentHandler:(id __nullable)handler forSocketID:(NSNumber *)socketID; + +- (void)sendData:(NSData *)data forSocketID:(nonnull NSNumber *)socketID; + +@end + +@interface RCTBridge (RCTWebSocketModule) + +- (RCTWebSocketModule *)webSocketModule; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWrapperViewController.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWrapperViewController.h new file mode 100644 index 0000000..dc9b0d6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/RCTWrapperViewController.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTWrapperViewController; + +@interface RCTWrapperViewController : UIViewController + +- (instancetype)initWithContentView:(UIView *)contentView NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/UIView+Private.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/UIView+Private.h new file mode 100644 index 0000000..a5cb440 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/UIView+Private.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface UIView (Private) + +// remove clipped subviews implementation +- (void)react_remountAllSubviews; +- (void)react_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView; +- (UIView *)react_findClipView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/UIView+React.h b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/UIView+React.h new file mode 100644 index 0000000..67c665b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64/Headers/React/UIView+React.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@class RCTShadowView; + +@interface UIView (React) + +/** + * RCTComponent interface. + */ +- (NSArray *)reactSubviews NS_REQUIRES_SUPER; +- (UIView *)reactSuperview NS_REQUIRES_SUPER; +- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex NS_REQUIRES_SUPER; +- (void)removeReactSubview:(UIView *)subview NS_REQUIRES_SUPER; + +/** + * The native id of the view, used to locate view from native codes + */ +@property (nonatomic, copy) NSString *nativeID; + +/** + * Determines whether or not a view should ignore inverted colors or not. Used to set + * UIView property accessibilityIgnoresInvertColors in iOS 11+. + */ +@property (nonatomic, assign) BOOL shouldAccessibilityIgnoresInvertColors; + +/** + * Layout direction of the view. + * Internally backed to `semanticContentAttribute` property. + * Defaults to `LeftToRight` in case of ambiguity. + */ +@property (nonatomic, assign) UIUserInterfaceLayoutDirection reactLayoutDirection; + +/** + * Yoga `display` style property. Can be `flex` or `none`. + * Defaults to `flex`. + * May be used to temporary hide the view in a very efficient way. + */ +@property (nonatomic, assign) YGDisplay reactDisplay; + +/** + * The z-index of the view. + */ +@property (nonatomic, assign) NSInteger reactZIndex; + +/** + * Subviews sorted by z-index. Note that this method doesn't do any caching (yet) + * and sorts all the views each call. + */ +- (NSArray *)reactZIndexSortedSubviews; + +/** + * Updates the subviews array based on the reactSubviews. Default behavior is + * to insert the sortedReactSubviews into the UIView. + */ +- (void)didUpdateReactSubviews; + +/** + * Called each time props have been set. + * The default implementation does nothing. + */ +- (void)didSetProps:(NSArray *)changedProps; + +/** + * Used by the UIIManager to set the view frame. + * May be overridden to disable animation, etc. + */ +- (void)reactSetFrame:(CGRect)frame; + +/** + * This method finds and returns the containing view controller for the view. + */ +- (UIViewController *)reactViewController; + +/** + * This method attaches the specified controller as a child of the + * the owning view controller of this view. Returns NO if no view + * controller is found (which may happen if the view is not currently + * attached to the view hierarchy). + */ +- (void)reactAddControllerToClosestParent:(UIViewController *)controller; + +/** + * Focus manipulation. + */ +- (void)reactFocus; +- (void)reactFocusIfNeeded; +- (void)reactBlur; + +/** + * Useful properties for computing layout. + */ +@property (nonatomic, readonly) UIEdgeInsets reactBorderInsets; +@property (nonatomic, readonly) UIEdgeInsets reactPaddingInsets; +@property (nonatomic, readonly) UIEdgeInsets reactCompoundInsets; +@property (nonatomic, readonly) CGRect reactContentFrame; + +/** + * The (sub)view which represents this view in terms of accessibility. + * ViewManager will apply all accessibility properties directly to this view. + * May be overridden in view subclass which needs to be accessiblitywise + * transparent in favour of some subview. + * Defaults to `self`. + */ +@property (nonatomic, readonly) UIView *reactAccessibilityElement; + +/** + * Accessibility properties + */ +@property (nonatomic, copy) NSString *accessibilityRole; +@property (nonatomic, copy) NSDictionary *accessibilityState; +@property (nonatomic, copy) NSArray *accessibilityActions; +@property (nonatomic, copy) NSDictionary *accessibilityValueInternal; + +/** + * Used in debugging to get a description of the view hierarchy rooted at + * the current view. + */ +- (NSString *)react_recursiveDescription; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64/libReact-Core.a b/Frameworks/React-Core.xcframework/ios-arm64/libReact-Core.a new file mode 100644 index 0000000..502ba8c Binary files /dev/null and b/Frameworks/React-Core.xcframework/ios-arm64/libReact-Core.a differ diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/CoreModulesPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/CoreModulesPlugins.h new file mode 100644 index 0000000..0dd2130 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/CoreModulesPlugins.h @@ -0,0 +1,64 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBCoreModulesPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTCoreModulesClassProvider(const char *name); + +// Lookup functions +Class RCTAccessibilityManagerCls(void) __attribute__((used)); +Class RCTAppearanceCls(void) __attribute__((used)); +Class RCTDeviceInfoCls(void) __attribute__((used)); +Class RCTExceptionsManagerCls(void) __attribute__((used)); +Class RCTPlatformCls(void) __attribute__((used)); +Class RCTClipboardCls(void) __attribute__((used)); +Class RCTI18nManagerCls(void) __attribute__((used)); +Class RCTSourceCodeCls(void) __attribute__((used)); +Class RCTActionSheetManagerCls(void) __attribute__((used)); +Class RCTAlertManagerCls(void) __attribute__((used)); +Class RCTAsyncLocalStorageCls(void) __attribute__((used)); +Class RCTTimingCls(void) __attribute__((used)); +Class RCTStatusBarManagerCls(void) __attribute__((used)); +Class RCTKeyboardObserverCls(void) __attribute__((used)); +Class RCTAppStateCls(void) __attribute__((used)); +Class RCTPerfMonitorCls(void) __attribute__((used)); +Class RCTDevMenuCls(void) __attribute__((used)); +Class RCTDevSettingsCls(void) __attribute__((used)); +Class RCTRedBoxCls(void) __attribute__((used)); +Class RCTLogBoxCls(void) __attribute__((used)); +Class RCTWebSocketExecutorCls(void) __attribute__((used)); +Class RCTWebSocketModuleCls(void) __attribute__((used)); +Class RCTDevLoadingViewCls(void) __attribute__((used)); +Class RCTDevSplitBundleLoaderCls(void) __attribute__((used)); +Class RCTEventDispatcherCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/NSTextStorage+FontScaling.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/NSTextStorage+FontScaling.h new file mode 100644 index 0000000..61b1634 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/NSTextStorage+FontScaling.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface NSTextStorage (FontScaling) + +- (void)scaleFontSizeToFitSize:(CGSize)size + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +- (void)scaleFontSizeWithRatio:(CGFloat)ratio + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAccessibilityManager+Internal.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAccessibilityManager+Internal.h new file mode 100644 index 0000000..e01e800 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAccessibilityManager+Internal.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAccessibilityManager.h" + +#import + +NS_ASSUME_NONNULL_BEGIN + +RCT_EXTERN_C_BEGIN + +// Only to be used for testing and internal tooling. Do not use this in +// production. +void RCTAccessibilityManagerSetIsVoiceOverEnabled( + RCTAccessibilityManager *accessibiltyManager, + BOOL isVoiceOverEnabled); + +RCT_EXTERN_C_END + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAccessibilityManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAccessibilityManager.h new file mode 100644 index 0000000..7b5a132 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAccessibilityManager.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; // posted when multiplier is changed + +@interface RCTAccessibilityManager : NSObject + +@property (nonatomic, readonly) CGFloat multiplier; + +/// map from UIKit categories to multipliers +@property (nonatomic, copy) NSDictionary *multipliers; + +@property (nonatomic, assign) BOOL isBoldTextEnabled; +@property (nonatomic, assign) BOOL isGrayscaleEnabled; +@property (nonatomic, assign) BOOL isInvertColorsEnabled; +@property (nonatomic, assign) BOOL isReduceMotionEnabled; +@property (nonatomic, assign) BOOL isReduceTransparencyEnabled; +@property (nonatomic, assign) BOOL isVoiceOverEnabled; + +@end + +@interface RCTBridge (RCTAccessibilityManager) + +@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActionSheetManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActionSheetManager.h new file mode 100644 index 0000000..858afcf --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActionSheetManager.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTActionSheetManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActivityIndicatorView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActivityIndicatorView.h new file mode 100644 index 0000000..62d5f32 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActivityIndicatorView.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTActivityIndicatorView : UIActivityIndicatorView +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActivityIndicatorViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActivityIndicatorViewManager.h new file mode 100644 index 0000000..61bbd72 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTActivityIndicatorViewManager.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTConvert (UIActivityIndicatorView) + ++ (UIActivityIndicatorViewStyle)UIActivityIndicatorViewStyle:(id)json; + +@end + +@interface RCTActivityIndicatorViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAdditionAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAdditionAnimatedNode.h new file mode 100644 index 0000000..50f3bc1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAdditionAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTAdditionAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAlertController.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAlertController.h new file mode 100644 index 0000000..f5c206c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAlertController.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTAlertController : UIAlertController + +- (void)show:(BOOL)animated completion:(void (^)(void))completion; +- (void)hide; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAlertManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAlertManager.h new file mode 100644 index 0000000..8ea1d9b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAlertManager.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef NS_ENUM(NSInteger, RCTAlertViewStyle) { + RCTAlertViewStyleDefault = 0, + RCTAlertViewStyleSecureTextInput, + RCTAlertViewStylePlainTextInput, + RCTAlertViewStyleLoginAndPasswordInput +}; + +@interface RCTAlertManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimatedImage.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimatedImage.h new file mode 100644 index 0000000..933a492 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimatedImage.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTAnimatedImage +@property (nonatomic, assign, readonly) NSUInteger animatedImageFrameCount; +@property (nonatomic, assign, readonly) NSUInteger animatedImageLoopCount; + +- (nullable UIImage *)animatedImageFrameAtIndex:(NSUInteger)index; +- (NSTimeInterval)animatedImageDurationAtIndex:(NSUInteger)index; + +@end + +@interface RCTAnimatedImage : UIImage + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimatedNode.h new file mode 100644 index 0000000..24c0fb3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimatedNode.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTNativeAnimatedNodesManager; + +@interface RCTAnimatedNode : NSObject + +- (instancetype)initWithTag:(NSNumber *)tag + config:(NSDictionary *)config NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, readonly) NSNumber *nodeTag; +@property (nonatomic, weak) RCTNativeAnimatedNodesManager *manager; +@property (nonatomic, copy, readonly) NSDictionary *config; + +@property (nonatomic, copy, readonly) NSMapTable *childNodes; +@property (nonatomic, copy, readonly) NSMapTable *parentNodes; + +@property (nonatomic, readonly) BOOL needsUpdate; + +-(BOOL)isManagedByFabric; + +/** + * Marks a node and its children as needing update. + */ +- (void)setNeedsUpdate NS_REQUIRES_SUPER; + +/** + * The node will update its value if necessary and only after its parents have updated. + */ +- (void)updateNodeIfNecessary NS_REQUIRES_SUPER; + +/** + * Where the actual update code lives. Called internally from updateNodeIfNecessary + */ +- (void)performUpdate NS_REQUIRES_SUPER; + +- (void)addChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER; +- (void)removeChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER; + +- (void)onAttachedToNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER; +- (void)onDetachedFromNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER; + +- (void)detachNode NS_REQUIRES_SUPER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationDriver.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationDriver.h new file mode 100644 index 0000000..256464b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationDriver.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +static CGFloat RCTSingleFrameInterval = (CGFloat)(1.0 / 60.0); + +@class RCTValueAnimatedNode; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTAnimationDriver + +@property (nonatomic, readonly) NSNumber *animationId; +@property (nonatomic, readonly) RCTValueAnimatedNode *valueNode; +@property (nonatomic, readonly) BOOL animationHasBegun; +@property (nonatomic, readonly) BOOL animationHasFinished; + +- (instancetype)initWithId:(NSNumber *)animationId + config:(NSDictionary *)config + forNode:(RCTValueAnimatedNode *)valueNode + callBack:(nullable RCTResponseSenderBlock)callback; + +- (void)startAnimation; +- (void)stepAnimationWithTime:(NSTimeInterval)currentTime; +- (void)stopAnimation; +- (void)resetAnimationConfig:(NSDictionary *)config; + +NS_ASSUME_NONNULL_END + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationPlugins.h new file mode 100644 index 0000000..406eb68 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationPlugins.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTAnimationPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTAnimationClassProvider(const char *name); + +// Lookup functions +Class RCTNativeAnimatedModuleCls(void) __attribute__((used)); +Class RCTNativeAnimatedTurboModuleCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationType.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationType.h new file mode 100644 index 0000000..4dcb316 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationType.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTAnimationType) { + RCTAnimationTypeSpring = 0, + RCTAnimationTypeLinear, + RCTAnimationTypeEaseIn, + RCTAnimationTypeEaseOut, + RCTAnimationTypeEaseInEaseOut, + RCTAnimationTypeKeyboard, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationUtils.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationUtils.h new file mode 100644 index 0000000..1f1afa9 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAnimationUtils.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +static NSString *const EXTRAPOLATE_TYPE_IDENTITY = @"identity"; +static NSString *const EXTRAPOLATE_TYPE_CLAMP = @"clamp"; +static NSString *const EXTRAPOLATE_TYPE_EXTEND = @"extend"; + +RCT_EXTERN CGFloat RCTInterpolateValueInRange(CGFloat value, + NSArray *inputRange, + NSArray *outputRange, + NSString *extrapolateLeft, + NSString *extrapolateRight); + +RCT_EXTERN CGFloat RCTInterpolateValue(CGFloat value, + CGFloat inputMin, + CGFloat inputMax, + CGFloat outputMin, + CGFloat outputMax, + NSString *extrapolateLeft, + NSString *extrapolateRight); + +RCT_EXTERN CGFloat RCTRadiansToDegrees(CGFloat radians); +RCT_EXTERN CGFloat RCTDegreesToRadians(CGFloat degrees); + +/** + * Coefficient to slow down animations, respects the ios + * simulator `Slow Animations (⌘T)` option. + */ +RCT_EXTERN CGFloat RCTAnimationDragCoefficient(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAppState.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAppState.h new file mode 100644 index 0000000..0921f70 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAppState.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTAppState : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAppearance.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAppearance.h new file mode 100644 index 0000000..d8c3585 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAppearance.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +RCT_EXTERN void RCTEnableAppearancePreference(BOOL enabled); +RCT_EXTERN void RCTOverrideAppearancePreference(NSString *const); +RCT_EXTERN NSString *RCTColorSchemePreference(UITraitCollection *traitCollection); + +@interface RCTAppearance : RCTEventEmitter +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAssert.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAssert.h new file mode 100644 index 0000000..e4c7790 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAssert.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/* + * Defined in RCTUtils.m + */ +RCT_EXTERN BOOL RCTIsMainQueue(void); + +/** + * This is the main assert macro that you should use. Asserts should be compiled out + * in production builds. You can customize the assert behaviour by setting a custom + * assert handler through `RCTSetAssertFunction`. + */ +#ifndef NS_BLOCK_ASSERTIONS +#define RCTAssert(condition, ...) \ + do { \ + if ((condition) == 0) { \ + _RCTAssertFormat(#condition, __FILE__, __LINE__, __func__, __VA_ARGS__); \ + if (RCT_NSASSERT) { \ + [[NSAssertionHandler currentHandler] handleFailureInFunction:(NSString *_Nonnull)@(__func__) \ + file:(NSString *_Nonnull)@(__FILE__) \ + lineNumber:__LINE__ \ + description:__VA_ARGS__]; \ + } \ + } \ + } while (false) +#else +#define RCTAssert(condition, ...) \ + do { \ + } while (false) +#endif +RCT_EXTERN void _RCTAssertFormat(const char *, const char *, int, const char *, NSString *, ...) + NS_FORMAT_FUNCTION(5, 6); + +/** + * Report a fatal condition when executing. These calls will _NOT_ be compiled out + * in production, and crash the app by default. You can customize the fatal behaviour + * by setting a custom fatal handler through `RCTSetFatalHandler` and + * `RCTSetFatalExceptionHandler`. + */ +RCT_EXTERN void RCTFatal(NSError *error); +RCT_EXTERN void RCTFatalException(NSException *exception); + +/** + * The default error domain to be used for React errors. + */ +RCT_EXTERN NSString *const RCTErrorDomain; + +/** + * JS Stack trace provided as part of an NSError's userInfo + */ +RCT_EXTERN NSString *const RCTJSStackTraceKey; + +/** + * Raw JS Stack trace string provided as part of an NSError's userInfo + */ +RCT_EXTERN NSString *const RCTJSRawStackTraceKey; + +/** + * Objective-C stack trace string provided as part of an NSError's userInfo + */ +RCT_EXTERN NSString *const RCTObjCStackTraceKey; + +/** + * Name of fatal exceptions generated by RCTFatal + */ +RCT_EXTERN NSString *const RCTFatalExceptionName; + +/** + * A block signature to be used for custom assertion handling. + */ +typedef void (^RCTAssertFunction)( + NSString *condition, + NSString *fileName, + NSNumber *lineNumber, + NSString *function, + NSString *message); + +typedef void (^RCTFatalHandler)(NSError *error); +typedef void (^RCTFatalExceptionHandler)(NSException *exception); + +/** + * Convenience macro for asserting that a parameter is non-nil/non-zero. + */ +#define RCTAssertParam(name) RCTAssert(name, @"'%s' is a required parameter", #name) + +/** + * Convenience macro for asserting that we're running on main queue. + */ +#define RCTAssertMainQueue() RCTAssert(RCTIsMainQueue(), @"This function must be called on the main queue") + +/** + * Convenience macro for asserting that we're running off the main queue. + */ +#define RCTAssertNotMainQueue() RCTAssert(!RCTIsMainQueue(), @"This function must not be called on the main queue") + +/** + * These methods get and set the current assert function called by the RCTAssert + * macros. You can use these to replace the standard behavior with custom assert + * functionality. + */ +RCT_EXTERN void RCTSetAssertFunction(RCTAssertFunction assertFunction); +RCT_EXTERN RCTAssertFunction RCTGetAssertFunction(void); + +/** + * This appends additional code to the existing assert function, without + * replacing the existing functionality. Useful if you just want to forward + * assert info to an extra service without changing the default behavior. + */ +RCT_EXTERN void RCTAddAssertFunction(RCTAssertFunction assertFunction); + +/** + * This method temporarily overrides the assert function while performing the + * specified block. This is useful for testing purposes (to detect if a given + * function asserts something) or to suppress or override assertions temporarily. + */ +RCT_EXTERN void RCTPerformBlockWithAssertFunction(void (^block)(void), RCTAssertFunction assertFunction); + +/** + * These methods get and set the current fatal handler called by the `RCTFatal` + * and `RCTFatalException` methods. + */ +RCT_EXTERN void RCTSetFatalHandler(RCTFatalHandler fatalHandler); +RCT_EXTERN RCTFatalHandler RCTGetFatalHandler(void); +RCT_EXTERN void RCTSetFatalExceptionHandler(RCTFatalExceptionHandler fatalExceptionHandler); +RCT_EXTERN RCTFatalExceptionHandler RCTGetFatalExceptionHandler(void); + +/** + * Get the current thread's name (or the current queue, if in debug mode) + */ +RCT_EXTERN NSString *RCTCurrentThreadName(void); + +/** + * Helper to get generate exception message from NSError + */ +RCT_EXTERN NSString * +RCTFormatError(NSString *message, NSArray *> *stacktrace, NSUInteger maxMessageLength); + +/** + * Formats a JS stack trace for logging. + */ +RCT_EXTERN NSString *RCTFormatStackTrace(NSArray *> *stackTrace); + +/** + * Convenience macro to assert which thread is currently running (DEBUG mode only) + */ +#if DEBUG + +#define RCTAssertThread(thread, format...) \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") RCTAssert( \ + [(id)thread isKindOfClass:[NSString class]] ? [RCTCurrentThreadName() isEqualToString:(NSString *)thread] \ + : [(id)thread isKindOfClass:[NSThread class]] ? [NSThread currentThread] == (NSThread *)thread \ + : dispatch_get_current_queue() == (dispatch_queue_t)thread, \ + format); \ + _Pragma("clang diagnostic pop") + +#else + +#define RCTAssertThread(thread, format...) \ + do { \ + } while (0) + +#endif + +/** + * Controls for ensuring the new architecture runtime assumption holds. + * Note: this is work in progress. + */ + +// Enable reporting of any violation related to the new React Native architecture. +// If RCT_NEW_ARCHITECTURE is defined, it is already enabled by default, otherwise, no violation will be +// reported until enabled. +// Note: enabling this at runtime is not early enough to report issues within ObjC class +load execution. +__attribute__((used)) RCT_EXTERN void RCTEnableNewArchitectureViolationReporting(BOOL enabled); + +// When reporting is enabled, trigger an assertion. +__attribute__((used)) RCT_EXTERN void RCTEnforceNotAllowedForNewArchitecture(id context, NSString *extra); + +// When reporting is enabled, warn about the violation. Use this to prepare a specific callsite +// for stricter enforcement. When ready, switch it to use the variant above. +__attribute__((used)) RCT_EXTERN void RCTWarnNotAllowedForNewArchitecture(id context, NSString *extra); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAsyncLocalStorage.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAsyncLocalStorage.h new file mode 100644 index 0000000..d43281c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAsyncLocalStorage.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * A simple, asynchronous, persistent, key-value storage system designed as a + * backend to the AsyncStorage JS module, which is modeled after LocalStorage. + * + * Current implementation stores small values in serialized dictionary and + * larger values in separate files. Since we use a serial file queue + * `RKFileQueue`, reading/writing from multiple threads should be perceived as + * being atomic, unless someone bypasses the `RCTAsyncLocalStorage` API. + * + * Keys and values must always be strings or an error is returned. + */ +@interface RCTAsyncLocalStorage : NSObject + +@property (nonatomic, assign) BOOL clearOnInvalidate; + +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +// Clear the RCTAsyncLocalStorage data from native code +- (void)clearAllData; + +// For clearing data when the bridge may not exist, e.g. when logging out. ++ (void)clearAllData; + +// Grab data from the cache. ResponseBlock result array will have an error at position 0, and an array of arrays at +// position 1. +- (void)multiGet:(NSArray *)keys callback:(RCTResponseSenderBlock)callback; + +// Add multiple key value pairs to the cache. +- (void)multiSet:(NSArray *> *)kvPairs callback:(RCTResponseSenderBlock)callback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAutoInsetsProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAutoInsetsProtocol.h new file mode 100644 index 0000000..fc18a9a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTAutoInsetsProtocol.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * Defines a View that wants to support auto insets adjustment + */ +@protocol RCTAutoInsetsProtocol + +@property (nonatomic, assign, readwrite) UIEdgeInsets contentInset; +@property (nonatomic, assign, readwrite) BOOL automaticallyAdjustContentInsets; + +/** + * Automatically adjusted content inset depends on view controller's top and bottom + * layout guides so if you've changed one of them (e.g. after rotation or manually) you should call this method + * to recalculate and refresh content inset. + * To handle case with changing navigation bar height call this method from viewDidLayoutSubviews: + * of your view controller. + */ +- (void)refreshContentInset; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputDelegate.h new file mode 100644 index 0000000..3e1839b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputDelegate.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputViewProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputDelegate + +- (BOOL)textInputShouldBeginEditing; // Return `NO` to disallow editing. +- (void)textInputDidBeginEditing; + +- (BOOL)textInputShouldEndEditing; // Return `YES` to allow editing to stop and to resign first responder status. `NO` to disallow the editing session to end. +- (void)textInputDidEndEditing; // May be called if forced even if `textInputShouldEndEditing` returns `NO` (e.g. view removed from window) or `[textInput endEditing:YES]` called. + +- (BOOL)textInputShouldReturn; // May be called right before `textInputShouldEndEditing` if "Return" button was pressed. +- (void)textInputDidReturn; + +/* + * Called before any change in the TextInput. The delegate has the opportunity to change the replacement string or reject the change completely. + * To change the replacement, return the changed version of the `text`. + * To accept the change, return `text` argument as-is. + * To reject the change, return `nil`. + */ +- (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range; +- (void)textInputDidChange; + +- (void)textInputDidChangeSelection; + +@optional + +- (void)scrollViewDidScroll:(UIScrollView *)scrollView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputDelegateAdapter.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputDelegateAdapter.h new file mode 100644 index 0000000..a7f3251 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputDelegateAdapter.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBackedTextInputViewProtocol.h" +#import "RCTBackedTextInputDelegate.h" + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField) + +@interface RCTBackedTextFieldDelegateAdapter : NSObject + +- (instancetype)initWithTextField:(UITextField *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; +- (void)selectedTextRangeWasSet; + +@end + +#pragma mark - RCTBackedTextViewDelegateAdapter (for UITextView) + +@interface RCTBackedTextViewDelegateAdapter : NSObject + +- (instancetype)initWithTextView:(UITextView *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputViewProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputViewProtocol.h new file mode 100644 index 0000000..09f4fe2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBackedTextInputViewProtocol.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputDelegate; +@class RCTTextAttributes; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputViewProtocol + +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, strong, nullable) UIView *inputAccessoryView; +@property (nonatomic, strong, nullable) UIView *inputView; +@property (nonatomic, weak, nullable) id textInputDelegate; +@property (nonatomic, readonly) CGSize contentSize; +@property (nonatomic, strong, nullable) NSDictionary *defaultTextAttributes; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL enablesReturnKeyAutomatically; +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +// This protocol disallows direct access to `selectedTextRange` property because +// unwise usage of it can break the `delegate` behavior. So, we always have to +// explicitly specify should `delegate` be notified about the change or not. +// If the change was initiated programmatically, we must NOT notify the delegate. +// If the change was a result of user actions (like typing or touches), we MUST notify the delegate. +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange NS_UNAVAILABLE; +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange notifyDelegate:(BOOL)notifyDelegate; + +// This protocol disallows direct access to `text` property because +// unwise usage of it can break the `attributeText` behavior. +// Use `attributedText.string` instead. +@property (nonatomic, copy, nullable) NSString *text NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputShadowView.h new file mode 100644 index 0000000..44b46db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputShadowView.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, copy, nullable) NSString *text; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputView.h new file mode 100644 index 0000000..d73f082 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputView.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTBackedTextInputDelegate.h" +#import "RCTBackedTextInputViewProtocol.h" + +@class RCTBridge; +@class RCTTextAttributes; +@class RCTTextSelection; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; + +@property (nonatomic, readonly) UIView *backedTextInputView; + +@property (nonatomic, strong, nullable) RCTTextAttributes *textAttributes; +@property (nonatomic, assign) UIEdgeInsets reactPaddingInsets; +@property (nonatomic, assign) UIEdgeInsets reactBorderInsets; + +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onSelectionChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onTextInput; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onScroll; + +@property (nonatomic, assign) NSInteger mostRecentEventCount; +@property (nonatomic, assign, readonly) NSInteger nativeEventCount; +@property (nonatomic, assign) BOOL autoFocus; +@property (nonatomic, assign) BOOL blurOnSubmit; +@property (nonatomic, assign) BOOL selectTextOnFocus; +@property (nonatomic, assign) BOOL clearTextOnFocus; +@property (nonatomic, assign) BOOL secureTextEntry; +@property (nonatomic, copy) RCTTextSelection *selection; +@property (nonatomic, strong, nullable) NSNumber *maxLength; +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy) NSString *inputAccessoryViewID; +@property (nonatomic, assign) UIKeyboardType keyboardType; +@property (nonatomic, assign) BOOL showSoftInputOnFocus; + +/** + Sets selection intext input if both start and end are within range of the text input. + **/ +- (void)setSelectionStart:(NSInteger)start + selectionEnd:(NSInteger)end; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputViewManager.h new file mode 100644 index 0000000..5201bdb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextInputViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTBaseTextInputViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextShadowView.h new file mode 100644 index 0000000..9f2c944 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextShadowView.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextAttributes.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTBaseTextShadowViewEmbeddedShadowViewAttributeName; + +@interface RCTBaseTextShadowView : RCTShadowView { + @protected NSAttributedString *_Nullable cachedAttributedText; + @protected RCTTextAttributes *_Nullable cachedTextAttributes; +} + +@property (nonatomic, strong) RCTTextAttributes *textAttributes; + +- (NSAttributedString *)attributedTextWithBaseTextAttributes:(nullable RCTTextAttributes *)baseTextAttributes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextViewManager.h new file mode 100644 index 0000000..b0f9470 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBaseTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBlobManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBlobManager.h new file mode 100755 index 0000000..04b905c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBlobManager.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import + +@interface RCTBlobManager : NSObject + +- (NSString *)store:(NSData *)data; + +- (void)store:(NSData *)data withId:(NSString *)blobId; + +- (NSData *)resolve:(NSDictionary *)blob; + +- (NSData *)resolve:(NSString *)blobId offset:(NSInteger)offset size:(NSInteger)size; + +- (NSData *)resolveURL:(NSURL *)url; + +- (void)remove:(NSString *)blobId; + +- (void)createFromParts:(NSArray *> *)parts withId:(NSString *)blobId; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBorderDrawing.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBorderDrawing.h new file mode 100644 index 0000000..884aa79 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBorderDrawing.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef struct { + CGFloat topLeft; + CGFloat topRight; + CGFloat bottomLeft; + CGFloat bottomRight; +} RCTCornerRadii; + +typedef struct { + CGSize topLeft; + CGSize topRight; + CGSize bottomLeft; + CGSize bottomRight; +} RCTCornerInsets; + +typedef struct { + CGColorRef top; + CGColorRef left; + CGColorRef bottom; + CGColorRef right; +} RCTBorderColors; + +/** + * Determine if the border widths, colors and radii are all equal. + */ +RCT_EXTERN BOOL RCTBorderInsetsAreEqual(UIEdgeInsets borderInsets); +RCT_EXTERN BOOL RCTCornerRadiiAreEqual(RCTCornerRadii cornerRadii); +RCT_EXTERN BOOL RCTBorderColorsAreEqual(RCTBorderColors borderColors); + +/** + * Convert RCTCornerRadii to RCTCornerInsets by applying border insets. + * Effectively, returns radius - inset, with a lower bound of 0.0. + */ +RCT_EXTERN RCTCornerInsets RCTGetCornerInsets(RCTCornerRadii cornerRadii, UIEdgeInsets borderInsets); + +/** + * Create a CGPath representing a rounded rectangle with the specified bounds + * and corner insets. Note that the CGPathRef must be released by the caller. + */ +RCT_EXTERN CGPathRef +RCTPathCreateWithRoundedRect(CGRect bounds, RCTCornerInsets cornerInsets, const CGAffineTransform *transform); + +/** + * Draw a CSS-compliant border as an image. You can determine if it's scalable + * by inspecting the image's `capInsets`. + * + * `borderInsets` defines the border widths for each edge. + */ +RCT_EXTERN UIImage *RCTGetBorderImage( + RCTBorderStyle borderStyle, + CGSize viewSize, + RCTCornerRadii cornerRadii, + UIEdgeInsets borderInsets, + RCTBorderColors borderColors, + CGColorRef backgroundColor, + BOOL drawToEdge); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBorderStyle.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBorderStyle.h new file mode 100644 index 0000000..70d6d72 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBorderStyle.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTBorderStyle) { + RCTBorderStyleUnset = 0, + RCTBorderStyleSolid, + RCTBorderStyleDotted, + RCTBorderStyleDashed, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridge+Private.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridge+Private.h new file mode 100644 index 0000000..9dd96a5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridge+Private.h @@ -0,0 +1,157 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTModuleRegistry; +@class RCTModuleData; +@protocol RCTJavaScriptExecutor; + +RCT_EXTERN NSArray *RCTGetModuleClasses(void); +RCT_EXTERN void RCTRegisterModule(Class); + +@interface RCTBridge () + +// Private designated initializer +- (instancetype)initWithDelegate:(id)delegate + bundleURL:(NSURL *)bundleURL + moduleProvider:(RCTBridgeModuleListProvider)block + launchOptions:(NSDictionary *)launchOptions NS_DESIGNATED_INITIALIZER; + +// Used for the profiler flow events between JS and native +@property (nonatomic, assign) int64_t flowID; +@property (nonatomic, assign) CFMutableDictionaryRef flowIDMap; +@property (nonatomic, strong) NSLock *flowIDMapLock; + +// Used by RCTDevMenu +@property (nonatomic, copy) NSString *bridgeDescription; + ++ (instancetype)currentBridge; ++ (void)setCurrentBridge:(RCTBridge *)bridge; + +/** + * Bridge setup code - creates an instance of RCTBachedBridge. Exposed for + * test only + */ +- (void)setUp; + +/** + * This method is used to invoke a callback that was registered in the + * JavaScript application context. Safe to call from any thread. + */ +- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args; + +/** + * This property is mostly used on the main thread, but may be touched from + * a background thread if the RCTBridge happens to deallocate on a background + * thread. Therefore, we want all writes to it to be seen atomically. + */ +@property (atomic, strong) RCTBridge *batchedBridge; + +/** + * The block that creates the modules' instances to be added to the bridge. + * Exposed for RCTCxxBridge + */ +@property (nonatomic, copy, readonly) RCTBridgeModuleListProvider moduleProvider; + +/** + * Used by RCTDevMenu to override the `hot` param of the current bundleURL. + */ +@property (nonatomic, strong, readwrite) NSURL *bundleURL; + +/** + * An object that allows one to require NativeModules/TurboModules. + * RCTModuleRegistry is implemented in bridgeless mode and bridge mode. + * Used by RCTRootView. + */ +@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; + +@end + +@interface RCTBridge (RCTCxxBridge) + +/** + * Used by RCTModuleData + */ + +@property (nonatomic, weak, readonly) RCTBridge *parentBridge; + +/** + * Used by RCTModuleData + */ +@property (nonatomic, assign, readonly) BOOL moduleSetupComplete; + +/** + * Called on the child bridge to run the executor and start loading. + */ +- (void)start; + +/** + * Used by RCTModuleData to register the module for frame updates after it is + * lazily initialized. + */ +- (void)registerModuleForFrameUpdates:(id)module withModuleData:(RCTModuleData *)moduleData; + +/** + * Dispatch work to a module's queue - this is also suports the fake RCTJSThread + * queue. Exposed for the RCTProfiler + */ +- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue; + +/** + * Get the module data for a given module name. Used by UIManager to implement + * the `dispatchViewManagerCommand` method. + */ +- (RCTModuleData *)moduleDataForName:(NSString *)moduleName; + +/** + * Registers additional classes with the ModuleRegistry. + */ +- (void)registerAdditionalModuleClasses:(NSArray *)newModules; + +/** + * Updates the ModuleRegistry with a pre-initialized instance. + */ +- (void)updateModuleWithInstance:(id)instance; + +/** + * Systrace profiler toggling methods exposed for the RCTDevMenu + */ +- (void)startProfiling; +- (void)stopProfiling:(void (^)(NSData *))callback; + +/** + * Synchronously call a specific native module's method and return the result + */ +- (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:(NSArray *)params; + +/** + * Hook exposed for RCTLog to send logs to JavaScript when not running in JSC + */ +- (void)logMessage:(NSString *)message level:(NSString *)level; + +/** + * Allow super fast, one time, timers to skip the queue and be directly executed + */ +- (void)_immediatelyCallTimer:(NSNumber *)timer; + +@end + +@interface RCTBridge (Inspector) + +@property (nonatomic, readonly, getter=isInspectable) BOOL inspectable; + +@end + +@interface RCTCxxBridge : RCTBridge + +// TODO(cjhopman): this seems unsafe unless we require that it is only called on the main js queue. +@property (nonatomic, readonly) void *runtime; + +- (instancetype)initWithParentBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridge.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridge.h new file mode 100644 index 0000000..8eef1ce --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridge.h @@ -0,0 +1,337 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import + +@class JSValue; +@class RCTBridge; +@class RCTPerformanceLogger; + +/** + * This notification fires when the bridge initializes. + */ +RCT_EXTERN NSString *const RCTJavaScriptWillStartLoadingNotification; + +/** + * This notification fires when the bridge starts executing the JS bundle. + */ +RCT_EXTERN NSString *const RCTJavaScriptWillStartExecutingNotification; + +/** + * This notification fires when the bridge has finished loading the JS bundle. + */ +RCT_EXTERN NSString *const RCTJavaScriptDidLoadNotification; + +/** + * This notification fires when the bridge failed to load the JS bundle. The + * `error` key can be used to determine the error that occurred. + */ +RCT_EXTERN NSString *const RCTJavaScriptDidFailToLoadNotification; + +/** + * This notification fires each time a native module is instantiated. The + * `module` key will contain a reference to the newly-created module instance. + * Note that this notification may be fired before the module is available via + * the `[bridge moduleForClass:]` method. + */ +RCT_EXTERN NSString *const RCTDidInitializeModuleNotification; + +/** + * This notification fires each time a module is setup after it is initialized. The + * `RCTDidSetupModuleNotificationModuleNameKey` key will contain a reference to the module name and + * `RCTDidSetupModuleNotificationSetupTimeKey` will contain the setup time in ms. + */ +RCT_EXTERN NSString *const RCTDidSetupModuleNotification; + +/** + * Key for the module name (NSString) in the + * RCTDidSetupModuleNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTDidSetupModuleNotificationModuleNameKey; + +/** + * Key for the setup time (NSNumber) in the + * RCTDidSetupModuleNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTDidSetupModuleNotificationSetupTimeKey; + +/** + * DEPRECATED - Use RCTReloadCommand instead. This notification fires just before the bridge starts + * processing a request to reload. + */ +RCT_EXTERN NSString *const RCTBridgeWillReloadNotification; + +/** + * This notification fires whenever a fast refresh happens. + */ +RCT_EXTERN NSString *const RCTBridgeFastRefreshNotification; + +/** + * This notification fires just before the bridge begins downloading a script + * from the packager. + */ +RCT_EXTERN NSString *const RCTBridgeWillDownloadScriptNotification; + +/** + * This notification fires just after the bridge finishes downloading a script + * from the packager. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotification; + +/** + * This notification fires right after the bridge is about to invalidate NativeModule + * instances during teardown. Handle this notification to perform additional invalidation. + */ +RCT_EXTERN NSString *const RCTBridgeWillInvalidateModulesNotification; + +/** + * This notification fires right after the bridge finishes invalidating NativeModule + * instances during teardown. Handle this notification to perform additional invalidation. + */ +RCT_EXTERN NSString *const RCTBridgeDidInvalidateModulesNotification; + +/** + * This notification fires right before the bridge starting invalidation process. + * Handle this notification to perform additional invalidation. + * The notification can be issued on any thread. + */ +RCT_EXTERN NSString *const RCTBridgeWillBeInvalidatedNotification; + +/** + * Key for the RCTSource object in the RCTBridgeDidDownloadScriptNotification + * userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationSourceKey; + +/** + * Key for the reload reason in the RCTBridgeWillReloadNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationReasonKey; + +/** + * Key for the bridge description (NSString_ in the + * RCTBridgeDidDownloadScriptNotification userInfo dictionary. + */ +RCT_EXTERN NSString *const RCTBridgeDidDownloadScriptNotificationBridgeDescriptionKey; + +/** + * This block can be used to instantiate modules that require additional + * init parameters, or additional configuration prior to being used. + * The bridge will call this block to instantiate the modules, and will + * be responsible for invalidating/releasing them when the bridge is destroyed. + * For this reason, the block should always return new module instances, and + * module instances should not be shared between bridges. + */ +typedef NSArray> * (^RCTBridgeModuleListProvider)(void); + +/** + * These blocks are used to report whether an additional bundle + * fails or succeeds loading. + */ +typedef void (^RCTLoadAndExecuteErrorBlock)(NSError *error); + +/** + * This function returns the module name for a given class. + */ +RCT_EXTERN NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass); + +/** + * Experimental. + * Check/set if JSI-bound NativeModule is enabled. By default it's off. + */ +RCT_EXTERN BOOL RCTTurboModuleEnabled(void); +RCT_EXTERN void RCTEnableTurboModule(BOOL enabled); + +// Turn on TurboModule eager initialization +RCT_EXTERN BOOL RCTTurboModuleEagerInitEnabled(void); +RCT_EXTERN void RCTEnableTurboModuleEagerInit(BOOL enabled); + +// Turn on TurboModule shared mutex initialization +RCT_EXTERN BOOL RCTTurboModuleSharedMutexInitEnabled(void); +RCT_EXTERN void RCTEnableTurboModuleSharedMutexInit(BOOL enabled); + +// Turn off TurboModule delegate locking +RCT_EXTERN BOOL RCTTurboModuleManagerDelegateLockingDisabled(void); +RCT_EXTERN void RCTDisableTurboModuleManagerDelegateLocking(BOOL enabled); + +typedef enum { + kRCTGlobalScope, + kRCTGlobalScopeUsingRetainJSCallback, + kRCTTurboModuleManagerScope, +} RCTTurboModuleCleanupMode; + +RCT_EXTERN RCTTurboModuleCleanupMode RCTGetTurboModuleCleanupMode(void); +RCT_EXTERN void RCTSetTurboModuleCleanupMode(RCTTurboModuleCleanupMode mode); + +/** + * Async batched bridge used to communicate with the JavaScript application. + */ +@interface RCTBridge : NSObject + +/** + * Creates a new bridge with a custom RCTBridgeDelegate. + * + * All the interaction with the JavaScript context should be done using the bridge + * instance of the RCTBridgeModules. Modules will be automatically instantiated + * using the default contructor, but you can optionally pass in an array of + * pre-initialized module instances if they require additional init parameters + * or configuration. + */ +- (instancetype)initWithDelegate:(id)delegate launchOptions:(NSDictionary *)launchOptions; + +/** + * DEPRECATED: Use initWithDelegate:launchOptions: instead + * + * The designated initializer. This creates a new bridge on top of the specified + * executor. The bridge should then be used for all subsequent communication + * with the JavaScript code running in the executor. Modules will be automatically + * instantiated using the default contructor, but you can optionally pass in an + * array of pre-initialized module instances if they require additional init + * parameters or configuration. + */ +- (instancetype)initWithBundleURL:(NSURL *)bundleURL + moduleProvider:(RCTBridgeModuleListProvider)block + launchOptions:(NSDictionary *)launchOptions; + +/** + * This method is used to call functions in the JavaScript application context. + * It is primarily intended for use by modules that require two-way communication + * with the JavaScript code. Safe to call from any thread. + */ +- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args; +- (void)enqueueJSCall:(NSString *)module + method:(NSString *)method + args:(NSArray *)args + completion:(dispatch_block_t)completion; + +/** + * This method registers the file path of an additional JS segment by its ID. + * + * @experimental + */ +- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path; + +/** + * Retrieve a bridge module instance by name or class. Note that modules are + * lazily instantiated, so calling these methods for the first time with a given + * module name/class may cause the class to be synchronously instantiated, + * potentially blocking both the calling thread and main thread for a short time. + * + * Note: This method does NOT lazily load the particular module if it's not yet loaded. + */ +- (id)moduleForName:(NSString *)moduleName; +- (id)moduleForName:(NSString *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad; +// Note: This method lazily load the module as necessary. +- (id)moduleForClass:(Class)moduleClass; + +/** + * When a NativeModule performs a lookup for a TurboModule, we need to query + * the TurboModuleRegistry. + */ +- (void)setRCTTurboModuleRegistry:(id)turboModuleRegistry; + +/** + * This hook is called by the TurboModule infra with every TurboModule that's created. + * It allows the bridge to attach properties to TurboModules that give TurboModules + * access to Bridge APIs. + */ +- (void)attachBridgeAPIsToTurboModule:(id)module; + +/** + * Convenience method for retrieving all modules conforming to a given protocol. + * Modules will be synchronously instantiated if they haven't already been, + * potentially blocking both the calling thread and main thread for a short time. + */ +- (NSArray *)modulesConformingToProtocol:(Protocol *)protocol; + +/** + * Test if a module has been initialized. Use this prior to calling + * `moduleForClass:` or `moduleForName:` if you do not want to cause the module + * to be instantiated if it hasn't been already. + */ +- (BOOL)moduleIsInitialized:(Class)moduleClass; + +/** + * All registered bridge module classes. + */ +@property (nonatomic, copy, readonly) NSArray *moduleClasses; + +/** + * URL of the script that was loaded into the bridge. + */ +@property (nonatomic, strong, readonly) NSURL *bundleURL; + +/** + * The class of the executor currently being used. Changes to this value will + * take effect after the bridge is reloaded. + */ +@property (nonatomic, strong) Class executorClass; + +/** + * The delegate provided during the bridge initialization + */ +@property (nonatomic, weak, readonly) id delegate; + +/** + * The launch options that were used to initialize the bridge. + */ +@property (nonatomic, copy, readonly) NSDictionary *launchOptions; + +/** + * Use this to check if the bridge is currently loading. + */ +@property (nonatomic, readonly, getter=isLoading) BOOL loading; + +/** + * Use this to check if the bridge has been invalidated. + */ +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +/** + * Link to the Performance Logger that logs React Native perf events. + */ +@property (nonatomic, readonly, strong) RCTPerformanceLogger *performanceLogger; + +/** + * Reload the bundle and reset executor & modules. Safe to call from any thread. + */ +- (void)reload __deprecated_msg("Use RCTReloadCommand instead"); + +/** + * Reload the bundle and reset executor & modules. Safe to call from any thread. + */ +- (void)reloadWithReason:(NSString *)reason __deprecated_msg("Use RCTReloadCommand instead"); + +/** + * Handle notifications for a fast refresh. Safe to call from any thread. + */ +- (void)onFastRefresh; + +/** + * Inform the bridge, and anything subscribing to it, that it should reload. + */ +- (void)requestReload __deprecated_msg("Use RCTReloadCommand instead"); + +/** + * Says whether bridge has started receiving calls from JavaScript. + */ +- (BOOL)isBatchActive; + +/** + * Loads and executes additional bundles in the VM for development. + */ +- (void)loadAndExecuteSplitBundleURL:(NSURL *)bundleURL + onError:(RCTLoadAndExecuteErrorBlock)onError + onComplete:(dispatch_block_t)onComplete; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeDelegate.h new file mode 100644 index 0000000..00c26f2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeDelegate.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; +@protocol RCTBridgeModule; + +@protocol RCTBridgeDelegate + +/** + * The location of the JavaScript source file. When running from the packager + * this should be an absolute URL, e.g. `http://localhost:8081/index.ios.bundle`. + * When running from a locally bundled JS file, this should be a `file://` url + * pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`. + */ +- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge; + +@optional + +/** + * The bridge initializes any registered RCTBridgeModules automatically, however + * if you wish to instantiate your own module instances, you can return them + * from this method. + * + * Note: You should always return a new instance for each call, rather than + * returning the same instance each time the bridge is reloaded. Module instances + * should not be shared between bridges, and this may cause unexpected behavior. + * + * It is also possible to override standard modules with your own implementations + * by returning a class with the same `moduleName` from this method, but this is + * not recommended in most cases - if the module methods and behavior do not + * match exactly, it may lead to bugs or crashes. + */ +- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge; + +/** + * Configure whether the JSCExecutor created should use the system JSC API or + * alternative hooks provided. When returning YES from this method, you must have + * previously called facebook::react::setCustomJSCWrapper. + * + * @experimental + */ +- (BOOL)shouldBridgeUseCustomJSC:(RCTBridge *)bridge; + +/** + * The bridge will call this method when a module been called from JS + * cannot be found among registered modules. + * It should return YES if the module with name 'moduleName' was registered + * in the implementation, and the system must attempt to look for it again among registered. + * If the module was not registered, return NO to prevent further searches. + */ +- (BOOL)bridge:(RCTBridge *)bridge didNotFindModule:(NSString *)moduleName; + +/** + * The bridge will automatically attempt to load the JS source code from the + * location specified by the `sourceURLForBridge:` method, however, if you want + * to handle loading the JS yourself, you can do so by implementing this method. + */ +- (void)loadSourceForBridge:(RCTBridge *)bridge + onProgress:(RCTSourceLoadProgressBlock)onProgress + onComplete:(RCTSourceLoadBlock)loadCallback; + +/** + * Similar to loadSourceForBridge:onProgress:onComplete: but without progress + * reporting. + */ +- (void)loadSourceForBridge:(RCTBridge *)bridge withBlock:(RCTSourceLoadBlock)loadCallback; + +/** + * Retrieve the list of lazy-native-modules names for the given bridge. + */ +- (NSDictionary *)extraLazyModuleClassesForBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeMethod.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeMethod.h new file mode 100644 index 0000000..35d2b89 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeMethod.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; + +typedef NS_ENUM(NSUInteger, RCTFunctionType) { + RCTFunctionTypeNormal, + RCTFunctionTypePromise, + RCTFunctionTypeSync, +}; + +static inline const char *RCTFunctionDescriptorFromType(RCTFunctionType type) +{ + switch (type) { + case RCTFunctionTypeNormal: + return "async"; + case RCTFunctionTypePromise: + return "promise"; + case RCTFunctionTypeSync: + return "sync"; + } +}; + +@protocol RCTBridgeMethod + +@property (nonatomic, readonly) const char *JSMethodName; +@property (nonatomic, readonly) RCTFunctionType functionType; + +- (id)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray *)arguments; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeModule.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeModule.h new file mode 100644 index 0000000..fff361a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBridgeModule.h @@ -0,0 +1,469 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import +#import + +@class RCTBridge; +@protocol RCTBridgeMethod; +@class RCTModuleRegistry; +@class RCTViewRegistry; +@class RCTBundleManager; +@class RCTCallableJSModules; + +/** + * The type of a block that is capable of sending a response to a bridged + * operation. Use this for returning callback methods to JS. + */ +typedef void (^RCTResponseSenderBlock)(NSArray *response); + +/** + * The type of a block that is capable of sending an error response to a + * bridged operation. Use this for returning error information to JS. + */ +typedef void (^RCTResponseErrorBlock)(NSError *error); + +/** + * Block that bridge modules use to resolve the JS promise waiting for a result. + * Nil results are supported and are converted to JS's undefined value. + */ +typedef void (^RCTPromiseResolveBlock)(id result); + +/** + * Block that bridge modules use to reject the JS promise waiting for a result. + * The error may be nil but it is preferable to pass an NSError object for more + * precise error messages. + */ +typedef void (^RCTPromiseRejectBlock)(NSString *code, NSString *message, NSError *error); + +RCT_EXTERN_C_BEGIN + +typedef struct RCTMethodInfo { + const char *const jsName; + const char *const objcName; + const BOOL isSync; +} RCTMethodInfo; + +RCT_EXTERN_C_END + +/** + * Provides the interface needed to register a bridge module. + */ +@protocol RCTBridgeModule + +/** + * Place this macro in your class implementation to automatically register + * your module with the bridge when it loads. The optional js_name argument + * will be used as the JS module name. If omitted, the JS module name will + * match the Objective-C class name. + */ +#define RCT_EXPORT_MODULE(js_name) \ + RCT_EXTERN void RCTRegisterModule(Class); \ + +(NSString *)moduleName \ + { \ + return @ #js_name; \ + } \ + +(void)load \ + { \ + RCTRegisterModule(self); \ + } + +/** + * Same as RCT_EXPORT_MODULE, but uses __attribute__((constructor)) for module + * registration. Useful for registering swift classes that forbids use of load + * Used in RCT_EXTERN_REMAP_MODULE + */ +#define RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) \ + RCT_EXTERN void RCTRegisterModule(Class); \ + +(NSString *)moduleName \ + { \ + return @ #js_name; \ + } \ + __attribute__((constructor)) static void RCT_CONCAT(initialize_, objc_name)() \ + { \ + RCTRegisterModule([objc_name class]); \ + } + +/** + * To improve startup performance users may want to generate their module lists + * at build time and hook the delegate to merge with the runtime list. This + * macro takes the place of the above for those cases by omitting the +load + * generation. + * + */ +#define RCT_EXPORT_PRE_REGISTERED_MODULE(js_name) \ + +(NSString *)moduleName \ + { \ + return @ #js_name; \ + } + +// Implemented by RCT_EXPORT_MODULE ++ (NSString *)moduleName; + +@optional + +/** + * A reference to the RCTModuleRegistry. Useful for modules that require access + * to other NativeModules. To implement this in your module, just add `@synthesize + * moduleRegistry = _moduleRegistry;`. If using Swift, add + * `@objc var moduleRegistry: RCTModuleRegistry!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTModuleRegistry *moduleRegistry; + +/** + * A reference to the RCTViewRegistry. Useful for modules that query UIViews, + * given a react tag. This API is deprecated, and only exists to help migrate + * NativeModules to Venice. + * + * To implement this in your module, just add `@synthesize + * viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;`. If using Swift, add + * `@objc var viewRegistry_DEPRECATED: RCTViewRegistry!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTViewRegistry *viewRegistry_DEPRECATED; + +/** + * A reference to the RCTBundleManager. Useful for modules that need to read + * or write to the app's bundle URL. + * + * To implement this in your module, just add `@synthesize bundleManager = + * _bundleManager;`. If using Swift, add `@objc var bundleManager: + * RCTBundleManager!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTBundleManager *bundleManager; + +/** + * A reference to an RCTCallableJSModules. Useful for modules that need to + * call into methods on JavaScript modules registered as callable with + * React Native. + * + * To implement this in your module, just add `@synthesize callableJSModules = + * _callableJSModules;`. If using Swift, add `@objc var callableJSModules: + * RCTCallableJSModules!` to your module. + */ +@property (nonatomic, weak, readwrite) RCTCallableJSModules *callableJSModules; + +/** + * A reference to the RCTBridge. Useful for modules that require access + * to bridge features, such as sending events or making JS calls. This + * will be set automatically by the bridge when it initializes the module. + * To implement this in your module, just add `@synthesize bridge = _bridge;` + * If using Swift, add `@objc var bridge: RCTBridge!` to your module. + */ +@property (nonatomic, weak, readonly) RCTBridge *bridge; + +/** + * The queue that will be used to call all exported methods. If omitted, this + * will call on a default background queue, which is avoids blocking the main + * thread. + * + * If the methods in your module need to interact with UIKit methods, they will + * probably need to call those on the main thread, as most of UIKit is main- + * thread-only. You can tell React Native to call your module methods on the + * main thread by returning a reference to the main queue, like this: + * + * - (dispatch_queue_t)methodQueue + * { + * return dispatch_get_main_queue(); + * } + * + * If you don't want to specify the queue yourself, but you need to use it + * inside your class (e.g. if you have internal methods that need to dispatch + * onto that queue), you can just add `@synthesize methodQueue = _methodQueue;` + * and the bridge will populate the methodQueue property for you automatically + * when it initializes the module. + */ +@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue; + +/** + * Wrap the parameter line of your method implementation with this macro to + * expose it to JS. By default the exposed method will match the first part of + * the Objective-C method selector name (up to the first colon). Use + * RCT_REMAP_METHOD to specify the JS name of the method. + * + * For example, in ModuleName.m: + * + * - (void)doSomething:(NSString *)aString withA:(NSInteger)a andB:(NSInteger)b + * { ... } + * + * becomes + * + * RCT_EXPORT_METHOD(doSomething:(NSString *)aString + * withA:(NSInteger)a + * andB:(NSInteger)b) + * { ... } + * + * and is exposed to JavaScript as `NativeModules.ModuleName.doSomething`. + * + * ## Promises + * + * Bridge modules can also define methods that are exported to JavaScript as + * methods that return a Promise, and are compatible with JS async functions. + * + * Declare the last two parameters of your native method to be a resolver block + * and a rejecter block. The resolver block must precede the rejecter block. + * + * For example: + * + * RCT_EXPORT_METHOD(doSomethingAsync:(NSString *)aString + * resolver:(RCTPromiseResolveBlock)resolve + * rejecter:(RCTPromiseRejectBlock)reject + * { ... } + * + * Calling `NativeModules.ModuleName.doSomethingAsync(aString)` from + * JavaScript will return a promise that is resolved or rejected when your + * native method implementation calls the respective block. + * + */ +#define RCT_EXPORT_METHOD(method) RCT_REMAP_METHOD(, method) + +/** + * Same as RCT_EXPORT_METHOD but the method is called from JS + * synchronously **on the JS thread**, possibly returning a result. + * + * WARNING: in the vast majority of cases, you should use RCT_EXPORT_METHOD which + * allows your native module methods to be called asynchronously: calling + * methods synchronously can have strong performance penalties and introduce + * threading-related bugs to your native modules. + * + * The return type must be of object type (id) and should be serializable + * to JSON. This means that the hook can only return nil or JSON values + * (e.g. NSNumber, NSString, NSArray, NSDictionary). + * + * Calling these methods when running under the websocket executor + * is currently not supported. + */ +#define RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(method) RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(id, method) + +#define RCT_EXPORT_SYNCHRONOUS_TYPED_METHOD(returnType, method) \ + RCT_REMAP_BLOCKING_SYNCHRONOUS_METHOD(, returnType, method) + +/** + * Similar to RCT_EXPORT_METHOD but lets you set the JS name of the exported + * method. Example usage: + * + * RCT_REMAP_METHOD(executeQueryWithParameters, + * executeQuery:(NSString *)query parameters:(NSDictionary *)parameters) + * { ... } + */ +#define RCT_REMAP_METHOD(js_name, method) \ + _RCT_EXTERN_REMAP_METHOD(js_name, method, NO) \ + -(void)method RCT_DYNAMIC; + +/** + * Similar to RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD but lets you set + * the JS name of the exported method. Example usage: + * + * RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(executeQueryWithParameters, + * executeQuery:(NSString *)query parameters:(NSDictionary *)parameters) + * { ... } + */ +#define RCT_REMAP_BLOCKING_SYNCHRONOUS_METHOD(js_name, returnType, method) \ + _RCT_EXTERN_REMAP_METHOD(js_name, method, YES) \ + -(returnType)method RCT_DYNAMIC; + +/** + * Use this macro in a private Objective-C implementation file to automatically + * register an external module with the bridge when it loads. This allows you to + * register Swift or private Objective-C classes with the bridge. + * + * For example if one wanted to export a Swift class to the bridge: + * + * MyModule.swift: + * + * @objc(MyModule) class MyModule: NSObject { + * + * @objc func doSomething(string: String! withFoo a: Int, bar b: Int) { ... } + * + * } + * + * MyModuleExport.m: + * + * #import + * + * @interface RCT_EXTERN_MODULE(MyModule, NSObject) + * + * RCT_EXTERN_METHOD(doSomething:(NSString *)string withFoo:(NSInteger)a bar:(NSInteger)b) + * + * @end + * + * This will now expose MyModule and the method to JavaScript via + * `NativeModules.MyModule.doSomething` + */ +#define RCT_EXTERN_MODULE(objc_name, objc_supername) RCT_EXTERN_REMAP_MODULE(, objc_name, objc_supername) + +/** + * Like RCT_EXTERN_MODULE, but allows setting a custom JavaScript name. + */ +#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \ + objc_name: \ + objc_supername @ \ + end @interface objc_name(RCTExternModule) \ + @end \ + @implementation objc_name (RCTExternModule) \ + RCT_EXPORT_MODULE_NO_LOAD(js_name, objc_name) + +/** + * Use this macro in accordance with RCT_EXTERN_MODULE to export methods + * of an external module. + */ +#define RCT_EXTERN_METHOD(method) _RCT_EXTERN_REMAP_METHOD(, method, NO) + +/** + * Use this macro in accordance with RCT_EXTERN_MODULE to export methods + * of an external module that should be invoked synchronously. + */ +#define RCT_EXTERN__BLOCKING_SYNCHRONOUS_METHOD(method) _RCT_EXTERN_REMAP_METHOD(, method, YES) + +/** + * Like RCT_EXTERN_REMAP_METHOD, but allows setting a custom JavaScript name + * and also whether this method is synchronous. + */ +#define _RCT_EXTERN_REMAP_METHOD(js_name, method, is_blocking_synchronous_method) \ + +(const RCTMethodInfo *)RCT_CONCAT(__rct_export__, RCT_CONCAT(js_name, RCT_CONCAT(__LINE__, __COUNTER__))) \ + { \ + static RCTMethodInfo config = {#js_name, #method, is_blocking_synchronous_method}; \ + return &config; \ + } + +/** + * Most modules can be used from any thread. All of the modules exported non-sync method will be called on its + * methodQueue, and the module will be constructed lazily when its first invoked. Some modules have main need to access + * information that's main queue only (e.g. most UIKit classes). Since we don't want to dispatch synchronously to the + * main thread to this safely, we construct these modules and export their constants ahead-of-time. + * + * Note that when set to false, the module constructor will be called from any thread. + * + * This requirement is currently inferred by checking if the module has a custom initializer or if there's exported + * constants. In the future, we'll stop automatically inferring this and instead only rely on this method. + */ ++ (BOOL)requiresMainQueueSetup; + +/** + * Injects methods into JS. Entries in this array are used in addition to any + * methods defined using the macros above. This method is called only once, + * before registration. + */ +- (NSArray> *)methodsToExport; + +/** + * Injects constants into JS. These constants are made accessible via NativeModules.ModuleName.X. It is only called once + * for the lifetime of the bridge, so it is not suitable for returning dynamic values, but may be used for long-lived + * values such as session keys, that are regenerated only as part of a reload of the entire React application. + * + * If you implement this method and do not implement `requiresMainQueueSetup`, you will trigger deprecated logic + * that eagerly initializes your module on bridge startup. In the future, this behaviour will be changed to default + * to initializing lazily, and even modules with constants will be initialized lazily. + */ +- (NSDictionary *)constantsToExport; + +/** + * Notifies the module that a batch of JS method invocations has just completed. + */ +- (void)batchDidComplete; + +/** + * Notifies the module that the active batch of JS method invocations has been + * partially flushed. + * + * This occurs before -batchDidComplete, and more frequently. + */ +- (void)partialBatchDidFlush; + +@end + +/** + * A protocol that allows TurboModules to do lookup on other TurboModules. + * Calling these methods may cause a module to be synchronously instantiated. + */ +@protocol RCTTurboModuleRegistry +- (id)moduleForName:(const char *)moduleName; + +/** + * Rationale: + * When TurboModules lookup other modules by name, we first check the TurboModule + * registry to see if a TurboModule exists with the respective name. In this case, + * we don't want a RedBox to be raised if the TurboModule isn't found. + * + * This method is deprecated and will be deleted after the migration from + * TurboModules to TurboModules is complete. + */ +- (id)moduleForName:(const char *)moduleName warnOnLookupFailure:(BOOL)warnOnLookupFailure; +- (BOOL)moduleIsInitialized:(const char *)moduleName; + +- (NSArray *)eagerInitModuleNames; +- (NSArray *)eagerInitMainQueueModuleNames; +@end + +/** + * Experimental. + * A protocol to declare that a class supports TurboModule. + * This may be removed in the future. + * See RCTTurboModule.h for actual signature. + */ +@protocol RCTTurboModule; + +/** + * A class that allows NativeModules and TurboModules to look up one another. + */ +@interface RCTModuleRegistry : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setTurboModuleRegistry:(id)turboModuleRegistry; + +- (id)moduleForName:(const char *)moduleName; +- (id)moduleForName:(const char *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad; +@end + +typedef void (^RCTBridgelessBundleURLSetter)(NSURL *bundleURL); +typedef NSURL * (^RCTBridgelessBundleURLGetter)(void); + +/** + * A class that allows NativeModules/TurboModules to read/write the bundleURL, with or without the bridge. + */ +@interface RCTBundleManager : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setBridgelessBundleURLGetter:(RCTBridgelessBundleURLGetter)getter + andSetter:(RCTBridgelessBundleURLSetter)setter + andDefaultGetter:(RCTBridgelessBundleURLGetter)defaultGetter; +- (void)resetBundleURL; +@property NSURL *bundleURL; +@end + +typedef UIView * (^RCTBridgelessComponentViewProvider)(NSNumber *); + +/** + * A class that allows NativeModules to query for views, given React Tags. + */ +@interface RCTViewRegistry : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setBridgelessComponentViewProvider:(RCTBridgelessComponentViewProvider)bridgelessComponentViewProvider; + +- (UIView *)viewForReactTag:(NSNumber *)reactTag; +@end + +typedef void (^RCTBridgelessJSModuleMethodInvoker)( + NSString *moduleName, + NSString *methodName, + NSArray *args, + dispatch_block_t onComplete); + +/** + * A class that allows NativeModules to call methods on JavaScript modules registered + * as callable with React Native. + */ +@interface RCTCallableJSModules : NSObject +- (void)setBridge:(RCTBridge *)bridge; +- (void)setBridgelessJSModuleMethodInvoker:(RCTBridgelessJSModuleMethodInvoker)bridgelessJSModuleMethodInvoker; + +- (void)invokeModule:(NSString *)moduleName method:(NSString *)methodName withArgs:(NSArray *)args; +- (void)invokeModule:(NSString *)moduleName + method:(NSString *)methodName + withArgs:(NSArray *)args + onComplete:(dispatch_block_t)onComplete; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBundleURLProvider.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBundleURLProvider.h new file mode 100644 index 0000000..26fbbd0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTBundleURLProvider.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTDefines.h" + +RCT_EXTERN NSString *const RCTBundleURLProviderUpdatedNotification; +RCT_EXTERN const NSUInteger kRCTBundleURLProviderDefaultPort; + +#if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY +/** + * Allow/disallow accessing the packager server for various runtime scenario. + * For instance, if a test run should never access the packager, disable it + * by calling this function before initializing React Native (RCTBridge etc). + * By default the access is enabled. + */ +RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); +#endif + +@interface RCTBundleURLProvider : NSObject + +/** + * Set default settings on NSUserDefaults. + */ +- (void)setDefaults; + +/** + * Reset every settings to default. + */ +- (void)resetToDefaults; + +/** + * Return the server host. If its a development build and there's no jsLocation defined, + * it will return the server host IP address + */ +- (NSString *)packagerServerHost; + +/** + * Return the server host with optional port. If its a development build and there's no jsLocation defined, + * it will return the server host IP address + */ +- (NSString *)packagerServerHostPort; + +/** + * Returns if there's a packager running at the given host port. + * The port is optional, if not specified, kRCTBundleURLProviderDefaultPort will be used + */ ++ (BOOL)isPackagerRunning:(NSString *)hostPort; + +/** + * Returns if there's a packager running at the given scheme://host:port. + * The port is optional, if not specified, kRCTBundleURLProviderDefaultPort will be used + * The scheme is also optional, if not specified, a default http protocol will be used + */ ++ (BOOL)isPackagerRunning:(NSString *)hostPort scheme:(NSString *)scheme; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle if the packager is not running. + */ +- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackURLProvider:(NSURL * (^)(void))fallbackURLProvider; + +/** + * Returns the jsBundleURL for a given split bundle entrypoint in development + */ +- (NSURL *)jsBundleURLForSplitBundleRoot:(NSString *)bundleRoot; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle if the packager is not running. + * if resourceName or extension are nil, "main" and "jsbundle" will be + * used, respectively. + */ +- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + fallbackResource:(NSString *)resourceName + fallbackExtension:(NSString *)extension; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle if the packager is not running. + */ +- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackResource:(NSString *)resourceName; + +/** + * Returns the jsBundleURL for a given bundle entrypoint and + * the fallback offline JS bundle. If resourceName or extension + * are nil, "main" and "jsbundle" will be used, respectively. + */ +- (NSURL *)jsBundleURLForFallbackResource:(NSString *)resourceName fallbackExtension:(NSString *)extension; + +/** + * Returns the resourceURL for a given bundle entrypoint and + * the fallback offline resource file if the packager is not running. + */ +- (NSURL *)resourceURLForResourceRoot:(NSString *)root + resourceName:(NSString *)name + resourceExtension:(NSString *)extension + offlineBundle:(NSBundle *)offlineBundle; + +/** + * The IP address or hostname of the packager. + */ +@property (nonatomic, copy) NSString *jsLocation; + +@property (nonatomic, assign) BOOL enableMinification; +@property (nonatomic, assign) BOOL enableDev; + +/** + * The scheme/protocol used of the packager, the default is the http protocol + */ +@property (nonatomic, copy) NSString *packagerScheme; + ++ (instancetype)sharedSettings; + +/** + * Given a hostname for the packager and a bundle root, returns the URL to the js bundle. Generally you should use the + * instance method -jsBundleURLForBundleRoot:fallbackResource: which includes logic to guess if the packager is running + * and fall back to a pre-packaged bundle if it is not. + * + * The options here mirror some of Metro's Bundling Options: + * - enableDev: Whether to keep or remove `__DEV__` blocks from the bundle. + * - enableMinification: Enables or disables minification. Usually production bundles are minified and development + * bundles are not. + * - modulesOnly: When true, will only send module definitions without polyfills and without the require-runtime. + * - runModule: When true, will run the main module after defining all modules. This is used in the main bundle but not + * in split bundles. + */ ++ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerHost:(NSString *)packagerHost + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification; + ++ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerHost:(NSString *)packagerHost + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification + modulesOnly:(BOOL)modulesOnly + runModule:(BOOL)runModule; + ++ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot + packagerHost:(NSString *)packagerHost + packagerScheme:(NSString *)scheme + enableDev:(BOOL)enableDev + enableMinification:(BOOL)enableMinification + modulesOnly:(BOOL)modulesOnly + runModule:(BOOL)runModule; +/** + * Given a hostname for the packager and a resource path (including "/"), return the URL to the resource. + * In general, please use the instance method to decide if the packager is running and fallback to the pre-packaged + * resource if it is not: -resourceURLForResourceRoot:resourceName:resourceExtension:offlineBundle: + */ ++ (NSURL *)resourceURLForResourcePath:(NSString *)path packagerHost:(NSString *)packagerHost query:(NSString *)query; + ++ (NSURL *)resourceURLForResourcePath:(NSString *)path + packagerHost:(NSString *)packagerHost + scheme:(NSString *)scheme + query:(NSString *)query; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTClipboard.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTClipboard.h new file mode 100644 index 0000000..1dd9789 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTClipboard.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTClipboard : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponent.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponent.h new file mode 100644 index 0000000..4258334 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponent.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * These block types can be used for mapping input event handlers from JS to view + * properties. Unlike JS method callbacks, these can be called multiple times. + */ +typedef void (^RCTDirectEventBlock)(NSDictionary *body); +typedef void (^RCTBubblingEventBlock)(NSDictionary *body); + +/** + * Logical node in a tree of application components. Both `ShadowView` and + * `UIView` conforms to this. Allows us to write utilities that reason about + * trees generally. + */ +@protocol RCTComponent + +@property (nonatomic, copy) NSNumber *reactTag; +@property (nonatomic, copy) NSNumber *rootTag; + +- (void)insertReactSubview:(id)subview atIndex:(NSInteger)atIndex; +- (void)removeReactSubview:(id)subview; +- (NSArray> *)reactSubviews; +- (id)reactSuperview; +- (NSNumber *)reactTagAtPoint:(CGPoint)point; + +// View/ShadowView is a root view +- (BOOL)isReactRootView; + +/** + * Called each time props have been set. + * Not all props have to be set - React can set only changed ones. + * @param changedProps String names of all set props. + */ +- (void)didSetProps:(NSArray *)changedProps; + +/** + * Called each time subviews have been updated + */ +- (void)didUpdateReactSubviews; + +@end + +// TODO: this is kinda dumb - let's come up with a +// better way of identifying root React views please! +static inline BOOL RCTIsReactRootView(NSNumber *reactTag) +{ + return reactTag.integerValue % 10 == 1; +} diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponentData.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponentData.h new file mode 100644 index 0000000..6a1fdb7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponentData.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; +@class RCTShadowView; +@class UIView; +@class RCTEventDispatcherProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTComponentData : NSObject + +@property (nonatomic, readonly) Class managerClass; +@property (nonatomic, copy, readonly) NSString *name; +@property (nonatomic, weak, readonly) RCTViewManager *manager; +/* + * When running React Native with the bridge, view managers are retained by the + * bridge. When running in bridgeless mode, allocate and retain view managers + * in this class. + */ +@property (nonatomic, strong, readonly) RCTViewManager *bridgelessViewManager; + +- (instancetype)initWithManagerClass:(Class)managerClass + bridge:(RCTBridge *)bridge + eventDispatcher:(id)eventDispatcher NS_DESIGNATED_INITIALIZER; + +- (UIView *)createViewWithTag:(nullable NSNumber *)tag rootTag:(nullable NSNumber *)rootTag; +- (RCTShadowView *)createShadowViewWithTag:(NSNumber *)tag; +- (void)setProps:(NSDictionary *)props forView:(id)view; +- (void)setProps:(NSDictionary *)props forShadowView:(RCTShadowView *)shadowView; + +@property (nonatomic, copy, nullable) void (^eventInterceptor) + (NSString *eventName, NSDictionary *event, NSNumber *reactTag); + +- (NSDictionary *)viewConfig; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponentEvent.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponentEvent.h new file mode 100644 index 0000000..0467f8c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTComponentEvent.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Generic untyped event for Components. Used internally by RCTDirectEventBlock and + * RCTBubblingEventBlock, for other use cases prefer using a class that implements + * RCTEvent to have a type safe way to initialize it. + */ +@interface RCTComponentEvent : NSObject + +- (instancetype)initWithName:(NSString *)name viewTag:(NSNumber *)viewTag body:(NSDictionary *)body; + +NS_ASSUME_NONNULL_END + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConstants.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConstants.h new file mode 100644 index 0000000..c92fc10 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConstants.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotification; +RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey; + +/* + * Preemptive View Allocation + */ +RCT_EXTERN BOOL RCTExperimentGetPreemptiveViewAllocationDisabled(void); +RCT_EXTERN void RCTExperimentSetPreemptiveViewAllocationDisabled(BOOL value); + +/* + * Remove clipped subviews + */ +RCT_EXTERN BOOL RCTGetRemoveClippedSubviewsEnabled(void); +RCT_EXTERN void RCTSetRemoveClippedSubviewsEnabled(BOOL value); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+CoreLocation.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+CoreLocation.h new file mode 100644 index 0000000..251202f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+CoreLocation.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTConvert (CoreLocation) + ++ (CLLocationDegrees)CLLocationDegrees:(id)json; ++ (CLLocationDistance)CLLocationDistance:(id)json; ++ (CLLocationCoordinate2D)CLLocationCoordinate2D:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+Text.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+Text.h new file mode 100644 index 0000000..eafbdb3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+Text.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTConvert (Text) + ++ (UITextAutocorrectionType)UITextAutocorrectionType:(nullable id)json; ++ (UITextSpellCheckingType)UITextSpellCheckingType:(nullable id)json; ++ (RCTTextTransform)RCTTextTransform:(nullable id)json; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+Transform.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+Transform.h new file mode 100644 index 0000000..07a7b2c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert+Transform.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTConvert.h" + +@interface RCTConvert (Transform) + ++ (CATransform3D)CATransform3D:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert.h new file mode 100644 index 0000000..09a380e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTConvert.h @@ -0,0 +1,263 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#if TARGET_OS_IPHONE +#import +#endif + +/** + * This class provides a collection of conversion functions for mapping + * JSON objects to native types and classes. These are useful when writing + * custom RCTViewManager setter methods. + */ +@interface RCTConvert : NSObject + ++ (id)id:(id)json; + ++ (BOOL)BOOL:(id)json; ++ (double)double:(id)json; ++ (float)float:(id)json; ++ (int)int:(id)json; + ++ (int64_t)int64_t:(id)json; ++ (uint64_t)uint64_t:(id)json; + ++ (NSInteger)NSInteger:(id)json; ++ (NSUInteger)NSUInteger:(id)json; + ++ (NSArray *)NSArray:(id)json; ++ (NSDictionary *)NSDictionary:(id)json; ++ (NSString *)NSString:(id)json; ++ (NSNumber *)NSNumber:(id)json; + ++ (NSSet *)NSSet:(id)json; ++ (NSData *)NSData:(id)json; ++ (NSIndexSet *)NSIndexSet:(id)json; + ++ (NSURLRequestCachePolicy)NSURLRequestCachePolicy:(id)json; ++ (NSURL *)NSURL:(id)json; ++ (NSURLRequest *)NSURLRequest:(id)json; + +typedef NSURL RCTFileURL; ++ (RCTFileURL *)RCTFileURL:(id)json; + ++ (NSDate *)NSDate:(id)json; ++ (NSLocale *)NSLocale:(id)json; ++ (NSTimeZone *)NSTimeZone:(id)json; ++ (NSTimeInterval)NSTimeInterval:(id)json; + ++ (NSLineBreakMode)NSLineBreakMode:(id)json; ++ (NSTextAlignment)NSTextAlignment:(id)json; ++ (NSUnderlineStyle)NSUnderlineStyle:(id)json; ++ (NSWritingDirection)NSWritingDirection:(id)json; ++ (UITextAutocapitalizationType)UITextAutocapitalizationType:(id)json; ++ (UITextFieldViewMode)UITextFieldViewMode:(id)json; ++ (UIKeyboardType)UIKeyboardType:(id)json; ++ (UIKeyboardAppearance)UIKeyboardAppearance:(id)json; ++ (UIReturnKeyType)UIReturnKeyType:(id)json; +#if !TARGET_OS_TV ++ (UIDataDetectorTypes)UIDataDetectorTypes:(id)json; +#endif + +#if TARGET_OS_IPHONE ++ (WKDataDetectorTypes)WKDataDetectorTypes:(id)json; +#endif + ++ (UIViewContentMode)UIViewContentMode:(id)json; +#if !TARGET_OS_TV ++ (UIBarStyle)UIBarStyle:(id)json; +#endif + ++ (CGFloat)CGFloat:(id)json; ++ (CGPoint)CGPoint:(id)json; ++ (CGSize)CGSize:(id)json; ++ (CGRect)CGRect:(id)json; ++ (UIEdgeInsets)UIEdgeInsets:(id)json; + ++ (CGLineCap)CGLineCap:(id)json; ++ (CGLineJoin)CGLineJoin:(id)json; + ++ (CGAffineTransform)CGAffineTransform:(id)json; + ++ (UIColor *)UIColor:(id)json; ++ (CGColorRef)CGColor:(id)json CF_RETURNS_NOT_RETAINED; + ++ (YGValue)YGValue:(id)json; + ++ (NSArray *)NSArrayArray:(id)json; ++ (NSArray *)NSStringArray:(id)json; ++ (NSArray *> *)NSStringArrayArray:(id)json; ++ (NSArray *)NSDictionaryArray:(id)json; ++ (NSArray *)NSURLArray:(id)json; ++ (NSArray *)RCTFileURLArray:(id)json; ++ (NSArray *)NSNumberArray:(id)json; ++ (NSArray *)UIColorArray:(id)json; + +typedef NSArray CGColorArray; ++ (CGColorArray *)CGColorArray:(id)json; + +/** + * Convert a JSON object to a Plist-safe equivalent by stripping null values. + */ +typedef id NSPropertyList; ++ (NSPropertyList)NSPropertyList:(id)json; + +typedef BOOL css_backface_visibility_t; ++ (YGOverflow)YGOverflow:(id)json; ++ (YGDisplay)YGDisplay:(id)json; ++ (css_backface_visibility_t)css_backface_visibility_t:(id)json; ++ (YGFlexDirection)YGFlexDirection:(id)json; ++ (YGJustify)YGJustify:(id)json; ++ (YGAlign)YGAlign:(id)json; ++ (YGPositionType)YGPositionType:(id)json; ++ (YGWrap)YGWrap:(id)json; ++ (YGDirection)YGDirection:(id)json; + ++ (RCTPointerEvents)RCTPointerEvents:(id)json; ++ (RCTAnimationType)RCTAnimationType:(id)json; ++ (RCTBorderStyle)RCTBorderStyle:(id)json; ++ (RCTTextDecorationLineType)RCTTextDecorationLineType:(id)json; + +@end + +@interface RCTConvert (Deprecated) + +/** + * Use lightweight generics syntax instead, e.g. NSArray + */ +typedef NSArray NSArrayArray __deprecated_msg("Use NSArray"); +typedef NSArray NSStringArray __deprecated_msg("Use NSArray"); +typedef NSArray NSStringArrayArray __deprecated_msg("Use NSArray *>"); +typedef NSArray NSDictionaryArray __deprecated_msg("Use NSArray"); +typedef NSArray NSURLArray __deprecated_msg("Use NSArray"); +typedef NSArray RCTFileURLArray __deprecated_msg("Use NSArray"); +typedef NSArray NSNumberArray __deprecated_msg("Use NSArray"); +typedef NSArray UIColorArray __deprecated_msg("Use NSArray"); + +/** + * Synchronous image loading is generally a bad idea for performance reasons. + * If you need to pass image references, try to use `RCTImageSource` and then + * `RCTImageLoader` instead of converting directly to a UIImage. + */ ++ (UIImage *)UIImage:(id)json; ++ (CGImageRef)CGImage:(id)json CF_RETURNS_NOT_RETAINED; + +@end + +/** + * Underlying implementations of RCT_XXX_CONVERTER macros. Ignore these. + */ +RCT_EXTERN NSNumber *RCTConvertEnumValue(const char *, NSDictionary *, NSNumber *, id); +RCT_EXTERN NSNumber *RCTConvertMultiEnumValue(const char *, NSDictionary *, NSNumber *, id); +RCT_EXTERN NSArray *RCTConvertArrayValue(SEL, id); + +/** + * This macro is used for logging conversion errors. This is just used to + * avoid repeating the same boilerplate for every error message. + */ +#define RCTLogConvertError(json, typeName) \ + RCTLogError(@"JSON value '%@' of type %@ cannot be converted to %@", json, [json classForCoder], typeName) + +/** + * This macro is used for creating simple converter functions that just call + * the specified getter method on the json value. + */ +#define RCT_CONVERTER(type, name, getter) RCT_CUSTOM_CONVERTER(type, name, [json getter]) + +/** + * This macro is used for creating converter functions with arbitrary logic. + */ +#define RCT_CUSTOM_CONVERTER(type, name, code) \ + +(type)name : (id)json RCT_DYNAMIC \ + { \ + if (!RCT_DEBUG) { \ + return code; \ + } else { \ + @try { \ + return code; \ + } @catch (__unused NSException * e) { \ + RCTLogConvertError(json, @ #type); \ + json = nil; \ + return code; \ + } \ + } \ + } + +/** + * This macro is similar to RCT_CONVERTER, but specifically geared towards + * numeric types. It will handle string input correctly, and provides more + * detailed error reporting if an invalid value is passed in. + */ +#define RCT_NUMBER_CONVERTER(type, getter) \ + RCT_CUSTOM_CONVERTER(type, type, [RCT_DEBUG ? [self NSNumber:json] : json getter]) + +/** + * When using RCT_ENUM_CONVERTER in ObjC, the compiler is OK with us returning + * the underlying NSInteger/NSUInteger. In ObjC++, this is a type mismatch and + * we need to explicitly cast the return value to expected enum return type. + */ +#ifdef __cplusplus +#define _RCT_CAST(type, expr) static_cast(expr) +#else +#define _RCT_CAST(type, expr) expr +#endif + +/** + * This macro is used for creating converters for enum types. + */ +#define RCT_ENUM_CONVERTER(type, values, default, getter) \ + +(type)type : (id)json RCT_DYNAMIC \ + { \ + static NSDictionary *mapping; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ + return _RCT_CAST(type, [RCTConvertEnumValue(#type, mapping, @(default), json) getter]); \ + } + +/** + * This macro is used for creating converters for enum types for + * multiple enum values combined with | operator + */ +#define RCT_MULTI_ENUM_CONVERTER(type, values, default, getter) \ + +(type)type : (id)json RCT_DYNAMIC \ + { \ + static NSDictionary *mapping; \ + static dispatch_once_t onceToken; \ + dispatch_once(&onceToken, ^{ \ + mapping = values; \ + }); \ + return _RCT_CAST(type, [RCTConvertMultiEnumValue(#type, mapping, @(default), json) getter]); \ + } + +/** + * This macro is used for creating explicitly-named converter functions + * for typed arrays. + */ +#define RCT_ARRAY_CONVERTER_NAMED(type, name) \ + +(NSArray *)name##Array : (id)json RCT_DYNAMIC \ + { \ + return RCTConvertArrayValue(@selector(name:), json); \ + } + +/** + * This macro is used for creating converter functions for typed arrays. + * RCT_ARRAY_CONVERTER_NAMED may be used when type contains characters + * which are disallowed in selector names. + */ +#define RCT_ARRAY_CONVERTER(type) RCT_ARRAY_CONVERTER_NAMED(type, type) diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTCxxConvert.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTCxxConvert.h new file mode 100644 index 0000000..261e61f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTCxxConvert.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * This class provides a collection of conversion functions for mapping + * JSON objects to cxx types. Extensible via categories. + * Convert methods are expected to return cxx objects wrapped in RCTManagedPointer. + */ + +@interface RCTCxxConvert : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDataRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDataRequestHandler.h new file mode 100644 index 0000000..f0b2c68 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDataRequestHandler.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * This is the default RCTURLRequestHandler implementation for data URL requests. + */ +@interface RCTDataRequestHandler : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDatePicker.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDatePicker.h new file mode 100644 index 0000000..14f9a2e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDatePicker.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTDatePicker : UIDatePicker + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDatePickerManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDatePickerManager.h new file mode 100644 index 0000000..bd14cd3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDatePickerManager.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTConvert (UIDatePicker) + ++ (UIDatePickerMode)UIDatePickerMode:(id)json; + +@end + +@interface RCTDatePickerManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDecayAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDecayAnimation.h new file mode 100644 index 0000000..e68450e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDecayAnimation.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimationDriver.h" + +@interface RCTDecayAnimation : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDefines.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDefines.h new file mode 100644 index 0000000..4b9517e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDefines.h @@ -0,0 +1,163 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __OBJC__ +#import +#endif + +/** + * Make global functions usable in C++ + */ +#if defined(__cplusplus) +#define RCT_EXTERN extern "C" __attribute__((visibility("default"))) +#define RCT_EXTERN_C_BEGIN extern "C" { +#define RCT_EXTERN_C_END } +#else +#define RCT_EXTERN extern __attribute__((visibility("default"))) +#define RCT_EXTERN_C_BEGIN +#define RCT_EXTERN_C_END +#endif + +/** + * The RCT_DEBUG macro can be used to exclude error checking and logging code + * from release builds to improve performance and reduce binary size. + */ +#ifndef RCT_DEBUG +#if DEBUG +#define RCT_DEBUG 1 +#else +#define RCT_DEBUG 0 +#endif +#endif + +/** + * The RCT_DEV macro can be used to enable or disable development tools + * such as the debug executors, dev menu, red box, etc. + */ +#ifndef RCT_DEV +#if DEBUG +#define RCT_DEV 1 +#else +#define RCT_DEV 0 +#endif +#endif + +/** + * RCT_DEV_MENU can be used to toggle the dev menu separately from RCT_DEV. + * By default though, it will inherit from RCT_DEV. + */ +#ifndef RCT_DEV_MENU +#define RCT_DEV_MENU RCT_DEV +#endif + +/** + * Controls for the core packgaer loading functionality + * By default, this inherits from RCT_DEV_MENU but it also gives the capability to + * enable the packager functionality without the rest of the dev tools from RCT_DEV_MENU + */ +#ifndef RCT_ENABLE_LOADING_FROM_PACKAGER +#define RCT_ENABLE_LOADING_FROM_PACKAGER RCT_DEV_MENU +#endif + +#ifndef RCT_ENABLE_INSPECTOR +#if RCT_DEV && __has_include() +#define RCT_ENABLE_INSPECTOR 1 +#else +#define RCT_ENABLE_INSPECTOR 0 +#endif +#endif + +#ifndef RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION +#if RCT_DEV && (__has_include("RCTPackagerConnection.h") || __has_include()) +#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 1 +#else +#define RCT_DEV_SETTINGS_ENABLE_PACKAGER_CONNECTION 0 +#endif +#endif + +#if RCT_DEV +#define RCT_IF_DEV(...) __VA_ARGS__ +#else +#define RCT_IF_DEV(...) +#endif + +#ifndef RCT_PROFILE +#define RCT_PROFILE RCT_DEV +#endif + +/** + * Add the default Metro packager port number + */ +#ifndef RCT_METRO_PORT +#define RCT_METRO_PORT 8081 +#else +// test if RCT_METRO_PORT is empty +#define RCT_METRO_PORT_DO_EXPAND(VAL) VAL##1 +#define RCT_METRO_PORT_EXPAND(VAL) RCT_METRO_PORT_DO_EXPAND(VAL) +#if !defined(RCT_METRO_PORT) || (RCT_METRO_PORT_EXPAND(RCT_METRO_PORT) == 1) +// Only here if RCT_METRO_PORT is not defined +// OR RCT_METRO_PORT is the empty string +#undef RCT_METRO_PORT +#define RCT_METRO_PORT 8081 +#endif +#endif + +/** + * Add the default packager name + */ +#ifndef RCT_PACKAGER_NAME +#define RCT_PACKAGER_NAME @"Metro" +#endif + +/** + * By default, only raise an NSAssertion in debug mode + * (custom assert functions will still be called). + */ +#ifndef RCT_NSASSERT +#define RCT_NSASSERT RCT_DEBUG +#endif + +/** + * Concat two literals. Supports macro expansions, + * e.g. RCT_CONCAT(foo, __FILE__). + */ +#define RCT_CONCAT2(A, B) A##B +#define RCT_CONCAT(A, B) RCT_CONCAT2(A, B) + +/** + * This attribute is used for static analysis. + */ +#if !defined RCT_DYNAMIC +#if __has_attribute(objc_dynamic) +#define RCT_DYNAMIC __attribute__((objc_dynamic)) +#else +#define RCT_DYNAMIC +#endif +#endif + +/** + * Throw an assertion for unimplemented methods. + */ +#define RCT_NOT_IMPLEMENTED(method) \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wmissing-method-return-type\"") \ + _Pragma("clang diagnostic ignored \"-Wunused-parameter\"") \ + RCT_EXTERN NSException *_RCTNotImplementedException(SEL, Class); \ + method NS_UNAVAILABLE \ + { \ + @throw _RCTNotImplementedException(_cmd, [self class]); \ + } \ + _Pragma("clang diagnostic pop") + +/** + * Controls for activating the new architecture without the legacy system. + * Note: this is work in progress. + */ +#ifdef REACT_NATIVE_FORCE_NEW_ARCHITECTURE +#define RCT_NEW_ARCHITECTURE 1 +#else +#define RCT_NEW_ARCHITECTURE 0 +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingView.h new file mode 100644 index 0000000..da5ad2d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingView.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTDevLoadingView : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingViewProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingViewProtocol.h new file mode 100644 index 0000000..001a18e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingViewProtocol.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTLoadingProgress; + +@protocol RCTDevLoadingViewProtocol ++ (void)setEnabled:(BOOL)enabled; +- (void)showMessage:(NSString *)message color:(UIColor *)color backgroundColor:(UIColor *)backgroundColor; +- (void)showWithURL:(NSURL *)URL; +- (void)updateProgress:(RCTLoadingProgress *)progress; +- (void)hide; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingViewSetEnabled.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingViewSetEnabled.h new file mode 100644 index 0000000..1ad1825 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevLoadingViewSetEnabled.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +RCT_EXTERN void RCTDevLoadingViewSetEnabled(BOOL enabled); +RCT_EXTERN BOOL RCTDevLoadingViewGetEnabled(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevMenu.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevMenu.h new file mode 100644 index 0000000..b322afb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevMenu.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +#if RCT_DEV_MENU + +RCT_EXTERN NSString *const RCTShowDevMenuNotification; + +#endif + +@class RCTDevMenuItem; + +/** + * Developer menu, useful for exposing extra functionality when debugging. + */ +@interface RCTDevMenu : NSObject + +/** + * Deprecated, use RCTDevSettings instead. + */ +@property (nonatomic, assign) BOOL shakeToShow DEPRECATED_ATTRIBUTE; + +/** + * Deprecated, use RCTDevSettings instead. + */ +@property (nonatomic, assign) BOOL profilingEnabled DEPRECATED_ATTRIBUTE; + +/** + * Deprecated, use RCTDevSettings instead. + */ +@property (nonatomic, assign) BOOL hotLoadingEnabled DEPRECATED_ATTRIBUTE; + +/** + * Presented items in development menu + */ +@property (nonatomic, copy, readonly) NSArray *presentedItems; + +/** + * Detect if actions sheet (development menu) is shown + */ +- (BOOL)isActionSheetShown; + +/** + * Manually show the dev menu (can be called from JS). + */ +- (void)show; + +/** + * Deprecated, use `RCTReloadCommand` instead. + */ +- (void)reload DEPRECATED_ATTRIBUTE; + +/** + * Deprecated. Use the `-addItem:` method instead. + */ +- (void)addItem:(NSString *)title handler:(void (^)(void))handler DEPRECATED_ATTRIBUTE; + +/** + * Add custom item to the development menu. The handler will be called + * when user selects the item. + */ +- (void)addItem:(RCTDevMenuItem *)item; + +@end + +typedef NSString * (^RCTDevMenuItemTitleBlock)(void); + +/** + * Developer menu item, used to expose additional functionality via the menu. + */ +@interface RCTDevMenuItem : NSObject + +/** + * This creates an item with a simple push-button interface, used to trigger an + * action. + */ ++ (instancetype)buttonItemWithTitle:(NSString *)title handler:(dispatch_block_t)handler; + +/** + * This creates an item with a simple push-button interface, used to trigger an + * action. getTitleForPresentation is called each time the item is about to be + * presented, and should return the item's title. + */ ++ (instancetype)buttonItemWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock handler:(dispatch_block_t)handler; + +@end + +/** + * This category makes the developer menu instance available via the + * RCTBridge, which is useful for any class that needs to access the menu. + */ +@interface RCTBridge (RCTDevMenu) + +@property (nonatomic, readonly) RCTDevMenu *devMenu; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevSettings.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevSettings.h new file mode 100644 index 0000000..9661caf --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevSettings.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import + +@protocol RCTPackagerClientMethod; + +/** + * An abstraction for a key-value store to manage RCTDevSettings behavior. + * The default implementation persists settings using NSUserDefaults. + */ +@protocol RCTDevSettingsDataSource + +/** + * Updates the setting with the given key to the given value. + * How the data source's state changes depends on the implementation. + */ +- (void)updateSettingWithValue:(id)value forKey:(NSString *)key; + +/** + * Returns the value for the setting with the given key. + */ +- (id)settingForKey:(NSString *)key; + +@end + +@protocol RCTDevSettingsInspectable + +/** + * Whether current jsi::Runtime is inspectable. + * Only set when using as a bridgeless turbo module. + */ +@property (nonatomic, assign, readwrite) BOOL isInspectable; + +@end + +@interface RCTDevSettings : RCTEventEmitter + +- (instancetype)initWithDataSource:(id)dataSource; + +@property (nonatomic, readonly) BOOL isHotLoadingAvailable; +@property (nonatomic, readonly) BOOL isRemoteDebuggingAvailable; +@property (nonatomic, readonly) BOOL isDeviceDebuggingAvailable; +@property (nonatomic, readonly) BOOL isJSCSamplingProfilerAvailable; + +/** + * Whether the bridge is connected to a remote JS executor. + */ +@property (nonatomic, assign) BOOL isDebuggingRemotely; + +/* + * Whether shaking will show RCTDevMenu. The menu is enabled by default if RCT_DEV=1, but + * you may wish to disable it so that you can provide your own shake handler. + */ +@property (nonatomic, assign) BOOL isShakeToShowDevMenuEnabled; + +/** + * Whether performance profiling is enabled. + */ +@property (nonatomic, assign, setter=setProfilingEnabled:) BOOL isProfilingEnabled; + +/** + * Whether hot loading is enabled. + */ +@property (nonatomic, assign, setter=setHotLoadingEnabled:) BOOL isHotLoadingEnabled; + +/** + * Enables starting of profiling sampler on launch + */ +@property (nonatomic, assign) BOOL startSamplingProfilerOnLaunch; + +/** + * Whether the element inspector is visible. + */ +@property (nonatomic, readonly) BOOL isElementInspectorShown; + +/** + * Whether the performance monitor is visible. + */ +@property (nonatomic, assign) BOOL isPerfMonitorShown; + +/** + * Toggle the element inspector. + */ +- (void)toggleElementInspector; + +/** + * Set up the HMRClient if loading the bundle from Metro. + */ +- (void)setupHMRClientWithBundleURL:(NSURL *)bundleURL; + +/** + * Register additional bundles with the HMRClient. + */ +- (void)setupHMRClientWithAdditionalBundleURL:(NSURL *)bundleURL; + +#if RCT_DEV_MENU +- (void)addHandler:(id)handler + forPackagerMethod:(NSString *)name __deprecated_msg("Use RCTPackagerConnection directly instead"); +#endif + +@end + +@interface RCTBridge (RCTDevSettings) + +@property (nonatomic, readonly) RCTDevSettings *devSettings; + +@end + +// In debug builds, the dev menu is enabled by default but it is further customizable using this method. +// However, this method only has an effect in builds where the dev menu is actually compiled in. +// (i.e. RCT_DEV or RCT_DEV_MENU is set) +RCT_EXTERN void RCTDevSettingsSetEnabled(BOOL enabled); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevSplitBundleLoader.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevSplitBundleLoader.h new file mode 100644 index 0000000..52a115c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDevSplitBundleLoader.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTDevSplitBundleLoader : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDeviceInfo.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDeviceInfo.h new file mode 100644 index 0000000..cef03be --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDeviceInfo.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTDeviceInfo : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDiffClampAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDiffClampAnimatedNode.h new file mode 100644 index 0000000..085fb3d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDiffClampAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTDiffClampAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDisplayLink.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDisplayLink.h new file mode 100644 index 0000000..1e79c0b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDisplayLink.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBridgeModule; +@class RCTModuleData; + +@interface RCTDisplayLink : NSObject + +- (instancetype)init; +- (void)invalidate; +- (void)registerModuleForFrameUpdates:(id)module withModuleData:(RCTModuleData *)moduleData; +- (void)addToRunLoop:(NSRunLoop *)runLoop; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDisplayWeakRefreshable.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDisplayWeakRefreshable.h new file mode 100644 index 0000000..c1ea105 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDisplayWeakRefreshable.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTDisplayRefreshable + +- (void)displayDidRefresh:(CADisplayLink *)displayLink; + +@end + +@interface RCTDisplayWeakRefreshable : NSObject + +@property (nonatomic, weak) id refreshable; + ++ (CADisplayLink *)displayLinkWithWeakRefreshable:(id)refreshable; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDivisionAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDivisionAnimatedNode.h new file mode 100644 index 0000000..006fd5a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTDivisionAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTDivisionAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTErrorCustomizer.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTErrorCustomizer.h new file mode 100644 index 0000000..aa65296 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTErrorCustomizer.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTErrorInfo; + +/** + * Provides an interface to customize React Native error messages and stack + * traces from exceptions. + */ +@protocol RCTErrorCustomizer + +/** + * Customizes the given error, returning the passed info argument if no + * customization is required. + */ +- (nonnull RCTErrorInfo *)customizeErrorInfo:(nonnull RCTErrorInfo *)info; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTErrorInfo.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTErrorInfo.h new file mode 100644 index 0000000..a5d74d8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTErrorInfo.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTJSStackFrame; + +/** + * An ObjC wrapper for React Native errors. + */ +@interface RCTErrorInfo : NSObject +@property (nonatomic, copy, readonly) NSString *errorMessage; +@property (nonatomic, copy, readonly) NSArray *stack; + +- (instancetype)initWithErrorMessage:(NSString *)errorMessage stack:(NSArray *)stack; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventAnimation.h new file mode 100644 index 0000000..c63c1f4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventAnimation.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTValueAnimatedNode.h" + +@interface RCTEventAnimation : NSObject + +@property (nonatomic, readonly, weak) RCTValueAnimatedNode *valueNode; + +- (instancetype)initWithEventPath:(NSArray *)eventPath + valueNode:(RCTValueAnimatedNode *)valueNode; + +- (void)updateWithEvent:(id)event; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventDispatcher.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventDispatcher.h new file mode 100644 index 0000000..bbcd643 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventDispatcher.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +/** + * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and + * provides some convenience methods for generating event calls. + */ +@interface RCTEventDispatcher : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventDispatcherProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventDispatcherProtocol.h new file mode 100644 index 0000000..913cf85 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventDispatcherProtocol.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * The threshold at which text inputs will start warning that the JS thread + * has fallen behind (resulting in poor input performance, missed keys, etc.) + */ +RCT_EXTERN const NSInteger RCTTextUpdateLagWarningThreshold; + +/** + * Takes an input event name and normalizes it to the form that is required + * by the events system (currently that means starting with the "top" prefix, + * but that's an implementation detail that may change in future). + */ +RCT_EXTERN NSString *RCTNormalizeInputEventName(NSString *eventName); + +typedef NS_ENUM(NSInteger, RCTTextEventType) { + RCTTextEventTypeFocus, + RCTTextEventTypeBlur, + RCTTextEventTypeChange, + RCTTextEventTypeSubmit, + RCTTextEventTypeEnd, + RCTTextEventTypeKeyPress +}; + +@protocol RCTEvent +@required + +@property (nonatomic, strong, readonly) NSNumber *viewTag; +@property (nonatomic, copy, readonly) NSString *eventName; + +- (BOOL)canCoalesce; + +/** used directly for doing a JS call */ ++ (NSString *)moduleDotMethod; + +/** must contain only JSON compatible values */ +- (NSArray *)arguments; + +@optional + +/** + * Coalescing related methods must only be implemented if canCoalesce + * returns YES. + */ +@property (nonatomic, assign, readonly) uint16_t coalescingKey; +- (id)coalesceWithEvent:(id)newEvent; + +@end + +/** + * This protocol allows observing events dispatched by RCTEventDispatcher. + */ +@protocol RCTEventDispatcherObserver + +/** + * Called before dispatching an event, on the same thread the event was + * dispatched from. + */ +- (void)eventDispatcherWillDispatchEvent:(id)event; + +@end + +@protocol RCTJSDispatcherModule + +@property (nonatomic, copy) void (^dispatchToJSThread)(dispatch_block_t block); + +@end + +/** + * This class wraps the -[RCTBridge enqueueJSCall:args:] method, and + * provides some convenience methods for generating event calls. + */ +@protocol RCTEventDispatcherProtocol + +- (void)sendViewEventWithName:(NSString *)name reactTag:(NSNumber *)reactTag; + +/** + * Deprecated, do not use. + */ +- (void)sendAppEventWithName:(NSString *)name body:(id)body __deprecated_msg("Subclass RCTEventEmitter instead"); + +/** + * Deprecated, do not use. + */ +- (void)sendDeviceEventWithName:(NSString *)name body:(id)body __deprecated_msg("Subclass RCTEventEmitter instead"); + +/** + * Send a text input/focus event. For internal use only. + */ +- (void)sendTextEventWithType:(RCTTextEventType)type + reactTag:(NSNumber *)reactTag + text:(NSString *)text + key:(NSString *)key + eventCount:(NSInteger)eventCount; + +/** + * Send a pre-prepared event object. + * + * Events are sent to JS as soon as the thread is free to process them. + * If an event can be coalesced and there is another compatible event waiting, the coalescing will happen immediately. + */ +- (void)sendEvent:(id)event; + +/** + * Add an event dispatcher observer. + */ +- (void)addDispatchObserver:(id)observer; + +/** + * Remove an event dispatcher observer. + */ +- (void)removeDispatchObserver:(id)observer; + +@end + +@interface RCTBridge (RCTEventDispatcher) + +- (id)eventDispatcher; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventEmitter.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventEmitter.h new file mode 100644 index 0000000..e3bb12f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTEventEmitter.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * RCTEventEmitter is an abstract base class to be used for modules that emit + * events to be observed by JS. + */ +@interface RCTEventEmitter : NSObject + +@property (nonatomic, weak) RCTBridge *bridge; +@property (nonatomic, weak) RCTModuleRegistry *moduleRegistry; +@property (nonatomic, weak) RCTViewRegistry *viewRegistry_DEPRECATED; + +- (instancetype)initWithDisabledObservation; + +/** + * Override this method to return an array of supported event names. Attempting + * to observe or send an event that isn't included in this list will result in + * an error. + */ +- (NSArray *)supportedEvents; + +/** + * Send an event that does not relate to a specific view, e.g. a navigation + * or data update notification. + */ +- (void)sendEventWithName:(NSString *)name body:(id)body; + +/** + * These methods will be called when the first observer is added and when the + * last observer is removed (or when dealloc is called), respectively. These + * should be overridden in your subclass in order to start/stop sending events. + */ +- (void)startObserving; +- (void)stopObserving; + +- (void)invalidate NS_REQUIRES_SUPER; + +- (void)addListener:(NSString *)eventName; +- (void)removeListeners:(double)count; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTExceptionsManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTExceptionsManager.h new file mode 100644 index 0000000..28ae105 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTExceptionsManager.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTExceptionsManagerDelegate + +- (void)handleSoftJSExceptionWithMessage:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(NSNumber *)exceptionId; +- (void)handleFatalJSExceptionWithMessage:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(NSNumber *)exceptionId; + +@optional +- (void)updateJSExceptionWithMessage:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(NSNumber *)exceptionId; + +@end + +@interface RCTExceptionsManager : NSObject + +- (instancetype)initWithDelegate:(id)delegate; + +- (void)reportSoftException:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(double)exceptionId; +- (void)reportFatalException:(nullable NSString *)message + stack:(nullable NSArray *)stack + exceptionId:(double)exceptionId; + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, assign) NSUInteger maxReloadAttempts; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFPSGraph.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFPSGraph.h new file mode 100644 index 0000000..73dd6bd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFPSGraph.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#if RCT_DEV + +@interface RCTFPSGraph : UIView + +@property (nonatomic, assign, readonly) NSUInteger FPS; +@property (nonatomic, assign, readonly) NSUInteger maxFPS; +@property (nonatomic, assign, readonly) NSUInteger minFPS; + +- (instancetype)initWithFrame:(CGRect)frame color:(UIColor *)color NS_DESIGNATED_INITIALIZER; + +- (void)onTick:(NSTimeInterval)timestamp; + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFileReaderModule.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFileReaderModule.h new file mode 100644 index 0000000..0eb246b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFileReaderModule.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTFileReaderModule : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFileRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFileRequestHandler.h new file mode 100644 index 0000000..7faf39d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFileRequestHandler.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * This is the default RCTURLRequestHandler implementation for file requests. + */ +@interface RCTFileRequestHandler : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFont.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFont.h new file mode 100644 index 0000000..15437dd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFont.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +typedef UIFont * (^RCTFontHandler)(CGFloat fontSize, NSString *fontWeightDescription); + +/** + * React Native will use the System font for rendering by default. If you want to + * provide a different base font, use this override. The font weight supplied to your + * handler will be one of "ultralight", "thin", "light", "regular", "medium", + * "semibold", "extrabold", "bold", "heavy", or "black". + */ +RCT_EXTERN void RCTSetDefaultFontHandler(RCTFontHandler handler); +RCT_EXTERN BOOL RCTHasFontHandlerSet(void); + +@interface RCTFont : NSObject + +/** + * Update a font with a given font-family, size, weight and style. + * If parameters are not specified, they'll be kept as-is. + * If font is nil, the default system font of size 14 will be used. + */ ++ (UIFont *)updateFont:(UIFont *)font + withFamily:(NSString *)family + size:(NSNumber *)size + weight:(NSString *)weight + style:(NSString *)style + variant:(NSArray *)variant + scaleMultiplier:(CGFloat)scaleMultiplier; + ++ (UIFont *)updateFont:(UIFont *)font withFamily:(NSString *)family; ++ (UIFont *)updateFont:(UIFont *)font withSize:(NSNumber *)size; ++ (UIFont *)updateFont:(UIFont *)font withWeight:(NSString *)weight; ++ (UIFont *)updateFont:(UIFont *)font withStyle:(NSString *)style; + +@end + +@interface RCTConvert (RCTFont) + ++ (UIFont *)UIFont:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFrameAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFrameAnimation.h new file mode 100644 index 0000000..610d3ff --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFrameAnimation.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimationDriver.h" + +@interface RCTFrameAnimation : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFrameUpdate.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFrameUpdate.h new file mode 100644 index 0000000..07f0889 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTFrameUpdate.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class CADisplayLink; + +/** + * Interface containing the information about the last screen refresh. + */ +@interface RCTFrameUpdate : NSObject + +/** + * Timestamp for the actual screen refresh + */ +@property (nonatomic, readonly) NSTimeInterval timestamp; + +/** + * Time since the last frame update ( >= 16.6ms ) + */ +@property (nonatomic, readonly) NSTimeInterval deltaTime; + +- (instancetype)initWithDisplayLink:(CADisplayLink *)displayLink NS_DESIGNATED_INITIALIZER; + +@end + +/** + * Protocol that must be implemented for subscribing to display refreshes (DisplayLink updates) + */ +@protocol RCTFrameUpdateObserver + +/** + * Method called on every screen refresh (if paused != YES) + */ +- (void)didUpdateFrame:(RCTFrameUpdate *)update; + +/** + * Synthesize and set to true to pause the calls to -[didUpdateFrame:] + */ +@property (nonatomic, readonly, getter=isPaused) BOOL paused; + +/** + * Callback for pause/resume observer. + * Observer should call it when paused property is changed. + */ +@property (nonatomic, copy) dispatch_block_t pauseCallback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTGIFImageDecoder.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTGIFImageDecoder.h new file mode 100644 index 0000000..2d56637 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTGIFImageDecoder.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTGIFImageDecoder : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTHTTPRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTHTTPRequestHandler.h new file mode 100644 index 0000000..5a91bd0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTHTTPRequestHandler.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +typedef NSURLSessionConfiguration* (^NSURLSessionConfigurationProvider)(void); +/** + * The block provided via this function will provide the NSURLSessionConfiguration for all HTTP requests made by the app. +*/ +RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider); +/** + * This is the default RCTURLRequestHandler implementation for HTTP requests. + */ +@interface RCTHTTPRequestHandler : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTI18nManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTI18nManager.h new file mode 100644 index 0000000..5f21ec4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTI18nManager.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * @experimental + * This is a experimental module for RTL support + * This module bridges the i18n utility from RCTI18nUtil + */ +@interface RCTI18nManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTI18nUtil.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTI18nUtil.h new file mode 100644 index 0000000..f3a1550 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTI18nUtil.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * @experimental + * This is a experimental module for to expose constance IsRTL to js about the RTL status. + * And it allows js to force RLT status for development propose. + * This will also provide other i18n related utilities in the future. + */ +@interface RCTI18nUtil : NSObject + ++ (instancetype)sharedInstance; + +- (BOOL)isRTL; +- (BOOL)isRTLAllowed; +- (void)allowRTL:(BOOL)value; +- (BOOL)isRTLForced; +- (void)forceRTL:(BOOL)value; +- (BOOL)doLeftAndRightSwapInRTL; +- (void)swapLeftAndRightInRTL:(BOOL)value; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageBlurUtils.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageBlurUtils.h new file mode 100644 index 0000000..18a286e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageBlurUtils.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +RCT_EXTERN UIImage *RCTBlurredImageWithRadius(UIImage *inputImage, CGFloat radius); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageCache.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageCache.h new file mode 100644 index 0000000..a4d15b4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageCache.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +@interface UIImage (React) + +/** + * Memory bytes of the image with the default calculation of static image or GIF. Custom calculations of decoded bytes can be assigned manually. + */ +@property (nonatomic, assign) NSInteger reactDecodedImageBytes; + +@end + +/** + * Provides an interface to use for providing a image caching strategy. + */ +@protocol RCTImageCache + +- (UIImage *)imageForUrl:(NSString *)url + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode; + +- (void)addImageToCache:(UIImage *)image + URL:(NSString *)url + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + response:(NSURLResponse *)response; + +@end + +@interface RCTImageCache : NSObject +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageDataDecoder.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageDataDecoder.h new file mode 100644 index 0000000..b7fbb00 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageDataDecoder.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +/** + * Provides the interface needed to register an image decoder. Image decoders + * are also bridge modules, so should be registered using RCT_EXPORT_MODULE(). + */ +@protocol RCTImageDataDecoder + +/** + * Indicates whether this handler is capable of decoding the specified data. + * Typically the handler would examine some sort of header data to determine + * this. + */ +- (BOOL)canDecodeImageData:(NSData *)imageData; + +/** + * Decode an image from the data object. The method should call the + * completionHandler when the decoding operation has finished. The method + * should also return a cancellation block, if applicable. + * + * If you provide a custom image decoder, you most implement scheduling yourself, + * to avoid decoding large amounts of images at the same time. + */ +- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + completionHandler:(RCTImageLoaderCompletionBlock)completionHandler; + +@optional + +/** + * If more than one RCTImageDataDecoder responds YES to `-canDecodeImageData:` + * then `decoderPriority` is used to determine which one to use. The decoder + * with the highest priority will be selected. Default priority is zero. + * If two or more valid decoders have the same priority, the selection order is + * undefined. + */ +- (float)decoderPriority; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageEditingManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageEditingManager.h new file mode 100644 index 0000000..216b622 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageEditingManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTImageEditingManager : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoader.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoader.h new file mode 100644 index 0000000..da0df28 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoader.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +@interface RCTImageLoader : NSObject +- (instancetype)init; +- (instancetype)initWithRedirectDelegate:(id)redirectDelegate NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithRedirectDelegate:(id)redirectDelegate + loadersProvider:(NSArray> * (^)(RCTModuleRegistry *))getLoaders + decodersProvider:(NSArray> * (^)(RCTModuleRegistry *))getDecoders; +@end + +/** + * DEPRECATED!! DO NOT USE + * Instead use `[_bridge moduleForClass:[RCTImageLoader class]]` + */ +@interface RCTBridge (RCTImageLoader) + +@property (nonatomic, readonly) RCTImageLoader *imageLoader; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderLoggable.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderLoggable.h new file mode 100644 index 0000000..3b78c48 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderLoggable.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * The image loader (i.e. RCTImageLoader) implement this to declare whether image performance should be logged. + */ +@protocol RCTImageLoaderLoggableProtocol + +/** + * Image instrumentation - declares whether its caller should log images + */ +- (BOOL)shouldEnablePerfLoggingForRequestUrl:(NSURL *)url; + +@end + +/** + * Image handlers in the image loader implement this to declare whether image performance should be logged. + */ +@protocol RCTImageLoaderLoggable + +/** + * Image instrumentation - declares whether its caller should log images + */ +- (BOOL)shouldEnablePerfLogging; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderProtocol.h new file mode 100644 index 0000000..f1bb268 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderProtocol.h @@ -0,0 +1,138 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * If available, RCTImageRedirectProtocol is invoked before loading an asset. + * Implementation should return either a new URL or nil when redirection is + * not needed. + */ + +@protocol RCTImageRedirectProtocol + +- (NSURL *)redirectAssetsURL:(NSURL *)URL; + +@end + +/** + * Image Downloading priority. + * Use PriorityImmediate to download images at the highest priority. + * Use PriorityPrefetch to prefetch images at a lower priority. + * The priority logic is up to each @RCTImageLoaderProtocol implementation + */ +typedef NS_ENUM(NSUInteger, RCTImageLoaderPriority) { + RCTImageLoaderPriorityImmediate, + RCTImageLoaderPriorityPrefetch +}; + +@protocol RCTImageLoaderProtocol + +/** + * The maximum number of concurrent image loading tasks. Loading and decoding + * images can consume a lot of memory, so setting this to a higher value may + * cause memory to spike. If you are seeing out-of-memory crashes, try reducing + * this value. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentLoadingTasks; + +/** + * The maximum number of concurrent image decoding tasks. Decoding large + * images can be especially CPU and memory intensive, so if your are decoding a + * lot of large images in your app, you may wish to adjust this value. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentDecodingTasks; + +/** + * Decoding large images can use a lot of memory, and potentially cause the app + * to crash. This value allows you to throttle the amount of memory used by the + * decoder independently of the number of concurrent threads. This means you can + * still decode a lot of small images in parallel, without allowing the decoder + * to try to decompress multiple huge images at once. Note that this value is + * only a hint, and not an indicator of the total memory used by the app. + */ +@property (nonatomic, assign) NSUInteger maxConcurrentDecodingBytes; + +/** + * Loads the specified image at the highest available resolution. + * Can be called from any thread, will call back on an unspecified thread. + */ +- (nullable RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + callback:(RCTImageLoaderCompletionBlock)callback; +/** + * As above, but includes download `priority`. + */ +- (nullable RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + priority:(RCTImageLoaderPriority)priority + callback:(RCTImageLoaderCompletionBlock)callback; + +/** +* As above, but includes target `size`, `scale` and `resizeMode`, which are used to +* select the optimal dimensions for the loaded image. The `clipped` option +* controls whether the image will be clipped to fit the specified size exactly, +* or if the original aspect ratio should be retained. +* `partialLoadBlock` is meant for custom image loaders that do not ship with the core RN library. +* It is meant to be called repeatedly while loading the image as higher quality versions are decoded, +* for instance with progressive JPEGs. +*/ +- (nullable RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + size:(CGSize)size + scale:(CGFloat)scale + clipped:(BOOL)clipped + resizeMode:(RCTResizeMode)resizeMode + progressBlock:(RCTImageLoaderProgressBlock)progressBlock + partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock + completionBlock:(RCTImageLoaderCompletionBlock)completionBlock; + +/** + * Finds an appropriate image decoder and passes the target `size`, `scale` and + * `resizeMode` for optimal image decoding. The `clipped` option controls + * whether the image will be clipped to fit the specified size exactly, or + * if the original aspect ratio should be retained. Can be called from any + * thread, will call callback on an unspecified thread. + */ +- (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData + size:(CGSize)size + scale:(CGFloat)scale + clipped:(BOOL)clipped + resizeMode:(RCTResizeMode)resizeMode + completionBlock:(RCTImageLoaderCompletionBlock)completionBlock; + +/** + * Get image size, in pixels. This method will do the least work possible to get + * the information, and won't decode the image if it doesn't have to. + */ +- (RCTImageLoaderCancellationBlock)getImageSizeForURLRequest:(NSURLRequest *)imageURLRequest + block:(void(^)(NSError *error, CGSize size))completionBlock; +/** + * Determines whether given image URLs are cached locally. The `requests` array is expected + * to contain objects convertible to NSURLRequest. The return value maps URLs to strings: + * "disk" for images known to be cached in non-volatile storage, "memory" for images known + * to be cached in memory. Dictionary items corresponding to images that are not known to be + * cached are simply missing. + */ +- (NSDictionary *)getImageCacheStatus:(NSArray *)requests; + +/** + * Allows developers to set their own caching implementation for + * decoded images as long as it conforms to the RCTImageCache + * protocol. This method should be called in bridgeDidInitializeModule. + */ +- (void)setImageCache:(id)cache; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderWithAttributionProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderWithAttributionProtocol.h new file mode 100644 index 0000000..07aab9d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageLoaderWithAttributionProtocol.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +RCT_EXTERN BOOL RCTImageLoadingPerfInstrumentationEnabled(void); +RCT_EXTERN void RCTEnableImageLoadingPerfInstrumentation(BOOL enabled); + +@protocol RCTImageLoaderWithAttributionProtocol + +// TODO (T61325135): Remove C++ checks +#ifdef __cplusplus +/** + * Same as the variant in RCTImageURLLoaderProtocol, but allows passing attribution + * information that each image URL loader can process. + */ +- (RCTImageURLLoaderRequest *)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest + size:(CGSize)size + scale:(CGFloat)scale + clipped:(BOOL)clipped + resizeMode:(RCTResizeMode)resizeMode + priority: (RCTImageLoaderPriority)priority + attribution:(const facebook::react::ImageURLLoaderAttribution &)attribution + progressBlock:(RCTImageLoaderProgressBlock)progressBlock + partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock + completionBlock:(RCTImageLoaderCompletionBlockWithMetadata)completionBlock; +#endif + +/** + * Image instrumentation - start tracking the on-screen visibility of the native image view. + */ +- (void)trackURLImageVisibilityForRequest:(RCTImageURLLoaderRequest *)loaderRequest imageView:(UIView *)imageView; + +/** + * Image instrumentation - notify that the request was cancelled. + */ +- (void)trackURLImageRequestDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +/** + * Image instrumentation - notify that the native image view was destroyed. + */ +- (void)trackURLImageDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImagePlugins.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImagePlugins.h new file mode 100644 index 0000000..1e943d8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImagePlugins.h @@ -0,0 +1,44 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTImagePlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTImageClassProvider(const char *name); + +// Lookup functions +Class RCTGIFImageDecoderCls(void) __attribute__((used)); +Class RCTImageEditingManagerCls(void) __attribute__((used)); +Class RCTImageLoaderCls(void) __attribute__((used)); +Class RCTImageStoreManagerCls(void) __attribute__((used)); +Class RCTLocalAssetImageLoaderCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageShadowView.h new file mode 100644 index 0000000..3057118 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTImageShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageSource.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageSource.h new file mode 100644 index 0000000..928657c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageSource.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * Object containing an image URL and associated metadata. + */ +@interface RCTImageSource : NSObject + +@property (nonatomic, copy, readonly) NSURLRequest *request; +@property (nonatomic, assign, readonly) CGSize size; +@property (nonatomic, assign, readonly) CGFloat scale; + +/** + * Create a new image source object. + * Pass a size of CGSizeZero if you do not know or wish to specify the image + * size. Pass a scale of zero if you do not know or wish to specify the scale. + */ +- (instancetype)initWithURLRequest:(NSURLRequest *)request size:(CGSize)size scale:(CGFloat)scale; + +/** + * Create a copy of the image source with the specified size and scale. + */ +- (instancetype)imageSourceWithSize:(CGSize)size scale:(CGFloat)scale; + +@end + +@interface RCTConvert (ImageSource) + ++ (RCTImageSource *)RCTImageSource:(id)json; ++ (NSArray *)RCTImageSourceArray:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageStoreManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageStoreManager.h new file mode 100644 index 0000000..0073381 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageStoreManager.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTImageStoreManager : NSObject + +/** + * Set and get cached image data asynchronously. It is safe to call these from any + * thread. The callbacks will be called on an unspecified thread. + */ +- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block; +- (void)storeImageData:(NSData *)imageData withBlock:(void (^)(NSString *imageTag))block; +- (void)getImageDataForTag:(NSString *)imageTag withBlock:(void (^)(NSData *imageData))block; + +/** + * Convenience method to store an image directly (image is converted to data + * internally, so any metadata such as scale or orientation will be lost). + */ +- (void)storeImage:(UIImage *)image withBlock:(void (^)(NSString *imageTag))block; + +@end + +@interface RCTImageStoreManager (Deprecated) + +/** + * These methods are deprecated - use the data-based alternatives instead. + */ +- (NSString *)storeImage:(UIImage *)image __deprecated; +- (UIImage *)imageForTag:(NSString *)imageTag __deprecated; +- (void)getImageForTag:(NSString *)imageTag withBlock:(void (^)(UIImage *image))block __deprecated; + +@end + +@interface RCTBridge (RCTImageStoreManager) + +@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageURLLoader.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageURLLoader.h new file mode 100644 index 0000000..e49ed11 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageURLLoader.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef void (^RCTImageLoaderProgressBlock)(int64_t progress, int64_t total); +typedef void (^RCTImageLoaderPartialLoadBlock)(UIImage *image); +typedef void (^RCTImageLoaderCompletionBlock)(NSError * _Nullable error, UIImage * _Nullable image); +// Metadata is passed as a id in an additional parameter because there are forks of RN without this parameter, +// and the complexity of RCTImageLoader would make using protocols here difficult to typecheck. +typedef void (^RCTImageLoaderCompletionBlockWithMetadata)(NSError * _Nullable error, UIImage * _Nullable image, id _Nullable metadata); +typedef dispatch_block_t RCTImageLoaderCancellationBlock; + +/** + * Provides the interface needed to register an image loader. Image data + * loaders are also bridge modules, so should be registered using + * RCT_EXPORT_MODULE(). + */ +@protocol RCTImageURLLoader + +/** + * Indicates whether this data loader is capable of processing the specified + * request URL. Typically the handler would examine the scheme/protocol of the + * URL to determine this. + */ +- (BOOL)canLoadImageURL:(NSURL *)requestURL; + +/** + * Send a network request to load the request URL. The method should call the + * progressHandler (if applicable) and the completionHandler when the request + * has finished. The method should also return a cancellation block, if + * applicable. + */ +- (nullable RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + progressHandler:(RCTImageLoaderProgressBlock)progressHandler + partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler + completionHandler:(RCTImageLoaderCompletionBlock)completionHandler; + +@optional + +/** + * If more than one RCTImageURLLoader responds YES to `-canLoadImageURL:` + * then `loaderPriority` is used to determine which one to use. The loader + * with the highest priority will be selected. Default priority is zero. If + * two or more valid loaders have the same priority, the selection order is + * undefined. + */ +- (float)loaderPriority; + +/** + * If the loader must be called on the serial url cache queue, and whether the completion + * block should be dispatched off the main thread. If this is NO, the loader will be + * called from the main queue. Defaults to YES. + * + * Use with care: disabling scheduling will reduce RCTImageLoader's ability to throttle + * network requests. + */ +- (BOOL)requiresScheduling; + +/** + * If images loaded by the loader should be cached in the decoded image cache. + * Defaults to YES. + */ +- (BOOL)shouldCacheLoadedImages; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageURLLoaderWithAttribution.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageURLLoaderWithAttribution.h new file mode 100644 index 0000000..118bed1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageURLLoaderWithAttribution.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +// TODO (T61325135): Remove C++ checks +#ifdef __cplusplus +namespace facebook { +namespace react { + +struct ImageURLLoaderAttribution { + int32_t nativeViewTag = 0; + int32_t surfaceId = 0; + std::string queryRootName; + NSString *analyticTag; +}; + +} // namespace react +} // namespace facebook +#endif + +@interface RCTImageURLLoaderRequest : NSObject + +@property (nonatomic, strong, readonly) NSString *requestId; +@property (nonatomic, strong, readonly) NSURL *imageURL; +@property (nonatomic, copy, readonly) RCTImageLoaderCancellationBlock cancellationBlock; + +- (instancetype)initWithRequestId:(NSString *)requestId imageURL:(NSURL *)imageURL cancellationBlock:(RCTImageLoaderCancellationBlock)cancellationBlock; +- (void)cancel; + +@end + +/** + * Same as the RCTImageURLLoader interface, but allows passing in optional `attribution` information. + * This is useful for per-app logging and other instrumentation. + */ +@protocol RCTImageURLLoaderWithAttribution + +// TODO (T61325135): Remove C++ checks +#ifdef __cplusplus +/** + * Same as the RCTImageURLLoader variant above, but allows optional `attribution` information. + * Caller may also specify a preferred requestId for tracking purpose. + */ +- (RCTImageURLLoaderRequest *)loadImageForURL:(NSURL *)imageURL + size:(CGSize)size + scale:(CGFloat)scale + resizeMode:(RCTResizeMode)resizeMode + requestId:(NSString *)requestId + priority: (RCTImageLoaderPriority)priority + attribution:(const facebook::react::ImageURLLoaderAttribution &)attribution + progressHandler:(RCTImageLoaderProgressBlock)progressHandler + partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler + completionHandler:(RCTImageLoaderCompletionBlockWithMetadata)completionHandler; +#endif + +/** + * Image instrumentation - start tracking the on-screen visibility of the native image view. + */ +- (void)trackURLImageVisibilityForRequest:(RCTImageURLLoaderRequest *)loaderRequest imageView:(UIView *)imageView; + +/** + * Image instrumentation - notify that the request was destroyed. + */ +- (void)trackURLImageRequestDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +/** + * Image instrumentation - notify that the native image view was destroyed. + */ +- (void)trackURLImageDidDestroy:(RCTImageURLLoaderRequest *)loaderRequest; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageUtils.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageUtils.h new file mode 100644 index 0000000..df04a2c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageUtils.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * This function takes an source size (typically from an image), a target size + * and scale that it will be drawn at (typically in a CGContext) and then + * calculates the rectangle to draw the image into so that it will be sized and + * positioned correctly according to the specified resizeMode. + */ +RCT_EXTERN CGRect RCTTargetRect(CGSize sourceSize, CGSize destSize, + CGFloat destScale, RCTResizeMode resizeMode); + +/** + * This function takes a source size (typically from an image), a target rect + * that it will be drawn into (typically relative to a CGContext), and works out + * the transform needed to draw the image at the correct scale and position. + */ +RCT_EXTERN CGAffineTransform RCTTransformFromTargetRect(CGSize sourceSize, + CGRect targetRect); + +/** + * This function takes an input content size & scale (typically from an image), + * a target size & scale at which it will be displayed (typically in a + * UIImageView) and then calculates the optimal size at which to redraw the + * image so that it will be displayed correctly with the specified resizeMode. + */ +RCT_EXTERN CGSize RCTTargetSize(CGSize sourceSize, CGFloat sourceScale, + CGSize destSize, CGFloat destScale, + RCTResizeMode resizeMode, BOOL allowUpscaling); + +/** + * This function takes an input content size & scale (typically from an image), + * a target size & scale that it will be displayed at, and determines if the + * source will need to be upscaled to fit (which may result in pixelization). + */ +RCT_EXTERN BOOL RCTUpscalingRequired(CGSize sourceSize, CGFloat sourceScale, + CGSize destSize, CGFloat destScale, + RCTResizeMode resizeMode); + +/** + * This function takes the source data for an image and decodes it at the + * specified size. If the original image is smaller than the destination size, + * the resultant image's scale will be decreased to compensate, so the + * width/height of the returned image is guaranteed to be >= destSize. + * Pass a destSize of CGSizeZero to decode the image at its original size. + */ +RCT_EXTERN UIImage *__nullable RCTDecodeImageWithData(NSData *data, + CGSize destSize, + CGFloat destScale, + RCTResizeMode resizeMode); + +/** + * This function takes the source data for an image and decodes just the + * metadata, without decompressing the image itself. + */ +RCT_EXTERN NSDictionary *__nullable RCTGetImageMetadata(NSData *data); + +/** + * Convert an image back into data. Images with an alpha channel will be + * converted to lossless PNG data. Images without alpha will be converted to + * JPEG. The `quality` argument controls the compression ratio of the JPEG + * conversion, with 1.0 being maximum quality. It has no effect for images + * using PNG compression. + */ +RCT_EXTERN NSData *__nullable RCTGetImageData(UIImage *image, float quality); + +/** + * This function transforms an image. `destSize` is the size of the final image, + * and `destScale` is its scale. The `transform` argument controls how the + * source image will be mapped to the destination image. + */ +RCT_EXTERN UIImage *__nullable RCTTransformImage(UIImage *image, + CGSize destSize, + CGFloat destScale, + CGAffineTransform transform); + +/* + * Return YES if image has an alpha component + */ +RCT_EXTERN BOOL RCTImageHasAlpha(CGImageRef image); + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageView.h new file mode 100644 index 0000000..c895a53 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageView.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@class RCTBridge; +@class RCTImageSource; + +@interface RCTImageView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, assign) UIEdgeInsets capInsets; +@property (nonatomic, strong) UIImage *defaultImage; +@property (nonatomic, assign) UIImageRenderingMode renderingMode; +@property (nonatomic, copy) NSArray *imageSources; +@property (nonatomic, assign) CGFloat blurRadius; +@property (nonatomic, assign) RCTResizeMode resizeMode; +@property (nonatomic, copy) NSString *internal_analyticTag; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageViewManager.h new file mode 100644 index 0000000..9431f35 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTImageViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTImageViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInitializing.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInitializing.h new file mode 100644 index 0000000..56b14b1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInitializing.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTInitializing + +- (void)initialize; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryShadowView.h new file mode 100644 index 0000000..8ed5110 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryView.h new file mode 100644 index 0000000..d4c48ce --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryView.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; +@class RCTInputAccessoryViewContent; + +@interface RCTInputAccessoryView : UIView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryViewContent.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryViewContent.h new file mode 100644 index 0000000..f65eea7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryViewContent.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewContent : UIView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryViewManager.h new file mode 100644 index 0000000..251048d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInputAccessoryViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspector.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspector.h new file mode 100644 index 0000000..97c8d2e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspector.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if RCT_DEV + +@class RCTInspectorRemoteConnection; + +@interface RCTInspectorLocalConnection : NSObject +- (void)sendMessage:(NSString *)message; +- (void)disconnect; +@end + +@interface RCTInspectorPage : NSObject +@property (nonatomic, readonly) NSInteger id; +@property (nonatomic, readonly) NSString *title; +@property (nonatomic, readonly) NSString *vm; +@end + +@interface RCTInspector : NSObject ++ (NSArray *)pages; ++ (RCTInspectorLocalConnection *)connectPage:(NSInteger)pageId + forRemoteConnection:(RCTInspectorRemoteConnection *)remote; +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspectorDevServerHelper.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspectorDevServerHelper.h new file mode 100644 index 0000000..b69fa02 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspectorDevServerHelper.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import +#import + +#if RCT_DEV + +@interface RCTInspectorDevServerHelper : NSObject + ++ (RCTInspectorPackagerConnection *)connectWithBundleURL:(NSURL *)bundleURL; ++ (void)disableDebugger; ++ (void)openURL:(NSString *)url withBundleURL:(NSURL *)bundleURL withErrorMessage:(NSString *)errorMessage; +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspectorPackagerConnection.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspectorPackagerConnection.h new file mode 100644 index 0000000..de08694 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInspectorPackagerConnection.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if RCT_DEV + +@interface RCTBundleStatus : NSObject +@property (atomic, assign) BOOL isLastBundleDownloadSuccess; +@property (atomic, assign) NSTimeInterval bundleUpdateTimestamp; +@end + +typedef RCTBundleStatus * (^RCTBundleStatusProvider)(void); + +@interface RCTInspectorPackagerConnection : NSObject +- (instancetype)initWithURL:(NSURL *)url; + +- (bool)isConnected; +- (void)connect; +- (void)closeQuietly; +- (void)sendEventToAllConnections:(NSString *)event; +- (void)setBundleStatusProvider:(RCTBundleStatusProvider)bundleStatusProvider; +@end + +@interface RCTInspectorRemoteConnection : NSObject +- (void)onMessage:(NSString *)message; +- (void)onDisconnect; +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInterpolationAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInterpolationAnimatedNode.h new file mode 100644 index 0000000..8ec4101 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInterpolationAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTInterpolationAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInvalidating.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInvalidating.h new file mode 100644 index 0000000..bc144cd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTInvalidating.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTInvalidating + +- (void)invalidate; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSScriptLoaderModule.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSScriptLoaderModule.h new file mode 100644 index 0000000..a0ba36e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSScriptLoaderModule.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +@class RCTSource; + +/** + * This protocol should be adopted when a turbo module needs to tell React Native to load a script. + * In bridge-less React Native, it is a replacement for [_bridge loadAndExecuteSplitBundleURL:]. + */ +@protocol RCTJSScriptLoaderModule + +@property (nonatomic, copy, nonnull) void (^loadScript)(RCTSource *source); + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSStackFrame.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSStackFrame.h new file mode 100644 index 0000000..1a66e29 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSStackFrame.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTJSStackFrame : NSObject + +@property (nonatomic, copy, readonly) NSString *methodName; +@property (nonatomic, copy, readonly) NSString *file; +@property (nonatomic, readonly) NSInteger lineNumber; +@property (nonatomic, readonly) NSInteger column; +@property (nonatomic, readonly) BOOL collapse; + +- (instancetype)initWithMethodName:(NSString *)methodName + file:(NSString *)file + lineNumber:(NSInteger)lineNumber + column:(NSInteger)column + collapse:(BOOL)collapse; +- (NSDictionary *)toDictionary; + ++ (instancetype)stackFrameWithLine:(NSString *)line; ++ (instancetype)stackFrameWithDictionary:(NSDictionary *)dict; ++ (NSArray *)stackFramesWithLines:(NSString *)lines; ++ (NSArray *)stackFramesWithDictionaries:(NSArray *)dicts; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSThread.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSThread.h new file mode 100644 index 0000000..8f1bc76 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJSThread.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#import + +/** + * This constant can be returned from +methodQueue to force module + * methods to be called on the JavaScript thread. This can have serious + * implications for performance, so only use this if you're sure it's what + * you need. + * + * NOTE: RCTJSThread is not a real libdispatch queue + */ +RCT_EXTERN dispatch_queue_t RCTJSThread; + +/** + * Initializes the RCTJSThread constant. + * Exported because the bridgeless initialization layer needs to initialize + * RCTJSThread. In bridgeless mode, RCTBridge isn't accessed, and RCTJSThread + * therefore isn't initialized. + */ +RCT_EXTERN void _RCTInitializeJSThreadConstantInternal(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJavaScriptExecutor.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJavaScriptExecutor.h new file mode 100644 index 0000000..c42fb05 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJavaScriptExecutor.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef void (^RCTJavaScriptCompleteBlock)(NSError *error); +typedef void (^RCTJavaScriptCallback)(id result, NSError *error); + +/** + * Abstracts away a JavaScript execution context - we may be running code in a + * web view (for debugging purposes), or may be running code in a `JSContext`. + */ +@protocol RCTJavaScriptExecutor + +/** + * Used to set up the executor after the bridge has been fully initialized. + * Do any expensive setup in this method instead of `-init`. + */ +- (void)setUp; + +/** + * Whether the executor has been invalidated + */ +@property (nonatomic, readonly, getter=isValid) BOOL valid; + +/** + * Executes BatchedBridge.flushedQueue on JS thread and calls the given callback + * with JSValue, containing the next queue, and JSContext. + */ +- (void)flushedQueue:(RCTJavaScriptCallback)onComplete; + +/** + * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module name, + * method name and optional additional arguments on the JS thread and calls the + * given callback with JSValue, containing the next queue, and JSContext. + */ +- (void)callFunctionOnModule:(NSString *)module + method:(NSString *)method + arguments:(NSArray *)args + callback:(RCTJavaScriptCallback)onComplete; + +/** + * Executes BatchedBridge.invokeCallbackAndReturnFlushedQueue with the cbID, + * and optional additional arguments on the JS thread and calls the + * given callback with JSValue, containing the next queue, and JSContext. + */ +- (void)invokeCallbackID:(NSNumber *)cbID arguments:(NSArray *)args callback:(RCTJavaScriptCallback)onComplete; + +/** + * Runs an application script, and notifies of the script load being complete via `onComplete`. + */ +- (void)executeApplicationScript:(NSData *)script + sourceURL:(NSURL *)sourceURL + onComplete:(RCTJavaScriptCompleteBlock)onComplete; + +- (void)injectJSONText:(NSString *)script + asGlobalObjectNamed:(NSString *)objectName + callback:(RCTJavaScriptCompleteBlock)onComplete; + +/** + * Enqueue a block to run in the executors JS thread. Fallback to `dispatch_async` + * on the main queue if the executor doesn't own a thread. + */ +- (void)executeBlockOnJavaScriptQueue:(dispatch_block_t)block; + +/** + * Special case for Timers + ContextExecutor - instead of the default + * if jsthread then call else dispatch call on jsthread + * ensure the call is made async on the jsthread + */ +- (void)executeAsyncBlockOnJavaScriptQueue:(dispatch_block_t)block; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJavaScriptLoader.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJavaScriptLoader.h new file mode 100755 index 0000000..729fa37 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTJavaScriptLoader.h @@ -0,0 +1,98 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +extern NSString *const RCTJavaScriptLoaderErrorDomain; + +extern const UInt32 RCT_BYTECODE_ALIGNMENT; + +UInt32 RCTReadUInt32LE(NSData *script, UInt32 offset); +bool RCTIsBytecodeBundle(NSData *script); + +NS_ENUM(NSInteger){ + RCTJavaScriptLoaderErrorNoScriptURL = 1, + RCTJavaScriptLoaderErrorFailedOpeningFile = 2, + RCTJavaScriptLoaderErrorFailedReadingFile = 3, + RCTJavaScriptLoaderErrorFailedStatingFile = 3, + RCTJavaScriptLoaderErrorURLLoadFailed = 3, + RCTJavaScriptLoaderErrorBCVersion = 4, + RCTJavaScriptLoaderErrorBCNotSupported = 4, + + RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously = 1000, +}; + +NS_ENUM(NSInteger){ + RCTSourceFilesChangedCountNotBuiltByBundler = -2, + RCTSourceFilesChangedCountRebuiltFromScratch = -1, +}; + +@interface RCTLoadingProgress : NSObject + +@property (nonatomic, copy) NSString *status; +@property (strong, nonatomic) NSNumber *done; +@property (strong, nonatomic) NSNumber *total; + +@end + +@interface RCTSource : NSObject + +/** + * URL of the source object. + */ +@property (strong, nonatomic, readonly) NSURL *url; + +/** + * JS source (or simply the binary header in the case of a RAM bundle). + */ +@property (strong, nonatomic, readonly) NSData *data; + +/** + * Length of the entire JS bundle. Note that self.length != self.data.length in the case of certain bundle formats. For + * instance, when using RAM bundles: + * + * - self.data will point to the bundle header + * - self.data.length is the length of the bundle header, i.e. sizeof(facebook::react::BundleHeader) + * - self.length is the length of the entire bundle file (header + contents) + */ +@property (nonatomic, readonly) NSUInteger length; + +/** + * Returns number of files changed when building this bundle: + * + * - RCTSourceFilesChangedCountNotBuiltByBundler if the source wasn't built by the bundler (e.g. read from disk) + * - RCTSourceFilesChangedCountRebuiltFromScratch if the source was rebuilt from scratch by the bundler + * - Otherwise, the number of files changed when incrementally rebuilding the source + */ +@property (nonatomic, readonly) NSInteger filesChangedCount; + +@end + +typedef void (^RCTSourceLoadProgressBlock)(RCTLoadingProgress *progressData); +typedef void (^RCTSourceLoadBlock)(NSError *error, RCTSource *source); + +@interface RCTJavaScriptLoader : NSObject + ++ (void)loadBundleAtURL:(NSURL *)scriptURL + onProgress:(RCTSourceLoadProgressBlock)onProgress + onComplete:(RCTSourceLoadBlock)onComplete; + +/** + * @experimental + * Attempts to synchronously load the script at the given URL. The following two conditions must be met: + * 1. It must be a file URL. + * 2. It must not point to a text/javascript file. + * If the URL does not meet those conditions, this method will return nil and supply an error with the domain + * RCTJavaScriptLoaderErrorDomain and the code RCTJavaScriptLoaderErrorCannotBeLoadedSynchronously. + */ ++ (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL + sourceLength:(int64_t *)sourceLength + error:(NSError **)error; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTKeyCommands.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTKeyCommands.h new file mode 100644 index 0000000..2bdefcf --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTKeyCommands.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTKeyCommands : NSObject + ++ (instancetype)sharedInstance; + +/** + * Register a keyboard command. + */ +- (void)registerKeyCommandWithInput:(NSString *)input + modifierFlags:(UIKeyModifierFlags)flags + action:(void (^)(UIKeyCommand *command))block; + +/** + * Unregister a keyboard command. + */ +- (void)unregisterKeyCommandWithInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags; + +/** + * Check if a command is registered. + */ +- (BOOL)isKeyCommandRegisteredForInput:(NSString *)input modifierFlags:(UIKeyModifierFlags)flags; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTKeyboardObserver.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTKeyboardObserver.h new file mode 100644 index 0000000..320b65d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTKeyboardObserver.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTKeyboardObserver : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayout.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayout.h new file mode 100644 index 0000000..d838032 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayout.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTShadowView; + +typedef NS_ENUM(NSInteger, RCTDisplayType) { + RCTDisplayTypeNone, + RCTDisplayTypeFlex, + RCTDisplayTypeInline, +}; + +struct RCTLayoutMetrics { + CGRect frame; + CGRect contentFrame; + UIEdgeInsets borderWidth; + RCTDisplayType displayType; + UIUserInterfaceLayoutDirection layoutDirection; +}; +typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics; + +struct RCTLayoutContext { + CGPoint absolutePosition; + __unsafe_unretained NSHashTable *_Nonnull affectedShadowViews; + __unsafe_unretained NSHashTable *_Nonnull other; +}; +typedef struct CG_BOXABLE RCTLayoutContext RCTLayoutContext; + +static inline BOOL RCTLayoutMetricsEqualToLayoutMetrics(RCTLayoutMetrics a, RCTLayoutMetrics b) +{ + return CGRectEqualToRect(a.frame, b.frame) && CGRectEqualToRect(a.contentFrame, b.contentFrame) && + UIEdgeInsetsEqualToEdgeInsets(a.borderWidth, b.borderWidth) && a.displayType == b.displayType && + a.layoutDirection == b.layoutDirection; +} + +RCT_EXTERN RCTLayoutMetrics RCTLayoutMetricsFromYogaNode(YGNodeRef yogaNode); + +/** + * Converts float values between Yoga and CoreGraphics representations, + * especially in terms of edge cases. + */ +RCT_EXTERN float RCTYogaFloatFromCoreGraphicsFloat(CGFloat value); +RCT_EXTERN CGFloat RCTCoreGraphicsFloatFromYogaFloat(float value); + +/** + * Converts compound `YGValue` to simple `CGFloat` value. + */ +RCT_EXTERN CGFloat RCTCoreGraphicsFloatFromYogaValue(YGValue value, CGFloat baseFloatValue); + +/** + * Converts `YGDirection` to `UIUserInterfaceLayoutDirection` and vise versa. + */ +RCT_EXTERN YGDirection RCTYogaLayoutDirectionFromUIKitLayoutDirection(UIUserInterfaceLayoutDirection direction); +RCT_EXTERN UIUserInterfaceLayoutDirection RCTUIKitLayoutDirectionFromYogaLayoutDirection(YGDirection direction); + +/** + * Converts `YGDisplay` to `RCTDisplayType` and vise versa. + */ +RCT_EXTERN YGDisplay RCTYogaDisplayTypeFromReactDisplayType(RCTDisplayType displayType); +RCT_EXTERN RCTDisplayType RCTReactDisplayTypeFromYogaDisplayType(YGDisplay displayType); + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayoutAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayoutAnimation.h new file mode 100644 index 0000000..e907a99 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayoutAnimation.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTLayoutAnimation : NSObject + +@property (nonatomic, readonly) NSTimeInterval duration; +@property (nonatomic, readonly) NSTimeInterval delay; +@property (nonatomic, readonly, copy) NSString *property ; +@property (nonatomic, readonly) CGFloat springDamping; +@property (nonatomic, readonly) CGFloat initialVelocity; +@property (nonatomic, readonly) RCTAnimationType animationType; + ++ (void)initializeStatics; + +- (instancetype)initWithDuration:(NSTimeInterval)duration + delay:(NSTimeInterval)delay + property:(NSString *)property + springDamping:(CGFloat)springDamping + initialVelocity:(CGFloat)initialVelocity + animationType:(RCTAnimationType)animationType; + +- (instancetype)initWithDuration:(NSTimeInterval)duration config:(NSDictionary *)config; + +- (void)performAnimations:(void (^)(void))animations withCompletionBlock:(void (^)(BOOL completed))completionBlock; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayoutAnimationGroup.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayoutAnimationGroup.h new file mode 100644 index 0000000..f13d046 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLayoutAnimationGroup.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@class RCTLayoutAnimation; + +@interface RCTLayoutAnimationGroup : NSObject + +@property (nonatomic, readonly) RCTLayoutAnimation *creatingLayoutAnimation; +@property (nonatomic, readonly) RCTLayoutAnimation *updatingLayoutAnimation; +@property (nonatomic, readonly) RCTLayoutAnimation *deletingLayoutAnimation; + +@property (nonatomic, copy) RCTResponseSenderBlock callback; + +- (instancetype)initWithCreatingLayoutAnimation:(RCTLayoutAnimation *)creatingLayoutAnimation + updatingLayoutAnimation:(RCTLayoutAnimation *)updatingLayoutAnimation + deletingLayoutAnimation:(RCTLayoutAnimation *)deletingLayoutAnimation + callback:(RCTResponseSenderBlock)callback; + +- (instancetype)initWithConfig:(NSDictionary *)config callback:(RCTResponseSenderBlock)callback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLinkingManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLinkingManager.h new file mode 100644 index 0000000..02de122 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLinkingManager.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 12000) /* __IPHONE_12_0 */ +#import +#endif +#import + +@interface RCTLinkingManager : RCTEventEmitter + ++ (BOOL)application:(nonnull UIApplication *)app + openURL:(nonnull NSURL *)URL + options:(nonnull NSDictionary *)options; + ++ (BOOL)application:(nonnull UIApplication *)application + openURL:(nonnull NSURL *)URL + sourceApplication:(nullable NSString *)sourceApplication + annotation:(nonnull id)annotation; + ++ (BOOL)application:(nonnull UIApplication *)application + continueUserActivity:(nonnull NSUserActivity *)userActivity + restorationHandler: + #if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= 12000) /* __IPHONE_12_0 */ + (nonnull void (^)(NSArray> *_Nullable))restorationHandler; + #else + (nonnull void (^)(NSArray *_Nullable))restorationHandler; + #endif + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLinkingPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLinkingPlugins.h new file mode 100644 index 0000000..17e3d6c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLinkingPlugins.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTLinkingPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTLinkingClassProvider(const char *name); + +// Lookup functions +Class RCTLinkingManagerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLocalAssetImageLoader.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLocalAssetImageLoader.h new file mode 100644 index 0000000..c04f21e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLocalAssetImageLoader.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTLocalAssetImageLoader : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLog.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLog.h new file mode 100644 index 0000000..0d79797 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLog.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +#ifndef RCTLOG_ENABLED +#define RCTLOG_ENABLED 1 +#endif + +/** + * Thresholds for logs to display a redbox. You can override these values when debugging + * in order to tweak the default logging behavior. + */ +#ifndef RCTLOG_REDBOX_LEVEL +#define RCTLOG_REDBOX_LEVEL RCTLogLevelError +#endif + +/** + * Logging macros. Use these to log information, warnings and errors in your + * own code. + */ +#define RCTLog(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__) +#define RCTLogTrace(...) _RCTLog(RCTLogLevelTrace, __VA_ARGS__) +#define RCTLogInfo(...) _RCTLog(RCTLogLevelInfo, __VA_ARGS__) +#define RCTLogAdvice(string, ...) RCTLogWarn([@"(ADVICE) " stringByAppendingString:(NSString *)string], __VA_ARGS__) +#define RCTLogWarn(...) _RCTLog(RCTLogLevelWarning, __VA_ARGS__) +#define RCTLogError(...) _RCTLog(RCTLogLevelError, __VA_ARGS__) + +/** + * An enum representing the severity of the log message. + */ +typedef NS_ENUM(NSInteger, RCTLogLevel) { + RCTLogLevelTrace = 0, + RCTLogLevelInfo = 1, + RCTLogLevelWarning = 2, + RCTLogLevelError = 3, + RCTLogLevelFatal = 4 +}; + +/** + * An enum representing the source of a log message. + */ +typedef NS_ENUM(NSInteger, RCTLogSource) { RCTLogSourceNative = 1, RCTLogSourceJavaScript = 2 }; + +/** + * A block signature to be used for custom logging functions. In most cases you + * will want to pass these arguments to the RCTFormatLog function in order to + * generate a string. + */ +typedef void (^RCTLogFunction)( + RCTLogLevel level, + RCTLogSource source, + NSString *fileName, + NSNumber *lineNumber, + NSString *message); + +/** + * A method to generate a string from a collection of log data. To omit any + * particular data from the log, just pass nil or zero for the argument. + */ +RCT_EXTERN NSString * +RCTFormatLog(NSDate *timestamp, RCTLogLevel level, NSString *fileName, NSNumber *lineNumber, NSString *message); + +/** + * A method to generate a string RCTLogLevel + */ +RCT_EXTERN NSString *RCTFormatLogLevel(RCTLogLevel); + +/** + * A method to generate a string from a RCTLogSource + */ +RCT_EXTERN NSString *RCTFormatLogSource(RCTLogSource); + +/** + * The default logging function used by RCTLogXX. + */ +extern RCTLogFunction RCTDefaultLogFunction; + +/** + * These methods get and set the global logging threshold. This is the level + * below which logs will be ignored. Default is RCTLogLevelInfo for debug and + * RCTLogLevelError for production. + */ +RCT_EXTERN void RCTSetLogThreshold(RCTLogLevel threshold); +RCT_EXTERN RCTLogLevel RCTGetLogThreshold(void); + +/** + * These methods get and set the global logging function called by the RCTLogXX + * macros. You can use these to replace the standard behavior with custom log + * functionality. + */ +RCT_EXTERN void RCTSetLogFunction(RCTLogFunction logFunction); +RCT_EXTERN RCTLogFunction RCTGetLogFunction(void); + +/** + * This appends additional code to the existing log function, without replacing + * the existing functionality. Useful if you just want to forward logs to an + * extra service without changing the default behavior. + */ +RCT_EXTERN void RCTAddLogFunction(RCTLogFunction logFunction); + +/** + * This method temporarily overrides the log function while performing the + * specified block. This is useful for testing purposes (to detect if a given + * function logs something) or to suppress or override logging temporarily. + */ +RCT_EXTERN void RCTPerformBlockWithLogFunction(void (^block)(void), RCTLogFunction logFunction); + +/** + * This method adds a conditional prefix to any messages logged within the scope + * of the passed block. This is useful for adding additional context to log + * messages. The block will be performed synchronously on the current thread. + */ +RCT_EXTERN void RCTPerformBlockWithLogPrefix(void (^block)(void), NSString *prefix); + +/** + * Private logging function - ignore this. + */ +#if RCTLOG_ENABLED +#define _RCTLog(lvl, ...) _RCTLogNativeInternal(lvl, __FILE__, __LINE__, __VA_ARGS__) +#else +#define _RCTLog(lvl, ...) \ + do { \ + } while (0) +#endif + +RCT_EXTERN void _RCTLogNativeInternal(RCTLogLevel, const char *, int, NSString *, ...) NS_FORMAT_FUNCTION(4, 5); +RCT_EXTERN void _RCTLogJavaScriptInternal(RCTLogLevel, NSString *); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLogBox.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLogBox.h new file mode 100644 index 0000000..e3bf6ad --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLogBox.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RCTLogBoxView.h" + +@interface RCTLogBox : NSObject + +#if RCT_DEV_MENU + +- (void)setRCTLogBoxView:(RCTLogBoxView *)view; + +#endif + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLogBoxView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLogBoxView.h new file mode 100644 index 0000000..7c05bcb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTLogBoxView.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTLogBoxView : UIWindow + +- (instancetype)initWithFrame:(CGRect)frame; + +- (void)createRootViewController:(UIView *)view; + +- (instancetype)initWithFrame:(CGRect)frame bridge:(RCTBridge *)bridge; + +- (void)show; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMacros.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMacros.h new file mode 100644 index 0000000..9144bbe --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMacros.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#define _CONCAT(A, B) A##B +#define CONCAT(A, B) _CONCAT(A, B) + +#if !defined(PIC_MODIFIER) +#define PIC_MODIFIER +#endif + +#define SYMBOL_NAME(name) CONCAT(__USER_LABEL_PREFIX__, name) +#define SYMBOL_NAME_PIC(name) CONCAT(SYMBOL_NAME(name), PIC_MODIFIER) diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTManagedPointer.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTManagedPointer.h new file mode 100644 index 0000000..4ed6616 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTManagedPointer.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifdef __cplusplus + +#include + +#import + +/** + * Type erased wrapper over any cxx value that can be passed as an argument + * to native method. + */ + +@interface RCTManagedPointer : NSObject + +@property (nonatomic, readonly) void *voidPointer; + +- (instancetype)initWithPointer:(std::shared_ptr)pointer; + +@end + +namespace facebook { +namespace react { + +template +RCTManagedPointer *managedPointer(P initializer) +{ + auto ptr = std::shared_ptr(new T(initializer)); + return [[RCTManagedPointer alloc] initWithPointer:std::move(ptr)]; +} + +} +} + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMaskedView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMaskedView.h new file mode 100644 index 0000000..4628240 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMaskedView.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTMaskedView : RCTView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMaskedViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMaskedViewManager.h new file mode 100644 index 0000000..a37f85a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMaskedViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTMaskedViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostView.h new file mode 100644 index 0000000..01d3861 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostView.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; +@class RCTModalHostViewController; + +@protocol RCTModalHostViewInteractor; + +@interface RCTModalHostView : UIView + +@property (nonatomic, copy) NSString *animationType; +@property (nonatomic, assign) UIModalPresentationStyle presentationStyle; +@property (nonatomic, assign, getter=isTransparent) BOOL transparent; + +@property (nonatomic, copy) RCTDirectEventBlock onShow; +@property (nonatomic, assign) BOOL visible; + +@property (nonatomic, copy) NSNumber *identifier; + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, copy) NSArray *supportedOrientations; +@property (nonatomic, copy) RCTDirectEventBlock onOrientationChange; + +// Fabric only +@property (nonatomic, copy) RCTBubblingEventBlock onDismiss; + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +@end + +@protocol RCTModalHostViewInteractor + +- (void)presentModalHostView:(RCTModalHostView *)modalHostView + withViewController:(RCTModalHostViewController *)viewController + animated:(BOOL)animated; +- (void)dismissModalHostView:(RCTModalHostView *)modalHostView + withViewController:(RCTModalHostViewController *)viewController + animated:(BOOL)animated; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostViewController.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostViewController.h new file mode 100644 index 0000000..a3f66b6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostViewController.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTModalHostViewController : UIViewController + +@property (nonatomic, copy) void (^boundsDidChangeBlock)(CGRect newBounds); + +@property (nonatomic, assign) UIInterfaceOrientationMask supportedInterfaceOrientations; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostViewManager.h new file mode 100644 index 0000000..e5b0815 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalHostViewManager.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTConvert (RCTModalHostView) + ++ (UIModalPresentationStyle)UIModalPresentationStyle:(id)json; + +@end + +typedef void (^RCTModalViewInteractionBlock)( + UIViewController *reactViewController, + UIViewController *viewController, + BOOL animated, + dispatch_block_t completionBlock); + +@interface RCTModalHostViewManager : RCTViewManager + +/** + * `presentationBlock` and `dismissalBlock` allow you to control how a Modal interacts with your case, + * e.g. in case you have a native navigator that has its own way to display a modal. + * If these are not specified, it falls back to the UIViewController standard way of presenting. + */ +@property (nonatomic, strong) RCTModalViewInteractionBlock presentationBlock; +@property (nonatomic, strong) RCTModalViewInteractionBlock dismissalBlock; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalManager.h new file mode 100644 index 0000000..4fbe6df --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModalManager.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTModalManager : RCTEventEmitter + +- (void)modalDismissed:(NSNumber *)modalID; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuleData.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuleData.h new file mode 100644 index 0000000..71e1950 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuleData.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import "RCTDefines.h" + +@protocol RCTBridgeMethod; +@protocol RCTBridgeModule; +@class RCTBridge; +@class RCTModuleRegistry; +@class RCTViewRegistry; +@class RCTBundleManager; +@class RCTCallableJSModules; + +typedef id (^RCTBridgeModuleProvider)(void); + +@interface RCTModuleData : NSObject + +- (instancetype)initWithModuleClass:(Class)moduleClass + bridge:(RCTBridge *)bridge + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules; + +- (instancetype)initWithModuleClass:(Class)moduleClass + moduleProvider:(RCTBridgeModuleProvider)moduleProvider + bridge:(RCTBridge *)bridge + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithModuleInstance:(id)instance + bridge:(RCTBridge *)bridge + moduleRegistry:(RCTModuleRegistry *)moduleRegistry + viewRegistry_DEPRECATED:(RCTViewRegistry *)viewRegistry_DEPRECATED + bundleManager:(RCTBundleManager *)bundleManager + callableJSModules:(RCTCallableJSModules *)callableJSModules NS_DESIGNATED_INITIALIZER; + +/** + * Calls `constantsToExport` on the module and stores the result. Note that + * this will init the module if it has not already been created. This method + * can be called on any thread, but may block the main thread briefly if the + * module implements `constantsToExport`. + */ +- (void)gatherConstants; + +@property (nonatomic, strong, readonly) Class moduleClass; +@property (nonatomic, copy, readonly) NSString *name; + +/** + * Returns the module methods. Note that this will gather the methods the first + * time it is called and then memoize the results. + */ +@property (nonatomic, copy, readonly) NSArray> *methods; + +/** + * Returns a map of the module methods. Note that this will gather the methods the first + * time it is called and then memoize the results. + */ +@property (nonatomic, copy, readonly) NSDictionary> *methodsByName; + +/** + * Returns the module's constants, if it exports any + */ +@property (nonatomic, copy, readonly) NSDictionary *exportedConstants; + +/** + * Returns YES if module instance has already been initialized; NO otherwise. + */ +@property (nonatomic, assign, readonly) BOOL hasInstance; + +/** + * Returns YES if module instance must be created on the main thread. + */ +@property (nonatomic, assign) BOOL requiresMainQueueSetup; + +/** + * Returns YES if module has constants to export. + */ +@property (nonatomic, assign, readonly) BOOL hasConstantsToExport; + +/** + * Returns the current module instance. Note that this will init the instance + * if it has not already been created. To check if the module instance exists + * without causing it to be created, use `hasInstance` instead. + */ +@property (nonatomic, strong, readwrite) id instance; + +/** + * Returns the module method dispatch queue. Note that this will init both the + * queue and the module itself if they have not already been created. + */ +@property (nonatomic, strong, readonly) dispatch_queue_t methodQueue; + +/** + * Whether the receiver has a valid `instance` which implements -batchDidComplete. + */ +@property (nonatomic, assign, readonly) BOOL implementsBatchDidComplete; + +/** + * Whether the receiver has a valid `instance` which implements + * -partialBatchDidFlush. + */ +@property (nonatomic, assign, readonly) BOOL implementsPartialBatchDidFlush; + +@end + +RCT_EXTERN void RCTSetIsMainQueueExecutionOfConstantsToExportDisabled(BOOL val); +RCT_EXTERN BOOL RCTIsMainQueueExecutionOfConstantsToExportDisabled(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuleMethod.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuleMethod.h new file mode 100644 index 0000000..c93a060 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuleMethod.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; + +@interface RCTMethodArgument : NSObject + +@property (nonatomic, copy, readonly) NSString *type; +@property (nonatomic, readonly) RCTNullability nullability; +@property (nonatomic, readonly) BOOL unused; + +@end + +@interface RCTModuleMethod : NSObject + +@property (nonatomic, readonly) Class moduleClass; +@property (nonatomic, readonly) SEL selector; + +- (instancetype)initWithExportedMethod:(const RCTMethodInfo *)exportMethod + moduleClass:(Class)moduleClass NS_DESIGNATED_INITIALIZER; + +@end + +RCT_EXTERN NSString *RCTParseMethodSignature(const char *input, NSArray **arguments); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuloAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuloAnimatedNode.h new file mode 100644 index 0000000..fc7f69d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTModuloAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTModuloAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultilineTextInputView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultilineTextInputView.h new file mode 100644 index 0000000..0efd63a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultilineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultilineTextInputViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultilineTextInputViewManager.h new file mode 100644 index 0000000..3347fbb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultilineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultipartDataTask.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultipartDataTask.h new file mode 100644 index 0000000..bcf0c57 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultipartDataTask.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +typedef void (^RCTMultipartDataTaskCallback)( + NSInteger statusCode, + NSDictionary *headers, + NSData *content, + NSError *error, + BOOL done); + +@interface RCTMultipartDataTask : NSObject + +- (instancetype)initWithURL:(NSURL *)url + partHandler:(RCTMultipartDataTaskCallback)partHandler + progressHandler:(RCTMultipartProgressCallback)progressHandler; + +- (void)startTask; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultipartStreamReader.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultipartStreamReader.h new file mode 100644 index 0000000..5ef5b61 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultipartStreamReader.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef void (^RCTMultipartCallback)(NSDictionary *headers, NSData *content, BOOL done); +typedef void (^RCTMultipartProgressCallback)(NSDictionary *headers, NSNumber *loaded, NSNumber *total); + +// RCTMultipartStreamReader can be used to parse responses with Content-Type: multipart/mixed +// See https://www.w3.org/Protocols/rfc1341/7_2_Multipart.html +@interface RCTMultipartStreamReader : NSObject + +- (instancetype)initWithInputStream:(NSInputStream *)stream boundary:(NSString *)boundary; +- (BOOL)readAllPartsWithCompletionCallback:(RCTMultipartCallback)callback + progressCallback:(RCTMultipartProgressCallback)progressCallback; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultiplicationAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultiplicationAnimatedNode.h new file mode 100644 index 0000000..bb8b3b2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTMultiplicationAnimatedNode.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTMultiplicationAnimatedNode : RCTValueAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedModule.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedModule.h new file mode 100644 index 0000000..13b40fd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedModule.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import +#import +#import +#import + +#import "RCTValueAnimatedNode.h" + +// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. +// NOTE: This module is temporarily forked (see RCTNativeAnimatedTurboModule). +// When making any changes, be sure to apply them to the fork as well. +@interface RCTNativeAnimatedModule : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedNodesManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedNodesManager.h new file mode 100644 index 0000000..7832538 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedNodesManager.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import +#import + +@protocol RCTValueAnimatedNodeObserver; + +@interface RCTNativeAnimatedNodesManager : NSObject + +- (nonnull instancetype)initWithBridge:(RCTBridge *)bridge + surfacePresenter:(id)surfacePresenter; + +- (void)updateAnimations; + +- (void)stepAnimations:(nonnull CADisplayLink *)displaylink; + +- (BOOL)isNodeManagedByFabric:(nonnull NSNumber *)tag; + +- (void)getValue:(nonnull NSNumber *)nodeTag + saveCallback:(nullable RCTResponseSenderBlock)saveCallback; + +// graph + +- (void)createAnimatedNode:(nonnull NSNumber *)tag + config:(NSDictionary *__nonnull)config; + +- (void)connectAnimatedNodes:(nonnull NSNumber *)parentTag + childTag:(nonnull NSNumber *)childTag; + +- (void)disconnectAnimatedNodes:(nonnull NSNumber *)parentTag + childTag:(nonnull NSNumber *)childTag; + +- (void)connectAnimatedNodeToView:(nonnull NSNumber *)nodeTag + viewTag:(nonnull NSNumber *)viewTag + viewName:(nonnull NSString *)viewName; + +- (void)restoreDefaultValues:(nonnull NSNumber *)nodeTag; + +- (void)disconnectAnimatedNodeFromView:(nonnull NSNumber *)nodeTag + viewTag:(nonnull NSNumber *)viewTag; + +- (void)dropAnimatedNode:(nonnull NSNumber *)tag; + +// mutations + +- (void)setAnimatedNodeValue:(nonnull NSNumber *)nodeTag + value:(nonnull NSNumber *)value; + +- (void)setAnimatedNodeOffset:(nonnull NSNumber *)nodeTag + offset:(nonnull NSNumber *)offset; + +- (void)flattenAnimatedNodeOffset:(nonnull NSNumber *)nodeTag; + +- (void)extractAnimatedNodeOffset:(nonnull NSNumber *)nodeTag; + +// drivers + +- (void)startAnimatingNode:(nonnull NSNumber *)animationId + nodeTag:(nonnull NSNumber *)nodeTag + config:(NSDictionary *__nonnull)config + endCallback:(nullable RCTResponseSenderBlock)callBack; + +- (void)stopAnimation:(nonnull NSNumber *)animationId; + +- (void)stopAnimationLoop; + +// events + +- (void)addAnimatedEventToView:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + eventMapping:(NSDictionary *__nonnull)eventMapping; + +- (void)removeAnimatedEventFromView:(nonnull NSNumber *)viewTag + eventName:(nonnull NSString *)eventName + animatedNodeTag:(nonnull NSNumber *)animatedNodeTag; + +- (void)handleAnimatedEvent:(nonnull id)event; + +// listeners + +- (void)startListeningToAnimatedNodeValue:(nonnull NSNumber *)tag + valueObserver:(nonnull id)valueObserver; + +- (void)stopListeningToAnimatedNodeValue:(nonnull NSNumber *)tag; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedTurboModule.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedTurboModule.h new file mode 100644 index 0000000..2da04a1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNativeAnimatedTurboModule.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import +#import +#import +#import + +#import "RCTValueAnimatedNode.h" + +// TODO T69437152 @petetheheat - Delete this fork when Fabric ships to 100%. +// NOTE: This module is temporarily forked (see RCTNativeAnimatedModule). +// When making any changes, be sure to apply them to the fork as well. +@interface RCTNativeAnimatedTurboModule: RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworkPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworkPlugins.h new file mode 100644 index 0000000..b8ea7cd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworkPlugins.h @@ -0,0 +1,43 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTNetworkPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTNetworkClassProvider(const char *name); + +// Lookup functions +Class RCTNetworkingCls(void) __attribute__((used)); +Class RCTDataRequestHandlerCls(void) __attribute__((used)); +Class RCTFileRequestHandlerCls(void) __attribute__((used)); +Class RCTHTTPRequestHandlerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworkTask.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworkTask.h new file mode 100644 index 0000000..716a090 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworkTask.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +typedef void (^RCTURLRequestCompletionBlock)(NSURLResponse *response, NSData *data, NSError *error); +typedef void (^RCTURLRequestCancellationBlock)(void); +typedef void (^RCTURLRequestIncrementalDataBlock)(NSData *data, int64_t progress, int64_t total); +typedef void (^RCTURLRequestProgressBlock)(int64_t progress, int64_t total); +typedef void (^RCTURLRequestResponseBlock)(NSURLResponse *response); + +typedef NS_ENUM(NSInteger, RCTNetworkTaskStatus) { + RCTNetworkTaskPending = 0, + RCTNetworkTaskInProgress, + RCTNetworkTaskFinished, +}; + +@interface RCTNetworkTask : NSObject + +@property (nonatomic, readonly) NSURLRequest *request; +@property (nonatomic, readonly) NSNumber *requestID; +@property (nonatomic, readonly, weak) id requestToken; +@property (nonatomic, readonly) NSURLResponse *response; + +@property (nonatomic, copy) RCTURLRequestCompletionBlock completionBlock; +@property (nonatomic, copy) RCTURLRequestProgressBlock downloadProgressBlock; +@property (nonatomic, copy) RCTURLRequestIncrementalDataBlock incrementalDataBlock; +@property (nonatomic, copy) RCTURLRequestResponseBlock responseBlock; +@property (nonatomic, copy) RCTURLRequestProgressBlock uploadProgressBlock; + +@property (nonatomic, readonly) RCTNetworkTaskStatus status; + +- (instancetype)initWithRequest:(NSURLRequest *)request + handler:(id)handler + callbackQueue:(dispatch_queue_t)callbackQueue NS_DESIGNATED_INITIALIZER; + +- (void)start; +- (void)cancel; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworking.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworking.h new file mode 100644 index 0000000..2068f32 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNetworking.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@protocol RCTNetworkingRequestHandler + +// @lint-ignore FBOBJCUNTYPEDCOLLECTION1 +- (BOOL)canHandleNetworkingRequest:(NSDictionary *)data; +// @lint-ignore FBOBJCUNTYPEDCOLLECTION1 +- (NSDictionary *)handleNetworkingRequest:(NSDictionary *)data; + +@end + +@protocol RCTNetworkingResponseHandler + +- (BOOL)canHandleNetworkingResponse:(NSString *)responseType; +- (id)handleNetworkingResponse:(NSURLResponse *)response data:(NSData *)data; + +@end + +@interface RCTNetworking : RCTEventEmitter + +/** + * Allows RCTNetworking instances to be initialized with handlers. + * The handlers will be requested via the bridge's moduleForName method when required. + */ +- (instancetype)initWithHandlersProvider:(NSArray> * (^)(RCTModuleRegistry *))getHandlers; + +/** + * Does a handler exist for the specified request? + */ +- (BOOL)canHandleRequest:(NSURLRequest *)request; + +/** + * Return an RCTNetworkTask for the specified request. This is useful for + * invoking the React Native networking stack from within native code. + */ +- (RCTNetworkTask *)networkTaskWithRequest:(NSURLRequest *)request + completionBlock:(RCTURLRequestCompletionBlock)completionBlock; + +- (void)addRequestHandler:(id)handler; + +- (void)addResponseHandler:(id)handler; + +- (void)removeRequestHandler:(id)handler; + +- (void)removeResponseHandler:(id)handler; + +@end + +@interface RCTBridge (RCTNetworking) + +@property (nonatomic, readonly) RCTNetworking *networking; + +@end + +// HACK: When uploading images/video from PHAssetLibrary, we change the URL scheme to be +// ph-upload://. This is to ensure that we upload a full video when given a ph-upload:// URL, +// instead of just the thumbnail. Consider the following problem: +// The user has a video in their camera roll with URL ph://1B3E2DDB-0AD3-4E33-A7A1-9F4AA9A762AA/L0/001 +// 1. We want to display that video in an and show the thumbnail +// 2. We later want to upload that video. +// At this point, if we use the same URL for both uses, there is no way to distinguish the intent +// and we will either upload the thumbnail (bad!) or try to show the video in an (bad!). +// Our solution is to change the URL scheme in the uploader. +extern NSString *const RCTNetworkingPHUploadHackScheme; diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNullability.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNullability.h new file mode 100644 index 0000000..f08d276 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTNullability.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSUInteger, RCTNullability) { + RCTNullabilityUnspecified, + RCTNullable, + RCTNonnullable, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPackagerClient.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPackagerClient.h new file mode 100644 index 0000000..3a7a3fd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPackagerClient.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#if RCT_DEV // Only supported in dev mode + +@class RCTPackagerClientResponder; +@class RCTReconnectingWebSocket; + +#if defined(__cplusplus) +extern "C" { +#endif + +extern const int RCT_PACKAGER_CLIENT_PROTOCOL_VERSION; + +#if defined(__cplusplus) +} +#endif + +@protocol RCTPackagerClientMethod + +- (void)handleRequest:(NSDictionary *)params withResponder:(RCTPackagerClientResponder *)responder; +- (void)handleNotification:(NSDictionary *)params; + +@optional + +/** By default object will receive its methods on the main queue, unless this method is overridden. */ +- (dispatch_queue_t)methodQueue; + +@end + +@interface RCTPackagerClientResponder : NSObject + +- (instancetype)initWithId:(id)msgId socket:(RCTReconnectingWebSocket *)socket; +- (void)respondWithResult:(id)result; +- (void)respondWithError:(id)error; + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPackagerConnection.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPackagerConnection.h new file mode 100644 index 0000000..795a3fc --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPackagerConnection.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#if RCT_DEV + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTPackagerClientMethod; +@class RCTPackagerClientResponder; + +typedef uint32_t RCTHandlerToken; +typedef void (^RCTNotificationHandler)(NSDictionary *); +typedef void (^RCTRequestHandler)(NSDictionary *, RCTPackagerClientResponder *); +typedef void (^RCTConnectedHandler)(void); + +/** Encapsulates singleton connection to React Native packager. */ +@interface RCTPackagerConnection : NSObject + ++ (instancetype)sharedPackagerConnection; + +/** + * Registers a handler for a notification broadcast from the packager. An + * example is "reload" - an instruction to reload from the packager. + * If multiple notification handlers are registered for the same method, they + * will all be invoked sequentially. + */ +- (RCTHandlerToken)addNotificationHandler:(RCTNotificationHandler)handler + queue:(dispatch_queue_t)queue + forMethod:(NSString *)method; + +/** + * Registers a handler for a request from the packager. An example is + * pokeSamplingProfiler; it asks for profile data from the client. + * Only one handler can be registered for a given method; calling this + * displaces any previous request handler registered for that method. + */ +- (RCTHandlerToken)addRequestHandler:(RCTRequestHandler)handler + queue:(dispatch_queue_t)queue + forMethod:(NSString *)method; + +/** + * Registers a handler that runs at most once, when the connection to the + * packager has been established. The handler will be dispatched immediately + * if the connection is already established. + */ +- (RCTHandlerToken)addConnectedHandler:(RCTConnectedHandler)handler queue:(dispatch_queue_t)queue; + +/** Removes a handler. Silently does nothing if the token is not valid. */ +- (void)removeHandler:(RCTHandlerToken)token; + +/** Disconnects and removes all handlers. */ +- (void)stop; + +/** Reconnect with given packager server. */ +- (void)reconnect:(NSString *)packagerServerHostPort; + +/** + * Historically no distinction was made between notification and request + * handlers. If you use this method, it will be registered as *both* a + * notification handler *and* a request handler. You should migrate to the + * new block-based API instead. + */ +- (void)addHandler:(id)handler + forMethod:(NSString *)method __deprecated_msg("Use addRequestHandler or addNotificationHandler instead"); + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTParserUtils.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTParserUtils.h new file mode 100644 index 0000000..15701f4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTParserUtils.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTParserUtils : NSObject + +/** + * Generic utility functions for parsing Objective-C source code. + */ +RCT_EXTERN BOOL RCTReadChar(const char **input, char c); +RCT_EXTERN BOOL RCTReadString(const char **input, const char *string); +RCT_EXTERN void RCTSkipWhitespace(const char **input); +RCT_EXTERN BOOL RCTParseSelectorIdentifier(const char **input, NSString **string); +RCT_EXTERN BOOL RCTParseArgumentIdentifier(const char **input, NSString **string); + +/** + * Parse an Objective-C type into a form that can be used by RCTConvert. + * This doesn't really belong here, but it's used by both RCTConvert and + * RCTModuleMethod, which makes it difficult to find a better home for it. + */ +RCT_EXTERN NSString *RCTParseType(const char **input); + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPerformanceLogger.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPerformanceLogger.h new file mode 100644 index 0000000..b0e4a4e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPerformanceLogger.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +// Keep this in sync with _labelsForTags +typedef NS_ENUM(NSUInteger, RCTPLTag) { + RCTPLScriptDownload = 0, + RCTPLScriptExecution, + RCTPLRAMBundleLoad, + RCTPLRAMStartupCodeSize, + RCTPLRAMStartupNativeRequires, + RCTPLRAMStartupNativeRequiresCount, + RCTPLRAMNativeRequires, + RCTPLRAMNativeRequiresCount, + RCTPLNativeModuleInit, + RCTPLNativeModuleMainThread, + RCTPLNativeModulePrepareConfig, + RCTPLNativeModuleMainThreadUsesCount, + RCTPLNativeModuleSetup, + RCTPLTurboModuleSetup, + RCTPLJSCWrapperOpenLibrary, + RCTPLBridgeStartup, + RCTPLTTI, + RCTPLBundleSize, + RCTPLReactInstanceInit, + RCTPLSize // This is used to count the size +}; + +@interface RCTPerformanceLogger : NSObject + +/** + * Starts measuring a metric with the given tag. + * Overrides previous value if the measurement has been already started. + * If RCTProfile is enabled it also begins appropriate async event. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)markStartForTag:(RCTPLTag)tag; + +/** + * Stops measuring a metric with given tag. + * Checks if RCTPerformanceLoggerStart() has been called before + * and doesn't do anything and log a message if it hasn't. + * If RCTProfile is enabled it also ends appropriate async event. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)markStopForTag:(RCTPLTag)tag; + +/** + * Sets given value for a metric with given tag. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)setValue:(int64_t)value forTag:(RCTPLTag)tag; + +/** + * Adds given value to the current value for a metric with given tag. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)addValue:(int64_t)value forTag:(RCTPLTag)tag; + +/** + * Starts an additional measurement for a metric with given tag. + * It doesn't override previous measurement, instead it'll append a new value + * to the old one. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)appendStartForTag:(RCTPLTag)tag; + +/** + * Stops measurement and appends the result to the metric with given tag. + * Checks if RCTPerformanceLoggerAppendStart() has been called before + * and doesn't do anything and log a message if it hasn't. + * All work is scheduled on the background queue so this doesn't block current thread. + */ +- (void)appendStopForTag:(RCTPLTag)tag; + +/** + * Returns an array with values for all tags. + * Use RCTPLTag to go over the array, there's a pair of values + * for each tag: start and stop (with indexes 2 * tag and 2 * tag + 1). + */ +- (NSArray *)valuesForTags; + +/** + * Returns a duration in ms (stop_time - start_time) for given RCTPLTag. + */ +- (int64_t)durationForTag:(RCTPLTag)tag; + +/** + * Returns a value for given RCTPLTag. + */ +- (int64_t)valueForTag:(RCTPLTag)tag; + +/** + * Returns an array with values for all tags. + * Use RCTPLTag to go over the array. + */ +- (NSArray *)labelsForTags; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPlatform.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPlatform.h new file mode 100644 index 0000000..64ce567 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPlatform.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTPlatform : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPointerEvents.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPointerEvents.h new file mode 100644 index 0000000..001c85f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPointerEvents.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTPointerEvents) { + RCTPointerEventsUnspecified = 0, // Default + RCTPointerEventsNone, + RCTPointerEventsBoxNone, + RCTPointerEventsBoxOnly, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTProfile.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTProfile.h new file mode 100644 index 0000000..7c6dec1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTProfile.h @@ -0,0 +1,226 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +/** + * RCTProfile + * + * This file provides a set of functions and macros for performance profiling + * + * NOTE: This API is a work in progress, please consider carefully before + * using it. + */ + +RCT_EXTERN NSString *const RCTProfileDidStartProfiling; +RCT_EXTERN NSString *const RCTProfileDidEndProfiling; + +RCT_EXTERN const uint64_t RCTProfileTagAlways; + +#if RCT_PROFILE + +@class RCTBridge; + +#define RCTProfileBeginFlowEvent() \ + _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wshadow\"") NSUInteger __rct_profile_flow_id = \ + _RCTProfileBeginFlowEvent(); \ + _Pragma("clang diagnostic pop") + +#define RCTProfileEndFlowEvent() _RCTProfileEndFlowEvent(__rct_profile_flow_id) + +RCT_EXTERN dispatch_queue_t RCTProfileGetQueue(void); + +RCT_EXTERN NSUInteger _RCTProfileBeginFlowEvent(void); +RCT_EXTERN void _RCTProfileEndFlowEvent(NSUInteger); + +/** + * Returns YES if the profiling information is currently being collected + */ +RCT_EXTERN BOOL RCTProfileIsProfiling(void); + +/** + * Start collecting profiling information + */ +RCT_EXTERN void RCTProfileInit(RCTBridge *); + +/** + * Stop profiling and return a JSON string of the collected data - The data + * returned is compliant with google's trace event format - the format used + * as input to trace-viewer + */ +RCT_EXTERN void RCTProfileEnd(RCTBridge *, void (^)(NSString *)); + +/** + * Collects the initial event information for the event and returns a reference ID + */ +RCT_EXTERN void _RCTProfileBeginEvent( + NSThread *calleeThread, + NSTimeInterval time, + uint64_t tag, + NSString *name, + NSDictionary *args); +#define RCT_PROFILE_BEGIN_EVENT(tag, name, args) \ + do { \ + if (RCTProfileIsProfiling()) { \ + NSThread *__calleeThread = [NSThread currentThread]; \ + NSTimeInterval __time = CACurrentMediaTime(); \ + _RCTProfileBeginEvent(__calleeThread, __time, tag, name, args); \ + } \ + } while (0) + +/** + * The ID returned by BeginEvent should then be passed into EndEvent, with the + * rest of the event information. Just at this point the event will actually be + * registered + */ +RCT_EXTERN void _RCTProfileEndEvent( + NSThread *calleeThread, + NSString *threadName, + NSTimeInterval time, + uint64_t tag, + NSString *category); + +#define RCT_PROFILE_END_EVENT(tag, category) \ + do { \ + if (RCTProfileIsProfiling()) { \ + NSThread *__calleeThread = [NSThread currentThread]; \ + NSString *__threadName = RCTCurrentThreadName(); \ + NSTimeInterval __time = CACurrentMediaTime(); \ + _RCTProfileEndEvent(__calleeThread, __threadName, __time, tag, category); \ + } \ + } while (0) + +/** + * Collects the initial event information for the event and returns a reference ID + */ +RCT_EXTERN NSUInteger +RCTProfileBeginAsyncEvent(uint64_t tag, NSString *name, NSDictionary *args); + +/** + * The ID returned by BeginEvent should then be passed into EndEvent, with the + * rest of the event information. Just at this point the event will actually be + * registered + */ +RCT_EXTERN void +RCTProfileEndAsyncEvent(uint64_t tag, NSString *category, NSUInteger cookie, NSString *name, NSString *threadName); + +/** + * An event that doesn't have a duration (i.e. Notification, VSync, etc) + */ +RCT_EXTERN void RCTProfileImmediateEvent(uint64_t tag, NSString *name, NSTimeInterval time, char scope); + +/** + * Helper to profile the duration of the execution of a block. This method uses + * self and _cmd to name this event for simplicity sake. + * + * NOTE: The block can't expect any argument + * + * DEPRECATED: this approach breaks debugging and stepping through instrumented block functions + */ +#define RCTProfileBlock(block, tag, category, arguments) \ + ^{ \ + RCT_PROFILE_BEGIN_EVENT(tag, @(__PRETTY_FUNCTION__), nil); \ + block(); \ + RCT_PROFILE_END_EVENT(tag, category, arguments); \ + } + +/** + * Hook into a bridge instance to log all bridge module's method calls + */ +RCT_EXTERN void RCTProfileHookModules(RCTBridge *); + +/** + * Unhook from a given bridge instance's modules + */ +RCT_EXTERN void RCTProfileUnhookModules(RCTBridge *); + +/** + * Hook into all of a module's methods + */ +RCT_EXTERN void RCTProfileHookInstance(id instance); + +/** + * Send systrace or cpu profiling information to the packager + * to present to the user + */ +RCT_EXTERN void RCTProfileSendResult(RCTBridge *bridge, NSString *route, NSData *profileData); + +/** + * Systrace gluecode + * + * allow to use systrace to back RCTProfile + */ + +typedef struct { + const char *key; + unsigned long key_len; + const char *value; + unsigned long value_len; +} systrace_arg_t; + +typedef struct { + char *(*start)(void); + void (*stop)(void); + + void (*begin_section)(uint64_t tag, const char *name, size_t numArgs, systrace_arg_t *args); + void (*end_section)(uint64_t tag, size_t numArgs, systrace_arg_t *args); + + void (*begin_async_section)(uint64_t tag, const char *name, int cookie, size_t numArgs, systrace_arg_t *args); + void (*end_async_section)(uint64_t tag, const char *name, int cookie, size_t numArgs, systrace_arg_t *args); + + void (*instant_section)(uint64_t tag, const char *name, char scope); + + void (*begin_async_flow)(uint64_t tag, const char *name, int cookie); + void (*end_async_flow)(uint64_t tag, const char *name, int cookie); +} RCTProfileCallbacks; + +RCT_EXTERN void RCTProfileRegisterCallbacks(RCTProfileCallbacks *); + +/** + * Systrace control window + */ +RCT_EXTERN void RCTProfileShowControls(void); +RCT_EXTERN void RCTProfileHideControls(void); + +#else + +#define RCTProfileBeginFlowEvent() +#define _RCTProfileBeginFlowEvent() @0 + +#define RCTProfileEndFlowEvent() +#define _RCTProfileEndFlowEvent(...) + +#define RCTProfileIsProfiling(...) NO +#define RCTProfileInit(...) +#define RCTProfileEnd(...) @"" + +#define _RCTProfileBeginEvent(...) +#define _RCTProfileEndEvent(...) + +#define RCT_PROFILE_BEGIN_EVENT(...) +#define RCT_PROFILE_END_EVENT(...) + +#define RCTProfileBeginAsyncEvent(...) 0 +#define RCTProfileEndAsyncEvent(...) + +#define RCTProfileImmediateEvent(...) + +#define RCTProfileBlock(block, ...) block + +#define RCTProfileHookModules(...) +#define RCTProfileHookInstance(...) +#define RCTProfileUnhookModules(...) + +#define RCTProfileSendResult(...) + +#define RCTProfileShowControls(...) +#define RCTProfileHideControls(...) + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTProgressViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTProgressViewManager.h new file mode 100644 index 0000000..32b0988 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTProgressViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTProgressViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPropsAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPropsAnimatedNode.h new file mode 100644 index 0000000..0b5f532 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTPropsAnimatedNode.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + +#import + +@class RCTBridge; +@class RCTViewPropertyMapper; + +@interface RCTPropsAnimatedNode : RCTAnimatedNode + +- (void)connectToView:(NSNumber *)viewTag + viewName:(NSString *)viewName + bridge:(RCTBridge *)bridge + surfacePresenter:(id)surfacePresenter; + +- (void)disconnectFromView:(NSNumber *)viewTag; + +- (void)restoreDefaultValues; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRawTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRawTextShadowView.h new file mode 100644 index 0000000..1b63014 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRawTextShadowView.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextShadowView : RCTShadowView + +@property (nonatomic, copy, nullable) NSString *text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRawTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRawTextViewManager.h new file mode 100644 index 0000000..ef9a076 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRawTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTReconnectingWebSocket.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTReconnectingWebSocket.h new file mode 100644 index 0000000..25aa3ef --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTReconnectingWebSocket.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#if RCT_DEV // Only supported in dev mode + +@class RCTReconnectingWebSocket; + +@protocol RCTReconnectingWebSocketDelegate +- (void)reconnectingWebSocketDidOpen:(RCTReconnectingWebSocket *)webSocket; +- (void)reconnectingWebSocket:(RCTReconnectingWebSocket *)webSocket didReceiveMessage:(id)message; +/** Sent when the socket has closed due to error or clean shutdown. An automatic reconnect will start shortly. */ +- (void)reconnectingWebSocketDidClose:(RCTReconnectingWebSocket *)webSocket; +@end + +@interface RCTReconnectingWebSocket : NSObject + +/** Delegate will be messaged on the given queue (required). */ +- (instancetype)initWithURL:(NSURL *)url queue:(dispatch_queue_t)queue; + +@property (nonatomic, weak) id delegate; +- (void)send:(id)data; +- (void)start; +- (void)stop; + +- (instancetype)initWithURL:(NSURL *)url __deprecated_msg("Use initWithURL:queue: instead"); +/** @brief Must be set before -start to have effect */ +@property (nonatomic, strong) dispatch_queue_t delegateDispatchQueue __deprecated_msg("Use initWithURL:queue: instead"); + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBox.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBox.h new file mode 100644 index 0000000..d468f44 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBox.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTJSStackFrame; + +typedef void (^RCTRedBoxButtonPressHandler)(void); + +@interface RCTRedBox : NSObject + +- (void)registerErrorCustomizer:(id)errorCustomizer; +- (void)showError:(NSError *)error; +- (void)showErrorMessage:(NSString *)message; +- (void)showErrorMessage:(NSString *)message withDetails:(NSString *)details; +- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack; +- (void)showErrorMessage:(NSString *)message withRawStack:(NSString *)rawStack errorCookie:(int)errorCookie; +- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack; +- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack; +- (void)showErrorMessage:(NSString *)message withStack:(NSArray *)stack errorCookie:(int)errorCookie; +- (void)updateErrorMessage:(NSString *)message withStack:(NSArray *)stack errorCookie:(int)errorCookie; +- (void)showErrorMessage:(NSString *)message withParsedStack:(NSArray *)stack; +- (void)updateErrorMessage:(NSString *)message withParsedStack:(NSArray *)stack; +- (void)showErrorMessage:(NSString *)message + withParsedStack:(NSArray *)stack + errorCookie:(int)errorCookie; +- (void)updateErrorMessage:(NSString *)message + withParsedStack:(NSArray *)stack + errorCookie:(int)errorCookie; + +- (void)dismiss; + +- (void)addCustomButton:(NSString *)title onPressHandler:(RCTRedBoxButtonPressHandler)handler; + +/** Overrides bridge.bundleURL. Modify on main thread only. You shouldn't need to use this. */ +@property (nonatomic, strong) NSURL *overrideBundleURL; + +/** Overrides the default behavior of calling [bridge reload] on reload. You shouldn't need to use this. */ +@property (nonatomic, strong) dispatch_block_t overrideReloadAction; + +@end + +/** + * This category makes the red box instance available via the RCTBridge, which + * is useful for any class that needs to access the red box or error log. + */ +@interface RCTBridge (RCTRedBox) + +@property (nonatomic, readonly) RCTRedBox *redBox; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBoxExtraDataViewController.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBoxExtraDataViewController.h new file mode 100644 index 0000000..8d2b4c2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBoxExtraDataViewController.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTRedBoxExtraDataActionDelegate +- (void)reload; +@end + +@interface RCTRedBoxExtraDataViewController : UIViewController + +@property (nonatomic, weak) id actionDelegate; + +- (void)addExtraData:(NSDictionary *)data forIdentifier:(NSString *)identifier; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBoxSetEnabled.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBoxSetEnabled.h new file mode 100644 index 0000000..fd53eb7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRedBoxSetEnabled.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +// In debug builds, the red box is enabled by default but it is further +// customizable using this method. However, this method only has an effect in +// builds where RCTRedBox is actually compiled in. +RCT_EXTERN void RCTRedBoxSetEnabled(BOOL enabled); +RCT_EXTERN BOOL RCTRedBoxGetEnabled(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshControl.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshControl.h new file mode 100644 index 0000000..c17b226 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshControl.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTRefreshControl : UIRefreshControl + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, copy) RCTDirectEventBlock onRefresh; +@property (nonatomic, weak) UIScrollView *scrollView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshControlManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshControlManager.h new file mode 100644 index 0000000..107a9db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshControlManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTRefreshControlManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshableProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshableProtocol.h new file mode 100644 index 0000000..9271e2d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRefreshableProtocol.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * Protocol used to dispatch commands in `RCTRefreshControlManager.h`. + * This is in order to support commands for both Paper and Fabric components + * during migration. + */ +@protocol RCTRefreshableProtocol + +- (void)setRefreshing:(BOOL)refreshing; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTReloadCommand.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTReloadCommand.h new file mode 100644 index 0000000..4846275 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTReloadCommand.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * A protocol which should be conformed to in order to be notified of RN reload events. These events can be + * created by CMD+R or dev menu during development, or anywhere the trigger is exposed to JS. + * The listener must also register itself using the method below. + */ +@protocol RCTReloadListener +- (void)didReceiveReloadCommand; +@end + +/** + * Registers a weakly-held observer of RN reload events. + */ +RCT_EXTERN void RCTRegisterReloadCommandListener(id listener); + +/** + * Triggers a reload for all current listeners. Replaces [_bridge reload]. + */ +RCT_EXTERN void RCTTriggerReloadCommandListeners(NSString *reason); + +/** + * This notification fires anytime RCTTriggerReloadCommandListeners() is called. + */ +RCT_EXTERN NSString *const RCTTriggerReloadCommandNotification; +RCT_EXTERN NSString *const RCTTriggerReloadCommandReasonKey; +RCT_EXTERN NSString *const RCTTriggerReloadCommandBundleURLKey; + +RCT_EXTERN void RCTReloadCommandSetBundleURL(NSURL *URL); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTResizeMode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTResizeMode.h new file mode 100644 index 0000000..468a58a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTResizeMode.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTResizeMode) { + RCTResizeModeCover = UIViewContentModeScaleAspectFill, + RCTResizeModeContain = UIViewContentModeScaleAspectFit, + RCTResizeModeStretch = UIViewContentModeScaleToFill, + RCTResizeModeCenter = UIViewContentModeCenter, + RCTResizeModeRepeat = -1, // Use negative values to avoid conflicts with iOS enum values. +}; + +@interface RCTConvert(RCTResizeMode) + ++ (RCTResizeMode)RCTResizeMode:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootContentView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootContentView.h new file mode 100644 index 0000000..dfc6d03 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootContentView.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@class RCTBridge; +@class RCTTouchHandler; + +@interface RCTRootContentView : RCTView + +@property (nonatomic, readonly, weak) RCTBridge *bridge; +@property (nonatomic, readonly, assign) BOOL contentHasAppeared; +@property (nonatomic, readonly, strong) RCTTouchHandler *touchHandler; +@property (nonatomic, readonly, assign) CGSize availableSize; + +@property (nonatomic, assign) BOOL passThroughTouches; +@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility; + +- (instancetype)initWithFrame:(CGRect)frame + bridge:(RCTBridge *)bridge + reactTag:(NSNumber *)reactTag + sizeFlexiblity:(RCTRootViewSizeFlexibility)sizeFlexibility NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootShadowView.h new file mode 100644 index 0000000..74af7e8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootShadowView.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTRootShadowView : RCTShadowView + +/** + * Minimum size to layout all views. + * Defaults to CGSizeZero + */ +@property (nonatomic, assign) CGSize minimumSize; + +/** + * Available size to layout all views. + * Defaults to {INFINITY, INFINITY} + */ +@property (nonatomic, assign) CGSize availableSize; + +/** + * Layout direction (LTR or RTL) inherited from native environment and + * is using as a base direction value in layout engine. + * Defaults to value inferred from current locale. + */ +@property (nonatomic, assign) YGDirection baseDirection; + +- (void)layoutWithAffectedShadowViews:(NSHashTable *)affectedShadowViews; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootView.h new file mode 100644 index 0000000..dd56345 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootView.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +@protocol RCTRootViewDelegate; + +/** + * This enum is used to define size flexibility type of the root view. + * If a dimension is flexible, the view will recalculate that dimension + * so the content fits. Recalculations are performed when the root's frame, + * size flexibility mode or content size changes. After a recalculation, + * rootViewDidChangeIntrinsicSize method of the RCTRootViewDelegate will be called. + */ +typedef NS_ENUM(NSInteger, RCTRootViewSizeFlexibility) { + RCTRootViewSizeFlexibilityNone = 0, + RCTRootViewSizeFlexibilityWidth = 1 << 0, + RCTRootViewSizeFlexibilityHeight = 1 << 1, + RCTRootViewSizeFlexibilityWidthAndHeight = RCTRootViewSizeFlexibilityWidth | RCTRootViewSizeFlexibilityHeight, +}; + +/** + * This notification is sent when the first subviews are added to the root view + * after the application has loaded. This is used to hide the `loadingView`, and + * is a good indicator that the application is ready to use. + */ +#if defined(__cplusplus) +extern "C" +#else +extern +#endif + + NS_ASSUME_NONNULL_BEGIN + + NSString *const RCTContentDidAppearNotification; + +/** + * Native view used to host React-managed views within the app. Can be used just + * like any ordinary UIView. You can have multiple RCTRootViews on screen at + * once, all controlled by the same JavaScript application. + */ +@interface RCTRootView : UIView + +/** + * - Designated initializer - + */ +- (instancetype)initWithFrame:(CGRect)frame + bridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(nullable NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER; + +/** + * - Convenience initializer - + * The frame will default to CGRectZero. + */ +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(nullable NSDictionary *)initialProperties; + +/** + * - Convenience initializer - + * A bridge will be created internally. + * This initializer is intended to be used when the app has a single RCTRootView, + * otherwise create an `RCTBridge` and pass it in via `initWithBridge:moduleName:` + * to all the instances. + */ +- (instancetype)initWithBundleURL:(NSURL *)bundleURL + moduleName:(NSString *)moduleName + initialProperties:(nullable NSDictionary *)initialProperties + launchOptions:(nullable NSDictionary *)launchOptions; + +/** + * This API allows RCTRootView users to know if the root view is backed by the bridge. + */ +@property (nonatomic, readonly) BOOL hasBridge; + +/** + * This API allows users of RCTRootView to access other NativeModules, without + * directly accessing the bridge. + */ +@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; + +@property (nonatomic, strong, readonly) id eventDispatcher; + +/** + * The name of the JavaScript module to execute within the + * specified scriptURL (required). Setting this will not have + * any immediate effect, but it must be done prior to loading + * the script. + */ +@property (nonatomic, copy, readonly) NSString *moduleName; + +/** + * The bridge used by the root view. Bridges can be shared between multiple + * root views, so you can use this property to initialize another RCTRootView. + */ +@property (nonatomic, strong, readonly) RCTBridge *bridge; + +/** + * The properties to apply to the view. Use this property to update + * application properties and rerender the view. Initialized with + * initialProperties argument of the initializer. + * + * Set this property only on the main thread. + */ +@property (nonatomic, copy, readwrite, nullable) NSDictionary *appProperties; + +/** + * The size flexibility mode of the root view. + */ +@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility; + +/* + * The minimum size of the root view, defaults to CGSizeZero. + */ +@property (nonatomic, assign) CGSize minimumSize; + +/** + * The delegate that handles intrinsic size updates. + */ +@property (nonatomic, weak, nullable) id delegate; + +/** + * The backing view controller of the root view. + */ +@property (nonatomic, weak, nullable) UIViewController *reactViewController; + +/** + * The React-managed contents view of the root view. + */ +@property (nonatomic, strong, readonly) UIView *contentView; + +/** + * A view to display while the JavaScript is loading, so users aren't presented + * with a blank screen. By default this is nil, but you can override it with + * (for example) a UIActivityIndicatorView or a placeholder image. + */ +@property (nonatomic, strong, nullable) UIView *loadingView; + +/** + * When set, any touches on the RCTRootView that are not matched up to any of the child + * views will be passed to siblings of the RCTRootView. See -[UIView hitTest:withEvent:] + * for details on iOS hit testing. + * + * Enable this to support a semi-transparent RN view that occupies the whole screen but + * has visible content below it that the user can interact with. + * + * The default value is NO. + */ +@property (nonatomic, assign) BOOL passThroughTouches; + +/** + * Timings for hiding the loading view after the content has loaded. Both of + * these values default to 0.25 seconds. + */ +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay; +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration; + +@end + +@interface RCTRootView (Deprecated) + +/** + * The intrinsic size of the root view's content. This is set right before the + * `rootViewDidChangeIntrinsicSize` method of `RCTRootViewDelegate` is called. + * This property is deprecated and will be removed in next releases. + * Use UIKit `intrinsicContentSize` property instead. + */ +@property (readonly, nonatomic, assign) CGSize intrinsicSize __deprecated_msg("Use `intrinsicContentSize` instead."); + +/** + * This methods is deprecated and will be removed soon. + * To interrupt a React Native gesture recognizer, use the standard + * `UIGestureRecognizer` negotiation process. + * See `UIGestureRecognizerDelegate` for more details. + */ +- (void)cancelTouches; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootViewDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootViewDelegate.h new file mode 100644 index 0000000..5749157 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootViewDelegate.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTRootView; + +@protocol RCTRootViewDelegate + +/** + * Called after the root view's intrinsic content size is changed. + * + * The method is not called when both old size and new size have + * a dimension that equals to zero. + * + * The delegate can use this callback to appropriately resize + * the root view's frame to fit the new intrinsic content view size, + * but usually it is not necessary because the root view will also call + * `setNeedsLayout` for its superview which in its turn will trigger relayout. + * + * The new intrinsic content size is available via the `intrinsicContentSize` + * property of the root view. The view will not resize itself. + */ +- (void)rootViewDidChangeIntrinsicSize:(RCTRootView *)rootView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootViewInternal.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootViewInternal.h new file mode 100644 index 0000000..8e28dd4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTRootViewInternal.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * The interface provides a set of functions that allow other internal framework + * classes to change the RCTRootViews's internal state. + */ +@interface RCTRootView () + +/** + * This setter should be used only by RCTUIManager on react root view + * intrinsic content size update. + */ +@property (readwrite, nonatomic, assign) CGSize intrinsicContentSize; + +- (void)contentViewInvalidated; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSRWebSocket.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSRWebSocket.h new file mode 100644 index 0000000..1b17cff --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSRWebSocket.h @@ -0,0 +1,132 @@ +// +// Copyright 2012 Square Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#import +#import + +typedef NS_ENUM(unsigned int, RCTSRReadyState) { + RCTSR_CONNECTING = 0, + RCTSR_OPEN = 1, + RCTSR_CLOSING = 2, + RCTSR_CLOSED = 3, +}; + +typedef NS_ENUM(NSInteger, RCTSRStatusCode) { + RCTSRStatusCodeNormal = 1000, + RCTSRStatusCodeGoingAway = 1001, + RCTSRStatusCodeProtocolError = 1002, + RCTSRStatusCodeUnhandledType = 1003, + // 1004 reserved. + RCTSRStatusNoStatusReceived = 1005, + // 1004-1006 reserved. + RCTSRStatusCodeInvalidUTF8 = 1007, + RCTSRStatusCodePolicyViolated = 1008, + RCTSRStatusCodeMessageTooBig = 1009, +}; + +@class RCTSRWebSocket; + +extern NSString *const RCTSRWebSocketErrorDomain; +extern NSString *const RCTSRHTTPResponseErrorKey; + +#pragma mark - RCTSRWebSocketDelegate + +@protocol RCTSRWebSocketDelegate; + +#pragma mark - RCTSRWebSocket + +@interface RCTSRWebSocket : NSObject + +@property (nonatomic, weak) id delegate; + +@property (nonatomic, readonly) RCTSRReadyState readyState; +@property (nonatomic, readonly, strong) NSURL *url; + +// This returns the negotiated protocol. +// It will be nil until after the handshake completes. +@property (nonatomic, readonly, copy) NSString *protocol; + +// Protocols should be an array of strings that turn into Sec-WebSocket-Protocol. +- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithURLRequest:(NSURLRequest *)request; + +// Some helper constructors. +- (instancetype)initWithURL:(NSURL *)url protocols:(NSArray *)protocols; +- (instancetype)initWithURL:(NSURL *)url; + +// Delegate queue will be dispatch_main_queue by default. +// You cannot set both OperationQueue and dispatch_queue. +- (void)setDelegateOperationQueue:(NSOperationQueue *)queue; +- (void)setDelegateDispatchQueue:(dispatch_queue_t)queue; + +// By default, it will schedule itself on +[NSRunLoop RCTSR_networkRunLoop] using defaultModes. +- (void)scheduleInRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; +- (void)unscheduleFromRunLoop:(NSRunLoop *)aRunLoop forMode:(NSString *)mode; + +// RCTSRWebSockets are intended for one-time-use only. Open should be called once and only once. +- (void)open; + +- (void)close; +- (void)closeWithCode:(NSInteger)code reason:(NSString *)reason; + +// Send a UTF8 String or Data. +- (void)send:(id)data; + +// Send Data (can be nil) in a ping message. +- (void)sendPing:(NSData *)data; + +@end + +#pragma mark - RCTSRWebSocketDelegate + +@protocol RCTSRWebSocketDelegate + +// message will either be an NSString if the server is using text +// or NSData if the server is using binary. +- (void)webSocket:(RCTSRWebSocket *)webSocket didReceiveMessage:(id)message; + +@optional + +- (void)webSocketDidOpen:(RCTSRWebSocket *)webSocket; +- (void)webSocket:(RCTSRWebSocket *)webSocket didFailWithError:(NSError *)error; +- (void)webSocket:(RCTSRWebSocket *)webSocket didCloseWithCode:(NSInteger)code reason:(NSString *)reason wasClean:(BOOL)wasClean; +- (void)webSocket:(RCTSRWebSocket *)webSocket didReceivePong:(NSData *)pongPayload; + +@end + +#pragma mark - NSURLRequest (CertificateAdditions) + +@interface NSURLRequest (CertificateAdditions) + +@property (nonatomic, readonly, copy) NSArray *RCTSR_SSLPinnedCertificates; + +@end + +#pragma mark - NSMutableURLRequest (CertificateAdditions) + +@interface NSMutableURLRequest (CertificateAdditions) + +@property (nonatomic, copy) NSArray *RCTSR_SSLPinnedCertificates; + +@end + +#pragma mark - NSRunLoop (RCTSRWebSocket) + +@interface NSRunLoop (RCTSRWebSocket) + ++ (NSRunLoop *)RCTSR_networkRunLoop; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaShadowView.h new file mode 100644 index 0000000..784a4e0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaShadowView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSafeAreaShadowView : RCTShadowView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaView.h new file mode 100644 index 0000000..ae1b6b3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaView.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTBridge; + +@interface RCTSafeAreaView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) BOOL emulateUnlessSupported; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaViewLocalData.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaViewLocalData.h new file mode 100644 index 0000000..24c776c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaViewLocalData.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSafeAreaViewLocalData : NSObject + +- (instancetype)initWithInsets:(UIEdgeInsets)insets; + +@property (atomic, readonly) UIEdgeInsets insets; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaViewManager.h new file mode 100644 index 0000000..71dcc3c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSafeAreaViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSafeAreaViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentShadowView.h new file mode 100644 index 0000000..ecae476 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentShadowView.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTScrollContentShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentView.h new file mode 100644 index 0000000..8d33a5a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentView.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTScrollContentView : RCTView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentViewManager.h new file mode 100644 index 0000000..7645c04 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollContentViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTScrollContentViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollEvent.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollEvent.h new file mode 100644 index 0000000..29a645d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollEvent.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTScrollEvent : NSObject + +- (instancetype)initWithEventName:(NSString *)eventName + reactTag:(NSNumber *)reactTag + scrollViewContentOffset:(CGPoint)scrollViewContentOffset + scrollViewContentInset:(UIEdgeInsets)scrollViewContentInset + scrollViewContentSize:(CGSize)scrollViewContentSize + scrollViewFrame:(CGRect)scrollViewFrame + scrollViewZoomScale:(CGFloat)scrollViewZoomScale + userData:(NSDictionary *)userData + coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollView.h new file mode 100644 index 0000000..ea1522b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollView.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import + +@protocol UIScrollViewDelegate; + +@interface RCTScrollView : RCTView + +- (instancetype)initWithEventDispatcher:(id)eventDispatcher NS_DESIGNATED_INITIALIZER; + +/** + * The `RCTScrollView` may have at most one single subview. This will ensure + * that the scroll view's `contentSize` will be efficiently set to the size of + * the single subview's frame. That frame size will be determined somewhat + * efficiently since it will have already been computed by the off-main-thread + * layout system. + */ +@property (nonatomic, readonly) UIView *contentView; + +/** + * The underlying scrollView (TODO: can we remove this?) + */ +@property (nonatomic, readonly) UIScrollView *scrollView; + +@property (nonatomic, assign) UIEdgeInsets contentInset; +@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; +@property (nonatomic, assign) BOOL DEPRECATED_sendUpdatedChildFrames; +@property (nonatomic, assign) NSTimeInterval scrollEventThrottle; +@property (nonatomic, assign) BOOL centerContent; +@property (nonatomic, copy) NSDictionary *maintainVisibleContentPosition; +@property (nonatomic, assign) BOOL scrollToOverflowEnabled; +@property (nonatomic, assign) int snapToInterval; +@property (nonatomic, assign) BOOL disableIntervalMomentum; +@property (nonatomic, copy) NSArray *snapToOffsets; +@property (nonatomic, assign) BOOL snapToStart; +@property (nonatomic, assign) BOOL snapToEnd; +@property (nonatomic, copy) NSString *snapToAlignment; +@property (nonatomic, assign) BOOL inverted; +@property (nonatomic, assign) int minPointers; + +// NOTE: currently these event props are only declared so we can export the +// event names to JS - we don't call the blocks directly because scroll events +// need to be coalesced before sending, for performance reasons. +@property (nonatomic, copy) RCTDirectEventBlock onScrollBeginDrag; +@property (nonatomic, copy) RCTDirectEventBlock onScroll; +@property (nonatomic, copy) RCTDirectEventBlock onScrollToTop; +@property (nonatomic, copy) RCTDirectEventBlock onScrollEndDrag; +@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollBegin; +@property (nonatomic, copy) RCTDirectEventBlock onMomentumScrollEnd; + +@end + +@interface RCTScrollView (Internal) + +- (void)updateContentSizeIfNeeded; + +@end + +RCT_EXTERN void RCTSendFakeScrollEvent(id eventDispatcher, NSNumber *reactTag); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollViewManager.h new file mode 100644 index 0000000..94f6e19 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollViewManager.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTConvert (UIScrollView) + ++ (UIScrollViewKeyboardDismissMode)UIScrollViewKeyboardDismissMode:(id)json; + +@end + +@interface RCTScrollViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollableProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollableProtocol.h new file mode 100644 index 0000000..ec6772e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTScrollableProtocol.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * Contains any methods related to scrolling. Any `RCTView` that has scrolling + * features should implement these methods. + */ +@protocol RCTScrollableProtocol + +@property (nonatomic, readonly) CGSize contentSize; + +- (void)scrollToOffset:(CGPoint)offset; +- (void)scrollToOffset:(CGPoint)offset animated:(BOOL)animated; +/** + * If this is a vertical scroll view, scrolls to the bottom. + * If this is a horizontal scroll view, scrolls to the right. + */ +- (void)scrollToEnd:(BOOL)animated; +- (void)zoomToRect:(CGRect)rect animated:(BOOL)animated; + +- (void)addScrollListener:(NSObject *)scrollListener; +- (void)removeScrollListener:(NSObject *)scrollListener; + +@end + +/** + * Denotes a view which implements custom pull to refresh functionality. + */ +@protocol RCTCustomRefreshContolProtocol + +@property (nonatomic, copy) RCTDirectEventBlock onRefresh; +@property (nonatomic, readonly, getter=isRefreshing) BOOL refreshing; + +@optional +@property (nonatomic, weak) UIScrollView *scrollView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSegmentedControl.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSegmentedControl.h new file mode 100644 index 0000000..b428f4d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSegmentedControl.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSegmentedControl : UISegmentedControl + +@property (nonatomic, copy) NSArray *values; +@property (nonatomic, assign) NSInteger selectedIndex; +@property (nonatomic, copy) RCTBubblingEventBlock onChange; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSegmentedControlManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSegmentedControlManager.h new file mode 100644 index 0000000..edc9df9 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSegmentedControlManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTSegmentedControlManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSettingsManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSettingsManager.h new file mode 100644 index 0000000..4e76780 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSettingsManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSettingsManager : NSObject + +- (instancetype)initWithUserDefaults:(NSUserDefaults *)defaults NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSettingsPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSettingsPlugins.h new file mode 100644 index 0000000..cf79705 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSettingsPlugins.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTSettingsPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTSettingsClassProvider(const char *name); + +// Lookup functions +Class RCTSettingsManagerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView+Internal.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView+Internal.h new file mode 100644 index 0000000..b871ce6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView+Internal.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@class RCTRootShadowView; + +@interface RCTShadowView (Internal) + +@property (nonatomic, weak, readwrite) RCTRootShadowView *rootView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView+Layout.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView+Layout.h new file mode 100644 index 0000000..7e09674 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView+Layout.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTShadowView (Layout) + +#pragma mark - Computed Layout-Inferred Metrics + +@property (nonatomic, readonly) UIEdgeInsets paddingAsInsets; +@property (nonatomic, readonly) UIEdgeInsets borderAsInsets; +@property (nonatomic, readonly) UIEdgeInsets compoundInsets; +@property (nonatomic, readonly) CGSize availableSize; +@property (nonatomic, readonly) CGRect contentFrame; + +#pragma mark - Dirty Propagation Control + +/** + * Designated method to control dirty propagation mechanism. + * Dirties the shadow view (and all affected shadow views, usually a superview) + * in terms of layout. + * The default implementation does nothing. + */ +- (void)dirtyLayout; + +/** + * Designated method to control dirty propagation mechanism. + * Clears (makes not dirty) the shadow view. + * The default implementation does nothing. + */ +- (void)clearLayout; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView.h new file mode 100644 index 0000000..4696b14 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTShadowView.h @@ -0,0 +1,241 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +@class RCTRootShadowView; +@class RCTSparseArray; + +typedef void (^RCTApplierBlock)(NSDictionary *viewRegistry); + +/** + * ShadowView tree mirrors RCT view tree. Every node is highly stateful. + * 1. A node is in one of three lifecycles: uninitialized, computed, dirtied. + * 1. RCTBridge may call any of the padding/margin/width/height/top/left setters. A setter would dirty + * the node and all of its ancestors. + * 2. At the end of each Bridge transaction, we call layoutWithMinimumSize:maximumSize:layoutDirection:layoutContext + * at the root node to recursively lay out the entire hierarchy. + * 3. If a node is "computed" and the constraint passed from above is identical to the constraint used to + * perform the last computation, we skip laying out the subtree entirely. + */ +@interface RCTShadowView : NSObject + +/** + * Yoga Config which will be used to create `yogaNode` property. + * Override in subclass to enable special Yoga features. + * Defaults to suitable to current device configuration. + */ ++ (YGConfigRef)yogaConfig; + +/** + * RCTComponent interface. + */ +- (NSArray *)reactSubviews NS_REQUIRES_SUPER; +- (RCTShadowView *)reactSuperview NS_REQUIRES_SUPER; +- (void)insertReactSubview:(RCTShadowView *)subview atIndex:(NSInteger)atIndex NS_REQUIRES_SUPER; +- (void)removeReactSubview:(RCTShadowView *)subview NS_REQUIRES_SUPER; + +@property (nonatomic, weak, readonly) RCTRootShadowView *rootView; +@property (nonatomic, weak, readonly) RCTShadowView *superview; +@property (nonatomic, assign, readonly) YGNodeRef yogaNode; +@property (nonatomic, copy) NSString *viewName; +@property (nonatomic, copy) RCTDirectEventBlock onLayout; + +/** + * Computed layout of the view. + */ +@property (nonatomic, assign) RCTLayoutMetrics layoutMetrics; + +/** + * In some cases we need a way to specify some environmental data to shadow view + * to improve layout (or do something similar), so `localData` serves these needs. + * For example, any stateful embedded native views may benefit from this. + * Have in mind that this data is not supposed to interfere with the state of + * the shadow view. + * Please respect one-directional data flow of React. + * Use `-[RCTUIManager setLocalData:forView:]` to set this property + * (to provide local/environmental data for a shadow view) from the main thread. + */ +- (void)setLocalData:(NSObject *)localData; + +/** + * isNewView - Used to track the first time the view is introduced into the hierarchy. It is initialized YES, then is + * set to NO in RCTUIManager after the layout pass is done and all frames have been extracted to be applied to the + * corresponding UIViews. + */ +@property (nonatomic, assign, getter=isNewView) BOOL newView; + +/** + * Position and dimensions. + * Defaults to { 0, 0, NAN, NAN }. + */ +@property (nonatomic, assign) YGValue top; +@property (nonatomic, assign) YGValue left; +@property (nonatomic, assign) YGValue bottom; +@property (nonatomic, assign) YGValue right; +@property (nonatomic, assign) YGValue start; +@property (nonatomic, assign) YGValue end; + +@property (nonatomic, assign) YGValue width; +@property (nonatomic, assign) YGValue height; + +@property (nonatomic, assign) YGValue minWidth; +@property (nonatomic, assign) YGValue maxWidth; +@property (nonatomic, assign) YGValue minHeight; +@property (nonatomic, assign) YGValue maxHeight; + +/** + * Convenient alias to `width` and `height` in pixels. + * Defaults to NAN in case of non-pixel dimension. + */ +@property (nonatomic, assign) CGSize size; + +/** + * Border. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) float borderWidth; +@property (nonatomic, assign) float borderTopWidth; +@property (nonatomic, assign) float borderLeftWidth; +@property (nonatomic, assign) float borderBottomWidth; +@property (nonatomic, assign) float borderRightWidth; +@property (nonatomic, assign) float borderStartWidth; +@property (nonatomic, assign) float borderEndWidth; + +/** + * Margin. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) YGValue margin; +@property (nonatomic, assign) YGValue marginVertical; +@property (nonatomic, assign) YGValue marginHorizontal; +@property (nonatomic, assign) YGValue marginTop; +@property (nonatomic, assign) YGValue marginLeft; +@property (nonatomic, assign) YGValue marginBottom; +@property (nonatomic, assign) YGValue marginRight; +@property (nonatomic, assign) YGValue marginStart; +@property (nonatomic, assign) YGValue marginEnd; + +/** + * Padding. Defaults to { 0, 0, 0, 0 }. + */ +@property (nonatomic, assign) YGValue padding; +@property (nonatomic, assign) YGValue paddingVertical; +@property (nonatomic, assign) YGValue paddingHorizontal; +@property (nonatomic, assign) YGValue paddingTop; +@property (nonatomic, assign) YGValue paddingLeft; +@property (nonatomic, assign) YGValue paddingBottom; +@property (nonatomic, assign) YGValue paddingRight; +@property (nonatomic, assign) YGValue paddingStart; +@property (nonatomic, assign) YGValue paddingEnd; + +/** + * Flexbox properties. All zero/disabled by default + */ +@property (nonatomic, assign) YGFlexDirection flexDirection; +@property (nonatomic, assign) YGJustify justifyContent; +@property (nonatomic, assign) YGAlign alignSelf; +@property (nonatomic, assign) YGAlign alignItems; +@property (nonatomic, assign) YGAlign alignContent; +@property (nonatomic, assign) YGPositionType position; +@property (nonatomic, assign) YGWrap flexWrap; +@property (nonatomic, assign) YGDisplay display; + +@property (nonatomic, assign) float flex; +@property (nonatomic, assign) float flexGrow; +@property (nonatomic, assign) float flexShrink; +@property (nonatomic, assign) YGValue flexBasis; + +@property (nonatomic, assign) float aspectRatio; + +/** + * Interface direction (LTR or RTL) + */ +@property (nonatomic, assign) YGDirection direction; + +/** + * Clipping properties + */ +@property (nonatomic, assign) YGOverflow overflow; + +/** + * Represents the natural size of the view, which is used when explicit size is not set or is ambiguous. + * Defaults to `{UIViewNoIntrinsicMetric, UIViewNoIntrinsicMetric}`. + */ +@property (nonatomic, assign) CGSize intrinsicContentSize; + +#pragma mark - Layout + +/** + * Initiates layout starts from the view. + */ +- (void)layoutWithMinimumSize:(CGSize)minimumSize + maximumSize:(CGSize)maximumSize + layoutDirection:(UIUserInterfaceLayoutDirection)layoutDirection + layoutContext:(RCTLayoutContext)layoutContext; + +/** + * Applies computed layout metrics to the view. + */ +- (void)layoutWithMetrics:(RCTLayoutMetrics)layoutMetrics layoutContext:(RCTLayoutContext)layoutContext; + +/** + * Calculates (if needed) and applies layout to subviews. + */ +- (void)layoutSubviewsWithContext:(RCTLayoutContext)layoutContext; + +/** + * Measures shadow view without side-effects. + * Default implementation uses Yoga for measuring. + */ +- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize; + +/** + * Returns whether or not this view can have any subviews. + * Adding/inserting a child view to leaf view (`canHaveSubviews` equals `NO`) + * will throw an error. + * Return `NO` for components which must not have any descendants + * (like , for example.) + * Defaults to `YES`. Can be overridden in subclasses. + * Don't confuse this with `isYogaLeafNode`. + */ +- (BOOL)canHaveSubviews; + +/** + * Returns whether or not this node acts as a leaf node in the eyes of Yoga. + * For example `RCTTextShadowView` has children which it does not want Yoga + * to lay out so in the eyes of Yoga it is a leaf node. + * Defaults to `NO`. Can be overridden in subclasses. + * Don't confuse this with `canHaveSubviews`. + */ +- (BOOL)isYogaLeafNode; + +/** + * As described in RCTComponent protocol. + */ +- (void)didUpdateReactSubviews NS_REQUIRES_SUPER; +- (void)didSetProps:(NSArray *)changedProps NS_REQUIRES_SUPER; + +/** + * Computes the recursive offset, meaning the sum of all descendant offsets - + * this is the sum of all positions inset from parents. This is not merely the + * sum of `top`/`left`s, as this function uses the *actual* positions of + * children, not the style specified positions - it computes this based on the + * resulting layout. It does not yet compensate for native scroll view insets or + * transforms or anchor points. + */ +- (CGRect)measureLayoutRelativeToAncestor:(RCTShadowView *)ancestor; + +/** + * Checks if the current shadow view is a descendant of the provided `ancestor` + */ +- (BOOL)viewIsDescendantOf:(RCTShadowView *)ancestor; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSinglelineTextInputView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSinglelineTextInputView.h new file mode 100644 index 0000000..d9450db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSinglelineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSinglelineTextInputViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSinglelineTextInputViewManager.h new file mode 100644 index 0000000..314993a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSinglelineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSlider.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSlider.h new file mode 100644 index 0000000..355cc36 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSlider.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSlider : UISlider + +@property (nonatomic, copy) RCTBubblingEventBlock onValueChange; +@property (nonatomic, copy) RCTDirectEventBlock onSlidingComplete; + +@property (nonatomic, assign) float step; +@property (nonatomic, assign) float lastValue; + +@property (nonatomic, strong) UIImage *trackImage; +@property (nonatomic, strong) UIImage *minimumTrackImage; +@property (nonatomic, strong) UIImage *maximumTrackImage; + +@property (nonatomic, strong) UIImage *thumbImage; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSliderManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSliderManager.h new file mode 100644 index 0000000..49de42c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSliderManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTSliderManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSourceCode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSourceCode.h new file mode 100644 index 0000000..fd0e387 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSourceCode.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSourceCode : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSpringAnimation.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSpringAnimation.h new file mode 100644 index 0000000..0c031ec --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSpringAnimation.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimationDriver.h" + +@interface RCTSpringAnimation : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTStatusBarManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTStatusBarManager.h new file mode 100644 index 0000000..db02b91 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTStatusBarManager.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@interface RCTConvert (UIStatusBar) + ++ (UIStatusBarStyle)UIStatusBarStyle:(id)json; ++ (UIStatusBarAnimation)UIStatusBarAnimation:(id)json; + +@end + +@interface RCTStatusBarManager : RCTEventEmitter + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTStyleAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTStyleAnimatedNode.h new file mode 100644 index 0000000..cdcaca4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTStyleAnimatedNode.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + +@interface RCTStyleAnimatedNode : RCTAnimatedNode + +- (NSDictionary *)propsDictionary; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSubtractionAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSubtractionAnimatedNode.h new file mode 100644 index 0000000..e8ec799 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSubtractionAnimatedNode.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTValueAnimatedNode.h" + +@interface RCTSubtractionAnimatedNode : RCTValueAnimatedNode + +@end + diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurface.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurface.h new file mode 100644 index 0000000..b776443 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurface.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTBridge; +@class RCTSurfaceView; +@protocol RCTSurfaceDelegate; + +/** + * RCTSurface instance represents React Native-powered piece of a user interface + * which can be a full-screen app, separate modal view controller, + * or even small widget. + * It is called "Surface". + * + * The RCTSurface instance is completely thread-safe by design; + * it can be created on any thread, and any its method can be called from + * any thread (if the opposite is not mentioned explicitly). + * + * The primary goals of the RCTSurface are: + * * ability to measure and layout the surface in a thread-safe + * and synchronous manner; + * * ability to create a UIView instance on demand (later); + * * ability to communicate the current stage of the surface granularly. + */ +@interface RCTSurface : NSObject + +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties; + +#pragma mark - Layout: Setting the size constrains + +/** + * Previously set `minimumSize` layout constraint. + * Defaults to `{0, 0}`. + */ +@property (atomic, assign, readonly) CGSize minimumSize; + +/** + * Previously set `maximumSize` layout constraint. + * Defaults to `{CGFLOAT_MAX, CGFLOAT_MAX}`. + */ +@property (atomic, assign, readonly) CGSize maximumSize; + +/** + * Simple shortcut to `-[RCTSurface setMinimumSize:size maximumSize:size]`. + */ +- (void)setSize:(CGSize)size; + +#pragma mark - Synchronous waiting + +/** + * Synchronously blocks the current thread up to given `timeout` until + * the Surface reaches `stage`. + * Limitations: + * - Do nothing, if called on `UIManager` queue. + * - Calling on the main queue with `RCTSurfaceStageSurfaceDidInitialMounting` + * stage temporary is not supported; in this case the stage will be + * downgraded to `RCTSurfaceStageSurfaceDidInitialLayout`. + */ +- (BOOL)synchronouslyWaitForStage:(RCTSurfaceStage)stage timeout:(NSTimeInterval)timeout; + +#pragma mark - Mounting/Unmounting of React components + +/** + * Mount the React component specified by the given moduleName. This is typically + * calling runApplication.js from the native side. + */ +- (void)mountReactComponentWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + params:(NSDictionary *)params; + +/** + * Unmount the React component specified by the given rootViewTag, called from native. + */ +- (void)unmountReactComponentWithBridge:(RCTBridge *)bridge rootViewTag:(NSNumber *)rootViewTag; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceDelegate.h new file mode 100644 index 0000000..895c2eb --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceDelegate.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurface; + +@protocol RCTSurfaceDelegate + +@optional + +/** + * Notifies a receiver that a surface transitioned to a new stage. + * See `RCTSurfaceStage` for more details. + */ +- (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage; + +/** + * Notifies a receiver that root view got a new (intrinsic) size during the last + * layout pass. + */ +- (void)surface:(RCTSurface *)surface didChangeIntrinsicSize:(CGSize)intrinsicSize; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceHostingProxyRootView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceHostingProxyRootView.h new file mode 100644 index 0000000..a7077a5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceHostingProxyRootView.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +#import "RCTSurfaceHostingView.h" + +NS_ASSUME_NONNULL_BEGIN + +/** + * This is a RCTRootView-compatible implementation of RCTSurfaceHostingView. + * Use this class to replace all usages of RCTRootView in the app for easier migration + * to RCTSurfaceHostingView. + * + * WARNING: In the future, RCTRootView will be deprecated in favor of RCTSurfaceHostingView. + */ +@interface RCTSurfaceHostingProxyRootView : RCTSurfaceHostingView + +#pragma mark RCTRootView compatibility - keep these sync'ed with RCTRootView.h + +@property (nonatomic, copy, readonly) NSString *moduleName; +@property (nonatomic, strong, readonly) RCTBridge *bridge; +@property (nonatomic, readonly) BOOL hasBridge; +@property (nonatomic, strong, readonly) RCTModuleRegistry *moduleRegistry; +@property (nonatomic, strong, readonly) id eventDispatcher; +@property (nonatomic, copy, readwrite) NSDictionary *appProperties; +@property (nonatomic, assign) RCTRootViewSizeFlexibility sizeFlexibility; +@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) UIViewController *reactViewController; +@property (nonatomic, strong, readonly) UIView *contentView; +@property (nonatomic, strong) UIView *loadingView; +@property (nonatomic, assign) BOOL passThroughTouches; +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDelay; +@property (nonatomic, assign) NSTimeInterval loadingViewFadeDuration; +@property (nonatomic, assign) CGSize minimumSize; + +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithBundleURL:(NSURL *)bundleURL + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties + launchOptions:(NSDictionary *)launchOptions; + +/** + * Bridgeless mode initializer + */ +- (instancetype)initWithSurface:(id)surface + sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode + moduleRegistry:(RCTModuleRegistry *)moduleRegistry; + +- (void)cancelTouches; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceHostingView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceHostingView.h new file mode 100644 index 0000000..0fbbdab --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceHostingView.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +@class RCTBridge; +@class RCTSurface; + +typedef UIView *_Nullable (^RCTSurfaceHostingViewActivityIndicatorViewFactory)(void); + +NS_ASSUME_NONNULL_BEGIN + +/** + * UIView subclass which providers interoperability between UIKit and + * Surface regarding layout and life-cycle. + * This class can be used as easy-to-use general purpose integration point + * of ReactNative-powered experiences in UIKit based apps. + */ +@interface RCTSurfaceHostingView : UIView + +/** + * Create an instance of RCTSurface to be hosted. + */ ++ (RCTSurface *)createSurfaceWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties; + +/** + * Designated initializer. + * Instanciates a view with given Surface object. + * Note: The view retains the surface object. + */ +- (instancetype)initWithSurface:(id)surface + sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode NS_DESIGNATED_INITIALIZER; + +/** + * Convenience initializer. + * Instanciates a Surface object with given `bridge`, `moduleName`, and + * `initialProperties`, and then use it to instanciate a view. + */ +- (instancetype)initWithBridge:(RCTBridge *)bridge + moduleName:(NSString *)moduleName + initialProperties:(NSDictionary *)initialProperties + sizeMeasureMode:(RCTSurfaceSizeMeasureMode)sizeMeasureMode; + +/** + * Surface object which is currently using to power the view. + * Read-only. + */ +@property (nonatomic, strong, readonly) id surface; + +/** + * Size measure mode which are defining relationship between UIKit and ReactNative + * layout approaches. + * Defaults to `RCTSurfaceSizeMeasureModeWidthAtMost | RCTSurfaceSizeMeasureModeHeightAtMost`. + */ +@property (nonatomic, assign) RCTSurfaceSizeMeasureMode sizeMeasureMode; + +/** + * Activity indicator factory. + * A hosting view may use this block to instantiate and display custom activity + * (loading) indicator (aka "spinner") when it needed. + * Defaults to `nil` (no activity indicator). + */ +@property (nonatomic, copy, nullable) RCTSurfaceHostingViewActivityIndicatorViewFactory activityIndicatorViewFactory; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfacePresenterStub.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfacePresenterStub.h new file mode 100644 index 0000000..32a2b80 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfacePresenterStub.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +// TODO: Eventually this should go away and files should just include RCTSurfacePresenter.h, but +// that pulls in all of fabric which doesn't compile in open source yet, so we mirror the protocol +// and duplicate the category here for now. + +@protocol RCTSurfacePresenterObserver + +@optional + +- (void)willMountComponentsWithRootTag:(NSInteger)rootTag; +- (void)didMountComponentsWithRootTag:(NSInteger)rootTag; + +@end + +@protocol RCTSurfacePresenterStub + +- (nullable UIView *)findComponentViewWithTag_DO_NOT_USE_DEPRECATED:(NSInteger)tag; +- (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props; +- (void)addObserver:(id)observer; +- (void)removeObserver:(id)observer; + +@end + +@interface RCTBridge (RCTSurfacePresenterStub) + +- (id)surfacePresenter; +- (void)setSurfacePresenter:(id)presenter; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceProtocol.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceProtocol.h new file mode 100644 index 0000000..c274df7 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceProtocol.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurfaceView; +@protocol RCTSurfaceDelegate; + +@protocol RCTSurfaceProtocol + +@property (atomic, readonly) RCTSurfaceStage stage; +@property (atomic, readonly) NSString *moduleName; +@property (atomic, readwrite, weak, nullable) id delegate; + +/** + * Deprecated. Use `rootTag` instead. + */ +@property (atomic, readonly) NSNumber *rootViewTag; +@property (atomic, copy, readwrite) NSDictionary *properties; +@property (atomic, readonly) NSInteger rootTag; + +/** + * Sets `minimumSize` and `maximumSize` layout constraints for the Surface. + */ +- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize; + +/** + * Sets `minimumSize`, `maximumSize`, and `viewportOffset` layout constraints for the Surface. + * `viewportOffset` is ignored in `RCTSurface` but used in `RCTFabricSurface`. + */ +- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize viewportOffset:(CGPoint)viewportOffset; + +#pragma mark - Dealing with UIView representation, the Main thread only access + +/** + * Creates (if needed) and returns `UIView` instance which represents the Surface. + * The Surface will cache and *retain* this object. + * Returning the UIView instance does not mean that the Surface is ready + * to execute and layout. It can be just a handler which Surface will use later + * to mount the actual views. + * RCTSurface does not control (or influence in any way) the size or origin + * of this view. Some superview (or another owner) must use other methods + * of this class to setup proper layout and interop interactions with UIKit + * or another UI framework. + * This method must be called only from the main queue. + */ +- (RCTSurfaceView *)view; + +#pragma mark - Layout: Measuring + +/** + * Measures the Surface with given constraints. + * This method does not cause any side effects on the surface object. + */ +- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize; + +/** + * Return the current size of the root view based on (but not clamp by) current + * size constraints. + */ +@property (atomic, assign, readonly) CGSize intrinsicSize; + +#pragma mark - Start & Stop + +/** + * Starts or stops the Surface. + * Those methods are a no-op for regular RCTSurface (for now), but all call sites must call them appropriately. + */ +- (BOOL)start; +- (BOOL)stop; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootShadowView.h new file mode 100644 index 0000000..cab8b4a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootShadowView.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +@interface RCTSurfaceRootShadowView : RCTShadowView + +@property (nonatomic, assign, readonly) CGSize minimumSize; +@property (nonatomic, assign, readonly) CGSize maximumSize; + +- (void)setMinimumSize:(CGSize)size maximumSize:(CGSize)maximumSize; + +@property (nonatomic, assign, readonly) CGSize intrinsicSize; + +@property (nonatomic, weak) id delegate; + +/** + * Layout direction (LTR or RTL) inherited from native environment and + * is using as a base direction value in layout engine. + * Defaults to value inferred from current locale. + */ +@property (nonatomic, assign) YGDirection baseDirection; + +- (void)layoutWithAffectedShadowViews:(NSHashTable *)affectedShadowViews; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootShadowViewDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootShadowViewDelegate.h new file mode 100644 index 0000000..6ad7337 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootShadowViewDelegate.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurfaceRootShadowView; + +@protocol RCTSurfaceRootShadowViewDelegate + +- (void)rootShadowView:(RCTSurfaceRootShadowView *)rootShadowView didChangeIntrinsicSize:(CGSize)instrinsicSize; +- (void)rootShadowViewDidStartRendering:(RCTSurfaceRootShadowView *)rootShadowView; +- (void)rootShadowViewDidStartLayingOut:(RCTSurfaceRootShadowView *)rootShadowView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootView.h new file mode 100644 index 0000000..052476a --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceRootView.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * Internal class represents Surface's root view. + */ +@interface RCTSurfaceRootView : RCTView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceSizeMeasureMode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceSizeMeasureMode.h new file mode 100644 index 0000000..0ca27cd --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceSizeMeasureMode.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * Bitmask defines how size constrains from `-[UIView sizeThatFits:]` + * are translated to `-[RCTSurface sizeThatFitsMinimumSize:maximumSize:]`. + */ +typedef NS_OPTIONS(NSInteger, RCTSurfaceSizeMeasureMode) { + RCTSurfaceSizeMeasureModeWidthUndefined = 0 << 0, + RCTSurfaceSizeMeasureModeWidthExact = 1 << 0, + RCTSurfaceSizeMeasureModeWidthAtMost = 2 << 0, + RCTSurfaceSizeMeasureModeHeightUndefined = 0 << 2, + RCTSurfaceSizeMeasureModeHeightExact = 1 << 2, + RCTSurfaceSizeMeasureModeHeightAtMost = 2 << 2, +}; + +/** + * Returns size constraints based on `size` and `sizeMeasureMode`. + */ +RCT_EXTERN void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode( + CGSize size, + RCTSurfaceSizeMeasureMode sizeMeasureMode, + CGSize *minimumSize, + CGSize *maximumSize); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceStage.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceStage.h new file mode 100644 index 0000000..87bf915 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceStage.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * The stage of the Surface + */ +typedef NS_OPTIONS(NSInteger, RCTSurfaceStage) { + RCTSurfaceStageSurfaceDidInitialize = 1 << 0, // Surface object was created + RCTSurfaceStageBridgeDidLoad = 1 << 1, // Bridge was loaded + RCTSurfaceStageModuleDidLoad = 1 << 2, // Module (JavaScript code) was loaded + RCTSurfaceStageSurfaceDidRun = 1 << 3, // Module (JavaScript code) was run + RCTSurfaceStageSurfaceDidInitialRendering = 1 << 4, // UIManager created the first shadow views + RCTSurfaceStageSurfaceDidInitialLayout = 1 << 5, // UIManager completed the first layout pass + RCTSurfaceStageSurfaceDidInitialMounting = 1 << 6, // UIManager completed the first mounting pass + RCTSurfaceStageSurfaceDidStop = 1 << 7, // Surface stopped + + // Most of the previously existed stages make no sense in the new architecture; + // now Surface exposes only two simple stages: + RCTSurfaceStagePreparing = RCTSurfaceStageSurfaceDidInitialize | RCTSurfaceStageBridgeDidLoad | + RCTSurfaceStageModuleDidLoad, + RCTSurfaceStageRunning = RCTSurfaceStagePreparing | RCTSurfaceStageSurfaceDidRun | + RCTSurfaceStageSurfaceDidInitialRendering | RCTSurfaceStageSurfaceDidInitialLayout | + RCTSurfaceStageSurfaceDidInitialMounting, +}; + +/** + * Returns `YES` if the stage is suitable for displaying normal React Native app. + */ +RCT_EXTERN BOOL RCTSurfaceStageIsRunning(RCTSurfaceStage stage); + +/** + * Returns `YES` if the stage is suitable for displaying activity indicator. + */ +RCT_EXTERN BOOL RCTSurfaceStageIsPreparing(RCTSurfaceStage stage); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceView+Internal.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceView+Internal.h new file mode 100644 index 0000000..ac4f59f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceView+Internal.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@class RCTSurfaceRootView; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSurfaceView (Internal) + +@property (nonatomic, nullable, strong) RCTSurfaceRootView *rootView; +@property (nonatomic, assign) RCTSurfaceStage stage; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceView.h new file mode 100644 index 0000000..a61e28c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSurfaceView.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@class RCTSurface; + +/** + * UIView instance which represents the Surface + */ +@interface RCTSurfaceView : UIView + +- (instancetype)initWithSurface:(RCTSurface *)surface NS_DESIGNATED_INITIALIZER; + +@property (nonatomic, weak, readonly, nullable) RCTSurface *surface; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSwitch.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSwitch.h new file mode 100644 index 0000000..3b42a50 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSwitch.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RCTSwitch : UISwitch + +@property (nonatomic, assign) BOOL wasOn; +@property (nonatomic, copy) RCTBubblingEventBlock onChange; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSwitchManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSwitchManager.h new file mode 100644 index 0000000..06015b1 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTSwitchManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTSwitchManager : RCTViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextAttributes.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextAttributes.h new file mode 100644 index 0000000..ce04362 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextAttributes.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTTextAttributesIsHighlightedAttributeName; +extern NSString *const RCTTextAttributesTagAttributeName; + +/** + * Represents knowledge about all supported *text* attributes + * assigned to some text component such as , , + * and . + */ +@interface RCTTextAttributes : NSObject + +// Color +@property (nonatomic, strong, nullable) UIColor *foregroundColor; +@property (nonatomic, strong, nullable) UIColor *backgroundColor; +@property (nonatomic, assign) CGFloat opacity; +// Font +@property (nonatomic, copy, nullable) NSString *fontFamily; +@property (nonatomic, assign) CGFloat fontSize; +@property (nonatomic, assign) CGFloat fontSizeMultiplier; +@property (nonatomic, assign) CGFloat maxFontSizeMultiplier; +@property (nonatomic, copy, nullable) NSString *fontWeight; +@property (nonatomic, copy, nullable) NSString *fontStyle; +@property (nonatomic, copy, nullable) NSArray *fontVariant; +@property (nonatomic, assign) BOOL allowFontScaling; +@property (nonatomic, assign) CGFloat letterSpacing; +// Paragraph Styles +@property (nonatomic, assign) CGFloat lineHeight; +@property (nonatomic, assign) NSTextAlignment alignment; +@property (nonatomic, assign) NSWritingDirection baseWritingDirection; +// Decoration +@property (nonatomic, strong, nullable) UIColor *textDecorationColor; +@property (nonatomic, assign) NSUnderlineStyle textDecorationStyle; +@property (nonatomic, assign) RCTTextDecorationLineType textDecorationLine; +// Shadow +@property (nonatomic, assign) CGSize textShadowOffset; +@property (nonatomic, assign) CGFloat textShadowRadius; +@property (nonatomic, strong, nullable) UIColor *textShadowColor; +// Special +@property (nonatomic, assign) BOOL isHighlighted; +@property (nonatomic, strong, nullable) NSNumber *tag; +@property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection; +@property (nonatomic, assign) RCTTextTransform textTransform; + +#pragma mark - Inheritance + +- (void)applyTextAttributes:(RCTTextAttributes *)textAttributes; + +#pragma mark - Adapters + +/** + * Text attributes in NSAttributedString terms. + */ +- (NSDictionary *)effectiveTextAttributes; + +/** + * Constructed paragraph style. + */ +- (NSParagraphStyle *_Nullable)effectiveParagraphStyle; + +/** + * Constructed font. + */ +- (UIFont *)effectiveFont; + +/** + * Font size multiplier reflects `allowFontScaling`, `fontSizeMultiplier`, and `maxFontSizeMultiplier`. + */ +- (CGFloat)effectiveFontSizeMultiplier; + +/** + * Foreground and background colors with opacity and right defaults. + */ +- (UIColor *)effectiveForegroundColor; +- (UIColor *)effectiveBackgroundColor; + +/** + * Text transformed per 'none', 'uppercase', 'lowercase', 'capitalize' + */ +- (NSString *)applyTextAttributesToText:(NSString *)text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextDecorationLineType.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextDecorationLineType.h new file mode 100644 index 0000000..ddf9195 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextDecorationLineType.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTTextDecorationLineType) { + RCTTextDecorationLineTypeNone = 0, + RCTTextDecorationLineTypeUnderline, + RCTTextDecorationLineTypeStrikethrough, + RCTTextDecorationLineTypeUnderlineStrikethrough, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextSelection.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextSelection.h new file mode 100644 index 0000000..0bb7583 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextSelection.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * Object containing information about a TextInput's selection. + */ +@interface RCTTextSelection : NSObject + +@property (nonatomic, assign, readonly) NSInteger start; +@property (nonatomic, assign, readonly) NSInteger end; + +- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end; + +@end + +@interface RCTConvert (RCTTextSelection) + ++ (RCTTextSelection *)RCTTextSelection:(id)json; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextShadowView.h new file mode 100644 index 0000000..d364db5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextShadowView.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, assign) NSLineBreakMode lineBreakMode; +@property (nonatomic, assign) BOOL adjustsFontSizeToFit; +@property (nonatomic, assign) CGFloat minimumFontScale; +@property (nonatomic, copy) RCTDirectEventBlock onTextLayout; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextTransform.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextTransform.h new file mode 100644 index 0000000..15d328c --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextTransform.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTTextTransform) { + RCTTextTransformUndefined = 0, + RCTTextTransformNone, + RCTTextTransformCapitalize, + RCTTextTransformUppercase, + RCTTextTransformLowercase, +}; diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextView.h new file mode 100644 index 0000000..5928b70 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextView.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextView : UIView + +@property (nonatomic, assign) BOOL selectable; + +- (void)setTextStorage:(NSTextStorage *)textStorage + contentFrame:(CGRect)contentFrame + descendantViews:(NSArray *)descendantViews; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextViewManager.h new file mode 100644 index 0000000..446a5db --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTextViewManager.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextViewManager.h" + +@interface RCTTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTiming.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTiming.h new file mode 100644 index 0000000..7c197aa --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTiming.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +@protocol RCTTimingDelegate + +- (void)callTimers:(NSArray *)timers; +- (void)immediatelyCallTimer:(nonnull NSNumber *)callbackID; +- (void)callIdleCallbacks:(nonnull NSNumber *)absoluteFrameStartMS; + +@end + +@interface RCTTiming : NSObject + +- (instancetype)initWithDelegate:(id)delegate; +- (void)createTimerForNextFrame:(nonnull NSNumber *)callbackID + duration:(NSTimeInterval)jsDuration + jsSchedulingTime:(NSDate *)jsSchedulingTime + repeats:(BOOL)repeats; +- (void)deleteTimer:(double)timerID; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTouchEvent.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTouchEvent.h new file mode 100644 index 0000000..9f3cc4f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTouchEvent.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +/** + * Represents a touch event, which may be composed of several touches (one for every finger). + * For more information on contents of passed data structures see RCTTouchHandler. + */ +@interface RCTTouchEvent : NSObject + +- (instancetype)initWithEventName:(NSString *)eventName + reactTag:(NSNumber *)reactTag + reactTouches:(NSArray *)reactTouches + changedIndexes:(NSArray *)changedIndexes + coalescingKey:(uint16_t)coalescingKey NS_DESIGNATED_INITIALIZER; +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTouchHandler.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTouchHandler.h new file mode 100644 index 0000000..8481a27 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTouchHandler.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@class RCTBridge; + +@interface RCTTouchHandler : UIGestureRecognizer + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +- (void)attachToView:(UIView *)view; +- (void)detachFromView:(UIView *)view; + +- (void)cancel; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTrackingAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTrackingAnimatedNode.h new file mode 100644 index 0000000..27d61fa --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTrackingAnimatedNode.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + + +@interface RCTTrackingAnimatedNode : RCTAnimatedNode + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTransformAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTransformAnimatedNode.h new file mode 100644 index 0000000..fe16bd2 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTTransformAnimatedNode.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTAnimatedNode.h" + +@interface RCTTransformAnimatedNode : RCTAnimatedNode + +- (NSDictionary *)propsDictionary; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIImageViewAnimated.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIImageViewAnimated.h new file mode 100644 index 0000000..9af8d4e --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIImageViewAnimated.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTUIImageViewAnimated : UIImageView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManager.h new file mode 100644 index 0000000..65309cc --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManager.h @@ -0,0 +1,174 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import + +/** + * Posted right before re-render happens. This is a chance for views to invalidate their state so + * next render cycle will pick up updated views and layout appropriately. + */ +RCT_EXTERN NSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotification; + +@class RCTLayoutAnimationGroup; +@class RCTUIManagerObserverCoordinator; + +/** + * The RCTUIManager is the module responsible for updating the view hierarchy. + */ +@interface RCTUIManager : NSObject + +/** + * Register a root view tag and creates corresponding `rootView` and + * `rootShadowView`. + */ +- (void)registerRootViewTag:(NSNumber *)rootTag; + +/** + * Register a root view with the RCTUIManager. + */ +- (void)registerRootView:(UIView *)rootView; + +/** + * Gets the view name associated with a reactTag. + */ +- (NSString *)viewNameForReactTag:(NSNumber *)reactTag; + +/** + * Gets the view associated with a reactTag. + */ +- (UIView *)viewForReactTag:(NSNumber *)reactTag; + +/** + * Gets the shadow view associated with a reactTag. + */ +- (RCTShadowView *)shadowViewForReactTag:(NSNumber *)reactTag; + +/** + * Set the available size (`availableSize` property) for a root view. + * This might be used in response to changes in external layout constraints. + * This value will be directly trasmitted to layout engine and defines how big viewport is; + * this value does not affect root node size style properties. + * Can be considered as something similar to `setSize:forView:` but applicable only for root view. + */ +- (void)setAvailableSize:(CGSize)availableSize forRootView:(UIView *)rootView; + +/** + * Sets local data for a shadow view corresponded with given view. + * In some cases we need a way to specify some environmental data to shadow view + * to improve layout (or do something similar), so `localData` serves these needs. + * For example, any stateful embedded native views may benefit from this. + * Have in mind that this data is not supposed to interfere with the state of + * the shadow view. + * Please respect one-directional data flow of React. + */ +- (void)setLocalData:(NSObject *)localData forView:(UIView *)view; + +/** + * Set the size of a view. This might be in response to a screen rotation + * or some other layout event outside of the React-managed view hierarchy. + */ +- (void)setSize:(CGSize)size forView:(UIView *)view; + +/** + * Set the natural size of a view, which is used when no explicit size is set. + * Use `UIViewNoIntrinsicMetric` to ignore a dimension. + * The `size` must NOT include padding and border. + */ +- (void)setIntrinsicContentSize:(CGSize)intrinsicContentSize forView:(UIView *)view; + +/** + * Sets up layout animation which will perform on next layout pass. + * The animation will affect only one next layout pass. + * Must be called on the main queue. + */ +- (void)setNextLayoutAnimationGroup:(RCTLayoutAnimationGroup *)layoutAnimationGroup; + +/** + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic after all currently queued view updates have completed. + */ +- (void)addUIBlock:(RCTViewManagerUIBlock)block; + +/** + * Schedule a block to be executed on the UI thread. Useful if you need to execute + * view logic before all currently queued view updates have completed. + */ +- (void)prependUIBlock:(RCTViewManagerUIBlock)block; + +/** + * Used by native animated module to bypass the process of updating the values through the shadow + * view hierarchy. This method will directly update native views, which means that updates for + * layout-related propertied won't be handled properly. + * Make sure you know what you're doing before calling this method :) + */ +- (void)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag + viewName:(NSString *)viewName + props:(NSDictionary *)props; + +/** + * Given a reactTag from a component, find its root view, if possible. + * Otherwise, this will give back nil. + * + * @param reactTag the component tag + * @param completion the completion block that will hand over the rootView, if any. + * + */ +- (void)rootViewForReactTag:(NSNumber *)reactTag withCompletion:(void (^)(UIView *view))completion; + +/** + * Finds a view that is tagged with nativeID as its nativeID prop + * with the associated rootTag root tag view hierarchy. Returns the + * view if found, nil otherwise. + * + * @param nativeID the id reference to native component relative to root view. + * @param rootTag the react tag of root view hierarchy from which to find the view. + */ +- (UIView *)viewForNativeID:(NSString *)nativeID withRootTag:(NSNumber *)rootTag; + +/** + * Register a view that is tagged with nativeID as its nativeID prop + * + * @param nativeID the id reference to native component relative to root view. + * @param view the view that is tagged with nativeID as its nativeID prop. + */ +- (void)setNativeID:(NSString *)nativeID forView:(UIView *)view; + +/** + * The view that is currently first responder, according to the JS context. + */ ++ (UIView *)JSResponder; + +/** + * In some cases we might want to trigger layout from native side. + * React won't be aware of this, so we need to make sure it happens. + */ +- (void)setNeedsLayout; + +/** + * Dedicated object for subscribing for UIManager events. + * See `RCTUIManagerObserver` protocol for more details. + */ +@property (atomic, retain, readonly) RCTUIManagerObserverCoordinator *observerCoordinator; + +@end + +/** + * This category makes the current RCTUIManager instance available via the + * RCTBridge, which is useful for RCTBridgeModules or RCTViewManagers that + * need to access the RCTUIManager. + */ +@interface RCTBridge (RCTUIManager) + +@property (nonatomic, readonly) RCTUIManager *uiManager; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManagerObserverCoordinator.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManagerObserverCoordinator.h new file mode 100644 index 0000000..f351159 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManagerObserverCoordinator.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +typedef dispatch_block_t RCTUIManagerMountingBlock; + +/** + * Allows hooking into UIManager internals. This can be used to execute code at + * specific points during the view updating process. + * New observers must not be added inside observer handlers. + * The particular order of handler invocation is not guaranteed. + * All observer handlers are called on UIManager queue. + */ +@protocol RCTUIManagerObserver + +@optional + +/** + * Called just before the UIManager layout views. + * It allows performing some operation for components which contain custom + * layout logic right before regular Yoga based layout. So, for instance, + * some components which have own React-independent state can compute and cache + * own intrinsic content size (which will be used by Yoga) at this point. + */ +- (void)uiManagerWillPerformLayout:(RCTUIManager *)manager; + +/** + * Called just after the UIManager layout views. + * It allows performing custom layout logic right after regular Yoga based layout. + * So, for instance, this can be used for computing final layout for a component, + * since it has its final frame set by Yoga at this point. + */ +- (void)uiManagerDidPerformLayout:(RCTUIManager *)manager; + +/** + * Called before flushing UI blocks at the end of a batch. + * This is called from the UIManager queue. Can be used to add UI operations in that batch. + */ +- (void)uiManagerWillPerformMounting:(RCTUIManager *)manager; + +/** + * Called right before flushing UI blocks and allows to intercept the mounting process. + * Return `YES` to cancel default execution of the `block` (and perform the + * execution later). + */ +- (BOOL)uiManager:(RCTUIManager *)manager performMountingWithBlock:(RCTUIManagerMountingBlock)block; + +/** + * Called just after flushing UI blocks. + * This is called from the UIManager queue. + */ +- (void)uiManagerDidPerformMounting:(RCTUIManager *)manager; + +@end + +/** + * Simple helper which take care of RCTUIManager's observers. + */ +@interface RCTUIManagerObserverCoordinator : NSObject + +/** + * Add a UIManagerObserver. See the `RCTUIManagerObserver` protocol for more info. + * References to observers are held weakly. + * This method can be called safely from any queue. + */ +- (void)addObserver:(id)observer; + +/** + * Remove a `UIManagerObserver`. + * This method can be called safely from any queue. + */ +- (void)removeObserver:(id)observer; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManagerUtils.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManagerUtils.h new file mode 100644 index 0000000..2bf9f57 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIManagerUtils.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +/** + * Queues Problem Intro: + * UIManager queue is a special queue because it has a special relationship with + * the Main queue. + * + * This particular relationship comes from two key factors: + * 1. UIManager initiates execution of many blocks on the Main queue; + * 2. In some cases, we want to initiate (and wait for) some UIManager's work *synchronously* from + * the Main queue. + * + * So, how can we meet these criteria? + * "Pseudo UIManager queue" comes to rescue! + * + * "Pseudo UIManager queue" means the safe execution of typical UIManager's work + * on the Main queue while the UIManager queue is explicitly blocked for preventing + * simultaneous/concurrent memory access. + * + * So, how can we technically do this? + * 1. `RCTAssertUIManagerQueue` is okay with execution on both actual UIManager and + * Pseudo UIManager queues. + * 2. Both `RCTExecuteOnUIManagerQueue` and `RCTUnsafeExecuteOnUIManagerQueueSync` + * execute given block *synchronously* if they were called on actual UIManager + * or Pseudo UIManager queues. + * 3. `RCTExecuteOnMainQueue` executes given block *synchronously* if we already on + * the Main queue. + * 4. `RCTUnsafeExecuteOnUIManagerQueueSync` is smart enough to do the trick: + * It detects calling on the Main queue and in this case, instead of doing + * trivial *synchronous* dispatch, it does: + * - Block the Main queue; + * - Dispatch the special block on UIManager queue to block the queue and + * concurrent memory access; + * - Execute the given block on the Main queue; + * - Unblock the UIManager queue. + * + * Imagine the analogy: We have two queues: the Main one and UIManager one. + * And these queues are two lanes of railway that go in parallel. Then, + * at some point, we merge UIManager lane with the Main lane, and all cars use + * the unified the Main lane. + * And then we split lanes again. + * + * This solution assumes that the code running on UIManager queue will never + * *explicitly* block the Main queue via calling `RCTUnsafeExecuteOnMainQueueSync`. + * Otherwise, it can cause a deadlock. + */ + +/** + * Returns UIManager queue. + */ +RCT_EXTERN dispatch_queue_t RCTGetUIManagerQueue(void); + +/** + * Default name for the UIManager queue. + */ +RCT_EXTERN char *const RCTUIManagerQueueName; + +/** + * Check if we are currently on UIManager queue. + * Please do not use this unless you really know what you're doing. + */ +RCT_EXTERN BOOL RCTIsUIManagerQueue(void); + +/** + * Check if we are currently on Pseudo UIManager queue. + * Please do not use this unless you really know what you're doing. + */ +RCT_EXTERN BOOL RCTIsPseudoUIManagerQueue(void); + +/** + * *Asynchronously* executes the specified block on the UIManager queue. + * Unlike `dispatch_async()` this will execute the block immediately + * if we're already on the UIManager queue. + */ +RCT_EXTERN void RCTExecuteOnUIManagerQueue(dispatch_block_t block); + +/** + * *Synchronously* executes the specified block on the UIManager queue. + * Unlike `dispatch_sync()` this will execute the block immediately + * if we're already on the UIManager queue. + * Please do not use this unless you really know what you're doing. + */ +RCT_EXTERN void RCTUnsafeExecuteOnUIManagerQueueSync(dispatch_block_t block); + +/** + * Convenience macro for asserting that we're running on UIManager queue. + */ +#define RCTAssertUIManagerQueue() \ + RCTAssert( \ + RCTIsUIManagerQueue() || RCTIsPseudoUIManagerQueue(), @"This function must be called on the UIManager queue") + +/** + * Returns new unique root view tag. + */ +RCT_EXTERN NSNumber *RCTAllocateRootViewTag(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUITextField.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUITextField.h new file mode 100644 index 0000000..f3b3492 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUITextField.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextField... but much better! + */ +@interface RCTUITextField : UITextField + +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUITextView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUITextView.h new file mode 100644 index 0000000..5cb03ee --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUITextView.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextView... but much better! + */ +@interface RCTUITextView : UITextView + +- (instancetype)initWithFrame:(CGRect)frame textContainer:(nullable NSTextContainer *)textContainer NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; + +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +// The `clearButtonMode` property actually is not supported yet; +// it's declared here only to conform to the interface. +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; + +@property (nonatomic, assign) BOOL caretHidden; + +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIUtils.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIUtils.h new file mode 100644 index 0000000..14fadee --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUIUtils.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +#ifdef __cplusplus +extern "C" { +#endif + +// Get window and screen dimensions +typedef struct { + struct { + CGFloat width, height, scale, fontScale; + } window, screen; +} RCTDimensions; +extern __attribute__((visibility("default"))) RCTDimensions RCTGetDimensions(CGFloat fontScale); + +// Get font size multiplier for font base size (Large) by content size category +extern __attribute__((visibility("default"))) CGFloat RCTGetMultiplierForContentSizeCategory( + UIContentSizeCategory category); + +#ifdef __cplusplus +} +#endif + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTURLRequestDelegate.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTURLRequestDelegate.h new file mode 100644 index 0000000..8a9e03f --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTURLRequestDelegate.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * An abstract interface used by request handler modules to send + * data back over the bridge back to JS. + */ +@protocol RCTURLRequestDelegate + +/** + * Call this when you send request data to the server. This is used to track + * upload progress, so should be called multiple times for large request bodies. + */ +- (void)URLRequest:(id)requestToken didSendDataWithProgress:(int64_t)bytesSent; + +/** + * Call this when you first receives a response from the server. This should + * include response headers, etc. + */ +- (void)URLRequest:(id)requestToken didReceiveResponse:(NSURLResponse *)response; + +/** + * Call this when you receive data from the server. This can be called multiple + * times with partial data chunks, or just once with the full data packet. + */ +- (void)URLRequest:(id)requestToken didReceiveData:(NSData *)data; + +/** + * Call this when the request is complete and/or if an error is encountered. + * For a successful request, the error parameter should be nil. + */ +- (void)URLRequest:(id)requestToken didCompleteWithError:(NSError *)error; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTURLRequestHandler.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTURLRequestHandler.h new file mode 100644 index 0000000..89f48f5 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTURLRequestHandler.h @@ -0,0 +1,52 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +/** + * Provides the interface needed to register a request handler. Request handlers + * are also bridge modules, so should be registered using RCT_EXPORT_MODULE(). + */ +@protocol RCTURLRequestHandler + +/** + * Indicates whether this handler is capable of processing the specified + * request. Typically the handler would examine the scheme/protocol of the + * request URL (and possibly the HTTP method and/or headers) to determine this. + */ +- (BOOL)canHandleRequest:(NSURLRequest *)request; + +/** + * Send a network request and call the delegate with the response data. The + * method should return a token, which can be anything, including the request + * itself. This will be used later to refer to the request in callbacks. The + * `sendRequest:withDelegate:` method *must* return before calling any of the + * delegate methods, or the delegate won't recognize the token. + * Following common Objective-C pattern, `delegate` will not be retained. + */ +- (id)sendRequest:(NSURLRequest *)request withDelegate:(id)delegate; + +@optional + +/** + * Not all request types can be cancelled, but this method can be implemented + * for ones that can. It should be used to free up any resources on ongoing + * processes associated with the request. + */ +- (void)cancelRequest:(id)requestToken; + +/** + * If more than one RCTURLRequestHandler responds YES to `canHandleRequest:` + * then `handlerPriority` is used to determine which one to use. The handler + * with the highest priority will be selected. Default priority is zero. If + * two or more valid handlers have the same priority, the selection order is + * undefined. + */ +- (float)handlerPriority; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUtils.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUtils.h new file mode 100644 index 0000000..ecb7915 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUtils.h @@ -0,0 +1,189 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +// JSON serialization/deserialization +RCT_EXTERN NSString *__nullable RCTJSONStringify(id __nullable jsonObject, NSError **error); +RCT_EXTERN id __nullable RCTJSONParse(NSString *__nullable jsonString, NSError **error); +RCT_EXTERN id __nullable RCTJSONParseMutable(NSString *__nullable jsonString, NSError **error); + +// Sanitize a JSON object by stripping invalid types and/or NaN values +RCT_EXTERN id RCTJSONClean(id object); + +// Get MD5 hash of a string +RCT_EXTERN NSString *RCTMD5Hash(NSString *string); + +// Check if we are currently on the main queue (not to be confused with +// the main thread, which is not necessarily the same thing) +// https://twitter.com/olebegemann/status/738656134731599872 +RCT_EXTERN BOOL RCTIsMainQueue(void); + +// Execute the specified block on the main queue. Unlike dispatch_async() +// this will execute immediately if we're already on the main queue. +RCT_EXTERN void RCTExecuteOnMainQueue(dispatch_block_t block); + +// Legacy function to execute the specified block on the main queue synchronously. +// Please do not use this unless you know what you're doing. +RCT_EXTERN void RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block); + +// Get screen scale, can be only used on main +RCT_EXTERN void RCTComputeScreenScale(void); + +// Get screen metrics in a thread-safe way +RCT_EXTERN CGFloat RCTScreenScale(void); +RCT_EXTERN CGFloat RCTFontSizeMultiplier(void); +RCT_EXTERN CGSize RCTScreenSize(void); +RCT_EXTERN CGSize RCTViewportSize(void); + +// Round float coordinates to nearest whole screen pixel (not point) +RCT_EXTERN CGFloat RCTRoundPixelValue(CGFloat value); +RCT_EXTERN CGFloat RCTCeilPixelValue(CGFloat value); +RCT_EXTERN CGFloat RCTFloorPixelValue(CGFloat value); + +// Convert a size in points to pixels, rounded up to the nearest integral size +RCT_EXTERN CGSize RCTSizeInPixels(CGSize pointSize, CGFloat scale); + +// Method swizzling +RCT_EXTERN void RCTSwapClassMethods(Class cls, SEL original, SEL replacement); +RCT_EXTERN void RCTSwapInstanceMethods(Class cls, SEL original, SEL replacement); +RCT_EXTERN void RCTSwapInstanceMethodWithBlock(Class cls, SEL original, id replacementBlock, SEL replacementSelector); + +// Module subclass support +RCT_EXTERN BOOL RCTClassOverridesClassMethod(Class cls, SEL selector); +RCT_EXTERN BOOL RCTClassOverridesInstanceMethod(Class cls, SEL selector); + +// Creates a standardized error object to return in callbacks +RCT_EXTERN NSDictionary + *RCTMakeError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); +RCT_EXTERN NSDictionary * +RCTMakeAndLogError(NSString *message, id __nullable toStringify, NSDictionary *__nullable extraData); +RCT_EXTERN NSDictionary *RCTJSErrorFromNSError(NSError *error); +RCT_EXTERN NSDictionary + *RCTJSErrorFromCodeMessageAndNSError(NSString *code, NSString *message, NSError *__nullable error); + +// The default error code to use as the `code` property for callback error objects +RCT_EXTERN NSString *const RCTErrorUnspecified; + +// Returns YES if React is running in a test environment +RCT_EXTERN BOOL RCTRunningInTestEnvironment(void); + +// Returns YES if React is running in an iOS App Extension +RCT_EXTERN BOOL RCTRunningInAppExtension(void); + +// Returns the shared UIApplication instance, or nil if running in an App Extension +RCT_EXTERN UIApplication *__nullable RCTSharedApplication(void); + +// Returns the current main window, useful if you need to access the root view +// or view controller +RCT_EXTERN UIWindow *__nullable RCTKeyWindow(void); + +// Returns the presented view controller, useful if you need +// e.g. to present a modal view controller or alert over it +RCT_EXTERN UIViewController *__nullable RCTPresentedViewController(void); + +// Does this device support force touch (aka 3D Touch)? +RCT_EXTERN BOOL RCTForceTouchAvailable(void); + +// Create an NSError in the RCTErrorDomain +RCT_EXTERN NSError *RCTErrorWithMessage(NSString *message); + +// Creates an NSError from given an NSException +RCT_EXTERN NSError *RCTErrorWithNSException(NSException *exception); + +// Convert nil values to NSNull, and vice-versa +#define RCTNullIfNil(value) ((value) ?: (id)kCFNull) +#define RCTNilIfNull(value) \ + ({ \ + __typeof__(value) t = (value); \ + (id) t == (id)kCFNull ? (__typeof(value))nil : t; \ + }) + +// Convert NaN or infinite values to zero, as these aren't JSON-safe +RCT_EXTERN double RCTZeroIfNaN(double value); + +// Returns `0` and log special warning if value is NaN or INF. +RCT_EXTERN double RCTSanitizeNaNValue(double value, NSString *property); + +// Convert data to a Base64-encoded data URL +RCT_EXTERN NSURL *RCTDataURL(NSString *mimeType, NSData *data); + +// Gzip functionality - compression level in range 0 - 1 (-1 for default) +RCT_EXTERN NSData *__nullable RCTGzipData(NSData *__nullable data, float level); + +// Returns the relative path within the main bundle for an absolute URL +// (or nil, if the URL does not specify a path within the main bundle) +RCT_EXTERN NSString *__nullable RCTBundlePathForURL(NSURL *__nullable URL); + +// Returns the Path of Library directory +RCT_EXTERN NSString *__nullable RCTLibraryPath(void); + +// Returns the relative path within the library for an absolute URL +// (or nil, if the URL does not specify a path within the Library directory) +RCT_EXTERN NSString *__nullable RCTLibraryPathForURL(NSURL *__nullable URL); + +// Determines if a given image URL refers to a image in bundle +RCT_EXTERN BOOL RCTIsBundleAssetURL(NSURL *__nullable imageURL); + +// Determines if a given image URL refers to a image in library +RCT_EXTERN BOOL RCTIsLibraryAssetURL(NSURL *__nullable imageURL); + +// Determines if a given image URL refers to a local image +RCT_EXTERN BOOL RCTIsLocalAssetURL(NSURL *__nullable imageURL); + +// Returns an UIImage for a local image asset. Returns nil if the URL +// does not correspond to a local asset. +RCT_EXTERN UIImage *__nullable RCTImageFromLocalAssetURL(NSURL *imageURL); + +// Only used in case when RCTImageFromLocalAssetURL fails to get an image +// This method basically checks for the image in the bundle location, instead +// of the CodePush location +RCT_EXTERN UIImage *__nullable RCTImageFromLocalBundleAssetURL(NSURL *imageURL); + +// Creates a new, unique temporary file path with the specified extension +RCT_EXTERN NSString *__nullable RCTTempFilePath(NSString *__nullable extension, NSError **error); + +// Get RGBA components of CGColor +RCT_EXTERN void RCTGetRGBAColorComponents(CGColorRef color, CGFloat rgba[_Nonnull 4]); + +// Converts a CGColor to a hex string +RCT_EXTERN NSString *RCTColorToHexString(CGColorRef color); + +// Get standard localized string (if it exists) +RCT_EXTERN NSString *RCTUIKitLocalizedString(NSString *string); + +// Get a human readable type string from an NSObject. For example NSString becomes string +RCT_EXTERN NSString *RCTHumanReadableType(NSObject *obj); + +// URL manipulation +RCT_EXTERN NSString *__nullable RCTGetURLQueryParam(NSURL *__nullable URL, NSString *param); +RCT_EXTERN NSURL *__nullable +RCTURLByReplacingQueryParam(NSURL *__nullable URL, NSString *param, NSString *__nullable value); + +// Given a string, drop common RN prefixes (RCT, RK, etc.) +RCT_EXTERN NSString *RCTDropReactPrefixes(NSString *s); + +RCT_EXTERN BOOL RCTUIManagerTypeForTagIsFabric(NSNumber *reactTag); + +RCT_EXTERN BOOL RCTValidateTypeOfViewCommandArgument( + NSObject *obj, + id expectedClass, + NSString const *expectedType, + NSString const *componentName, + NSString const *commandName, + NSString const *argPos); + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUtilsUIOverride.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUtilsUIOverride.h new file mode 100644 index 0000000..c6988c6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTUtilsUIOverride.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface RCTUtilsUIOverride : NSObject +/** + Set the global presented view controller instance override. + */ ++ (void)setPresentedViewController:(UIViewController *)presentedViewController; ++ (UIViewController *)presentedViewController; ++ (BOOL)hasPresentedViewController; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTValueAnimatedNode.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTValueAnimatedNode.h new file mode 100644 index 0000000..a388d00 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTValueAnimatedNode.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTAnimatedNode.h" + +@class RCTValueAnimatedNode; + +@protocol RCTValueAnimatedNodeObserver + +- (void)animatedNode:(RCTValueAnimatedNode *)node didUpdateValue:(CGFloat)value; + +@end + +@interface RCTValueAnimatedNode : RCTAnimatedNode + +- (void)setOffset:(CGFloat)offset; +- (void)flattenOffset; +- (void)extractOffset; + +@property (nonatomic, assign) CGFloat value; +@property (nonatomic, strong) id animatedObject; +@property (nonatomic, weak) id valueObserver; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVersion.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVersion.h new file mode 100644 index 0000000..5bc858d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVersion.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +RCT_EXTERN NSString *const RCTVersionMajor; +RCT_EXTERN NSString *const RCTVersionMinor; +RCT_EXTERN NSString *const RCTVersionPatch; +RCT_EXTERN NSString *const RCTVersionPrerelease; + +RCT_EXTERN NSDictionary *RCTGetReactNativeVersion(void); diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVibration.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVibration.h new file mode 100644 index 0000000..1f6ced3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVibration.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTVibration : NSObject + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVibrationPlugins.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVibrationPlugins.h new file mode 100644 index 0000000..0676192 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVibrationPlugins.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTVibrationPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTVibrationClassProvider(const char *name); + +// Lookup functions +Class RCTVibrationCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTView.h new file mode 100644 index 0000000..c82242d --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTView.h @@ -0,0 +1,114 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import + +extern const UIAccessibilityTraits SwitchAccessibilityTrait; + +@protocol RCTAutoInsetsProtocol; + +@class RCTView; + +@interface RCTView : UIView + +/** + * Accessibility event handlers + */ +@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityAction; +@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityTap; +@property (nonatomic, copy) RCTDirectEventBlock onMagicTap; +@property (nonatomic, copy) RCTDirectEventBlock onAccessibilityEscape; + +/** + * Used to control how touch events are processed. + */ +@property (nonatomic, assign) RCTPointerEvents pointerEvents; + ++ (void)autoAdjustInsetsForView:(UIView *)parentView + withScrollView:(UIScrollView *)scrollView + updateOffset:(BOOL)updateOffset; + +/** + * Find the first view controller whose view, or any subview is the specified view. + */ ++ (UIEdgeInsets)contentInsetsForView:(UIView *)curView; + +/** + * Layout direction of the view. + * This is inherited from UIView+React, but we override it here + * to improve performance and make subclassing/overriding possible/easier. + */ +@property (nonatomic, assign) UIUserInterfaceLayoutDirection reactLayoutDirection; + +/** + * This is an optimization used to improve performance + * for large scrolling views with many subviews, such as a + * list or table. If set to YES, any clipped subviews will + * be removed from the view hierarchy whenever -updateClippedSubviews + * is called. This would typically be triggered by a scroll event + */ +@property (nonatomic, assign) BOOL removeClippedSubviews; + +/** + * Hide subviews if they are outside the view bounds. + * This is an optimisation used predominantly with RKScrollViews + * but it is applied recursively to all subviews that have + * removeClippedSubviews set to YES + */ +- (void)updateClippedSubviews; + +/** + * Border radii. + */ +@property (nonatomic, assign) CGFloat borderRadius; +@property (nonatomic, assign) CGFloat borderTopLeftRadius; +@property (nonatomic, assign) CGFloat borderTopRightRadius; +@property (nonatomic, assign) CGFloat borderTopStartRadius; +@property (nonatomic, assign) CGFloat borderTopEndRadius; +@property (nonatomic, assign) CGFloat borderBottomLeftRadius; +@property (nonatomic, assign) CGFloat borderBottomRightRadius; +@property (nonatomic, assign) CGFloat borderBottomStartRadius; +@property (nonatomic, assign) CGFloat borderBottomEndRadius; + +/** + * Border colors (actually retained). + */ +@property (nonatomic, strong) UIColor *borderTopColor; +@property (nonatomic, strong) UIColor *borderRightColor; +@property (nonatomic, strong) UIColor *borderBottomColor; +@property (nonatomic, strong) UIColor *borderLeftColor; +@property (nonatomic, strong) UIColor *borderStartColor; +@property (nonatomic, strong) UIColor *borderEndColor; +@property (nonatomic, strong) UIColor *borderColor; + +/** + * Border widths. + */ +@property (nonatomic, assign) CGFloat borderTopWidth; +@property (nonatomic, assign) CGFloat borderRightWidth; +@property (nonatomic, assign) CGFloat borderBottomWidth; +@property (nonatomic, assign) CGFloat borderLeftWidth; +@property (nonatomic, assign) CGFloat borderStartWidth; +@property (nonatomic, assign) CGFloat borderEndWidth; +@property (nonatomic, assign) CGFloat borderWidth; + +/** + * Border styles. + */ +@property (nonatomic, assign) RCTBorderStyle borderStyle; + +/** + * Insets used when hit testing inside this view. + */ +@property (nonatomic, assign) UIEdgeInsets hitTestEdgeInsets; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTViewManager.h new file mode 100644 index 0000000..5c1eba4 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTViewManager.h @@ -0,0 +1,118 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import +#import + +@class RCTBridge; +@class RCTShadowView; +@class RCTSparseArray; +@class RCTUIManager; + +typedef void (^RCTViewManagerUIBlock)(RCTUIManager *uiManager, NSDictionary *viewRegistry); + +@interface RCTViewManager : NSObject + +/** + * The bridge can be used to access both the RCTUIIManager and the RCTEventDispatcher, + * allowing the manager (or the views that it manages) to manipulate the view + * hierarchy and send events back to the JS context. + */ +@property (nonatomic, weak) RCTBridge *bridge; + +/** + * This method instantiates a native view to be managed by the module. Override + * this to return a custom view instance, which may be preconfigured with default + * properties, subviews, etc. This method will be called many times, and should + * return a fresh instance each time. The view module MUST NOT cache the returned + * view and return the same instance for subsequent calls. + */ +- (UIView *)view; + +/** + * This method instantiates a shadow view to be managed by the module. If omitted, + * an ordinary RCTShadowView instance will be created, which is typically fine for + * most view types. As with the -view method, the -shadowView method should return + * a fresh instance each time it is called. + */ +- (RCTShadowView *)shadowView; + +/** + * DEPRECATED: declare properties of type RCTBubblingEventBlock instead + * + * Returns an array of names of events that can be sent by native views. This + * should return bubbling, directly-dispatched event types. The event name + * should not include a prefix such as 'on' or 'top', as this will be applied + * as needed. When subscribing to the event, use the 'Captured' suffix to + * indicate the captured form, or omit the suffix for the bubbling form. + * + * Note that this method is not inherited when you subclass a view module, and + * you should not call [super customBubblingEventTypes] when overriding it. + */ +- (NSArray *)customBubblingEventTypes __deprecated_msg("Use RCTBubblingEventBlock props instead."); + +/** + * This handles the simple case, where JS and native property names match. + */ +#define RCT_EXPORT_VIEW_PROPERTY(name, type) \ + +(NSArray *)propConfig_##name RCT_DYNAMIC \ + { \ + return @[ @ #type ]; \ + } + +/** + * This macro maps a named property to an arbitrary key path in the view. + */ +#define RCT_REMAP_VIEW_PROPERTY(name, keyPath, type) \ + +(NSArray *)propConfig_##name RCT_DYNAMIC \ + { \ + return @[ @ #type, @ #keyPath ]; \ + } + +/** + * This macro can be used when you need to provide custom logic for setting + * view properties. The macro should be followed by a method body, which can + * refer to "json", "view" and "defaultView" to implement the required logic. + */ +#define RCT_CUSTOM_VIEW_PROPERTY(name, type, viewClass) \ + RCT_REMAP_VIEW_PROPERTY(name, __custom__, type) \ + -(void)set_##name : (id)json forView : (viewClass *)view withDefaultView : (viewClass *)defaultView RCT_DYNAMIC + +/** + * This macro is used to map properties to the shadow view, instead of the view. + */ +#define RCT_EXPORT_SHADOW_PROPERTY(name, type) \ + +(NSArray *)propConfigShadow_##name RCT_DYNAMIC \ + { \ + return @[ @ #type ]; \ + } + +/** + * This macro maps a named property to an arbitrary key path in the shadow view. + */ +#define RCT_REMAP_SHADOW_PROPERTY(name, keyPath, type) \ + +(NSArray *)propConfigShadow_##name RCT_DYNAMIC \ + { \ + return @[ @ #type, @ #keyPath ]; \ + } + +/** + * This macro can be used when you need to provide custom logic for setting + * shadow view properties. The macro should be followed by a method body, which can + * refer to "json" and "view". + */ +#define RCT_CUSTOM_SHADOW_PROPERTY(name, type, viewClass) \ + RCT_REMAP_SHADOW_PROPERTY(name, __custom__, type) \ + -(void)set_##name : (id)json forShadowView : (viewClass *)view RCT_DYNAMIC + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVirtualTextShadowView.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVirtualTextShadowView.h new file mode 100644 index 0000000..bce9ea8 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVirtualTextShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +@interface RCTVirtualTextShadowView : RCTBaseTextShadowView + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVirtualTextViewManager.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVirtualTextViewManager.h new file mode 100644 index 0000000..91d4f78 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTVirtualTextViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTVirtualTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWeakProxy.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWeakProxy.h new file mode 100644 index 0000000..472f7f0 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWeakProxy.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTWeakProxy : NSObject + +@property (nonatomic, weak, readonly) id target; + ++ (instancetype)weakProxyWithTarget:(id)target; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWeakViewHolder.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWeakViewHolder.h new file mode 100644 index 0000000..ce39eee --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWeakViewHolder.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/* + * THIS IS A HACK + * This protocol should only be used for Paper ViewManagers which need to + * use the Fabric Interop layer, and also need to reference their created + * views. This protocol allows the view manager to store a weak reference to + * any created views. It will not affect view lifecycle in any way. + */ +@protocol RCTWeakViewHolder + +@property (nonatomic, strong) NSMapTable *weakViews; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWebSocketExecutor.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWebSocketExecutor.h new file mode 100644 index 0000000..499664b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWebSocketExecutor.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if RCT_DEV // Debug executors are only supported in dev mode + +@interface RCTWebSocketExecutor : NSObject + +- (instancetype)initWithURL:(NSURL *)URL; + +@end + +#endif diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWebSocketModule.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWebSocketModule.h new file mode 100644 index 0000000..c1a48d3 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWebSocketModule.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTWebSocketContentHandler + +- (id)processWebsocketMessage:(id __nullable)message + forSocketID:(NSNumber *)socketID + withType:(NSString *__nonnull __autoreleasing *__nonnull)type; + +@end + +@interface RCTWebSocketModule : RCTEventEmitter + +// Register a custom handler for a specific websocket. The handler will be strongly held by the WebSocketModule. +- (void)setContentHandler:(id __nullable)handler forSocketID:(NSNumber *)socketID; + +- (void)sendData:(NSData *)data forSocketID:(nonnull NSNumber *)socketID; + +@end + +@interface RCTBridge (RCTWebSocketModule) + +- (RCTWebSocketModule *)webSocketModule; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWrapperViewController.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWrapperViewController.h new file mode 100644 index 0000000..dc9b0d6 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/RCTWrapperViewController.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTWrapperViewController; + +@interface RCTWrapperViewController : UIViewController + +- (instancetype)initWithContentView:(UIView *)contentView NS_DESIGNATED_INITIALIZER; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/UIView+Private.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/UIView+Private.h new file mode 100644 index 0000000..a5cb440 --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/UIView+Private.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface UIView (Private) + +// remove clipped subviews implementation +- (void)react_remountAllSubviews; +- (void)react_updateClippedSubviewsWithClipRect:(CGRect)clipRect relativeToView:(UIView *)clipView; +- (UIView *)react_findClipView; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/UIView+React.h b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/UIView+React.h new file mode 100644 index 0000000..67c665b --- /dev/null +++ b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/Headers/React/UIView+React.h @@ -0,0 +1,130 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +@class RCTShadowView; + +@interface UIView (React) + +/** + * RCTComponent interface. + */ +- (NSArray *)reactSubviews NS_REQUIRES_SUPER; +- (UIView *)reactSuperview NS_REQUIRES_SUPER; +- (void)insertReactSubview:(UIView *)subview atIndex:(NSInteger)atIndex NS_REQUIRES_SUPER; +- (void)removeReactSubview:(UIView *)subview NS_REQUIRES_SUPER; + +/** + * The native id of the view, used to locate view from native codes + */ +@property (nonatomic, copy) NSString *nativeID; + +/** + * Determines whether or not a view should ignore inverted colors or not. Used to set + * UIView property accessibilityIgnoresInvertColors in iOS 11+. + */ +@property (nonatomic, assign) BOOL shouldAccessibilityIgnoresInvertColors; + +/** + * Layout direction of the view. + * Internally backed to `semanticContentAttribute` property. + * Defaults to `LeftToRight` in case of ambiguity. + */ +@property (nonatomic, assign) UIUserInterfaceLayoutDirection reactLayoutDirection; + +/** + * Yoga `display` style property. Can be `flex` or `none`. + * Defaults to `flex`. + * May be used to temporary hide the view in a very efficient way. + */ +@property (nonatomic, assign) YGDisplay reactDisplay; + +/** + * The z-index of the view. + */ +@property (nonatomic, assign) NSInteger reactZIndex; + +/** + * Subviews sorted by z-index. Note that this method doesn't do any caching (yet) + * and sorts all the views each call. + */ +- (NSArray *)reactZIndexSortedSubviews; + +/** + * Updates the subviews array based on the reactSubviews. Default behavior is + * to insert the sortedReactSubviews into the UIView. + */ +- (void)didUpdateReactSubviews; + +/** + * Called each time props have been set. + * The default implementation does nothing. + */ +- (void)didSetProps:(NSArray *)changedProps; + +/** + * Used by the UIIManager to set the view frame. + * May be overridden to disable animation, etc. + */ +- (void)reactSetFrame:(CGRect)frame; + +/** + * This method finds and returns the containing view controller for the view. + */ +- (UIViewController *)reactViewController; + +/** + * This method attaches the specified controller as a child of the + * the owning view controller of this view. Returns NO if no view + * controller is found (which may happen if the view is not currently + * attached to the view hierarchy). + */ +- (void)reactAddControllerToClosestParent:(UIViewController *)controller; + +/** + * Focus manipulation. + */ +- (void)reactFocus; +- (void)reactFocusIfNeeded; +- (void)reactBlur; + +/** + * Useful properties for computing layout. + */ +@property (nonatomic, readonly) UIEdgeInsets reactBorderInsets; +@property (nonatomic, readonly) UIEdgeInsets reactPaddingInsets; +@property (nonatomic, readonly) UIEdgeInsets reactCompoundInsets; +@property (nonatomic, readonly) CGRect reactContentFrame; + +/** + * The (sub)view which represents this view in terms of accessibility. + * ViewManager will apply all accessibility properties directly to this view. + * May be overridden in view subclass which needs to be accessiblitywise + * transparent in favour of some subview. + * Defaults to `self`. + */ +@property (nonatomic, readonly) UIView *reactAccessibilityElement; + +/** + * Accessibility properties + */ +@property (nonatomic, copy) NSString *accessibilityRole; +@property (nonatomic, copy) NSDictionary *accessibilityState; +@property (nonatomic, copy) NSArray *accessibilityActions; +@property (nonatomic, copy) NSDictionary *accessibilityValueInternal; + +/** + * Used in debugging to get a description of the view hierarchy rooted at + * the current view. + */ +- (NSString *)react_recursiveDescription; + +@end diff --git a/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/libReact-Core.a b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/libReact-Core.a new file mode 100644 index 0000000..49bc642 Binary files /dev/null and b/Frameworks/React-Core.xcframework/ios-arm64_x86_64-simulator/libReact-Core.a differ diff --git a/Frameworks/React-CoreModules.xcframework/Info.plist b/Frameworks/React-CoreModules.xcframework/Info.plist new file mode 100644 index 0000000..a3d28e5 --- /dev/null +++ b/Frameworks/React-CoreModules.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-CoreModules.a + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-CoreModules.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-CoreModules.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-CoreModules.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-CoreModules.xcframework/ios-arm64/libReact-CoreModules.a b/Frameworks/React-CoreModules.xcframework/ios-arm64/libReact-CoreModules.a new file mode 100644 index 0000000..3759493 Binary files /dev/null and b/Frameworks/React-CoreModules.xcframework/ios-arm64/libReact-CoreModules.a differ diff --git a/Frameworks/React-CoreModules.xcframework/ios-arm64_x86_64-simulator/libReact-CoreModules.a b/Frameworks/React-CoreModules.xcframework/ios-arm64_x86_64-simulator/libReact-CoreModules.a new file mode 100644 index 0000000..3c3f5a6 Binary files /dev/null and b/Frameworks/React-CoreModules.xcframework/ios-arm64_x86_64-simulator/libReact-CoreModules.a differ diff --git a/Frameworks/React-RCTAnimation.xcframework/Info.plist b/Frameworks/React-RCTAnimation.xcframework/Info.plist new file mode 100644 index 0000000..d333907 --- /dev/null +++ b/Frameworks/React-RCTAnimation.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTAnimation.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTAnimation.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libReact-RCTAnimation.a + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTAnimation.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTAnimation.xcframework/ios-arm64/libReact-RCTAnimation.a b/Frameworks/React-RCTAnimation.xcframework/ios-arm64/libReact-RCTAnimation.a new file mode 100644 index 0000000..182c353 Binary files /dev/null and b/Frameworks/React-RCTAnimation.xcframework/ios-arm64/libReact-RCTAnimation.a differ diff --git a/Frameworks/React-RCTAnimation.xcframework/ios-arm64_x86_64-simulator/libReact-RCTAnimation.a b/Frameworks/React-RCTAnimation.xcframework/ios-arm64_x86_64-simulator/libReact-RCTAnimation.a new file mode 100644 index 0000000..bd26873 Binary files /dev/null and b/Frameworks/React-RCTAnimation.xcframework/ios-arm64_x86_64-simulator/libReact-RCTAnimation.a differ diff --git a/Frameworks/React-RCTBlob.xcframework/Info.plist b/Frameworks/React-RCTBlob.xcframework/Info.plist new file mode 100644 index 0000000..1f02303 --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTBlob.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTBlob.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-RCTBlob.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTBlob.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobCollector.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobCollector.h new file mode 100644 index 0000000..43179d9 --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobCollector.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +using namespace facebook; + +@class RCTBlobManager; + +namespace facebook { +namespace react { + +class JSI_EXPORT RCTBlobCollector : public jsi::HostObject { + public: + RCTBlobCollector(RCTBlobManager *blobManager, const std::string &blobId); + ~RCTBlobCollector(); + + static void install(RCTBlobManager *blobManager); + + private: + const std::string blobId_; + RCTBlobManager *blobManager_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobManager.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobManager.h new file mode 100755 index 0000000..04b905c --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobManager.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import + +@interface RCTBlobManager : NSObject + +- (NSString *)store:(NSData *)data; + +- (void)store:(NSData *)data withId:(NSString *)blobId; + +- (NSData *)resolve:(NSDictionary *)blob; + +- (NSData *)resolve:(NSString *)blobId offset:(NSInteger)offset size:(NSInteger)size; + +- (NSData *)resolveURL:(NSURL *)url; + +- (void)remove:(NSString *)blobId; + +- (void)createFromParts:(NSArray *> *)parts withId:(NSString *)blobId; + +@end diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobPlugins.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobPlugins.h new file mode 100644 index 0000000..141ca35 --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTBlobPlugins.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTBlobPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTBlobClassProvider(const char *name); + +// Lookup functions +Class RCTFileReaderModuleCls(void) __attribute__((used)); +Class RCTBlobManagerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTFileReaderModule.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTFileReaderModule.h new file mode 100644 index 0000000..0eb246b --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64/Headers/RCTBlob/RCTFileReaderModule.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTFileReaderModule : NSObject + +@end diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64/libReact-RCTBlob.a b/Frameworks/React-RCTBlob.xcframework/ios-arm64/libReact-RCTBlob.a new file mode 100644 index 0000000..6d8660f Binary files /dev/null and b/Frameworks/React-RCTBlob.xcframework/ios-arm64/libReact-RCTBlob.a differ diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobCollector.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobCollector.h new file mode 100644 index 0000000..43179d9 --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobCollector.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +using namespace facebook; + +@class RCTBlobManager; + +namespace facebook { +namespace react { + +class JSI_EXPORT RCTBlobCollector : public jsi::HostObject { + public: + RCTBlobCollector(RCTBlobManager *blobManager, const std::string &blobId); + ~RCTBlobCollector(); + + static void install(RCTBlobManager *blobManager); + + private: + const std::string blobId_; + RCTBlobManager *blobManager_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobManager.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobManager.h new file mode 100755 index 0000000..04b905c --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobManager.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import +#import + +@interface RCTBlobManager : NSObject + +- (NSString *)store:(NSData *)data; + +- (void)store:(NSData *)data withId:(NSString *)blobId; + +- (NSData *)resolve:(NSDictionary *)blob; + +- (NSData *)resolve:(NSString *)blobId offset:(NSInteger)offset size:(NSInteger)size; + +- (NSData *)resolveURL:(NSURL *)url; + +- (void)remove:(NSString *)blobId; + +- (void)createFromParts:(NSArray *> *)parts withId:(NSString *)blobId; + +@end diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobPlugins.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobPlugins.h new file mode 100644 index 0000000..141ca35 --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTBlobPlugins.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by an internal plugin build system + */ + +#ifdef RN_DISABLE_OSS_PLUGIN_HEADER + +// FB Internal: FBRCTBlobPlugins.h is autogenerated by the build system. +#import + +#else + +// OSS-compatibility layer + +#import + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wreturn-type-c-linkage" + +#ifdef __cplusplus +extern "C" { +#endif + +// RCTTurboModuleManagerDelegate should call this to resolve module classes. +Class RCTBlobClassProvider(const char *name); + +// Lookup functions +Class RCTFileReaderModuleCls(void) __attribute__((used)); +Class RCTBlobManagerCls(void) __attribute__((used)); + +#ifdef __cplusplus +} +#endif + +#pragma GCC diagnostic pop + +#endif // RN_DISABLE_OSS_PLUGIN_HEADER diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTFileReaderModule.h b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTFileReaderModule.h new file mode 100644 index 0000000..0eb246b --- /dev/null +++ b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/Headers/RCTBlob/RCTFileReaderModule.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTFileReaderModule : NSObject + +@end diff --git a/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/libReact-RCTBlob.a b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/libReact-RCTBlob.a new file mode 100644 index 0000000..118b91f Binary files /dev/null and b/Frameworks/React-RCTBlob.xcframework/ios-arm64_x86_64-simulator/libReact-RCTBlob.a differ diff --git a/Frameworks/React-RCTImage.xcframework/Info.plist b/Frameworks/React-RCTImage.xcframework/Info.plist new file mode 100644 index 0000000..6eb0588 --- /dev/null +++ b/Frameworks/React-RCTImage.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTImage.a + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTImage.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-RCTImage.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTImage.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTImage.xcframework/ios-arm64/libReact-RCTImage.a b/Frameworks/React-RCTImage.xcframework/ios-arm64/libReact-RCTImage.a new file mode 100644 index 0000000..5f4f27a Binary files /dev/null and b/Frameworks/React-RCTImage.xcframework/ios-arm64/libReact-RCTImage.a differ diff --git a/Frameworks/React-RCTImage.xcframework/ios-arm64_x86_64-simulator/libReact-RCTImage.a b/Frameworks/React-RCTImage.xcframework/ios-arm64_x86_64-simulator/libReact-RCTImage.a new file mode 100644 index 0000000..35103b8 Binary files /dev/null and b/Frameworks/React-RCTImage.xcframework/ios-arm64_x86_64-simulator/libReact-RCTImage.a differ diff --git a/Frameworks/React-RCTLinking.xcframework/Info.plist b/Frameworks/React-RCTLinking.xcframework/Info.plist new file mode 100644 index 0000000..51f40f5 --- /dev/null +++ b/Frameworks/React-RCTLinking.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTLinking.a + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTLinking.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-RCTLinking.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTLinking.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTLinking.xcframework/ios-arm64/libReact-RCTLinking.a b/Frameworks/React-RCTLinking.xcframework/ios-arm64/libReact-RCTLinking.a new file mode 100644 index 0000000..4547651 Binary files /dev/null and b/Frameworks/React-RCTLinking.xcframework/ios-arm64/libReact-RCTLinking.a differ diff --git a/Frameworks/React-RCTLinking.xcframework/ios-arm64_x86_64-simulator/libReact-RCTLinking.a b/Frameworks/React-RCTLinking.xcframework/ios-arm64_x86_64-simulator/libReact-RCTLinking.a new file mode 100644 index 0000000..545ef40 Binary files /dev/null and b/Frameworks/React-RCTLinking.xcframework/ios-arm64_x86_64-simulator/libReact-RCTLinking.a differ diff --git a/Frameworks/React-RCTNetwork.xcframework/Info.plist b/Frameworks/React-RCTNetwork.xcframework/Info.plist new file mode 100644 index 0000000..1a5fdfb --- /dev/null +++ b/Frameworks/React-RCTNetwork.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTNetwork.a + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTNetwork.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-RCTNetwork.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTNetwork.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTNetwork.xcframework/ios-arm64/libReact-RCTNetwork.a b/Frameworks/React-RCTNetwork.xcframework/ios-arm64/libReact-RCTNetwork.a new file mode 100644 index 0000000..c5978e4 Binary files /dev/null and b/Frameworks/React-RCTNetwork.xcframework/ios-arm64/libReact-RCTNetwork.a differ diff --git a/Frameworks/React-RCTNetwork.xcframework/ios-arm64_x86_64-simulator/libReact-RCTNetwork.a b/Frameworks/React-RCTNetwork.xcframework/ios-arm64_x86_64-simulator/libReact-RCTNetwork.a new file mode 100644 index 0000000..e4ba503 Binary files /dev/null and b/Frameworks/React-RCTNetwork.xcframework/ios-arm64_x86_64-simulator/libReact-RCTNetwork.a differ diff --git a/Frameworks/React-RCTSettings.xcframework/Info.plist b/Frameworks/React-RCTSettings.xcframework/Info.plist new file mode 100644 index 0000000..38592b9 --- /dev/null +++ b/Frameworks/React-RCTSettings.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTSettings.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTSettings.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libReact-RCTSettings.a + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTSettings.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTSettings.xcframework/ios-arm64/libReact-RCTSettings.a b/Frameworks/React-RCTSettings.xcframework/ios-arm64/libReact-RCTSettings.a new file mode 100644 index 0000000..d43ebcd Binary files /dev/null and b/Frameworks/React-RCTSettings.xcframework/ios-arm64/libReact-RCTSettings.a differ diff --git a/Frameworks/React-RCTSettings.xcframework/ios-arm64_x86_64-simulator/libReact-RCTSettings.a b/Frameworks/React-RCTSettings.xcframework/ios-arm64_x86_64-simulator/libReact-RCTSettings.a new file mode 100644 index 0000000..f056ed0 Binary files /dev/null and b/Frameworks/React-RCTSettings.xcframework/ios-arm64_x86_64-simulator/libReact-RCTSettings.a differ diff --git a/Frameworks/React-RCTText.xcframework/Info.plist b/Frameworks/React-RCTText.xcframework/Info.plist new file mode 100644 index 0000000..205be05 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTText.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTText.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-RCTText.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTText.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/NSTextStorage+FontScaling.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/NSTextStorage+FontScaling.h new file mode 100644 index 0000000..61b1634 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/NSTextStorage+FontScaling.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface NSTextStorage (FontScaling) + +- (void)scaleFontSizeToFitSize:(CGSize)size + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +- (void)scaleFontSizeWithRatio:(CGFloat)ratio + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputDelegate.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputDelegate.h new file mode 100644 index 0000000..3e1839b --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputDelegate.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputViewProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputDelegate + +- (BOOL)textInputShouldBeginEditing; // Return `NO` to disallow editing. +- (void)textInputDidBeginEditing; + +- (BOOL)textInputShouldEndEditing; // Return `YES` to allow editing to stop and to resign first responder status. `NO` to disallow the editing session to end. +- (void)textInputDidEndEditing; // May be called if forced even if `textInputShouldEndEditing` returns `NO` (e.g. view removed from window) or `[textInput endEditing:YES]` called. + +- (BOOL)textInputShouldReturn; // May be called right before `textInputShouldEndEditing` if "Return" button was pressed. +- (void)textInputDidReturn; + +/* + * Called before any change in the TextInput. The delegate has the opportunity to change the replacement string or reject the change completely. + * To change the replacement, return the changed version of the `text`. + * To accept the change, return `text` argument as-is. + * To reject the change, return `nil`. + */ +- (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range; +- (void)textInputDidChange; + +- (void)textInputDidChangeSelection; + +@optional + +- (void)scrollViewDidScroll:(UIScrollView *)scrollView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputDelegateAdapter.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputDelegateAdapter.h new file mode 100644 index 0000000..a7f3251 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputDelegateAdapter.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBackedTextInputViewProtocol.h" +#import "RCTBackedTextInputDelegate.h" + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField) + +@interface RCTBackedTextFieldDelegateAdapter : NSObject + +- (instancetype)initWithTextField:(UITextField *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; +- (void)selectedTextRangeWasSet; + +@end + +#pragma mark - RCTBackedTextViewDelegateAdapter (for UITextView) + +@interface RCTBackedTextViewDelegateAdapter : NSObject + +- (instancetype)initWithTextView:(UITextView *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputViewProtocol.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputViewProtocol.h new file mode 100644 index 0000000..09f4fe2 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBackedTextInputViewProtocol.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputDelegate; +@class RCTTextAttributes; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputViewProtocol + +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, strong, nullable) UIView *inputAccessoryView; +@property (nonatomic, strong, nullable) UIView *inputView; +@property (nonatomic, weak, nullable) id textInputDelegate; +@property (nonatomic, readonly) CGSize contentSize; +@property (nonatomic, strong, nullable) NSDictionary *defaultTextAttributes; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL enablesReturnKeyAutomatically; +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +// This protocol disallows direct access to `selectedTextRange` property because +// unwise usage of it can break the `delegate` behavior. So, we always have to +// explicitly specify should `delegate` be notified about the change or not. +// If the change was initiated programmatically, we must NOT notify the delegate. +// If the change was a result of user actions (like typing or touches), we MUST notify the delegate. +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange NS_UNAVAILABLE; +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange notifyDelegate:(BOOL)notifyDelegate; + +// This protocol disallows direct access to `text` property because +// unwise usage of it can break the `attributeText` behavior. +// Use `attributedText.string` instead. +@property (nonatomic, copy, nullable) NSString *text NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputShadowView.h new file mode 100644 index 0000000..44b46db --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputShadowView.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, copy, nullable) NSString *text; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputView.h new file mode 100644 index 0000000..d73f082 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputView.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTBackedTextInputDelegate.h" +#import "RCTBackedTextInputViewProtocol.h" + +@class RCTBridge; +@class RCTTextAttributes; +@class RCTTextSelection; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; + +@property (nonatomic, readonly) UIView *backedTextInputView; + +@property (nonatomic, strong, nullable) RCTTextAttributes *textAttributes; +@property (nonatomic, assign) UIEdgeInsets reactPaddingInsets; +@property (nonatomic, assign) UIEdgeInsets reactBorderInsets; + +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onSelectionChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onTextInput; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onScroll; + +@property (nonatomic, assign) NSInteger mostRecentEventCount; +@property (nonatomic, assign, readonly) NSInteger nativeEventCount; +@property (nonatomic, assign) BOOL autoFocus; +@property (nonatomic, assign) BOOL blurOnSubmit; +@property (nonatomic, assign) BOOL selectTextOnFocus; +@property (nonatomic, assign) BOOL clearTextOnFocus; +@property (nonatomic, assign) BOOL secureTextEntry; +@property (nonatomic, copy) RCTTextSelection *selection; +@property (nonatomic, strong, nullable) NSNumber *maxLength; +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy) NSString *inputAccessoryViewID; +@property (nonatomic, assign) UIKeyboardType keyboardType; +@property (nonatomic, assign) BOOL showSoftInputOnFocus; + +/** + Sets selection intext input if both start and end are within range of the text input. + **/ +- (void)setSelectionStart:(NSInteger)start + selectionEnd:(NSInteger)end; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputViewManager.h new file mode 100644 index 0000000..5201bdb --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextInputViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTBaseTextInputViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextShadowView.h new file mode 100644 index 0000000..9f2c944 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextShadowView.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextAttributes.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTBaseTextShadowViewEmbeddedShadowViewAttributeName; + +@interface RCTBaseTextShadowView : RCTShadowView { + @protected NSAttributedString *_Nullable cachedAttributedText; + @protected RCTTextAttributes *_Nullable cachedTextAttributes; +} + +@property (nonatomic, strong) RCTTextAttributes *textAttributes; + +- (NSAttributedString *)attributedTextWithBaseTextAttributes:(nullable RCTTextAttributes *)baseTextAttributes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextViewManager.h new file mode 100644 index 0000000..b0f9470 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTBaseTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTConvert+Text.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTConvert+Text.h new file mode 100644 index 0000000..eafbdb3 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTConvert+Text.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTConvert (Text) + ++ (UITextAutocorrectionType)UITextAutocorrectionType:(nullable id)json; ++ (UITextSpellCheckingType)UITextSpellCheckingType:(nullable id)json; ++ (RCTTextTransform)RCTTextTransform:(nullable id)json; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryShadowView.h new file mode 100644 index 0000000..8ed5110 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryView.h new file mode 100644 index 0000000..d4c48ce --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryView.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; +@class RCTInputAccessoryViewContent; + +@interface RCTInputAccessoryView : UIView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryViewContent.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryViewContent.h new file mode 100644 index 0000000..f65eea7 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryViewContent.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewContent : UIView + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryViewManager.h new file mode 100644 index 0000000..251048d --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTInputAccessoryViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTMultilineTextInputView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTMultilineTextInputView.h new file mode 100644 index 0000000..0efd63a --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTMultilineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTMultilineTextInputViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTMultilineTextInputViewManager.h new file mode 100644 index 0000000..3347fbb --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTMultilineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTRawTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTRawTextShadowView.h new file mode 100644 index 0000000..1b63014 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTRawTextShadowView.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextShadowView : RCTShadowView + +@property (nonatomic, copy, nullable) NSString *text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTRawTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTRawTextViewManager.h new file mode 100644 index 0000000..ef9a076 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTRawTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTSinglelineTextInputView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTSinglelineTextInputView.h new file mode 100644 index 0000000..d9450db --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTSinglelineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTSinglelineTextInputViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTSinglelineTextInputViewManager.h new file mode 100644 index 0000000..314993a --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTSinglelineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextAttributes.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextAttributes.h new file mode 100644 index 0000000..ce04362 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextAttributes.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTTextAttributesIsHighlightedAttributeName; +extern NSString *const RCTTextAttributesTagAttributeName; + +/** + * Represents knowledge about all supported *text* attributes + * assigned to some text component such as , , + * and . + */ +@interface RCTTextAttributes : NSObject + +// Color +@property (nonatomic, strong, nullable) UIColor *foregroundColor; +@property (nonatomic, strong, nullable) UIColor *backgroundColor; +@property (nonatomic, assign) CGFloat opacity; +// Font +@property (nonatomic, copy, nullable) NSString *fontFamily; +@property (nonatomic, assign) CGFloat fontSize; +@property (nonatomic, assign) CGFloat fontSizeMultiplier; +@property (nonatomic, assign) CGFloat maxFontSizeMultiplier; +@property (nonatomic, copy, nullable) NSString *fontWeight; +@property (nonatomic, copy, nullable) NSString *fontStyle; +@property (nonatomic, copy, nullable) NSArray *fontVariant; +@property (nonatomic, assign) BOOL allowFontScaling; +@property (nonatomic, assign) CGFloat letterSpacing; +// Paragraph Styles +@property (nonatomic, assign) CGFloat lineHeight; +@property (nonatomic, assign) NSTextAlignment alignment; +@property (nonatomic, assign) NSWritingDirection baseWritingDirection; +// Decoration +@property (nonatomic, strong, nullable) UIColor *textDecorationColor; +@property (nonatomic, assign) NSUnderlineStyle textDecorationStyle; +@property (nonatomic, assign) RCTTextDecorationLineType textDecorationLine; +// Shadow +@property (nonatomic, assign) CGSize textShadowOffset; +@property (nonatomic, assign) CGFloat textShadowRadius; +@property (nonatomic, strong, nullable) UIColor *textShadowColor; +// Special +@property (nonatomic, assign) BOOL isHighlighted; +@property (nonatomic, strong, nullable) NSNumber *tag; +@property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection; +@property (nonatomic, assign) RCTTextTransform textTransform; + +#pragma mark - Inheritance + +- (void)applyTextAttributes:(RCTTextAttributes *)textAttributes; + +#pragma mark - Adapters + +/** + * Text attributes in NSAttributedString terms. + */ +- (NSDictionary *)effectiveTextAttributes; + +/** + * Constructed paragraph style. + */ +- (NSParagraphStyle *_Nullable)effectiveParagraphStyle; + +/** + * Constructed font. + */ +- (UIFont *)effectiveFont; + +/** + * Font size multiplier reflects `allowFontScaling`, `fontSizeMultiplier`, and `maxFontSizeMultiplier`. + */ +- (CGFloat)effectiveFontSizeMultiplier; + +/** + * Foreground and background colors with opacity and right defaults. + */ +- (UIColor *)effectiveForegroundColor; +- (UIColor *)effectiveBackgroundColor; + +/** + * Text transformed per 'none', 'uppercase', 'lowercase', 'capitalize' + */ +- (NSString *)applyTextAttributesToText:(NSString *)text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextSelection.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextSelection.h new file mode 100644 index 0000000..0bb7583 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextSelection.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * Object containing information about a TextInput's selection. + */ +@interface RCTTextSelection : NSObject + +@property (nonatomic, assign, readonly) NSInteger start; +@property (nonatomic, assign, readonly) NSInteger end; + +- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end; + +@end + +@interface RCTConvert (RCTTextSelection) + ++ (RCTTextSelection *)RCTTextSelection:(id)json; + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextShadowView.h new file mode 100644 index 0000000..d364db5 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextShadowView.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, assign) NSLineBreakMode lineBreakMode; +@property (nonatomic, assign) BOOL adjustsFontSizeToFit; +@property (nonatomic, assign) CGFloat minimumFontScale; +@property (nonatomic, copy) RCTDirectEventBlock onTextLayout; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextTransform.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextTransform.h new file mode 100644 index 0000000..15d328c --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextTransform.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTTextTransform) { + RCTTextTransformUndefined = 0, + RCTTextTransformNone, + RCTTextTransformCapitalize, + RCTTextTransformUppercase, + RCTTextTransformLowercase, +}; diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextView.h new file mode 100644 index 0000000..5928b70 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextView.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextView : UIView + +@property (nonatomic, assign) BOOL selectable; + +- (void)setTextStorage:(NSTextStorage *)textStorage + contentFrame:(CGRect)contentFrame + descendantViews:(NSArray *)descendantViews; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextViewManager.h new file mode 100644 index 0000000..446a5db --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTTextViewManager.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextViewManager.h" + +@interface RCTTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTUITextField.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTUITextField.h new file mode 100644 index 0000000..f3b3492 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTUITextField.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextField... but much better! + */ +@interface RCTUITextField : UITextField + +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTUITextView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTUITextView.h new file mode 100644 index 0000000..5cb03ee --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTUITextView.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextView... but much better! + */ +@interface RCTUITextView : UITextView + +- (instancetype)initWithFrame:(CGRect)frame textContainer:(nullable NSTextContainer *)textContainer NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; + +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +// The `clearButtonMode` property actually is not supported yet; +// it's declared here only to conform to the interface. +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; + +@property (nonatomic, assign) BOOL caretHidden; + +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTVirtualTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTVirtualTextShadowView.h new file mode 100644 index 0000000..bce9ea8 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTVirtualTextShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +@interface RCTVirtualTextShadowView : RCTBaseTextShadowView + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTVirtualTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTVirtualTextViewManager.h new file mode 100644 index 0000000..91d4f78 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64/Headers/RCTText/RCTVirtualTextViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTVirtualTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64/libReact-RCTText.a b/Frameworks/React-RCTText.xcframework/ios-arm64/libReact-RCTText.a new file mode 100644 index 0000000..b0aaa36 Binary files /dev/null and b/Frameworks/React-RCTText.xcframework/ios-arm64/libReact-RCTText.a differ diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/NSTextStorage+FontScaling.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/NSTextStorage+FontScaling.h new file mode 100644 index 0000000..61b1634 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/NSTextStorage+FontScaling.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface NSTextStorage (FontScaling) + +- (void)scaleFontSizeToFitSize:(CGSize)size + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +- (void)scaleFontSizeWithRatio:(CGFloat)ratio + minimumFontSize:(CGFloat)minimumFontSize + maximumFontSize:(CGFloat)maximumFontSize; + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputDelegate.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputDelegate.h new file mode 100644 index 0000000..3e1839b --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputDelegate.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputViewProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputDelegate + +- (BOOL)textInputShouldBeginEditing; // Return `NO` to disallow editing. +- (void)textInputDidBeginEditing; + +- (BOOL)textInputShouldEndEditing; // Return `YES` to allow editing to stop and to resign first responder status. `NO` to disallow the editing session to end. +- (void)textInputDidEndEditing; // May be called if forced even if `textInputShouldEndEditing` returns `NO` (e.g. view removed from window) or `[textInput endEditing:YES]` called. + +- (BOOL)textInputShouldReturn; // May be called right before `textInputShouldEndEditing` if "Return" button was pressed. +- (void)textInputDidReturn; + +/* + * Called before any change in the TextInput. The delegate has the opportunity to change the replacement string or reject the change completely. + * To change the replacement, return the changed version of the `text`. + * To accept the change, return `text` argument as-is. + * To reject the change, return `nil`. + */ +- (NSString *)textInputShouldChangeText:(NSString *)text inRange:(NSRange)range; +- (void)textInputDidChange; + +- (void)textInputDidChangeSelection; + +@optional + +- (void)scrollViewDidScroll:(UIScrollView *)scrollView; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputDelegateAdapter.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputDelegateAdapter.h new file mode 100644 index 0000000..a7f3251 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputDelegateAdapter.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBackedTextInputViewProtocol.h" +#import "RCTBackedTextInputDelegate.h" + +NS_ASSUME_NONNULL_BEGIN + +#pragma mark - RCTBackedTextFieldDelegateAdapter (for UITextField) + +@interface RCTBackedTextFieldDelegateAdapter : NSObject + +- (instancetype)initWithTextField:(UITextField *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; +- (void)selectedTextRangeWasSet; + +@end + +#pragma mark - RCTBackedTextViewDelegateAdapter (for UITextView) + +@interface RCTBackedTextViewDelegateAdapter : NSObject + +- (instancetype)initWithTextView:(UITextView *)backedTextInputView; + +- (void)skipNextTextInputDidChangeSelectionEventWithTextRange:(UITextRange *)textRange; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputViewProtocol.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputViewProtocol.h new file mode 100644 index 0000000..09f4fe2 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBackedTextInputViewProtocol.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTBackedTextInputDelegate; +@class RCTTextAttributes; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTBackedTextInputViewProtocol + +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, strong, nullable) UIView *inputAccessoryView; +@property (nonatomic, strong, nullable) UIView *inputView; +@property (nonatomic, weak, nullable) id textInputDelegate; +@property (nonatomic, readonly) CGSize contentSize; +@property (nonatomic, strong, nullable) NSDictionary *defaultTextAttributes; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL enablesReturnKeyAutomatically; +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +// This protocol disallows direct access to `selectedTextRange` property because +// unwise usage of it can break the `delegate` behavior. So, we always have to +// explicitly specify should `delegate` be notified about the change or not. +// If the change was initiated programmatically, we must NOT notify the delegate. +// If the change was a result of user actions (like typing or touches), we MUST notify the delegate. +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange NS_UNAVAILABLE; +- (void)setSelectedTextRange:(nullable UITextRange *)selectedTextRange notifyDelegate:(BOOL)notifyDelegate; + +// This protocol disallows direct access to `text` property because +// unwise usage of it can break the `attributeText` behavior. +// Use `attributedText.string` instead. +@property (nonatomic, copy, nullable) NSString *text NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputShadowView.h new file mode 100644 index 0000000..44b46db --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputShadowView.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, copy, nullable) NSString *text; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputView.h new file mode 100644 index 0000000..d73f082 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputView.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTBackedTextInputDelegate.h" +#import "RCTBackedTextInputViewProtocol.h" + +@class RCTBridge; +@class RCTTextAttributes; +@class RCTTextSelection; + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextInputView : RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; +- (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE; + +@property (nonatomic, readonly) UIView *backedTextInputView; + +@property (nonatomic, strong, nullable) RCTTextAttributes *textAttributes; +@property (nonatomic, assign) UIEdgeInsets reactPaddingInsets; +@property (nonatomic, assign) UIEdgeInsets reactBorderInsets; + +@property (nonatomic, copy, nullable) RCTDirectEventBlock onContentSizeChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onSelectionChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onChange; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onTextInput; +@property (nonatomic, copy, nullable) RCTDirectEventBlock onScroll; + +@property (nonatomic, assign) NSInteger mostRecentEventCount; +@property (nonatomic, assign, readonly) NSInteger nativeEventCount; +@property (nonatomic, assign) BOOL autoFocus; +@property (nonatomic, assign) BOOL blurOnSubmit; +@property (nonatomic, assign) BOOL selectTextOnFocus; +@property (nonatomic, assign) BOOL clearTextOnFocus; +@property (nonatomic, assign) BOOL secureTextEntry; +@property (nonatomic, copy) RCTTextSelection *selection; +@property (nonatomic, strong, nullable) NSNumber *maxLength; +@property (nonatomic, copy, nullable) NSAttributedString *attributedText; +@property (nonatomic, copy) NSString *inputAccessoryViewID; +@property (nonatomic, assign) UIKeyboardType keyboardType; +@property (nonatomic, assign) BOOL showSoftInputOnFocus; + +/** + Sets selection intext input if both start and end are within range of the text input. + **/ +- (void)setSelectionStart:(NSInteger)start + selectionEnd:(NSInteger)end; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputViewManager.h new file mode 100644 index 0000000..5201bdb --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextInputViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTBaseTextInputViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextShadowView.h new file mode 100644 index 0000000..9f2c944 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextShadowView.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextAttributes.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTBaseTextShadowViewEmbeddedShadowViewAttributeName; + +@interface RCTBaseTextShadowView : RCTShadowView { + @protected NSAttributedString *_Nullable cachedAttributedText; + @protected RCTTextAttributes *_Nullable cachedTextAttributes; +} + +@property (nonatomic, strong) RCTTextAttributes *textAttributes; + +- (NSAttributedString *)attributedTextWithBaseTextAttributes:(nullable RCTTextAttributes *)baseTextAttributes; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextViewManager.h new file mode 100644 index 0000000..b0f9470 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTBaseTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTBaseTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTConvert+Text.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTConvert+Text.h new file mode 100644 index 0000000..eafbdb3 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTConvert+Text.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTConvert (Text) + ++ (UITextAutocorrectionType)UITextAutocorrectionType:(nullable id)json; ++ (UITextSpellCheckingType)UITextSpellCheckingType:(nullable id)json; ++ (RCTTextTransform)RCTTextTransform:(nullable id)json; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryShadowView.h new file mode 100644 index 0000000..8ed5110 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryShadowView : RCTShadowView + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryView.h new file mode 100644 index 0000000..d4c48ce --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryView.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class RCTBridge; +@class RCTInputAccessoryViewContent; + +@interface RCTInputAccessoryView : UIView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryViewContent.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryViewContent.h new file mode 100644 index 0000000..f65eea7 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryViewContent.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewContent : UIView + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryViewManager.h new file mode 100644 index 0000000..251048d --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTInputAccessoryViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RCTInputAccessoryViewManager : RCTViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTMultilineTextInputView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTMultilineTextInputView.h new file mode 100644 index 0000000..0efd63a --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTMultilineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTMultilineTextInputViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTMultilineTextInputViewManager.h new file mode 100644 index 0000000..3347fbb --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTMultilineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTMultilineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTRawTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTRawTextShadowView.h new file mode 100644 index 0000000..1b63014 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTRawTextShadowView.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextShadowView : RCTShadowView + +@property (nonatomic, copy, nullable) NSString *text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTRawTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTRawTextViewManager.h new file mode 100644 index 0000000..ef9a076 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTRawTextViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTRawTextViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTSinglelineTextInputView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTSinglelineTextInputView.h new file mode 100644 index 0000000..d9450db --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTSinglelineTextInputView.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputView : RCTBaseTextInputView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTSinglelineTextInputViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTSinglelineTextInputViewManager.h new file mode 100644 index 0000000..314993a --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTSinglelineTextInputViewManager.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextInputViewManager.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTSinglelineTextInputViewManager : RCTBaseTextInputViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextAttributes.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextAttributes.h new file mode 100644 index 0000000..ce04362 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextAttributes.h @@ -0,0 +1,97 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "RCTTextTransform.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const RCTTextAttributesIsHighlightedAttributeName; +extern NSString *const RCTTextAttributesTagAttributeName; + +/** + * Represents knowledge about all supported *text* attributes + * assigned to some text component such as , , + * and . + */ +@interface RCTTextAttributes : NSObject + +// Color +@property (nonatomic, strong, nullable) UIColor *foregroundColor; +@property (nonatomic, strong, nullable) UIColor *backgroundColor; +@property (nonatomic, assign) CGFloat opacity; +// Font +@property (nonatomic, copy, nullable) NSString *fontFamily; +@property (nonatomic, assign) CGFloat fontSize; +@property (nonatomic, assign) CGFloat fontSizeMultiplier; +@property (nonatomic, assign) CGFloat maxFontSizeMultiplier; +@property (nonatomic, copy, nullable) NSString *fontWeight; +@property (nonatomic, copy, nullable) NSString *fontStyle; +@property (nonatomic, copy, nullable) NSArray *fontVariant; +@property (nonatomic, assign) BOOL allowFontScaling; +@property (nonatomic, assign) CGFloat letterSpacing; +// Paragraph Styles +@property (nonatomic, assign) CGFloat lineHeight; +@property (nonatomic, assign) NSTextAlignment alignment; +@property (nonatomic, assign) NSWritingDirection baseWritingDirection; +// Decoration +@property (nonatomic, strong, nullable) UIColor *textDecorationColor; +@property (nonatomic, assign) NSUnderlineStyle textDecorationStyle; +@property (nonatomic, assign) RCTTextDecorationLineType textDecorationLine; +// Shadow +@property (nonatomic, assign) CGSize textShadowOffset; +@property (nonatomic, assign) CGFloat textShadowRadius; +@property (nonatomic, strong, nullable) UIColor *textShadowColor; +// Special +@property (nonatomic, assign) BOOL isHighlighted; +@property (nonatomic, strong, nullable) NSNumber *tag; +@property (nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection; +@property (nonatomic, assign) RCTTextTransform textTransform; + +#pragma mark - Inheritance + +- (void)applyTextAttributes:(RCTTextAttributes *)textAttributes; + +#pragma mark - Adapters + +/** + * Text attributes in NSAttributedString terms. + */ +- (NSDictionary *)effectiveTextAttributes; + +/** + * Constructed paragraph style. + */ +- (NSParagraphStyle *_Nullable)effectiveParagraphStyle; + +/** + * Constructed font. + */ +- (UIFont *)effectiveFont; + +/** + * Font size multiplier reflects `allowFontScaling`, `fontSizeMultiplier`, and `maxFontSizeMultiplier`. + */ +- (CGFloat)effectiveFontSizeMultiplier; + +/** + * Foreground and background colors with opacity and right defaults. + */ +- (UIColor *)effectiveForegroundColor; +- (UIColor *)effectiveBackgroundColor; + +/** + * Text transformed per 'none', 'uppercase', 'lowercase', 'capitalize' + */ +- (NSString *)applyTextAttributesToText:(NSString *)text; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextSelection.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextSelection.h new file mode 100644 index 0000000..0bb7583 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextSelection.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +/** + * Object containing information about a TextInput's selection. + */ +@interface RCTTextSelection : NSObject + +@property (nonatomic, assign, readonly) NSInteger start; +@property (nonatomic, assign, readonly) NSInteger end; + +- (instancetype)initWithStart:(NSInteger)start end:(NSInteger)end; + +@end + +@interface RCTConvert (RCTTextSelection) + ++ (RCTTextSelection *)RCTTextSelection:(id)json; + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextShadowView.h new file mode 100644 index 0000000..d364db5 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextShadowView.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextShadowView.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextShadowView : RCTBaseTextShadowView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) NSInteger maximumNumberOfLines; +@property (nonatomic, assign) NSLineBreakMode lineBreakMode; +@property (nonatomic, assign) BOOL adjustsFontSizeToFit; +@property (nonatomic, assign) CGFloat minimumFontScale; +@property (nonatomic, copy) RCTDirectEventBlock onTextLayout; + +- (void)uiManagerWillPerformMounting; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextTransform.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextTransform.h new file mode 100644 index 0000000..15d328c --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextTransform.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +typedef NS_ENUM(NSInteger, RCTTextTransform) { + RCTTextTransformUndefined = 0, + RCTTextTransformNone, + RCTTextTransformCapitalize, + RCTTextTransformUppercase, + RCTTextTransformLowercase, +}; diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextView.h new file mode 100644 index 0000000..5928b70 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextView.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTTextView : UIView + +@property (nonatomic, assign) BOOL selectable; + +- (void)setTextStorage:(NSTextStorage *)textStorage + contentFrame:(CGRect)contentFrame + descendantViews:(NSArray *)descendantViews; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextViewManager.h new file mode 100644 index 0000000..446a5db --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTTextViewManager.h @@ -0,0 +1,14 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "RCTBaseTextViewManager.h" + +@interface RCTTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTUITextField.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTUITextField.h new file mode 100644 index 0000000..f3b3492 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTUITextField.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextField... but much better! + */ +@interface RCTUITextField : UITextField + +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL caretHidden; +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; +@property (nonatomic, assign) UIEdgeInsets textContainerInset; +@property (nonatomic, assign, getter=isEditable) BOOL editable; +@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled; +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTUITextView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTUITextView.h new file mode 100644 index 0000000..5cb03ee --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTUITextView.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +/* + * Just regular UITextView... but much better! + */ +@interface RCTUITextView : UITextView + +- (instancetype)initWithFrame:(CGRect)frame textContainer:(nullable NSTextContainer *)textContainer NS_UNAVAILABLE; +- (instancetype)initWithCoder:(NSCoder *)decoder NS_UNAVAILABLE; + +@property (nonatomic, weak) id textInputDelegate; + +@property (nonatomic, assign) BOOL contextMenuHidden; +@property (nonatomic, assign, readonly) BOOL textWasPasted; +@property (nonatomic, copy, nullable) NSString *placeholder; +@property (nonatomic, strong, nullable) UIColor *placeholderColor; + +@property (nonatomic, assign) CGFloat preferredMaxLayoutWidth; + +// The `clearButtonMode` property actually is not supported yet; +// it's declared here only to conform to the interface. +@property (nonatomic, assign) UITextFieldViewMode clearButtonMode; + +@property (nonatomic, assign) BOOL caretHidden; + +@property (nonatomic, strong, nullable) NSString *inputAccessoryViewID; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTVirtualTextShadowView.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTVirtualTextShadowView.h new file mode 100644 index 0000000..bce9ea8 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTVirtualTextShadowView.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextShadowView.h" + +@interface RCTVirtualTextShadowView : RCTBaseTextShadowView + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTVirtualTextViewManager.h b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTVirtualTextViewManager.h new file mode 100644 index 0000000..91d4f78 --- /dev/null +++ b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/Headers/RCTText/RCTVirtualTextViewManager.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "RCTBaseTextViewManager.h" + +@interface RCTVirtualTextViewManager : RCTBaseTextViewManager + +@end diff --git a/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/libReact-RCTText.a b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/libReact-RCTText.a new file mode 100644 index 0000000..56b5e31 Binary files /dev/null and b/Frameworks/React-RCTText.xcframework/ios-arm64_x86_64-simulator/libReact-RCTText.a differ diff --git a/Frameworks/React-RCTVibration.xcframework/Info.plist b/Frameworks/React-RCTVibration.xcframework/Info.plist new file mode 100644 index 0000000..25826dc --- /dev/null +++ b/Frameworks/React-RCTVibration.xcframework/Info.plist @@ -0,0 +1,44 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-RCTVibration.a + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-RCTVibration.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-RCTVibration.a + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-RCTVibration.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-RCTVibration.xcframework/ios-arm64/libReact-RCTVibration.a b/Frameworks/React-RCTVibration.xcframework/ios-arm64/libReact-RCTVibration.a new file mode 100644 index 0000000..aa23354 Binary files /dev/null and b/Frameworks/React-RCTVibration.xcframework/ios-arm64/libReact-RCTVibration.a differ diff --git a/Frameworks/React-RCTVibration.xcframework/ios-arm64_x86_64-simulator/libReact-RCTVibration.a b/Frameworks/React-RCTVibration.xcframework/ios-arm64_x86_64-simulator/libReact-RCTVibration.a new file mode 100644 index 0000000..4eee7bf Binary files /dev/null and b/Frameworks/React-RCTVibration.xcframework/ios-arm64_x86_64-simulator/libReact-RCTVibration.a differ diff --git a/Frameworks/React-cxxreact.xcframework/Info.plist b/Frameworks/React-cxxreact.xcframework/Info.plist new file mode 100644 index 0000000..06e5e6d --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-cxxreact.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-cxxreact.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-cxxreact.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-cxxreact.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/CxxModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/CxxModule.h new file mode 100644 index 0000000..64b7db6 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/CxxModule.h @@ -0,0 +1,258 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#include + +using namespace std::placeholders; + +namespace facebook { +namespace react { + +class Instance; + +} +} // namespace facebook + +namespace facebook { +namespace xplat { +namespace module { + +/** + * Base class for Catalyst native modules whose implementations are + * written in C++. Native methods are represented by instances of the + * Method struct. Generally, a derived class will manage an instance + * which represents the data for the module, and non-Catalyst-specific + * methods can be wrapped in lambdas which convert between + * folly::dynamic and native C++ objects. The Callback arguments will + * pass through to js functions passed to the analogous javascript + * methods. At most two callbacks will be converted. Results should + * be passed to the first callback, and errors to the second callback. + * Exceptions thrown by a method will be converted to platform + * exceptions, and handled however they are handled on that platform. + * (TODO mhorowitz #7128529: this exception behavior is not yet + * implemented.) + * + * There are two sets of constructors here. The first set initializes + * a Method using a name and anything convertible to a std::function. + * This is most useful for registering a lambda as a RN method. There + * are overloads to support functions which take no arguments, + * arguments only, and zero, one, or two callbacks. + * + * The second set of methods is similar, but instead of taking a + * function, takes the method name, an object, and a pointer to a + * method on that object. + */ + +class CxxModule { + class AsyncTagType {}; + class SyncTagType {}; + + public: + typedef std::function()> Provider; + + typedef std::function)> Callback; + + constexpr static AsyncTagType AsyncTag = AsyncTagType(); + constexpr static SyncTagType SyncTag = SyncTagType(); + + struct Method { + std::string name; + + size_t callbacks; + bool isPromise; + std::function func; + + std::function syncFunc; + + const char *getType() { + assert(func || syncFunc); + return func ? (isPromise ? "promise" : "async") : "sync"; + } + + // std::function/lambda ctors + + Method(std::string aname, std::function &&afunc) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(std::move(afunc))) {} + + Method(std::string aname, std::function &&afunc) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(std::move(afunc), std::placeholders::_1)) {} + + Method( + std::string aname, + std::function &&afunc) + : name(std::move(aname)), + callbacks(1), + isPromise(false), + func(std::bind( + std::move(afunc), + std::placeholders::_1, + std::placeholders::_2)) {} + + Method( + std::string aname, + std::function &&afunc) + : name(std::move(aname)), + callbacks(2), + isPromise(true), + func(std::move(afunc)) {} + + Method( + std::string aname, + std::function &&afunc, + AsyncTagType) + : name(std::move(aname)), + callbacks(2), + isPromise(false), + func(std::move(afunc)) {} + + // method pointer ctors + + template + Method(std::string aname, T *t, void (T::*method)()) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(method, t)) {} + + template + Method(std::string aname, T *t, void (T::*method)(folly::dynamic)) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(method, t, std::placeholders::_1)) {} + + template + Method(std::string aname, T *t, void (T::*method)(folly::dynamic, Callback)) + : name(std::move(aname)), + callbacks(1), + isPromise(false), + func(std::bind( + method, + t, + std::placeholders::_1, + std::placeholders::_2)) {} + + template + Method( + std::string aname, + T *t, + void (T::*method)(folly::dynamic, Callback, Callback)) + : name(std::move(aname)), + callbacks(2), + isPromise(true), + func(std::bind( + method, + t, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3)) {} + + template + Method( + std::string aname, + T *t, + void (T::*method)(folly::dynamic, Callback, Callback), + AsyncTagType) + : name(std::move(aname)), + callbacks(2), + isPromise(false), + func(std::bind( + method, + t, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3)) {} + + // sync std::function/lambda ctors + + // Overloads for functions returning void give ambiguity errors. + // I am not sure if this is a runtime/compiler bug, or a + // limitation I do not understand. + + Method( + std::string aname, + std::function &&afunc, + SyncTagType) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + syncFunc([afunc = std::move(afunc)](const folly::dynamic &) { + return afunc(); + }) {} + + Method( + std::string aname, + std::function &&afunc, + SyncTagType) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + syncFunc(std::move(afunc)) {} + }; + + /** + * This may block, if necessary to complete cleanup before the + * object is destroyed. + */ + virtual ~CxxModule() {} + + /** + * @return the name of this module. This will be the name used to {@code + * require()} this module from javascript. + */ + virtual std::string getName() = 0; + + /** + * Each entry in the map will be exported as a property to JS. The + * key is the property name, and the value can be anything. + */ + virtual auto getConstants() -> std::map { + return {}; + }; + + /** + * @return a list of methods this module exports to JS. + */ + virtual auto getMethods() -> std::vector = 0; + + /** + * Called during the construction of CxxNativeModule. + */ + void setInstance(std::weak_ptr instance) { + instance_ = instance; + } + + /** + * @return a weak_ptr to the current instance of the bridge. + * When used with CxxNativeModule, this gives Cxx modules access to functions + * such as `callJSFunction`, allowing them to communicate back to JS outside + * of the regular callbacks. + */ + std::weak_ptr getInstance() { + return instance_; + } + + private: + std::weak_ptr instance_; +}; + +} // namespace module +} // namespace xplat +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/CxxNativeModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/CxxNativeModule.h new file mode 100644 index 0000000..a10f0ec --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/CxxNativeModule.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class Instance; +class MessageQueueThread; + +typedef void (*WarnOnUsageLogger)(std::string message); + +std::function makeCallback( + std::weak_ptr instance, + const folly::dynamic &callbackId); + +class RN_EXPORT CxxNativeModule : public NativeModule { + public: + CxxNativeModule( + std::weak_ptr instance, + std::string name, + xplat::module::CxxModule::Provider provider, + std::shared_ptr messageQueueThread) + : instance_(instance), + name_(std::move(name)), + provider_(provider), + messageQueueThread_(messageQueueThread) {} + + std::string getName() override; + std::string getSyncMethodName(unsigned int methodId) override; + std::vector getMethods() override; + folly::dynamic getConstants() override; + void invoke(unsigned int reactMethodId, folly::dynamic &¶ms, int callId) + override; + MethodCallResult callSerializableNativeHook( + unsigned int hookId, + folly::dynamic &&args) override; + + static void setShouldWarnOnUse(bool value); + + private: + void lazyInit(); + + std::weak_ptr instance_; + std::string name_; + xplat::module::CxxModule::Provider provider_; + std::shared_ptr messageQueueThread_; + std::unique_ptr module_; + std::vector methods_; + void emitWarnIfWarnOnUsage( + const std::string &method_name, + const std::string &module_name); + + static bool shouldWarnOnUse_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ErrorUtils.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ErrorUtils.h new file mode 100644 index 0000000..3ab715b --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ErrorUtils.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +namespace facebook { +namespace react { + +inline static void +handleJSError(jsi::Runtime &runtime, const jsi::JSError &error, bool isFatal) { + auto errorUtils = runtime.global().getProperty(runtime, "ErrorUtils"); + if (errorUtils.isUndefined() || !errorUtils.isObject() || + !errorUtils.getObject(runtime).hasProperty(runtime, "reportFatalError") || + !errorUtils.getObject(runtime).hasProperty(runtime, "reportError")) { + // ErrorUtils was not set up. This probably means the bundle didn't + // load properly. + throw jsi::JSError( + runtime, + "ErrorUtils is not set up properly. Something probably went wrong trying to load the JS bundle. Trying to report error " + + error.getMessage(), + error.getStack()); + } + + // TODO(janzer): Rewrite this function to return the processed error + // instead of just reporting it through the native module + if (isFatal) { + auto func = errorUtils.asObject(runtime).getPropertyAsFunction( + runtime, "reportFatalError"); + + func.call(runtime, error.value()); + } else { + auto func = errorUtils.asObject(runtime).getPropertyAsFunction( + runtime, "reportError"); + + func.call(runtime, error.value()); + } +} + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/Instance.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/Instance.h new file mode 100644 index 0000000..7cd11f9 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/Instance.h @@ -0,0 +1,179 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace folly { +struct dynamic; +} + +namespace facebook { +namespace react { + +class JSBigString; +class JSExecutorFactory; +class MessageQueueThread; +class ModuleRegistry; +class RAMBundleRegistry; + +struct InstanceCallback { + virtual ~InstanceCallback() {} + virtual void onBatchComplete() {} + virtual void incrementPendingJSCalls() {} + virtual void decrementPendingJSCalls() {} +}; + +class RN_EXPORT Instance { + public: + ~Instance(); + void initializeBridge( + std::unique_ptr callback, + std::shared_ptr jsef, + std::shared_ptr jsQueue, + std::shared_ptr moduleRegistry); + + void initializeRuntime(); + + void setSourceURL(std::string sourceURL); + + void loadScriptFromString( + std::unique_ptr string, + std::string sourceURL, + bool loadSynchronously); + static bool isHBCBundle(const char *sourcePath); + static bool isIndexedRAMBundle(const char *sourcePath); + static bool isIndexedRAMBundle(std::unique_ptr *string); + void loadRAMBundleFromString( + std::unique_ptr script, + const std::string &sourceURL); + void loadRAMBundleFromFile( + const std::string &sourcePath, + const std::string &sourceURL, + bool loadSynchronously); + void loadRAMBundle( + std::unique_ptr bundleRegistry, + std::unique_ptr startupScript, + std::string startupScriptSourceURL, + bool loadSynchronously); + bool supportsProfiling(); + void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue); + void *getJavaScriptContext(); + bool isInspectable(); + bool isBatchActive(); + void callJSFunction( + std::string &&module, + std::string &&method, + folly::dynamic &¶ms); + void callJSCallback(uint64_t callbackId, folly::dynamic &¶ms); + + // This method is experimental, and may be modified or removed. + void registerBundle(uint32_t bundleId, const std::string &bundlePath); + + const ModuleRegistry &getModuleRegistry() const; + ModuleRegistry &getModuleRegistry(); + + void handleMemoryPressure(int pressureLevel); + + /** + * JS CallInvoker is used by TurboModules to schedule work on the JS thread. + * + * Why is the bridge creating JS CallInvoker? + * + * - After every Native -> JS call in the TurboModule system, the bridge + * needs to flush all queued NativeModule method calls. The bridge must + * also dispatch onBatchComplete if the queue of NativeModule method calls + * was not empty. + */ + std::shared_ptr getJSCallInvoker(); + + /** + * Native CallInvoker is used by TurboModules to schedule work on the + * NativeModule thread(s). + * + * Why is the bridge decorating native CallInvoker? + * + * - The bridge must be informed of all TurboModule async method calls. Why? + * When all queued NativeModule method calls are flushed by a call from + * Native -> JS, if that queue was non-zero in size, JsToNativeBridge + * dispatches onBatchComplete. When we turn our NativeModules to + * TurboModuels, there will be less and less pending NativeModule method + * calls, so onBatchComplete will not fire as often. Therefore, the bridge + * needs to know how many TurboModule async method calls have been completed + * since the last time the bridge was flushed. If this number is non-zero, + * we fire onBatchComplete. + * + * Why can't we just create and return a new native CallInvoker? + * + * - On Android, we have one NativeModule thread. That thread is created and + * managed outisde of NativeToJsBridge. On iOS, we have one MethodQueue per + * module. Those MethodQueues are also created and managed outside of + * NativeToJsBridge. Therefore, we need to pass in a CallInvoker that + * schedules work on the respective thread. + */ + std::shared_ptr getDecoratedNativeCallInvoker( + std::shared_ptr nativeInvoker); + + /** + * RuntimeExecutor is used by Fabric to access the jsi::Runtime. + */ + RuntimeExecutor getRuntimeExecutor(); + + private: + void callNativeModules(folly::dynamic &&calls, bool isEndOfBatch); + void loadBundle( + std::unique_ptr bundleRegistry, + std::unique_ptr startupScript, + std::string startupScriptSourceURL); + void loadBundleSync( + std::unique_ptr bundleRegistry, + std::unique_ptr startupScript, + std::string startupScriptSourceURL); + + std::shared_ptr callback_; + std::shared_ptr nativeToJsBridge_; + std::shared_ptr moduleRegistry_; + + std::mutex m_syncMutex; + std::condition_variable m_syncCV; + bool m_syncReady = false; + + class JSCallInvoker : public CallInvoker { + private: + std::weak_ptr m_nativeToJsBridge; + std::mutex m_mutex; + bool m_shouldBuffer = true; + std::list> m_workBuffer; + + void scheduleAsync(std::function &&work); + + public: + void setNativeToJsBridgeAndFlushCalls( + std::weak_ptr nativeToJsBridge); + void invokeAsync(std::function &&work) override; + void invokeSync(std::function &&work) override; + }; + + std::shared_ptr jsCallInvoker_ = + std::make_shared(); +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSBigString.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSBigString.h new file mode 100644 index 0000000..c4996c4 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSBigString.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#ifndef RN_EXPORT +#ifdef _MSC_VER +#define RN_EXPORT +#else +#define RN_EXPORT __attribute__((visibility("default"))) +#endif +#endif + +namespace facebook { +namespace react { + +// JSExecutor functions sometimes take large strings, on the order of +// megabytes. Copying these can be expensive. Introducing a +// move-only, non-CopyConstructible type will let the compiler ensure +// that no copies occur. folly::MoveWrapper should be used when a +// large string needs to be curried into a std::function<>, which must +// by CopyConstructible. + +class JSBigString { + public: + JSBigString() = default; + + // Not copyable + JSBigString(const JSBigString &) = delete; + JSBigString &operator=(const JSBigString &) = delete; + + virtual ~JSBigString() {} + + virtual bool isAscii() const = 0; + + // This needs to be a \0 terminated string + virtual const char *c_str() const = 0; + + // Length of the c_str without the NULL byte. + virtual size_t size() const = 0; +}; + +// Concrete JSBigString implementation which holds a std::string +// instance. +class JSBigStdString : public JSBigString { + public: + JSBigStdString(std::string str, bool isAscii = false) + : m_isAscii(isAscii), m_str(std::move(str)) {} + + bool isAscii() const override { + return m_isAscii; + } + + const char *c_str() const override { + return m_str.c_str(); + } + + size_t size() const override { + return m_str.size(); + } + + private: + bool m_isAscii; + std::string m_str; +}; + +// Concrete JSBigString implementation which holds a heap-allocated +// buffer, and provides an accessor for writing to it. This can be +// used to construct a JSBigString in place, such as by reading from a +// file. +class RN_EXPORT JSBigBufferString : public JSBigString { + public: + JSBigBufferString(size_t size) : m_data(new char[size + 1]), m_size(size) { + // Guarantee nul-termination. The caller is responsible for + // filling in the rest of m_data. + m_data[m_size] = '\0'; + } + + ~JSBigBufferString() { + delete[] m_data; + } + + bool isAscii() const override { + return true; + } + + const char *c_str() const override { + return m_data; + } + + size_t size() const override { + return m_size; + } + + char *data() { + return m_data; + } + + private: + char *m_data; + size_t m_size; +}; + +// JSBigString interface implemented by a file-backed mmap region. +class RN_EXPORT JSBigFileString : public JSBigString { + public: + JSBigFileString(int fd, size_t size, off_t offset = 0); + ~JSBigFileString(); + + bool isAscii() const override { + return true; + } + + const char *c_str() const override; + + size_t size() const override; + int fd() const; + + static std::unique_ptr fromPath( + const std::string &sourceURL); + + private: + int m_fd; // The file descriptor being mmaped + size_t m_size; // The size of the mmaped region + mutable off_t m_pageOff; // The offset in the mmaped region to the data. + off_t m_mapOff; // The offset in the file to the mmaped region. + mutable const char *m_data; // Pointer to the mmaped region. +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSBundleType.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSBundleType.h new file mode 100644 index 0000000..be39711 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSBundleType.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +/* + * ScriptTag + * + * Scripts given to the JS Executors to run could be in any of the following + * formats. They are tagged so the executor knows how to run them. + */ +enum struct ScriptTag { + String = 0, + RAMBundle, + HBCBundle, +}; + +/** + * BundleHeader + * + * RAM bundles and BC bundles begin with headers. For RAM bundles this is + * 4 bytes, for BC bundles this is 12 bytes. This structure holds the first 12 + * bytes from a bundle in a way that gives access to that information. + */ +FOLLY_PACK_PUSH +struct FOLLY_PACK_ATTR BundleHeader { + BundleHeader() { + std::memset(this, 0, sizeof(BundleHeader)); + } + + uint32_t magic; + uint32_t reserved_; + uint32_t version; +}; +FOLLY_PACK_POP + +/** + * parseTypeFromHeader + * + * Takes the first 8 bytes of a bundle, and returns a tag describing the + * bundle's format. + */ +RN_EXPORT ScriptTag parseTypeFromHeader(const BundleHeader &header); + +/** + * stringForScriptTag + * + * Convert an `ScriptTag` enum into a string, useful for emitting in errors + * and diagnostic messages. + */ +RN_EXPORT const char *stringForScriptTag(const ScriptTag &tag); + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSExecutor.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSExecutor.h new file mode 100644 index 0000000..b3b29d1 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSExecutor.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class JSBigString; +class JSExecutor; +class JSModulesUnbundle; +class MessageQueueThread; +class ModuleRegistry; +class RAMBundleRegistry; + +// This interface describes the delegate interface required by +// Executor implementations to call from JS into native code. +class ExecutorDelegate { + public: + virtual ~ExecutorDelegate() {} + + virtual std::shared_ptr getModuleRegistry() = 0; + + virtual void callNativeModules( + JSExecutor &executor, + folly::dynamic &&calls, + bool isEndOfBatch) = 0; + virtual MethodCallResult callSerializableNativeHook( + JSExecutor &executor, + unsigned int moduleId, + unsigned int methodId, + folly::dynamic &&args) = 0; +}; + +using NativeExtensionsProvider = + std::function; + +class JSExecutorFactory { + public: + virtual std::unique_ptr createJSExecutor( + std::shared_ptr delegate, + std::shared_ptr jsQueue) = 0; + virtual ~JSExecutorFactory() {} +}; + +class RN_EXPORT JSExecutor { + public: + /** + * Prepares the JS runtime for React Native by installing global variables. + * Called once before any JS is evaluated. + */ + virtual void initializeRuntime() = 0; + /** + * Execute an application script bundle in the JS context. + */ + virtual void loadBundle( + std::unique_ptr script, + std::string sourceURL) = 0; + + /** + * Add an application "RAM" bundle registry + */ + virtual void setBundleRegistry( + std::unique_ptr bundleRegistry) = 0; + + /** + * Register a file path for an additional "RAM" bundle + */ + virtual void registerBundle( + uint32_t bundleId, + const std::string &bundlePath) = 0; + + /** + * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module ID, + * method ID and optional additional arguments in JS. The executor is + * responsible for using Bridge->callNativeModules to invoke any necessary + * native modules methods. + */ + virtual void callFunction( + const std::string &moduleId, + const std::string &methodId, + const folly::dynamic &arguments) = 0; + + /** + * Executes BatchedBridge.invokeCallbackAndReturnFlushedQueue with the cbID, + * and optional additional arguments in JS and returns the next queue. The + * executor is responsible for using Bridge->callNativeModules to invoke any + * necessary native modules methods. + */ + virtual void invokeCallback( + const double callbackId, + const folly::dynamic &arguments) = 0; + + virtual void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue) = 0; + + virtual void *getJavaScriptContext() { + return nullptr; + } + + /** + * Returns whether or not the underlying executor supports debugging via the + * Chrome remote debugging protocol. + */ + virtual bool isInspectable() { + return false; + } + + /** + * The description is displayed in the dev menu, if there is one in + * this build. There is a default, but if this method returns a + * non-empty string, it will be used instead. + */ + virtual std::string getDescription() = 0; + + virtual void handleMemoryPressure(__unused int pressureLevel) {} + + virtual void destroy() {} + virtual ~JSExecutor() {} + + virtual void flush() {} + + static std::string getSyntheticBundlePath( + uint32_t bundleId, + const std::string &bundlePath); +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSIndexedRAMBundle.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSIndexedRAMBundle.h new file mode 100644 index 0000000..3045eb6 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSIndexedRAMBundle.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class RN_EXPORT JSIndexedRAMBundle : public JSModulesUnbundle { + public: + static std::function(std::string)> + buildFactory(); + + // Throws std::runtime_error on failure. + JSIndexedRAMBundle(const char *sourceURL); + JSIndexedRAMBundle(std::unique_ptr script); + + // Throws std::runtime_error on failure. + std::unique_ptr getStartupCode(); + // Throws std::runtime_error on failure. + Module getModule(uint32_t moduleId) const override; + + private: + struct ModuleData { + uint32_t offset; + uint32_t length; + }; + static_assert( + sizeof(ModuleData) == 8, + "ModuleData must not have any padding and use sizes matching input files"); + + struct ModuleTable { + size_t numEntries; + std::unique_ptr data; + ModuleTable() : numEntries(0){}; + ModuleTable(size_t entries) + : numEntries(entries), + data(std::unique_ptr(new ModuleData[numEntries])){}; + size_t byteLength() const { + return numEntries * sizeof(ModuleData); + } + }; + + void init(); + std::string getModuleCode(const uint32_t id) const; + void readBundle(char *buffer, const std::streamsize bytes) const; + void readBundle( + char *buffer, + const std::streamsize bytes, + const std::istream::pos_type position) const; + + mutable std::unique_ptr m_bundle; + ModuleTable m_table; + size_t m_baseOffset; + std::unique_ptr m_startupCode; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSModulesUnbundle.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSModulesUnbundle.h new file mode 100644 index 0000000..52103f7 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JSModulesUnbundle.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include + +namespace facebook { +namespace react { + +class JSModulesUnbundle { + /** + * Represents the set of JavaScript modules that the application consists of. + * The source code of each module can be retrieved by module ID. + * + * The class is non-copyable because copying instances might involve copying + * several megabytes of memory. + */ + public: + class ModuleNotFound : public std::out_of_range { + public: + using std::out_of_range::out_of_range; + ModuleNotFound(uint32_t moduleId) + : std::out_of_range::out_of_range( + folly::to("Module not found: ", moduleId)) {} + }; + struct Module { + std::string name; + std::string code; + }; + JSModulesUnbundle() {} + virtual ~JSModulesUnbundle() {} + virtual Module getModule(uint32_t moduleId) const = 0; + + private: + JSModulesUnbundle(const JSModulesUnbundle &) = delete; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JsArgumentHelpers-inl.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JsArgumentHelpers-inl.h new file mode 100644 index 0000000..fa76074 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JsArgumentHelpers-inl.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once +#include + +namespace facebook { +namespace xplat { + +namespace detail { + +template +R jsArg1(const folly::dynamic &arg, M asFoo, const T &...desc) { + try { + return (arg.*asFoo)(); + } catch (const folly::TypeError &ex) { + throw JsArgumentException(folly::to( + "Error converting javascript arg ", desc..., " to C++: ", ex.what())); + } catch (const std::range_error &ex) { + throw JsArgumentException(folly::to( + "Could not convert argument ", + desc..., + " to required type: ", + ex.what())); + } +} + +} // namespace detail + +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const, + const T &...desc) { + return detail::jsArg1(arg, asFoo, desc...); +} + +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const &, + const T &...desc) { + return detail::jsArg1(arg, asFoo, desc...); +} + +template +// NOLINTNEXTLINE (T62192316) +typename detail::is_dynamic::type &jsArgAsDynamic(T &&args, size_t n) { + try { + return args[n]; + } catch (const std::out_of_range &ex) { + // Use 1-base counting for argument description. + throw JsArgumentException(folly::to( + "JavaScript provided ", + args.size(), + " arguments for C++ method which references at least ", + n + 1, + " arguments: ", + ex.what())); + } +} + +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const) { + return jsArg(jsArgAsDynamic(args, n), asFoo, n); +} +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const &) { + return jsArg(jsArgAsDynamic(args, n), asFoo, n); +} + +namespace detail { + +// This is a helper for jsArgAsArray and jsArgAsObject. + +template +typename detail::is_dynamic::type &jsArgAsType( + T &&args, + size_t n, + const char *required, + bool (folly::dynamic::*isFoo)() const) { + T &ret = jsArgAsDynamic(args, n); + if ((ret.*isFoo)()) { + return ret; + } + + // Use 1-base counting for argument description. + throw JsArgumentException(folly::to( + "Argument ", + n + 1, + " of type ", + ret.typeName(), + " is not required type ", + required)); +} + +} // end namespace detail + +template +typename detail::is_dynamic::type &jsArgAsArray(T &&args, size_t n) { + return detail::jsArgAsType(args, n, "Array", &folly::dynamic::isArray); +} + +template +typename detail::is_dynamic::type &jsArgAsObject(T &&args, size_t n) { + return detail::jsArgAsType(args, n, "Object", &folly::dynamic::isObject); +} + +} // namespace xplat +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JsArgumentHelpers.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JsArgumentHelpers.h new file mode 100644 index 0000000..25702ba --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/JsArgumentHelpers.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +// When building a cross-platform module for React Native, arguments passed +// from JS are represented as a folly::dynamic. This class provides helpers to +// extract arguments from the folly::dynamic to concrete types usable by +// cross-platform code, and converting exceptions to a JsArgumentException so +// they can be caught and reported to RN consistently. The goal is to make the +// jsArgAs... methods at the end simple to use should be most common, but any +// non-detail method can be used when needed. + +namespace facebook { +namespace xplat { + +class JsArgumentException : public std::logic_error { + public: + JsArgumentException(const std::string &msg) : std::logic_error(msg) {} +}; + +// This extracts a single argument by calling the given method pointer on it. +// If an exception is thrown, the additional arguments are passed to +// folly::to<> to be included in the exception string. This will be most +// commonly used when extracting values from non-scalar argument. The second +// overload accepts ref-qualified member functions. + +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const, + const T &...desc); +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const &, + const T &...desc); + +// This is like jsArg, but a operates on a dynamic representing an array of +// arguments. The argument n is used both to index the array and build the +// exception message, if any. It can be used directly, but will more often be +// used by the type-specific methods following. + +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const); +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const &); + +namespace detail { + +// This is a type helper to implement functions which should work on both const +// and non-const folly::dynamic arguments, and return a type with the same +// constness. Basically, it causes the templates which use it to be defined +// only for types compatible with folly::dynamic. +template +struct is_dynamic { + typedef typename std:: + enable_if::value, T>::type type; +}; + +} // end namespace detail + +// Easy to use conversion helpers are here: + +// Extract the n'th arg from the given dynamic, as a dynamic. Throws a +// JsArgumentException if there is no n'th arg in the input. +template +typename detail::is_dynamic::type &jsArgAsDynamic(T &&args, size_t n); + +// Extract the n'th arg from the given dynamic, as a dynamic Array. Throws a +// JsArgumentException if there is no n'th arg in the input, or it is not an +// Array. +template +typename detail::is_dynamic::type &jsArgAsArray(T &&args, size_t n); + +// Extract the n'th arg from the given dynamic, as a dynamic Object. Throws a +// JsArgumentException if there is no n'th arg in the input, or it is not an +// Object. +template +typename detail::is_dynamic::type &jsArgAsObject(T &&args, size_t n); + +// Extract the n'th arg from the given dynamic, as a bool. Throws a +// JsArgumentException if this fails for some reason. +inline bool jsArgAsBool(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asBool); +} + +// Extract the n'th arg from the given dynamic, as an integer. Throws a +// JsArgumentException if this fails for some reason. +inline int64_t jsArgAsInt(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asInt); +} + +// Extract the n'th arg from the given dynamic, as a double. Throws a +// JsArgumentException if this fails for some reason. +inline double jsArgAsDouble(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asDouble); +} + +// Extract the n'th arg from the given dynamic, as a string. Throws a +// JsArgumentException if this fails for some reason. +inline std::string jsArgAsString(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asString); +} + +} // namespace xplat +} // namespace facebook + +#include diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/MessageQueueThread.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/MessageQueueThread.h new file mode 100644 index 0000000..9026a0b --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/MessageQueueThread.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +class MessageQueueThread { + public: + virtual ~MessageQueueThread() {} + virtual void runOnQueue(std::function &&) = 0; + // runOnQueueSync and quitSynchronous are dangerous. They should only be + // used for initialization and cleanup. + virtual void runOnQueueSync(std::function &&) = 0; + // Once quitSynchronous() returns, no further work should run on the queue. + virtual void quitSynchronous() = 0; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/MethodCall.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/MethodCall.h new file mode 100644 index 0000000..665cd70 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/MethodCall.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include + +namespace facebook { +namespace react { + +struct MethodCall { + int moduleId; + int methodId; + folly::dynamic arguments; + int callId; + + MethodCall(int mod, int meth, folly::dynamic &&args, int cid) + : moduleId(mod), + methodId(meth), + arguments(std::move(args)), + callId(cid) {} +}; + +/// \throws std::invalid_argument +std::vector parseMethodCalls(folly::dynamic &&calls); + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ModuleRegistry.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ModuleRegistry.h new file mode 100644 index 0000000..fba4496 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ModuleRegistry.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class NativeModule; + +struct ModuleConfig { + size_t index; + folly::dynamic config; +}; + +class RN_EXPORT ModuleRegistry { + public: + // not implemented: + // onBatchComplete: see + // https://our.intern.facebook.com/intern/tasks/?t=5279396 getModule: only + // used by views getAllModules: only used for cleanup; use RAII instead + // notifyCatalystInstanceInitialized: this is really only used by view-related + // code notifyCatalystInstanceDestroy: use RAII instead + + using ModuleNotFoundCallback = std::function; + + ModuleRegistry( + std::vector> modules, + ModuleNotFoundCallback callback = nullptr); + void registerModules(std::vector> modules); + + std::vector moduleNames(); + + folly::Optional getConfig(const std::string &name); + + void callNativeMethod( + unsigned int moduleId, + unsigned int methodId, + folly::dynamic &¶ms, + int callId); + MethodCallResult callSerializableNativeHook( + unsigned int moduleId, + unsigned int methodId, + folly::dynamic &&args); + + std::string getModuleName(unsigned int moduleId); + std::string getModuleSyncMethodName( + unsigned int moduleId, + unsigned int methodName); + + private: + // This is always populated + std::vector> modules_; + + // This is used to extend the population of modulesByName_ if registerModules + // is called after moduleNames + void updateModuleNamesFromIndex(size_t size); + + // This is only populated if moduleNames() is called. Values are indices into + // modules_. + std::unordered_map modulesByName_; + + // This is populated with modules that are requested via getConfig but are + // unknown. An error will be thrown if they are subsequently added to the + // registry. + std::unordered_set unknownModules_; + + // Function will be called if a module was requested but was not found. + // If the function returns true, ModuleRegistry will try to find the module + // again (assuming it's registered) If the functon returns false, + // ModuleRegistry will not try to find the module and return nullptr instead. + ModuleNotFoundCallback moduleNotFoundCallback_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/NativeModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/NativeModule.h new file mode 100644 index 0000000..2441953 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/NativeModule.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +namespace facebook { +namespace react { + +struct MethodDescriptor { + std::string name; + // type is one of js MessageQueue.MethodTypes + std::string type; + + MethodDescriptor(std::string n, std::string t) + : name(std::move(n)), type(std::move(t)) {} +}; + +using MethodCallResult = folly::Optional; + +class NativeModule { + public: + virtual ~NativeModule() {} + virtual std::string getName() = 0; + virtual std::string getSyncMethodName(unsigned int methodId) = 0; + virtual std::vector getMethods() = 0; + virtual folly::dynamic getConstants() = 0; + virtual void + invoke(unsigned int reactMethodId, folly::dynamic &¶ms, int callId) = 0; + virtual MethodCallResult callSerializableNativeHook( + unsigned int reactMethodId, + folly::dynamic &&args) = 0; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/NativeToJsBridge.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/NativeToJsBridge.h new file mode 100644 index 0000000..f9548c5 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/NativeToJsBridge.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include +#include + +namespace folly { +struct dynamic; +} + +namespace facebook { +namespace react { + +struct InstanceCallback; +class JsToNativeBridge; +class MessageQueueThread; +class ModuleRegistry; +class RAMBundleRegistry; + +// This class manages calls from native code to JS. It also manages +// executors and their threads. All functions here can be called from +// any thread. +// +// Except for loadBundleSync(), all void methods will queue +// work to run on the jsQueue passed to the ctor, and return +// immediately. +class NativeToJsBridge { + public: + friend class JsToNativeBridge; + + /** + * This must be called on the main JS thread. + */ + NativeToJsBridge( + JSExecutorFactory *jsExecutorFactory, + std::shared_ptr registry, + std::shared_ptr jsQueue, + std::shared_ptr callback); + virtual ~NativeToJsBridge(); + + /** + * Executes a function with the module ID and method ID and any additional + * arguments in JS. + */ + void callFunction( + std::string &&module, + std::string &&method, + folly::dynamic &&args); + + /** + * Invokes a callback with the cbID, and optional additional arguments in JS. + */ + void invokeCallback(double callbackId, folly::dynamic &&args); + + /** + * Sets global variables in the JS Context. + */ + void initializeRuntime(); + + /** + * Starts the JS application. If bundleRegistry is non-null, then it is + * used to fetch JavaScript modules as individual scripts. + * Otherwise, the script is assumed to include all the modules. + */ + void loadBundle( + std::unique_ptr bundleRegistry, + std::unique_ptr startupCode, + std::string sourceURL); + void loadBundleSync( + std::unique_ptr bundleRegistry, + std::unique_ptr startupCode, + std::string sourceURL); + + void registerBundle(uint32_t bundleId, const std::string &bundlePath); + void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue); + void *getJavaScriptContext(); + bool isInspectable(); + bool isBatchActive(); + + void handleMemoryPressure(int pressureLevel); + + /** + * Synchronously tears down the bridge and the main executor. + */ + void destroy(); + + void runOnExecutorQueue(std::function task); + + /** + * Native CallInvoker is used by TurboModules to schedule work on the + * NativeModule thread(s). + */ + std::shared_ptr getDecoratedNativeCallInvoker( + std::shared_ptr nativeInvoker); + + private: + // This is used to avoid a race condition where a proxyCallback gets queued + // after ~NativeToJsBridge(), on the same thread. In that case, the callback + // will try to run the task on m_callback which will have been destroyed + // within ~NativeToJsBridge(), thus causing a SIGSEGV. + std::shared_ptr m_destroyed; + std::shared_ptr m_delegate; + std::unique_ptr m_executor; + std::shared_ptr m_executorMessageQueueThread; + + // Memoize this on the JS thread, so that it can be inspected from + // any thread later. This assumes inspectability doesn't change for + // a JSExecutor instance, which is true for all existing implementations. + bool m_inspectable; + + // Keep track of whether the JS bundle containing the application logic causes + // exception when evaluated initially. If so, more calls to JS will very + // likely fail as well, so this flag can help prevent them. + bool m_applicationScriptHasFailure = false; + +#ifdef WITH_FBSYSTRACE + std::atomic_uint_least32_t m_systraceCookie = ATOMIC_VAR_INIT(0); +#endif +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/RAMBundleRegistry.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/RAMBundleRegistry.h new file mode 100644 index 0000000..9dcb210 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/RAMBundleRegistry.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class RN_EXPORT RAMBundleRegistry { + public: + constexpr static uint32_t MAIN_BUNDLE_ID = 0; + + static std::unique_ptr singleBundleRegistry( + std::unique_ptr mainBundle); + static std::unique_ptr multipleBundlesRegistry( + std::unique_ptr mainBundle, + std::function(std::string)> factory); + + explicit RAMBundleRegistry( + std::unique_ptr mainBundle, + std::function(std::string)> factory = + nullptr); + + RAMBundleRegistry(RAMBundleRegistry &&) = default; + RAMBundleRegistry &operator=(RAMBundleRegistry &&) = default; + + void registerBundle(uint32_t bundleId, std::string bundlePath); + JSModulesUnbundle::Module getModule(uint32_t bundleId, uint32_t moduleId); + virtual ~RAMBundleRegistry(){}; + + private: + JSModulesUnbundle *getBundle(uint32_t bundleId) const; + + std::function(std::string)> m_factory; + std::unordered_map m_bundlePaths; + std::unordered_map> m_bundles; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ReactMarker.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ReactMarker.h new file mode 100644 index 0000000..875f7b2 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ReactMarker.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __APPLE__ +#include +#endif + +namespace facebook { +namespace react { +namespace ReactMarker { + +enum ReactMarkerId { + NATIVE_REQUIRE_START, + NATIVE_REQUIRE_STOP, + RUN_JS_BUNDLE_START, + RUN_JS_BUNDLE_STOP, + CREATE_REACT_CONTEXT_STOP, + JS_BUNDLE_STRING_CONVERT_START, + JS_BUNDLE_STRING_CONVERT_STOP, + NATIVE_MODULE_SETUP_START, + NATIVE_MODULE_SETUP_STOP, + REGISTER_JS_SEGMENT_START, + REGISTER_JS_SEGMENT_STOP, + REACT_INSTANCE_INIT_START, + REACT_INSTANCE_INIT_STOP +}; + +#ifdef __APPLE__ +using LogTaggedMarker = + std::function; +using LogTaggedMarkerWithInstanceKey = std::function< + void(const ReactMarkerId, const char *tag, const int instanceKey)>; +#else +typedef void (*LogTaggedMarker)(const ReactMarkerId, const char *tag); +typedef void (*LogTaggedMarkerWithInstanceKey)( + const ReactMarkerId, + const char *tag, + const int instanceKey); +#endif + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +extern RN_EXPORT LogTaggedMarker logTaggedMarker; +extern RN_EXPORT LogTaggedMarkerWithInstanceKey logTaggedMarkerWithInstanceKey; + +extern RN_EXPORT void logMarker(const ReactMarkerId markerId); + +} // namespace ReactMarker +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ReactNativeVersion.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ReactNativeVersion.h new file mode 100644 index 0000000..a99f81f --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/ReactNativeVersion.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by scripts/set-rn-version.js + */ + +#pragma once + +#include +#include + +namespace facebook::react { + +constexpr struct { + int32_t Major = 0; + int32_t Minor = 67; + int32_t Patch = 5; + std::string_view Prerelease = ""; +} ReactNativeVersion; + +} // namespace facebook::react diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/RecoverableError.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/RecoverableError.h new file mode 100644 index 0000000..362fea2 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/RecoverableError.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +/** + * RecoverableError + * + * An exception that it is expected we should be able to recover from. + */ +struct RecoverableError : public std::exception { + explicit RecoverableError(const std::string &what_) + : m_what{"facebook::react::Recoverable: " + what_} {} + + virtual const char *what() const noexcept override { + return m_what.c_str(); + } + + /** + * runRethrowingAsRecoverable + * + * Helper function that converts any exception of type `E`, thrown within the + * `act` routine into a recoverable error with the same message. + */ + template + inline static void runRethrowingAsRecoverable(std::function act) { + try { + act(); + } catch (const E &err) { + throw RecoverableError(err.what()); + } + } + + private: + std::string m_what; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/SharedProxyCxxModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/SharedProxyCxxModule.h new file mode 100644 index 0000000..97d67dd --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/SharedProxyCxxModule.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +#include + +namespace facebook { +namespace xplat { +namespace module { + +// Allows a Cxx-module to be shared or reused across multiple React instances +// Caveat: the setInstance call is not forwarded, so usages of getInstance +// inside your module (e.g. dispatching events) will always be nullptr. +class SharedProxyCxxModule : public CxxModule { + public: + explicit SharedProxyCxxModule(std::shared_ptr shared) + : shared_(shared) {} + + std::string getName() override { + return shared_->getName(); + } + + auto getConstants() -> std::map override { + return shared_->getConstants(); + } + + auto getMethods() -> std::vector override { + return shared_->getMethods(); + } + + private: + std::shared_ptr shared_; +}; + +} // namespace module +} // namespace xplat +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/SystraceSection.h b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/SystraceSection.h new file mode 100644 index 0000000..3a59f0e --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64/Headers/cxxreact/SystraceSection.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef WITH_FBSYSTRACE +#include +#endif + +namespace facebook { +namespace react { + +/** + * This is a convenience class to avoid lots of verbose profiling + * #ifdefs. If WITH_FBSYSTRACE is not defined, the optimizer will + * remove this completely. If it is defined, it will behave as + * FbSystraceSection, with the right tag provided. Use two separate classes to + * to ensure that the ODR rule isn't violated, that is, if WITH_FBSYSTRACE has + * different values in different files, there is no inconsistency in the sizes + * of defined symbols. + */ +#ifdef WITH_FBSYSTRACE +struct ConcreteSystraceSection { + public: + template + explicit ConcreteSystraceSection( + const char *name, + ConvertsToStringPiece &&...args) + : m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...) {} + + private: + fbsystrace::FbSystraceSection m_section; +}; +using SystraceSection = ConcreteSystraceSection; +#else +struct DummySystraceSection { + public: + template + explicit DummySystraceSection( + __unused const char *name, + __unused ConvertsToStringPiece &&...args) {} +}; +using SystraceSection = DummySystraceSection; +#endif + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64/libReact-cxxreact.a b/Frameworks/React-cxxreact.xcframework/ios-arm64/libReact-cxxreact.a new file mode 100644 index 0000000..d468c9b Binary files /dev/null and b/Frameworks/React-cxxreact.xcframework/ios-arm64/libReact-cxxreact.a differ diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/CxxModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/CxxModule.h new file mode 100644 index 0000000..64b7db6 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/CxxModule.h @@ -0,0 +1,258 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#include + +using namespace std::placeholders; + +namespace facebook { +namespace react { + +class Instance; + +} +} // namespace facebook + +namespace facebook { +namespace xplat { +namespace module { + +/** + * Base class for Catalyst native modules whose implementations are + * written in C++. Native methods are represented by instances of the + * Method struct. Generally, a derived class will manage an instance + * which represents the data for the module, and non-Catalyst-specific + * methods can be wrapped in lambdas which convert between + * folly::dynamic and native C++ objects. The Callback arguments will + * pass through to js functions passed to the analogous javascript + * methods. At most two callbacks will be converted. Results should + * be passed to the first callback, and errors to the second callback. + * Exceptions thrown by a method will be converted to platform + * exceptions, and handled however they are handled on that platform. + * (TODO mhorowitz #7128529: this exception behavior is not yet + * implemented.) + * + * There are two sets of constructors here. The first set initializes + * a Method using a name and anything convertible to a std::function. + * This is most useful for registering a lambda as a RN method. There + * are overloads to support functions which take no arguments, + * arguments only, and zero, one, or two callbacks. + * + * The second set of methods is similar, but instead of taking a + * function, takes the method name, an object, and a pointer to a + * method on that object. + */ + +class CxxModule { + class AsyncTagType {}; + class SyncTagType {}; + + public: + typedef std::function()> Provider; + + typedef std::function)> Callback; + + constexpr static AsyncTagType AsyncTag = AsyncTagType(); + constexpr static SyncTagType SyncTag = SyncTagType(); + + struct Method { + std::string name; + + size_t callbacks; + bool isPromise; + std::function func; + + std::function syncFunc; + + const char *getType() { + assert(func || syncFunc); + return func ? (isPromise ? "promise" : "async") : "sync"; + } + + // std::function/lambda ctors + + Method(std::string aname, std::function &&afunc) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(std::move(afunc))) {} + + Method(std::string aname, std::function &&afunc) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(std::move(afunc), std::placeholders::_1)) {} + + Method( + std::string aname, + std::function &&afunc) + : name(std::move(aname)), + callbacks(1), + isPromise(false), + func(std::bind( + std::move(afunc), + std::placeholders::_1, + std::placeholders::_2)) {} + + Method( + std::string aname, + std::function &&afunc) + : name(std::move(aname)), + callbacks(2), + isPromise(true), + func(std::move(afunc)) {} + + Method( + std::string aname, + std::function &&afunc, + AsyncTagType) + : name(std::move(aname)), + callbacks(2), + isPromise(false), + func(std::move(afunc)) {} + + // method pointer ctors + + template + Method(std::string aname, T *t, void (T::*method)()) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(method, t)) {} + + template + Method(std::string aname, T *t, void (T::*method)(folly::dynamic)) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + func(std::bind(method, t, std::placeholders::_1)) {} + + template + Method(std::string aname, T *t, void (T::*method)(folly::dynamic, Callback)) + : name(std::move(aname)), + callbacks(1), + isPromise(false), + func(std::bind( + method, + t, + std::placeholders::_1, + std::placeholders::_2)) {} + + template + Method( + std::string aname, + T *t, + void (T::*method)(folly::dynamic, Callback, Callback)) + : name(std::move(aname)), + callbacks(2), + isPromise(true), + func(std::bind( + method, + t, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3)) {} + + template + Method( + std::string aname, + T *t, + void (T::*method)(folly::dynamic, Callback, Callback), + AsyncTagType) + : name(std::move(aname)), + callbacks(2), + isPromise(false), + func(std::bind( + method, + t, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3)) {} + + // sync std::function/lambda ctors + + // Overloads for functions returning void give ambiguity errors. + // I am not sure if this is a runtime/compiler bug, or a + // limitation I do not understand. + + Method( + std::string aname, + std::function &&afunc, + SyncTagType) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + syncFunc([afunc = std::move(afunc)](const folly::dynamic &) { + return afunc(); + }) {} + + Method( + std::string aname, + std::function &&afunc, + SyncTagType) + : name(std::move(aname)), + callbacks(0), + isPromise(false), + syncFunc(std::move(afunc)) {} + }; + + /** + * This may block, if necessary to complete cleanup before the + * object is destroyed. + */ + virtual ~CxxModule() {} + + /** + * @return the name of this module. This will be the name used to {@code + * require()} this module from javascript. + */ + virtual std::string getName() = 0; + + /** + * Each entry in the map will be exported as a property to JS. The + * key is the property name, and the value can be anything. + */ + virtual auto getConstants() -> std::map { + return {}; + }; + + /** + * @return a list of methods this module exports to JS. + */ + virtual auto getMethods() -> std::vector = 0; + + /** + * Called during the construction of CxxNativeModule. + */ + void setInstance(std::weak_ptr instance) { + instance_ = instance; + } + + /** + * @return a weak_ptr to the current instance of the bridge. + * When used with CxxNativeModule, this gives Cxx modules access to functions + * such as `callJSFunction`, allowing them to communicate back to JS outside + * of the regular callbacks. + */ + std::weak_ptr getInstance() { + return instance_; + } + + private: + std::weak_ptr instance_; +}; + +} // namespace module +} // namespace xplat +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/CxxNativeModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/CxxNativeModule.h new file mode 100644 index 0000000..a10f0ec --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/CxxNativeModule.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class Instance; +class MessageQueueThread; + +typedef void (*WarnOnUsageLogger)(std::string message); + +std::function makeCallback( + std::weak_ptr instance, + const folly::dynamic &callbackId); + +class RN_EXPORT CxxNativeModule : public NativeModule { + public: + CxxNativeModule( + std::weak_ptr instance, + std::string name, + xplat::module::CxxModule::Provider provider, + std::shared_ptr messageQueueThread) + : instance_(instance), + name_(std::move(name)), + provider_(provider), + messageQueueThread_(messageQueueThread) {} + + std::string getName() override; + std::string getSyncMethodName(unsigned int methodId) override; + std::vector getMethods() override; + folly::dynamic getConstants() override; + void invoke(unsigned int reactMethodId, folly::dynamic &¶ms, int callId) + override; + MethodCallResult callSerializableNativeHook( + unsigned int hookId, + folly::dynamic &&args) override; + + static void setShouldWarnOnUse(bool value); + + private: + void lazyInit(); + + std::weak_ptr instance_; + std::string name_; + xplat::module::CxxModule::Provider provider_; + std::shared_ptr messageQueueThread_; + std::unique_ptr module_; + std::vector methods_; + void emitWarnIfWarnOnUsage( + const std::string &method_name, + const std::string &module_name); + + static bool shouldWarnOnUse_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ErrorUtils.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ErrorUtils.h new file mode 100644 index 0000000..3ab715b --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ErrorUtils.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +namespace facebook { +namespace react { + +inline static void +handleJSError(jsi::Runtime &runtime, const jsi::JSError &error, bool isFatal) { + auto errorUtils = runtime.global().getProperty(runtime, "ErrorUtils"); + if (errorUtils.isUndefined() || !errorUtils.isObject() || + !errorUtils.getObject(runtime).hasProperty(runtime, "reportFatalError") || + !errorUtils.getObject(runtime).hasProperty(runtime, "reportError")) { + // ErrorUtils was not set up. This probably means the bundle didn't + // load properly. + throw jsi::JSError( + runtime, + "ErrorUtils is not set up properly. Something probably went wrong trying to load the JS bundle. Trying to report error " + + error.getMessage(), + error.getStack()); + } + + // TODO(janzer): Rewrite this function to return the processed error + // instead of just reporting it through the native module + if (isFatal) { + auto func = errorUtils.asObject(runtime).getPropertyAsFunction( + runtime, "reportFatalError"); + + func.call(runtime, error.value()); + } else { + auto func = errorUtils.asObject(runtime).getPropertyAsFunction( + runtime, "reportError"); + + func.call(runtime, error.value()); + } +} + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/Instance.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/Instance.h new file mode 100644 index 0000000..7cd11f9 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/Instance.h @@ -0,0 +1,179 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace folly { +struct dynamic; +} + +namespace facebook { +namespace react { + +class JSBigString; +class JSExecutorFactory; +class MessageQueueThread; +class ModuleRegistry; +class RAMBundleRegistry; + +struct InstanceCallback { + virtual ~InstanceCallback() {} + virtual void onBatchComplete() {} + virtual void incrementPendingJSCalls() {} + virtual void decrementPendingJSCalls() {} +}; + +class RN_EXPORT Instance { + public: + ~Instance(); + void initializeBridge( + std::unique_ptr callback, + std::shared_ptr jsef, + std::shared_ptr jsQueue, + std::shared_ptr moduleRegistry); + + void initializeRuntime(); + + void setSourceURL(std::string sourceURL); + + void loadScriptFromString( + std::unique_ptr string, + std::string sourceURL, + bool loadSynchronously); + static bool isHBCBundle(const char *sourcePath); + static bool isIndexedRAMBundle(const char *sourcePath); + static bool isIndexedRAMBundle(std::unique_ptr *string); + void loadRAMBundleFromString( + std::unique_ptr script, + const std::string &sourceURL); + void loadRAMBundleFromFile( + const std::string &sourcePath, + const std::string &sourceURL, + bool loadSynchronously); + void loadRAMBundle( + std::unique_ptr bundleRegistry, + std::unique_ptr startupScript, + std::string startupScriptSourceURL, + bool loadSynchronously); + bool supportsProfiling(); + void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue); + void *getJavaScriptContext(); + bool isInspectable(); + bool isBatchActive(); + void callJSFunction( + std::string &&module, + std::string &&method, + folly::dynamic &¶ms); + void callJSCallback(uint64_t callbackId, folly::dynamic &¶ms); + + // This method is experimental, and may be modified or removed. + void registerBundle(uint32_t bundleId, const std::string &bundlePath); + + const ModuleRegistry &getModuleRegistry() const; + ModuleRegistry &getModuleRegistry(); + + void handleMemoryPressure(int pressureLevel); + + /** + * JS CallInvoker is used by TurboModules to schedule work on the JS thread. + * + * Why is the bridge creating JS CallInvoker? + * + * - After every Native -> JS call in the TurboModule system, the bridge + * needs to flush all queued NativeModule method calls. The bridge must + * also dispatch onBatchComplete if the queue of NativeModule method calls + * was not empty. + */ + std::shared_ptr getJSCallInvoker(); + + /** + * Native CallInvoker is used by TurboModules to schedule work on the + * NativeModule thread(s). + * + * Why is the bridge decorating native CallInvoker? + * + * - The bridge must be informed of all TurboModule async method calls. Why? + * When all queued NativeModule method calls are flushed by a call from + * Native -> JS, if that queue was non-zero in size, JsToNativeBridge + * dispatches onBatchComplete. When we turn our NativeModules to + * TurboModuels, there will be less and less pending NativeModule method + * calls, so onBatchComplete will not fire as often. Therefore, the bridge + * needs to know how many TurboModule async method calls have been completed + * since the last time the bridge was flushed. If this number is non-zero, + * we fire onBatchComplete. + * + * Why can't we just create and return a new native CallInvoker? + * + * - On Android, we have one NativeModule thread. That thread is created and + * managed outisde of NativeToJsBridge. On iOS, we have one MethodQueue per + * module. Those MethodQueues are also created and managed outside of + * NativeToJsBridge. Therefore, we need to pass in a CallInvoker that + * schedules work on the respective thread. + */ + std::shared_ptr getDecoratedNativeCallInvoker( + std::shared_ptr nativeInvoker); + + /** + * RuntimeExecutor is used by Fabric to access the jsi::Runtime. + */ + RuntimeExecutor getRuntimeExecutor(); + + private: + void callNativeModules(folly::dynamic &&calls, bool isEndOfBatch); + void loadBundle( + std::unique_ptr bundleRegistry, + std::unique_ptr startupScript, + std::string startupScriptSourceURL); + void loadBundleSync( + std::unique_ptr bundleRegistry, + std::unique_ptr startupScript, + std::string startupScriptSourceURL); + + std::shared_ptr callback_; + std::shared_ptr nativeToJsBridge_; + std::shared_ptr moduleRegistry_; + + std::mutex m_syncMutex; + std::condition_variable m_syncCV; + bool m_syncReady = false; + + class JSCallInvoker : public CallInvoker { + private: + std::weak_ptr m_nativeToJsBridge; + std::mutex m_mutex; + bool m_shouldBuffer = true; + std::list> m_workBuffer; + + void scheduleAsync(std::function &&work); + + public: + void setNativeToJsBridgeAndFlushCalls( + std::weak_ptr nativeToJsBridge); + void invokeAsync(std::function &&work) override; + void invokeSync(std::function &&work) override; + }; + + std::shared_ptr jsCallInvoker_ = + std::make_shared(); +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSBigString.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSBigString.h new file mode 100644 index 0000000..c4996c4 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSBigString.h @@ -0,0 +1,137 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#ifndef RN_EXPORT +#ifdef _MSC_VER +#define RN_EXPORT +#else +#define RN_EXPORT __attribute__((visibility("default"))) +#endif +#endif + +namespace facebook { +namespace react { + +// JSExecutor functions sometimes take large strings, on the order of +// megabytes. Copying these can be expensive. Introducing a +// move-only, non-CopyConstructible type will let the compiler ensure +// that no copies occur. folly::MoveWrapper should be used when a +// large string needs to be curried into a std::function<>, which must +// by CopyConstructible. + +class JSBigString { + public: + JSBigString() = default; + + // Not copyable + JSBigString(const JSBigString &) = delete; + JSBigString &operator=(const JSBigString &) = delete; + + virtual ~JSBigString() {} + + virtual bool isAscii() const = 0; + + // This needs to be a \0 terminated string + virtual const char *c_str() const = 0; + + // Length of the c_str without the NULL byte. + virtual size_t size() const = 0; +}; + +// Concrete JSBigString implementation which holds a std::string +// instance. +class JSBigStdString : public JSBigString { + public: + JSBigStdString(std::string str, bool isAscii = false) + : m_isAscii(isAscii), m_str(std::move(str)) {} + + bool isAscii() const override { + return m_isAscii; + } + + const char *c_str() const override { + return m_str.c_str(); + } + + size_t size() const override { + return m_str.size(); + } + + private: + bool m_isAscii; + std::string m_str; +}; + +// Concrete JSBigString implementation which holds a heap-allocated +// buffer, and provides an accessor for writing to it. This can be +// used to construct a JSBigString in place, such as by reading from a +// file. +class RN_EXPORT JSBigBufferString : public JSBigString { + public: + JSBigBufferString(size_t size) : m_data(new char[size + 1]), m_size(size) { + // Guarantee nul-termination. The caller is responsible for + // filling in the rest of m_data. + m_data[m_size] = '\0'; + } + + ~JSBigBufferString() { + delete[] m_data; + } + + bool isAscii() const override { + return true; + } + + const char *c_str() const override { + return m_data; + } + + size_t size() const override { + return m_size; + } + + char *data() { + return m_data; + } + + private: + char *m_data; + size_t m_size; +}; + +// JSBigString interface implemented by a file-backed mmap region. +class RN_EXPORT JSBigFileString : public JSBigString { + public: + JSBigFileString(int fd, size_t size, off_t offset = 0); + ~JSBigFileString(); + + bool isAscii() const override { + return true; + } + + const char *c_str() const override; + + size_t size() const override; + int fd() const; + + static std::unique_ptr fromPath( + const std::string &sourceURL); + + private: + int m_fd; // The file descriptor being mmaped + size_t m_size; // The size of the mmaped region + mutable off_t m_pageOff; // The offset in the mmaped region to the data. + off_t m_mapOff; // The offset in the file to the mmaped region. + mutable const char *m_data; // Pointer to the mmaped region. +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSBundleType.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSBundleType.h new file mode 100644 index 0000000..be39711 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSBundleType.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +/* + * ScriptTag + * + * Scripts given to the JS Executors to run could be in any of the following + * formats. They are tagged so the executor knows how to run them. + */ +enum struct ScriptTag { + String = 0, + RAMBundle, + HBCBundle, +}; + +/** + * BundleHeader + * + * RAM bundles and BC bundles begin with headers. For RAM bundles this is + * 4 bytes, for BC bundles this is 12 bytes. This structure holds the first 12 + * bytes from a bundle in a way that gives access to that information. + */ +FOLLY_PACK_PUSH +struct FOLLY_PACK_ATTR BundleHeader { + BundleHeader() { + std::memset(this, 0, sizeof(BundleHeader)); + } + + uint32_t magic; + uint32_t reserved_; + uint32_t version; +}; +FOLLY_PACK_POP + +/** + * parseTypeFromHeader + * + * Takes the first 8 bytes of a bundle, and returns a tag describing the + * bundle's format. + */ +RN_EXPORT ScriptTag parseTypeFromHeader(const BundleHeader &header); + +/** + * stringForScriptTag + * + * Convert an `ScriptTag` enum into a string, useful for emitting in errors + * and diagnostic messages. + */ +RN_EXPORT const char *stringForScriptTag(const ScriptTag &tag); + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSExecutor.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSExecutor.h new file mode 100644 index 0000000..b3b29d1 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSExecutor.h @@ -0,0 +1,144 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class JSBigString; +class JSExecutor; +class JSModulesUnbundle; +class MessageQueueThread; +class ModuleRegistry; +class RAMBundleRegistry; + +// This interface describes the delegate interface required by +// Executor implementations to call from JS into native code. +class ExecutorDelegate { + public: + virtual ~ExecutorDelegate() {} + + virtual std::shared_ptr getModuleRegistry() = 0; + + virtual void callNativeModules( + JSExecutor &executor, + folly::dynamic &&calls, + bool isEndOfBatch) = 0; + virtual MethodCallResult callSerializableNativeHook( + JSExecutor &executor, + unsigned int moduleId, + unsigned int methodId, + folly::dynamic &&args) = 0; +}; + +using NativeExtensionsProvider = + std::function; + +class JSExecutorFactory { + public: + virtual std::unique_ptr createJSExecutor( + std::shared_ptr delegate, + std::shared_ptr jsQueue) = 0; + virtual ~JSExecutorFactory() {} +}; + +class RN_EXPORT JSExecutor { + public: + /** + * Prepares the JS runtime for React Native by installing global variables. + * Called once before any JS is evaluated. + */ + virtual void initializeRuntime() = 0; + /** + * Execute an application script bundle in the JS context. + */ + virtual void loadBundle( + std::unique_ptr script, + std::string sourceURL) = 0; + + /** + * Add an application "RAM" bundle registry + */ + virtual void setBundleRegistry( + std::unique_ptr bundleRegistry) = 0; + + /** + * Register a file path for an additional "RAM" bundle + */ + virtual void registerBundle( + uint32_t bundleId, + const std::string &bundlePath) = 0; + + /** + * Executes BatchedBridge.callFunctionReturnFlushedQueue with the module ID, + * method ID and optional additional arguments in JS. The executor is + * responsible for using Bridge->callNativeModules to invoke any necessary + * native modules methods. + */ + virtual void callFunction( + const std::string &moduleId, + const std::string &methodId, + const folly::dynamic &arguments) = 0; + + /** + * Executes BatchedBridge.invokeCallbackAndReturnFlushedQueue with the cbID, + * and optional additional arguments in JS and returns the next queue. The + * executor is responsible for using Bridge->callNativeModules to invoke any + * necessary native modules methods. + */ + virtual void invokeCallback( + const double callbackId, + const folly::dynamic &arguments) = 0; + + virtual void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue) = 0; + + virtual void *getJavaScriptContext() { + return nullptr; + } + + /** + * Returns whether or not the underlying executor supports debugging via the + * Chrome remote debugging protocol. + */ + virtual bool isInspectable() { + return false; + } + + /** + * The description is displayed in the dev menu, if there is one in + * this build. There is a default, but if this method returns a + * non-empty string, it will be used instead. + */ + virtual std::string getDescription() = 0; + + virtual void handleMemoryPressure(__unused int pressureLevel) {} + + virtual void destroy() {} + virtual ~JSExecutor() {} + + virtual void flush() {} + + static std::string getSyntheticBundlePath( + uint32_t bundleId, + const std::string &bundlePath); +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSIndexedRAMBundle.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSIndexedRAMBundle.h new file mode 100644 index 0000000..3045eb6 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSIndexedRAMBundle.h @@ -0,0 +1,73 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class RN_EXPORT JSIndexedRAMBundle : public JSModulesUnbundle { + public: + static std::function(std::string)> + buildFactory(); + + // Throws std::runtime_error on failure. + JSIndexedRAMBundle(const char *sourceURL); + JSIndexedRAMBundle(std::unique_ptr script); + + // Throws std::runtime_error on failure. + std::unique_ptr getStartupCode(); + // Throws std::runtime_error on failure. + Module getModule(uint32_t moduleId) const override; + + private: + struct ModuleData { + uint32_t offset; + uint32_t length; + }; + static_assert( + sizeof(ModuleData) == 8, + "ModuleData must not have any padding and use sizes matching input files"); + + struct ModuleTable { + size_t numEntries; + std::unique_ptr data; + ModuleTable() : numEntries(0){}; + ModuleTable(size_t entries) + : numEntries(entries), + data(std::unique_ptr(new ModuleData[numEntries])){}; + size_t byteLength() const { + return numEntries * sizeof(ModuleData); + } + }; + + void init(); + std::string getModuleCode(const uint32_t id) const; + void readBundle(char *buffer, const std::streamsize bytes) const; + void readBundle( + char *buffer, + const std::streamsize bytes, + const std::istream::pos_type position) const; + + mutable std::unique_ptr m_bundle; + ModuleTable m_table; + size_t m_baseOffset; + std::unique_ptr m_startupCode; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSModulesUnbundle.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSModulesUnbundle.h new file mode 100644 index 0000000..52103f7 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JSModulesUnbundle.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include + +namespace facebook { +namespace react { + +class JSModulesUnbundle { + /** + * Represents the set of JavaScript modules that the application consists of. + * The source code of each module can be retrieved by module ID. + * + * The class is non-copyable because copying instances might involve copying + * several megabytes of memory. + */ + public: + class ModuleNotFound : public std::out_of_range { + public: + using std::out_of_range::out_of_range; + ModuleNotFound(uint32_t moduleId) + : std::out_of_range::out_of_range( + folly::to("Module not found: ", moduleId)) {} + }; + struct Module { + std::string name; + std::string code; + }; + JSModulesUnbundle() {} + virtual ~JSModulesUnbundle() {} + virtual Module getModule(uint32_t moduleId) const = 0; + + private: + JSModulesUnbundle(const JSModulesUnbundle &) = delete; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JsArgumentHelpers-inl.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JsArgumentHelpers-inl.h new file mode 100644 index 0000000..fa76074 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JsArgumentHelpers-inl.h @@ -0,0 +1,120 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once +#include + +namespace facebook { +namespace xplat { + +namespace detail { + +template +R jsArg1(const folly::dynamic &arg, M asFoo, const T &...desc) { + try { + return (arg.*asFoo)(); + } catch (const folly::TypeError &ex) { + throw JsArgumentException(folly::to( + "Error converting javascript arg ", desc..., " to C++: ", ex.what())); + } catch (const std::range_error &ex) { + throw JsArgumentException(folly::to( + "Could not convert argument ", + desc..., + " to required type: ", + ex.what())); + } +} + +} // namespace detail + +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const, + const T &...desc) { + return detail::jsArg1(arg, asFoo, desc...); +} + +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const &, + const T &...desc) { + return detail::jsArg1(arg, asFoo, desc...); +} + +template +// NOLINTNEXTLINE (T62192316) +typename detail::is_dynamic::type &jsArgAsDynamic(T &&args, size_t n) { + try { + return args[n]; + } catch (const std::out_of_range &ex) { + // Use 1-base counting for argument description. + throw JsArgumentException(folly::to( + "JavaScript provided ", + args.size(), + " arguments for C++ method which references at least ", + n + 1, + " arguments: ", + ex.what())); + } +} + +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const) { + return jsArg(jsArgAsDynamic(args, n), asFoo, n); +} +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const &) { + return jsArg(jsArgAsDynamic(args, n), asFoo, n); +} + +namespace detail { + +// This is a helper for jsArgAsArray and jsArgAsObject. + +template +typename detail::is_dynamic::type &jsArgAsType( + T &&args, + size_t n, + const char *required, + bool (folly::dynamic::*isFoo)() const) { + T &ret = jsArgAsDynamic(args, n); + if ((ret.*isFoo)()) { + return ret; + } + + // Use 1-base counting for argument description. + throw JsArgumentException(folly::to( + "Argument ", + n + 1, + " of type ", + ret.typeName(), + " is not required type ", + required)); +} + +} // end namespace detail + +template +typename detail::is_dynamic::type &jsArgAsArray(T &&args, size_t n) { + return detail::jsArgAsType(args, n, "Array", &folly::dynamic::isArray); +} + +template +typename detail::is_dynamic::type &jsArgAsObject(T &&args, size_t n) { + return detail::jsArgAsType(args, n, "Object", &folly::dynamic::isObject); +} + +} // namespace xplat +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JsArgumentHelpers.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JsArgumentHelpers.h new file mode 100644 index 0000000..25702ba --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/JsArgumentHelpers.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +// When building a cross-platform module for React Native, arguments passed +// from JS are represented as a folly::dynamic. This class provides helpers to +// extract arguments from the folly::dynamic to concrete types usable by +// cross-platform code, and converting exceptions to a JsArgumentException so +// they can be caught and reported to RN consistently. The goal is to make the +// jsArgAs... methods at the end simple to use should be most common, but any +// non-detail method can be used when needed. + +namespace facebook { +namespace xplat { + +class JsArgumentException : public std::logic_error { + public: + JsArgumentException(const std::string &msg) : std::logic_error(msg) {} +}; + +// This extracts a single argument by calling the given method pointer on it. +// If an exception is thrown, the additional arguments are passed to +// folly::to<> to be included in the exception string. This will be most +// commonly used when extracting values from non-scalar argument. The second +// overload accepts ref-qualified member functions. + +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const, + const T &...desc); +template +R jsArg( + const folly::dynamic &arg, + R (folly::dynamic::*asFoo)() const &, + const T &...desc); + +// This is like jsArg, but a operates on a dynamic representing an array of +// arguments. The argument n is used both to index the array and build the +// exception message, if any. It can be used directly, but will more often be +// used by the type-specific methods following. + +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const); +template +R jsArgN( + const folly::dynamic &args, + size_t n, + R (folly::dynamic::*asFoo)() const &); + +namespace detail { + +// This is a type helper to implement functions which should work on both const +// and non-const folly::dynamic arguments, and return a type with the same +// constness. Basically, it causes the templates which use it to be defined +// only for types compatible with folly::dynamic. +template +struct is_dynamic { + typedef typename std:: + enable_if::value, T>::type type; +}; + +} // end namespace detail + +// Easy to use conversion helpers are here: + +// Extract the n'th arg from the given dynamic, as a dynamic. Throws a +// JsArgumentException if there is no n'th arg in the input. +template +typename detail::is_dynamic::type &jsArgAsDynamic(T &&args, size_t n); + +// Extract the n'th arg from the given dynamic, as a dynamic Array. Throws a +// JsArgumentException if there is no n'th arg in the input, or it is not an +// Array. +template +typename detail::is_dynamic::type &jsArgAsArray(T &&args, size_t n); + +// Extract the n'th arg from the given dynamic, as a dynamic Object. Throws a +// JsArgumentException if there is no n'th arg in the input, or it is not an +// Object. +template +typename detail::is_dynamic::type &jsArgAsObject(T &&args, size_t n); + +// Extract the n'th arg from the given dynamic, as a bool. Throws a +// JsArgumentException if this fails for some reason. +inline bool jsArgAsBool(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asBool); +} + +// Extract the n'th arg from the given dynamic, as an integer. Throws a +// JsArgumentException if this fails for some reason. +inline int64_t jsArgAsInt(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asInt); +} + +// Extract the n'th arg from the given dynamic, as a double. Throws a +// JsArgumentException if this fails for some reason. +inline double jsArgAsDouble(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asDouble); +} + +// Extract the n'th arg from the given dynamic, as a string. Throws a +// JsArgumentException if this fails for some reason. +inline std::string jsArgAsString(const folly::dynamic &args, size_t n) { + return jsArgN(args, n, &folly::dynamic::asString); +} + +} // namespace xplat +} // namespace facebook + +#include diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/MessageQueueThread.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/MessageQueueThread.h new file mode 100644 index 0000000..9026a0b --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/MessageQueueThread.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +class MessageQueueThread { + public: + virtual ~MessageQueueThread() {} + virtual void runOnQueue(std::function &&) = 0; + // runOnQueueSync and quitSynchronous are dangerous. They should only be + // used for initialization and cleanup. + virtual void runOnQueueSync(std::function &&) = 0; + // Once quitSynchronous() returns, no further work should run on the queue. + virtual void quitSynchronous() = 0; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/MethodCall.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/MethodCall.h new file mode 100644 index 0000000..665cd70 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/MethodCall.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include + +namespace facebook { +namespace react { + +struct MethodCall { + int moduleId; + int methodId; + folly::dynamic arguments; + int callId; + + MethodCall(int mod, int meth, folly::dynamic &&args, int cid) + : moduleId(mod), + methodId(meth), + arguments(std::move(args)), + callId(cid) {} +}; + +/// \throws std::invalid_argument +std::vector parseMethodCalls(folly::dynamic &&calls); + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ModuleRegistry.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ModuleRegistry.h new file mode 100644 index 0000000..fba4496 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ModuleRegistry.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +#include +#include +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class NativeModule; + +struct ModuleConfig { + size_t index; + folly::dynamic config; +}; + +class RN_EXPORT ModuleRegistry { + public: + // not implemented: + // onBatchComplete: see + // https://our.intern.facebook.com/intern/tasks/?t=5279396 getModule: only + // used by views getAllModules: only used for cleanup; use RAII instead + // notifyCatalystInstanceInitialized: this is really only used by view-related + // code notifyCatalystInstanceDestroy: use RAII instead + + using ModuleNotFoundCallback = std::function; + + ModuleRegistry( + std::vector> modules, + ModuleNotFoundCallback callback = nullptr); + void registerModules(std::vector> modules); + + std::vector moduleNames(); + + folly::Optional getConfig(const std::string &name); + + void callNativeMethod( + unsigned int moduleId, + unsigned int methodId, + folly::dynamic &¶ms, + int callId); + MethodCallResult callSerializableNativeHook( + unsigned int moduleId, + unsigned int methodId, + folly::dynamic &&args); + + std::string getModuleName(unsigned int moduleId); + std::string getModuleSyncMethodName( + unsigned int moduleId, + unsigned int methodName); + + private: + // This is always populated + std::vector> modules_; + + // This is used to extend the population of modulesByName_ if registerModules + // is called after moduleNames + void updateModuleNamesFromIndex(size_t size); + + // This is only populated if moduleNames() is called. Values are indices into + // modules_. + std::unordered_map modulesByName_; + + // This is populated with modules that are requested via getConfig but are + // unknown. An error will be thrown if they are subsequently added to the + // registry. + std::unordered_set unknownModules_; + + // Function will be called if a module was requested but was not found. + // If the function returns true, ModuleRegistry will try to find the module + // again (assuming it's registered) If the functon returns false, + // ModuleRegistry will not try to find the module and return nullptr instead. + ModuleNotFoundCallback moduleNotFoundCallback_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/NativeModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/NativeModule.h new file mode 100644 index 0000000..2441953 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/NativeModule.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include + +namespace facebook { +namespace react { + +struct MethodDescriptor { + std::string name; + // type is one of js MessageQueue.MethodTypes + std::string type; + + MethodDescriptor(std::string n, std::string t) + : name(std::move(n)), type(std::move(t)) {} +}; + +using MethodCallResult = folly::Optional; + +class NativeModule { + public: + virtual ~NativeModule() {} + virtual std::string getName() = 0; + virtual std::string getSyncMethodName(unsigned int methodId) = 0; + virtual std::vector getMethods() = 0; + virtual folly::dynamic getConstants() = 0; + virtual void + invoke(unsigned int reactMethodId, folly::dynamic &¶ms, int callId) = 0; + virtual MethodCallResult callSerializableNativeHook( + unsigned int reactMethodId, + folly::dynamic &&args) = 0; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/NativeToJsBridge.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/NativeToJsBridge.h new file mode 100644 index 0000000..f9548c5 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/NativeToJsBridge.h @@ -0,0 +1,136 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#include +#include +#include + +namespace folly { +struct dynamic; +} + +namespace facebook { +namespace react { + +struct InstanceCallback; +class JsToNativeBridge; +class MessageQueueThread; +class ModuleRegistry; +class RAMBundleRegistry; + +// This class manages calls from native code to JS. It also manages +// executors and their threads. All functions here can be called from +// any thread. +// +// Except for loadBundleSync(), all void methods will queue +// work to run on the jsQueue passed to the ctor, and return +// immediately. +class NativeToJsBridge { + public: + friend class JsToNativeBridge; + + /** + * This must be called on the main JS thread. + */ + NativeToJsBridge( + JSExecutorFactory *jsExecutorFactory, + std::shared_ptr registry, + std::shared_ptr jsQueue, + std::shared_ptr callback); + virtual ~NativeToJsBridge(); + + /** + * Executes a function with the module ID and method ID and any additional + * arguments in JS. + */ + void callFunction( + std::string &&module, + std::string &&method, + folly::dynamic &&args); + + /** + * Invokes a callback with the cbID, and optional additional arguments in JS. + */ + void invokeCallback(double callbackId, folly::dynamic &&args); + + /** + * Sets global variables in the JS Context. + */ + void initializeRuntime(); + + /** + * Starts the JS application. If bundleRegistry is non-null, then it is + * used to fetch JavaScript modules as individual scripts. + * Otherwise, the script is assumed to include all the modules. + */ + void loadBundle( + std::unique_ptr bundleRegistry, + std::unique_ptr startupCode, + std::string sourceURL); + void loadBundleSync( + std::unique_ptr bundleRegistry, + std::unique_ptr startupCode, + std::string sourceURL); + + void registerBundle(uint32_t bundleId, const std::string &bundlePath); + void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue); + void *getJavaScriptContext(); + bool isInspectable(); + bool isBatchActive(); + + void handleMemoryPressure(int pressureLevel); + + /** + * Synchronously tears down the bridge and the main executor. + */ + void destroy(); + + void runOnExecutorQueue(std::function task); + + /** + * Native CallInvoker is used by TurboModules to schedule work on the + * NativeModule thread(s). + */ + std::shared_ptr getDecoratedNativeCallInvoker( + std::shared_ptr nativeInvoker); + + private: + // This is used to avoid a race condition where a proxyCallback gets queued + // after ~NativeToJsBridge(), on the same thread. In that case, the callback + // will try to run the task on m_callback which will have been destroyed + // within ~NativeToJsBridge(), thus causing a SIGSEGV. + std::shared_ptr m_destroyed; + std::shared_ptr m_delegate; + std::unique_ptr m_executor; + std::shared_ptr m_executorMessageQueueThread; + + // Memoize this on the JS thread, so that it can be inspected from + // any thread later. This assumes inspectability doesn't change for + // a JSExecutor instance, which is true for all existing implementations. + bool m_inspectable; + + // Keep track of whether the JS bundle containing the application logic causes + // exception when evaluated initially. If so, more calls to JS will very + // likely fail as well, so this flag can help prevent them. + bool m_applicationScriptHasFailure = false; + +#ifdef WITH_FBSYSTRACE + std::atomic_uint_least32_t m_systraceCookie = ATOMIC_VAR_INIT(0); +#endif +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/RAMBundleRegistry.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/RAMBundleRegistry.h new file mode 100644 index 0000000..9dcb210 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/RAMBundleRegistry.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +namespace facebook { +namespace react { + +class RN_EXPORT RAMBundleRegistry { + public: + constexpr static uint32_t MAIN_BUNDLE_ID = 0; + + static std::unique_ptr singleBundleRegistry( + std::unique_ptr mainBundle); + static std::unique_ptr multipleBundlesRegistry( + std::unique_ptr mainBundle, + std::function(std::string)> factory); + + explicit RAMBundleRegistry( + std::unique_ptr mainBundle, + std::function(std::string)> factory = + nullptr); + + RAMBundleRegistry(RAMBundleRegistry &&) = default; + RAMBundleRegistry &operator=(RAMBundleRegistry &&) = default; + + void registerBundle(uint32_t bundleId, std::string bundlePath); + JSModulesUnbundle::Module getModule(uint32_t bundleId, uint32_t moduleId); + virtual ~RAMBundleRegistry(){}; + + private: + JSModulesUnbundle *getBundle(uint32_t bundleId) const; + + std::function(std::string)> m_factory; + std::unordered_map m_bundlePaths; + std::unordered_map> m_bundles; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ReactMarker.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ReactMarker.h new file mode 100644 index 0000000..875f7b2 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ReactMarker.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __APPLE__ +#include +#endif + +namespace facebook { +namespace react { +namespace ReactMarker { + +enum ReactMarkerId { + NATIVE_REQUIRE_START, + NATIVE_REQUIRE_STOP, + RUN_JS_BUNDLE_START, + RUN_JS_BUNDLE_STOP, + CREATE_REACT_CONTEXT_STOP, + JS_BUNDLE_STRING_CONVERT_START, + JS_BUNDLE_STRING_CONVERT_STOP, + NATIVE_MODULE_SETUP_START, + NATIVE_MODULE_SETUP_STOP, + REGISTER_JS_SEGMENT_START, + REGISTER_JS_SEGMENT_STOP, + REACT_INSTANCE_INIT_START, + REACT_INSTANCE_INIT_STOP +}; + +#ifdef __APPLE__ +using LogTaggedMarker = + std::function; +using LogTaggedMarkerWithInstanceKey = std::function< + void(const ReactMarkerId, const char *tag, const int instanceKey)>; +#else +typedef void (*LogTaggedMarker)(const ReactMarkerId, const char *tag); +typedef void (*LogTaggedMarkerWithInstanceKey)( + const ReactMarkerId, + const char *tag, + const int instanceKey); +#endif + +#ifndef RN_EXPORT +#define RN_EXPORT __attribute__((visibility("default"))) +#endif + +extern RN_EXPORT LogTaggedMarker logTaggedMarker; +extern RN_EXPORT LogTaggedMarkerWithInstanceKey logTaggedMarkerWithInstanceKey; + +extern RN_EXPORT void logMarker(const ReactMarkerId markerId); + +} // namespace ReactMarker +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ReactNativeVersion.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ReactNativeVersion.h new file mode 100644 index 0000000..a99f81f --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/ReactNativeVersion.h @@ -0,0 +1,24 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @generated by scripts/set-rn-version.js + */ + +#pragma once + +#include +#include + +namespace facebook::react { + +constexpr struct { + int32_t Major = 0; + int32_t Minor = 67; + int32_t Patch = 5; + std::string_view Prerelease = ""; +} ReactNativeVersion; + +} // namespace facebook::react diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/RecoverableError.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/RecoverableError.h new file mode 100644 index 0000000..362fea2 --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/RecoverableError.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +/** + * RecoverableError + * + * An exception that it is expected we should be able to recover from. + */ +struct RecoverableError : public std::exception { + explicit RecoverableError(const std::string &what_) + : m_what{"facebook::react::Recoverable: " + what_} {} + + virtual const char *what() const noexcept override { + return m_what.c_str(); + } + + /** + * runRethrowingAsRecoverable + * + * Helper function that converts any exception of type `E`, thrown within the + * `act` routine into a recoverable error with the same message. + */ + template + inline static void runRethrowingAsRecoverable(std::function act) { + try { + act(); + } catch (const E &err) { + throw RecoverableError(err.what()); + } + } + + private: + std::string m_what; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/SharedProxyCxxModule.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/SharedProxyCxxModule.h new file mode 100644 index 0000000..97d67dd --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/SharedProxyCxxModule.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#include + +#include + +namespace facebook { +namespace xplat { +namespace module { + +// Allows a Cxx-module to be shared or reused across multiple React instances +// Caveat: the setInstance call is not forwarded, so usages of getInstance +// inside your module (e.g. dispatching events) will always be nullptr. +class SharedProxyCxxModule : public CxxModule { + public: + explicit SharedProxyCxxModule(std::shared_ptr shared) + : shared_(shared) {} + + std::string getName() override { + return shared_->getName(); + } + + auto getConstants() -> std::map override { + return shared_->getConstants(); + } + + auto getMethods() -> std::vector override { + return shared_->getMethods(); + } + + private: + std::shared_ptr shared_; +}; + +} // namespace module +} // namespace xplat +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/SystraceSection.h b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/SystraceSection.h new file mode 100644 index 0000000..3a59f0e --- /dev/null +++ b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/Headers/cxxreact/SystraceSection.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef WITH_FBSYSTRACE +#include +#endif + +namespace facebook { +namespace react { + +/** + * This is a convenience class to avoid lots of verbose profiling + * #ifdefs. If WITH_FBSYSTRACE is not defined, the optimizer will + * remove this completely. If it is defined, it will behave as + * FbSystraceSection, with the right tag provided. Use two separate classes to + * to ensure that the ODR rule isn't violated, that is, if WITH_FBSYSTRACE has + * different values in different files, there is no inconsistency in the sizes + * of defined symbols. + */ +#ifdef WITH_FBSYSTRACE +struct ConcreteSystraceSection { + public: + template + explicit ConcreteSystraceSection( + const char *name, + ConvertsToStringPiece &&...args) + : m_section(TRACE_TAG_REACT_CXX_BRIDGE, name, args...) {} + + private: + fbsystrace::FbSystraceSection m_section; +}; +using SystraceSection = ConcreteSystraceSection; +#else +struct DummySystraceSection { + public: + template + explicit DummySystraceSection( + __unused const char *name, + __unused ConvertsToStringPiece &&...args) {} +}; +using SystraceSection = DummySystraceSection; +#endif + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/libReact-cxxreact.a b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/libReact-cxxreact.a new file mode 100644 index 0000000..37c4bd8 Binary files /dev/null and b/Frameworks/React-cxxreact.xcframework/ios-arm64_x86_64-simulator/libReact-cxxreact.a differ diff --git a/Frameworks/React-jsi.xcframework/Info.plist b/Frameworks/React-jsi.xcframework/Info.plist new file mode 100644 index 0000000..597d0e6 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-jsi.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-jsi.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-jsi.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-jsi.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/JSCRuntime.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/JSCRuntime.h new file mode 100644 index 0000000..5455423 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/JSCRuntime.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace jsc { + +std::unique_ptr makeJSCRuntime(); + +} // namespace jsc +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/JSIDynamic.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/JSIDynamic.h new file mode 100644 index 0000000..41f9d9f --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/JSIDynamic.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace jsi { + +facebook::jsi::Value valueFromDynamic( + facebook::jsi::Runtime& runtime, + const folly::dynamic& dyn); + +folly::dynamic dynamicFromValue( + facebook::jsi::Runtime& runtime, + const facebook::jsi::Value& value); + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/decorator.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/decorator.h new file mode 100644 index 0000000..be6f4f5 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/decorator.h @@ -0,0 +1,753 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include +#include + +// This file contains objects to help API users create their own +// runtime adapters, i.e. if you want to compose runtimes to add your +// own behavior. + +namespace facebook { +namespace jsi { + +// Use this to wrap host functions. It will pass the member runtime as +// the first arg to the callback. The first argument to the ctor +// should be the decorated runtime, not the plain one. +class DecoratedHostFunction { + public: + DecoratedHostFunction(Runtime& drt, HostFunctionType plainHF) + : drt_(drt), plainHF_(std::move(plainHF)) {} + + Runtime& decoratedRuntime() { + return drt_; + } + + Value + operator()(Runtime&, const Value& thisVal, const Value* args, size_t count) { + return plainHF_(decoratedRuntime(), thisVal, args, count); + } + + private: + template + friend class RuntimeDecorator; + + Runtime& drt_; + HostFunctionType plainHF_; +}; + +// From the perspective of the caller, a plain HostObject is passed to +// the decorated Runtime, and the HostObject methods expect to get +// passed that Runtime. But the plain Runtime will pass itself to its +// callback, so we need a helper here which curries the decorated +// Runtime, and calls the plain HostObject with it. +// +// If the concrete RuntimeDecorator derives DecoratedHostObject, it +// should call the base class get() and set() to invoke the plain +// HostObject functionality. The Runtime& it passes does not matter, +// as it is not used. +class DecoratedHostObject : public HostObject { + public: + DecoratedHostObject(Runtime& drt, std::shared_ptr plainHO) + : drt_(drt), plainHO_(plainHO) {} + + // The derived class methods can call this to get a reference to the + // decorated runtime, since the rt passed to the callback will be + // the plain runtime. + Runtime& decoratedRuntime() { + return drt_; + } + + Value get(Runtime&, const PropNameID& name) override { + return plainHO_->get(decoratedRuntime(), name); + } + + void set(Runtime&, const PropNameID& name, const Value& value) override { + plainHO_->set(decoratedRuntime(), name, value); + } + + std::vector getPropertyNames(Runtime&) override { + return plainHO_->getPropertyNames(decoratedRuntime()); + } + + private: + template + friend class RuntimeDecorator; + + Runtime& drt_; + std::shared_ptr plainHO_; +}; + +/// C++ variant on a standard Decorator pattern, using template +/// parameters. The \c Plain template parameter type is the +/// undecorated Runtime type. You can usually use \c Runtime here, +/// but if you know the concrete type ahead of time and it's final, +/// the compiler can devirtualize calls to the decorated +/// implementation. The \c Base template parameter type will be used +/// as the base class of the decorated type. Here, too, you can +/// usually use \c Runtime, but if you want the decorated type to +/// implement a derived class of Runtime, you can specify that here. +/// For an example, see threadsafe.h. +template +class RuntimeDecorator : public Base, private jsi::Instrumentation { + public: + Plain& plain() { + static_assert( + std::is_base_of::value, + "RuntimeDecorator's Plain type must derive from jsi::Runtime"); + static_assert( + std::is_base_of::value, + "RuntimeDecorator's Base type must derive from jsi::Runtime"); + return plain_; + } + const Plain& plain() const { + return plain_; + } + + Value evaluateJavaScript( + const std::shared_ptr& buffer, + const std::string& sourceURL) override { + return plain().evaluateJavaScript(buffer, sourceURL); + } + std::shared_ptr prepareJavaScript( + const std::shared_ptr& buffer, + std::string sourceURL) override { + return plain().prepareJavaScript(buffer, std::move(sourceURL)); + } + Value evaluatePreparedJavaScript( + const std::shared_ptr& js) override { + return plain().evaluatePreparedJavaScript(js); + } + bool drainMicrotasks(int maxMicrotasksHint) override { + return plain().drainMicrotasks(maxMicrotasksHint); + } + Object global() override { + return plain().global(); + } + std::string description() override { + return plain().description(); + }; + bool isInspectable() override { + return plain().isInspectable(); + }; + Instrumentation& instrumentation() override { + return *this; + } + + protected: + // plain is generally going to be a reference to an object managed + // by a derived class. We cache it here so this class can be + // concrete, and avoid making virtual calls to find the plain + // Runtime. Note that the ctor and dtor do not access through the + // reference, so passing a reference to an object before its + // lifetime has started is ok. + RuntimeDecorator(Plain& plain) : plain_(plain) {} + + Runtime::PointerValue* cloneSymbol(const Runtime::PointerValue* pv) override { + return plain_.cloneSymbol(pv); + }; + Runtime::PointerValue* cloneString(const Runtime::PointerValue* pv) override { + return plain_.cloneString(pv); + }; + Runtime::PointerValue* cloneObject(const Runtime::PointerValue* pv) override { + return plain_.cloneObject(pv); + }; + Runtime::PointerValue* clonePropNameID( + const Runtime::PointerValue* pv) override { + return plain_.clonePropNameID(pv); + }; + + PropNameID createPropNameIDFromAscii(const char* str, size_t length) + override { + return plain_.createPropNameIDFromAscii(str, length); + }; + PropNameID createPropNameIDFromUtf8(const uint8_t* utf8, size_t length) + override { + return plain_.createPropNameIDFromUtf8(utf8, length); + }; + PropNameID createPropNameIDFromString(const String& str) override { + return plain_.createPropNameIDFromString(str); + }; + std::string utf8(const PropNameID& id) override { + return plain_.utf8(id); + }; + bool compare(const PropNameID& a, const PropNameID& b) override { + return plain_.compare(a, b); + }; + + std::string symbolToString(const Symbol& sym) override { + return plain_.symbolToString(sym); + } + + String createStringFromAscii(const char* str, size_t length) override { + return plain_.createStringFromAscii(str, length); + }; + String createStringFromUtf8(const uint8_t* utf8, size_t length) override { + return plain_.createStringFromUtf8(utf8, length); + }; + std::string utf8(const String& s) override { + return plain_.utf8(s); + } + + Object createObject() override { + return plain_.createObject(); + }; + + Object createObject(std::shared_ptr ho) override { + return plain_.createObject( + std::make_shared(*this, std::move(ho))); + }; + std::shared_ptr getHostObject(const jsi::Object& o) override { + std::shared_ptr dho = plain_.getHostObject(o); + return static_cast(*dho).plainHO_; + }; + HostFunctionType& getHostFunction(const jsi::Function& f) override { + HostFunctionType& dhf = plain_.getHostFunction(f); + // This will fail if a cpp file including this header is not compiled + // with RTTI. + return dhf.target()->plainHF_; + }; + + Value getProperty(const Object& o, const PropNameID& name) override { + return plain_.getProperty(o, name); + }; + Value getProperty(const Object& o, const String& name) override { + return plain_.getProperty(o, name); + }; + bool hasProperty(const Object& o, const PropNameID& name) override { + return plain_.hasProperty(o, name); + }; + bool hasProperty(const Object& o, const String& name) override { + return plain_.hasProperty(o, name); + }; + void setPropertyValue(Object& o, const PropNameID& name, const Value& value) + override { + plain_.setPropertyValue(o, name, value); + }; + void setPropertyValue(Object& o, const String& name, const Value& value) + override { + plain_.setPropertyValue(o, name, value); + }; + + bool isArray(const Object& o) const override { + return plain_.isArray(o); + }; + bool isArrayBuffer(const Object& o) const override { + return plain_.isArrayBuffer(o); + }; + bool isFunction(const Object& o) const override { + return plain_.isFunction(o); + }; + bool isHostObject(const jsi::Object& o) const override { + return plain_.isHostObject(o); + }; + bool isHostFunction(const jsi::Function& f) const override { + return plain_.isHostFunction(f); + }; + Array getPropertyNames(const Object& o) override { + return plain_.getPropertyNames(o); + }; + + WeakObject createWeakObject(const Object& o) override { + return plain_.createWeakObject(o); + }; + Value lockWeakObject(WeakObject& wo) override { + return plain_.lockWeakObject(wo); + }; + + Array createArray(size_t length) override { + return plain_.createArray(length); + }; + size_t size(const Array& a) override { + return plain_.size(a); + }; + size_t size(const ArrayBuffer& ab) override { + return plain_.size(ab); + }; + uint8_t* data(const ArrayBuffer& ab) override { + return plain_.data(ab); + }; + Value getValueAtIndex(const Array& a, size_t i) override { + return plain_.getValueAtIndex(a, i); + }; + void setValueAtIndexImpl(Array& a, size_t i, const Value& value) override { + plain_.setValueAtIndexImpl(a, i, value); + }; + + Function createFunctionFromHostFunction( + const PropNameID& name, + unsigned int paramCount, + HostFunctionType func) override { + return plain_.createFunctionFromHostFunction( + name, paramCount, DecoratedHostFunction(*this, std::move(func))); + }; + Value call( + const Function& f, + const Value& jsThis, + const Value* args, + size_t count) override { + return plain_.call(f, jsThis, args, count); + }; + Value callAsConstructor(const Function& f, const Value* args, size_t count) + override { + return plain_.callAsConstructor(f, args, count); + }; + + // Private data for managing scopes. + Runtime::ScopeState* pushScope() override { + return plain_.pushScope(); + } + void popScope(Runtime::ScopeState* ss) override { + plain_.popScope(ss); + } + + bool strictEquals(const Symbol& a, const Symbol& b) const override { + return plain_.strictEquals(a, b); + }; + bool strictEquals(const String& a, const String& b) const override { + return plain_.strictEquals(a, b); + }; + bool strictEquals(const Object& a, const Object& b) const override { + return plain_.strictEquals(a, b); + }; + + bool instanceOf(const Object& o, const Function& f) override { + return plain_.instanceOf(o, f); + }; + + // jsi::Instrumentation methods + + std::string getRecordedGCStats() override { + return plain().instrumentation().getRecordedGCStats(); + } + + std::unordered_map getHeapInfo( + bool includeExpensive) override { + return plain().instrumentation().getHeapInfo(includeExpensive); + } + + void collectGarbage(std::string cause) override { + plain().instrumentation().collectGarbage(std::move(cause)); + } + + void startTrackingHeapObjectStackTraces( + std::function)> callback) override { + plain().instrumentation().startTrackingHeapObjectStackTraces( + std::move(callback)); + } + + void stopTrackingHeapObjectStackTraces() override { + plain().instrumentation().stopTrackingHeapObjectStackTraces(); + } + + void startHeapSampling(size_t samplingInterval) override { + plain().instrumentation().startHeapSampling(samplingInterval); + } + + void stopHeapSampling(std::ostream& os) override { + plain().instrumentation().stopHeapSampling(os); + } + + void createSnapshotToFile(const std::string& path) override { + plain().instrumentation().createSnapshotToFile(path); + } + + void createSnapshotToStream(std::ostream& os) override { + plain().instrumentation().createSnapshotToStream(os); + } + + std::string flushAndDisableBridgeTrafficTrace() override { + return const_cast(plain()) + .instrumentation() + .flushAndDisableBridgeTrafficTrace(); + } + + void writeBasicBlockProfileTraceToFile( + const std::string& fileName) const override { + const_cast(plain()) + .instrumentation() + .writeBasicBlockProfileTraceToFile(fileName); + } + + /// Dump external profiler symbols to the given file name. + void dumpProfilerSymbolsToFile(const std::string& fileName) const override { + const_cast(plain()).instrumentation().dumpProfilerSymbolsToFile( + fileName); + } + + private: + Plain& plain_; +}; + +namespace detail { + +// This metaprogramming allows the With type's methods to be +// optional. + +template +struct BeforeCaller { + static void before(T&) {} +}; + +template +struct AfterCaller { + static void after(T&) {} +}; + +// decltype((void)&...) is either SFINAE, or void. +// So, if SFINAE does not happen for T, then this specialization exists +// for BeforeCaller, and always applies. If not, only the +// default above exists, and that is used instead. +template +struct BeforeCaller { + static void before(T& t) { + t.before(); + } +}; + +template +struct AfterCaller { + static void after(T& t) { + t.after(); + } +}; + +// It's possible to use multiple decorators by nesting +// WithRuntimeDecorator<...>, but this specialization allows use of +// std::tuple of decorator classes instead. See testlib.cpp for an +// example. +template +struct BeforeCaller> { + static void before(std::tuple& tuple) { + all_before<0, T...>(tuple); + } + + private: + template + static void all_before(std::tuple& tuple) { + detail::BeforeCaller::before(std::get(tuple)); + all_before(tuple); + } + + template + static void all_before(std::tuple&) {} +}; + +template +struct AfterCaller> { + static void after(std::tuple& tuple) { + all_after<0, T...>(tuple); + } + + private: + template + static void all_after(std::tuple& tuple) { + all_after(tuple); + detail::AfterCaller::after(std::get(tuple)); + } + + template + static void all_after(std::tuple&) {} +}; + +} // namespace detail + +// A decorator which implements an around idiom. A With instance is +// RAII constructed before each call to the undecorated class; the +// ctor is passed a single argument of type WithArg&. Plain and Base +// are used as in the base class. +template +class WithRuntimeDecorator : public RuntimeDecorator { + public: + using RD = RuntimeDecorator; + + // The reference arguments to the ctor are stored, but not used by + // the ctor, and there is no ctor, so they can be passed members of + // the derived class. + WithRuntimeDecorator(Plain& plain, With& with) : RD(plain), with_(with) {} + + Value evaluateJavaScript( + const std::shared_ptr& buffer, + const std::string& sourceURL) override { + Around around{with_}; + return RD::evaluateJavaScript(buffer, sourceURL); + } + std::shared_ptr prepareJavaScript( + const std::shared_ptr& buffer, + std::string sourceURL) override { + Around around{with_}; + return RD::prepareJavaScript(buffer, std::move(sourceURL)); + } + Value evaluatePreparedJavaScript( + const std::shared_ptr& js) override { + Around around{with_}; + return RD::evaluatePreparedJavaScript(js); + } + bool drainMicrotasks(int maxMicrotasksHint) override { + Around around{with_}; + return RD::drainMicrotasks(maxMicrotasksHint); + } + Object global() override { + Around around{with_}; + return RD::global(); + } + std::string description() override { + Around around{with_}; + return RD::description(); + }; + bool isInspectable() override { + Around around{with_}; + return RD::isInspectable(); + }; + + // The jsi:: prefix is necessary because MSVC compiler complains C2247: + // Instrumentation is not accessible because RuntimeDecorator uses private + // to inherit from Instrumentation. + // TODO(T40821815) Consider removing this workaround when updating MSVC + jsi::Instrumentation& instrumentation() override { + Around around{with_}; + return RD::instrumentation(); + } + + protected: + Runtime::PointerValue* cloneSymbol(const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::cloneSymbol(pv); + }; + Runtime::PointerValue* cloneString(const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::cloneString(pv); + }; + Runtime::PointerValue* cloneObject(const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::cloneObject(pv); + }; + Runtime::PointerValue* clonePropNameID( + const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::clonePropNameID(pv); + }; + + PropNameID createPropNameIDFromAscii(const char* str, size_t length) + override { + Around around{with_}; + return RD::createPropNameIDFromAscii(str, length); + }; + PropNameID createPropNameIDFromUtf8(const uint8_t* utf8, size_t length) + override { + Around around{with_}; + return RD::createPropNameIDFromUtf8(utf8, length); + }; + PropNameID createPropNameIDFromString(const String& str) override { + Around around{with_}; + return RD::createPropNameIDFromString(str); + }; + std::string utf8(const PropNameID& id) override { + Around around{with_}; + return RD::utf8(id); + }; + bool compare(const PropNameID& a, const PropNameID& b) override { + Around around{with_}; + return RD::compare(a, b); + }; + + std::string symbolToString(const Symbol& sym) override { + Around around{with_}; + return RD::symbolToString(sym); + }; + + String createStringFromAscii(const char* str, size_t length) override { + Around around{with_}; + return RD::createStringFromAscii(str, length); + }; + String createStringFromUtf8(const uint8_t* utf8, size_t length) override { + Around around{with_}; + return RD::createStringFromUtf8(utf8, length); + }; + std::string utf8(const String& s) override { + Around around{with_}; + return RD::utf8(s); + } + + Object createObject() override { + Around around{with_}; + return RD::createObject(); + }; + Object createObject(std::shared_ptr ho) override { + Around around{with_}; + return RD::createObject(std::move(ho)); + }; + std::shared_ptr getHostObject(const jsi::Object& o) override { + Around around{with_}; + return RD::getHostObject(o); + }; + HostFunctionType& getHostFunction(const jsi::Function& f) override { + Around around{with_}; + return RD::getHostFunction(f); + }; + + Value getProperty(const Object& o, const PropNameID& name) override { + Around around{with_}; + return RD::getProperty(o, name); + }; + Value getProperty(const Object& o, const String& name) override { + Around around{with_}; + return RD::getProperty(o, name); + }; + bool hasProperty(const Object& o, const PropNameID& name) override { + Around around{with_}; + return RD::hasProperty(o, name); + }; + bool hasProperty(const Object& o, const String& name) override { + Around around{with_}; + return RD::hasProperty(o, name); + }; + void setPropertyValue(Object& o, const PropNameID& name, const Value& value) + override { + Around around{with_}; + RD::setPropertyValue(o, name, value); + }; + void setPropertyValue(Object& o, const String& name, const Value& value) + override { + Around around{with_}; + RD::setPropertyValue(o, name, value); + }; + + bool isArray(const Object& o) const override { + Around around{with_}; + return RD::isArray(o); + }; + bool isArrayBuffer(const Object& o) const override { + Around around{with_}; + return RD::isArrayBuffer(o); + }; + bool isFunction(const Object& o) const override { + Around around{with_}; + return RD::isFunction(o); + }; + bool isHostObject(const jsi::Object& o) const override { + Around around{with_}; + return RD::isHostObject(o); + }; + bool isHostFunction(const jsi::Function& f) const override { + Around around{with_}; + return RD::isHostFunction(f); + }; + Array getPropertyNames(const Object& o) override { + Around around{with_}; + return RD::getPropertyNames(o); + }; + + WeakObject createWeakObject(const Object& o) override { + Around around{with_}; + return RD::createWeakObject(o); + }; + Value lockWeakObject(WeakObject& wo) override { + Around around{with_}; + return RD::lockWeakObject(wo); + }; + + Array createArray(size_t length) override { + Around around{with_}; + return RD::createArray(length); + }; + size_t size(const Array& a) override { + Around around{with_}; + return RD::size(a); + }; + size_t size(const ArrayBuffer& ab) override { + Around around{with_}; + return RD::size(ab); + }; + uint8_t* data(const ArrayBuffer& ab) override { + Around around{with_}; + return RD::data(ab); + }; + Value getValueAtIndex(const Array& a, size_t i) override { + Around around{with_}; + return RD::getValueAtIndex(a, i); + }; + void setValueAtIndexImpl(Array& a, size_t i, const Value& value) override { + Around around{with_}; + RD::setValueAtIndexImpl(a, i, value); + }; + + Function createFunctionFromHostFunction( + const PropNameID& name, + unsigned int paramCount, + HostFunctionType func) override { + Around around{with_}; + return RD::createFunctionFromHostFunction( + name, paramCount, std::move(func)); + }; + Value call( + const Function& f, + const Value& jsThis, + const Value* args, + size_t count) override { + Around around{with_}; + return RD::call(f, jsThis, args, count); + }; + Value callAsConstructor(const Function& f, const Value* args, size_t count) + override { + Around around{with_}; + return RD::callAsConstructor(f, args, count); + }; + + // Private data for managing scopes. + Runtime::ScopeState* pushScope() override { + Around around{with_}; + return RD::pushScope(); + } + void popScope(Runtime::ScopeState* ss) override { + Around around{with_}; + RD::popScope(ss); + } + + bool strictEquals(const Symbol& a, const Symbol& b) const override { + Around around{with_}; + return RD::strictEquals(a, b); + }; + bool strictEquals(const String& a, const String& b) const override { + Around around{with_}; + return RD::strictEquals(a, b); + }; + bool strictEquals(const Object& a, const Object& b) const override { + Around around{with_}; + return RD::strictEquals(a, b); + }; + + bool instanceOf(const Object& o, const Function& f) override { + Around around{with_}; + return RD::instanceOf(o, f); + }; + + private: + // Wrap an RAII type around With& to guarantee after always happens. + struct Around { + Around(With& with) : with_(with) { + detail::BeforeCaller::before(with_); + } + ~Around() { + detail::AfterCaller::after(with_); + } + + With& with_; + }; + + With& with_; +}; + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/instrumentation.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/instrumentation.h new file mode 100644 index 0000000..a337a7a --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/instrumentation.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace facebook { +namespace jsi { + +/// Methods for starting and collecting instrumentation, an \c Instrumentation +/// instance is associated with a particular \c Runtime instance, which it +/// controls the instrumentation of. +/// None of these functions should return newly created jsi values, nor should +/// it modify the values of any jsi values in the heap (although GCs are fine). +class JSI_EXPORT Instrumentation { + public: + virtual ~Instrumentation() = default; + + /// Returns GC statistics as a JSON-encoded string, with an object containing + /// "type" and "version" fields outermost. "type" is a string, unique to a + /// particular implementation of \c jsi::Instrumentation, and "version" is a + /// number to indicate any revision to that implementation and its output + /// format. + /// + /// \pre This call can only be made on the instrumentation instance of a + /// runtime initialised to collect GC statistics. + /// + /// \post All cumulative measurements mentioned in the output are accumulated + /// across the entire lifetime of the Runtime. + /// + /// \return the GC statistics collected so far, as a JSON-encoded string. + virtual std::string getRecordedGCStats() = 0; + + /// Request statistics about the current state of the runtime's heap. This + /// function can be called at any time, and should produce information that is + /// correct at the instant it is called (i.e, not stale). + /// + /// \return a map from a string key to a number associated with that + /// statistic. + virtual std::unordered_map getHeapInfo( + bool includeExpensive) = 0; + + /// Perform a full garbage collection. + /// \param cause The cause of this collection, as it should be reported in + /// logs. + virtual void collectGarbage(std::string cause) = 0; + + /// A HeapStatsUpdate is a tuple of the fragment index, the number of objects + /// in that fragment, and the number of bytes used by those objects. + /// A "fragment" is a view of all objects allocated within a time slice. + using HeapStatsUpdate = std::tuple; + + /// Start capturing JS stack-traces for all JS heap allocated objects. These + /// can be accessed via \c ::createSnapshotToFile(). + /// \param fragmentCallback If present, invoke this callback every so often + /// with the most recently seen object ID, and a list of fragments that have + /// been updated. This callback will be invoked on the same thread that the + /// runtime is using. + virtual void startTrackingHeapObjectStackTraces( + std::function stats)> fragmentCallback) = 0; + + /// Stop capture JS stack-traces for JS heap allocated objects. + virtual void stopTrackingHeapObjectStackTraces() = 0; + + /// Start a heap sampling profiler that will sample heap allocations, and the + /// stack trace they were allocated at. Reports a summary of which functions + /// allocated the most. + /// \param samplingInterval The number of bytes allocated to wait between + /// samples. This will be used as the expected value of a poisson + /// distribution. + virtual void startHeapSampling(size_t samplingInterval) = 0; + + /// Turns off the heap sampling profiler previously enabled via + /// \c startHeapSampling. Writes the output of the sampling heap profiler to + /// \p os. The output is a JSON formatted string. + virtual void stopHeapSampling(std::ostream& os) = 0; + + /// Captures the heap to a file + /// + /// \param path to save the heap capture + virtual void createSnapshotToFile(const std::string& path) = 0; + + /// Captures the heap to an output stream + /// + /// \param os output stream to write to. + virtual void createSnapshotToStream(std::ostream& os) = 0; + + /// If the runtime has been created to trace to a temp file, flush + /// any unwritten parts of the trace of bridge traffic to the file, + /// and return the name of the file. Otherwise, return the empty string. + /// Tracing is disabled after this call. + virtual std::string flushAndDisableBridgeTrafficTrace() = 0; + + /// Write basic block profile trace to the given file name. + virtual void writeBasicBlockProfileTraceToFile( + const std::string& fileName) const = 0; + + /// Dump external profiler symbols to the given file name. + virtual void dumpProfilerSymbolsToFile(const std::string& fileName) const = 0; +}; + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsi-inl.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsi-inl.h new file mode 100644 index 0000000..63d4a2f --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsi-inl.h @@ -0,0 +1,316 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +namespace facebook { +namespace jsi { +namespace detail { + +inline Value toValue(Runtime&, std::nullptr_t) { + return Value::null(); +} +inline Value toValue(Runtime&, bool b) { + return Value(b); +} +inline Value toValue(Runtime&, double d) { + return Value(d); +} +inline Value toValue(Runtime&, float f) { + return Value(static_cast(f)); +} +inline Value toValue(Runtime&, int i) { + return Value(i); +} +inline Value toValue(Runtime& runtime, const char* str) { + return String::createFromAscii(runtime, str); +} +inline Value toValue(Runtime& runtime, const std::string& str) { + return String::createFromUtf8(runtime, str); +} +template +inline Value toValue(Runtime& runtime, const T& other) { + static_assert( + std::is_base_of::value, + "This type cannot be converted to Value"); + return Value(runtime, other); +} +inline Value toValue(Runtime& runtime, const Value& value) { + return Value(runtime, value); +} +inline Value&& toValue(Runtime&, Value&& value) { + return std::move(value); +} + +inline PropNameID toPropNameID(Runtime& runtime, const char* name) { + return PropNameID::forAscii(runtime, name); +} +inline PropNameID toPropNameID(Runtime& runtime, const std::string& name) { + return PropNameID::forUtf8(runtime, name); +} +inline PropNameID&& toPropNameID(Runtime&, PropNameID&& name) { + return std::move(name); +} + +void throwJSError(Runtime&, const char* msg); + +} // namespace detail + +template +inline T Runtime::make(Runtime::PointerValue* pv) { + return T(pv); +} + +inline Runtime::PointerValue* Runtime::getPointerValue(jsi::Pointer& pointer) { + return pointer.ptr_; +} + +inline const Runtime::PointerValue* Runtime::getPointerValue( + const jsi::Pointer& pointer) { + return pointer.ptr_; +} + +inline const Runtime::PointerValue* Runtime::getPointerValue( + const jsi::Value& value) { + return value.data_.pointer.ptr_; +} + +inline Value Object::getProperty(Runtime& runtime, const char* name) const { + return getProperty(runtime, String::createFromAscii(runtime, name)); +} + +inline Value Object::getProperty(Runtime& runtime, const String& name) const { + return runtime.getProperty(*this, name); +} + +inline Value Object::getProperty(Runtime& runtime, const PropNameID& name) + const { + return runtime.getProperty(*this, name); +} + +inline bool Object::hasProperty(Runtime& runtime, const char* name) const { + return hasProperty(runtime, String::createFromAscii(runtime, name)); +} + +inline bool Object::hasProperty(Runtime& runtime, const String& name) const { + return runtime.hasProperty(*this, name); +} + +inline bool Object::hasProperty(Runtime& runtime, const PropNameID& name) + const { + return runtime.hasProperty(*this, name); +} + +template +void Object::setProperty(Runtime& runtime, const char* name, T&& value) { + setProperty( + runtime, String::createFromAscii(runtime, name), std::forward(value)); +} + +template +void Object::setProperty(Runtime& runtime, const String& name, T&& value) { + setPropertyValue( + runtime, name, detail::toValue(runtime, std::forward(value))); +} + +template +void Object::setProperty(Runtime& runtime, const PropNameID& name, T&& value) { + setPropertyValue( + runtime, name, detail::toValue(runtime, std::forward(value))); +} + +inline Array Object::getArray(Runtime& runtime) const& { + assert(runtime.isArray(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + return Array(runtime.cloneObject(ptr_)); +} + +inline Array Object::getArray(Runtime& runtime) && { + assert(runtime.isArray(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + Runtime::PointerValue* value = ptr_; + ptr_ = nullptr; + return Array(value); +} + +inline ArrayBuffer Object::getArrayBuffer(Runtime& runtime) const& { + assert(runtime.isArrayBuffer(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + return ArrayBuffer(runtime.cloneObject(ptr_)); +} + +inline ArrayBuffer Object::getArrayBuffer(Runtime& runtime) && { + assert(runtime.isArrayBuffer(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + Runtime::PointerValue* value = ptr_; + ptr_ = nullptr; + return ArrayBuffer(value); +} + +inline Function Object::getFunction(Runtime& runtime) const& { + assert(runtime.isFunction(*this)); + return Function(runtime.cloneObject(ptr_)); +} + +inline Function Object::getFunction(Runtime& runtime) && { + assert(runtime.isFunction(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + Runtime::PointerValue* value = ptr_; + ptr_ = nullptr; + return Function(value); +} + +template +inline bool Object::isHostObject(Runtime& runtime) const { + return runtime.isHostObject(*this) && + std::dynamic_pointer_cast(runtime.getHostObject(*this)); +} + +template <> +inline bool Object::isHostObject(Runtime& runtime) const { + return runtime.isHostObject(*this); +} + +template +inline std::shared_ptr Object::getHostObject(Runtime& runtime) const { + assert(isHostObject(runtime)); + return std::static_pointer_cast(runtime.getHostObject(*this)); +} + +template +inline std::shared_ptr Object::asHostObject(Runtime& runtime) const { + if (!isHostObject(runtime)) { + detail::throwJSError(runtime, "Object is not a HostObject of desired type"); + } + return std::static_pointer_cast(runtime.getHostObject(*this)); +} + +template <> +inline std::shared_ptr Object::getHostObject( + Runtime& runtime) const { + assert(runtime.isHostObject(*this)); + return runtime.getHostObject(*this); +} + +inline Array Object::getPropertyNames(Runtime& runtime) const { + return runtime.getPropertyNames(*this); +} + +inline Value WeakObject::lock(Runtime& runtime) { + return runtime.lockWeakObject(*this); +} + +template +void Array::setValueAtIndex(Runtime& runtime, size_t i, T&& value) { + setValueAtIndexImpl( + runtime, i, detail::toValue(runtime, std::forward(value))); +} + +inline Value Array::getValueAtIndex(Runtime& runtime, size_t i) const { + return runtime.getValueAtIndex(*this, i); +} + +inline Function Function::createFromHostFunction( + Runtime& runtime, + const jsi::PropNameID& name, + unsigned int paramCount, + jsi::HostFunctionType func) { + return runtime.createFunctionFromHostFunction( + name, paramCount, std::move(func)); +} + +inline Value Function::call(Runtime& runtime, const Value* args, size_t count) + const { + return runtime.call(*this, Value::undefined(), args, count); +} + +inline Value Function::call(Runtime& runtime, std::initializer_list args) + const { + return call(runtime, args.begin(), args.size()); +} + +template +inline Value Function::call(Runtime& runtime, Args&&... args) const { + // A more awesome version of this would be able to create raw values + // which can be used directly without wrapping and unwrapping, but + // this will do for now. + return call(runtime, {detail::toValue(runtime, std::forward(args))...}); +} + +inline Value Function::callWithThis( + Runtime& runtime, + const Object& jsThis, + const Value* args, + size_t count) const { + return runtime.call(*this, Value(runtime, jsThis), args, count); +} + +inline Value Function::callWithThis( + Runtime& runtime, + const Object& jsThis, + std::initializer_list args) const { + return callWithThis(runtime, jsThis, args.begin(), args.size()); +} + +template +inline Value Function::callWithThis( + Runtime& runtime, + const Object& jsThis, + Args&&... args) const { + // A more awesome version of this would be able to create raw values + // which can be used directly without wrapping and unwrapping, but + // this will do for now. + return callWithThis( + runtime, jsThis, {detail::toValue(runtime, std::forward(args))...}); +} + +template +inline Array Array::createWithElements(Runtime& runtime, Args&&... args) { + return createWithElements( + runtime, {detail::toValue(runtime, std::forward(args))...}); +} + +template +inline std::vector PropNameID::names( + Runtime& runtime, + Args&&... args) { + return names({detail::toPropNameID(runtime, std::forward(args))...}); +} + +template +inline std::vector PropNameID::names( + PropNameID(&&propertyNames)[N]) { + std::vector result; + result.reserve(N); + for (auto& name : propertyNames) { + result.push_back(std::move(name)); + } + return result; +} + +inline Value Function::callAsConstructor( + Runtime& runtime, + const Value* args, + size_t count) const { + return runtime.callAsConstructor(*this, args, count); +} + +inline Value Function::callAsConstructor( + Runtime& runtime, + std::initializer_list args) const { + return callAsConstructor(runtime, args.begin(), args.size()); +} + +template +inline Value Function::callAsConstructor(Runtime& runtime, Args&&... args) + const { + return callAsConstructor( + runtime, {detail::toValue(runtime, std::forward(args))...}); +} + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsi.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsi.h new file mode 100644 index 0000000..ae64498 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsi.h @@ -0,0 +1,1317 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#ifndef JSI_EXPORT +#ifdef _MSC_VER +#ifdef CREATE_SHARED_LIBRARY +#define JSI_EXPORT __declspec(dllexport) +#else +#define JSI_EXPORT +#endif // CREATE_SHARED_LIBRARY +#else // _MSC_VER +#define JSI_EXPORT __attribute__((visibility("default"))) +#endif // _MSC_VER +#endif // !defined(JSI_EXPORT) + +class FBJSRuntime; +namespace facebook { +namespace jsi { + +class JSI_EXPORT Buffer { + public: + virtual ~Buffer(); + virtual size_t size() const = 0; + virtual const uint8_t* data() const = 0; +}; + +class JSI_EXPORT StringBuffer : public Buffer { + public: + StringBuffer(std::string s) : s_(std::move(s)) {} + size_t size() const override { + return s_.size(); + } + const uint8_t* data() const override { + return reinterpret_cast(s_.data()); + } + + private: + std::string s_; +}; + +/// PreparedJavaScript is a base class representing JavaScript which is in a +/// form optimized for execution, in a runtime-specific way. Construct one via +/// jsi::Runtime::prepareJavaScript(). +/// ** This is an experimental API that is subject to change. ** +class JSI_EXPORT PreparedJavaScript { + protected: + PreparedJavaScript() = default; + + public: + virtual ~PreparedJavaScript() = 0; +}; + +class Runtime; +class Pointer; +class PropNameID; +class Symbol; +class String; +class Object; +class WeakObject; +class Array; +class ArrayBuffer; +class Function; +class Value; +class Instrumentation; +class Scope; +class JSIException; +class JSError; + +/// A function which has this type can be registered as a function +/// callable from JavaScript using Function::createFromHostFunction(). +/// When the function is called, args will point to the arguments, and +/// count will indicate how many arguments are passed. The function +/// can return a Value to the caller, or throw an exception. If a C++ +/// exception is thrown, a JS Error will be created and thrown into +/// JS; if the C++ exception extends std::exception, the Error's +/// message will be whatever what() returns. Note that it is undefined whether +/// HostFunctions may or may not be called in strict mode; that is `thisVal` +/// can be any value - it will not necessarily be coerced to an object or +/// or set to the global object. +using HostFunctionType = std::function< + Value(Runtime& rt, const Value& thisVal, const Value* args, size_t count)>; + +/// An object which implements this interface can be registered as an +/// Object with the JS runtime. +class JSI_EXPORT HostObject { + public: + // The C++ object's dtor will be called when the GC finalizes this + // object. (This may be as late as when the Runtime is shut down.) + // You have no control over which thread it is called on. This will + // be called from inside the GC, so it is unsafe to do any VM + // operations which require a Runtime&. Derived classes' dtors + // should also avoid doing anything expensive. Calling the dtor on + // a jsi object is explicitly ok. If you want to do JS operations, + // or any nontrivial work, you should add it to a work queue, and + // manage it externally. + virtual ~HostObject(); + + // When JS wants a property with a given name from the HostObject, + // it will call this method. If it throws an exception, the call + // will throw a JS \c Error object. By default this returns undefined. + // \return the value for the property. + virtual Value get(Runtime&, const PropNameID& name); + + // When JS wants to set a property with a given name on the HostObject, + // it will call this method. If it throws an exception, the call will + // throw a JS \c Error object. By default this throws a type error exception + // mimicking the behavior of a frozen object in strict mode. + virtual void set(Runtime&, const PropNameID& name, const Value& value); + + // When JS wants a list of property names for the HostObject, it will + // call this method. If it throws an exception, the call will throw a + // JS \c Error object. The default implementation returns empty vector. + virtual std::vector getPropertyNames(Runtime& rt); +}; + +/// Represents a JS runtime. Movable, but not copyable. Note that +/// this object may not be thread-aware, but cannot be used safely from +/// multiple threads at once. The application is responsible for +/// ensuring that it is used safely. This could mean using the +/// Runtime from a single thread, using a mutex, doing all work on a +/// serial queue, etc. This restriction applies to the methods of +/// this class, and any method in the API which take a Runtime& as an +/// argument. Destructors (all but ~Scope), operators, or other methods +/// which do not take Runtime& as an argument are safe to call from any +/// thread, but it is still forbidden to make write operations on a single +/// instance of any class from more than one thread. In addition, to +/// make shutdown safe, destruction of objects associated with the Runtime +/// must be destroyed before the Runtime is destroyed, or from the +/// destructor of a managed HostObject or HostFunction. Informally, this +/// means that the main source of unsafe behavior is to hold a jsi object +/// in a non-Runtime-managed object, and not clean it up before the Runtime +/// is shut down. If your lifecycle is such that avoiding this is hard, +/// you will probably need to do use your own locks. +class JSI_EXPORT Runtime { + public: + virtual ~Runtime(); + + /// Evaluates the given JavaScript \c buffer. \c sourceURL is used + /// to annotate the stack trace if there is an exception. The + /// contents may be utf8-encoded JS source code, or binary bytecode + /// whose format is specific to the implementation. If the input + /// format is unknown, or evaluation causes an error, a JSIException + /// will be thrown. + /// Note this function should ONLY be used when there isn't another means + /// through the JSI API. For example, it will be much slower to use this to + /// call a global function than using the JSI APIs to read the function + /// property from the global object and then calling it explicitly. + virtual Value evaluateJavaScript( + const std::shared_ptr& buffer, + const std::string& sourceURL) = 0; + + /// Prepares to evaluate the given JavaScript \c buffer by processing it into + /// a form optimized for execution. This may include pre-parsing, compiling, + /// etc. If the input is invalid (for example, cannot be parsed), a + /// JSIException will be thrown. The resulting object is tied to the + /// particular concrete type of Runtime from which it was created. It may be + /// used (via evaluatePreparedJavaScript) in any Runtime of the same concrete + /// type. + /// The PreparedJavaScript object may be passed to multiple VM instances, so + /// they can all share and benefit from the prepared script. + /// As with evaluateJavaScript(), using JavaScript code should be avoided + /// when the JSI API is sufficient. + virtual std::shared_ptr prepareJavaScript( + const std::shared_ptr& buffer, + std::string sourceURL) = 0; + + /// Evaluates a PreparedJavaScript. If evaluation causes an error, a + /// JSIException will be thrown. + /// As with evaluateJavaScript(), using JavaScript code should be avoided + /// when the JSI API is sufficient. + virtual Value evaluatePreparedJavaScript( + const std::shared_ptr& js) = 0; + + /// Drain the JavaScript VM internal Microtask (a.k.a. Job in ECMA262) queue. + /// + /// \param maxMicrotasksHint a hint to tell an implementation that it should + /// make a best effort not execute more than the given number. It's default + /// to -1 for infinity (unbounded execution). + /// \return true if the queue is drained or false if there is more work to do. + /// + /// When there were exceptions thrown from the execution of microtasks, + /// implementations shall discard the exceptional jobs. An implementation may + /// \throw a \c JSError object to signal the hosts to handle. In that case, an + /// implementation may or may not suspend the draining. + /// + /// Hosts may call this function again to resume the draining if it was + /// suspended due to either exceptions or the \p maxMicrotasksHint bound. + /// E.g. a host may repetitively invoke this function until the queue is + /// drained to implement the "microtask checkpint" defined in WHATWG HTML + /// event loop: https://html.spec.whatwg.org/C#perform-a-microtask-checkpoint. + /// + /// Note that error propagation is only a concern if a host needs to implement + /// `queueMicrotask`, a recent API that allows enqueueing aribitary functions + /// (hence may throw) as microtasks. Exceptions from ECMA-262 Promise Jobs are + /// handled internally to VMs and are never propagrated to hosts. + /// + /// This API offers some queue management to hosts at its best effort due to + /// different behaviors and limitations imposed by different VMs and APIs. By + /// the time this is written, An implementation may swallow exceptions (JSC), + /// may not pause (V8), and may not support bounded executions. + virtual bool drainMicrotasks(int maxMicrotasksHint = -1) = 0; + + /// \return the global object + virtual Object global() = 0; + + /// \return a short printable description of the instance. It should + /// at least include some human-readable indication of the runtime + /// implementation. This should only be used by logging, debugging, + /// and other developer-facing callers. + virtual std::string description() = 0; + + /// \return whether or not the underlying runtime supports debugging via the + /// Chrome remote debugging protocol. + /// + /// NOTE: the API for determining whether a runtime is debuggable and + /// registering a runtime with the debugger is still in flux, so please don't + /// use this API unless you know what you're doing. + virtual bool isInspectable() = 0; + + /// \return an interface to extract metrics from this \c Runtime. The default + /// implementation of this function returns an \c Instrumentation instance + /// which returns no metrics. + virtual Instrumentation& instrumentation(); + + protected: + friend class Pointer; + friend class PropNameID; + friend class Symbol; + friend class String; + friend class Object; + friend class WeakObject; + friend class Array; + friend class ArrayBuffer; + friend class Function; + friend class Value; + friend class Scope; + friend class JSError; + + // Potential optimization: avoid the cloneFoo() virtual dispatch, + // and instead just fix the number of fields, and copy them, since + // in practice they are trivially copyable. Sufficient use of + // rvalue arguments/methods would also reduce the number of clones. + + struct PointerValue { + virtual void invalidate() = 0; + + protected: + virtual ~PointerValue() = default; + }; + + virtual PointerValue* cloneSymbol(const Runtime::PointerValue* pv) = 0; + virtual PointerValue* cloneString(const Runtime::PointerValue* pv) = 0; + virtual PointerValue* cloneObject(const Runtime::PointerValue* pv) = 0; + virtual PointerValue* clonePropNameID(const Runtime::PointerValue* pv) = 0; + + virtual PropNameID createPropNameIDFromAscii( + const char* str, + size_t length) = 0; + virtual PropNameID createPropNameIDFromUtf8( + const uint8_t* utf8, + size_t length) = 0; + virtual PropNameID createPropNameIDFromString(const String& str) = 0; + virtual std::string utf8(const PropNameID&) = 0; + virtual bool compare(const PropNameID&, const PropNameID&) = 0; + + virtual std::string symbolToString(const Symbol&) = 0; + + virtual String createStringFromAscii(const char* str, size_t length) = 0; + virtual String createStringFromUtf8(const uint8_t* utf8, size_t length) = 0; + virtual std::string utf8(const String&) = 0; + + // \return a \c Value created from a utf8-encoded JSON string. The default + // implementation creates a \c String and invokes JSON.parse. + virtual Value createValueFromJsonUtf8(const uint8_t* json, size_t length); + + virtual Object createObject() = 0; + virtual Object createObject(std::shared_ptr ho) = 0; + virtual std::shared_ptr getHostObject(const jsi::Object&) = 0; + virtual HostFunctionType& getHostFunction(const jsi::Function&) = 0; + + virtual Value getProperty(const Object&, const PropNameID& name) = 0; + virtual Value getProperty(const Object&, const String& name) = 0; + virtual bool hasProperty(const Object&, const PropNameID& name) = 0; + virtual bool hasProperty(const Object&, const String& name) = 0; + virtual void + setPropertyValue(Object&, const PropNameID& name, const Value& value) = 0; + virtual void + setPropertyValue(Object&, const String& name, const Value& value) = 0; + + virtual bool isArray(const Object&) const = 0; + virtual bool isArrayBuffer(const Object&) const = 0; + virtual bool isFunction(const Object&) const = 0; + virtual bool isHostObject(const jsi::Object&) const = 0; + virtual bool isHostFunction(const jsi::Function&) const = 0; + virtual Array getPropertyNames(const Object&) = 0; + + virtual WeakObject createWeakObject(const Object&) = 0; + virtual Value lockWeakObject(WeakObject&) = 0; + + virtual Array createArray(size_t length) = 0; + virtual size_t size(const Array&) = 0; + virtual size_t size(const ArrayBuffer&) = 0; + virtual uint8_t* data(const ArrayBuffer&) = 0; + virtual Value getValueAtIndex(const Array&, size_t i) = 0; + virtual void setValueAtIndexImpl(Array&, size_t i, const Value& value) = 0; + + virtual Function createFunctionFromHostFunction( + const PropNameID& name, + unsigned int paramCount, + HostFunctionType func) = 0; + virtual Value call( + const Function&, + const Value& jsThis, + const Value* args, + size_t count) = 0; + virtual Value + callAsConstructor(const Function&, const Value* args, size_t count) = 0; + + // Private data for managing scopes. + struct ScopeState; + virtual ScopeState* pushScope(); + virtual void popScope(ScopeState*); + + virtual bool strictEquals(const Symbol& a, const Symbol& b) const = 0; + virtual bool strictEquals(const String& a, const String& b) const = 0; + virtual bool strictEquals(const Object& a, const Object& b) const = 0; + + virtual bool instanceOf(const Object& o, const Function& f) = 0; + + // These exist so derived classes can access the private parts of + // Value, Symbol, String, and Object, which are all friends of Runtime. + template + static T make(PointerValue* pv); + static PointerValue* getPointerValue(Pointer& pointer); + static const PointerValue* getPointerValue(const Pointer& pointer); + static const PointerValue* getPointerValue(const Value& value); + + friend class ::FBJSRuntime; + template + friend class RuntimeDecorator; +}; + +// Base class for pointer-storing types. +class JSI_EXPORT Pointer { + protected: + explicit Pointer(Pointer&& other) : ptr_(other.ptr_) { + other.ptr_ = nullptr; + } + + ~Pointer() { + if (ptr_) { + ptr_->invalidate(); + } + } + + Pointer& operator=(Pointer&& other); + + friend class Runtime; + friend class Value; + + explicit Pointer(Runtime::PointerValue* ptr) : ptr_(ptr) {} + + typename Runtime::PointerValue* ptr_; +}; + +/// Represents something that can be a JS property key. Movable, not copyable. +class JSI_EXPORT PropNameID : public Pointer { + public: + using Pointer::Pointer; + + PropNameID(Runtime& runtime, const PropNameID& other) + : Pointer(runtime.clonePropNameID(other.ptr_)) {} + + PropNameID(PropNameID&& other) = default; + PropNameID& operator=(PropNameID&& other) = default; + + /// Create a JS property name id from ascii values. The data is + /// copied. + static PropNameID forAscii(Runtime& runtime, const char* str, size_t length) { + return runtime.createPropNameIDFromAscii(str, length); + } + + /// Create a property name id from a nul-terminated C ascii name. The data is + /// copied. + static PropNameID forAscii(Runtime& runtime, const char* str) { + return forAscii(runtime, str, strlen(str)); + } + + /// Create a PropNameID from a C++ string. The string is copied. + static PropNameID forAscii(Runtime& runtime, const std::string& str) { + return forAscii(runtime, str.c_str(), str.size()); + } + + /// Create a PropNameID from utf8 values. The data is copied. + static PropNameID + forUtf8(Runtime& runtime, const uint8_t* utf8, size_t length) { + return runtime.createPropNameIDFromUtf8(utf8, length); + } + + /// Create a PropNameID from utf8-encoded octets stored in a + /// std::string. The string data is transformed and copied. + static PropNameID forUtf8(Runtime& runtime, const std::string& utf8) { + return runtime.createPropNameIDFromUtf8( + reinterpret_cast(utf8.data()), utf8.size()); + } + + /// Create a PropNameID from a JS string. + static PropNameID forString(Runtime& runtime, const jsi::String& str) { + return runtime.createPropNameIDFromString(str); + } + + // Creates a vector of PropNameIDs constructed from given arguments. + template + static std::vector names(Runtime& runtime, Args&&... args); + + // Creates a vector of given PropNameIDs. + template + static std::vector names(PropNameID(&&propertyNames)[N]); + + /// Copies the data in a PropNameID as utf8 into a C++ string. + std::string utf8(Runtime& runtime) const { + return runtime.utf8(*this); + } + + static bool compare( + Runtime& runtime, + const jsi::PropNameID& a, + const jsi::PropNameID& b) { + return runtime.compare(a, b); + } + + friend class Runtime; + friend class Value; +}; + +/// Represents a JS Symbol (es6). Movable, not copyable. +/// TODO T40778724: this is a limited implementation sufficient for +/// the debugger not to crash when a Symbol is a property in an Object +/// or element in an array. Complete support for creating will come +/// later. +class JSI_EXPORT Symbol : public Pointer { + public: + using Pointer::Pointer; + + Symbol(Symbol&& other) = default; + Symbol& operator=(Symbol&& other) = default; + + /// \return whether a and b refer to the same symbol. + static bool strictEquals(Runtime& runtime, const Symbol& a, const Symbol& b) { + return runtime.strictEquals(a, b); + } + + /// Converts a Symbol into a C++ string as JS .toString would. The output + /// will look like \c Symbol(description) . + std::string toString(Runtime& runtime) const { + return runtime.symbolToString(*this); + } + + friend class Runtime; + friend class Value; +}; + +/// Represents a JS String. Movable, not copyable. +class JSI_EXPORT String : public Pointer { + public: + using Pointer::Pointer; + + String(String&& other) = default; + String& operator=(String&& other) = default; + + /// Create a JS string from ascii values. The string data is + /// copied. + static String + createFromAscii(Runtime& runtime, const char* str, size_t length) { + return runtime.createStringFromAscii(str, length); + } + + /// Create a JS string from a nul-terminated C ascii string. The + /// string data is copied. + static String createFromAscii(Runtime& runtime, const char* str) { + return createFromAscii(runtime, str, strlen(str)); + } + + /// Create a JS string from a C++ string. The string data is + /// copied. + static String createFromAscii(Runtime& runtime, const std::string& str) { + return createFromAscii(runtime, str.c_str(), str.size()); + } + + /// Create a JS string from utf8-encoded octets. The string data is + /// transformed and copied. + static String + createFromUtf8(Runtime& runtime, const uint8_t* utf8, size_t length) { + return runtime.createStringFromUtf8(utf8, length); + } + + /// Create a JS string from utf8-encoded octets stored in a + /// std::string. The string data is transformed and copied. + static String createFromUtf8(Runtime& runtime, const std::string& utf8) { + return runtime.createStringFromUtf8( + reinterpret_cast(utf8.data()), utf8.length()); + } + + /// \return whether a and b contain the same characters. + static bool strictEquals(Runtime& runtime, const String& a, const String& b) { + return runtime.strictEquals(a, b); + } + + /// Copies the data in a JS string as utf8 into a C++ string. + std::string utf8(Runtime& runtime) const { + return runtime.utf8(*this); + } + + friend class Runtime; + friend class Value; +}; + +class Array; +class Function; + +/// Represents a JS Object. Movable, not copyable. +class JSI_EXPORT Object : public Pointer { + public: + using Pointer::Pointer; + + Object(Object&& other) = default; + Object& operator=(Object&& other) = default; + + /// Creates a new Object instance, like '{}' in JS. + Object(Runtime& runtime) : Object(runtime.createObject()) {} + + static Object createFromHostObject( + Runtime& runtime, + std::shared_ptr ho) { + return runtime.createObject(ho); + } + + /// \return whether this and \c obj are the same JSObject or not. + static bool strictEquals(Runtime& runtime, const Object& a, const Object& b) { + return runtime.strictEquals(a, b); + } + + /// \return the result of `this instanceOf ctor` in JS. + bool instanceOf(Runtime& rt, const Function& ctor) { + return rt.instanceOf(*this, ctor); + } + + /// \return the property of the object with the given ascii name. + /// If the name isn't a property on the object, returns the + /// undefined value. + Value getProperty(Runtime& runtime, const char* name) const; + + /// \return the property of the object with the String name. + /// If the name isn't a property on the object, returns the + /// undefined value. + Value getProperty(Runtime& runtime, const String& name) const; + + /// \return the property of the object with the given JS PropNameID + /// name. If the name isn't a property on the object, returns the + /// undefined value. + Value getProperty(Runtime& runtime, const PropNameID& name) const; + + /// \return true if and only if the object has a property with the + /// given ascii name. + bool hasProperty(Runtime& runtime, const char* name) const; + + /// \return true if and only if the object has a property with the + /// given String name. + bool hasProperty(Runtime& runtime, const String& name) const; + + /// \return true if and only if the object has a property with the + /// given PropNameID name. + bool hasProperty(Runtime& runtime, const PropNameID& name) const; + + /// Sets the property value from a Value or anything which can be + /// used to make one: nullptr_t, bool, double, int, const char*, + /// String, or Object. + template + void setProperty(Runtime& runtime, const char* name, T&& value); + + /// Sets the property value from a Value or anything which can be + /// used to make one: nullptr_t, bool, double, int, const char*, + /// String, or Object. + template + void setProperty(Runtime& runtime, const String& name, T&& value); + + /// Sets the property value from a Value or anything which can be + /// used to make one: nullptr_t, bool, double, int, const char*, + /// String, or Object. + template + void setProperty(Runtime& runtime, const PropNameID& name, T&& value); + + /// \return true iff JS \c Array.isArray() would return \c true. If + /// so, then \c getArray() will succeed. + bool isArray(Runtime& runtime) const { + return runtime.isArray(*this); + } + + /// \return true iff the Object is an ArrayBuffer. If so, then \c + /// getArrayBuffer() will succeed. + bool isArrayBuffer(Runtime& runtime) const { + return runtime.isArrayBuffer(*this); + } + + /// \return true iff the Object is callable. If so, then \c + /// getFunction will succeed. + bool isFunction(Runtime& runtime) const { + return runtime.isFunction(*this); + } + + /// \return true iff the Object was initialized with \c createFromHostObject + /// and the HostObject passed is of type \c T. If returns \c true then + /// \c getHostObject will succeed. + template + bool isHostObject(Runtime& runtime) const; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will assert. + Array getArray(Runtime& runtime) const&; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will assert. + Array getArray(Runtime& runtime) &&; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will throw + /// JSIException. + Array asArray(Runtime& runtime) const&; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will throw + /// JSIException. + Array asArray(Runtime& runtime) &&; + + /// \return an ArrayBuffer instance which refers to the same underlying + /// object. If \c isArrayBuffer() would return false, this will assert. + ArrayBuffer getArrayBuffer(Runtime& runtime) const&; + + /// \return an ArrayBuffer instance which refers to the same underlying + /// object. If \c isArrayBuffer() would return false, this will assert. + ArrayBuffer getArrayBuffer(Runtime& runtime) &&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will assert. + Function getFunction(Runtime& runtime) const&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will assert. + Function getFunction(Runtime& runtime) &&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will throw + /// JSIException. + Function asFunction(Runtime& runtime) const&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will throw + /// JSIException. + Function asFunction(Runtime& runtime) &&; + + /// \return a shared_ptr which refers to the same underlying + /// \c HostObject that was used to create this object. If \c isHostObject + /// is false, this will assert. Note that this does a type check and will + /// assert if the underlying HostObject isn't of type \c T + template + std::shared_ptr getHostObject(Runtime& runtime) const; + + /// \return a shared_ptr which refers to the same underlying + /// \c HostObject that was used to crete this object. If \c isHostObject + /// is false, this will throw. + template + std::shared_ptr asHostObject(Runtime& runtime) const; + + /// \return same as \c getProperty(name).asObject(), except with + /// a better exception message. + Object getPropertyAsObject(Runtime& runtime, const char* name) const; + + /// \return similar to \c + /// getProperty(name).getObject().getFunction(), except it will + /// throw JSIException instead of asserting if the property is + /// not an object, or the object is not callable. + Function getPropertyAsFunction(Runtime& runtime, const char* name) const; + + /// \return an Array consisting of all enumerable property names in + /// the object and its prototype chain. All values in the return + /// will be isString(). (This is probably not optimal, but it + /// works. I only need it in one place.) + Array getPropertyNames(Runtime& runtime) const; + + protected: + void + setPropertyValue(Runtime& runtime, const String& name, const Value& value) { + return runtime.setPropertyValue(*this, name, value); + } + + void setPropertyValue( + Runtime& runtime, + const PropNameID& name, + const Value& value) { + return runtime.setPropertyValue(*this, name, value); + } + + friend class Runtime; + friend class Value; +}; + +/// Represents a weak reference to a JS Object. If the only reference +/// to an Object are these, the object is eligible for GC. Method +/// names are inspired by C++ weak_ptr. Movable, not copyable. +class JSI_EXPORT WeakObject : public Pointer { + public: + using Pointer::Pointer; + + WeakObject(WeakObject&& other) = default; + WeakObject& operator=(WeakObject&& other) = default; + + /// Create a WeakObject from an Object. + WeakObject(Runtime& runtime, const Object& o) + : WeakObject(runtime.createWeakObject(o)) {} + + /// \return a Value representing the underlying Object if it is still valid; + /// otherwise returns \c undefined. Note that this method has nothing to do + /// with threads or concurrency. The name is based on std::weak_ptr::lock() + /// which serves a similar purpose. + Value lock(Runtime& runtime); + + friend class Runtime; +}; + +/// Represents a JS Object which can be efficiently used as an array +/// with integral indices. +class JSI_EXPORT Array : public Object { + public: + Array(Array&&) = default; + /// Creates a new Array instance, with \c length undefined elements. + Array(Runtime& runtime, size_t length) : Array(runtime.createArray(length)) {} + + Array& operator=(Array&&) = default; + + /// \return the size of the Array, according to its length property. + /// (C++ naming convention) + size_t size(Runtime& runtime) const { + return runtime.size(*this); + } + + /// \return the size of the Array, according to its length property. + /// (JS naming convention) + size_t length(Runtime& runtime) const { + return size(runtime); + } + + /// \return the property of the array at index \c i. If there is no + /// such property, returns the undefined value. If \c i is out of + /// range [ 0..\c length ] throws a JSIException. + Value getValueAtIndex(Runtime& runtime, size_t i) const; + + /// Sets the property of the array at index \c i. The argument + /// value behaves as with Object::setProperty(). If \c i is out of + /// range [ 0..\c length ] throws a JSIException. + template + void setValueAtIndex(Runtime& runtime, size_t i, T&& value); + + /// There is no current API for changing the size of an array once + /// created. We'll probably need that eventually. + + /// Creates a new Array instance from provided values + template + static Array createWithElements(Runtime&, Args&&... args); + + /// Creates a new Array instance from initializer list. + static Array createWithElements( + Runtime& runtime, + std::initializer_list elements); + + private: + friend class Object; + friend class Value; + + void setValueAtIndexImpl(Runtime& runtime, size_t i, const Value& value) { + return runtime.setValueAtIndexImpl(*this, i, value); + } + + Array(Runtime::PointerValue* value) : Object(value) {} +}; + +/// Represents a JSArrayBuffer +class JSI_EXPORT ArrayBuffer : public Object { + public: + ArrayBuffer(ArrayBuffer&&) = default; + ArrayBuffer& operator=(ArrayBuffer&&) = default; + + /// \return the size of the ArrayBuffer, according to its byteLength property. + /// (C++ naming convention) + size_t size(Runtime& runtime) const { + return runtime.size(*this); + } + + size_t length(Runtime& runtime) const { + return runtime.size(*this); + } + + uint8_t* data(Runtime& runtime) { + return runtime.data(*this); + } + + private: + friend class Object; + friend class Value; + + ArrayBuffer(Runtime::PointerValue* value) : Object(value) {} +}; + +/// Represents a JS Object which is guaranteed to be Callable. +class JSI_EXPORT Function : public Object { + public: + Function(Function&&) = default; + Function& operator=(Function&&) = default; + + /// Create a function which, when invoked, calls C++ code. If the + /// function throws an exception, a JS Error will be created and + /// thrown. + /// \param name the name property for the function. + /// \param paramCount the length property for the function, which + /// may not be the number of arguments the function is passed. + static Function createFromHostFunction( + Runtime& runtime, + const jsi::PropNameID& name, + unsigned int paramCount, + jsi::HostFunctionType func); + + /// Calls the function with \c count \c args. The \c this value of the JS + /// function will not be set by the C++ caller, similar to calling + /// Function.prototype.apply(undefined, args) in JS. + /// \b Note: as with Function.prototype.apply, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. + Value call(Runtime& runtime, const Value* args, size_t count) const; + + /// Calls the function with a \c std::initializer_list of Value + /// arguments. The \c this value of the JS function will not be set by the + /// C++ caller, similar to calling Function.prototype.apply(undefined, args) + /// in JS. + /// \b Note: as with Function.prototype.apply, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. + Value call(Runtime& runtime, std::initializer_list args) const; + + /// Calls the function with any number of arguments similarly to + /// Object::setProperty(). The \c this value of the JS function will not be + /// set by the C++ caller, similar to calling + /// Function.prototype.call(undefined, ...args) in JS. + /// \b Note: as with Function.prototype.call, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. + template + Value call(Runtime& runtime, Args&&... args) const; + + /// Calls the function with \c count \c args and \c jsThis value passed + /// as the \c this value. + Value callWithThis( + Runtime& Runtime, + const Object& jsThis, + const Value* args, + size_t count) const; + + /// Calls the function with a \c std::initializer_list of Value + /// arguments and \c jsThis passed as the \c this value. + Value callWithThis( + Runtime& runtime, + const Object& jsThis, + std::initializer_list args) const; + + /// Calls the function with any number of arguments similarly to + /// Object::setProperty(), and with \c jsThis passed as the \c this value. + template + Value callWithThis(Runtime& runtime, const Object& jsThis, Args&&... args) + const; + + /// Calls the function as a constructor with \c count \c args. Equivalent + /// to calling `new Func` where `Func` is the js function reqresented by + /// this. + Value callAsConstructor(Runtime& runtime, const Value* args, size_t count) + const; + + /// Same as above `callAsConstructor`, except use an initializer_list to + /// supply the arguments. + Value callAsConstructor(Runtime& runtime, std::initializer_list args) + const; + + /// Same as above `callAsConstructor`, but automatically converts/wraps + /// any argument with a jsi Value. + template + Value callAsConstructor(Runtime& runtime, Args&&... args) const; + + /// Returns whether this was created with Function::createFromHostFunction. + /// If true then you can use getHostFunction to get the underlying + /// HostFunctionType. + bool isHostFunction(Runtime& runtime) const { + return runtime.isHostFunction(*this); + } + + /// Returns the underlying HostFunctionType iff isHostFunction returns true + /// and asserts otherwise. You can use this to use std::function<>::target + /// to get the object that was passed to create the HostFunctionType. + /// + /// Note: The reference returned is borrowed from the JS object underlying + /// \c this, and thus only lasts as long as the object underlying + /// \c this does. + HostFunctionType& getHostFunction(Runtime& runtime) const { + assert(isHostFunction(runtime)); + return runtime.getHostFunction(*this); + } + + private: + friend class Object; + friend class Value; + + Function(Runtime::PointerValue* value) : Object(value) {} +}; + +/// Represents any JS Value (undefined, null, boolean, number, symbol, +/// string, or object). Movable, or explicitly copyable (has no copy +/// ctor). +class JSI_EXPORT Value { + public: + /// Default ctor creates an \c undefined JS value. + Value() : Value(UndefinedKind) {} + + /// Creates a \c null JS value. + /* implicit */ Value(std::nullptr_t) : kind_(NullKind) {} + + /// Creates a boolean JS value. + /* implicit */ Value(bool b) : Value(BooleanKind) { + data_.boolean = b; + } + + /// Creates a number JS value. + /* implicit */ Value(double d) : Value(NumberKind) { + data_.number = d; + } + + /// Creates a number JS value. + /* implicit */ Value(int i) : Value(NumberKind) { + data_.number = i; + } + + /// Moves a Symbol, String, or Object rvalue into a new JS value. + template + /* implicit */ Value(T&& other) : Value(kindOf(other)) { + static_assert( + std::is_base_of::value || + std::is_base_of::value || + std::is_base_of::value, + "Value cannot be implicitly move-constructed from this type"); + new (&data_.pointer) T(std::move(other)); + } + + /// Value("foo") will treat foo as a bool. This makes doing that a + /// compile error. + template + Value(const char*) { + static_assert( + !std::is_same::value, + "Value cannot be constructed directly from const char*"); + } + + Value(Value&& value); + + /// Copies a Symbol lvalue into a new JS value. + Value(Runtime& runtime, const Symbol& sym) : Value(SymbolKind) { + new (&data_.pointer) String(runtime.cloneSymbol(sym.ptr_)); + } + + /// Copies a String lvalue into a new JS value. + Value(Runtime& runtime, const String& str) : Value(StringKind) { + new (&data_.pointer) String(runtime.cloneString(str.ptr_)); + } + + /// Copies a Object lvalue into a new JS value. + Value(Runtime& runtime, const Object& obj) : Value(ObjectKind) { + new (&data_.pointer) Object(runtime.cloneObject(obj.ptr_)); + } + + /// Creates a JS value from another Value lvalue. + Value(Runtime& runtime, const Value& value); + + /// Value(rt, "foo") will treat foo as a bool. This makes doing + /// that a compile error. + template + Value(Runtime&, const char*) { + static_assert( + !std::is_same::value, + "Value cannot be constructed directly from const char*"); + } + + ~Value(); + // \return the undefined \c Value. + static Value undefined() { + return Value(); + } + + // \return the null \c Value. + static Value null() { + return Value(nullptr); + } + + // \return a \c Value created from a utf8-encoded JSON string. + static Value + createFromJsonUtf8(Runtime& runtime, const uint8_t* json, size_t length) { + return runtime.createValueFromJsonUtf8(json, length); + } + + /// \return according to the Strict Equality Comparison algorithm, see: + /// https://262.ecma-international.org/11.0/#sec-strict-equality-comparison + static bool strictEquals(Runtime& runtime, const Value& a, const Value& b); + + Value& operator=(Value&& other) { + this->~Value(); + new (this) Value(std::move(other)); + return *this; + } + + bool isUndefined() const { + return kind_ == UndefinedKind; + } + + bool isNull() const { + return kind_ == NullKind; + } + + bool isBool() const { + return kind_ == BooleanKind; + } + + bool isNumber() const { + return kind_ == NumberKind; + } + + bool isString() const { + return kind_ == StringKind; + } + + bool isSymbol() const { + return kind_ == SymbolKind; + } + + bool isObject() const { + return kind_ == ObjectKind; + } + + /// \return the boolean value, or asserts if not a boolean. + bool getBool() const { + assert(isBool()); + return data_.boolean; + } + + /// \return the number value, or asserts if not a number. + double getNumber() const { + assert(isNumber()); + return data_.number; + } + + /// \return the number value, or throws JSIException if not a + /// number. + double asNumber() const; + + /// \return the Symbol value, or asserts if not a symbol. + Symbol getSymbol(Runtime& runtime) const& { + assert(isSymbol()); + return Symbol(runtime.cloneSymbol(data_.pointer.ptr_)); + } + + /// \return the Symbol value, or asserts if not a symbol. + /// Can be used on rvalue references to avoid cloning more symbols. + Symbol getSymbol(Runtime&) && { + assert(isSymbol()); + auto ptr = data_.pointer.ptr_; + data_.pointer.ptr_ = nullptr; + return static_cast(ptr); + } + + /// \return the Symbol value, or throws JSIException if not a + /// symbol + Symbol asSymbol(Runtime& runtime) const&; + Symbol asSymbol(Runtime& runtime) &&; + + /// \return the String value, or asserts if not a string. + String getString(Runtime& runtime) const& { + assert(isString()); + return String(runtime.cloneString(data_.pointer.ptr_)); + } + + /// \return the String value, or asserts if not a string. + /// Can be used on rvalue references to avoid cloning more strings. + String getString(Runtime&) && { + assert(isString()); + auto ptr = data_.pointer.ptr_; + data_.pointer.ptr_ = nullptr; + return static_cast(ptr); + } + + /// \return the String value, or throws JSIException if not a + /// string. + String asString(Runtime& runtime) const&; + String asString(Runtime& runtime) &&; + + /// \return the Object value, or asserts if not an object. + Object getObject(Runtime& runtime) const& { + assert(isObject()); + return Object(runtime.cloneObject(data_.pointer.ptr_)); + } + + /// \return the Object value, or asserts if not an object. + /// Can be used on rvalue references to avoid cloning more objects. + Object getObject(Runtime&) && { + assert(isObject()); + auto ptr = data_.pointer.ptr_; + data_.pointer.ptr_ = nullptr; + return static_cast(ptr); + } + + /// \return the Object value, or throws JSIException if not an + /// object. + Object asObject(Runtime& runtime) const&; + Object asObject(Runtime& runtime) &&; + + // \return a String like JS .toString() would do. + String toString(Runtime& runtime) const; + + private: + friend class Runtime; + + enum ValueKind { + UndefinedKind, + NullKind, + BooleanKind, + NumberKind, + SymbolKind, + StringKind, + ObjectKind, + PointerKind = SymbolKind, + }; + + union Data { + // Value's ctor and dtor will manage the lifecycle of the contained Data. + Data() { + static_assert( + sizeof(Data) == sizeof(uint64_t), + "Value data should fit in a 64-bit register"); + } + ~Data() {} + + // scalars + bool boolean; + double number; + // pointers + Pointer pointer; // Symbol, String, Object, Array, Function + }; + + Value(ValueKind kind) : kind_(kind) {} + + constexpr static ValueKind kindOf(const Symbol&) { + return SymbolKind; + } + constexpr static ValueKind kindOf(const String&) { + return StringKind; + } + constexpr static ValueKind kindOf(const Object&) { + return ObjectKind; + } + + ValueKind kind_; + Data data_; + + // In the future: Value becomes NaN-boxed. See T40538354. +}; + +/// Not movable and not copyable RAII marker advising the underlying +/// JavaScript VM to track resources allocated since creation until +/// destruction so that they can be recycled eagerly when the Scope +/// goes out of scope instead of floating in the air until the next +/// garbage collection or any other delayed release occurs. +/// +/// This API should be treated only as advice, implementations can +/// choose to ignore the fact that Scopes are created or destroyed. +/// +/// This class is an exception to the rule allowing destructors to be +/// called without proper synchronization (see Runtime documentation). +/// The whole point of this class is to enable all sorts of clean ups +/// when the destructor is called and this proper synchronization is +/// required at that time. +/// +/// Instances of this class are intended to be created as automatic stack +/// variables in which case destructor calls don't require any additional +/// locking, provided that the lock (if any) is managed with RAII helpers. +class JSI_EXPORT Scope { + public: + explicit Scope(Runtime& rt) : rt_(rt), prv_(rt.pushScope()) {} + ~Scope() { + rt_.popScope(prv_); + }; + + Scope(const Scope&) = delete; + Scope(Scope&&) = delete; + + Scope& operator=(const Scope&) = delete; + Scope& operator=(Scope&&) = delete; + + template + static auto callInNewScope(Runtime& rt, F f) -> decltype(f()) { + Scope s(rt); + return f(); + } + + private: + Runtime& rt_; + Runtime::ScopeState* prv_; +}; + +/// Base class for jsi exceptions +class JSI_EXPORT JSIException : public std::exception { + protected: + JSIException(){}; + JSIException(std::string what) : what_(std::move(what)){}; + + public: + virtual const char* what() const noexcept override { + return what_.c_str(); + } + + virtual ~JSIException(); + + protected: + std::string what_; +}; + +/// This exception will be thrown by API functions on errors not related to +/// JavaScript execution. +class JSI_EXPORT JSINativeException : public JSIException { + public: + JSINativeException(std::string what) : JSIException(std::move(what)) {} + + virtual ~JSINativeException(); +}; + +/// This exception will be thrown by API functions whenever a JS +/// operation causes an exception as described by the spec, or as +/// otherwise described. +class JSI_EXPORT JSError : public JSIException { + public: + /// Creates a JSError referring to provided \c value + JSError(Runtime& r, Value&& value); + + /// Creates a JSError referring to new \c Error instance capturing current + /// JavaScript stack. The error message property is set to given \c message. + JSError(Runtime& rt, std::string message); + + /// Creates a JSError referring to new \c Error instance capturing current + /// JavaScript stack. The error message property is set to given \c message. + JSError(Runtime& rt, const char* message) + : JSError(rt, std::string(message)){}; + + /// Creates a JSError referring to a JavaScript Object having message and + /// stack properties set to provided values. + JSError(Runtime& rt, std::string message, std::string stack); + + /// Creates a JSError referring to provided value and what string + /// set to provided message. This argument order is a bit weird, + /// but necessary to avoid ambiguity with the above. + JSError(std::string what, Runtime& rt, Value&& value); + + virtual ~JSError(); + + const std::string& getStack() const { + return stack_; + } + + const std::string& getMessage() const { + return message_; + } + + const jsi::Value& value() const { + assert(value_); + return *value_; + } + + private: + // This initializes the value_ member and does some other + // validation, so it must be called by every branch through the + // constructors. + void setValue(Runtime& rt, Value&& value); + + // This needs to be on the heap, because throw requires the object + // be copyable, and Value is not. + std::shared_ptr value_; + std::string message_; + std::string stack_; +}; + +} // namespace jsi +} // namespace facebook + +#include diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsilib.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsilib.h new file mode 100644 index 0000000..d99b66d --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/jsilib.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +namespace facebook { +namespace jsi { + +class FileBuffer : public Buffer { + public: + FileBuffer(const std::string& path); + ~FileBuffer(); + + size_t size() const override { + return size_; + } + + const uint8_t* data() const override { + return data_; + } + + private: + size_t size_; + uint8_t* data_; +}; + +// A trivial implementation of PreparedJavaScript that simply stores the source +// buffer and URL. +class SourceJavaScriptPreparation final : public jsi::PreparedJavaScript, + public jsi::Buffer { + std::shared_ptr buf_; + std::string sourceURL_; + + public: + SourceJavaScriptPreparation( + std::shared_ptr buf, + std::string sourceURL) + : buf_(std::move(buf)), sourceURL_(std::move(sourceURL)) {} + + const std::string& sourceURL() const { + return sourceURL_; + } + + size_t size() const override { + return buf_->size(); + } + const uint8_t* data() const override { + return buf_->data(); + } +}; + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/threadsafe.h b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/threadsafe.h new file mode 100644 index 0000000..eddbce4 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64/Headers/jsi/threadsafe.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include +#include + +namespace facebook { +namespace jsi { + +class ThreadSafeRuntime : public Runtime { + public: + virtual void lock() const = 0; + virtual void unlock() const = 0; + virtual Runtime& getUnsafeRuntime() = 0; +}; + +namespace detail { + +template +struct WithLock { + L lock; + WithLock(R& r) : lock(r) {} + void before() { + lock.lock(); + } + void after() { + lock.unlock(); + } +}; + +// The actual implementation of a given ThreadSafeRuntime. It's parameterized +// by: +// +// - R: The actual Runtime type that this wraps +// - L: A lock type that has three members: +// - L(R& r) // ctor +// - void lock() +// - void unlock() +template +class ThreadSafeRuntimeImpl final + : public WithRuntimeDecorator, R, ThreadSafeRuntime> { + public: + template + ThreadSafeRuntimeImpl(Args&&... args) + : WithRuntimeDecorator, R, ThreadSafeRuntime>( + unsafe_, + lock_), + unsafe_(std::forward(args)...), + lock_(unsafe_) {} + + R& getUnsafeRuntime() override { + return WithRuntimeDecorator, R, ThreadSafeRuntime>::plain(); + } + + void lock() const override { + lock_.before(); + } + + void unlock() const override { + lock_.after(); + } + + private: + R unsafe_; + mutable WithLock lock_; +}; + +} // namespace detail + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64/libReact-jsi.a b/Frameworks/React-jsi.xcframework/ios-arm64/libReact-jsi.a new file mode 100644 index 0000000..2ae6109 Binary files /dev/null and b/Frameworks/React-jsi.xcframework/ios-arm64/libReact-jsi.a differ diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/JSCRuntime.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/JSCRuntime.h new file mode 100644 index 0000000..5455423 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/JSCRuntime.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace jsc { + +std::unique_ptr makeJSCRuntime(); + +} // namespace jsc +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/JSIDynamic.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/JSIDynamic.h new file mode 100644 index 0000000..41f9d9f --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/JSIDynamic.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace jsi { + +facebook::jsi::Value valueFromDynamic( + facebook::jsi::Runtime& runtime, + const folly::dynamic& dyn); + +folly::dynamic dynamicFromValue( + facebook::jsi::Runtime& runtime, + const facebook::jsi::Value& value); + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/decorator.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/decorator.h new file mode 100644 index 0000000..be6f4f5 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/decorator.h @@ -0,0 +1,753 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include +#include + +// This file contains objects to help API users create their own +// runtime adapters, i.e. if you want to compose runtimes to add your +// own behavior. + +namespace facebook { +namespace jsi { + +// Use this to wrap host functions. It will pass the member runtime as +// the first arg to the callback. The first argument to the ctor +// should be the decorated runtime, not the plain one. +class DecoratedHostFunction { + public: + DecoratedHostFunction(Runtime& drt, HostFunctionType plainHF) + : drt_(drt), plainHF_(std::move(plainHF)) {} + + Runtime& decoratedRuntime() { + return drt_; + } + + Value + operator()(Runtime&, const Value& thisVal, const Value* args, size_t count) { + return plainHF_(decoratedRuntime(), thisVal, args, count); + } + + private: + template + friend class RuntimeDecorator; + + Runtime& drt_; + HostFunctionType plainHF_; +}; + +// From the perspective of the caller, a plain HostObject is passed to +// the decorated Runtime, and the HostObject methods expect to get +// passed that Runtime. But the plain Runtime will pass itself to its +// callback, so we need a helper here which curries the decorated +// Runtime, and calls the plain HostObject with it. +// +// If the concrete RuntimeDecorator derives DecoratedHostObject, it +// should call the base class get() and set() to invoke the plain +// HostObject functionality. The Runtime& it passes does not matter, +// as it is not used. +class DecoratedHostObject : public HostObject { + public: + DecoratedHostObject(Runtime& drt, std::shared_ptr plainHO) + : drt_(drt), plainHO_(plainHO) {} + + // The derived class methods can call this to get a reference to the + // decorated runtime, since the rt passed to the callback will be + // the plain runtime. + Runtime& decoratedRuntime() { + return drt_; + } + + Value get(Runtime&, const PropNameID& name) override { + return plainHO_->get(decoratedRuntime(), name); + } + + void set(Runtime&, const PropNameID& name, const Value& value) override { + plainHO_->set(decoratedRuntime(), name, value); + } + + std::vector getPropertyNames(Runtime&) override { + return plainHO_->getPropertyNames(decoratedRuntime()); + } + + private: + template + friend class RuntimeDecorator; + + Runtime& drt_; + std::shared_ptr plainHO_; +}; + +/// C++ variant on a standard Decorator pattern, using template +/// parameters. The \c Plain template parameter type is the +/// undecorated Runtime type. You can usually use \c Runtime here, +/// but if you know the concrete type ahead of time and it's final, +/// the compiler can devirtualize calls to the decorated +/// implementation. The \c Base template parameter type will be used +/// as the base class of the decorated type. Here, too, you can +/// usually use \c Runtime, but if you want the decorated type to +/// implement a derived class of Runtime, you can specify that here. +/// For an example, see threadsafe.h. +template +class RuntimeDecorator : public Base, private jsi::Instrumentation { + public: + Plain& plain() { + static_assert( + std::is_base_of::value, + "RuntimeDecorator's Plain type must derive from jsi::Runtime"); + static_assert( + std::is_base_of::value, + "RuntimeDecorator's Base type must derive from jsi::Runtime"); + return plain_; + } + const Plain& plain() const { + return plain_; + } + + Value evaluateJavaScript( + const std::shared_ptr& buffer, + const std::string& sourceURL) override { + return plain().evaluateJavaScript(buffer, sourceURL); + } + std::shared_ptr prepareJavaScript( + const std::shared_ptr& buffer, + std::string sourceURL) override { + return plain().prepareJavaScript(buffer, std::move(sourceURL)); + } + Value evaluatePreparedJavaScript( + const std::shared_ptr& js) override { + return plain().evaluatePreparedJavaScript(js); + } + bool drainMicrotasks(int maxMicrotasksHint) override { + return plain().drainMicrotasks(maxMicrotasksHint); + } + Object global() override { + return plain().global(); + } + std::string description() override { + return plain().description(); + }; + bool isInspectable() override { + return plain().isInspectable(); + }; + Instrumentation& instrumentation() override { + return *this; + } + + protected: + // plain is generally going to be a reference to an object managed + // by a derived class. We cache it here so this class can be + // concrete, and avoid making virtual calls to find the plain + // Runtime. Note that the ctor and dtor do not access through the + // reference, so passing a reference to an object before its + // lifetime has started is ok. + RuntimeDecorator(Plain& plain) : plain_(plain) {} + + Runtime::PointerValue* cloneSymbol(const Runtime::PointerValue* pv) override { + return plain_.cloneSymbol(pv); + }; + Runtime::PointerValue* cloneString(const Runtime::PointerValue* pv) override { + return plain_.cloneString(pv); + }; + Runtime::PointerValue* cloneObject(const Runtime::PointerValue* pv) override { + return plain_.cloneObject(pv); + }; + Runtime::PointerValue* clonePropNameID( + const Runtime::PointerValue* pv) override { + return plain_.clonePropNameID(pv); + }; + + PropNameID createPropNameIDFromAscii(const char* str, size_t length) + override { + return plain_.createPropNameIDFromAscii(str, length); + }; + PropNameID createPropNameIDFromUtf8(const uint8_t* utf8, size_t length) + override { + return plain_.createPropNameIDFromUtf8(utf8, length); + }; + PropNameID createPropNameIDFromString(const String& str) override { + return plain_.createPropNameIDFromString(str); + }; + std::string utf8(const PropNameID& id) override { + return plain_.utf8(id); + }; + bool compare(const PropNameID& a, const PropNameID& b) override { + return plain_.compare(a, b); + }; + + std::string symbolToString(const Symbol& sym) override { + return plain_.symbolToString(sym); + } + + String createStringFromAscii(const char* str, size_t length) override { + return plain_.createStringFromAscii(str, length); + }; + String createStringFromUtf8(const uint8_t* utf8, size_t length) override { + return plain_.createStringFromUtf8(utf8, length); + }; + std::string utf8(const String& s) override { + return plain_.utf8(s); + } + + Object createObject() override { + return plain_.createObject(); + }; + + Object createObject(std::shared_ptr ho) override { + return plain_.createObject( + std::make_shared(*this, std::move(ho))); + }; + std::shared_ptr getHostObject(const jsi::Object& o) override { + std::shared_ptr dho = plain_.getHostObject(o); + return static_cast(*dho).plainHO_; + }; + HostFunctionType& getHostFunction(const jsi::Function& f) override { + HostFunctionType& dhf = plain_.getHostFunction(f); + // This will fail if a cpp file including this header is not compiled + // with RTTI. + return dhf.target()->plainHF_; + }; + + Value getProperty(const Object& o, const PropNameID& name) override { + return plain_.getProperty(o, name); + }; + Value getProperty(const Object& o, const String& name) override { + return plain_.getProperty(o, name); + }; + bool hasProperty(const Object& o, const PropNameID& name) override { + return plain_.hasProperty(o, name); + }; + bool hasProperty(const Object& o, const String& name) override { + return plain_.hasProperty(o, name); + }; + void setPropertyValue(Object& o, const PropNameID& name, const Value& value) + override { + plain_.setPropertyValue(o, name, value); + }; + void setPropertyValue(Object& o, const String& name, const Value& value) + override { + plain_.setPropertyValue(o, name, value); + }; + + bool isArray(const Object& o) const override { + return plain_.isArray(o); + }; + bool isArrayBuffer(const Object& o) const override { + return plain_.isArrayBuffer(o); + }; + bool isFunction(const Object& o) const override { + return plain_.isFunction(o); + }; + bool isHostObject(const jsi::Object& o) const override { + return plain_.isHostObject(o); + }; + bool isHostFunction(const jsi::Function& f) const override { + return plain_.isHostFunction(f); + }; + Array getPropertyNames(const Object& o) override { + return plain_.getPropertyNames(o); + }; + + WeakObject createWeakObject(const Object& o) override { + return plain_.createWeakObject(o); + }; + Value lockWeakObject(WeakObject& wo) override { + return plain_.lockWeakObject(wo); + }; + + Array createArray(size_t length) override { + return plain_.createArray(length); + }; + size_t size(const Array& a) override { + return plain_.size(a); + }; + size_t size(const ArrayBuffer& ab) override { + return plain_.size(ab); + }; + uint8_t* data(const ArrayBuffer& ab) override { + return plain_.data(ab); + }; + Value getValueAtIndex(const Array& a, size_t i) override { + return plain_.getValueAtIndex(a, i); + }; + void setValueAtIndexImpl(Array& a, size_t i, const Value& value) override { + plain_.setValueAtIndexImpl(a, i, value); + }; + + Function createFunctionFromHostFunction( + const PropNameID& name, + unsigned int paramCount, + HostFunctionType func) override { + return plain_.createFunctionFromHostFunction( + name, paramCount, DecoratedHostFunction(*this, std::move(func))); + }; + Value call( + const Function& f, + const Value& jsThis, + const Value* args, + size_t count) override { + return plain_.call(f, jsThis, args, count); + }; + Value callAsConstructor(const Function& f, const Value* args, size_t count) + override { + return plain_.callAsConstructor(f, args, count); + }; + + // Private data for managing scopes. + Runtime::ScopeState* pushScope() override { + return plain_.pushScope(); + } + void popScope(Runtime::ScopeState* ss) override { + plain_.popScope(ss); + } + + bool strictEquals(const Symbol& a, const Symbol& b) const override { + return plain_.strictEquals(a, b); + }; + bool strictEquals(const String& a, const String& b) const override { + return plain_.strictEquals(a, b); + }; + bool strictEquals(const Object& a, const Object& b) const override { + return plain_.strictEquals(a, b); + }; + + bool instanceOf(const Object& o, const Function& f) override { + return plain_.instanceOf(o, f); + }; + + // jsi::Instrumentation methods + + std::string getRecordedGCStats() override { + return plain().instrumentation().getRecordedGCStats(); + } + + std::unordered_map getHeapInfo( + bool includeExpensive) override { + return plain().instrumentation().getHeapInfo(includeExpensive); + } + + void collectGarbage(std::string cause) override { + plain().instrumentation().collectGarbage(std::move(cause)); + } + + void startTrackingHeapObjectStackTraces( + std::function)> callback) override { + plain().instrumentation().startTrackingHeapObjectStackTraces( + std::move(callback)); + } + + void stopTrackingHeapObjectStackTraces() override { + plain().instrumentation().stopTrackingHeapObjectStackTraces(); + } + + void startHeapSampling(size_t samplingInterval) override { + plain().instrumentation().startHeapSampling(samplingInterval); + } + + void stopHeapSampling(std::ostream& os) override { + plain().instrumentation().stopHeapSampling(os); + } + + void createSnapshotToFile(const std::string& path) override { + plain().instrumentation().createSnapshotToFile(path); + } + + void createSnapshotToStream(std::ostream& os) override { + plain().instrumentation().createSnapshotToStream(os); + } + + std::string flushAndDisableBridgeTrafficTrace() override { + return const_cast(plain()) + .instrumentation() + .flushAndDisableBridgeTrafficTrace(); + } + + void writeBasicBlockProfileTraceToFile( + const std::string& fileName) const override { + const_cast(plain()) + .instrumentation() + .writeBasicBlockProfileTraceToFile(fileName); + } + + /// Dump external profiler symbols to the given file name. + void dumpProfilerSymbolsToFile(const std::string& fileName) const override { + const_cast(plain()).instrumentation().dumpProfilerSymbolsToFile( + fileName); + } + + private: + Plain& plain_; +}; + +namespace detail { + +// This metaprogramming allows the With type's methods to be +// optional. + +template +struct BeforeCaller { + static void before(T&) {} +}; + +template +struct AfterCaller { + static void after(T&) {} +}; + +// decltype((void)&...) is either SFINAE, or void. +// So, if SFINAE does not happen for T, then this specialization exists +// for BeforeCaller, and always applies. If not, only the +// default above exists, and that is used instead. +template +struct BeforeCaller { + static void before(T& t) { + t.before(); + } +}; + +template +struct AfterCaller { + static void after(T& t) { + t.after(); + } +}; + +// It's possible to use multiple decorators by nesting +// WithRuntimeDecorator<...>, but this specialization allows use of +// std::tuple of decorator classes instead. See testlib.cpp for an +// example. +template +struct BeforeCaller> { + static void before(std::tuple& tuple) { + all_before<0, T...>(tuple); + } + + private: + template + static void all_before(std::tuple& tuple) { + detail::BeforeCaller::before(std::get(tuple)); + all_before(tuple); + } + + template + static void all_before(std::tuple&) {} +}; + +template +struct AfterCaller> { + static void after(std::tuple& tuple) { + all_after<0, T...>(tuple); + } + + private: + template + static void all_after(std::tuple& tuple) { + all_after(tuple); + detail::AfterCaller::after(std::get(tuple)); + } + + template + static void all_after(std::tuple&) {} +}; + +} // namespace detail + +// A decorator which implements an around idiom. A With instance is +// RAII constructed before each call to the undecorated class; the +// ctor is passed a single argument of type WithArg&. Plain and Base +// are used as in the base class. +template +class WithRuntimeDecorator : public RuntimeDecorator { + public: + using RD = RuntimeDecorator; + + // The reference arguments to the ctor are stored, but not used by + // the ctor, and there is no ctor, so they can be passed members of + // the derived class. + WithRuntimeDecorator(Plain& plain, With& with) : RD(plain), with_(with) {} + + Value evaluateJavaScript( + const std::shared_ptr& buffer, + const std::string& sourceURL) override { + Around around{with_}; + return RD::evaluateJavaScript(buffer, sourceURL); + } + std::shared_ptr prepareJavaScript( + const std::shared_ptr& buffer, + std::string sourceURL) override { + Around around{with_}; + return RD::prepareJavaScript(buffer, std::move(sourceURL)); + } + Value evaluatePreparedJavaScript( + const std::shared_ptr& js) override { + Around around{with_}; + return RD::evaluatePreparedJavaScript(js); + } + bool drainMicrotasks(int maxMicrotasksHint) override { + Around around{with_}; + return RD::drainMicrotasks(maxMicrotasksHint); + } + Object global() override { + Around around{with_}; + return RD::global(); + } + std::string description() override { + Around around{with_}; + return RD::description(); + }; + bool isInspectable() override { + Around around{with_}; + return RD::isInspectable(); + }; + + // The jsi:: prefix is necessary because MSVC compiler complains C2247: + // Instrumentation is not accessible because RuntimeDecorator uses private + // to inherit from Instrumentation. + // TODO(T40821815) Consider removing this workaround when updating MSVC + jsi::Instrumentation& instrumentation() override { + Around around{with_}; + return RD::instrumentation(); + } + + protected: + Runtime::PointerValue* cloneSymbol(const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::cloneSymbol(pv); + }; + Runtime::PointerValue* cloneString(const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::cloneString(pv); + }; + Runtime::PointerValue* cloneObject(const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::cloneObject(pv); + }; + Runtime::PointerValue* clonePropNameID( + const Runtime::PointerValue* pv) override { + Around around{with_}; + return RD::clonePropNameID(pv); + }; + + PropNameID createPropNameIDFromAscii(const char* str, size_t length) + override { + Around around{with_}; + return RD::createPropNameIDFromAscii(str, length); + }; + PropNameID createPropNameIDFromUtf8(const uint8_t* utf8, size_t length) + override { + Around around{with_}; + return RD::createPropNameIDFromUtf8(utf8, length); + }; + PropNameID createPropNameIDFromString(const String& str) override { + Around around{with_}; + return RD::createPropNameIDFromString(str); + }; + std::string utf8(const PropNameID& id) override { + Around around{with_}; + return RD::utf8(id); + }; + bool compare(const PropNameID& a, const PropNameID& b) override { + Around around{with_}; + return RD::compare(a, b); + }; + + std::string symbolToString(const Symbol& sym) override { + Around around{with_}; + return RD::symbolToString(sym); + }; + + String createStringFromAscii(const char* str, size_t length) override { + Around around{with_}; + return RD::createStringFromAscii(str, length); + }; + String createStringFromUtf8(const uint8_t* utf8, size_t length) override { + Around around{with_}; + return RD::createStringFromUtf8(utf8, length); + }; + std::string utf8(const String& s) override { + Around around{with_}; + return RD::utf8(s); + } + + Object createObject() override { + Around around{with_}; + return RD::createObject(); + }; + Object createObject(std::shared_ptr ho) override { + Around around{with_}; + return RD::createObject(std::move(ho)); + }; + std::shared_ptr getHostObject(const jsi::Object& o) override { + Around around{with_}; + return RD::getHostObject(o); + }; + HostFunctionType& getHostFunction(const jsi::Function& f) override { + Around around{with_}; + return RD::getHostFunction(f); + }; + + Value getProperty(const Object& o, const PropNameID& name) override { + Around around{with_}; + return RD::getProperty(o, name); + }; + Value getProperty(const Object& o, const String& name) override { + Around around{with_}; + return RD::getProperty(o, name); + }; + bool hasProperty(const Object& o, const PropNameID& name) override { + Around around{with_}; + return RD::hasProperty(o, name); + }; + bool hasProperty(const Object& o, const String& name) override { + Around around{with_}; + return RD::hasProperty(o, name); + }; + void setPropertyValue(Object& o, const PropNameID& name, const Value& value) + override { + Around around{with_}; + RD::setPropertyValue(o, name, value); + }; + void setPropertyValue(Object& o, const String& name, const Value& value) + override { + Around around{with_}; + RD::setPropertyValue(o, name, value); + }; + + bool isArray(const Object& o) const override { + Around around{with_}; + return RD::isArray(o); + }; + bool isArrayBuffer(const Object& o) const override { + Around around{with_}; + return RD::isArrayBuffer(o); + }; + bool isFunction(const Object& o) const override { + Around around{with_}; + return RD::isFunction(o); + }; + bool isHostObject(const jsi::Object& o) const override { + Around around{with_}; + return RD::isHostObject(o); + }; + bool isHostFunction(const jsi::Function& f) const override { + Around around{with_}; + return RD::isHostFunction(f); + }; + Array getPropertyNames(const Object& o) override { + Around around{with_}; + return RD::getPropertyNames(o); + }; + + WeakObject createWeakObject(const Object& o) override { + Around around{with_}; + return RD::createWeakObject(o); + }; + Value lockWeakObject(WeakObject& wo) override { + Around around{with_}; + return RD::lockWeakObject(wo); + }; + + Array createArray(size_t length) override { + Around around{with_}; + return RD::createArray(length); + }; + size_t size(const Array& a) override { + Around around{with_}; + return RD::size(a); + }; + size_t size(const ArrayBuffer& ab) override { + Around around{with_}; + return RD::size(ab); + }; + uint8_t* data(const ArrayBuffer& ab) override { + Around around{with_}; + return RD::data(ab); + }; + Value getValueAtIndex(const Array& a, size_t i) override { + Around around{with_}; + return RD::getValueAtIndex(a, i); + }; + void setValueAtIndexImpl(Array& a, size_t i, const Value& value) override { + Around around{with_}; + RD::setValueAtIndexImpl(a, i, value); + }; + + Function createFunctionFromHostFunction( + const PropNameID& name, + unsigned int paramCount, + HostFunctionType func) override { + Around around{with_}; + return RD::createFunctionFromHostFunction( + name, paramCount, std::move(func)); + }; + Value call( + const Function& f, + const Value& jsThis, + const Value* args, + size_t count) override { + Around around{with_}; + return RD::call(f, jsThis, args, count); + }; + Value callAsConstructor(const Function& f, const Value* args, size_t count) + override { + Around around{with_}; + return RD::callAsConstructor(f, args, count); + }; + + // Private data for managing scopes. + Runtime::ScopeState* pushScope() override { + Around around{with_}; + return RD::pushScope(); + } + void popScope(Runtime::ScopeState* ss) override { + Around around{with_}; + RD::popScope(ss); + } + + bool strictEquals(const Symbol& a, const Symbol& b) const override { + Around around{with_}; + return RD::strictEquals(a, b); + }; + bool strictEquals(const String& a, const String& b) const override { + Around around{with_}; + return RD::strictEquals(a, b); + }; + bool strictEquals(const Object& a, const Object& b) const override { + Around around{with_}; + return RD::strictEquals(a, b); + }; + + bool instanceOf(const Object& o, const Function& f) override { + Around around{with_}; + return RD::instanceOf(o, f); + }; + + private: + // Wrap an RAII type around With& to guarantee after always happens. + struct Around { + Around(With& with) : with_(with) { + detail::BeforeCaller::before(with_); + } + ~Around() { + detail::AfterCaller::after(with_); + } + + With& with_; + }; + + With& with_; +}; + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/instrumentation.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/instrumentation.h new file mode 100644 index 0000000..a337a7a --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/instrumentation.h @@ -0,0 +1,117 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace facebook { +namespace jsi { + +/// Methods for starting and collecting instrumentation, an \c Instrumentation +/// instance is associated with a particular \c Runtime instance, which it +/// controls the instrumentation of. +/// None of these functions should return newly created jsi values, nor should +/// it modify the values of any jsi values in the heap (although GCs are fine). +class JSI_EXPORT Instrumentation { + public: + virtual ~Instrumentation() = default; + + /// Returns GC statistics as a JSON-encoded string, with an object containing + /// "type" and "version" fields outermost. "type" is a string, unique to a + /// particular implementation of \c jsi::Instrumentation, and "version" is a + /// number to indicate any revision to that implementation and its output + /// format. + /// + /// \pre This call can only be made on the instrumentation instance of a + /// runtime initialised to collect GC statistics. + /// + /// \post All cumulative measurements mentioned in the output are accumulated + /// across the entire lifetime of the Runtime. + /// + /// \return the GC statistics collected so far, as a JSON-encoded string. + virtual std::string getRecordedGCStats() = 0; + + /// Request statistics about the current state of the runtime's heap. This + /// function can be called at any time, and should produce information that is + /// correct at the instant it is called (i.e, not stale). + /// + /// \return a map from a string key to a number associated with that + /// statistic. + virtual std::unordered_map getHeapInfo( + bool includeExpensive) = 0; + + /// Perform a full garbage collection. + /// \param cause The cause of this collection, as it should be reported in + /// logs. + virtual void collectGarbage(std::string cause) = 0; + + /// A HeapStatsUpdate is a tuple of the fragment index, the number of objects + /// in that fragment, and the number of bytes used by those objects. + /// A "fragment" is a view of all objects allocated within a time slice. + using HeapStatsUpdate = std::tuple; + + /// Start capturing JS stack-traces for all JS heap allocated objects. These + /// can be accessed via \c ::createSnapshotToFile(). + /// \param fragmentCallback If present, invoke this callback every so often + /// with the most recently seen object ID, and a list of fragments that have + /// been updated. This callback will be invoked on the same thread that the + /// runtime is using. + virtual void startTrackingHeapObjectStackTraces( + std::function stats)> fragmentCallback) = 0; + + /// Stop capture JS stack-traces for JS heap allocated objects. + virtual void stopTrackingHeapObjectStackTraces() = 0; + + /// Start a heap sampling profiler that will sample heap allocations, and the + /// stack trace they were allocated at. Reports a summary of which functions + /// allocated the most. + /// \param samplingInterval The number of bytes allocated to wait between + /// samples. This will be used as the expected value of a poisson + /// distribution. + virtual void startHeapSampling(size_t samplingInterval) = 0; + + /// Turns off the heap sampling profiler previously enabled via + /// \c startHeapSampling. Writes the output of the sampling heap profiler to + /// \p os. The output is a JSON formatted string. + virtual void stopHeapSampling(std::ostream& os) = 0; + + /// Captures the heap to a file + /// + /// \param path to save the heap capture + virtual void createSnapshotToFile(const std::string& path) = 0; + + /// Captures the heap to an output stream + /// + /// \param os output stream to write to. + virtual void createSnapshotToStream(std::ostream& os) = 0; + + /// If the runtime has been created to trace to a temp file, flush + /// any unwritten parts of the trace of bridge traffic to the file, + /// and return the name of the file. Otherwise, return the empty string. + /// Tracing is disabled after this call. + virtual std::string flushAndDisableBridgeTrafficTrace() = 0; + + /// Write basic block profile trace to the given file name. + virtual void writeBasicBlockProfileTraceToFile( + const std::string& fileName) const = 0; + + /// Dump external profiler symbols to the given file name. + virtual void dumpProfilerSymbolsToFile(const std::string& fileName) const = 0; +}; + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsi-inl.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsi-inl.h new file mode 100644 index 0000000..63d4a2f --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsi-inl.h @@ -0,0 +1,316 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +namespace facebook { +namespace jsi { +namespace detail { + +inline Value toValue(Runtime&, std::nullptr_t) { + return Value::null(); +} +inline Value toValue(Runtime&, bool b) { + return Value(b); +} +inline Value toValue(Runtime&, double d) { + return Value(d); +} +inline Value toValue(Runtime&, float f) { + return Value(static_cast(f)); +} +inline Value toValue(Runtime&, int i) { + return Value(i); +} +inline Value toValue(Runtime& runtime, const char* str) { + return String::createFromAscii(runtime, str); +} +inline Value toValue(Runtime& runtime, const std::string& str) { + return String::createFromUtf8(runtime, str); +} +template +inline Value toValue(Runtime& runtime, const T& other) { + static_assert( + std::is_base_of::value, + "This type cannot be converted to Value"); + return Value(runtime, other); +} +inline Value toValue(Runtime& runtime, const Value& value) { + return Value(runtime, value); +} +inline Value&& toValue(Runtime&, Value&& value) { + return std::move(value); +} + +inline PropNameID toPropNameID(Runtime& runtime, const char* name) { + return PropNameID::forAscii(runtime, name); +} +inline PropNameID toPropNameID(Runtime& runtime, const std::string& name) { + return PropNameID::forUtf8(runtime, name); +} +inline PropNameID&& toPropNameID(Runtime&, PropNameID&& name) { + return std::move(name); +} + +void throwJSError(Runtime&, const char* msg); + +} // namespace detail + +template +inline T Runtime::make(Runtime::PointerValue* pv) { + return T(pv); +} + +inline Runtime::PointerValue* Runtime::getPointerValue(jsi::Pointer& pointer) { + return pointer.ptr_; +} + +inline const Runtime::PointerValue* Runtime::getPointerValue( + const jsi::Pointer& pointer) { + return pointer.ptr_; +} + +inline const Runtime::PointerValue* Runtime::getPointerValue( + const jsi::Value& value) { + return value.data_.pointer.ptr_; +} + +inline Value Object::getProperty(Runtime& runtime, const char* name) const { + return getProperty(runtime, String::createFromAscii(runtime, name)); +} + +inline Value Object::getProperty(Runtime& runtime, const String& name) const { + return runtime.getProperty(*this, name); +} + +inline Value Object::getProperty(Runtime& runtime, const PropNameID& name) + const { + return runtime.getProperty(*this, name); +} + +inline bool Object::hasProperty(Runtime& runtime, const char* name) const { + return hasProperty(runtime, String::createFromAscii(runtime, name)); +} + +inline bool Object::hasProperty(Runtime& runtime, const String& name) const { + return runtime.hasProperty(*this, name); +} + +inline bool Object::hasProperty(Runtime& runtime, const PropNameID& name) + const { + return runtime.hasProperty(*this, name); +} + +template +void Object::setProperty(Runtime& runtime, const char* name, T&& value) { + setProperty( + runtime, String::createFromAscii(runtime, name), std::forward(value)); +} + +template +void Object::setProperty(Runtime& runtime, const String& name, T&& value) { + setPropertyValue( + runtime, name, detail::toValue(runtime, std::forward(value))); +} + +template +void Object::setProperty(Runtime& runtime, const PropNameID& name, T&& value) { + setPropertyValue( + runtime, name, detail::toValue(runtime, std::forward(value))); +} + +inline Array Object::getArray(Runtime& runtime) const& { + assert(runtime.isArray(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + return Array(runtime.cloneObject(ptr_)); +} + +inline Array Object::getArray(Runtime& runtime) && { + assert(runtime.isArray(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + Runtime::PointerValue* value = ptr_; + ptr_ = nullptr; + return Array(value); +} + +inline ArrayBuffer Object::getArrayBuffer(Runtime& runtime) const& { + assert(runtime.isArrayBuffer(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + return ArrayBuffer(runtime.cloneObject(ptr_)); +} + +inline ArrayBuffer Object::getArrayBuffer(Runtime& runtime) && { + assert(runtime.isArrayBuffer(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + Runtime::PointerValue* value = ptr_; + ptr_ = nullptr; + return ArrayBuffer(value); +} + +inline Function Object::getFunction(Runtime& runtime) const& { + assert(runtime.isFunction(*this)); + return Function(runtime.cloneObject(ptr_)); +} + +inline Function Object::getFunction(Runtime& runtime) && { + assert(runtime.isFunction(*this)); + (void)runtime; // when assert is disabled we need to mark this as used + Runtime::PointerValue* value = ptr_; + ptr_ = nullptr; + return Function(value); +} + +template +inline bool Object::isHostObject(Runtime& runtime) const { + return runtime.isHostObject(*this) && + std::dynamic_pointer_cast(runtime.getHostObject(*this)); +} + +template <> +inline bool Object::isHostObject(Runtime& runtime) const { + return runtime.isHostObject(*this); +} + +template +inline std::shared_ptr Object::getHostObject(Runtime& runtime) const { + assert(isHostObject(runtime)); + return std::static_pointer_cast(runtime.getHostObject(*this)); +} + +template +inline std::shared_ptr Object::asHostObject(Runtime& runtime) const { + if (!isHostObject(runtime)) { + detail::throwJSError(runtime, "Object is not a HostObject of desired type"); + } + return std::static_pointer_cast(runtime.getHostObject(*this)); +} + +template <> +inline std::shared_ptr Object::getHostObject( + Runtime& runtime) const { + assert(runtime.isHostObject(*this)); + return runtime.getHostObject(*this); +} + +inline Array Object::getPropertyNames(Runtime& runtime) const { + return runtime.getPropertyNames(*this); +} + +inline Value WeakObject::lock(Runtime& runtime) { + return runtime.lockWeakObject(*this); +} + +template +void Array::setValueAtIndex(Runtime& runtime, size_t i, T&& value) { + setValueAtIndexImpl( + runtime, i, detail::toValue(runtime, std::forward(value))); +} + +inline Value Array::getValueAtIndex(Runtime& runtime, size_t i) const { + return runtime.getValueAtIndex(*this, i); +} + +inline Function Function::createFromHostFunction( + Runtime& runtime, + const jsi::PropNameID& name, + unsigned int paramCount, + jsi::HostFunctionType func) { + return runtime.createFunctionFromHostFunction( + name, paramCount, std::move(func)); +} + +inline Value Function::call(Runtime& runtime, const Value* args, size_t count) + const { + return runtime.call(*this, Value::undefined(), args, count); +} + +inline Value Function::call(Runtime& runtime, std::initializer_list args) + const { + return call(runtime, args.begin(), args.size()); +} + +template +inline Value Function::call(Runtime& runtime, Args&&... args) const { + // A more awesome version of this would be able to create raw values + // which can be used directly without wrapping and unwrapping, but + // this will do for now. + return call(runtime, {detail::toValue(runtime, std::forward(args))...}); +} + +inline Value Function::callWithThis( + Runtime& runtime, + const Object& jsThis, + const Value* args, + size_t count) const { + return runtime.call(*this, Value(runtime, jsThis), args, count); +} + +inline Value Function::callWithThis( + Runtime& runtime, + const Object& jsThis, + std::initializer_list args) const { + return callWithThis(runtime, jsThis, args.begin(), args.size()); +} + +template +inline Value Function::callWithThis( + Runtime& runtime, + const Object& jsThis, + Args&&... args) const { + // A more awesome version of this would be able to create raw values + // which can be used directly without wrapping and unwrapping, but + // this will do for now. + return callWithThis( + runtime, jsThis, {detail::toValue(runtime, std::forward(args))...}); +} + +template +inline Array Array::createWithElements(Runtime& runtime, Args&&... args) { + return createWithElements( + runtime, {detail::toValue(runtime, std::forward(args))...}); +} + +template +inline std::vector PropNameID::names( + Runtime& runtime, + Args&&... args) { + return names({detail::toPropNameID(runtime, std::forward(args))...}); +} + +template +inline std::vector PropNameID::names( + PropNameID(&&propertyNames)[N]) { + std::vector result; + result.reserve(N); + for (auto& name : propertyNames) { + result.push_back(std::move(name)); + } + return result; +} + +inline Value Function::callAsConstructor( + Runtime& runtime, + const Value* args, + size_t count) const { + return runtime.callAsConstructor(*this, args, count); +} + +inline Value Function::callAsConstructor( + Runtime& runtime, + std::initializer_list args) const { + return callAsConstructor(runtime, args.begin(), args.size()); +} + +template +inline Value Function::callAsConstructor(Runtime& runtime, Args&&... args) + const { + return callAsConstructor( + runtime, {detail::toValue(runtime, std::forward(args))...}); +} + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsi.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsi.h new file mode 100644 index 0000000..ae64498 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsi.h @@ -0,0 +1,1317 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include + +#ifndef JSI_EXPORT +#ifdef _MSC_VER +#ifdef CREATE_SHARED_LIBRARY +#define JSI_EXPORT __declspec(dllexport) +#else +#define JSI_EXPORT +#endif // CREATE_SHARED_LIBRARY +#else // _MSC_VER +#define JSI_EXPORT __attribute__((visibility("default"))) +#endif // _MSC_VER +#endif // !defined(JSI_EXPORT) + +class FBJSRuntime; +namespace facebook { +namespace jsi { + +class JSI_EXPORT Buffer { + public: + virtual ~Buffer(); + virtual size_t size() const = 0; + virtual const uint8_t* data() const = 0; +}; + +class JSI_EXPORT StringBuffer : public Buffer { + public: + StringBuffer(std::string s) : s_(std::move(s)) {} + size_t size() const override { + return s_.size(); + } + const uint8_t* data() const override { + return reinterpret_cast(s_.data()); + } + + private: + std::string s_; +}; + +/// PreparedJavaScript is a base class representing JavaScript which is in a +/// form optimized for execution, in a runtime-specific way. Construct one via +/// jsi::Runtime::prepareJavaScript(). +/// ** This is an experimental API that is subject to change. ** +class JSI_EXPORT PreparedJavaScript { + protected: + PreparedJavaScript() = default; + + public: + virtual ~PreparedJavaScript() = 0; +}; + +class Runtime; +class Pointer; +class PropNameID; +class Symbol; +class String; +class Object; +class WeakObject; +class Array; +class ArrayBuffer; +class Function; +class Value; +class Instrumentation; +class Scope; +class JSIException; +class JSError; + +/// A function which has this type can be registered as a function +/// callable from JavaScript using Function::createFromHostFunction(). +/// When the function is called, args will point to the arguments, and +/// count will indicate how many arguments are passed. The function +/// can return a Value to the caller, or throw an exception. If a C++ +/// exception is thrown, a JS Error will be created and thrown into +/// JS; if the C++ exception extends std::exception, the Error's +/// message will be whatever what() returns. Note that it is undefined whether +/// HostFunctions may or may not be called in strict mode; that is `thisVal` +/// can be any value - it will not necessarily be coerced to an object or +/// or set to the global object. +using HostFunctionType = std::function< + Value(Runtime& rt, const Value& thisVal, const Value* args, size_t count)>; + +/// An object which implements this interface can be registered as an +/// Object with the JS runtime. +class JSI_EXPORT HostObject { + public: + // The C++ object's dtor will be called when the GC finalizes this + // object. (This may be as late as when the Runtime is shut down.) + // You have no control over which thread it is called on. This will + // be called from inside the GC, so it is unsafe to do any VM + // operations which require a Runtime&. Derived classes' dtors + // should also avoid doing anything expensive. Calling the dtor on + // a jsi object is explicitly ok. If you want to do JS operations, + // or any nontrivial work, you should add it to a work queue, and + // manage it externally. + virtual ~HostObject(); + + // When JS wants a property with a given name from the HostObject, + // it will call this method. If it throws an exception, the call + // will throw a JS \c Error object. By default this returns undefined. + // \return the value for the property. + virtual Value get(Runtime&, const PropNameID& name); + + // When JS wants to set a property with a given name on the HostObject, + // it will call this method. If it throws an exception, the call will + // throw a JS \c Error object. By default this throws a type error exception + // mimicking the behavior of a frozen object in strict mode. + virtual void set(Runtime&, const PropNameID& name, const Value& value); + + // When JS wants a list of property names for the HostObject, it will + // call this method. If it throws an exception, the call will throw a + // JS \c Error object. The default implementation returns empty vector. + virtual std::vector getPropertyNames(Runtime& rt); +}; + +/// Represents a JS runtime. Movable, but not copyable. Note that +/// this object may not be thread-aware, but cannot be used safely from +/// multiple threads at once. The application is responsible for +/// ensuring that it is used safely. This could mean using the +/// Runtime from a single thread, using a mutex, doing all work on a +/// serial queue, etc. This restriction applies to the methods of +/// this class, and any method in the API which take a Runtime& as an +/// argument. Destructors (all but ~Scope), operators, or other methods +/// which do not take Runtime& as an argument are safe to call from any +/// thread, but it is still forbidden to make write operations on a single +/// instance of any class from more than one thread. In addition, to +/// make shutdown safe, destruction of objects associated with the Runtime +/// must be destroyed before the Runtime is destroyed, or from the +/// destructor of a managed HostObject or HostFunction. Informally, this +/// means that the main source of unsafe behavior is to hold a jsi object +/// in a non-Runtime-managed object, and not clean it up before the Runtime +/// is shut down. If your lifecycle is such that avoiding this is hard, +/// you will probably need to do use your own locks. +class JSI_EXPORT Runtime { + public: + virtual ~Runtime(); + + /// Evaluates the given JavaScript \c buffer. \c sourceURL is used + /// to annotate the stack trace if there is an exception. The + /// contents may be utf8-encoded JS source code, or binary bytecode + /// whose format is specific to the implementation. If the input + /// format is unknown, or evaluation causes an error, a JSIException + /// will be thrown. + /// Note this function should ONLY be used when there isn't another means + /// through the JSI API. For example, it will be much slower to use this to + /// call a global function than using the JSI APIs to read the function + /// property from the global object and then calling it explicitly. + virtual Value evaluateJavaScript( + const std::shared_ptr& buffer, + const std::string& sourceURL) = 0; + + /// Prepares to evaluate the given JavaScript \c buffer by processing it into + /// a form optimized for execution. This may include pre-parsing, compiling, + /// etc. If the input is invalid (for example, cannot be parsed), a + /// JSIException will be thrown. The resulting object is tied to the + /// particular concrete type of Runtime from which it was created. It may be + /// used (via evaluatePreparedJavaScript) in any Runtime of the same concrete + /// type. + /// The PreparedJavaScript object may be passed to multiple VM instances, so + /// they can all share and benefit from the prepared script. + /// As with evaluateJavaScript(), using JavaScript code should be avoided + /// when the JSI API is sufficient. + virtual std::shared_ptr prepareJavaScript( + const std::shared_ptr& buffer, + std::string sourceURL) = 0; + + /// Evaluates a PreparedJavaScript. If evaluation causes an error, a + /// JSIException will be thrown. + /// As with evaluateJavaScript(), using JavaScript code should be avoided + /// when the JSI API is sufficient. + virtual Value evaluatePreparedJavaScript( + const std::shared_ptr& js) = 0; + + /// Drain the JavaScript VM internal Microtask (a.k.a. Job in ECMA262) queue. + /// + /// \param maxMicrotasksHint a hint to tell an implementation that it should + /// make a best effort not execute more than the given number. It's default + /// to -1 for infinity (unbounded execution). + /// \return true if the queue is drained or false if there is more work to do. + /// + /// When there were exceptions thrown from the execution of microtasks, + /// implementations shall discard the exceptional jobs. An implementation may + /// \throw a \c JSError object to signal the hosts to handle. In that case, an + /// implementation may or may not suspend the draining. + /// + /// Hosts may call this function again to resume the draining if it was + /// suspended due to either exceptions or the \p maxMicrotasksHint bound. + /// E.g. a host may repetitively invoke this function until the queue is + /// drained to implement the "microtask checkpint" defined in WHATWG HTML + /// event loop: https://html.spec.whatwg.org/C#perform-a-microtask-checkpoint. + /// + /// Note that error propagation is only a concern if a host needs to implement + /// `queueMicrotask`, a recent API that allows enqueueing aribitary functions + /// (hence may throw) as microtasks. Exceptions from ECMA-262 Promise Jobs are + /// handled internally to VMs and are never propagrated to hosts. + /// + /// This API offers some queue management to hosts at its best effort due to + /// different behaviors and limitations imposed by different VMs and APIs. By + /// the time this is written, An implementation may swallow exceptions (JSC), + /// may not pause (V8), and may not support bounded executions. + virtual bool drainMicrotasks(int maxMicrotasksHint = -1) = 0; + + /// \return the global object + virtual Object global() = 0; + + /// \return a short printable description of the instance. It should + /// at least include some human-readable indication of the runtime + /// implementation. This should only be used by logging, debugging, + /// and other developer-facing callers. + virtual std::string description() = 0; + + /// \return whether or not the underlying runtime supports debugging via the + /// Chrome remote debugging protocol. + /// + /// NOTE: the API for determining whether a runtime is debuggable and + /// registering a runtime with the debugger is still in flux, so please don't + /// use this API unless you know what you're doing. + virtual bool isInspectable() = 0; + + /// \return an interface to extract metrics from this \c Runtime. The default + /// implementation of this function returns an \c Instrumentation instance + /// which returns no metrics. + virtual Instrumentation& instrumentation(); + + protected: + friend class Pointer; + friend class PropNameID; + friend class Symbol; + friend class String; + friend class Object; + friend class WeakObject; + friend class Array; + friend class ArrayBuffer; + friend class Function; + friend class Value; + friend class Scope; + friend class JSError; + + // Potential optimization: avoid the cloneFoo() virtual dispatch, + // and instead just fix the number of fields, and copy them, since + // in practice they are trivially copyable. Sufficient use of + // rvalue arguments/methods would also reduce the number of clones. + + struct PointerValue { + virtual void invalidate() = 0; + + protected: + virtual ~PointerValue() = default; + }; + + virtual PointerValue* cloneSymbol(const Runtime::PointerValue* pv) = 0; + virtual PointerValue* cloneString(const Runtime::PointerValue* pv) = 0; + virtual PointerValue* cloneObject(const Runtime::PointerValue* pv) = 0; + virtual PointerValue* clonePropNameID(const Runtime::PointerValue* pv) = 0; + + virtual PropNameID createPropNameIDFromAscii( + const char* str, + size_t length) = 0; + virtual PropNameID createPropNameIDFromUtf8( + const uint8_t* utf8, + size_t length) = 0; + virtual PropNameID createPropNameIDFromString(const String& str) = 0; + virtual std::string utf8(const PropNameID&) = 0; + virtual bool compare(const PropNameID&, const PropNameID&) = 0; + + virtual std::string symbolToString(const Symbol&) = 0; + + virtual String createStringFromAscii(const char* str, size_t length) = 0; + virtual String createStringFromUtf8(const uint8_t* utf8, size_t length) = 0; + virtual std::string utf8(const String&) = 0; + + // \return a \c Value created from a utf8-encoded JSON string. The default + // implementation creates a \c String and invokes JSON.parse. + virtual Value createValueFromJsonUtf8(const uint8_t* json, size_t length); + + virtual Object createObject() = 0; + virtual Object createObject(std::shared_ptr ho) = 0; + virtual std::shared_ptr getHostObject(const jsi::Object&) = 0; + virtual HostFunctionType& getHostFunction(const jsi::Function&) = 0; + + virtual Value getProperty(const Object&, const PropNameID& name) = 0; + virtual Value getProperty(const Object&, const String& name) = 0; + virtual bool hasProperty(const Object&, const PropNameID& name) = 0; + virtual bool hasProperty(const Object&, const String& name) = 0; + virtual void + setPropertyValue(Object&, const PropNameID& name, const Value& value) = 0; + virtual void + setPropertyValue(Object&, const String& name, const Value& value) = 0; + + virtual bool isArray(const Object&) const = 0; + virtual bool isArrayBuffer(const Object&) const = 0; + virtual bool isFunction(const Object&) const = 0; + virtual bool isHostObject(const jsi::Object&) const = 0; + virtual bool isHostFunction(const jsi::Function&) const = 0; + virtual Array getPropertyNames(const Object&) = 0; + + virtual WeakObject createWeakObject(const Object&) = 0; + virtual Value lockWeakObject(WeakObject&) = 0; + + virtual Array createArray(size_t length) = 0; + virtual size_t size(const Array&) = 0; + virtual size_t size(const ArrayBuffer&) = 0; + virtual uint8_t* data(const ArrayBuffer&) = 0; + virtual Value getValueAtIndex(const Array&, size_t i) = 0; + virtual void setValueAtIndexImpl(Array&, size_t i, const Value& value) = 0; + + virtual Function createFunctionFromHostFunction( + const PropNameID& name, + unsigned int paramCount, + HostFunctionType func) = 0; + virtual Value call( + const Function&, + const Value& jsThis, + const Value* args, + size_t count) = 0; + virtual Value + callAsConstructor(const Function&, const Value* args, size_t count) = 0; + + // Private data for managing scopes. + struct ScopeState; + virtual ScopeState* pushScope(); + virtual void popScope(ScopeState*); + + virtual bool strictEquals(const Symbol& a, const Symbol& b) const = 0; + virtual bool strictEquals(const String& a, const String& b) const = 0; + virtual bool strictEquals(const Object& a, const Object& b) const = 0; + + virtual bool instanceOf(const Object& o, const Function& f) = 0; + + // These exist so derived classes can access the private parts of + // Value, Symbol, String, and Object, which are all friends of Runtime. + template + static T make(PointerValue* pv); + static PointerValue* getPointerValue(Pointer& pointer); + static const PointerValue* getPointerValue(const Pointer& pointer); + static const PointerValue* getPointerValue(const Value& value); + + friend class ::FBJSRuntime; + template + friend class RuntimeDecorator; +}; + +// Base class for pointer-storing types. +class JSI_EXPORT Pointer { + protected: + explicit Pointer(Pointer&& other) : ptr_(other.ptr_) { + other.ptr_ = nullptr; + } + + ~Pointer() { + if (ptr_) { + ptr_->invalidate(); + } + } + + Pointer& operator=(Pointer&& other); + + friend class Runtime; + friend class Value; + + explicit Pointer(Runtime::PointerValue* ptr) : ptr_(ptr) {} + + typename Runtime::PointerValue* ptr_; +}; + +/// Represents something that can be a JS property key. Movable, not copyable. +class JSI_EXPORT PropNameID : public Pointer { + public: + using Pointer::Pointer; + + PropNameID(Runtime& runtime, const PropNameID& other) + : Pointer(runtime.clonePropNameID(other.ptr_)) {} + + PropNameID(PropNameID&& other) = default; + PropNameID& operator=(PropNameID&& other) = default; + + /// Create a JS property name id from ascii values. The data is + /// copied. + static PropNameID forAscii(Runtime& runtime, const char* str, size_t length) { + return runtime.createPropNameIDFromAscii(str, length); + } + + /// Create a property name id from a nul-terminated C ascii name. The data is + /// copied. + static PropNameID forAscii(Runtime& runtime, const char* str) { + return forAscii(runtime, str, strlen(str)); + } + + /// Create a PropNameID from a C++ string. The string is copied. + static PropNameID forAscii(Runtime& runtime, const std::string& str) { + return forAscii(runtime, str.c_str(), str.size()); + } + + /// Create a PropNameID from utf8 values. The data is copied. + static PropNameID + forUtf8(Runtime& runtime, const uint8_t* utf8, size_t length) { + return runtime.createPropNameIDFromUtf8(utf8, length); + } + + /// Create a PropNameID from utf8-encoded octets stored in a + /// std::string. The string data is transformed and copied. + static PropNameID forUtf8(Runtime& runtime, const std::string& utf8) { + return runtime.createPropNameIDFromUtf8( + reinterpret_cast(utf8.data()), utf8.size()); + } + + /// Create a PropNameID from a JS string. + static PropNameID forString(Runtime& runtime, const jsi::String& str) { + return runtime.createPropNameIDFromString(str); + } + + // Creates a vector of PropNameIDs constructed from given arguments. + template + static std::vector names(Runtime& runtime, Args&&... args); + + // Creates a vector of given PropNameIDs. + template + static std::vector names(PropNameID(&&propertyNames)[N]); + + /// Copies the data in a PropNameID as utf8 into a C++ string. + std::string utf8(Runtime& runtime) const { + return runtime.utf8(*this); + } + + static bool compare( + Runtime& runtime, + const jsi::PropNameID& a, + const jsi::PropNameID& b) { + return runtime.compare(a, b); + } + + friend class Runtime; + friend class Value; +}; + +/// Represents a JS Symbol (es6). Movable, not copyable. +/// TODO T40778724: this is a limited implementation sufficient for +/// the debugger not to crash when a Symbol is a property in an Object +/// or element in an array. Complete support for creating will come +/// later. +class JSI_EXPORT Symbol : public Pointer { + public: + using Pointer::Pointer; + + Symbol(Symbol&& other) = default; + Symbol& operator=(Symbol&& other) = default; + + /// \return whether a and b refer to the same symbol. + static bool strictEquals(Runtime& runtime, const Symbol& a, const Symbol& b) { + return runtime.strictEquals(a, b); + } + + /// Converts a Symbol into a C++ string as JS .toString would. The output + /// will look like \c Symbol(description) . + std::string toString(Runtime& runtime) const { + return runtime.symbolToString(*this); + } + + friend class Runtime; + friend class Value; +}; + +/// Represents a JS String. Movable, not copyable. +class JSI_EXPORT String : public Pointer { + public: + using Pointer::Pointer; + + String(String&& other) = default; + String& operator=(String&& other) = default; + + /// Create a JS string from ascii values. The string data is + /// copied. + static String + createFromAscii(Runtime& runtime, const char* str, size_t length) { + return runtime.createStringFromAscii(str, length); + } + + /// Create a JS string from a nul-terminated C ascii string. The + /// string data is copied. + static String createFromAscii(Runtime& runtime, const char* str) { + return createFromAscii(runtime, str, strlen(str)); + } + + /// Create a JS string from a C++ string. The string data is + /// copied. + static String createFromAscii(Runtime& runtime, const std::string& str) { + return createFromAscii(runtime, str.c_str(), str.size()); + } + + /// Create a JS string from utf8-encoded octets. The string data is + /// transformed and copied. + static String + createFromUtf8(Runtime& runtime, const uint8_t* utf8, size_t length) { + return runtime.createStringFromUtf8(utf8, length); + } + + /// Create a JS string from utf8-encoded octets stored in a + /// std::string. The string data is transformed and copied. + static String createFromUtf8(Runtime& runtime, const std::string& utf8) { + return runtime.createStringFromUtf8( + reinterpret_cast(utf8.data()), utf8.length()); + } + + /// \return whether a and b contain the same characters. + static bool strictEquals(Runtime& runtime, const String& a, const String& b) { + return runtime.strictEquals(a, b); + } + + /// Copies the data in a JS string as utf8 into a C++ string. + std::string utf8(Runtime& runtime) const { + return runtime.utf8(*this); + } + + friend class Runtime; + friend class Value; +}; + +class Array; +class Function; + +/// Represents a JS Object. Movable, not copyable. +class JSI_EXPORT Object : public Pointer { + public: + using Pointer::Pointer; + + Object(Object&& other) = default; + Object& operator=(Object&& other) = default; + + /// Creates a new Object instance, like '{}' in JS. + Object(Runtime& runtime) : Object(runtime.createObject()) {} + + static Object createFromHostObject( + Runtime& runtime, + std::shared_ptr ho) { + return runtime.createObject(ho); + } + + /// \return whether this and \c obj are the same JSObject or not. + static bool strictEquals(Runtime& runtime, const Object& a, const Object& b) { + return runtime.strictEquals(a, b); + } + + /// \return the result of `this instanceOf ctor` in JS. + bool instanceOf(Runtime& rt, const Function& ctor) { + return rt.instanceOf(*this, ctor); + } + + /// \return the property of the object with the given ascii name. + /// If the name isn't a property on the object, returns the + /// undefined value. + Value getProperty(Runtime& runtime, const char* name) const; + + /// \return the property of the object with the String name. + /// If the name isn't a property on the object, returns the + /// undefined value. + Value getProperty(Runtime& runtime, const String& name) const; + + /// \return the property of the object with the given JS PropNameID + /// name. If the name isn't a property on the object, returns the + /// undefined value. + Value getProperty(Runtime& runtime, const PropNameID& name) const; + + /// \return true if and only if the object has a property with the + /// given ascii name. + bool hasProperty(Runtime& runtime, const char* name) const; + + /// \return true if and only if the object has a property with the + /// given String name. + bool hasProperty(Runtime& runtime, const String& name) const; + + /// \return true if and only if the object has a property with the + /// given PropNameID name. + bool hasProperty(Runtime& runtime, const PropNameID& name) const; + + /// Sets the property value from a Value or anything which can be + /// used to make one: nullptr_t, bool, double, int, const char*, + /// String, or Object. + template + void setProperty(Runtime& runtime, const char* name, T&& value); + + /// Sets the property value from a Value or anything which can be + /// used to make one: nullptr_t, bool, double, int, const char*, + /// String, or Object. + template + void setProperty(Runtime& runtime, const String& name, T&& value); + + /// Sets the property value from a Value or anything which can be + /// used to make one: nullptr_t, bool, double, int, const char*, + /// String, or Object. + template + void setProperty(Runtime& runtime, const PropNameID& name, T&& value); + + /// \return true iff JS \c Array.isArray() would return \c true. If + /// so, then \c getArray() will succeed. + bool isArray(Runtime& runtime) const { + return runtime.isArray(*this); + } + + /// \return true iff the Object is an ArrayBuffer. If so, then \c + /// getArrayBuffer() will succeed. + bool isArrayBuffer(Runtime& runtime) const { + return runtime.isArrayBuffer(*this); + } + + /// \return true iff the Object is callable. If so, then \c + /// getFunction will succeed. + bool isFunction(Runtime& runtime) const { + return runtime.isFunction(*this); + } + + /// \return true iff the Object was initialized with \c createFromHostObject + /// and the HostObject passed is of type \c T. If returns \c true then + /// \c getHostObject will succeed. + template + bool isHostObject(Runtime& runtime) const; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will assert. + Array getArray(Runtime& runtime) const&; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will assert. + Array getArray(Runtime& runtime) &&; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will throw + /// JSIException. + Array asArray(Runtime& runtime) const&; + + /// \return an Array instance which refers to the same underlying + /// object. If \c isArray() would return false, this will throw + /// JSIException. + Array asArray(Runtime& runtime) &&; + + /// \return an ArrayBuffer instance which refers to the same underlying + /// object. If \c isArrayBuffer() would return false, this will assert. + ArrayBuffer getArrayBuffer(Runtime& runtime) const&; + + /// \return an ArrayBuffer instance which refers to the same underlying + /// object. If \c isArrayBuffer() would return false, this will assert. + ArrayBuffer getArrayBuffer(Runtime& runtime) &&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will assert. + Function getFunction(Runtime& runtime) const&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will assert. + Function getFunction(Runtime& runtime) &&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will throw + /// JSIException. + Function asFunction(Runtime& runtime) const&; + + /// \return a Function instance which refers to the same underlying + /// object. If \c isFunction() would return false, this will throw + /// JSIException. + Function asFunction(Runtime& runtime) &&; + + /// \return a shared_ptr which refers to the same underlying + /// \c HostObject that was used to create this object. If \c isHostObject + /// is false, this will assert. Note that this does a type check and will + /// assert if the underlying HostObject isn't of type \c T + template + std::shared_ptr getHostObject(Runtime& runtime) const; + + /// \return a shared_ptr which refers to the same underlying + /// \c HostObject that was used to crete this object. If \c isHostObject + /// is false, this will throw. + template + std::shared_ptr asHostObject(Runtime& runtime) const; + + /// \return same as \c getProperty(name).asObject(), except with + /// a better exception message. + Object getPropertyAsObject(Runtime& runtime, const char* name) const; + + /// \return similar to \c + /// getProperty(name).getObject().getFunction(), except it will + /// throw JSIException instead of asserting if the property is + /// not an object, or the object is not callable. + Function getPropertyAsFunction(Runtime& runtime, const char* name) const; + + /// \return an Array consisting of all enumerable property names in + /// the object and its prototype chain. All values in the return + /// will be isString(). (This is probably not optimal, but it + /// works. I only need it in one place.) + Array getPropertyNames(Runtime& runtime) const; + + protected: + void + setPropertyValue(Runtime& runtime, const String& name, const Value& value) { + return runtime.setPropertyValue(*this, name, value); + } + + void setPropertyValue( + Runtime& runtime, + const PropNameID& name, + const Value& value) { + return runtime.setPropertyValue(*this, name, value); + } + + friend class Runtime; + friend class Value; +}; + +/// Represents a weak reference to a JS Object. If the only reference +/// to an Object are these, the object is eligible for GC. Method +/// names are inspired by C++ weak_ptr. Movable, not copyable. +class JSI_EXPORT WeakObject : public Pointer { + public: + using Pointer::Pointer; + + WeakObject(WeakObject&& other) = default; + WeakObject& operator=(WeakObject&& other) = default; + + /// Create a WeakObject from an Object. + WeakObject(Runtime& runtime, const Object& o) + : WeakObject(runtime.createWeakObject(o)) {} + + /// \return a Value representing the underlying Object if it is still valid; + /// otherwise returns \c undefined. Note that this method has nothing to do + /// with threads or concurrency. The name is based on std::weak_ptr::lock() + /// which serves a similar purpose. + Value lock(Runtime& runtime); + + friend class Runtime; +}; + +/// Represents a JS Object which can be efficiently used as an array +/// with integral indices. +class JSI_EXPORT Array : public Object { + public: + Array(Array&&) = default; + /// Creates a new Array instance, with \c length undefined elements. + Array(Runtime& runtime, size_t length) : Array(runtime.createArray(length)) {} + + Array& operator=(Array&&) = default; + + /// \return the size of the Array, according to its length property. + /// (C++ naming convention) + size_t size(Runtime& runtime) const { + return runtime.size(*this); + } + + /// \return the size of the Array, according to its length property. + /// (JS naming convention) + size_t length(Runtime& runtime) const { + return size(runtime); + } + + /// \return the property of the array at index \c i. If there is no + /// such property, returns the undefined value. If \c i is out of + /// range [ 0..\c length ] throws a JSIException. + Value getValueAtIndex(Runtime& runtime, size_t i) const; + + /// Sets the property of the array at index \c i. The argument + /// value behaves as with Object::setProperty(). If \c i is out of + /// range [ 0..\c length ] throws a JSIException. + template + void setValueAtIndex(Runtime& runtime, size_t i, T&& value); + + /// There is no current API for changing the size of an array once + /// created. We'll probably need that eventually. + + /// Creates a new Array instance from provided values + template + static Array createWithElements(Runtime&, Args&&... args); + + /// Creates a new Array instance from initializer list. + static Array createWithElements( + Runtime& runtime, + std::initializer_list elements); + + private: + friend class Object; + friend class Value; + + void setValueAtIndexImpl(Runtime& runtime, size_t i, const Value& value) { + return runtime.setValueAtIndexImpl(*this, i, value); + } + + Array(Runtime::PointerValue* value) : Object(value) {} +}; + +/// Represents a JSArrayBuffer +class JSI_EXPORT ArrayBuffer : public Object { + public: + ArrayBuffer(ArrayBuffer&&) = default; + ArrayBuffer& operator=(ArrayBuffer&&) = default; + + /// \return the size of the ArrayBuffer, according to its byteLength property. + /// (C++ naming convention) + size_t size(Runtime& runtime) const { + return runtime.size(*this); + } + + size_t length(Runtime& runtime) const { + return runtime.size(*this); + } + + uint8_t* data(Runtime& runtime) { + return runtime.data(*this); + } + + private: + friend class Object; + friend class Value; + + ArrayBuffer(Runtime::PointerValue* value) : Object(value) {} +}; + +/// Represents a JS Object which is guaranteed to be Callable. +class JSI_EXPORT Function : public Object { + public: + Function(Function&&) = default; + Function& operator=(Function&&) = default; + + /// Create a function which, when invoked, calls C++ code. If the + /// function throws an exception, a JS Error will be created and + /// thrown. + /// \param name the name property for the function. + /// \param paramCount the length property for the function, which + /// may not be the number of arguments the function is passed. + static Function createFromHostFunction( + Runtime& runtime, + const jsi::PropNameID& name, + unsigned int paramCount, + jsi::HostFunctionType func); + + /// Calls the function with \c count \c args. The \c this value of the JS + /// function will not be set by the C++ caller, similar to calling + /// Function.prototype.apply(undefined, args) in JS. + /// \b Note: as with Function.prototype.apply, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. + Value call(Runtime& runtime, const Value* args, size_t count) const; + + /// Calls the function with a \c std::initializer_list of Value + /// arguments. The \c this value of the JS function will not be set by the + /// C++ caller, similar to calling Function.prototype.apply(undefined, args) + /// in JS. + /// \b Note: as with Function.prototype.apply, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. + Value call(Runtime& runtime, std::initializer_list args) const; + + /// Calls the function with any number of arguments similarly to + /// Object::setProperty(). The \c this value of the JS function will not be + /// set by the C++ caller, similar to calling + /// Function.prototype.call(undefined, ...args) in JS. + /// \b Note: as with Function.prototype.call, \c this may not always be + /// \c undefined in the function itself. If the function is non-strict, + /// \c this will be set to the global object. + template + Value call(Runtime& runtime, Args&&... args) const; + + /// Calls the function with \c count \c args and \c jsThis value passed + /// as the \c this value. + Value callWithThis( + Runtime& Runtime, + const Object& jsThis, + const Value* args, + size_t count) const; + + /// Calls the function with a \c std::initializer_list of Value + /// arguments and \c jsThis passed as the \c this value. + Value callWithThis( + Runtime& runtime, + const Object& jsThis, + std::initializer_list args) const; + + /// Calls the function with any number of arguments similarly to + /// Object::setProperty(), and with \c jsThis passed as the \c this value. + template + Value callWithThis(Runtime& runtime, const Object& jsThis, Args&&... args) + const; + + /// Calls the function as a constructor with \c count \c args. Equivalent + /// to calling `new Func` where `Func` is the js function reqresented by + /// this. + Value callAsConstructor(Runtime& runtime, const Value* args, size_t count) + const; + + /// Same as above `callAsConstructor`, except use an initializer_list to + /// supply the arguments. + Value callAsConstructor(Runtime& runtime, std::initializer_list args) + const; + + /// Same as above `callAsConstructor`, but automatically converts/wraps + /// any argument with a jsi Value. + template + Value callAsConstructor(Runtime& runtime, Args&&... args) const; + + /// Returns whether this was created with Function::createFromHostFunction. + /// If true then you can use getHostFunction to get the underlying + /// HostFunctionType. + bool isHostFunction(Runtime& runtime) const { + return runtime.isHostFunction(*this); + } + + /// Returns the underlying HostFunctionType iff isHostFunction returns true + /// and asserts otherwise. You can use this to use std::function<>::target + /// to get the object that was passed to create the HostFunctionType. + /// + /// Note: The reference returned is borrowed from the JS object underlying + /// \c this, and thus only lasts as long as the object underlying + /// \c this does. + HostFunctionType& getHostFunction(Runtime& runtime) const { + assert(isHostFunction(runtime)); + return runtime.getHostFunction(*this); + } + + private: + friend class Object; + friend class Value; + + Function(Runtime::PointerValue* value) : Object(value) {} +}; + +/// Represents any JS Value (undefined, null, boolean, number, symbol, +/// string, or object). Movable, or explicitly copyable (has no copy +/// ctor). +class JSI_EXPORT Value { + public: + /// Default ctor creates an \c undefined JS value. + Value() : Value(UndefinedKind) {} + + /// Creates a \c null JS value. + /* implicit */ Value(std::nullptr_t) : kind_(NullKind) {} + + /// Creates a boolean JS value. + /* implicit */ Value(bool b) : Value(BooleanKind) { + data_.boolean = b; + } + + /// Creates a number JS value. + /* implicit */ Value(double d) : Value(NumberKind) { + data_.number = d; + } + + /// Creates a number JS value. + /* implicit */ Value(int i) : Value(NumberKind) { + data_.number = i; + } + + /// Moves a Symbol, String, or Object rvalue into a new JS value. + template + /* implicit */ Value(T&& other) : Value(kindOf(other)) { + static_assert( + std::is_base_of::value || + std::is_base_of::value || + std::is_base_of::value, + "Value cannot be implicitly move-constructed from this type"); + new (&data_.pointer) T(std::move(other)); + } + + /// Value("foo") will treat foo as a bool. This makes doing that a + /// compile error. + template + Value(const char*) { + static_assert( + !std::is_same::value, + "Value cannot be constructed directly from const char*"); + } + + Value(Value&& value); + + /// Copies a Symbol lvalue into a new JS value. + Value(Runtime& runtime, const Symbol& sym) : Value(SymbolKind) { + new (&data_.pointer) String(runtime.cloneSymbol(sym.ptr_)); + } + + /// Copies a String lvalue into a new JS value. + Value(Runtime& runtime, const String& str) : Value(StringKind) { + new (&data_.pointer) String(runtime.cloneString(str.ptr_)); + } + + /// Copies a Object lvalue into a new JS value. + Value(Runtime& runtime, const Object& obj) : Value(ObjectKind) { + new (&data_.pointer) Object(runtime.cloneObject(obj.ptr_)); + } + + /// Creates a JS value from another Value lvalue. + Value(Runtime& runtime, const Value& value); + + /// Value(rt, "foo") will treat foo as a bool. This makes doing + /// that a compile error. + template + Value(Runtime&, const char*) { + static_assert( + !std::is_same::value, + "Value cannot be constructed directly from const char*"); + } + + ~Value(); + // \return the undefined \c Value. + static Value undefined() { + return Value(); + } + + // \return the null \c Value. + static Value null() { + return Value(nullptr); + } + + // \return a \c Value created from a utf8-encoded JSON string. + static Value + createFromJsonUtf8(Runtime& runtime, const uint8_t* json, size_t length) { + return runtime.createValueFromJsonUtf8(json, length); + } + + /// \return according to the Strict Equality Comparison algorithm, see: + /// https://262.ecma-international.org/11.0/#sec-strict-equality-comparison + static bool strictEquals(Runtime& runtime, const Value& a, const Value& b); + + Value& operator=(Value&& other) { + this->~Value(); + new (this) Value(std::move(other)); + return *this; + } + + bool isUndefined() const { + return kind_ == UndefinedKind; + } + + bool isNull() const { + return kind_ == NullKind; + } + + bool isBool() const { + return kind_ == BooleanKind; + } + + bool isNumber() const { + return kind_ == NumberKind; + } + + bool isString() const { + return kind_ == StringKind; + } + + bool isSymbol() const { + return kind_ == SymbolKind; + } + + bool isObject() const { + return kind_ == ObjectKind; + } + + /// \return the boolean value, or asserts if not a boolean. + bool getBool() const { + assert(isBool()); + return data_.boolean; + } + + /// \return the number value, or asserts if not a number. + double getNumber() const { + assert(isNumber()); + return data_.number; + } + + /// \return the number value, or throws JSIException if not a + /// number. + double asNumber() const; + + /// \return the Symbol value, or asserts if not a symbol. + Symbol getSymbol(Runtime& runtime) const& { + assert(isSymbol()); + return Symbol(runtime.cloneSymbol(data_.pointer.ptr_)); + } + + /// \return the Symbol value, or asserts if not a symbol. + /// Can be used on rvalue references to avoid cloning more symbols. + Symbol getSymbol(Runtime&) && { + assert(isSymbol()); + auto ptr = data_.pointer.ptr_; + data_.pointer.ptr_ = nullptr; + return static_cast(ptr); + } + + /// \return the Symbol value, or throws JSIException if not a + /// symbol + Symbol asSymbol(Runtime& runtime) const&; + Symbol asSymbol(Runtime& runtime) &&; + + /// \return the String value, or asserts if not a string. + String getString(Runtime& runtime) const& { + assert(isString()); + return String(runtime.cloneString(data_.pointer.ptr_)); + } + + /// \return the String value, or asserts if not a string. + /// Can be used on rvalue references to avoid cloning more strings. + String getString(Runtime&) && { + assert(isString()); + auto ptr = data_.pointer.ptr_; + data_.pointer.ptr_ = nullptr; + return static_cast(ptr); + } + + /// \return the String value, or throws JSIException if not a + /// string. + String asString(Runtime& runtime) const&; + String asString(Runtime& runtime) &&; + + /// \return the Object value, or asserts if not an object. + Object getObject(Runtime& runtime) const& { + assert(isObject()); + return Object(runtime.cloneObject(data_.pointer.ptr_)); + } + + /// \return the Object value, or asserts if not an object. + /// Can be used on rvalue references to avoid cloning more objects. + Object getObject(Runtime&) && { + assert(isObject()); + auto ptr = data_.pointer.ptr_; + data_.pointer.ptr_ = nullptr; + return static_cast(ptr); + } + + /// \return the Object value, or throws JSIException if not an + /// object. + Object asObject(Runtime& runtime) const&; + Object asObject(Runtime& runtime) &&; + + // \return a String like JS .toString() would do. + String toString(Runtime& runtime) const; + + private: + friend class Runtime; + + enum ValueKind { + UndefinedKind, + NullKind, + BooleanKind, + NumberKind, + SymbolKind, + StringKind, + ObjectKind, + PointerKind = SymbolKind, + }; + + union Data { + // Value's ctor and dtor will manage the lifecycle of the contained Data. + Data() { + static_assert( + sizeof(Data) == sizeof(uint64_t), + "Value data should fit in a 64-bit register"); + } + ~Data() {} + + // scalars + bool boolean; + double number; + // pointers + Pointer pointer; // Symbol, String, Object, Array, Function + }; + + Value(ValueKind kind) : kind_(kind) {} + + constexpr static ValueKind kindOf(const Symbol&) { + return SymbolKind; + } + constexpr static ValueKind kindOf(const String&) { + return StringKind; + } + constexpr static ValueKind kindOf(const Object&) { + return ObjectKind; + } + + ValueKind kind_; + Data data_; + + // In the future: Value becomes NaN-boxed. See T40538354. +}; + +/// Not movable and not copyable RAII marker advising the underlying +/// JavaScript VM to track resources allocated since creation until +/// destruction so that they can be recycled eagerly when the Scope +/// goes out of scope instead of floating in the air until the next +/// garbage collection or any other delayed release occurs. +/// +/// This API should be treated only as advice, implementations can +/// choose to ignore the fact that Scopes are created or destroyed. +/// +/// This class is an exception to the rule allowing destructors to be +/// called without proper synchronization (see Runtime documentation). +/// The whole point of this class is to enable all sorts of clean ups +/// when the destructor is called and this proper synchronization is +/// required at that time. +/// +/// Instances of this class are intended to be created as automatic stack +/// variables in which case destructor calls don't require any additional +/// locking, provided that the lock (if any) is managed with RAII helpers. +class JSI_EXPORT Scope { + public: + explicit Scope(Runtime& rt) : rt_(rt), prv_(rt.pushScope()) {} + ~Scope() { + rt_.popScope(prv_); + }; + + Scope(const Scope&) = delete; + Scope(Scope&&) = delete; + + Scope& operator=(const Scope&) = delete; + Scope& operator=(Scope&&) = delete; + + template + static auto callInNewScope(Runtime& rt, F f) -> decltype(f()) { + Scope s(rt); + return f(); + } + + private: + Runtime& rt_; + Runtime::ScopeState* prv_; +}; + +/// Base class for jsi exceptions +class JSI_EXPORT JSIException : public std::exception { + protected: + JSIException(){}; + JSIException(std::string what) : what_(std::move(what)){}; + + public: + virtual const char* what() const noexcept override { + return what_.c_str(); + } + + virtual ~JSIException(); + + protected: + std::string what_; +}; + +/// This exception will be thrown by API functions on errors not related to +/// JavaScript execution. +class JSI_EXPORT JSINativeException : public JSIException { + public: + JSINativeException(std::string what) : JSIException(std::move(what)) {} + + virtual ~JSINativeException(); +}; + +/// This exception will be thrown by API functions whenever a JS +/// operation causes an exception as described by the spec, or as +/// otherwise described. +class JSI_EXPORT JSError : public JSIException { + public: + /// Creates a JSError referring to provided \c value + JSError(Runtime& r, Value&& value); + + /// Creates a JSError referring to new \c Error instance capturing current + /// JavaScript stack. The error message property is set to given \c message. + JSError(Runtime& rt, std::string message); + + /// Creates a JSError referring to new \c Error instance capturing current + /// JavaScript stack. The error message property is set to given \c message. + JSError(Runtime& rt, const char* message) + : JSError(rt, std::string(message)){}; + + /// Creates a JSError referring to a JavaScript Object having message and + /// stack properties set to provided values. + JSError(Runtime& rt, std::string message, std::string stack); + + /// Creates a JSError referring to provided value and what string + /// set to provided message. This argument order is a bit weird, + /// but necessary to avoid ambiguity with the above. + JSError(std::string what, Runtime& rt, Value&& value); + + virtual ~JSError(); + + const std::string& getStack() const { + return stack_; + } + + const std::string& getMessage() const { + return message_; + } + + const jsi::Value& value() const { + assert(value_); + return *value_; + } + + private: + // This initializes the value_ member and does some other + // validation, so it must be called by every branch through the + // constructors. + void setValue(Runtime& rt, Value&& value); + + // This needs to be on the heap, because throw requires the object + // be copyable, and Value is not. + std::shared_ptr value_; + std::string message_; + std::string stack_; +}; + +} // namespace jsi +} // namespace facebook + +#include diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsilib.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsilib.h new file mode 100644 index 0000000..d99b66d --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/jsilib.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +namespace facebook { +namespace jsi { + +class FileBuffer : public Buffer { + public: + FileBuffer(const std::string& path); + ~FileBuffer(); + + size_t size() const override { + return size_; + } + + const uint8_t* data() const override { + return data_; + } + + private: + size_t size_; + uint8_t* data_; +}; + +// A trivial implementation of PreparedJavaScript that simply stores the source +// buffer and URL. +class SourceJavaScriptPreparation final : public jsi::PreparedJavaScript, + public jsi::Buffer { + std::shared_ptr buf_; + std::string sourceURL_; + + public: + SourceJavaScriptPreparation( + std::shared_ptr buf, + std::string sourceURL) + : buf_(std::move(buf)), sourceURL_(std::move(sourceURL)) {} + + const std::string& sourceURL() const { + return sourceURL_; + } + + size_t size() const override { + return buf_->size(); + } + const uint8_t* data() const override { + return buf_->data(); + } +}; + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/threadsafe.h b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/threadsafe.h new file mode 100644 index 0000000..eddbce4 --- /dev/null +++ b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/Headers/jsi/threadsafe.h @@ -0,0 +1,79 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include +#include + +namespace facebook { +namespace jsi { + +class ThreadSafeRuntime : public Runtime { + public: + virtual void lock() const = 0; + virtual void unlock() const = 0; + virtual Runtime& getUnsafeRuntime() = 0; +}; + +namespace detail { + +template +struct WithLock { + L lock; + WithLock(R& r) : lock(r) {} + void before() { + lock.lock(); + } + void after() { + lock.unlock(); + } +}; + +// The actual implementation of a given ThreadSafeRuntime. It's parameterized +// by: +// +// - R: The actual Runtime type that this wraps +// - L: A lock type that has three members: +// - L(R& r) // ctor +// - void lock() +// - void unlock() +template +class ThreadSafeRuntimeImpl final + : public WithRuntimeDecorator, R, ThreadSafeRuntime> { + public: + template + ThreadSafeRuntimeImpl(Args&&... args) + : WithRuntimeDecorator, R, ThreadSafeRuntime>( + unsafe_, + lock_), + unsafe_(std::forward(args)...), + lock_(unsafe_) {} + + R& getUnsafeRuntime() override { + return WithRuntimeDecorator, R, ThreadSafeRuntime>::plain(); + } + + void lock() const override { + lock_.before(); + } + + void unlock() const override { + lock_.after(); + } + + private: + R unsafe_; + mutable WithLock lock_; +}; + +} // namespace detail + +} // namespace jsi +} // namespace facebook diff --git a/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/libReact-jsi.a b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/libReact-jsi.a new file mode 100644 index 0000000..1152adf Binary files /dev/null and b/Frameworks/React-jsi.xcframework/ios-arm64_x86_64-simulator/libReact-jsi.a differ diff --git a/Frameworks/React-jsiexecutor.xcframework/Info.plist b/Frameworks/React-jsiexecutor.xcframework/Info.plist new file mode 100644 index 0000000..483d07d --- /dev/null +++ b/Frameworks/React-jsiexecutor.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-jsiexecutor.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-jsiexecutor.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-jsiexecutor.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-jsiexecutor.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-jsiexecutor.xcframework/ios-arm64/Headers/jsireact/JSIExecutor.h b/Frameworks/React-jsiexecutor.xcframework/ios-arm64/Headers/jsireact/JSIExecutor.h new file mode 100644 index 0000000..615172e --- /dev/null +++ b/Frameworks/React-jsiexecutor.xcframework/ios-arm64/Headers/jsireact/JSIExecutor.h @@ -0,0 +1,146 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include "JSINativeModules.h" + +#include +#include +#include +#include +#include +#include + +namespace facebook { +namespace react { + +// A JSIScopedTimeoutInvoker is a trampoline-type function for introducing +// timeouts. Call the TimeoutInvoker with a function to execute, the invokee. +// The TimeoutInvoker will immediately invoke it, synchronously on the same +// thread. If the invokee fails to return after some timeout (private to the +// TimeoutInvoker), a soft error may be reported. +// +// If a soft error is reported, the second parameter errorMessageProducer will +// be invoked to produce an error message, which will be included in the soft +// error report. Note that the errorMessageProducer will be invoked +// asynchronously on a different thread. +// +// The timeout behavior does NOT cause the invokee to aborted. If the invokee +// blocks forever, so will the ScopedTimeoutInvoker (but the soft error may +// still be reported). +// +// The invokee is passed by const ref because it is executed synchronously, but +// the errorMessageProducer is passed by value because it must be copied or +// moved for async execution. +// +// Example usage: +// +// int param = ...; +// timeoutInvoker( +// [&]{ someBigWork(param); }, +// [=] -> std::string { +// return "someBigWork, param " + std::to_string(param); +// }) +// +using JSIScopedTimeoutInvoker = std::function &invokee, + std::function errorMessageProducer)>; + +class BigStringBuffer : public jsi::Buffer { + public: + BigStringBuffer(std::unique_ptr script) + : script_(std::move(script)) {} + + size_t size() const override { + return script_->size(); + } + + const uint8_t *data() const override { + return reinterpret_cast(script_->c_str()); + } + + private: + std::unique_ptr script_; +}; + +class JSIExecutor : public JSExecutor { + public: + using RuntimeInstaller = std::function; + + JSIExecutor( + std::shared_ptr runtime, + std::shared_ptr delegate, + const JSIScopedTimeoutInvoker &timeoutInvoker, + RuntimeInstaller runtimeInstaller); + void initializeRuntime() override; + void loadBundle( + std::unique_ptr script, + std::string sourceURL) override; + void setBundleRegistry(std::unique_ptr) override; + void registerBundle(uint32_t bundleId, const std::string &bundlePath) + override; + void callFunction( + const std::string &moduleId, + const std::string &methodId, + const folly::dynamic &arguments) override; + void invokeCallback(const double callbackId, const folly::dynamic &arguments) + override; + void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue) override; + std::string getDescription() override; + void *getJavaScriptContext() override; + bool isInspectable() override; + void handleMemoryPressure(int pressureLevel) override; + + // An implementation of JSIScopedTimeoutInvoker that simply runs the + // invokee, with no timeout. + static void defaultTimeoutInvoker( + const std::function &invokee, + std::function errorMessageProducer) { + (void)errorMessageProducer; + invokee(); + } + + void flush() override; + + private: + class NativeModuleProxy; + + void bindBridge(); + void callNativeModules(const jsi::Value &queue, bool isEndOfBatch); + jsi::Value nativeCallSyncHook(const jsi::Value *args, size_t count); + jsi::Value nativeRequire(const jsi::Value *args, size_t count); +#ifdef DEBUG + jsi::Value globalEvalWithSourceUrl(const jsi::Value *args, size_t count); +#endif + + std::shared_ptr runtime_; + std::shared_ptr delegate_; + std::shared_ptr nativeModules_; + std::shared_ptr moduleRegistry_; + std::once_flag bindFlag_; + std::unique_ptr bundleRegistry_; + JSIScopedTimeoutInvoker scopedTimeoutInvoker_; + RuntimeInstaller runtimeInstaller_; + + folly::Optional callFunctionReturnFlushedQueue_; + folly::Optional invokeCallbackAndReturnFlushedQueue_; + folly::Optional flushedQueue_; +}; + +using Logger = + std::function; +void bindNativeLogger(jsi::Runtime &runtime, Logger logger); + +using PerformanceNow = std::function; +void bindNativePerformanceNow( + jsi::Runtime &runtime, + PerformanceNow performanceNow); +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-jsiexecutor.xcframework/ios-arm64/Headers/jsireact/JSINativeModules.h b/Frameworks/React-jsiexecutor.xcframework/ios-arm64/Headers/jsireact/JSINativeModules.h new file mode 100644 index 0000000..a1dff88 --- /dev/null +++ b/Frameworks/React-jsiexecutor.xcframework/ios-arm64/Headers/jsireact/JSINativeModules.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include +#include + +namespace facebook { +namespace react { + +/** + * Holds and creates JS representations of the modules in ModuleRegistry + */ +class JSINativeModules { + public: + explicit JSINativeModules(std::shared_ptr moduleRegistry); + jsi::Value getModule(jsi::Runtime &rt, const jsi::PropNameID &name); + void reset(); + + private: + folly::Optional m_genNativeModuleJS; + std::shared_ptr m_moduleRegistry; + std::unordered_map m_objects; + + folly::Optional createModule( + jsi::Runtime &rt, + const std::string &name); +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-jsiexecutor.xcframework/ios-arm64/libReact-jsiexecutor.a b/Frameworks/React-jsiexecutor.xcframework/ios-arm64/libReact-jsiexecutor.a new file mode 100644 index 0000000..6792ea3 Binary files /dev/null and b/Frameworks/React-jsiexecutor.xcframework/ios-arm64/libReact-jsiexecutor.a differ diff --git a/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/Headers/jsireact/JSIExecutor.h b/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/Headers/jsireact/JSIExecutor.h new file mode 100644 index 0000000..615172e --- /dev/null +++ b/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/Headers/jsireact/JSIExecutor.h @@ -0,0 +1,146 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include "JSINativeModules.h" + +#include +#include +#include +#include +#include +#include + +namespace facebook { +namespace react { + +// A JSIScopedTimeoutInvoker is a trampoline-type function for introducing +// timeouts. Call the TimeoutInvoker with a function to execute, the invokee. +// The TimeoutInvoker will immediately invoke it, synchronously on the same +// thread. If the invokee fails to return after some timeout (private to the +// TimeoutInvoker), a soft error may be reported. +// +// If a soft error is reported, the second parameter errorMessageProducer will +// be invoked to produce an error message, which will be included in the soft +// error report. Note that the errorMessageProducer will be invoked +// asynchronously on a different thread. +// +// The timeout behavior does NOT cause the invokee to aborted. If the invokee +// blocks forever, so will the ScopedTimeoutInvoker (but the soft error may +// still be reported). +// +// The invokee is passed by const ref because it is executed synchronously, but +// the errorMessageProducer is passed by value because it must be copied or +// moved for async execution. +// +// Example usage: +// +// int param = ...; +// timeoutInvoker( +// [&]{ someBigWork(param); }, +// [=] -> std::string { +// return "someBigWork, param " + std::to_string(param); +// }) +// +using JSIScopedTimeoutInvoker = std::function &invokee, + std::function errorMessageProducer)>; + +class BigStringBuffer : public jsi::Buffer { + public: + BigStringBuffer(std::unique_ptr script) + : script_(std::move(script)) {} + + size_t size() const override { + return script_->size(); + } + + const uint8_t *data() const override { + return reinterpret_cast(script_->c_str()); + } + + private: + std::unique_ptr script_; +}; + +class JSIExecutor : public JSExecutor { + public: + using RuntimeInstaller = std::function; + + JSIExecutor( + std::shared_ptr runtime, + std::shared_ptr delegate, + const JSIScopedTimeoutInvoker &timeoutInvoker, + RuntimeInstaller runtimeInstaller); + void initializeRuntime() override; + void loadBundle( + std::unique_ptr script, + std::string sourceURL) override; + void setBundleRegistry(std::unique_ptr) override; + void registerBundle(uint32_t bundleId, const std::string &bundlePath) + override; + void callFunction( + const std::string &moduleId, + const std::string &methodId, + const folly::dynamic &arguments) override; + void invokeCallback(const double callbackId, const folly::dynamic &arguments) + override; + void setGlobalVariable( + std::string propName, + std::unique_ptr jsonValue) override; + std::string getDescription() override; + void *getJavaScriptContext() override; + bool isInspectable() override; + void handleMemoryPressure(int pressureLevel) override; + + // An implementation of JSIScopedTimeoutInvoker that simply runs the + // invokee, with no timeout. + static void defaultTimeoutInvoker( + const std::function &invokee, + std::function errorMessageProducer) { + (void)errorMessageProducer; + invokee(); + } + + void flush() override; + + private: + class NativeModuleProxy; + + void bindBridge(); + void callNativeModules(const jsi::Value &queue, bool isEndOfBatch); + jsi::Value nativeCallSyncHook(const jsi::Value *args, size_t count); + jsi::Value nativeRequire(const jsi::Value *args, size_t count); +#ifdef DEBUG + jsi::Value globalEvalWithSourceUrl(const jsi::Value *args, size_t count); +#endif + + std::shared_ptr runtime_; + std::shared_ptr delegate_; + std::shared_ptr nativeModules_; + std::shared_ptr moduleRegistry_; + std::once_flag bindFlag_; + std::unique_ptr bundleRegistry_; + JSIScopedTimeoutInvoker scopedTimeoutInvoker_; + RuntimeInstaller runtimeInstaller_; + + folly::Optional callFunctionReturnFlushedQueue_; + folly::Optional invokeCallbackAndReturnFlushedQueue_; + folly::Optional flushedQueue_; +}; + +using Logger = + std::function; +void bindNativeLogger(jsi::Runtime &runtime, Logger logger); + +using PerformanceNow = std::function; +void bindNativePerformanceNow( + jsi::Runtime &runtime, + PerformanceNow performanceNow); +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/Headers/jsireact/JSINativeModules.h b/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/Headers/jsireact/JSINativeModules.h new file mode 100644 index 0000000..a1dff88 --- /dev/null +++ b/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/Headers/jsireact/JSINativeModules.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include +#include +#include + +namespace facebook { +namespace react { + +/** + * Holds and creates JS representations of the modules in ModuleRegistry + */ +class JSINativeModules { + public: + explicit JSINativeModules(std::shared_ptr moduleRegistry); + jsi::Value getModule(jsi::Runtime &rt, const jsi::PropNameID &name); + void reset(); + + private: + folly::Optional m_genNativeModuleJS; + std::shared_ptr m_moduleRegistry; + std::unordered_map m_objects; + + folly::Optional createModule( + jsi::Runtime &rt, + const std::string &name); +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/libReact-jsiexecutor.a b/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/libReact-jsiexecutor.a new file mode 100644 index 0000000..e20389e Binary files /dev/null and b/Frameworks/React-jsiexecutor.xcframework/ios-arm64_x86_64-simulator/libReact-jsiexecutor.a differ diff --git a/Frameworks/React-jsinspector.xcframework/Info.plist b/Frameworks/React-jsinspector.xcframework/Info.plist new file mode 100644 index 0000000..5812431 --- /dev/null +++ b/Frameworks/React-jsinspector.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-jsinspector.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-jsinspector.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libReact-jsinspector.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-jsinspector.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-jsinspector.xcframework/ios-arm64/Headers/jsinspector/InspectorInterfaces.h b/Frameworks/React-jsinspector.xcframework/ios-arm64/Headers/jsinspector/InspectorInterfaces.h new file mode 100644 index 0000000..345434b --- /dev/null +++ b/Frameworks/React-jsinspector.xcframework/ios-arm64/Headers/jsinspector/InspectorInterfaces.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#ifndef JSINSPECTOR_EXPORT +#ifdef _MSC_VER +#ifdef CREATE_SHARED_LIBRARY +#define JSINSPECTOR_EXPORT __declspec(dllexport) +#else +#define JSINSPECTOR_EXPORT +#endif // CREATE_SHARED_LIBRARY +#else // _MSC_VER +#define JSINSPECTOR_EXPORT __attribute__((visibility("default"))) +#endif // _MSC_VER +#endif // !defined(JSINSPECTOR_EXPORT) + +namespace facebook { +namespace react { + +class IDestructible { + public: + virtual ~IDestructible() = 0; +}; + +struct InspectorPage { + const int id; + const std::string title; + const std::string vm; +}; + +/// IRemoteConnection allows the VM to send debugger messages to the client. +class JSINSPECTOR_EXPORT IRemoteConnection : public IDestructible { + public: + virtual ~IRemoteConnection() = 0; + virtual void onMessage(std::string message) = 0; + virtual void onDisconnect() = 0; +}; + +/// ILocalConnection allows the client to send debugger messages to the VM. +class JSINSPECTOR_EXPORT ILocalConnection : public IDestructible { + public: + virtual ~ILocalConnection() = 0; + virtual void sendMessage(std::string message) = 0; + virtual void disconnect() = 0; +}; + +/// IInspector tracks debuggable JavaScript targets (pages). +class JSINSPECTOR_EXPORT IInspector : public IDestructible { + public: + using ConnectFunc = std::function( + std::unique_ptr)>; + + virtual ~IInspector() = 0; + + /// addPage is called by the VM to add a page to the list of debuggable pages. + virtual int addPage( + const std::string &title, + const std::string &vm, + ConnectFunc connectFunc) = 0; + + /// removePage is called by the VM to remove a page from the list of + /// debuggable pages. + virtual void removePage(int pageId) = 0; + + /// getPages is called by the client to list all debuggable pages. + virtual std::vector getPages() const = 0; + + /// connect is called by the client to initiate a debugging session on the + /// given page. + virtual std::unique_ptr connect( + int pageId, + std::unique_ptr remote) = 0; +}; + +/// getInspectorInstance retrieves the singleton inspector that tracks all +/// debuggable pages in this process. +extern IInspector &getInspectorInstance(); + +/// makeTestInspectorInstance creates an independent inspector instance that +/// should only be used in tests. +extern std::unique_ptr makeTestInspectorInstance(); + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-jsinspector.xcframework/ios-arm64/libReact-jsinspector.a b/Frameworks/React-jsinspector.xcframework/ios-arm64/libReact-jsinspector.a new file mode 100644 index 0000000..df5d61c Binary files /dev/null and b/Frameworks/React-jsinspector.xcframework/ios-arm64/libReact-jsinspector.a differ diff --git a/Frameworks/React-jsinspector.xcframework/ios-arm64_x86_64-simulator/Headers/jsinspector/InspectorInterfaces.h b/Frameworks/React-jsinspector.xcframework/ios-arm64_x86_64-simulator/Headers/jsinspector/InspectorInterfaces.h new file mode 100644 index 0000000..345434b --- /dev/null +++ b/Frameworks/React-jsinspector.xcframework/ios-arm64_x86_64-simulator/Headers/jsinspector/InspectorInterfaces.h @@ -0,0 +1,94 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include + +#ifndef JSINSPECTOR_EXPORT +#ifdef _MSC_VER +#ifdef CREATE_SHARED_LIBRARY +#define JSINSPECTOR_EXPORT __declspec(dllexport) +#else +#define JSINSPECTOR_EXPORT +#endif // CREATE_SHARED_LIBRARY +#else // _MSC_VER +#define JSINSPECTOR_EXPORT __attribute__((visibility("default"))) +#endif // _MSC_VER +#endif // !defined(JSINSPECTOR_EXPORT) + +namespace facebook { +namespace react { + +class IDestructible { + public: + virtual ~IDestructible() = 0; +}; + +struct InspectorPage { + const int id; + const std::string title; + const std::string vm; +}; + +/// IRemoteConnection allows the VM to send debugger messages to the client. +class JSINSPECTOR_EXPORT IRemoteConnection : public IDestructible { + public: + virtual ~IRemoteConnection() = 0; + virtual void onMessage(std::string message) = 0; + virtual void onDisconnect() = 0; +}; + +/// ILocalConnection allows the client to send debugger messages to the VM. +class JSINSPECTOR_EXPORT ILocalConnection : public IDestructible { + public: + virtual ~ILocalConnection() = 0; + virtual void sendMessage(std::string message) = 0; + virtual void disconnect() = 0; +}; + +/// IInspector tracks debuggable JavaScript targets (pages). +class JSINSPECTOR_EXPORT IInspector : public IDestructible { + public: + using ConnectFunc = std::function( + std::unique_ptr)>; + + virtual ~IInspector() = 0; + + /// addPage is called by the VM to add a page to the list of debuggable pages. + virtual int addPage( + const std::string &title, + const std::string &vm, + ConnectFunc connectFunc) = 0; + + /// removePage is called by the VM to remove a page from the list of + /// debuggable pages. + virtual void removePage(int pageId) = 0; + + /// getPages is called by the client to list all debuggable pages. + virtual std::vector getPages() const = 0; + + /// connect is called by the client to initiate a debugging session on the + /// given page. + virtual std::unique_ptr connect( + int pageId, + std::unique_ptr remote) = 0; +}; + +/// getInspectorInstance retrieves the singleton inspector that tracks all +/// debuggable pages in this process. +extern IInspector &getInspectorInstance(); + +/// makeTestInspectorInstance creates an independent inspector instance that +/// should only be used in tests. +extern std::unique_ptr makeTestInspectorInstance(); + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-jsinspector.xcframework/ios-arm64_x86_64-simulator/libReact-jsinspector.a b/Frameworks/React-jsinspector.xcframework/ios-arm64_x86_64-simulator/libReact-jsinspector.a new file mode 100644 index 0000000..7a3346c Binary files /dev/null and b/Frameworks/React-jsinspector.xcframework/ios-arm64_x86_64-simulator/libReact-jsinspector.a differ diff --git a/Frameworks/React-logger.xcframework/Info.plist b/Frameworks/React-logger.xcframework/Info.plist new file mode 100644 index 0000000..076a975 --- /dev/null +++ b/Frameworks/React-logger.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-logger.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-logger.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-logger.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-logger.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-logger.xcframework/ios-arm64/Headers/logger/react_native_log.h b/Frameworks/React-logger.xcframework/ios-arm64/Headers/logger/react_native_log.h new file mode 100644 index 0000000..c64f202 --- /dev/null +++ b/Frameworks/React-logger.xcframework/ios-arm64/Headers/logger/react_native_log.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +enum ReactNativeLogLevel { + ReactNativeLogLevelInfo = 1, + ReactNativeLogLevelWarning = 2, + ReactNativeLogLevelError = 3, + ReactNativeLogLevelFatal = 4 +}; + +typedef void (*reactnativelogfunctype)(ReactNativeLogLevel, const char *); + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +void set_react_native_logfunc(reactnativelogfunctype newlogfunc); + +void react_native_log_info(const char *text); +void react_native_log_warn(const char *text); +void react_native_log_error(const char *text); +void react_native_log_fatal(const char *text); + +void _react_native_log(ReactNativeLogLevel level, const char *text); +void _react_native_log_default(ReactNativeLogLevel level, const char *text); +#ifdef __cplusplus +} +#endif // __cpusplus diff --git a/Frameworks/React-logger.xcframework/ios-arm64/libReact-logger.a b/Frameworks/React-logger.xcframework/ios-arm64/libReact-logger.a new file mode 100644 index 0000000..c2b2b53 Binary files /dev/null and b/Frameworks/React-logger.xcframework/ios-arm64/libReact-logger.a differ diff --git a/Frameworks/React-logger.xcframework/ios-arm64_x86_64-simulator/Headers/logger/react_native_log.h b/Frameworks/React-logger.xcframework/ios-arm64_x86_64-simulator/Headers/logger/react_native_log.h new file mode 100644 index 0000000..c64f202 --- /dev/null +++ b/Frameworks/React-logger.xcframework/ios-arm64_x86_64-simulator/Headers/logger/react_native_log.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +enum ReactNativeLogLevel { + ReactNativeLogLevelInfo = 1, + ReactNativeLogLevelWarning = 2, + ReactNativeLogLevelError = 3, + ReactNativeLogLevelFatal = 4 +}; + +typedef void (*reactnativelogfunctype)(ReactNativeLogLevel, const char *); + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus +void set_react_native_logfunc(reactnativelogfunctype newlogfunc); + +void react_native_log_info(const char *text); +void react_native_log_warn(const char *text); +void react_native_log_error(const char *text); +void react_native_log_fatal(const char *text); + +void _react_native_log(ReactNativeLogLevel level, const char *text); +void _react_native_log_default(ReactNativeLogLevel level, const char *text); +#ifdef __cplusplus +} +#endif // __cpusplus diff --git a/Frameworks/React-logger.xcframework/ios-arm64_x86_64-simulator/libReact-logger.a b/Frameworks/React-logger.xcframework/ios-arm64_x86_64-simulator/libReact-logger.a new file mode 100644 index 0000000..be610f6 Binary files /dev/null and b/Frameworks/React-logger.xcframework/ios-arm64_x86_64-simulator/libReact-logger.a differ diff --git a/Frameworks/React-perflogger.xcframework/Info.plist b/Frameworks/React-perflogger.xcframework/Info.plist new file mode 100644 index 0000000..33a1194 --- /dev/null +++ b/Frameworks/React-perflogger.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReact-perflogger.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReact-perflogger.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReact-perflogger.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReact-perflogger.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/React-perflogger.xcframework/ios-arm64/Headers/reactperflogger/BridgeNativeModulePerfLogger.h b/Frameworks/React-perflogger.xcframework/ios-arm64/Headers/reactperflogger/BridgeNativeModulePerfLogger.h new file mode 100644 index 0000000..9ac83b9 --- /dev/null +++ b/Frameworks/React-perflogger.xcframework/ios-arm64/Headers/reactperflogger/BridgeNativeModulePerfLogger.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once +#include +#include "NativeModulePerfLogger.h" + +namespace facebook { +namespace react { + +namespace BridgeNativeModulePerfLogger { +void enableLogging(std::unique_ptr &&logger); +void disableLogging(); + +void moduleDataCreateStart(const char *moduleName, int32_t id); +void moduleDataCreateEnd(const char *moduleName, int32_t id); + +/** + * Create NativeModule platform object + */ +void moduleCreateStart(const char *moduleName, int32_t id); +void moduleCreateCacheHit(const char *moduleName, int32_t id); +void moduleCreateConstructStart(const char *moduleName, int32_t id); +void moduleCreateConstructEnd(const char *moduleName, int32_t id); +void moduleCreateSetUpStart(const char *moduleName, int32_t id); +void moduleCreateSetUpEnd(const char *moduleName, int32_t id); +void moduleCreateEnd(const char *moduleName, int32_t id); +void moduleCreateFail(const char *moduleName, int32_t id); + +/** + * JS require beginning + */ +void moduleJSRequireBeginningStart(const char *moduleName); +void moduleJSRequireBeginningCacheHit(const char *moduleName); +void moduleJSRequireBeginningEnd(const char *moduleName); +void moduleJSRequireBeginningFail(const char *moduleName); + +/** + * JS require ending + */ +void moduleJSRequireEndingStart(const char *moduleName); +void moduleJSRequireEndingEnd(const char *moduleName); +void moduleJSRequireEndingFail(const char *moduleName); + +// Sync method calls +void syncMethodCallStart(const char *moduleName, const char *methodName); +void syncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionEnd(const char *moduleName, const char *methodName); +void syncMethodCallReturnConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallReturnConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallEnd(const char *moduleName, const char *methodName); +void syncMethodCallFail(const char *moduleName, const char *methodName); + +// Async method calls +void asyncMethodCallStart(const char *moduleName, const char *methodName); +void asyncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void asyncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void asyncMethodCallDispatch(const char *moduleName, const char *methodName); +void asyncMethodCallEnd(const char *moduleName, const char *methodName); +void asyncMethodCallFail(const char *moduleName, const char *methodName); + +/** + * Pre-processing async method call batch + */ +void asyncMethodCallBatchPreprocessStart(); +void asyncMethodCallBatchPreprocessEnd(int batchSize); + +// Async method call execution +void asyncMethodCallExecutionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionFail( + const char *moduleName, + const char *methodName, + int32_t id); + +} // namespace BridgeNativeModulePerfLogger + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-perflogger.xcframework/ios-arm64/Headers/reactperflogger/NativeModulePerfLogger.h b/Frameworks/React-perflogger.xcframework/ios-arm64/Headers/reactperflogger/NativeModulePerfLogger.h new file mode 100644 index 0000000..54def97 --- /dev/null +++ b/Frameworks/React-perflogger.xcframework/ios-arm64/Headers/reactperflogger/NativeModulePerfLogger.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once +#include + +namespace facebook { +namespace react { + +/** + * A platform-agnostic interface to do performance logging on NativeModules and + * TuboModules. + */ +class NativeModulePerfLogger { + public: + virtual ~NativeModulePerfLogger() {} + + /** + * NativeModule Initialization. + * + * The initialization of two NativeModules can interleave. Therefore, + * performance markers should use the moduleName as a unique key. + */ + + /** + * On iOS: + * - NativeModule initialization is split into two phases, which sometimes + * have a pause in the middle. + * - TurboModule initialization happens all at once. + * + * On Android: + * - NativeModule and TurboModule initialization happens all at once. + * + * These markers are meant for iOS NativeModules: + * - moduleDataCreateStart: very beginning of first phase. + * - moduleDataCreateEnd: after RCTModuleData has been created. + */ + virtual void moduleDataCreateStart(const char *moduleName, int32_t id) = 0; + virtual void moduleDataCreateEnd(const char *moduleName, int32_t id) = 0; + + /** + * How long does it take to create the platform NativeModule object? + * - moduleCreateStart: start creating platform NativeModule + * - moduleCreateEnd: stop creating platform NativeModule + */ + virtual void moduleCreateStart(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateCacheHit(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateConstructStart( + const char *moduleName, + int32_t id) = 0; + virtual void moduleCreateConstructEnd(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateSetUpStart(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateSetUpEnd(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateEnd(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateFail(const char *moduleName, int32_t id) = 0; + + /** + * How long, after starting JS require, does it take to start creating the + * platform NativeModule? + * - moduleJSRequireBeginningStart: start of JS require + * - moduleJSRequireBeginningEnd: start creating platform NativeModule + */ + virtual void moduleJSRequireBeginningStart(const char *moduleName) = 0; + virtual void moduleJSRequireBeginningCacheHit(const char *moduleName) = 0; + virtual void moduleJSRequireBeginningEnd(const char *moduleName) = 0; + virtual void moduleJSRequireBeginningFail(const char *moduleName) = 0; + + /** + * How long does it take to return from the JS require after the platform + * NativeModule is created? + * - moduleJSRequireEndingStart: end creating platform NativeModule + * - moduleJSRequireEndingEnd: end of JS require + */ + virtual void moduleJSRequireEndingStart(const char *moduleName) = 0; + virtual void moduleJSRequireEndingEnd(const char *moduleName) = 0; + virtual void moduleJSRequireEndingFail(const char *moduleName) = 0; + + // Sync method calls + virtual void syncMethodCallStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallExecutionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallReturnConversionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallReturnConversionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallFail( + const char *moduleName, + const char *methodName) = 0; + + // Async method calls + virtual void asyncMethodCallStart( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallDispatch( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallFail( + const char *moduleName, + const char *methodName) = 0; + + /** + * In the NativeModule system, we batch async NativeModule method calls. + * When we execute a batch of NativeModule method calls, we convert the batch + * from a jsi::Value to folly::dynamic to std::vector. This marker + * documents that work. + */ + virtual void asyncMethodCallBatchPreprocessStart() = 0; + virtual void asyncMethodCallBatchPreprocessEnd(int batchSize) = 0; + + // Async method call execution + virtual void asyncMethodCallExecutionStart( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionArgConversionStart( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionArgConversionEnd( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionFail( + const char *moduleName, + const char *methodName, + int32_t id) = 0; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-perflogger.xcframework/ios-arm64/libReact-perflogger.a b/Frameworks/React-perflogger.xcframework/ios-arm64/libReact-perflogger.a new file mode 100644 index 0000000..068f598 Binary files /dev/null and b/Frameworks/React-perflogger.xcframework/ios-arm64/libReact-perflogger.a differ diff --git a/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/Headers/reactperflogger/BridgeNativeModulePerfLogger.h b/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/Headers/reactperflogger/BridgeNativeModulePerfLogger.h new file mode 100644 index 0000000..9ac83b9 --- /dev/null +++ b/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/Headers/reactperflogger/BridgeNativeModulePerfLogger.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once +#include +#include "NativeModulePerfLogger.h" + +namespace facebook { +namespace react { + +namespace BridgeNativeModulePerfLogger { +void enableLogging(std::unique_ptr &&logger); +void disableLogging(); + +void moduleDataCreateStart(const char *moduleName, int32_t id); +void moduleDataCreateEnd(const char *moduleName, int32_t id); + +/** + * Create NativeModule platform object + */ +void moduleCreateStart(const char *moduleName, int32_t id); +void moduleCreateCacheHit(const char *moduleName, int32_t id); +void moduleCreateConstructStart(const char *moduleName, int32_t id); +void moduleCreateConstructEnd(const char *moduleName, int32_t id); +void moduleCreateSetUpStart(const char *moduleName, int32_t id); +void moduleCreateSetUpEnd(const char *moduleName, int32_t id); +void moduleCreateEnd(const char *moduleName, int32_t id); +void moduleCreateFail(const char *moduleName, int32_t id); + +/** + * JS require beginning + */ +void moduleJSRequireBeginningStart(const char *moduleName); +void moduleJSRequireBeginningCacheHit(const char *moduleName); +void moduleJSRequireBeginningEnd(const char *moduleName); +void moduleJSRequireBeginningFail(const char *moduleName); + +/** + * JS require ending + */ +void moduleJSRequireEndingStart(const char *moduleName); +void moduleJSRequireEndingEnd(const char *moduleName); +void moduleJSRequireEndingFail(const char *moduleName); + +// Sync method calls +void syncMethodCallStart(const char *moduleName, const char *methodName); +void syncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionEnd(const char *moduleName, const char *methodName); +void syncMethodCallReturnConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallReturnConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallEnd(const char *moduleName, const char *methodName); +void syncMethodCallFail(const char *moduleName, const char *methodName); + +// Async method calls +void asyncMethodCallStart(const char *moduleName, const char *methodName); +void asyncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void asyncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void asyncMethodCallDispatch(const char *moduleName, const char *methodName); +void asyncMethodCallEnd(const char *moduleName, const char *methodName); +void asyncMethodCallFail(const char *moduleName, const char *methodName); + +/** + * Pre-processing async method call batch + */ +void asyncMethodCallBatchPreprocessStart(); +void asyncMethodCallBatchPreprocessEnd(int batchSize); + +// Async method call execution +void asyncMethodCallExecutionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionFail( + const char *moduleName, + const char *methodName, + int32_t id); + +} // namespace BridgeNativeModulePerfLogger + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/Headers/reactperflogger/NativeModulePerfLogger.h b/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/Headers/reactperflogger/NativeModulePerfLogger.h new file mode 100644 index 0000000..54def97 --- /dev/null +++ b/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/Headers/reactperflogger/NativeModulePerfLogger.h @@ -0,0 +1,164 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once +#include + +namespace facebook { +namespace react { + +/** + * A platform-agnostic interface to do performance logging on NativeModules and + * TuboModules. + */ +class NativeModulePerfLogger { + public: + virtual ~NativeModulePerfLogger() {} + + /** + * NativeModule Initialization. + * + * The initialization of two NativeModules can interleave. Therefore, + * performance markers should use the moduleName as a unique key. + */ + + /** + * On iOS: + * - NativeModule initialization is split into two phases, which sometimes + * have a pause in the middle. + * - TurboModule initialization happens all at once. + * + * On Android: + * - NativeModule and TurboModule initialization happens all at once. + * + * These markers are meant for iOS NativeModules: + * - moduleDataCreateStart: very beginning of first phase. + * - moduleDataCreateEnd: after RCTModuleData has been created. + */ + virtual void moduleDataCreateStart(const char *moduleName, int32_t id) = 0; + virtual void moduleDataCreateEnd(const char *moduleName, int32_t id) = 0; + + /** + * How long does it take to create the platform NativeModule object? + * - moduleCreateStart: start creating platform NativeModule + * - moduleCreateEnd: stop creating platform NativeModule + */ + virtual void moduleCreateStart(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateCacheHit(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateConstructStart( + const char *moduleName, + int32_t id) = 0; + virtual void moduleCreateConstructEnd(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateSetUpStart(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateSetUpEnd(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateEnd(const char *moduleName, int32_t id) = 0; + virtual void moduleCreateFail(const char *moduleName, int32_t id) = 0; + + /** + * How long, after starting JS require, does it take to start creating the + * platform NativeModule? + * - moduleJSRequireBeginningStart: start of JS require + * - moduleJSRequireBeginningEnd: start creating platform NativeModule + */ + virtual void moduleJSRequireBeginningStart(const char *moduleName) = 0; + virtual void moduleJSRequireBeginningCacheHit(const char *moduleName) = 0; + virtual void moduleJSRequireBeginningEnd(const char *moduleName) = 0; + virtual void moduleJSRequireBeginningFail(const char *moduleName) = 0; + + /** + * How long does it take to return from the JS require after the platform + * NativeModule is created? + * - moduleJSRequireEndingStart: end creating platform NativeModule + * - moduleJSRequireEndingEnd: end of JS require + */ + virtual void moduleJSRequireEndingStart(const char *moduleName) = 0; + virtual void moduleJSRequireEndingEnd(const char *moduleName) = 0; + virtual void moduleJSRequireEndingFail(const char *moduleName) = 0; + + // Sync method calls + virtual void syncMethodCallStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallExecutionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallReturnConversionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallReturnConversionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void syncMethodCallFail( + const char *moduleName, + const char *methodName) = 0; + + // Async method calls + virtual void asyncMethodCallStart( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallDispatch( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallEnd( + const char *moduleName, + const char *methodName) = 0; + virtual void asyncMethodCallFail( + const char *moduleName, + const char *methodName) = 0; + + /** + * In the NativeModule system, we batch async NativeModule method calls. + * When we execute a batch of NativeModule method calls, we convert the batch + * from a jsi::Value to folly::dynamic to std::vector. This marker + * documents that work. + */ + virtual void asyncMethodCallBatchPreprocessStart() = 0; + virtual void asyncMethodCallBatchPreprocessEnd(int batchSize) = 0; + + // Async method call execution + virtual void asyncMethodCallExecutionStart( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionArgConversionStart( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionArgConversionEnd( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName, + int32_t id) = 0; + virtual void asyncMethodCallExecutionFail( + const char *moduleName, + const char *methodName, + int32_t id) = 0; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/libReact-perflogger.a b/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/libReact-perflogger.a new file mode 100644 index 0000000..2b19633 Binary files /dev/null and b/Frameworks/React-perflogger.xcframework/ios-arm64_x86_64-simulator/libReact-perflogger.a differ diff --git a/Frameworks/ReactCommon.xcframework/Info.plist b/Frameworks/ReactCommon.xcframework/Info.plist new file mode 100644 index 0000000..bf75865 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReactCommon.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReactCommon.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReactCommon.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReactCommon.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/LongLivedObject.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/LongLivedObject.h new file mode 100644 index 0000000..5173b73 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/LongLivedObject.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +/** + * A simple wrapper class that can be registered to a collection that keep it + * alive for extended period of time. This object can be removed from the + * collection when needed. + * + * The subclass of this class must be created using std::make_shared(). + * After creation, add it to the `LongLivedObjectCollection`. + * When done with the object, call `allowRelease()` to allow the OS to release + * it. + */ +class LongLivedObject { + public: + virtual void allowRelease(); + + protected: + LongLivedObject(); + virtual ~LongLivedObject(); +}; + +/** + * A singleton, thread-safe, write-only collection for the `LongLivedObject`s. + */ +class LongLivedObjectCollection { + public: + static LongLivedObjectCollection &get(); + + LongLivedObjectCollection(); + LongLivedObjectCollection(LongLivedObjectCollection const &) = delete; + void operator=(LongLivedObjectCollection const &) = delete; + + void add(std::shared_ptr o) const; + void remove(const LongLivedObject *o) const; + void clear() const; + + private: + mutable std::unordered_set> collection_; + mutable std::mutex collectionMutex_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTBlockGuard.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTBlockGuard.h new file mode 100644 index 0000000..38dbd2b --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTBlockGuard.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * RCTBlockGuard is designed to be used with obj-c blocks to assist with manual deallocation of C++ resources + * tied to lifetime of a block. If C++ resources needs to be manually released at the end of block or when the block + * is deallocated, place the clean up code inside constructor and make sure the instace of the class is references in + * the block. + */ +@interface RCTBlockGuard : NSObject + +- (instancetype)initWithCleanup:(void (^)(void))cleanup; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTTurboModule.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTTurboModule.h new file mode 100644 index 0000000..1cc512c --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTTurboModule.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#import + +#import + +#import +#import +#import +#import +#import +#import +#import +#import + +#define RCT_IS_TURBO_MODULE_CLASS(klass) \ + ((RCTTurboModuleEnabled() && [(klass) conformsToProtocol:@protocol(RCTTurboModule)])) +#define RCT_IS_TURBO_MODULE_INSTANCE(module) RCT_IS_TURBO_MODULE_CLASS([(module) class]) + +namespace facebook { +namespace react { + +class Instance; + +typedef std::weak_ptr ( + ^RCTRetainJSCallback)(jsi::Function &&callback, jsi::Runtime &runtime, std::shared_ptr jsInvoker); + +/** + * ObjC++ specific TurboModule base class. + */ +class JSI_EXPORT ObjCTurboModule : public TurboModule { + public: + // TODO(T65603471): Should we unify this with a Fabric abstraction? + struct InitParams { + std::string moduleName; + id instance; + std::shared_ptr jsInvoker; + std::shared_ptr nativeInvoker; + bool isSyncModule; + RCTRetainJSCallback retainJSCallback; + }; + + ObjCTurboModule(const InitParams ¶ms); + + jsi::Value invokeObjCMethod( + jsi::Runtime &runtime, + TurboModuleMethodValueKind valueKind, + const std::string &methodName, + SEL selector, + const jsi::Value *args, + size_t count); + + id instance_; + std::shared_ptr nativeInvoker_; + + protected: + void setMethodArgConversionSelector(NSString *methodName, int argIndex, NSString *fnName); + + private: + // Does the NativeModule dispatch async methods to the JS thread? + const bool isSyncModule_; + + RCTRetainJSCallback retainJSCallback_; + + /** + * TODO(ramanpreet): + * Investigate an optimization that'll let us get rid of this NSMutableDictionary. + */ + NSMutableDictionary *methodArgConversionSelectors_; + NSDictionary *> *methodArgumentTypeNames_; + + bool isMethodSync(TurboModuleMethodValueKind returnType); + BOOL hasMethodArgConversionSelector(NSString *methodName, int argIndex); + SEL getMethodArgConversionSelector(NSString *methodName, int argIndex); + NSString *getArgumentTypeName(NSString *methodName, int argIndex); + NSInvocation *getMethodInvocation( + jsi::Runtime &runtime, + TurboModuleMethodValueKind returnType, + const char *methodName, + SEL selector, + const jsi::Value *args, + size_t count, + NSMutableArray *retainedObjectsForInvocation); + jsi::Value performMethodInvocation( + jsi::Runtime &runtime, + TurboModuleMethodValueKind returnType, + const char *methodName, + NSInvocation *inv, + NSMutableArray *retainedObjectsForInvocation); + + using PromiseInvocationBlock = void (^)(RCTPromiseResolveBlock resolveWrapper, RCTPromiseRejectBlock rejectWrapper); + jsi::Value createPromise(jsi::Runtime &runtime, std::string methodName, PromiseInvocationBlock invoke); +}; + +} // namespace react +} // namespace facebook + +@protocol RCTTurboModule +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params; +@end + +/** + * These methods are all implemented by RCTCxxBridge, which subclasses RCTBridge. Hence, they must only be used in + * contexts where the concrete class of an RCTBridge instance is RCTCxxBridge. This happens, for example, when + * [RCTCxxBridgeDelegate jsExecutorFactoryForBridge:(RCTBridge *)] is invoked by RCTCxxBridge. + * + * TODO: Consolidate this extension with the one in RCTSurfacePresenter. + */ +@interface RCTBridge (RCTTurboModule) +- (std::shared_ptr)jsCallInvoker; +- (std::shared_ptr)decorateNativeCallInvoker: + (std::shared_ptr)nativeInvoker; +@end diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTTurboModuleManager.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTTurboModuleManager.h new file mode 100644 index 0000000..2b9c473 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/RCTTurboModuleManager.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#import + +#import "RCTTurboModule.h" + +#import + +@protocol RCTTurboModuleManagerDelegate + +@optional +- (NSArray *)getEagerInitModuleNames; +- (NSArray *)getEagerInitMainQueueModuleNames; + +/** + * Given a module name, return its actual class. If not provided, basic ObjC class lookup is performed. + */ +- (Class)getModuleClassFromName:(const char *)name; + +/** + * Given a module class, provide an instance for it. If not provided, default initializer is used. + */ +- (id)getModuleInstanceFromClass:(Class)moduleClass; + +/** + * Create an instance of a TurboModule without relying on any ObjC++ module instance. + */ +- (std::shared_ptr)getTurboModule:(const std::string &)name + jsInvoker: + (std::shared_ptr)jsInvoker; + +@end + +@interface RCTTurboModuleManager : NSObject + +- (instancetype)initWithBridge:(RCTBridge *)bridge + delegate:(id)delegate + jsInvoker:(std::shared_ptr)jsInvoker; + +- (void)installJSBindingWithRuntimeExecutor:(facebook::react::RuntimeExecutor)runtimeExecutor; + +- (void)invalidate; + +@end diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboCxxModule.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboCxxModule.h new file mode 100644 index 0000000..e419553 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboCxxModule.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include + +#include "TurboModule.h" + +namespace facebook { +namespace react { + +/** + * A helper class to convert the legacy CxxModule instance to a TurboModule + * instance. This should be used only for migration purpose (to TurboModule), + * since it's not very performant due to a lot of back-and-forth value + * conversions between folly::dynamic and jsi::Value. + */ +class JSI_EXPORT TurboCxxModule : public TurboModule { + public: + TurboCxxModule( + std::unique_ptr cxxModule, + std::shared_ptr jsInvoker); + + virtual facebook::jsi::Value get( + facebook::jsi::Runtime &runtime, + const facebook::jsi::PropNameID &propName) override; + + jsi::Value invokeMethod( + jsi::Runtime &runtime, + TurboModuleMethodValueKind valueKind, + const std::string &methodName, + const jsi::Value *args, + size_t count); + + private: + std::vector cxxMethods_; + std::unique_ptr cxxModule_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModule.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModule.h new file mode 100644 index 0000000..0772986 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModule.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include + +#include + +namespace facebook { +namespace react { + +/** + * For now, support the same set of return types as existing impl. + * This can be improved to support richer typed objects. + */ +enum TurboModuleMethodValueKind { + VoidKind, + BooleanKind, + NumberKind, + StringKind, + ObjectKind, + ArrayKind, + FunctionKind, + PromiseKind, +}; + +/** + * Base HostObject class for every module to be exposed to JS + */ +class JSI_EXPORT TurboModule : public facebook::jsi::HostObject { + public: + TurboModule(const std::string &name, std::shared_ptr jsInvoker); + virtual ~TurboModule(); + + virtual facebook::jsi::Value get( + facebook::jsi::Runtime &runtime, + const facebook::jsi::PropNameID &propName) override; + + const std::string name_; + std::shared_ptr jsInvoker_; + + protected: + struct MethodMetadata { + size_t argCount; + facebook::jsi::Value (*invoker)( + facebook::jsi::Runtime &rt, + TurboModule &turboModule, + const facebook::jsi::Value *args, + size_t count); + }; + + std::unordered_map methodMap_; +}; + +/** + * An app/platform-specific provider function to get an instance of a module + * given a name. + */ +using TurboModuleProviderFunctionType = + std::function(const std::string &name)>; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModuleBinding.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModuleBinding.h new file mode 100644 index 0000000..87679af --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModuleBinding.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include +#include +#include + +namespace facebook { +namespace react { + +class JSCallInvoker; + +/** + * Represents the JavaScript binding for the TurboModule system. + */ +class TurboModuleBinding { + public: + /* + * Installs TurboModuleBinding into JavaScript runtime. + * Thread synchronization must be enforced externally. + */ + static void install( + jsi::Runtime &runtime, + const TurboModuleProviderFunctionType &&moduleProvider); + static void install( + jsi::Runtime &runtime, + const TurboModuleProviderFunctionType &&moduleProvider, + std::shared_ptr longLivedObjectCollection); + + TurboModuleBinding(const TurboModuleProviderFunctionType &&moduleProvider); + TurboModuleBinding( + const TurboModuleProviderFunctionType &&moduleProvider, + std::shared_ptr longLivedObjectCollection); + virtual ~TurboModuleBinding(); + + /** + * Get an TurboModule instance for the given module name. + */ + std::shared_ptr getModule(const std::string &name); + + private: + /** + * A lookup function exposed to JS to get an instance of a TurboModule + * for the given name. + */ + jsi::Value jsProxy( + jsi::Runtime &runtime, + const jsi::Value &thisVal, + const jsi::Value *args, + size_t count); + + TurboModuleProviderFunctionType moduleProvider_; + std::shared_ptr longLivedObjectCollection_; + bool disableGlobalLongLivedObjectCollection_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModulePerfLogger.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModulePerfLogger.h new file mode 100644 index 0000000..2f7fcf8 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModulePerfLogger.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace react { +namespace TurboModulePerfLogger { +void enableLogging(std::unique_ptr &&logger); +void disableLogging(); + +void moduleDataCreateStart(const char *moduleName, int32_t id); +void moduleDataCreateEnd(const char *moduleName, int32_t id); + +/** + * Create NativeModule platform object + */ +void moduleCreateStart(const char *moduleName, int32_t id); +void moduleCreateCacheHit(const char *moduleName, int32_t id); +void moduleCreateConstructStart(const char *moduleName, int32_t id); +void moduleCreateConstructEnd(const char *moduleName, int32_t id); +void moduleCreateSetUpStart(const char *moduleName, int32_t id); +void moduleCreateSetUpEnd(const char *moduleName, int32_t id); +void moduleCreateEnd(const char *moduleName, int32_t id); +void moduleCreateFail(const char *moduleName, int32_t id); + +/** + * JS require beginning + */ +void moduleJSRequireBeginningStart(const char *moduleName); +void moduleJSRequireBeginningCacheHit(const char *moduleName); +void moduleJSRequireBeginningEnd(const char *moduleName); +void moduleJSRequireBeginningFail(const char *moduleName); + +/** + * JS require ending + */ +void moduleJSRequireEndingStart(const char *moduleName); +void moduleJSRequireEndingEnd(const char *moduleName); +void moduleJSRequireEndingFail(const char *moduleName); + +// Sync method calls +void syncMethodCallStart(const char *moduleName, const char *methodName); +void syncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionEnd(const char *moduleName, const char *methodName); +void syncMethodCallReturnConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallReturnConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallEnd(const char *moduleName, const char *methodName); +void syncMethodCallFail(const char *moduleName, const char *methodName); + +// Async method calls +void asyncMethodCallStart(const char *moduleName, const char *methodName); +void asyncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void asyncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void asyncMethodCallDispatch(const char *moduleName, const char *methodName); +void asyncMethodCallEnd(const char *moduleName, const char *methodName); +void asyncMethodCallFail(const char *moduleName, const char *methodName); + +/** + * Pre-processing async method call batch + */ +void asyncMethodCallBatchPreprocessStart(); +void asyncMethodCallBatchPreprocessEnd(int batchSize); + +// Async method call execution +void asyncMethodCallExecutionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionFail( + const char *moduleName, + const char *methodName, + int32_t id); + +} // namespace TurboModulePerfLogger +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModuleUtils.h b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModuleUtils.h new file mode 100644 index 0000000..0dc0813 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64/Headers/ReactCommon/TurboModuleUtils.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include + +#include +#include + +using namespace facebook; + +namespace facebook { +namespace react { + +jsi::Object deepCopyJSIObject(jsi::Runtime &rt, const jsi::Object &obj); +jsi::Array deepCopyJSIArray(jsi::Runtime &rt, const jsi::Array &arr); + +struct Promise : public LongLivedObject { + Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject); + + void resolve(const jsi::Value &result); + void reject(const std::string &error); + + jsi::Runtime &runtime_; + jsi::Function resolve_; + jsi::Function reject_; +}; + +using PromiseSetupFunctionType = + std::function)>; +jsi::Value createPromiseAsJSIValue( + jsi::Runtime &rt, + const PromiseSetupFunctionType func); + +// Helper for passing jsi::Function arg to other methods. +class CallbackWrapper : public LongLivedObject { + private: + CallbackWrapper( + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) + : longLivedObjectCollection_(), + callback_(std::move(callback)), + runtime_(runtime), + jsInvoker_(std::move(jsInvoker)) {} + + CallbackWrapper( + std::shared_ptr longLivedObjectCollection, + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) + : longLivedObjectCollection_(longLivedObjectCollection), + callback_(std::move(callback)), + runtime_(runtime), + jsInvoker_(std::move(jsInvoker)) {} + + // Use a weak_ptr to avoid a retain cycle: LongLivedObjectCollection owns all + // CallbackWrappers. So, CallbackWrapper cannot own its + // LongLivedObjectCollection. + std::weak_ptr longLivedObjectCollection_; + jsi::Function callback_; + jsi::Runtime &runtime_; + std::shared_ptr jsInvoker_; + + public: + static std::weak_ptr createWeak( + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) { + auto wrapper = std::shared_ptr( + new CallbackWrapper(std::move(callback), runtime, jsInvoker)); + LongLivedObjectCollection::get().add(wrapper); + return wrapper; + } + + static std::weak_ptr createWeak( + std::shared_ptr longLivedObjectCollection, + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) { + auto wrapper = std::shared_ptr(new CallbackWrapper( + longLivedObjectCollection, std::move(callback), runtime, jsInvoker)); + longLivedObjectCollection->add(wrapper); + return wrapper; + } + + // Delete the enclosed jsi::Function + void destroy() { + allowRelease(); + } + + jsi::Function &callback() { + return callback_; + } + + jsi::Runtime &runtime() { + return runtime_; + } + + CallInvoker &jsInvoker() { + return *(jsInvoker_); + } + + void allowRelease() override { + if (auto longLivedObjectCollection = longLivedObjectCollection_.lock()) { + if (longLivedObjectCollection != nullptr) { + longLivedObjectCollection->remove(this); + return; + } + } + LongLivedObject::allowRelease(); + } +}; + +class RAIICallbackWrapperDestroyer { + public: + RAIICallbackWrapperDestroyer(std::weak_ptr callbackWrapper) + : callbackWrapper_(callbackWrapper) {} + + ~RAIICallbackWrapperDestroyer() { + auto strongWrapper = callbackWrapper_.lock(); + if (!strongWrapper) { + return; + } + + strongWrapper->destroy(); + } + + private: + std::weak_ptr callbackWrapper_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64/libReactCommon.a b/Frameworks/ReactCommon.xcframework/ios-arm64/libReactCommon.a new file mode 100644 index 0000000..c45d260 Binary files /dev/null and b/Frameworks/ReactCommon.xcframework/ios-arm64/libReactCommon.a differ diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/LongLivedObject.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/LongLivedObject.h new file mode 100644 index 0000000..5173b73 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/LongLivedObject.h @@ -0,0 +1,57 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include + +namespace facebook { +namespace react { + +/** + * A simple wrapper class that can be registered to a collection that keep it + * alive for extended period of time. This object can be removed from the + * collection when needed. + * + * The subclass of this class must be created using std::make_shared(). + * After creation, add it to the `LongLivedObjectCollection`. + * When done with the object, call `allowRelease()` to allow the OS to release + * it. + */ +class LongLivedObject { + public: + virtual void allowRelease(); + + protected: + LongLivedObject(); + virtual ~LongLivedObject(); +}; + +/** + * A singleton, thread-safe, write-only collection for the `LongLivedObject`s. + */ +class LongLivedObjectCollection { + public: + static LongLivedObjectCollection &get(); + + LongLivedObjectCollection(); + LongLivedObjectCollection(LongLivedObjectCollection const &) = delete; + void operator=(LongLivedObjectCollection const &) = delete; + + void add(std::shared_ptr o) const; + void remove(const LongLivedObject *o) const; + void clear() const; + + private: + mutable std::unordered_set> collection_; + mutable std::mutex collectionMutex_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTBlockGuard.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTBlockGuard.h new file mode 100644 index 0000000..38dbd2b --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTBlockGuard.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * RCTBlockGuard is designed to be used with obj-c blocks to assist with manual deallocation of C++ resources + * tied to lifetime of a block. If C++ resources needs to be manually released at the end of block or when the block + * is deallocated, place the clean up code inside constructor and make sure the instace of the class is references in + * the block. + */ +@interface RCTBlockGuard : NSObject + +- (instancetype)initWithCleanup:(void (^)(void))cleanup; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTTurboModule.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTTurboModule.h new file mode 100644 index 0000000..1cc512c --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTTurboModule.h @@ -0,0 +1,121 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#import + +#import + +#import +#import +#import +#import +#import +#import +#import +#import + +#define RCT_IS_TURBO_MODULE_CLASS(klass) \ + ((RCTTurboModuleEnabled() && [(klass) conformsToProtocol:@protocol(RCTTurboModule)])) +#define RCT_IS_TURBO_MODULE_INSTANCE(module) RCT_IS_TURBO_MODULE_CLASS([(module) class]) + +namespace facebook { +namespace react { + +class Instance; + +typedef std::weak_ptr ( + ^RCTRetainJSCallback)(jsi::Function &&callback, jsi::Runtime &runtime, std::shared_ptr jsInvoker); + +/** + * ObjC++ specific TurboModule base class. + */ +class JSI_EXPORT ObjCTurboModule : public TurboModule { + public: + // TODO(T65603471): Should we unify this with a Fabric abstraction? + struct InitParams { + std::string moduleName; + id instance; + std::shared_ptr jsInvoker; + std::shared_ptr nativeInvoker; + bool isSyncModule; + RCTRetainJSCallback retainJSCallback; + }; + + ObjCTurboModule(const InitParams ¶ms); + + jsi::Value invokeObjCMethod( + jsi::Runtime &runtime, + TurboModuleMethodValueKind valueKind, + const std::string &methodName, + SEL selector, + const jsi::Value *args, + size_t count); + + id instance_; + std::shared_ptr nativeInvoker_; + + protected: + void setMethodArgConversionSelector(NSString *methodName, int argIndex, NSString *fnName); + + private: + // Does the NativeModule dispatch async methods to the JS thread? + const bool isSyncModule_; + + RCTRetainJSCallback retainJSCallback_; + + /** + * TODO(ramanpreet): + * Investigate an optimization that'll let us get rid of this NSMutableDictionary. + */ + NSMutableDictionary *methodArgConversionSelectors_; + NSDictionary *> *methodArgumentTypeNames_; + + bool isMethodSync(TurboModuleMethodValueKind returnType); + BOOL hasMethodArgConversionSelector(NSString *methodName, int argIndex); + SEL getMethodArgConversionSelector(NSString *methodName, int argIndex); + NSString *getArgumentTypeName(NSString *methodName, int argIndex); + NSInvocation *getMethodInvocation( + jsi::Runtime &runtime, + TurboModuleMethodValueKind returnType, + const char *methodName, + SEL selector, + const jsi::Value *args, + size_t count, + NSMutableArray *retainedObjectsForInvocation); + jsi::Value performMethodInvocation( + jsi::Runtime &runtime, + TurboModuleMethodValueKind returnType, + const char *methodName, + NSInvocation *inv, + NSMutableArray *retainedObjectsForInvocation); + + using PromiseInvocationBlock = void (^)(RCTPromiseResolveBlock resolveWrapper, RCTPromiseRejectBlock rejectWrapper); + jsi::Value createPromise(jsi::Runtime &runtime, std::string methodName, PromiseInvocationBlock invoke); +}; + +} // namespace react +} // namespace facebook + +@protocol RCTTurboModule +- (std::shared_ptr)getTurboModule: + (const facebook::react::ObjCTurboModule::InitParams &)params; +@end + +/** + * These methods are all implemented by RCTCxxBridge, which subclasses RCTBridge. Hence, they must only be used in + * contexts where the concrete class of an RCTBridge instance is RCTCxxBridge. This happens, for example, when + * [RCTCxxBridgeDelegate jsExecutorFactoryForBridge:(RCTBridge *)] is invoked by RCTCxxBridge. + * + * TODO: Consolidate this extension with the one in RCTSurfacePresenter. + */ +@interface RCTBridge (RCTTurboModule) +- (std::shared_ptr)jsCallInvoker; +- (std::shared_ptr)decorateNativeCallInvoker: + (std::shared_ptr)nativeInvoker; +@end diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTTurboModuleManager.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTTurboModuleManager.h new file mode 100644 index 0000000..2b9c473 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/RCTTurboModuleManager.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#import + +#import "RCTTurboModule.h" + +#import + +@protocol RCTTurboModuleManagerDelegate + +@optional +- (NSArray *)getEagerInitModuleNames; +- (NSArray *)getEagerInitMainQueueModuleNames; + +/** + * Given a module name, return its actual class. If not provided, basic ObjC class lookup is performed. + */ +- (Class)getModuleClassFromName:(const char *)name; + +/** + * Given a module class, provide an instance for it. If not provided, default initializer is used. + */ +- (id)getModuleInstanceFromClass:(Class)moduleClass; + +/** + * Create an instance of a TurboModule without relying on any ObjC++ module instance. + */ +- (std::shared_ptr)getTurboModule:(const std::string &)name + jsInvoker: + (std::shared_ptr)jsInvoker; + +@end + +@interface RCTTurboModuleManager : NSObject + +- (instancetype)initWithBridge:(RCTBridge *)bridge + delegate:(id)delegate + jsInvoker:(std::shared_ptr)jsInvoker; + +- (void)installJSBindingWithRuntimeExecutor:(facebook::react::RuntimeExecutor)runtimeExecutor; + +- (void)invalidate; + +@end diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboCxxModule.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboCxxModule.h new file mode 100644 index 0000000..e419553 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboCxxModule.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include + +#include "TurboModule.h" + +namespace facebook { +namespace react { + +/** + * A helper class to convert the legacy CxxModule instance to a TurboModule + * instance. This should be used only for migration purpose (to TurboModule), + * since it's not very performant due to a lot of back-and-forth value + * conversions between folly::dynamic and jsi::Value. + */ +class JSI_EXPORT TurboCxxModule : public TurboModule { + public: + TurboCxxModule( + std::unique_ptr cxxModule, + std::shared_ptr jsInvoker); + + virtual facebook::jsi::Value get( + facebook::jsi::Runtime &runtime, + const facebook::jsi::PropNameID &propName) override; + + jsi::Value invokeMethod( + jsi::Runtime &runtime, + TurboModuleMethodValueKind valueKind, + const std::string &methodName, + const jsi::Value *args, + size_t count); + + private: + std::vector cxxMethods_; + std::unique_ptr cxxModule_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModule.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModule.h new file mode 100644 index 0000000..0772986 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModule.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include + +#include + +namespace facebook { +namespace react { + +/** + * For now, support the same set of return types as existing impl. + * This can be improved to support richer typed objects. + */ +enum TurboModuleMethodValueKind { + VoidKind, + BooleanKind, + NumberKind, + StringKind, + ObjectKind, + ArrayKind, + FunctionKind, + PromiseKind, +}; + +/** + * Base HostObject class for every module to be exposed to JS + */ +class JSI_EXPORT TurboModule : public facebook::jsi::HostObject { + public: + TurboModule(const std::string &name, std::shared_ptr jsInvoker); + virtual ~TurboModule(); + + virtual facebook::jsi::Value get( + facebook::jsi::Runtime &runtime, + const facebook::jsi::PropNameID &propName) override; + + const std::string name_; + std::shared_ptr jsInvoker_; + + protected: + struct MethodMetadata { + size_t argCount; + facebook::jsi::Value (*invoker)( + facebook::jsi::Runtime &rt, + TurboModule &turboModule, + const facebook::jsi::Value *args, + size_t count); + }; + + std::unordered_map methodMap_; +}; + +/** + * An app/platform-specific provider function to get an instance of a module + * given a name. + */ +using TurboModuleProviderFunctionType = + std::function(const std::string &name)>; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModuleBinding.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModuleBinding.h new file mode 100644 index 0000000..87679af --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModuleBinding.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include + +#include +#include +#include + +namespace facebook { +namespace react { + +class JSCallInvoker; + +/** + * Represents the JavaScript binding for the TurboModule system. + */ +class TurboModuleBinding { + public: + /* + * Installs TurboModuleBinding into JavaScript runtime. + * Thread synchronization must be enforced externally. + */ + static void install( + jsi::Runtime &runtime, + const TurboModuleProviderFunctionType &&moduleProvider); + static void install( + jsi::Runtime &runtime, + const TurboModuleProviderFunctionType &&moduleProvider, + std::shared_ptr longLivedObjectCollection); + + TurboModuleBinding(const TurboModuleProviderFunctionType &&moduleProvider); + TurboModuleBinding( + const TurboModuleProviderFunctionType &&moduleProvider, + std::shared_ptr longLivedObjectCollection); + virtual ~TurboModuleBinding(); + + /** + * Get an TurboModule instance for the given module name. + */ + std::shared_ptr getModule(const std::string &name); + + private: + /** + * A lookup function exposed to JS to get an instance of a TurboModule + * for the given name. + */ + jsi::Value jsProxy( + jsi::Runtime &runtime, + const jsi::Value &thisVal, + const jsi::Value *args, + size_t count); + + TurboModuleProviderFunctionType moduleProvider_; + std::shared_ptr longLivedObjectCollection_; + bool disableGlobalLongLivedObjectCollection_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModulePerfLogger.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModulePerfLogger.h new file mode 100644 index 0000000..2f7fcf8 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModulePerfLogger.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +namespace facebook { +namespace react { +namespace TurboModulePerfLogger { +void enableLogging(std::unique_ptr &&logger); +void disableLogging(); + +void moduleDataCreateStart(const char *moduleName, int32_t id); +void moduleDataCreateEnd(const char *moduleName, int32_t id); + +/** + * Create NativeModule platform object + */ +void moduleCreateStart(const char *moduleName, int32_t id); +void moduleCreateCacheHit(const char *moduleName, int32_t id); +void moduleCreateConstructStart(const char *moduleName, int32_t id); +void moduleCreateConstructEnd(const char *moduleName, int32_t id); +void moduleCreateSetUpStart(const char *moduleName, int32_t id); +void moduleCreateSetUpEnd(const char *moduleName, int32_t id); +void moduleCreateEnd(const char *moduleName, int32_t id); +void moduleCreateFail(const char *moduleName, int32_t id); + +/** + * JS require beginning + */ +void moduleJSRequireBeginningStart(const char *moduleName); +void moduleJSRequireBeginningCacheHit(const char *moduleName); +void moduleJSRequireBeginningEnd(const char *moduleName); +void moduleJSRequireBeginningFail(const char *moduleName); + +/** + * JS require ending + */ +void moduleJSRequireEndingStart(const char *moduleName); +void moduleJSRequireEndingEnd(const char *moduleName); +void moduleJSRequireEndingFail(const char *moduleName); + +// Sync method calls +void syncMethodCallStart(const char *moduleName, const char *methodName); +void syncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallExecutionEnd(const char *moduleName, const char *methodName); +void syncMethodCallReturnConversionStart( + const char *moduleName, + const char *methodName); +void syncMethodCallReturnConversionEnd( + const char *moduleName, + const char *methodName); +void syncMethodCallEnd(const char *moduleName, const char *methodName); +void syncMethodCallFail(const char *moduleName, const char *methodName); + +// Async method calls +void asyncMethodCallStart(const char *moduleName, const char *methodName); +void asyncMethodCallArgConversionStart( + const char *moduleName, + const char *methodName); +void asyncMethodCallArgConversionEnd( + const char *moduleName, + const char *methodName); +void asyncMethodCallDispatch(const char *moduleName, const char *methodName); +void asyncMethodCallEnd(const char *moduleName, const char *methodName); +void asyncMethodCallFail(const char *moduleName, const char *methodName); + +/** + * Pre-processing async method call batch + */ +void asyncMethodCallBatchPreprocessStart(); +void asyncMethodCallBatchPreprocessEnd(int batchSize); + +// Async method call execution +void asyncMethodCallExecutionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionStart( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionArgConversionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionEnd( + const char *moduleName, + const char *methodName, + int32_t id); +void asyncMethodCallExecutionFail( + const char *moduleName, + const char *methodName, + int32_t id); + +} // namespace TurboModulePerfLogger +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModuleUtils.h b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModuleUtils.h new file mode 100644 index 0000000..0dc0813 --- /dev/null +++ b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/Headers/ReactCommon/TurboModuleUtils.h @@ -0,0 +1,142 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include + +#include + +#include +#include + +using namespace facebook; + +namespace facebook { +namespace react { + +jsi::Object deepCopyJSIObject(jsi::Runtime &rt, const jsi::Object &obj); +jsi::Array deepCopyJSIArray(jsi::Runtime &rt, const jsi::Array &arr); + +struct Promise : public LongLivedObject { + Promise(jsi::Runtime &rt, jsi::Function resolve, jsi::Function reject); + + void resolve(const jsi::Value &result); + void reject(const std::string &error); + + jsi::Runtime &runtime_; + jsi::Function resolve_; + jsi::Function reject_; +}; + +using PromiseSetupFunctionType = + std::function)>; +jsi::Value createPromiseAsJSIValue( + jsi::Runtime &rt, + const PromiseSetupFunctionType func); + +// Helper for passing jsi::Function arg to other methods. +class CallbackWrapper : public LongLivedObject { + private: + CallbackWrapper( + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) + : longLivedObjectCollection_(), + callback_(std::move(callback)), + runtime_(runtime), + jsInvoker_(std::move(jsInvoker)) {} + + CallbackWrapper( + std::shared_ptr longLivedObjectCollection, + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) + : longLivedObjectCollection_(longLivedObjectCollection), + callback_(std::move(callback)), + runtime_(runtime), + jsInvoker_(std::move(jsInvoker)) {} + + // Use a weak_ptr to avoid a retain cycle: LongLivedObjectCollection owns all + // CallbackWrappers. So, CallbackWrapper cannot own its + // LongLivedObjectCollection. + std::weak_ptr longLivedObjectCollection_; + jsi::Function callback_; + jsi::Runtime &runtime_; + std::shared_ptr jsInvoker_; + + public: + static std::weak_ptr createWeak( + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) { + auto wrapper = std::shared_ptr( + new CallbackWrapper(std::move(callback), runtime, jsInvoker)); + LongLivedObjectCollection::get().add(wrapper); + return wrapper; + } + + static std::weak_ptr createWeak( + std::shared_ptr longLivedObjectCollection, + jsi::Function &&callback, + jsi::Runtime &runtime, + std::shared_ptr jsInvoker) { + auto wrapper = std::shared_ptr(new CallbackWrapper( + longLivedObjectCollection, std::move(callback), runtime, jsInvoker)); + longLivedObjectCollection->add(wrapper); + return wrapper; + } + + // Delete the enclosed jsi::Function + void destroy() { + allowRelease(); + } + + jsi::Function &callback() { + return callback_; + } + + jsi::Runtime &runtime() { + return runtime_; + } + + CallInvoker &jsInvoker() { + return *(jsInvoker_); + } + + void allowRelease() override { + if (auto longLivedObjectCollection = longLivedObjectCollection_.lock()) { + if (longLivedObjectCollection != nullptr) { + longLivedObjectCollection->remove(this); + return; + } + } + LongLivedObject::allowRelease(); + } +}; + +class RAIICallbackWrapperDestroyer { + public: + RAIICallbackWrapperDestroyer(std::weak_ptr callbackWrapper) + : callbackWrapper_(callbackWrapper) {} + + ~RAIICallbackWrapperDestroyer() { + auto strongWrapper = callbackWrapper_.lock(); + if (!strongWrapper) { + return; + } + + strongWrapper->destroy(); + } + + private: + std::weak_ptr callbackWrapper_; +}; + +} // namespace react +} // namespace facebook diff --git a/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/libReactCommon.a b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/libReactCommon.a new file mode 100644 index 0000000..3c7ee27 Binary files /dev/null and b/Frameworks/ReactCommon.xcframework/ios-arm64_x86_64-simulator/libReactCommon.a differ diff --git a/Frameworks/ReactNativeART.xcframework/Info.plist b/Frameworks/ReactNativeART.xcframework/Info.plist new file mode 100644 index 0000000..80becfc --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReactNativeART.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReactNativeART.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libReactNativeART.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReactNativeART.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTBrush.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTBrush.h new file mode 100644 index 0000000..f6e39e8 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTBrush.h @@ -0,0 +1,33 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface ARTBrush : NSObject + +/* @abstract */ +- (instancetype)initWithArray:(NSArray *)data NS_DESIGNATED_INITIALIZER; + +/** + * For certain brushes we can fast path a combined fill and stroke. + * For those brushes we override applyFillColor which sets the fill + * color to be used by those batch paints. Those return YES. + * We can't batch gradient painting in CoreGraphics, so those will + * return NO and paint gets called instead. + * @abstract + */ +- (BOOL)applyFillColor:(CGContextRef)context; + +/** + * paint fills the context with a brush. The context is assumed to + * be clipped. + * @abstract + */ +- (void)paint:(CGContextRef)context; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTCGFloatArray.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTCGFloatArray.h new file mode 100644 index 0000000..b26bcb1 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTCGFloatArray.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// A little helper to make sure we have the right memory allocation ready for use. +// We assume that we will only this in one place so no reference counting is necessary. +// Needs to be freed when deallocated. + +// This is fragile since this relies on these values not getting reused. Consider +// wrapping these in an Obj-C class or some ARC hackery to get refcounting. + +typedef struct { + size_t count; + CGFloat *array; +} ARTCGFloatArray; diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTContainer.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTContainer.h new file mode 100644 index 0000000..5439d9f --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTContainer.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol ARTContainer + +// This is used as a hook for child to mark it's parent as dirty. +// This bubbles up to the root which gets marked as dirty. +- (void)invalidate; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTGroup.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTGroup.h new file mode 100644 index 0000000..31edddd --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTGroup.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTContainer.h" +#import "ARTNode.h" + +@interface ARTGroup : ARTNode + +@property (nonatomic, assign) CGRect clipping; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTGroupManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTGroupManager.h new file mode 100644 index 0000000..f518cf0 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTGroupManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTNodeManager.h" + +@interface ARTGroupManager : ARTNodeManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTLinearGradient.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTLinearGradient.h new file mode 100644 index 0000000..d289b19 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTLinearGradient.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTLinearGradient : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTNode.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTNode.h new file mode 100644 index 0000000..8c6a7a6 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTNode.h @@ -0,0 +1,31 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "ARTShadow.h" +/** + * ART nodes are implemented as empty UIViews but this is just an implementation detail to fit + * into the existing view management. They should also be shadow views and painted on a background + * thread. + */ + +@interface ARTNode : UIView + +@property (nonatomic, assign) CGFloat opacity; +@property (nonatomic, assign) ARTShadow shadow; + +- (void)invalidate; +- (void)renderTo:(CGContextRef)context; + +/** + * renderTo will take opacity into account and draw renderLayerTo off-screen if there is opacity + * specified, then composite that onto the context. renderLayerTo always draws at opacity=1. + * @abstract + */ +- (void)renderLayerTo:(CGContextRef)context; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTNodeManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTNodeManager.h new file mode 100644 index 0000000..84ef8fb --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTNodeManager.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class ARTNode; + +@interface ARTNodeManager : RCTViewManager + +- (ARTNode *)node; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTPattern.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTPattern.h new file mode 100644 index 0000000..11fa935 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTPattern.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTPattern : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRadialGradient.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRadialGradient.h new file mode 100644 index 0000000..98bec02 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRadialGradient.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTRadialGradient : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRenderable.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRenderable.h new file mode 100644 index 0000000..077d47e --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRenderable.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTBrush.h" +#import "ARTCGFloatArray.h" +#import "ARTNode.h" + +@interface ARTRenderable : ARTNode + +@property (nonatomic, strong) ARTBrush *fill; +@property (nonatomic, assign) CGColorRef stroke; +@property (nonatomic, assign) CGFloat strokeWidth; +@property (nonatomic, assign) CGLineCap strokeCap; +@property (nonatomic, assign) CGLineJoin strokeJoin; +@property (nonatomic, assign) ARTCGFloatArray strokeDash; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRenderableManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRenderableManager.h new file mode 100644 index 0000000..781ed32 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTRenderableManager.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTNodeManager.h" +#import "ARTRenderable.h" + +@interface ARTRenderableManager : ARTNodeManager + +- (ARTRenderable *)node; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShadow.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShadow.h new file mode 100644 index 0000000..2aa5b48 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShadow.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef struct { + CGSize offset; + CGFloat blur; + UIColor* color; +} ARTShadow; diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShape.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShape.h new file mode 100644 index 0000000..1a1fd42 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShape.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTRenderable.h" + +@interface ARTShape : ARTRenderable + +@property (nonatomic, assign) CGPathRef d; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShapeManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShapeManager.h new file mode 100644 index 0000000..cc514b1 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTShapeManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTRenderableManager.h" + +@interface ARTShapeManager : ARTRenderableManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSolidColor.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSolidColor.h new file mode 100644 index 0000000..9880cfd --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSolidColor.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTSolidColor : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSurfaceView.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSurfaceView.h new file mode 100644 index 0000000..34016b9 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSurfaceView.h @@ -0,0 +1,14 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTContainer.h" + +@interface ARTSurfaceView : UIView + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSurfaceViewManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSurfaceViewManager.h new file mode 100644 index 0000000..36d5949 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTSurfaceViewManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface ARTSurfaceViewManager : RCTViewManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTText.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTText.h new file mode 100644 index 0000000..1431fc5 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTText.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTRenderable.h" +#import "ARTTextFrame.h" + +@interface ARTText : ARTRenderable + +@property (nonatomic, assign) CTTextAlignment alignment; +@property (nonatomic, assign) ARTTextFrame textFrame; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTTextFrame.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTTextFrame.h new file mode 100644 index 0000000..00e61ce --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTTextFrame.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +// A little helper to make sure we have a set of lines including width ready for use. +// We assume that we will only this in one place so no reference counting is necessary. +// Needs to be freed when deallocated. + +// This is fragile since this relies on these values not getting reused. Consider +// wrapping these in an Obj-C class or some ARC hackery to get refcounting. + +typedef struct { + size_t count; + CGFloat baseLine; // Distance from the origin to the base line of the first line + CGFloat lineHeight; // Distance between lines + CTLineRef *lines; + CGFloat *widths; // Width of each line +} ARTTextFrame; diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTTextManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTTextManager.h new file mode 100644 index 0000000..343e669 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/ARTTextManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTRenderableManager.h" + +@interface ARTTextManager : ARTRenderableManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/RCTConvert+ART.h b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/RCTConvert+ART.h new file mode 100644 index 0000000..74b35df --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64/Headers/RCTConvert+ART.h @@ -0,0 +1,31 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "ARTBrush.h" +#import "ARTShadow.h" +#import "ARTCGFloatArray.h" +#import "ARTTextFrame.h" + +@interface RCTConvert (ART) + ++ (CGPathRef)CGPath:(id)json CF_RETURNS_NOT_RETAINED; ++ (CTTextAlignment)CTTextAlignment:(id)json; ++ (ARTTextFrame)ARTTextFrame:(id)json; ++ (ARTCGFloatArray)ARTCGFloatArray:(id)json; ++ (ARTBrush *)ARTBrush:(id)json; ++ (ARTShadow)ARTShadow:(id)json; + ++ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset; ++ (CGRect)CGRect:(id)json offset:(NSUInteger)offset; ++ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset CF_RETURNS_NOT_RETAINED; ++ (CGGradientRef)CGGradient:(id)json offset:(NSUInteger)offset CF_RETURNS_NOT_RETAINED; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64/libReactNativeART.a b/Frameworks/ReactNativeART.xcframework/ios-arm64/libReactNativeART.a new file mode 100644 index 0000000..be7b63f Binary files /dev/null and b/Frameworks/ReactNativeART.xcframework/ios-arm64/libReactNativeART.a differ diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTBrush.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTBrush.h new file mode 100644 index 0000000..f6e39e8 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTBrush.h @@ -0,0 +1,33 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +@interface ARTBrush : NSObject + +/* @abstract */ +- (instancetype)initWithArray:(NSArray *)data NS_DESIGNATED_INITIALIZER; + +/** + * For certain brushes we can fast path a combined fill and stroke. + * For those brushes we override applyFillColor which sets the fill + * color to be used by those batch paints. Those return YES. + * We can't batch gradient painting in CoreGraphics, so those will + * return NO and paint gets called instead. + * @abstract + */ +- (BOOL)applyFillColor:(CGContextRef)context; + +/** + * paint fills the context with a brush. The context is assumed to + * be clipped. + * @abstract + */ +- (void)paint:(CGContextRef)context; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTCGFloatArray.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTCGFloatArray.h new file mode 100644 index 0000000..b26bcb1 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTCGFloatArray.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +// A little helper to make sure we have the right memory allocation ready for use. +// We assume that we will only this in one place so no reference counting is necessary. +// Needs to be freed when deallocated. + +// This is fragile since this relies on these values not getting reused. Consider +// wrapping these in an Obj-C class or some ARC hackery to get refcounting. + +typedef struct { + size_t count; + CGFloat *array; +} ARTCGFloatArray; diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTContainer.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTContainer.h new file mode 100644 index 0000000..5439d9f --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTContainer.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol ARTContainer + +// This is used as a hook for child to mark it's parent as dirty. +// This bubbles up to the root which gets marked as dirty. +- (void)invalidate; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTGroup.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTGroup.h new file mode 100644 index 0000000..31edddd --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTGroup.h @@ -0,0 +1,17 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTContainer.h" +#import "ARTNode.h" + +@interface ARTGroup : ARTNode + +@property (nonatomic, assign) CGRect clipping; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTGroupManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTGroupManager.h new file mode 100644 index 0000000..f518cf0 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTGroupManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTNodeManager.h" + +@interface ARTGroupManager : ARTNodeManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTLinearGradient.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTLinearGradient.h new file mode 100644 index 0000000..d289b19 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTLinearGradient.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTLinearGradient : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTNode.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTNode.h new file mode 100644 index 0000000..8c6a7a6 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTNode.h @@ -0,0 +1,31 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "ARTShadow.h" +/** + * ART nodes are implemented as empty UIViews but this is just an implementation detail to fit + * into the existing view management. They should also be shadow views and painted on a background + * thread. + */ + +@interface ARTNode : UIView + +@property (nonatomic, assign) CGFloat opacity; +@property (nonatomic, assign) ARTShadow shadow; + +- (void)invalidate; +- (void)renderTo:(CGContextRef)context; + +/** + * renderTo will take opacity into account and draw renderLayerTo off-screen if there is opacity + * specified, then composite that onto the context. renderLayerTo always draws at opacity=1. + * @abstract + */ +- (void)renderLayerTo:(CGContextRef)context; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTNodeManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTNodeManager.h new file mode 100644 index 0000000..84ef8fb --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTNodeManager.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@class ARTNode; + +@interface ARTNodeManager : RCTViewManager + +- (ARTNode *)node; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTPattern.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTPattern.h new file mode 100644 index 0000000..11fa935 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTPattern.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTPattern : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRadialGradient.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRadialGradient.h new file mode 100644 index 0000000..98bec02 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRadialGradient.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTRadialGradient : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRenderable.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRenderable.h new file mode 100644 index 0000000..077d47e --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRenderable.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTBrush.h" +#import "ARTCGFloatArray.h" +#import "ARTNode.h" + +@interface ARTRenderable : ARTNode + +@property (nonatomic, strong) ARTBrush *fill; +@property (nonatomic, assign) CGColorRef stroke; +@property (nonatomic, assign) CGFloat strokeWidth; +@property (nonatomic, assign) CGLineCap strokeCap; +@property (nonatomic, assign) CGLineJoin strokeJoin; +@property (nonatomic, assign) ARTCGFloatArray strokeDash; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRenderableManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRenderableManager.h new file mode 100644 index 0000000..781ed32 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTRenderableManager.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTNodeManager.h" +#import "ARTRenderable.h" + +@interface ARTRenderableManager : ARTNodeManager + +- (ARTRenderable *)node; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShadow.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShadow.h new file mode 100644 index 0000000..2aa5b48 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShadow.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +typedef struct { + CGSize offset; + CGFloat blur; + UIColor* color; +} ARTShadow; diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShape.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShape.h new file mode 100644 index 0000000..1a1fd42 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShape.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTRenderable.h" + +@interface ARTShape : ARTRenderable + +@property (nonatomic, assign) CGPathRef d; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShapeManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShapeManager.h new file mode 100644 index 0000000..cc514b1 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTShapeManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTRenderableManager.h" + +@interface ARTShapeManager : ARTRenderableManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSolidColor.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSolidColor.h new file mode 100644 index 0000000..9880cfd --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSolidColor.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTBrush.h" + +@interface ARTSolidColor : ARTBrush + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSurfaceView.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSurfaceView.h new file mode 100644 index 0000000..34016b9 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSurfaceView.h @@ -0,0 +1,14 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTContainer.h" + +@interface ARTSurfaceView : UIView + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSurfaceViewManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSurfaceViewManager.h new file mode 100644 index 0000000..36d5949 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTSurfaceViewManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface ARTSurfaceViewManager : RCTViewManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTText.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTText.h new file mode 100644 index 0000000..1431fc5 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTText.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import "ARTRenderable.h" +#import "ARTTextFrame.h" + +@interface ARTText : ARTRenderable + +@property (nonatomic, assign) CTTextAlignment alignment; +@property (nonatomic, assign) ARTTextFrame textFrame; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTTextFrame.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTTextFrame.h new file mode 100644 index 0000000..00e61ce --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTTextFrame.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +// A little helper to make sure we have a set of lines including width ready for use. +// We assume that we will only this in one place so no reference counting is necessary. +// Needs to be freed when deallocated. + +// This is fragile since this relies on these values not getting reused. Consider +// wrapping these in an Obj-C class or some ARC hackery to get refcounting. + +typedef struct { + size_t count; + CGFloat baseLine; // Distance from the origin to the base line of the first line + CGFloat lineHeight; // Distance between lines + CTLineRef *lines; + CGFloat *widths; // Width of each line +} ARTTextFrame; diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTTextManager.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTTextManager.h new file mode 100644 index 0000000..343e669 --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/ARTTextManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import "ARTRenderableManager.h" + +@interface ARTTextManager : ARTRenderableManager + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+ART.h b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+ART.h new file mode 100644 index 0000000..74b35df --- /dev/null +++ b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+ART.h @@ -0,0 +1,31 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +#import "ARTBrush.h" +#import "ARTShadow.h" +#import "ARTCGFloatArray.h" +#import "ARTTextFrame.h" + +@interface RCTConvert (ART) + ++ (CGPathRef)CGPath:(id)json CF_RETURNS_NOT_RETAINED; ++ (CTTextAlignment)CTTextAlignment:(id)json; ++ (ARTTextFrame)ARTTextFrame:(id)json; ++ (ARTCGFloatArray)ARTCGFloatArray:(id)json; ++ (ARTBrush *)ARTBrush:(id)json; ++ (ARTShadow)ARTShadow:(id)json; + ++ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset; ++ (CGRect)CGRect:(id)json offset:(NSUInteger)offset; ++ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset CF_RETURNS_NOT_RETAINED; ++ (CGGradientRef)CGGradient:(id)json offset:(NSUInteger)offset CF_RETURNS_NOT_RETAINED; + +@end diff --git a/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/libReactNativeART.a b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/libReactNativeART.a new file mode 100644 index 0000000..f7c275f Binary files /dev/null and b/Frameworks/ReactNativeART.xcframework/ios-arm64_x86_64-simulator/libReactNativeART.a differ diff --git a/Frameworks/ReactNativeDarkMode.xcframework/Info.plist b/Frameworks/ReactNativeDarkMode.xcframework/Info.plist new file mode 100644 index 0000000..c513161 --- /dev/null +++ b/Frameworks/ReactNativeDarkMode.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libReactNativeDarkMode.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libReactNativeDarkMode.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libReactNativeDarkMode.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libReactNativeDarkMode.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/Headers/RNDarkMode.h b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/Headers/RNDarkMode.h new file mode 100644 index 0000000..3f610a7 --- /dev/null +++ b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/Headers/RNDarkMode.h @@ -0,0 +1,10 @@ +#import +#import + +#import "UIScreen+RNDarkModeTraitChangeListener.h" + +@interface RNDarkMode : RCTEventEmitter + +- (void)currentModeChanged:(NSString *)newMode; + +@end diff --git a/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/Headers/UIScreen+RNDarkModeTraitChangeListener.h b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/Headers/UIScreen+RNDarkModeTraitChangeListener.h new file mode 100644 index 0000000..b13cc62 --- /dev/null +++ b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/Headers/UIScreen+RNDarkModeTraitChangeListener.h @@ -0,0 +1,17 @@ +#import + +#import "RNDarkMode.h" + +typedef NS_ENUM(NSInteger, RNDarkModeMode) { + RNDarkModeModeLight, + RNDarkModeModeDark, +}; + +@class RNDarkMode; + +@interface UIScreen (RNDarkModeTraitChangeListener) + ++ (NSString *)getCurrentMode; ++ (void)setCurrentManager:(RNDarkMode *)manager; + +@end diff --git a/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/libReactNativeDarkMode.a b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/libReactNativeDarkMode.a new file mode 100644 index 0000000..c881c7f Binary files /dev/null and b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64/libReactNativeDarkMode.a differ diff --git a/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/Headers/RNDarkMode.h b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/Headers/RNDarkMode.h new file mode 100644 index 0000000..3f610a7 --- /dev/null +++ b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/Headers/RNDarkMode.h @@ -0,0 +1,10 @@ +#import +#import + +#import "UIScreen+RNDarkModeTraitChangeListener.h" + +@interface RNDarkMode : RCTEventEmitter + +- (void)currentModeChanged:(NSString *)newMode; + +@end diff --git a/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/Headers/UIScreen+RNDarkModeTraitChangeListener.h b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/Headers/UIScreen+RNDarkModeTraitChangeListener.h new file mode 100644 index 0000000..b13cc62 --- /dev/null +++ b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/Headers/UIScreen+RNDarkModeTraitChangeListener.h @@ -0,0 +1,17 @@ +#import + +#import "RNDarkMode.h" + +typedef NS_ENUM(NSInteger, RNDarkModeMode) { + RNDarkModeModeLight, + RNDarkModeModeDark, +}; + +@class RNDarkMode; + +@interface UIScreen (RNDarkModeTraitChangeListener) + ++ (NSString *)getCurrentMode; ++ (void)setCurrentManager:(RNDarkMode *)manager; + +@end diff --git a/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/libReactNativeDarkMode.a b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/libReactNativeDarkMode.a new file mode 100644 index 0000000..e596c87 Binary files /dev/null and b/Frameworks/ReactNativeDarkMode.xcframework/ios-arm64_x86_64-simulator/libReactNativeDarkMode.a differ diff --git a/Frameworks/TextToSpeech.xcframework/Info.plist b/Frameworks/TextToSpeech.xcframework/Info.plist new file mode 100644 index 0000000..77539de --- /dev/null +++ b/Frameworks/TextToSpeech.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libTextToSpeech.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libTextToSpeech.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libTextToSpeech.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libTextToSpeech.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/TextToSpeech.xcframework/ios-arm64/Headers/TextToSpeech.h b/Frameworks/TextToSpeech.xcframework/ios-arm64/Headers/TextToSpeech.h new file mode 100644 index 0000000..25bd220 --- /dev/null +++ b/Frameworks/TextToSpeech.xcframework/ios-arm64/Headers/TextToSpeech.h @@ -0,0 +1,20 @@ +// +// TextToSpeech.h +// TextToSpeech +// +// Created by Anton Krasovsky on 27/09/2016. +// Copyright © 2016 Anton Krasovsky. All rights reserved. +// + +#import +#import + +@import AVFoundation; + +@interface TextToSpeech : RCTEventEmitter +@property (nonatomic, strong) AVSpeechSynthesizer *synthesizer; +@property (nonatomic, strong) AVSpeechSynthesisVoice *defaultVoice; +@property (nonatomic) float defaultRate; +@property (nonatomic) float defaultPitch; +@property (nonatomic) bool ducking; +@end diff --git a/Frameworks/TextToSpeech.xcframework/ios-arm64/libTextToSpeech.a b/Frameworks/TextToSpeech.xcframework/ios-arm64/libTextToSpeech.a new file mode 100644 index 0000000..2481e17 Binary files /dev/null and b/Frameworks/TextToSpeech.xcframework/ios-arm64/libTextToSpeech.a differ diff --git a/Frameworks/TextToSpeech.xcframework/ios-arm64_x86_64-simulator/Headers/TextToSpeech.h b/Frameworks/TextToSpeech.xcframework/ios-arm64_x86_64-simulator/Headers/TextToSpeech.h new file mode 100644 index 0000000..25bd220 --- /dev/null +++ b/Frameworks/TextToSpeech.xcframework/ios-arm64_x86_64-simulator/Headers/TextToSpeech.h @@ -0,0 +1,20 @@ +// +// TextToSpeech.h +// TextToSpeech +// +// Created by Anton Krasovsky on 27/09/2016. +// Copyright © 2016 Anton Krasovsky. All rights reserved. +// + +#import +#import + +@import AVFoundation; + +@interface TextToSpeech : RCTEventEmitter +@property (nonatomic, strong) AVSpeechSynthesizer *synthesizer; +@property (nonatomic, strong) AVSpeechSynthesisVoice *defaultVoice; +@property (nonatomic) float defaultRate; +@property (nonatomic) float defaultPitch; +@property (nonatomic) bool ducking; +@end diff --git a/Frameworks/TextToSpeech.xcframework/ios-arm64_x86_64-simulator/libTextToSpeech.a b/Frameworks/TextToSpeech.xcframework/ios-arm64_x86_64-simulator/libTextToSpeech.a new file mode 100644 index 0000000..9d3b61b Binary files /dev/null and b/Frameworks/TextToSpeech.xcframework/ios-arm64_x86_64-simulator/libTextToSpeech.a differ diff --git a/Frameworks/Yoga.xcframework/Info.plist b/Frameworks/Yoga.xcframework/Info.plist new file mode 100644 index 0000000..3e26cb0 --- /dev/null +++ b/Frameworks/Yoga.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libYoga.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libYoga.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libYoga.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libYoga.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/Yoga-umbrella.h b/Frameworks/Yoga.xcframework/ios-arm64/Headers/Yoga-umbrella.h new file mode 100644 index 0000000..65d28e5 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/Yoga-umbrella.h @@ -0,0 +1,22 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "yoga/YGEnums.h" +#import "yoga/YGMacros.h" +#import "yoga/YGNode.h" +#import "yoga/YGStyle.h" +#import "yoga/YGValue.h" +#import "yoga/Yoga.h" + +FOUNDATION_EXPORT double yogaVersionNumber; +FOUNDATION_EXPORT const unsigned char yogaVersionString[]; + diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/Yoga.modulemap b/Frameworks/Yoga.xcframework/ios-arm64/Headers/Yoga.modulemap new file mode 100644 index 0000000..b47796c --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/Yoga.modulemap @@ -0,0 +1,6 @@ +module yoga { + umbrella header "Yoga-umbrella.h" + + export * + module * { export * } +} diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGEnums.h b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGEnums.h new file mode 100644 index 0000000..3dc458d --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGEnums.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include "YGMacros.h" + +#ifdef __cplusplus +namespace facebook { +namespace yoga { +namespace enums { + +template +constexpr int count(); // can't use `= delete` due to a defect in clang < 3.9 + +namespace detail { +template +constexpr int n() { + return sizeof...(xs); +} +} // namespace detail + +} // namespace enums +} // namespace yoga +} // namespace facebook +#endif + +#define YG_ENUM_DECL(NAME, ...) \ + typedef YG_ENUM_BEGIN(NAME){__VA_ARGS__} YG_ENUM_END(NAME); \ + WIN_EXPORT const char* NAME##ToString(NAME); + +#ifdef __cplusplus +#define YG_ENUM_SEQ_DECL(NAME, ...) \ + YG_ENUM_DECL(NAME, __VA_ARGS__) \ + YG_EXTERN_C_END \ + namespace facebook { \ + namespace yoga { \ + namespace enums { \ + template <> \ + constexpr int count() { \ + return detail::n<__VA_ARGS__>(); \ + } \ + } \ + } \ + } \ + YG_EXTERN_C_BEGIN +#else +#define YG_ENUM_SEQ_DECL YG_ENUM_DECL +#endif + +YG_EXTERN_C_BEGIN + +YG_ENUM_SEQ_DECL( + YGAlign, + YGAlignAuto, + YGAlignFlexStart, + YGAlignCenter, + YGAlignFlexEnd, + YGAlignStretch, + YGAlignBaseline, + YGAlignSpaceBetween, + YGAlignSpaceAround); + +YG_ENUM_SEQ_DECL(YGDimension, YGDimensionWidth, YGDimensionHeight) + +YG_ENUM_SEQ_DECL( + YGDirection, + YGDirectionInherit, + YGDirectionLTR, + YGDirectionRTL) + +YG_ENUM_SEQ_DECL(YGDisplay, YGDisplayFlex, YGDisplayNone) + +YG_ENUM_SEQ_DECL( + YGEdge, + YGEdgeLeft, + YGEdgeTop, + YGEdgeRight, + YGEdgeBottom, + YGEdgeStart, + YGEdgeEnd, + YGEdgeHorizontal, + YGEdgeVertical, + YGEdgeAll) + +YG_ENUM_SEQ_DECL(YGExperimentalFeature, YGExperimentalFeatureWebFlexBasis) + +YG_ENUM_SEQ_DECL( + YGFlexDirection, + YGFlexDirectionColumn, + YGFlexDirectionColumnReverse, + YGFlexDirectionRow, + YGFlexDirectionRowReverse) + +YG_ENUM_SEQ_DECL( + YGJustify, + YGJustifyFlexStart, + YGJustifyCenter, + YGJustifyFlexEnd, + YGJustifySpaceBetween, + YGJustifySpaceAround, + YGJustifySpaceEvenly) + +YG_ENUM_SEQ_DECL( + YGLogLevel, + YGLogLevelError, + YGLogLevelWarn, + YGLogLevelInfo, + YGLogLevelDebug, + YGLogLevelVerbose, + YGLogLevelFatal) + +YG_ENUM_SEQ_DECL( + YGMeasureMode, + YGMeasureModeUndefined, + YGMeasureModeExactly, + YGMeasureModeAtMost) + +YG_ENUM_SEQ_DECL(YGNodeType, YGNodeTypeDefault, YGNodeTypeText) + +YG_ENUM_SEQ_DECL( + YGOverflow, + YGOverflowVisible, + YGOverflowHidden, + YGOverflowScroll) + +YG_ENUM_SEQ_DECL( + YGPositionType, + YGPositionTypeStatic, + YGPositionTypeRelative, + YGPositionTypeAbsolute) + +YG_ENUM_DECL( + YGPrintOptions, + YGPrintOptionsLayout = 1, + YGPrintOptionsStyle = 2, + YGPrintOptionsChildren = 4) + +YG_ENUM_SEQ_DECL( + YGUnit, + YGUnitUndefined, + YGUnitPoint, + YGUnitPercent, + YGUnitAuto) + +YG_ENUM_SEQ_DECL(YGWrap, YGWrapNoWrap, YGWrapWrap, YGWrapWrapReverse) + +YG_EXTERN_C_END + +#undef YG_ENUM_DECL +#undef YG_ENUM_SEQ_DECL diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGMacros.h b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGMacros.h new file mode 100644 index 0000000..c6917f1 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGMacros.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __cplusplus +#define YG_EXTERN_C_BEGIN extern "C" { +#define YG_EXTERN_C_END } +#else +#define YG_EXTERN_C_BEGIN +#define YG_EXTERN_C_END +#endif + +#ifdef _WINDLL +#define WIN_EXPORT __declspec(dllexport) +#else +#define WIN_EXPORT +#endif + +#ifndef YOGA_EXPORT +#ifdef _MSC_VER +#define YOGA_EXPORT +#else +#define YOGA_EXPORT __attribute__((visibility("default"))) +#endif +#endif + +#ifdef NS_ENUM +// Cannot use NSInteger as NSInteger has a different size than int (which is the +// default type of a enum). Therefor when linking the Yoga C library into obj-c +// the header is a missmatch for the Yoga ABI. +#define YG_ENUM_BEGIN(name) NS_ENUM(int, name) +#define YG_ENUM_END(name) +#else +#define YG_ENUM_BEGIN(name) enum name +#define YG_ENUM_END(name) name +#endif + +#ifdef __GNUC__ +#define YG_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +#define YG_DEPRECATED __declspec(deprecated) +#elif __cplusplus >= 201402L +#if defined(__has_cpp_attribute) +#if __has_cpp_attribute(deprecated) +#define YG_DEPRECATED [[deprecated]] +#endif +#endif +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGNode.h b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGNode.h new file mode 100644 index 0000000..4b6e627 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGNode.h @@ -0,0 +1,348 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __cplusplus + +#include +#include +#include "BitUtils.h" +#include "CompactValue.h" +#include "YGConfig.h" +#include "YGLayout.h" +#include "YGStyle.h" +#include "YGMacros.h" +#include "Yoga-internal.h" + +YGConfigRef YGConfigGetDefault(); + +struct YOGA_EXPORT YGNode { + using MeasureWithContextFn = + YGSize (*)(YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*); + using BaselineWithContextFn = float (*)(YGNode*, float, float, void*); + using PrintWithContextFn = void (*)(YGNode*, void*); + +private: + static constexpr size_t hasNewLayout_ = 0; + static constexpr size_t isReferenceBaseline_ = 1; + static constexpr size_t isDirty_ = 2; + static constexpr size_t nodeType_ = 3; + static constexpr size_t measureUsesContext_ = 4; + static constexpr size_t baselineUsesContext_ = 5; + static constexpr size_t printUsesContext_ = 6; + static constexpr size_t useWebDefaults_ = 7; + + void* context_ = nullptr; + uint8_t flags = 1; + uint8_t reserved_ = 0; + union { + YGMeasureFunc noContext; + MeasureWithContextFn withContext; + } measure_ = {nullptr}; + union { + YGBaselineFunc noContext; + BaselineWithContextFn withContext; + } baseline_ = {nullptr}; + union { + YGPrintFunc noContext; + PrintWithContextFn withContext; + } print_ = {nullptr}; + YGDirtiedFunc dirtied_ = nullptr; + YGStyle style_ = {}; + YGLayout layout_ = {}; + uint32_t lineIndex_ = 0; + YGNodeRef owner_ = nullptr; + YGVector children_ = {}; + YGConfigRef config_; + std::array resolvedDimensions_ = { + {YGValueUndefined, YGValueUndefined}}; + + YGFloatOptional relativePosition( + const YGFlexDirection axis, + const float axisSize) const; + + void setMeasureFunc(decltype(measure_)); + void setBaselineFunc(decltype(baseline_)); + + void useWebDefaults() { + facebook::yoga::detail::setBooleanData(flags, useWebDefaults_, true); + style_.flexDirection() = YGFlexDirectionRow; + style_.alignContent() = YGAlignStretch; + } + + // DANGER DANGER DANGER! + // If the node assigned to has children, we'd either have to deallocate + // them (potentially incorrect) or ignore them (danger of leaks). Only ever + // use this after checking that there are no children. + // DO NOT CHANGE THE VISIBILITY OF THIS METHOD! + YGNode& operator=(YGNode&&) = default; + + using CompactValue = facebook::yoga::detail::CompactValue; + +public: + YGNode() : YGNode{YGConfigGetDefault()} {} + explicit YGNode(const YGConfigRef config) : config_{config} { + if (config->useWebDefaults) { + useWebDefaults(); + } + }; + ~YGNode() = default; // cleanup of owner/children relationships in YGNodeFree + + YGNode(YGNode&&); + + // Does not expose true value semantics, as children are not cloned eagerly. + // Should we remove this? + YGNode(const YGNode& node) = default; + + // for RB fabric + YGNode(const YGNode& node, YGConfigRef config); + + // assignment means potential leaks of existing children, or alternatively + // freeing unowned memory, double free, or freeing stack memory. + YGNode& operator=(const YGNode&) = delete; + + // Getters + void* getContext() const { return context_; } + + uint8_t& reserved() { return reserved_; } + uint8_t reserved() const { return reserved_; } + + void print(void*); + + bool getHasNewLayout() const { + return facebook::yoga::detail::getBooleanData(flags, hasNewLayout_); + } + + YGNodeType getNodeType() const { + return facebook::yoga::detail::getEnumData(flags, nodeType_); + } + + bool hasMeasureFunc() const noexcept { return measure_.noContext != nullptr; } + + YGSize measure(float, YGMeasureMode, float, YGMeasureMode, void*); + + bool hasBaselineFunc() const noexcept { + return baseline_.noContext != nullptr; + } + + float baseline(float width, float height, void* layoutContext); + + YGDirtiedFunc getDirtied() const { return dirtied_; } + + // For Performance reasons passing as reference. + YGStyle& getStyle() { return style_; } + + const YGStyle& getStyle() const { return style_; } + + // For Performance reasons passing as reference. + YGLayout& getLayout() { return layout_; } + + const YGLayout& getLayout() const { return layout_; } + + uint32_t getLineIndex() const { return lineIndex_; } + + bool isReferenceBaseline() { + return facebook::yoga::detail::getBooleanData(flags, isReferenceBaseline_); + } + + // returns the YGNodeRef that owns this YGNode. An owner is used to identify + // the YogaTree that a YGNode belongs to. This method will return the parent + // of the YGNode when a YGNode only belongs to one YogaTree or nullptr when + // the YGNode is shared between two or more YogaTrees. + YGNodeRef getOwner() const { return owner_; } + + // Deprecated, use getOwner() instead. + YGNodeRef getParent() const { return getOwner(); } + + const YGVector& getChildren() const { return children_; } + + // Applies a callback to all children, after cloning them if they are not + // owned. + template + void iterChildrenAfterCloningIfNeeded(T callback, void* cloneContext) { + int i = 0; + for (YGNodeRef& child : children_) { + if (child->getOwner() != this) { + child = config_->cloneNode(child, this, i, cloneContext); + child->setOwner(this); + } + i += 1; + + callback(child, cloneContext); + } + } + + YGNodeRef getChild(uint32_t index) const { return children_.at(index); } + + YGConfigRef getConfig() const { return config_; } + + bool isDirty() const { + return facebook::yoga::detail::getBooleanData(flags, isDirty_); + } + + std::array getResolvedDimensions() const { + return resolvedDimensions_; + } + + YGValue getResolvedDimension(int index) const { + return resolvedDimensions_[index]; + } + + static CompactValue computeEdgeValueForColumn( + const YGStyle::Edges& edges, + YGEdge edge, + CompactValue defaultValue); + + static CompactValue computeEdgeValueForRow( + const YGStyle::Edges& edges, + YGEdge rowEdge, + YGEdge edge, + CompactValue defaultValue); + + // Methods related to positions, margin, padding and border + YGFloatOptional getLeadingPosition( + const YGFlexDirection axis, + const float axisSize) const; + bool isLeadingPositionDefined(const YGFlexDirection axis) const; + bool isTrailingPosDefined(const YGFlexDirection axis) const; + YGFloatOptional getTrailingPosition( + const YGFlexDirection axis, + const float axisSize) const; + YGFloatOptional getLeadingMargin( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getTrailingMargin( + const YGFlexDirection axis, + const float widthSize) const; + float getLeadingBorder(const YGFlexDirection flexDirection) const; + float getTrailingBorder(const YGFlexDirection flexDirection) const; + YGFloatOptional getLeadingPadding( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getTrailingPadding( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getLeadingPaddingAndBorder( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getTrailingPaddingAndBorder( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getMarginForAxis( + const YGFlexDirection axis, + const float widthSize) const; + // Setters + + void setContext(void* context) { context_ = context; } + + void setPrintFunc(YGPrintFunc printFunc) { + print_.noContext = printFunc; + facebook::yoga::detail::setBooleanData(flags, printUsesContext_, false); + } + void setPrintFunc(PrintWithContextFn printFunc) { + print_.withContext = printFunc; + facebook::yoga::detail::setBooleanData(flags, printUsesContext_, true); + } + void setPrintFunc(std::nullptr_t) { setPrintFunc(YGPrintFunc{nullptr}); } + + void setHasNewLayout(bool hasNewLayout) { + facebook::yoga::detail::setBooleanData(flags, hasNewLayout_, hasNewLayout); + } + + void setNodeType(YGNodeType nodeType) { + return facebook::yoga::detail::setEnumData( + flags, nodeType_, nodeType); + } + + void setMeasureFunc(YGMeasureFunc measureFunc); + void setMeasureFunc(MeasureWithContextFn); + void setMeasureFunc(std::nullptr_t) { + return setMeasureFunc(YGMeasureFunc{nullptr}); + } + + void setBaselineFunc(YGBaselineFunc baseLineFunc) { + facebook::yoga::detail::setBooleanData(flags, baselineUsesContext_, false); + baseline_.noContext = baseLineFunc; + } + void setBaselineFunc(BaselineWithContextFn baseLineFunc) { + facebook::yoga::detail::setBooleanData(flags, baselineUsesContext_, true); + baseline_.withContext = baseLineFunc; + } + void setBaselineFunc(std::nullptr_t) { + return setBaselineFunc(YGBaselineFunc{nullptr}); + } + + void setDirtiedFunc(YGDirtiedFunc dirtiedFunc) { dirtied_ = dirtiedFunc; } + + void setStyle(const YGStyle& style) { style_ = style; } + + void setLayout(const YGLayout& layout) { layout_ = layout; } + + void setLineIndex(uint32_t lineIndex) { lineIndex_ = lineIndex; } + + void setIsReferenceBaseline(bool isReferenceBaseline) { + facebook::yoga::detail::setBooleanData( + flags, isReferenceBaseline_, isReferenceBaseline); + } + + void setOwner(YGNodeRef owner) { owner_ = owner; } + + void setChildren(const YGVector& children) { children_ = children; } + + // TODO: rvalue override for setChildren + + YG_DEPRECATED void setConfig(YGConfigRef config) { config_ = config; } + + void setDirty(bool isDirty); + void setLayoutLastOwnerDirection(YGDirection direction); + void setLayoutComputedFlexBasis(const YGFloatOptional computedFlexBasis); + void setLayoutComputedFlexBasisGeneration( + uint32_t computedFlexBasisGeneration); + void setLayoutMeasuredDimension(float measuredDimension, int index); + void setLayoutHadOverflow(bool hadOverflow); + void setLayoutDimension(float dimension, int index); + void setLayoutDirection(YGDirection direction); + void setLayoutMargin(float margin, int index); + void setLayoutBorder(float border, int index); + void setLayoutPadding(float padding, int index); + void setLayoutPosition(float position, int index); + void setPosition( + const YGDirection direction, + const float mainSize, + const float crossSize, + const float ownerWidth); + void setLayoutDoesLegacyFlagAffectsLayout(bool doesLegacyFlagAffectsLayout); + void setLayoutDidUseLegacyFlag(bool didUseLegacyFlag); + void markDirtyAndPropogateDownwards(); + + // Other methods + YGValue marginLeadingValue(const YGFlexDirection axis) const; + YGValue marginTrailingValue(const YGFlexDirection axis) const; + YGValue resolveFlexBasisPtr() const; + void resolveDimension(); + YGDirection resolveDirection(const YGDirection ownerDirection); + void clearChildren(); + /// Replaces the occurrences of oldChild with newChild + void replaceChild(YGNodeRef oldChild, YGNodeRef newChild); + void replaceChild(YGNodeRef child, uint32_t index); + void insertChild(YGNodeRef child, uint32_t index); + /// Removes the first occurrence of child + bool removeChild(YGNodeRef child); + void removeChild(uint32_t index); + + void cloneChildrenIfNeeded(void*); + void markDirtyAndPropogate(); + float resolveFlexGrow() const; + float resolveFlexShrink() const; + bool isNodeFlexible(); + bool didUseLegacyFlag(); + bool isLayoutTreeEqualToNode(const YGNode& node) const; + void reset(); +}; + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGStyle.h b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGStyle.h new file mode 100644 index 0000000..aab7599 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGStyle.h @@ -0,0 +1,236 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __cplusplus + +#include +#include +#include +#include +#include "CompactValue.h" +#include "YGEnums.h" +#include "YGFloatOptional.h" +#include "Yoga-internal.h" +#include "Yoga.h" +#include "BitUtils.h" + +class YOGA_EXPORT YGStyle { + template + using Values = + facebook::yoga::detail::Values()>; + using CompactValue = facebook::yoga::detail::CompactValue; + +public: + using Dimensions = Values; + using Edges = Values; + + template + struct BitfieldRef { + YGStyle& style; + size_t offset; + operator T() const { + return facebook::yoga::detail::getEnumData(style.flags, offset); + } + BitfieldRef& operator=(T x) { + facebook::yoga::detail::setEnumData(style.flags, offset, x); + return *this; + } + }; + + template + struct Ref { + YGStyle& style; + operator T() const { return style.*Prop; } + Ref& operator=(T value) { + style.*Prop = value; + return *this; + } + }; + + template YGStyle::*Prop> + struct IdxRef { + struct Ref { + YGStyle& style; + Idx idx; + operator CompactValue() const { return (style.*Prop)[idx]; } + operator YGValue() const { return (style.*Prop)[idx]; } + Ref& operator=(CompactValue value) { + (style.*Prop)[idx] = value; + return *this; + } + }; + + YGStyle& style; + IdxRef& operator=(const Values& values) { + style.*Prop = values; + return *this; + } + operator const Values&() const { return style.*Prop; } + Ref operator[](Idx idx) { return {style, idx}; } + CompactValue operator[](Idx idx) const { return (style.*Prop)[idx]; } + }; + + YGStyle() { + alignContent() = YGAlignFlexStart; + alignItems() = YGAlignStretch; + } + ~YGStyle() = default; + +private: + static constexpr size_t directionOffset = 0; + static constexpr size_t flexdirectionOffset = + directionOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t justifyContentOffset = flexdirectionOffset + + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t alignContentOffset = + justifyContentOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t alignItemsOffset = + alignContentOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t alignSelfOffset = + alignItemsOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t positionTypeOffset = + alignSelfOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t flexWrapOffset = + positionTypeOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t overflowOffset = + flexWrapOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t displayOffset = + overflowOffset + facebook::yoga::detail::bitWidthFn(); + + uint32_t flags = 0; + + YGFloatOptional flex_ = {}; + YGFloatOptional flexGrow_ = {}; + YGFloatOptional flexShrink_ = {}; + CompactValue flexBasis_ = CompactValue::ofAuto(); + Edges margin_ = {}; + Edges position_ = {}; + Edges padding_ = {}; + Edges border_ = {}; + Dimensions dimensions_{CompactValue::ofAuto()}; + Dimensions minDimensions_ = {}; + Dimensions maxDimensions_ = {}; + // Yoga specific properties, not compatible with flexbox specification + YGFloatOptional aspectRatio_ = {}; + +public: + // for library users needing a type + using ValueRepr = std::remove_reference::type; + + YGDirection direction() const { + return facebook::yoga::detail::getEnumData( + flags, directionOffset); + } + BitfieldRef direction() { return {*this, directionOffset}; } + + YGFlexDirection flexDirection() const { + return facebook::yoga::detail::getEnumData( + flags, flexdirectionOffset); + } + BitfieldRef flexDirection() { + return {*this, flexdirectionOffset}; + } + + YGJustify justifyContent() const { + return facebook::yoga::detail::getEnumData( + flags, justifyContentOffset); + } + BitfieldRef justifyContent() { + return {*this, justifyContentOffset}; + } + + YGAlign alignContent() const { + return facebook::yoga::detail::getEnumData( + flags, alignContentOffset); + } + BitfieldRef alignContent() { return {*this, alignContentOffset}; } + + YGAlign alignItems() const { + return facebook::yoga::detail::getEnumData( + flags, alignItemsOffset); + } + BitfieldRef alignItems() { return {*this, alignItemsOffset}; } + + YGAlign alignSelf() const { + return facebook::yoga::detail::getEnumData(flags, alignSelfOffset); + } + BitfieldRef alignSelf() { return {*this, alignSelfOffset}; } + + YGPositionType positionType() const { + return facebook::yoga::detail::getEnumData( + flags, positionTypeOffset); + } + BitfieldRef positionType() { + return {*this, positionTypeOffset}; + } + + YGWrap flexWrap() const { + return facebook::yoga::detail::getEnumData(flags, flexWrapOffset); + } + BitfieldRef flexWrap() { return {*this, flexWrapOffset}; } + + YGOverflow overflow() const { + return facebook::yoga::detail::getEnumData( + flags, overflowOffset); + } + BitfieldRef overflow() { return {*this, overflowOffset}; } + + YGDisplay display() const { + return facebook::yoga::detail::getEnumData(flags, displayOffset); + } + BitfieldRef display() { return {*this, displayOffset}; } + + YGFloatOptional flex() const { return flex_; } + Ref flex() { return {*this}; } + + YGFloatOptional flexGrow() const { return flexGrow_; } + Ref flexGrow() { return {*this}; } + + YGFloatOptional flexShrink() const { return flexShrink_; } + Ref flexShrink() { return {*this}; } + + CompactValue flexBasis() const { return flexBasis_; } + Ref flexBasis() { return {*this}; } + + const Edges& margin() const { return margin_; } + IdxRef margin() { return {*this}; } + + const Edges& position() const { return position_; } + IdxRef position() { return {*this}; } + + const Edges& padding() const { return padding_; } + IdxRef padding() { return {*this}; } + + const Edges& border() const { return border_; } + IdxRef border() { return {*this}; } + + const Dimensions& dimensions() const { return dimensions_; } + IdxRef dimensions() { return {*this}; } + + const Dimensions& minDimensions() const { return minDimensions_; } + IdxRef minDimensions() { + return {*this}; + } + + const Dimensions& maxDimensions() const { return maxDimensions_; } + IdxRef maxDimensions() { + return {*this}; + } + + // Yoga specific properties, not compatible with flexbox specification + YGFloatOptional aspectRatio() const { return aspectRatio_; } + Ref aspectRatio() { return {*this}; } +}; + +YOGA_EXPORT bool operator==(const YGStyle& lhs, const YGStyle& rhs); +YOGA_EXPORT inline bool operator!=(const YGStyle& lhs, const YGStyle& rhs) { + return !(lhs == rhs); +} + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGValue.h b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGValue.h new file mode 100644 index 0000000..a200097 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/YGValue.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include "YGEnums.h" +#include "YGMacros.h" + +#if defined(_MSC_VER) && defined(__clang__) +#define COMPILING_WITH_CLANG_ON_WINDOWS +#endif +#if defined(COMPILING_WITH_CLANG_ON_WINDOWS) +#include +constexpr float YGUndefined = std::numeric_limits::quiet_NaN(); +#else +YG_EXTERN_C_BEGIN + +// Not defined in MSVC++ +#ifndef NAN +static const uint32_t __nan = 0x7fc00000; +#define NAN (*(const float*) __nan) +#endif + +#define YGUndefined NAN +#endif + +typedef struct YGValue { + float value; + YGUnit unit; +} YGValue; + +YOGA_EXPORT extern const YGValue YGValueAuto; +YOGA_EXPORT extern const YGValue YGValueUndefined; +YOGA_EXPORT extern const YGValue YGValueZero; + +#if !defined(COMPILING_WITH_CLANG_ON_WINDOWS) +YG_EXTERN_C_END +#endif +#undef COMPILING_WITH_CLANG_ON_WINDOWS + +#ifdef __cplusplus + +inline bool operator==(const YGValue& lhs, const YGValue& rhs) { + if (lhs.unit != rhs.unit) { + return false; + } + + switch (lhs.unit) { + case YGUnitUndefined: + case YGUnitAuto: + return true; + case YGUnitPoint: + case YGUnitPercent: + return lhs.value == rhs.value; + } + + return false; +} + +inline bool operator!=(const YGValue& lhs, const YGValue& rhs) { + return !(lhs == rhs); +} + +inline YGValue operator-(const YGValue& value) { + return {-value.value, value.unit}; +} + +namespace facebook { +namespace yoga { +namespace literals { + +inline YGValue operator"" _pt(long double value) { + return YGValue{static_cast(value), YGUnitPoint}; +} +inline YGValue operator"" _pt(unsigned long long value) { + return operator"" _pt(static_cast(value)); +} + +inline YGValue operator"" _percent(long double value) { + return YGValue{static_cast(value), YGUnitPercent}; +} +inline YGValue operator"" _percent(unsigned long long value) { + return operator"" _percent(static_cast(value)); +} + +} // namespace literals +} // namespace yoga +} // namespace facebook + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/Yoga.h b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/Yoga.h new file mode 100644 index 0000000..86cd65e --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64/Headers/yoga/Yoga.h @@ -0,0 +1,374 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#ifndef __cplusplus +#include +#endif + +#include "YGEnums.h" +#include "YGMacros.h" +#include "YGValue.h" + +YG_EXTERN_C_BEGIN + +typedef struct YGSize { + float width; + float height; +} YGSize; + +typedef struct YGConfig* YGConfigRef; + +typedef struct YGNode* YGNodeRef; +typedef const struct YGNode* YGNodeConstRef; + +typedef YGSize (*YGMeasureFunc)( + YGNodeRef node, + float width, + YGMeasureMode widthMode, + float height, + YGMeasureMode heightMode); +typedef float (*YGBaselineFunc)(YGNodeRef node, float width, float height); +typedef void (*YGDirtiedFunc)(YGNodeRef node); +typedef void (*YGPrintFunc)(YGNodeRef node); +typedef void (*YGNodeCleanupFunc)(YGNodeRef node); +typedef int (*YGLogger)( + YGConfigRef config, + YGNodeRef node, + YGLogLevel level, + const char* format, + va_list args); +typedef YGNodeRef ( + *YGCloneNodeFunc)(YGNodeRef oldNode, YGNodeRef owner, int childIndex); + +// YGNode +WIN_EXPORT YGNodeRef YGNodeNew(void); +WIN_EXPORT YGNodeRef YGNodeNewWithConfig(YGConfigRef config); +WIN_EXPORT YGNodeRef YGNodeClone(YGNodeRef node); +WIN_EXPORT void YGNodeFree(YGNodeRef node); +WIN_EXPORT void YGNodeFreeRecursiveWithCleanupFunc( + YGNodeRef node, + YGNodeCleanupFunc cleanup); +WIN_EXPORT void YGNodeFreeRecursive(YGNodeRef node); +WIN_EXPORT void YGNodeReset(YGNodeRef node); + +WIN_EXPORT void YGNodeInsertChild( + YGNodeRef node, + YGNodeRef child, + uint32_t index); + +WIN_EXPORT void YGNodeSwapChild( + YGNodeRef node, + YGNodeRef child, + uint32_t index); + +WIN_EXPORT void YGNodeRemoveChild(YGNodeRef node, YGNodeRef child); +WIN_EXPORT void YGNodeRemoveAllChildren(YGNodeRef node); +WIN_EXPORT YGNodeRef YGNodeGetChild(YGNodeRef node, uint32_t index); +WIN_EXPORT YGNodeRef YGNodeGetOwner(YGNodeRef node); +WIN_EXPORT YGNodeRef YGNodeGetParent(YGNodeRef node); +WIN_EXPORT uint32_t YGNodeGetChildCount(YGNodeRef node); +WIN_EXPORT void YGNodeSetChildren( + YGNodeRef owner, + const YGNodeRef children[], + uint32_t count); + +WIN_EXPORT void YGNodeSetIsReferenceBaseline( + YGNodeRef node, + bool isReferenceBaseline); + +WIN_EXPORT bool YGNodeIsReferenceBaseline(YGNodeRef node); + +WIN_EXPORT void YGNodeCalculateLayout( + YGNodeRef node, + float availableWidth, + float availableHeight, + YGDirection ownerDirection); + +// Mark a node as dirty. Only valid for nodes with a custom measure function +// set. +// +// Yoga knows when to mark all other nodes as dirty but because nodes with +// measure functions depend on information not known to Yoga they must perform +// this dirty marking manually. +WIN_EXPORT void YGNodeMarkDirty(YGNodeRef node); + +// Marks the current node and all its descendants as dirty. +// +// Intended to be used for Yoga benchmarks. Don't use in production, as calling +// `YGCalculateLayout` will cause the recalculation of each and every node. +WIN_EXPORT void YGNodeMarkDirtyAndPropogateToDescendants(YGNodeRef node); + +WIN_EXPORT void YGNodePrint(YGNodeRef node, YGPrintOptions options); + +WIN_EXPORT bool YGFloatIsUndefined(float value); + +WIN_EXPORT bool YGNodeCanUseCachedMeasurement( + YGMeasureMode widthMode, + float width, + YGMeasureMode heightMode, + float height, + YGMeasureMode lastWidthMode, + float lastWidth, + YGMeasureMode lastHeightMode, + float lastHeight, + float lastComputedWidth, + float lastComputedHeight, + float marginRow, + float marginColumn, + YGConfigRef config); + +WIN_EXPORT void YGNodeCopyStyle(YGNodeRef dstNode, YGNodeRef srcNode); + +WIN_EXPORT void* YGNodeGetContext(YGNodeRef node); +WIN_EXPORT void YGNodeSetContext(YGNodeRef node, void* context); +void YGConfigSetPrintTreeFlag(YGConfigRef config, bool enabled); +bool YGNodeHasMeasureFunc(YGNodeRef node); +WIN_EXPORT void YGNodeSetMeasureFunc(YGNodeRef node, YGMeasureFunc measureFunc); +bool YGNodeHasBaselineFunc(YGNodeRef node); +void YGNodeSetBaselineFunc(YGNodeRef node, YGBaselineFunc baselineFunc); +YGDirtiedFunc YGNodeGetDirtiedFunc(YGNodeRef node); +void YGNodeSetDirtiedFunc(YGNodeRef node, YGDirtiedFunc dirtiedFunc); +void YGNodeSetPrintFunc(YGNodeRef node, YGPrintFunc printFunc); +WIN_EXPORT bool YGNodeGetHasNewLayout(YGNodeRef node); +WIN_EXPORT void YGNodeSetHasNewLayout(YGNodeRef node, bool hasNewLayout); +YGNodeType YGNodeGetNodeType(YGNodeRef node); +void YGNodeSetNodeType(YGNodeRef node, YGNodeType nodeType); +WIN_EXPORT bool YGNodeIsDirty(YGNodeRef node); +bool YGNodeLayoutGetDidUseLegacyFlag(YGNodeRef node); + +WIN_EXPORT void YGNodeStyleSetDirection(YGNodeRef node, YGDirection direction); +WIN_EXPORT YGDirection YGNodeStyleGetDirection(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexDirection( + YGNodeRef node, + YGFlexDirection flexDirection); +WIN_EXPORT YGFlexDirection YGNodeStyleGetFlexDirection(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetJustifyContent( + YGNodeRef node, + YGJustify justifyContent); +WIN_EXPORT YGJustify YGNodeStyleGetJustifyContent(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetAlignContent( + YGNodeRef node, + YGAlign alignContent); +WIN_EXPORT YGAlign YGNodeStyleGetAlignContent(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetAlignItems(YGNodeRef node, YGAlign alignItems); +WIN_EXPORT YGAlign YGNodeStyleGetAlignItems(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetAlignSelf(YGNodeRef node, YGAlign alignSelf); +WIN_EXPORT YGAlign YGNodeStyleGetAlignSelf(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetPositionType( + YGNodeRef node, + YGPositionType positionType); +WIN_EXPORT YGPositionType YGNodeStyleGetPositionType(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexWrap(YGNodeRef node, YGWrap flexWrap); +WIN_EXPORT YGWrap YGNodeStyleGetFlexWrap(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetOverflow(YGNodeRef node, YGOverflow overflow); +WIN_EXPORT YGOverflow YGNodeStyleGetOverflow(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetDisplay(YGNodeRef node, YGDisplay display); +WIN_EXPORT YGDisplay YGNodeStyleGetDisplay(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlex(YGNodeRef node, float flex); +WIN_EXPORT float YGNodeStyleGetFlex(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexGrow(YGNodeRef node, float flexGrow); +WIN_EXPORT float YGNodeStyleGetFlexGrow(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexShrink(YGNodeRef node, float flexShrink); +WIN_EXPORT float YGNodeStyleGetFlexShrink(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexBasis(YGNodeRef node, float flexBasis); +WIN_EXPORT void YGNodeStyleSetFlexBasisPercent(YGNodeRef node, float flexBasis); +WIN_EXPORT void YGNodeStyleSetFlexBasisAuto(YGNodeRef node); +WIN_EXPORT YGValue YGNodeStyleGetFlexBasis(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetPosition( + YGNodeRef node, + YGEdge edge, + float position); +WIN_EXPORT void YGNodeStyleSetPositionPercent( + YGNodeRef node, + YGEdge edge, + float position); +WIN_EXPORT YGValue YGNodeStyleGetPosition(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float margin); +WIN_EXPORT void YGNodeStyleSetMarginPercent( + YGNodeRef node, + YGEdge edge, + float margin); +WIN_EXPORT void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge); +WIN_EXPORT YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetPadding( + YGNodeRef node, + YGEdge edge, + float padding); +WIN_EXPORT void YGNodeStyleSetPaddingPercent( + YGNodeRef node, + YGEdge edge, + float padding); +WIN_EXPORT YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetBorder(YGNodeRef node, YGEdge edge, float border); +WIN_EXPORT float YGNodeStyleGetBorder(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, float width); +WIN_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, float width); +WIN_EXPORT void YGNodeStyleSetWidthAuto(YGNodeRef node); +WIN_EXPORT YGValue YGNodeStyleGetWidth(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, float height); +WIN_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, float height); +WIN_EXPORT void YGNodeStyleSetHeightAuto(YGNodeRef node); +WIN_EXPORT YGValue YGNodeStyleGetHeight(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMinWidth(YGNodeRef node, float minWidth); +WIN_EXPORT void YGNodeStyleSetMinWidthPercent(YGNodeRef node, float minWidth); +WIN_EXPORT YGValue YGNodeStyleGetMinWidth(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMinHeight(YGNodeRef node, float minHeight); +WIN_EXPORT void YGNodeStyleSetMinHeightPercent(YGNodeRef node, float minHeight); +WIN_EXPORT YGValue YGNodeStyleGetMinHeight(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMaxWidth(YGNodeRef node, float maxWidth); +WIN_EXPORT void YGNodeStyleSetMaxWidthPercent(YGNodeRef node, float maxWidth); +WIN_EXPORT YGValue YGNodeStyleGetMaxWidth(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMaxHeight(YGNodeRef node, float maxHeight); +WIN_EXPORT void YGNodeStyleSetMaxHeightPercent(YGNodeRef node, float maxHeight); +WIN_EXPORT YGValue YGNodeStyleGetMaxHeight(YGNodeConstRef node); + +// Yoga specific properties, not compatible with flexbox specification Aspect +// ratio control the size of the undefined dimension of a node. Aspect ratio is +// encoded as a floating point value width/height. e.g. A value of 2 leads to a +// node with a width twice the size of its height while a value of 0.5 gives the +// opposite effect. +// +// - On a node with a set width/height aspect ratio control the size of the +// unset dimension +// - On a node with a set flex basis aspect ratio controls the size of the node +// in the cross axis if unset +// - On a node with a measure function aspect ratio works as though the measure +// function measures the flex basis +// - On a node with flex grow/shrink aspect ratio controls the size of the node +// in the cross axis if unset +// - Aspect ratio takes min/max dimensions into account +WIN_EXPORT void YGNodeStyleSetAspectRatio(YGNodeRef node, float aspectRatio); +WIN_EXPORT float YGNodeStyleGetAspectRatio(YGNodeConstRef node); + +WIN_EXPORT float YGNodeLayoutGetLeft(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetTop(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetRight(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetBottom(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetWidth(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetHeight(YGNodeRef node); +WIN_EXPORT YGDirection YGNodeLayoutGetDirection(YGNodeRef node); +WIN_EXPORT bool YGNodeLayoutGetHadOverflow(YGNodeRef node); +bool YGNodeLayoutGetDidLegacyStretchFlagAffectLayout(YGNodeRef node); + +// Get the computed values for these nodes after performing layout. If they were +// set using point values then the returned value will be the same as +// YGNodeStyleGetXXX. However if they were set using a percentage value then the +// returned value is the computed value used during layout. +WIN_EXPORT float YGNodeLayoutGetMargin(YGNodeRef node, YGEdge edge); +WIN_EXPORT float YGNodeLayoutGetBorder(YGNodeRef node, YGEdge edge); +WIN_EXPORT float YGNodeLayoutGetPadding(YGNodeRef node, YGEdge edge); + +WIN_EXPORT void YGConfigSetLogger(YGConfigRef config, YGLogger logger); +WIN_EXPORT void YGAssert(bool condition, const char* message); +WIN_EXPORT void YGAssertWithNode( + YGNodeRef node, + bool condition, + const char* message); +WIN_EXPORT void YGAssertWithConfig( + YGConfigRef config, + bool condition, + const char* message); +// Set this to number of pixels in 1 point to round calculation results If you +// want to avoid rounding - set PointScaleFactor to 0 +WIN_EXPORT void YGConfigSetPointScaleFactor( + YGConfigRef config, + float pixelsInPoint); +void YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour( + YGConfigRef config, + bool shouldDiffLayout); + +// Yoga previously had an error where containers would take the maximum space +// possible instead of the minimum like they are supposed to. In practice this +// resulted in implicit behaviour similar to align-self: stretch; Because this +// was such a long-standing bug we must allow legacy users to switch back to +// this behaviour. +WIN_EXPORT void YGConfigSetUseLegacyStretchBehaviour( + YGConfigRef config, + bool useLegacyStretchBehaviour); + +// YGConfig +WIN_EXPORT YGConfigRef YGConfigNew(void); +WIN_EXPORT void YGConfigFree(YGConfigRef config); +WIN_EXPORT void YGConfigCopy(YGConfigRef dest, YGConfigRef src); +WIN_EXPORT int32_t YGConfigGetInstanceCount(void); + +WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled( + YGConfigRef config, + YGExperimentalFeature feature, + bool enabled); +WIN_EXPORT bool YGConfigIsExperimentalFeatureEnabled( + YGConfigRef config, + YGExperimentalFeature feature); + +// Using the web defaults is the preferred configuration for new projects. Usage +// of non web defaults should be considered as legacy. +WIN_EXPORT void YGConfigSetUseWebDefaults(YGConfigRef config, bool enabled); +WIN_EXPORT bool YGConfigGetUseWebDefaults(YGConfigRef config); + +WIN_EXPORT void YGConfigSetCloneNodeFunc( + YGConfigRef config, + YGCloneNodeFunc callback); + +// Export only for C# +WIN_EXPORT YGConfigRef YGConfigGetDefault(void); + +WIN_EXPORT void YGConfigSetContext(YGConfigRef config, void* context); +WIN_EXPORT void* YGConfigGetContext(YGConfigRef config); + +WIN_EXPORT float YGRoundValueToPixelGrid( + double value, + double pointScaleFactor, + bool forceCeil, + bool forceFloor); + +YG_EXTERN_C_END + +#ifdef __cplusplus + +#include +#include + +// Calls f on each node in the tree including the given node argument. +void YGTraversePreOrder( + YGNodeRef node, + std::function&& f); + +void YGNodeSetChildren(YGNodeRef owner, const std::vector& children); + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64/libYoga.a b/Frameworks/Yoga.xcframework/ios-arm64/libYoga.a new file mode 100644 index 0000000..2748600 Binary files /dev/null and b/Frameworks/Yoga.xcframework/ios-arm64/libYoga.a differ diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/Yoga-umbrella.h b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/Yoga-umbrella.h new file mode 100644 index 0000000..65d28e5 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/Yoga-umbrella.h @@ -0,0 +1,22 @@ +#ifdef __OBJC__ +#import +#else +#ifndef FOUNDATION_EXPORT +#if defined(__cplusplus) +#define FOUNDATION_EXPORT extern "C" +#else +#define FOUNDATION_EXPORT extern +#endif +#endif +#endif + +#import "yoga/YGEnums.h" +#import "yoga/YGMacros.h" +#import "yoga/YGNode.h" +#import "yoga/YGStyle.h" +#import "yoga/YGValue.h" +#import "yoga/Yoga.h" + +FOUNDATION_EXPORT double yogaVersionNumber; +FOUNDATION_EXPORT const unsigned char yogaVersionString[]; + diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/Yoga.modulemap b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/Yoga.modulemap new file mode 100644 index 0000000..b47796c --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/Yoga.modulemap @@ -0,0 +1,6 @@ +module yoga { + umbrella header "Yoga-umbrella.h" + + export * + module * { export * } +} diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGEnums.h b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGEnums.h new file mode 100644 index 0000000..3dc458d --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGEnums.h @@ -0,0 +1,155 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include "YGMacros.h" + +#ifdef __cplusplus +namespace facebook { +namespace yoga { +namespace enums { + +template +constexpr int count(); // can't use `= delete` due to a defect in clang < 3.9 + +namespace detail { +template +constexpr int n() { + return sizeof...(xs); +} +} // namespace detail + +} // namespace enums +} // namespace yoga +} // namespace facebook +#endif + +#define YG_ENUM_DECL(NAME, ...) \ + typedef YG_ENUM_BEGIN(NAME){__VA_ARGS__} YG_ENUM_END(NAME); \ + WIN_EXPORT const char* NAME##ToString(NAME); + +#ifdef __cplusplus +#define YG_ENUM_SEQ_DECL(NAME, ...) \ + YG_ENUM_DECL(NAME, __VA_ARGS__) \ + YG_EXTERN_C_END \ + namespace facebook { \ + namespace yoga { \ + namespace enums { \ + template <> \ + constexpr int count() { \ + return detail::n<__VA_ARGS__>(); \ + } \ + } \ + } \ + } \ + YG_EXTERN_C_BEGIN +#else +#define YG_ENUM_SEQ_DECL YG_ENUM_DECL +#endif + +YG_EXTERN_C_BEGIN + +YG_ENUM_SEQ_DECL( + YGAlign, + YGAlignAuto, + YGAlignFlexStart, + YGAlignCenter, + YGAlignFlexEnd, + YGAlignStretch, + YGAlignBaseline, + YGAlignSpaceBetween, + YGAlignSpaceAround); + +YG_ENUM_SEQ_DECL(YGDimension, YGDimensionWidth, YGDimensionHeight) + +YG_ENUM_SEQ_DECL( + YGDirection, + YGDirectionInherit, + YGDirectionLTR, + YGDirectionRTL) + +YG_ENUM_SEQ_DECL(YGDisplay, YGDisplayFlex, YGDisplayNone) + +YG_ENUM_SEQ_DECL( + YGEdge, + YGEdgeLeft, + YGEdgeTop, + YGEdgeRight, + YGEdgeBottom, + YGEdgeStart, + YGEdgeEnd, + YGEdgeHorizontal, + YGEdgeVertical, + YGEdgeAll) + +YG_ENUM_SEQ_DECL(YGExperimentalFeature, YGExperimentalFeatureWebFlexBasis) + +YG_ENUM_SEQ_DECL( + YGFlexDirection, + YGFlexDirectionColumn, + YGFlexDirectionColumnReverse, + YGFlexDirectionRow, + YGFlexDirectionRowReverse) + +YG_ENUM_SEQ_DECL( + YGJustify, + YGJustifyFlexStart, + YGJustifyCenter, + YGJustifyFlexEnd, + YGJustifySpaceBetween, + YGJustifySpaceAround, + YGJustifySpaceEvenly) + +YG_ENUM_SEQ_DECL( + YGLogLevel, + YGLogLevelError, + YGLogLevelWarn, + YGLogLevelInfo, + YGLogLevelDebug, + YGLogLevelVerbose, + YGLogLevelFatal) + +YG_ENUM_SEQ_DECL( + YGMeasureMode, + YGMeasureModeUndefined, + YGMeasureModeExactly, + YGMeasureModeAtMost) + +YG_ENUM_SEQ_DECL(YGNodeType, YGNodeTypeDefault, YGNodeTypeText) + +YG_ENUM_SEQ_DECL( + YGOverflow, + YGOverflowVisible, + YGOverflowHidden, + YGOverflowScroll) + +YG_ENUM_SEQ_DECL( + YGPositionType, + YGPositionTypeStatic, + YGPositionTypeRelative, + YGPositionTypeAbsolute) + +YG_ENUM_DECL( + YGPrintOptions, + YGPrintOptionsLayout = 1, + YGPrintOptionsStyle = 2, + YGPrintOptionsChildren = 4) + +YG_ENUM_SEQ_DECL( + YGUnit, + YGUnitUndefined, + YGUnitPoint, + YGUnitPercent, + YGUnitAuto) + +YG_ENUM_SEQ_DECL(YGWrap, YGWrapNoWrap, YGWrapWrap, YGWrapWrapReverse) + +YG_EXTERN_C_END + +#undef YG_ENUM_DECL +#undef YG_ENUM_SEQ_DECL diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGMacros.h b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGMacros.h new file mode 100644 index 0000000..c6917f1 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGMacros.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __cplusplus +#define YG_EXTERN_C_BEGIN extern "C" { +#define YG_EXTERN_C_END } +#else +#define YG_EXTERN_C_BEGIN +#define YG_EXTERN_C_END +#endif + +#ifdef _WINDLL +#define WIN_EXPORT __declspec(dllexport) +#else +#define WIN_EXPORT +#endif + +#ifndef YOGA_EXPORT +#ifdef _MSC_VER +#define YOGA_EXPORT +#else +#define YOGA_EXPORT __attribute__((visibility("default"))) +#endif +#endif + +#ifdef NS_ENUM +// Cannot use NSInteger as NSInteger has a different size than int (which is the +// default type of a enum). Therefor when linking the Yoga C library into obj-c +// the header is a missmatch for the Yoga ABI. +#define YG_ENUM_BEGIN(name) NS_ENUM(int, name) +#define YG_ENUM_END(name) +#else +#define YG_ENUM_BEGIN(name) enum name +#define YG_ENUM_END(name) name +#endif + +#ifdef __GNUC__ +#define YG_DEPRECATED __attribute__((deprecated)) +#elif defined(_MSC_VER) +#define YG_DEPRECATED __declspec(deprecated) +#elif __cplusplus >= 201402L +#if defined(__has_cpp_attribute) +#if __has_cpp_attribute(deprecated) +#define YG_DEPRECATED [[deprecated]] +#endif +#endif +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGNode.h b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGNode.h new file mode 100644 index 0000000..4b6e627 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGNode.h @@ -0,0 +1,348 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __cplusplus + +#include +#include +#include "BitUtils.h" +#include "CompactValue.h" +#include "YGConfig.h" +#include "YGLayout.h" +#include "YGStyle.h" +#include "YGMacros.h" +#include "Yoga-internal.h" + +YGConfigRef YGConfigGetDefault(); + +struct YOGA_EXPORT YGNode { + using MeasureWithContextFn = + YGSize (*)(YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*); + using BaselineWithContextFn = float (*)(YGNode*, float, float, void*); + using PrintWithContextFn = void (*)(YGNode*, void*); + +private: + static constexpr size_t hasNewLayout_ = 0; + static constexpr size_t isReferenceBaseline_ = 1; + static constexpr size_t isDirty_ = 2; + static constexpr size_t nodeType_ = 3; + static constexpr size_t measureUsesContext_ = 4; + static constexpr size_t baselineUsesContext_ = 5; + static constexpr size_t printUsesContext_ = 6; + static constexpr size_t useWebDefaults_ = 7; + + void* context_ = nullptr; + uint8_t flags = 1; + uint8_t reserved_ = 0; + union { + YGMeasureFunc noContext; + MeasureWithContextFn withContext; + } measure_ = {nullptr}; + union { + YGBaselineFunc noContext; + BaselineWithContextFn withContext; + } baseline_ = {nullptr}; + union { + YGPrintFunc noContext; + PrintWithContextFn withContext; + } print_ = {nullptr}; + YGDirtiedFunc dirtied_ = nullptr; + YGStyle style_ = {}; + YGLayout layout_ = {}; + uint32_t lineIndex_ = 0; + YGNodeRef owner_ = nullptr; + YGVector children_ = {}; + YGConfigRef config_; + std::array resolvedDimensions_ = { + {YGValueUndefined, YGValueUndefined}}; + + YGFloatOptional relativePosition( + const YGFlexDirection axis, + const float axisSize) const; + + void setMeasureFunc(decltype(measure_)); + void setBaselineFunc(decltype(baseline_)); + + void useWebDefaults() { + facebook::yoga::detail::setBooleanData(flags, useWebDefaults_, true); + style_.flexDirection() = YGFlexDirectionRow; + style_.alignContent() = YGAlignStretch; + } + + // DANGER DANGER DANGER! + // If the node assigned to has children, we'd either have to deallocate + // them (potentially incorrect) or ignore them (danger of leaks). Only ever + // use this after checking that there are no children. + // DO NOT CHANGE THE VISIBILITY OF THIS METHOD! + YGNode& operator=(YGNode&&) = default; + + using CompactValue = facebook::yoga::detail::CompactValue; + +public: + YGNode() : YGNode{YGConfigGetDefault()} {} + explicit YGNode(const YGConfigRef config) : config_{config} { + if (config->useWebDefaults) { + useWebDefaults(); + } + }; + ~YGNode() = default; // cleanup of owner/children relationships in YGNodeFree + + YGNode(YGNode&&); + + // Does not expose true value semantics, as children are not cloned eagerly. + // Should we remove this? + YGNode(const YGNode& node) = default; + + // for RB fabric + YGNode(const YGNode& node, YGConfigRef config); + + // assignment means potential leaks of existing children, or alternatively + // freeing unowned memory, double free, or freeing stack memory. + YGNode& operator=(const YGNode&) = delete; + + // Getters + void* getContext() const { return context_; } + + uint8_t& reserved() { return reserved_; } + uint8_t reserved() const { return reserved_; } + + void print(void*); + + bool getHasNewLayout() const { + return facebook::yoga::detail::getBooleanData(flags, hasNewLayout_); + } + + YGNodeType getNodeType() const { + return facebook::yoga::detail::getEnumData(flags, nodeType_); + } + + bool hasMeasureFunc() const noexcept { return measure_.noContext != nullptr; } + + YGSize measure(float, YGMeasureMode, float, YGMeasureMode, void*); + + bool hasBaselineFunc() const noexcept { + return baseline_.noContext != nullptr; + } + + float baseline(float width, float height, void* layoutContext); + + YGDirtiedFunc getDirtied() const { return dirtied_; } + + // For Performance reasons passing as reference. + YGStyle& getStyle() { return style_; } + + const YGStyle& getStyle() const { return style_; } + + // For Performance reasons passing as reference. + YGLayout& getLayout() { return layout_; } + + const YGLayout& getLayout() const { return layout_; } + + uint32_t getLineIndex() const { return lineIndex_; } + + bool isReferenceBaseline() { + return facebook::yoga::detail::getBooleanData(flags, isReferenceBaseline_); + } + + // returns the YGNodeRef that owns this YGNode. An owner is used to identify + // the YogaTree that a YGNode belongs to. This method will return the parent + // of the YGNode when a YGNode only belongs to one YogaTree or nullptr when + // the YGNode is shared between two or more YogaTrees. + YGNodeRef getOwner() const { return owner_; } + + // Deprecated, use getOwner() instead. + YGNodeRef getParent() const { return getOwner(); } + + const YGVector& getChildren() const { return children_; } + + // Applies a callback to all children, after cloning them if they are not + // owned. + template + void iterChildrenAfterCloningIfNeeded(T callback, void* cloneContext) { + int i = 0; + for (YGNodeRef& child : children_) { + if (child->getOwner() != this) { + child = config_->cloneNode(child, this, i, cloneContext); + child->setOwner(this); + } + i += 1; + + callback(child, cloneContext); + } + } + + YGNodeRef getChild(uint32_t index) const { return children_.at(index); } + + YGConfigRef getConfig() const { return config_; } + + bool isDirty() const { + return facebook::yoga::detail::getBooleanData(flags, isDirty_); + } + + std::array getResolvedDimensions() const { + return resolvedDimensions_; + } + + YGValue getResolvedDimension(int index) const { + return resolvedDimensions_[index]; + } + + static CompactValue computeEdgeValueForColumn( + const YGStyle::Edges& edges, + YGEdge edge, + CompactValue defaultValue); + + static CompactValue computeEdgeValueForRow( + const YGStyle::Edges& edges, + YGEdge rowEdge, + YGEdge edge, + CompactValue defaultValue); + + // Methods related to positions, margin, padding and border + YGFloatOptional getLeadingPosition( + const YGFlexDirection axis, + const float axisSize) const; + bool isLeadingPositionDefined(const YGFlexDirection axis) const; + bool isTrailingPosDefined(const YGFlexDirection axis) const; + YGFloatOptional getTrailingPosition( + const YGFlexDirection axis, + const float axisSize) const; + YGFloatOptional getLeadingMargin( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getTrailingMargin( + const YGFlexDirection axis, + const float widthSize) const; + float getLeadingBorder(const YGFlexDirection flexDirection) const; + float getTrailingBorder(const YGFlexDirection flexDirection) const; + YGFloatOptional getLeadingPadding( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getTrailingPadding( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getLeadingPaddingAndBorder( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getTrailingPaddingAndBorder( + const YGFlexDirection axis, + const float widthSize) const; + YGFloatOptional getMarginForAxis( + const YGFlexDirection axis, + const float widthSize) const; + // Setters + + void setContext(void* context) { context_ = context; } + + void setPrintFunc(YGPrintFunc printFunc) { + print_.noContext = printFunc; + facebook::yoga::detail::setBooleanData(flags, printUsesContext_, false); + } + void setPrintFunc(PrintWithContextFn printFunc) { + print_.withContext = printFunc; + facebook::yoga::detail::setBooleanData(flags, printUsesContext_, true); + } + void setPrintFunc(std::nullptr_t) { setPrintFunc(YGPrintFunc{nullptr}); } + + void setHasNewLayout(bool hasNewLayout) { + facebook::yoga::detail::setBooleanData(flags, hasNewLayout_, hasNewLayout); + } + + void setNodeType(YGNodeType nodeType) { + return facebook::yoga::detail::setEnumData( + flags, nodeType_, nodeType); + } + + void setMeasureFunc(YGMeasureFunc measureFunc); + void setMeasureFunc(MeasureWithContextFn); + void setMeasureFunc(std::nullptr_t) { + return setMeasureFunc(YGMeasureFunc{nullptr}); + } + + void setBaselineFunc(YGBaselineFunc baseLineFunc) { + facebook::yoga::detail::setBooleanData(flags, baselineUsesContext_, false); + baseline_.noContext = baseLineFunc; + } + void setBaselineFunc(BaselineWithContextFn baseLineFunc) { + facebook::yoga::detail::setBooleanData(flags, baselineUsesContext_, true); + baseline_.withContext = baseLineFunc; + } + void setBaselineFunc(std::nullptr_t) { + return setBaselineFunc(YGBaselineFunc{nullptr}); + } + + void setDirtiedFunc(YGDirtiedFunc dirtiedFunc) { dirtied_ = dirtiedFunc; } + + void setStyle(const YGStyle& style) { style_ = style; } + + void setLayout(const YGLayout& layout) { layout_ = layout; } + + void setLineIndex(uint32_t lineIndex) { lineIndex_ = lineIndex; } + + void setIsReferenceBaseline(bool isReferenceBaseline) { + facebook::yoga::detail::setBooleanData( + flags, isReferenceBaseline_, isReferenceBaseline); + } + + void setOwner(YGNodeRef owner) { owner_ = owner; } + + void setChildren(const YGVector& children) { children_ = children; } + + // TODO: rvalue override for setChildren + + YG_DEPRECATED void setConfig(YGConfigRef config) { config_ = config; } + + void setDirty(bool isDirty); + void setLayoutLastOwnerDirection(YGDirection direction); + void setLayoutComputedFlexBasis(const YGFloatOptional computedFlexBasis); + void setLayoutComputedFlexBasisGeneration( + uint32_t computedFlexBasisGeneration); + void setLayoutMeasuredDimension(float measuredDimension, int index); + void setLayoutHadOverflow(bool hadOverflow); + void setLayoutDimension(float dimension, int index); + void setLayoutDirection(YGDirection direction); + void setLayoutMargin(float margin, int index); + void setLayoutBorder(float border, int index); + void setLayoutPadding(float padding, int index); + void setLayoutPosition(float position, int index); + void setPosition( + const YGDirection direction, + const float mainSize, + const float crossSize, + const float ownerWidth); + void setLayoutDoesLegacyFlagAffectsLayout(bool doesLegacyFlagAffectsLayout); + void setLayoutDidUseLegacyFlag(bool didUseLegacyFlag); + void markDirtyAndPropogateDownwards(); + + // Other methods + YGValue marginLeadingValue(const YGFlexDirection axis) const; + YGValue marginTrailingValue(const YGFlexDirection axis) const; + YGValue resolveFlexBasisPtr() const; + void resolveDimension(); + YGDirection resolveDirection(const YGDirection ownerDirection); + void clearChildren(); + /// Replaces the occurrences of oldChild with newChild + void replaceChild(YGNodeRef oldChild, YGNodeRef newChild); + void replaceChild(YGNodeRef child, uint32_t index); + void insertChild(YGNodeRef child, uint32_t index); + /// Removes the first occurrence of child + bool removeChild(YGNodeRef child); + void removeChild(uint32_t index); + + void cloneChildrenIfNeeded(void*); + void markDirtyAndPropogate(); + float resolveFlexGrow() const; + float resolveFlexShrink() const; + bool isNodeFlexible(); + bool didUseLegacyFlag(); + bool isLayoutTreeEqualToNode(const YGNode& node) const; + void reset(); +}; + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGStyle.h b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGStyle.h new file mode 100644 index 0000000..aab7599 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGStyle.h @@ -0,0 +1,236 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __cplusplus + +#include +#include +#include +#include +#include "CompactValue.h" +#include "YGEnums.h" +#include "YGFloatOptional.h" +#include "Yoga-internal.h" +#include "Yoga.h" +#include "BitUtils.h" + +class YOGA_EXPORT YGStyle { + template + using Values = + facebook::yoga::detail::Values()>; + using CompactValue = facebook::yoga::detail::CompactValue; + +public: + using Dimensions = Values; + using Edges = Values; + + template + struct BitfieldRef { + YGStyle& style; + size_t offset; + operator T() const { + return facebook::yoga::detail::getEnumData(style.flags, offset); + } + BitfieldRef& operator=(T x) { + facebook::yoga::detail::setEnumData(style.flags, offset, x); + return *this; + } + }; + + template + struct Ref { + YGStyle& style; + operator T() const { return style.*Prop; } + Ref& operator=(T value) { + style.*Prop = value; + return *this; + } + }; + + template YGStyle::*Prop> + struct IdxRef { + struct Ref { + YGStyle& style; + Idx idx; + operator CompactValue() const { return (style.*Prop)[idx]; } + operator YGValue() const { return (style.*Prop)[idx]; } + Ref& operator=(CompactValue value) { + (style.*Prop)[idx] = value; + return *this; + } + }; + + YGStyle& style; + IdxRef& operator=(const Values& values) { + style.*Prop = values; + return *this; + } + operator const Values&() const { return style.*Prop; } + Ref operator[](Idx idx) { return {style, idx}; } + CompactValue operator[](Idx idx) const { return (style.*Prop)[idx]; } + }; + + YGStyle() { + alignContent() = YGAlignFlexStart; + alignItems() = YGAlignStretch; + } + ~YGStyle() = default; + +private: + static constexpr size_t directionOffset = 0; + static constexpr size_t flexdirectionOffset = + directionOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t justifyContentOffset = flexdirectionOffset + + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t alignContentOffset = + justifyContentOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t alignItemsOffset = + alignContentOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t alignSelfOffset = + alignItemsOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t positionTypeOffset = + alignSelfOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t flexWrapOffset = + positionTypeOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t overflowOffset = + flexWrapOffset + facebook::yoga::detail::bitWidthFn(); + static constexpr size_t displayOffset = + overflowOffset + facebook::yoga::detail::bitWidthFn(); + + uint32_t flags = 0; + + YGFloatOptional flex_ = {}; + YGFloatOptional flexGrow_ = {}; + YGFloatOptional flexShrink_ = {}; + CompactValue flexBasis_ = CompactValue::ofAuto(); + Edges margin_ = {}; + Edges position_ = {}; + Edges padding_ = {}; + Edges border_ = {}; + Dimensions dimensions_{CompactValue::ofAuto()}; + Dimensions minDimensions_ = {}; + Dimensions maxDimensions_ = {}; + // Yoga specific properties, not compatible with flexbox specification + YGFloatOptional aspectRatio_ = {}; + +public: + // for library users needing a type + using ValueRepr = std::remove_reference::type; + + YGDirection direction() const { + return facebook::yoga::detail::getEnumData( + flags, directionOffset); + } + BitfieldRef direction() { return {*this, directionOffset}; } + + YGFlexDirection flexDirection() const { + return facebook::yoga::detail::getEnumData( + flags, flexdirectionOffset); + } + BitfieldRef flexDirection() { + return {*this, flexdirectionOffset}; + } + + YGJustify justifyContent() const { + return facebook::yoga::detail::getEnumData( + flags, justifyContentOffset); + } + BitfieldRef justifyContent() { + return {*this, justifyContentOffset}; + } + + YGAlign alignContent() const { + return facebook::yoga::detail::getEnumData( + flags, alignContentOffset); + } + BitfieldRef alignContent() { return {*this, alignContentOffset}; } + + YGAlign alignItems() const { + return facebook::yoga::detail::getEnumData( + flags, alignItemsOffset); + } + BitfieldRef alignItems() { return {*this, alignItemsOffset}; } + + YGAlign alignSelf() const { + return facebook::yoga::detail::getEnumData(flags, alignSelfOffset); + } + BitfieldRef alignSelf() { return {*this, alignSelfOffset}; } + + YGPositionType positionType() const { + return facebook::yoga::detail::getEnumData( + flags, positionTypeOffset); + } + BitfieldRef positionType() { + return {*this, positionTypeOffset}; + } + + YGWrap flexWrap() const { + return facebook::yoga::detail::getEnumData(flags, flexWrapOffset); + } + BitfieldRef flexWrap() { return {*this, flexWrapOffset}; } + + YGOverflow overflow() const { + return facebook::yoga::detail::getEnumData( + flags, overflowOffset); + } + BitfieldRef overflow() { return {*this, overflowOffset}; } + + YGDisplay display() const { + return facebook::yoga::detail::getEnumData(flags, displayOffset); + } + BitfieldRef display() { return {*this, displayOffset}; } + + YGFloatOptional flex() const { return flex_; } + Ref flex() { return {*this}; } + + YGFloatOptional flexGrow() const { return flexGrow_; } + Ref flexGrow() { return {*this}; } + + YGFloatOptional flexShrink() const { return flexShrink_; } + Ref flexShrink() { return {*this}; } + + CompactValue flexBasis() const { return flexBasis_; } + Ref flexBasis() { return {*this}; } + + const Edges& margin() const { return margin_; } + IdxRef margin() { return {*this}; } + + const Edges& position() const { return position_; } + IdxRef position() { return {*this}; } + + const Edges& padding() const { return padding_; } + IdxRef padding() { return {*this}; } + + const Edges& border() const { return border_; } + IdxRef border() { return {*this}; } + + const Dimensions& dimensions() const { return dimensions_; } + IdxRef dimensions() { return {*this}; } + + const Dimensions& minDimensions() const { return minDimensions_; } + IdxRef minDimensions() { + return {*this}; + } + + const Dimensions& maxDimensions() const { return maxDimensions_; } + IdxRef maxDimensions() { + return {*this}; + } + + // Yoga specific properties, not compatible with flexbox specification + YGFloatOptional aspectRatio() const { return aspectRatio_; } + Ref aspectRatio() { return {*this}; } +}; + +YOGA_EXPORT bool operator==(const YGStyle& lhs, const YGStyle& rhs); +YOGA_EXPORT inline bool operator!=(const YGStyle& lhs, const YGStyle& rhs) { + return !(lhs == rhs); +} + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGValue.h b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGValue.h new file mode 100644 index 0000000..a200097 --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/YGValue.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include "YGEnums.h" +#include "YGMacros.h" + +#if defined(_MSC_VER) && defined(__clang__) +#define COMPILING_WITH_CLANG_ON_WINDOWS +#endif +#if defined(COMPILING_WITH_CLANG_ON_WINDOWS) +#include +constexpr float YGUndefined = std::numeric_limits::quiet_NaN(); +#else +YG_EXTERN_C_BEGIN + +// Not defined in MSVC++ +#ifndef NAN +static const uint32_t __nan = 0x7fc00000; +#define NAN (*(const float*) __nan) +#endif + +#define YGUndefined NAN +#endif + +typedef struct YGValue { + float value; + YGUnit unit; +} YGValue; + +YOGA_EXPORT extern const YGValue YGValueAuto; +YOGA_EXPORT extern const YGValue YGValueUndefined; +YOGA_EXPORT extern const YGValue YGValueZero; + +#if !defined(COMPILING_WITH_CLANG_ON_WINDOWS) +YG_EXTERN_C_END +#endif +#undef COMPILING_WITH_CLANG_ON_WINDOWS + +#ifdef __cplusplus + +inline bool operator==(const YGValue& lhs, const YGValue& rhs) { + if (lhs.unit != rhs.unit) { + return false; + } + + switch (lhs.unit) { + case YGUnitUndefined: + case YGUnitAuto: + return true; + case YGUnitPoint: + case YGUnitPercent: + return lhs.value == rhs.value; + } + + return false; +} + +inline bool operator!=(const YGValue& lhs, const YGValue& rhs) { + return !(lhs == rhs); +} + +inline YGValue operator-(const YGValue& value) { + return {-value.value, value.unit}; +} + +namespace facebook { +namespace yoga { +namespace literals { + +inline YGValue operator"" _pt(long double value) { + return YGValue{static_cast(value), YGUnitPoint}; +} +inline YGValue operator"" _pt(unsigned long long value) { + return operator"" _pt(static_cast(value)); +} + +inline YGValue operator"" _percent(long double value) { + return YGValue{static_cast(value), YGUnitPercent}; +} +inline YGValue operator"" _percent(unsigned long long value) { + return operator"" _percent(static_cast(value)); +} + +} // namespace literals +} // namespace yoga +} // namespace facebook + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/Yoga.h b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/Yoga.h new file mode 100644 index 0000000..86cd65e --- /dev/null +++ b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/Headers/yoga/Yoga.h @@ -0,0 +1,374 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#ifndef __cplusplus +#include +#endif + +#include "YGEnums.h" +#include "YGMacros.h" +#include "YGValue.h" + +YG_EXTERN_C_BEGIN + +typedef struct YGSize { + float width; + float height; +} YGSize; + +typedef struct YGConfig* YGConfigRef; + +typedef struct YGNode* YGNodeRef; +typedef const struct YGNode* YGNodeConstRef; + +typedef YGSize (*YGMeasureFunc)( + YGNodeRef node, + float width, + YGMeasureMode widthMode, + float height, + YGMeasureMode heightMode); +typedef float (*YGBaselineFunc)(YGNodeRef node, float width, float height); +typedef void (*YGDirtiedFunc)(YGNodeRef node); +typedef void (*YGPrintFunc)(YGNodeRef node); +typedef void (*YGNodeCleanupFunc)(YGNodeRef node); +typedef int (*YGLogger)( + YGConfigRef config, + YGNodeRef node, + YGLogLevel level, + const char* format, + va_list args); +typedef YGNodeRef ( + *YGCloneNodeFunc)(YGNodeRef oldNode, YGNodeRef owner, int childIndex); + +// YGNode +WIN_EXPORT YGNodeRef YGNodeNew(void); +WIN_EXPORT YGNodeRef YGNodeNewWithConfig(YGConfigRef config); +WIN_EXPORT YGNodeRef YGNodeClone(YGNodeRef node); +WIN_EXPORT void YGNodeFree(YGNodeRef node); +WIN_EXPORT void YGNodeFreeRecursiveWithCleanupFunc( + YGNodeRef node, + YGNodeCleanupFunc cleanup); +WIN_EXPORT void YGNodeFreeRecursive(YGNodeRef node); +WIN_EXPORT void YGNodeReset(YGNodeRef node); + +WIN_EXPORT void YGNodeInsertChild( + YGNodeRef node, + YGNodeRef child, + uint32_t index); + +WIN_EXPORT void YGNodeSwapChild( + YGNodeRef node, + YGNodeRef child, + uint32_t index); + +WIN_EXPORT void YGNodeRemoveChild(YGNodeRef node, YGNodeRef child); +WIN_EXPORT void YGNodeRemoveAllChildren(YGNodeRef node); +WIN_EXPORT YGNodeRef YGNodeGetChild(YGNodeRef node, uint32_t index); +WIN_EXPORT YGNodeRef YGNodeGetOwner(YGNodeRef node); +WIN_EXPORT YGNodeRef YGNodeGetParent(YGNodeRef node); +WIN_EXPORT uint32_t YGNodeGetChildCount(YGNodeRef node); +WIN_EXPORT void YGNodeSetChildren( + YGNodeRef owner, + const YGNodeRef children[], + uint32_t count); + +WIN_EXPORT void YGNodeSetIsReferenceBaseline( + YGNodeRef node, + bool isReferenceBaseline); + +WIN_EXPORT bool YGNodeIsReferenceBaseline(YGNodeRef node); + +WIN_EXPORT void YGNodeCalculateLayout( + YGNodeRef node, + float availableWidth, + float availableHeight, + YGDirection ownerDirection); + +// Mark a node as dirty. Only valid for nodes with a custom measure function +// set. +// +// Yoga knows when to mark all other nodes as dirty but because nodes with +// measure functions depend on information not known to Yoga they must perform +// this dirty marking manually. +WIN_EXPORT void YGNodeMarkDirty(YGNodeRef node); + +// Marks the current node and all its descendants as dirty. +// +// Intended to be used for Yoga benchmarks. Don't use in production, as calling +// `YGCalculateLayout` will cause the recalculation of each and every node. +WIN_EXPORT void YGNodeMarkDirtyAndPropogateToDescendants(YGNodeRef node); + +WIN_EXPORT void YGNodePrint(YGNodeRef node, YGPrintOptions options); + +WIN_EXPORT bool YGFloatIsUndefined(float value); + +WIN_EXPORT bool YGNodeCanUseCachedMeasurement( + YGMeasureMode widthMode, + float width, + YGMeasureMode heightMode, + float height, + YGMeasureMode lastWidthMode, + float lastWidth, + YGMeasureMode lastHeightMode, + float lastHeight, + float lastComputedWidth, + float lastComputedHeight, + float marginRow, + float marginColumn, + YGConfigRef config); + +WIN_EXPORT void YGNodeCopyStyle(YGNodeRef dstNode, YGNodeRef srcNode); + +WIN_EXPORT void* YGNodeGetContext(YGNodeRef node); +WIN_EXPORT void YGNodeSetContext(YGNodeRef node, void* context); +void YGConfigSetPrintTreeFlag(YGConfigRef config, bool enabled); +bool YGNodeHasMeasureFunc(YGNodeRef node); +WIN_EXPORT void YGNodeSetMeasureFunc(YGNodeRef node, YGMeasureFunc measureFunc); +bool YGNodeHasBaselineFunc(YGNodeRef node); +void YGNodeSetBaselineFunc(YGNodeRef node, YGBaselineFunc baselineFunc); +YGDirtiedFunc YGNodeGetDirtiedFunc(YGNodeRef node); +void YGNodeSetDirtiedFunc(YGNodeRef node, YGDirtiedFunc dirtiedFunc); +void YGNodeSetPrintFunc(YGNodeRef node, YGPrintFunc printFunc); +WIN_EXPORT bool YGNodeGetHasNewLayout(YGNodeRef node); +WIN_EXPORT void YGNodeSetHasNewLayout(YGNodeRef node, bool hasNewLayout); +YGNodeType YGNodeGetNodeType(YGNodeRef node); +void YGNodeSetNodeType(YGNodeRef node, YGNodeType nodeType); +WIN_EXPORT bool YGNodeIsDirty(YGNodeRef node); +bool YGNodeLayoutGetDidUseLegacyFlag(YGNodeRef node); + +WIN_EXPORT void YGNodeStyleSetDirection(YGNodeRef node, YGDirection direction); +WIN_EXPORT YGDirection YGNodeStyleGetDirection(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexDirection( + YGNodeRef node, + YGFlexDirection flexDirection); +WIN_EXPORT YGFlexDirection YGNodeStyleGetFlexDirection(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetJustifyContent( + YGNodeRef node, + YGJustify justifyContent); +WIN_EXPORT YGJustify YGNodeStyleGetJustifyContent(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetAlignContent( + YGNodeRef node, + YGAlign alignContent); +WIN_EXPORT YGAlign YGNodeStyleGetAlignContent(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetAlignItems(YGNodeRef node, YGAlign alignItems); +WIN_EXPORT YGAlign YGNodeStyleGetAlignItems(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetAlignSelf(YGNodeRef node, YGAlign alignSelf); +WIN_EXPORT YGAlign YGNodeStyleGetAlignSelf(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetPositionType( + YGNodeRef node, + YGPositionType positionType); +WIN_EXPORT YGPositionType YGNodeStyleGetPositionType(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexWrap(YGNodeRef node, YGWrap flexWrap); +WIN_EXPORT YGWrap YGNodeStyleGetFlexWrap(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetOverflow(YGNodeRef node, YGOverflow overflow); +WIN_EXPORT YGOverflow YGNodeStyleGetOverflow(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetDisplay(YGNodeRef node, YGDisplay display); +WIN_EXPORT YGDisplay YGNodeStyleGetDisplay(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlex(YGNodeRef node, float flex); +WIN_EXPORT float YGNodeStyleGetFlex(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexGrow(YGNodeRef node, float flexGrow); +WIN_EXPORT float YGNodeStyleGetFlexGrow(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexShrink(YGNodeRef node, float flexShrink); +WIN_EXPORT float YGNodeStyleGetFlexShrink(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetFlexBasis(YGNodeRef node, float flexBasis); +WIN_EXPORT void YGNodeStyleSetFlexBasisPercent(YGNodeRef node, float flexBasis); +WIN_EXPORT void YGNodeStyleSetFlexBasisAuto(YGNodeRef node); +WIN_EXPORT YGValue YGNodeStyleGetFlexBasis(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetPosition( + YGNodeRef node, + YGEdge edge, + float position); +WIN_EXPORT void YGNodeStyleSetPositionPercent( + YGNodeRef node, + YGEdge edge, + float position); +WIN_EXPORT YGValue YGNodeStyleGetPosition(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetMargin(YGNodeRef node, YGEdge edge, float margin); +WIN_EXPORT void YGNodeStyleSetMarginPercent( + YGNodeRef node, + YGEdge edge, + float margin); +WIN_EXPORT void YGNodeStyleSetMarginAuto(YGNodeRef node, YGEdge edge); +WIN_EXPORT YGValue YGNodeStyleGetMargin(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetPadding( + YGNodeRef node, + YGEdge edge, + float padding); +WIN_EXPORT void YGNodeStyleSetPaddingPercent( + YGNodeRef node, + YGEdge edge, + float padding); +WIN_EXPORT YGValue YGNodeStyleGetPadding(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetBorder(YGNodeRef node, YGEdge edge, float border); +WIN_EXPORT float YGNodeStyleGetBorder(YGNodeConstRef node, YGEdge edge); + +WIN_EXPORT void YGNodeStyleSetWidth(YGNodeRef node, float width); +WIN_EXPORT void YGNodeStyleSetWidthPercent(YGNodeRef node, float width); +WIN_EXPORT void YGNodeStyleSetWidthAuto(YGNodeRef node); +WIN_EXPORT YGValue YGNodeStyleGetWidth(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetHeight(YGNodeRef node, float height); +WIN_EXPORT void YGNodeStyleSetHeightPercent(YGNodeRef node, float height); +WIN_EXPORT void YGNodeStyleSetHeightAuto(YGNodeRef node); +WIN_EXPORT YGValue YGNodeStyleGetHeight(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMinWidth(YGNodeRef node, float minWidth); +WIN_EXPORT void YGNodeStyleSetMinWidthPercent(YGNodeRef node, float minWidth); +WIN_EXPORT YGValue YGNodeStyleGetMinWidth(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMinHeight(YGNodeRef node, float minHeight); +WIN_EXPORT void YGNodeStyleSetMinHeightPercent(YGNodeRef node, float minHeight); +WIN_EXPORT YGValue YGNodeStyleGetMinHeight(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMaxWidth(YGNodeRef node, float maxWidth); +WIN_EXPORT void YGNodeStyleSetMaxWidthPercent(YGNodeRef node, float maxWidth); +WIN_EXPORT YGValue YGNodeStyleGetMaxWidth(YGNodeConstRef node); + +WIN_EXPORT void YGNodeStyleSetMaxHeight(YGNodeRef node, float maxHeight); +WIN_EXPORT void YGNodeStyleSetMaxHeightPercent(YGNodeRef node, float maxHeight); +WIN_EXPORT YGValue YGNodeStyleGetMaxHeight(YGNodeConstRef node); + +// Yoga specific properties, not compatible with flexbox specification Aspect +// ratio control the size of the undefined dimension of a node. Aspect ratio is +// encoded as a floating point value width/height. e.g. A value of 2 leads to a +// node with a width twice the size of its height while a value of 0.5 gives the +// opposite effect. +// +// - On a node with a set width/height aspect ratio control the size of the +// unset dimension +// - On a node with a set flex basis aspect ratio controls the size of the node +// in the cross axis if unset +// - On a node with a measure function aspect ratio works as though the measure +// function measures the flex basis +// - On a node with flex grow/shrink aspect ratio controls the size of the node +// in the cross axis if unset +// - Aspect ratio takes min/max dimensions into account +WIN_EXPORT void YGNodeStyleSetAspectRatio(YGNodeRef node, float aspectRatio); +WIN_EXPORT float YGNodeStyleGetAspectRatio(YGNodeConstRef node); + +WIN_EXPORT float YGNodeLayoutGetLeft(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetTop(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetRight(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetBottom(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetWidth(YGNodeRef node); +WIN_EXPORT float YGNodeLayoutGetHeight(YGNodeRef node); +WIN_EXPORT YGDirection YGNodeLayoutGetDirection(YGNodeRef node); +WIN_EXPORT bool YGNodeLayoutGetHadOverflow(YGNodeRef node); +bool YGNodeLayoutGetDidLegacyStretchFlagAffectLayout(YGNodeRef node); + +// Get the computed values for these nodes after performing layout. If they were +// set using point values then the returned value will be the same as +// YGNodeStyleGetXXX. However if they were set using a percentage value then the +// returned value is the computed value used during layout. +WIN_EXPORT float YGNodeLayoutGetMargin(YGNodeRef node, YGEdge edge); +WIN_EXPORT float YGNodeLayoutGetBorder(YGNodeRef node, YGEdge edge); +WIN_EXPORT float YGNodeLayoutGetPadding(YGNodeRef node, YGEdge edge); + +WIN_EXPORT void YGConfigSetLogger(YGConfigRef config, YGLogger logger); +WIN_EXPORT void YGAssert(bool condition, const char* message); +WIN_EXPORT void YGAssertWithNode( + YGNodeRef node, + bool condition, + const char* message); +WIN_EXPORT void YGAssertWithConfig( + YGConfigRef config, + bool condition, + const char* message); +// Set this to number of pixels in 1 point to round calculation results If you +// want to avoid rounding - set PointScaleFactor to 0 +WIN_EXPORT void YGConfigSetPointScaleFactor( + YGConfigRef config, + float pixelsInPoint); +void YGConfigSetShouldDiffLayoutWithoutLegacyStretchBehaviour( + YGConfigRef config, + bool shouldDiffLayout); + +// Yoga previously had an error where containers would take the maximum space +// possible instead of the minimum like they are supposed to. In practice this +// resulted in implicit behaviour similar to align-self: stretch; Because this +// was such a long-standing bug we must allow legacy users to switch back to +// this behaviour. +WIN_EXPORT void YGConfigSetUseLegacyStretchBehaviour( + YGConfigRef config, + bool useLegacyStretchBehaviour); + +// YGConfig +WIN_EXPORT YGConfigRef YGConfigNew(void); +WIN_EXPORT void YGConfigFree(YGConfigRef config); +WIN_EXPORT void YGConfigCopy(YGConfigRef dest, YGConfigRef src); +WIN_EXPORT int32_t YGConfigGetInstanceCount(void); + +WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled( + YGConfigRef config, + YGExperimentalFeature feature, + bool enabled); +WIN_EXPORT bool YGConfigIsExperimentalFeatureEnabled( + YGConfigRef config, + YGExperimentalFeature feature); + +// Using the web defaults is the preferred configuration for new projects. Usage +// of non web defaults should be considered as legacy. +WIN_EXPORT void YGConfigSetUseWebDefaults(YGConfigRef config, bool enabled); +WIN_EXPORT bool YGConfigGetUseWebDefaults(YGConfigRef config); + +WIN_EXPORT void YGConfigSetCloneNodeFunc( + YGConfigRef config, + YGCloneNodeFunc callback); + +// Export only for C# +WIN_EXPORT YGConfigRef YGConfigGetDefault(void); + +WIN_EXPORT void YGConfigSetContext(YGConfigRef config, void* context); +WIN_EXPORT void* YGConfigGetContext(YGConfigRef config); + +WIN_EXPORT float YGRoundValueToPixelGrid( + double value, + double pointScaleFactor, + bool forceCeil, + bool forceFloor); + +YG_EXTERN_C_END + +#ifdef __cplusplus + +#include +#include + +// Calls f on each node in the tree including the given node argument. +void YGTraversePreOrder( + YGNodeRef node, + std::function&& f); + +void YGNodeSetChildren(YGNodeRef owner, const std::vector& children); + +#endif diff --git a/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/libYoga.a b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/libYoga.a new file mode 100644 index 0000000..631f06e Binary files /dev/null and b/Frameworks/Yoga.xcframework/ios-arm64_x86_64-simulator/libYoga.a differ diff --git a/Frameworks/glog.xcframework/Info.plist b/Frameworks/glog.xcframework/Info.plist new file mode 100644 index 0000000..34ca58e --- /dev/null +++ b/Frameworks/glog.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libglog.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libglog.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libglog.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libglog.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/glog.xcframework/ios-arm64/Headers/glog/log_severity.h b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/log_severity.h new file mode 100644 index 0000000..99945a4 --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/log_severity.h @@ -0,0 +1,92 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef BASE_LOG_SEVERITY_H__ +#define BASE_LOG_SEVERITY_H__ + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// Variables of type LogSeverity are widely taken to lie in the range +// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if +// you ever need to change their values or add a new severity. +typedef int LogSeverity; + +const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, + NUM_SEVERITIES = 4; +#ifndef GLOG_NO_ABBREVIATED_SEVERITIES +# ifdef ERROR +# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. +# endif +const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, + ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; +#endif + +// DFATAL is FATAL in debug mode, ERROR in normal mode +#ifdef NDEBUG +#define DFATAL_LEVEL ERROR +#else +#define DFATAL_LEVEL FATAL +#endif + +extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES]; + +// NDEBUG usage helpers related to (RAW_)DCHECK: +// +// DEBUG_MODE is for small !NDEBUG uses like +// if (DEBUG_MODE) foo.CheckThatFoo(); +// instead of substantially more verbose +// #ifndef NDEBUG +// foo.CheckThatFoo(); +// #endif +// +// IF_DEBUG_MODE is for small !NDEBUG uses like +// IF_DEBUG_MODE( string error; ) +// DCHECK(Foo(&error)) << error; +// instead of substantially more verbose +// #ifndef NDEBUG +// string error; +// DCHECK(Foo(&error)) << error; +// #endif +// +#ifdef NDEBUG +enum { DEBUG_MODE = 0 }; +#define IF_DEBUG_MODE(x) +#else +enum { DEBUG_MODE = 1 }; +#define IF_DEBUG_MODE(x) x +#endif + +#endif // BASE_LOG_SEVERITY_H__ diff --git a/Frameworks/glog.xcframework/ios-arm64/Headers/glog/logging.h b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/logging.h new file mode 100644 index 0000000..5abdacd --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/logging.h @@ -0,0 +1,1661 @@ +// Copyright (c) 1999, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney +// +// This file contains #include information about logging-related stuff. +// Pretty much everybody needs to #include this file so that they can +// log various happenings. +// +#ifndef _LOGGING_H_ +#define _LOGGING_H_ + +#include +#include +#include +#include +#include +#include +#include +#if 1 +# include +#endif +#include + +#if defined(_MSC_VER) +#define GLOG_MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \ + __pragma(warning(disable:n)) +#define GLOG_MSVC_POP_WARNING() __pragma(warning(pop)) +#else +#define GLOG_MSVC_PUSH_DISABLE_WARNING(n) +#define GLOG_MSVC_POP_WARNING() +#endif + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// We care a lot about number of bits things take up. Unfortunately, +// systems define their bit-specific ints in a lot of different ways. +// We use our own way, and have a typedef to get there. +// Note: these commands below may look like "#if 1" or "#if 0", but +// that's because they were constructed that way at ./configure time. +// Look at logging.h.in to see how they're calculated (based on your config). +#if 1 +#include // the normal place uint16_t is defined +#endif +#if 1 +#include // the normal place u_int16_t is defined +#endif +#if 1 +#include // a third place for uint16_t or u_int16_t +#endif + +#if 0 +#include +#endif + +namespace google { + +#if 1 // the C99 format +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#elif 1 // the BSD format +typedef int32_t int32; +typedef u_int32_t uint32; +typedef int64_t int64; +typedef u_int64_t uint64; +#elif 0 // the windows (vc7) format +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; +#else +#error Do not know how to define a 32-bit integer quantity on your system +#endif + +} + +// The global value of GOOGLE_STRIP_LOG. All the messages logged to +// LOG(XXX) with severity less than GOOGLE_STRIP_LOG will not be displayed. +// If it can be determined at compile time that the message will not be +// printed, the statement will be compiled out. +// +// Example: to strip out all INFO and WARNING messages, use the value +// of 2 below. To make an exception for WARNING messages from a single +// file, add "#define GOOGLE_STRIP_LOG 1" to that file _before_ including +// base/logging.h +#ifndef GOOGLE_STRIP_LOG +#define GOOGLE_STRIP_LOG 0 +#endif + +// GCC can be told that a certain branch is not likely to be taken (for +// instance, a CHECK failure), and use that information in static analysis. +// Giving it this information can help it optimize for the common case in +// the absence of better information (ie. -fprofile-arcs). +// +#ifndef GOOGLE_PREDICT_BRANCH_NOT_TAKEN +#if 1 +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) (__builtin_expect(x, 0)) +#else +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) x +#endif +#endif + +#ifndef GOOGLE_PREDICT_FALSE +#if 1 +#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0)) +#else +#define GOOGLE_PREDICT_FALSE(x) x +#endif +#endif + +#ifndef GOOGLE_PREDICT_TRUE +#if 1 +#define GOOGLE_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) +#else +#define GOOGLE_PREDICT_TRUE(x) x +#endif +#endif + + +// Make a bunch of macros for logging. The way to log things is to stream +// things to LOG(). E.g., +// +// LOG(INFO) << "Found " << num_cookies << " cookies"; +// +// You can capture log messages in a string, rather than reporting them +// immediately: +// +// vector errors; +// LOG_STRING(ERROR, &errors) << "Couldn't parse cookie #" << cookie_num; +// +// This pushes back the new error onto 'errors'; if given a NULL pointer, +// it reports the error via LOG(ERROR). +// +// You can also do conditional logging: +// +// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// You can also do occasional logging (log every n'th occurrence of an +// event): +// +// LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; +// +// The above will cause log messages to be output on the 1st, 11th, 21st, ... +// times it is executed. Note that the special google::COUNTER value is used +// to identify which repetition is happening. +// +// You can also do occasional conditional logging (log every n'th +// occurrence of an event, when condition is satisfied): +// +// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER +// << "th big cookie"; +// +// You can log messages the first N times your code executes a line. E.g. +// +// LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie"; +// +// Outputs log messages for the first 20 times it is executed. +// +// Analogous SYSLOG, SYSLOG_IF, and SYSLOG_EVERY_N macros are available. +// These log to syslog as well as to the normal logs. If you use these at +// all, you need to be aware that syslog can drastically reduce performance, +// especially if it is configured for remote logging! Don't use these +// unless you fully understand this and have a concrete need to use them. +// Even then, try to minimize your use of them. +// +// There are also "debug mode" logging macros like the ones above: +// +// DLOG(INFO) << "Found cookies"; +// +// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; +// +// All "debug mode" logging is compiled away to nothing for non-debug mode +// compiles. +// +// We also have +// +// LOG_ASSERT(assertion); +// DLOG_ASSERT(assertion); +// +// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion; +// +// There are "verbose level" logging macros. They look like +// +// VLOG(1) << "I'm printed when you run the program with --v=1 or more"; +// VLOG(2) << "I'm printed when you run the program with --v=2 or more"; +// +// These always log at the INFO log level (when they log at all). +// The verbose logging can also be turned on module-by-module. For instance, +// --vmodule=mapreduce=2,file=1,gfs*=3 --v=0 +// will cause: +// a. VLOG(2) and lower messages to be printed from mapreduce.{h,cc} +// b. VLOG(1) and lower messages to be printed from file.{h,cc} +// c. VLOG(3) and lower messages to be printed from files prefixed with "gfs" +// d. VLOG(0) and lower messages to be printed from elsewhere +// +// The wildcarding functionality shown by (c) supports both '*' (match +// 0 or more characters) and '?' (match any single character) wildcards. +// +// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as +// +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished with just VLOG(2) << ...; +// } +// +// There are also VLOG_IF, VLOG_EVERY_N and VLOG_IF_EVERY_N "verbose level" +// condition macros for sample cases, when some extra computation and +// preparation for logs is not needed. +// VLOG_IF(1, (size > 1024)) +// << "I'm printed when size is more than 1024 and when you run the " +// "program with --v=1 or more"; +// VLOG_EVERY_N(1, 10) +// << "I'm printed every 10th occurrence, and when you run the program " +// "with --v=1 or more. Present occurence is " << google::COUNTER; +// VLOG_IF_EVERY_N(1, (size > 1024), 10) +// << "I'm printed on every 10th occurence of case when size is more " +// " than 1024, when you run the program with --v=1 or more. "; +// "Present occurence is " << google::COUNTER; +// +// The supported severity levels for macros that allow you to specify one +// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL. +// Note that messages of a given severity are logged not only in the +// logfile for that severity, but also in all logfiles of lower severity. +// E.g., a message of severity FATAL will be logged to the logfiles of +// severity FATAL, ERROR, WARNING, and INFO. +// +// There is also the special severity of DFATAL, which logs FATAL in +// debug mode, ERROR in normal mode. +// +// Very important: logging a message at the FATAL severity level causes +// the program to terminate (after the message is logged). +// +// Unless otherwise specified, logs will be written to the filename +// "...log..", followed +// by the date, time, and pid (you can't prevent the date, time, and pid +// from being in the filename). +// +// The logging code takes two flags: +// --v=# set the verbose level +// --logtostderr log all the messages to stderr instead of to logfiles + +// LOG LINE PREFIX FORMAT +// +// Log lines have this form: +// +// Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... +// +// where the fields are defined as follows: +// +// L A single character, representing the log level +// (eg 'I' for INFO) +// mm The month (zero padded; ie May is '05') +// dd The day (zero padded) +// hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds +// threadid The space-padded thread ID as returned by GetTID() +// (this matches the PID on Linux) +// file The file name +// line The line number +// msg The user-supplied message +// +// Example: +// +// I1103 11:57:31.739339 24395 google.cc:2341] Command line: ./some_prog +// I1103 11:57:31.739403 24395 google.cc:2342] Process id 24395 +// +// NOTE: although the microseconds are useful for comparing events on +// a single machine, clocks on different machines may not be well +// synchronized. Hence, use caution when comparing the low bits of +// timestamps from different machines. + +#ifndef DECLARE_VARIABLE +#define MUST_UNDEF_GFLAGS_DECLARE_MACROS +#define DECLARE_VARIABLE(type, shorttype, name, tn) \ + namespace fL##shorttype { \ + extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ + } \ + using fL##shorttype::FLAGS_##name + +// bool specialization +#define DECLARE_bool(name) \ + DECLARE_VARIABLE(bool, B, name, bool) + +// int32 specialization +#define DECLARE_int32(name) \ + DECLARE_VARIABLE(google::int32, I, name, int32) + +// Special case for string, because we have to specify the namespace +// std::string, which doesn't play nicely with our FLAG__namespace hackery. +#define DECLARE_string(name) \ + namespace fLS { \ + extern GOOGLE_GLOG_DLL_DECL std::string& FLAGS_##name; \ + } \ + using fLS::FLAGS_##name +#endif + +// Set whether log messages go to stderr instead of logfiles +DECLARE_bool(logtostderr); + +// Set whether log messages go to stderr in addition to logfiles. +DECLARE_bool(alsologtostderr); + +// Set color messages logged to stderr (if supported by terminal). +DECLARE_bool(colorlogtostderr); + +// Log messages at a level >= this flag are automatically sent to +// stderr in addition to log files. +DECLARE_int32(stderrthreshold); + +// Set whether the log prefix should be prepended to each line of output. +DECLARE_bool(log_prefix); + +// Log messages at a level <= this flag are buffered. +// Log messages at a higher level are flushed immediately. +DECLARE_int32(logbuflevel); + +// Sets the maximum number of seconds which logs may be buffered for. +DECLARE_int32(logbufsecs); + +// Log suppression level: messages logged at a lower level than this +// are suppressed. +DECLARE_int32(minloglevel); + +// If specified, logfiles are written into this directory instead of the +// default logging directory. +DECLARE_string(log_dir); + +// Set the log file mode. +DECLARE_int32(logfile_mode); + +// Sets the path of the directory into which to put additional links +// to the log files. +DECLARE_string(log_link); + +DECLARE_int32(v); // in vlog_is_on.cc + +// Sets the maximum log file size (in MB). +DECLARE_int32(max_log_size); + +// Sets whether to avoid logging to the disk if the disk is full. +DECLARE_bool(stop_logging_if_full_disk); + +#ifdef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef DECLARE_VARIABLE +#undef DECLARE_bool +#undef DECLARE_int32 +#undef DECLARE_string +#endif + +// Log messages below the GOOGLE_STRIP_LOG level will be compiled away for +// security reasons. See LOG(severtiy) below. + +// A few definitions of macros that don't generate much code. Since +// LOG(INFO) and its ilk are used all over our code, it's +// better to have compact code for these operations. + +#if GOOGLE_STRIP_LOG == 0 +#define COMPACT_GOOGLE_LOG_INFO google::LogMessage( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_INFO(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_INFO, message) +#else +#define COMPACT_GOOGLE_LOG_INFO google::NullStream() +#define LOG_TO_STRING_INFO(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 1 +#define COMPACT_GOOGLE_LOG_WARNING google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_WARNING) +#define LOG_TO_STRING_WARNING(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_WARNING, message) +#else +#define COMPACT_GOOGLE_LOG_WARNING google::NullStream() +#define LOG_TO_STRING_WARNING(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 2 +#define COMPACT_GOOGLE_LOG_ERROR google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ERROR) +#define LOG_TO_STRING_ERROR(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ERROR, message) +#else +#define COMPACT_GOOGLE_LOG_ERROR google::NullStream() +#define LOG_TO_STRING_ERROR(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_FATAL google::LogMessageFatal( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_FATAL(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_FATAL, message) +#else +#define COMPACT_GOOGLE_LOG_FATAL google::NullStreamFatal() +#define LOG_TO_STRING_FATAL(message) google::NullStreamFatal() +#endif + +#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) +#define DCHECK_IS_ON() 0 +#else +#define DCHECK_IS_ON() 1 +#endif + +// For DFATAL, we want to use LogMessage (as opposed to +// LogMessageFatal), to be consistent with the original behavior. +#if !DCHECK_IS_ON() +#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_ERROR +#elif GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_DFATAL google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_FATAL) +#else +#define COMPACT_GOOGLE_LOG_DFATAL google::NullStreamFatal() +#endif + +#define GOOGLE_LOG_INFO(counter) google::LogMessage(__FILE__, __LINE__, google::GLOG_INFO, counter, &google::LogMessage::SendToLog) +#define SYSLOG_INFO(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_INFO, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToSyslogAndLog) + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) || defined(__CYGWIN32__) +// A very useful logging macro to log windows errors: +#define LOG_SYSRESULT(result) \ + if (FAILED(HRESULT_FROM_WIN32(result))) { \ + LPSTR message = NULL; \ + LPSTR msg = reinterpret_cast(&message); \ + DWORD message_length = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | \ + FORMAT_MESSAGE_FROM_SYSTEM, \ + 0, result, 0, msg, 100, NULL); \ + if (message_length > 0) { \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, 0, \ + &google::LogMessage::SendToLog).stream() \ + << reinterpret_cast(message); \ + LocalFree(message); \ + } \ + } +#endif + +// We use the preprocessor's merging operator, "##", so that, e.g., +// LOG(INFO) becomes the token GOOGLE_LOG_INFO. There's some funny +// subtle difference between ostream member streaming functions (e.g., +// ostream::operator<<(int) and ostream non-member streaming functions +// (e.g., ::operator<<(ostream&, string&): it turns out that it's +// impossible to stream something like a string directly to an unnamed +// ostream. We employ a neat hack by calling the stream() member +// function of LogMessage which seems to avoid the problem. +#define LOG(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() +#define SYSLOG(severity) SYSLOG_ ## severity(0).stream() + +namespace google { + +// They need the definitions of integer types. +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Initialize google's logging library. You will see the program name +// specified by argv0 in log outputs. +GOOGLE_GLOG_DLL_DECL void InitGoogleLogging(const char* argv0); + +// Shutdown google's logging library. +GOOGLE_GLOG_DLL_DECL void ShutdownGoogleLogging(); + +// Install a function which will be called after LOG(FATAL). +GOOGLE_GLOG_DLL_DECL void InstallFailureFunction(void (*fail_func)()); + +class LogSink; // defined below + +// If a non-NULL sink pointer is given, we push this message to that sink. +// For LOG_TO_SINK we then do normal LOG(severity) logging as well. +// This is useful for capturing messages and passing/storing them +// somewhere more specific than the global log of the process. +// Argument types: +// LogSink* sink; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +#define LOG_TO_SINK(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::GLOG_ ## severity, \ + static_cast(sink), true).stream() +#define LOG_TO_SINK_BUT_NOT_TO_LOGFILE(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::GLOG_ ## severity, \ + static_cast(sink), false).stream() + +// If a non-NULL string pointer is given, we write this message to that string. +// We then do normal LOG(severity) logging as well. +// This is useful for capturing messages and storing them somewhere more +// specific than the global log of the process. +// Argument types: +// string* message; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +// NOTE: LOG(severity) expands to LogMessage().stream() for the specified +// severity. +#define LOG_TO_STRING(severity, message) \ + LOG_TO_STRING_##severity(static_cast(message)).stream() + +// If a non-NULL pointer is given, we push the message onto the end +// of a vector of strings; otherwise, we report it with LOG(severity). +// This is handy for capturing messages and perhaps passing them back +// to the caller, rather than reporting them immediately. +// Argument types: +// LogSeverity severity; +// vector *outvec; +// The cast is to disambiguate NULL arguments. +#define LOG_STRING(severity, outvec) \ + LOG_TO_STRING_##severity(static_cast*>(outvec)).stream() + +#define LOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) +#define SYSLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & SYSLOG(severity) + +#define LOG_ASSERT(condition) \ + LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition +#define SYSLOG_ASSERT(condition) \ + SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by DCHECK_IS_ON(), so the check will be executed regardless of +// compilation mode. Therefore, it is safe to do things like: +// CHECK(fp->Write(x) == 4) +#define CHECK(condition) \ + LOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A container for a string pointer which can be evaluated to a bool - +// true iff the pointer is NULL. +struct CheckOpString { + CheckOpString(std::string* str) : str_(str) { } + // No destructor: if str_ is non-NULL, we're about to LOG(FATAL), + // so there's no point in cleaning up str_. + operator bool() const { + return GOOGLE_PREDICT_BRANCH_NOT_TAKEN(str_ != NULL); + } + std::string* str_; +}; + +// Function is overloaded for integral types to allow static const +// integrals declared in classes and not defined to be used as arguments to +// CHECK* macros. It's not encouraged though. +template +inline const T& GetReferenceableValue(const T& t) { return t; } +inline char GetReferenceableValue(char t) { return t; } +inline unsigned char GetReferenceableValue(unsigned char t) { return t; } +inline signed char GetReferenceableValue(signed char t) { return t; } +inline short GetReferenceableValue(short t) { return t; } +inline unsigned short GetReferenceableValue(unsigned short t) { return t; } +inline int GetReferenceableValue(int t) { return t; } +inline unsigned int GetReferenceableValue(unsigned int t) { return t; } +inline long GetReferenceableValue(long t) { return t; } +inline unsigned long GetReferenceableValue(unsigned long t) { return t; } +inline long long GetReferenceableValue(long long t) { return t; } +inline unsigned long long GetReferenceableValue(unsigned long long t) { + return t; +} + +// This is a dummy class to define the following operator. +struct DummyClassToDefineOperator {}; + +} + +// Define global operator<< to declare using ::operator<<. +// This declaration will allow use to use CHECK macros for user +// defined classes which have operator<< (e.g., stl_logging.h). +inline std::ostream& operator<<( + std::ostream& out, const google::DummyClassToDefineOperator&) { + return out; +} + +namespace google { + +// This formats a value for a failing CHECK_XX statement. Ordinarily, +// it uses the definition for operator<<, with a few special cases below. +template +inline void MakeCheckOpValueString(std::ostream* os, const T& v) { + (*os) << v; +} + +// Overrides for char types provide readable values for unprintable +// characters. +template <> GOOGLE_GLOG_DLL_DECL +void MakeCheckOpValueString(std::ostream* os, const char& v); +template <> GOOGLE_GLOG_DLL_DECL +void MakeCheckOpValueString(std::ostream* os, const signed char& v); +template <> GOOGLE_GLOG_DLL_DECL +void MakeCheckOpValueString(std::ostream* os, const unsigned char& v); + +// Build the error message string. Specify no inlining for code size. +template +std::string* MakeCheckOpString(const T1& v1, const T2& v2, const char* exprtext) + __attribute__ ((noinline)); + +namespace base { +namespace internal { + +// If "s" is less than base_logging::INFO, returns base_logging::INFO. +// If "s" is greater than base_logging::FATAL, returns +// base_logging::ERROR. Otherwise, returns "s". +LogSeverity NormalizeSeverity(LogSeverity s); + +} // namespace internal + +// A helper class for formatting "expr (V1 vs. V2)" in a CHECK_XX +// statement. See MakeCheckOpString for sample usage. Other +// approaches were considered: use of a template method (e.g., +// base::BuildCheckOpString(exprtext, base::Print, &v1, +// base::Print, &v2), however this approach has complications +// related to volatile arguments and function-pointer arguments). +class GOOGLE_GLOG_DLL_DECL CheckOpMessageBuilder { + public: + // Inserts "exprtext" and " (" to the stream. + explicit CheckOpMessageBuilder(const char *exprtext); + // Deletes "stream_". + ~CheckOpMessageBuilder(); + // For inserting the first variable. + std::ostream* ForVar1() { return stream_; } + // For inserting the second variable (adds an intermediate " vs. "). + std::ostream* ForVar2(); + // Get the result (inserts the closing ")"). + std::string* NewString(); + + private: + std::ostringstream *stream_; +}; + +} // namespace base + +template +std::string* MakeCheckOpString(const T1& v1, const T2& v2, const char* exprtext) { + base::CheckOpMessageBuilder comb(exprtext); + MakeCheckOpValueString(comb.ForVar1(), v1); + MakeCheckOpValueString(comb.ForVar2(), v2); + return comb.NewString(); +} + +// Helper functions for CHECK_OP macro. +// The (int, int) specialization works around the issue that the compiler +// will not instantiate the template version of the function on values of +// unnamed enum type - see comment below. +#define DEFINE_CHECK_OP_IMPL(name, op) \ + template \ + inline std::string* name##Impl(const T1& v1, const T2& v2, \ + const char* exprtext) { \ + if (GOOGLE_PREDICT_TRUE(v1 op v2)) return NULL; \ + else return MakeCheckOpString(v1, v2, exprtext); \ + } \ + inline std::string* name##Impl(int v1, int v2, const char* exprtext) { \ + return name##Impl(v1, v2, exprtext); \ + } + +// We use the full name Check_EQ, Check_NE, etc. in case the file including +// base/logging.h provides its own #defines for the simpler names EQ, NE, etc. +// This happens if, for example, those are used as token names in a +// yacc grammar. +DEFINE_CHECK_OP_IMPL(Check_EQ, ==) // Compilation error with CHECK_EQ(NULL, x)? +DEFINE_CHECK_OP_IMPL(Check_NE, !=) // Use CHECK(x == NULL) instead. +DEFINE_CHECK_OP_IMPL(Check_LE, <=) +DEFINE_CHECK_OP_IMPL(Check_LT, < ) +DEFINE_CHECK_OP_IMPL(Check_GE, >=) +DEFINE_CHECK_OP_IMPL(Check_GT, > ) +#undef DEFINE_CHECK_OP_IMPL + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use CHECK_EQ et al below. + +#if defined(STATIC_ANALYSIS) +// Only for static analysis tool to know that it is equivalent to assert +#define CHECK_OP_LOG(name, op, val1, val2, log) CHECK((val1) op (val2)) +#elif DCHECK_IS_ON() +// In debug mode, avoid constructing CheckOpStrings if possible, +// to reduce the overhead of CHECK statments by 2x. +// Real DCHECK-heavy tests have seen 1.5x speedups. + +// The meaning of "string" might be different between now and +// when this macro gets invoked (e.g., if someone is experimenting +// with other string implementations that get defined after this +// file is included). Save the current meaning now and use it +// in the macro. +typedef std::string _Check_string; +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::_Check_string* _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, \ + google::CheckOpString(_result)).stream() +#else +// In optimized mode, use CheckOpString to hint to compiler that +// the while condition is unlikely. +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::CheckOpString _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, _result).stream() +#endif // STATIC_ANALYSIS, DCHECK_IS_ON() + +#if GOOGLE_STRIP_LOG <= 3 +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::LogMessageFatal) +#else +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::NullStreamFatal) +#endif // STRIP_LOG <= 3 + +// Equality/Inequality checks - compare two values, and log a FATAL message +// including the two values when the result is not as expected. The values +// must have operator<<(ostream, ...) defined. +// +// You may append to the error message like so: +// CHECK_NE(1, 2) << ": The world must be ending!"; +// +// We are very careful to ensure that each argument is evaluated exactly +// once, and that anything which is legal to pass as a function argument is +// legal here. In particular, the arguments may be temporary expressions +// which will end up being destroyed at the end of the apparent statement, +// for example: +// CHECK_EQ(string("abc")[1], 'b'); +// +// WARNING: These don't compile correctly if one of the arguments is a pointer +// and the other is NULL. To work around this, simply static_cast NULL to the +// type of the desired pointer. + +#define CHECK_EQ(val1, val2) CHECK_OP(_EQ, ==, val1, val2) +#define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2) +#define CHECK_LE(val1, val2) CHECK_OP(_LE, <=, val1, val2) +#define CHECK_LT(val1, val2) CHECK_OP(_LT, < , val1, val2) +#define CHECK_GE(val1, val2) CHECK_OP(_GE, >=, val1, val2) +#define CHECK_GT(val1, val2) CHECK_OP(_GT, > , val1, val2) + +// Check that the input is non NULL. This very useful in constructor +// initializer lists. + +#define CHECK_NOTNULL(val) \ + google::CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val)) + +// Helper functions for string comparisons. +// To avoid bloat, the definitions are in logging.cc. +#define DECLARE_CHECK_STROP_IMPL(func, expected) \ + GOOGLE_GLOG_DLL_DECL std::string* Check##func##expected##Impl( \ + const char* s1, const char* s2, const char* names); +DECLARE_CHECK_STROP_IMPL(strcmp, true) +DECLARE_CHECK_STROP_IMPL(strcmp, false) +DECLARE_CHECK_STROP_IMPL(strcasecmp, true) +DECLARE_CHECK_STROP_IMPL(strcasecmp, false) +#undef DECLARE_CHECK_STROP_IMPL + +// Helper macro for string comparisons. +// Don't use this macro directly in your code, use CHECK_STREQ et al below. +#define CHECK_STROP(func, op, expected, s1, s2) \ + while (google::CheckOpString _result = \ + google::Check##func##expected##Impl((s1), (s2), \ + #s1 " " #op " " #s2)) \ + LOG(FATAL) << *_result.str_ + + +// String (char*) equality/inequality checks. +// CASE versions are case-insensitive. +// +// Note that "s1" and "s2" may be temporary strings which are destroyed +// by the compiler at the end of the current "full expression" +// (e.g. CHECK_STREQ(Foo().c_str(), Bar().c_str())). + +#define CHECK_STREQ(s1, s2) CHECK_STROP(strcmp, ==, true, s1, s2) +#define CHECK_STRNE(s1, s2) CHECK_STROP(strcmp, !=, false, s1, s2) +#define CHECK_STRCASEEQ(s1, s2) CHECK_STROP(strcasecmp, ==, true, s1, s2) +#define CHECK_STRCASENE(s1, s2) CHECK_STROP(strcasecmp, !=, false, s1, s2) + +#define CHECK_INDEX(I,A) CHECK(I < (sizeof(A)/sizeof(A[0]))) +#define CHECK_BOUND(B,A) CHECK(B <= (sizeof(A)/sizeof(A[0]))) + +#define CHECK_DOUBLE_EQ(val1, val2) \ + do { \ + CHECK_LE((val1), (val2)+0.000000000000001L); \ + CHECK_GE((val1), (val2)-0.000000000000001L); \ + } while (0) + +#define CHECK_NEAR(val1, val2, margin) \ + do { \ + CHECK_LE((val1), (val2)+(margin)); \ + CHECK_GE((val1), (val2)-(margin)); \ + } while (0) + +// perror()..googly style! +// +// PLOG() and PLOG_IF() and PCHECK() behave exactly like their LOG* and +// CHECK equivalents with the addition that they postpend a description +// of the current state of errno to their output lines. + +#define PLOG(severity) GOOGLE_PLOG(severity, 0).stream() + +#define GOOGLE_PLOG(severity, counter) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, counter, \ + &google::LogMessage::SendToLog) + +#define PLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & PLOG(severity) + +// A CHECK() macro that postpends errno if the condition is false. E.g. +// +// if (poll(fds, nfds, timeout) == -1) { PCHECK(errno == EINTR); ... } +#define PCHECK(condition) \ + PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A CHECK() macro that lets you assert the success of a function that +// returns -1 and sets errno in case of an error. E.g. +// +// CHECK_ERR(mkdir(path, 0700)); +// +// or +// +// int fd = open(filename, flags); CHECK_ERR(fd) << ": open " << filename; +#define CHECK_ERR(invocation) \ +PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN((invocation) == -1)) \ + << #invocation + +// Use macro expansion to create, for each use of LOG_EVERY_N(), static +// variables with the __LINE__ expansion as part of the variable name. +#define LOG_EVERY_N_VARNAME(base, line) LOG_EVERY_N_VARNAME_CONCAT(base, line) +#define LOG_EVERY_N_VARNAME_CONCAT(base, line) base ## line + +#define LOG_OCCURRENCES LOG_EVERY_N_VARNAME(occurrences_, __LINE__) +#define LOG_OCCURRENCES_MOD_N LOG_EVERY_N_VARNAME(occurrences_mod_n_, __LINE__) + +#define SOME_KIND_OF_LOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_IF_EVERY_N(severity, condition, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (condition && \ + ((LOG_OCCURRENCES_MOD_N=(LOG_OCCURRENCES_MOD_N + 1) % n) == (1 % n))) \ + google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_PLOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_FIRST_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0; \ + if (LOG_OCCURRENCES <= n) \ + ++LOG_OCCURRENCES; \ + if (LOG_OCCURRENCES <= n) \ + google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +namespace glog_internal_namespace_ { +template +struct CompileAssert { +}; +struct CrashReason; + +// Returns true if FailureSignalHandler is installed. +bool IsFailureSignalHandlerInstalled(); +} // namespace glog_internal_namespace_ + +#define GOOGLE_GLOG_COMPILE_ASSERT(expr, msg) \ + typedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + +#define LOG_EVERY_N(severity, n) \ + GOOGLE_GLOG_COMPILE_ASSERT(google::GLOG_ ## severity < \ + google::NUM_SEVERITIES, \ + INVALID_REQUESTED_LOG_SEVERITY); \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define SYSLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToSyslogAndLog) + +#define PLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_PLOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_FIRST_N(severity, n) \ + SOME_KIND_OF_LOG_FIRST_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_IF_EVERY_N(severity, condition, n) \ + SOME_KIND_OF_LOG_IF_EVERY_N(severity, (condition), (n), google::LogMessage::SendToLog) + +// We want the special COUNTER value available for LOG_EVERY_X()'ed messages +enum PRIVATE_Counter {COUNTER}; + +#ifdef GLOG_NO_ABBREVIATED_SEVERITIES +// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets +// substituted with 0, and it expands to COMPACT_GOOGLE_LOG_0. To allow us +// to keep using this syntax, we define this macro to do the same thing +// as COMPACT_GOOGLE_LOG_ERROR. +#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR +#define SYSLOG_0 SYSLOG_ERROR +#define LOG_TO_STRING_0 LOG_TO_STRING_ERROR +// Needed for LOG_IS_ON(ERROR). +const LogSeverity GLOG_0 = GLOG_ERROR; +#else +// Users may include windows.h after logging.h without +// GLOG_NO_ABBREVIATED_SEVERITIES nor WIN32_LEAN_AND_MEAN. +// For this case, we cannot detect if ERROR is defined before users +// actually use ERROR. Let's make an undefined symbol to warn users. +# define GLOG_ERROR_MSG ERROR_macro_is_defined_Define_GLOG_NO_ABBREVIATED_SEVERITIES_before_including_logging_h_See_the_document_for_detail +# define COMPACT_GOOGLE_LOG_0 GLOG_ERROR_MSG +# define SYSLOG_0 GLOG_ERROR_MSG +# define LOG_TO_STRING_0 GLOG_ERROR_MSG +# define GLOG_0 GLOG_ERROR_MSG +#endif + +// Plus some debug-logging macros that get compiled to nothing for production + +#if DCHECK_IS_ON() + +#define DLOG(severity) LOG(severity) +#define DVLOG(verboselevel) VLOG(verboselevel) +#define DLOG_IF(severity, condition) LOG_IF(severity, condition) +#define DLOG_EVERY_N(severity, n) LOG_EVERY_N(severity, n) +#define DLOG_IF_EVERY_N(severity, condition, n) \ + LOG_IF_EVERY_N(severity, condition, n) +#define DLOG_ASSERT(condition) LOG_ASSERT(condition) + +// debug-only checking. executed if DCHECK_IS_ON(). +#define DCHECK(condition) CHECK(condition) +#define DCHECK_EQ(val1, val2) CHECK_EQ(val1, val2) +#define DCHECK_NE(val1, val2) CHECK_NE(val1, val2) +#define DCHECK_LE(val1, val2) CHECK_LE(val1, val2) +#define DCHECK_LT(val1, val2) CHECK_LT(val1, val2) +#define DCHECK_GE(val1, val2) CHECK_GE(val1, val2) +#define DCHECK_GT(val1, val2) CHECK_GT(val1, val2) +#define DCHECK_NOTNULL(val) CHECK_NOTNULL(val) +#define DCHECK_STREQ(str1, str2) CHECK_STREQ(str1, str2) +#define DCHECK_STRCASEEQ(str1, str2) CHECK_STRCASEEQ(str1, str2) +#define DCHECK_STRNE(str1, str2) CHECK_STRNE(str1, str2) +#define DCHECK_STRCASENE(str1, str2) CHECK_STRCASENE(str1, str2) + +#else // !DCHECK_IS_ON() + +#define DLOG(severity) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DVLOG(verboselevel) \ + (true || !VLOG_IS_ON(verboselevel)) ?\ + (void) 0 : google::LogMessageVoidify() & LOG(INFO) + +#define DLOG_IF(severity, condition) \ + (true || !(condition)) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_EVERY_N(severity, n) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_IF_EVERY_N(severity, condition, n) \ + (true || !(condition))? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_ASSERT(condition) \ + true ? (void) 0 : LOG_ASSERT(condition) + +// MSVC warning C4127: conditional expression is constant +#define DCHECK(condition) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK(condition) + +#define DCHECK_EQ(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_EQ(val1, val2) + +#define DCHECK_NE(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_NE(val1, val2) + +#define DCHECK_LE(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_LE(val1, val2) + +#define DCHECK_LT(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_LT(val1, val2) + +#define DCHECK_GE(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_GE(val1, val2) + +#define DCHECK_GT(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_GT(val1, val2) + +// You may see warnings in release mode if you don't use the return +// value of DCHECK_NOTNULL. Please just use DCHECK for such cases. +#define DCHECK_NOTNULL(val) (val) + +#define DCHECK_STREQ(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STREQ(str1, str2) + +#define DCHECK_STRCASEEQ(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STRCASEEQ(str1, str2) + +#define DCHECK_STRNE(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STRNE(str1, str2) + +#define DCHECK_STRCASENE(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STRCASENE(str1, str2) + +#endif // DCHECK_IS_ON() + +// Log only in verbose mode. + +#define VLOG(verboselevel) LOG_IF(INFO, VLOG_IS_ON(verboselevel)) + +#define VLOG_IF(verboselevel, condition) \ + LOG_IF(INFO, (condition) && VLOG_IS_ON(verboselevel)) + +#define VLOG_EVERY_N(verboselevel, n) \ + LOG_IF_EVERY_N(INFO, VLOG_IS_ON(verboselevel), n) + +#define VLOG_IF_EVERY_N(verboselevel, condition, n) \ + LOG_IF_EVERY_N(INFO, (condition) && VLOG_IS_ON(verboselevel), n) + +namespace base_logging { + +// LogMessage::LogStream is a std::ostream backed by this streambuf. +// This class ignores overflow and leaves two bytes at the end of the +// buffer to allow for a '\n' and '\0'. +class GOOGLE_GLOG_DLL_DECL LogStreamBuf : public std::streambuf { + public: + // REQUIREMENTS: "len" must be >= 2 to account for the '\n' and '\n'. + LogStreamBuf(char *buf, int len) { + setp(buf, buf + len - 2); + } + // This effectively ignores overflow. + virtual int_type overflow(int_type ch) { + return ch; + } + + // Legacy public ostrstream method. + size_t pcount() const { return pptr() - pbase(); } + char* pbase() const { return std::streambuf::pbase(); } +}; + +} // namespace base_logging + +// +// This class more or less represents a particular log message. You +// create an instance of LogMessage and then stream stuff to it. +// When you finish streaming to it, ~LogMessage is called and the +// full message gets streamed to the appropriate destination. +// +// You shouldn't actually use LogMessage's constructor to log things, +// though. You should use the LOG() macro (and variants thereof) +// above. +class GOOGLE_GLOG_DLL_DECL LogMessage { +public: + enum { + // Passing kNoLogPrefix for the line number disables the + // log-message prefix. Useful for using the LogMessage + // infrastructure as a printing utility. See also the --log_prefix + // flag for controlling the log-message prefix on an + // application-wide basis. + kNoLogPrefix = -1 + }; + + // LogStream inherit from non-DLL-exported class (std::ostrstream) + // and VC++ produces a warning for this situation. + // However, MSDN says "C4275 can be ignored in Microsoft Visual C++ + // 2005 if you are deriving from a type in the Standard C++ Library" + // http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx + // Let's just ignore the warning. +#ifdef _MSC_VER +# pragma warning(disable: 4275) +#endif + class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream { +#ifdef _MSC_VER +# pragma warning(default: 4275) +#endif + public: + LogStream(char *buf, int len, int ctr) + : std::ostream(NULL), + streambuf_(buf, len), + ctr_(ctr), + self_(this) { + rdbuf(&streambuf_); + } + + int ctr() const { return ctr_; } + void set_ctr(int ctr) { ctr_ = ctr; } + LogStream* self() const { return self_; } + + // Legacy std::streambuf methods. + size_t pcount() const { return streambuf_.pcount(); } + char* pbase() const { return streambuf_.pbase(); } + char* str() const { return pbase(); } + + private: + LogStream(const LogStream&); + LogStream& operator=(const LogStream&); + base_logging::LogStreamBuf streambuf_; + int ctr_; // Counter hack (for the LOG_EVERY_X() macro) + LogStream *self_; // Consistency check hack + }; + +public: + // icc 8 requires this typedef to avoid an internal compiler error. + typedef void (LogMessage::*SendMethod)(); + + LogMessage(const char* file, int line, LogSeverity severity, int ctr, + SendMethod send_method); + + // Two special constructors that generate reduced amounts of code at + // LOG call sites for common cases. + + // Used for LOG(INFO): Implied are: + // severity = INFO, ctr = 0, send_method = &LogMessage::SendToLog. + // + // Using this constructor instead of the more complex constructor above + // saves 19 bytes per call site. + LogMessage(const char* file, int line); + + // Used for LOG(severity) where severity != INFO. Implied + // are: ctr = 0, send_method = &LogMessage::SendToLog + // + // Using this constructor instead of the more complex constructor above + // saves 17 bytes per call site. + LogMessage(const char* file, int line, LogSeverity severity); + + // Constructor to log this message to a specified sink (if not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SendToSinkAndLog if + // also_send_to_log is true, send_method = &LogMessage::SendToSink otherwise. + LogMessage(const char* file, int line, LogSeverity severity, LogSink* sink, + bool also_send_to_log); + + // Constructor where we also give a vector pointer + // for storing the messages (if the pointer is not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SaveOrSendToLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::vector* outvec); + + // Constructor where we also give a string pointer for storing the + // message (if the pointer is not NULL). Implied are: ctr = 0, + // send_method = &LogMessage::WriteToStringAndLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::string* message); + + // A special constructor used for check failures + LogMessage(const char* file, int line, const CheckOpString& result); + + ~LogMessage(); + + // Flush a buffered message to the sink set in the constructor. Always + // called by the destructor, it may also be called from elsewhere if + // needed. Only the first call is actioned; any later ones are ignored. + void Flush(); + + // An arbitrary limit on the length of a single log message. This + // is so that streaming can be done more efficiently. + static const size_t kMaxLogMessageLen; + + // Theses should not be called directly outside of logging.*, + // only passed as SendMethod arguments to other LogMessage methods: + void SendToLog(); // Actually dispatch to the logs + void SendToSyslogAndLog(); // Actually dispatch to syslog and the logs + + // Call abort() or similar to perform LOG(FATAL) crash. + static void __attribute__ ((noreturn)) Fail(); + + std::ostream& stream(); + + int preserved_errno() const; + + // Must be called without the log_mutex held. (L < log_mutex) + static int64 num_messages(int severity); + + struct LogMessageData; + +private: + // Fully internal SendMethod cases: + void SendToSinkAndLog(); // Send to sink if provided and dispatch to the logs + void SendToSink(); // Send to sink if provided, do nothing otherwise. + + // Write to string if provided and dispatch to the logs. + void WriteToStringAndLog(); + + void SaveOrSendToLog(); // Save to stringvec if provided, else to logs + + void Init(const char* file, int line, LogSeverity severity, + void (LogMessage::*send_method)()); + + // Used to fill in crash information during LOG(FATAL) failures. + void RecordCrashReason(glog_internal_namespace_::CrashReason* reason); + + // Counts of messages sent at each priority: + static int64 num_messages_[NUM_SEVERITIES]; // under log_mutex + + // We keep the data in a separate struct so that each instance of + // LogMessage uses less stack space. + LogMessageData* allocated_; + LogMessageData* data_; + + friend class LogDestination; + + LogMessage(const LogMessage&); + void operator=(const LogMessage&); +}; + +// This class happens to be thread-hostile because all instances share +// a single data buffer, but since it can only be created just before +// the process dies, we don't worry so much. +class GOOGLE_GLOG_DLL_DECL LogMessageFatal : public LogMessage { + public: + LogMessageFatal(const char* file, int line); + LogMessageFatal(const char* file, int line, const CheckOpString& result); + __attribute__ ((noreturn)) ~LogMessageFatal(); +}; + +// A non-macro interface to the log facility; (useful +// when the logging level is not a compile-time constant). +inline void LogAtLevel(int const severity, std::string const &msg) { + LogMessage(__FILE__, __LINE__, severity).stream() << msg; +} + +// A macro alternative of LogAtLevel. New code may want to use this +// version since there are two advantages: 1. this version outputs the +// file name and the line number where this macro is put like other +// LOG macros, 2. this macro can be used as C++ stream. +#define LOG_AT_LEVEL(severity) google::LogMessage(__FILE__, __LINE__, severity).stream() + +// Check if it's compiled in C++11 mode. +// +// GXX_EXPERIMENTAL_CXX0X is defined by gcc and clang up to at least +// gcc-4.7 and clang-3.1 (2011-12-13). __cplusplus was defined to 1 +// in gcc before 4.7 (Crosstool 16) and clang before 3.1, but is +// defined according to the language version in effect thereafter. +// Microsoft Visual Studio 14 (2015) sets __cplusplus==199711 despite +// reasonably good C++11 support, so we set LANG_CXX for it and +// newer versions (_MSC_VER >= 1900). +#if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L || \ + (defined(_MSC_VER) && _MSC_VER >= 1900)) +// Helper for CHECK_NOTNULL(). +// +// In C++11, all cases can be handled by a single function. Since the value +// category of the argument is preserved (also for rvalue references), +// member initializer lists like the one below will compile correctly: +// +// Foo() +// : x_(CHECK_NOTNULL(MethodReturningUniquePtr())) {} +template +T CheckNotNull(const char* file, int line, const char* names, T&& t) { + if (t == nullptr) { + LogMessageFatal(file, line, new std::string(names)); + } + return std::forward(t); +} + +#else + +// A small helper for CHECK_NOTNULL(). +template +T* CheckNotNull(const char *file, int line, const char *names, T* t) { + if (t == NULL) { + LogMessageFatal(file, line, new std::string(names)); + } + return t; +} +#endif + +// Allow folks to put a counter in the LOG_EVERY_X()'ed messages. This +// only works if ostream is a LogStream. If the ostream is not a +// LogStream you'll get an assert saying as much at runtime. +GOOGLE_GLOG_DLL_DECL std::ostream& operator<<(std::ostream &os, + const PRIVATE_Counter&); + + +// Derived class for PLOG*() above. +class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage { + public: + + ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr, + void (LogMessage::*send_method)()); + + // Postpends ": strerror(errno) [errno]". + ~ErrnoLogMessage(); + + private: + ErrnoLogMessage(const ErrnoLogMessage&); + void operator=(const ErrnoLogMessage&); +}; + + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". + +class GOOGLE_GLOG_DLL_DECL LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-safe. +GOOGLE_GLOG_DLL_DECL void FlushLogFiles(LogSeverity min_severity); + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-hostile because it ignores +// locking -- used for catastrophic failures. +GOOGLE_GLOG_DLL_DECL void FlushLogFilesUnsafe(LogSeverity min_severity); + +// +// Set the destination to which a particular severity level of log +// messages is sent. If base_filename is "", it means "don't log this +// severity". Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogDestination(LogSeverity severity, + const char* base_filename); + +// +// Set the basename of the symlink to the latest log file at a given +// severity. If symlink_basename is empty, do not make a symlink. If +// you don't call this function, the symlink basename is the +// invocation name of the program. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogSymlink(LogSeverity severity, + const char* symlink_basename); + +// +// Used to send logs to some other kind of destination +// Users should subclass LogSink and override send to do whatever they want. +// Implementations must be thread-safe because a shared instance will +// be called from whichever thread ran the LOG(XXX) line. +class GOOGLE_GLOG_DLL_DECL LogSink { + public: + virtual ~LogSink(); + + // Sink's logging logic (message_len is such as to exclude '\n' at the end). + // This method can't use LOG() or CHECK() as logging system mutex(s) are held + // during this call. + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len) = 0; + + // Redefine this to implement waiting for + // the sink's logging logic to complete. + // It will be called after each send() returns, + // but before that LogMessage exits or crashes. + // By default this function does nothing. + // Using this function one can implement complex logic for send() + // that itself involves logging; and do all this w/o causing deadlocks and + // inconsistent rearrangement of log messages. + // E.g. if a LogSink has thread-specific actions, the send() method + // can simply add the message to a queue and wake up another thread that + // handles real logging while itself making some LOG() calls; + // WaitTillSent() can be implemented to wait for that logic to complete. + // See our unittest for an example. + virtual void WaitTillSent(); + + // Returns the normal text output of the log message. + // Can be useful to implement send(). + static std::string ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len); +}; + +// Add or remove a LogSink as a consumer of logging data. Thread-safe. +GOOGLE_GLOG_DLL_DECL void AddLogSink(LogSink *destination); +GOOGLE_GLOG_DLL_DECL void RemoveLogSink(LogSink *destination); + +// +// Specify an "extension" added to the filename specified via +// SetLogDestination. This applies to all severity levels. It's +// often used to append the port we're listening on to the logfile +// name. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogFilenameExtension( + const char* filename_extension); + +// +// Make it so that all log messages of at least a particular severity +// are logged to stderr (in addition to logging to the usual log +// file(s)). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetStderrLogging(LogSeverity min_severity); + +// +// Make it so that all log messages go only to stderr. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void LogToStderr(); + +// +// Make it so that all log messages of at least a particular severity are +// logged via email to a list of addresses (in addition to logging to the +// usual log file(s)). The list of addresses is just a string containing +// the email addresses to send to (separated by spaces, say). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetEmailLogging(LogSeverity min_severity, + const char* addresses); + +// A simple function that sends email. dest is a commma-separated +// list of addressess. Thread-safe. +GOOGLE_GLOG_DLL_DECL bool SendEmail(const char *dest, + const char *subject, const char *body); + +GOOGLE_GLOG_DLL_DECL const std::vector& GetLoggingDirectories(); + +// For tests only: Clear the internal [cached] list of logging directories to +// force a refresh the next time GetLoggingDirectories is called. +// Thread-hostile. +void TestOnly_ClearLoggingDirectoriesList(); + +// Returns a set of existing temporary directories, which will be a +// subset of the directories returned by GetLogginDirectories(). +// Thread-safe. +GOOGLE_GLOG_DLL_DECL void GetExistingTempDirectories( + std::vector* list); + +// Print any fatal message again -- useful to call from signal handler +// so that the last thing in the output is the fatal message. +// Thread-hostile, but a race is unlikely. +GOOGLE_GLOG_DLL_DECL void ReprintFatalMessage(); + +// Truncate a log file that may be the append-only output of multiple +// processes and hence can't simply be renamed/reopened (typically a +// stdout/stderr). If the file "path" is > "limit" bytes, copy the +// last "keep" bytes to offset 0 and truncate the rest. Since we could +// be racing with other writers, this approach has the potential to +// lose very small amounts of data. For security, only follow symlinks +// if the path is /proc/self/fd/* +GOOGLE_GLOG_DLL_DECL void TruncateLogFile(const char *path, + int64 limit, int64 keep); + +// Truncate stdout and stderr if they are over the value specified by +// --max_log_size; keep the final 1MB. This function has the same +// race condition as TruncateLogFile. +GOOGLE_GLOG_DLL_DECL void TruncateStdoutStderr(); + +// Return the string representation of the provided LogSeverity level. +// Thread-safe. +GOOGLE_GLOG_DLL_DECL const char* GetLogSeverityName(LogSeverity severity); + +// --------------------------------------------------------------------- +// Implementation details that are not useful to most clients +// --------------------------------------------------------------------- + +// A Logger is the interface used by logging modules to emit entries +// to a log. A typical implementation will dump formatted data to a +// sequence of files. We also provide interfaces that will forward +// the data to another thread so that the invoker never blocks. +// Implementations should be thread-safe since the logging system +// will write to them from multiple threads. + +namespace base { + +class GOOGLE_GLOG_DLL_DECL Logger { + public: + virtual ~Logger(); + + // Writes "message[0,message_len-1]" corresponding to an event that + // occurred at "timestamp". If "force_flush" is true, the log file + // is flushed immediately. + // + // The input message has already been formatted as deemed + // appropriate by the higher level logging facility. For example, + // textual log messages already contain timestamps, and the + // file:linenumber header. + virtual void Write(bool force_flush, + time_t timestamp, + const char* message, + int message_len) = 0; + + // Flush any buffered messages + virtual void Flush() = 0; + + // Get the current LOG file size. + // The returned value is approximate since some + // logged data may not have been flushed to disk yet. + virtual uint32 LogSize() = 0; +}; + +// Get the logger for the specified severity level. The logger +// remains the property of the logging module and should not be +// deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL Logger* GetLogger(LogSeverity level); + +// Set the logger for the specified severity level. The logger +// becomes the property of the logging module and should not +// be deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL void SetLogger(LogSeverity level, Logger* logger); + +} + +// glibc has traditionally implemented two incompatible versions of +// strerror_r(). There is a poorly defined convention for picking the +// version that we want, but it is not clear whether it even works with +// all versions of glibc. +// So, instead, we provide this wrapper that automatically detects the +// version that is in use, and then implements POSIX semantics. +// N.B. In addition to what POSIX says, we also guarantee that "buf" will +// be set to an empty string, if this function failed. This means, in most +// cases, you do not need to check the error code and you can directly +// use the value of "buf". It will never have an undefined value. +// DEPRECATED: Use StrError(int) instead. +GOOGLE_GLOG_DLL_DECL int posix_strerror_r(int err, char *buf, size_t len); + +// A thread-safe replacement for strerror(). Returns a string describing the +// given POSIX error code. +GOOGLE_GLOG_DLL_DECL std::string StrError(int err); + +// A class for which we define operator<<, which does nothing. +class GOOGLE_GLOG_DLL_DECL NullStream : public LogMessage::LogStream { + public: + // Initialize the LogStream so the messages can be written somewhere + // (they'll never be actually displayed). This will be needed if a + // NullStream& is implicitly converted to LogStream&, in which case + // the overloaded NullStream::operator<< will not be invoked. + NullStream() : LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream(const char* /*file*/, int /*line*/, + const CheckOpString& /*result*/) : + LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream &stream() { return *this; } + private: + // A very short buffer for messages (which we discard anyway). This + // will be needed if NullStream& converted to LogStream& (e.g. as a + // result of a conditional expression). + char message_buffer_[2]; +}; + +// Do nothing. This operator is inline, allowing the message to be +// compiled away. The message will not be compiled away if we do +// something like (flag ? LOG(INFO) : LOG(ERROR)) << message; when +// SKIP_LOG=WARNING. In those cases, NullStream will be implicitly +// converted to LogStream and the message will be computed and then +// quietly discarded. +template +inline NullStream& operator<<(NullStream &str, const T &) { return str; } + +// Similar to NullStream, but aborts the program (without stack +// trace), like LogMessageFatal. +class GOOGLE_GLOG_DLL_DECL NullStreamFatal : public NullStream { + public: + NullStreamFatal() { } + NullStreamFatal(const char* file, int line, const CheckOpString& result) : + NullStream(file, line, result) { } + __attribute__ ((noreturn)) ~NullStreamFatal() throw () { _exit(1); } +}; + +// Install a signal handler that will dump signal information and a stack +// trace when the program crashes on certain signals. We'll install the +// signal handler for the following signals. +// +// SIGSEGV, SIGILL, SIGFPE, SIGABRT, SIGBUS, and SIGTERM. +// +// By default, the signal handler will write the failure dump to the +// standard error. You can customize the destination by installing your +// own writer function by InstallFailureWriter() below. +// +// Note on threading: +// +// The function should be called before threads are created, if you want +// to use the failure signal handler for all threads. The stack trace +// will be shown only for the thread that receives the signal. In other +// words, stack traces of other threads won't be shown. +GOOGLE_GLOG_DLL_DECL void InstallFailureSignalHandler(); + +// Installs a function that is used for writing the failure dump. "data" +// is the pointer to the beginning of a message to be written, and "size" +// is the size of the message. You should not expect the data is +// terminated with '\0'. +GOOGLE_GLOG_DLL_DECL void InstallFailureWriter( + void (*writer)(const char* data, int size)); + +} + +#endif // _LOGGING_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64/Headers/glog/raw_logging.h b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/raw_logging.h new file mode 100644 index 0000000..65278f6 --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/raw_logging.h @@ -0,0 +1,185 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Maxim Lifantsev +// +// Thread-safe logging routines that do not allocate any memory or +// acquire any locks, and can therefore be used by low-level memory +// allocation and synchronization code. + +#ifndef BASE_RAW_LOGGING_H_ +#define BASE_RAW_LOGGING_H_ + +#include + +namespace google { + +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// This is similar to LOG(severity) << format... and VLOG(level) << format.., +// but +// * it is to be used ONLY by low-level modules that can't use normal LOG() +// * it is desiged to be a low-level logger that does not allocate any +// memory and does not need any locks, hence: +// * it logs straight and ONLY to STDERR w/o buffering +// * it uses an explicit format and arguments list +// * it will silently chop off really long message strings +// Usage example: +// RAW_LOG(ERROR, "Failed foo with %i: %s", status, error); +// RAW_VLOG(3, "status is %i", status); +// These will print an almost standard log lines like this to stderr only: +// E0821 211317 file.cc:123] RAW: Failed foo with 22: bad_file +// I0821 211317 file.cc:142] RAW: status is 20 +#define RAW_LOG(severity, ...) \ + do { \ + switch (google::GLOG_ ## severity) { \ + case 0: \ + RAW_LOG_INFO(__VA_ARGS__); \ + break; \ + case 1: \ + RAW_LOG_WARNING(__VA_ARGS__); \ + break; \ + case 2: \ + RAW_LOG_ERROR(__VA_ARGS__); \ + break; \ + case 3: \ + RAW_LOG_FATAL(__VA_ARGS__); \ + break; \ + default: \ + break; \ + } \ + } while (0) + +// The following STRIP_LOG testing is performed in the header file so that it's +// possible to completely compile out the logging code and the log messages. +#if STRIP_LOG == 0 +#define RAW_VLOG(verboselevel, ...) \ + do { \ + if (VLOG_IS_ON(verboselevel)) { \ + RAW_LOG_INFO(__VA_ARGS__); \ + } \ + } while (0) +#else +#define RAW_VLOG(verboselevel, ...) RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG == 0 +#define RAW_LOG_INFO(...) google::RawLog__(google::GLOG_INFO, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG <= 1 +#define RAW_LOG_WARNING(...) google::RawLog__(google::GLOG_WARNING, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 1 + +#if STRIP_LOG <= 2 +#define RAW_LOG_ERROR(...) google::RawLog__(google::GLOG_ERROR, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 2 + +#if STRIP_LOG <= 3 +#define RAW_LOG_FATAL(...) google::RawLog__(google::GLOG_FATAL, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_FATAL(...) \ + do { \ + google::RawLogStub__(0, __VA_ARGS__); \ + exit(1); \ + } while (0) +#endif // STRIP_LOG <= 3 + +// Similar to CHECK(condition) << message, +// but for low-level modules: we use only RAW_LOG that does not allocate memory. +// We do not want to provide args list here to encourage this usage: +// if (!cond) RAW_LOG(FATAL, "foo ...", hard_to_compute_args); +// so that the args are not computed when not needed. +#define RAW_CHECK(condition, message) \ + do { \ + if (!(condition)) { \ + RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ + } \ + } while (0) + +// Debug versions of RAW_LOG and RAW_CHECK +#ifndef NDEBUG + +#define RAW_DLOG(severity, ...) RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) RAW_CHECK(condition, message) + +#else // NDEBUG + +#define RAW_DLOG(severity, ...) \ + while (false) \ + RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) \ + while (false) \ + RAW_CHECK(condition, message) + +#endif // NDEBUG + +// Stub log function used to work around for unused variable warnings when +// building with STRIP_LOG > 0. +static inline void RawLogStub__(int /* ignored */, ...) { +} + +// Helper function to implement RAW_LOG and RAW_VLOG +// Logs format... at "severity" level, reporting it +// as called from file:line. +// This does not allocate memory or acquire locks. +GOOGLE_GLOG_DLL_DECL void RawLog__(LogSeverity severity, + const char* file, + int line, + const char* format, ...) + __attribute__((__format__ (__printf__, 4, 5))); + +// Hack to propagate time information into this module so that +// this module does not have to directly call localtime_r(), +// which could allocate memory. +GOOGLE_GLOG_DLL_DECL void RawLog__SetLastTime(const struct tm& t, int usecs); + +} + +#endif // BASE_RAW_LOGGING_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64/Headers/glog/stl_logging.h b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/stl_logging.h new file mode 100644 index 0000000..40a15aa --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/stl_logging.h @@ -0,0 +1,220 @@ +// Copyright (c) 2003, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Stream output operators for STL containers; to be used for logging *only*. +// Inclusion of this file lets you do: +// +// list x; +// LOG(INFO) << "data: " << x; +// vector v1, v2; +// CHECK_EQ(v1, v2); +// +// If you want to use this header file with hash maps or slist, you +// need to define macros before including this file: +// +// - GLOG_STL_LOGGING_FOR_UNORDERED - and +// - GLOG_STL_LOGGING_FOR_TR1_UNORDERED - +// - GLOG_STL_LOGGING_FOR_EXT_HASH - +// - GLOG_STL_LOGGING_FOR_EXT_SLIST - +// + +#ifndef UTIL_GTL_STL_LOGGING_INL_H_ +#define UTIL_GTL_STL_LOGGING_INL_H_ + +#if !1 +# error We do not support stl_logging for this compiler +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifdef GLOG_STL_LOGGING_FOR_UNORDERED +# include +# include +#endif + +#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED +# include +# include +#endif + +#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH +# include +# include +#endif +#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST +# include +#endif + +// Forward declare these two, and define them after all the container streams +// operators so that we can recurse from pair -> container -> container -> pair +// properly. +template +std::ostream& operator<<(std::ostream& out, const std::pair& p); + +namespace google { + +template +void PrintSequence(std::ostream& out, Iter begin, Iter end); + +} + +#define OUTPUT_TWO_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +OUTPUT_TWO_ARG_CONTAINER(std::vector) +OUTPUT_TWO_ARG_CONTAINER(std::deque) +OUTPUT_TWO_ARG_CONTAINER(std::list) +#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST +OUTPUT_TWO_ARG_CONTAINER(__gnu_cxx::slist) +#endif + +#undef OUTPUT_TWO_ARG_CONTAINER + +#define OUTPUT_THREE_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +OUTPUT_THREE_ARG_CONTAINER(std::set) +OUTPUT_THREE_ARG_CONTAINER(std::multiset) + +#undef OUTPUT_THREE_ARG_CONTAINER + +#define OUTPUT_FOUR_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +OUTPUT_FOUR_ARG_CONTAINER(std::map) +OUTPUT_FOUR_ARG_CONTAINER(std::multimap) +#ifdef GLOG_STL_LOGGING_FOR_UNORDERED +OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set) +OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset) +#endif +#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED +OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_set) +OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_multiset) +#endif +#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH +OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_set) +OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_multiset) +#endif + +#undef OUTPUT_FOUR_ARG_CONTAINER + +#define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +#ifdef GLOG_STL_LOGGING_FOR_UNORDERED +OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map) +OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap) +#endif +#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED +OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_map) +OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_multimap) +#endif +#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH +OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_map) +OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_multimap) +#endif + +#undef OUTPUT_FIVE_ARG_CONTAINER + +template +inline std::ostream& operator<<(std::ostream& out, + const std::pair& p) { + out << '(' << p.first << ", " << p.second << ')'; + return out; +} + +namespace google { + +template +inline void PrintSequence(std::ostream& out, Iter begin, Iter end) { + // Output at most 100 elements -- appropriate if used for logging. + for (int i = 0; begin != end && i < 100; ++i, ++begin) { + if (i > 0) out << ' '; + out << *begin; + } + if (begin != end) { + out << " ..."; + } +} + +} + +// Note that this is technically undefined behavior! We are adding things into +// the std namespace for a reason though -- we are providing new operations on +// types which are themselves defined with this namespace. Without this, these +// operator overloads cannot be found via ADL. If these definitions are not +// found via ADL, they must be #included before they're used, which requires +// this header to be included before apparently independent other headers. +// +// For example, base/logging.h defines various template functions to implement +// CHECK_EQ(x, y) and stream x and y into the log in the event the check fails. +// It does so via the function template MakeCheckOpValueString: +// template +// void MakeCheckOpValueString(strstream* ss, const T& v) { +// (*ss) << v; +// } +// Because 'glog/logging.h' is included before 'glog/stl_logging.h', +// subsequent CHECK_EQ(v1, v2) for vector<...> typed variable v1 and v2 can only +// find these operator definitions via ADL. +// +// Even this solution has problems -- it may pull unintended operators into the +// namespace as well, allowing them to also be found via ADL, and creating code +// that only works with a particular order of includes. Long term, we need to +// move all of the *definitions* into namespace std, bet we need to ensure no +// one references them first. This lets us take that step. We cannot define them +// in both because that would create ambiguous overloads when both are found. +namespace std { using ::operator<<; } + +#endif // UTIL_GTL_STL_LOGGING_INL_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64/Headers/glog/vlog_is_on.h b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/vlog_is_on.h new file mode 100644 index 0000000..02b0b86 --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64/Headers/glog/vlog_is_on.h @@ -0,0 +1,129 @@ +// Copyright (c) 1999, 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney and many others +// +// Defines the VLOG_IS_ON macro that controls the variable-verbosity +// conditional logging. +// +// It's used by VLOG and VLOG_IF in logging.h +// and by RAW_VLOG in raw_logging.h to trigger the logging. +// +// It can also be used directly e.g. like this: +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished e.g. via just VLOG(2) << ...; +// } +// +// The truth value that VLOG_IS_ON(level) returns is determined by +// the three verbosity level flags: +// --v= Gives the default maximal active V-logging level; +// 0 is the default. +// Normally positive values are used for V-logging levels. +// --vmodule= Gives the per-module maximal V-logging levels to override +// the value given by --v. +// E.g. "my_module=2,foo*=3" would change the logging level +// for all code in source files "my_module.*" and "foo*.*" +// ("-inl" suffixes are also disregarded for this matching). +// +// SetVLOGLevel helper function is provided to do limited dynamic control over +// V-logging by overriding the per-module settings given via --vmodule flag. +// +// CAVEAT: --vmodule functionality is not available in non gcc compilers. +// + +#ifndef BASE_VLOG_IS_ON_H_ +#define BASE_VLOG_IS_ON_H_ + +#include "glog/log_severity.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +#if defined(__GNUC__) +// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. +// (Normally) the first time every VLOG_IS_ON(n) site is hit, +// we determine what variable will dynamically control logging at this site: +// it's either FLAGS_v or an appropriate internal variable +// matching the current source file that represents results of +// parsing of --vmodule flag and/or SetVLOGLevel calls. +#define VLOG_IS_ON(verboselevel) \ + __extension__ \ + ({ static google::int32* vlocal__ = &google::kLogSiteUninitialized; \ + google::int32 verbose_level__ = (verboselevel); \ + (*vlocal__ >= verbose_level__) && \ + ((vlocal__ != &google::kLogSiteUninitialized) || \ + (google::InitVLOG3__(&vlocal__, &FLAGS_v, \ + __FILE__, verbose_level__))); }) +#else +// GNU extensions not available, so we do not support --vmodule. +// Dynamic value of FLAGS_v always controls the logging level. +#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) +#endif + +// Set VLOG(_IS_ON) level for module_pattern to log_level. +// This lets us dynamically control what is normally set by the --vmodule flag. +// Returns the level that previously applied to module_pattern. +// NOTE: To change the log level for VLOG(_IS_ON) sites +// that have already executed after/during InitGoogleLogging, +// one needs to supply the exact --vmodule pattern that applied to them. +// (If no --vmodule pattern applied to them +// the value of FLAGS_v will continue to control them.) +extern GOOGLE_GLOG_DLL_DECL int SetVLOGLevel(const char* module_pattern, + int log_level); + +// Various declarations needed for VLOG_IS_ON above: ========================= + +// Special value used to indicate that a VLOG_IS_ON site has not been +// initialized. We make this a large value, so the common-case check +// of "*vlocal__ >= verbose_level__" in VLOG_IS_ON definition +// passes in such cases and InitVLOG3__ is then triggered. +extern google::int32 kLogSiteUninitialized; + +// Helper routine which determines the logging info for a particalur VLOG site. +// site_flag is the address of the site-local pointer to the controlling +// verbosity level +// site_default is the default to use for *site_flag +// fname is the current source file name +// verbose_level is the argument to VLOG_IS_ON +// We will return the return value for VLOG_IS_ON +// and if possible set *site_flag appropriately. +extern GOOGLE_GLOG_DLL_DECL bool InitVLOG3__( + google::int32** site_flag, + google::int32* site_default, + const char* fname, + google::int32 verbose_level); + +#endif // BASE_VLOG_IS_ON_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64/libglog.a b/Frameworks/glog.xcframework/ios-arm64/libglog.a new file mode 100644 index 0000000..f2ce35b Binary files /dev/null and b/Frameworks/glog.xcframework/ios-arm64/libglog.a differ diff --git a/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/log_severity.h b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/log_severity.h new file mode 100644 index 0000000..99945a4 --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/log_severity.h @@ -0,0 +1,92 @@ +// Copyright (c) 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef BASE_LOG_SEVERITY_H__ +#define BASE_LOG_SEVERITY_H__ + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// Variables of type LogSeverity are widely taken to lie in the range +// [0, NUM_SEVERITIES-1]. Be careful to preserve this assumption if +// you ever need to change their values or add a new severity. +typedef int LogSeverity; + +const int GLOG_INFO = 0, GLOG_WARNING = 1, GLOG_ERROR = 2, GLOG_FATAL = 3, + NUM_SEVERITIES = 4; +#ifndef GLOG_NO_ABBREVIATED_SEVERITIES +# ifdef ERROR +# error ERROR macro is defined. Define GLOG_NO_ABBREVIATED_SEVERITIES before including logging.h. See the document for detail. +# endif +const int INFO = GLOG_INFO, WARNING = GLOG_WARNING, + ERROR = GLOG_ERROR, FATAL = GLOG_FATAL; +#endif + +// DFATAL is FATAL in debug mode, ERROR in normal mode +#ifdef NDEBUG +#define DFATAL_LEVEL ERROR +#else +#define DFATAL_LEVEL FATAL +#endif + +extern GOOGLE_GLOG_DLL_DECL const char* const LogSeverityNames[NUM_SEVERITIES]; + +// NDEBUG usage helpers related to (RAW_)DCHECK: +// +// DEBUG_MODE is for small !NDEBUG uses like +// if (DEBUG_MODE) foo.CheckThatFoo(); +// instead of substantially more verbose +// #ifndef NDEBUG +// foo.CheckThatFoo(); +// #endif +// +// IF_DEBUG_MODE is for small !NDEBUG uses like +// IF_DEBUG_MODE( string error; ) +// DCHECK(Foo(&error)) << error; +// instead of substantially more verbose +// #ifndef NDEBUG +// string error; +// DCHECK(Foo(&error)) << error; +// #endif +// +#ifdef NDEBUG +enum { DEBUG_MODE = 0 }; +#define IF_DEBUG_MODE(x) +#else +enum { DEBUG_MODE = 1 }; +#define IF_DEBUG_MODE(x) x +#endif + +#endif // BASE_LOG_SEVERITY_H__ diff --git a/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/logging.h b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/logging.h new file mode 100644 index 0000000..5abdacd --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/logging.h @@ -0,0 +1,1661 @@ +// Copyright (c) 1999, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney +// +// This file contains #include information about logging-related stuff. +// Pretty much everybody needs to #include this file so that they can +// log various happenings. +// +#ifndef _LOGGING_H_ +#define _LOGGING_H_ + +#include +#include +#include +#include +#include +#include +#include +#if 1 +# include +#endif +#include + +#if defined(_MSC_VER) +#define GLOG_MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \ + __pragma(warning(disable:n)) +#define GLOG_MSVC_POP_WARNING() __pragma(warning(pop)) +#else +#define GLOG_MSVC_PUSH_DISABLE_WARNING(n) +#define GLOG_MSVC_POP_WARNING() +#endif + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// We care a lot about number of bits things take up. Unfortunately, +// systems define their bit-specific ints in a lot of different ways. +// We use our own way, and have a typedef to get there. +// Note: these commands below may look like "#if 1" or "#if 0", but +// that's because they were constructed that way at ./configure time. +// Look at logging.h.in to see how they're calculated (based on your config). +#if 1 +#include // the normal place uint16_t is defined +#endif +#if 1 +#include // the normal place u_int16_t is defined +#endif +#if 1 +#include // a third place for uint16_t or u_int16_t +#endif + +#if 0 +#include +#endif + +namespace google { + +#if 1 // the C99 format +typedef int32_t int32; +typedef uint32_t uint32; +typedef int64_t int64; +typedef uint64_t uint64; +#elif 1 // the BSD format +typedef int32_t int32; +typedef u_int32_t uint32; +typedef int64_t int64; +typedef u_int64_t uint64; +#elif 0 // the windows (vc7) format +typedef __int32 int32; +typedef unsigned __int32 uint32; +typedef __int64 int64; +typedef unsigned __int64 uint64; +#else +#error Do not know how to define a 32-bit integer quantity on your system +#endif + +} + +// The global value of GOOGLE_STRIP_LOG. All the messages logged to +// LOG(XXX) with severity less than GOOGLE_STRIP_LOG will not be displayed. +// If it can be determined at compile time that the message will not be +// printed, the statement will be compiled out. +// +// Example: to strip out all INFO and WARNING messages, use the value +// of 2 below. To make an exception for WARNING messages from a single +// file, add "#define GOOGLE_STRIP_LOG 1" to that file _before_ including +// base/logging.h +#ifndef GOOGLE_STRIP_LOG +#define GOOGLE_STRIP_LOG 0 +#endif + +// GCC can be told that a certain branch is not likely to be taken (for +// instance, a CHECK failure), and use that information in static analysis. +// Giving it this information can help it optimize for the common case in +// the absence of better information (ie. -fprofile-arcs). +// +#ifndef GOOGLE_PREDICT_BRANCH_NOT_TAKEN +#if 1 +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) (__builtin_expect(x, 0)) +#else +#define GOOGLE_PREDICT_BRANCH_NOT_TAKEN(x) x +#endif +#endif + +#ifndef GOOGLE_PREDICT_FALSE +#if 1 +#define GOOGLE_PREDICT_FALSE(x) (__builtin_expect(x, 0)) +#else +#define GOOGLE_PREDICT_FALSE(x) x +#endif +#endif + +#ifndef GOOGLE_PREDICT_TRUE +#if 1 +#define GOOGLE_PREDICT_TRUE(x) (__builtin_expect(!!(x), 1)) +#else +#define GOOGLE_PREDICT_TRUE(x) x +#endif +#endif + + +// Make a bunch of macros for logging. The way to log things is to stream +// things to LOG(). E.g., +// +// LOG(INFO) << "Found " << num_cookies << " cookies"; +// +// You can capture log messages in a string, rather than reporting them +// immediately: +// +// vector errors; +// LOG_STRING(ERROR, &errors) << "Couldn't parse cookie #" << cookie_num; +// +// This pushes back the new error onto 'errors'; if given a NULL pointer, +// it reports the error via LOG(ERROR). +// +// You can also do conditional logging: +// +// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// You can also do occasional logging (log every n'th occurrence of an +// event): +// +// LOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; +// +// The above will cause log messages to be output on the 1st, 11th, 21st, ... +// times it is executed. Note that the special google::COUNTER value is used +// to identify which repetition is happening. +// +// You can also do occasional conditional logging (log every n'th +// occurrence of an event, when condition is satisfied): +// +// LOG_IF_EVERY_N(INFO, (size > 1024), 10) << "Got the " << google::COUNTER +// << "th big cookie"; +// +// You can log messages the first N times your code executes a line. E.g. +// +// LOG_FIRST_N(INFO, 20) << "Got the " << google::COUNTER << "th cookie"; +// +// Outputs log messages for the first 20 times it is executed. +// +// Analogous SYSLOG, SYSLOG_IF, and SYSLOG_EVERY_N macros are available. +// These log to syslog as well as to the normal logs. If you use these at +// all, you need to be aware that syslog can drastically reduce performance, +// especially if it is configured for remote logging! Don't use these +// unless you fully understand this and have a concrete need to use them. +// Even then, try to minimize your use of them. +// +// There are also "debug mode" logging macros like the ones above: +// +// DLOG(INFO) << "Found cookies"; +// +// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// DLOG_EVERY_N(INFO, 10) << "Got the " << google::COUNTER << "th cookie"; +// +// All "debug mode" logging is compiled away to nothing for non-debug mode +// compiles. +// +// We also have +// +// LOG_ASSERT(assertion); +// DLOG_ASSERT(assertion); +// +// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion; +// +// There are "verbose level" logging macros. They look like +// +// VLOG(1) << "I'm printed when you run the program with --v=1 or more"; +// VLOG(2) << "I'm printed when you run the program with --v=2 or more"; +// +// These always log at the INFO log level (when they log at all). +// The verbose logging can also be turned on module-by-module. For instance, +// --vmodule=mapreduce=2,file=1,gfs*=3 --v=0 +// will cause: +// a. VLOG(2) and lower messages to be printed from mapreduce.{h,cc} +// b. VLOG(1) and lower messages to be printed from file.{h,cc} +// c. VLOG(3) and lower messages to be printed from files prefixed with "gfs" +// d. VLOG(0) and lower messages to be printed from elsewhere +// +// The wildcarding functionality shown by (c) supports both '*' (match +// 0 or more characters) and '?' (match any single character) wildcards. +// +// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as +// +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished with just VLOG(2) << ...; +// } +// +// There are also VLOG_IF, VLOG_EVERY_N and VLOG_IF_EVERY_N "verbose level" +// condition macros for sample cases, when some extra computation and +// preparation for logs is not needed. +// VLOG_IF(1, (size > 1024)) +// << "I'm printed when size is more than 1024 and when you run the " +// "program with --v=1 or more"; +// VLOG_EVERY_N(1, 10) +// << "I'm printed every 10th occurrence, and when you run the program " +// "with --v=1 or more. Present occurence is " << google::COUNTER; +// VLOG_IF_EVERY_N(1, (size > 1024), 10) +// << "I'm printed on every 10th occurence of case when size is more " +// " than 1024, when you run the program with --v=1 or more. "; +// "Present occurence is " << google::COUNTER; +// +// The supported severity levels for macros that allow you to specify one +// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL. +// Note that messages of a given severity are logged not only in the +// logfile for that severity, but also in all logfiles of lower severity. +// E.g., a message of severity FATAL will be logged to the logfiles of +// severity FATAL, ERROR, WARNING, and INFO. +// +// There is also the special severity of DFATAL, which logs FATAL in +// debug mode, ERROR in normal mode. +// +// Very important: logging a message at the FATAL severity level causes +// the program to terminate (after the message is logged). +// +// Unless otherwise specified, logs will be written to the filename +// "...log..", followed +// by the date, time, and pid (you can't prevent the date, time, and pid +// from being in the filename). +// +// The logging code takes two flags: +// --v=# set the verbose level +// --logtostderr log all the messages to stderr instead of to logfiles + +// LOG LINE PREFIX FORMAT +// +// Log lines have this form: +// +// Lmmdd hh:mm:ss.uuuuuu threadid file:line] msg... +// +// where the fields are defined as follows: +// +// L A single character, representing the log level +// (eg 'I' for INFO) +// mm The month (zero padded; ie May is '05') +// dd The day (zero padded) +// hh:mm:ss.uuuuuu Time in hours, minutes and fractional seconds +// threadid The space-padded thread ID as returned by GetTID() +// (this matches the PID on Linux) +// file The file name +// line The line number +// msg The user-supplied message +// +// Example: +// +// I1103 11:57:31.739339 24395 google.cc:2341] Command line: ./some_prog +// I1103 11:57:31.739403 24395 google.cc:2342] Process id 24395 +// +// NOTE: although the microseconds are useful for comparing events on +// a single machine, clocks on different machines may not be well +// synchronized. Hence, use caution when comparing the low bits of +// timestamps from different machines. + +#ifndef DECLARE_VARIABLE +#define MUST_UNDEF_GFLAGS_DECLARE_MACROS +#define DECLARE_VARIABLE(type, shorttype, name, tn) \ + namespace fL##shorttype { \ + extern GOOGLE_GLOG_DLL_DECL type FLAGS_##name; \ + } \ + using fL##shorttype::FLAGS_##name + +// bool specialization +#define DECLARE_bool(name) \ + DECLARE_VARIABLE(bool, B, name, bool) + +// int32 specialization +#define DECLARE_int32(name) \ + DECLARE_VARIABLE(google::int32, I, name, int32) + +// Special case for string, because we have to specify the namespace +// std::string, which doesn't play nicely with our FLAG__namespace hackery. +#define DECLARE_string(name) \ + namespace fLS { \ + extern GOOGLE_GLOG_DLL_DECL std::string& FLAGS_##name; \ + } \ + using fLS::FLAGS_##name +#endif + +// Set whether log messages go to stderr instead of logfiles +DECLARE_bool(logtostderr); + +// Set whether log messages go to stderr in addition to logfiles. +DECLARE_bool(alsologtostderr); + +// Set color messages logged to stderr (if supported by terminal). +DECLARE_bool(colorlogtostderr); + +// Log messages at a level >= this flag are automatically sent to +// stderr in addition to log files. +DECLARE_int32(stderrthreshold); + +// Set whether the log prefix should be prepended to each line of output. +DECLARE_bool(log_prefix); + +// Log messages at a level <= this flag are buffered. +// Log messages at a higher level are flushed immediately. +DECLARE_int32(logbuflevel); + +// Sets the maximum number of seconds which logs may be buffered for. +DECLARE_int32(logbufsecs); + +// Log suppression level: messages logged at a lower level than this +// are suppressed. +DECLARE_int32(minloglevel); + +// If specified, logfiles are written into this directory instead of the +// default logging directory. +DECLARE_string(log_dir); + +// Set the log file mode. +DECLARE_int32(logfile_mode); + +// Sets the path of the directory into which to put additional links +// to the log files. +DECLARE_string(log_link); + +DECLARE_int32(v); // in vlog_is_on.cc + +// Sets the maximum log file size (in MB). +DECLARE_int32(max_log_size); + +// Sets whether to avoid logging to the disk if the disk is full. +DECLARE_bool(stop_logging_if_full_disk); + +#ifdef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef MUST_UNDEF_GFLAGS_DECLARE_MACROS +#undef DECLARE_VARIABLE +#undef DECLARE_bool +#undef DECLARE_int32 +#undef DECLARE_string +#endif + +// Log messages below the GOOGLE_STRIP_LOG level will be compiled away for +// security reasons. See LOG(severtiy) below. + +// A few definitions of macros that don't generate much code. Since +// LOG(INFO) and its ilk are used all over our code, it's +// better to have compact code for these operations. + +#if GOOGLE_STRIP_LOG == 0 +#define COMPACT_GOOGLE_LOG_INFO google::LogMessage( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_INFO(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_INFO, message) +#else +#define COMPACT_GOOGLE_LOG_INFO google::NullStream() +#define LOG_TO_STRING_INFO(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 1 +#define COMPACT_GOOGLE_LOG_WARNING google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_WARNING) +#define LOG_TO_STRING_WARNING(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_WARNING, message) +#else +#define COMPACT_GOOGLE_LOG_WARNING google::NullStream() +#define LOG_TO_STRING_WARNING(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 2 +#define COMPACT_GOOGLE_LOG_ERROR google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ERROR) +#define LOG_TO_STRING_ERROR(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ERROR, message) +#else +#define COMPACT_GOOGLE_LOG_ERROR google::NullStream() +#define LOG_TO_STRING_ERROR(message) google::NullStream() +#endif + +#if GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_FATAL google::LogMessageFatal( \ + __FILE__, __LINE__) +#define LOG_TO_STRING_FATAL(message) google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_FATAL, message) +#else +#define COMPACT_GOOGLE_LOG_FATAL google::NullStreamFatal() +#define LOG_TO_STRING_FATAL(message) google::NullStreamFatal() +#endif + +#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) +#define DCHECK_IS_ON() 0 +#else +#define DCHECK_IS_ON() 1 +#endif + +// For DFATAL, we want to use LogMessage (as opposed to +// LogMessageFatal), to be consistent with the original behavior. +#if !DCHECK_IS_ON() +#define COMPACT_GOOGLE_LOG_DFATAL COMPACT_GOOGLE_LOG_ERROR +#elif GOOGLE_STRIP_LOG <= 3 +#define COMPACT_GOOGLE_LOG_DFATAL google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_FATAL) +#else +#define COMPACT_GOOGLE_LOG_DFATAL google::NullStreamFatal() +#endif + +#define GOOGLE_LOG_INFO(counter) google::LogMessage(__FILE__, __LINE__, google::GLOG_INFO, counter, &google::LogMessage::SendToLog) +#define SYSLOG_INFO(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_INFO, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_WARNING(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_WARNING, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_ERROR(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_FATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_FATAL, counter, \ + &google::LogMessage::SendToSyslogAndLog) +#define GOOGLE_LOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToLog) +#define SYSLOG_DFATAL(counter) \ + google::LogMessage(__FILE__, __LINE__, google::DFATAL_LEVEL, counter, \ + &google::LogMessage::SendToSyslogAndLog) + +#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) || defined(__CYGWIN32__) +// A very useful logging macro to log windows errors: +#define LOG_SYSRESULT(result) \ + if (FAILED(HRESULT_FROM_WIN32(result))) { \ + LPSTR message = NULL; \ + LPSTR msg = reinterpret_cast(&message); \ + DWORD message_length = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | \ + FORMAT_MESSAGE_FROM_SYSTEM, \ + 0, result, 0, msg, 100, NULL); \ + if (message_length > 0) { \ + google::LogMessage(__FILE__, __LINE__, google::GLOG_ERROR, 0, \ + &google::LogMessage::SendToLog).stream() \ + << reinterpret_cast(message); \ + LocalFree(message); \ + } \ + } +#endif + +// We use the preprocessor's merging operator, "##", so that, e.g., +// LOG(INFO) becomes the token GOOGLE_LOG_INFO. There's some funny +// subtle difference between ostream member streaming functions (e.g., +// ostream::operator<<(int) and ostream non-member streaming functions +// (e.g., ::operator<<(ostream&, string&): it turns out that it's +// impossible to stream something like a string directly to an unnamed +// ostream. We employ a neat hack by calling the stream() member +// function of LogMessage which seems to avoid the problem. +#define LOG(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() +#define SYSLOG(severity) SYSLOG_ ## severity(0).stream() + +namespace google { + +// They need the definitions of integer types. +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Initialize google's logging library. You will see the program name +// specified by argv0 in log outputs. +GOOGLE_GLOG_DLL_DECL void InitGoogleLogging(const char* argv0); + +// Shutdown google's logging library. +GOOGLE_GLOG_DLL_DECL void ShutdownGoogleLogging(); + +// Install a function which will be called after LOG(FATAL). +GOOGLE_GLOG_DLL_DECL void InstallFailureFunction(void (*fail_func)()); + +class LogSink; // defined below + +// If a non-NULL sink pointer is given, we push this message to that sink. +// For LOG_TO_SINK we then do normal LOG(severity) logging as well. +// This is useful for capturing messages and passing/storing them +// somewhere more specific than the global log of the process. +// Argument types: +// LogSink* sink; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +#define LOG_TO_SINK(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::GLOG_ ## severity, \ + static_cast(sink), true).stream() +#define LOG_TO_SINK_BUT_NOT_TO_LOGFILE(sink, severity) \ + google::LogMessage( \ + __FILE__, __LINE__, \ + google::GLOG_ ## severity, \ + static_cast(sink), false).stream() + +// If a non-NULL string pointer is given, we write this message to that string. +// We then do normal LOG(severity) logging as well. +// This is useful for capturing messages and storing them somewhere more +// specific than the global log of the process. +// Argument types: +// string* message; +// LogSeverity severity; +// The cast is to disambiguate NULL arguments. +// NOTE: LOG(severity) expands to LogMessage().stream() for the specified +// severity. +#define LOG_TO_STRING(severity, message) \ + LOG_TO_STRING_##severity(static_cast(message)).stream() + +// If a non-NULL pointer is given, we push the message onto the end +// of a vector of strings; otherwise, we report it with LOG(severity). +// This is handy for capturing messages and perhaps passing them back +// to the caller, rather than reporting them immediately. +// Argument types: +// LogSeverity severity; +// vector *outvec; +// The cast is to disambiguate NULL arguments. +#define LOG_STRING(severity, outvec) \ + LOG_TO_STRING_##severity(static_cast*>(outvec)).stream() + +#define LOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) +#define SYSLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & SYSLOG(severity) + +#define LOG_ASSERT(condition) \ + LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition +#define SYSLOG_ASSERT(condition) \ + SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by DCHECK_IS_ON(), so the check will be executed regardless of +// compilation mode. Therefore, it is safe to do things like: +// CHECK(fp->Write(x) == 4) +#define CHECK(condition) \ + LOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A container for a string pointer which can be evaluated to a bool - +// true iff the pointer is NULL. +struct CheckOpString { + CheckOpString(std::string* str) : str_(str) { } + // No destructor: if str_ is non-NULL, we're about to LOG(FATAL), + // so there's no point in cleaning up str_. + operator bool() const { + return GOOGLE_PREDICT_BRANCH_NOT_TAKEN(str_ != NULL); + } + std::string* str_; +}; + +// Function is overloaded for integral types to allow static const +// integrals declared in classes and not defined to be used as arguments to +// CHECK* macros. It's not encouraged though. +template +inline const T& GetReferenceableValue(const T& t) { return t; } +inline char GetReferenceableValue(char t) { return t; } +inline unsigned char GetReferenceableValue(unsigned char t) { return t; } +inline signed char GetReferenceableValue(signed char t) { return t; } +inline short GetReferenceableValue(short t) { return t; } +inline unsigned short GetReferenceableValue(unsigned short t) { return t; } +inline int GetReferenceableValue(int t) { return t; } +inline unsigned int GetReferenceableValue(unsigned int t) { return t; } +inline long GetReferenceableValue(long t) { return t; } +inline unsigned long GetReferenceableValue(unsigned long t) { return t; } +inline long long GetReferenceableValue(long long t) { return t; } +inline unsigned long long GetReferenceableValue(unsigned long long t) { + return t; +} + +// This is a dummy class to define the following operator. +struct DummyClassToDefineOperator {}; + +} + +// Define global operator<< to declare using ::operator<<. +// This declaration will allow use to use CHECK macros for user +// defined classes which have operator<< (e.g., stl_logging.h). +inline std::ostream& operator<<( + std::ostream& out, const google::DummyClassToDefineOperator&) { + return out; +} + +namespace google { + +// This formats a value for a failing CHECK_XX statement. Ordinarily, +// it uses the definition for operator<<, with a few special cases below. +template +inline void MakeCheckOpValueString(std::ostream* os, const T& v) { + (*os) << v; +} + +// Overrides for char types provide readable values for unprintable +// characters. +template <> GOOGLE_GLOG_DLL_DECL +void MakeCheckOpValueString(std::ostream* os, const char& v); +template <> GOOGLE_GLOG_DLL_DECL +void MakeCheckOpValueString(std::ostream* os, const signed char& v); +template <> GOOGLE_GLOG_DLL_DECL +void MakeCheckOpValueString(std::ostream* os, const unsigned char& v); + +// Build the error message string. Specify no inlining for code size. +template +std::string* MakeCheckOpString(const T1& v1, const T2& v2, const char* exprtext) + __attribute__ ((noinline)); + +namespace base { +namespace internal { + +// If "s" is less than base_logging::INFO, returns base_logging::INFO. +// If "s" is greater than base_logging::FATAL, returns +// base_logging::ERROR. Otherwise, returns "s". +LogSeverity NormalizeSeverity(LogSeverity s); + +} // namespace internal + +// A helper class for formatting "expr (V1 vs. V2)" in a CHECK_XX +// statement. See MakeCheckOpString for sample usage. Other +// approaches were considered: use of a template method (e.g., +// base::BuildCheckOpString(exprtext, base::Print, &v1, +// base::Print, &v2), however this approach has complications +// related to volatile arguments and function-pointer arguments). +class GOOGLE_GLOG_DLL_DECL CheckOpMessageBuilder { + public: + // Inserts "exprtext" and " (" to the stream. + explicit CheckOpMessageBuilder(const char *exprtext); + // Deletes "stream_". + ~CheckOpMessageBuilder(); + // For inserting the first variable. + std::ostream* ForVar1() { return stream_; } + // For inserting the second variable (adds an intermediate " vs. "). + std::ostream* ForVar2(); + // Get the result (inserts the closing ")"). + std::string* NewString(); + + private: + std::ostringstream *stream_; +}; + +} // namespace base + +template +std::string* MakeCheckOpString(const T1& v1, const T2& v2, const char* exprtext) { + base::CheckOpMessageBuilder comb(exprtext); + MakeCheckOpValueString(comb.ForVar1(), v1); + MakeCheckOpValueString(comb.ForVar2(), v2); + return comb.NewString(); +} + +// Helper functions for CHECK_OP macro. +// The (int, int) specialization works around the issue that the compiler +// will not instantiate the template version of the function on values of +// unnamed enum type - see comment below. +#define DEFINE_CHECK_OP_IMPL(name, op) \ + template \ + inline std::string* name##Impl(const T1& v1, const T2& v2, \ + const char* exprtext) { \ + if (GOOGLE_PREDICT_TRUE(v1 op v2)) return NULL; \ + else return MakeCheckOpString(v1, v2, exprtext); \ + } \ + inline std::string* name##Impl(int v1, int v2, const char* exprtext) { \ + return name##Impl(v1, v2, exprtext); \ + } + +// We use the full name Check_EQ, Check_NE, etc. in case the file including +// base/logging.h provides its own #defines for the simpler names EQ, NE, etc. +// This happens if, for example, those are used as token names in a +// yacc grammar. +DEFINE_CHECK_OP_IMPL(Check_EQ, ==) // Compilation error with CHECK_EQ(NULL, x)? +DEFINE_CHECK_OP_IMPL(Check_NE, !=) // Use CHECK(x == NULL) instead. +DEFINE_CHECK_OP_IMPL(Check_LE, <=) +DEFINE_CHECK_OP_IMPL(Check_LT, < ) +DEFINE_CHECK_OP_IMPL(Check_GE, >=) +DEFINE_CHECK_OP_IMPL(Check_GT, > ) +#undef DEFINE_CHECK_OP_IMPL + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use CHECK_EQ et al below. + +#if defined(STATIC_ANALYSIS) +// Only for static analysis tool to know that it is equivalent to assert +#define CHECK_OP_LOG(name, op, val1, val2, log) CHECK((val1) op (val2)) +#elif DCHECK_IS_ON() +// In debug mode, avoid constructing CheckOpStrings if possible, +// to reduce the overhead of CHECK statments by 2x. +// Real DCHECK-heavy tests have seen 1.5x speedups. + +// The meaning of "string" might be different between now and +// when this macro gets invoked (e.g., if someone is experimenting +// with other string implementations that get defined after this +// file is included). Save the current meaning now and use it +// in the macro. +typedef std::string _Check_string; +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::_Check_string* _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, \ + google::CheckOpString(_result)).stream() +#else +// In optimized mode, use CheckOpString to hint to compiler that +// the while condition is unlikely. +#define CHECK_OP_LOG(name, op, val1, val2, log) \ + while (google::CheckOpString _result = \ + google::Check##name##Impl( \ + google::GetReferenceableValue(val1), \ + google::GetReferenceableValue(val2), \ + #val1 " " #op " " #val2)) \ + log(__FILE__, __LINE__, _result).stream() +#endif // STATIC_ANALYSIS, DCHECK_IS_ON() + +#if GOOGLE_STRIP_LOG <= 3 +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::LogMessageFatal) +#else +#define CHECK_OP(name, op, val1, val2) \ + CHECK_OP_LOG(name, op, val1, val2, google::NullStreamFatal) +#endif // STRIP_LOG <= 3 + +// Equality/Inequality checks - compare two values, and log a FATAL message +// including the two values when the result is not as expected. The values +// must have operator<<(ostream, ...) defined. +// +// You may append to the error message like so: +// CHECK_NE(1, 2) << ": The world must be ending!"; +// +// We are very careful to ensure that each argument is evaluated exactly +// once, and that anything which is legal to pass as a function argument is +// legal here. In particular, the arguments may be temporary expressions +// which will end up being destroyed at the end of the apparent statement, +// for example: +// CHECK_EQ(string("abc")[1], 'b'); +// +// WARNING: These don't compile correctly if one of the arguments is a pointer +// and the other is NULL. To work around this, simply static_cast NULL to the +// type of the desired pointer. + +#define CHECK_EQ(val1, val2) CHECK_OP(_EQ, ==, val1, val2) +#define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2) +#define CHECK_LE(val1, val2) CHECK_OP(_LE, <=, val1, val2) +#define CHECK_LT(val1, val2) CHECK_OP(_LT, < , val1, val2) +#define CHECK_GE(val1, val2) CHECK_OP(_GE, >=, val1, val2) +#define CHECK_GT(val1, val2) CHECK_OP(_GT, > , val1, val2) + +// Check that the input is non NULL. This very useful in constructor +// initializer lists. + +#define CHECK_NOTNULL(val) \ + google::CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val)) + +// Helper functions for string comparisons. +// To avoid bloat, the definitions are in logging.cc. +#define DECLARE_CHECK_STROP_IMPL(func, expected) \ + GOOGLE_GLOG_DLL_DECL std::string* Check##func##expected##Impl( \ + const char* s1, const char* s2, const char* names); +DECLARE_CHECK_STROP_IMPL(strcmp, true) +DECLARE_CHECK_STROP_IMPL(strcmp, false) +DECLARE_CHECK_STROP_IMPL(strcasecmp, true) +DECLARE_CHECK_STROP_IMPL(strcasecmp, false) +#undef DECLARE_CHECK_STROP_IMPL + +// Helper macro for string comparisons. +// Don't use this macro directly in your code, use CHECK_STREQ et al below. +#define CHECK_STROP(func, op, expected, s1, s2) \ + while (google::CheckOpString _result = \ + google::Check##func##expected##Impl((s1), (s2), \ + #s1 " " #op " " #s2)) \ + LOG(FATAL) << *_result.str_ + + +// String (char*) equality/inequality checks. +// CASE versions are case-insensitive. +// +// Note that "s1" and "s2" may be temporary strings which are destroyed +// by the compiler at the end of the current "full expression" +// (e.g. CHECK_STREQ(Foo().c_str(), Bar().c_str())). + +#define CHECK_STREQ(s1, s2) CHECK_STROP(strcmp, ==, true, s1, s2) +#define CHECK_STRNE(s1, s2) CHECK_STROP(strcmp, !=, false, s1, s2) +#define CHECK_STRCASEEQ(s1, s2) CHECK_STROP(strcasecmp, ==, true, s1, s2) +#define CHECK_STRCASENE(s1, s2) CHECK_STROP(strcasecmp, !=, false, s1, s2) + +#define CHECK_INDEX(I,A) CHECK(I < (sizeof(A)/sizeof(A[0]))) +#define CHECK_BOUND(B,A) CHECK(B <= (sizeof(A)/sizeof(A[0]))) + +#define CHECK_DOUBLE_EQ(val1, val2) \ + do { \ + CHECK_LE((val1), (val2)+0.000000000000001L); \ + CHECK_GE((val1), (val2)-0.000000000000001L); \ + } while (0) + +#define CHECK_NEAR(val1, val2, margin) \ + do { \ + CHECK_LE((val1), (val2)+(margin)); \ + CHECK_GE((val1), (val2)-(margin)); \ + } while (0) + +// perror()..googly style! +// +// PLOG() and PLOG_IF() and PCHECK() behave exactly like their LOG* and +// CHECK equivalents with the addition that they postpend a description +// of the current state of errno to their output lines. + +#define PLOG(severity) GOOGLE_PLOG(severity, 0).stream() + +#define GOOGLE_PLOG(severity, counter) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, counter, \ + &google::LogMessage::SendToLog) + +#define PLOG_IF(severity, condition) \ + !(condition) ? (void) 0 : google::LogMessageVoidify() & PLOG(severity) + +// A CHECK() macro that postpends errno if the condition is false. E.g. +// +// if (poll(fds, nfds, timeout) == -1) { PCHECK(errno == EINTR); ... } +#define PCHECK(condition) \ + PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN(!(condition))) \ + << "Check failed: " #condition " " + +// A CHECK() macro that lets you assert the success of a function that +// returns -1 and sets errno in case of an error. E.g. +// +// CHECK_ERR(mkdir(path, 0700)); +// +// or +// +// int fd = open(filename, flags); CHECK_ERR(fd) << ": open " << filename; +#define CHECK_ERR(invocation) \ +PLOG_IF(FATAL, GOOGLE_PREDICT_BRANCH_NOT_TAKEN((invocation) == -1)) \ + << #invocation + +// Use macro expansion to create, for each use of LOG_EVERY_N(), static +// variables with the __LINE__ expansion as part of the variable name. +#define LOG_EVERY_N_VARNAME(base, line) LOG_EVERY_N_VARNAME_CONCAT(base, line) +#define LOG_EVERY_N_VARNAME_CONCAT(base, line) base ## line + +#define LOG_OCCURRENCES LOG_EVERY_N_VARNAME(occurrences_, __LINE__) +#define LOG_OCCURRENCES_MOD_N LOG_EVERY_N_VARNAME(occurrences_mod_n_, __LINE__) + +#define SOME_KIND_OF_LOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_IF_EVERY_N(severity, condition, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (condition && \ + ((LOG_OCCURRENCES_MOD_N=(LOG_OCCURRENCES_MOD_N + 1) % n) == (1 % n))) \ + google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_PLOG_EVERY_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0, LOG_OCCURRENCES_MOD_N = 0; \ + ++LOG_OCCURRENCES; \ + if (++LOG_OCCURRENCES_MOD_N > n) LOG_OCCURRENCES_MOD_N -= n; \ + if (LOG_OCCURRENCES_MOD_N == 1) \ + google::ErrnoLogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +#define SOME_KIND_OF_LOG_FIRST_N(severity, n, what_to_do) \ + static int LOG_OCCURRENCES = 0; \ + if (LOG_OCCURRENCES <= n) \ + ++LOG_OCCURRENCES; \ + if (LOG_OCCURRENCES <= n) \ + google::LogMessage( \ + __FILE__, __LINE__, google::GLOG_ ## severity, LOG_OCCURRENCES, \ + &what_to_do).stream() + +namespace glog_internal_namespace_ { +template +struct CompileAssert { +}; +struct CrashReason; + +// Returns true if FailureSignalHandler is installed. +bool IsFailureSignalHandlerInstalled(); +} // namespace glog_internal_namespace_ + +#define GOOGLE_GLOG_COMPILE_ASSERT(expr, msg) \ + typedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] + +#define LOG_EVERY_N(severity, n) \ + GOOGLE_GLOG_COMPILE_ASSERT(google::GLOG_ ## severity < \ + google::NUM_SEVERITIES, \ + INVALID_REQUESTED_LOG_SEVERITY); \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define SYSLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToSyslogAndLog) + +#define PLOG_EVERY_N(severity, n) \ + SOME_KIND_OF_PLOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_FIRST_N(severity, n) \ + SOME_KIND_OF_LOG_FIRST_N(severity, (n), google::LogMessage::SendToLog) + +#define LOG_IF_EVERY_N(severity, condition, n) \ + SOME_KIND_OF_LOG_IF_EVERY_N(severity, (condition), (n), google::LogMessage::SendToLog) + +// We want the special COUNTER value available for LOG_EVERY_X()'ed messages +enum PRIVATE_Counter {COUNTER}; + +#ifdef GLOG_NO_ABBREVIATED_SEVERITIES +// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets +// substituted with 0, and it expands to COMPACT_GOOGLE_LOG_0. To allow us +// to keep using this syntax, we define this macro to do the same thing +// as COMPACT_GOOGLE_LOG_ERROR. +#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR +#define SYSLOG_0 SYSLOG_ERROR +#define LOG_TO_STRING_0 LOG_TO_STRING_ERROR +// Needed for LOG_IS_ON(ERROR). +const LogSeverity GLOG_0 = GLOG_ERROR; +#else +// Users may include windows.h after logging.h without +// GLOG_NO_ABBREVIATED_SEVERITIES nor WIN32_LEAN_AND_MEAN. +// For this case, we cannot detect if ERROR is defined before users +// actually use ERROR. Let's make an undefined symbol to warn users. +# define GLOG_ERROR_MSG ERROR_macro_is_defined_Define_GLOG_NO_ABBREVIATED_SEVERITIES_before_including_logging_h_See_the_document_for_detail +# define COMPACT_GOOGLE_LOG_0 GLOG_ERROR_MSG +# define SYSLOG_0 GLOG_ERROR_MSG +# define LOG_TO_STRING_0 GLOG_ERROR_MSG +# define GLOG_0 GLOG_ERROR_MSG +#endif + +// Plus some debug-logging macros that get compiled to nothing for production + +#if DCHECK_IS_ON() + +#define DLOG(severity) LOG(severity) +#define DVLOG(verboselevel) VLOG(verboselevel) +#define DLOG_IF(severity, condition) LOG_IF(severity, condition) +#define DLOG_EVERY_N(severity, n) LOG_EVERY_N(severity, n) +#define DLOG_IF_EVERY_N(severity, condition, n) \ + LOG_IF_EVERY_N(severity, condition, n) +#define DLOG_ASSERT(condition) LOG_ASSERT(condition) + +// debug-only checking. executed if DCHECK_IS_ON(). +#define DCHECK(condition) CHECK(condition) +#define DCHECK_EQ(val1, val2) CHECK_EQ(val1, val2) +#define DCHECK_NE(val1, val2) CHECK_NE(val1, val2) +#define DCHECK_LE(val1, val2) CHECK_LE(val1, val2) +#define DCHECK_LT(val1, val2) CHECK_LT(val1, val2) +#define DCHECK_GE(val1, val2) CHECK_GE(val1, val2) +#define DCHECK_GT(val1, val2) CHECK_GT(val1, val2) +#define DCHECK_NOTNULL(val) CHECK_NOTNULL(val) +#define DCHECK_STREQ(str1, str2) CHECK_STREQ(str1, str2) +#define DCHECK_STRCASEEQ(str1, str2) CHECK_STRCASEEQ(str1, str2) +#define DCHECK_STRNE(str1, str2) CHECK_STRNE(str1, str2) +#define DCHECK_STRCASENE(str1, str2) CHECK_STRCASENE(str1, str2) + +#else // !DCHECK_IS_ON() + +#define DLOG(severity) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DVLOG(verboselevel) \ + (true || !VLOG_IS_ON(verboselevel)) ?\ + (void) 0 : google::LogMessageVoidify() & LOG(INFO) + +#define DLOG_IF(severity, condition) \ + (true || !(condition)) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_EVERY_N(severity, n) \ + true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_IF_EVERY_N(severity, condition, n) \ + (true || !(condition))? (void) 0 : google::LogMessageVoidify() & LOG(severity) + +#define DLOG_ASSERT(condition) \ + true ? (void) 0 : LOG_ASSERT(condition) + +// MSVC warning C4127: conditional expression is constant +#define DCHECK(condition) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK(condition) + +#define DCHECK_EQ(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_EQ(val1, val2) + +#define DCHECK_NE(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_NE(val1, val2) + +#define DCHECK_LE(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_LE(val1, val2) + +#define DCHECK_LT(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_LT(val1, val2) + +#define DCHECK_GE(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_GE(val1, val2) + +#define DCHECK_GT(val1, val2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_GT(val1, val2) + +// You may see warnings in release mode if you don't use the return +// value of DCHECK_NOTNULL. Please just use DCHECK for such cases. +#define DCHECK_NOTNULL(val) (val) + +#define DCHECK_STREQ(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STREQ(str1, str2) + +#define DCHECK_STRCASEEQ(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STRCASEEQ(str1, str2) + +#define DCHECK_STRNE(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STRNE(str1, str2) + +#define DCHECK_STRCASENE(str1, str2) \ + GLOG_MSVC_PUSH_DISABLE_WARNING(4127) \ + while (false) \ + GLOG_MSVC_POP_WARNING() CHECK_STRCASENE(str1, str2) + +#endif // DCHECK_IS_ON() + +// Log only in verbose mode. + +#define VLOG(verboselevel) LOG_IF(INFO, VLOG_IS_ON(verboselevel)) + +#define VLOG_IF(verboselevel, condition) \ + LOG_IF(INFO, (condition) && VLOG_IS_ON(verboselevel)) + +#define VLOG_EVERY_N(verboselevel, n) \ + LOG_IF_EVERY_N(INFO, VLOG_IS_ON(verboselevel), n) + +#define VLOG_IF_EVERY_N(verboselevel, condition, n) \ + LOG_IF_EVERY_N(INFO, (condition) && VLOG_IS_ON(verboselevel), n) + +namespace base_logging { + +// LogMessage::LogStream is a std::ostream backed by this streambuf. +// This class ignores overflow and leaves two bytes at the end of the +// buffer to allow for a '\n' and '\0'. +class GOOGLE_GLOG_DLL_DECL LogStreamBuf : public std::streambuf { + public: + // REQUIREMENTS: "len" must be >= 2 to account for the '\n' and '\n'. + LogStreamBuf(char *buf, int len) { + setp(buf, buf + len - 2); + } + // This effectively ignores overflow. + virtual int_type overflow(int_type ch) { + return ch; + } + + // Legacy public ostrstream method. + size_t pcount() const { return pptr() - pbase(); } + char* pbase() const { return std::streambuf::pbase(); } +}; + +} // namespace base_logging + +// +// This class more or less represents a particular log message. You +// create an instance of LogMessage and then stream stuff to it. +// When you finish streaming to it, ~LogMessage is called and the +// full message gets streamed to the appropriate destination. +// +// You shouldn't actually use LogMessage's constructor to log things, +// though. You should use the LOG() macro (and variants thereof) +// above. +class GOOGLE_GLOG_DLL_DECL LogMessage { +public: + enum { + // Passing kNoLogPrefix for the line number disables the + // log-message prefix. Useful for using the LogMessage + // infrastructure as a printing utility. See also the --log_prefix + // flag for controlling the log-message prefix on an + // application-wide basis. + kNoLogPrefix = -1 + }; + + // LogStream inherit from non-DLL-exported class (std::ostrstream) + // and VC++ produces a warning for this situation. + // However, MSDN says "C4275 can be ignored in Microsoft Visual C++ + // 2005 if you are deriving from a type in the Standard C++ Library" + // http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx + // Let's just ignore the warning. +#ifdef _MSC_VER +# pragma warning(disable: 4275) +#endif + class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream { +#ifdef _MSC_VER +# pragma warning(default: 4275) +#endif + public: + LogStream(char *buf, int len, int ctr) + : std::ostream(NULL), + streambuf_(buf, len), + ctr_(ctr), + self_(this) { + rdbuf(&streambuf_); + } + + int ctr() const { return ctr_; } + void set_ctr(int ctr) { ctr_ = ctr; } + LogStream* self() const { return self_; } + + // Legacy std::streambuf methods. + size_t pcount() const { return streambuf_.pcount(); } + char* pbase() const { return streambuf_.pbase(); } + char* str() const { return pbase(); } + + private: + LogStream(const LogStream&); + LogStream& operator=(const LogStream&); + base_logging::LogStreamBuf streambuf_; + int ctr_; // Counter hack (for the LOG_EVERY_X() macro) + LogStream *self_; // Consistency check hack + }; + +public: + // icc 8 requires this typedef to avoid an internal compiler error. + typedef void (LogMessage::*SendMethod)(); + + LogMessage(const char* file, int line, LogSeverity severity, int ctr, + SendMethod send_method); + + // Two special constructors that generate reduced amounts of code at + // LOG call sites for common cases. + + // Used for LOG(INFO): Implied are: + // severity = INFO, ctr = 0, send_method = &LogMessage::SendToLog. + // + // Using this constructor instead of the more complex constructor above + // saves 19 bytes per call site. + LogMessage(const char* file, int line); + + // Used for LOG(severity) where severity != INFO. Implied + // are: ctr = 0, send_method = &LogMessage::SendToLog + // + // Using this constructor instead of the more complex constructor above + // saves 17 bytes per call site. + LogMessage(const char* file, int line, LogSeverity severity); + + // Constructor to log this message to a specified sink (if not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SendToSinkAndLog if + // also_send_to_log is true, send_method = &LogMessage::SendToSink otherwise. + LogMessage(const char* file, int line, LogSeverity severity, LogSink* sink, + bool also_send_to_log); + + // Constructor where we also give a vector pointer + // for storing the messages (if the pointer is not NULL). + // Implied are: ctr = 0, send_method = &LogMessage::SaveOrSendToLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::vector* outvec); + + // Constructor where we also give a string pointer for storing the + // message (if the pointer is not NULL). Implied are: ctr = 0, + // send_method = &LogMessage::WriteToStringAndLog. + LogMessage(const char* file, int line, LogSeverity severity, + std::string* message); + + // A special constructor used for check failures + LogMessage(const char* file, int line, const CheckOpString& result); + + ~LogMessage(); + + // Flush a buffered message to the sink set in the constructor. Always + // called by the destructor, it may also be called from elsewhere if + // needed. Only the first call is actioned; any later ones are ignored. + void Flush(); + + // An arbitrary limit on the length of a single log message. This + // is so that streaming can be done more efficiently. + static const size_t kMaxLogMessageLen; + + // Theses should not be called directly outside of logging.*, + // only passed as SendMethod arguments to other LogMessage methods: + void SendToLog(); // Actually dispatch to the logs + void SendToSyslogAndLog(); // Actually dispatch to syslog and the logs + + // Call abort() or similar to perform LOG(FATAL) crash. + static void __attribute__ ((noreturn)) Fail(); + + std::ostream& stream(); + + int preserved_errno() const; + + // Must be called without the log_mutex held. (L < log_mutex) + static int64 num_messages(int severity); + + struct LogMessageData; + +private: + // Fully internal SendMethod cases: + void SendToSinkAndLog(); // Send to sink if provided and dispatch to the logs + void SendToSink(); // Send to sink if provided, do nothing otherwise. + + // Write to string if provided and dispatch to the logs. + void WriteToStringAndLog(); + + void SaveOrSendToLog(); // Save to stringvec if provided, else to logs + + void Init(const char* file, int line, LogSeverity severity, + void (LogMessage::*send_method)()); + + // Used to fill in crash information during LOG(FATAL) failures. + void RecordCrashReason(glog_internal_namespace_::CrashReason* reason); + + // Counts of messages sent at each priority: + static int64 num_messages_[NUM_SEVERITIES]; // under log_mutex + + // We keep the data in a separate struct so that each instance of + // LogMessage uses less stack space. + LogMessageData* allocated_; + LogMessageData* data_; + + friend class LogDestination; + + LogMessage(const LogMessage&); + void operator=(const LogMessage&); +}; + +// This class happens to be thread-hostile because all instances share +// a single data buffer, but since it can only be created just before +// the process dies, we don't worry so much. +class GOOGLE_GLOG_DLL_DECL LogMessageFatal : public LogMessage { + public: + LogMessageFatal(const char* file, int line); + LogMessageFatal(const char* file, int line, const CheckOpString& result); + __attribute__ ((noreturn)) ~LogMessageFatal(); +}; + +// A non-macro interface to the log facility; (useful +// when the logging level is not a compile-time constant). +inline void LogAtLevel(int const severity, std::string const &msg) { + LogMessage(__FILE__, __LINE__, severity).stream() << msg; +} + +// A macro alternative of LogAtLevel. New code may want to use this +// version since there are two advantages: 1. this version outputs the +// file name and the line number where this macro is put like other +// LOG macros, 2. this macro can be used as C++ stream. +#define LOG_AT_LEVEL(severity) google::LogMessage(__FILE__, __LINE__, severity).stream() + +// Check if it's compiled in C++11 mode. +// +// GXX_EXPERIMENTAL_CXX0X is defined by gcc and clang up to at least +// gcc-4.7 and clang-3.1 (2011-12-13). __cplusplus was defined to 1 +// in gcc before 4.7 (Crosstool 16) and clang before 3.1, but is +// defined according to the language version in effect thereafter. +// Microsoft Visual Studio 14 (2015) sets __cplusplus==199711 despite +// reasonably good C++11 support, so we set LANG_CXX for it and +// newer versions (_MSC_VER >= 1900). +#if (defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L || \ + (defined(_MSC_VER) && _MSC_VER >= 1900)) +// Helper for CHECK_NOTNULL(). +// +// In C++11, all cases can be handled by a single function. Since the value +// category of the argument is preserved (also for rvalue references), +// member initializer lists like the one below will compile correctly: +// +// Foo() +// : x_(CHECK_NOTNULL(MethodReturningUniquePtr())) {} +template +T CheckNotNull(const char* file, int line, const char* names, T&& t) { + if (t == nullptr) { + LogMessageFatal(file, line, new std::string(names)); + } + return std::forward(t); +} + +#else + +// A small helper for CHECK_NOTNULL(). +template +T* CheckNotNull(const char *file, int line, const char *names, T* t) { + if (t == NULL) { + LogMessageFatal(file, line, new std::string(names)); + } + return t; +} +#endif + +// Allow folks to put a counter in the LOG_EVERY_X()'ed messages. This +// only works if ostream is a LogStream. If the ostream is not a +// LogStream you'll get an assert saying as much at runtime. +GOOGLE_GLOG_DLL_DECL std::ostream& operator<<(std::ostream &os, + const PRIVATE_Counter&); + + +// Derived class for PLOG*() above. +class GOOGLE_GLOG_DLL_DECL ErrnoLogMessage : public LogMessage { + public: + + ErrnoLogMessage(const char* file, int line, LogSeverity severity, int ctr, + void (LogMessage::*send_method)()); + + // Postpends ": strerror(errno) [errno]". + ~ErrnoLogMessage(); + + private: + ErrnoLogMessage(const ErrnoLogMessage&); + void operator=(const ErrnoLogMessage&); +}; + + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". + +class GOOGLE_GLOG_DLL_DECL LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-safe. +GOOGLE_GLOG_DLL_DECL void FlushLogFiles(LogSeverity min_severity); + +// Flushes all log files that contains messages that are at least of +// the specified severity level. Thread-hostile because it ignores +// locking -- used for catastrophic failures. +GOOGLE_GLOG_DLL_DECL void FlushLogFilesUnsafe(LogSeverity min_severity); + +// +// Set the destination to which a particular severity level of log +// messages is sent. If base_filename is "", it means "don't log this +// severity". Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogDestination(LogSeverity severity, + const char* base_filename); + +// +// Set the basename of the symlink to the latest log file at a given +// severity. If symlink_basename is empty, do not make a symlink. If +// you don't call this function, the symlink basename is the +// invocation name of the program. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogSymlink(LogSeverity severity, + const char* symlink_basename); + +// +// Used to send logs to some other kind of destination +// Users should subclass LogSink and override send to do whatever they want. +// Implementations must be thread-safe because a shared instance will +// be called from whichever thread ran the LOG(XXX) line. +class GOOGLE_GLOG_DLL_DECL LogSink { + public: + virtual ~LogSink(); + + // Sink's logging logic (message_len is such as to exclude '\n' at the end). + // This method can't use LOG() or CHECK() as logging system mutex(s) are held + // during this call. + virtual void send(LogSeverity severity, const char* full_filename, + const char* base_filename, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len) = 0; + + // Redefine this to implement waiting for + // the sink's logging logic to complete. + // It will be called after each send() returns, + // but before that LogMessage exits or crashes. + // By default this function does nothing. + // Using this function one can implement complex logic for send() + // that itself involves logging; and do all this w/o causing deadlocks and + // inconsistent rearrangement of log messages. + // E.g. if a LogSink has thread-specific actions, the send() method + // can simply add the message to a queue and wake up another thread that + // handles real logging while itself making some LOG() calls; + // WaitTillSent() can be implemented to wait for that logic to complete. + // See our unittest for an example. + virtual void WaitTillSent(); + + // Returns the normal text output of the log message. + // Can be useful to implement send(). + static std::string ToString(LogSeverity severity, const char* file, int line, + const struct ::tm* tm_time, + const char* message, size_t message_len); +}; + +// Add or remove a LogSink as a consumer of logging data. Thread-safe. +GOOGLE_GLOG_DLL_DECL void AddLogSink(LogSink *destination); +GOOGLE_GLOG_DLL_DECL void RemoveLogSink(LogSink *destination); + +// +// Specify an "extension" added to the filename specified via +// SetLogDestination. This applies to all severity levels. It's +// often used to append the port we're listening on to the logfile +// name. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetLogFilenameExtension( + const char* filename_extension); + +// +// Make it so that all log messages of at least a particular severity +// are logged to stderr (in addition to logging to the usual log +// file(s)). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetStderrLogging(LogSeverity min_severity); + +// +// Make it so that all log messages go only to stderr. Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void LogToStderr(); + +// +// Make it so that all log messages of at least a particular severity are +// logged via email to a list of addresses (in addition to logging to the +// usual log file(s)). The list of addresses is just a string containing +// the email addresses to send to (separated by spaces, say). Thread-safe. +// +GOOGLE_GLOG_DLL_DECL void SetEmailLogging(LogSeverity min_severity, + const char* addresses); + +// A simple function that sends email. dest is a commma-separated +// list of addressess. Thread-safe. +GOOGLE_GLOG_DLL_DECL bool SendEmail(const char *dest, + const char *subject, const char *body); + +GOOGLE_GLOG_DLL_DECL const std::vector& GetLoggingDirectories(); + +// For tests only: Clear the internal [cached] list of logging directories to +// force a refresh the next time GetLoggingDirectories is called. +// Thread-hostile. +void TestOnly_ClearLoggingDirectoriesList(); + +// Returns a set of existing temporary directories, which will be a +// subset of the directories returned by GetLogginDirectories(). +// Thread-safe. +GOOGLE_GLOG_DLL_DECL void GetExistingTempDirectories( + std::vector* list); + +// Print any fatal message again -- useful to call from signal handler +// so that the last thing in the output is the fatal message. +// Thread-hostile, but a race is unlikely. +GOOGLE_GLOG_DLL_DECL void ReprintFatalMessage(); + +// Truncate a log file that may be the append-only output of multiple +// processes and hence can't simply be renamed/reopened (typically a +// stdout/stderr). If the file "path" is > "limit" bytes, copy the +// last "keep" bytes to offset 0 and truncate the rest. Since we could +// be racing with other writers, this approach has the potential to +// lose very small amounts of data. For security, only follow symlinks +// if the path is /proc/self/fd/* +GOOGLE_GLOG_DLL_DECL void TruncateLogFile(const char *path, + int64 limit, int64 keep); + +// Truncate stdout and stderr if they are over the value specified by +// --max_log_size; keep the final 1MB. This function has the same +// race condition as TruncateLogFile. +GOOGLE_GLOG_DLL_DECL void TruncateStdoutStderr(); + +// Return the string representation of the provided LogSeverity level. +// Thread-safe. +GOOGLE_GLOG_DLL_DECL const char* GetLogSeverityName(LogSeverity severity); + +// --------------------------------------------------------------------- +// Implementation details that are not useful to most clients +// --------------------------------------------------------------------- + +// A Logger is the interface used by logging modules to emit entries +// to a log. A typical implementation will dump formatted data to a +// sequence of files. We also provide interfaces that will forward +// the data to another thread so that the invoker never blocks. +// Implementations should be thread-safe since the logging system +// will write to them from multiple threads. + +namespace base { + +class GOOGLE_GLOG_DLL_DECL Logger { + public: + virtual ~Logger(); + + // Writes "message[0,message_len-1]" corresponding to an event that + // occurred at "timestamp". If "force_flush" is true, the log file + // is flushed immediately. + // + // The input message has already been formatted as deemed + // appropriate by the higher level logging facility. For example, + // textual log messages already contain timestamps, and the + // file:linenumber header. + virtual void Write(bool force_flush, + time_t timestamp, + const char* message, + int message_len) = 0; + + // Flush any buffered messages + virtual void Flush() = 0; + + // Get the current LOG file size. + // The returned value is approximate since some + // logged data may not have been flushed to disk yet. + virtual uint32 LogSize() = 0; +}; + +// Get the logger for the specified severity level. The logger +// remains the property of the logging module and should not be +// deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL Logger* GetLogger(LogSeverity level); + +// Set the logger for the specified severity level. The logger +// becomes the property of the logging module and should not +// be deleted by the caller. Thread-safe. +extern GOOGLE_GLOG_DLL_DECL void SetLogger(LogSeverity level, Logger* logger); + +} + +// glibc has traditionally implemented two incompatible versions of +// strerror_r(). There is a poorly defined convention for picking the +// version that we want, but it is not clear whether it even works with +// all versions of glibc. +// So, instead, we provide this wrapper that automatically detects the +// version that is in use, and then implements POSIX semantics. +// N.B. In addition to what POSIX says, we also guarantee that "buf" will +// be set to an empty string, if this function failed. This means, in most +// cases, you do not need to check the error code and you can directly +// use the value of "buf". It will never have an undefined value. +// DEPRECATED: Use StrError(int) instead. +GOOGLE_GLOG_DLL_DECL int posix_strerror_r(int err, char *buf, size_t len); + +// A thread-safe replacement for strerror(). Returns a string describing the +// given POSIX error code. +GOOGLE_GLOG_DLL_DECL std::string StrError(int err); + +// A class for which we define operator<<, which does nothing. +class GOOGLE_GLOG_DLL_DECL NullStream : public LogMessage::LogStream { + public: + // Initialize the LogStream so the messages can be written somewhere + // (they'll never be actually displayed). This will be needed if a + // NullStream& is implicitly converted to LogStream&, in which case + // the overloaded NullStream::operator<< will not be invoked. + NullStream() : LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream(const char* /*file*/, int /*line*/, + const CheckOpString& /*result*/) : + LogMessage::LogStream(message_buffer_, 1, 0) { } + NullStream &stream() { return *this; } + private: + // A very short buffer for messages (which we discard anyway). This + // will be needed if NullStream& converted to LogStream& (e.g. as a + // result of a conditional expression). + char message_buffer_[2]; +}; + +// Do nothing. This operator is inline, allowing the message to be +// compiled away. The message will not be compiled away if we do +// something like (flag ? LOG(INFO) : LOG(ERROR)) << message; when +// SKIP_LOG=WARNING. In those cases, NullStream will be implicitly +// converted to LogStream and the message will be computed and then +// quietly discarded. +template +inline NullStream& operator<<(NullStream &str, const T &) { return str; } + +// Similar to NullStream, but aborts the program (without stack +// trace), like LogMessageFatal. +class GOOGLE_GLOG_DLL_DECL NullStreamFatal : public NullStream { + public: + NullStreamFatal() { } + NullStreamFatal(const char* file, int line, const CheckOpString& result) : + NullStream(file, line, result) { } + __attribute__ ((noreturn)) ~NullStreamFatal() throw () { _exit(1); } +}; + +// Install a signal handler that will dump signal information and a stack +// trace when the program crashes on certain signals. We'll install the +// signal handler for the following signals. +// +// SIGSEGV, SIGILL, SIGFPE, SIGABRT, SIGBUS, and SIGTERM. +// +// By default, the signal handler will write the failure dump to the +// standard error. You can customize the destination by installing your +// own writer function by InstallFailureWriter() below. +// +// Note on threading: +// +// The function should be called before threads are created, if you want +// to use the failure signal handler for all threads. The stack trace +// will be shown only for the thread that receives the signal. In other +// words, stack traces of other threads won't be shown. +GOOGLE_GLOG_DLL_DECL void InstallFailureSignalHandler(); + +// Installs a function that is used for writing the failure dump. "data" +// is the pointer to the beginning of a message to be written, and "size" +// is the size of the message. You should not expect the data is +// terminated with '\0'. +GOOGLE_GLOG_DLL_DECL void InstallFailureWriter( + void (*writer)(const char* data, int size)); + +} + +#endif // _LOGGING_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/raw_logging.h b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/raw_logging.h new file mode 100644 index 0000000..65278f6 --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/raw_logging.h @@ -0,0 +1,185 @@ +// Copyright (c) 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Maxim Lifantsev +// +// Thread-safe logging routines that do not allocate any memory or +// acquire any locks, and can therefore be used by low-level memory +// allocation and synchronization code. + +#ifndef BASE_RAW_LOGGING_H_ +#define BASE_RAW_LOGGING_H_ + +#include + +namespace google { + +#include "glog/log_severity.h" +#include "glog/vlog_is_on.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +// This is similar to LOG(severity) << format... and VLOG(level) << format.., +// but +// * it is to be used ONLY by low-level modules that can't use normal LOG() +// * it is desiged to be a low-level logger that does not allocate any +// memory and does not need any locks, hence: +// * it logs straight and ONLY to STDERR w/o buffering +// * it uses an explicit format and arguments list +// * it will silently chop off really long message strings +// Usage example: +// RAW_LOG(ERROR, "Failed foo with %i: %s", status, error); +// RAW_VLOG(3, "status is %i", status); +// These will print an almost standard log lines like this to stderr only: +// E0821 211317 file.cc:123] RAW: Failed foo with 22: bad_file +// I0821 211317 file.cc:142] RAW: status is 20 +#define RAW_LOG(severity, ...) \ + do { \ + switch (google::GLOG_ ## severity) { \ + case 0: \ + RAW_LOG_INFO(__VA_ARGS__); \ + break; \ + case 1: \ + RAW_LOG_WARNING(__VA_ARGS__); \ + break; \ + case 2: \ + RAW_LOG_ERROR(__VA_ARGS__); \ + break; \ + case 3: \ + RAW_LOG_FATAL(__VA_ARGS__); \ + break; \ + default: \ + break; \ + } \ + } while (0) + +// The following STRIP_LOG testing is performed in the header file so that it's +// possible to completely compile out the logging code and the log messages. +#if STRIP_LOG == 0 +#define RAW_VLOG(verboselevel, ...) \ + do { \ + if (VLOG_IS_ON(verboselevel)) { \ + RAW_LOG_INFO(__VA_ARGS__); \ + } \ + } while (0) +#else +#define RAW_VLOG(verboselevel, ...) RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG == 0 +#define RAW_LOG_INFO(...) google::RawLog__(google::GLOG_INFO, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_INFO(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG == 0 + +#if STRIP_LOG <= 1 +#define RAW_LOG_WARNING(...) google::RawLog__(google::GLOG_WARNING, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_WARNING(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 1 + +#if STRIP_LOG <= 2 +#define RAW_LOG_ERROR(...) google::RawLog__(google::GLOG_ERROR, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_ERROR(...) google::RawLogStub__(0, __VA_ARGS__) +#endif // STRIP_LOG <= 2 + +#if STRIP_LOG <= 3 +#define RAW_LOG_FATAL(...) google::RawLog__(google::GLOG_FATAL, \ + __FILE__, __LINE__, __VA_ARGS__) +#else +#define RAW_LOG_FATAL(...) \ + do { \ + google::RawLogStub__(0, __VA_ARGS__); \ + exit(1); \ + } while (0) +#endif // STRIP_LOG <= 3 + +// Similar to CHECK(condition) << message, +// but for low-level modules: we use only RAW_LOG that does not allocate memory. +// We do not want to provide args list here to encourage this usage: +// if (!cond) RAW_LOG(FATAL, "foo ...", hard_to_compute_args); +// so that the args are not computed when not needed. +#define RAW_CHECK(condition, message) \ + do { \ + if (!(condition)) { \ + RAW_LOG(FATAL, "Check %s failed: %s", #condition, message); \ + } \ + } while (0) + +// Debug versions of RAW_LOG and RAW_CHECK +#ifndef NDEBUG + +#define RAW_DLOG(severity, ...) RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) RAW_CHECK(condition, message) + +#else // NDEBUG + +#define RAW_DLOG(severity, ...) \ + while (false) \ + RAW_LOG(severity, __VA_ARGS__) +#define RAW_DCHECK(condition, message) \ + while (false) \ + RAW_CHECK(condition, message) + +#endif // NDEBUG + +// Stub log function used to work around for unused variable warnings when +// building with STRIP_LOG > 0. +static inline void RawLogStub__(int /* ignored */, ...) { +} + +// Helper function to implement RAW_LOG and RAW_VLOG +// Logs format... at "severity" level, reporting it +// as called from file:line. +// This does not allocate memory or acquire locks. +GOOGLE_GLOG_DLL_DECL void RawLog__(LogSeverity severity, + const char* file, + int line, + const char* format, ...) + __attribute__((__format__ (__printf__, 4, 5))); + +// Hack to propagate time information into this module so that +// this module does not have to directly call localtime_r(), +// which could allocate memory. +GOOGLE_GLOG_DLL_DECL void RawLog__SetLastTime(const struct tm& t, int usecs); + +} + +#endif // BASE_RAW_LOGGING_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/stl_logging.h b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/stl_logging.h new file mode 100644 index 0000000..40a15aa --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/stl_logging.h @@ -0,0 +1,220 @@ +// Copyright (c) 2003, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Stream output operators for STL containers; to be used for logging *only*. +// Inclusion of this file lets you do: +// +// list x; +// LOG(INFO) << "data: " << x; +// vector v1, v2; +// CHECK_EQ(v1, v2); +// +// If you want to use this header file with hash maps or slist, you +// need to define macros before including this file: +// +// - GLOG_STL_LOGGING_FOR_UNORDERED - and +// - GLOG_STL_LOGGING_FOR_TR1_UNORDERED - +// - GLOG_STL_LOGGING_FOR_EXT_HASH - +// - GLOG_STL_LOGGING_FOR_EXT_SLIST - +// + +#ifndef UTIL_GTL_STL_LOGGING_INL_H_ +#define UTIL_GTL_STL_LOGGING_INL_H_ + +#if !1 +# error We do not support stl_logging for this compiler +#endif + +#include +#include +#include +#include +#include +#include +#include + +#ifdef GLOG_STL_LOGGING_FOR_UNORDERED +# include +# include +#endif + +#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED +# include +# include +#endif + +#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH +# include +# include +#endif +#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST +# include +#endif + +// Forward declare these two, and define them after all the container streams +// operators so that we can recurse from pair -> container -> container -> pair +// properly. +template +std::ostream& operator<<(std::ostream& out, const std::pair& p); + +namespace google { + +template +void PrintSequence(std::ostream& out, Iter begin, Iter end); + +} + +#define OUTPUT_TWO_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +OUTPUT_TWO_ARG_CONTAINER(std::vector) +OUTPUT_TWO_ARG_CONTAINER(std::deque) +OUTPUT_TWO_ARG_CONTAINER(std::list) +#ifdef GLOG_STL_LOGGING_FOR_EXT_SLIST +OUTPUT_TWO_ARG_CONTAINER(__gnu_cxx::slist) +#endif + +#undef OUTPUT_TWO_ARG_CONTAINER + +#define OUTPUT_THREE_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +OUTPUT_THREE_ARG_CONTAINER(std::set) +OUTPUT_THREE_ARG_CONTAINER(std::multiset) + +#undef OUTPUT_THREE_ARG_CONTAINER + +#define OUTPUT_FOUR_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +OUTPUT_FOUR_ARG_CONTAINER(std::map) +OUTPUT_FOUR_ARG_CONTAINER(std::multimap) +#ifdef GLOG_STL_LOGGING_FOR_UNORDERED +OUTPUT_FOUR_ARG_CONTAINER(std::unordered_set) +OUTPUT_FOUR_ARG_CONTAINER(std::unordered_multiset) +#endif +#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED +OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_set) +OUTPUT_FOUR_ARG_CONTAINER(std::tr1::unordered_multiset) +#endif +#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH +OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_set) +OUTPUT_FOUR_ARG_CONTAINER(__gnu_cxx::hash_multiset) +#endif + +#undef OUTPUT_FOUR_ARG_CONTAINER + +#define OUTPUT_FIVE_ARG_CONTAINER(Sequence) \ +template \ +inline std::ostream& operator<<(std::ostream& out, \ + const Sequence& seq) { \ + google::PrintSequence(out, seq.begin(), seq.end()); \ + return out; \ +} + +#ifdef GLOG_STL_LOGGING_FOR_UNORDERED +OUTPUT_FIVE_ARG_CONTAINER(std::unordered_map) +OUTPUT_FIVE_ARG_CONTAINER(std::unordered_multimap) +#endif +#ifdef GLOG_STL_LOGGING_FOR_TR1_UNORDERED +OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_map) +OUTPUT_FIVE_ARG_CONTAINER(std::tr1::unordered_multimap) +#endif +#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH +OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_map) +OUTPUT_FIVE_ARG_CONTAINER(__gnu_cxx::hash_multimap) +#endif + +#undef OUTPUT_FIVE_ARG_CONTAINER + +template +inline std::ostream& operator<<(std::ostream& out, + const std::pair& p) { + out << '(' << p.first << ", " << p.second << ')'; + return out; +} + +namespace google { + +template +inline void PrintSequence(std::ostream& out, Iter begin, Iter end) { + // Output at most 100 elements -- appropriate if used for logging. + for (int i = 0; begin != end && i < 100; ++i, ++begin) { + if (i > 0) out << ' '; + out << *begin; + } + if (begin != end) { + out << " ..."; + } +} + +} + +// Note that this is technically undefined behavior! We are adding things into +// the std namespace for a reason though -- we are providing new operations on +// types which are themselves defined with this namespace. Without this, these +// operator overloads cannot be found via ADL. If these definitions are not +// found via ADL, they must be #included before they're used, which requires +// this header to be included before apparently independent other headers. +// +// For example, base/logging.h defines various template functions to implement +// CHECK_EQ(x, y) and stream x and y into the log in the event the check fails. +// It does so via the function template MakeCheckOpValueString: +// template +// void MakeCheckOpValueString(strstream* ss, const T& v) { +// (*ss) << v; +// } +// Because 'glog/logging.h' is included before 'glog/stl_logging.h', +// subsequent CHECK_EQ(v1, v2) for vector<...> typed variable v1 and v2 can only +// find these operator definitions via ADL. +// +// Even this solution has problems -- it may pull unintended operators into the +// namespace as well, allowing them to also be found via ADL, and creating code +// that only works with a particular order of includes. Long term, we need to +// move all of the *definitions* into namespace std, bet we need to ensure no +// one references them first. This lets us take that step. We cannot define them +// in both because that would create ambiguous overloads when both are found. +namespace std { using ::operator<<; } + +#endif // UTIL_GTL_STL_LOGGING_INL_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/vlog_is_on.h b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/vlog_is_on.h new file mode 100644 index 0000000..02b0b86 --- /dev/null +++ b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/Headers/glog/vlog_is_on.h @@ -0,0 +1,129 @@ +// Copyright (c) 1999, 2007, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: Ray Sidney and many others +// +// Defines the VLOG_IS_ON macro that controls the variable-verbosity +// conditional logging. +// +// It's used by VLOG and VLOG_IF in logging.h +// and by RAW_VLOG in raw_logging.h to trigger the logging. +// +// It can also be used directly e.g. like this: +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished e.g. via just VLOG(2) << ...; +// } +// +// The truth value that VLOG_IS_ON(level) returns is determined by +// the three verbosity level flags: +// --v= Gives the default maximal active V-logging level; +// 0 is the default. +// Normally positive values are used for V-logging levels. +// --vmodule= Gives the per-module maximal V-logging levels to override +// the value given by --v. +// E.g. "my_module=2,foo*=3" would change the logging level +// for all code in source files "my_module.*" and "foo*.*" +// ("-inl" suffixes are also disregarded for this matching). +// +// SetVLOGLevel helper function is provided to do limited dynamic control over +// V-logging by overriding the per-module settings given via --vmodule flag. +// +// CAVEAT: --vmodule functionality is not available in non gcc compilers. +// + +#ifndef BASE_VLOG_IS_ON_H_ +#define BASE_VLOG_IS_ON_H_ + +#include "glog/log_severity.h" + +// Annoying stuff for windows -- makes sure clients can import these functions +#ifndef GOOGLE_GLOG_DLL_DECL +# if defined(_WIN32) && !defined(__CYGWIN__) +# define GOOGLE_GLOG_DLL_DECL __declspec(dllimport) +# else +# define GOOGLE_GLOG_DLL_DECL +# endif +#endif + +#if defined(__GNUC__) +// We emit an anonymous static int* variable at every VLOG_IS_ON(n) site. +// (Normally) the first time every VLOG_IS_ON(n) site is hit, +// we determine what variable will dynamically control logging at this site: +// it's either FLAGS_v or an appropriate internal variable +// matching the current source file that represents results of +// parsing of --vmodule flag and/or SetVLOGLevel calls. +#define VLOG_IS_ON(verboselevel) \ + __extension__ \ + ({ static google::int32* vlocal__ = &google::kLogSiteUninitialized; \ + google::int32 verbose_level__ = (verboselevel); \ + (*vlocal__ >= verbose_level__) && \ + ((vlocal__ != &google::kLogSiteUninitialized) || \ + (google::InitVLOG3__(&vlocal__, &FLAGS_v, \ + __FILE__, verbose_level__))); }) +#else +// GNU extensions not available, so we do not support --vmodule. +// Dynamic value of FLAGS_v always controls the logging level. +#define VLOG_IS_ON(verboselevel) (FLAGS_v >= (verboselevel)) +#endif + +// Set VLOG(_IS_ON) level for module_pattern to log_level. +// This lets us dynamically control what is normally set by the --vmodule flag. +// Returns the level that previously applied to module_pattern. +// NOTE: To change the log level for VLOG(_IS_ON) sites +// that have already executed after/during InitGoogleLogging, +// one needs to supply the exact --vmodule pattern that applied to them. +// (If no --vmodule pattern applied to them +// the value of FLAGS_v will continue to control them.) +extern GOOGLE_GLOG_DLL_DECL int SetVLOGLevel(const char* module_pattern, + int log_level); + +// Various declarations needed for VLOG_IS_ON above: ========================= + +// Special value used to indicate that a VLOG_IS_ON site has not been +// initialized. We make this a large value, so the common-case check +// of "*vlocal__ >= verbose_level__" in VLOG_IS_ON definition +// passes in such cases and InitVLOG3__ is then triggered. +extern google::int32 kLogSiteUninitialized; + +// Helper routine which determines the logging info for a particalur VLOG site. +// site_flag is the address of the site-local pointer to the controlling +// verbosity level +// site_default is the default to use for *site_flag +// fname is the current source file name +// verbose_level is the argument to VLOG_IS_ON +// We will return the return value for VLOG_IS_ON +// and if possible set *site_flag appropriately. +extern GOOGLE_GLOG_DLL_DECL bool InitVLOG3__( + google::int32** site_flag, + google::int32* site_default, + const char* fname, + google::int32 verbose_level); + +#endif // BASE_VLOG_IS_ON_H_ diff --git a/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/libglog.a b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/libglog.a new file mode 100644 index 0000000..9c50188 Binary files /dev/null and b/Frameworks/glog.xcframework/ios-arm64_x86_64-simulator/libglog.a differ diff --git a/Frameworks/react-native-bridge.xcframework/Info.plist b/Frameworks/react-native-bridge.xcframework/Info.plist new file mode 100644 index 0000000..f0ea6a2 --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-bridge.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-bridge.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-bridge.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-bridge.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ActivityStarter.h b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ActivityStarter.h new file mode 100644 index 0000000..e8740a5 --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ActivityStarter.h @@ -0,0 +1,14 @@ +// +// ActivityStarter.h +// TecnaviaApplication +// +// Created by iPad Developer on 10.01.19. +// Copyright © 2019 Facebook. All rights reserved. +// + +#import +#import + +@interface ActivityStarter : NSObject + +@end diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/BridgeEmitter.h b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/BridgeEmitter.h new file mode 100644 index 0000000..53d01d6 --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/BridgeEmitter.h @@ -0,0 +1,23 @@ +// +// BridgeEmitter.h +// TecnaviaApplication +// +// Created by iPad Developer on 12.02.19. +// Copyright © 2019 Facebook. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BridgeEmitter : RCTEventEmitter + +- (void)sendKeyDown:(NSDictionary *)event; +- (void)sendKeyUp:(NSDictionary *)event; +- (void)sendEvent:(NSString *)event; +- (void)sendEvent:(NSString *)event withBody:(NSDictionary *)body; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ReactBridgeManager.h b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ReactBridgeManager.h new file mode 100644 index 0000000..b2c633e --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ReactBridgeManager.h @@ -0,0 +1,20 @@ +// +// ReactBridgeManager.h +// TecnaviaApplication +// +// Created by iPad Developer on 18.01.21. +// Copyright © 2021 Facebook. All rights reserved. +// + +#import +#import + +@interface ReactBridgeManager : NSObject +@property (nonatomic, strong, readonly) RCTBridge *bridge; + ++ (id) sharedManager; + +- (void) initBridgeWithLaunchOptions:(NSDictionary *)launchOptions; +- (void) reload; + +@end diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ReactViewController.h b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ReactViewController.h new file mode 100644 index 0000000..cca1e0e --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64/Headers/ReactViewController.h @@ -0,0 +1,43 @@ +// +// ReactViewController.h +// TecnaviaApplication +// +// Created by iPad Developer on 18.01.21. +// Copyright © 2021 Facebook. All rights reserved. +// +#import +#import +#import "ReactBridgeManager.h" + +extern NSString *const TAPSetupPropKey; +extern NSString *const TAServerPropKey; +extern NSString *const TALocalePropKey; +extern NSString *const TASplashBackgroundColorPropKey; +extern NSString *const TALoadingColorPropKey; +extern NSString *const TAAppNamePropKey; +extern NSString *const TAAppVersionNamePropKey; +extern NSString *const TAAppVersionCodePropKey; +extern NSString *const TAIAPSharedSecretPropKey; +extern NSString *const TAPushServicePropKey; +extern NSString *const TAPushChannelPropKey; +extern NSString *const TAPushChannelSilentPropKey; +extern NSString *const TAOneSignalAppIdPropKey; +extern NSString *const TAMasAppIdPropKey; +extern NSString *const TAFacebookAppIdPropKey; +extern NSString *const TADebugModePropKey; +extern NSString *const TAAndroidAppIdPropKey; +extern NSString *const TAAmazonIapDeveloperSecretPropKey; +extern NSString *const TAInitialOrientationPropKey; +extern NSString *const TADeveloperNamePropKey; +extern NSString *const TAExternalLinkAccountURLPropKey; +extern NSString *const TAIsAddonPropKey; +extern NSString *const TAAddonNeedsCloseButtonPropKey; +extern NSString *const TAAddonNeedsSafeAreaPropKey; +extern NSString *const TATokenPropKey; +extern NSString *const TAAPIKeyPropKey; + +@interface ReactViewController : UIViewController + +- (instancetype)initWithBridge:(RCTBridge *)bridge moduleName:(NSString*)moduleName initialProps:(NSDictionary*)initialProps; +- (instancetype)initBridgeWithLaunchOptions:(NSDictionary *)launchOptions moduleName:(NSString*)moduleName initialProps:(NSDictionary*)initialProps; +@end diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64/libreact-native-bridge.a b/Frameworks/react-native-bridge.xcframework/ios-arm64/libreact-native-bridge.a new file mode 100644 index 0000000..dc7c000 Binary files /dev/null and b/Frameworks/react-native-bridge.xcframework/ios-arm64/libreact-native-bridge.a differ diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ActivityStarter.h b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ActivityStarter.h new file mode 100644 index 0000000..e8740a5 --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ActivityStarter.h @@ -0,0 +1,14 @@ +// +// ActivityStarter.h +// TecnaviaApplication +// +// Created by iPad Developer on 10.01.19. +// Copyright © 2019 Facebook. All rights reserved. +// + +#import +#import + +@interface ActivityStarter : NSObject + +@end diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/BridgeEmitter.h b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/BridgeEmitter.h new file mode 100644 index 0000000..53d01d6 --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/BridgeEmitter.h @@ -0,0 +1,23 @@ +// +// BridgeEmitter.h +// TecnaviaApplication +// +// Created by iPad Developer on 12.02.19. +// Copyright © 2019 Facebook. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface BridgeEmitter : RCTEventEmitter + +- (void)sendKeyDown:(NSDictionary *)event; +- (void)sendKeyUp:(NSDictionary *)event; +- (void)sendEvent:(NSString *)event; +- (void)sendEvent:(NSString *)event withBody:(NSDictionary *)body; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ReactBridgeManager.h b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ReactBridgeManager.h new file mode 100644 index 0000000..b2c633e --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ReactBridgeManager.h @@ -0,0 +1,20 @@ +// +// ReactBridgeManager.h +// TecnaviaApplication +// +// Created by iPad Developer on 18.01.21. +// Copyright © 2021 Facebook. All rights reserved. +// + +#import +#import + +@interface ReactBridgeManager : NSObject +@property (nonatomic, strong, readonly) RCTBridge *bridge; + ++ (id) sharedManager; + +- (void) initBridgeWithLaunchOptions:(NSDictionary *)launchOptions; +- (void) reload; + +@end diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ReactViewController.h b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ReactViewController.h new file mode 100644 index 0000000..cca1e0e --- /dev/null +++ b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/Headers/ReactViewController.h @@ -0,0 +1,43 @@ +// +// ReactViewController.h +// TecnaviaApplication +// +// Created by iPad Developer on 18.01.21. +// Copyright © 2021 Facebook. All rights reserved. +// +#import +#import +#import "ReactBridgeManager.h" + +extern NSString *const TAPSetupPropKey; +extern NSString *const TAServerPropKey; +extern NSString *const TALocalePropKey; +extern NSString *const TASplashBackgroundColorPropKey; +extern NSString *const TALoadingColorPropKey; +extern NSString *const TAAppNamePropKey; +extern NSString *const TAAppVersionNamePropKey; +extern NSString *const TAAppVersionCodePropKey; +extern NSString *const TAIAPSharedSecretPropKey; +extern NSString *const TAPushServicePropKey; +extern NSString *const TAPushChannelPropKey; +extern NSString *const TAPushChannelSilentPropKey; +extern NSString *const TAOneSignalAppIdPropKey; +extern NSString *const TAMasAppIdPropKey; +extern NSString *const TAFacebookAppIdPropKey; +extern NSString *const TADebugModePropKey; +extern NSString *const TAAndroidAppIdPropKey; +extern NSString *const TAAmazonIapDeveloperSecretPropKey; +extern NSString *const TAInitialOrientationPropKey; +extern NSString *const TADeveloperNamePropKey; +extern NSString *const TAExternalLinkAccountURLPropKey; +extern NSString *const TAIsAddonPropKey; +extern NSString *const TAAddonNeedsCloseButtonPropKey; +extern NSString *const TAAddonNeedsSafeAreaPropKey; +extern NSString *const TATokenPropKey; +extern NSString *const TAAPIKeyPropKey; + +@interface ReactViewController : UIViewController + +- (instancetype)initWithBridge:(RCTBridge *)bridge moduleName:(NSString*)moduleName initialProps:(NSDictionary*)initialProps; +- (instancetype)initBridgeWithLaunchOptions:(NSDictionary *)launchOptions moduleName:(NSString*)moduleName initialProps:(NSDictionary*)initialProps; +@end diff --git a/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/libreact-native-bridge.a b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/libreact-native-bridge.a new file mode 100644 index 0000000..47d204c Binary files /dev/null and b/Frameworks/react-native-bridge.xcframework/ios-arm64_x86_64-simulator/libreact-native-bridge.a differ diff --git a/Frameworks/react-native-cookies.xcframework/Info.plist b/Frameworks/react-native-cookies.xcframework/Info.plist new file mode 100644 index 0000000..486b4ff --- /dev/null +++ b/Frameworks/react-native-cookies.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-cookies.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-cookies.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-cookies.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-cookies.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-cookies.xcframework/ios-arm64/Headers/RNCookieManagerIOS.h b/Frameworks/react-native-cookies.xcframework/ios-arm64/Headers/RNCookieManagerIOS.h new file mode 100644 index 0000000..f780534 --- /dev/null +++ b/Frameworks/react-native-cookies.xcframework/ios-arm64/Headers/RNCookieManagerIOS.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Joseph P. Ferraro + * + * This source code is licensed under the MIT license found in the + * LICENSE file here: https://github.com/joeferraro/react-native-cookies/blob/master/LICENSE.md. + */ + +#import + +#import + +@interface RNCookieManagerIOS : NSObject + +@property (nonatomic, strong) NSDateFormatter *formatter; + +@end diff --git a/Frameworks/react-native-cookies.xcframework/ios-arm64/libreact-native-cookies.a b/Frameworks/react-native-cookies.xcframework/ios-arm64/libreact-native-cookies.a new file mode 100644 index 0000000..091d50c Binary files /dev/null and b/Frameworks/react-native-cookies.xcframework/ios-arm64/libreact-native-cookies.a differ diff --git a/Frameworks/react-native-cookies.xcframework/ios-arm64_x86_64-simulator/Headers/RNCookieManagerIOS.h b/Frameworks/react-native-cookies.xcframework/ios-arm64_x86_64-simulator/Headers/RNCookieManagerIOS.h new file mode 100644 index 0000000..f780534 --- /dev/null +++ b/Frameworks/react-native-cookies.xcframework/ios-arm64_x86_64-simulator/Headers/RNCookieManagerIOS.h @@ -0,0 +1,16 @@ +/** + * Copyright (c) Joseph P. Ferraro + * + * This source code is licensed under the MIT license found in the + * LICENSE file here: https://github.com/joeferraro/react-native-cookies/blob/master/LICENSE.md. + */ + +#import + +#import + +@interface RNCookieManagerIOS : NSObject + +@property (nonatomic, strong) NSDateFormatter *formatter; + +@end diff --git a/Frameworks/react-native-cookies.xcframework/ios-arm64_x86_64-simulator/libreact-native-cookies.a b/Frameworks/react-native-cookies.xcframework/ios-arm64_x86_64-simulator/libreact-native-cookies.a new file mode 100644 index 0000000..5981dfa Binary files /dev/null and b/Frameworks/react-native-cookies.xcframework/ios-arm64_x86_64-simulator/libreact-native-cookies.a differ diff --git a/Frameworks/react-native-dfp.xcframework/Info.plist b/Frameworks/react-native-dfp.xcframework/Info.plist new file mode 100644 index 0000000..522dbb3 --- /dev/null +++ b/Frameworks/react-native-dfp.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-dfp.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-dfp.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-dfp.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-dfp.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPBannerManager.h b/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPBannerManager.h new file mode 100644 index 0000000..c6aab08 --- /dev/null +++ b/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPBannerManager.h @@ -0,0 +1,9 @@ +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + +@interface RNDFPBannerManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPBannerView.h b/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPBannerView.h new file mode 100644 index 0000000..6cb3737 --- /dev/null +++ b/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPBannerView.h @@ -0,0 +1,36 @@ +#if __has_include() +#import +#else +#import "RCTComponent.h" +#endif + +#import + +@import GoogleMobileAds; + +@class RCTEventDispatcher; + +@interface RNDFPBannerView : RCTView + +@property (nonatomic, copy) NSArray *adSizes; +@property (nonatomic, copy) NSDictionary *dimensions; +@property (nonatomic, copy) NSString *bannerSize; +@property (nonatomic, copy) NSString *adUnitID; +@property (nonatomic, copy) NSString *testDeviceID; +@property (nonatomic, copy) NSDictionary *targeting; + +@property (nonatomic, copy) RCTBubblingEventBlock onWillChangeAdSizeTo; + +@property (nonatomic, copy) RCTBubblingEventBlock onSizeChange; +@property (nonatomic, copy) RCTBubblingEventBlock onAdmobDispatchAppEvent; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewDidReceiveAd; +@property (nonatomic, copy) RCTBubblingEventBlock onDidFailToReceiveAdWithError; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewWillPresentScreen; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewWillDismissScreen; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewDidDismissScreen; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; +- (GADAdSize)getAdSizeFromString:(NSString *)bannerSize; +- (void)loadBanner; + +@end diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPInterstitial.h b/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPInterstitial.h new file mode 100644 index 0000000..9a93ea5 --- /dev/null +++ b/Frameworks/react-native-dfp.xcframework/ios-arm64/Headers/RNDFPInterstitial.h @@ -0,0 +1,17 @@ +#if __has_include() +#import +#import +#import +#else +#import "RCTBridgeModule.h" +#import "RCTEventDispatcher.h" +#import "RCTUtils.h" +#endif + +@import GoogleMobileAds; + +@interface RNDFPInterstitial : NSObject + +@property(nonatomic, strong) GAMInterstitialAd *interstitial; + +@end diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64/libreact-native-dfp.a b/Frameworks/react-native-dfp.xcframework/ios-arm64/libreact-native-dfp.a new file mode 100644 index 0000000..44b0900 Binary files /dev/null and b/Frameworks/react-native-dfp.xcframework/ios-arm64/libreact-native-dfp.a differ diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPBannerManager.h b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPBannerManager.h new file mode 100644 index 0000000..c6aab08 --- /dev/null +++ b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPBannerManager.h @@ -0,0 +1,9 @@ +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + +@interface RNDFPBannerManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPBannerView.h b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPBannerView.h new file mode 100644 index 0000000..6cb3737 --- /dev/null +++ b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPBannerView.h @@ -0,0 +1,36 @@ +#if __has_include() +#import +#else +#import "RCTComponent.h" +#endif + +#import + +@import GoogleMobileAds; + +@class RCTEventDispatcher; + +@interface RNDFPBannerView : RCTView + +@property (nonatomic, copy) NSArray *adSizes; +@property (nonatomic, copy) NSDictionary *dimensions; +@property (nonatomic, copy) NSString *bannerSize; +@property (nonatomic, copy) NSString *adUnitID; +@property (nonatomic, copy) NSString *testDeviceID; +@property (nonatomic, copy) NSDictionary *targeting; + +@property (nonatomic, copy) RCTBubblingEventBlock onWillChangeAdSizeTo; + +@property (nonatomic, copy) RCTBubblingEventBlock onSizeChange; +@property (nonatomic, copy) RCTBubblingEventBlock onAdmobDispatchAppEvent; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewDidReceiveAd; +@property (nonatomic, copy) RCTBubblingEventBlock onDidFailToReceiveAdWithError; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewWillPresentScreen; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewWillDismissScreen; +@property (nonatomic, copy) RCTBubblingEventBlock onAdViewDidDismissScreen; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; +- (GADAdSize)getAdSizeFromString:(NSString *)bannerSize; +- (void)loadBanner; + +@end diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPInterstitial.h b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPInterstitial.h new file mode 100644 index 0000000..9a93ea5 --- /dev/null +++ b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/Headers/RNDFPInterstitial.h @@ -0,0 +1,17 @@ +#if __has_include() +#import +#import +#import +#else +#import "RCTBridgeModule.h" +#import "RCTEventDispatcher.h" +#import "RCTUtils.h" +#endif + +@import GoogleMobileAds; + +@interface RNDFPInterstitial : NSObject + +@property(nonatomic, strong) GAMInterstitialAd *interstitial; + +@end diff --git a/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/libreact-native-dfp.a b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/libreact-native-dfp.a new file mode 100644 index 0000000..5c272f2 Binary files /dev/null and b/Frameworks/react-native-dfp.xcframework/ios-arm64_x86_64-simulator/libreact-native-dfp.a differ diff --git a/Frameworks/react-native-geolocation.xcframework/Info.plist b/Frameworks/react-native-geolocation.xcframework/Info.plist new file mode 100644 index 0000000..f5e1d95 --- /dev/null +++ b/Frameworks/react-native-geolocation.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-geolocation.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-geolocation.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-geolocation.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-geolocation.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-geolocation.xcframework/ios-arm64/Headers/RNCGeolocation.h b/Frameworks/react-native-geolocation.xcframework/ios-arm64/Headers/RNCGeolocation.h new file mode 100644 index 0000000..75bc64c --- /dev/null +++ b/Frameworks/react-native-geolocation.xcframework/ios-arm64/Headers/RNCGeolocation.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCGeolocation : RCTEventEmitter + +@end diff --git a/Frameworks/react-native-geolocation.xcframework/ios-arm64/libreact-native-geolocation.a b/Frameworks/react-native-geolocation.xcframework/ios-arm64/libreact-native-geolocation.a new file mode 100644 index 0000000..b751f80 Binary files /dev/null and b/Frameworks/react-native-geolocation.xcframework/ios-arm64/libreact-native-geolocation.a differ diff --git a/Frameworks/react-native-geolocation.xcframework/ios-arm64_x86_64-simulator/Headers/RNCGeolocation.h b/Frameworks/react-native-geolocation.xcframework/ios-arm64_x86_64-simulator/Headers/RNCGeolocation.h new file mode 100644 index 0000000..75bc64c --- /dev/null +++ b/Frameworks/react-native-geolocation.xcframework/ios-arm64_x86_64-simulator/Headers/RNCGeolocation.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCGeolocation : RCTEventEmitter + +@end diff --git a/Frameworks/react-native-geolocation.xcframework/ios-arm64_x86_64-simulator/libreact-native-geolocation.a b/Frameworks/react-native-geolocation.xcframework/ios-arm64_x86_64-simulator/libreact-native-geolocation.a new file mode 100644 index 0000000..ee1e9ac Binary files /dev/null and b/Frameworks/react-native-geolocation.xcframework/ios-arm64_x86_64-simulator/libreact-native-geolocation.a differ diff --git a/Frameworks/react-native-html-to-pdf.xcframework/Info.plist b/Frameworks/react-native-html-to-pdf.xcframework/Info.plist new file mode 100644 index 0000000..be925ea --- /dev/null +++ b/Frameworks/react-native-html-to-pdf.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-html-to-pdf.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-html-to-pdf.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-html-to-pdf.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-html-to-pdf.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64/Headers/RNHTMLtoPDF.h b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64/Headers/RNHTMLtoPDF.h new file mode 100644 index 0000000..7e1810b --- /dev/null +++ b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64/Headers/RNHTMLtoPDF.h @@ -0,0 +1,9 @@ + +// Created by Christopher on 9/3/15. + +#import +#import +#import +@interface RNHTMLtoPDF : RCTView + +@end diff --git a/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64/libreact-native-html-to-pdf.a b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64/libreact-native-html-to-pdf.a new file mode 100644 index 0000000..9e61747 Binary files /dev/null and b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64/libreact-native-html-to-pdf.a differ diff --git a/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RNHTMLtoPDF.h b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RNHTMLtoPDF.h new file mode 100644 index 0000000..7e1810b --- /dev/null +++ b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RNHTMLtoPDF.h @@ -0,0 +1,9 @@ + +// Created by Christopher on 9/3/15. + +#import +#import +#import +@interface RNHTMLtoPDF : RCTView + +@end diff --git a/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64_x86_64-simulator/libreact-native-html-to-pdf.a b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64_x86_64-simulator/libreact-native-html-to-pdf.a new file mode 100644 index 0000000..1e39a0f Binary files /dev/null and b/Frameworks/react-native-html-to-pdf.xcframework/ios-arm64_x86_64-simulator/libreact-native-html-to-pdf.a differ diff --git a/Frameworks/react-native-idle-timer.xcframework/Info.plist b/Frameworks/react-native-idle-timer.xcframework/Info.plist new file mode 100644 index 0000000..9daaded --- /dev/null +++ b/Frameworks/react-native-idle-timer.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-idle-timer.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-idle-timer.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-idle-timer.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-idle-timer.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-idle-timer.xcframework/ios-arm64/Headers/IdleTimerManager.h b/Frameworks/react-native-idle-timer.xcframework/ios-arm64/Headers/IdleTimerManager.h new file mode 100644 index 0000000..54a32b9 --- /dev/null +++ b/Frameworks/react-native-idle-timer.xcframework/ios-arm64/Headers/IdleTimerManager.h @@ -0,0 +1,10 @@ +#import +#if __has_include("RCTBridgeModule.h") +#import "RCTBridgeModule.h" +#else +#import +#endif + +@interface IdleTimerManager : NSObject + +@end diff --git a/Frameworks/react-native-idle-timer.xcframework/ios-arm64/libreact-native-idle-timer.a b/Frameworks/react-native-idle-timer.xcframework/ios-arm64/libreact-native-idle-timer.a new file mode 100644 index 0000000..65ef38e Binary files /dev/null and b/Frameworks/react-native-idle-timer.xcframework/ios-arm64/libreact-native-idle-timer.a differ diff --git a/Frameworks/react-native-idle-timer.xcframework/ios-arm64_x86_64-simulator/Headers/IdleTimerManager.h b/Frameworks/react-native-idle-timer.xcframework/ios-arm64_x86_64-simulator/Headers/IdleTimerManager.h new file mode 100644 index 0000000..54a32b9 --- /dev/null +++ b/Frameworks/react-native-idle-timer.xcframework/ios-arm64_x86_64-simulator/Headers/IdleTimerManager.h @@ -0,0 +1,10 @@ +#import +#if __has_include("RCTBridgeModule.h") +#import "RCTBridgeModule.h" +#else +#import +#endif + +@interface IdleTimerManager : NSObject + +@end diff --git a/Frameworks/react-native-idle-timer.xcframework/ios-arm64_x86_64-simulator/libreact-native-idle-timer.a b/Frameworks/react-native-idle-timer.xcframework/ios-arm64_x86_64-simulator/libreact-native-idle-timer.a new file mode 100644 index 0000000..007fcc4 Binary files /dev/null and b/Frameworks/react-native-idle-timer.xcframework/ios-arm64_x86_64-simulator/libreact-native-idle-timer.a differ diff --git a/Frameworks/react-native-image-editor.xcframework/Info.plist b/Frameworks/react-native-image-editor.xcframework/Info.plist new file mode 100644 index 0000000..eac83c6 --- /dev/null +++ b/Frameworks/react-native-image-editor.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-image-editor.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-image-editor.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-image-editor.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-image-editor.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCFileSystem.h b/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCFileSystem.h new file mode 100644 index 0000000..ab5a50e --- /dev/null +++ b/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCFileSystem.h @@ -0,0 +1,22 @@ +// +// RNFileSystem.h +// RNCImageEditor +// +// Created by Dawid Urbaniak on 30/05/2019. +// Copyright © 2019 Facebook. All rights reserved. +// + +#ifndef RNCFileSystem_h +#define RNCFileSystem_h + +#import + +@interface RNCFileSystem : NSObject + ++ (BOOL)ensureDirExistsWithPath:(NSString *)path; ++ (NSString *)generatePathInDirectory:(NSString *)directory withExtension:(NSString *)extension; ++ (NSString *)cacheDirectoryPath; + +@end + +#endif /* RNCFileSystem_h */ diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCImageEditor.h b/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCImageEditor.h new file mode 100644 index 0000000..2fb37e8 --- /dev/null +++ b/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCImageEditor.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCImageEditor : NSObject + +@end diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCImageUtils.h b/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCImageUtils.h new file mode 100644 index 0000000..e771084 --- /dev/null +++ b/Frameworks/react-native-image-editor.xcframework/ios-arm64/Headers/RNCImageUtils.h @@ -0,0 +1,21 @@ +// +// RNCImageUtils.h +// RNCImageEditor +// +// Created by Dawid Urbaniak on 30/05/2019. +// Copyright © 2019 Facebook. All rights reserved. +// + +#ifndef RNCImageUtils_h +#define RNCImageUtils_h + +#import + +@interface RNCImageUtils : NSObject + ++ (NSString *)writeImage:(NSData *)image toPath:(NSString *)path error:(NSError **)error; + +@end + + +#endif /* RNCImageUtils_h */ diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64/libreact-native-image-editor.a b/Frameworks/react-native-image-editor.xcframework/ios-arm64/libreact-native-image-editor.a new file mode 100644 index 0000000..a7c1c25 Binary files /dev/null and b/Frameworks/react-native-image-editor.xcframework/ios-arm64/libreact-native-image-editor.a differ diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCFileSystem.h b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCFileSystem.h new file mode 100644 index 0000000..ab5a50e --- /dev/null +++ b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCFileSystem.h @@ -0,0 +1,22 @@ +// +// RNFileSystem.h +// RNCImageEditor +// +// Created by Dawid Urbaniak on 30/05/2019. +// Copyright © 2019 Facebook. All rights reserved. +// + +#ifndef RNCFileSystem_h +#define RNCFileSystem_h + +#import + +@interface RNCFileSystem : NSObject + ++ (BOOL)ensureDirExistsWithPath:(NSString *)path; ++ (NSString *)generatePathInDirectory:(NSString *)directory withExtension:(NSString *)extension; ++ (NSString *)cacheDirectoryPath; + +@end + +#endif /* RNCFileSystem_h */ diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCImageEditor.h b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCImageEditor.h new file mode 100644 index 0000000..2fb37e8 --- /dev/null +++ b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCImageEditor.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCImageEditor : NSObject + +@end diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCImageUtils.h b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCImageUtils.h new file mode 100644 index 0000000..e771084 --- /dev/null +++ b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/Headers/RNCImageUtils.h @@ -0,0 +1,21 @@ +// +// RNCImageUtils.h +// RNCImageEditor +// +// Created by Dawid Urbaniak on 30/05/2019. +// Copyright © 2019 Facebook. All rights reserved. +// + +#ifndef RNCImageUtils_h +#define RNCImageUtils_h + +#import + +@interface RNCImageUtils : NSObject + ++ (NSString *)writeImage:(NSData *)image toPath:(NSString *)path error:(NSError **)error; + +@end + + +#endif /* RNCImageUtils_h */ diff --git a/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/libreact-native-image-editor.a b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/libreact-native-image-editor.a new file mode 100644 index 0000000..8f7d8b7 Binary files /dev/null and b/Frameworks/react-native-image-editor.xcframework/ios-arm64_x86_64-simulator/libreact-native-image-editor.a differ diff --git a/Frameworks/react-native-image-marker.xcframework/Info.plist b/Frameworks/react-native-image-marker.xcframework/Info.plist new file mode 100644 index 0000000..2afefa1 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-image-marker.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-image-marker.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-image-marker.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-image-marker.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/MarkImageOptions.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/MarkImageOptions.h new file mode 100644 index 0000000..2ed8511 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/MarkImageOptions.h @@ -0,0 +1,20 @@ +// +// Options+ImageMarkOptions.h +// react-native-image-marker +// +// Created by Jimmydaddy on 2023/6/22. +// + +#import "Options.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MarkImageOptions: Options + +@property (nonatomic, copy) NSDictionary * markerSrc; +@property (nonatomic, copy) NSString * markerImageUri; +@property (nonatomic, assign) CGFloat markerScale; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/MarkTextOptions.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/MarkTextOptions.h new file mode 100644 index 0000000..b1d8f2e --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/MarkTextOptions.h @@ -0,0 +1,17 @@ +// +// Options+TextMarkOptions.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import "Options.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MarkTextOptions: Options +@property (nonatomic, copy) NSString * text; +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/Options.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/Options.h new file mode 100644 index 0000000..3d62d19 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/Options.h @@ -0,0 +1,39 @@ +// +// NSObject+Options.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import +#import +#import "TextBackground.h" +#import "RCTConvert+ImageMarker.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface Options: NSObject + +@property (nonatomic, copy) NSDictionary * src; +@property (nonatomic, copy) UIColor * color; +@property (nonatomic, copy) NSString * uri; +@property (nonatomic, copy) UIFont * font; +@property (nonatomic, copy) NSShadow * shadow; +@property (nonatomic, copy) TextBackground* textBackground; +@property (nonatomic, assign) CGFloat scale; +@property (nonatomic, assign) NSInteger quality; +@property (nonatomic, copy) NSString * filename; +@property (nonatomic, assign) NSInteger maxSize; +@property (nonatomic, assign) CGFloat X; +@property (nonatomic, assign) CGFloat Y; +@property (nonatomic, copy) NSString * saveFormat; +@property (nonatomic, assign) MarkerPosition position; + +-(id)initWithDicOpts: (NSDictionary *) opts; + ++(id)checkParams: (NSDictionary *) opts rejecter:(RCTPromiseRejectBlock)reject; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/RCTConvert+ImageMarker.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/RCTConvert+ImageMarker.h new file mode 100644 index 0000000..7015dd6 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/RCTConvert+ImageMarker.h @@ -0,0 +1,31 @@ +// +// RCTConvert+ImageMarker.h +// RCTImageMarker +// +// Created by Jimmy on 16/7/19. +// Copyright © 2016年 Jimmy. All rights reserved. +// + +#ifndef RCTConvert_ImageMarker_h +#define RCTConvert_ImageMarker_h +#import + +typedef enum{ + TopLeft = 0, + TopCenter = 1, + TopRight = 2, + BottomLeft = 3, + BottomCenter = 4, + BottomRight = 5, + Center = 6 +} MarkerPosition; + +@interface RCTConvert(ImageMarker) ++ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset; ++ (CGRect)CGRect:(id)json offset:(NSUInteger)offset; ++ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset; ++ (CGSize)CGSize:(id)json offset:(NSUInteger)offset; ++ (MarkerPosition)MarkerPosition: (id)value; +@end + +#endif /* RCTConvert_ImageMarker_h */ diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/RCTImageMarker.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/RCTImageMarker.h new file mode 100644 index 0000000..1dc1a00 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/RCTImageMarker.h @@ -0,0 +1,15 @@ +// +// RCTImageMarker.h +// RCTImageMarker +// +// Created by Jimmy on 16/7/18. +// Copyright © 2016年 Jimmy. All rights reserved. +// + +#import +#import +#import + +@interface ImageMarker : NSObject + +@end diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/TextBackground.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/TextBackground.h new file mode 100644 index 0000000..579b798 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/TextBackground.h @@ -0,0 +1,24 @@ +// +// NSObject+TextBackground.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TextBackground : NSObject +@property (nonatomic, copy) UIColor * colorBg; +@property (nonatomic, copy) NSString * typeBg; +@property (nonatomic, assign) float paddingX; +@property (nonatomic, assign) float paddingY; + +-(id)initWithTextBackgroundStyle:(NSDictionary *) textBackground; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/Utils.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/Utils.h new file mode 100644 index 0000000..003e58d --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64/Headers/Utils.h @@ -0,0 +1,26 @@ +// +// NSObject+Utils.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface Utils: NSObject + ++ (UIColor *)getColor:(NSString *)hexColor; ++ (int)stringToInt:(NSString *)string; ++(NSShadow*)getShadowStyle:(NSDictionary *) shadowStyle; ++ (bool)isPng: (NSString *)saveFormat; ++ (NSString*) getExt: (NSString*) saveFormat; ++ (bool)isNULL: (NSDictionary*) obj; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64/libreact-native-image-marker.a b/Frameworks/react-native-image-marker.xcframework/ios-arm64/libreact-native-image-marker.a new file mode 100644 index 0000000..56d2955 Binary files /dev/null and b/Frameworks/react-native-image-marker.xcframework/ios-arm64/libreact-native-image-marker.a differ diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/MarkImageOptions.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/MarkImageOptions.h new file mode 100644 index 0000000..2ed8511 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/MarkImageOptions.h @@ -0,0 +1,20 @@ +// +// Options+ImageMarkOptions.h +// react-native-image-marker +// +// Created by Jimmydaddy on 2023/6/22. +// + +#import "Options.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MarkImageOptions: Options + +@property (nonatomic, copy) NSDictionary * markerSrc; +@property (nonatomic, copy) NSString * markerImageUri; +@property (nonatomic, assign) CGFloat markerScale; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/MarkTextOptions.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/MarkTextOptions.h new file mode 100644 index 0000000..b1d8f2e --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/MarkTextOptions.h @@ -0,0 +1,17 @@ +// +// Options+TextMarkOptions.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import "Options.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface MarkTextOptions: Options +@property (nonatomic, copy) NSString * text; +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/Options.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/Options.h new file mode 100644 index 0000000..3d62d19 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/Options.h @@ -0,0 +1,39 @@ +// +// NSObject+Options.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import +#import +#import "TextBackground.h" +#import "RCTConvert+ImageMarker.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface Options: NSObject + +@property (nonatomic, copy) NSDictionary * src; +@property (nonatomic, copy) UIColor * color; +@property (nonatomic, copy) NSString * uri; +@property (nonatomic, copy) UIFont * font; +@property (nonatomic, copy) NSShadow * shadow; +@property (nonatomic, copy) TextBackground* textBackground; +@property (nonatomic, assign) CGFloat scale; +@property (nonatomic, assign) NSInteger quality; +@property (nonatomic, copy) NSString * filename; +@property (nonatomic, assign) NSInteger maxSize; +@property (nonatomic, assign) CGFloat X; +@property (nonatomic, assign) CGFloat Y; +@property (nonatomic, copy) NSString * saveFormat; +@property (nonatomic, assign) MarkerPosition position; + +-(id)initWithDicOpts: (NSDictionary *) opts; + ++(id)checkParams: (NSDictionary *) opts rejecter:(RCTPromiseRejectBlock)reject; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+ImageMarker.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+ImageMarker.h new file mode 100644 index 0000000..7015dd6 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+ImageMarker.h @@ -0,0 +1,31 @@ +// +// RCTConvert+ImageMarker.h +// RCTImageMarker +// +// Created by Jimmy on 16/7/19. +// Copyright © 2016年 Jimmy. All rights reserved. +// + +#ifndef RCTConvert_ImageMarker_h +#define RCTConvert_ImageMarker_h +#import + +typedef enum{ + TopLeft = 0, + TopCenter = 1, + TopRight = 2, + BottomLeft = 3, + BottomCenter = 4, + BottomRight = 5, + Center = 6 +} MarkerPosition; + +@interface RCTConvert(ImageMarker) ++ (CGPoint)CGPoint:(id)json offset:(NSUInteger)offset; ++ (CGRect)CGRect:(id)json offset:(NSUInteger)offset; ++ (CGColorRef)CGColor:(id)json offset:(NSUInteger)offset; ++ (CGSize)CGSize:(id)json offset:(NSUInteger)offset; ++ (MarkerPosition)MarkerPosition: (id)value; +@end + +#endif /* RCTConvert_ImageMarker_h */ diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/RCTImageMarker.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/RCTImageMarker.h new file mode 100644 index 0000000..1dc1a00 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/RCTImageMarker.h @@ -0,0 +1,15 @@ +// +// RCTImageMarker.h +// RCTImageMarker +// +// Created by Jimmy on 16/7/18. +// Copyright © 2016年 Jimmy. All rights reserved. +// + +#import +#import +#import + +@interface ImageMarker : NSObject + +@end diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/TextBackground.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/TextBackground.h new file mode 100644 index 0000000..579b798 --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/TextBackground.h @@ -0,0 +1,24 @@ +// +// NSObject+TextBackground.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface TextBackground : NSObject +@property (nonatomic, copy) UIColor * colorBg; +@property (nonatomic, copy) NSString * typeBg; +@property (nonatomic, assign) float paddingX; +@property (nonatomic, assign) float paddingY; + +-(id)initWithTextBackgroundStyle:(NSDictionary *) textBackground; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/Utils.h b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/Utils.h new file mode 100644 index 0000000..003e58d --- /dev/null +++ b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/Headers/Utils.h @@ -0,0 +1,26 @@ +// +// NSObject+Utils.h +// RCTImageMarker +// +// Created by Jimmydaddy on 2023/6/22. +// Copyright © 2023 Jimmy. All rights reserved. +// + +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface Utils: NSObject + ++ (UIColor *)getColor:(NSString *)hexColor; ++ (int)stringToInt:(NSString *)string; ++(NSShadow*)getShadowStyle:(NSDictionary *) shadowStyle; ++ (bool)isPng: (NSString *)saveFormat; ++ (NSString*) getExt: (NSString*) saveFormat; ++ (bool)isNULL: (NSDictionary*) obj; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/libreact-native-image-marker.a b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/libreact-native-image-marker.a new file mode 100644 index 0000000..b24b7a4 Binary files /dev/null and b/Frameworks/react-native-image-marker.xcframework/ios-arm64_x86_64-simulator/libreact-native-image-marker.a differ diff --git a/Frameworks/react-native-mail.xcframework/Info.plist b/Frameworks/react-native-mail.xcframework/Info.plist new file mode 100644 index 0000000..c81bdf4 --- /dev/null +++ b/Frameworks/react-native-mail.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-mail.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-mail.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-mail.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-mail.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-mail.xcframework/ios-arm64/Headers/RNMail.h b/Frameworks/react-native-mail.xcframework/ios-arm64/Headers/RNMail.h new file mode 100644 index 0000000..81bd83e --- /dev/null +++ b/Frameworks/react-native-mail.xcframework/ios-arm64/Headers/RNMail.h @@ -0,0 +1,6 @@ +#import +#import + +@interface RNMail : NSObject + +@end diff --git a/Frameworks/react-native-mail.xcframework/ios-arm64/libreact-native-mail.a b/Frameworks/react-native-mail.xcframework/ios-arm64/libreact-native-mail.a new file mode 100644 index 0000000..a665ac4 Binary files /dev/null and b/Frameworks/react-native-mail.xcframework/ios-arm64/libreact-native-mail.a differ diff --git a/Frameworks/react-native-mail.xcframework/ios-arm64_x86_64-simulator/Headers/RNMail.h b/Frameworks/react-native-mail.xcframework/ios-arm64_x86_64-simulator/Headers/RNMail.h new file mode 100644 index 0000000..81bd83e --- /dev/null +++ b/Frameworks/react-native-mail.xcframework/ios-arm64_x86_64-simulator/Headers/RNMail.h @@ -0,0 +1,6 @@ +#import +#import + +@interface RNMail : NSObject + +@end diff --git a/Frameworks/react-native-mail.xcframework/ios-arm64_x86_64-simulator/libreact-native-mail.a b/Frameworks/react-native-mail.xcframework/ios-arm64_x86_64-simulator/libreact-native-mail.a new file mode 100644 index 0000000..9dd933f Binary files /dev/null and b/Frameworks/react-native-mail.xcframework/ios-arm64_x86_64-simulator/libreact-native-mail.a differ diff --git a/Frameworks/react-native-netinfo.xcframework/Info.plist b/Frameworks/react-native-netinfo.xcframework/Info.plist new file mode 100644 index 0000000..0019296 --- /dev/null +++ b/Frameworks/react-native-netinfo.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-netinfo.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-netinfo.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-netinfo.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-netinfo.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCConnectionState.h b/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCConnectionState.h new file mode 100644 index 0000000..99d811d --- /dev/null +++ b/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCConnectionState.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +// Based on the ConnectionType enum described in the W3C Network Information API spec +// (https://wicg.github.io/netinfo/). +static NSString *const RNCConnectionTypeUnknown = @"unknown"; +static NSString *const RNCConnectionTypeNone = @"none"; +static NSString *const RNCConnectionTypeWifi = @"wifi"; +static NSString *const RNCConnectionTypeCellular = @"cellular"; +static NSString *const RNCConnectionTypeEthernet = @"ethernet"; + +// Based on the EffectiveConnectionType enum described in the W3C Network Information API spec +// (https://wicg.github.io/netinfo/). +static NSString *const RNCCellularGeneration2g = @"2g"; +static NSString *const RNCCellularGeneration3g = @"3g"; +static NSString *const RNCCellularGeneration4g = @"4g"; + +@interface RNCConnectionState : NSObject + +- (instancetype)init; +- (instancetype)initWithReachabilityFlags:(SCNetworkReachabilityFlags)flags; +- (BOOL)isEqualToConnectionState:(RNCConnectionState *)otherState; + +@property (nonatomic, strong, readonly) NSString *type; +@property (nullable, nonatomic, strong, readonly) NSString *cellularGeneration; +@property (nonatomic, readonly) BOOL connected; +@property (nonatomic, readonly) BOOL expensive; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCConnectionStateWatcher.h b/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCConnectionStateWatcher.h new file mode 100644 index 0000000..01dedaa --- /dev/null +++ b/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCConnectionStateWatcher.h @@ -0,0 +1,29 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNCConnectionState.h" + +NS_ASSUME_NONNULL_BEGIN + +@class RNCConnectionStateWatcher; + + +@protocol RNCConnectionStateWatcherDelegate + +- (void)connectionStateWatcher:(RNCConnectionStateWatcher *)connectionStateWatcher didUpdateState:(RNCConnectionState *)state; + +@end + +@interface RNCConnectionStateWatcher : NSObject + +- (instancetype)initWithDelegate:(id)delegate; +- (RNCConnectionState *)currentState; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCNetInfo.h b/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCNetInfo.h new file mode 100644 index 0000000..1960893 --- /dev/null +++ b/Frameworks/react-native-netinfo.xcframework/ios-arm64/Headers/RNCNetInfo.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCNetInfo : RCTEventEmitter + +@end diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64/libreact-native-netinfo.a b/Frameworks/react-native-netinfo.xcframework/ios-arm64/libreact-native-netinfo.a new file mode 100644 index 0000000..2bb057f Binary files /dev/null and b/Frameworks/react-native-netinfo.xcframework/ios-arm64/libreact-native-netinfo.a differ diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCConnectionState.h b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCConnectionState.h new file mode 100644 index 0000000..99d811d --- /dev/null +++ b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCConnectionState.h @@ -0,0 +1,40 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +// Based on the ConnectionType enum described in the W3C Network Information API spec +// (https://wicg.github.io/netinfo/). +static NSString *const RNCConnectionTypeUnknown = @"unknown"; +static NSString *const RNCConnectionTypeNone = @"none"; +static NSString *const RNCConnectionTypeWifi = @"wifi"; +static NSString *const RNCConnectionTypeCellular = @"cellular"; +static NSString *const RNCConnectionTypeEthernet = @"ethernet"; + +// Based on the EffectiveConnectionType enum described in the W3C Network Information API spec +// (https://wicg.github.io/netinfo/). +static NSString *const RNCCellularGeneration2g = @"2g"; +static NSString *const RNCCellularGeneration3g = @"3g"; +static NSString *const RNCCellularGeneration4g = @"4g"; + +@interface RNCConnectionState : NSObject + +- (instancetype)init; +- (instancetype)initWithReachabilityFlags:(SCNetworkReachabilityFlags)flags; +- (BOOL)isEqualToConnectionState:(RNCConnectionState *)otherState; + +@property (nonatomic, strong, readonly) NSString *type; +@property (nullable, nonatomic, strong, readonly) NSString *cellularGeneration; +@property (nonatomic, readonly) BOOL connected; +@property (nonatomic, readonly) BOOL expensive; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCConnectionStateWatcher.h b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCConnectionStateWatcher.h new file mode 100644 index 0000000..01dedaa --- /dev/null +++ b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCConnectionStateWatcher.h @@ -0,0 +1,29 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import "RNCConnectionState.h" + +NS_ASSUME_NONNULL_BEGIN + +@class RNCConnectionStateWatcher; + + +@protocol RNCConnectionStateWatcherDelegate + +- (void)connectionStateWatcher:(RNCConnectionStateWatcher *)connectionStateWatcher didUpdateState:(RNCConnectionState *)state; + +@end + +@interface RNCConnectionStateWatcher : NSObject + +- (instancetype)initWithDelegate:(id)delegate; +- (RNCConnectionState *)currentState; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCNetInfo.h b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCNetInfo.h new file mode 100644 index 0000000..1960893 --- /dev/null +++ b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/Headers/RNCNetInfo.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCNetInfo : RCTEventEmitter + +@end diff --git a/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/libreact-native-netinfo.a b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/libreact-native-netinfo.a new file mode 100644 index 0000000..1c03006 Binary files /dev/null and b/Frameworks/react-native-netinfo.xcframework/ios-arm64_x86_64-simulator/libreact-native-netinfo.a differ diff --git a/Frameworks/react-native-pager-view.xcframework/Info.plist b/Frameworks/react-native-pager-view.xcframework/Info.plist new file mode 100644 index 0000000..fbf40e0 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-pager-view.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-pager-view.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-pager-view.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-pager-view.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTConvert+UIPageViewControllerNavigationOrientation.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTConvert+UIPageViewControllerNavigationOrientation.h new file mode 100644 index 0000000..35d1cae --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTConvert+UIPageViewControllerNavigationOrientation.h @@ -0,0 +1,11 @@ + +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface RCTConvert (UIPageViewControllerNavigationOrientation) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageScrollEvent.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageScrollEvent.h new file mode 100644 index 0000000..b0d7d95 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageScrollEvent.h @@ -0,0 +1,14 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTOnPageScrollEvent : NSObject + +- (instancetype) initWithReactTag:(NSNumber *)reactTag + position:(NSNumber *)position + offset:(NSNumber *)offset; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageScrollStateChanged.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageScrollStateChanged.h new file mode 100644 index 0000000..55135ac --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageScrollStateChanged.h @@ -0,0 +1,14 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTOnPageScrollStateChanged : NSObject + +- (instancetype) initWithReactTag:(NSNumber *)reactTag + state:(NSString *)state + coalescingKey:(uint16_t)coalescingKey; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageSelected.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageSelected.h new file mode 100644 index 0000000..dd88dd9 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RCTOnPageSelected.h @@ -0,0 +1,14 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTOnPageSelected : NSObject + +- (instancetype) initWithReactTag:(NSNumber *)reactTag + position:(NSNumber *)position + coalescingKey:(uint16_t)coalescingKey; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RNCPagerViewComponentView.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RNCPagerViewComponentView.h new file mode 100644 index 0000000..de276e0 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/RNCPagerViewComponentView.h @@ -0,0 +1,27 @@ +#ifdef RCT_NEW_ARCH_ENABLED + +#import +#import +#import +#import "UIViewController+CreateExtension.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCPagerViewComponentView : RCTViewComponentView + +@property(strong, nonatomic, readonly) UIPageViewController *nativePageViewController; +@property(nonatomic, strong) NSMutableArray *nativeChildrenViewControllers; +@property(nonatomic) NSInteger initialPage; +@property(nonatomic) NSInteger currentIndex; +@property(nonatomic) NSInteger destinationIndex; +@property(nonatomic) NSString* layoutDirection; +@property(nonatomic) BOOL overdrag; + +- (void)setPage:(NSInteger)number; +- (void)setPageWithoutAnimation:(NSInteger)number; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/ReactNativePageView.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/ReactNativePageView.h new file mode 100644 index 0000000..8887fd2 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/ReactNativePageView.h @@ -0,0 +1,33 @@ +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ReactNativePageView: UIView + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@property(nonatomic) NSInteger initialPage; +@property(nonatomic) NSInteger lastReportedIndex; +@property(nonatomic) NSInteger destinationIndex; +@property(nonatomic) NSInteger currentIndex; +@property(nonatomic) NSInteger pageMargin; +@property(nonatomic, readonly) BOOL scrollEnabled; +@property(nonatomic, readonly) UIScrollViewKeyboardDismissMode dismissKeyboard; +@property(nonatomic) UIPageViewControllerNavigationOrientation orientation; +@property(nonatomic, copy) RCTDirectEventBlock onPageSelected; +@property(nonatomic, copy) RCTDirectEventBlock onPageScroll; +@property(nonatomic, copy) RCTDirectEventBlock onPageScrollStateChanged; +@property(nonatomic) BOOL overdrag; +@property(nonatomic) NSString* layoutDirection; +@property(nonatomic, assign) BOOL animating; + +- (void)goTo:(NSInteger)index animated:(BOOL)animated; +- (void)shouldScroll:(BOOL)scrollEnabled; +- (void)shouldDismissKeyboard:(NSString *)dismissKeyboard; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/ReactViewPagerManager.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/ReactViewPagerManager.h new file mode 100644 index 0000000..cc5de3e --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/ReactViewPagerManager.h @@ -0,0 +1,13 @@ + +#import +#import +#import +#import +#import "ReactNativePageView.h" +NS_ASSUME_NONNULL_BEGIN + +@interface ReactViewPagerManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/UIViewController+CreateExtension.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/UIViewController+CreateExtension.h new file mode 100644 index 0000000..009e951 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64/Headers/UIViewController+CreateExtension.h @@ -0,0 +1,11 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIViewController (CreateExtension) + +- (instancetype)initWithView:(UIView *)view; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64/libreact-native-pager-view.a b/Frameworks/react-native-pager-view.xcframework/ios-arm64/libreact-native-pager-view.a new file mode 100644 index 0000000..6656aa8 Binary files /dev/null and b/Frameworks/react-native-pager-view.xcframework/ios-arm64/libreact-native-pager-view.a differ diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+UIPageViewControllerNavigationOrientation.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+UIPageViewControllerNavigationOrientation.h new file mode 100644 index 0000000..35d1cae --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTConvert+UIPageViewControllerNavigationOrientation.h @@ -0,0 +1,11 @@ + +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface RCTConvert (UIPageViewControllerNavigationOrientation) + +@end + + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageScrollEvent.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageScrollEvent.h new file mode 100644 index 0000000..b0d7d95 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageScrollEvent.h @@ -0,0 +1,14 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTOnPageScrollEvent : NSObject + +- (instancetype) initWithReactTag:(NSNumber *)reactTag + position:(NSNumber *)position + offset:(NSNumber *)offset; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageScrollStateChanged.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageScrollStateChanged.h new file mode 100644 index 0000000..55135ac --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageScrollStateChanged.h @@ -0,0 +1,14 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTOnPageScrollStateChanged : NSObject + +- (instancetype) initWithReactTag:(NSNumber *)reactTag + state:(NSString *)state + coalescingKey:(uint16_t)coalescingKey; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageSelected.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageSelected.h new file mode 100644 index 0000000..dd88dd9 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RCTOnPageSelected.h @@ -0,0 +1,14 @@ +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RCTOnPageSelected : NSObject + +- (instancetype) initWithReactTag:(NSNumber *)reactTag + position:(NSNumber *)position + coalescingKey:(uint16_t)coalescingKey; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RNCPagerViewComponentView.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RNCPagerViewComponentView.h new file mode 100644 index 0000000..de276e0 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/RNCPagerViewComponentView.h @@ -0,0 +1,27 @@ +#ifdef RCT_NEW_ARCH_ENABLED + +#import +#import +#import +#import "UIViewController+CreateExtension.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCPagerViewComponentView : RCTViewComponentView + +@property(strong, nonatomic, readonly) UIPageViewController *nativePageViewController; +@property(nonatomic, strong) NSMutableArray *nativeChildrenViewControllers; +@property(nonatomic) NSInteger initialPage; +@property(nonatomic) NSInteger currentIndex; +@property(nonatomic) NSInteger destinationIndex; +@property(nonatomic) NSString* layoutDirection; +@property(nonatomic) BOOL overdrag; + +- (void)setPage:(NSInteger)number; +- (void)setPageWithoutAnimation:(NSInteger)number; + +@end + +NS_ASSUME_NONNULL_END + +#endif diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/ReactNativePageView.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/ReactNativePageView.h new file mode 100644 index 0000000..8887fd2 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/ReactNativePageView.h @@ -0,0 +1,33 @@ +#import +#import +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface ReactNativePageView: UIView + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher; + +@property(nonatomic) NSInteger initialPage; +@property(nonatomic) NSInteger lastReportedIndex; +@property(nonatomic) NSInteger destinationIndex; +@property(nonatomic) NSInteger currentIndex; +@property(nonatomic) NSInteger pageMargin; +@property(nonatomic, readonly) BOOL scrollEnabled; +@property(nonatomic, readonly) UIScrollViewKeyboardDismissMode dismissKeyboard; +@property(nonatomic) UIPageViewControllerNavigationOrientation orientation; +@property(nonatomic, copy) RCTDirectEventBlock onPageSelected; +@property(nonatomic, copy) RCTDirectEventBlock onPageScroll; +@property(nonatomic, copy) RCTDirectEventBlock onPageScrollStateChanged; +@property(nonatomic) BOOL overdrag; +@property(nonatomic) NSString* layoutDirection; +@property(nonatomic, assign) BOOL animating; + +- (void)goTo:(NSInteger)index animated:(BOOL)animated; +- (void)shouldScroll:(BOOL)scrollEnabled; +- (void)shouldDismissKeyboard:(NSString *)dismissKeyboard; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/ReactViewPagerManager.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/ReactViewPagerManager.h new file mode 100644 index 0000000..cc5de3e --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/ReactViewPagerManager.h @@ -0,0 +1,13 @@ + +#import +#import +#import +#import +#import "ReactNativePageView.h" +NS_ASSUME_NONNULL_BEGIN + +@interface ReactViewPagerManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/UIViewController+CreateExtension.h b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/UIViewController+CreateExtension.h new file mode 100644 index 0000000..009e951 --- /dev/null +++ b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/Headers/UIViewController+CreateExtension.h @@ -0,0 +1,11 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface UIViewController (CreateExtension) + +- (instancetype)initWithView:(UIView *)view; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/libreact-native-pager-view.a b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/libreact-native-pager-view.a new file mode 100644 index 0000000..07166f9 Binary files /dev/null and b/Frameworks/react-native-pager-view.xcframework/ios-arm64_x86_64-simulator/libreact-native-pager-view.a differ diff --git a/Frameworks/react-native-pdf.xcframework/Info.plist b/Frameworks/react-native-pdf.xcframework/Info.plist new file mode 100644 index 0000000..e2e759d --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-pdf.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-pdf.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-pdf.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-pdf.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/FastRCTiledLayer.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/FastRCTiledLayer.h new file mode 100644 index 0000000..b6e6b05 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/FastRCTiledLayer.h @@ -0,0 +1,13 @@ +// +// FastCATiledLayer.h +// NewsMemory +// +// Created by TecnaviaAppsIOSdev on 10/02/14. +// +// + +#import + +@interface FastRCTiledLayer : CATiledLayer + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/PdfManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/PdfManager.h new file mode 100644 index 0000000..cb1f297 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/PdfManager.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + + +@interface PdfManager : NSObject + ++ (CGPDFDocumentRef) getPdf:(NSUInteger) index; + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/PdfUtility.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/PdfUtility.h new file mode 100644 index 0000000..9dc2d58 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/PdfUtility.h @@ -0,0 +1,21 @@ +// +// PdfUtility.h +// RCTPdf +// +// Created by iPad Developer on 19.09.19. +// Copyright © 2019 wonday.org. All rights reserved. +// + +#ifndef PdfUtility_h +#define PdfUtility_h + +#import +#import + +@interface PdfUtility : NSObject { + NSOperationQueue *pngQueue; +} + +@end + +#endif /* PdfUtility_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTGraphBoxView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTGraphBoxView.h new file mode 100644 index 0000000..df3ba88 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTGraphBoxView.h @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifndef RCTGraphBoxView_h +#define RCTGraphBoxView_h + +#if __has_include() +#import +#import +#else +#import "RCTEventDispatcher.h" +#import "UIView+React.h" +#endif + +@class RCTEventDispatcher; + +@interface RCTGraphBoxView : UIImageView + +@property(nonatomic, strong) NSDictionary *coordinates; +@property(nonatomic, strong) NSString *path; +@property(nonatomic) int pageId; +@property(nonatomic) int artId; + +@property(nonatomic, copy) RCTBubblingEventBlock onBoxDrawn; + +@end + +#endif /* RCTGraphBoxView_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTGraphBoxViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTGraphBoxViewManager.h new file mode 100644 index 0000000..bd7c89a --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTGraphBoxViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTGraphBoxViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfBoxView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfBoxView.h new file mode 100644 index 0000000..3da29db --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfBoxView.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifndef RCTPdfBoxView_h +#define RCTPdfBoxView_h + +#if __has_include() +#import +#import +#else +#import "RCTEventDispatcher.h" +#import "UIView+React.h" +#endif + + +@class RCTEventDispatcher; + +@interface RCTPdfBoxView : UIImageView + +@property(nonatomic, strong) NSDictionary *coordinates; +@property(nonatomic, strong) NSDictionary *offset; +@property(nonatomic, strong) NSString *path; +@property(nonatomic) int pageId; +@property(nonatomic) int artId; +@property(nonatomic, strong) NSDictionary *pageSize; +@property(nonatomic) float scale; +@property(nonatomic) BOOL visible; + +@property(nonatomic, copy) RCTBubblingEventBlock onPdfError; +@property(nonatomic, copy) RCTBubblingEventBlock onBoxDrawn; +- (CGRect) getCoordinatesRect; +- (UIImage *) cropImageAtScale:(float)scale; + +@end + +#endif /* RCTPdfView_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfBoxViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfBoxViewManager.h new file mode 100644 index 0000000..7264168 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfBoxViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTPdfBoxViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfPageView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfPageView.h new file mode 100644 index 0000000..09ff05b --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfPageView.h @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "UIView+React.h" +#endif + + +@interface RCTPdfPageView : UIView + +@property(nonatomic) int fileNo; +@property(nonatomic) int page; + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfPageViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfPageViewManager.h new file mode 100644 index 0000000..eb27068 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfPageViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTPdfPageViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfView.h new file mode 100644 index 0000000..c41195c --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfView.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifndef RCTPdfView_h +#define RCTPdfView_h + +#if __has_include() +#import +#import +#else +#import "RCTEventDispatcher.h" +#import "UIView+React.h" +#endif + +@class RCTEventDispatcher; + +@interface RCTPdfView : UIView + +@property(nonatomic, strong) NSString *path; +@property(nonatomic) int page; +@property(nonatomic) float scale; +@property(nonatomic) float offsetX; +@property(nonatomic) float offsetY; +@property(nonatomic) float minScale; +@property(nonatomic) float maxScale; +@property(nonatomic) BOOL isDoubleTruck; + +@property(nonatomic, copy) RCTBubblingEventBlock onPdfLoaded; +@property(nonatomic, copy) RCTBubblingEventBlock onPdfError; +@property(nonatomic, copy) RCTBubblingEventBlock onPdfDrawn; + +- (void)checkBoxes:(NSTimer *)timer; + +@end + +#endif /* RCTPdfView_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfViewManager.h new file mode 100644 index 0000000..ba9e034 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64/Headers/RCTPdfViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTPdfViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64/libreact-native-pdf.a b/Frameworks/react-native-pdf.xcframework/ios-arm64/libreact-native-pdf.a new file mode 100644 index 0000000..4d9f60e Binary files /dev/null and b/Frameworks/react-native-pdf.xcframework/ios-arm64/libreact-native-pdf.a differ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/FastRCTiledLayer.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/FastRCTiledLayer.h new file mode 100644 index 0000000..b6e6b05 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/FastRCTiledLayer.h @@ -0,0 +1,13 @@ +// +// FastCATiledLayer.h +// NewsMemory +// +// Created by TecnaviaAppsIOSdev on 10/02/14. +// +// + +#import + +@interface FastRCTiledLayer : CATiledLayer + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/PdfManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/PdfManager.h new file mode 100644 index 0000000..cb1f297 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/PdfManager.h @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + + +@interface PdfManager : NSObject + ++ (CGPDFDocumentRef) getPdf:(NSUInteger) index; + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/PdfUtility.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/PdfUtility.h new file mode 100644 index 0000000..9dc2d58 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/PdfUtility.h @@ -0,0 +1,21 @@ +// +// PdfUtility.h +// RCTPdf +// +// Created by iPad Developer on 19.09.19. +// Copyright © 2019 wonday.org. All rights reserved. +// + +#ifndef PdfUtility_h +#define PdfUtility_h + +#import +#import + +@interface PdfUtility : NSObject { + NSOperationQueue *pngQueue; +} + +@end + +#endif /* PdfUtility_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTGraphBoxView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTGraphBoxView.h new file mode 100644 index 0000000..df3ba88 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTGraphBoxView.h @@ -0,0 +1,33 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifndef RCTGraphBoxView_h +#define RCTGraphBoxView_h + +#if __has_include() +#import +#import +#else +#import "RCTEventDispatcher.h" +#import "UIView+React.h" +#endif + +@class RCTEventDispatcher; + +@interface RCTGraphBoxView : UIImageView + +@property(nonatomic, strong) NSDictionary *coordinates; +@property(nonatomic, strong) NSString *path; +@property(nonatomic) int pageId; +@property(nonatomic) int artId; + +@property(nonatomic, copy) RCTBubblingEventBlock onBoxDrawn; + +@end + +#endif /* RCTGraphBoxView_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTGraphBoxViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTGraphBoxViewManager.h new file mode 100644 index 0000000..bd7c89a --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTGraphBoxViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTGraphBoxViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfBoxView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfBoxView.h new file mode 100644 index 0000000..3da29db --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfBoxView.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifndef RCTPdfBoxView_h +#define RCTPdfBoxView_h + +#if __has_include() +#import +#import +#else +#import "RCTEventDispatcher.h" +#import "UIView+React.h" +#endif + + +@class RCTEventDispatcher; + +@interface RCTPdfBoxView : UIImageView + +@property(nonatomic, strong) NSDictionary *coordinates; +@property(nonatomic, strong) NSDictionary *offset; +@property(nonatomic, strong) NSString *path; +@property(nonatomic) int pageId; +@property(nonatomic) int artId; +@property(nonatomic, strong) NSDictionary *pageSize; +@property(nonatomic) float scale; +@property(nonatomic) BOOL visible; + +@property(nonatomic, copy) RCTBubblingEventBlock onPdfError; +@property(nonatomic, copy) RCTBubblingEventBlock onBoxDrawn; +- (CGRect) getCoordinatesRect; +- (UIImage *) cropImageAtScale:(float)scale; + +@end + +#endif /* RCTPdfView_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfBoxViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfBoxViewManager.h new file mode 100644 index 0000000..7264168 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfBoxViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTPdfBoxViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfPageView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfPageView.h new file mode 100644 index 0000000..09ff05b --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfPageView.h @@ -0,0 +1,21 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "UIView+React.h" +#endif + + +@interface RCTPdfPageView : UIView + +@property(nonatomic) int fileNo; +@property(nonatomic) int page; + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfPageViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfPageViewManager.h new file mode 100644 index 0000000..eb27068 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfPageViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTPdfPageViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfView.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfView.h new file mode 100644 index 0000000..c41195c --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfView.h @@ -0,0 +1,41 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#ifndef RCTPdfView_h +#define RCTPdfView_h + +#if __has_include() +#import +#import +#else +#import "RCTEventDispatcher.h" +#import "UIView+React.h" +#endif + +@class RCTEventDispatcher; + +@interface RCTPdfView : UIView + +@property(nonatomic, strong) NSString *path; +@property(nonatomic) int page; +@property(nonatomic) float scale; +@property(nonatomic) float offsetX; +@property(nonatomic) float offsetY; +@property(nonatomic) float minScale; +@property(nonatomic) float maxScale; +@property(nonatomic) BOOL isDoubleTruck; + +@property(nonatomic, copy) RCTBubblingEventBlock onPdfLoaded; +@property(nonatomic, copy) RCTBubblingEventBlock onPdfError; +@property(nonatomic, copy) RCTBubblingEventBlock onPdfDrawn; + +- (void)checkBoxes:(NSTimer *)timer; + +@end + +#endif /* RCTPdfView_h */ diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfViewManager.h b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfViewManager.h new file mode 100644 index 0000000..ba9e034 --- /dev/null +++ b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/Headers/RCTPdfViewManager.h @@ -0,0 +1,18 @@ +/** + * Copyright (c) 2017-present, Wonday (@wonday.org) + * All rights reserved. + * + * This source code is licensed under the MIT-style license found in the + * LICENSE file in the root directory of this source tree. + */ + +#if __has_include() +#import +#else +#import "RCTViewManager.h" +#endif + + +@interface RCTPdfViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/libreact-native-pdf.a b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/libreact-native-pdf.a new file mode 100644 index 0000000..cba4c76 Binary files /dev/null and b/Frameworks/react-native-pdf.xcframework/ios-arm64_x86_64-simulator/libreact-native-pdf.a differ diff --git a/Frameworks/react-native-photo-view-ex.xcframework/Info.plist b/Frameworks/react-native-photo-view-ex.xcframework/Info.plist new file mode 100644 index 0000000..38f4a95 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-photo-view-ex.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-photo-view-ex.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-photo-view-ex.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-photo-view-ex.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/MWTapDetectingImageView.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/MWTapDetectingImageView.h new file mode 100644 index 0000000..e6d0e73 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/MWTapDetectingImageView.h @@ -0,0 +1,28 @@ +// +// UIImageViewTap.h +// Momento +// +// Created by Michael Waterfall on 04/11/2009. +// Copyright 2009 d3i. All rights reserved. +// + +#import +#import + +@protocol MWTapDetectingImageViewDelegate; + +@interface MWTapDetectingImageView : UIImageView {} + +@property (nonatomic, weak) id tapDelegate; + +@end + +@protocol MWTapDetectingImageViewDelegate + +@optional + +- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch; +- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch; +- (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch; + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/MWTapDetectingView.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/MWTapDetectingView.h new file mode 100644 index 0000000..f727515 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/MWTapDetectingView.h @@ -0,0 +1,28 @@ +// +// UIViewTap.h +// Momento +// +// Created by Michael Waterfall on 04/11/2009. +// Copyright 2009 d3i. All rights reserved. +// + +#import +#import + +@protocol MWTapDetectingViewDelegate; + +@interface MWTapDetectingView : UIView {} + +@property (nonatomic, weak) id tapDelegate; + +@end + +@protocol MWTapDetectingViewDelegate + +@optional + +- (void)view:(UIView *)view singleTapDetected:(UITouch *)touch; +- (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch; +- (void)view:(UIView *)view tripleTapDetected:(UITouch *)touch; + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/RNPhotoView.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/RNPhotoView.h new file mode 100644 index 0000000..1f21146 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/RNPhotoView.h @@ -0,0 +1,32 @@ +#import +#import +#import "MWTapDetectingImageView.h" +#import "MWTapDetectingView.h" + +@class RCTBridge; + +@interface RNPhotoView : UIScrollView + +#pragma mark - Data + +@property (nonatomic, strong) NSDictionary *source; +@property (nonatomic, strong) NSDictionary *src; +@property (nonatomic, strong) NSString *loadingIndicatorSrc; +@property (nonatomic, assign) NSInteger scale; +@property (nonatomic, assign) CGFloat minZoomScale; +@property (nonatomic, assign) CGFloat maxZoomScale; + +#pragma mark - Block + +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerError; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerScale; +@property (nonatomic, copy) RCTBubblingEventBlock onPhotoViewerViewTap; +@property (nonatomic, copy) RCTBubblingEventBlock onPhotoViewerTap; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoadStart; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoad; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoadEnd; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerProgress; + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/RNPhotoViewManager.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/RNPhotoViewManager.h new file mode 100644 index 0000000..756b3e1 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/Headers/RNPhotoViewManager.h @@ -0,0 +1,5 @@ +#import + +@interface RNPhotoViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/libreact-native-photo-view-ex.a b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/libreact-native-photo-view-ex.a new file mode 100644 index 0000000..3f37815 Binary files /dev/null and b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64/libreact-native-photo-view-ex.a differ diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/MWTapDetectingImageView.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/MWTapDetectingImageView.h new file mode 100644 index 0000000..e6d0e73 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/MWTapDetectingImageView.h @@ -0,0 +1,28 @@ +// +// UIImageViewTap.h +// Momento +// +// Created by Michael Waterfall on 04/11/2009. +// Copyright 2009 d3i. All rights reserved. +// + +#import +#import + +@protocol MWTapDetectingImageViewDelegate; + +@interface MWTapDetectingImageView : UIImageView {} + +@property (nonatomic, weak) id tapDelegate; + +@end + +@protocol MWTapDetectingImageViewDelegate + +@optional + +- (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch; +- (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch; +- (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch; + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/MWTapDetectingView.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/MWTapDetectingView.h new file mode 100644 index 0000000..f727515 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/MWTapDetectingView.h @@ -0,0 +1,28 @@ +// +// UIViewTap.h +// Momento +// +// Created by Michael Waterfall on 04/11/2009. +// Copyright 2009 d3i. All rights reserved. +// + +#import +#import + +@protocol MWTapDetectingViewDelegate; + +@interface MWTapDetectingView : UIView {} + +@property (nonatomic, weak) id tapDelegate; + +@end + +@protocol MWTapDetectingViewDelegate + +@optional + +- (void)view:(UIView *)view singleTapDetected:(UITouch *)touch; +- (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch; +- (void)view:(UIView *)view tripleTapDetected:(UITouch *)touch; + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/RNPhotoView.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/RNPhotoView.h new file mode 100644 index 0000000..1f21146 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/RNPhotoView.h @@ -0,0 +1,32 @@ +#import +#import +#import "MWTapDetectingImageView.h" +#import "MWTapDetectingView.h" + +@class RCTBridge; + +@interface RNPhotoView : UIScrollView + +#pragma mark - Data + +@property (nonatomic, strong) NSDictionary *source; +@property (nonatomic, strong) NSDictionary *src; +@property (nonatomic, strong) NSString *loadingIndicatorSrc; +@property (nonatomic, assign) NSInteger scale; +@property (nonatomic, assign) CGFloat minZoomScale; +@property (nonatomic, assign) CGFloat maxZoomScale; + +#pragma mark - Block + +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerError; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerScale; +@property (nonatomic, copy) RCTBubblingEventBlock onPhotoViewerViewTap; +@property (nonatomic, copy) RCTBubblingEventBlock onPhotoViewerTap; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoadStart; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoad; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerLoadEnd; +@property (nonatomic, copy) RCTDirectEventBlock onPhotoViewerProgress; + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/RNPhotoViewManager.h b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/RNPhotoViewManager.h new file mode 100644 index 0000000..756b3e1 --- /dev/null +++ b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/Headers/RNPhotoViewManager.h @@ -0,0 +1,5 @@ +#import + +@interface RNPhotoViewManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/libreact-native-photo-view-ex.a b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/libreact-native-photo-view-ex.a new file mode 100644 index 0000000..fa44195 Binary files /dev/null and b/Frameworks/react-native-photo-view-ex.xcframework/ios-arm64_x86_64-simulator/libreact-native-photo-view-ex.a differ diff --git a/Frameworks/react-native-print.xcframework/Info.plist b/Frameworks/react-native-print.xcframework/Info.plist new file mode 100644 index 0000000..4e4d15c --- /dev/null +++ b/Frameworks/react-native-print.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-print.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-print.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-print.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-print.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-print.xcframework/ios-arm64/Headers/RNPrint.h b/Frameworks/react-native-print.xcframework/ios-arm64/Headers/RNPrint.h new file mode 100644 index 0000000..3e7a09c --- /dev/null +++ b/Frameworks/react-native-print.xcframework/ios-arm64/Headers/RNPrint.h @@ -0,0 +1,14 @@ + +// Created by Christopher on 9/4/15. + +#import +#import +#import + +@interface RNPrint : RCTView +@property UIPrinter *pickedPrinter; +@property NSString *filePath; +@property NSString *htmlString; +@property NSURL *printerURL; +@property (nonatomic, assign) BOOL isLandscape; +@end diff --git a/Frameworks/react-native-print.xcframework/ios-arm64/libreact-native-print.a b/Frameworks/react-native-print.xcframework/ios-arm64/libreact-native-print.a new file mode 100644 index 0000000..77d091f Binary files /dev/null and b/Frameworks/react-native-print.xcframework/ios-arm64/libreact-native-print.a differ diff --git a/Frameworks/react-native-print.xcframework/ios-arm64_x86_64-simulator/Headers/RNPrint.h b/Frameworks/react-native-print.xcframework/ios-arm64_x86_64-simulator/Headers/RNPrint.h new file mode 100644 index 0000000..3e7a09c --- /dev/null +++ b/Frameworks/react-native-print.xcframework/ios-arm64_x86_64-simulator/Headers/RNPrint.h @@ -0,0 +1,14 @@ + +// Created by Christopher on 9/4/15. + +#import +#import +#import + +@interface RNPrint : RCTView +@property UIPrinter *pickedPrinter; +@property NSString *filePath; +@property NSString *htmlString; +@property NSURL *printerURL; +@property (nonatomic, assign) BOOL isLandscape; +@end diff --git a/Frameworks/react-native-print.xcframework/ios-arm64_x86_64-simulator/libreact-native-print.a b/Frameworks/react-native-print.xcframework/ios-arm64_x86_64-simulator/libreact-native-print.a new file mode 100644 index 0000000..ec9076f Binary files /dev/null and b/Frameworks/react-native-print.xcframework/ios-arm64_x86_64-simulator/libreact-native-print.a differ diff --git a/Frameworks/react-native-safe-area-context.xcframework/Info.plist b/Frameworks/react-native-safe-area-context.xcframework/Info.plist new file mode 100644 index 0000000..3b79350 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-safe-area-context.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-safe-area-context.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-safe-area-context.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-safe-area-context.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RCTView+SafeAreaCompat.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RCTView+SafeAreaCompat.h new file mode 100644 index 0000000..b9f3332 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RCTView+SafeAreaCompat.h @@ -0,0 +1,16 @@ +#import +#import +#import + +RCT_EXTERN BOOL UIEdgeInsetsEqualToEdgeInsetsWithThreshold(UIEdgeInsets insets1, UIEdgeInsets insets2, CGFloat threshold); + +NS_ASSUME_NONNULL_BEGIN + +@interface UIView(SafeAreaCompat) + +- (BOOL)nativeSafeAreaSupport; +- (UIEdgeInsets)safeAreaInsetsOrEmulate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaProvider.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaProvider.h new file mode 100644 index 0000000..f31adb7 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaProvider.h @@ -0,0 +1,13 @@ +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaProvider : RCTView + +@property (nonatomic, copy) RCTBubblingEventBlock onInsetsChange; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaProviderManager.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaProviderManager.h new file mode 100644 index 0000000..d83c327 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaProviderManager.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaProviderManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaShadowView.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaShadowView.h new file mode 100644 index 0000000..a3474cd --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaShadowView.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaShadowView : RCTShadowView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaView.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaView.h new file mode 100644 index 0000000..d7d5320 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaView.h @@ -0,0 +1,21 @@ +#import +#import +#import + +#import "RNCSafeAreaViewMode.h" +#import "RNCSafeAreaViewEdges.h" + +NS_ASSUME_NONNULL_BEGIN + +@class RNCSafeAreaView; + +@interface RNCSafeAreaView: RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) RNCSafeAreaViewMode mode; +@property (nonatomic, assign) RNCSafeAreaViewEdges edges; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewEdges.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewEdges.h new file mode 100644 index 0000000..e0ec095 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewEdges.h @@ -0,0 +1,9 @@ +#import + +typedef NS_ENUM(NSInteger, RNCSafeAreaViewEdges) { + RNCSafeAreaViewEdgesTop = 0b1000, + RNCSafeAreaViewEdgesRight = 0b0100, + RNCSafeAreaViewEdgesBottom = 0b0010, + RNCSafeAreaViewEdgesLeft = 0b0001, + RNCSafeAreaViewEdgesAll = 0b1111, +}; diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewLocalData.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewLocalData.h new file mode 100644 index 0000000..7945b3d --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewLocalData.h @@ -0,0 +1,18 @@ +#import + +#import "RNCSafeAreaViewMode.h" +#import "RNCSafeAreaViewEdges.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaViewLocalData : NSObject + +- (instancetype)initWithInsets:(UIEdgeInsets)insets mode:(RNCSafeAreaViewMode)mode edges:(RNCSafeAreaViewEdges)edges; + +@property (atomic, readonly) UIEdgeInsets insets; +@property (atomic, readonly) RNCSafeAreaViewMode mode; +@property (atomic, readonly) RNCSafeAreaViewEdges edges; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewManager.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewManager.h new file mode 100644 index 0000000..cf92d53 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewManager.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewMode.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewMode.h new file mode 100644 index 0000000..a43f382 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/Headers/RNCSafeAreaViewMode.h @@ -0,0 +1,7 @@ +#import + +typedef NS_ENUM(NSInteger, RNCSafeAreaViewMode) { + RNCSafeAreaViewModePadding, + RNCSafeAreaViewModeMargin, + RNCSafeAreaViewModeBorder, +}; diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/libreact-native-safe-area-context.a b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/libreact-native-safe-area-context.a new file mode 100644 index 0000000..fc2f79f Binary files /dev/null and b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64/libreact-native-safe-area-context.a differ diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RCTView+SafeAreaCompat.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RCTView+SafeAreaCompat.h new file mode 100644 index 0000000..b9f3332 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RCTView+SafeAreaCompat.h @@ -0,0 +1,16 @@ +#import +#import +#import + +RCT_EXTERN BOOL UIEdgeInsetsEqualToEdgeInsetsWithThreshold(UIEdgeInsets insets1, UIEdgeInsets insets2, CGFloat threshold); + +NS_ASSUME_NONNULL_BEGIN + +@interface UIView(SafeAreaCompat) + +- (BOOL)nativeSafeAreaSupport; +- (UIEdgeInsets)safeAreaInsetsOrEmulate; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaProvider.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaProvider.h new file mode 100644 index 0000000..f31adb7 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaProvider.h @@ -0,0 +1,13 @@ +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaProvider : RCTView + +@property (nonatomic, copy) RCTBubblingEventBlock onInsetsChange; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaProviderManager.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaProviderManager.h new file mode 100644 index 0000000..d83c327 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaProviderManager.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaProviderManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaShadowView.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaShadowView.h new file mode 100644 index 0000000..a3474cd --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaShadowView.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaShadowView : RCTShadowView + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaView.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaView.h new file mode 100644 index 0000000..d7d5320 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaView.h @@ -0,0 +1,21 @@ +#import +#import +#import + +#import "RNCSafeAreaViewMode.h" +#import "RNCSafeAreaViewEdges.h" + +NS_ASSUME_NONNULL_BEGIN + +@class RNCSafeAreaView; + +@interface RNCSafeAreaView: RCTView + +- (instancetype)initWithBridge:(RCTBridge *)bridge; + +@property (nonatomic, assign) RNCSafeAreaViewMode mode; +@property (nonatomic, assign) RNCSafeAreaViewEdges edges; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewEdges.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewEdges.h new file mode 100644 index 0000000..e0ec095 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewEdges.h @@ -0,0 +1,9 @@ +#import + +typedef NS_ENUM(NSInteger, RNCSafeAreaViewEdges) { + RNCSafeAreaViewEdgesTop = 0b1000, + RNCSafeAreaViewEdgesRight = 0b0100, + RNCSafeAreaViewEdgesBottom = 0b0010, + RNCSafeAreaViewEdgesLeft = 0b0001, + RNCSafeAreaViewEdgesAll = 0b1111, +}; diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewLocalData.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewLocalData.h new file mode 100644 index 0000000..7945b3d --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewLocalData.h @@ -0,0 +1,18 @@ +#import + +#import "RNCSafeAreaViewMode.h" +#import "RNCSafeAreaViewEdges.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaViewLocalData : NSObject + +- (instancetype)initWithInsets:(UIEdgeInsets)insets mode:(RNCSafeAreaViewMode)mode edges:(RNCSafeAreaViewEdges)edges; + +@property (atomic, readonly) UIEdgeInsets insets; +@property (atomic, readonly) RNCSafeAreaViewMode mode; +@property (atomic, readonly) RNCSafeAreaViewEdges edges; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewManager.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewManager.h new file mode 100644 index 0000000..cf92d53 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewManager.h @@ -0,0 +1,9 @@ +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface RNCSafeAreaViewManager : RCTViewManager + +@end + +NS_ASSUME_NONNULL_END diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewMode.h b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewMode.h new file mode 100644 index 0000000..a43f382 --- /dev/null +++ b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSafeAreaViewMode.h @@ -0,0 +1,7 @@ +#import + +typedef NS_ENUM(NSInteger, RNCSafeAreaViewMode) { + RNCSafeAreaViewModePadding, + RNCSafeAreaViewModeMargin, + RNCSafeAreaViewModeBorder, +}; diff --git a/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/libreact-native-safe-area-context.a b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/libreact-native-safe-area-context.a new file mode 100644 index 0000000..60ebf46 Binary files /dev/null and b/Frameworks/react-native-safe-area-context.xcframework/ios-arm64_x86_64-simulator/libreact-native-safe-area-context.a differ diff --git a/Frameworks/react-native-slider.xcframework/Info.plist b/Frameworks/react-native-slider.xcframework/Info.plist new file mode 100644 index 0000000..eb3d4b0 --- /dev/null +++ b/Frameworks/react-native-slider.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-slider.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-slider.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-slider.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-slider.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-slider.xcframework/ios-arm64/Headers/RNCSlider.h b/Frameworks/react-native-slider.xcframework/ios-arm64/Headers/RNCSlider.h new file mode 100644 index 0000000..165cc16 --- /dev/null +++ b/Frameworks/react-native-slider.xcframework/ios-arm64/Headers/RNCSlider.h @@ -0,0 +1,28 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RNCSlider : UISlider + +@property (nonatomic, copy) RCTBubblingEventBlock onRNCSliderValueChange; +@property (nonatomic, copy) RCTBubblingEventBlock onRNCSliderSlidingStart; +@property (nonatomic, copy) RCTBubblingEventBlock onRNCSliderSlidingComplete; + +@property (nonatomic, assign) float step; +@property (nonatomic, assign) float lastValue; + +@property (nonatomic, strong) UIImage *trackImage; +@property (nonatomic, strong) UIImage *minimumTrackImage; +@property (nonatomic, strong) UIImage *maximumTrackImage; + +@property (nonatomic, strong) UIImage *thumbImage; + + +@end diff --git a/Frameworks/react-native-slider.xcframework/ios-arm64/Headers/RNCSliderManager.h b/Frameworks/react-native-slider.xcframework/ios-arm64/Headers/RNCSliderManager.h new file mode 100644 index 0000000..b161d85 --- /dev/null +++ b/Frameworks/react-native-slider.xcframework/ios-arm64/Headers/RNCSliderManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCSliderManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-slider.xcframework/ios-arm64/libreact-native-slider.a b/Frameworks/react-native-slider.xcframework/ios-arm64/libreact-native-slider.a new file mode 100644 index 0000000..f69b281 Binary files /dev/null and b/Frameworks/react-native-slider.xcframework/ios-arm64/libreact-native-slider.a differ diff --git a/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSlider.h b/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSlider.h new file mode 100644 index 0000000..165cc16 --- /dev/null +++ b/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSlider.h @@ -0,0 +1,28 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import + +@interface RNCSlider : UISlider + +@property (nonatomic, copy) RCTBubblingEventBlock onRNCSliderValueChange; +@property (nonatomic, copy) RCTBubblingEventBlock onRNCSliderSlidingStart; +@property (nonatomic, copy) RCTBubblingEventBlock onRNCSliderSlidingComplete; + +@property (nonatomic, assign) float step; +@property (nonatomic, assign) float lastValue; + +@property (nonatomic, strong) UIImage *trackImage; +@property (nonatomic, strong) UIImage *minimumTrackImage; +@property (nonatomic, strong) UIImage *maximumTrackImage; + +@property (nonatomic, strong) UIImage *thumbImage; + + +@end diff --git a/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSliderManager.h b/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSliderManager.h new file mode 100644 index 0000000..b161d85 --- /dev/null +++ b/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/Headers/RNCSliderManager.h @@ -0,0 +1,12 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCSliderManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/libreact-native-slider.a b/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/libreact-native-slider.a new file mode 100644 index 0000000..056dfcf Binary files /dev/null and b/Frameworks/react-native-slider.xcframework/ios-arm64_x86_64-simulator/libreact-native-slider.a differ diff --git a/Frameworks/react-native-splash-screen.xcframework/Info.plist b/Frameworks/react-native-splash-screen.xcframework/Info.plist new file mode 100644 index 0000000..3eb3353 --- /dev/null +++ b/Frameworks/react-native-splash-screen.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-splash-screen.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-splash-screen.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-splash-screen.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-splash-screen.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-splash-screen.xcframework/ios-arm64/Headers/RNSplashScreen.h b/Frameworks/react-native-splash-screen.xcframework/ios-arm64/Headers/RNSplashScreen.h new file mode 100644 index 0000000..f1cfbca --- /dev/null +++ b/Frameworks/react-native-splash-screen.xcframework/ios-arm64/Headers/RNSplashScreen.h @@ -0,0 +1,16 @@ +/** + * SplashScreen + * 启动屏 + * from:http://www.devio.org + * Author:CrazyCodeBoy + * GitHub:https://github.com/crazycodeboy + * Email:crazycodeboy@gmail.com + */ +#import +#import + +@interface RNSplashScreen : NSObject ++ (void)showSplashInRootView:(UIView*)rootView; ++ (void)show; ++ (void)hide; +@end diff --git a/Frameworks/react-native-splash-screen.xcframework/ios-arm64/libreact-native-splash-screen.a b/Frameworks/react-native-splash-screen.xcframework/ios-arm64/libreact-native-splash-screen.a new file mode 100644 index 0000000..1592868 Binary files /dev/null and b/Frameworks/react-native-splash-screen.xcframework/ios-arm64/libreact-native-splash-screen.a differ diff --git a/Frameworks/react-native-splash-screen.xcframework/ios-arm64_x86_64-simulator/Headers/RNSplashScreen.h b/Frameworks/react-native-splash-screen.xcframework/ios-arm64_x86_64-simulator/Headers/RNSplashScreen.h new file mode 100644 index 0000000..f1cfbca --- /dev/null +++ b/Frameworks/react-native-splash-screen.xcframework/ios-arm64_x86_64-simulator/Headers/RNSplashScreen.h @@ -0,0 +1,16 @@ +/** + * SplashScreen + * 启动屏 + * from:http://www.devio.org + * Author:CrazyCodeBoy + * GitHub:https://github.com/crazycodeboy + * Email:crazycodeboy@gmail.com + */ +#import +#import + +@interface RNSplashScreen : NSObject ++ (void)showSplashInRootView:(UIView*)rootView; ++ (void)show; ++ (void)hide; +@end diff --git a/Frameworks/react-native-splash-screen.xcframework/ios-arm64_x86_64-simulator/libreact-native-splash-screen.a b/Frameworks/react-native-splash-screen.xcframework/ios-arm64_x86_64-simulator/libreact-native-splash-screen.a new file mode 100644 index 0000000..e962160 Binary files /dev/null and b/Frameworks/react-native-splash-screen.xcframework/ios-arm64_x86_64-simulator/libreact-native-splash-screen.a differ diff --git a/Frameworks/react-native-sqlite-storage.xcframework/Info.plist b/Frameworks/react-native-sqlite-storage.xcframework/Info.plist new file mode 100644 index 0000000..91faa7f --- /dev/null +++ b/Frameworks/react-native-sqlite-storage.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-sqlite-storage.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-sqlite-storage.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-sqlite-storage.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-sqlite-storage.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/Headers/SQLite.h b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/Headers/SQLite.h new file mode 100644 index 0000000..70759ae --- /dev/null +++ b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/Headers/SQLite.h @@ -0,0 +1,56 @@ +/* + * SQLite.h + * + * Created by Andrzej Porebski on 10/29/15. + * Copyright (c) 2015 Andrzej Porebski. + * + * This software is largely based on the SQLLite Storage Cordova Plugin created by Chris Brody & Davide Bertola. + * The implementation was adopted and converted to use React Native bindings. + * + * See https://github.com/litehelpers/Cordova-sqlite-storage + * + * This library is available under the terms of the MIT License (2008). + * See http://opensource.org/licenses/alphabetical for full text. + */ + +#import + +// Used to remove dependency on sqlite3.h in this header: +struct sqlite3; + +enum WebSQLError { + UNKNOWN_ERR = 0, + DATABASE_ERR = 1, + VERSION_ERR = 2, + TOO_LARGE_ERR = 3, + QUOTA_ERR = 4, + SYNTAX_ERR = 5, + CONSTRAINT_ERR = 6, + TIMEOUT_ERR = 7 +}; +typedef int WebSQLError; + +@interface SQLite : NSObject { + NSMutableDictionary *openDBs; +} + +@property (nonatomic, copy) NSMutableDictionary *openDBs; +@property (nonatomic, copy) NSMutableDictionary *appDBPaths; + +// Open / Close +-(void) open: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) close: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) attach: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) delete: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; + +// Batch processing interface +-(void) backgroundExecuteSqlBatch: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) executeSqlBatch: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; + +// Single requests interface +-(void) backgroundExecuteSql:(NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) executeSql:(NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; + +// Echo Test +-(void) echoStringValue:(NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +@end diff --git a/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/Headers/SQLiteResult.h b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/Headers/SQLiteResult.h new file mode 100644 index 0000000..6319376 --- /dev/null +++ b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/Headers/SQLiteResult.h @@ -0,0 +1,32 @@ +/* + * SQLiteResult.h + * + * Created by Andrzej Porebski on 10/29/15. + * Copyright (c) 2015 Andrzej Porebski. + * + * This software is largely based on the SQLLite Storage Cordova Plugin created by Chris Brody & Davide Bertola. + * The implementation was adopted and converted to use React Native bindings. + * + * See https://github.com/litehelpers/Cordova-sqlite-storage + * + * This library is available under the terms of the MIT License (2008). + * See http://opensource.org/licenses/alphabetical for full text. + */ + +typedef enum { + SQLiteStatus_NO_RESULT = 0, + SQLiteStatus_OK, + SQLiteStatus_ERROR +} SQLiteStatus; + + +@interface SQLiteResult : NSObject {} + +@property (nonatomic, strong, readonly) NSNumber* status; +@property (nonatomic, strong, readonly) id message; + ++ (SQLiteResult*)resultWithStatus:(SQLiteStatus)statusOrdinal messageAsString:(NSString*)theMessage; ++ (SQLiteResult*)resultWithStatus:(SQLiteStatus)statusOrdinal messageAsArray:(NSArray*)theMessage; ++ (SQLiteResult*)resultWithStatus:(SQLiteStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage; + +@end \ No newline at end of file diff --git a/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/libreact-native-sqlite-storage.a b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/libreact-native-sqlite-storage.a new file mode 100644 index 0000000..8fb998f Binary files /dev/null and b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64/libreact-native-sqlite-storage.a differ diff --git a/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/Headers/SQLite.h b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/Headers/SQLite.h new file mode 100644 index 0000000..70759ae --- /dev/null +++ b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/Headers/SQLite.h @@ -0,0 +1,56 @@ +/* + * SQLite.h + * + * Created by Andrzej Porebski on 10/29/15. + * Copyright (c) 2015 Andrzej Porebski. + * + * This software is largely based on the SQLLite Storage Cordova Plugin created by Chris Brody & Davide Bertola. + * The implementation was adopted and converted to use React Native bindings. + * + * See https://github.com/litehelpers/Cordova-sqlite-storage + * + * This library is available under the terms of the MIT License (2008). + * See http://opensource.org/licenses/alphabetical for full text. + */ + +#import + +// Used to remove dependency on sqlite3.h in this header: +struct sqlite3; + +enum WebSQLError { + UNKNOWN_ERR = 0, + DATABASE_ERR = 1, + VERSION_ERR = 2, + TOO_LARGE_ERR = 3, + QUOTA_ERR = 4, + SYNTAX_ERR = 5, + CONSTRAINT_ERR = 6, + TIMEOUT_ERR = 7 +}; +typedef int WebSQLError; + +@interface SQLite : NSObject { + NSMutableDictionary *openDBs; +} + +@property (nonatomic, copy) NSMutableDictionary *openDBs; +@property (nonatomic, copy) NSMutableDictionary *appDBPaths; + +// Open / Close +-(void) open: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) close: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) attach: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) delete: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; + +// Batch processing interface +-(void) backgroundExecuteSqlBatch: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) executeSqlBatch: (NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; + +// Single requests interface +-(void) backgroundExecuteSql:(NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +-(void) executeSql:(NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; + +// Echo Test +-(void) echoStringValue:(NSDictionary *) options success:(RCTResponseSenderBlock)success error:(RCTResponseSenderBlock)error; +@end diff --git a/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/Headers/SQLiteResult.h b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/Headers/SQLiteResult.h new file mode 100644 index 0000000..6319376 --- /dev/null +++ b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/Headers/SQLiteResult.h @@ -0,0 +1,32 @@ +/* + * SQLiteResult.h + * + * Created by Andrzej Porebski on 10/29/15. + * Copyright (c) 2015 Andrzej Porebski. + * + * This software is largely based on the SQLLite Storage Cordova Plugin created by Chris Brody & Davide Bertola. + * The implementation was adopted and converted to use React Native bindings. + * + * See https://github.com/litehelpers/Cordova-sqlite-storage + * + * This library is available under the terms of the MIT License (2008). + * See http://opensource.org/licenses/alphabetical for full text. + */ + +typedef enum { + SQLiteStatus_NO_RESULT = 0, + SQLiteStatus_OK, + SQLiteStatus_ERROR +} SQLiteStatus; + + +@interface SQLiteResult : NSObject {} + +@property (nonatomic, strong, readonly) NSNumber* status; +@property (nonatomic, strong, readonly) id message; + ++ (SQLiteResult*)resultWithStatus:(SQLiteStatus)statusOrdinal messageAsString:(NSString*)theMessage; ++ (SQLiteResult*)resultWithStatus:(SQLiteStatus)statusOrdinal messageAsArray:(NSArray*)theMessage; ++ (SQLiteResult*)resultWithStatus:(SQLiteStatus)statusOrdinal messageAsDictionary:(NSDictionary*)theMessage; + +@end \ No newline at end of file diff --git a/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/libreact-native-sqlite-storage.a b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/libreact-native-sqlite-storage.a new file mode 100644 index 0000000..e9d5669 Binary files /dev/null and b/Frameworks/react-native-sqlite-storage.xcframework/ios-arm64_x86_64-simulator/libreact-native-sqlite-storage.a differ diff --git a/Frameworks/react-native-uuid-generator.xcframework/Info.plist b/Frameworks/react-native-uuid-generator.xcframework/Info.plist new file mode 100644 index 0000000..60f65b2 --- /dev/null +++ b/Frameworks/react-native-uuid-generator.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-uuid-generator.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-uuid-generator.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-uuid-generator.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-uuid-generator.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-uuid-generator.xcframework/ios-arm64/Headers/RNUUIDGenerator.h b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64/Headers/RNUUIDGenerator.h new file mode 100644 index 0000000..3062599 --- /dev/null +++ b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64/Headers/RNUUIDGenerator.h @@ -0,0 +1,6 @@ +#import + +@interface RNUUIDGenerator : NSObject + +@end + diff --git a/Frameworks/react-native-uuid-generator.xcframework/ios-arm64/libreact-native-uuid-generator.a b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64/libreact-native-uuid-generator.a new file mode 100644 index 0000000..520fa45 Binary files /dev/null and b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64/libreact-native-uuid-generator.a differ diff --git a/Frameworks/react-native-uuid-generator.xcframework/ios-arm64_x86_64-simulator/Headers/RNUUIDGenerator.h b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64_x86_64-simulator/Headers/RNUUIDGenerator.h new file mode 100644 index 0000000..3062599 --- /dev/null +++ b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64_x86_64-simulator/Headers/RNUUIDGenerator.h @@ -0,0 +1,6 @@ +#import + +@interface RNUUIDGenerator : NSObject + +@end + diff --git a/Frameworks/react-native-uuid-generator.xcframework/ios-arm64_x86_64-simulator/libreact-native-uuid-generator.a b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64_x86_64-simulator/libreact-native-uuid-generator.a new file mode 100644 index 0000000..97ad61b Binary files /dev/null and b/Frameworks/react-native-uuid-generator.xcframework/ios-arm64_x86_64-simulator/libreact-native-uuid-generator.a differ diff --git a/Frameworks/react-native-video.xcframework/Info.plist b/Frameworks/react-native-video.xcframework/Info.plist new file mode 100644 index 0000000..b1b7829 --- /dev/null +++ b/Frameworks/react-native-video.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-video.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-video.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-video.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-video.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideo.h b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideo.h new file mode 100644 index 0000000..6fee299 --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideo.h @@ -0,0 +1,67 @@ +#import +#import "AVKit/AVKit.h" +#import "UIView+FindUIViewController.h" +#import "RCTVideoPlayerViewController.h" +#import "RCTVideoPlayerViewControllerDelegate.h" +#import +#import + +#if __has_include() +#import +#import +#import +#endif + +@class RCTEventDispatcher; +#if __has_include() +@interface RCTVideo : UIView +#elif TARGET_OS_TV +@interface RCTVideo : UIView +#else +@interface RCTVideo : UIView +#endif + +@property (nonatomic, copy) RCTDirectEventBlock onVideoLoadStart; +@property (nonatomic, copy) RCTDirectEventBlock onVideoLoad; +@property (nonatomic, copy) RCTDirectEventBlock onVideoBuffer; +@property (nonatomic, copy) RCTDirectEventBlock onVideoError; +@property (nonatomic, copy) RCTDirectEventBlock onVideoProgress; +@property (nonatomic, copy) RCTDirectEventBlock onBandwidthUpdate; +@property (nonatomic, copy) RCTDirectEventBlock onVideoSeek; +@property (nonatomic, copy) RCTDirectEventBlock onVideoEnd; +@property (nonatomic, copy) RCTDirectEventBlock onTimedMetadata; +@property (nonatomic, copy) RCTDirectEventBlock onVideoAudioBecomingNoisy; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerWillPresent; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerDidPresent; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerWillDismiss; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerDidDismiss; +@property (nonatomic, copy) RCTDirectEventBlock onReadyForDisplay; +@property (nonatomic, copy) RCTDirectEventBlock onPlaybackStalled; +@property (nonatomic, copy) RCTDirectEventBlock onPlaybackResume; +@property (nonatomic, copy) RCTDirectEventBlock onPlaybackRateChange; +@property (nonatomic, copy) RCTDirectEventBlock onVideoExternalPlaybackChange; +@property (nonatomic, copy) RCTDirectEventBlock onPictureInPictureStatusChanged; +@property (nonatomic, copy) RCTDirectEventBlock onRestoreUserInterfaceForPictureInPictureStop; +@property (nonatomic, copy) RCTDirectEventBlock onGetLicense; + +typedef NS_ENUM(NSInteger, RCTVideoError) { + RCTVideoErrorFromJSPart, + RCTVideoErrorLicenseRequestNotOk, + RCTVideoErrorNoDataFromLicenseRequest, + RCTVideoErrorNoSPC, + RCTVideoErrorNoDataRequest, + RCTVideoErrorNoCertificateData, + RCTVideoErrorNoCertificateURL, + RCTVideoErrorNoFairplayDRM, + RCTVideoErrorNoDRMData +}; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +- (AVPlayerViewController*)createPlayerViewController:(AVPlayer*)player withPlayerItem:(AVPlayerItem*)playerItem; + +- (void)save:(NSDictionary *)options resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject; +- (void)setLicenseResult:(NSString * )license; +- (BOOL)setLicenseResultError:(NSString * )error; + +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoManager.h b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoManager.h new file mode 100644 index 0000000..b3bfccb --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoManager.h @@ -0,0 +1,6 @@ +#import +#import + +@interface RCTVideoManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoPlayerViewController.h b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoPlayerViewController.h new file mode 100644 index 0000000..ed9ebdd --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoPlayerViewController.h @@ -0,0 +1,20 @@ +// +// RCTVideoPlayerViewController.h +// RCTVideo +// +// Created by Stanisław Chmiela on 31.03.2016. +// Copyright © 2016 Facebook. All rights reserved. +// + +#import +#import "RCTVideo.h" +#import "RCTVideoPlayerViewControllerDelegate.h" + +@interface RCTVideoPlayerViewController : AVPlayerViewController +@property (nonatomic, weak) id rctDelegate; + +// Optional paramters +@property (nonatomic, weak) NSString* preferredOrientation; +@property (nonatomic) BOOL autorotate; + +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoPlayerViewControllerDelegate.h b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoPlayerViewControllerDelegate.h new file mode 100644 index 0000000..e84b3f5 --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/RCTVideoPlayerViewControllerDelegate.h @@ -0,0 +1,7 @@ +#import +#import "AVKit/AVKit.h" + +@protocol RCTVideoPlayerViewControllerDelegate +- (void)videoPlayerViewControllerWillDismiss:(AVPlayerViewController *)playerViewController; +- (void)videoPlayerViewControllerDidDismiss:(AVPlayerViewController *)playerViewController; +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64/Headers/UIView+FindUIViewController.h b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/UIView+FindUIViewController.h new file mode 100644 index 0000000..0921426 --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64/Headers/UIView+FindUIViewController.h @@ -0,0 +1,15 @@ +// +// UIView+FindUIViewController.h +// RCTVideo +// +// Created by Stanisław Chmiela on 31.03.2016. +// Copyright © 2016 Facebook. All rights reserved. +// +// Source: http://stackoverflow.com/a/3732812/1123156 + +#import + +@interface UIView (FindUIViewController) +- (UIViewController *) firstAvailableUIViewController; +- (id) traverseResponderChainForUIViewController; +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64/libreact-native-video.a b/Frameworks/react-native-video.xcframework/ios-arm64/libreact-native-video.a new file mode 100644 index 0000000..32ac5ee Binary files /dev/null and b/Frameworks/react-native-video.xcframework/ios-arm64/libreact-native-video.a differ diff --git a/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideo.h b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideo.h new file mode 100644 index 0000000..6fee299 --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideo.h @@ -0,0 +1,67 @@ +#import +#import "AVKit/AVKit.h" +#import "UIView+FindUIViewController.h" +#import "RCTVideoPlayerViewController.h" +#import "RCTVideoPlayerViewControllerDelegate.h" +#import +#import + +#if __has_include() +#import +#import +#import +#endif + +@class RCTEventDispatcher; +#if __has_include() +@interface RCTVideo : UIView +#elif TARGET_OS_TV +@interface RCTVideo : UIView +#else +@interface RCTVideo : UIView +#endif + +@property (nonatomic, copy) RCTDirectEventBlock onVideoLoadStart; +@property (nonatomic, copy) RCTDirectEventBlock onVideoLoad; +@property (nonatomic, copy) RCTDirectEventBlock onVideoBuffer; +@property (nonatomic, copy) RCTDirectEventBlock onVideoError; +@property (nonatomic, copy) RCTDirectEventBlock onVideoProgress; +@property (nonatomic, copy) RCTDirectEventBlock onBandwidthUpdate; +@property (nonatomic, copy) RCTDirectEventBlock onVideoSeek; +@property (nonatomic, copy) RCTDirectEventBlock onVideoEnd; +@property (nonatomic, copy) RCTDirectEventBlock onTimedMetadata; +@property (nonatomic, copy) RCTDirectEventBlock onVideoAudioBecomingNoisy; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerWillPresent; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerDidPresent; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerWillDismiss; +@property (nonatomic, copy) RCTDirectEventBlock onVideoFullscreenPlayerDidDismiss; +@property (nonatomic, copy) RCTDirectEventBlock onReadyForDisplay; +@property (nonatomic, copy) RCTDirectEventBlock onPlaybackStalled; +@property (nonatomic, copy) RCTDirectEventBlock onPlaybackResume; +@property (nonatomic, copy) RCTDirectEventBlock onPlaybackRateChange; +@property (nonatomic, copy) RCTDirectEventBlock onVideoExternalPlaybackChange; +@property (nonatomic, copy) RCTDirectEventBlock onPictureInPictureStatusChanged; +@property (nonatomic, copy) RCTDirectEventBlock onRestoreUserInterfaceForPictureInPictureStop; +@property (nonatomic, copy) RCTDirectEventBlock onGetLicense; + +typedef NS_ENUM(NSInteger, RCTVideoError) { + RCTVideoErrorFromJSPart, + RCTVideoErrorLicenseRequestNotOk, + RCTVideoErrorNoDataFromLicenseRequest, + RCTVideoErrorNoSPC, + RCTVideoErrorNoDataRequest, + RCTVideoErrorNoCertificateData, + RCTVideoErrorNoCertificateURL, + RCTVideoErrorNoFairplayDRM, + RCTVideoErrorNoDRMData +}; + +- (instancetype)initWithEventDispatcher:(RCTEventDispatcher *)eventDispatcher NS_DESIGNATED_INITIALIZER; + +- (AVPlayerViewController*)createPlayerViewController:(AVPlayer*)player withPlayerItem:(AVPlayerItem*)playerItem; + +- (void)save:(NSDictionary *)options resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject; +- (void)setLicenseResult:(NSString * )license; +- (BOOL)setLicenseResultError:(NSString * )error; + +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoManager.h b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoManager.h new file mode 100644 index 0000000..b3bfccb --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoManager.h @@ -0,0 +1,6 @@ +#import +#import + +@interface RCTVideoManager : RCTViewManager + +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoPlayerViewController.h b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoPlayerViewController.h new file mode 100644 index 0000000..ed9ebdd --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoPlayerViewController.h @@ -0,0 +1,20 @@ +// +// RCTVideoPlayerViewController.h +// RCTVideo +// +// Created by Stanisław Chmiela on 31.03.2016. +// Copyright © 2016 Facebook. All rights reserved. +// + +#import +#import "RCTVideo.h" +#import "RCTVideoPlayerViewControllerDelegate.h" + +@interface RCTVideoPlayerViewController : AVPlayerViewController +@property (nonatomic, weak) id rctDelegate; + +// Optional paramters +@property (nonatomic, weak) NSString* preferredOrientation; +@property (nonatomic) BOOL autorotate; + +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoPlayerViewControllerDelegate.h b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoPlayerViewControllerDelegate.h new file mode 100644 index 0000000..e84b3f5 --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/RCTVideoPlayerViewControllerDelegate.h @@ -0,0 +1,7 @@ +#import +#import "AVKit/AVKit.h" + +@protocol RCTVideoPlayerViewControllerDelegate +- (void)videoPlayerViewControllerWillDismiss:(AVPlayerViewController *)playerViewController; +- (void)videoPlayerViewControllerDidDismiss:(AVPlayerViewController *)playerViewController; +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/UIView+FindUIViewController.h b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/UIView+FindUIViewController.h new file mode 100644 index 0000000..0921426 --- /dev/null +++ b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/Headers/UIView+FindUIViewController.h @@ -0,0 +1,15 @@ +// +// UIView+FindUIViewController.h +// RCTVideo +// +// Created by Stanisław Chmiela on 31.03.2016. +// Copyright © 2016 Facebook. All rights reserved. +// +// Source: http://stackoverflow.com/a/3732812/1123156 + +#import + +@interface UIView (FindUIViewController) +- (UIViewController *) firstAvailableUIViewController; +- (id) traverseResponderChainForUIViewController; +@end diff --git a/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/libreact-native-video.a b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/libreact-native-video.a new file mode 100644 index 0000000..571e695 Binary files /dev/null and b/Frameworks/react-native-video.xcframework/ios-arm64_x86_64-simulator/libreact-native-video.a differ diff --git a/Frameworks/react-native-webview.xcframework/Info.plist b/Frameworks/react-native-webview.xcframework/Info.plist new file mode 100644 index 0000000..d620387 --- /dev/null +++ b/Frameworks/react-native-webview.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-webview.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-webview.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + libreact-native-webview.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-webview.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWKProcessPoolManager.h b/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWKProcessPoolManager.h new file mode 100644 index 0000000..6d2d215 --- /dev/null +++ b/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWKProcessPoolManager.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCWKProcessPoolManager : NSObject + ++ (instancetype) sharedManager; +- (WKProcessPool *)sharedProcessPool; + +@end diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWebView.h b/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWebView.h new file mode 100644 index 0000000..33a67ae --- /dev/null +++ b/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWebView.h @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +typedef enum RNCWebViewPermissionGrantType : NSUInteger { + RNCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt, + RNCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny, + RNCWebViewPermissionGrantType_Deny, + RNCWebViewPermissionGrantType_Grant, + RNCWebViewPermissionGrantType_Prompt +} RNCWebViewPermissionGrantType; + +@class RNCWebView; + +@protocol RNCWebViewDelegate + +- (BOOL)webView:(RNCWebView *_Nonnull)webView + shouldStartLoadForRequest:(NSMutableDictionary *_Nonnull)request + withCallback:(RCTDirectEventBlock _Nonnull)callback; + +@end + +@interface RNCWeakScriptMessageDelegate : NSObject + +@property (nonatomic, weak, nullable) id scriptDelegate; + +- (nullable instancetype)initWithDelegate:(id _Nullable)scriptDelegate; + +@end + +@interface RNCWebView : RCTView + +@property (nonatomic, weak) id _Nullable delegate; +@property (nonatomic, copy) NSDictionary * _Nullable source; +@property (nonatomic, assign) BOOL messagingEnabled; +@property (nonatomic, copy) NSString * _Nullable injectedJavaScript; +@property (nonatomic, copy) NSString * _Nullable injectedJavaScriptBeforeContentLoaded; +@property (nonatomic, assign) BOOL injectedJavaScriptForMainFrameOnly; +@property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly; +@property (nonatomic, assign) BOOL scrollEnabled; +@property (nonatomic, assign) BOOL sharedCookiesEnabled; +@property (nonatomic, assign) BOOL autoManageStatusBarEnabled; +@property (nonatomic, assign) BOOL pagingEnabled; +@property (nonatomic, assign) CGFloat decelerationRate; +@property (nonatomic, assign) BOOL allowsInlineMediaPlayback; +@property (nonatomic, assign) BOOL bounces; +@property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction; +#if WEBKIT_IOS_10_APIS_AVAILABLE +@property (nonatomic, assign) WKDataDetectorTypes dataDetectorTypes; +#endif +@property (nonatomic, assign) UIEdgeInsets contentInset; +@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; +@property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction; +@property (nonatomic, assign) BOOL hideKeyboardAccessoryView; +@property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures; +@property (nonatomic, assign) BOOL incognito; +@property (nonatomic, assign) BOOL useSharedProcessPool; +@property (nonatomic, copy) NSString * _Nullable userAgent; +@property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent; +@property (nonatomic, assign) BOOL cacheEnabled; +@property (nonatomic, assign) BOOL javaScriptEnabled; +@property (nonatomic, assign) BOOL javaScriptCanOpenWindowsAutomatically; +@property (nonatomic, assign) BOOL allowFileAccessFromFileURLs; +@property (nonatomic, assign) BOOL allowUniversalAccessFromFileURLs; +@property (nonatomic, assign) BOOL allowsLinkPreview; +@property (nonatomic, assign) BOOL showsHorizontalScrollIndicator; +@property (nonatomic, assign) BOOL showsVerticalScrollIndicator; +@property (nonatomic, assign) BOOL directionalLockEnabled; +@property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch; +@property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL; +@property (nonatomic, copy) NSDictionary * _Nullable basicAuthCredential; +@property (nonatomic, assign) BOOL pullToRefreshEnabled; +@property (nonatomic, assign) BOOL enableApplePay; +@property (nonatomic, copy) NSArray * _Nullable menuItems; +@property (nonatomic, copy) RCTDirectEventBlock onCustomMenuSelection; +#if !TARGET_OS_OSX +@property (nonatomic, weak) UIRefreshControl * _Nullable refreshControl; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */ +@property (nonatomic, assign) WKContentMode contentMode; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 /* iOS 14 */ +@property (nonatomic, assign) BOOL limitsNavigationsToAppBoundDomains; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */ +@property (nonatomic, assign) BOOL textInteractionEnabled; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */ +@property (nonatomic, assign) RNCWebViewPermissionGrantType mediaCapturePermissionGrantType; +#endif + ++ (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential; ++ (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates; +- (void)postMessage:(NSString *_Nullable)message; +- (void)injectJavaScript:(NSString *_Nullable)script; +- (void)goForward; +- (void)goBack; +- (void)reload; +- (void)stopLoading; +#if !TARGET_OS_OSX +- (void)addPullToRefreshControl; +- (void)pullToRefresh:(UIRefreshControl *_Nonnull)refreshControl; +#endif + +@end diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWebViewManager.h b/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWebViewManager.h new file mode 100644 index 0000000..c7252e5 --- /dev/null +++ b/Frameworks/react-native-webview.xcframework/ios-arm64/Headers/RNCWebViewManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCWebViewManager : RCTViewManager + @property (nonatomic, copy) NSArray * _Nullable menuItems; + @property (nonatomic, copy) RCTDirectEventBlock onCustomMenuSelection; +@end diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64/libreact-native-webview.a b/Frameworks/react-native-webview.xcframework/ios-arm64/libreact-native-webview.a new file mode 100644 index 0000000..e45f58e Binary files /dev/null and b/Frameworks/react-native-webview.xcframework/ios-arm64/libreact-native-webview.a differ diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWKProcessPoolManager.h b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWKProcessPoolManager.h new file mode 100644 index 0000000..6d2d215 --- /dev/null +++ b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWKProcessPoolManager.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCWKProcessPoolManager : NSObject + ++ (instancetype) sharedManager; +- (WKProcessPool *)sharedProcessPool; + +@end diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWebView.h b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWebView.h new file mode 100644 index 0000000..33a67ae --- /dev/null +++ b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWebView.h @@ -0,0 +1,116 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import +#import +#import + +typedef enum RNCWebViewPermissionGrantType : NSUInteger { + RNCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt, + RNCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny, + RNCWebViewPermissionGrantType_Deny, + RNCWebViewPermissionGrantType_Grant, + RNCWebViewPermissionGrantType_Prompt +} RNCWebViewPermissionGrantType; + +@class RNCWebView; + +@protocol RNCWebViewDelegate + +- (BOOL)webView:(RNCWebView *_Nonnull)webView + shouldStartLoadForRequest:(NSMutableDictionary *_Nonnull)request + withCallback:(RCTDirectEventBlock _Nonnull)callback; + +@end + +@interface RNCWeakScriptMessageDelegate : NSObject + +@property (nonatomic, weak, nullable) id scriptDelegate; + +- (nullable instancetype)initWithDelegate:(id _Nullable)scriptDelegate; + +@end + +@interface RNCWebView : RCTView + +@property (nonatomic, weak) id _Nullable delegate; +@property (nonatomic, copy) NSDictionary * _Nullable source; +@property (nonatomic, assign) BOOL messagingEnabled; +@property (nonatomic, copy) NSString * _Nullable injectedJavaScript; +@property (nonatomic, copy) NSString * _Nullable injectedJavaScriptBeforeContentLoaded; +@property (nonatomic, assign) BOOL injectedJavaScriptForMainFrameOnly; +@property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly; +@property (nonatomic, assign) BOOL scrollEnabled; +@property (nonatomic, assign) BOOL sharedCookiesEnabled; +@property (nonatomic, assign) BOOL autoManageStatusBarEnabled; +@property (nonatomic, assign) BOOL pagingEnabled; +@property (nonatomic, assign) CGFloat decelerationRate; +@property (nonatomic, assign) BOOL allowsInlineMediaPlayback; +@property (nonatomic, assign) BOOL bounces; +@property (nonatomic, assign) BOOL mediaPlaybackRequiresUserAction; +#if WEBKIT_IOS_10_APIS_AVAILABLE +@property (nonatomic, assign) WKDataDetectorTypes dataDetectorTypes; +#endif +@property (nonatomic, assign) UIEdgeInsets contentInset; +@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets; +@property (nonatomic, assign) BOOL keyboardDisplayRequiresUserAction; +@property (nonatomic, assign) BOOL hideKeyboardAccessoryView; +@property (nonatomic, assign) BOOL allowsBackForwardNavigationGestures; +@property (nonatomic, assign) BOOL incognito; +@property (nonatomic, assign) BOOL useSharedProcessPool; +@property (nonatomic, copy) NSString * _Nullable userAgent; +@property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent; +@property (nonatomic, assign) BOOL cacheEnabled; +@property (nonatomic, assign) BOOL javaScriptEnabled; +@property (nonatomic, assign) BOOL javaScriptCanOpenWindowsAutomatically; +@property (nonatomic, assign) BOOL allowFileAccessFromFileURLs; +@property (nonatomic, assign) BOOL allowUniversalAccessFromFileURLs; +@property (nonatomic, assign) BOOL allowsLinkPreview; +@property (nonatomic, assign) BOOL showsHorizontalScrollIndicator; +@property (nonatomic, assign) BOOL showsVerticalScrollIndicator; +@property (nonatomic, assign) BOOL directionalLockEnabled; +@property (nonatomic, assign) BOOL ignoreSilentHardwareSwitch; +@property (nonatomic, copy) NSString * _Nullable allowingReadAccessToURL; +@property (nonatomic, copy) NSDictionary * _Nullable basicAuthCredential; +@property (nonatomic, assign) BOOL pullToRefreshEnabled; +@property (nonatomic, assign) BOOL enableApplePay; +@property (nonatomic, copy) NSArray * _Nullable menuItems; +@property (nonatomic, copy) RCTDirectEventBlock onCustomMenuSelection; +#if !TARGET_OS_OSX +@property (nonatomic, weak) UIRefreshControl * _Nullable refreshControl; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */ +@property (nonatomic, assign) WKContentMode contentMode; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 /* iOS 14 */ +@property (nonatomic, assign) BOOL limitsNavigationsToAppBoundDomains; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */ +@property (nonatomic, assign) BOOL textInteractionEnabled; +#endif + +#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */ +@property (nonatomic, assign) RNCWebViewPermissionGrantType mediaCapturePermissionGrantType; +#endif + ++ (void)setClientAuthenticationCredential:(nullable NSURLCredential*)credential; ++ (void)setCustomCertificatesForHost:(nullable NSDictionary *)certificates; +- (void)postMessage:(NSString *_Nullable)message; +- (void)injectJavaScript:(NSString *_Nullable)script; +- (void)goForward; +- (void)goBack; +- (void)reload; +- (void)stopLoading; +#if !TARGET_OS_OSX +- (void)addPullToRefreshControl; +- (void)pullToRefresh:(UIRefreshControl *_Nonnull)refreshControl; +#endif + +@end diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWebViewManager.h b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWebViewManager.h new file mode 100644 index 0000000..c7252e5 --- /dev/null +++ b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/Headers/RNCWebViewManager.h @@ -0,0 +1,13 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@interface RNCWebViewManager : RCTViewManager + @property (nonatomic, copy) NSArray * _Nullable menuItems; + @property (nonatomic, copy) RCTDirectEventBlock onCustomMenuSelection; +@end diff --git a/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/libreact-native-webview.a b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/libreact-native-webview.a new file mode 100644 index 0000000..e989c09 Binary files /dev/null and b/Frameworks/react-native-webview.xcframework/ios-arm64_x86_64-simulator/libreact-native-webview.a differ diff --git a/Frameworks/react-native-zip-archive.xcframework/Info.plist b/Frameworks/react-native-zip-archive.xcframework/Info.plist new file mode 100644 index 0000000..d8abd04 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + libreact-native-zip-archive.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + libreact-native-zip-archive.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + BinaryPath + libreact-native-zip-archive.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + libreact-native-zip-archive.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/RNZipArchive.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/RNZipArchive.h new file mode 100644 index 0000000..02e9f43 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/RNZipArchive.h @@ -0,0 +1,25 @@ +// +// RNZipArchive.h +// RNZipArchive +// +// Created by Perry Poon on 8/26/15. +// Copyright (c) 2015 Perry Poon. All rights reserved. +// + + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif +#import "SSZipArchive/SSZipArchive.h" + +@interface RNZipArchive : NSObject{ + NSString *unzippedFilePath; + float unzipProgress; +} + +@property (nonatomic) NSString *unzippedFilePath; +@property (nonatomic) float unzipProgress; + +@end diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/SSZipArchive.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/SSZipArchive.h new file mode 100644 index 0000000..2e0c7f8 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/SSZipArchive.h @@ -0,0 +1,150 @@ +// +// SSZipArchive.h +// SSZipArchive +// +// Created by Sam Soffes on 7/21/10. +// Copyright (c) Sam Soffes 2010-2015. All rights reserved. +// + +#ifndef _SSZIPARCHIVE_H +#define _SSZIPARCHIVE_H + +#import +#include "SSZipCommon.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const SSZipArchiveErrorDomain; +typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { + SSZipArchiveErrorCodeFailedOpenZipFile = -1, + SSZipArchiveErrorCodeFailedOpenFileInZip = -2, + SSZipArchiveErrorCodeFileInfoNotLoadable = -3, + SSZipArchiveErrorCodeFileContentNotReadable = -4, + SSZipArchiveErrorCodeFailedToWriteFile = -5, + SSZipArchiveErrorCodeInvalidArguments = -6, +}; + +@protocol SSZipArchiveDelegate; + +@interface SSZipArchive : NSObject + +// Password check ++ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path; ++ (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NOTHROW; + +// Unzip ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination; ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id)delegate; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + error:(NSError * *)error; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + error:(NSError * *)error + delegate:(nullable id)delegate NS_REFINED_FOR_SWIFT; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + preserveAttributes:(BOOL)preserveAttributes + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + error:(NSError * *)error + delegate:(nullable id)delegate; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler + completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler + completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + preserveAttributes:(BOOL)preserveAttributes + overwrite:(BOOL)overwrite + nestedZipLevel:(NSInteger)nestedZipLevel + password:(nullable NSString *)password + error:(NSError **)error + delegate:(nullable id)delegate + progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler + completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; + +// Zip +// default compression level is Z_DEFAULT_COMPRESSION (from "zlib.h") +// keepParentDirectory: if YES, then unzipping will give `directoryName/fileName`. If NO, then unzipping will just give `fileName`. Default is NO. + +// without password ++ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths; +//without password and compression ++ (BOOL)createStoreZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths; ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath; + ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory; + +// with optional password, default encryption is AES +// don't use AES if you need compatibility with native macOS unzip and Archive Utility ++ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password; ++ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password withCompressionLevel:(int)compressionLevel; ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password; ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password; ++ (BOOL)createZipFileAtPath:(NSString *)path + withContentsOfDirectory:(NSString *)directoryPath + keepParentDirectory:(BOOL)keepParentDirectory + withPassword:(nullable NSString *)password + andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; ++ (BOOL)createZipFileAtPath:(NSString *)path + withContentsOfDirectory:(NSString *)directoryPath + keepParentDirectory:(BOOL)keepParentDirectory + compressionLevel:(int)compressionLevel + password:(nullable NSString *)password + AES:(BOOL)aes + progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER; +- (BOOL)open; + +/// write empty folder +- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password; +/// write file +- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password; +- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password; +- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; +/// write data +- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password; +- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; + +- (BOOL)close; + +@end + +@protocol SSZipArchiveDelegate + +@optional + +- (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo; +- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath; + +- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; +- (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; +- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; +- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath; + +- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total; + +@end + +NS_ASSUME_NONNULL_END + +#endif /* _SSZIPARCHIVE_H */ diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/SSZipCommon.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/SSZipCommon.h new file mode 100644 index 0000000..78fa282 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/SSZipCommon.h @@ -0,0 +1,68 @@ +#ifndef SSZipCommon +#define SSZipCommon + +// typedefs moved from mz_compat.h to here for public access + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info64_s +{ + uint64_t number_entry; /* total number of entries in the central dir on this disk */ + uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */ + uint16_t size_comment; /* size of the global comment of the zipfile */ +} unz_global_info64; + +typedef struct unz_global_info_s +{ + uint32_t number_entry; /* total number of entries in the central dir on this disk */ + uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */ + uint16_t size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + +/* unz_file_info contain information about a file in the zipfile */ +/* https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT */ +typedef struct unz_file_info64_s +{ + uint16_t version; /* version made by 2 bytes */ + uint16_t version_needed; /* version needed to extract 2 bytes */ + uint16_t flag; /* general purpose bit flag 2 bytes */ + uint16_t compression_method; /* compression method 2 bytes */ + uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ + uint32_t crc; /* crc-32 4 bytes */ + uint64_t compressed_size; /* compressed size 8 bytes */ + uint64_t uncompressed_size; /* uncompressed size 8 bytes */ + uint16_t size_filename; /* filename length 2 bytes */ + uint16_t size_file_extra; /* extra field length 2 bytes */ + uint16_t size_file_comment; /* file comment length 2 bytes */ + + uint32_t disk_num_start; /* disk number start 4 bytes */ + uint16_t internal_fa; /* internal file attributes 2 bytes */ + uint32_t external_fa; /* external file attributes 4 bytes */ + + uint64_t disk_offset; + + uint16_t size_file_extra_internal; +} unz_file_info64; + +typedef struct unz_file_info_s +{ + uint16_t version; /* version made by 2 bytes */ + uint16_t version_needed; /* version needed to extract 2 bytes */ + uint16_t flag; /* general purpose bit flag 2 bytes */ + uint16_t compression_method; /* compression method 2 bytes */ + uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ + uint32_t crc; /* crc-32 4 bytes */ + uint32_t compressed_size; /* compressed size 4 bytes */ + uint32_t uncompressed_size; /* uncompressed size 4 bytes */ + uint16_t size_filename; /* filename length 2 bytes */ + uint16_t size_file_extra; /* extra field length 2 bytes */ + uint16_t size_file_comment; /* file comment length 2 bytes */ + + uint16_t disk_num_start; /* disk number start 2 bytes */ + uint16_t internal_fa; /* internal file attributes 2 bytes */ + uint32_t external_fa; /* external file attributes 4 bytes */ + + uint64_t disk_offset; +} unz_file_info; + +#endif diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/ZipArchive.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/ZipArchive.h new file mode 100644 index 0000000..7a53df8 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/Headers/ZipArchive.h @@ -0,0 +1,19 @@ +// +// ZipArchive.h +// ZipArchive +// +// Created by Serhii Mumriak on 12/1/15. +// Copyright © 2015 smumryak. All rights reserved. +// + +#import + +//! Project version number for ZipArchive. +FOUNDATION_EXPORT double ZipArchiveVersionNumber; + +//! Project version string for ZipArchive. +FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import "SSZipArchive.h" diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64/libreact-native-zip-archive.a b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/libreact-native-zip-archive.a new file mode 100644 index 0000000..6b94eb4 Binary files /dev/null and b/Frameworks/react-native-zip-archive.xcframework/ios-arm64/libreact-native-zip-archive.a differ diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/RNZipArchive.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/RNZipArchive.h new file mode 100644 index 0000000..02e9f43 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/RNZipArchive.h @@ -0,0 +1,25 @@ +// +// RNZipArchive.h +// RNZipArchive +// +// Created by Perry Poon on 8/26/15. +// Copyright (c) 2015 Perry Poon. All rights reserved. +// + + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif +#import "SSZipArchive/SSZipArchive.h" + +@interface RNZipArchive : NSObject{ + NSString *unzippedFilePath; + float unzipProgress; +} + +@property (nonatomic) NSString *unzippedFilePath; +@property (nonatomic) float unzipProgress; + +@end diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/SSZipArchive.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/SSZipArchive.h new file mode 100644 index 0000000..2e0c7f8 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/SSZipArchive.h @@ -0,0 +1,150 @@ +// +// SSZipArchive.h +// SSZipArchive +// +// Created by Sam Soffes on 7/21/10. +// Copyright (c) Sam Soffes 2010-2015. All rights reserved. +// + +#ifndef _SSZIPARCHIVE_H +#define _SSZIPARCHIVE_H + +#import +#include "SSZipCommon.h" + +NS_ASSUME_NONNULL_BEGIN + +extern NSString *const SSZipArchiveErrorDomain; +typedef NS_ENUM(NSInteger, SSZipArchiveErrorCode) { + SSZipArchiveErrorCodeFailedOpenZipFile = -1, + SSZipArchiveErrorCodeFailedOpenFileInZip = -2, + SSZipArchiveErrorCodeFileInfoNotLoadable = -3, + SSZipArchiveErrorCodeFileContentNotReadable = -4, + SSZipArchiveErrorCodeFailedToWriteFile = -5, + SSZipArchiveErrorCodeInvalidArguments = -6, +}; + +@protocol SSZipArchiveDelegate; + +@interface SSZipArchive : NSObject + +// Password check ++ (BOOL)isFilePasswordProtectedAtPath:(NSString *)path; ++ (BOOL)isPasswordValidForArchiveAtPath:(NSString *)path password:(NSString *)pw error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NOTHROW; + +// Unzip ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination; ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination delegate:(nullable id)delegate; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + error:(NSError * *)error; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + error:(NSError * *)error + delegate:(nullable id)delegate NS_REFINED_FOR_SWIFT; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + preserveAttributes:(BOOL)preserveAttributes + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + error:(NSError * *)error + delegate:(nullable id)delegate; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler + completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + overwrite:(BOOL)overwrite + password:(nullable NSString *)password + progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler + completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; + ++ (NSMutableArray *)unzipFileAtPath:(NSString *)path + toDestination:(NSString *)destination + preserveAttributes:(BOOL)preserveAttributes + overwrite:(BOOL)overwrite + nestedZipLevel:(NSInteger)nestedZipLevel + password:(nullable NSString *)password + error:(NSError **)error + delegate:(nullable id)delegate + progressHandler:(void (^_Nullable)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler + completionHandler:(void (^_Nullable)(NSString *path, BOOL succeeded, NSError * _Nullable error))completionHandler; + +// Zip +// default compression level is Z_DEFAULT_COMPRESSION (from "zlib.h") +// keepParentDirectory: if YES, then unzipping will give `directoryName/fileName`. If NO, then unzipping will just give `fileName`. Default is NO. + +// without password ++ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths; +//without password and compression ++ (BOOL)createStoreZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths; ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath; + ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory; + +// with optional password, default encryption is AES +// don't use AES if you need compatibility with native macOS unzip and Archive Utility ++ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password; ++ (BOOL)createZipFileAtPath:(NSString *)path withFilesAtPaths:(NSArray *)paths withPassword:(nullable NSString *)password withCompressionLevel:(int)compressionLevel; ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath withPassword:(nullable NSString *)password; ++ (BOOL)createZipFileAtPath:(NSString *)path withContentsOfDirectory:(NSString *)directoryPath keepParentDirectory:(BOOL)keepParentDirectory withPassword:(nullable NSString *)password; ++ (BOOL)createZipFileAtPath:(NSString *)path + withContentsOfDirectory:(NSString *)directoryPath + keepParentDirectory:(BOOL)keepParentDirectory + withPassword:(nullable NSString *)password + andProgressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; ++ (BOOL)createZipFileAtPath:(NSString *)path + withContentsOfDirectory:(NSString *)directoryPath + keepParentDirectory:(BOOL)keepParentDirectory + compressionLevel:(int)compressionLevel + password:(nullable NSString *)password + AES:(BOOL)aes + progressHandler:(void(^ _Nullable)(NSUInteger entryNumber, NSUInteger total))progressHandler; + +- (instancetype)init NS_UNAVAILABLE; +- (instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER; +- (BOOL)open; + +/// write empty folder +- (BOOL)writeFolderAtPath:(NSString *)path withFolderName:(NSString *)folderName withPassword:(nullable NSString *)password; +/// write file +- (BOOL)writeFile:(NSString *)path withPassword:(nullable NSString *)password; +- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName withPassword:(nullable NSString *)password; +- (BOOL)writeFileAtPath:(NSString *)path withFileName:(nullable NSString *)fileName compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; +/// write data +- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename withPassword:(nullable NSString *)password; +- (BOOL)writeData:(NSData *)data filename:(nullable NSString *)filename compressionLevel:(int)compressionLevel password:(nullable NSString *)password AES:(BOOL)aes; + +- (BOOL)close; + +@end + +@protocol SSZipArchiveDelegate + +@optional + +- (void)zipArchiveWillUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo; +- (void)zipArchiveDidUnzipArchiveAtPath:(NSString *)path zipInfo:(unz_global_info)zipInfo unzippedPath:(NSString *)unzippedPath; + +- (BOOL)zipArchiveShouldUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; +- (void)zipArchiveWillUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; +- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath fileInfo:(unz_file_info)fileInfo; +- (void)zipArchiveDidUnzipFileAtIndex:(NSInteger)fileIndex totalFiles:(NSInteger)totalFiles archivePath:(NSString *)archivePath unzippedFilePath:(NSString *)unzippedFilePath; + +- (void)zipArchiveProgressEvent:(unsigned long long)loaded total:(unsigned long long)total; + +@end + +NS_ASSUME_NONNULL_END + +#endif /* _SSZIPARCHIVE_H */ diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/SSZipCommon.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/SSZipCommon.h new file mode 100644 index 0000000..78fa282 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/SSZipCommon.h @@ -0,0 +1,68 @@ +#ifndef SSZipCommon +#define SSZipCommon + +// typedefs moved from mz_compat.h to here for public access + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info64_s +{ + uint64_t number_entry; /* total number of entries in the central dir on this disk */ + uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */ + uint16_t size_comment; /* size of the global comment of the zipfile */ +} unz_global_info64; + +typedef struct unz_global_info_s +{ + uint32_t number_entry; /* total number of entries in the central dir on this disk */ + uint32_t number_disk_with_CD; /* number the the disk with central dir, used for spanning ZIP */ + uint16_t size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + +/* unz_file_info contain information about a file in the zipfile */ +/* https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT */ +typedef struct unz_file_info64_s +{ + uint16_t version; /* version made by 2 bytes */ + uint16_t version_needed; /* version needed to extract 2 bytes */ + uint16_t flag; /* general purpose bit flag 2 bytes */ + uint16_t compression_method; /* compression method 2 bytes */ + uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ + uint32_t crc; /* crc-32 4 bytes */ + uint64_t compressed_size; /* compressed size 8 bytes */ + uint64_t uncompressed_size; /* uncompressed size 8 bytes */ + uint16_t size_filename; /* filename length 2 bytes */ + uint16_t size_file_extra; /* extra field length 2 bytes */ + uint16_t size_file_comment; /* file comment length 2 bytes */ + + uint32_t disk_num_start; /* disk number start 4 bytes */ + uint16_t internal_fa; /* internal file attributes 2 bytes */ + uint32_t external_fa; /* external file attributes 4 bytes */ + + uint64_t disk_offset; + + uint16_t size_file_extra_internal; +} unz_file_info64; + +typedef struct unz_file_info_s +{ + uint16_t version; /* version made by 2 bytes */ + uint16_t version_needed; /* version needed to extract 2 bytes */ + uint16_t flag; /* general purpose bit flag 2 bytes */ + uint16_t compression_method; /* compression method 2 bytes */ + uint32_t dos_date; /* last mod file date in Dos fmt 4 bytes */ + uint32_t crc; /* crc-32 4 bytes */ + uint32_t compressed_size; /* compressed size 4 bytes */ + uint32_t uncompressed_size; /* uncompressed size 4 bytes */ + uint16_t size_filename; /* filename length 2 bytes */ + uint16_t size_file_extra; /* extra field length 2 bytes */ + uint16_t size_file_comment; /* file comment length 2 bytes */ + + uint16_t disk_num_start; /* disk number start 2 bytes */ + uint16_t internal_fa; /* internal file attributes 2 bytes */ + uint32_t external_fa; /* external file attributes 4 bytes */ + + uint64_t disk_offset; +} unz_file_info; + +#endif diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/ZipArchive.h b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/ZipArchive.h new file mode 100644 index 0000000..7a53df8 --- /dev/null +++ b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/Headers/ZipArchive.h @@ -0,0 +1,19 @@ +// +// ZipArchive.h +// ZipArchive +// +// Created by Serhii Mumriak on 12/1/15. +// Copyright © 2015 smumryak. All rights reserved. +// + +#import + +//! Project version number for ZipArchive. +FOUNDATION_EXPORT double ZipArchiveVersionNumber; + +//! Project version string for ZipArchive. +FOUNDATION_EXPORT const unsigned char ZipArchiveVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + +#import "SSZipArchive.h" diff --git a/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/libreact-native-zip-archive.a b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/libreact-native-zip-archive.a new file mode 100644 index 0000000..b76a3cf Binary files /dev/null and b/Frameworks/react-native-zip-archive.xcframework/ios-arm64_x86_64-simulator/libreact-native-zip-archive.a differ diff --git a/Frameworks/rn-fetch-blob.xcframework/Info.plist b/Frameworks/rn-fetch-blob.xcframework/Info.plist new file mode 100644 index 0000000..75cf30c --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/Info.plist @@ -0,0 +1,48 @@ + + + + + AvailableLibraries + + + BinaryPath + librn-fetch-blob.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64 + LibraryPath + librn-fetch-blob.a + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + BinaryPath + librn-fetch-blob.a + HeadersPath + Headers + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + librn-fetch-blob.a + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/IOS7Polyfill.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/IOS7Polyfill.h new file mode 100644 index 0000000..04a4bfa --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/IOS7Polyfill.h @@ -0,0 +1,27 @@ +// +// IOS7Polyfill.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/9/6. +// Copyright © 2016年 wkh237.github.io. All rights reserved. +// + +#ifndef IOS7Polyfill_h +#define IOS7Polyfill_h + +@interface NSString (Contains) + +- (BOOL)RNFBContainsString:(NSString*)other; + +@end + +@implementation NSString (Contains) + +- (BOOL)RNFBContainsString:(NSString*)other { + NSRange range = [self rangeOfString:other]; + return range.length != 0; +} + + +@end +#endif /* IOS7Polyfill_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlob.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlob.h new file mode 100644 index 0000000..669a093 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlob.h @@ -0,0 +1,45 @@ +// +// RNFetchBlob.h +// +// Created by wkh237 on 2016/4/28. +// + +//XXX: DO NO REMOVE THIS LINE IF YOU'RE USING IT ON RN > 0.40 PROJECT + + + +#ifndef RNFetchBlob_h +#define RNFetchBlob_h + + +#if __has_include() +#import +#import +#import +#import +#import +#else +#import "RCTBridgeModule.h" +#import "RCTLog.h" +#import "RCTRootView.h" +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" +#endif + +#import + + +@interface RNFetchBlob : NSObject { + + NSString * filePathPrefix; + +} + +@property (nonatomic) NSString * filePathPrefix; +@property (retain) UIDocumentInteractionController * documentController; + ++ (RCTBridge *)getRCTBridge; + +@end + +#endif /* RNFetchBlob_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobConst.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobConst.h new file mode 100644 index 0000000..6347b7a --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobConst.h @@ -0,0 +1,55 @@ +// +// RNFetchBlobConst.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/6/6. +// Copyright © 2016年 suzuri04x2. All rights reserved. +// + +#ifndef RNFetchBlobConst_h +#define RNFetchBlobConst_h + +#import + +// lib event +extern NSString *const MSG_EVENT; +extern NSString *const MSG_EVENT_LOG; +extern NSString *const MSG_EVENT_WARN; +extern NSString *const MSG_EVENT_ERROR; + +extern NSString *const EVENT_EXPIRE; +extern NSString *const EVENT_PROGRESS; +extern NSString *const EVENT_SERVER_PUSH; +extern NSString *const EVENT_PROGRESS_UPLOAD; +extern NSString *const EVENT_STATE_CHANGE; + +extern NSString *const FILE_PREFIX; +extern NSString *const ASSET_PREFIX; +extern NSString *const AL_PREFIX; + +// config +extern NSString *const CONFIG_USE_TEMP; +extern NSString *const CONFIG_FILE_PATH; +extern NSString *const CONFIG_FILE_EXT; +extern NSString *const CONFIG_TRUSTY; +extern NSString *const CONFIG_INDICATOR; +extern NSString *const CONFIG_KEY; +extern NSString *const CONFIG_EXTRA_BLOB_CTYPE; + +// fs events +extern NSString *const FS_EVENT_DATA; +extern NSString *const FS_EVENT_END; +extern NSString *const FS_EVENT_WARN; +extern NSString *const FS_EVENT_ERROR; + +extern NSString *const KEY_REPORT_PROGRESS; +extern NSString *const KEY_REPORT_UPLOAD_PROGRESS; + +// response type +extern NSString *const RESP_TYPE_BASE64; +extern NSString *const RESP_TYPE_UTF8; +extern NSString *const RESP_TYPE_PATH; + + + +#endif /* RNFetchBlobConst_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobFS.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobFS.h new file mode 100644 index 0000000..5141201 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobFS.h @@ -0,0 +1,109 @@ +// +// RNFetchBlobFS.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/6/6. +// Copyright © 2016年 suzuri04x2. All rights reserved. +// + +#ifndef RNFetchBlobFS_h +#define RNFetchBlobFS_h + +#import "RNFetchBlob.h" +#import + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + +@import AssetsLibrary; + +@interface RNFetchBlobFS : NSObject { + NSOutputStream * outStream; + NSInputStream * inStream; + RCTResponseSenderBlock callback; + RCTBridge * bridge; + Boolean isOpen; + NSString * encoding; + int bufferSize; + BOOL appendData; + NSString * taskId; + NSString * path; + NSString * streamId; +} + +@property (nonatomic) NSOutputStream * _Nullable outStream; +@property (nonatomic) NSInputStream * _Nullable inStream; +@property (strong, nonatomic) RCTResponseSenderBlock callback; +@property (nonatomic) RCTBridge * bridge; +@property (nonatomic) NSString * encoding; +@property (nonatomic) NSString * taskId; +@property (nonatomic) NSString * path; +@property (nonatomic) int bufferSize; +@property (nonatomic) NSString * streamId; +@property (nonatomic) BOOL appendData; + +// get dirs ++ (NSString *) getCacheDir; ++ (NSString *) getDocumentDir; ++ (NSString *) getDownloadDir; ++ (NSString *) getLibraryDir; ++ (NSString *) getMainBundleDir; ++ (NSString *) getMovieDir; ++ (NSString *) getMusicDir; ++ (NSString *) getPictureDir; ++ (NSString *) getTempPath; ++ (NSString *) getTempPath:(NSString*)taskId withExtension:(NSString *)ext; ++ (NSString *) getPathOfAsset:(NSString *)assetURI; ++ (NSString *) getPathForAppGroup:(NSString *)groupName; ++ (void) getPathFromUri:(NSString *)uri completionHandler:(void(^)(NSString * path, ALAssetRepresentation *asset)) onComplete; + +// fs methods ++ (RNFetchBlobFS *) getFileStreams; ++ (BOOL) mkdir:(NSString *) path; ++ (void) mkdir:(NSString *) path resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject; ++ (void) hash:(NSString *)path + algorithm:(NSString *)algorithm + resolver:(RCTPromiseResolveBlock)resolve + rejecter:(RCTPromiseRejectBlock)reject; ++ (NSDictionary *) stat:(NSString *) path error:(NSError **) error; ++ (void) exists:(NSString *) path callback:(RCTResponseSenderBlock)callback; ++ (void) writeFileArray:(NSString *)path data:(NSArray *)data append:(BOOL)append resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject; ++ (void) writeFile:(NSString *)path encoding:(NSString *)encoding data:(NSString *)data append:(BOOL)append resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject; ++ (void) readFile:(NSString *)path encoding:(NSString *)encoding onComplete:(void (^)(NSData * content, NSString* code, NSString * errMsg))onComplete; ++ (void) readAssetFile:(NSData *)assetUrl completionBlock:(void(^)(NSData * content))completionBlock failBlock:(void(^)(NSError * err))failBlock; ++ (void) slice:(NSString *)path + dest:(NSString *)dest + start:(nonnull NSNumber *)start + end:(nonnull NSNumber *)end + encode:(NSString *)encode + resolver:(RCTPromiseResolveBlock)resolve + rejecter:(RCTPromiseRejectBlock)reject; +//+ (void) writeFileFromFile:(NSString *)src toFile:(NSString *)dest append:(BOOL)append; ++ (void) writeAssetToPath:(ALAssetRepresentation * )rep dest:(NSString *)dest; ++ (void) readStream:(NSString *)uri encoding:(NSString * )encoding bufferSize:(int)bufferSize tick:(int)tick streamId:(NSString *)streamId bridgeRef:(RCTBridge *)bridgeRef; ++ (void) df:(RCTResponseSenderBlock)callback; + +// constructor +- (id) init; +- (id)initWithCallback:(RCTResponseSenderBlock)callback; +- (id)initWithBridgeRef:(RCTBridge *)bridgeRef; + +// file stream +- (void) openWithDestination; +- (NSString *)openWithPath:(NSString *)destPath encode:(nullable NSString *)encode appendData:(BOOL)append; + +// file stream write data +- (void)write:(NSData *) chunk; +- (void)writeEncodeChunk:(NSString *) chunk; + +- (void) closeInStream; +- (void) closeOutStream; + +- (void) openFile:( NSString * _Nonnull ) uri; + +@end + +#endif /* RNFetchBlobFS_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobNetwork.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobNetwork.h new file mode 100644 index 0000000..ff4cd9c --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobNetwork.h @@ -0,0 +1,50 @@ +// +// RNFetchBlobNetwork.h +// RNFetchBlob +// +// Created by wkh237 on 2016/6/6. +// Copyright © 2016 wkh237. All rights reserved. +// + +#ifndef RNFetchBlobNetwork_h +#define RNFetchBlobNetwork_h + +#import +#import "RNFetchBlobProgress.h" +#import "RNFetchBlobFS.h" +#import "RNFetchBlobRequest.h" + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + + +@interface RNFetchBlobNetwork : NSObject + +@property(nonnull, nonatomic) NSOperationQueue *taskQueue; +@property(nonnull, nonatomic) NSMapTable * requestsTable; +@property(nonnull, nonatomic) NSMutableDictionary *rebindProgressDict; +@property(nonnull, nonatomic) NSMutableDictionary *rebindUploadProgressDict; + ++ (RNFetchBlobNetwork* _Nullable)sharedInstance; ++ (NSMutableDictionary * _Nullable ) normalizeHeaders:(NSDictionary * _Nullable)headers; ++ (void) emitExpiredTasks; + +- (nullable id) init; +- (void) sendRequest:(NSDictionary * _Nullable )options + contentLength:(long)contentLength + bridge:(RCTBridge * _Nullable)bridgeRef + taskId:(NSString * _Nullable)taskId + withRequest:(NSURLRequest * _Nullable)req + callback:(_Nullable RCTResponseSenderBlock) callback; +- (void) cancelRequest:(NSString * _Nonnull)taskId; +- (void) enableProgressReport:(NSString * _Nonnull) taskId config:(RNFetchBlobProgress * _Nullable)config; +- (void) enableUploadProgress:(NSString * _Nonnull) taskId config:(RNFetchBlobProgress * _Nullable)config; + + +@end + + +#endif /* RNFetchBlobNetwork_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobProgress.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobProgress.h new file mode 100644 index 0000000..63f5cb4 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobProgress.h @@ -0,0 +1,39 @@ +// +// RNFetchBlobProgress.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/9/25. +// Copyright © 2016年 wkh237.github.io. All rights reserved. +// + +#ifndef RNFetchBlobProgress_h +#define RNFetchBlobProgress_h + +#import + +typedef NS_ENUM(NSUInteger, ProgressType) { + Download, + Upload, +}; + +@interface RNFetchBlobProgress : NSObject +{ + NSNumber * count; + NSNumber * interval; + ProgressType type; + BOOL enable; + +} + +@property (nonatomic) NSNumber * count; +@property (nonatomic) NSNumber * interval; +@property (nonatomic) NSInteger type; +@property (nonatomic) BOOL enable; + +-(id)initWithType:(ProgressType)type interval:(NSNumber*)interval count:(NSNumber *)count; +-(BOOL)shouldReport:(NSNumber *) nextProgress; + + +@end + +#endif /* RNFetchBlobProgress_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobReqBuilder.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobReqBuilder.h new file mode 100644 index 0000000..1edc3ff --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobReqBuilder.h @@ -0,0 +1,37 @@ +// +// RNFetchBlobReqBuilder.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/7/9. +// Copyright © 2016年 wkh237. All rights reserved. +// + +#ifndef RNFetchBlobReqBuilder_h +#define RNFetchBlobReqBuilder_h + +#import + +@interface RNFetchBlobReqBuilder : NSObject; + ++(void) buildMultipartRequest:(NSDictionary *)options + taskId:(NSString *)taskId + method:(NSString *)method + url:(NSString *)url + headers:(NSDictionary *)headers + form:(NSArray *)form + onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete; + ++(void) buildOctetRequest:(NSDictionary *)options + taskId:(NSString *)taskId + method:(NSString *)method + url:(NSString *)url + headers:(NSDictionary *)headers + body:(NSString *)body + onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete; + ++(NSString *) getHeaderIgnoreCases:(NSString *)field fromHeaders:(NSDictionary *) headers; + + +@end + +#endif /* RNFetchBlobReqBuilder_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobRequest.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobRequest.h new file mode 100644 index 0000000..b550ac2 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/Headers/RNFetchBlobRequest.h @@ -0,0 +1,47 @@ +// +// RNFetchBlobRequest.h +// RNFetchBlob +// +// Created by Artur Chrusciel on 15.01.18. +// Copyright © 2018 wkh237.github.io. All rights reserved. +// + +#ifndef RNFetchBlobRequest_h +#define RNFetchBlobRequest_h + +#import + +#import "RNFetchBlobProgress.h" + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + +@interface RNFetchBlobRequest : NSObject + +@property (nullable, nonatomic) NSString * taskId; +@property (nonatomic) long long expectedBytes; +@property (nonatomic) long long receivedBytes; +@property (nonatomic) BOOL isServerPush; +@property (nullable, nonatomic) NSMutableData * respData; +@property (nullable, strong, nonatomic) RCTResponseSenderBlock callback; +@property (nullable, nonatomic) RCTBridge * bridge; +@property (nullable, nonatomic) NSDictionary * options; +@property (nullable, nonatomic) NSError * error; +@property (nullable, nonatomic) RNFetchBlobProgress *progressConfig; +@property (nullable, nonatomic) RNFetchBlobProgress *uploadProgressConfig; +@property (nullable, nonatomic, weak) NSURLSessionDataTask *task; + +- (void) sendRequest:(NSDictionary * _Nullable )options + contentLength:(long)contentLength + bridge:(RCTBridge * _Nullable)bridgeRef + taskId:(NSString * _Nullable)taskId + withRequest:(NSURLRequest * _Nullable)req + taskOperationQueue:(NSOperationQueue * _Nonnull)operationQueue + callback:(_Nullable RCTResponseSenderBlock) callback; + +@end + +#endif /* RNFetchBlobRequest_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64/librn-fetch-blob.a b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/librn-fetch-blob.a new file mode 100644 index 0000000..7ea8193 Binary files /dev/null and b/Frameworks/rn-fetch-blob.xcframework/ios-arm64/librn-fetch-blob.a differ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/IOS7Polyfill.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/IOS7Polyfill.h new file mode 100644 index 0000000..04a4bfa --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/IOS7Polyfill.h @@ -0,0 +1,27 @@ +// +// IOS7Polyfill.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/9/6. +// Copyright © 2016年 wkh237.github.io. All rights reserved. +// + +#ifndef IOS7Polyfill_h +#define IOS7Polyfill_h + +@interface NSString (Contains) + +- (BOOL)RNFBContainsString:(NSString*)other; + +@end + +@implementation NSString (Contains) + +- (BOOL)RNFBContainsString:(NSString*)other { + NSRange range = [self rangeOfString:other]; + return range.length != 0; +} + + +@end +#endif /* IOS7Polyfill_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlob.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlob.h new file mode 100644 index 0000000..669a093 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlob.h @@ -0,0 +1,45 @@ +// +// RNFetchBlob.h +// +// Created by wkh237 on 2016/4/28. +// + +//XXX: DO NO REMOVE THIS LINE IF YOU'RE USING IT ON RN > 0.40 PROJECT + + + +#ifndef RNFetchBlob_h +#define RNFetchBlob_h + + +#if __has_include() +#import +#import +#import +#import +#import +#else +#import "RCTBridgeModule.h" +#import "RCTLog.h" +#import "RCTRootView.h" +#import "RCTBridge.h" +#import "RCTEventDispatcher.h" +#endif + +#import + + +@interface RNFetchBlob : NSObject { + + NSString * filePathPrefix; + +} + +@property (nonatomic) NSString * filePathPrefix; +@property (retain) UIDocumentInteractionController * documentController; + ++ (RCTBridge *)getRCTBridge; + +@end + +#endif /* RNFetchBlob_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobConst.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobConst.h new file mode 100644 index 0000000..6347b7a --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobConst.h @@ -0,0 +1,55 @@ +// +// RNFetchBlobConst.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/6/6. +// Copyright © 2016年 suzuri04x2. All rights reserved. +// + +#ifndef RNFetchBlobConst_h +#define RNFetchBlobConst_h + +#import + +// lib event +extern NSString *const MSG_EVENT; +extern NSString *const MSG_EVENT_LOG; +extern NSString *const MSG_EVENT_WARN; +extern NSString *const MSG_EVENT_ERROR; + +extern NSString *const EVENT_EXPIRE; +extern NSString *const EVENT_PROGRESS; +extern NSString *const EVENT_SERVER_PUSH; +extern NSString *const EVENT_PROGRESS_UPLOAD; +extern NSString *const EVENT_STATE_CHANGE; + +extern NSString *const FILE_PREFIX; +extern NSString *const ASSET_PREFIX; +extern NSString *const AL_PREFIX; + +// config +extern NSString *const CONFIG_USE_TEMP; +extern NSString *const CONFIG_FILE_PATH; +extern NSString *const CONFIG_FILE_EXT; +extern NSString *const CONFIG_TRUSTY; +extern NSString *const CONFIG_INDICATOR; +extern NSString *const CONFIG_KEY; +extern NSString *const CONFIG_EXTRA_BLOB_CTYPE; + +// fs events +extern NSString *const FS_EVENT_DATA; +extern NSString *const FS_EVENT_END; +extern NSString *const FS_EVENT_WARN; +extern NSString *const FS_EVENT_ERROR; + +extern NSString *const KEY_REPORT_PROGRESS; +extern NSString *const KEY_REPORT_UPLOAD_PROGRESS; + +// response type +extern NSString *const RESP_TYPE_BASE64; +extern NSString *const RESP_TYPE_UTF8; +extern NSString *const RESP_TYPE_PATH; + + + +#endif /* RNFetchBlobConst_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobFS.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobFS.h new file mode 100644 index 0000000..5141201 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobFS.h @@ -0,0 +1,109 @@ +// +// RNFetchBlobFS.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/6/6. +// Copyright © 2016年 suzuri04x2. All rights reserved. +// + +#ifndef RNFetchBlobFS_h +#define RNFetchBlobFS_h + +#import "RNFetchBlob.h" +#import + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + +@import AssetsLibrary; + +@interface RNFetchBlobFS : NSObject { + NSOutputStream * outStream; + NSInputStream * inStream; + RCTResponseSenderBlock callback; + RCTBridge * bridge; + Boolean isOpen; + NSString * encoding; + int bufferSize; + BOOL appendData; + NSString * taskId; + NSString * path; + NSString * streamId; +} + +@property (nonatomic) NSOutputStream * _Nullable outStream; +@property (nonatomic) NSInputStream * _Nullable inStream; +@property (strong, nonatomic) RCTResponseSenderBlock callback; +@property (nonatomic) RCTBridge * bridge; +@property (nonatomic) NSString * encoding; +@property (nonatomic) NSString * taskId; +@property (nonatomic) NSString * path; +@property (nonatomic) int bufferSize; +@property (nonatomic) NSString * streamId; +@property (nonatomic) BOOL appendData; + +// get dirs ++ (NSString *) getCacheDir; ++ (NSString *) getDocumentDir; ++ (NSString *) getDownloadDir; ++ (NSString *) getLibraryDir; ++ (NSString *) getMainBundleDir; ++ (NSString *) getMovieDir; ++ (NSString *) getMusicDir; ++ (NSString *) getPictureDir; ++ (NSString *) getTempPath; ++ (NSString *) getTempPath:(NSString*)taskId withExtension:(NSString *)ext; ++ (NSString *) getPathOfAsset:(NSString *)assetURI; ++ (NSString *) getPathForAppGroup:(NSString *)groupName; ++ (void) getPathFromUri:(NSString *)uri completionHandler:(void(^)(NSString * path, ALAssetRepresentation *asset)) onComplete; + +// fs methods ++ (RNFetchBlobFS *) getFileStreams; ++ (BOOL) mkdir:(NSString *) path; ++ (void) mkdir:(NSString *) path resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject; ++ (void) hash:(NSString *)path + algorithm:(NSString *)algorithm + resolver:(RCTPromiseResolveBlock)resolve + rejecter:(RCTPromiseRejectBlock)reject; ++ (NSDictionary *) stat:(NSString *) path error:(NSError **) error; ++ (void) exists:(NSString *) path callback:(RCTResponseSenderBlock)callback; ++ (void) writeFileArray:(NSString *)path data:(NSArray *)data append:(BOOL)append resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject; ++ (void) writeFile:(NSString *)path encoding:(NSString *)encoding data:(NSString *)data append:(BOOL)append resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject; ++ (void) readFile:(NSString *)path encoding:(NSString *)encoding onComplete:(void (^)(NSData * content, NSString* code, NSString * errMsg))onComplete; ++ (void) readAssetFile:(NSData *)assetUrl completionBlock:(void(^)(NSData * content))completionBlock failBlock:(void(^)(NSError * err))failBlock; ++ (void) slice:(NSString *)path + dest:(NSString *)dest + start:(nonnull NSNumber *)start + end:(nonnull NSNumber *)end + encode:(NSString *)encode + resolver:(RCTPromiseResolveBlock)resolve + rejecter:(RCTPromiseRejectBlock)reject; +//+ (void) writeFileFromFile:(NSString *)src toFile:(NSString *)dest append:(BOOL)append; ++ (void) writeAssetToPath:(ALAssetRepresentation * )rep dest:(NSString *)dest; ++ (void) readStream:(NSString *)uri encoding:(NSString * )encoding bufferSize:(int)bufferSize tick:(int)tick streamId:(NSString *)streamId bridgeRef:(RCTBridge *)bridgeRef; ++ (void) df:(RCTResponseSenderBlock)callback; + +// constructor +- (id) init; +- (id)initWithCallback:(RCTResponseSenderBlock)callback; +- (id)initWithBridgeRef:(RCTBridge *)bridgeRef; + +// file stream +- (void) openWithDestination; +- (NSString *)openWithPath:(NSString *)destPath encode:(nullable NSString *)encode appendData:(BOOL)append; + +// file stream write data +- (void)write:(NSData *) chunk; +- (void)writeEncodeChunk:(NSString *) chunk; + +- (void) closeInStream; +- (void) closeOutStream; + +- (void) openFile:( NSString * _Nonnull ) uri; + +@end + +#endif /* RNFetchBlobFS_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobNetwork.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobNetwork.h new file mode 100644 index 0000000..ff4cd9c --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobNetwork.h @@ -0,0 +1,50 @@ +// +// RNFetchBlobNetwork.h +// RNFetchBlob +// +// Created by wkh237 on 2016/6/6. +// Copyright © 2016 wkh237. All rights reserved. +// + +#ifndef RNFetchBlobNetwork_h +#define RNFetchBlobNetwork_h + +#import +#import "RNFetchBlobProgress.h" +#import "RNFetchBlobFS.h" +#import "RNFetchBlobRequest.h" + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + + +@interface RNFetchBlobNetwork : NSObject + +@property(nonnull, nonatomic) NSOperationQueue *taskQueue; +@property(nonnull, nonatomic) NSMapTable * requestsTable; +@property(nonnull, nonatomic) NSMutableDictionary *rebindProgressDict; +@property(nonnull, nonatomic) NSMutableDictionary *rebindUploadProgressDict; + ++ (RNFetchBlobNetwork* _Nullable)sharedInstance; ++ (NSMutableDictionary * _Nullable ) normalizeHeaders:(NSDictionary * _Nullable)headers; ++ (void) emitExpiredTasks; + +- (nullable id) init; +- (void) sendRequest:(NSDictionary * _Nullable )options + contentLength:(long)contentLength + bridge:(RCTBridge * _Nullable)bridgeRef + taskId:(NSString * _Nullable)taskId + withRequest:(NSURLRequest * _Nullable)req + callback:(_Nullable RCTResponseSenderBlock) callback; +- (void) cancelRequest:(NSString * _Nonnull)taskId; +- (void) enableProgressReport:(NSString * _Nonnull) taskId config:(RNFetchBlobProgress * _Nullable)config; +- (void) enableUploadProgress:(NSString * _Nonnull) taskId config:(RNFetchBlobProgress * _Nullable)config; + + +@end + + +#endif /* RNFetchBlobNetwork_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobProgress.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobProgress.h new file mode 100644 index 0000000..63f5cb4 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobProgress.h @@ -0,0 +1,39 @@ +// +// RNFetchBlobProgress.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/9/25. +// Copyright © 2016年 wkh237.github.io. All rights reserved. +// + +#ifndef RNFetchBlobProgress_h +#define RNFetchBlobProgress_h + +#import + +typedef NS_ENUM(NSUInteger, ProgressType) { + Download, + Upload, +}; + +@interface RNFetchBlobProgress : NSObject +{ + NSNumber * count; + NSNumber * interval; + ProgressType type; + BOOL enable; + +} + +@property (nonatomic) NSNumber * count; +@property (nonatomic) NSNumber * interval; +@property (nonatomic) NSInteger type; +@property (nonatomic) BOOL enable; + +-(id)initWithType:(ProgressType)type interval:(NSNumber*)interval count:(NSNumber *)count; +-(BOOL)shouldReport:(NSNumber *) nextProgress; + + +@end + +#endif /* RNFetchBlobProgress_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobReqBuilder.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobReqBuilder.h new file mode 100644 index 0000000..1edc3ff --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobReqBuilder.h @@ -0,0 +1,37 @@ +// +// RNFetchBlobReqBuilder.h +// RNFetchBlob +// +// Created by Ben Hsieh on 2016/7/9. +// Copyright © 2016年 wkh237. All rights reserved. +// + +#ifndef RNFetchBlobReqBuilder_h +#define RNFetchBlobReqBuilder_h + +#import + +@interface RNFetchBlobReqBuilder : NSObject; + ++(void) buildMultipartRequest:(NSDictionary *)options + taskId:(NSString *)taskId + method:(NSString *)method + url:(NSString *)url + headers:(NSDictionary *)headers + form:(NSArray *)form + onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete; + ++(void) buildOctetRequest:(NSDictionary *)options + taskId:(NSString *)taskId + method:(NSString *)method + url:(NSString *)url + headers:(NSDictionary *)headers + body:(NSString *)body + onComplete:(void(^)(NSURLRequest * req, long bodyLength))onComplete; + ++(NSString *) getHeaderIgnoreCases:(NSString *)field fromHeaders:(NSDictionary *) headers; + + +@end + +#endif /* RNFetchBlobReqBuilder_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobRequest.h b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobRequest.h new file mode 100644 index 0000000..b550ac2 --- /dev/null +++ b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/Headers/RNFetchBlobRequest.h @@ -0,0 +1,47 @@ +// +// RNFetchBlobRequest.h +// RNFetchBlob +// +// Created by Artur Chrusciel on 15.01.18. +// Copyright © 2018 wkh237.github.io. All rights reserved. +// + +#ifndef RNFetchBlobRequest_h +#define RNFetchBlobRequest_h + +#import + +#import "RNFetchBlobProgress.h" + +#if __has_include() +#import +#else +#import "RCTBridgeModule.h" +#endif + +@interface RNFetchBlobRequest : NSObject + +@property (nullable, nonatomic) NSString * taskId; +@property (nonatomic) long long expectedBytes; +@property (nonatomic) long long receivedBytes; +@property (nonatomic) BOOL isServerPush; +@property (nullable, nonatomic) NSMutableData * respData; +@property (nullable, strong, nonatomic) RCTResponseSenderBlock callback; +@property (nullable, nonatomic) RCTBridge * bridge; +@property (nullable, nonatomic) NSDictionary * options; +@property (nullable, nonatomic) NSError * error; +@property (nullable, nonatomic) RNFetchBlobProgress *progressConfig; +@property (nullable, nonatomic) RNFetchBlobProgress *uploadProgressConfig; +@property (nullable, nonatomic, weak) NSURLSessionDataTask *task; + +- (void) sendRequest:(NSDictionary * _Nullable )options + contentLength:(long)contentLength + bridge:(RCTBridge * _Nullable)bridgeRef + taskId:(NSString * _Nullable)taskId + withRequest:(NSURLRequest * _Nullable)req + taskOperationQueue:(NSOperationQueue * _Nonnull)operationQueue + callback:(_Nullable RCTResponseSenderBlock) callback; + +@end + +#endif /* RNFetchBlobRequest_h */ diff --git a/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/librn-fetch-blob.a b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/librn-fetch-blob.a new file mode 100644 index 0000000..ce65012 Binary files /dev/null and b/Frameworks/rn-fetch-blob.xcframework/ios-arm64_x86_64-simulator/librn-fetch-blob.a differ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..158ae1e --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +NON-FREE SOFTWARE LICENSE AGREEMENT + +This Non-Free Software License Agreement ("Agreement") is entered into between Tecnavia Press Inc. ("Licensor"), and the entity or individual using the Software ("Licensee"). + +LICENSE GRANT +Licensor grants to Licensee a non-exclusive, non-transferable, limited license to use the software package (the "Software") solely as embedded in an existing app, and only for Licensee's internal business purposes. Licensee may not modify, reverse engineer, decompile, or disassemble the Software, except to the extent that such activity is expressly permitted by applicable law. + +OWNERSHIP AND COPYRIGHT +The Software is the property of Licensor and is protected by copyright laws and international copyright treaties, as well as other intellectual property laws and treaties. Licensor retains all rights, title, and interest in and to the Software, including all intellectual property rights. + +TERM AND TERMINATION +This Agreement shall remain in effect until terminated by either party. Licensor may terminate this Agreement immediately if Licensee breaches any of the terms or conditions of this Agreement. Upon termination of this Agreement, Licensee shall immediately cease all use of the Software and shall delete or destroy all copies of the Software. + +WARRANTY DISCLAIMER +Licensor provides the Software "as is" and without warranty of any kind, express or implied, including, without limitation, any warranties of merchantability, fitness for a particular purpose, and non-infringement of third party rights. + +LIMITATION OF LIABILITY +Licensor shall not be liable for any direct, indirect, incidental, special, or consequential damages arising out of or relating to this Agreement or the use of the Software, even if Licensor has been advised of the possibility of such damages. + +GENERAL PROVISIONS +This Agreement constitutes the entire agreement between the parties and supersedes all prior negotiations, understandings, and agreements between the parties relating to the subject matter of this Agreement. This Agreement may not be modified except in writing signed by both parties. This Agreement shall be governed by and construed in accordance with the laws of the State of Minnesota without giving effect to its conflicts of law provisions. Any legal action or proceeding arising out of or relating to this Agreement shall be brought in the state or federal courts of Dakota County, Minnesota. If any provision of this Agreement is held to be invalid or unenforceable, such provision shall be struck and the remaining provisions shall be enforced. + +By using the Software, Licensee acknowledges that it has read this Agreement, understands it, and agrees to be bound by its terms and conditions. + +Tecnavia Press Inc. +March 1st, 2023 diff --git a/NewsmemorySDK.podspec b/NewsmemorySDK.podspec new file mode 100644 index 0000000..7d37ce0 --- /dev/null +++ b/NewsmemorySDK.podspec @@ -0,0 +1,50 @@ +Pod::Spec.new do |s| + s.name = 'NewsmemorySDK' + s.version = '3.10.05' + s.description = 'Components and configuration for Tecnavia Newsmemory ePaper solution SDK.' + s.summary = 'Components for Tecnavia Newsmemory SDK.' + s.homepage = 'https://www.tecnavia.com' + s.license = { type: 'Proprietary', file: 'LICENSE' } + s.author = { 'Nick Aquilini' => 'naquilini@tecnavia.com' } + s.source = { git: 'git@pubgit.newsmemory.com:tecnaviapress/newsmemory-ios-sdk.git', tag: "v#{s.version}" } + + + s.resources = 'Other/Resources/{Newsmemory.js,*.bundle,fonts/*.ttf,fonts/*.otf}', 'Other/assets' + s.platform = :ios, '11.0' + + + + s.libraries = "sqlite3", "sqlite3.0", "z" + s.vendored_frameworks = 'Frameworks/*.xcframework' + + s.dependency 'fmt', '~> 6.2.1' + s.dependency 'Google-Mobile-Ads-SDK', '~> 9.14.0' + s.dependency 'GoogleAppMeasurement', '~> 10.21.0' + s.dependency 'GoogleUserMessagingPlatform', '~> 2.1.0' + s.dependency 'GoogleUtilities', '~> 7.13.0' + s.dependency 'libwebp', '~> 1.2.1' + s.dependency 'nanopb', '~> 2.30908.0' + s.dependency 'PromisesObjC', '~> 2.4.0' + s.dependency 'SDWebImage', '~> 5.11.1' + s.dependency 'SDWebImageWebPCoder', '~> 0.8.4' + + s.framework = "AVFoundation", "AudioToolbox", "CFNetwork", "CoreGraphics", "CoreMedia", "CoreTelephony", "CoreText", "CoreVideo", "Foundation", "GoogleAppMeasurement", "GoogleAppMeasurementIdentitySupport", "GoogleMobileAds", "ImageIO", "JavaScriptCore", "MediaPlayer", "MessageUI", "MobileCoreServices", "QuartzCore", "Security", "StoreKit", "SystemConfiguration", "UIKit", "UserMessagingPlatform", "WebKit" + s.weak_frameworks = "AdSupport", "LinkPresentation", "SafariServices" + + s.user_target_xcconfig = { + 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES' => 'YES', + 'CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER' => 'NO', + 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1 $(inherited) SD_WEBP=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1', + 'HEADER_SEARCH_PATHS' => '$(inherited) ${TECNAVIA_FRAMEWORKS_DIR}/BVLinearGradient.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/DoubleConversion.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/DynamicFonts.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/FBReactNativeSpec.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/Newsmemory.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RCT-Folly.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RCTTypeSafety.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNCAsyncStorage.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNColorMatrixImageFilters.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNDateTimePicker.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNDefaultPreference.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNDeviceInfo.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNFS.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNFastImage.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNGestureHandler.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNIap.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNOpenAppSettings.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNReanimated.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNSVG.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNScreens.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNShare.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNTextSize.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNVectorIcons.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/RNVolumeController.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-Core.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-CoreModules.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTAnimation.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTBlob.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTImage.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTLinking.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTNetwork.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTSettings.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTText.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-RCTVibration.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-cxxreact.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-jsi.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-jsiexecutor.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-jsinspector.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-logger.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/React-perflogger.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/ReactCommon.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/ReactNativeART.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/ReactNativeDarkMode.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/TextToSpeech.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/Yoga.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/glog.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-bridge.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-cookies.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-dfp.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-geolocation.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-html-to-pdf.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-idle-timer.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-image-editor.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-image-marker.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-mail.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-netinfo.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-pager-view.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-pdf.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-photo-view-ex.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-print.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-safe-area-context.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-slider.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-splash-screen.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-sqlite-storage.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-uuid-generator.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-video.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-webview.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/react-native-zip-archive.xcframework/** ${TECNAVIA_FRAMEWORKS_DIR}/rn-fetch-blob.xcframework/**', + 'LIBRARY_SEARCH_PATHS' => '$(inherited) "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift', + 'OTHER_LDFLAGS' => '$(inherited) -ObjC -l"c++" -l"c++abi" -l"iconv" -l"sqlite3" -l"z"', + 'OTHER_SWIFT_FLAGS' => '$(inherited) -D COCOAPODS', + 'TECNAVIA_FRAMEWORKS_DIR' => '${PODS_ROOT}/${TECNAVIA_SDK_VERSION}/Frameworks', + 'TECNAVIA_SDK_VERSION' => 'NewsmemorySDK', + 'USER_HEADER_SEARCH_PATHS' => '$(inherited) ${PODS_ROOT}/libwebp/src', + 'USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES' => 'YES', + + } + + end + \ No newline at end of file diff --git a/Other/.DS_Store b/Other/.DS_Store new file mode 100644 index 0000000..2b92812 Binary files /dev/null and b/Other/.DS_Store differ diff --git a/Other/Resources/.DS_Store b/Other/Resources/.DS_Store new file mode 100644 index 0000000..ee8e0b3 Binary files /dev/null and b/Other/Resources/.DS_Store differ diff --git a/Other/Resources/AccessibilityResources.bundle/Info.plist b/Other/Resources/AccessibilityResources.bundle/Info.plist new file mode 100644 index 0000000..69eb877 Binary files /dev/null and b/Other/Resources/AccessibilityResources.bundle/Info.plist differ diff --git a/Other/Resources/AccessibilityResources.bundle/en.lproj/Localizable.strings b/Other/Resources/AccessibilityResources.bundle/en.lproj/Localizable.strings new file mode 100644 index 0000000..ee35fc3 --- /dev/null +++ b/Other/Resources/AccessibilityResources.bundle/en.lproj/Localizable.strings @@ -0,0 +1,26 @@ +/* + Localizable.strings + React +*/ +"alert"="alert"; +"checkbox"="checkbox"; +"combobox"="combo box"; +"menu"="menu"; +"menubar"="menu bar"; +"menuitem"="menu item"; +"progressbar"="progress bar"; +"radio"="radio button"; +"radiogroup"="radio group"; +"scrollbar"="scroll bar"; +"spinbutton"="spin button"; +"switch"="switch"; +"tab"="tab"; +"tablist"="tab list"; +"timer"="timer"; +"toolbar"="tool bar"; +"checked"="checked"; +"unchecked"="not checked"; +"busy"="busy"; +"expanded"="expanded"; +"collapsed"="collapsed"; +"mixed"="mixed"; diff --git a/Other/Resources/Newsmemory.js b/Other/Resources/Newsmemory.js new file mode 100644 index 0000000..a9d781f --- /dev/null +++ b/Other/Resources/Newsmemory.js @@ -0,0 +1,397942 @@ +var __BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=this.process||{},__METRO_GLOBAL_PREFIX__='';process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production"; +(function (global) { + "use strict"; + + global.__r = metroRequire; + global[__METRO_GLOBAL_PREFIX__ + "__d"] = define; + global.__c = clear; + global.__registerSegment = registerSegment; + var modules = clear(); + var EMPTY = {}; + var _ref = {}, + hasOwnProperty = _ref.hasOwnProperty; + + function clear() { + modules = Object.create(null); + return modules; + } + + function define(factory, moduleId, dependencyMap) { + if (modules[moduleId] != null) { + return; + } + + var mod = { + dependencyMap: dependencyMap, + factory: factory, + hasError: false, + importedAll: EMPTY, + importedDefault: EMPTY, + isInitialized: false, + publicModule: { + exports: {} + } + }; + modules[moduleId] = mod; + } + + function metroRequire(moduleId) { + var moduleIdReallyIsNumber = moduleId; + var module = modules[moduleIdReallyIsNumber]; + return module && module.isInitialized ? module.publicModule.exports : guardedLoadModule(moduleIdReallyIsNumber, module); + } + + function metroImportDefault(moduleId) { + var moduleIdReallyIsNumber = moduleId; + + if (modules[moduleIdReallyIsNumber] && modules[moduleIdReallyIsNumber].importedDefault !== EMPTY) { + return modules[moduleIdReallyIsNumber].importedDefault; + } + + var exports = metroRequire(moduleIdReallyIsNumber); + var importedDefault = exports && exports.__esModule ? exports.default : exports; + return modules[moduleIdReallyIsNumber].importedDefault = importedDefault; + } + + metroRequire.importDefault = metroImportDefault; + + function metroImportAll(moduleId) { + var moduleIdReallyIsNumber = moduleId; + + if (modules[moduleIdReallyIsNumber] && modules[moduleIdReallyIsNumber].importedAll !== EMPTY) { + return modules[moduleIdReallyIsNumber].importedAll; + } + + var exports = metroRequire(moduleIdReallyIsNumber); + var importedAll; + + if (exports && exports.__esModule) { + importedAll = exports; + } else { + importedAll = {}; + + if (exports) { + for (var key in exports) { + if (hasOwnProperty.call(exports, key)) { + importedAll[key] = exports[key]; + } + } + } + + importedAll.default = exports; + } + + return modules[moduleIdReallyIsNumber].importedAll = importedAll; + } + + metroRequire.importAll = metroImportAll; + var inGuard = false; + + function guardedLoadModule(moduleId, module) { + if (!inGuard && global.ErrorUtils) { + inGuard = true; + var returnValue; + + try { + returnValue = loadModuleImplementation(moduleId, module); + } catch (e) { + global.ErrorUtils.reportFatalError(e); + } + + inGuard = false; + return returnValue; + } else { + return loadModuleImplementation(moduleId, module); + } + } + + var ID_MASK_SHIFT = 16; + var LOCAL_ID_MASK = 65535; + + function unpackModuleId(moduleId) { + var segmentId = moduleId >>> ID_MASK_SHIFT; + var localId = moduleId & LOCAL_ID_MASK; + return { + segmentId: segmentId, + localId: localId + }; + } + + metroRequire.unpackModuleId = unpackModuleId; + + function packModuleId(value) { + return (value.segmentId << ID_MASK_SHIFT) + value.localId; + } + + metroRequire.packModuleId = packModuleId; + var moduleDefinersBySegmentID = []; + var definingSegmentByModuleID = new Map(); + + function registerSegment(segmentId, moduleDefiner, moduleIds) { + moduleDefinersBySegmentID[segmentId] = moduleDefiner; + + if (moduleIds) { + moduleIds.forEach(function (moduleId) { + if (!modules[moduleId] && !definingSegmentByModuleID.has(moduleId)) { + definingSegmentByModuleID.set(moduleId, segmentId); + } + }); + } + } + + function loadModuleImplementation(moduleId, module) { + if (!module && moduleDefinersBySegmentID.length > 0) { + var _definingSegmentByMod; + + var segmentId = (_definingSegmentByMod = definingSegmentByModuleID.get(moduleId)) !== null && _definingSegmentByMod !== undefined ? _definingSegmentByMod : 0; + var definer = moduleDefinersBySegmentID[segmentId]; + + if (definer != null) { + definer(moduleId); + module = modules[moduleId]; + definingSegmentByModuleID.delete(moduleId); + } + } + + var nativeRequire = global.nativeRequire; + + if (!module && nativeRequire) { + var _unpackModuleId = unpackModuleId(moduleId), + _segmentId = _unpackModuleId.segmentId, + localId = _unpackModuleId.localId; + + nativeRequire(localId, _segmentId); + module = modules[moduleId]; + } + + if (!module) { + throw unknownModuleError(moduleId); + } + + if (module.hasError) { + throw moduleThrewError(moduleId, module.error); + } + + module.isInitialized = true; + var _module = module, + factory = _module.factory, + dependencyMap = _module.dependencyMap; + + try { + var moduleObject = module.publicModule; + moduleObject.id = moduleId; + factory(global, metroRequire, metroImportDefault, metroImportAll, moduleObject, moduleObject.exports, dependencyMap); + { + module.factory = undefined; + module.dependencyMap = undefined; + } + return moduleObject.exports; + } catch (e) { + module.hasError = true; + module.error = e; + module.isInitialized = false; + module.publicModule.exports = undefined; + throw e; + } finally {} + } + + function unknownModuleError(id) { + var message = 'Requiring unknown module "' + id + '".'; + return Error(message); + } + + function moduleThrewError(id, error) { + var displayName = id; + return Error('Requiring module "' + displayName + '", which threw an exception: ' + error); + } +})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this); +(function (global) { + var inspect = function () { + function inspect(obj, opts) { + var ctx = { + seen: [], + formatValueCalls: 0, + stylize: stylizeNoColor + }; + return formatValue(ctx, obj, opts.depth); + } + + function stylizeNoColor(str, styleType) { + return str; + } + + function arrayToHash(array) { + var hash = {}; + array.forEach(function (val, idx) { + hash[val] = true; + }); + return hash; + } + + function formatValue(ctx, value, recurseTimes) { + ctx.formatValueCalls++; + + if (ctx.formatValueCalls > 200) { + return "[TOO BIG formatValueCalls " + ctx.formatValueCalls + " exceeded limit of 200]"; + } + + var primitive = formatPrimitive(ctx, value); + + if (primitive) { + return primitive; + } + + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + + if (isError(value)) { + return formatError(value); + } + } + + var base = '', + array = false, + braces = ['{', '}']; + + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + var output; + + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function (key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + return reduceToSingleString(output, base, braces); + } + + function formatPrimitive(ctx, value) { + if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); + + if (isString(value)) { + var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; + return ctx.stylize(simple, 'string'); + } + + if (isNumber(value)) return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); + if (isNull(value)) return ctx.stylize('null', 'null'); + } + + function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; + } + + function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); + } else { + output.push(''); + } + } + + keys.forEach(function (key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); + } + }); + return output; + } + + function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { + value: value[key] + }; + + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function (line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + + name = JSON.stringify('' + key); + + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; + } + + function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function (prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; + } + + function isArray(ar) { + return Array.isArray(ar); + } + + function isBoolean(arg) { + return typeof arg === 'boolean'; + } + + function isNull(arg) { + return arg === null; + } + + function isNumber(arg) { + return typeof arg === 'number'; + } + + function isString(arg) { + return typeof arg === 'string'; + } + + function isUndefined(arg) { + return arg === undefined; + } + + function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; + } + + function isObject(arg) { + return typeof arg === 'object' && arg !== null; + } + + function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; + } + + function isError(e) { + return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); + } + + function isFunction(arg) { + return typeof arg === 'function'; + } + + function objectToString(o) { + return Object.prototype.toString.call(o); + } + + function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + return inspect; + }(); + + var OBJECT_COLUMN_NAME = '(index)'; + var LOG_LEVELS = { + trace: 0, + info: 1, + warn: 2, + error: 3 + }; + var INSPECTOR_LEVELS = []; + INSPECTOR_LEVELS[LOG_LEVELS.trace] = 'debug'; + INSPECTOR_LEVELS[LOG_LEVELS.info] = 'log'; + INSPECTOR_LEVELS[LOG_LEVELS.warn] = 'warning'; + INSPECTOR_LEVELS[LOG_LEVELS.error] = 'error'; + var INSPECTOR_FRAMES_TO_SKIP = 1; + + function getNativeLogFunction(level) { + return function () { + var str; + + if (arguments.length === 1 && typeof arguments[0] === 'string') { + str = arguments[0]; + } else { + str = Array.prototype.map.call(arguments, function (arg) { + return inspect(arg, { + depth: 10 + }); + }).join(', '); + } + + var firstArg = arguments[0]; + var logLevel = level; + + if (typeof firstArg === 'string' && firstArg.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) { + logLevel = LOG_LEVELS.warn; + } + + if (global.__inspectorLog) { + global.__inspectorLog(INSPECTOR_LEVELS[logLevel], str, [].slice.call(arguments), INSPECTOR_FRAMES_TO_SKIP); + } + + if (groupStack.length) { + str = groupFormat('', str); + } + + global.nativeLoggingHook(str, logLevel); + }; + } + + function repeat(element, n) { + return Array.apply(null, Array(n)).map(function () { + return element; + }); + } + + function consoleTablePolyfill(rows) { + if (!Array.isArray(rows)) { + var data = rows; + rows = []; + + for (var key in data) { + if (data.hasOwnProperty(key)) { + var row = data[key]; + row[OBJECT_COLUMN_NAME] = key; + rows.push(row); + } + } + } + + if (rows.length === 0) { + global.nativeLoggingHook('', LOG_LEVELS.info); + return; + } + + var columns = Object.keys(rows[0]).sort(); + var stringRows = []; + var columnWidths = []; + columns.forEach(function (k, i) { + columnWidths[i] = k.length; + + for (var j = 0; j < rows.length; j++) { + var cellStr = (rows[j][k] || '?').toString(); + stringRows[j] = stringRows[j] || []; + stringRows[j][i] = cellStr; + columnWidths[i] = Math.max(columnWidths[i], cellStr.length); + } + }); + + function joinRow(row, space) { + var cells = row.map(function (cell, i) { + var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join(''); + return cell + extraSpaces; + }); + space = space || ' '; + return cells.join(space + '|' + space); + } + + var separators = columnWidths.map(function (columnWidth) { + return repeat('-', columnWidth).join(''); + }); + var separatorRow = joinRow(separators, '-'); + var header = joinRow(columns); + var table = [header, separatorRow]; + + for (var i = 0; i < rows.length; i++) { + table.push(joinRow(stringRows[i])); + } + + global.nativeLoggingHook('\n' + table.join('\n'), LOG_LEVELS.info); + } + + var GROUP_PAD = "\u2502"; + var GROUP_OPEN = "\u2510"; + var GROUP_CLOSE = "\u2518"; + var groupStack = []; + + function groupFormat(prefix, msg) { + return groupStack.join('') + prefix + ' ' + (msg || ''); + } + + function consoleGroupPolyfill(label) { + global.nativeLoggingHook(groupFormat(GROUP_OPEN, label), LOG_LEVELS.info); + groupStack.push(GROUP_PAD); + } + + function consoleGroupCollapsedPolyfill(label) { + global.nativeLoggingHook(groupFormat(GROUP_CLOSE, label), LOG_LEVELS.info); + groupStack.push(GROUP_PAD); + } + + function consoleGroupEndPolyfill() { + groupStack.pop(); + global.nativeLoggingHook(groupFormat(GROUP_CLOSE), LOG_LEVELS.info); + } + + function consoleAssertPolyfill(expression, label) { + if (!expression) { + global.nativeLoggingHook('Assertion failed: ' + label, LOG_LEVELS.error); + } + } + + if (global.nativeLoggingHook) { + var originalConsole = global.console; + global.console = { + error: getNativeLogFunction(LOG_LEVELS.error), + info: getNativeLogFunction(LOG_LEVELS.info), + log: getNativeLogFunction(LOG_LEVELS.info), + warn: getNativeLogFunction(LOG_LEVELS.warn), + trace: getNativeLogFunction(LOG_LEVELS.trace), + debug: getNativeLogFunction(LOG_LEVELS.trace), + table: consoleTablePolyfill, + group: consoleGroupPolyfill, + groupEnd: consoleGroupEndPolyfill, + groupCollapsed: consoleGroupCollapsedPolyfill, + assert: consoleAssertPolyfill + }; + Object.defineProperty(console, '_isPolyfilled', { + value: true, + enumerable: false + }); + } else if (!global.console) { + function stub() {} + + var log = global.print || stub; + global.console = { + debug: log, + error: log, + info: log, + log: log, + trace: log, + warn: log, + assert: function assert(expression, label) { + if (!expression) { + log('Assertion failed: ' + label); + } + }, + clear: stub, + dir: stub, + dirxml: stub, + group: stub, + groupCollapsed: stub, + groupEnd: stub, + profile: stub, + profileEnd: stub, + table: stub + }; + Object.defineProperty(console, '_isPolyfilled', { + value: true, + enumerable: false + }); + } +})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this); +(function (global) { + var _inGuard = 0; + + var _globalHandler = function onError(e, isFatal) { + throw e; + }; + + var ErrorUtils = { + setGlobalHandler: function setGlobalHandler(fun) { + _globalHandler = fun; + }, + getGlobalHandler: function getGlobalHandler() { + return _globalHandler; + }, + reportError: function reportError(error) { + _globalHandler && _globalHandler(error, false); + }, + reportFatalError: function reportFatalError(error) { + _globalHandler && _globalHandler(error, true); + }, + applyWithGuard: function applyWithGuard(fun, context, args, unused_onError, unused_name) { + try { + _inGuard++; + return fun.apply(context, args); + } catch (e) { + ErrorUtils.reportError(e); + } finally { + _inGuard--; + } + + return null; + }, + applyWithGuardIfNeeded: function applyWithGuardIfNeeded(fun, context, args) { + if (ErrorUtils.inGuard()) { + return fun.apply(context, args); + } else { + ErrorUtils.applyWithGuard(fun, context, args); + } + + return null; + }, + inGuard: function inGuard() { + return !!_inGuard; + }, + guard: function guard(fun, name, context) { + var _ref; + + if (typeof fun !== 'function') { + console.warn('A function must be passed to ErrorUtils.guard, got ', fun); + return null; + } + + var guardName = (_ref = name != null ? name : fun.name) != null ? _ref : ''; + + function guarded() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return ErrorUtils.applyWithGuard(fun, context != null ? context : this, args, null, guardName); + } + + return guarded; + } + }; + global.ErrorUtils = ErrorUtils; +})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this); +(function (global) { + (function () { + 'use strict'; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + + if (typeof Object.entries !== 'function') { + Object.entries = function (object) { + if (object == null) { + throw new TypeError('Object.entries called on non-object'); + } + + var entries = []; + + for (var key in object) { + if (hasOwnProperty.call(object, key)) { + entries.push([key, object[key]]); + } + } + + return entries; + }; + } + + if (typeof Object.values !== 'function') { + Object.values = function (object) { + if (object == null) { + throw new TypeError('Object.values called on non-object'); + } + + var values = []; + + for (var key in object) { + if (hasOwnProperty.call(object, key)) { + values.push(object[key]); + } + } + + return values; + }; + } + })(); +})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + _$$_REQUIRE(_dependencyMap[0]); + + _$$_REQUIRE(_dependencyMap[1]); + + _$$_REQUIRE(_dependencyMap[2]); +},0,[1,428,2133]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "Directions", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).Directions; + } + }); + Object.defineProperty(exports, "State", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).State; + } + }); + Object.defineProperty(exports, "gestureHandlerRootHOC", { + enumerable: true, + get: function get() { + return _gestureHandlerRootHOC.default; + } + }); + Object.defineProperty(exports, "GestureHandlerRootView", { + enumerable: true, + get: function get() { + return _GestureHandlerRootView.default; + } + }); + Object.defineProperty(exports, "TapGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).TapGestureHandler; + } + }); + Object.defineProperty(exports, "ForceTouchGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).ForceTouchGestureHandler; + } + }); + Object.defineProperty(exports, "LongPressGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).LongPressGestureHandler; + } + }); + Object.defineProperty(exports, "PanGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).PanGestureHandler; + } + }); + Object.defineProperty(exports, "PinchGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).PinchGestureHandler; + } + }); + Object.defineProperty(exports, "RotationGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).RotationGestureHandler; + } + }); + Object.defineProperty(exports, "FlingGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).FlingGestureHandler; + } + }); + Object.defineProperty(exports, "createNativeWrapper", { + enumerable: true, + get: function get() { + return _createNativeWrapper.default; + } + }); + Object.defineProperty(exports, "NativeViewGestureHandler", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).NativeViewGestureHandler; + } + }); + Object.defineProperty(exports, "RawButton", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[4]).RawButton; + } + }); + Object.defineProperty(exports, "BaseButton", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[4]).BaseButton; + } + }); + Object.defineProperty(exports, "RectButton", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[4]).RectButton; + } + }); + Object.defineProperty(exports, "BorderlessButton", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[4]).BorderlessButton; + } + }); + Object.defineProperty(exports, "TouchableHighlight", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[5]).TouchableHighlight; + } + }); + Object.defineProperty(exports, "TouchableNativeFeedback", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[5]).TouchableNativeFeedback; + } + }); + Object.defineProperty(exports, "TouchableOpacity", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[5]).TouchableOpacity; + } + }); + Object.defineProperty(exports, "TouchableWithoutFeedback", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[5]).TouchableWithoutFeedback; + } + }); + Object.defineProperty(exports, "ScrollView", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[6]).ScrollView; + } + }); + Object.defineProperty(exports, "Switch", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[6]).Switch; + } + }); + Object.defineProperty(exports, "TextInput", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[6]).TextInput; + } + }); + Object.defineProperty(exports, "DrawerLayoutAndroid", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[6]).DrawerLayoutAndroid; + } + }); + Object.defineProperty(exports, "FlatList", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[6]).FlatList; + } + }); + Object.defineProperty(exports, "Swipeable", { + enumerable: true, + get: function get() { + return _Swipeable.default; + } + }); + Object.defineProperty(exports, "DrawerLayout", { + enumerable: true, + get: function get() { + return _DrawerLayout.default; + } + }); + + var _gestureHandlerRootHOC = _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[8])); + + var _GestureHandlerRootView = _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[9])); + + var _createNativeWrapper = _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[10])); + + var _Swipeable = _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[11])); + + var _DrawerLayout = _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[12])); +},1,[2,3,4,410,411,414,420,5,421,425,412,426,427]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Directions = undefined; + var Directions = { + RIGHT: 1, + LEFT: 2, + UP: 4, + DOWN: 8 + }; + exports.Directions = Directions; +},2,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.State = undefined; + var State = { + UNDETERMINED: 0, + FAILED: 1, + BEGAN: 2, + CANCELLED: 3, + ACTIVE: 4, + END: 5 + }; + exports.State = State; +},3,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RotationGestureHandler = exports.PinchGestureHandler = exports.PanGestureHandler = exports.LongPressGestureHandler = exports.ForceTouchGestureHandler = exports.FlingGestureHandler = exports.TapGestureHandler = exports.baseProps = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _createHandler = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _PlatformConstants = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var baseProps = ['id', 'enabled', 'minPointers', 'waitFor', 'simultaneousHandlers', 'shouldCancelWhenOutside', 'hitSlop', 'onBegan', 'onFailed', 'onCancelled', 'onActivated', 'onEnded', 'onGestureEvent', 'onHandlerStateChange']; + exports.baseProps = baseProps; + var TapGestureHandler = (0, _createHandler.default)({ + name: 'TapGestureHandler', + allowedProps: [].concat(baseProps, ['maxDurationMs', 'maxDelayMs', 'numberOfTaps', 'maxDeltaX', 'maxDeltaY', 'maxDist', 'minPointers']), + config: {} + }); + exports.TapGestureHandler = TapGestureHandler; + var FlingGestureHandler = (0, _createHandler.default)({ + name: 'FlingGestureHandler', + allowedProps: [].concat(baseProps, ['numberOfPointers', 'direction']), + config: {} + }); + exports.FlingGestureHandler = FlingGestureHandler; + + var ForceTouchFallback = function (_React$Component) { + (0, _inherits2.default)(ForceTouchFallback, _React$Component); + + var _super = _createSuper(ForceTouchFallback); + + function ForceTouchFallback() { + (0, _classCallCheck2.default)(this, ForceTouchFallback); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(ForceTouchFallback, [{ + key: "componentDidMount", + value: function componentDidMount() { + console.warn('ForceTouchGestureHandler is not available on this platform. Please use ForceTouchGestureHandler.forceTouchAvailable to conditionally render other components that would provide a fallback behavior specific to your usecase'); + } + }, { + key: "render", + value: function render() { + return this.props.children; + } + }]); + return ForceTouchFallback; + }(React.Component); + + ForceTouchFallback.forceTouchAvailable = false; + var ForceTouchGestureHandler = _PlatformConstants.default != null && _PlatformConstants.default.forceTouchAvailable ? (0, _createHandler.default)({ + name: 'ForceTouchGestureHandler', + allowedProps: [].concat(baseProps, ['minForce', 'maxForce', 'feedbackOnActivation']), + config: {} + }) : ForceTouchFallback; + exports.ForceTouchGestureHandler = ForceTouchGestureHandler; + ForceTouchGestureHandler.forceTouchAvailable = (_PlatformConstants.default == null ? undefined : _PlatformConstants.default.forceTouchAvailable) || false; + var LongPressGestureHandler = (0, _createHandler.default)({ + name: 'LongPressGestureHandler', + allowedProps: [].concat(baseProps, ['minDurationMs', 'maxDist']), + config: {} + }); + exports.LongPressGestureHandler = LongPressGestureHandler; + + function transformPanGestureHandlerProps(props) { + var res = (0, _extends2.default)({}, props); + + if (props.minDeltaX !== undefined) { + delete res.minDeltaX; + res.activeOffsetXStart = -props.minDeltaX; + res.activeOffsetXEnd = props.minDeltaX; + } + + if (props.maxDeltaX !== undefined) { + delete res.maxDeltaX; + res.failOffsetXStart = -props.maxDeltaX; + res.failOffsetXEnd = props.maxDeltaX; + } + + if (props.minOffsetX !== undefined) { + delete res.minOffsetX; + + if (props.minOffsetX < 0) { + res.activeOffsetXStart = props.minOffsetX; + } else { + res.activeOffsetXEnd = props.minOffsetX; + } + } + + if (props.minDeltaY !== undefined) { + delete res.minDeltaY; + res.activeOffsetYStart = -props.minDeltaY; + res.activeOffsetYEnd = props.minDeltaY; + } + + if (props.maxDeltaY !== undefined) { + delete res.maxDeltaY; + res.failOffsetYStart = -props.maxDeltaY; + res.failOffsetYEnd = props.maxDeltaY; + } + + if (props.minOffsetY !== undefined) { + delete res.minOffsetY; + + if (props.minOffsetY < 0) { + res.activeOffsetYStart = props.minOffsetY; + } else { + res.activeOffsetYEnd = props.minOffsetY; + } + } + + if (props.activeOffsetX !== undefined) { + delete res.activeOffsetX; + + if (Array.isArray(props.activeOffsetX)) { + res.activeOffsetXStart = props.activeOffsetX[0]; + res.activeOffsetXEnd = props.activeOffsetX[1]; + } else if (props.activeOffsetX < 0) { + res.activeOffsetXStart = props.activeOffsetX; + } else { + res.activeOffsetXEnd = props.activeOffsetX; + } + } + + if (props.activeOffsetY !== undefined) { + delete res.activeOffsetY; + + if (Array.isArray(props.activeOffsetY)) { + res.activeOffsetYStart = props.activeOffsetY[0]; + res.activeOffsetYEnd = props.activeOffsetY[1]; + } else if (props.activeOffsetY < 0) { + res.activeOffsetYStart = props.activeOffsetY; + } else { + res.activeOffsetYEnd = props.activeOffsetY; + } + } + + if (props.failOffsetX !== undefined) { + delete res.failOffsetX; + + if (Array.isArray(props.failOffsetX)) { + res.failOffsetXStart = props.failOffsetX[0]; + res.failOffsetXEnd = props.failOffsetX[1]; + } else if (props.failOffsetX < 0) { + res.failOffsetXStart = props.failOffsetX; + } else { + res.failOffsetXEnd = props.failOffsetX; + } + } + + if (props.failOffsetY !== undefined) { + delete res.failOffsetY; + + if (Array.isArray(props.failOffsetY)) { + res.failOffsetYStart = props.failOffsetY[0]; + res.failOffsetYEnd = props.failOffsetY[1]; + } else if (props.failOffsetY < 0) { + res.failOffsetYStart = props.failOffsetY; + } else { + res.failOffsetYEnd = props.failOffsetY; + } + } + + return res; + } + + function managePanProps(props) { + return transformPanGestureHandlerProps(props); + } + + var PanGestureHandler = (0, _createHandler.default)({ + name: 'PanGestureHandler', + allowedProps: [].concat(baseProps, ['activeOffsetY', 'activeOffsetX', 'failOffsetY', 'failOffsetX', 'minDist', 'minVelocity', 'minVelocityX', 'minVelocityY', 'minPointers', 'maxPointers', 'avgTouches', 'enableTrackpadTwoFingerGesture']), + config: {}, + transformProps: managePanProps, + customNativeProps: ['activeOffsetYStart', 'activeOffsetYEnd', 'activeOffsetXStart', 'activeOffsetXEnd', 'failOffsetYStart', 'failOffsetYEnd', 'failOffsetXStart', 'failOffsetXEnd'] + }); + exports.PanGestureHandler = PanGestureHandler; + var PinchGestureHandler = (0, _createHandler.default)({ + name: 'PinchGestureHandler', + allowedProps: baseProps, + config: {} + }); + exports.PinchGestureHandler = PinchGestureHandler; + var RotationGestureHandler = (0, _createHandler.default)({ + name: 'RotationGestureHandler', + allowedProps: baseProps, + config: {} + }); + exports.RotationGestureHandler = RotationGestureHandler; +},4,[5,6,7,8,12,14,16,17,20,409]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { + "default": obj + }; + } + + module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; +},5,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _extends() { + module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + return _extends.apply(this, arguments); + } + + module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; +},6,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + } + + module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; +},7,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, _$$_REQUIRE(_dependencyMap[0])(descriptor.key), descriptor); + } + } + + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) _defineProperties(Constructor.prototype, protoProps); + if (staticProps) _defineProperties(Constructor, staticProps); + Object.defineProperty(Constructor, "prototype", { + writable: false + }); + return Constructor; + } + + module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; +},8,[9]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function toPropertyKey(t) { + var i = _$$_REQUIRE(_dependencyMap[0])(t, "string"); + + return "symbol" == _$$_REQUIRE(_dependencyMap[1])["default"](i) ? i : String(i); + } + + module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; +},9,[10,11]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function toPrimitive(t, r) { + if ("object" != _$$_REQUIRE(_dependencyMap[0])["default"](t) || !t) return t; + var e = t[Symbol.toPrimitive]; + + if (undefined !== e) { + var i = e.call(t, r || "default"); + if ("object" != _$$_REQUIRE(_dependencyMap[0])["default"](i)) return i; + throw new TypeError("@@toPrimitive must return a primitive value."); + } + + return ("string" === r ? String : Number)(t); + } + + module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; +},10,[11]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _typeof(o) { + "@babel/helpers - typeof"; + + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { + return typeof o; + } : function (o) { + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o); + } + + module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; +},11,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function"); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + writable: true, + configurable: true + } + }); + Object.defineProperty(subClass, "prototype", { + writable: false + }); + if (superClass) _$$_REQUIRE(_dependencyMap[0])(subClass, superClass); + } + + module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; +},12,[13]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _setPrototypeOf(o, p) { + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { + o.__proto__ = p; + return o; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + return _setPrototypeOf(o, p); + } + + module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; +},13,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _possibleConstructorReturn(self, call) { + if (call && (_$$_REQUIRE(_dependencyMap[0])["default"](call) === "object" || typeof call === "function")) { + return call; + } else if (call !== undefined) { + throw new TypeError("Derived constructors may only return object or undefined"); + } + + return _$$_REQUIRE(_dependencyMap[1])(self); + } + + module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; +},14,[11,15]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _assertThisInitialized(self) { + if (self === undefined) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return self; + } + + module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; +},15,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _getPrototypeOf(o) { + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { + return o.__proto__ || Object.getPrototypeOf(o); + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + return _getPrototypeOf(o); + } + + module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; +},16,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + { + module.exports = _$$_REQUIRE(_dependencyMap[0]); + } +},17,[18]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** @license React v17.0.2 + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + 'use strict'; + + var n = 60103, + p = 60106; + exports.Fragment = 60107; + exports.StrictMode = 60108; + exports.Profiler = 60114; + var q = 60109, + r = 60110, + t = 60112; + exports.Suspense = 60113; + var u = 60115, + v = 60116; + + if ("function" === typeof Symbol && Symbol.for) { + var w = Symbol.for; + n = w("react.element"); + p = w("react.portal"); + exports.Fragment = w("react.fragment"); + exports.StrictMode = w("react.strict_mode"); + exports.Profiler = w("react.profiler"); + q = w("react.provider"); + r = w("react.context"); + t = w("react.forward_ref"); + exports.Suspense = w("react.suspense"); + u = w("react.memo"); + v = w("react.lazy"); + } + + var x = "function" === typeof Symbol && Symbol.iterator; + + function y(a) { + if (null === a || "object" !== typeof a) return null; + a = x && a[x] || a["@@iterator"]; + return "function" === typeof a ? a : null; + } + + function z(a) { + for (var b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a, c = 1; c < arguments.length; c++) { + b += "&args[]=" + encodeURIComponent(arguments[c]); + } + + return "Minified React error #" + a + "; visit " + b + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings."; + } + + var A = { + isMounted: function isMounted() { + return false; + }, + enqueueForceUpdate: function enqueueForceUpdate() {}, + enqueueReplaceState: function enqueueReplaceState() {}, + enqueueSetState: function enqueueSetState() {} + }, + B = {}; + + function C(a, b, c) { + this.props = a; + this.context = b; + this.refs = B; + this.updater = c || A; + } + + C.prototype.isReactComponent = {}; + + C.prototype.setState = function (a, b) { + if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error(z(85)); + this.updater.enqueueSetState(this, a, b, "setState"); + }; + + C.prototype.forceUpdate = function (a) { + this.updater.enqueueForceUpdate(this, a, "forceUpdate"); + }; + + function D() {} + + D.prototype = C.prototype; + + function E(a, b, c) { + this.props = a; + this.context = b; + this.refs = B; + this.updater = c || A; + } + + var F = E.prototype = new D(); + F.constructor = E; + + _$$_REQUIRE(_dependencyMap[0])(F, C.prototype); + + F.isPureReactComponent = true; + var G = { + current: null + }, + H = Object.prototype.hasOwnProperty, + I = { + key: true, + ref: true, + __self: true, + __source: true + }; + + function J(a, b, c) { + var e, + d = {}, + k = null, + h = null; + if (null != b) for (e in undefined !== b.ref && (h = b.ref), undefined !== b.key && (k = "" + b.key), b) { + H.call(b, e) && !I.hasOwnProperty(e) && (d[e] = b[e]); + } + var g = arguments.length - 2; + if (1 === g) d.children = c;else if (1 < g) { + for (var f = Array(g), m = 0; m < g; m++) { + f[m] = arguments[m + 2]; + } + + d.children = f; + } + if (a && a.defaultProps) for (e in g = a.defaultProps, g) { + undefined === d[e] && (d[e] = g[e]); + } + return { + $$typeof: n, + type: a, + key: k, + ref: h, + props: d, + _owner: G.current + }; + } + + function K(a, b) { + return { + $$typeof: n, + type: a.type, + key: b, + ref: a.ref, + props: a.props, + _owner: a._owner + }; + } + + function L(a) { + return "object" === typeof a && null !== a && a.$$typeof === n; + } + + function escape(a) { + var b = { + "=": "=0", + ":": "=2" + }; + return "$" + a.replace(/[=:]/g, function (a) { + return b[a]; + }); + } + + var M = /\/+/g; + + function N(a, b) { + return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36); + } + + function O(a, b, c, e, d) { + var k = typeof a; + if ("undefined" === k || "boolean" === k) a = null; + var h = false; + if (null === a) h = true;else switch (k) { + case "string": + case "number": + h = true; + break; + + case "object": + switch (a.$$typeof) { + case n: + case p: + h = true; + } + + } + if (h) return h = a, d = d(h), a = "" === e ? "." + N(h, 0) : e, Array.isArray(d) ? (c = "", null != a && (c = a.replace(M, "$&/") + "/"), O(d, b, c, "", function (a) { + return a; + })) : null != d && (L(d) && (d = K(d, c + (!d.key || h && h.key === d.key ? "" : ("" + d.key).replace(M, "$&/") + "/") + a)), b.push(d)), 1; + h = 0; + e = "" === e ? "." : e + ":"; + if (Array.isArray(a)) for (var g = 0; g < a.length; g++) { + k = a[g]; + var f = e + N(k, g); + h += O(k, b, c, f, d); + } else if (f = y(a), "function" === typeof f) for (a = f.call(a), g = 0; !(k = a.next()).done;) { + k = k.value, f = e + N(k, g++), h += O(k, b, c, f, d); + } else if ("object" === k) throw b = "" + a, Error(z(31, "[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b)); + return h; + } + + function P(a, b, c) { + if (null == a) return a; + var e = [], + d = 0; + O(a, e, "", "", function (a) { + return b.call(c, a, d++); + }); + return e; + } + + function Q(a) { + if (-1 === a._status) { + var b = a._result; + b = b(); + a._status = 0; + a._result = b; + b.then(function (b) { + 0 === a._status && (b = b.default, a._status = 1, a._result = b); + }, function (b) { + 0 === a._status && (a._status = 2, a._result = b); + }); + } + + if (1 === a._status) return a._result; + throw a._result; + } + + var R = { + current: null + }; + + function S() { + var a = R.current; + if (null === a) throw Error(z(321)); + return a; + } + + var T = { + ReactCurrentDispatcher: R, + ReactCurrentBatchConfig: { + transition: 0 + }, + ReactCurrentOwner: G, + IsSomeRendererActing: { + current: false + }, + assign: _$$_REQUIRE(_dependencyMap[0]) + }; + exports.Children = { + map: P, + forEach: function forEach(a, b, c) { + P(a, function () { + b.apply(this, arguments); + }, c); + }, + count: function count(a) { + var b = 0; + P(a, function () { + b++; + }); + return b; + }, + toArray: function toArray(a) { + return P(a, function (a) { + return a; + }) || []; + }, + only: function only(a) { + if (!L(a)) throw Error(z(143)); + return a; + } + }; + exports.Component = C; + exports.PureComponent = E; + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = T; + + exports.cloneElement = function (a, b, c) { + if (null === a || undefined === a) throw Error(z(267, a)); + + var e = _$$_REQUIRE(_dependencyMap[0])({}, a.props), + d = a.key, + k = a.ref, + h = a._owner; + + if (null != b) { + undefined !== b.ref && (k = b.ref, h = G.current); + undefined !== b.key && (d = "" + b.key); + if (a.type && a.type.defaultProps) var g = a.type.defaultProps; + + for (f in b) { + H.call(b, f) && !I.hasOwnProperty(f) && (e[f] = undefined === b[f] && undefined !== g ? g[f] : b[f]); + } + } + + var f = arguments.length - 2; + if (1 === f) e.children = c;else if (1 < f) { + g = Array(f); + + for (var m = 0; m < f; m++) { + g[m] = arguments[m + 2]; + } + + e.children = g; + } + return { + $$typeof: n, + type: a.type, + key: d, + ref: k, + props: e, + _owner: h + }; + }; + + exports.createContext = function (a, b) { + undefined === b && (b = null); + a = { + $$typeof: r, + _calculateChangedBits: b, + _currentValue: a, + _currentValue2: a, + _threadCount: 0, + Provider: null, + Consumer: null + }; + a.Provider = { + $$typeof: q, + _context: a + }; + return a.Consumer = a; + }; + + exports.createElement = J; + + exports.createFactory = function (a) { + var b = J.bind(null, a); + b.type = a; + return b; + }; + + exports.createRef = function () { + return { + current: null + }; + }; + + exports.forwardRef = function (a) { + return { + $$typeof: t, + render: a + }; + }; + + exports.isValidElement = L; + + exports.lazy = function (a) { + return { + $$typeof: v, + _payload: { + _status: -1, + _result: a + }, + _init: Q + }; + }; + + exports.memo = function (a, b) { + return { + $$typeof: u, + type: a, + compare: undefined === b ? null : b + }; + }; + + exports.useCallback = function (a, b) { + return S().useCallback(a, b); + }; + + exports.useContext = function (a, b) { + return S().useContext(a, b); + }; + + exports.useDebugValue = function () {}; + + exports.useEffect = function (a, b) { + return S().useEffect(a, b); + }; + + exports.useImperativeHandle = function (a, b, c) { + return S().useImperativeHandle(a, b, c); + }; + + exports.useLayoutEffect = function (a, b) { + return S().useLayoutEffect(a, b); + }; + + exports.useMemo = function (a, b) { + return S().useMemo(a, b); + }; + + exports.useReducer = function (a, b, c) { + return S().useReducer(a, b, c); + }; + + exports.useRef = function (a) { + return S().useRef(a); + }; + + exports.useState = function (a) { + return S().useState(a); + }; + + exports.version = "17.0.2"; +},18,[19]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + 'use strict'; + + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + var test1 = new String('abc'); + test1[5] = 'de'; + + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + var test2 = {}; + + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + + if (order2.join('') !== '0123456789') { + return false; + } + + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + + if (Object.keys(_$$_REQUIRE(_dependencyMap[0])({}, test3)).join('') !== 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + return false; + } + } + + module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; +},19,[6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createHandler; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _defineProperty2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _areEqual = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _RNGestureHandlerModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _UIManager$getViewMan, _stateToPropMappings; + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function findNodeHandle(node) { + if (_reactNative.Platform.OS === 'web') return node; + return (0, _reactNative.findNodeHandle)(node); + } + + var _NativeModules$UIMana = _reactNative.NativeModules.UIManager, + UIManager = _NativeModules$UIMana === undefined ? {} : _NativeModules$UIMana; + var customGHEventsConfig = { + onGestureHandlerEvent: { + registrationName: 'onGestureHandlerEvent' + }, + onGestureHandlerStateChange: { + registrationName: 'onGestureHandlerStateChange' + } + }; + UIManager.genericDirectEventTypes = (0, _extends2.default)({}, UIManager.genericDirectEventTypes, customGHEventsConfig); + var UIManagerConstants = (_UIManager$getViewMan = UIManager.getViewManagerConfig == null ? undefined : UIManager.getViewManagerConfig('getConstants')) != null ? _UIManager$getViewMan : UIManager.getConstants == null ? undefined : UIManager.getConstants(); + + if (UIManagerConstants) { + UIManagerConstants.genericDirectEventTypes = (0, _extends2.default)({}, UIManagerConstants.genericDirectEventTypes, customGHEventsConfig); + } + + var _UIManager$setJSRespo = UIManager.setJSResponder, + oldSetJSResponder = _UIManager$setJSRespo === undefined ? function () {} : _UIManager$setJSRespo, + _UIManager$clearJSRes = UIManager.clearJSResponder, + oldClearJSResponder = _UIManager$clearJSRes === undefined ? function () {} : _UIManager$clearJSRes; + + UIManager.setJSResponder = function (tag, blockNativeResponder) { + _RNGestureHandlerModule.default.handleSetJSResponder(tag, blockNativeResponder); + + oldSetJSResponder(tag, blockNativeResponder); + }; + + UIManager.clearJSResponder = function () { + _RNGestureHandlerModule.default.handleClearJSResponder(); + + oldClearJSResponder(); + }; + + var handlerTag = 1; + var handlerIDToTag = {}; + + function isConfigParam(param, name) { + return param !== undefined && (param !== Object(param) || !('__isNative' in param)) && name !== 'onHandlerStateChange' && name !== 'onGestureEvent'; + } + + function filterConfig(props, validProps) { + var defaults = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var res = (0, _extends2.default)({}, defaults); + validProps.forEach(function (key) { + var value = props[key]; + + if (isConfigParam(value, key)) { + var _value = props[key]; + + if (key === 'simultaneousHandlers' || key === 'waitFor') { + _value = transformIntoHandlerTags(props[key]); + } else if (key === 'hitSlop') { + if (typeof _value !== 'object') { + _value = { + top: _value, + left: _value, + bottom: _value, + right: _value + }; + } + } + + res[key] = _value; + } + }); + return res; + } + + function transformIntoHandlerTags(handlerIDs) { + if (!Array.isArray(handlerIDs)) { + handlerIDs = [handlerIDs]; + } + + if (_reactNative.Platform.OS === 'web') { + return handlerIDs.map(function (_ref) { + var current = _ref.current; + return current; + }).filter(function (handle) { + return handle; + }); + } + + return handlerIDs.map(function (handlerID) { + var _handlerID$current; + + return handlerIDToTag[handlerID] || ((_handlerID$current = handlerID.current) == null ? undefined : _handlerID$current.handlerTag) || -1; + }).filter(function (handlerTag) { + return handlerTag > 0; + }); + } + + function hasUnresolvedRefs(props) { + var extract = function extract(refs) { + if (!Array.isArray(refs)) { + return refs && refs.current === null; + } + + return refs.some(function (r) { + return r && r.current === null; + }); + }; + + return extract(props['simultaneousHandlers']) || extract(props['waitFor']); + } + + var stateToPropMappings = (_stateToPropMappings = {}, (0, _defineProperty2.default)(_stateToPropMappings, _$$_REQUIRE(_dependencyMap[13]).State.UNDETERMINED, undefined), (0, _defineProperty2.default)(_stateToPropMappings, _$$_REQUIRE(_dependencyMap[13]).State.BEGAN, 'onBegan'), (0, _defineProperty2.default)(_stateToPropMappings, _$$_REQUIRE(_dependencyMap[13]).State.FAILED, 'onFailed'), (0, _defineProperty2.default)(_stateToPropMappings, _$$_REQUIRE(_dependencyMap[13]).State.CANCELLED, 'onCancelled'), (0, _defineProperty2.default)(_stateToPropMappings, _$$_REQUIRE(_dependencyMap[13]).State.ACTIVE, 'onActivated'), (0, _defineProperty2.default)(_stateToPropMappings, _$$_REQUIRE(_dependencyMap[13]).State.END, 'onEnded'), _stateToPropMappings); + + function createHandler(_ref2) { + var name = _ref2.name, + _ref2$allowedProps = _ref2.allowedProps, + allowedProps = _ref2$allowedProps === undefined ? [] : _ref2$allowedProps, + _ref2$config = _ref2.config, + config = _ref2$config === undefined ? {} : _ref2$config, + transformProps = _ref2.transformProps, + _ref2$customNativePro = _ref2.customNativeProps, + customNativeProps = _ref2$customNativePro === undefined ? [] : _ref2$customNativePro; + + var Handler = function (_React$Component) { + (0, _inherits2.default)(Handler, _React$Component); + + var _super = _createSuper(Handler); + + function Handler(props) { + var _this; + + (0, _classCallCheck2.default)(this, Handler); + _this = _super.call(this, props); + _this.updateEnqueued = null; + + _this.onGestureHandlerEvent = function (event) { + if (event.nativeEvent.handlerTag === _this.handlerTag) { + _this.props.onGestureEvent == null ? undefined : _this.props.onGestureEvent(event); + } else { + _this.props.onGestureHandlerEvent == null ? undefined : _this.props.onGestureHandlerEvent(event); + } + }; + + _this.onGestureHandlerStateChange = function (event) { + if (event.nativeEvent.handlerTag === _this.handlerTag) { + _this.props.onHandlerStateChange == null ? undefined : _this.props.onHandlerStateChange(event); + var state = event.nativeEvent.state; + var stateEventName = stateToPropMappings[state]; + var eventHandler = stateEventName && _this.props[stateEventName]; + + if (eventHandler && typeof eventHandler === 'function') { + eventHandler(event); + } + } else { + _this.props.onGestureHandlerStateChange == null ? undefined : _this.props.onGestureHandlerStateChange(event); + } + }; + + _this.refHandler = function (node) { + _this.viewNode = node; + var child = React.Children.only(_this.props.children); + var ref = child.ref; + + if (ref !== null) { + if (typeof ref === 'function') { + ref(node); + } else { + ref.current = node; + } + } + }; + + _this.createGestureHandler = function (newConfig) { + _this.config = newConfig; + + _RNGestureHandlerModule.default.createGestureHandler(name, _this.handlerTag, newConfig); + }; + + _this.attachGestureHandler = function (newViewTag) { + _this.viewTag = newViewTag; + + if (_reactNative.Platform.OS === 'web') { + _RNGestureHandlerModule.default.attachGestureHandler(_this.handlerTag, newViewTag, _this.propsRef); + } else { + _RNGestureHandlerModule.default.attachGestureHandler(_this.handlerTag, newViewTag); + } + }; + + _this.updateGestureHandler = function (newConfig) { + _this.config = newConfig; + + _RNGestureHandlerModule.default.updateGestureHandler(_this.handlerTag, newConfig); + }; + + _this.handlerTag = handlerTag++; + _this.config = {}; + _this.propsRef = React.createRef(); + + if (props.id) { + if (handlerIDToTag[props.id] !== undefined) { + throw new Error("Handler with ID \"" + props.id + "\" already registered"); + } + + handlerIDToTag[props.id] = _this.handlerTag; + } + + return _this; + } + + (0, _createClass2.default)(Handler, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var props = this.props; + + if (hasUnresolvedRefs(props)) { + this.updateEnqueued = setImmediate(function () { + _this2.updateEnqueued = null; + + _this2.update(); + }); + } + + this.createGestureHandler(filterConfig(transformProps ? transformProps(this.props) : this.props, [].concat((0, _toConsumableArray2.default)(allowedProps), (0, _toConsumableArray2.default)(customNativeProps)), config)); + this.attachGestureHandler(findNodeHandle(this.viewNode)); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + var viewTag = findNodeHandle(this.viewNode); + + if (this.viewTag !== viewTag) { + this.attachGestureHandler(viewTag); + } + + this.update(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _RNGestureHandlerModule.default.dropGestureHandler(this.handlerTag); + + if (this.updateEnqueued) { + clearImmediate(this.updateEnqueued); + } + + var handlerID = this.props.id; + + if (handlerID) { + delete handlerIDToTag[handlerID]; + } + } + }, { + key: "update", + value: function update() { + var newConfig = filterConfig(transformProps ? transformProps(this.props) : this.props, [].concat((0, _toConsumableArray2.default)(allowedProps), (0, _toConsumableArray2.default)(customNativeProps)), config); + + if (!(0, _areEqual.default)(this.config, newConfig)) { + this.updateGestureHandler(newConfig); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(updates) { + var mergedProps = (0, _extends2.default)({}, this.props, updates); + var newConfig = filterConfig(transformProps ? transformProps(mergedProps) : mergedProps, [].concat((0, _toConsumableArray2.default)(allowedProps), (0, _toConsumableArray2.default)(customNativeProps)), config); + this.updateGestureHandler(newConfig); + } + }, { + key: "render", + value: function render() { + var gestureEventHandler = this.onGestureHandlerEvent; + var _this$props = this.props, + onGestureEvent = _this$props.onGestureEvent, + onGestureHandlerEvent = _this$props.onGestureHandlerEvent; + + if (onGestureEvent && typeof onGestureEvent !== 'function') { + if (onGestureHandlerEvent) { + throw new Error('Nesting touch handlers with native animated driver is not supported yet'); + } + + gestureEventHandler = onGestureEvent; + } else { + if (onGestureHandlerEvent && typeof onGestureHandlerEvent !== 'function') { + throw new Error('Nesting touch handlers with native animated driver is not supported yet'); + } + } + + var gestureStateEventHandler = this.onGestureHandlerStateChange; + var _this$props2 = this.props, + onHandlerStateChange = _this$props2.onHandlerStateChange, + onGestureHandlerStateChange = _this$props2.onGestureHandlerStateChange; + + if (onHandlerStateChange && typeof onHandlerStateChange !== 'function') { + if (onGestureHandlerStateChange) { + throw new Error('Nesting touch handlers with native animated driver is not supported yet'); + } + + gestureStateEventHandler = onHandlerStateChange; + } else { + if (onGestureHandlerStateChange && typeof onGestureHandlerStateChange !== 'function') { + throw new Error('Nesting touch handlers with native animated driver is not supported yet'); + } + } + + var events = { + onGestureHandlerEvent: gestureEventHandler, + onGestureHandlerStateChange: gestureStateEventHandler + }; + this.propsRef.current = events; + var child = React.Children.only(this.props.children); + var grandChildren = child.props.children; + + if (_reactNative.Touchable.TOUCH_TARGET_DEBUG && child.type && (child.type === 'RNGestureHandlerButton' || child.type.name === 'View' || child.type.displayName === 'View')) { + grandChildren = React.Children.toArray(grandChildren); + grandChildren.push(_reactNative.Touchable.renderDebugView({ + color: 'mediumspringgreen', + hitSlop: child.props.hitSlop + })); + } + + return React.cloneElement(child, (0, _extends2.default)({ + ref: this.refHandler, + collapsable: false + }, events), grandChildren); + } + }]); + return Handler; + }(React.Component); + + Handler.displayName = name; + return Handler; + } +},20,[5,21,7,8,12,14,16,27,6,17,28,407,408,3]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _toConsumableArray(arr) { + return _$$_REQUIRE(_dependencyMap[0])(arr) || _$$_REQUIRE(_dependencyMap[1])(arr) || _$$_REQUIRE(_dependencyMap[2])(arr) || _$$_REQUIRE(_dependencyMap[3])(); + } + + module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},21,[22,24,25,26]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _arrayWithoutHoles(arr) { + if (Array.isArray(arr)) return _$$_REQUIRE(_dependencyMap[0])(arr); + } + + module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; +},22,[23]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _arrayLikeToArray(arr, len) { + if (len == null || len > arr.length) len = arr.length; + + for (var i = 0, arr2 = new Array(len); i < len; i++) { + arr2[i] = arr[i]; + } + + return arr2; + } + + module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},23,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _iterableToArray(iter) { + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); + } + + module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},24,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _unsupportedIterableToArray(o, minLen) { + if (!o) return; + if (typeof o === "string") return _$$_REQUIRE(_dependencyMap[0])(o, minLen); + var n = Object.prototype.toString.call(o).slice(8, -1); + if (n === "Object" && o.constructor) n = o.constructor.name; + if (n === "Map" || n === "Set") return Array.from(o); + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _$$_REQUIRE(_dependencyMap[0])(o, minLen); + } + + module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},25,[23]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _nonIterableSpread() { + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; +},26,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _defineProperty(obj, key, value) { + key = _$$_REQUIRE(_dependencyMap[0])(key); + + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + + return obj; + } + + module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; +},27,[9]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = { + get AccessibilityInfo() { + return _$$_REQUIRE(_dependencyMap[0]).default; + }, + + get ActivityIndicator() { + return _$$_REQUIRE(_dependencyMap[1]); + }, + + get Button() { + return _$$_REQUIRE(_dependencyMap[2]); + }, + + get DatePickerIOS() { + _$$_REQUIRE(_dependencyMap[3])('DatePickerIOS-merged', "DatePickerIOS has been merged with DatePickerAndroid and will be removed in a future release. It can now be installed and imported from '@react-native-community/datetimepicker' instead of 'react-native'. See https://github.com/react-native-datetimepicker/datetimepicker"); + + return _$$_REQUIRE(_dependencyMap[4]); + }, + + get DrawerLayoutAndroid() { + return _$$_REQUIRE(_dependencyMap[5]); + }, + + get FlatList() { + return _$$_REQUIRE(_dependencyMap[6]); + }, + + get Image() { + return _$$_REQUIRE(_dependencyMap[7]); + }, + + get ImageBackground() { + return _$$_REQUIRE(_dependencyMap[8]); + }, + + get InputAccessoryView() { + return _$$_REQUIRE(_dependencyMap[9]); + }, + + get KeyboardAvoidingView() { + return _$$_REQUIRE(_dependencyMap[10]).default; + }, + + get MaskedViewIOS() { + _$$_REQUIRE(_dependencyMap[3])('maskedviewios-moved', "MaskedViewIOS has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-masked-view/masked-view' instead of 'react-native'. See https://github.com/react-native-masked-view/masked-view"); + + return _$$_REQUIRE(_dependencyMap[11]); + }, + + get Modal() { + return _$$_REQUIRE(_dependencyMap[12]); + }, + + get Pressable() { + return _$$_REQUIRE(_dependencyMap[13]).default; + }, + + get ProgressBarAndroid() { + _$$_REQUIRE(_dependencyMap[3])('progress-bar-android-moved', "ProgressBarAndroid has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/progress-bar-android' instead of 'react-native'. See https://github.com/react-native-progress-view/progress-bar-android"); + + return _$$_REQUIRE(_dependencyMap[14]); + }, + + get ProgressViewIOS() { + _$$_REQUIRE(_dependencyMap[3])('progress-view-ios-moved', "ProgressViewIOS has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/progress-view' instead of 'react-native'. See https://github.com/react-native-progress-view/progress-view"); + + return _$$_REQUIRE(_dependencyMap[15]); + }, + + get RefreshControl() { + return _$$_REQUIRE(_dependencyMap[16]); + }, + + get SafeAreaView() { + return _$$_REQUIRE(_dependencyMap[17]).default; + }, + + get ScrollView() { + return _$$_REQUIRE(_dependencyMap[18]); + }, + + get SectionList() { + return _$$_REQUIRE(_dependencyMap[19]).default; + }, + + get SegmentedControlIOS() { + _$$_REQUIRE(_dependencyMap[3])('segmented-control-ios-moved', "SegmentedControlIOS has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-segmented-control/segmented-control' instead of 'react-native'. See https://github.com/react-native-segmented-control/segmented-control"); + + return _$$_REQUIRE(_dependencyMap[20]); + }, + + get Slider() { + _$$_REQUIRE(_dependencyMap[3])('slider-moved', "Slider has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/slider' instead of 'react-native'. See https://github.com/callstack/react-native-slider"); + + return _$$_REQUIRE(_dependencyMap[21]); + }, + + get StatusBar() { + return _$$_REQUIRE(_dependencyMap[22]); + }, + + get Switch() { + return _$$_REQUIRE(_dependencyMap[23]).default; + }, + + get Text() { + return _$$_REQUIRE(_dependencyMap[24]); + }, + + get TextInput() { + return _$$_REQUIRE(_dependencyMap[25]); + }, + + get Touchable() { + return _$$_REQUIRE(_dependencyMap[26]); + }, + + get TouchableHighlight() { + return _$$_REQUIRE(_dependencyMap[27]); + }, + + get TouchableNativeFeedback() { + return _$$_REQUIRE(_dependencyMap[28]); + }, + + get TouchableOpacity() { + return _$$_REQUIRE(_dependencyMap[29]); + }, + + get TouchableWithoutFeedback() { + return _$$_REQUIRE(_dependencyMap[30]); + }, + + get View() { + return _$$_REQUIRE(_dependencyMap[31]); + }, + + get VirtualizedList() { + return _$$_REQUIRE(_dependencyMap[32]); + }, + + get VirtualizedSectionList() { + return _$$_REQUIRE(_dependencyMap[33]); + }, + + get ActionSheetIOS() { + return _$$_REQUIRE(_dependencyMap[34]); + }, + + get Alert() { + return _$$_REQUIRE(_dependencyMap[35]); + }, + + get Animated() { + return _$$_REQUIRE(_dependencyMap[36]); + }, + + get Appearance() { + return _$$_REQUIRE(_dependencyMap[37]); + }, + + get AppRegistry() { + return _$$_REQUIRE(_dependencyMap[38]); + }, + + get AppState() { + return _$$_REQUIRE(_dependencyMap[39]); + }, + + get AsyncStorage() { + _$$_REQUIRE(_dependencyMap[3])('async-storage-moved', "AsyncStorage has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-async-storage/async-storage' instead of 'react-native'. See https://github.com/react-native-async-storage/async-storage"); + + return _$$_REQUIRE(_dependencyMap[40]); + }, + + get BackHandler() { + return _$$_REQUIRE(_dependencyMap[41]); + }, + + get Clipboard() { + _$$_REQUIRE(_dependencyMap[3])('clipboard-moved', "Clipboard has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-clipboard/clipboard' instead of 'react-native'. See https://github.com/react-native-clipboard/clipboard"); + + return _$$_REQUIRE(_dependencyMap[42]); + }, + + get DeviceInfo() { + return _$$_REQUIRE(_dependencyMap[43]); + }, + + get DevSettings() { + return _$$_REQUIRE(_dependencyMap[44]); + }, + + get Dimensions() { + return _$$_REQUIRE(_dependencyMap[45]); + }, + + get Easing() { + return _$$_REQUIRE(_dependencyMap[46]); + }, + + get findNodeHandle() { + return _$$_REQUIRE(_dependencyMap[47]).findNodeHandle; + }, + + get I18nManager() { + return _$$_REQUIRE(_dependencyMap[48]); + }, + + get ImagePickerIOS() { + _$$_REQUIRE(_dependencyMap[3])('imagePickerIOS-moved', "ImagePickerIOS has been extracted from react-native core and will be removed in a future release. Please upgrade to use either '@react-native-community/react-native-image-picker' or 'expo-image-picker'. If you cannot upgrade to a different library, please install the deprecated '@react-native-community/image-picker-ios' package. See https://github.com/rnc-archive/react-native-image-picker-ios"); + + return _$$_REQUIRE(_dependencyMap[49]); + }, + + get InteractionManager() { + return _$$_REQUIRE(_dependencyMap[50]); + }, + + get Keyboard() { + return _$$_REQUIRE(_dependencyMap[51]); + }, + + get LayoutAnimation() { + return _$$_REQUIRE(_dependencyMap[52]); + }, + + get Linking() { + return _$$_REQUIRE(_dependencyMap[53]); + }, + + get LogBox() { + return _$$_REQUIRE(_dependencyMap[54]); + }, + + get NativeDialogManagerAndroid() { + return _$$_REQUIRE(_dependencyMap[55]).default; + }, + + get NativeEventEmitter() { + return _$$_REQUIRE(_dependencyMap[56]).default; + }, + + get Networking() { + return _$$_REQUIRE(_dependencyMap[57]); + }, + + get PanResponder() { + return _$$_REQUIRE(_dependencyMap[58]); + }, + + get PermissionsAndroid() { + return _$$_REQUIRE(_dependencyMap[59]); + }, + + get PixelRatio() { + return _$$_REQUIRE(_dependencyMap[60]); + }, + + get PushNotificationIOS() { + _$$_REQUIRE(_dependencyMap[3])('pushNotificationIOS-moved', "PushNotificationIOS has been extracted from react-native core and will be removed in a future release. It can now be installed and imported from '@react-native-community/push-notification-ios' instead of 'react-native'. See https://github.com/react-native-push-notification-ios/push-notification-ios"); + + return _$$_REQUIRE(_dependencyMap[61]); + }, + + get Settings() { + return _$$_REQUIRE(_dependencyMap[62]); + }, + + get Share() { + return _$$_REQUIRE(_dependencyMap[63]); + }, + + get StyleSheet() { + return _$$_REQUIRE(_dependencyMap[64]); + }, + + get Systrace() { + return _$$_REQUIRE(_dependencyMap[65]); + }, + + get ToastAndroid() { + return _$$_REQUIRE(_dependencyMap[66]); + }, + + get TurboModuleRegistry() { + return _$$_REQUIRE(_dependencyMap[67]); + }, + + get UIManager() { + return _$$_REQUIRE(_dependencyMap[68]); + }, + + get unstable_batchedUpdates() { + return _$$_REQUIRE(_dependencyMap[47]).unstable_batchedUpdates; + }, + + get useColorScheme() { + return _$$_REQUIRE(_dependencyMap[69]).default; + }, + + get useWindowDimensions() { + return _$$_REQUIRE(_dependencyMap[70]).default; + }, + + get UTFSequence() { + return _$$_REQUIRE(_dependencyMap[71]); + }, + + get Vibration() { + return _$$_REQUIRE(_dependencyMap[72]); + }, + + get YellowBox() { + return _$$_REQUIRE(_dependencyMap[73]); + }, + + get DeviceEventEmitter() { + return _$$_REQUIRE(_dependencyMap[74]).default; + }, + + get DynamicColorIOS() { + return _$$_REQUIRE(_dependencyMap[75]).DynamicColorIOS; + }, + + get NativeAppEventEmitter() { + return _$$_REQUIRE(_dependencyMap[76]); + }, + + get NativeModules() { + return _$$_REQUIRE(_dependencyMap[77]); + }, + + get Platform() { + return _$$_REQUIRE(_dependencyMap[78]); + }, + + get PlatformColor() { + return _$$_REQUIRE(_dependencyMap[79]).PlatformColor; + }, + + get processColor() { + return _$$_REQUIRE(_dependencyMap[80]); + }, + + get requireNativeComponent() { + return _$$_REQUIRE(_dependencyMap[81]); + }, + + get RootTagContext() { + return _$$_REQUIRE(_dependencyMap[82]).RootTagContext; + }, + + get unstable_enableLogBox() { + return function () { + return console.warn('LogBox is enabled by default so there is no need to call unstable_enableLogBox() anymore. This is a no op and will be removed in the next version.'); + }; + }, + + get ColorPropType() { + return _$$_REQUIRE(_dependencyMap[83]); + }, + + get EdgeInsetsPropType() { + return _$$_REQUIRE(_dependencyMap[84]); + }, + + get PointPropType() { + return _$$_REQUIRE(_dependencyMap[85]); + }, + + get ViewPropTypes() { + return _$$_REQUIRE(_dependencyMap[86]); + } + + }; +},28,[29,182,193,299,300,302,256,284,303,304,306,307,309,316,187,318,275,320,259,295,322,324,326,329,194,333,341,345,219,220,346,184,258,296,347,119,221,349,351,367,370,357,373,375,376,171,245,54,314,378,230,261,262,380,383,122,110,100,384,386,170,388,390,392,183,47,394,39,155,395,400,401,402,404,30,405,130,40,37,148,145,191,313,205,208,406,335]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeAccessibilityInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _NativeAccessibilityManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _legacySendAccessibilityEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var EventNames = _Platform.default.OS === 'android' ? new Map([['change', 'touchExplorationDidChange'], ['reduceMotionChanged', 'reduceMotionDidChange'], ['screenReaderChanged', 'touchExplorationDidChange']]) : new Map([['announcementFinished', 'announcementFinished'], ['boldTextChanged', 'boldTextChanged'], ['change', 'screenReaderChanged'], ['grayscaleChanged', 'grayscaleChanged'], ['invertColorsChanged', 'invertColorsChanged'], ['reduceMotionChanged', 'reduceMotionChanged'], ['reduceTransparencyChanged', 'reduceTransparencyChanged'], ['screenReaderChanged', 'screenReaderChanged']]); + var AccessibilityInfo = { + isBoldTextEnabled: function isBoldTextEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentBoldTextState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + isGrayscaleEnabled: function isGrayscaleEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentGrayscaleState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + isInvertColorsEnabled: function isInvertColorsEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentInvertColorsState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + isReduceMotionEnabled: function isReduceMotionEnabled() { + return new Promise(function (resolve, reject) { + if (_Platform.default.OS === 'android') { + if (_NativeAccessibilityInfo.default != null) { + _NativeAccessibilityInfo.default.isReduceMotionEnabled(resolve); + } else { + reject(null); + } + } else { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentReduceMotionState(resolve, reject); + } else { + reject(null); + } + } + }); + }, + isReduceTransparencyEnabled: function isReduceTransparencyEnabled() { + if (_Platform.default.OS === 'android') { + return Promise.resolve(false); + } else { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentReduceTransparencyState(resolve, reject); + } else { + reject(null); + } + }); + } + }, + isScreenReaderEnabled: function isScreenReaderEnabled() { + return new Promise(function (resolve, reject) { + if (_Platform.default.OS === 'android') { + if (_NativeAccessibilityInfo.default != null) { + _NativeAccessibilityInfo.default.isTouchExplorationEnabled(resolve); + } else { + reject(null); + } + } else { + if (_NativeAccessibilityManager.default != null) { + _NativeAccessibilityManager.default.getCurrentVoiceOverState(resolve, reject); + } else { + reject(null); + } + } + }); + }, + addEventListener: function addEventListener(eventName, handler) { + var deviceEventName = EventNames.get(eventName); + return deviceEventName == null ? { + remove: function remove() {} + } : _RCTDeviceEventEmitter.default.addListener(deviceEventName, handler); + }, + setAccessibilityFocus: function setAccessibilityFocus(reactTag) { + (0, _legacySendAccessibilityEvent.default)(reactTag, 'focus'); + }, + sendAccessibilityEvent_unstable: function sendAccessibilityEvent_unstable(handle, eventType) { + if (_Platform.default.OS === 'ios' && eventType === 'click') { + return; + } + + (0, _$$_REQUIRE(_dependencyMap[6]).sendAccessibilityEvent)(handle, eventType); + }, + announceForAccessibility: function announceForAccessibility(announcement) { + if (_Platform.default.OS === 'android') { + _NativeAccessibilityInfo.default == null ? undefined : _NativeAccessibilityInfo.default.announceForAccessibility(announcement); + } else { + _NativeAccessibilityManager.default == null ? undefined : _NativeAccessibilityManager.default.announceForAccessibility(announcement); + } + }, + removeEventListener: function removeEventListener(eventName, handler) { + var deviceEventName = EventNames.get(eventName); + + if (deviceEventName != null) { + _RCTDeviceEventEmitter.default.removeListener('deviceEventName', handler); + } + }, + getRecommendedTimeoutMillis: function getRecommendedTimeoutMillis(originalTimeout) { + if (_Platform.default.OS === 'android') { + return new Promise(function (resolve, reject) { + if (_NativeAccessibilityInfo.default != null && _NativeAccessibilityInfo.default.getRecommendedTimeoutMillis) { + _NativeAccessibilityInfo.default.getRecommendedTimeoutMillis(originalTimeout, resolve); + } else { + resolve(originalTimeout); + } + }); + } else { + return Promise.resolve(originalTimeout); + } + } + }; + var _default = AccessibilityInfo; + exports.default = _default; +},29,[5,30,37,51,52,53,54]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _EventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = new _EventEmitter.default(); + + exports.default = _default; +},30,[5,31]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + exports.default = _$$_REQUIRE(_dependencyMap[0]); +},31,[32]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _EmitterSubscription = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _EventSubscriptionVendor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var sparseFilterPredicate = function sparseFilterPredicate() { + return true; + }; + + var EventEmitter = function () { + function EventEmitter(subscriber) { + (0, _classCallCheck2.default)(this, EventEmitter); + this._subscriber = new _EventSubscriptionVendor.default(); + + if (subscriber != null) { + console.warn('EventEmitter(...): Constructor argument is deprecated.'); + this._subscriber = subscriber; + } + } + + (0, _createClass2.default)(EventEmitter, [{ + key: "addListener", + value: function addListener(eventType, listener, context) { + return this._subscriber.addSubscription(eventType, new _EmitterSubscription.default(this, this._subscriber, listener, context)); + } + }, { + key: "removeAllListeners", + value: function removeAllListeners(eventType) { + this._subscriber.removeAllSubscriptions(eventType); + } + }, { + key: "removeSubscription", + value: function removeSubscription(subscription) { + console.warn("EventEmitter.removeSubscription(...): Method has been deprecated. Please instead use `remove()` on the subscription itself."); + + this.__removeSubscription(subscription); + } + }, { + key: "__removeSubscription", + value: function __removeSubscription(subscription) { + _$$_REQUIRE(_dependencyMap[5])(subscription.emitter === this, 'Subscription does not belong to this emitter.'); + + this._subscriber.removeSubscription(subscription); + } + }, { + key: "listenerCount", + value: function listenerCount(eventType) { + var subscriptions = this._subscriber.getSubscriptionsForType(eventType); + + return subscriptions ? subscriptions.filter(sparseFilterPredicate).length : 0; + } + }, { + key: "emit", + value: function emit(eventType) { + var subscriptions = this._subscriber.getSubscriptionsForType(eventType); + + if (subscriptions) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + for (var i = 0, l = subscriptions.length; i < l; i++) { + var subscription = subscriptions[i]; + + if (subscription && subscription.listener) { + subscription.listener.apply(subscription.context, args); + } + } + } + } + }, { + key: "removeListener", + value: function removeListener(eventType, listener) { + console.warn("EventEmitter.removeListener('" + eventType + "', ...): Method has been " + 'deprecated. Please instead use `remove()` on the subscription ' + 'returned by `EventEmitter.addListener`.'); + + var subscriptions = this._subscriber.getSubscriptionsForType(eventType); + + if (subscriptions) { + for (var i = 0, l = subscriptions.length; i < l; i++) { + var subscription = subscriptions[i]; + + if (subscription && subscription.listener === listener) { + subscription.remove(); + } + } + } + } + }]); + return EventEmitter; + }(); + + module.exports = EventEmitter; +},32,[5,7,8,33,35,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _EventSubscription3 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EmitterSubscription = function (_EventSubscription2) { + (0, _inherits2.default)(EmitterSubscription, _EventSubscription2); + + var _super = _createSuper(EmitterSubscription); + + function EmitterSubscription(emitter, subscriber, listener, context) { + var _this; + + (0, _classCallCheck2.default)(this, EmitterSubscription); + _this = _super.call(this, subscriber); + _this.emitter = emitter; + _this.listener = listener; + _this.context = context; + return _this; + } + + (0, _createClass2.default)(EmitterSubscription, [{ + key: "remove", + value: function remove() { + this.emitter.__removeSubscription(this); + } + }]); + return EmitterSubscription; + }(_EventSubscription3.default); + + module.exports = EmitterSubscription; +},33,[5,7,8,12,14,16,34]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _EventSubscription = function () { + function _EventSubscription(subscriber) { + (0, _classCallCheck2.default)(this, _EventSubscription); + this.subscriber = subscriber; + } + + (0, _createClass2.default)(_EventSubscription, [{ + key: "remove", + value: function remove() { + this.subscriber.removeSubscription(this); + } + }]); + return _EventSubscription; + }(); + + module.exports = _EventSubscription; +},34,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var EventSubscriptionVendor = function () { + function EventSubscriptionVendor() { + _$$_REQUIRE(_dependencyMap[0])(this, EventSubscriptionVendor); + + this._subscriptionsForType = {}; + } + + _$$_REQUIRE(_dependencyMap[1])(EventSubscriptionVendor, [{ + key: "addSubscription", + value: function addSubscription(eventType, subscription) { + _$$_REQUIRE(_dependencyMap[2])(subscription.subscriber === this, 'The subscriber of the subscription is incorrectly set.'); + + if (!this._subscriptionsForType[eventType]) { + this._subscriptionsForType[eventType] = []; + } + + var key = this._subscriptionsForType[eventType].length; + + this._subscriptionsForType[eventType].push(subscription); + + subscription.eventType = eventType; + subscription.key = key; + return subscription; + } + }, { + key: "removeAllSubscriptions", + value: function removeAllSubscriptions(eventType) { + if (eventType == null) { + this._subscriptionsForType = {}; + } else { + delete this._subscriptionsForType[eventType]; + } + } + }, { + key: "removeSubscription", + value: function removeSubscription(subscription) { + var eventType = subscription.eventType; + var key = subscription.key; + var subscriptionsForType = this._subscriptionsForType[eventType]; + + if (subscriptionsForType) { + delete subscriptionsForType[key]; + } + } + }, { + key: "getSubscriptionsForType", + value: function getSubscriptionsForType(eventType) { + return this._subscriptionsForType[eventType]; + } + }]); + + return EventSubscriptionVendor; + }(); + + module.exports = EventSubscriptionVendor; +},35,[7,8,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var invariant = function invariant(condition, format, a, b, c, d, e, f) { + if (!condition) { + var error; + + if (format === undefined) { + error = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; + throw error; + } + }; + + module.exports = invariant; +},36,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativePlatformConstantsIOS = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var Platform = { + __constants: null, + OS: 'ios', + + get Version() { + return this.constants.osVersion; + }, + + get constants() { + if (this.__constants == null) { + this.__constants = _NativePlatformConstantsIOS.default.getConstants(); + } + + return this.__constants; + }, + + get isPad() { + return this.constants.interfaceIdiom === 'pad'; + }, + + get isTVOS() { + return Platform.isTV; + }, + + get isTV() { + return this.constants.interfaceIdiom === 'tv'; + }, + + get isTesting() { + return false; + }, + + select: function select(spec) { + return 'ios' in spec ? spec.ios : 'native' in spec ? spec.native : spec.default; + } + }; + module.exports = Platform; +},37,[5,38]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('PlatformConstants'); + + exports.default = _default; +},38,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.get = get; + exports.getEnforcing = getEnforcing; + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var turboModuleProxy = global.__turboModuleProxy; + + function requireModule(name) { + if (global.RN$Bridgeless !== true) { + var legacyModule = _$$_REQUIRE(_dependencyMap[2])[name]; + + if (legacyModule != null) { + return legacyModule; + } + } + + if (turboModuleProxy != null) { + var module = turboModuleProxy(name); + return module; + } + + return null; + } + + function get(name) { + return requireModule(name); + } + + function getEnforcing(name) { + var module = requireModule(name); + (0, _invariant.default)(module != null, "TurboModuleRegistry.getEnforcing(...): '" + name + "' could not be found. " + 'Verify that a module by this name is registered in the native binary.'); + return module; + } +},39,[5,36,40]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function genModule(config, moduleID) { + if (!config) { + return null; + } + + var _config = _$$_REQUIRE(_dependencyMap[0])(config, 5), + moduleName = _config[0], + constants = _config[1], + methods = _config[2], + promiseMethods = _config[3], + syncMethods = _config[4]; + + _$$_REQUIRE(_dependencyMap[1])(!moduleName.startsWith('RCT') && !moduleName.startsWith('RK'), "Module name prefixes should've been stripped by the native side but wasn't for " + moduleName); + + if (!constants && !methods) { + return { + name: moduleName + }; + } + + var module = {}; + methods && methods.forEach(function (methodName, methodID) { + var isPromise = promiseMethods && arrayContains(promiseMethods, methodID) || false; + var isSync = syncMethods && arrayContains(syncMethods, methodID) || false; + + _$$_REQUIRE(_dependencyMap[1])(!isPromise || !isSync, 'Cannot have a method that is both async and a sync hook'); + + var methodType = isPromise ? 'promise' : isSync ? 'sync' : 'async'; + module[methodName] = genMethod(moduleID, methodID, methodType); + }); + + _$$_REQUIRE(_dependencyMap[2])(module, constants); + + if (module.getConstants == null) { + module.getConstants = function () { + return constants || Object.freeze({}); + }; + } else { + console.warn("Unable to define method 'getConstants()' on NativeModule '" + moduleName + "'. NativeModule '" + moduleName + "' already has a constant or method called 'getConstants'. Please remove it."); + } + + return { + name: moduleName, + module: module + }; + } + + global.__fbGenNativeModule = genModule; + + function loadModule(name, moduleID) { + _$$_REQUIRE(_dependencyMap[1])(global.nativeRequireModuleConfig, "Can't lazily create module without nativeRequireModuleConfig"); + + var config = global.nativeRequireModuleConfig(name); + var info = genModule(config, moduleID); + return info && info.module; + } + + function genMethod(moduleID, methodID, type) { + var fn = null; + + if (type === 'promise') { + fn = function promiseMethodWrapper() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var enqueueingFrameError = new Error(); + return new Promise(function (resolve, reject) { + _$$_REQUIRE(_dependencyMap[3]).enqueueNativeCall(moduleID, methodID, args, function (data) { + return resolve(data); + }, function (errorData) { + return reject(updateErrorWithErrorData(errorData, enqueueingFrameError)); + }); + }); + }; + } else { + fn = function nonPromiseMethodWrapper() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + var lastArg = args.length > 0 ? args[args.length - 1] : null; + var secondLastArg = args.length > 1 ? args[args.length - 2] : null; + var hasSuccessCallback = typeof lastArg === 'function'; + var hasErrorCallback = typeof secondLastArg === 'function'; + hasErrorCallback && _$$_REQUIRE(_dependencyMap[1])(hasSuccessCallback, 'Cannot have a non-function arg after a function arg.'); + var onSuccess = hasSuccessCallback ? lastArg : null; + var onFail = hasErrorCallback ? secondLastArg : null; + var callbackCount = hasSuccessCallback + hasErrorCallback; + var newArgs = args.slice(0, args.length - callbackCount); + + if (type === 'sync') { + return _$$_REQUIRE(_dependencyMap[3]).callNativeSyncHook(moduleID, methodID, newArgs, onFail, onSuccess); + } else { + _$$_REQUIRE(_dependencyMap[3]).enqueueNativeCall(moduleID, methodID, newArgs, onFail, onSuccess); + } + }; + } + + fn.type = type; + return fn; + } + + function arrayContains(array, value) { + return array.indexOf(value) !== -1; + } + + function updateErrorWithErrorData(errorData, error) { + return _$$_REQUIRE(_dependencyMap[2])(error, errorData || {}); + } + + var NativeModules = {}; + + if (global.nativeModuleProxy) { + NativeModules = global.nativeModuleProxy; + } else if (!global.nativeExtensions) { + var bridgeConfig = global.__fbBatchedBridgeConfig; + + _$$_REQUIRE(_dependencyMap[1])(bridgeConfig, '__fbBatchedBridgeConfig is not set, cannot invoke native modules'); + + var defineLazyObjectProperty = _$$_REQUIRE(_dependencyMap[4]); + + (bridgeConfig.remoteModuleConfig || []).forEach(function (config, moduleID) { + var info = genModule(config, moduleID); + + if (!info) { + return; + } + + if (info.module) { + NativeModules[info.name] = info.module; + } else { + defineLazyObjectProperty(NativeModules, info.name, { + get: function get() { + return loadModule(info.name, moduleID); + } + }); + } + }); + } + + module.exports = NativeModules; +},40,[41,36,6,45,50]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _slicedToArray(arr, i) { + return _$$_REQUIRE(_dependencyMap[0])(arr) || _$$_REQUIRE(_dependencyMap[1])(arr, i) || _$$_REQUIRE(_dependencyMap[2])(arr, i) || _$$_REQUIRE(_dependencyMap[3])(); + } + + module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},41,[42,43,25,44]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; + } + + module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; +},42,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _iterableToArrayLimit(r, l) { + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; + + if (null != t) { + var e, + n, + i, + u, + a = [], + f = true, + o = false; + + try { + if (i = (t = t.call(r)).next, 0 === l) { + if (Object(t) !== t) return; + f = false; + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = true) { + ; + } + } catch (r) { + o = true, n = r; + } finally { + try { + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; + } finally { + if (o) throw n; + } + } + + return a; + } + } + + module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; +},43,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); + } + + module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; +},44,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var BatchedBridge = new (_$$_REQUIRE(_dependencyMap[0]))(); + Object.defineProperty(global, '__fbBatchedBridge', { + configurable: true, + value: BatchedBridge + }); + module.exports = BatchedBridge; +},45,[46]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var TO_JS = 0; + var TO_NATIVE = 1; + var MODULE_IDS = 0; + var METHOD_IDS = 1; + var PARAMS = 2; + var MIN_TIME_BETWEEN_FLUSHES_MS = 5; + var TRACE_TAG_REACT_APPS = 131072; + var DEBUG_INFO_LIMIT = 32; + + var MessageQueue = function () { + function MessageQueue() { + _$$_REQUIRE(_dependencyMap[0])(this, MessageQueue); + + this._lazyCallableModules = {}; + this._queue = [[], [], [], 0]; + this._successCallbacks = new Map(); + this._failureCallbacks = new Map(); + this._callID = 0; + this._lastFlush = 0; + this._eventLoopStartTime = Date.now(); + this._reactNativeMicrotasksCallback = null; + this.callFunctionReturnFlushedQueue = this.callFunctionReturnFlushedQueue.bind(this); + this.flushedQueue = this.flushedQueue.bind(this); + this.invokeCallbackAndReturnFlushedQueue = this.invokeCallbackAndReturnFlushedQueue.bind(this); + } + + _$$_REQUIRE(_dependencyMap[1])(MessageQueue, [{ + key: "callFunctionReturnFlushedQueue", + value: function callFunctionReturnFlushedQueue(module, method, args) { + var _this = this; + + this.__guard(function () { + _this.__callFunction(module, method, args); + }); + + return this.flushedQueue(); + } + }, { + key: "invokeCallbackAndReturnFlushedQueue", + value: function invokeCallbackAndReturnFlushedQueue(cbID, args) { + var _this2 = this; + + this.__guard(function () { + _this2.__invokeCallback(cbID, args); + }); + + return this.flushedQueue(); + } + }, { + key: "flushedQueue", + value: function flushedQueue() { + var _this3 = this; + + this.__guard(function () { + _this3.__callReactNativeMicrotasks(); + }); + + var queue = this._queue; + this._queue = [[], [], [], this._callID]; + return queue[0].length ? queue : null; + } + }, { + key: "getEventLoopRunningTime", + value: function getEventLoopRunningTime() { + return Date.now() - this._eventLoopStartTime; + } + }, { + key: "registerCallableModule", + value: function registerCallableModule(name, module) { + this._lazyCallableModules[name] = function () { + return module; + }; + } + }, { + key: "registerLazyCallableModule", + value: function registerLazyCallableModule(name, factory) { + var module; + var getValue = factory; + + this._lazyCallableModules[name] = function () { + if (getValue) { + module = getValue(); + getValue = null; + } + + return module; + }; + } + }, { + key: "getCallableModule", + value: function getCallableModule(name) { + var getValue = this._lazyCallableModules[name]; + return getValue ? getValue() : null; + } + }, { + key: "callNativeSyncHook", + value: function callNativeSyncHook(moduleID, methodID, params, onFail, onSucc) { + this.processCallbacks(moduleID, methodID, params, onFail, onSucc); + return global.nativeCallSyncHook(moduleID, methodID, params); + } + }, { + key: "processCallbacks", + value: function processCallbacks(moduleID, methodID, params, onFail, onSucc) { + var _this4 = this; + + if (onFail || onSucc) { + onFail && params.push(this._callID << 1); + onSucc && params.push(this._callID << 1 | 1); + + this._successCallbacks.set(this._callID, onSucc); + + this._failureCallbacks.set(this._callID, onFail); + } + + this._callID++; + } + }, { + key: "enqueueNativeCall", + value: function enqueueNativeCall(moduleID, methodID, params, onFail, onSucc) { + this.processCallbacks(moduleID, methodID, params, onFail, onSucc); + + this._queue[MODULE_IDS].push(moduleID); + + this._queue[METHOD_IDS].push(methodID); + + this._queue[PARAMS].push(params); + + var now = Date.now(); + + if (global.nativeFlushQueueImmediate && now - this._lastFlush >= MIN_TIME_BETWEEN_FLUSHES_MS) { + var queue = this._queue; + this._queue = [[], [], [], this._callID]; + this._lastFlush = now; + global.nativeFlushQueueImmediate(queue); + } + + _$$_REQUIRE(_dependencyMap[2]).counterEvent('pending_js_to_native_queue', this._queue[0].length); + + if (this.__spy) { + this.__spy({ + type: TO_NATIVE, + module: moduleID + '', + method: methodID, + args: params + }); + } + } + }, { + key: "createDebugLookup", + value: function createDebugLookup(moduleID, name, methods) {} + }, { + key: "setReactNativeMicrotasksCallback", + value: function setReactNativeMicrotasksCallback(fn) { + this._reactNativeMicrotasksCallback = fn; + } + }, { + key: "__guard", + value: function __guard(fn) { + if (this.__shouldPauseOnThrow()) { + fn(); + } else { + try { + fn(); + } catch (error) { + _$$_REQUIRE(_dependencyMap[3]).reportFatalError(error); + } + } + } + }, { + key: "__shouldPauseOnThrow", + value: function __shouldPauseOnThrow() { + return typeof DebuggerInternal !== 'undefined' && DebuggerInternal.shouldPauseOnThrow === true; + } + }, { + key: "__callReactNativeMicrotasks", + value: function __callReactNativeMicrotasks() { + _$$_REQUIRE(_dependencyMap[2]).beginEvent('JSTimers.callReactNativeMicrotasks()'); + + if (this._reactNativeMicrotasksCallback != null) { + this._reactNativeMicrotasksCallback(); + } + + _$$_REQUIRE(_dependencyMap[2]).endEvent(); + } + }, { + key: "__callFunction", + value: function __callFunction(module, method, args) { + this._lastFlush = Date.now(); + this._eventLoopStartTime = this._lastFlush; + + if (this.__spy) { + _$$_REQUIRE(_dependencyMap[2]).beginEvent(module + "." + method + "(" + _$$_REQUIRE(_dependencyMap[4]).default(args) + ")"); + } else { + _$$_REQUIRE(_dependencyMap[2]).beginEvent(module + "." + method + "(...)"); + } + + if (this.__spy) { + this.__spy({ + type: TO_JS, + module: module, + method: method, + args: args + }); + } + + var moduleMethods = this.getCallableModule(module); + + _$$_REQUIRE(_dependencyMap[5])(!!moduleMethods, "Module " + module + " is not a registered callable module (calling " + method + "). A frequent cause of the error is that the application entry file path is incorrect.\n This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native."); + + _$$_REQUIRE(_dependencyMap[5])(!!moduleMethods[method], "Method " + method + " does not exist on module " + module); + + moduleMethods[method].apply(moduleMethods, args); + + _$$_REQUIRE(_dependencyMap[2]).endEvent(); + } + }, { + key: "__invokeCallback", + value: function __invokeCallback(cbID, args) { + this._lastFlush = Date.now(); + this._eventLoopStartTime = this._lastFlush; + var callID = cbID >>> 1; + var isSuccess = cbID & 1; + var callback = isSuccess ? this._successCallbacks.get(callID) : this._failureCallbacks.get(callID); + + if (!callback) { + return; + } + + this._successCallbacks.delete(callID); + + this._failureCallbacks.delete(callID); + + callback.apply(undefined, _$$_REQUIRE(_dependencyMap[6])(args)); + } + }], [{ + key: "spy", + value: function spy(spyOrToggle) { + if (spyOrToggle === true) { + MessageQueue.prototype.__spy = function (info) {}; + } else if (spyOrToggle === false) { + MessageQueue.prototype.__spy = null; + } else { + MessageQueue.prototype.__spy = spyOrToggle; + } + } + }]); + + return MessageQueue; + }(); + + module.exports = MessageQueue; +},46,[7,8,47,48,49,36,21]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var TRACE_TAG_REACT_APPS = 131072; + var TRACE_TAG_JS_VM_CALLS = 134217728; + var _enabled = false; + var _asyncCookie = 0; + var _markStack = []; + + var _markStackIndex = -1; + + var _canInstallReactHook = false; + var REACT_MARKER = "\u269B"; + var userTimingPolyfill = null; + var Systrace = { + installReactHook: function installReactHook() { + if (_enabled) {} + + _canInstallReactHook = true; + }, + setEnabled: function setEnabled(enabled) { + if (_enabled !== enabled) { + _enabled = enabled; + } + }, + isEnabled: function isEnabled() { + return _enabled; + }, + beginEvent: function beginEvent(profileName, args) { + if (_enabled) { + var profileNameString = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceBeginSection(TRACE_TAG_REACT_APPS, profileNameString, args); + } + }, + endEvent: function endEvent() { + if (_enabled) { + global.nativeTraceEndSection(TRACE_TAG_REACT_APPS); + } + }, + beginAsyncEvent: function beginAsyncEvent(profileName) { + var cookie = _asyncCookie; + + if (_enabled) { + _asyncCookie++; + var profileNameString = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceBeginAsyncSection(TRACE_TAG_REACT_APPS, profileNameString, cookie); + } + + return cookie; + }, + endAsyncEvent: function endAsyncEvent(profileName, cookie) { + if (_enabled) { + var profileNameString = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceEndAsyncSection(TRACE_TAG_REACT_APPS, profileNameString, cookie); + } + }, + counterEvent: function counterEvent(profileName, value) { + if (_enabled) { + var profileNameString = typeof profileName === 'function' ? profileName() : profileName; + global.nativeTraceCounter && global.nativeTraceCounter(TRACE_TAG_REACT_APPS, profileNameString, value); + } + } + }; + module.exports = Systrace; +},47,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = global.ErrorUtils; +},48,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createStringifySafeWithLimits = createStringifySafeWithLimits; + exports.default = undefined; + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function createStringifySafeWithLimits(limits) { + var _limits$maxDepth = limits.maxDepth, + maxDepth = _limits$maxDepth === undefined ? Number.POSITIVE_INFINITY : _limits$maxDepth, + _limits$maxStringLimi = limits.maxStringLimit, + maxStringLimit = _limits$maxStringLimi === undefined ? Number.POSITIVE_INFINITY : _limits$maxStringLimi, + _limits$maxArrayLimit = limits.maxArrayLimit, + maxArrayLimit = _limits$maxArrayLimit === undefined ? Number.POSITIVE_INFINITY : _limits$maxArrayLimit, + _limits$maxObjectKeys = limits.maxObjectKeysLimit, + maxObjectKeysLimit = _limits$maxObjectKeys === undefined ? Number.POSITIVE_INFINITY : _limits$maxObjectKeys; + var stack = []; + + function replacer(key, value) { + while (stack.length && this !== stack[0]) { + stack.shift(); + } + + if (typeof value === 'string') { + var truncatedString = '...(truncated)...'; + + if (value.length > maxStringLimit + truncatedString.length) { + return value.substring(0, maxStringLimit) + truncatedString; + } + + return value; + } + + if (typeof value !== 'object' || value === null) { + return value; + } + + var retval = value; + + if (Array.isArray(value)) { + if (stack.length >= maxDepth) { + retval = "[ ... array with " + value.length + " values ... ]"; + } else if (value.length > maxArrayLimit) { + retval = value.slice(0, maxArrayLimit).concat(["... extra " + (value.length - maxArrayLimit) + " values truncated ..."]); + } + } else { + (0, _invariant.default)(typeof value === 'object', 'This was already found earlier'); + var keys = Object.keys(value); + + if (stack.length >= maxDepth) { + retval = "{ ... object with " + keys.length + " keys ... }"; + } else if (keys.length > maxObjectKeysLimit) { + retval = {}; + + for (var _iterator = _createForOfIteratorHelperLoose(keys.slice(0, maxObjectKeysLimit)), _step; !(_step = _iterator()).done;) { + var k = _step.value; + retval[k] = value[k]; + } + + var truncatedKey = '...(truncated keys)...'; + retval[truncatedKey] = keys.length - maxObjectKeysLimit; + } + } + + stack.unshift(retval); + return retval; + } + + return function stringifySafe(arg) { + if (arg === undefined) { + return 'undefined'; + } else if (arg === null) { + return 'null'; + } else if (typeof arg === 'function') { + try { + return arg.toString(); + } catch (e) { + return '[function unknown]'; + } + } else if (arg instanceof Error) { + return arg.name + ': ' + arg.message; + } else { + try { + var ret = JSON.stringify(arg, replacer); + + if (ret === undefined) { + return '["' + typeof arg + '" failed to stringify]'; + } + + return ret; + } catch (e) { + if (typeof arg.toString === 'function') { + try { + return arg.toString(); + } catch (E) {} + } + } + } + + return '["' + typeof arg + '" failed to stringify]'; + }; + } + + var stringifySafe = createStringifySafeWithLimits({ + maxDepth: 10, + maxStringLimit: 100, + maxArrayLimit: 50, + maxObjectKeysLimit: 50 + }); + var _default = stringifySafe; + exports.default = _default; +},49,[5,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function defineLazyObjectProperty(object, name, descriptor) { + var get = descriptor.get; + var enumerable = descriptor.enumerable !== false; + var writable = descriptor.writable !== false; + var value; + var valueSet = false; + + function getValue() { + if (!valueSet) { + valueSet = true; + setValue(get()); + } + + return value; + } + + function setValue(newValue) { + value = newValue; + valueSet = true; + Object.defineProperty(object, name, { + value: newValue, + configurable: true, + enumerable: enumerable, + writable: writable + }); + } + + Object.defineProperty(object, name, { + get: getValue, + set: setValue, + configurable: true, + enumerable: enumerable + }); + } + + module.exports = defineLazyObjectProperty; +},50,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('AccessibilityInfo'); + + exports.default = _default; +},51,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('AccessibilityManager'); + + exports.default = _default; +},52,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeAccessibilityManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function legacySendAccessibilityEvent(reactTag, eventType) { + if (eventType === 'focus' && _NativeAccessibilityManager.default) { + _NativeAccessibilityManager.default.setAccessibilityFocus(reactTag); + } + } + + module.exports = legacySendAccessibilityEvent; +},53,[5,52]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ReactNative; + { + ReactNative = _$$_REQUIRE(_dependencyMap[0]); + } + module.exports = ReactNative; +},54,[55]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + _$$_REQUIRE(_dependencyMap[0]); + + var React = _$$_REQUIRE(_dependencyMap[1]); + + function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + + try { + func.apply(context, funcArgs); + } catch (error) { + this.onError(error); + } + } + + var hasError = false, + caughtError = null, + hasRethrowError = false, + rethrowError = null, + reporter = { + onError: function onError(error) { + hasError = true; + caughtError = error; + } + }; + + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl.apply(reporter, arguments); + } + + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + + if (hasError) { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + } else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."); + + hasRethrowError || (hasRethrowError = true, rethrowError = error); + } + } + + var isArrayImpl = Array.isArray, + getFiberCurrentPropsFromNode = null, + getInstanceFromNode = null, + getNodeFromInstance = null; + + function executeDispatch(event, listener, inst) { + var type = event.type || "unknown-event"; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; + } + + function executeDirectDispatch(event) { + var dispatchListener = event._dispatchListeners, + dispatchInstance = event._dispatchInstances; + if (isArrayImpl(dispatchListener)) throw Error("executeDirectDispatch(...): Invalid `event`."); + event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null; + dispatchListener = dispatchListener ? dispatchListener(event) : null; + event.currentTarget = null; + event._dispatchListeners = null; + event._dispatchInstances = null; + return dispatchListener; + } + + function functionThatReturnsTrue() { + return true; + } + + function functionThatReturnsFalse() { + return false; + } + + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + this.dispatchConfig = dispatchConfig; + this._targetInst = targetInst; + this.nativeEvent = nativeEvent; + this._dispatchInstances = this._dispatchListeners = null; + dispatchConfig = this.constructor.Interface; + + for (var propName in dispatchConfig) { + dispatchConfig.hasOwnProperty(propName) && ((targetInst = dispatchConfig[propName]) ? this[propName] = targetInst(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]); + } + + this.isDefaultPrevented = (null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : false === nativeEvent.returnValue) ? functionThatReturnsTrue : functionThatReturnsFalse; + this.isPropagationStopped = functionThatReturnsFalse; + return this; + } + + _$$_REQUIRE(_dependencyMap[2])(SyntheticEvent.prototype, { + preventDefault: function preventDefault() { + this.defaultPrevented = true; + var event = this.nativeEvent; + event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = false), this.isDefaultPrevented = functionThatReturnsTrue); + }, + stopPropagation: function stopPropagation() { + var event = this.nativeEvent; + event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = true), this.isPropagationStopped = functionThatReturnsTrue); + }, + persist: function persist() { + this.isPersistent = functionThatReturnsTrue; + }, + isPersistent: functionThatReturnsFalse, + destructor: function destructor() { + var Interface = this.constructor.Interface, + propName; + + for (propName in Interface) { + this[propName] = null; + } + + this.nativeEvent = this._targetInst = this.dispatchConfig = null; + this.isPropagationStopped = this.isDefaultPrevented = functionThatReturnsFalse; + this._dispatchInstances = this._dispatchListeners = null; + } + }); + + SyntheticEvent.Interface = { + type: null, + target: null, + currentTarget: function currentTarget() { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function timeStamp(event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null + }; + + SyntheticEvent.extend = function (Interface) { + function E() {} + + function Class() { + return Super.apply(this, arguments); + } + + var Super = this; + E.prototype = Super.prototype; + var prototype = new E(); + + _$$_REQUIRE(_dependencyMap[2])(prototype, Class.prototype); + + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.Interface = _$$_REQUIRE(_dependencyMap[2])({}, Super.Interface, Interface); + Class.extend = Super.extend; + addEventPoolingTo(Class); + return Class; + }; + + addEventPoolingTo(SyntheticEvent); + + function createOrGetPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { + if (this.eventPool.length) { + var instance = this.eventPool.pop(); + this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); + return instance; + } + + return new this(dispatchConfig, targetInst, nativeEvent, nativeInst); + } + + function releasePooledEvent(event) { + if (!(event instanceof this)) throw Error("Trying to release an event instance into a pool of a different type."); + event.destructor(); + 10 > this.eventPool.length && this.eventPool.push(event); + } + + function addEventPoolingTo(EventConstructor) { + EventConstructor.getPooled = createOrGetPooledEvent; + EventConstructor.eventPool = []; + EventConstructor.release = releasePooledEvent; + } + + var ResponderSyntheticEvent = SyntheticEvent.extend({ + touchHistory: function touchHistory() { + return null; + } + }); + + function isStartish(topLevelType) { + return "topTouchStart" === topLevelType; + } + + function isMoveish(topLevelType) { + return "topTouchMove" === topLevelType; + } + + var startDependencies = ["topTouchStart"], + moveDependencies = ["topTouchMove"], + endDependencies = ["topTouchCancel", "topTouchEnd"], + touchBank = [], + touchHistory = { + touchBank: touchBank, + numberActiveTouches: 0, + indexOfSingleActiveTouch: -1, + mostRecentTimeStamp: 0 + }; + + function timestampForTouch(touch) { + return touch.timeStamp || touch.timestamp; + } + + function getTouchIdentifier(_ref) { + _ref = _ref.identifier; + if (null == _ref) throw Error("Touch object is missing identifier."); + return _ref; + } + + function recordTouchStart(touch) { + var identifier = getTouchIdentifier(touch), + touchRecord = touchBank[identifier]; + touchRecord ? (touchRecord.touchActive = true, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch)) : (touchRecord = { + touchActive: true, + startPageX: touch.pageX, + startPageY: touch.pageY, + startTimeStamp: timestampForTouch(touch), + currentPageX: touch.pageX, + currentPageY: touch.pageY, + currentTimeStamp: timestampForTouch(touch), + previousPageX: touch.pageX, + previousPageY: touch.pageY, + previousTimeStamp: timestampForTouch(touch) + }, touchBank[identifier] = touchRecord); + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } + + function recordTouchMove(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord && (touchRecord.touchActive = true, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)); + } + + function recordTouchEnd(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord && (touchRecord.touchActive = false, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)); + } + + var instrumentationCallback, + ResponderTouchHistoryStore = { + instrument: function instrument(callback) { + instrumentationCallback = callback; + }, + recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) { + null != instrumentationCallback && instrumentationCallback(topLevelType, nativeEvent); + if (isMoveish(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove);else if (isStartish(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier);else if ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType) if (nativeEvent.changedTouches.forEach(recordTouchEnd), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches) for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++) { + if (nativeEvent = touchBank[topLevelType], null != nativeEvent && nativeEvent.touchActive) { + touchHistory.indexOfSingleActiveTouch = topLevelType; + break; + } + } + }, + touchHistory: touchHistory + }; + + function accumulate(current, next) { + if (null == next) throw Error("accumulate(...): Accumulated items must not be null or undefined."); + return null == current ? next : isArrayImpl(current) ? current.concat(next) : isArrayImpl(next) ? [current].concat(next) : [current, next]; + } + + function accumulateInto(current, next) { + if (null == next) throw Error("accumulateInto(...): Accumulated items must not be null or undefined."); + if (null == current) return next; + + if (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; + current.push(next); + return current; + } + + return isArrayImpl(next) ? [current].concat(next) : [current, next]; + } + + function forEachAccumulated(arr, cb, scope) { + Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); + } + + var responderInst = null, + trackedTouchCount = 0; + + function changeResponder(nextResponderInst, blockHostResponder) { + var oldResponderInst = responderInst; + responderInst = nextResponderInst; + if (null !== ResponderEventPlugin.GlobalResponderHandler) ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); + } + + var eventTypes = { + startShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onStartShouldSetResponder", + captured: "onStartShouldSetResponderCapture" + }, + dependencies: startDependencies + }, + scrollShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onScrollShouldSetResponder", + captured: "onScrollShouldSetResponderCapture" + }, + dependencies: ["topScroll"] + }, + selectionChangeShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onSelectionChangeShouldSetResponder", + captured: "onSelectionChangeShouldSetResponderCapture" + }, + dependencies: ["topSelectionChange"] + }, + moveShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onMoveShouldSetResponder", + captured: "onMoveShouldSetResponderCapture" + }, + dependencies: moveDependencies + }, + responderStart: { + registrationName: "onResponderStart", + dependencies: startDependencies + }, + responderMove: { + registrationName: "onResponderMove", + dependencies: moveDependencies + }, + responderEnd: { + registrationName: "onResponderEnd", + dependencies: endDependencies + }, + responderRelease: { + registrationName: "onResponderRelease", + dependencies: endDependencies + }, + responderTerminationRequest: { + registrationName: "onResponderTerminationRequest", + dependencies: [] + }, + responderGrant: { + registrationName: "onResponderGrant", + dependencies: [] + }, + responderReject: { + registrationName: "onResponderReject", + dependencies: [] + }, + responderTerminate: { + registrationName: "onResponderTerminate", + dependencies: [] + } + }; + + function getParent(inst) { + do { + inst = inst.return; + } while (inst && 5 !== inst.tag); + + return inst ? inst : null; + } + + function traverseTwoPhase(inst, fn, arg) { + for (var path = []; inst;) { + path.push(inst), inst = getParent(inst); + } + + for (inst = path.length; 0 < inst--;) { + fn(path[inst], "captured", arg); + } + + for (inst = 0; inst < path.length; inst++) { + fn(path[inst], "bubbled", arg); + } + } + + function getListener(inst, registrationName) { + inst = inst.stateNode; + if (null === inst) return null; + inst = getFiberCurrentPropsFromNode(inst); + if (null === inst) return null; + if ((inst = inst[registrationName]) && "function" !== typeof inst) throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof inst + "` type."); + return inst; + } + + function accumulateDirectionalDispatches(inst, phase, event) { + if (phase = getListener(inst, event.dispatchConfig.phasedRegistrationNames[phase])) event._dispatchListeners = accumulateInto(event._dispatchListeners, phase), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + + function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + var inst = event._targetInst; + + if (inst && event && event.dispatchConfig.registrationName) { + var listener = getListener(inst, event.dispatchConfig.registrationName); + listener && (event._dispatchListeners = accumulateInto(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst)); + } + } + } + + function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst; + targetInst = targetInst ? getParent(targetInst) : null; + traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event); + } + } + + function accumulateTwoPhaseDispatchesSingle(event) { + event && event.dispatchConfig.phasedRegistrationNames && traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } + + var ResponderEventPlugin = { + _getResponder: function _getResponder() { + return responderInst; + }, + eventTypes: eventTypes, + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (isStartish(topLevelType)) trackedTouchCount += 1;else if ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType) if (0 <= trackedTouchCount) --trackedTouchCount;else return null; + ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); + + if (targetInst && ("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll || 0 < trackedTouchCount && "topSelectionChange" === topLevelType || isStartish(topLevelType) || isMoveish(topLevelType))) { + var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder; + if (responderInst) b: { + var JSCompiler_temp = responderInst; + + for (var depthA = 0, tempA = JSCompiler_temp; tempA; tempA = getParent(tempA)) { + depthA++; + } + + tempA = 0; + + for (var tempB = targetInst; tempB; tempB = getParent(tempB)) { + tempA++; + } + + for (; 0 < depthA - tempA;) { + JSCompiler_temp = getParent(JSCompiler_temp), depthA--; + } + + for (; 0 < tempA - depthA;) { + targetInst = getParent(targetInst), tempA--; + } + + for (; depthA--;) { + if (JSCompiler_temp === targetInst || JSCompiler_temp === targetInst.alternate) break b; + JSCompiler_temp = getParent(JSCompiler_temp); + targetInst = getParent(targetInst); + } + + JSCompiler_temp = null; + } else JSCompiler_temp = targetInst; + targetInst = JSCompiler_temp; + JSCompiler_temp = targetInst === responderInst; + shouldSetEventType = ResponderSyntheticEvent.getPooled(shouldSetEventType, targetInst, nativeEvent, nativeEventTarget); + shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory; + JSCompiler_temp ? forEachAccumulated(shouldSetEventType, accumulateTwoPhaseDispatchesSingleSkipTarget) : forEachAccumulated(shouldSetEventType, accumulateTwoPhaseDispatchesSingle); + + b: { + JSCompiler_temp = shouldSetEventType._dispatchListeners; + targetInst = shouldSetEventType._dispatchInstances; + if (isArrayImpl(JSCompiler_temp)) for (depthA = 0; depthA < JSCompiler_temp.length && !shouldSetEventType.isPropagationStopped(); depthA++) { + if (JSCompiler_temp[depthA](shouldSetEventType, targetInst[depthA])) { + JSCompiler_temp = targetInst[depthA]; + break b; + } + } else if (JSCompiler_temp && JSCompiler_temp(shouldSetEventType, targetInst)) { + JSCompiler_temp = targetInst; + break b; + } + JSCompiler_temp = null; + } + + shouldSetEventType._dispatchInstances = null; + shouldSetEventType._dispatchListeners = null; + shouldSetEventType.isPersistent() || shouldSetEventType.constructor.release(shouldSetEventType); + if (JSCompiler_temp && JSCompiler_temp !== responderInst) { + if (shouldSetEventType = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, JSCompiler_temp, nativeEvent, nativeEventTarget), shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(shouldSetEventType, accumulateDirectDispatchesSingle), targetInst = true === executeDirectDispatch(shouldSetEventType), responderInst) { + if (depthA = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget), depthA.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(depthA, accumulateDirectDispatchesSingle), tempA = !depthA._dispatchListeners || executeDirectDispatch(depthA), depthA.isPersistent() || depthA.constructor.release(depthA), tempA) { + depthA = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); + depthA.touchHistory = ResponderTouchHistoryStore.touchHistory; + forEachAccumulated(depthA, accumulateDirectDispatchesSingle); + var JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, [shouldSetEventType, depthA]); + changeResponder(JSCompiler_temp, targetInst); + } else shouldSetEventType = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, JSCompiler_temp, nativeEvent, nativeEventTarget), shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(shouldSetEventType, accumulateDirectDispatchesSingle), JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, shouldSetEventType); + } else JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, shouldSetEventType), changeResponder(JSCompiler_temp, targetInst); + } else JSCompiler_temp$jscomp$0 = null; + } else JSCompiler_temp$jscomp$0 = null; + + shouldSetEventType = responderInst && isStartish(topLevelType); + JSCompiler_temp = responderInst && isMoveish(topLevelType); + targetInst = responderInst && ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType); + if (shouldSetEventType = shouldSetEventType ? eventTypes.responderStart : JSCompiler_temp ? eventTypes.responderMove : targetInst ? eventTypes.responderEnd : null) shouldSetEventType = ResponderSyntheticEvent.getPooled(shouldSetEventType, responderInst, nativeEvent, nativeEventTarget), shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(shouldSetEventType, accumulateDirectDispatchesSingle), JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, shouldSetEventType); + shouldSetEventType = responderInst && "topTouchCancel" === topLevelType; + if (topLevelType = responderInst && !shouldSetEventType && ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType)) a: { + if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length) for (JSCompiler_temp = 0; JSCompiler_temp < topLevelType.length; JSCompiler_temp++) { + if (targetInst = topLevelType[JSCompiler_temp].target, null !== targetInst && undefined !== targetInst && 0 !== targetInst) { + depthA = getInstanceFromNode(targetInst); + + b: { + for (targetInst = responderInst; depthA;) { + if (targetInst === depthA || targetInst === depthA.alternate) { + targetInst = true; + break b; + } + + depthA = getParent(depthA); + } + + targetInst = false; + } + + if (targetInst) { + topLevelType = false; + break a; + } + } + } + topLevelType = true; + } + if (topLevelType = shouldSetEventType ? eventTypes.responderTerminate : topLevelType ? eventTypes.responderRelease : null) nativeEvent = ResponderSyntheticEvent.getPooled(topLevelType, responderInst, nativeEvent, nativeEventTarget), nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle), JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, nativeEvent), changeResponder(null); + return JSCompiler_temp$jscomp$0; + }, + GlobalResponderHandler: null, + injection: { + injectGlobalResponderHandler: function injectGlobalResponderHandler(GlobalResponderHandler) { + ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + } + } + }, + eventPluginOrder = null, + namesToPlugins = {}; + + function recomputePluginOrdering() { + if (eventPluginOrder) for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName], + pluginIndex = eventPluginOrder.indexOf(pluginName); + if (!(-1 < pluginIndex)) throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`."); + + if (!plugins[pluginIndex]) { + if (!pluginModule.extractEvents) throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not."); + plugins[pluginIndex] = pluginModule; + pluginIndex = pluginModule.eventTypes; + + for (var eventName in pluginIndex) { + var JSCompiler_inline_result = undefined; + var dispatchConfig = pluginIndex[eventName], + eventName$jscomp$0 = eventName; + if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0)) throw Error("EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName$jscomp$0 + "`."); + eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + if (phasedRegistrationNames) { + for (JSCompiler_inline_result in phasedRegistrationNames) { + phasedRegistrationNames.hasOwnProperty(JSCompiler_inline_result) && publishRegistrationName(phasedRegistrationNames[JSCompiler_inline_result], pluginModule, eventName$jscomp$0); + } + + JSCompiler_inline_result = true; + } else dispatchConfig.registrationName ? (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName$jscomp$0), JSCompiler_inline_result = true) : JSCompiler_inline_result = false; + + if (!JSCompiler_inline_result) throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`."); + } + } + } + } + + function publishRegistrationName(registrationName, pluginModule) { + if (registrationNameModules[registrationName]) throw Error("EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`."); + registrationNameModules[registrationName] = pluginModule; + } + + var plugins = [], + eventNameDispatchConfigs = {}, + registrationNameModules = {}; + + function getListener$1(inst, registrationName) { + inst = inst.stateNode; + if (null === inst) return null; + inst = getFiberCurrentPropsFromNode(inst); + if (null === inst) return null; + if ((inst = inst[registrationName]) && "function" !== typeof inst) throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof inst + "` type."); + return inst; + } + + var customBubblingEventTypes = _$$_REQUIRE(_dependencyMap[3]).ReactNativeViewConfigRegistry.customBubblingEventTypes, + customDirectEventTypes = _$$_REQUIRE(_dependencyMap[3]).ReactNativeViewConfigRegistry.customDirectEventTypes; + + function accumulateDirectionalDispatches$1(inst, phase, event) { + if (phase = getListener$1(inst, event.dispatchConfig.phasedRegistrationNames[phase])) event._dispatchListeners = accumulateInto(event._dispatchListeners, phase), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + + function accumulateTwoPhaseDispatchesSingle$1(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + for (var inst = event._targetInst, path = []; inst;) { + path.push(inst); + + do { + inst = inst.return; + } while (inst && 5 !== inst.tag); + + inst = inst ? inst : null; + } + + for (inst = path.length; 0 < inst--;) { + accumulateDirectionalDispatches$1(path[inst], "captured", event); + } + + for (inst = 0; inst < path.length; inst++) { + accumulateDirectionalDispatches$1(path[inst], "bubbled", event); + } + } + } + + function accumulateDirectDispatchesSingle$1(event) { + if (event && event.dispatchConfig.registrationName) { + var inst = event._targetInst; + + if (inst && event && event.dispatchConfig.registrationName) { + var listener = getListener$1(inst, event.dispatchConfig.registrationName); + listener && (event._dispatchListeners = accumulateInto(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst)); + } + } + } + + if (eventPluginOrder) throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."); + eventPluginOrder = Array.prototype.slice.call(["ResponderEventPlugin", "ReactNativeBridgeEventPlugin"]); + recomputePluginOrdering(); + var injectedNamesToPlugins$jscomp$inline_219 = { + ResponderEventPlugin: ResponderEventPlugin, + ReactNativeBridgeEventPlugin: { + eventTypes: {}, + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (null == targetInst) return null; + var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], + directDispatchConfig = customDirectEventTypes[topLevelType]; + if (!bubbleDispatchConfig && !directDispatchConfig) throw Error('Unsupported top level event type "' + topLevelType + '" dispatched'); + topLevelType = SyntheticEvent.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); + if (bubbleDispatchConfig) forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle$1);else if (directDispatchConfig) forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle$1);else return null; + return topLevelType; + } + } + }, + isOrderingDirty$jscomp$inline_220 = false, + pluginName$jscomp$inline_221; + + for (pluginName$jscomp$inline_221 in injectedNamesToPlugins$jscomp$inline_219) { + if (injectedNamesToPlugins$jscomp$inline_219.hasOwnProperty(pluginName$jscomp$inline_221)) { + var pluginModule$jscomp$inline_222 = injectedNamesToPlugins$jscomp$inline_219[pluginName$jscomp$inline_221]; + + if (!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_221) || namesToPlugins[pluginName$jscomp$inline_221] !== pluginModule$jscomp$inline_222) { + if (namesToPlugins[pluginName$jscomp$inline_221]) throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName$jscomp$inline_221 + "`."); + namesToPlugins[pluginName$jscomp$inline_221] = pluginModule$jscomp$inline_222; + isOrderingDirty$jscomp$inline_220 = true; + } + } + } + + isOrderingDirty$jscomp$inline_220 && recomputePluginOrdering(); + var instanceCache = new Map(), + instanceProps = new Map(); + + function getInstanceFromTag(tag) { + return instanceCache.get(tag) || null; + } + + function batchedUpdatesImpl(fn, bookkeeping) { + return fn(bookkeeping); + } + + var isInsideEventHandler = false; + + function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) return fn(bookkeeping); + isInsideEventHandler = true; + + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + } + } + + var eventQueue = null; + + function executeDispatchesAndReleaseTopLevel(e) { + if (e) { + var dispatchListeners = e._dispatchListeners, + dispatchInstances = e._dispatchInstances; + if (isArrayImpl(dispatchListeners)) for (var i = 0; i < dispatchListeners.length && !e.isPropagationStopped(); i++) { + executeDispatch(e, dispatchListeners[i], dispatchInstances[i]); + } else dispatchListeners && executeDispatch(e, dispatchListeners, dispatchInstances); + e._dispatchListeners = null; + e._dispatchInstances = null; + e.isPersistent() || e.constructor.release(e); + } + } + + var EMPTY_NATIVE_EVENT = {}; + + function _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam) { + var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT, + inst = getInstanceFromTag(rootNodeID), + target = null; + null != inst && (target = inst.stateNode); + batchedUpdates(function () { + var JSCompiler_inline_result = target; + + for (var events = null, legacyPlugins = plugins, i = 0; i < legacyPlugins.length; i++) { + var possiblePlugin = legacyPlugins[i]; + possiblePlugin && (possiblePlugin = possiblePlugin.extractEvents(topLevelType, inst, nativeEvent, JSCompiler_inline_result)) && (events = accumulateInto(events, possiblePlugin)); + } + + JSCompiler_inline_result = events; + null !== JSCompiler_inline_result && (eventQueue = accumulateInto(eventQueue, JSCompiler_inline_result)); + JSCompiler_inline_result = eventQueue; + eventQueue = null; + + if (JSCompiler_inline_result) { + forEachAccumulated(JSCompiler_inline_result, executeDispatchesAndReleaseTopLevel); + if (eventQueue) throw Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."); + if (hasRethrowError) throw JSCompiler_inline_result = rethrowError, hasRethrowError = false, rethrowError = null, JSCompiler_inline_result; + } + }); + } + + _$$_REQUIRE(_dependencyMap[3]).RCTEventEmitter.register({ + receiveEvent: function receiveEvent(rootNodeID, topLevelType, nativeEventParam) { + _receiveRootNodeIDEvent(rootNodeID, topLevelType, nativeEventParam); + }, + receiveTouches: function receiveTouches(eventTopLevelType, touches, changedIndices) { + if ("topTouchEnd" === eventTopLevelType || "topTouchCancel" === eventTopLevelType) { + var JSCompiler_temp = []; + + for (var i = 0; i < changedIndices.length; i++) { + var index$0 = changedIndices[i]; + JSCompiler_temp.push(touches[index$0]); + touches[index$0] = null; + } + + for (i = changedIndices = 0; i < touches.length; i++) { + index$0 = touches[i], null !== index$0 && (touches[changedIndices++] = index$0); + } + + touches.length = changedIndices; + } else for (JSCompiler_temp = [], i = 0; i < changedIndices.length; i++) { + JSCompiler_temp.push(touches[changedIndices[i]]); + } + + for (changedIndices = 0; changedIndices < JSCompiler_temp.length; changedIndices++) { + i = JSCompiler_temp[changedIndices]; + i.changedTouches = JSCompiler_temp; + i.touches = touches; + index$0 = null; + var target = i.target; + null === target || undefined === target || 1 > target || (index$0 = target); + + _receiveRootNodeIDEvent(index$0, eventTopLevelType, i); + } + } + }); + + getFiberCurrentPropsFromNode = function getFiberCurrentPropsFromNode(stateNode) { + return instanceProps.get(stateNode._nativeTag) || null; + }; + + getInstanceFromNode = getInstanceFromTag; + + getNodeFromInstance = function getNodeFromInstance(inst) { + inst = inst.stateNode; + var tag = inst._nativeTag; + undefined === tag && (inst = inst.canonical, tag = inst._nativeTag); + if (!tag) throw Error("All native instances should have a tag."); + return inst; + }; + + ResponderEventPlugin.injection.injectGlobalResponderHandler({ + onChange: function onChange(from, to, blockNativeResponder) { + null !== to ? _$$_REQUIRE(_dependencyMap[3]).UIManager.setJSResponder(to.stateNode._nativeTag, blockNativeResponder) : _$$_REQUIRE(_dependencyMap[3]).UIManager.clearJSResponder(); + } + }); + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + REACT_ELEMENT_TYPE = 60103, + REACT_PORTAL_TYPE = 60106, + REACT_FRAGMENT_TYPE = 60107, + REACT_STRICT_MODE_TYPE = 60108, + REACT_PROFILER_TYPE = 60114, + REACT_PROVIDER_TYPE = 60109, + REACT_CONTEXT_TYPE = 60110, + REACT_FORWARD_REF_TYPE = 60112, + REACT_SUSPENSE_TYPE = 60113, + REACT_SUSPENSE_LIST_TYPE = 60120, + REACT_MEMO_TYPE = 60115, + REACT_LAZY_TYPE = 60116, + REACT_DEBUG_TRACING_MODE_TYPE = 60129, + REACT_OFFSCREEN_TYPE = 60130, + REACT_LEGACY_HIDDEN_TYPE = 60131, + REACT_CACHE_TYPE = 60132; + + if ("function" === typeof Symbol && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor("react.element"); + REACT_PORTAL_TYPE = symbolFor("react.portal"); + REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); + REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); + REACT_PROFILER_TYPE = symbolFor("react.profiler"); + REACT_PROVIDER_TYPE = symbolFor("react.provider"); + REACT_CONTEXT_TYPE = symbolFor("react.context"); + REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); + REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); + REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); + REACT_MEMO_TYPE = symbolFor("react.memo"); + REACT_LAZY_TYPE = symbolFor("react.lazy"); + symbolFor("react.scope"); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); + REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); + REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); + REACT_CACHE_TYPE = symbolFor("react.cache"); + } + + var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator; + + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; + } + + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) return type.displayName || type.name || null; + if ("string" === typeof type) return type; + + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + + case REACT_PORTAL_TYPE: + return "Portal"; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + + case REACT_SUSPENSE_TYPE: + return "Suspense"; + + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + + case REACT_CACHE_TYPE: + return "Cache"; + } + + if ("object" === typeof type) switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return (type.displayName || "Context") + ".Consumer"; + + case REACT_PROVIDER_TYPE: + return (type._context.displayName || "Context") + ".Provider"; + + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); + return type; + + case REACT_MEMO_TYPE: + return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; + + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + + } + return null; + } + + function getComponentNameFromFiber(fiber) { + var type = fiber.type; + + switch (fiber.tag) { + case 24: + return "Cache"; + + case 9: + return (type.displayName || "Context") + ".Consumer"; + + case 10: + return (type._context.displayName || "Context") + ".Provider"; + + case 18: + return "DehydratedFragment"; + + case 11: + return fiber = type.render, fiber = fiber.displayName || fiber.name || "", type.displayName || ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef"); + + case 7: + return "Fragment"; + + case 5: + return type; + + case 4: + return "Portal"; + + case 3: + return "Root"; + + case 6: + return "Text"; + + case 16: + return getComponentNameFromType(type); + + case 23: + return "LegacyHidden"; + + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + + case 22: + return "Offscreen"; + + case 12: + return "Profiler"; + + case 21: + return "Scope"; + + case 13: + return "Suspense"; + + case 19: + return "SuspenseList"; + + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if ("function" === typeof type) return type.displayName || type.name || null; + if ("string" === typeof type) return type; + } + + return null; + } + + function getNearestMountedFiber(fiber) { + var node = fiber, + nearestMounted = fiber; + if (fiber.alternate) for (; node.return;) { + node = node.return; + } else { + fiber = node; + + do { + node = fiber, 0 !== (node.flags & 2050) && (nearestMounted = node.return), fiber = node.return; + } while (fiber); + } + return 3 === node.tag ? nearestMounted : null; + } + + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) throw Error("Unable to find node on an unmounted component."); + } + + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) throw Error("Unable to find node on an unmounted component."); + return alternate !== fiber ? null : fiber; + } + + for (var a = fiber, b = alternate;;) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + + if (null === parentB) { + b = parentA.return; + + if (null !== b) { + a = b; + continue; + } + + break; + } + + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB;) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + + throw Error("Unable to find node on an unmounted component."); + } + + if (a.return !== b.return) a = parentA, b = parentB;else { + for (var didFindChild = false, child$1 = parentA.child; child$1;) { + if (child$1 === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + + if (child$1 === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + + child$1 = child$1.sibling; + } + + if (!didFindChild) { + for (child$1 = parentB.child; child$1;) { + if (child$1 === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + + if (child$1 === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + + child$1 = child$1.sibling; + } + + if (!didFindChild) throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."); + } + } + if (a.alternate !== b) throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."); + } + + if (3 !== a.tag) throw Error("Unable to find node on an unmounted component."); + return a.stateNode.current === a ? fiber : alternate; + } + + function findCurrentHostFiber(parent) { + parent = findCurrentFiberUsingSlowPath(parent); + return null !== parent ? findCurrentHostFiberImpl(parent) : null; + } + + function findCurrentHostFiberImpl(node) { + if (5 === node.tag || 6 === node.tag) return node; + + for (node = node.child; null !== node;) { + var match = findCurrentHostFiberImpl(node); + if (null !== match) return match; + node = node.sibling; + } + + return null; + } + + var emptyObject = {}, + removedKeys = null, + removedKeyCount = 0, + deepDifferOptions = { + unsafelyIgnoreFunctions: true + }; + + function defaultDiffer(prevProp, nextProp) { + return "object" !== typeof nextProp || null === nextProp ? true : _$$_REQUIRE(_dependencyMap[3]).deepDiffer(prevProp, nextProp, deepDifferOptions); + } + + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (isArrayImpl(node)) for (var i = node.length; i-- && 0 < removedKeyCount;) { + restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); + } else if (node && 0 < removedKeyCount) for (i in removedKeys) { + if (removedKeys[i]) { + var nextProp = node[i]; + + if (undefined !== nextProp) { + var attributeConfig = validAttributes[i]; + + if (attributeConfig) { + "function" === typeof nextProp && (nextProp = true); + "undefined" === typeof nextProp && (nextProp = null); + if ("object" !== typeof attributeConfig) updatePayload[i] = nextProp;else if ("function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process) nextProp = "function" === typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, updatePayload[i] = nextProp; + removedKeys[i] = false; + removedKeyCount--; + } + } + } + } + } + + function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + if (!updatePayload && prevProp === nextProp) return updatePayload; + if (!prevProp || !nextProp) return nextProp ? addNestedProperty(updatePayload, nextProp, validAttributes) : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload; + if (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); + + if (isArrayImpl(prevProp) && isArrayImpl(nextProp)) { + var minLength = prevProp.length < nextProp.length ? prevProp.length : nextProp.length, + i; + + for (i = 0; i < minLength; i++) { + updatePayload = diffNestedProperty(updatePayload, prevProp[i], nextProp[i], validAttributes); + } + + for (; i < prevProp.length; i++) { + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + + for (; i < nextProp.length; i++) { + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + + return updatePayload; + } + + return isArrayImpl(prevProp) ? diffProperties(updatePayload, _$$_REQUIRE(_dependencyMap[3]).flattenStyle(prevProp), nextProp, validAttributes) : diffProperties(updatePayload, prevProp, _$$_REQUIRE(_dependencyMap[3]).flattenStyle(nextProp), validAttributes); + } + + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) return updatePayload; + if (!isArrayImpl(nextProp)) return diffProperties(updatePayload, emptyObject, nextProp, validAttributes); + + for (var i = 0; i < nextProp.length; i++) { + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + + return updatePayload; + } + + function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) return updatePayload; + if (!isArrayImpl(prevProp)) return diffProperties(updatePayload, prevProp, emptyObject, validAttributes); + + for (var i = 0; i < prevProp.length; i++) { + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + + return updatePayload; + } + + function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig, propKey; + + for (propKey in nextProps) { + if (attributeConfig = validAttributes[propKey]) { + var prevProp = prevProps[propKey]; + var nextProp = nextProps[propKey]; + "function" === typeof nextProp && (nextProp = true, "function" === typeof prevProp && (prevProp = true)); + "undefined" === typeof nextProp && (nextProp = null, "undefined" === typeof prevProp && (prevProp = null)); + removedKeys && (removedKeys[propKey] = false); + if (updatePayload && undefined !== updatePayload[propKey]) { + if ("object" !== typeof attributeConfig) updatePayload[propKey] = nextProp;else { + if ("function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process) attributeConfig = "function" === typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, updatePayload[propKey] = attributeConfig; + } + } else if (prevProp !== nextProp) if ("object" !== typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp);else if ("function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process) { + if (undefined === prevProp || ("function" === typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp))) attributeConfig = "function" === typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, (updatePayload || (updatePayload = {}))[propKey] = attributeConfig; + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), 0 < removedKeyCount && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), removedKeys = null); + } + } + + for (var propKey$3 in prevProps) { + undefined === nextProps[propKey$3] && (!(attributeConfig = validAttributes[propKey$3]) || updatePayload && undefined !== updatePayload[propKey$3] || (prevProp = prevProps[propKey$3], undefined !== prevProp && ("object" !== typeof attributeConfig || "function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey$3] = null, removedKeys || (removedKeys = {}), removedKeys[propKey$3] || (removedKeys[propKey$3] = true, removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig)))); + } + + return updatePayload; + } + + function mountSafeCallback_NOT_REALLY_SAFE(context, callback) { + return function () { + if (callback && ("boolean" !== typeof context.__isMounted || context.__isMounted)) return callback.apply(context, arguments); + }; + } + + var ReactNativeFiberHostComponent = function () { + function ReactNativeFiberHostComponent(tag, viewConfig) { + this._nativeTag = tag; + this._children = []; + this.viewConfig = viewConfig; + } + + var _proto = ReactNativeFiberHostComponent.prototype; + + _proto.blur = function () { + _$$_REQUIRE(_dependencyMap[3]).TextInputState.blurTextInput(this); + }; + + _proto.focus = function () { + _$$_REQUIRE(_dependencyMap[3]).TextInputState.focusTextInput(this); + }; + + _proto.measure = function (callback) { + _$$_REQUIRE(_dependencyMap[3]).UIManager.measure(this._nativeTag, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + + _proto.measureInWindow = function (callback) { + _$$_REQUIRE(_dependencyMap[3]).UIManager.measureInWindow(this._nativeTag, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + + _proto.measureLayout = function (relativeToNativeNode, onSuccess, onFail) { + if ("number" === typeof relativeToNativeNode) var relativeNode = relativeToNativeNode;else relativeToNativeNode._nativeTag && (relativeNode = relativeToNativeNode._nativeTag); + null != relativeNode && _$$_REQUIRE(_dependencyMap[3]).UIManager.measureLayout(this._nativeTag, relativeNode, mountSafeCallback_NOT_REALLY_SAFE(this, onFail), mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)); + }; + + _proto.setNativeProps = function (nativeProps) { + nativeProps = diffProperties(null, emptyObject, nativeProps, this.viewConfig.validAttributes); + null != nativeProps && _$$_REQUIRE(_dependencyMap[3]).UIManager.updateView(this._nativeTag, this.viewConfig.uiViewClassName, nativeProps); + }; + + return ReactNativeFiberHostComponent; + }(), + rendererID = null, + injectedHook = null; + + function onCommitRoot(root) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) try { + injectedHook.onCommitFiberRoot(rendererID, root, undefined, 128 === (root.current.flags & 128)); + } catch (err) {} + } + + var nextTransitionLane = 64, + nextRetryLane = 4194304; + + function getHighestPriorityLanes(lanes) { + switch (lanes & -lanes) { + case 1: + return 1; + + case 2: + return 2; + + case 4: + return 4; + + case 8: + return 8; + + case 16: + return 16; + + case 32: + return 32; + + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 4194240; + + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return lanes & 130023424; + + case 134217728: + return 134217728; + + case 268435456: + return 268435456; + + case 536870912: + return 536870912; + + case 1073741824: + return 1073741824; + + default: + return lanes; + } + } + + function getNextLanes(root, wipLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + nonIdlePendingLanes = pendingLanes & 268435455; + + if (0 !== nonIdlePendingLanes) { + var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; + 0 !== nonIdleUnblockedLanes ? nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes))); + } else nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes)); + + if (0 === nextLanes) return 0; + if (0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, pingedLanes = wipLanes & -wipLanes, suspendedLanes >= pingedLanes || 16 === suspendedLanes && 0 !== (pingedLanes & 4194240))) return wipLanes; + 0 !== (nextLanes & 4) && (nextLanes |= pendingLanes & 16); + wipLanes = root.entangledLanes; + if (0 !== wipLanes) for (root = root.entanglements, wipLanes &= nextLanes; 0 < wipLanes;) { + pendingLanes = 31 - clz32(wipLanes), suspendedLanes = 1 << pendingLanes, nextLanes |= root[pendingLanes], wipLanes &= ~suspendedLanes; + } + return nextLanes; + } + + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case 1: + case 2: + case 4: + return currentTime + 250; + + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return currentTime + 5e3; + + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + + default: + return -1; + } + } + + function getLanesToRetrySynchronouslyOnError(root) { + root = root.pendingLanes & -1073741825; + return 0 !== root ? root : root & 1073741824 ? 1073741824 : 0; + } + + function createLaneMap(initial) { + for (var laneMap = [], i = 0; 31 > i; i++) { + laneMap.push(initial); + } + + return laneMap; + } + + function markRootUpdated(root, updateLane, eventTime) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && (root.suspendedLanes = 0, root.pingedLanes = 0); + root = root.eventTimes; + updateLane = 31 - clz32(updateLane); + root[updateLane] = eventTime; + } + + function markRootFinished(root, remainingLanes) { + var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + root.pendingLanes = remainingLanes; + root.suspendedLanes = 0; + root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; + root.mutableReadLanes &= remainingLanes; + root.entangledLanes &= remainingLanes; + remainingLanes = root.entanglements; + var eventTimes = root.eventTimes; + + for (root = root.expirationTimes; 0 < noLongerPendingLanes;) { + var index$8 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$8; + remainingLanes[index$8] = 0; + eventTimes[index$8] = -1; + root[index$8] = -1; + noLongerPendingLanes &= ~lane; + } + } + + function markRootEntangled(root, entangledLanes) { + var rootEntangledLanes = root.entangledLanes |= entangledLanes; + + for (root = root.entanglements; rootEntangledLanes;) { + var index$9 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$9; + lane & entangledLanes | root[index$9] & entangledLanes && (root[index$9] |= entangledLanes); + rootEntangledLanes &= ~lane; + } + } + + var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, + log = Math.log, + LN2 = Math.LN2; + + function clz32Fallback(lanes) { + return 0 === lanes ? 32 : 31 - (log(lanes) / LN2 | 0) | 0; + } + + var currentUpdatePriority = 0; + + function lanesToEventPriority(lanes) { + lanes &= -lanes; + return 1 < lanes ? 4 < lanes ? 0 !== (lanes & 268435455) ? 16 : 536870912 : 4 : 1; + } + + function shim() { + throw Error("The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue."); + } + + var getViewConfigForType = _$$_REQUIRE(_dependencyMap[3]).ReactNativeViewConfigRegistry.get, + UPDATE_SIGNAL = {}, + nextReactTag = 3; + + function allocateTag() { + var tag = nextReactTag; + 1 === tag % 10 && (tag += 2); + nextReactTag = tag + 2; + return tag; + } + + function recursivelyUncacheFiberNode(node) { + if ("number" === typeof node) instanceCache.delete(node), instanceProps.delete(node);else { + var tag = node._nativeTag; + instanceCache.delete(tag); + instanceProps.delete(tag); + + node._children.forEach(recursivelyUncacheFiberNode); + } + } + + function finalizeInitialChildren(parentInstance) { + if (0 === parentInstance._children.length) return false; + + var nativeTags = parentInstance._children.map(function (child) { + return "number" === typeof child ? child : child._nativeTag; + }); + + _$$_REQUIRE(_dependencyMap[3]).UIManager.setChildren(parentInstance._nativeTag, nativeTags); + + return false; + } + + var scheduleTimeout = setTimeout, + cancelTimeout = clearTimeout; + + function describeComponentFrame(name, source, ownerName) { + source = ""; + ownerName && (source = " (created by " + ownerName + ")"); + return "\n in " + (name || "Unknown") + source; + } + + function describeFunctionComponentFrame(fn, source) { + return fn ? describeComponentFrame(fn.displayName || fn.name || null, source, null) : ""; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty, + valueStack = [], + index = -1; + + function createCursor(defaultValue) { + return { + current: defaultValue + }; + } + + function pop(cursor) { + 0 > index || (cursor.current = valueStack[index], valueStack[index] = null, index--); + } + + function push(cursor, value) { + index++; + valueStack[index] = cursor.current; + cursor.current = value; + } + + var emptyContextObject = {}, + contextStackCursor = createCursor(emptyContextObject), + didPerformWorkStackCursor = createCursor(false), + previousContext = emptyContextObject; + + function getMaskedContext(workInProgress, unmaskedContext) { + var contextTypes = workInProgress.type.contextTypes; + if (!contextTypes) return emptyContextObject; + var instance = workInProgress.stateNode; + if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) return instance.__reactInternalMemoizedMaskedChildContext; + var context = {}, + key; + + for (key in contextTypes) { + context[key] = unmaskedContext[key]; + } + + instance && (workInProgress = workInProgress.stateNode, workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext, workInProgress.__reactInternalMemoizedMaskedChildContext = context); + return context; + } + + function isContextProvider(type) { + type = type.childContextTypes; + return null !== type && undefined !== type; + } + + function popContext() { + pop(didPerformWorkStackCursor); + pop(contextStackCursor); + } + + function pushTopLevelContextObject(fiber, context, didChange) { + if (contextStackCursor.current !== emptyContextObject) throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."); + push(contextStackCursor, context); + push(didPerformWorkStackCursor, didChange); + } + + function processChildContext(fiber, type, parentContext) { + var instance = fiber.stateNode; + type = type.childContextTypes; + if ("function" !== typeof instance.getChildContext) return parentContext; + instance = instance.getChildContext(); + + for (var contextKey in instance) { + if (!(contextKey in type)) throw Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); + } + + return _$$_REQUIRE(_dependencyMap[2])({}, parentContext, instance); + } + + function pushContextProvider(workInProgress) { + workInProgress = (workInProgress = workInProgress.stateNode) && workInProgress.__reactInternalMemoizedMergedChildContext || emptyContextObject; + previousContext = contextStackCursor.current; + push(contextStackCursor, workInProgress); + push(didPerformWorkStackCursor, didPerformWorkStackCursor.current); + return true; + } + + function invalidateContextProvider(workInProgress, type, didChange) { + var instance = workInProgress.stateNode; + if (!instance) throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."); + didChange ? (workInProgress = processChildContext(workInProgress, type, previousContext), instance.__reactInternalMemoizedMergedChildContext = workInProgress, pop(didPerformWorkStackCursor), pop(contextStackCursor), push(contextStackCursor, workInProgress)) : pop(didPerformWorkStackCursor); + push(didPerformWorkStackCursor, didChange); + } + + var syncQueue = null, + includesLegacySyncCallbacks = false, + isFlushingSyncQueue = false; + + function flushSyncCallbacks() { + if (!isFlushingSyncQueue && null !== syncQueue) { + isFlushingSyncQueue = true; + var i = 0, + previousUpdatePriority = currentUpdatePriority; + + try { + var queue = syncQueue; + + for (currentUpdatePriority = 1; i < queue.length; i++) { + var callback = queue[i]; + + do { + callback = callback(true); + } while (null !== callback); + } + + syncQueue = null; + includesLegacySyncCallbacks = false; + } catch (error) { + throw null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[4]).unstable_ImmediatePriority, flushSyncCallbacks), error; + } finally { + currentUpdatePriority = previousUpdatePriority, isFlushingSyncQueue = false; + } + } + + return null; + } + + var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; + + function is(x, y) { + return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; + } + + var objectIs = "function" === typeof Object.is ? Object.is : is; + + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return true; + if ("object" !== typeof objA || null === objA || "object" !== typeof objB || null === objB) return false; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return false; + + for (keysB = 0; keysB < keysA.length; keysB++) { + if (!hasOwnProperty.call(objB, keysA[keysB]) || !objectIs(objA[keysA[keysB]], objB[keysA[keysB]])) return false; + } + + return true; + } + + function describeFiber(fiber) { + switch (fiber.tag) { + case 5: + return describeComponentFrame(fiber.type, null, null); + + case 16: + return describeComponentFrame("Lazy", null, null); + + case 13: + return describeComponentFrame("Suspense", null, null); + + case 19: + return describeComponentFrame("SuspenseList", null, null); + + case 0: + case 2: + case 15: + return describeFunctionComponentFrame(fiber.type, null); + + case 11: + return describeFunctionComponentFrame(fiber.type.render, null); + + case 1: + return fiber = describeFunctionComponentFrame(fiber.type, null), fiber; + + default: + return ""; + } + } + + function getStackByFiberInDevAndProd(workInProgress) { + try { + var info = ""; + + do { + info += describeFiber(workInProgress), workInProgress = workInProgress.return; + } while (workInProgress); + + return info; + } catch (x) { + return "\nError generating stack: " + x.message + "\n" + x.stack; + } + } + + function resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + baseProps = _$$_REQUIRE(_dependencyMap[2])({}, baseProps); + Component = Component.defaultProps; + + for (var propName in Component) { + undefined === baseProps[propName] && (baseProps[propName] = Component[propName]); + } + + return baseProps; + } + + return baseProps; + } + + var valueCursor = createCursor(null), + currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null; + + function resetContextDependencies() { + lastFullyObservedContext = lastContextDependency = currentlyRenderingFiber = null; + } + + function popProvider(context) { + var currentValue = valueCursor.current; + pop(valueCursor); + context._currentValue = currentValue; + } + + function scheduleWorkOnParentPath(parent, renderLanes) { + for (; null !== parent;) { + var alternate = parent.alternate; + if ((parent.childLanes & renderLanes) === renderLanes) { + if (null === alternate || (alternate.childLanes & renderLanes) === renderLanes) break;else alternate.childLanes |= renderLanes; + } else parent.childLanes |= renderLanes, null !== alternate && (alternate.childLanes |= renderLanes); + parent = parent.return; + } + } + + function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastFullyObservedContext = lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && null !== workInProgress.firstContext && (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = true), workInProgress.firstContext = null); + } + + function readContext(context) { + var value = context._currentValue; + if (lastFullyObservedContext !== context) if (context = { + context: context, + memoizedValue: value, + next: null + }, null === lastContextDependency) { + if (null === currentlyRenderingFiber) throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); + lastContextDependency = context; + currentlyRenderingFiber.dependencies = { + lanes: 0, + firstContext: context + }; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + + var interleavedQueues = null, + hasForceUpdate = false; + + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { + pending: null, + interleaved: null, + lanes: 0 + }, + effects: null + }; + } + + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + effects: current.effects + }); + } + + function createUpdate(eventTime, lane) { + return { + eventTime: eventTime, + lane: lane, + tag: 0, + payload: null, + callback: null, + next: null + }; + } + + function enqueueUpdate(fiber, update) { + var updateQueue = fiber.updateQueue; + null !== updateQueue && (updateQueue = updateQueue.shared, null !== workInProgressRoot && 0 !== (fiber.mode & 1) && 0 === (executionContext & 8) ? (fiber = updateQueue.interleaved, null === fiber ? (update.next = update, null === interleavedQueues ? interleavedQueues = [updateQueue] : interleavedQueues.push(updateQueue)) : (update.next = fiber.next, fiber.next = update), updateQueue.interleaved = update) : (fiber = updateQueue.pending, null === fiber ? update.next = update : (update.next = fiber.next, fiber.next = update), updateQueue.pending = update)); + } + + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + + if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194240))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } + } + + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + + if (null !== current && (current = current.updateQueue, queue === current)) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + + if (null !== queue) { + do { + var clone = { + eventTime: queue.eventTime, + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: queue.callback, + next: null + }; + null === newLast ? newFirst = newLast = clone : newLast = newLast.next = clone; + queue = queue.next; + } while (null !== queue); + + null === newLast ? newFirst = newLast = capturedUpdate : newLast = newLast.next = capturedUpdate; + } else newFirst = newLast = capturedUpdate; + + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + effects: current.effects + }; + workInProgress.updateQueue = queue; + return; + } + + workInProgress = queue.lastBaseUpdate; + null === workInProgress ? queue.firstBaseUpdate = capturedUpdate : workInProgress.next = capturedUpdate; + queue.lastBaseUpdate = capturedUpdate; + } + + function processUpdateQueue(workInProgress$jscomp$0, props, instance, renderLanes) { + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = false; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate.next = firstPendingUpdate; + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; + null !== current && (current = current.updateQueue, pendingQueue = current.lastBaseUpdate, pendingQueue !== lastBaseUpdate && (null === pendingQueue ? current.firstBaseUpdate = firstPendingUpdate : pendingQueue.next = firstPendingUpdate, current.lastBaseUpdate = lastPendingUpdate)); + } + + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + + do { + var updateLane = pendingQueue.lane, + updateEventTime = pendingQueue.eventTime; + + if ((renderLanes & updateLane) === updateLane) { + null !== current && (current = current.next = { + eventTime: updateEventTime, + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }); + + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + updateEventTime = instance; + + switch (update.tag) { + case 1: + workInProgress = update.payload; + + if ("function" === typeof workInProgress) { + newState = workInProgress.call(updateEventTime, newState, updateLane); + break a; + } + + newState = workInProgress; + break a; + + case 3: + workInProgress.flags = workInProgress.flags & -16385 | 128; + + case 0: + workInProgress = update.payload; + updateLane = "function" === typeof workInProgress ? workInProgress.call(updateEventTime, newState, updateLane) : workInProgress; + if (null === updateLane || undefined === updateLane) break a; + newState = _$$_REQUIRE(_dependencyMap[2])({}, newState, updateLane); + break a; + + case 2: + hasForceUpdate = true; + } + } + + null !== pendingQueue.callback && 0 !== pendingQueue.lane && (workInProgress$jscomp$0.flags |= 64, updateLane = queue.effects, null === updateLane ? queue.effects = [pendingQueue] : updateLane.push(pendingQueue)); + } else updateEventTime = { + eventTime: updateEventTime, + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }, null === current ? (firstPendingUpdate = current = updateEventTime, lastPendingUpdate = newState) : current = current.next = updateEventTime, lastBaseUpdate |= updateLane; + + pendingQueue = pendingQueue.next; + if (null === pendingQueue) if (pendingQueue = queue.shared.pending, null === pendingQueue) break;else updateLane = pendingQueue, pendingQueue = updateLane.next, updateLane.next = null, queue.lastBaseUpdate = updateLane, queue.shared.pending = null; + } while (1); + + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + props = queue.shared.interleaved; + + if (null !== props) { + queue = props; + + do { + lastBaseUpdate |= queue.lane, queue = queue.next; + } while (queue !== props); + } else null === firstBaseUpdate && (queue.shared.lanes = 0); + + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; + } + } + + function commitUpdateQueue(finishedWork, finishedQueue, instance) { + finishedWork = finishedQueue.effects; + finishedQueue.effects = null; + if (null !== finishedWork) for (finishedQueue = 0; finishedQueue < finishedWork.length; finishedQueue++) { + var effect = finishedWork[finishedQueue], + callback = effect.callback; + + if (null !== callback) { + effect.callback = null; + if ("function" !== typeof callback) throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback); + callback.call(instance); + } + } + } + + var emptyRefsObject = new React.Component().refs; + + function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = null === getDerivedStateFromProps || undefined === getDerivedStateFromProps ? ctor : _$$_REQUIRE(_dependencyMap[2])({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); + } + + var classComponentUpdater = { + isMounted: function isMounted(component) { + return (component = component._reactInternals) ? getNearestMountedFiber(component) === component : false; + }, + enqueueSetState: function enqueueSetState(inst, payload, callback) { + inst = inst._reactInternals; + var eventTime = requestEventTime(), + lane = requestUpdateLane(inst), + update = createUpdate(eventTime, lane); + update.payload = payload; + undefined !== callback && null !== callback && (update.callback = callback); + enqueueUpdate(inst, update); + payload = scheduleUpdateOnFiber(inst, lane, eventTime); + null !== payload && entangleTransitions(payload, inst, lane); + }, + enqueueReplaceState: function enqueueReplaceState(inst, payload, callback) { + inst = inst._reactInternals; + var eventTime = requestEventTime(), + lane = requestUpdateLane(inst), + update = createUpdate(eventTime, lane); + update.tag = 1; + update.payload = payload; + undefined !== callback && null !== callback && (update.callback = callback); + enqueueUpdate(inst, update); + payload = scheduleUpdateOnFiber(inst, lane, eventTime); + null !== payload && entangleTransitions(payload, inst, lane); + }, + enqueueForceUpdate: function enqueueForceUpdate(inst, callback) { + inst = inst._reactInternals; + var eventTime = requestEventTime(), + lane = requestUpdateLane(inst), + update = createUpdate(eventTime, lane); + update.tag = 2; + undefined !== callback && null !== callback && (update.callback = callback); + enqueueUpdate(inst, update); + callback = scheduleUpdateOnFiber(inst, lane, eventTime); + null !== callback && entangleTransitions(callback, inst, lane); + } + }; + + function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : true; + } + + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = false, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context ? context = readContext(context) : (unmaskedContext = isContextProvider(ctor) ? previousContext : contextStackCursor.current, isLegacyContextConsumer = ctor.contextTypes, context = (isLegacyContextConsumer = null !== isLegacyContextConsumer && undefined !== isLegacyContextConsumer) ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject); + ctor = new ctor(props, context); + workInProgress.memoizedState = null !== ctor.state && undefined !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && (workInProgress = workInProgress.stateNode, workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext, workInProgress.__reactInternalMemoizedMaskedChildContext = context); + return ctor; + } + + function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } + + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = emptyRefsObject; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + "object" === typeof contextType && null !== contextType ? instance.context = readContext(contextType) : (contextType = isContextProvider(ctor) ? previousContext : contextStackCursor.current, instance.context = getMaskedContext(workInProgress, contextType)); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), instance.state = workInProgress.memoizedState); + "function" === typeof ctor.getDerivedStateFromProps || "function" === typeof instance.getSnapshotBeforeUpdate || "function" !== typeof instance.UNSAFE_componentWillMount && "function" !== typeof instance.componentWillMount || (ctor = instance.state, "function" === typeof instance.componentWillMount && instance.componentWillMount(), "function" === typeof instance.UNSAFE_componentWillMount && instance.UNSAFE_componentWillMount(), ctor !== instance.state && classComponentUpdater.enqueueReplaceState(instance, instance.state, null), processUpdateQueue(workInProgress, newProps, instance, renderLanes), instance.state = workInProgress.memoizedState); + "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4); + } + + function coerceRef(returnFiber, current, element) { + returnFiber = element.ref; + + if (null !== returnFiber && "function" !== typeof returnFiber && "object" !== typeof returnFiber) { + if (element._owner) { + element = element._owner; + + if (element) { + if (1 !== element.tag) throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref"); + var inst = element.stateNode; + } + + if (!inst) throw Error("Missing owner for string ref " + returnFiber + ". This error is likely caused by a bug in React. Please file an issue."); + var stringRef = "" + returnFiber; + if (null !== current && null !== current.ref && "function" === typeof current.ref && current.ref._stringRef === stringRef) return current.ref; + + current = function current(value) { + var refs = inst.refs; + refs === emptyRefsObject && (refs = inst.refs = {}); + null === value ? delete refs[stringRef] : refs[stringRef] = value; + }; + + current._stringRef = stringRef; + return current; + } + + if ("string" !== typeof returnFiber) throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null."); + if (!element._owner) throw Error("Element ref was specified as a string (" + returnFiber + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information."); + } + + return returnFiber; + } + + function throwOnInvalidObjectType(returnFiber, newChild) { + returnFiber = Object.prototype.toString.call(newChild); + throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber) + "). If you meant to render a collection of children, use an array instead."); + } + + function ChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions ? (returnFiber.deletions = [childToDelete], returnFiber.flags |= 16) : deletions.push(childToDelete); + } + } + + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + + for (; null !== currentFirstChild;) { + deleteChild(returnFiber, currentFirstChild), currentFirstChild = currentFirstChild.sibling; + } + + return null; + } + + function mapRemainingChildren(returnFiber, currentFirstChild) { + for (returnFiber = new Map(); null !== currentFirstChild;) { + null !== currentFirstChild.key ? returnFiber.set(currentFirstChild.key, currentFirstChild) : returnFiber.set(currentFirstChild.index, currentFirstChild), currentFirstChild = currentFirstChild.sibling; + } + + return returnFiber; + } + + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) return lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) return newIndex = newIndex.index, newIndex < lastPlacedIndex ? (newFiber.flags |= 2, lastPlacedIndex) : newIndex; + newFiber.flags |= 2; + return lastPlacedIndex; + } + + function placeSingleChild(newFiber) { + shouldTrackSideEffects && null === newFiber.alternate && (newFiber.flags |= 2); + return newFiber; + } + + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) return current = createFiberFromText(textContent, returnFiber.mode, lanes), current.return = returnFiber, current; + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) return updateFragment(returnFiber, current, element.props.children, lanes, element.key); + if (null !== current && current.elementType === elementType) return lanes = useFiber(current, element.props), lanes.ref = coerceRef(returnFiber, current, element), lanes.return = returnFiber, lanes; + lanes = createFiberFromTypeAndProps(element.type, element.key, element.props, null, returnFiber.mode, lanes); + lanes.ref = coerceRef(returnFiber, current, element); + lanes.return = returnFiber; + return lanes; + } + + function updatePortal(returnFiber, current, portal, lanes) { + if (null === current || 4 !== current.tag || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) return current = createFiberFromPortal(portal, returnFiber.mode, lanes), current.return = returnFiber, current; + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) return current = createFiberFromFragment(fragment, returnFiber.mode, lanes, key), current.return = returnFiber, current; + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + + function createChild(returnFiber, newChild, lanes) { + if ("string" === typeof newChild || "number" === typeof newChild) return newChild = createFiberFromText("" + newChild, returnFiber.mode, lanes), newChild.return = returnFiber, newChild; + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return lanes = createFiberFromTypeAndProps(newChild.type, newChild.key, newChild.props, null, returnFiber.mode, lanes), lanes.ref = coerceRef(returnFiber, null, newChild), lanes.return = returnFiber, lanes; + + case REACT_PORTAL_TYPE: + return newChild = createFiberFromPortal(newChild, returnFiber.mode, lanes), newChild.return = returnFiber, newChild; + } + + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return newChild = createFiberFromFragment(newChild, returnFiber.mode, lanes, null), newChild.return = returnFiber, newChild; + throwOnInvalidObjectType(returnFiber, newChild); + } + + return null; + } + + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ("string" === typeof newChild || "number" === typeof newChild) return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, lanes) : null; + + case REACT_PORTAL_TYPE: + return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null; + } + + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + throwOnInvalidObjectType(returnFiber, newChild); + } + + return null; + } + + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) { + if ("string" === typeof newChild || "number" === typeof newChild) return existingChildren = existingChildren.get(newIdx) || null, updateTextNode(returnFiber, existingChildren, "" + newChild, lanes); + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return existingChildren = existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, updateElement(returnFiber, existingChildren, newChild, lanes); + + case REACT_PORTAL_TYPE: + return existingChildren = existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, updatePortal(returnFiber, existingChildren, newChild, lanes); + } + + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return existingChildren = existingChildren.get(newIdx) || null, updateFragment(returnFiber, existingChildren, newChild, lanes, null); + throwOnInvalidObjectType(returnFiber, newChild); + } + + return null; + } + + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) { + for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) { + oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes); + + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber; + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + + if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; + + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) { + oldFiber = createChild(returnFiber, newChildren[newIdx], lanes), null !== oldFiber && (currentFirstChild = placeChild(oldFiber, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber); + } + + return resultingFirstChild; + } + + for (oldFiber = mapRemainingChildren(returnFiber, oldFiber); newIdx < newChildren.length; newIdx++) { + nextOldFiber = updateFromMap(oldFiber, returnFiber, newIdx, newChildren[newIdx], lanes), null !== nextOldFiber && (shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(null === nextOldFiber.key ? newIdx : nextOldFiber.key), currentFirstChild = placeChild(nextOldFiber, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber); + } + + shouldTrackSideEffects && oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return resultingFirstChild; + } + + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) { + var iteratorFn = getIteratorFn(newChildrenIterable); + if ("function" !== typeof iteratorFn) throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."); + newChildrenIterable = iteratorFn.call(newChildrenIterable); + if (null == newChildrenIterable) throw Error("An iterable object provided no iterator."); + + for (var previousNewFiber = iteratorFn = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null, step = newChildrenIterable.next(); null !== oldFiber && !step.done; newIdx++, step = newChildrenIterable.next()) { + oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber ? iteratorFn = newFiber : previousNewFiber.sibling = newFiber; + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + + if (step.done) return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildrenIterable.next()) { + step = createChild(returnFiber, step.value, lanes), null !== step && (currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? iteratorFn = step : previousNewFiber.sibling = step, previousNewFiber = step); + } + + return iteratorFn; + } + + for (oldFiber = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, step = newChildrenIterable.next()) { + step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes), null !== step && (shouldTrackSideEffects && null !== step.alternate && oldFiber.delete(null === step.key ? newIdx : step.key), currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? iteratorFn = step : previousNewFiber.sibling = step, previousNewFiber = step); + } + + shouldTrackSideEffects && oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return iteratorFn; + } + + return function (returnFiber, currentFirstChild, newChild, lanes) { + var isUnkeyedTopLevelFragment = "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key; + isUnkeyedTopLevelFragment && (newChild = newChild.props.children); + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + var key = newChild.key; + + for (isUnkeyedTopLevelFragment = currentFirstChild; null !== isUnkeyedTopLevelFragment;) { + if (isUnkeyedTopLevelFragment.key === key) { + key = newChild.type; + + if (key === REACT_FRAGMENT_TYPE) { + if (7 === isUnkeyedTopLevelFragment.tag) { + deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment.sibling); + currentFirstChild = useFiber(isUnkeyedTopLevelFragment, newChild.props.children); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + } else if (isUnkeyedTopLevelFragment.elementType === key) { + deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment.sibling); + currentFirstChild = useFiber(isUnkeyedTopLevelFragment, newChild.props); + currentFirstChild.ref = coerceRef(returnFiber, isUnkeyedTopLevelFragment, newChild); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + + deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment); + break; + } else deleteChild(returnFiber, isUnkeyedTopLevelFragment); + + isUnkeyedTopLevelFragment = isUnkeyedTopLevelFragment.sibling; + } + + newChild.type === REACT_FRAGMENT_TYPE ? (currentFirstChild = createFiberFromFragment(newChild.props.children, returnFiber.mode, lanes, newChild.key), currentFirstChild.return = returnFiber, returnFiber = currentFirstChild) : (lanes = createFiberFromTypeAndProps(newChild.type, newChild.key, newChild.props, null, returnFiber.mode, lanes), lanes.ref = coerceRef(returnFiber, currentFirstChild, newChild), lanes.return = returnFiber, returnFiber = lanes); + } + + return placeSingleChild(returnFiber); + + case REACT_PORTAL_TYPE: + a: { + for (isUnkeyedTopLevelFragment = newChild.key; null !== currentFirstChild;) { + if (currentFirstChild.key === isUnkeyedTopLevelFragment) { + if (4 === currentFirstChild.tag && currentFirstChild.stateNode.containerInfo === newChild.containerInfo && currentFirstChild.stateNode.implementation === newChild.implementation) { + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + currentFirstChild = useFiber(currentFirstChild, newChild.children || []); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + + currentFirstChild = createFiberFromPortal(newChild, returnFiber.mode, lanes); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + } + + return placeSingleChild(returnFiber); + } + + if (isArrayImpl(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); + if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); + throwOnInvalidObjectType(returnFiber, newChild); + } + + if ("string" === typeof newChild || "number" === typeof newChild) return newChild = "" + newChild, null !== currentFirstChild && 6 === currentFirstChild.tag ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), currentFirstChild = useFiber(currentFirstChild, newChild), currentFirstChild.return = returnFiber, returnFiber = currentFirstChild) : (deleteRemainingChildren(returnFiber, currentFirstChild), currentFirstChild = createFiberFromText(newChild, returnFiber.mode, lanes), currentFirstChild.return = returnFiber, returnFiber = currentFirstChild), placeSingleChild(returnFiber); + if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment) switch (returnFiber.tag) { + case 1: + case 0: + case 11: + case 15: + throw Error((getComponentNameFromFiber(returnFiber) || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."); + } + return deleteRemainingChildren(returnFiber, currentFirstChild); + }; + } + + var reconcileChildFibers = ChildReconciler(true), + mountChildFibers = ChildReconciler(false), + NO_CONTEXT = {}, + contextStackCursor$1 = createCursor(NO_CONTEXT), + contextFiberStackCursor = createCursor(NO_CONTEXT), + rootInstanceStackCursor = createCursor(NO_CONTEXT); + + function requiredContext(c) { + if (c === NO_CONTEXT) throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."); + return c; + } + + function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance); + push(contextFiberStackCursor, fiber); + push(contextStackCursor$1, NO_CONTEXT); + pop(contextStackCursor$1); + push(contextStackCursor$1, { + isInAParentText: false + }); + } + + function popHostContainer() { + pop(contextStackCursor$1); + pop(contextFiberStackCursor); + pop(rootInstanceStackCursor); + } + + function pushHostContext(fiber) { + requiredContext(rootInstanceStackCursor.current); + var context = requiredContext(contextStackCursor$1.current); + var JSCompiler_inline_result = fiber.type; + JSCompiler_inline_result = "AndroidTextInput" === JSCompiler_inline_result || "RCTMultilineTextInputView" === JSCompiler_inline_result || "RCTSinglelineTextInputView" === JSCompiler_inline_result || "RCTText" === JSCompiler_inline_result || "RCTVirtualText" === JSCompiler_inline_result; + JSCompiler_inline_result = context.isInAParentText !== JSCompiler_inline_result ? { + isInAParentText: JSCompiler_inline_result + } : context; + context !== JSCompiler_inline_result && (push(contextFiberStackCursor, fiber), push(contextStackCursor$1, JSCompiler_inline_result)); + } + + function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && (pop(contextStackCursor$1), pop(contextFiberStackCursor)); + } + + var suspenseStackCursor = createCursor(0); + + function findFirstSuspended(row) { + for (var node = row; null !== node;) { + if (13 === node.tag) { + var state = node.memoizedState; + if (null !== state && (null === state.dehydrated || shim() || shim())) return node; + } else if (19 === node.tag && undefined !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === row) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + + return null; + } + + var workInProgressSources = []; + + function resetWorkInProgressVersions() { + for (var i = 0; i < workInProgressSources.length; i++) { + workInProgressSources[i]._workInProgressVersionPrimary = null; + } + + workInProgressSources.length = 0; + } + + var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig, + renderLanes = 0, + currentlyRenderingFiber$1 = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = false, + didScheduleRenderPhaseUpdateDuringThisPass = false; + + function throwInvalidHookError() { + throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); + } + + function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return false; + + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (!objectIs(nextDeps[i], prevDeps[i])) return false; + } + + return true; + } + + function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber$1 = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactCurrentDispatcher$1.current = null === current || null === current.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate; + current = Component(props, secondArg); + + if (didScheduleRenderPhaseUpdateDuringThisPass) { + nextRenderLanes = 0; + + do { + didScheduleRenderPhaseUpdateDuringThisPass = false; + if (!(25 > nextRenderLanes)) throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."); + nextRenderLanes += 1; + workInProgressHook = currentHook = null; + workInProgress.updateQueue = null; + ReactCurrentDispatcher$1.current = HooksDispatcherOnRerender; + current = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + } + + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + workInProgress = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + didScheduleRenderPhaseUpdate = false; + if (workInProgress) throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement."); + return current; + } + + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook ? currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook.next = hook; + return workInProgressHook; + } + + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber$1.alternate; + nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + + var nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber$1.memoizedState : workInProgressHook.next; + if (null !== nextWorkInProgressHook) workInProgressHook = nextWorkInProgressHook, currentHook = nextCurrentHook;else { + if (null === nextCurrentHook) throw Error("Rendered more hooks than during the previous render."); + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook ? currentlyRenderingFiber$1.memoizedState = workInProgressHook = nextCurrentHook : workInProgressHook = workInProgressHook.next = nextCurrentHook; + } + return workInProgressHook; + } + + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; + } + + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error("Should have a queue. This is likely a bug in React. Please file an issue."); + queue.lastRenderedReducer = reducer; + var current = currentHook, + baseQueue = current.baseQueue, + pendingQueue = queue.pending; + + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; + } + + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; + } + + if (null !== baseQueue) { + pendingQueue = baseQueue.next; + current = current.baseState; + var newBaseQueueFirst = baseFirst = null, + newBaseQueueLast = null, + update = pendingQueue; + + do { + var updateLane = update.lane; + if ((renderLanes & updateLane) === updateLane) null !== newBaseQueueLast && (newBaseQueueLast = newBaseQueueLast.next = { + lane: 0, + action: update.action, + eagerReducer: update.eagerReducer, + eagerState: update.eagerState, + next: null + }), current = update.eagerReducer === reducer ? update.eagerState : reducer(current, update.action);else { + var clone = { + lane: updateLane, + action: update.action, + eagerReducer: update.eagerReducer, + eagerState: update.eagerState, + next: null + }; + null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = clone, baseFirst = current) : newBaseQueueLast = newBaseQueueLast.next = clone; + currentlyRenderingFiber$1.lanes |= updateLane; + workInProgressRootSkippedLanes |= updateLane; + } + update = update.next; + } while (null !== update && update !== pendingQueue); + + null === newBaseQueueLast ? baseFirst = current : newBaseQueueLast.next = newBaseQueueFirst; + objectIs(current, hook.memoizedState) || (didReceiveUpdate = true); + hook.memoizedState = current; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = current; + } + + reducer = queue.interleaved; + + if (null !== reducer) { + baseQueue = reducer; + + do { + pendingQueue = baseQueue.lane, currentlyRenderingFiber$1.lanes |= pendingQueue, workInProgressRootSkippedLanes |= pendingQueue, baseQueue = baseQueue.next; + } while (baseQueue !== reducer); + } else null === baseQueue && (queue.lanes = 0); + + return [hook.memoizedState, queue.dispatch]; + } + + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error("Should have a queue. This is likely a bug in React. Please file an issue."); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; + + do { + newState = reducer(newState, update.action), update = update.next; + } while (update !== lastRenderPhaseUpdate); + + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + + return [newState, dispatch]; + } + + function readFromUnsubcribedMutableSource(root, source, getSnapshot) { + var getVersion = source._getVersion; + getVersion = getVersion(source._source); + var JSCompiler_inline_result = source._workInProgressVersionPrimary; + if (null !== JSCompiler_inline_result) root = JSCompiler_inline_result === getVersion;else if (root = root.mutableReadLanes, root = (renderLanes & root) === root) source._workInProgressVersionPrimary = getVersion, workInProgressSources.push(source); + if (root) return getSnapshot(source._source); + workInProgressSources.push(source); + throw Error("Cannot read from mutable source during the current render without tearing. This may be a bug in React. Please file an issue."); + } + + function _useMutableSource(hook, source, getSnapshot, subscribe) { + var root = workInProgressRoot; + if (null === root) throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + + var getVersion = source._getVersion, + version = getVersion(source._source), + dispatcher = ReactCurrentDispatcher$1.current, + _dispatcher$useState = dispatcher.useState(function () { + return readFromUnsubcribedMutableSource(root, source, getSnapshot); + }), + setSnapshot = _dispatcher$useState[1], + snapshot = _dispatcher$useState[0]; + + _dispatcher$useState = workInProgressHook; + var memoizedState = hook.memoizedState, + refs = memoizedState.refs, + prevGetSnapshot = refs.getSnapshot, + prevSource = memoizedState.source; + memoizedState = memoizedState.subscribe; + var fiber = currentlyRenderingFiber$1; + hook.memoizedState = { + refs: refs, + source: source, + subscribe: subscribe + }; + dispatcher.useEffect(function () { + refs.getSnapshot = getSnapshot; + refs.setSnapshot = setSnapshot; + var maybeNewVersion = getVersion(source._source); + objectIs(version, maybeNewVersion) || (maybeNewVersion = getSnapshot(source._source), objectIs(snapshot, maybeNewVersion) || (setSnapshot(maybeNewVersion), maybeNewVersion = requestUpdateLane(fiber), root.mutableReadLanes |= maybeNewVersion & root.pendingLanes), markRootEntangled(root, root.mutableReadLanes)); + }, [getSnapshot, source, subscribe]); + dispatcher.useEffect(function () { + return subscribe(source._source, function () { + var latestGetSnapshot = refs.getSnapshot, + latestSetSnapshot = refs.setSnapshot; + + try { + latestSetSnapshot(latestGetSnapshot(source._source)); + var lane = requestUpdateLane(fiber); + root.mutableReadLanes |= lane & root.pendingLanes; + } catch (error) { + latestSetSnapshot(function () { + throw error; + }); + } + }); + }, [source, subscribe]); + objectIs(prevGetSnapshot, getSnapshot) && objectIs(prevSource, source) && objectIs(memoizedState, subscribe) || (hook = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: snapshot + }, hook.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, hook), _dispatcher$useState.queue = hook, _dispatcher$useState.baseQueue = null, snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot), _dispatcher$useState.memoizedState = _dispatcher$useState.baseState = snapshot); + return snapshot; + } + + function updateMutableSource(source, getSnapshot, subscribe) { + var hook = updateWorkInProgressHook(); + return _useMutableSource(hook, source, getSnapshot, subscribe); + } + + function mountState(initialState) { + var hook = mountWorkInProgressHook(); + "function" === typeof initialState && (initialState = initialState()); + hook.memoizedState = hook.baseState = initialState; + initialState = hook.queue = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + initialState = initialState.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, initialState); + return [hook.memoizedState, initialState]; + } + + function pushEffect(tag, create, destroy, deps) { + tag = { + tag: tag, + create: create, + destroy: destroy, + deps: deps, + next: null + }; + create = currentlyRenderingFiber$1.updateQueue; + null === create ? (create = { + lastEffect: null + }, currentlyRenderingFiber$1.updateQueue = create, create.lastEffect = tag.next = tag) : (destroy = create.lastEffect, null === destroy ? create.lastEffect = tag.next = tag : (deps = destroy.next, destroy.next = tag, tag.next = deps, create.lastEffect = tag)); + return tag; + } + + function updateRef() { + return updateWorkInProgressHook().memoizedState; + } + + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(1 | hookFlags, create, undefined, undefined === deps ? null : deps); + } + + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = undefined === deps ? null : deps; + var destroy = undefined; + + if (null !== currentHook) { + var prevEffect = currentHook.memoizedState; + destroy = prevEffect.destroy; + + if (null !== deps && areHookInputsEqual(deps, prevEffect.deps)) { + hook.memoizedState = pushEffect(hookFlags, create, destroy, deps); + return; + } + } + + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(1 | hookFlags, create, destroy, deps); + } + + function mountEffect(create, deps) { + return mountEffectImpl(1049600, 4, create, deps); + } + + function updateEffect(create, deps) { + return updateEffectImpl(1024, 4, create, deps); + } + + function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); + } + + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) return create = create(), ref(create), function () { + ref(null); + }; + if (null !== ref && undefined !== ref) return create = create(), ref.current = create, function () { + ref.current = null; + }; + } + + function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && undefined !== deps ? deps.concat([ref]) : null; + return updateEffectImpl(4, 2, imperativeHandleEffect.bind(null, create, ref), deps); + } + + function mountDebugValue() {} + + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = undefined === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== prevState && null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; + } + + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = undefined === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== prevState && null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; + nextCreate = nextCreate(); + hook.memoizedState = [nextCreate, deps]; + return nextCreate; + } + + function startTransition(setPending, callback) { + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 0 !== previousPriority && 4 > previousPriority ? previousPriority : 4; + setPending(true); + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setPending(false), callback(); + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$1.transition = prevTransition; + } + } + + function dispatchAction(fiber, queue, action) { + var eventTime = requestEventTime(), + lane = requestUpdateLane(fiber), + update = { + lane: lane, + action: action, + eagerReducer: null, + eagerState: null, + next: null + }, + alternate = fiber.alternate; + if (fiber === currentlyRenderingFiber$1 || null !== alternate && alternate === currentlyRenderingFiber$1) didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true, lane = queue.pending, null === lane ? update.next = update : (update.next = lane.next, lane.next = update), queue.pending = update;else { + if (null !== workInProgressRoot && 0 !== (fiber.mode & 1) && 0 === (executionContext & 8)) { + var interleaved = queue.interleaved; + null === interleaved ? (update.next = update, null === interleavedQueues ? interleavedQueues = [queue] : interleavedQueues.push(queue)) : (update.next = interleaved.next, interleaved.next = update); + queue.interleaved = update; + } else interleaved = queue.pending, null === interleaved ? update.next = update : (update.next = interleaved.next, interleaved.next = update), queue.pending = update; + + if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate)) try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.eagerReducer = alternate; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return; + } catch (error) {} finally {} + update = scheduleUpdateOnFiber(fiber, lane, eventTime); + 0 !== (lane & 4194240) && null !== update && (fiber = queue.lanes, fiber &= update.pendingLanes, lane |= fiber, queue.lanes = lane, markRootEntangled(update, lane)); + } + } + + var ContextOnlyDispatcher = { + readContext: readContext, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useMutableSource: throwInvalidHookError, + useOpaqueIdentifier: throwInvalidHookError, + unstable_isNewReconciler: false + }, + HooksDispatcherOnMount = { + readContext: readContext, + useCallback: function useCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [callback, undefined === deps ? null : deps]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + deps = null !== deps && undefined !== deps ? deps.concat([ref]) : null; + return mountEffectImpl(4, 2, imperativeHandleEffect.bind(null, create, ref), deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + return mountEffectImpl(4, 2, create, deps); + }, + useMemo: function useMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = undefined === deps ? null : deps; + nextCreate = nextCreate(); + hook.memoizedState = [nextCreate, deps]; + return nextCreate; + }, + useReducer: function useReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + initialArg = undefined !== init ? init(initialArg) : initialArg; + hook.memoizedState = hook.baseState = initialArg; + reducer = hook.queue = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialArg + }; + reducer = reducer.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, reducer); + return [hook.memoizedState, reducer]; + }, + useRef: function useRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { + current: initialValue + }; + return hook.memoizedState = initialValue; + }, + useState: mountState, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var _mountState = mountState(value), + prevValue = _mountState[0], + setValue = _mountState[1]; + + mountEffect(function () { + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.transition = prevTransition; + } + }, [value]); + return prevValue; + }, + useTransition: function useTransition() { + var _mountState2 = mountState(false), + isPending = _mountState2[0]; + + _mountState2 = startTransition.bind(null, _mountState2[1]); + mountWorkInProgressHook().memoizedState = _mountState2; + return [isPending, _mountState2]; + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = { + refs: { + getSnapshot: getSnapshot, + setSnapshot: null + }, + source: source, + subscribe: subscribe + }; + return _useMutableSource(hook, source, getSnapshot, subscribe); + }, + useOpaqueIdentifier: function useOpaqueIdentifier() { + throw Error("Not yet implemented"); + }, + unstable_isNewReconciler: false + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function useState() { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var _updateState = updateReducer(basicStateReducer), + prevValue = _updateState[0], + setValue = _updateState[1]; + + updateEffect(function () { + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.transition = prevTransition; + } + }, [value]); + return prevValue; + }, + useTransition: function useTransition() { + var isPending = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useOpaqueIdentifier: function useOpaqueIdentifier() { + return updateReducer(basicStateReducer)[0]; + }, + unstable_isNewReconciler: false + }, + HooksDispatcherOnRerender = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function useState() { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var _rerenderState = rerenderReducer(basicStateReducer), + prevValue = _rerenderState[0], + setValue = _rerenderState[1]; + + updateEffect(function () { + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.transition = prevTransition; + } + }, [value]); + return prevValue; + }, + useTransition: function useTransition() { + var isPending = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useOpaqueIdentifier: function useOpaqueIdentifier() { + return rerenderReducer(basicStateReducer)[0]; + }, + unstable_isNewReconciler: false + }; + + function createCapturedValue(value, source) { + return { + value: value, + source: source, + stack: getStackByFiberInDevAndProd(source) + }; + } + + if ("function" !== typeof _$$_REQUIRE(_dependencyMap[3]).ReactFiberErrorDialog.showErrorDialog) throw Error("Expected ReactFiberErrorDialog.showErrorDialog to be a function."); + + function logCapturedError(boundary, errorInfo) { + try { + false !== _$$_REQUIRE(_dependencyMap[3]).ReactFiberErrorDialog.showErrorDialog({ + componentStack: null !== errorInfo.stack ? errorInfo.stack : "", + error: errorInfo.value, + errorBoundary: null !== boundary && 1 === boundary.tag ? boundary.stateNode : null + }) && console.error(errorInfo.value); + } catch (e) { + setTimeout(function () { + throw e; + }); + } + } + + var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map; + + function createRootErrorUpdate(fiber, errorInfo, lane) { + lane = createUpdate(-1, lane); + lane.tag = 3; + lane.payload = { + element: null + }; + var error = errorInfo.value; + + lane.callback = function () { + hasUncaughtError || (hasUncaughtError = true, firstUncaughtError = error); + logCapturedError(fiber, errorInfo); + }; + + return lane; + } + + function createClassErrorUpdate(fiber, errorInfo, lane) { + lane = createUpdate(-1, lane); + lane.tag = 3; + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + + lane.payload = function () { + logCapturedError(fiber, errorInfo); + return getDerivedStateFromError(error); + }; + } + + var inst = fiber.stateNode; + null !== inst && "function" === typeof inst.componentDidCatch && (lane.callback = function () { + "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this), logCapturedError(fiber, errorInfo)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); + return lane; + } + + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner, + didReceiveUpdate = false; + + function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = null === current ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) : reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes); + } + + function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { + Component = Component.render; + var ref = workInProgress.ref; + prepareToReadContext(workInProgress, renderLanes); + nextProps = renderWithHooks(current, workInProgress, Component, nextProps, ref, renderLanes); + if (null !== current && !didReceiveUpdate) return workInProgress.updateQueue = current.updateQueue, workInProgress.flags &= -1029, current.lanes &= ~renderLanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + + function updateMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) { + if (null === current) { + var type = Component.type; + if ("function" === typeof type && !shouldConstruct(type) && undefined === type.defaultProps && null === Component.compare && undefined === Component.defaultProps) return workInProgress.tag = 15, workInProgress.type = type, updateSimpleMemoComponent(current, workInProgress, type, nextProps, updateLanes, renderLanes); + current = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + + type = current.child; + if (0 === (updateLanes & renderLanes) && (updateLanes = type.memoizedProps, Component = Component.compare, Component = null !== Component ? Component : shallowEqual, Component(updateLanes, nextProps) && current.ref === workInProgress.ref)) return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + + function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) { + if (null !== current && shallowEqual(current.memoizedProps, nextProps) && current.ref === workInProgress.ref) { + didReceiveUpdate = false; + if (0 === (renderLanes & updateLanes)) return workInProgress.lanes = current.lanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + 0 !== (current.flags & 32768) && (didReceiveUpdate = true); + } + + return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); + } + + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + prevState = null !== current ? current.memoizedState : null; + if ("hidden" === nextProps.mode || "unstable-defer-without-hiding" === nextProps.mode) { + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null + }, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= renderLanes;else { + if (0 === (renderLanes & 1073741824)) return current = null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, workInProgress.lanes = workInProgress.childLanes = 1073741824, workInProgress.memoizedState = { + baseLanes: current, + cachePool: null + }, workInProgress.updateQueue = null, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= current, null; + workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null + }; + nextProps = null !== prevState ? prevState.baseLanes : renderLanes; + push(subtreeRenderLanesCursor, subtreeRenderLanes); + subtreeRenderLanes |= nextProps; + } + } else null !== prevState ? (nextProps = prevState.baseLanes | renderLanes, workInProgress.memoizedState = null) : nextProps = renderLanes, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= nextProps; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === current && null !== ref || null !== current && current.ref !== ref) workInProgress.flags |= 256; + } + + function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) { + var context = isContextProvider(Component) ? previousContext : contextStackCursor.current; + context = getMaskedContext(workInProgress, context); + prepareToReadContext(workInProgress, renderLanes); + Component = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); + if (null !== current && !didReceiveUpdate) return workInProgress.updateQueue = current.updateQueue, workInProgress.flags &= -1029, current.lanes &= ~renderLanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; + } + + function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (isContextProvider(Component)) { + var hasContext = true; + pushContextProvider(workInProgress); + } else hasContext = false; + + prepareToReadContext(workInProgress, renderLanes); + if (null === workInProgress.stateNode) null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2), constructClassInstance(workInProgress, Component, nextProps), mountClassInstance(workInProgress, Component, nextProps, renderLanes), nextProps = true;else if (null === current) { + var instance = workInProgress.stateNode, + oldProps = workInProgress.memoizedProps; + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType ? contextType = readContext(contextType) : (contextType = isContextProvider(Component) ? previousContext : contextStackCursor.current, contextType = getMaskedContext(workInProgress, contextType)); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = "function" === typeof getDerivedStateFromProps || "function" === typeof instance.getSnapshotBeforeUpdate; + hasNewLifecycles || "function" !== typeof instance.UNSAFE_componentWillReceiveProps && "function" !== typeof instance.componentWillReceiveProps || (oldProps !== nextProps || oldContext !== contextType) && callComponentWillReceiveProps(workInProgress, instance, nextProps, contextType); + hasForceUpdate = false; + var oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + oldContext = workInProgress.memoizedState; + oldProps !== nextProps || oldState !== oldContext || didPerformWorkStackCursor.current || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, nextProps), oldContext = workInProgress.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(workInProgress, Component, oldProps, nextProps, oldState, oldContext, contextType)) ? (hasNewLifecycles || "function" !== typeof instance.UNSAFE_componentWillMount && "function" !== typeof instance.componentWillMount || ("function" === typeof instance.componentWillMount && instance.componentWillMount(), "function" === typeof instance.UNSAFE_componentWillMount && instance.UNSAFE_componentWillMount()), "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4)) : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4), workInProgress.memoizedProps = nextProps, workInProgress.memoizedState = oldContext), instance.props = nextProps, instance.state = oldContext, instance.context = contextType, nextProps = oldProps) : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4), nextProps = false); + } else { + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + oldState = instance.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext ? oldContext = readContext(oldContext) : (oldContext = isContextProvider(Component) ? previousContext : contextStackCursor.current, oldContext = getMaskedContext(workInProgress, oldContext)); + var getDerivedStateFromProps$jscomp$0 = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = "function" === typeof getDerivedStateFromProps$jscomp$0 || "function" === typeof instance.getSnapshotBeforeUpdate) || "function" !== typeof instance.UNSAFE_componentWillReceiveProps && "function" !== typeof instance.componentWillReceiveProps || (oldProps !== hasNewLifecycles || oldState !== oldContext) && callComponentWillReceiveProps(workInProgress, instance, nextProps, oldContext); + hasForceUpdate = false; + oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + var newState = workInProgress.memoizedState; + oldProps !== hasNewLifecycles || oldState !== newState || didPerformWorkStackCursor.current || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps$jscomp$0 && (applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps$jscomp$0, nextProps), newState = workInProgress.memoizedState), (contextType = hasForceUpdate || checkShouldComponentUpdate(workInProgress, Component, contextType, nextProps, oldState, newState, oldContext) || false) ? (getDerivedStateFromProps || "function" !== typeof instance.UNSAFE_componentWillUpdate && "function" !== typeof instance.componentWillUpdate || ("function" === typeof instance.componentWillUpdate && instance.componentWillUpdate(nextProps, newState, oldContext), "function" === typeof instance.UNSAFE_componentWillUpdate && instance.UNSAFE_componentWillUpdate(nextProps, newState, oldContext)), "function" === typeof instance.componentDidUpdate && (workInProgress.flags |= 4), "function" === typeof instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 512)) : ("function" !== typeof instance.componentDidUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 4), "function" !== typeof instance.getSnapshotBeforeUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 512), workInProgress.memoizedProps = nextProps, workInProgress.memoizedState = newState), instance.props = nextProps, instance.state = newState, instance.context = oldContext, nextProps = contextType) : ("function" !== typeof instance.componentDidUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 4), "function" !== typeof instance.getSnapshotBeforeUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 512), nextProps = false); + } + return finishClassComponent(current, workInProgress, Component, nextProps, hasContext, renderLanes); + } + + function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) { + markRef(current, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) return hasContext && invalidateContextProvider(workInProgress, Component, false), bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + shouldUpdate = workInProgress.stateNode; + ReactCurrentOwner$1.current = workInProgress; + var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current && didCaptureError ? (workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes), workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes)) : reconcileChildren(current, workInProgress, nextChildren, renderLanes); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, true); + return workInProgress.child; + } + + function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext ? pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject(workInProgress, root.context, false); + pushHostContainer(workInProgress, root.containerInfo); + } + + var SUSPENDED_MARKER = { + dehydrated: null, + retryLane: 0 + }; + + function mountSuspenseOffscreenState(renderLanes) { + return { + baseLanes: renderLanes, + cachePool: null + }; + } + + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + suspenseContext = suspenseStackCursor.current, + showFallback = false, + JSCompiler_temp; + (JSCompiler_temp = 0 !== (workInProgress.flags & 128)) || (JSCompiler_temp = null !== current && null === current.memoizedState ? false : 0 !== (suspenseContext & 2)); + JSCompiler_temp ? (showFallback = true, workInProgress.flags &= -129) : null !== current && null === current.memoizedState || undefined === nextProps.fallback || true === nextProps.unstable_avoidThisFallback || (suspenseContext |= 1); + push(suspenseStackCursor, suspenseContext & 1); + + if (null === current) { + current = nextProps.children; + suspenseContext = nextProps.fallback; + if (showFallback) return current = mountSuspenseFallbackChildren(workInProgress, current, suspenseContext, renderLanes), workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, current; + if ("number" === typeof nextProps.unstable_expectedLoadTime) return current = mountSuspenseFallbackChildren(workInProgress, current, suspenseContext, renderLanes), workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, workInProgress.lanes = 4194304, current; + renderLanes = createFiberFromOffscreen({ + mode: "visible", + children: current + }, workInProgress.mode, renderLanes, null); + renderLanes.return = workInProgress; + return workInProgress.child = renderLanes; + } + + if (null !== current.memoizedState) { + if (showFallback) return nextProps = updateSuspenseFallbackChildren(current, workInProgress, nextProps.children, nextProps.fallback, renderLanes), showFallback = workInProgress.child, suspenseContext = current.child.memoizedState, showFallback.memoizedState = null === suspenseContext ? mountSuspenseOffscreenState(renderLanes) : { + baseLanes: suspenseContext.baseLanes | renderLanes, + cachePool: null + }, showFallback.childLanes = current.childLanes & ~renderLanes, workInProgress.memoizedState = SUSPENDED_MARKER, nextProps; + renderLanes = updateSuspensePrimaryChildren(current, workInProgress, nextProps.children, renderLanes); + workInProgress.memoizedState = null; + return renderLanes; + } + + if (showFallback) return nextProps = updateSuspenseFallbackChildren(current, workInProgress, nextProps.children, nextProps.fallback, renderLanes), showFallback = workInProgress.child, suspenseContext = current.child.memoizedState, showFallback.memoizedState = null === suspenseContext ? mountSuspenseOffscreenState(renderLanes) : { + baseLanes: suspenseContext.baseLanes | renderLanes, + cachePool: null + }, showFallback.childLanes = current.childLanes & ~renderLanes, workInProgress.memoizedState = SUSPENDED_MARKER, nextProps; + renderLanes = updateSuspensePrimaryChildren(current, workInProgress, nextProps.children, renderLanes); + workInProgress.memoizedState = null; + return renderLanes; + } + + function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { + mode: "hidden", + children: primaryChildren + }; + 0 === (mode & 1) && null !== progressedPrimaryFragment ? (progressedPrimaryFragment.childLanes = 0, progressedPrimaryFragment.pendingProps = primaryChildren) : progressedPrimaryFragment = createFiberFromOffscreen(primaryChildren, mode, 0, null); + fallbackChildren = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; + } + + function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) { + var currentPrimaryChildFragment = current.child; + current = currentPrimaryChildFragment.sibling; + primaryChildren = createWorkInProgress(currentPrimaryChildFragment, { + mode: "visible", + children: primaryChildren + }); + 0 === (workInProgress.mode & 1) && (primaryChildren.lanes = renderLanes); + primaryChildren.return = workInProgress; + primaryChildren.sibling = null; + null !== current && (renderLanes = workInProgress.deletions, null === renderLanes ? (workInProgress.deletions = [current], workInProgress.flags |= 16) : renderLanes.push(current)); + return workInProgress.child = primaryChildren; + } + + function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode; + current = current.child; + var currentFallbackChildFragment = current.sibling, + primaryChildProps = { + mode: "hidden", + children: primaryChildren + }; + 0 === (mode & 1) && workInProgress.child !== current ? (primaryChildren = workInProgress.child, primaryChildren.childLanes = 0, primaryChildren.pendingProps = primaryChildProps, workInProgress.deletions = null) : (primaryChildren = createWorkInProgress(current, primaryChildProps), primaryChildren.subtreeFlags = current.subtreeFlags & 1835008); + null !== currentFallbackChildFragment ? fallbackChildren = createWorkInProgress(currentFallbackChildFragment, fallbackChildren) : (fallbackChildren = createFiberFromFragment(fallbackChildren, mode, renderLanes, null), fallbackChildren.flags |= 2); + fallbackChildren.return = workInProgress; + primaryChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; + } + + function scheduleWorkOnFiber(fiber, renderLanes) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleWorkOnParentPath(fiber.return, renderLanes); + } + + function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { + var renderState = workInProgress.memoizedState; + null === renderState ? workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode); + } + + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) nextProps = nextProps & 1 | 2, workInProgress.flags |= 128;else { + if (null !== current && 0 !== (current.flags & 128)) a: for (current = workInProgress.child; null !== current;) { + if (13 === current.tag) null !== current.memoizedState && scheduleWorkOnFiber(current, renderLanes);else if (19 === current.tag) scheduleWorkOnFiber(current, renderLanes);else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + + for (; null === current.sibling;) { + if (null === current.return || current.return === workInProgress) break a; + current = current.return; + } + + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; + } + push(suspenseStackCursor, nextProps); + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null;else switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + + for (revealOrder = null; null !== renderLanes;) { + current = renderLanes.alternate, null !== current && null === findFirstSuspended(current) && (revealOrder = renderLanes), renderLanes = renderLanes.sibling; + } + + renderLanes = revealOrder; + null === renderLanes ? (revealOrder = workInProgress.child, workInProgress.child = null) : (revealOrder = renderLanes.sibling, renderLanes.sibling = null); + initSuspenseListRenderState(workInProgress, false, revealOrder, renderLanes, tailMode); + break; + + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + + for (workInProgress.child = null; null !== revealOrder;) { + current = revealOrder.alternate; + + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + + initSuspenseListRenderState(workInProgress, true, renderLanes, null, tailMode); + break; + + case "together": + initSuspenseListRenderState(workInProgress, false, null, null, undefined); + break; + + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; + } + + function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) return null; + if (null !== current && workInProgress.child !== current.child) throw Error("Resuming work not yet implemented."); + + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + + for (renderLanes.return = workInProgress; null !== current.sibling;) { + current = current.sibling, renderLanes = renderLanes.sibling = createWorkInProgress(current, current.pendingProps), renderLanes.return = workInProgress; + } + + renderLanes.sibling = null; + } + + return workInProgress.child; + } + + var appendAllChildren, updateHostContainer, updateHostComponent$1, updateHostText$1; + + appendAllChildren = function appendAllChildren(parent, workInProgress) { + for (var node = workInProgress.child; null !== node;) { + if (5 === node.tag || 6 === node.tag) parent._children.push(node.stateNode);else if (4 !== node.tag && null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + if (node === workInProgress) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === workInProgress) return; + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + }; + + updateHostContainer = function updateHostContainer() {}; + + updateHostComponent$1 = function updateHostComponent$1(current, workInProgress, type, newProps) { + current.memoizedProps !== newProps && (requiredContext(contextStackCursor$1.current), workInProgress.updateQueue = UPDATE_SIGNAL) && (workInProgress.flags |= 4); + }; + + updateHostText$1 = function updateHostText$1(current, workInProgress, oldText, newText) { + oldText !== newText && (workInProgress.flags |= 4); + }; + + function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "hidden": + hasRenderedATailFallback = renderState.tail; + + for (var lastTailNode = null; null !== hasRenderedATailFallback;) { + null !== hasRenderedATailFallback.alternate && (lastTailNode = hasRenderedATailFallback), hasRenderedATailFallback = hasRenderedATailFallback.sibling; + } + + null === lastTailNode ? renderState.tail = null : lastTailNode.sibling = null; + break; + + case "collapsed": + lastTailNode = renderState.tail; + + for (var lastTailNode$69 = null; null !== lastTailNode;) { + null !== lastTailNode.alternate && (lastTailNode$69 = lastTailNode), lastTailNode = lastTailNode.sibling; + } + + null === lastTailNode$69 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$69.sibling = null; + } + } + + function bubbleProperties(completedWork) { + var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) for (var child$70 = completedWork.child; null !== child$70;) { + newChildLanes |= child$70.lanes | child$70.childLanes, subtreeFlags |= child$70.subtreeFlags & 1835008, subtreeFlags |= child$70.flags & 1835008, child$70.return = completedWork, child$70 = child$70.sibling; + } else for (child$70 = completedWork.child; null !== child$70;) { + newChildLanes |= child$70.lanes | child$70.childLanes, subtreeFlags |= child$70.subtreeFlags, subtreeFlags |= child$70.flags, child$70.return = completedWork, child$70 = child$70.sibling; + } + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; + } + + function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + + switch (workInProgress.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return bubbleProperties(workInProgress), null; + + case 1: + return isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null; + + case 3: + return newProps = workInProgress.stateNode, popHostContainer(), pop(didPerformWorkStackCursor), pop(contextStackCursor), resetWorkInProgressVersions(), newProps.pendingContext && (newProps.context = newProps.pendingContext, newProps.pendingContext = null), null !== current && null !== current.child || newProps.hydrate || (workInProgress.flags |= 512), updateHostContainer(current, workInProgress), bubbleProperties(workInProgress), null; + + case 5: + popHostContext(workInProgress); + renderLanes = requiredContext(rootInstanceStackCursor.current); + var type = workInProgress.type; + if (null !== current && null != workInProgress.stateNode) updateHostComponent$1(current, workInProgress, type, newProps, renderLanes), current.ref !== workInProgress.ref && (workInProgress.flags |= 256);else { + if (!newProps) { + if (null === workInProgress.stateNode) throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); + bubbleProperties(workInProgress); + return null; + } + + requiredContext(contextStackCursor$1.current); + current = allocateTag(); + type = getViewConfigForType(type); + var updatePayload = diffProperties(null, emptyObject, newProps, type.validAttributes); + + _$$_REQUIRE(_dependencyMap[3]).UIManager.createView(current, type.uiViewClassName, renderLanes, updatePayload); + + renderLanes = new ReactNativeFiberHostComponent(current, type, workInProgress); + instanceCache.set(current, workInProgress); + instanceProps.set(current, newProps); + appendAllChildren(renderLanes, workInProgress, false, false); + workInProgress.stateNode = renderLanes; + finalizeInitialChildren(renderLanes) && (workInProgress.flags |= 4); + null !== workInProgress.ref && (workInProgress.flags |= 256); + } + bubbleProperties(workInProgress); + return null; + + case 6: + if (current && null != workInProgress.stateNode) updateHostText$1(current, workInProgress, current.memoizedProps, newProps);else { + if ("string" !== typeof newProps && null === workInProgress.stateNode) throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); + current = requiredContext(rootInstanceStackCursor.current); + if (!requiredContext(contextStackCursor$1.current).isInAParentText) throw Error("Text strings must be rendered within a component."); + renderLanes = allocateTag(); + + _$$_REQUIRE(_dependencyMap[3]).UIManager.createView(renderLanes, "RCTRawText", current, { + text: newProps + }); + + instanceCache.set(renderLanes, workInProgress); + workInProgress.stateNode = renderLanes; + } + bubbleProperties(workInProgress); + return null; + + case 13: + pop(suspenseStackCursor); + newProps = workInProgress.memoizedState; + if (0 !== (workInProgress.flags & 128)) return workInProgress.lanes = renderLanes, workInProgress; + newProps = null !== newProps; + renderLanes = false; + null !== current && (renderLanes = null !== current.memoizedState); + if (newProps && !renderLanes && 0 !== (workInProgress.mode & 1)) if (null === current && true !== workInProgress.memoizedProps.unstable_avoidThisFallback || 0 !== (suspenseStackCursor.current & 1)) 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3);else { + if (0 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus) workInProgressRootExitStatus = 4; + null === workInProgressRoot || 0 === (workInProgressRootSkippedLanes & 268435455) && 0 === (workInProgressRootUpdatedLanes & 268435455) || markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); + } + if (newProps || renderLanes) workInProgress.flags |= 4; + bubbleProperties(workInProgress); + return null; + + case 4: + return popHostContainer(), updateHostContainer(current, workInProgress), bubbleProperties(workInProgress), null; + + case 10: + return popProvider(workInProgress.type._context), bubbleProperties(workInProgress), null; + + case 17: + return isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null; + + case 19: + pop(suspenseStackCursor); + type = workInProgress.memoizedState; + if (null === type) return bubbleProperties(workInProgress), null; + newProps = 0 !== (workInProgress.flags & 128); + updatePayload = type.rendering; + if (null === updatePayload) { + if (newProps) cutOffTailIfNeeded(type, false);else { + if (0 !== workInProgressRootExitStatus || null !== current && 0 !== (current.flags & 128)) for (current = workInProgress.child; null !== current;) { + updatePayload = findFirstSuspended(current); + + if (null !== updatePayload) { + workInProgress.flags |= 128; + cutOffTailIfNeeded(type, false); + current = updatePayload.updateQueue; + null !== current && (workInProgress.updateQueue = current, workInProgress.flags |= 4); + workInProgress.subtreeFlags = 0; + current = renderLanes; + + for (newProps = workInProgress.child; null !== newProps;) { + renderLanes = newProps, type = current, renderLanes.flags &= 1835010, updatePayload = renderLanes.alternate, null === updatePayload ? (renderLanes.childLanes = 0, renderLanes.lanes = type, renderLanes.child = null, renderLanes.subtreeFlags = 0, renderLanes.memoizedProps = null, renderLanes.memoizedState = null, renderLanes.updateQueue = null, renderLanes.dependencies = null, renderLanes.stateNode = null) : (renderLanes.childLanes = updatePayload.childLanes, renderLanes.lanes = updatePayload.lanes, renderLanes.child = updatePayload.child, renderLanes.subtreeFlags = 0, renderLanes.deletions = null, renderLanes.memoizedProps = updatePayload.memoizedProps, renderLanes.memoizedState = updatePayload.memoizedState, renderLanes.updateQueue = updatePayload.updateQueue, renderLanes.type = updatePayload.type, type = updatePayload.dependencies, renderLanes.dependencies = null === type ? null : { + lanes: type.lanes, + firstContext: type.firstContext + }), newProps = newProps.sibling; + } + + push(suspenseStackCursor, suspenseStackCursor.current & 1 | 2); + return workInProgress.child; + } + + current = current.sibling; + } + null !== type.tail && _$$_REQUIRE(_dependencyMap[4]).unstable_now() > workInProgressRootRenderTargetTime && (workInProgress.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress.lanes = 4194304); + } + } else { + if (!newProps) if (current = findFirstSuspended(updatePayload), null !== current) { + if (workInProgress.flags |= 128, newProps = true, current = current.updateQueue, null !== current && (workInProgress.updateQueue = current, workInProgress.flags |= 4), cutOffTailIfNeeded(type, true), null === type.tail && "hidden" === type.tailMode && !updatePayload.alternate) return bubbleProperties(workInProgress), null; + } else 2 * _$$_REQUIRE(_dependencyMap[4]).unstable_now() - type.renderingStartTime > workInProgressRootRenderTargetTime && 1073741824 !== renderLanes && (workInProgress.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress.lanes = 4194304); + type.isBackwards ? (updatePayload.sibling = workInProgress.child, workInProgress.child = updatePayload) : (current = type.last, null !== current ? current.sibling = updatePayload : workInProgress.child = updatePayload, type.last = updatePayload); + } + if (null !== type.tail) return workInProgress = type.tail, type.rendering = workInProgress, type.tail = workInProgress.sibling, type.renderingStartTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now(), workInProgress.sibling = null, current = suspenseStackCursor.current, push(suspenseStackCursor, newProps ? current & 1 | 2 : current & 1), workInProgress; + bubbleProperties(workInProgress); + return null; + + case 22: + case 23: + return popRenderLanes(), renderLanes = null !== workInProgress.memoizedState, null !== current && null !== current.memoizedState !== renderLanes && "unstable-defer-without-hiding" !== newProps.mode && (workInProgress.flags |= 4), renderLanes && 0 === (subtreeRenderLanes & 1073741824) && 0 !== (workInProgress.mode & 1) || bubbleProperties(workInProgress), null; + } + + throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue."); + } + + function unwindWork(workInProgress) { + switch (workInProgress.tag) { + case 1: + isContextProvider(workInProgress.type) && popContext(); + var flags = workInProgress.flags; + return flags & 16384 ? (workInProgress.flags = flags & -16385 | 128, workInProgress) : null; + + case 3: + popHostContainer(); + pop(didPerformWorkStackCursor); + pop(contextStackCursor); + resetWorkInProgressVersions(); + flags = workInProgress.flags; + if (0 !== (flags & 128)) throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue."); + workInProgress.flags = flags & -16385 | 128; + return workInProgress; + + case 5: + return popHostContext(workInProgress), null; + + case 13: + return pop(suspenseStackCursor), flags = workInProgress.flags, flags & 16384 ? (workInProgress.flags = flags & -16385 | 128, workInProgress) : null; + + case 19: + return pop(suspenseStackCursor), null; + + case 4: + return popHostContainer(), null; + + case 10: + return popProvider(workInProgress.type._context), null; + + case 22: + case 23: + return popRenderLanes(), null; + + case 24: + return null; + + default: + return null; + } + } + + var PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null; + + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref; + if (null !== ref) if ("function" === typeof ref) try { + ref(null); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } else ref.current = null; + } + + var shouldFireAfterActiveInstanceBlur = false; + + function commitBeforeMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect;) { + if (root = nextEffect, firstChild = root.child, 0 !== (root.subtreeFlags & 516) && null !== firstChild) firstChild.return = root, nextEffect = firstChild;else for (; null !== nextEffect;) { + root = nextEffect; + + try { + var current = root.alternate; + if (0 !== (root.flags & 512)) switch (root.tag) { + case 0: + case 11: + case 15: + break; + + case 1: + if (null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = root.stateNode, + snapshot = instance.getSnapshotBeforeUpdate(root.elementType === root.type ? prevProps : resolveDefaultProps(root.type, prevProps), prevState); + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } + + break; + + case 3: + break; + + case 5: + case 6: + case 4: + case 17: + break; + + default: + throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); + } + } catch (error) { + captureCommitPhaseError(root, root.return, error); + } + + firstChild = root.sibling; + + if (null !== firstChild) { + firstChild.return = root.return; + nextEffect = firstChild; + break; + } + + nextEffect = root.return; + } + } + + current = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = false; + return current; + } + + function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor$jscomp$0) { + var updateQueue = finishedWork.updateQueue; + updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; + + if (null !== updateQueue) { + var effect = updateQueue = updateQueue.next; + + do { + if ((effect.tag & flags) === flags) { + var destroy = effect.destroy; + effect.destroy = undefined; + + if (undefined !== destroy) { + var current = finishedWork, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + } + + effect = effect.next; + } while (effect !== updateQueue); + } + } + + function commitHookEffectListMount(tag, finishedWork) { + finishedWork = finishedWork.updateQueue; + finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; + + if (null !== finishedWork) { + var effect = finishedWork = finishedWork.next; + + do { + if ((effect.tag & tag) === tag) { + var create$82 = effect.create; + effect.destroy = create$82(); + } + + effect = effect.next; + } while (effect !== finishedWork); + } + } + + function hideOrUnhideAllChildren(finishedWork, isHidden) { + for (var hostSubtreeRoot = null, node = finishedWork;;) { + if (5 === node.tag) { + if (null === hostSubtreeRoot) { + hostSubtreeRoot = node; + var instance = node.stateNode; + + if (isHidden) { + var viewConfig = instance.viewConfig; + var updatePayload = diffProperties(null, emptyObject, { + style: { + display: "none" + } + }, viewConfig.validAttributes); + + _$$_REQUIRE(_dependencyMap[3]).UIManager.updateView(instance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } else { + instance = node.stateNode; + updatePayload = node.memoizedProps; + viewConfig = instance.viewConfig; + + var prevProps = _$$_REQUIRE(_dependencyMap[2])({}, updatePayload, { + style: [updatePayload.style, { + display: "none" + }] + }); + + updatePayload = diffProperties(null, prevProps, updatePayload, viewConfig.validAttributes); + + _$$_REQUIRE(_dependencyMap[3]).UIManager.updateView(instance._nativeTag, viewConfig.uiViewClassName, updatePayload); + } + } + } else if (6 === node.tag) { + if (null === hostSubtreeRoot) throw Error("Not yet implemented."); + } else if ((22 !== node.tag && 23 !== node.tag || null === node.memoizedState || node === finishedWork) && null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === finishedWork) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === finishedWork) return; + hostSubtreeRoot === node && (hostSubtreeRoot = null); + node = node.return; + } + + hostSubtreeRoot === node && (hostSubtreeRoot = null); + node.sibling.return = node.return; + node = node.sibling; + } + } + + function commitUnmount(finishedRoot, current, nearestMountedAncestor$jscomp$0) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) try { + injectedHook.onCommitFiberUnmount(rendererID, current); + } catch (err) {} + + switch (current.tag) { + case 0: + case 11: + case 14: + case 15: + finishedRoot = current.updateQueue; + + if (null !== finishedRoot && (finishedRoot = finishedRoot.lastEffect, null !== finishedRoot)) { + var effect = finishedRoot = finishedRoot.next; + + do { + var _effect = effect, + destroy = _effect.destroy; + _effect = _effect.tag; + + if (undefined !== destroy && 0 !== (_effect & 2)) { + _effect = current; + var nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + + try { + destroy(); + } catch (error) { + captureCommitPhaseError(_effect, nearestMountedAncestor, error); + } + } + + effect = effect.next; + } while (effect !== finishedRoot); + } + + break; + + case 1: + safelyDetachRef(current, nearestMountedAncestor$jscomp$0); + finishedRoot = current.stateNode; + if ("function" === typeof finishedRoot.componentWillUnmount) try { + finishedRoot.props = current.memoizedProps, finishedRoot.state = current.memoizedState, finishedRoot.componentWillUnmount(); + } catch (unmountError) { + captureCommitPhaseError(current, nearestMountedAncestor$jscomp$0, unmountError); + } + break; + + case 5: + safelyDetachRef(current, nearestMountedAncestor$jscomp$0); + break; + + case 4: + unmountHostComponents(finishedRoot, current, nearestMountedAncestor$jscomp$0); + } + } + + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; + } + + function isHostParent(fiber) { + return 5 === fiber.tag || 3 === fiber.tag || 4 === fiber.tag; + } + + function commitPlacement(finishedWork) { + a: { + for (var parent = finishedWork.return; null !== parent;) { + if (isHostParent(parent)) break a; + parent = parent.return; + } + + throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."); + } + + var parentFiber = parent; + parent = parentFiber.stateNode; + + switch (parentFiber.tag) { + case 5: + var isContainer = false; + break; + + case 3: + parent = parent.containerInfo; + isContainer = true; + break; + + case 4: + parent = parent.containerInfo; + isContainer = true; + break; + + default: + throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue."); + } + + parentFiber.flags & 32 && (parentFiber.flags &= -33); + + a: b: for (parentFiber = finishedWork;;) { + for (; null === parentFiber.sibling;) { + if (null === parentFiber.return || isHostParent(parentFiber.return)) { + parentFiber = null; + break a; + } + + parentFiber = parentFiber.return; + } + + parentFiber.sibling.return = parentFiber.return; + + for (parentFiber = parentFiber.sibling; 5 !== parentFiber.tag && 6 !== parentFiber.tag && 18 !== parentFiber.tag;) { + if (parentFiber.flags & 2) continue b; + if (null === parentFiber.child || 4 === parentFiber.tag) continue b;else parentFiber.child.return = parentFiber, parentFiber = parentFiber.child; + } + + if (!(parentFiber.flags & 2)) { + parentFiber = parentFiber.stateNode; + break a; + } + } + + isContainer ? insertOrAppendPlacementNodeIntoContainer(finishedWork, parentFiber, parent) : insertOrAppendPlacementNode(finishedWork, parentFiber, parent); + } + + function insertOrAppendPlacementNodeIntoContainer(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) { + if (node = node.stateNode, before) { + if ("number" === typeof parent) throw Error("Container does not support insertBefore operation"); + } else _$$_REQUIRE(_dependencyMap[3]).UIManager.setChildren(parent, ["number" === typeof node ? node : node._nativeTag]); + } else if (4 !== tag && (node = node.child, null !== node)) for (insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling; null !== node;) { + insertOrAppendPlacementNodeIntoContainer(node, before, parent), node = node.sibling; + } + } + + function insertOrAppendPlacementNode(node, before, parent) { + var tag = node.tag; + if (5 === tag || 6 === tag) { + if (node = node.stateNode, before) { + tag = parent._children; + var index = tag.indexOf(node); + 0 <= index ? (tag.splice(index, 1), before = tag.indexOf(before), tag.splice(before, 0, node), _$$_REQUIRE(_dependencyMap[3]).UIManager.manageChildren(parent._nativeTag, [index], [before], [], [], [])) : (before = tag.indexOf(before), tag.splice(before, 0, node), _$$_REQUIRE(_dependencyMap[3]).UIManager.manageChildren(parent._nativeTag, [], [], ["number" === typeof node ? node : node._nativeTag], [before], [])); + } else before = "number" === typeof node ? node : node._nativeTag, tag = parent._children, index = tag.indexOf(node), 0 <= index ? (tag.splice(index, 1), tag.push(node), _$$_REQUIRE(_dependencyMap[3]).UIManager.manageChildren(parent._nativeTag, [index], [tag.length - 1], [], [], [])) : (tag.push(node), _$$_REQUIRE(_dependencyMap[3]).UIManager.manageChildren(parent._nativeTag, [], [], [before], [tag.length - 1], [])); + } else if (4 !== tag && (node = node.child, null !== node)) for (insertOrAppendPlacementNode(node, before, parent), node = node.sibling; null !== node;) { + insertOrAppendPlacementNode(node, before, parent), node = node.sibling; + } + } + + function unmountHostComponents(finishedRoot$jscomp$0, current, nearestMountedAncestor$jscomp$0) { + for (var node = current, currentParentIsValid = false, currentParent, currentParentIsContainer;;) { + if (!currentParentIsValid) { + currentParentIsValid = node.return; + + a: for (;;) { + if (null === currentParentIsValid) throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue."); + currentParent = currentParentIsValid.stateNode; + + switch (currentParentIsValid.tag) { + case 5: + currentParentIsContainer = false; + break a; + + case 3: + currentParent = currentParent.containerInfo; + currentParentIsContainer = true; + break a; + + case 4: + currentParent = currentParent.containerInfo; + currentParentIsContainer = true; + break a; + } + + currentParentIsValid = currentParentIsValid.return; + } + + currentParentIsValid = true; + } + + if (5 === node.tag || 6 === node.tag) { + a: for (var finishedRoot = finishedRoot$jscomp$0, root = node, nearestMountedAncestor = nearestMountedAncestor$jscomp$0, node$jscomp$0 = root;;) { + if (commitUnmount(finishedRoot, node$jscomp$0, nearestMountedAncestor), null !== node$jscomp$0.child && 4 !== node$jscomp$0.tag) node$jscomp$0.child.return = node$jscomp$0, node$jscomp$0 = node$jscomp$0.child;else { + if (node$jscomp$0 === root) break a; + + for (; null === node$jscomp$0.sibling;) { + if (null === node$jscomp$0.return || node$jscomp$0.return === root) break a; + node$jscomp$0 = node$jscomp$0.return; + } + + node$jscomp$0.sibling.return = node$jscomp$0.return; + node$jscomp$0 = node$jscomp$0.sibling; + } + } + + currentParentIsContainer ? (finishedRoot = currentParent, recursivelyUncacheFiberNode(node.stateNode), _$$_REQUIRE(_dependencyMap[3]).UIManager.manageChildren(finishedRoot, [], [], [], [], [0])) : (finishedRoot = currentParent, nearestMountedAncestor = node.stateNode, recursivelyUncacheFiberNode(nearestMountedAncestor), root = finishedRoot._children, nearestMountedAncestor = root.indexOf(nearestMountedAncestor), root.splice(nearestMountedAncestor, 1), _$$_REQUIRE(_dependencyMap[3]).UIManager.manageChildren(finishedRoot._nativeTag, [], [], [], [], [nearestMountedAncestor])); + } else if (4 === node.tag) { + if (null !== node.child) { + currentParent = node.stateNode.containerInfo; + currentParentIsContainer = true; + node.child.return = node; + node = node.child; + continue; + } + } else if (commitUnmount(finishedRoot$jscomp$0, node, nearestMountedAncestor$jscomp$0), null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === current) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === current) return; + node = node.return; + 4 === node.tag && (currentParentIsValid = false); + } + + node.sibling.return = node.return; + node = node.sibling; + } + } + + function commitWork(current, finishedWork) { + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + commitHookEffectListUnmount(3, finishedWork, finishedWork.return); + return; + + case 1: + return; + + case 5: + var instance = finishedWork.stateNode; + + if (null != instance) { + var newProps = finishedWork.memoizedProps; + current = null !== current ? current.memoizedProps : newProps; + var updatePayload = finishedWork.updateQueue; + finishedWork.updateQueue = null; + null !== updatePayload && (finishedWork = instance.viewConfig, instanceProps.set(instance._nativeTag, newProps), newProps = diffProperties(null, current, newProps, finishedWork.validAttributes), null != newProps && _$$_REQUIRE(_dependencyMap[3]).UIManager.updateView(instance._nativeTag, finishedWork.uiViewClassName, newProps)); + } + + return; + + case 6: + if (null === finishedWork.stateNode) throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue."); + + _$$_REQUIRE(_dependencyMap[3]).UIManager.updateView(finishedWork.stateNode, "RCTRawText", { + text: finishedWork.memoizedProps + }); + + return; + + case 3: + return; + + case 12: + return; + + case 13: + null !== finishedWork.memoizedState && (globalMostRecentFallbackTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now(), hideOrUnhideAllChildren(finishedWork.child, true)); + attachSuspenseRetryListeners(finishedWork); + return; + + case 19: + attachSuspenseRetryListeners(finishedWork); + return; + + case 17: + return; + + case 22: + case 23: + hideOrUnhideAllChildren(finishedWork, null !== finishedWork.memoizedState); + return; + } + + throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); + } + + function attachSuspenseRetryListeners(finishedWork) { + var wakeables = finishedWork.updateQueue; + + if (null !== wakeables) { + finishedWork.updateQueue = null; + var retryCache = finishedWork.stateNode; + null === retryCache && (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); + wakeables.forEach(function (wakeable) { + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + retryCache.has(wakeable) || (retryCache.add(wakeable), wakeable.then(retry, retry)); + }); + } + } + + function commitMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect;) { + firstChild = nextEffect; + var deletions = firstChild.deletions; + if (null !== deletions) for (var i = 0; i < deletions.length; i++) { + var childToDelete = deletions[i]; + + try { + unmountHostComponents(root, childToDelete, firstChild); + var alternate = childToDelete.alternate; + null !== alternate && (alternate.return = null); + childToDelete.return = null; + } catch (error) { + captureCommitPhaseError(childToDelete, firstChild, error); + } + } + deletions = firstChild.child; + if (0 !== (firstChild.subtreeFlags & 6454) && null !== deletions) deletions.return = firstChild, nextEffect = deletions;else for (; null !== nextEffect;) { + firstChild = nextEffect; + + try { + var flags = firstChild.flags; + + if (flags & 256) { + var current = firstChild.alternate; + + if (null !== current) { + var currentRef = current.ref; + null !== currentRef && ("function" === typeof currentRef ? currentRef(null) : currentRef.current = null); + } + } + + switch (flags & 2054) { + case 2: + commitPlacement(firstChild); + firstChild.flags &= -3; + break; + + case 6: + commitPlacement(firstChild); + firstChild.flags &= -3; + commitWork(firstChild.alternate, firstChild); + break; + + case 2048: + firstChild.flags &= -2049; + break; + + case 2052: + firstChild.flags &= -2049; + commitWork(firstChild.alternate, firstChild); + break; + + case 4: + commitWork(firstChild.alternate, firstChild); + } + } catch (error) { + captureCommitPhaseError(firstChild, firstChild.return, error); + } + + deletions = firstChild.sibling; + + if (null !== deletions) { + deletions.return = firstChild.return; + nextEffect = deletions; + break; + } + + nextEffect = firstChild.return; + } + } + } + + function commitLayoutEffects(finishedWork) { + for (nextEffect = finishedWork; null !== nextEffect;) { + var fiber = nextEffect, + firstChild = fiber.child; + if (0 !== (fiber.subtreeFlags & 324) && null !== firstChild) firstChild.return = fiber, nextEffect = firstChild;else for (fiber = finishedWork; null !== nextEffect;) { + firstChild = nextEffect; + + if (0 !== (firstChild.flags & 324)) { + var current = firstChild.alternate; + + try { + if (0 !== (firstChild.flags & 68)) switch (firstChild.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(3, firstChild); + break; + + case 1: + var instance = firstChild.stateNode; + if (firstChild.flags & 4) if (null === current) instance.componentDidMount();else { + var prevProps = firstChild.elementType === firstChild.type ? current.memoizedProps : resolveDefaultProps(firstChild.type, current.memoizedProps); + instance.componentDidUpdate(prevProps, current.memoizedState, instance.__reactInternalSnapshotBeforeUpdate); + } + var updateQueue = firstChild.updateQueue; + null !== updateQueue && commitUpdateQueue(firstChild, updateQueue, instance); + break; + + case 3: + var updateQueue$83 = firstChild.updateQueue; + + if (null !== updateQueue$83) { + current = null; + if (null !== firstChild.child) switch (firstChild.child.tag) { + case 5: + current = firstChild.child.stateNode; + break; + + case 1: + current = firstChild.child.stateNode; + } + commitUpdateQueue(firstChild, updateQueue$83, current); + } + + break; + + case 5: + break; + + case 6: + break; + + case 4: + break; + + case 12: + break; + + case 13: + break; + + case 19: + case 17: + case 21: + case 22: + case 23: + break; + + default: + throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); + } + + if (firstChild.flags & 256) { + current = undefined; + var ref = firstChild.ref; + + if (null !== ref) { + var instance$jscomp$0 = firstChild.stateNode; + + switch (firstChild.tag) { + case 5: + current = instance$jscomp$0; + break; + + default: + current = instance$jscomp$0; + } + + "function" === typeof ref ? ref(current) : ref.current = current; + } + } + } catch (error) { + captureCommitPhaseError(firstChild, firstChild.return, error); + } + } + + if (firstChild === fiber) { + nextEffect = null; + break; + } + + current = firstChild.sibling; + + if (null !== current) { + current.return = firstChild.return; + nextEffect = current; + break; + } + + nextEffect = firstChild.return; + } + } + } + + var ceil = Math.ceil, + ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, + executionContext = 0, + workInProgressRoot = null, + workInProgress = null, + workInProgressRootRenderLanes = 0, + subtreeRenderLanes = 0, + subtreeRenderLanesCursor = createCursor(0), + workInProgressRootExitStatus = 0, + workInProgressRootFatalError = null, + workInProgressRootSkippedLanes = 0, + workInProgressRootUpdatedLanes = 0, + workInProgressRootPingedLanes = 0, + globalMostRecentFallbackTime = 0, + workInProgressRootRenderTargetTime = Infinity, + hasUncaughtError = false, + firstUncaughtError = null, + legacyErrorBoundariesThatAlreadyFailed = null, + rootDoesHavePassiveEffects = false, + rootWithPendingPassiveEffects = null, + pendingPassiveEffectsLanes = 0, + nestedUpdateCount = 0, + rootWithNestedUpdates = null, + currentEventTime = -1, + currentEventTransitionLane = 0; + + function requestEventTime() { + return 0 !== (executionContext & 24) ? _$$_REQUIRE(_dependencyMap[4]).unstable_now() : -1 !== currentEventTime ? currentEventTime : currentEventTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now(); + } + + function requestUpdateLane(fiber) { + if (0 === (fiber.mode & 1)) return 1; + if (0 !== (executionContext & 8) && 0 !== workInProgressRootRenderLanes) return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; + if (0 !== ReactCurrentBatchConfig.transition) return 0 === currentEventTransitionLane && (fiber = nextTransitionLane, nextTransitionLane <<= 1, 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64), currentEventTransitionLane = fiber), currentEventTransitionLane; + fiber = currentUpdatePriority; + return 0 !== fiber ? fiber : 16; + } + + function scheduleUpdateOnFiber(fiber, lane, eventTime) { + if (50 < nestedUpdateCount) throw nestedUpdateCount = 0, rootWithNestedUpdates = null, Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."); + var root = markUpdateLaneFromFiberToRoot(fiber, lane); + if (null === root) return null; + markRootUpdated(root, lane, eventTime); + root === workInProgressRoot && (0 === (executionContext & 8) && (workInProgressRootUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended$1(root, workInProgressRootRenderLanes)); + 1 === lane ? 0 !== (executionContext & 4) && 0 === (executionContext & 24) ? performSyncWorkOnRoot(root) : (ensureRootIsScheduled(root, eventTime), 0 === executionContext && 0 === (fiber.mode & 1) && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks())) : ensureRootIsScheduled(root, eventTime); + return root; + } + + function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + alternate = sourceFiber; + + for (sourceFiber = sourceFiber.return; null !== sourceFiber;) { + sourceFiber.childLanes |= lane, alternate = sourceFiber.alternate, null !== alternate && (alternate.childLanes |= lane), alternate = sourceFiber, sourceFiber = sourceFiber.return; + } + + return 3 === alternate.tag ? alternate.stateNode : null; + } + + function ensureRootIsScheduled(root, currentTime) { + for (var existingCallbackNode = root.callbackNode, suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes, expirationTimes = root.expirationTimes, lanes = root.pendingLanes; 0 < lanes;) { + var index$6 = 31 - clz32(lanes), + lane = 1 << index$6, + expirationTime = expirationTimes[index$6]; + + if (-1 === expirationTime) { + if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) expirationTimes[index$6] = computeExpirationTime(lane, currentTime); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); + + lanes &= ~lane; + } + + suspendedLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0); + if (0 === suspendedLanes) null !== existingCallbackNode && _$$_REQUIRE(_dependencyMap[4]).unstable_cancelCallback(existingCallbackNode), root.callbackNode = null, root.callbackPriority = 0;else if (currentTime = suspendedLanes & -suspendedLanes, root.callbackPriority !== currentTime) { + null != existingCallbackNode && _$$_REQUIRE(_dependencyMap[4]).unstable_cancelCallback(existingCallbackNode); + if (1 === currentTime) 0 === root.tag ? (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), includesLegacySyncCallbacks = true, null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)) : (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)), _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[4]).unstable_ImmediatePriority, flushSyncCallbacks), existingCallbackNode = null;else { + switch (lanesToEventPriority(suspendedLanes)) { + case 1: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_ImmediatePriority; + break; + + case 4: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_UserBlockingPriority; + break; + + case 16: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_NormalPriority; + break; + + case 536870912: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_IdlePriority; + break; + + default: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_NormalPriority; + } + + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(existingCallbackNode, performConcurrentWorkOnRoot.bind(null, root)); + } + root.callbackPriority = currentTime; + root.callbackNode = existingCallbackNode; + } + } + + function performConcurrentWorkOnRoot(root, didTimeout) { + currentEventTime = -1; + currentEventTransitionLane = 0; + if (0 !== (executionContext & 24)) throw Error("Should not already be working."); + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) return null; + var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0); + if (0 === lanes) return null; + var JSCompiler_inline_result = 0 !== (lanes & root.expiredLanes) ? false : 0 === (lanes & 30); + + if (JSCompiler_inline_result && !didTimeout) { + didTimeout = lanes; + JSCompiler_inline_result = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== didTimeout) workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now() + 500, prepareFreshStack(root, didTimeout); + + do { + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (1); + + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = JSCompiler_inline_result; + null !== workInProgress ? didTimeout = 0 : (workInProgressRoot = null, workInProgressRootRenderLanes = 0, didTimeout = workInProgressRootExitStatus); + } else didTimeout = renderRootSync(root, lanes); + + if (0 !== didTimeout) { + 2 === didTimeout && (executionContext |= 32, root.hydrate && (root.hydrate = false), JSCompiler_inline_result = getLanesToRetrySynchronouslyOnError(root), 0 !== JSCompiler_inline_result && (lanes = JSCompiler_inline_result, didTimeout = renderRootSync(root, JSCompiler_inline_result))); + if (1 === didTimeout) throw originalCallbackNode = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()), originalCallbackNode; + root.finishedWork = root.current.alternate; + root.finishedLanes = lanes; + + switch (didTimeout) { + case 0: + case 1: + throw Error("Root did not complete. This is a bug in React."); + + case 2: + commitRoot(root); + break; + + case 3: + markRootSuspended$1(root, lanes); + + if ((lanes & 130023424) === lanes && (didTimeout = globalMostRecentFallbackTime + 500 - _$$_REQUIRE(_dependencyMap[4]).unstable_now(), 10 < didTimeout)) { + if (0 !== getNextLanes(root, 0)) break; + JSCompiler_inline_result = root.suspendedLanes; + + if ((JSCompiler_inline_result & lanes) !== lanes) { + requestEventTime(); + root.pingedLanes |= root.suspendedLanes & JSCompiler_inline_result; + break; + } + + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), didTimeout); + break; + } + + commitRoot(root); + break; + + case 4: + markRootSuspended$1(root, lanes); + if ((lanes & 4194240) === lanes) break; + didTimeout = root.eventTimes; + + for (JSCompiler_inline_result = -1; 0 < lanes;) { + var index$5 = 31 - clz32(lanes); + prevDispatcher = 1 << index$5; + index$5 = didTimeout[index$5]; + index$5 > JSCompiler_inline_result && (JSCompiler_inline_result = index$5); + lanes &= ~prevDispatcher; + } + + lanes = JSCompiler_inline_result; + lanes = _$$_REQUIRE(_dependencyMap[4]).unstable_now() - lanes; + lanes = (120 > lanes ? 120 : 480 > lanes ? 480 : 1080 > lanes ? 1080 : 1920 > lanes ? 1920 : 3e3 > lanes ? 3e3 : 4320 > lanes ? 4320 : 1960 * ceil(lanes / 1960)) - lanes; + + if (10 < lanes) { + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), lanes); + break; + } + + commitRoot(root); + break; + + case 5: + commitRoot(root); + break; + + default: + throw Error("Unknown root exit status."); + } + } + + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()); + return root.callbackNode === originalCallbackNode ? performConcurrentWorkOnRoot.bind(null, root) : null; + } + + function markRootSuspended$1(root, suspendedLanes) { + suspendedLanes &= ~workInProgressRootPingedLanes; + suspendedLanes &= ~workInProgressRootUpdatedLanes; + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; + + for (root = root.expirationTimes; 0 < suspendedLanes;) { + var index$7 = 31 - clz32(suspendedLanes), + lane = 1 << index$7; + root[index$7] = -1; + suspendedLanes &= ~lane; + } + } + + function performSyncWorkOnRoot(root) { + if (0 !== (executionContext & 24)) throw Error("Should not already be working."); + flushPassiveEffects(); + var lanes = getNextLanes(root, 0); + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()), null; + var exitStatus = renderRootSync(root, lanes); + + if (0 !== root.tag && 2 === exitStatus) { + executionContext |= 32; + root.hydrate && (root.hydrate = false); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && (lanes = errorRetryLanes, exitStatus = renderRootSync(root, lanes)); + } + + if (1 === exitStatus) throw exitStatus = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()), exitStatus; + root.finishedWork = root.current.alternate; + root.finishedLanes = lanes; + commitRoot(root); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()); + return null; + } + + function popRenderLanes() { + subtreeRenderLanes = subtreeRenderLanesCursor.current; + pop(subtreeRenderLanesCursor); + } + + function prepareFreshStack(root, lanes) { + root.finishedWork = null; + root.finishedLanes = 0; + var timeoutHandle = root.timeoutHandle; + -1 !== timeoutHandle && (root.timeoutHandle = -1, cancelTimeout(timeoutHandle)); + if (null !== workInProgress) for (timeoutHandle = workInProgress.return; null !== timeoutHandle;) { + var interruptedWork = timeoutHandle; + + switch (interruptedWork.tag) { + case 1: + interruptedWork = interruptedWork.type.childContextTypes; + null !== interruptedWork && undefined !== interruptedWork && popContext(); + break; + + case 3: + popHostContainer(); + pop(didPerformWorkStackCursor); + pop(contextStackCursor); + resetWorkInProgressVersions(); + break; + + case 5: + popHostContext(interruptedWork); + break; + + case 4: + popHostContainer(); + break; + + case 13: + pop(suspenseStackCursor); + break; + + case 19: + pop(suspenseStackCursor); + break; + + case 10: + popProvider(interruptedWork.type._context); + break; + + case 22: + case 23: + popRenderLanes(); + } + + timeoutHandle = timeoutHandle.return; + } + workInProgressRoot = root; + workInProgress = createWorkInProgress(root.current, null); + workInProgressRootRenderLanes = subtreeRenderLanes = lanes; + workInProgressRootExitStatus = 0; + workInProgressRootFatalError = null; + workInProgressRootPingedLanes = workInProgressRootUpdatedLanes = workInProgressRootSkippedLanes = 0; + + if (null !== interleavedQueues) { + for (root = 0; root < interleavedQueues.length; root++) { + if (lanes = interleavedQueues[root], timeoutHandle = lanes.interleaved, null !== timeoutHandle) { + lanes.interleaved = null; + interruptedWork = timeoutHandle.next; + var lastPendingUpdate = lanes.pending; + + if (null !== lastPendingUpdate) { + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = interruptedWork; + timeoutHandle.next = firstPendingUpdate; + } + + lanes.pending = timeoutHandle; + } + } + + interleavedQueues = null; + } + } + + function handleError(root$jscomp$0, thrownValue) { + do { + var erroredWork = workInProgress; + + try { + resetContextDependencies(); + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + + if (didScheduleRenderPhaseUpdate) { + for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook;) { + var queue = hook.queue; + null !== queue && (queue.pending = null); + hook = hook.next; + } + + didScheduleRenderPhaseUpdate = false; + } + + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + didScheduleRenderPhaseUpdateDuringThisPass = false; + ReactCurrentOwner$2.current = null; + + if (null === erroredWork || null === erroredWork.return) { + workInProgressRootExitStatus = 1; + workInProgressRootFatalError = thrownValue; + workInProgress = null; + break; + } + + a: { + var root = root$jscomp$0, + returnFiber = erroredWork.return, + sourceFiber = erroredWork, + value = thrownValue; + thrownValue = workInProgressRootRenderLanes; + sourceFiber.flags |= 8192; + + if (null !== value && "object" === typeof value && "function" === typeof value.then) { + var wakeable = value, + tag = sourceFiber.tag; + + if (0 === (sourceFiber.mode & 1) && (0 === tag || 11 === tag || 15 === tag)) { + var currentSource = sourceFiber.alternate; + currentSource ? (sourceFiber.updateQueue = currentSource.updateQueue, sourceFiber.memoizedState = currentSource.memoizedState, sourceFiber.lanes = currentSource.lanes) : (sourceFiber.updateQueue = null, sourceFiber.memoizedState = null); + } + + var hasInvisibleParentBoundary = 0 !== (suspenseStackCursor.current & 1), + workInProgress$32 = returnFiber; + + do { + var JSCompiler_temp; + + if (JSCompiler_temp = 13 === workInProgress$32.tag) { + var nextState = workInProgress$32.memoizedState; + if (null !== nextState) JSCompiler_temp = null !== nextState.dehydrated ? true : false;else { + var props = workInProgress$32.memoizedProps; + JSCompiler_temp = undefined === props.fallback ? false : true !== props.unstable_avoidThisFallback ? true : hasInvisibleParentBoundary ? false : true; + } + } + + if (JSCompiler_temp) { + var wakeables = workInProgress$32.updateQueue; + + if (null === wakeables) { + var updateQueue = new Set(); + updateQueue.add(wakeable); + workInProgress$32.updateQueue = updateQueue; + } else wakeables.add(wakeable); + + if (0 === (workInProgress$32.mode & 1) && workInProgress$32 !== returnFiber) { + workInProgress$32.flags |= 128; + sourceFiber.flags |= 32768; + sourceFiber.flags &= -10053; + if (1 === sourceFiber.tag) if (null === sourceFiber.alternate) sourceFiber.tag = 17;else { + var update = createUpdate(-1, 1); + update.tag = 2; + enqueueUpdate(sourceFiber, update); + } + sourceFiber.lanes |= 1; + break a; + } + + value = undefined; + sourceFiber = thrownValue; + var pingCache = root.pingCache; + null === pingCache ? (pingCache = root.pingCache = new PossiblyWeakMap(), value = new Set(), pingCache.set(wakeable, value)) : (value = pingCache.get(wakeable), undefined === value && (value = new Set(), pingCache.set(wakeable, value))); + + if (!value.has(sourceFiber)) { + value.add(sourceFiber); + var ping = pingSuspendedRoot.bind(null, root, wakeable, sourceFiber); + wakeable.then(ping, ping); + } + + workInProgress$32.flags |= 16384; + workInProgress$32.lanes = thrownValue; + break a; + } + + workInProgress$32 = workInProgress$32.return; + } while (null !== workInProgress$32); + + value = Error((getComponentNameFromFiber(sourceFiber) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display."); + } + + 5 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + value = createCapturedValue(value, sourceFiber); + workInProgress$32 = returnFiber; + + do { + switch (workInProgress$32.tag) { + case 3: + root = value; + workInProgress$32.flags |= 16384; + thrownValue &= -thrownValue; + workInProgress$32.lanes |= thrownValue; + var update$33 = createRootErrorUpdate(workInProgress$32, root, thrownValue); + enqueueCapturedUpdate(workInProgress$32, update$33); + break a; + + case 1: + root = value; + var ctor = workInProgress$32.type, + instance = workInProgress$32.stateNode; + + if (0 === (workInProgress$32.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) { + workInProgress$32.flags |= 16384; + thrownValue &= -thrownValue; + workInProgress$32.lanes |= thrownValue; + var update$36 = createClassErrorUpdate(workInProgress$32, root, thrownValue); + enqueueCapturedUpdate(workInProgress$32, update$36); + break a; + } + + } + + workInProgress$32 = workInProgress$32.return; + } while (null !== workInProgress$32); + } + + completeUnitOfWork(erroredWork); + } catch (yetAnotherThrownValue) { + thrownValue = yetAnotherThrownValue; + workInProgress === erroredWork && null !== erroredWork && (workInProgress = erroredWork = erroredWork.return); + continue; + } + + break; + } while (1); + } + + function pushDispatcher() { + var prevDispatcher = ReactCurrentDispatcher$2.current; + ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; + return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; + } + + function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + workInProgressRoot === root && workInProgressRootRenderLanes === lanes || prepareFreshStack(root, lanes); + + do { + try { + workLoopSync(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (1); + + resetContextDependencies(); + executionContext = prevExecutionContext; + ReactCurrentDispatcher$2.current = prevDispatcher; + if (null !== workInProgress) throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + return workInProgressRootExitStatus; + } + + function workLoopSync() { + for (; null !== workInProgress;) { + performUnitOfWork(workInProgress); + } + } + + function workLoopConcurrent() { + for (; null !== workInProgress && !_$$_REQUIRE(_dependencyMap[4]).unstable_shouldYield();) { + performUnitOfWork(workInProgress); + } + } + + function performUnitOfWork(unitOfWork) { + var next = beginWork$1(unitOfWork.alternate, unitOfWork, subtreeRenderLanes); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next; + ReactCurrentOwner$2.current = null; + } + + function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + + do { + var current = completedWork.alternate; + unitOfWork = completedWork.return; + + if (0 === (completedWork.flags & 8192)) { + if (current = completeWork(current, completedWork, subtreeRenderLanes), null !== current) { + workInProgress = current; + return; + } + } else { + current = unwindWork(completedWork); + + if (null !== current) { + current.flags &= 8191; + workInProgress = current; + return; + } + + null !== unitOfWork && (unitOfWork.flags |= 8192, unitOfWork.subtreeFlags = 0, unitOfWork.deletions = null); + } + + completedWork = completedWork.sibling; + + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + + 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); + } + + function commitRoot(root) { + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; + + try { + ReactCurrentBatchConfig$2.transition = 0, currentUpdatePriority = 1, commitRootImpl(root, previousUpdateLanePriority); + } finally { + ReactCurrentBatchConfig$2.transition = prevTransition, currentUpdatePriority = previousUpdateLanePriority; + } + + return null; + } + + function commitRootImpl(root, renderPriorityLevel) { + do { + flushPassiveEffects(); + } while (null !== rootWithPendingPassiveEffects); + + if (0 !== (executionContext & 24)) throw Error("Should not already be working."); + var finishedWork = root.finishedWork, + lanes = root.finishedLanes; + if (null === finishedWork) return null; + root.finishedWork = null; + root.finishedLanes = 0; + if (finishedWork === root.current) throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."); + root.callbackNode = null; + root.callbackPriority = 0; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + markRootFinished(root, remainingLanes); + root === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0); + 0 === (finishedWork.subtreeFlags & 1040) && 0 === (finishedWork.flags & 1040) || rootDoesHavePassiveEffects || (rootDoesHavePassiveEffects = true, _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[4]).unstable_NormalPriority, function () { + flushPassiveEffects(); + return null; + })); + remainingLanes = 0 !== (finishedWork.flags & 8054); + + if (0 !== (finishedWork.subtreeFlags & 8054) || remainingLanes) { + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 1; + var prevExecutionContext = executionContext; + executionContext |= 16; + ReactCurrentOwner$2.current = null; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffects(root, finishedWork); + root.current = finishedWork; + commitLayoutEffects(finishedWork, root, lanes); + + _$$_REQUIRE(_dependencyMap[4]).unstable_requestPaint(); + + executionContext = prevExecutionContext; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; + } else root.current = finishedWork; + + rootDoesHavePassiveEffects && (rootDoesHavePassiveEffects = false, rootWithPendingPassiveEffects = root, pendingPassiveEffectsLanes = lanes); + remainingLanes = root.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root) : nestedUpdateCount = 0; + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()); + if (hasUncaughtError) throw hasUncaughtError = false, root = firstUncaughtError, firstUncaughtError = null, root; + if (0 !== (executionContext & 4)) return null; + 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); + flushSyncCallbacks(); + return null; + } + + function flushPassiveEffects() { + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, + previousPriority = currentUpdatePriority; + + try { + ReactCurrentBatchConfig$2.transition = 0; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; + if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = false;else { + renderPriority = rootWithPendingPassiveEffects; + rootWithPendingPassiveEffects = null; + pendingPassiveEffectsLanes = 0; + if (0 !== (executionContext & 24)) throw Error("Cannot flush passive effects while already rendering."); + var prevExecutionContext = executionContext; + executionContext |= 16; + + for (nextEffect = renderPriority.current; null !== nextEffect;) { + var fiber = nextEffect, + child = fiber.child; + + if (0 !== (nextEffect.flags & 16)) { + var deletions = fiber.deletions; + + if (null !== deletions) { + for (var i = 0; i < deletions.length; i++) { + var fiberToDelete = deletions[i]; + + for (nextEffect = fiberToDelete; null !== nextEffect;) { + var fiber$jscomp$0 = nextEffect; + + switch (fiber$jscomp$0.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(4, fiber$jscomp$0, fiber); + } + + var child$jscomp$0 = fiber$jscomp$0.child; + if (null !== child$jscomp$0) child$jscomp$0.return = fiber$jscomp$0, nextEffect = child$jscomp$0;else for (; null !== nextEffect;) { + fiber$jscomp$0 = nextEffect; + var sibling = fiber$jscomp$0.sibling, + returnFiber = fiber$jscomp$0.return; + detachFiberAfterEffects(fiber$jscomp$0); + + if (fiber$jscomp$0 === fiberToDelete) { + nextEffect = null; + break; + } + + if (null !== sibling) { + sibling.return = returnFiber; + nextEffect = sibling; + break; + } + + nextEffect = returnFiber; + } + } + } + + var previousFiber = fiber.alternate; + + if (null !== previousFiber) { + var detachedChild = previousFiber.child; + + if (null !== detachedChild) { + previousFiber.child = null; + + do { + var detachedSibling = detachedChild.sibling; + detachedChild.sibling = null; + detachedChild = detachedSibling; + } while (null !== detachedChild); + } + } + + nextEffect = fiber; + } + } + + if (0 !== (fiber.subtreeFlags & 1040) && null !== child) child.return = fiber, nextEffect = child;else b: for (; null !== nextEffect;) { + fiber = nextEffect; + if (0 !== (fiber.flags & 1024)) switch (fiber.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(5, fiber, fiber.return); + } + var sibling$jscomp$0 = fiber.sibling; + + if (null !== sibling$jscomp$0) { + sibling$jscomp$0.return = fiber.return; + nextEffect = sibling$jscomp$0; + break b; + } + + nextEffect = fiber.return; + } + } + + var finishedWork = renderPriority.current; + + for (nextEffect = finishedWork; null !== nextEffect;) { + child = nextEffect; + var firstChild = child.child; + if (0 !== (child.subtreeFlags & 1040) && null !== firstChild) firstChild.return = child, nextEffect = firstChild;else b: for (child = finishedWork; null !== nextEffect;) { + deletions = nextEffect; + if (0 !== (deletions.flags & 1024)) try { + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(5, deletions); + } + } catch (error) { + captureCommitPhaseError(deletions, deletions.return, error); + } + + if (deletions === child) { + nextEffect = null; + break b; + } + + var sibling$jscomp$1 = deletions.sibling; + + if (null !== sibling$jscomp$1) { + sibling$jscomp$1.return = deletions.return; + nextEffect = sibling$jscomp$1; + break b; + } + + nextEffect = deletions.return; + } + } + + executionContext = prevExecutionContext; + flushSyncCallbacks(); + if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} + JSCompiler_inline_result = true; + } + return JSCompiler_inline_result; + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$2.transition = prevTransition; + } + } + + return false; + } + + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValue(error, sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1); + enqueueUpdate(rootFiber, sourceFiber); + sourceFiber = requestEventTime(); + rootFiber = markUpdateLaneFromFiberToRoot(rootFiber, 1); + null !== rootFiber && (markRootUpdated(rootFiber, 1, sourceFiber), ensureRootIsScheduled(rootFiber, sourceFiber)); + } + + function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { + if (3 === sourceFiber.tag) captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);else for (nearestMountedAncestor = sourceFiber.return; null !== nearestMountedAncestor;) { + if (3 === nearestMountedAncestor.tag) { + captureCommitPhaseErrorOnRoot(nearestMountedAncestor, sourceFiber, error); + break; + } else if (1 === nearestMountedAncestor.tag) { + var instance = nearestMountedAncestor.stateNode; + + if ("function" === typeof nearestMountedAncestor.type.getDerivedStateFromError || "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance))) { + sourceFiber = createCapturedValue(error, sourceFiber); + sourceFiber = createClassErrorUpdate(nearestMountedAncestor, sourceFiber, 1); + enqueueUpdate(nearestMountedAncestor, sourceFiber); + sourceFiber = requestEventTime(); + nearestMountedAncestor = markUpdateLaneFromFiberToRoot(nearestMountedAncestor, 1); + null !== nearestMountedAncestor && (markRootUpdated(nearestMountedAncestor, 1, sourceFiber), ensureRootIsScheduled(nearestMountedAncestor, sourceFiber)); + break; + } + } + + nearestMountedAncestor = nearestMountedAncestor.return; + } + } + + function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + null !== pingCache && pingCache.delete(wakeable); + wakeable = requestEventTime(); + root.pingedLanes |= root.suspendedLanes & pingedLanes; + workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 130023424) === workInProgressRootRenderLanes && 500 > _$$_REQUIRE(_dependencyMap[4]).unstable_now() - globalMostRecentFallbackTime ? prepareFreshStack(root, 0) : workInProgressRootPingedLanes |= pingedLanes); + ensureRootIsScheduled(root, wakeable); + } + + function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryCache = boundaryFiber.stateNode; + null !== retryCache && retryCache.delete(wakeable); + wakeable = 0; + 0 === wakeable && (0 === (boundaryFiber.mode & 1) ? wakeable = 1 : (wakeable = nextRetryLane, nextRetryLane <<= 1, 0 === (nextRetryLane & 130023424) && (nextRetryLane = 4194304))); + retryCache = requestEventTime(); + boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, wakeable); + null !== boundaryFiber && (markRootUpdated(boundaryFiber, wakeable, retryCache), ensureRootIsScheduled(boundaryFiber, retryCache)); + } + + var beginWork$1; + + beginWork$1 = function beginWork$1(current, workInProgress, renderLanes) { + var updateLanes = workInProgress.lanes; + if (null !== current) { + if (current.memoizedProps !== workInProgress.pendingProps || didPerformWorkStackCursor.current) didReceiveUpdate = true;else { + if (0 === (renderLanes & updateLanes)) { + didReceiveUpdate = false; + + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + break; + + case 5: + pushHostContext(workInProgress); + break; + + case 1: + isContextProvider(workInProgress.type) && pushContextProvider(workInProgress); + break; + + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + + case 10: + updateLanes = workInProgress.type._context; + var nextValue = workInProgress.memoizedProps.value; + push(valueCursor, updateLanes._currentValue); + updateLanes._currentValue = nextValue; + break; + + case 13: + if (null !== workInProgress.memoizedState) { + if (0 !== (renderLanes & workInProgress.child.childLanes)) return updateSuspenseComponent(current, workInProgress, renderLanes); + push(suspenseStackCursor, suspenseStackCursor.current & 1); + workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + return null !== workInProgress ? workInProgress.sibling : null; + } + + push(suspenseStackCursor, suspenseStackCursor.current & 1); + break; + + case 19: + updateLanes = 0 !== (renderLanes & workInProgress.childLanes); + + if (0 !== (current.flags & 128)) { + if (updateLanes) return updateSuspenseListComponent(current, workInProgress, renderLanes); + workInProgress.flags |= 128; + } + + nextValue = workInProgress.memoizedState; + null !== nextValue && (nextValue.rendering = null, nextValue.tail = null, nextValue.lastEffect = null); + push(suspenseStackCursor, suspenseStackCursor.current); + if (updateLanes) break;else return null; + + case 22: + case 23: + return workInProgress.lanes = 0, updateOffscreenComponent(current, workInProgress, renderLanes); + } + + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + + didReceiveUpdate = 0 !== (current.flags & 32768) ? true : false; + } + } else didReceiveUpdate = false; + workInProgress.lanes = 0; + + switch (workInProgress.tag) { + case 2: + updateLanes = workInProgress.type; + null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2); + current = workInProgress.pendingProps; + nextValue = getMaskedContext(workInProgress, contextStackCursor.current); + prepareToReadContext(workInProgress, renderLanes); + nextValue = renderWithHooks(null, workInProgress, updateLanes, current, nextValue, renderLanes); + workInProgress.flags |= 1; + + if ("object" === typeof nextValue && null !== nextValue && "function" === typeof nextValue.render && undefined === nextValue.$$typeof) { + workInProgress.tag = 1; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + + if (isContextProvider(updateLanes)) { + var hasContext = true; + pushContextProvider(workInProgress); + } else hasContext = false; + + workInProgress.memoizedState = null !== nextValue.state && undefined !== nextValue.state ? nextValue.state : null; + initializeUpdateQueue(workInProgress); + nextValue.updater = classComponentUpdater; + workInProgress.stateNode = nextValue; + nextValue._reactInternals = workInProgress; + mountClassInstance(workInProgress, updateLanes, current, renderLanes); + workInProgress = finishClassComponent(null, workInProgress, updateLanes, true, hasContext, renderLanes); + } else workInProgress.tag = 0, reconcileChildren(null, workInProgress, nextValue, renderLanes), workInProgress = workInProgress.child; + + return workInProgress; + + case 16: + nextValue = workInProgress.elementType; + + a: { + null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2); + current = workInProgress.pendingProps; + hasContext = nextValue._init; + nextValue = hasContext(nextValue._payload); + workInProgress.type = nextValue; + hasContext = workInProgress.tag = resolveLazyComponentTag(nextValue); + current = resolveDefaultProps(nextValue, current); + + switch (hasContext) { + case 0: + workInProgress = updateFunctionComponent(null, workInProgress, nextValue, current, renderLanes); + break a; + + case 1: + workInProgress = updateClassComponent(null, workInProgress, nextValue, current, renderLanes); + break a; + + case 11: + workInProgress = updateForwardRef(null, workInProgress, nextValue, current, renderLanes); + break a; + + case 14: + workInProgress = updateMemoComponent(null, workInProgress, nextValue, resolveDefaultProps(nextValue.type, current), updateLanes, renderLanes); + break a; + } + + throw Error("Element type is invalid. Received a promise that resolves to: " + nextValue + ". Lazy element type must resolve to a class or function."); + } + + return workInProgress; + + case 0: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), updateFunctionComponent(current, workInProgress, updateLanes, nextValue, renderLanes); + + case 1: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), updateClassComponent(current, workInProgress, updateLanes, nextValue, renderLanes); + + case 3: + pushHostRootContext(workInProgress); + updateLanes = workInProgress.updateQueue; + if (null === current || null === updateLanes) throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue."); + nextValue = workInProgress.pendingProps; + updateLanes = workInProgress.memoizedState.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextValue, null, renderLanes); + nextValue = workInProgress.memoizedState.element; + nextValue === updateLanes ? workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) : (reconcileChildren(current, workInProgress, nextValue, renderLanes), workInProgress = workInProgress.child); + return workInProgress; + + case 5: + return pushHostContext(workInProgress), updateLanes = workInProgress.pendingProps.children, markRef(current, workInProgress), reconcileChildren(current, workInProgress, updateLanes, renderLanes), workInProgress.child; + + case 6: + return null; + + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + + case 4: + return pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo), updateLanes = workInProgress.pendingProps, null === current ? workInProgress.child = reconcileChildFibers(workInProgress, null, updateLanes, renderLanes) : reconcileChildren(current, workInProgress, updateLanes, renderLanes), workInProgress.child; + + case 11: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), updateForwardRef(current, workInProgress, updateLanes, nextValue, renderLanes); + + case 7: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps, renderLanes), workInProgress.child; + + case 8: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + + case 12: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + + case 10: + a: { + updateLanes = workInProgress.type._context; + nextValue = workInProgress.pendingProps; + hasContext = workInProgress.memoizedProps; + var newValue = nextValue.value; + push(valueCursor, updateLanes._currentValue); + updateLanes._currentValue = newValue; + if (null !== hasContext) if (objectIs(hasContext.value, newValue)) { + if (hasContext.children === nextValue.children && !didPerformWorkStackCursor.current) { + workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + break a; + } + } else for (newValue = workInProgress.child, null !== newValue && (newValue.return = workInProgress); null !== newValue;) { + var list = newValue.dependencies; + + if (null !== list) { + hasContext = newValue.child; + + for (var dependency = list.firstContext; null !== dependency;) { + if (dependency.context === updateLanes) { + if (1 === newValue.tag) { + dependency = createUpdate(-1, renderLanes & -renderLanes); + dependency.tag = 2; + var updateQueue = newValue.updateQueue; + + if (null !== updateQueue) { + updateQueue = updateQueue.shared; + var pending = updateQueue.pending; + null === pending ? dependency.next = dependency : (dependency.next = pending.next, pending.next = dependency); + updateQueue.pending = dependency; + } + } + + newValue.lanes |= renderLanes; + dependency = newValue.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleWorkOnParentPath(newValue.return, renderLanes); + list.lanes |= renderLanes; + break; + } + + dependency = dependency.next; + } + } else hasContext = 10 === newValue.tag ? newValue.type === workInProgress.type ? null : newValue.child : newValue.child; + + if (null !== hasContext) hasContext.return = newValue;else for (hasContext = newValue; null !== hasContext;) { + if (hasContext === workInProgress) { + hasContext = null; + break; + } + + newValue = hasContext.sibling; + + if (null !== newValue) { + newValue.return = hasContext.return; + hasContext = newValue; + break; + } + + hasContext = hasContext.return; + } + newValue = hasContext; + } + reconcileChildren(current, workInProgress, nextValue.children, renderLanes); + workInProgress = workInProgress.child; + } + + return workInProgress; + + case 9: + return nextValue = workInProgress.type, updateLanes = workInProgress.pendingProps.children, prepareToReadContext(workInProgress, renderLanes), nextValue = readContext(nextValue), updateLanes = updateLanes(nextValue), workInProgress.flags |= 1, reconcileChildren(current, workInProgress, updateLanes, renderLanes), workInProgress.child; + + case 14: + return nextValue = workInProgress.type, hasContext = resolveDefaultProps(nextValue, workInProgress.pendingProps), hasContext = resolveDefaultProps(nextValue.type, hasContext), updateMemoComponent(current, workInProgress, nextValue, hasContext, updateLanes, renderLanes); + + case 15: + return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateLanes, renderLanes); + + case 17: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2), workInProgress.tag = 1, isContextProvider(updateLanes) ? (current = true, pushContextProvider(workInProgress)) : current = false, prepareToReadContext(workInProgress, renderLanes), constructClassInstance(workInProgress, updateLanes, nextValue), mountClassInstance(workInProgress, updateLanes, nextValue, renderLanes), finishClassComponent(null, workInProgress, updateLanes, true, current, renderLanes); + + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + + case 23: + return updateOffscreenComponent(current, workInProgress, renderLanes); + } + + throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue."); + }; + + function FiberNode(tag, pendingProps, key, mode) { + this.tag = tag; + this.key = key; + this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null; + this.index = 0; + this.ref = null; + this.pendingProps = pendingProps; + this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null; + this.mode = mode; + this.subtreeFlags = this.flags = 0; + this.deletions = null; + this.childLanes = this.lanes = 0; + this.alternate = null; + } + + function createFiber(tag, pendingProps, key, mode) { + return new FiberNode(tag, pendingProps, key, mode); + } + + function shouldConstruct(Component) { + Component = Component.prototype; + return !(!Component || !Component.isReactComponent); + } + + function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) return shouldConstruct(Component) ? 1 : 0; + + if (undefined !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + + return 2; + } + + function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + null === workInProgress ? (workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode), workInProgress.elementType = current.elementType, workInProgress.type = current.type, workInProgress.stateNode = current.stateNode, workInProgress.alternate = current, current.alternate = workInProgress) : (workInProgress.pendingProps = pendingProps, workInProgress.type = current.type, workInProgress.flags = 0, workInProgress.subtreeFlags = 0, workInProgress.deletions = null); + workInProgress.flags = current.flags & 1835008; + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; + pendingProps = current.dependencies; + workInProgress.dependencies = null === pendingProps ? null : { + lanes: pendingProps.lanes, + firstContext: pendingProps.firstContext + }; + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + return workInProgress; + } + + function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) { + var fiberTag = 2; + owner = type; + if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);else if ("string" === typeof type) fiberTag = 5;else a: switch (type) { + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, lanes, key); + + case REACT_DEBUG_TRACING_MODE_TYPE: + fiberTag = 8; + mode |= 4; + break; + + case REACT_STRICT_MODE_TYPE: + fiberTag = 8; + mode |= 8; + break; + + case REACT_PROFILER_TYPE: + return type = createFiber(12, pendingProps, key, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type; + + case REACT_SUSPENSE_TYPE: + return type = createFiber(13, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_TYPE, type.lanes = lanes, type; + + case REACT_SUSPENSE_LIST_TYPE: + return type = createFiber(19, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_LIST_TYPE, type.lanes = lanes, type; + + case REACT_OFFSCREEN_TYPE: + return createFiberFromOffscreen(pendingProps, mode, lanes, key); + + case REACT_LEGACY_HIDDEN_TYPE: + return type = createFiber(23, pendingProps, key, mode), type.elementType = REACT_LEGACY_HIDDEN_TYPE, type.lanes = lanes, type; + + default: + if ("object" === typeof type && null !== type) switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + fiberTag = 10; + break a; + + case REACT_CONTEXT_TYPE: + fiberTag = 9; + break a; + + case REACT_FORWARD_REF_TYPE: + fiberTag = 11; + break a; + + case REACT_MEMO_TYPE: + fiberTag = 14; + break a; + + case REACT_LAZY_TYPE: + fiberTag = 16; + owner = null; + break a; + } + throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (null == type ? type : typeof type) + "."); + } + key = createFiber(fiberTag, pendingProps, key, mode); + key.elementType = type; + key.type = owner; + key.lanes = lanes; + return key; + } + + function createFiberFromFragment(elements, mode, lanes, key) { + elements = createFiber(7, elements, key, mode); + elements.lanes = lanes; + return elements; + } + + function createFiberFromOffscreen(pendingProps, mode, lanes, key) { + pendingProps = createFiber(22, pendingProps, key, mode); + pendingProps.elementType = REACT_OFFSCREEN_TYPE; + pendingProps.lanes = lanes; + return pendingProps; + } + + function createFiberFromText(content, mode, lanes) { + content = createFiber(6, content, null, mode); + content.lanes = lanes; + return content; + } + + function createFiberFromPortal(portal, mode, lanes) { + mode = createFiber(4, null !== portal.children ? portal.children : [], portal.key, mode); + mode.lanes = lanes; + mode.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + implementation: portal.implementation + }; + return mode; + } + + function FiberRootNode(containerInfo, tag, hydrate) { + this.tag = tag; + this.containerInfo = containerInfo; + this.finishedWork = this.pingCache = this.current = this.pendingChildren = null; + this.timeoutHandle = -1; + this.pendingContext = this.context = null; + this.hydrate = hydrate; + this.callbackNode = null; + this.callbackPriority = 0; + this.eventTimes = createLaneMap(0); + this.expirationTimes = createLaneMap(-1); + this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; + this.entanglements = createLaneMap(0); + } + + function createPortal(children, containerInfo, implementation) { + var key = 3 < arguments.length && undefined !== arguments[3] ? arguments[3] : null; + return { + $$typeof: REACT_PORTAL_TYPE, + key: null == key ? null : "" + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; + } + + function findHostInstance(component) { + var fiber = component._reactInternals; + + if (undefined === fiber) { + if ("function" === typeof component.render) throw Error("Unable to find node on an unmounted component."); + throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component)); + } + + component = findCurrentHostFiber(fiber); + return null === component ? null : component.stateNode; + } + + function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + eventTime = requestEventTime(), + lane = requestUpdateLane(current); + + a: if (parentComponent) { + parentComponent = parentComponent._reactInternals; + + b: { + if (getNearestMountedFiber(parentComponent) !== parentComponent || 1 !== parentComponent.tag) throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."); + var JSCompiler_inline_result = parentComponent; + + do { + switch (JSCompiler_inline_result.tag) { + case 3: + JSCompiler_inline_result = JSCompiler_inline_result.stateNode.context; + break b; + + case 1: + if (isContextProvider(JSCompiler_inline_result.type)) { + JSCompiler_inline_result = JSCompiler_inline_result.stateNode.__reactInternalMemoizedMergedChildContext; + break b; + } + + } + + JSCompiler_inline_result = JSCompiler_inline_result.return; + } while (null !== JSCompiler_inline_result); + + throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."); + } + + if (1 === parentComponent.tag) { + var Component = parentComponent.type; + + if (isContextProvider(Component)) { + parentComponent = processChildContext(parentComponent, Component, JSCompiler_inline_result); + break a; + } + } + + parentComponent = JSCompiler_inline_result; + } else parentComponent = emptyContextObject; + + null === container.context ? container.context = parentComponent : container.pendingContext = parentComponent; + container = createUpdate(eventTime, lane); + container.payload = { + element: element + }; + callback = undefined === callback ? null : callback; + null !== callback && (container.callback = callback); + enqueueUpdate(current, container); + element = scheduleUpdateOnFiber(current, lane, eventTime); + null !== element && entangleTransitions(element, current, lane); + return lane; + } + + function emptyFindFiberByHostInstance() { + return null; + } + + function findNodeHandle(componentOrHandle) { + if (null == componentOrHandle) return null; + if ("number" === typeof componentOrHandle) return componentOrHandle; + if (componentOrHandle._nativeTag) return componentOrHandle._nativeTag; + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) return componentOrHandle.canonical._nativeTag; + componentOrHandle = findHostInstance(componentOrHandle); + return null == componentOrHandle ? componentOrHandle : componentOrHandle.canonical ? componentOrHandle.canonical._nativeTag : componentOrHandle._nativeTag; + } + + function unmountComponentAtNode(containerTag) { + var root = roots.get(containerTag); + root && updateContainer(null, root, null, function () { + roots.delete(containerTag); + }); + } + + batchedUpdatesImpl = function batchedUpdatesImpl(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= 1; + + try { + return fn(a); + } finally { + executionContext = prevExecutionContext, 0 === executionContext && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks()); + } + }; + + var roots = new Map(), + devToolsConfig$jscomp$inline_983 = { + findFiberByHostInstance: getInstanceFromTag, + bundleType: 0, + version: "18.0.0-experimental-568dc3532", + rendererPackageName: "react-native-renderer", + rendererConfig: { + getInspectorDataForViewTag: function getInspectorDataForViewTag() { + throw Error("getInspectorDataForViewTag() is not available in production"); + }, + getInspectorDataForViewAtPoint: function () { + throw Error("getInspectorDataForViewAtPoint() is not available in production."); + }.bind(null, findNodeHandle) + } + }; + var internals$jscomp$inline_1237 = { + bundleType: devToolsConfig$jscomp$inline_983.bundleType, + version: devToolsConfig$jscomp$inline_983.version, + rendererPackageName: devToolsConfig$jscomp$inline_983.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_983.rendererConfig, + overrideHookState: null, + overrideHookStateDeletePath: null, + overrideHookStateRenamePath: null, + overrideProps: null, + overridePropsDeletePath: null, + overridePropsRenamePath: null, + setErrorHandler: null, + setSuspenseHandler: null, + scheduleUpdate: null, + currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher, + findHostInstanceByFiber: function findHostInstanceByFiber(fiber) { + fiber = findCurrentHostFiber(fiber); + return null === fiber ? null : fiber.stateNode; + }, + findFiberByHostInstance: devToolsConfig$jscomp$inline_983.findFiberByHostInstance || emptyFindFiberByHostInstance, + findHostInstancesForRefresh: null, + scheduleRefresh: null, + scheduleRoot: null, + setRefreshHandler: null, + getCurrentFiber: null, + reconcilerVersion: "18.0.0-experimental-568dc3532" + }; + + if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { + var hook$jscomp$inline_1238 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (!hook$jscomp$inline_1238.isDisabled && hook$jscomp$inline_1238.supportsFiber) try { + rendererID = hook$jscomp$inline_1238.inject(internals$jscomp$inline_1237), injectedHook = hook$jscomp$inline_1238; + } catch (err) {} + } + + exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = { + computeComponentStackForErrorReporting: function computeComponentStackForErrorReporting(reactTag) { + return (reactTag = getInstanceFromTag(reactTag)) ? getStackByFiberInDevAndProd(reactTag) : ""; + } + }; + + exports.createPortal = function (children, containerTag) { + return createPortal(children, containerTag, null, 2 < arguments.length && undefined !== arguments[2] ? arguments[2] : null); + }; + + exports.dispatchCommand = function (handle, command, args) { + null != handle._nativeTag && (handle._internalInstanceHandle ? nativeFabricUIManager.dispatchCommand(handle._internalInstanceHandle.stateNode.node, command, args) : _$$_REQUIRE(_dependencyMap[3]).UIManager.dispatchViewManagerCommand(handle._nativeTag, command, args)); + }; + + exports.findHostInstance_DEPRECATED = function (componentOrHandle) { + if (null == componentOrHandle) return null; + if (componentOrHandle._nativeTag) return componentOrHandle; + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) return componentOrHandle.canonical; + componentOrHandle = findHostInstance(componentOrHandle); + return null == componentOrHandle ? componentOrHandle : componentOrHandle.canonical ? componentOrHandle.canonical : componentOrHandle; + }; + + exports.findNodeHandle = findNodeHandle; + + exports.render = function (element, containerTag, callback) { + var root = roots.get(containerTag); + + if (!root) { + root = new FiberRootNode(containerTag, 0, false); + var JSCompiler_inline_result = createFiber(3, null, null, 0); + root.current = JSCompiler_inline_result; + JSCompiler_inline_result.stateNode = root; + JSCompiler_inline_result.memoizedState = { + element: null + }; + initializeUpdateQueue(JSCompiler_inline_result); + roots.set(containerTag, root); + } + + updateContainer(element, root, null, callback); + + a: if (element = root.current, element.child) switch (element.child.tag) { + case 5: + element = element.child.stateNode; + break a; + + default: + element = element.child.stateNode; + } else element = null; + + return element; + }; + + exports.sendAccessibilityEvent = function (handle, eventType) { + null != handle._nativeTag && (handle._internalInstanceHandle ? nativeFabricUIManager.sendAccessibilityEvent(handle._internalInstanceHandle.stateNode.node, eventType) : _$$_REQUIRE(_dependencyMap[3]).legacySendAccessibilityEvent(handle._nativeTag, eventType)); + }; + + exports.unmountComponentAtNode = unmountComponentAtNode; + + exports.unmountComponentAtNodeAndRemoveContainer = function (containerTag) { + unmountComponentAtNode(containerTag); + + _$$_REQUIRE(_dependencyMap[3]).UIManager.removeRootView(containerTag); + }; + + exports.unstable_batchedUpdates = batchedUpdates; +},55,[56,17,6,136,180]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + _$$_REQUIRE(_dependencyMap[0]); +},56,[57]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var start = Date.now(); + + _$$_REQUIRE(_dependencyMap[0]); + + _$$_REQUIRE(_dependencyMap[1]); + + _$$_REQUIRE(_dependencyMap[2]); + + _$$_REQUIRE(_dependencyMap[3]); + + _$$_REQUIRE(_dependencyMap[4]); + + _$$_REQUIRE(_dependencyMap[5]); + + _$$_REQUIRE(_dependencyMap[6]); + + _$$_REQUIRE(_dependencyMap[7]); + + _$$_REQUIRE(_dependencyMap[8]); + + _$$_REQUIRE(_dependencyMap[9]); + + _$$_REQUIRE(_dependencyMap[10]); + + _$$_REQUIRE(_dependencyMap[11]); + + _$$_REQUIRE(_dependencyMap[12]).markPoint('initializeCore_start', _$$_REQUIRE(_dependencyMap[12]).currentTimestamp() - (Date.now() - start)); + + _$$_REQUIRE(_dependencyMap[12]).markPoint('initializeCore_end'); +},57,[58,59,60,61,71,78,83,88,118,123,124,134,97]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (global.window === undefined) { + global.window = global; + } + + if (global.self === undefined) { + global.self = global; + } + + global.process = global.process || {}; + global.process.env = global.process.env || {}; + + if (!global.process.env.NODE_ENV) { + global.process.env.NODE_ENV = 'production'; + } +},58,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (!global.performance) { + global.performance = {}; + } + + if (typeof global.performance.now !== 'function') { + global.performance.now = function () { + var performanceNow = global.nativePerformanceNow || Date.now; + return performanceNow(); + }; + } +},59,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (global.__RCTProfileIsProfiling) { + var Systrace = _$$_REQUIRE(_dependencyMap[0]); + + Systrace.installReactHook(); + Systrace.setEnabled(true); + } +},60,[47]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + _$$_REQUIRE(_dependencyMap[0]).installConsoleErrorReporter(); + + if (!global.__fbDisableExceptionsManager) { + var handleError = function handleError(e, isFatal) { + try { + _$$_REQUIRE(_dependencyMap[0]).handleException(e, isFatal); + } catch (ee) { + throw e; + } + }; + + var ErrorUtils = _$$_REQUIRE(_dependencyMap[1]); + + ErrorUtils.setGlobalHandler(handleError); + } +},61,[62,48]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SyntheticError = function (_Error) { + _$$_REQUIRE(_dependencyMap[2])(SyntheticError, _Error); + + var _super = _createSuper(SyntheticError); + + function SyntheticError() { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, SyntheticError); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.name = ''; + return _this; + } + + return SyntheticError; + }(_$$_REQUIRE(_dependencyMap[4])(Error)); + + var userExceptionDecorator; + var inUserExceptionDecorator = false; + + function unstable_setExceptionDecorator(exceptionDecorator) { + userExceptionDecorator = exceptionDecorator; + } + + function preprocessException(data) { + if (userExceptionDecorator && !inUserExceptionDecorator) { + inUserExceptionDecorator = true; + + try { + return userExceptionDecorator(data); + } catch (_unused) {} finally { + inUserExceptionDecorator = false; + } + } + + return data; + } + + var exceptionID = 0; + + function reportException(e, isFatal, reportToConsole) { + var parseErrorStack = _$$_REQUIRE(_dependencyMap[5]); + + var stack = parseErrorStack(e == null ? undefined : e.stack); + var currentExceptionID = ++exceptionID; + var originalMessage = e.message || ''; + var message = originalMessage; + + if (e.componentStack != null) { + message += "\n\nThis error is located at:" + e.componentStack; + } + + var namePrefix = e.name == null || e.name === '' ? '' : e.name + ": "; + + if (!message.startsWith(namePrefix)) { + message = namePrefix + message; + } + + message = e.jsEngine == null ? message : message + ", js engine: " + e.jsEngine; + var data = preprocessException({ + message: message, + originalMessage: message === originalMessage ? null : originalMessage, + name: e.name == null || e.name === '' ? null : e.name, + componentStack: typeof e.componentStack === 'string' ? e.componentStack : null, + stack: stack, + id: currentExceptionID, + isFatal: isFatal, + extraData: { + jsEngine: e.jsEngine, + rawStack: e.stack + } + }); + + if (reportToConsole) { + console.error(data.message); + } + + if (isFatal || e.type !== 'warn') { + var NativeExceptionsManager = _$$_REQUIRE(_dependencyMap[6]).default; + + if (NativeExceptionsManager) { + NativeExceptionsManager.reportException(data); + } + } + } + + var inExceptionHandler = false; + + function handleException(e, isFatal) { + var error; + + if (e instanceof Error) { + error = e; + } else { + error = new SyntheticError(e); + } + + try { + inExceptionHandler = true; + reportException(error, isFatal, true); + } finally { + inExceptionHandler = false; + } + } + + function reactConsoleErrorHandler() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (!function () {}) { + return; + } + + if (inExceptionHandler) { + return; + } + + var error; + var firstArg = args[0]; + + if (firstArg != null && firstArg.stack) { + error = firstArg; + } else { + var stringifySafe = _$$_REQUIRE(_dependencyMap[7]).default; + + if (typeof firstArg === 'string' && firstArg.startsWith('Warning: ')) { + return; + } + + var message = args.map(function (arg) { + return typeof arg === 'string' ? arg : stringifySafe(arg); + }).join(' '); + error = new SyntheticError(message); + error.name = 'console.error'; + } + + reportException(error, false, false); + } + + function installConsoleErrorReporter() { + if (function () {}) { + return; + } + + console._errorOriginal = function () {}; + + console.error = reactConsoleErrorHandler; + + if (function () {} === undefined) { + console.reportErrorsAsExceptions = function () {}; + } + } + + module.exports = { + handleException: handleException, + installConsoleErrorReporter: installConsoleErrorReporter, + SyntheticError: SyntheticError, + unstable_setExceptionDecorator: unstable_setExceptionDecorator + }; +},62,[16,14,12,7,63,67,70,49]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _wrapNativeSuper(Class) { + var _cache = typeof Map === "function" ? new Map() : undefined; + + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) { + if (Class === null || !_$$_REQUIRE(_dependencyMap[0])(Class)) return Class; + + if (typeof Class !== "function") { + throw new TypeError("Super expression must either be null or a function"); + } + + if (typeof _cache !== "undefined") { + if (_cache.has(Class)) return _cache.get(Class); + + _cache.set(Class, Wrapper); + } + + function Wrapper() { + return _$$_REQUIRE(_dependencyMap[1])(Class, arguments, _$$_REQUIRE(_dependencyMap[2])(this).constructor); + } + + Wrapper.prototype = Object.create(Class.prototype, { + constructor: { + value: Wrapper, + enumerable: false, + writable: true, + configurable: true + } + }); + return _$$_REQUIRE(_dependencyMap[3])(Wrapper, Class); + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + return _wrapNativeSuper(Class); + } + + module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; +},63,[64,65,16,13]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _isNativeFunction(fn) { + try { + return Function.toString.call(fn).indexOf("[native code]") !== -1; + } catch (e) { + return typeof fn === "function"; + } + } + + module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports; +},64,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _construct(t, e, r) { + if (_$$_REQUIRE(_dependencyMap[0])()) return Reflect.construct.apply(null, arguments); + var o = [null]; + o.push.apply(o, e); + var p = new (t.bind.apply(t, o))(); + return r && _$$_REQUIRE(_dependencyMap[1])(p, r.prototype), p; + } + + module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports; +},65,[66,13]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _isNativeReflectConstruct() { + try { + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + } catch (t) {} + + return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() { + return !!t; + }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); + } + + module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports; +},66,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function convertHermesStack(stack) { + var frames = []; + + for (var _iterator = _createForOfIteratorHelperLoose(stack.entries), _step; !(_step = _iterator()).done;) { + var entry = _step.value; + + if (entry.type !== 'FRAME') { + continue; + } + + var location = entry.location, + functionName = entry.functionName; + + if (location.type === 'NATIVE') { + continue; + } + + frames.push({ + methodName: functionName, + file: location.sourceUrl, + lineNumber: location.line1Based, + column: location.type === 'SOURCE' ? location.column1Based - 1 : location.virtualOffset0Based + }); + } + + return frames; + } + + function parseErrorStack(errorStack) { + if (errorStack == null) { + return []; + } + + var stacktraceParser = _$$_REQUIRE(_dependencyMap[0]); + + var parsedStack = Array.isArray(errorStack) ? errorStack : global.HermesInternal ? convertHermesStack(_$$_REQUIRE(_dependencyMap[1])(errorStack)) : stacktraceParser.parse(errorStack).map(function (frame) { + return _$$_REQUIRE(_dependencyMap[2])({}, frame, { + column: frame.column != null ? frame.column - 1 : null + }); + }); + return parsedStack; + } + + module.exports = parseErrorStack; +},67,[68,69,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var UNKNOWN_FUNCTION = ''; + + function parse(stackString) { + var lines = stackString.split('\n'); + return lines.reduce(function (stack, line) { + var parseResult = parseChrome(line) || parseWinjs(line) || parseGecko(line) || parseNode(line) || parseJSC(line); + + if (parseResult) { + stack.push(parseResult); + } + + return stack; + }, []); + } + + var chromeRe = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack||\/|[a-z]:\\|\\\\).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i; + var chromeEvalRe = /\((\S*)(?::(\d+))(?::(\d+))\)/; + + function parseChrome(line) { + var parts = chromeRe.exec(line); + + if (!parts) { + return null; + } + + var isNative = parts[2] && parts[2].indexOf('native') === 0; + var isEval = parts[2] && parts[2].indexOf('eval') === 0; + var submatch = chromeEvalRe.exec(parts[2]); + + if (isEval && submatch != null) { + parts[2] = submatch[1]; + parts[3] = submatch[2]; + parts[4] = submatch[3]; + } + + return { + file: !isNative ? parts[2] : null, + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: isNative ? [parts[2]] : [], + lineNumber: parts[3] ? +parts[3] : null, + column: parts[4] ? +parts[4] : null + }; + } + + var winjsRe = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i; + + function parseWinjs(line) { + var parts = winjsRe.exec(line); + + if (!parts) { + return null; + } + + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; + } + + var geckoRe = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i; + var geckoEvalRe = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i; + + function parseGecko(line) { + var parts = geckoRe.exec(line); + + if (!parts) { + return null; + } + + var isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + var submatch = geckoEvalRe.exec(parts[3]); + + if (isEval && submatch != null) { + parts[3] = submatch[1]; + parts[4] = submatch[2]; + parts[5] = null; + } + + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: parts[2] ? parts[2].split(',') : [], + lineNumber: parts[4] ? +parts[4] : null, + column: parts[5] ? +parts[5] : null + }; + } + + var javaScriptCoreRe = /^\s*(?:([^@]*)(?:\((.*?)\))?@)?(\S.*?):(\d+)(?::(\d+))?\s*$/i; + + function parseJSC(line) { + var parts = javaScriptCoreRe.exec(line); + + if (!parts) { + return null; + } + + return { + file: parts[3], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[4], + column: parts[5] ? +parts[5] : null + }; + } + + var nodeRe = /^\s*at (?:((?:\[object object\])?[^\\/]+(?: \[as \S+\])?) )?\(?(.*?):(\d+)(?::(\d+))?\)?\s*$/i; + + function parseNode(line) { + var parts = nodeRe.exec(line); + + if (!parts) { + return null; + } + + return { + file: parts[2], + methodName: parts[1] || UNKNOWN_FUNCTION, + arguments: [], + lineNumber: +parts[3], + column: parts[4] ? +parts[4] : null + }; + } + + exports.parse = parse; +},68,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var RE_FRAME = /^ {4}at (.+?)(?: \((native)\)?| \((address at )?(.*?):(\d+):(\d+)\))$/; + var RE_SKIPPED = /^ {4}... skipping (\d+) frames$/; + + function parseLine(line) { + var asFrame = line.match(RE_FRAME); + + if (asFrame) { + return { + type: 'FRAME', + functionName: asFrame[1], + location: asFrame[2] === 'native' ? { + type: 'NATIVE' + } : asFrame[3] === 'address at ' ? { + type: 'BYTECODE', + sourceUrl: asFrame[4], + line1Based: Number.parseInt(asFrame[5], 10), + virtualOffset0Based: Number.parseInt(asFrame[6], 10) + } : { + type: 'SOURCE', + sourceUrl: asFrame[4], + line1Based: Number.parseInt(asFrame[5], 10), + column1Based: Number.parseInt(asFrame[6], 10) + } + }; + } + + var asSkipped = line.match(RE_SKIPPED); + + if (asSkipped) { + return { + type: 'SKIPPED', + count: Number.parseInt(asSkipped[1], 10) + }; + } + } + + module.exports = function parseHermesStack(stack) { + var lines = stack.split(/\n/); + var entries = []; + var lastMessageLine = -1; + + for (var i = 0; i < lines.length; ++i) { + var line = lines[i]; + + if (!line) { + continue; + } + + var entry = parseLine(line); + + if (entry) { + entries.push(entry); + continue; + } + + lastMessageLine = i; + entries = []; + } + + var message = lines.slice(0, lastMessageLine + 1).join('\n'); + return { + message: message, + entries: entries + }; + }; +},69,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NativeModule = TurboModuleRegistry.getEnforcing('ExceptionsManager'); + var ExceptionsManager = { + reportFatalException: function reportFatalException(message, stack, exceptionId) { + NativeModule.reportFatalException(message, stack, exceptionId); + }, + reportSoftException: function reportSoftException(message, stack, exceptionId) { + NativeModule.reportSoftException(message, stack, exceptionId); + }, + updateExceptionMessage: function updateExceptionMessage(message, stack, exceptionId) { + NativeModule.updateExceptionMessage(message, stack, exceptionId); + }, + dismissRedbox: function dismissRedbox() {}, + reportException: function reportException(data) { + if (NativeModule.reportException) { + NativeModule.reportException(data); + return; + } + + if (data.isFatal) { + ExceptionsManager.reportFatalException(data.message, data.stack, data.id); + } else { + ExceptionsManager.reportSoftException(data.message, data.stack, data.id); + } + } + }; + var _default = ExceptionsManager; + exports.default = _default; +},70,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _global, _global$HermesInterna; + + if ((_global = global) != null && (_global$HermesInterna = _global.HermesInternal) != null && _global$HermesInterna.hasPromise != null && _global$HermesInterna.hasPromise()) { + var HermesPromise = global.Promise; + } else { + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('Promise', function () { + return _$$_REQUIRE(_dependencyMap[1]); + }); + } +},71,[72,73]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function polyfillObjectProperty(object, name, getValue) { + var descriptor = Object.getOwnPropertyDescriptor(object, name); + + var _ref = descriptor || {}, + enumerable = _ref.enumerable, + writable = _ref.writable, + _ref$configurable = _ref.configurable, + configurable = _ref$configurable === undefined ? false : _ref$configurable; + + if (descriptor && !configurable) { + console.error('Failed to set polyfill. ' + name + ' is not configurable.'); + return; + } + + _$$_REQUIRE(_dependencyMap[0])(object, name, { + get: getValue, + enumerable: enumerable !== false, + writable: writable !== false + }); + } + + function polyfillGlobal(name, getValue) { + polyfillObjectProperty(global, name, getValue); + } + + module.exports = { + polyfillObjectProperty: polyfillObjectProperty, + polyfillGlobal: polyfillGlobal + }; +},72,[50]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + _$$_REQUIRE(_dependencyMap[0]); + + _$$_REQUIRE(_dependencyMap[1]); + + module.exports = _$$_REQUIRE(_dependencyMap[2]); +},73,[74,76,77]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]); + + _$$_REQUIRE(_dependencyMap[0]).prototype.done = function (onFulfilled, onRejected) { + var self = arguments.length ? this.then.apply(this, arguments) : this; + self.then(null, function (err) { + setTimeout(function () { + throw err; + }, 0); + }); + }; +},74,[75]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function noop() {} + + var LAST_ERROR = null; + var IS_ERROR = {}; + + function getThen(obj) { + try { + return obj.then; + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } + } + + function tryCallOne(fn, a) { + try { + return fn(a); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } + } + + function tryCallTwo(fn, a, b) { + try { + fn(a, b); + } catch (ex) { + LAST_ERROR = ex; + return IS_ERROR; + } + } + + module.exports = Promise; + + function Promise(fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + + if (typeof fn !== 'function') { + throw new TypeError('Promise constructor\'s argument is not a function'); + } + + this._x = 0; + this._y = 0; + this._z = null; + this._A = null; + if (fn === noop) return; + doResolve(fn, this); + } + + Promise._B = null; + Promise._C = null; + Promise._D = noop; + + Promise.prototype.then = function (onFulfilled, onRejected) { + if (this.constructor !== Promise) { + return safeThen(this, onFulfilled, onRejected); + } + + var res = new Promise(noop); + handle(this, new Handler(onFulfilled, onRejected, res)); + return res; + }; + + function safeThen(self, onFulfilled, onRejected) { + return new self.constructor(function (resolve, reject) { + var res = new Promise(noop); + res.then(resolve, reject); + handle(self, new Handler(onFulfilled, onRejected, res)); + }); + } + + function handle(self, deferred) { + while (self._y === 3) { + self = self._z; + } + + if (Promise._B) { + Promise._B(self); + } + + if (self._y === 0) { + if (self._x === 0) { + self._x = 1; + self._A = deferred; + return; + } + + if (self._x === 1) { + self._x = 2; + self._A = [self._A, deferred]; + return; + } + + self._A.push(deferred); + + return; + } + + handleResolved(self, deferred); + } + + function handleResolved(self, deferred) { + setImmediate(function () { + var cb = self._y === 1 ? deferred.onFulfilled : deferred.onRejected; + + if (cb === null) { + if (self._y === 1) { + resolve(deferred.promise, self._z); + } else { + reject(deferred.promise, self._z); + } + + return; + } + + var ret = tryCallOne(cb, self._z); + + if (ret === IS_ERROR) { + reject(deferred.promise, LAST_ERROR); + } else { + resolve(deferred.promise, ret); + } + }); + } + + function resolve(self, newValue) { + if (newValue === self) { + return reject(self, new TypeError('A promise cannot be resolved with itself.')); + } + + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = getThen(newValue); + + if (then === IS_ERROR) { + return reject(self, LAST_ERROR); + } + + if (then === self.then && newValue instanceof Promise) { + self._y = 3; + self._z = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(then.bind(newValue), self); + return; + } + } + + self._y = 1; + self._z = newValue; + finale(self); + } + + function reject(self, newValue) { + self._y = 2; + self._z = newValue; + + if (Promise._C) { + Promise._C(self, newValue); + } + + finale(self); + } + + function finale(self) { + if (self._x === 1) { + handle(self, self._A); + self._A = null; + } + + if (self._x === 2) { + for (var i = 0; i < self._A.length; i++) { + handle(self, self._A[i]); + } + + self._A = null; + } + } + + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + + function doResolve(fn, promise) { + var done = false; + var res = tryCallTwo(fn, function (value) { + if (done) return; + done = true; + resolve(promise, value); + }, function (reason) { + if (done) return; + done = true; + reject(promise, reason); + }); + + if (!done && res === IS_ERROR) { + done = true; + reject(promise, LAST_ERROR); + } + } +},75,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]); + + _$$_REQUIRE(_dependencyMap[0]).prototype.finally = function (f) { + return this.then(function (value) { + return _$$_REQUIRE(_dependencyMap[0]).resolve(f()).then(function () { + return value; + }); + }, function (err) { + return _$$_REQUIRE(_dependencyMap[0]).resolve(f()).then(function () { + throw err; + }); + }); + }; +},76,[75]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]); + var TRUE = valuePromise(true); + var FALSE = valuePromise(false); + var NULL = valuePromise(null); + var UNDEFINED = valuePromise(undefined); + var ZERO = valuePromise(0); + var EMPTYSTRING = valuePromise(''); + + function valuePromise(value) { + var p = new (_$$_REQUIRE(_dependencyMap[0]))(_$$_REQUIRE(_dependencyMap[0])._D); + p._y = 1; + p._z = value; + return p; + } + + _$$_REQUIRE(_dependencyMap[0]).resolve = function (value) { + if (value instanceof _$$_REQUIRE(_dependencyMap[0])) return value; + if (value === null) return NULL; + if (value === undefined) return UNDEFINED; + if (value === true) return TRUE; + if (value === false) return FALSE; + if (value === 0) return ZERO; + if (value === '') return EMPTYSTRING; + + if (typeof value === 'object' || typeof value === 'function') { + try { + var then = value.then; + + if (typeof then === 'function') { + return new (_$$_REQUIRE(_dependencyMap[0]))(then.bind(value)); + } + } catch (ex) { + return new (_$$_REQUIRE(_dependencyMap[0]))(function (resolve, reject) { + reject(ex); + }); + } + } + + return valuePromise(value); + }; + + var _iterableToArray = function iterableToArray(iterable) { + if (typeof Array.from === 'function') { + _iterableToArray = Array.from; + return Array.from(iterable); + } + + _iterableToArray = function iterableToArray(x) { + return Array.prototype.slice.call(x); + }; + + return Array.prototype.slice.call(iterable); + }; + + _$$_REQUIRE(_dependencyMap[0]).all = function (arr) { + var args = _iterableToArray(arr); + + return new (_$$_REQUIRE(_dependencyMap[0]))(function (resolve, reject) { + if (args.length === 0) return resolve([]); + var remaining = args.length; + + function res(i, val) { + if (val && (typeof val === 'object' || typeof val === 'function')) { + if (val instanceof _$$_REQUIRE(_dependencyMap[0]) && val.then === _$$_REQUIRE(_dependencyMap[0]).prototype.then) { + while (val._y === 3) { + val = val._z; + } + + if (val._y === 1) return res(i, val._z); + if (val._y === 2) reject(val._z); + val.then(function (val) { + res(i, val); + }, reject); + return; + } else { + var then = val.then; + + if (typeof then === 'function') { + var p = new (_$$_REQUIRE(_dependencyMap[0]))(then.bind(val)); + p.then(function (val) { + res(i, val); + }, reject); + return; + } + } + } + + args[i] = val; + + if (--remaining === 0) { + resolve(args); + } + } + + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + + function onSettledFulfill(value) { + return { + status: 'fulfilled', + value: value + }; + } + + function onSettledReject(reason) { + return { + status: 'rejected', + reason: reason + }; + } + + function mapAllSettled(item) { + if (item && (typeof item === 'object' || typeof item === 'function')) { + if (item instanceof _$$_REQUIRE(_dependencyMap[0]) && item.then === _$$_REQUIRE(_dependencyMap[0]).prototype.then) { + return item.then(onSettledFulfill, onSettledReject); + } + + var then = item.then; + + if (typeof then === 'function') { + return new (_$$_REQUIRE(_dependencyMap[0]))(then.bind(item)).then(onSettledFulfill, onSettledReject); + } + } + + return onSettledFulfill(item); + } + + _$$_REQUIRE(_dependencyMap[0]).allSettled = function (iterable) { + return _$$_REQUIRE(_dependencyMap[0]).all(_iterableToArray(iterable).map(mapAllSettled)); + }; + + _$$_REQUIRE(_dependencyMap[0]).reject = function (value) { + return new (_$$_REQUIRE(_dependencyMap[0]))(function (resolve, reject) { + reject(value); + }); + }; + + _$$_REQUIRE(_dependencyMap[0]).race = function (values) { + return new (_$$_REQUIRE(_dependencyMap[0]))(function (resolve, reject) { + _iterableToArray(values).forEach(function (value) { + _$$_REQUIRE(_dependencyMap[0]).resolve(value).then(resolve, reject); + }); + }); + }; + + _$$_REQUIRE(_dependencyMap[0]).prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + + function getAggregateError(errors) { + if (typeof AggregateError === 'function') { + return new AggregateError(errors, 'All promises were rejected'); + } + + var error = new Error('All promises were rejected'); + error.name = 'AggregateError'; + error.errors = errors; + return error; + } + + _$$_REQUIRE(_dependencyMap[0]).any = function promiseAny(values) { + return new (_$$_REQUIRE(_dependencyMap[0]))(function (resolve, reject) { + var promises = _iterableToArray(values); + + var hasResolved = false; + var rejectionReasons = []; + + function resolveOnce(value) { + if (!hasResolved) { + hasResolved = true; + resolve(value); + } + } + + function rejectionCheck(reason) { + rejectionReasons.push(reason); + + if (rejectionReasons.length === promises.length) { + reject(getAggregateError(rejectionReasons)); + } + } + + if (promises.length === 0) { + reject(getAggregateError(rejectionReasons)); + } else { + promises.forEach(function (value) { + _$$_REQUIRE(_dependencyMap[0]).resolve(value).then(resolveOnce, rejectionCheck); + }); + } + }); + }; +},77,[75]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var hasNativeGenerator; + + try { + hasNativeGenerator = _$$_REQUIRE(_dependencyMap[0]).hasNativeConstructor(_$$_REQUIRE(_dependencyMap[1]).mark(function _callee() { + return _$$_REQUIRE(_dependencyMap[1]).wrap(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + case "end": + return _context.stop(); + } + } + }, _callee); + }), 'GeneratorFunction'); + } catch (_unused) { + hasNativeGenerator = false; + } + + if (!hasNativeGenerator) { + _$$_REQUIRE(_dependencyMap[2]).polyfillGlobal('regeneratorRuntime', function () { + delete global.regeneratorRuntime; + return _$$_REQUIRE(_dependencyMap[3]); + }); + } +},78,[79,80,72,82]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function isNativeFunction(f) { + return typeof f === 'function' && f.toString().indexOf('[native code]') > -1; + } + + function hasNativeConstructor(o, expectedName) { + var con = Object.getPrototypeOf(o).constructor; + return con.name === expectedName && isNativeFunction(con); + } + + module.exports = { + isNativeFunction: isNativeFunction, + hasNativeConstructor: hasNativeConstructor + }; +},79,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var runtime = _$$_REQUIRE(_dependencyMap[0])(); + + module.exports = runtime; + + try { + regeneratorRuntime = runtime; + } catch (accidentalStrictMode) { + if (typeof globalThis === "object") { + globalThis.regeneratorRuntime = runtime; + } else { + Function("r", "regeneratorRuntime = r")(runtime); + } + } +},80,[81]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _regeneratorRuntime() { + "use strict"; + + module.exports = _regeneratorRuntime = function _regeneratorRuntime() { + return e; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + + var t, + e = {}, + r = Object.prototype, + n = r.hasOwnProperty, + o = Object.defineProperty || function (t, e, r) { + t[e] = r.value; + }, + i = "function" == typeof Symbol ? Symbol : {}, + a = i.iterator || "@@iterator", + c = i.asyncIterator || "@@asyncIterator", + u = i.toStringTag || "@@toStringTag"; + + function define(t, e, r) { + return Object.defineProperty(t, e, { + value: r, + enumerable: true, + configurable: true, + writable: true + }), t[e]; + } + + try { + define({}, ""); + } catch (t) { + define = function define(t, e, r) { + return t[e] = r; + }; + } + + function wrap(t, e, r, n) { + var i = e && e.prototype instanceof Generator ? e : Generator, + a = Object.create(i.prototype), + c = new Context(n || []); + return o(a, "_invoke", { + value: makeInvokeMethod(t, r, c) + }), a; + } + + function tryCatch(t, e, r) { + try { + return { + type: "normal", + arg: t.call(e, r) + }; + } catch (t) { + return { + type: "throw", + arg: t + }; + } + } + + e.wrap = wrap; + var h = "suspendedStart", + l = "suspendedYield", + f = "executing", + s = "completed", + y = {}; + + function Generator() {} + + function GeneratorFunction() {} + + function GeneratorFunctionPrototype() {} + + var p = {}; + define(p, a, function () { + return this; + }); + var d = Object.getPrototypeOf, + v = d && d(d(values([]))); + v && v !== r && n.call(v, a) && (p = v); + var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); + + function defineIteratorMethods(t) { + ["next", "throw", "return"].forEach(function (e) { + define(t, e, function (t) { + return this._invoke(e, t); + }); + }); + } + + function AsyncIterator(t, e) { + function invoke(r, o, i, a) { + var c = tryCatch(t[r], t, o); + + if ("throw" !== c.type) { + var u = c.arg, + h = u.value; + return h && "object" == _$$_REQUIRE(_dependencyMap[0])["default"](h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { + invoke("next", t, i, a); + }, function (t) { + invoke("throw", t, i, a); + }) : e.resolve(h).then(function (t) { + u.value = t, i(u); + }, function (t) { + return invoke("throw", t, i, a); + }); + } + + a(c.arg); + } + + var r; + o(this, "_invoke", { + value: function value(t, n) { + function callInvokeWithMethodAndArg() { + return new e(function (e, r) { + invoke(t, n, e, r); + }); + } + + return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + }); + } + + function makeInvokeMethod(e, r, n) { + var o = h; + return function (i, a) { + if (o === f) throw new Error("Generator is already running"); + + if (o === s) { + if ("throw" === i) throw a; + return { + value: t, + done: true + }; + } + + for (n.method = i, n.arg = a;;) { + var c = n.delegate; + + if (c) { + var u = maybeInvokeDelegate(c, n); + + if (u) { + if (u === y) continue; + return u; + } + } + + if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { + if (o === h) throw o = s, n.arg; + n.dispatchException(n.arg); + } else "return" === n.method && n.abrupt("return", n.arg); + o = f; + var p = tryCatch(e, r, n); + + if ("normal" === p.type) { + if (o = n.done ? s : l, p.arg === y) continue; + return { + value: p.arg, + done: n.done + }; + } + + "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); + } + }; + } + + function maybeInvokeDelegate(e, r) { + var n = r.method, + o = e.iterator[n]; + if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; + var i = tryCatch(o, e.iterator, r.arg); + if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; + var a = i.arg; + return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); + } + + function pushTryEntry(t) { + var e = { + tryLoc: t[0] + }; + 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); + } + + function resetTryEntry(t) { + var e = t.completion || {}; + e.type = "normal", delete e.arg, t.completion = e; + } + + function Context(t) { + this.tryEntries = [{ + tryLoc: "root" + }], t.forEach(pushTryEntry, this), this.reset(true); + } + + function values(e) { + if (e || "" === e) { + var r = e[a]; + if (r) return r.call(e); + if ("function" == typeof e.next) return e; + + if (!isNaN(e.length)) { + var o = -1, + i = function next() { + for (; ++o < e.length;) { + if (n.call(e, o)) return next.value = e[o], next.done = false, next; + } + + return next.value = t, next.done = true, next; + }; + + return i.next = i; + } + } + + throw new TypeError(_$$_REQUIRE(_dependencyMap[0])["default"](e) + " is not iterable"); + } + + return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { + value: GeneratorFunctionPrototype, + configurable: true + }), o(GeneratorFunctionPrototype, "constructor", { + value: GeneratorFunction, + configurable: true + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { + var e = "function" == typeof t && t.constructor; + return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); + }, e.mark = function (t) { + return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; + }, e.awrap = function (t) { + return { + __await: t + }; + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { + return this; + }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { + undefined === i && (i = Promise); + var a = new AsyncIterator(wrap(t, r, n, o), i); + return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { + return t.done ? t.value : a.next(); + }); + }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { + return this; + }), define(g, "toString", function () { + return "[object Generator]"; + }), e.keys = function (t) { + var e = Object(t), + r = []; + + for (var n in e) { + r.push(n); + } + + return r.reverse(), function next() { + for (; r.length;) { + var t = r.pop(); + if (t in e) return next.value = t, next.done = false, next; + } + + return next.done = true, next; + }; + }, e.values = values, Context.prototype = { + constructor: Context, + reset: function reset(e) { + if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) { + "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); + } + }, + stop: function stop() { + this.done = true; + var t = this.tryEntries[0].completion; + if ("throw" === t.type) throw t.arg; + return this.rval; + }, + dispatchException: function dispatchException(e) { + if (this.done) throw e; + var r = this; + + function handle(n, o) { + return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; + } + + for (var o = this.tryEntries.length - 1; o >= 0; --o) { + var i = this.tryEntries[o], + a = i.completion; + if ("root" === i.tryLoc) return handle("end"); + + if (i.tryLoc <= this.prev) { + var c = n.call(i, "catchLoc"), + u = n.call(i, "finallyLoc"); + + if (c && u) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, true); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } else if (c) { + if (this.prev < i.catchLoc) return handle(i.catchLoc, true); + } else { + if (!u) throw new Error("try statement without catch or finally"); + if (this.prev < i.finallyLoc) return handle(i.finallyLoc); + } + } + } + }, + abrupt: function abrupt(t, e) { + for (var r = this.tryEntries.length - 1; r >= 0; --r) { + var o = this.tryEntries[r]; + + if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { + var i = o; + break; + } + } + + i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); + var a = i ? i.completion : {}; + return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); + }, + complete: function complete(t, e) { + if ("throw" === t.type) throw t.arg; + return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; + }, + finish: function finish(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; + } + }, + "catch": function _catch(t) { + for (var e = this.tryEntries.length - 1; e >= 0; --e) { + var r = this.tryEntries[e]; + + if (r.tryLoc === t) { + var n = r.completion; + + if ("throw" === n.type) { + var o = n.arg; + resetTryEntry(r); + } + + return o; + } + } + + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(e, r, n) { + return this.delegate = { + iterator: values(e), + resultName: r, + nextLoc: n + }, "next" === this.method && (this.arg = t), y; + } + }, e; + } + + module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; +},81,[11]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var runtime = function (exports) { + "use strict"; + + var Op = Object.prototype; + var hasOwn = Op.hasOwnProperty; + var undefined; + var $Symbol = typeof Symbol === "function" ? Symbol : {}; + var iteratorSymbol = $Symbol.iterator || "@@iterator"; + var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; + var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; + + function define(obj, key, value) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + return obj[key]; + } + + try { + define({}, ""); + } catch (err) { + define = function define(obj, key, value) { + return obj[key] = value; + }; + } + + function wrap(innerFn, outerFn, self, tryLocsList) { + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; + var generator = Object.create(protoGenerator.prototype); + var context = new Context(tryLocsList || []); + generator._invoke = makeInvokeMethod(innerFn, self, context); + return generator; + } + + exports.wrap = wrap; + + function tryCatch(fn, obj, arg) { + try { + return { + type: "normal", + arg: fn.call(obj, arg) + }; + } catch (err) { + return { + type: "throw", + arg: err + }; + } + } + + var GenStateSuspendedStart = "suspendedStart"; + var GenStateSuspendedYield = "suspendedYield"; + var GenStateExecuting = "executing"; + var GenStateCompleted = "completed"; + var ContinueSentinel = {}; + + function Generator() {} + + function GeneratorFunction() {} + + function GeneratorFunctionPrototype() {} + + var IteratorPrototype = {}; + + IteratorPrototype[iteratorSymbol] = function () { + return this; + }; + + var getProto = Object.getPrototypeOf; + var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); + + if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { + IteratorPrototype = NativeIteratorPrototype; + } + + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); + GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; + GeneratorFunctionPrototype.constructor = GeneratorFunction; + GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); + + function defineIteratorMethods(prototype) { + ["next", "throw", "return"].forEach(function (method) { + define(prototype, method, function (arg) { + return this._invoke(method, arg); + }); + }); + } + + exports.isGeneratorFunction = function (genFun) { + var ctor = typeof genFun === "function" && genFun.constructor; + return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; + }; + + exports.mark = function (genFun) { + if (Object.setPrototypeOf) { + Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); + } else { + genFun.__proto__ = GeneratorFunctionPrototype; + define(genFun, toStringTagSymbol, "GeneratorFunction"); + } + + genFun.prototype = Object.create(Gp); + return genFun; + }; + + exports.awrap = function (arg) { + return { + __await: arg + }; + }; + + function AsyncIterator(generator, PromiseImpl) { + function invoke(method, arg, resolve, reject) { + var record = tryCatch(generator[method], generator, arg); + + if (record.type === "throw") { + reject(record.arg); + } else { + var result = record.arg; + var value = result.value; + + if (value && typeof value === "object" && hasOwn.call(value, "__await")) { + return PromiseImpl.resolve(value.__await).then(function (value) { + invoke("next", value, resolve, reject); + }, function (err) { + invoke("throw", err, resolve, reject); + }); + } + + return PromiseImpl.resolve(value).then(function (unwrapped) { + result.value = unwrapped; + resolve(result); + }, function (error) { + return invoke("throw", error, resolve, reject); + }); + } + } + + var previousPromise; + + function enqueue(method, arg) { + function callInvokeWithMethodAndArg() { + return new PromiseImpl(function (resolve, reject) { + invoke(method, arg, resolve, reject); + }); + } + + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); + } + + this._invoke = enqueue; + } + + defineIteratorMethods(AsyncIterator.prototype); + + AsyncIterator.prototype[asyncIteratorSymbol] = function () { + return this; + }; + + exports.AsyncIterator = AsyncIterator; + + exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { + if (PromiseImpl === undefined) PromiseImpl = Promise; + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { + return result.done ? result.value : iter.next(); + }); + }; + + function makeInvokeMethod(innerFn, self, context) { + var state = GenStateSuspendedStart; + return function invoke(method, arg) { + if (state === GenStateExecuting) { + throw new Error("Generator is already running"); + } + + if (state === GenStateCompleted) { + if (method === "throw") { + throw arg; + } + + return doneResult(); + } + + context.method = method; + context.arg = arg; + + while (true) { + var delegate = context.delegate; + + if (delegate) { + var delegateResult = maybeInvokeDelegate(delegate, context); + + if (delegateResult) { + if (delegateResult === ContinueSentinel) continue; + return delegateResult; + } + } + + if (context.method === "next") { + context.sent = context._sent = context.arg; + } else if (context.method === "throw") { + if (state === GenStateSuspendedStart) { + state = GenStateCompleted; + throw context.arg; + } + + context.dispatchException(context.arg); + } else if (context.method === "return") { + context.abrupt("return", context.arg); + } + + state = GenStateExecuting; + var record = tryCatch(innerFn, self, context); + + if (record.type === "normal") { + state = context.done ? GenStateCompleted : GenStateSuspendedYield; + + if (record.arg === ContinueSentinel) { + continue; + } + + return { + value: record.arg, + done: context.done + }; + } else if (record.type === "throw") { + state = GenStateCompleted; + context.method = "throw"; + context.arg = record.arg; + } + } + }; + } + + function maybeInvokeDelegate(delegate, context) { + var method = delegate.iterator[context.method]; + + if (method === undefined) { + context.delegate = null; + + if (context.method === "throw") { + if (delegate.iterator["return"]) { + context.method = "return"; + context.arg = undefined; + maybeInvokeDelegate(delegate, context); + + if (context.method === "throw") { + return ContinueSentinel; + } + } + + context.method = "throw"; + context.arg = new TypeError("The iterator does not provide a 'throw' method"); + } + + return ContinueSentinel; + } + + var record = tryCatch(method, delegate.iterator, context.arg); + + if (record.type === "throw") { + context.method = "throw"; + context.arg = record.arg; + context.delegate = null; + return ContinueSentinel; + } + + var info = record.arg; + + if (!info) { + context.method = "throw"; + context.arg = new TypeError("iterator result is not an object"); + context.delegate = null; + return ContinueSentinel; + } + + if (info.done) { + context[delegate.resultName] = info.value; + context.next = delegate.nextLoc; + + if (context.method !== "return") { + context.method = "next"; + context.arg = undefined; + } + } else { + return info; + } + + context.delegate = null; + return ContinueSentinel; + } + + defineIteratorMethods(Gp); + define(Gp, toStringTagSymbol, "Generator"); + + Gp[iteratorSymbol] = function () { + return this; + }; + + Gp.toString = function () { + return "[object Generator]"; + }; + + function pushTryEntry(locs) { + var entry = { + tryLoc: locs[0] + }; + + if (1 in locs) { + entry.catchLoc = locs[1]; + } + + if (2 in locs) { + entry.finallyLoc = locs[2]; + entry.afterLoc = locs[3]; + } + + this.tryEntries.push(entry); + } + + function resetTryEntry(entry) { + var record = entry.completion || {}; + record.type = "normal"; + delete record.arg; + entry.completion = record; + } + + function Context(tryLocsList) { + this.tryEntries = [{ + tryLoc: "root" + }]; + tryLocsList.forEach(pushTryEntry, this); + this.reset(true); + } + + exports.keys = function (object) { + var keys = []; + + for (var key in object) { + keys.push(key); + } + + keys.reverse(); + return function next() { + while (keys.length) { + var key = keys.pop(); + + if (key in object) { + next.value = key; + next.done = false; + return next; + } + } + + next.done = true; + return next; + }; + }; + + function values(iterable) { + if (iterable) { + var iteratorMethod = iterable[iteratorSymbol]; + + if (iteratorMethod) { + return iteratorMethod.call(iterable); + } + + if (typeof iterable.next === "function") { + return iterable; + } + + if (!isNaN(iterable.length)) { + var i = -1, + next = function next() { + while (++i < iterable.length) { + if (hasOwn.call(iterable, i)) { + next.value = iterable[i]; + next.done = false; + return next; + } + } + + next.value = undefined; + next.done = true; + return next; + }; + + return next.next = next; + } + } + + return { + next: doneResult + }; + } + + exports.values = values; + + function doneResult() { + return { + value: undefined, + done: true + }; + } + + Context.prototype = { + constructor: Context, + reset: function reset(skipTempReset) { + this.prev = 0; + this.next = 0; + this.sent = this._sent = undefined; + this.done = false; + this.delegate = null; + this.method = "next"; + this.arg = undefined; + this.tryEntries.forEach(resetTryEntry); + + if (!skipTempReset) { + for (var name in this) { + if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { + this[name] = undefined; + } + } + } + }, + stop: function stop() { + this.done = true; + var rootEntry = this.tryEntries[0]; + var rootRecord = rootEntry.completion; + + if (rootRecord.type === "throw") { + throw rootRecord.arg; + } + + return this.rval; + }, + dispatchException: function dispatchException(exception) { + if (this.done) { + throw exception; + } + + var context = this; + + function handle(loc, caught) { + record.type = "throw"; + record.arg = exception; + context.next = loc; + + if (caught) { + context.method = "next"; + context.arg = undefined; + } + + return !!caught; + } + + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + var record = entry.completion; + + if (entry.tryLoc === "root") { + return handle("end"); + } + + if (entry.tryLoc <= this.prev) { + var hasCatch = hasOwn.call(entry, "catchLoc"); + var hasFinally = hasOwn.call(entry, "finallyLoc"); + + if (hasCatch && hasFinally) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } else if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else if (hasCatch) { + if (this.prev < entry.catchLoc) { + return handle(entry.catchLoc, true); + } + } else if (hasFinally) { + if (this.prev < entry.finallyLoc) { + return handle(entry.finallyLoc); + } + } else { + throw new Error("try statement without catch or finally"); + } + } + } + }, + abrupt: function abrupt(type, arg) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { + var finallyEntry = entry; + break; + } + } + + if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { + finallyEntry = null; + } + + var record = finallyEntry ? finallyEntry.completion : {}; + record.type = type; + record.arg = arg; + + if (finallyEntry) { + this.method = "next"; + this.next = finallyEntry.finallyLoc; + return ContinueSentinel; + } + + return this.complete(record); + }, + complete: function complete(record, afterLoc) { + if (record.type === "throw") { + throw record.arg; + } + + if (record.type === "break" || record.type === "continue") { + this.next = record.arg; + } else if (record.type === "return") { + this.rval = this.arg = record.arg; + this.method = "return"; + this.next = "end"; + } else if (record.type === "normal" && afterLoc) { + this.next = afterLoc; + } + + return ContinueSentinel; + }, + finish: function finish(finallyLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + + if (entry.finallyLoc === finallyLoc) { + this.complete(entry.completion, entry.afterLoc); + resetTryEntry(entry); + return ContinueSentinel; + } + } + }, + "catch": function _catch(tryLoc) { + for (var i = this.tryEntries.length - 1; i >= 0; --i) { + var entry = this.tryEntries[i]; + + if (entry.tryLoc === tryLoc) { + var record = entry.completion; + + if (record.type === "throw") { + var thrown = record.arg; + resetTryEntry(entry); + } + + return thrown; + } + } + + throw new Error("illegal catch attempt"); + }, + delegateYield: function delegateYield(iterable, resultName, nextLoc) { + this.delegate = { + iterator: values(iterable), + resultName: resultName, + nextLoc: nextLoc + }; + + if (this.method === "next") { + this.arg = undefined; + } + + return ContinueSentinel; + } + }; + return exports; + }(typeof module === "object" ? module.exports : {}); + + try { + regeneratorRuntime = runtime; + } catch (accidentalStrictMode) { + Function("r", "regeneratorRuntime = r")(runtime); + } +},82,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _global$HermesInterna, _global$HermesInterna2; + + var hasHermesPromiseQueuedToJSVM = ((_global$HermesInterna = global.HermesInternal) == null ? undefined : _global$HermesInterna.hasPromise == null ? undefined : _global$HermesInterna.hasPromise()) === true && ((_global$HermesInterna2 = global.HermesInternal) == null ? undefined : _global$HermesInterna2.useEngineQueue == null ? undefined : _global$HermesInterna2.useEngineQueue()) === true; + + var hasNativePromise = _$$_REQUIRE(_dependencyMap[0]).isNativeFunction(Promise); + + var hasPromiseQueuedToJSVM = hasNativePromise || hasHermesPromiseQueuedToJSVM; + + if (global.RN$Bridgeless !== true) { + var defineLazyTimer = function defineLazyTimer(name) { + _$$_REQUIRE(_dependencyMap[1]).polyfillGlobal(name, function () { + return _$$_REQUIRE(_dependencyMap[2])[name]; + }); + }; + + defineLazyTimer('setTimeout'); + defineLazyTimer('clearTimeout'); + defineLazyTimer('setInterval'); + defineLazyTimer('clearInterval'); + defineLazyTimer('requestAnimationFrame'); + defineLazyTimer('cancelAnimationFrame'); + defineLazyTimer('requestIdleCallback'); + defineLazyTimer('cancelIdleCallback'); + } + + if (hasPromiseQueuedToJSVM) { + _$$_REQUIRE(_dependencyMap[1]).polyfillGlobal('setImmediate', function () { + return _$$_REQUIRE(_dependencyMap[3]).setImmediate; + }); + + _$$_REQUIRE(_dependencyMap[1]).polyfillGlobal('clearImmediate', function () { + return _$$_REQUIRE(_dependencyMap[3]).clearImmediate; + }); + } else { + if (global.RN$Bridgeless !== true) { + _$$_REQUIRE(_dependencyMap[1]).polyfillGlobal('setImmediate', function () { + return _$$_REQUIRE(_dependencyMap[2]).queueReactNativeMicrotask; + }); + + _$$_REQUIRE(_dependencyMap[1]).polyfillGlobal('clearImmediate', function () { + return _$$_REQUIRE(_dependencyMap[2]).clearReactNativeMicrotask; + }); + } + } + + if (hasHermesPromiseQueuedToJSVM) { + _$$_REQUIRE(_dependencyMap[1]).polyfillGlobal('queueMicrotask', function () { + var _global$HermesInterna3; + + return (_global$HermesInterna3 = global.HermesInternal) == null ? undefined : _global$HermesInterna3.enqueueJob; + }); + } else { + _$$_REQUIRE(_dependencyMap[1]).polyfillGlobal('queueMicrotask', function () { + return _$$_REQUIRE(_dependencyMap[4]).default; + }); + } +},83,[79,72,84,86,87]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeTiming = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var FRAME_DURATION = 16.666666666666668; + var IDLE_CALLBACK_FRAME_DEADLINE = 1; + var callbacks = []; + var types = []; + var timerIDs = []; + var reactNativeMicrotasks = []; + var requestIdleCallbacks = []; + var requestIdleCallbackTimeouts = {}; + var GUID = 1; + var errors = null; + var hasEmittedTimeDriftWarning = false; + + function _getFreeIndex() { + var freeIndex = timerIDs.indexOf(null); + + if (freeIndex === -1) { + freeIndex = timerIDs.length; + } + + return freeIndex; + } + + function _allocateCallback(func, type) { + var id = GUID++; + + var freeIndex = _getFreeIndex(); + + timerIDs[freeIndex] = id; + callbacks[freeIndex] = func; + types[freeIndex] = type; + return id; + } + + function _callTimer(timerID, frameTime, didTimeout) { + if (timerID > GUID) { + console.warn('Tried to call timer with ID %s but no such timer exists.', timerID); + } + + var timerIndex = timerIDs.indexOf(timerID); + + if (timerIndex === -1) { + return; + } + + var type = types[timerIndex]; + var callback = callbacks[timerIndex]; + + if (!callback || !type) { + console.error('No callback found for timerID ' + timerID); + return; + } + + if (type !== 'setInterval') { + _clearIndex(timerIndex); + } + + try { + if (type === 'setTimeout' || type === 'setInterval' || type === 'queueReactNativeMicrotask') { + callback(); + } else if (type === 'requestAnimationFrame') { + callback(global.performance.now()); + } else if (type === 'requestIdleCallback') { + callback({ + timeRemaining: function timeRemaining() { + return Math.max(0, FRAME_DURATION - (global.performance.now() - frameTime)); + }, + didTimeout: !!didTimeout + }); + } else { + console.error('Tried to call a callback with invalid type: ' + type); + } + } catch (e) { + if (!errors) { + errors = [e]; + } else { + errors.push(e); + } + } + } + + function _callReactNativeMicrotasksPass() { + if (reactNativeMicrotasks.length === 0) { + return false; + } + + var passReactNativeMicrotasks = reactNativeMicrotasks; + reactNativeMicrotasks = []; + + for (var i = 0; i < passReactNativeMicrotasks.length; ++i) { + _callTimer(passReactNativeMicrotasks[i], 0); + } + + return reactNativeMicrotasks.length > 0; + } + + function _clearIndex(i) { + timerIDs[i] = null; + callbacks[i] = null; + types[i] = null; + } + + function _freeCallback(timerID) { + if (timerID == null) { + return; + } + + var index = timerIDs.indexOf(timerID); + + if (index !== -1) { + var type = types[index]; + + _clearIndex(index); + + if (type !== 'queueReactNativeMicrotask' && type !== 'requestIdleCallback') { + deleteTimer(timerID); + } + } + } + + var JSTimers = { + setTimeout: function setTimeout(func, duration) { + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'setTimeout'); + + createTimer(id, duration || 0, Date.now(), false); + return id; + }, + setInterval: function setInterval(func, duration) { + for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'setInterval'); + + createTimer(id, duration || 0, Date.now(), true); + return id; + }, + queueReactNativeMicrotask: function queueReactNativeMicrotask(func) { + for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + args[_key3 - 1] = arguments[_key3]; + } + + var id = _allocateCallback(function () { + return func.apply(undefined, args); + }, 'queueReactNativeMicrotask'); + + reactNativeMicrotasks.push(id); + return id; + }, + requestAnimationFrame: function requestAnimationFrame(func) { + var id = _allocateCallback(func, 'requestAnimationFrame'); + + createTimer(id, 1, Date.now(), false); + return id; + }, + requestIdleCallback: function requestIdleCallback(func, options) { + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(true); + } + + var timeout = options && options.timeout; + + var id = _allocateCallback(timeout != null ? function (deadline) { + var timeoutId = requestIdleCallbackTimeouts[id]; + + if (timeoutId) { + JSTimers.clearTimeout(timeoutId); + delete requestIdleCallbackTimeouts[id]; + } + + return func(deadline); + } : func, 'requestIdleCallback'); + + requestIdleCallbacks.push(id); + + if (timeout != null) { + var timeoutId = JSTimers.setTimeout(function () { + var index = requestIdleCallbacks.indexOf(id); + + if (index > -1) { + requestIdleCallbacks.splice(index, 1); + + _callTimer(id, global.performance.now(), true); + } + + delete requestIdleCallbackTimeouts[id]; + + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(false); + } + }, timeout); + requestIdleCallbackTimeouts[id] = timeoutId; + } + + return id; + }, + cancelIdleCallback: function cancelIdleCallback(timerID) { + _freeCallback(timerID); + + var index = requestIdleCallbacks.indexOf(timerID); + + if (index !== -1) { + requestIdleCallbacks.splice(index, 1); + } + + var timeoutId = requestIdleCallbackTimeouts[timerID]; + + if (timeoutId) { + JSTimers.clearTimeout(timeoutId); + delete requestIdleCallbackTimeouts[timerID]; + } + + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(false); + } + }, + clearTimeout: function clearTimeout(timerID) { + _freeCallback(timerID); + }, + clearInterval: function clearInterval(timerID) { + _freeCallback(timerID); + }, + clearReactNativeMicrotask: function clearReactNativeMicrotask(timerID) { + _freeCallback(timerID); + + var index = reactNativeMicrotasks.indexOf(timerID); + + if (index !== -1) { + reactNativeMicrotasks.splice(index, 1); + } + }, + cancelAnimationFrame: function cancelAnimationFrame(timerID) { + _freeCallback(timerID); + }, + callTimers: function callTimers(timersToCall) { + _$$_REQUIRE(_dependencyMap[2])(timersToCall.length !== 0, 'Cannot call `callTimers` with an empty list of IDs.'); + + errors = null; + + for (var i = 0; i < timersToCall.length; i++) { + _callTimer(timersToCall[i], 0); + } + + if (errors) { + var errorCount = errors.length; + + if (errorCount > 1) { + for (var ii = 1; ii < errorCount; ii++) { + JSTimers.setTimeout(function (error) { + throw error; + }.bind(null, errors[ii]), 0); + } + } + + throw errors[0]; + } + }, + callIdleCallbacks: function callIdleCallbacks(frameTime) { + if (FRAME_DURATION - (global.performance.now() - frameTime) < IDLE_CALLBACK_FRAME_DEADLINE) { + return; + } + + errors = null; + + if (requestIdleCallbacks.length > 0) { + var passIdleCallbacks = requestIdleCallbacks; + requestIdleCallbacks = []; + + for (var i = 0; i < passIdleCallbacks.length; ++i) { + _callTimer(passIdleCallbacks[i], frameTime); + } + } + + if (requestIdleCallbacks.length === 0) { + setSendIdleEvents(false); + } + + if (errors) { + errors.forEach(function (error) { + return JSTimers.setTimeout(function () { + throw error; + }, 0); + }); + } + }, + callReactNativeMicrotasks: function callReactNativeMicrotasks() { + errors = null; + + while (_callReactNativeMicrotasksPass()) {} + + if (errors) { + errors.forEach(function (error) { + return JSTimers.setTimeout(function () { + throw error; + }, 0); + }); + } + }, + emitTimeDriftWarning: function emitTimeDriftWarning(warningMessage) { + if (hasEmittedTimeDriftWarning) { + return; + } + + hasEmittedTimeDriftWarning = true; + console.warn(warningMessage); + } + }; + + function createTimer(callbackID, duration, jsSchedulingTime, repeats) { + _$$_REQUIRE(_dependencyMap[2])(_NativeTiming.default, 'NativeTiming is available'); + + _NativeTiming.default.createTimer(callbackID, duration, jsSchedulingTime, repeats); + } + + function deleteTimer(timerID) { + _$$_REQUIRE(_dependencyMap[2])(_NativeTiming.default, 'NativeTiming is available'); + + _NativeTiming.default.deleteTimer(timerID); + } + + function setSendIdleEvents(sendIdleEvents) { + _$$_REQUIRE(_dependencyMap[2])(_NativeTiming.default, 'NativeTiming is available'); + + _NativeTiming.default.setSendIdleEvents(sendIdleEvents); + } + + var ExportedJSTimers; + + if (!_NativeTiming.default) { + console.warn("Timing native module is not available, can't set timers."); + ExportedJSTimers = { + callReactNativeMicrotasks: JSTimers.callReactNativeMicrotasks, + queueReactNativeMicrotask: JSTimers.queueReactNativeMicrotask + }; + } else { + ExportedJSTimers = JSTimers; + } + + _$$_REQUIRE(_dependencyMap[3]).setReactNativeMicrotasksCallback(JSTimers.callReactNativeMicrotasks); + + module.exports = ExportedJSTimers; +},84,[5,85,36,45]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('Timing'); + + exports.default = _default; +},85,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var GUIID = 1; + var clearedImmediates = new Set(); + + function setImmediate(callback) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (arguments.length < 1) { + throw new TypeError('setImmediate must be called with at least one argument (a function to call)'); + } + + if (typeof callback !== 'function') { + throw new TypeError('The first argument to setImmediate must be a function.'); + } + + var id = GUIID++; + + if (clearedImmediates.has(id)) { + clearedImmediates.delete(id); + } + + global.queueMicrotask(function () { + if (!clearedImmediates.has(id)) { + callback.apply(undefined, args); + } else { + clearedImmediates.delete(id); + } + }); + return id; + } + + function clearImmediate(immediateID) { + clearedImmediates.add(immediateID); + } + + var immediateShim = { + setImmediate: setImmediate, + clearImmediate: clearImmediate + }; + module.exports = immediateShim; +},86,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = queueMicrotask; + var resolvedPromise; + + function queueMicrotask(callback) { + if (arguments.length < 1) { + throw new TypeError('queueMicrotask must be called with at least one argument (a function to call)'); + } + + if (typeof callback !== 'function') { + throw new TypeError('The argument to queueMicrotask must be a function.'); + } + + (resolvedPromise || (resolvedPromise = Promise.resolve())).then(callback).catch(function (error) { + return setTimeout(function () { + throw error; + }, 0); + }); + } +},87,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('XMLHttpRequest', function () { + return _$$_REQUIRE(_dependencyMap[1]); + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('FormData', function () { + return _$$_REQUIRE(_dependencyMap[2]); + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('fetch', function () { + return _$$_REQUIRE(_dependencyMap[3]).fetch; + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('Headers', function () { + return _$$_REQUIRE(_dependencyMap[3]).Headers; + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('Request', function () { + return _$$_REQUIRE(_dependencyMap[3]).Request; + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('Response', function () { + return _$$_REQUIRE(_dependencyMap[3]).Response; + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('WebSocket', function () { + return _$$_REQUIRE(_dependencyMap[4]); + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('Blob', function () { + return _$$_REQUIRE(_dependencyMap[5]); + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('File', function () { + return _$$_REQUIRE(_dependencyMap[6]); + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('FileReader', function () { + return _$$_REQUIRE(_dependencyMap[7]); + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('URL', function () { + return _$$_REQUIRE(_dependencyMap[8]).URL; + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('URLSearchParams', function () { + return _$$_REQUIRE(_dependencyMap[8]).URLSearchParams; + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('AbortController', function () { + return _$$_REQUIRE(_dependencyMap[9]).AbortController; + }); + + _$$_REQUIRE(_dependencyMap[0]).polyfillGlobal('AbortSignal', function () { + return _$$_REQUIRE(_dependencyMap[9]).AbortSignal; + }); +},88,[72,89,103,105,107,94,113,114,116,117]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DEBUG_NETWORK_SEND_DELAY = false; + + if (_$$_REQUIRE(_dependencyMap[8]).isAvailable) { + _$$_REQUIRE(_dependencyMap[8]).addNetworkingHandler(); + } + + var UNSENT = 0; + var OPENED = 1; + var HEADERS_RECEIVED = 2; + var LOADING = 3; + var DONE = 4; + var SUPPORTED_RESPONSE_TYPES = { + arraybuffer: typeof global.ArrayBuffer === 'function', + blob: typeof global.Blob === 'function', + document: false, + json: true, + text: true, + '': true + }; + var REQUEST_EVENTS = ['abort', 'error', 'load', 'loadstart', 'progress', 'timeout', 'loadend']; + var XHR_EVENTS = REQUEST_EVENTS.concat('readystatechange'); + + var XMLHttpRequestEventTarget = function (_ref) { + (0, _inherits2.default)(XMLHttpRequestEventTarget, _ref); + + var _super = _createSuper(XMLHttpRequestEventTarget); + + function XMLHttpRequestEventTarget() { + (0, _classCallCheck2.default)(this, XMLHttpRequestEventTarget); + return _super.apply(this, arguments); + } + + return XMLHttpRequestEventTarget; + }(_$$_REQUIRE(_dependencyMap[9]).apply(undefined, REQUEST_EVENTS)); + + var XMLHttpRequest = function (_ref2) { + (0, _inherits2.default)(XMLHttpRequest, _ref2); + + var _super2 = _createSuper(XMLHttpRequest); + + function XMLHttpRequest() { + var _this; + + (0, _classCallCheck2.default)(this, XMLHttpRequest); + _this = _super2.call(this); + _this.UNSENT = UNSENT; + _this.OPENED = OPENED; + _this.HEADERS_RECEIVED = HEADERS_RECEIVED; + _this.LOADING = LOADING; + _this.DONE = DONE; + _this.readyState = UNSENT; + _this.status = 0; + _this.timeout = 0; + _this.withCredentials = true; + _this.upload = new XMLHttpRequestEventTarget(); + _this._aborted = false; + _this._hasError = false; + _this._method = null; + _this._perfKey = null; + _this._response = ''; + _this._url = null; + _this._timedOut = false; + _this._trackingName = 'unknown'; + _this._incrementalEvents = false; + _this._performanceLogger = _$$_REQUIRE(_dependencyMap[10]); + + _this._reset(); + + return _this; + } + + (0, _createClass2.default)(XMLHttpRequest, [{ + key: "_reset", + value: function _reset() { + this.readyState = this.UNSENT; + this.responseHeaders = undefined; + this.status = 0; + delete this.responseURL; + this._requestId = null; + this._cachedResponse = undefined; + this._hasError = false; + this._headers = {}; + this._response = ''; + this._responseType = ''; + this._sent = false; + this._lowerCaseResponseHeaders = {}; + + this._clearSubscriptions(); + + this._timedOut = false; + } + }, { + key: "responseType", + get: function get() { + return this._responseType; + }, + set: function set(responseType) { + if (this._sent) { + throw new Error("Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be set after the request has been sent."); + } + + if (!SUPPORTED_RESPONSE_TYPES.hasOwnProperty(responseType)) { + console.warn("The provided value '" + responseType + "' is not a valid 'responseType'."); + return; + } + + _$$_REQUIRE(_dependencyMap[11])(SUPPORTED_RESPONSE_TYPES[responseType] || responseType === 'document', "The provided value '" + responseType + "' is unsupported in this environment."); + + if (responseType === 'blob') { + _$$_REQUIRE(_dependencyMap[11])(_$$_REQUIRE(_dependencyMap[8]).isAvailable, 'Native module BlobModule is required for blob support'); + } + + this._responseType = responseType; + } + }, { + key: "responseText", + get: function get() { + if (this._responseType !== '' && this._responseType !== 'text') { + throw new Error("The 'responseText' property is only available if 'responseType' " + ("is set to '' or 'text', but it is '" + this._responseType + "'.")); + } + + if (this.readyState < LOADING) { + return ''; + } + + return this._response; + } + }, { + key: "response", + get: function get() { + var responseType = this.responseType; + + if (responseType === '' || responseType === 'text') { + return this.readyState < LOADING || this._hasError ? '' : this._response; + } + + if (this.readyState !== DONE) { + return null; + } + + if (this._cachedResponse !== undefined) { + return this._cachedResponse; + } + + switch (responseType) { + case 'document': + this._cachedResponse = null; + break; + + case 'arraybuffer': + this._cachedResponse = _$$_REQUIRE(_dependencyMap[12]).toByteArray(this._response).buffer; + break; + + case 'blob': + if (typeof this._response === 'object' && this._response) { + this._cachedResponse = _$$_REQUIRE(_dependencyMap[8]).createFromOptions(this._response); + } else if (this._response === '') { + this._cachedResponse = _$$_REQUIRE(_dependencyMap[8]).createFromParts([]); + } else { + throw new Error("Invalid response for blob: " + this._response); + } + + break; + + case 'json': + try { + this._cachedResponse = JSON.parse(this._response); + } catch (_) { + this._cachedResponse = null; + } + + break; + + default: + this._cachedResponse = null; + } + + return this._cachedResponse; + } + }, { + key: "__didCreateRequest", + value: function __didCreateRequest(requestId) { + this._requestId = requestId; + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.requestSent(requestId, this._url || '', this._method || 'GET', this._headers); + } + }, { + key: "__didUploadProgress", + value: function __didUploadProgress(requestId, progress, total) { + if (requestId === this._requestId) { + this.upload.dispatchEvent({ + type: 'progress', + lengthComputable: true, + loaded: progress, + total: total + }); + } + } + }, { + key: "__didReceiveResponse", + value: function __didReceiveResponse(requestId, status, responseHeaders, responseURL) { + if (requestId === this._requestId) { + this._perfKey != null && this._performanceLogger.stopTimespan(this._perfKey); + this.status = status; + this.setResponseHeaders(responseHeaders); + this.setReadyState(this.HEADERS_RECEIVED); + + if (responseURL || responseURL === '') { + this.responseURL = responseURL; + } else { + delete this.responseURL; + } + + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.responseReceived(requestId, responseURL || this._url || '', status, responseHeaders || {}); + } + } + }, { + key: "__didReceiveData", + value: function __didReceiveData(requestId, response) { + if (requestId !== this._requestId) { + return; + } + + this._response = response; + this._cachedResponse = undefined; + this.setReadyState(this.LOADING); + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(requestId, response); + } + }, { + key: "__didReceiveIncrementalData", + value: function __didReceiveIncrementalData(requestId, responseText, progress, total) { + if (requestId !== this._requestId) { + return; + } + + if (!this._response) { + this._response = responseText; + } else { + this._response += responseText; + } + + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.dataReceived(requestId, responseText); + this.setReadyState(this.LOADING); + + this.__didReceiveDataProgress(requestId, progress, total); + } + }, { + key: "__didReceiveDataProgress", + value: function __didReceiveDataProgress(requestId, loaded, total) { + if (requestId !== this._requestId) { + return; + } + + this.dispatchEvent({ + type: 'progress', + lengthComputable: total >= 0, + loaded: loaded, + total: total + }); + } + }, { + key: "__didCompleteResponse", + value: function __didCompleteResponse(requestId, error, timeOutError) { + if (requestId === this._requestId) { + if (error) { + if (this._responseType === '' || this._responseType === 'text') { + this._response = error; + } + + this._hasError = true; + + if (timeOutError) { + this._timedOut = true; + } + } + + this._clearSubscriptions(); + + this._requestId = null; + this.setReadyState(this.DONE); + + if (error) { + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFailed(requestId, error); + } else { + XMLHttpRequest._interceptor && XMLHttpRequest._interceptor.loadingFinished(requestId, this._response.length); + } + } + } + }, { + key: "_clearSubscriptions", + value: function _clearSubscriptions() { + (this._subscriptions || []).forEach(function (sub) { + if (sub) { + sub.remove(); + } + }); + this._subscriptions = []; + } + }, { + key: "getAllResponseHeaders", + value: function getAllResponseHeaders() { + if (!this.responseHeaders) { + return null; + } + + var headers = this.responseHeaders || {}; + return Object.keys(headers).map(function (headerName) { + return headerName + ': ' + headers[headerName]; + }).join('\r\n'); + } + }, { + key: "getResponseHeader", + value: function getResponseHeader(header) { + var value = this._lowerCaseResponseHeaders[header.toLowerCase()]; + + return value !== undefined ? value : null; + } + }, { + key: "setRequestHeader", + value: function setRequestHeader(header, value) { + if (this.readyState !== this.OPENED) { + throw new Error('Request has not been opened'); + } + + this._headers[header.toLowerCase()] = String(value); + } + }, { + key: "setTrackingName", + value: function setTrackingName(trackingName) { + this._trackingName = trackingName; + return this; + } + }, { + key: "setPerformanceLogger", + value: function setPerformanceLogger(performanceLogger) { + this._performanceLogger = performanceLogger; + return this; + } + }, { + key: "open", + value: function open(method, url, async) { + if (this.readyState !== this.UNSENT) { + throw new Error('Cannot open, already sending'); + } + + if (async !== undefined && !async) { + throw new Error('Synchronous http requests are not supported'); + } + + if (!url) { + throw new Error('Cannot load an empty url'); + } + + this._method = method.toUpperCase(); + this._url = url; + this._aborted = false; + this.setReadyState(this.OPENED); + } + }, { + key: "send", + value: function send(data) { + var _this2 = this; + + if (this.readyState !== this.OPENED) { + throw new Error('Request has not been opened'); + } + + if (this._sent) { + throw new Error('Request has already been sent'); + } + + this._sent = true; + var incrementalEvents = this._incrementalEvents || !!this.onreadystatechange || !!this.onprogress; + + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13]).addListener('didSendNetworkData', function (args) { + return _this2.__didUploadProgress.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13]).addListener('didReceiveNetworkResponse', function (args) { + return _this2.__didReceiveResponse.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13]).addListener('didReceiveNetworkData', function (args) { + return _this2.__didReceiveData.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13]).addListener('didReceiveNetworkIncrementalData', function (args) { + return _this2.__didReceiveIncrementalData.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13]).addListener('didReceiveNetworkDataProgress', function (args) { + return _this2.__didReceiveDataProgress.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + + this._subscriptions.push(_$$_REQUIRE(_dependencyMap[13]).addListener('didCompleteNetworkResponse', function (args) { + return _this2.__didCompleteResponse.apply(_this2, (0, _toConsumableArray2.default)(args)); + })); + + var nativeResponseType = 'text'; + + if (this._responseType === 'arraybuffer') { + nativeResponseType = 'base64'; + } + + if (this._responseType === 'blob') { + nativeResponseType = 'blob'; + } + + var doSend = function doSend() { + var friendlyName = _this2._trackingName !== 'unknown' ? _this2._trackingName : _this2._url; + _this2._perfKey = 'network_XMLHttpRequest_' + String(friendlyName); + + _this2._performanceLogger.startTimespan(_this2._perfKey); + + _$$_REQUIRE(_dependencyMap[11])(_this2._method, 'XMLHttpRequest method needs to be defined (%s).', friendlyName); + + _$$_REQUIRE(_dependencyMap[11])(_this2._url, 'XMLHttpRequest URL needs to be defined (%s).', friendlyName); + + _$$_REQUIRE(_dependencyMap[13]).sendRequest(_this2._method, _this2._trackingName, _this2._url, _this2._headers, data, nativeResponseType, incrementalEvents, _this2.timeout, _this2.__didCreateRequest.bind(_this2), _this2.withCredentials); + }; + + { + doSend(); + } + } + }, { + key: "abort", + value: function abort() { + this._aborted = true; + + if (this._requestId) { + _$$_REQUIRE(_dependencyMap[13]).abortRequest(this._requestId); + } + + if (!(this.readyState === this.UNSENT || this.readyState === this.OPENED && !this._sent || this.readyState === this.DONE)) { + this._reset(); + + this.setReadyState(this.DONE); + } + + this._reset(); + } + }, { + key: "setResponseHeaders", + value: function setResponseHeaders(responseHeaders) { + this.responseHeaders = responseHeaders || null; + var headers = responseHeaders || {}; + this._lowerCaseResponseHeaders = Object.keys(headers).reduce(function (lcaseHeaders, headerName) { + lcaseHeaders[headerName.toLowerCase()] = headers[headerName]; + return lcaseHeaders; + }, {}); + } + }, { + key: "setReadyState", + value: function setReadyState(newState) { + this.readyState = newState; + this.dispatchEvent({ + type: 'readystatechange' + }); + + if (newState === this.DONE) { + if (this._aborted) { + this.dispatchEvent({ + type: 'abort' + }); + } else if (this._hasError) { + if (this._timedOut) { + this.dispatchEvent({ + type: 'timeout' + }); + } else { + this.dispatchEvent({ + type: 'error' + }); + } + } else { + this.dispatchEvent({ + type: 'load' + }); + } + + this.dispatchEvent({ + type: 'loadend' + }); + } + } + }, { + key: "addEventListener", + value: function addEventListener(type, listener) { + if (type === 'readystatechange' || type === 'progress') { + this._incrementalEvents = true; + } + + (0, _get2.default)((0, _getPrototypeOf2.default)(XMLHttpRequest.prototype), "addEventListener", this).call(this, type, listener); + } + }], [{ + key: "setInterceptor", + value: function setInterceptor(interceptor) { + XMLHttpRequest._interceptor = interceptor; + } + }]); + return XMLHttpRequest; + }(_$$_REQUIRE(_dependencyMap[9]).apply(undefined, (0, _toConsumableArray2.default)(XHR_EVENTS))); + + XMLHttpRequest.UNSENT = UNSENT; + XMLHttpRequest.OPENED = OPENED; + XMLHttpRequest.HEADERS_RECEIVED = HEADERS_RECEIVED; + XMLHttpRequest.LOADING = LOADING; + XMLHttpRequest.DONE = DONE; + XMLHttpRequest._interceptor = null; + module.exports = XMLHttpRequest; +},89,[5,21,8,90,7,12,14,16,92,96,97,36,99,100]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _get() { + if (typeof Reflect !== "undefined" && Reflect.get) { + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports; + } else { + module.exports = _get = function _get(target, property, receiver) { + var base = _$$_REQUIRE(_dependencyMap[0])(target, property); + + if (!base) return; + var desc = Object.getOwnPropertyDescriptor(base, property); + + if (desc.get) { + return desc.get.call(arguments.length < 3 ? target : receiver); + } + + return desc.value; + }, module.exports.__esModule = true, module.exports["default"] = module.exports; + } + + return _get.apply(this, arguments); + } + + module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; +},90,[91]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _superPropBase(object, property) { + while (!Object.prototype.hasOwnProperty.call(object, property)) { + object = _$$_REQUIRE(_dependencyMap[0])(object); + if (object === null) break; + } + + return object; + } + + module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; +},91,[16]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _NativeBlobModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function uuidv4() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, + v = c == 'x' ? r : r & 0x3 | 0x8; + return v.toString(16); + }); + } + + function createBlobCollector(blobId) { + if (global.__blobCollectorProvider == null) { + return null; + } else { + return global.__blobCollectorProvider(blobId); + } + } + + var BlobManager = function () { + function BlobManager() { + (0, _classCallCheck2.default)(this, BlobManager); + } + + (0, _createClass2.default)(BlobManager, null, [{ + key: "createFromParts", + value: function createFromParts(parts, options) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + var blobId = uuidv4(); + var items = parts.map(function (part) { + if (part instanceof ArrayBuffer || global.ArrayBufferView && part instanceof global.ArrayBufferView) { + throw new Error("Creating blobs from 'ArrayBuffer' and 'ArrayBufferView' are not supported"); + } + + if (part instanceof _$$_REQUIRE(_dependencyMap[6])) { + return { + data: part.data, + type: 'blob' + }; + } else { + return { + data: String(part), + type: 'string' + }; + } + }); + var size = items.reduce(function (acc, curr) { + if (curr.type === 'string') { + return acc + global.unescape(encodeURI(curr.data)).length; + } else { + return acc + curr.data.size; + } + }, 0); + + _NativeBlobModule.default.createFromParts(items, blobId); + + return BlobManager.createFromOptions({ + blobId: blobId, + offset: 0, + size: size, + type: options ? options.type : '', + lastModified: options ? options.lastModified : Date.now() + }); + } + }, { + key: "createFromOptions", + value: function createFromOptions(options) { + _$$_REQUIRE(_dependencyMap[7]).register(options.blobId); + + return (0, _extends2.default)(Object.create(_$$_REQUIRE(_dependencyMap[6]).prototype), { + data: options.__collector == null ? (0, _extends2.default)({}, options, { + __collector: createBlobCollector(options.blobId) + }) : options + }); + } + }, { + key: "release", + value: function release(blobId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + + _$$_REQUIRE(_dependencyMap[7]).unregister(blobId); + + if (_$$_REQUIRE(_dependencyMap[7]).has(blobId)) { + return; + } + + _NativeBlobModule.default.release(blobId); + } + }, { + key: "addNetworkingHandler", + value: function addNetworkingHandler() { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + + _NativeBlobModule.default.addNetworkingHandler(); + } + }, { + key: "addWebSocketHandler", + value: function addWebSocketHandler(socketId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + + _NativeBlobModule.default.addWebSocketHandler(socketId); + } + }, { + key: "removeWebSocketHandler", + value: function removeWebSocketHandler(socketId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + + _NativeBlobModule.default.removeWebSocketHandler(socketId); + } + }, { + key: "sendOverSocket", + value: function sendOverSocket(blob, socketId) { + (0, _invariant.default)(_NativeBlobModule.default, 'NativeBlobModule is available.'); + + _NativeBlobModule.default.sendOverSocket(blob.data, socketId); + } + }]); + return BlobManager; + }(); + + BlobManager.isAvailable = !!_NativeBlobModule.default; + module.exports = BlobManager; +},92,[5,6,7,8,93,36,94,95]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NativeModule = TurboModuleRegistry.get('BlobModule'); + var constants = null; + var NativeBlobModule = null; + + if (NativeModule != null) { + NativeBlobModule = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + + return constants; + }, + addNetworkingHandler: function addNetworkingHandler() { + NativeModule.addNetworkingHandler(); + }, + addWebSocketHandler: function addWebSocketHandler(id) { + NativeModule.addWebSocketHandler(id); + }, + removeWebSocketHandler: function removeWebSocketHandler(id) { + NativeModule.removeWebSocketHandler(id); + }, + sendOverSocket: function sendOverSocket(blob, socketID) { + NativeModule.sendOverSocket(blob, socketID); + }, + createFromParts: function createFromParts(parts, withId) { + NativeModule.createFromParts(parts, withId); + }, + release: function release(blobId) { + NativeModule.release(blobId); + } + }; + } + + var _default = NativeBlobModule; + exports.default = _default; +},93,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var Blob = function () { + function Blob() { + var parts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var options = arguments.length > 1 ? arguments[1] : undefined; + + _$$_REQUIRE(_dependencyMap[0])(this, Blob); + + var BlobManager = _$$_REQUIRE(_dependencyMap[1]); + + this.data = BlobManager.createFromParts(parts, options).data; + } + + _$$_REQUIRE(_dependencyMap[2])(Blob, [{ + key: "data", + get: function get() { + if (!this._data) { + throw new Error('Blob has been closed and is no longer available'); + } + + return this._data; + }, + set: function set(data) { + this._data = data; + } + }, { + key: "slice", + value: function slice(start, end) { + var BlobManager = _$$_REQUIRE(_dependencyMap[1]); + + var _this$data = this.data, + offset = _this$data.offset, + size = _this$data.size; + + if (typeof start === 'number') { + if (start > size) { + start = size; + } + + offset += start; + size -= start; + + if (typeof end === 'number') { + if (end < 0) { + end = this.size + end; + } + + size = end - start; + } + } + + return BlobManager.createFromOptions({ + blobId: this.data.blobId, + offset: offset, + size: size + }); + } + }, { + key: "close", + value: function close() { + var BlobManager = _$$_REQUIRE(_dependencyMap[1]); + + BlobManager.release(this.data.blobId); + this.data = null; + } + }, { + key: "size", + get: function get() { + return this.data.size; + } + }, { + key: "type", + get: function get() { + return this.data.type || ''; + } + }]); + + return Blob; + }(); + + module.exports = Blob; +},94,[7,92,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var registry = {}; + + var register = function register(id) { + if (registry[id]) { + registry[id]++; + } else { + registry[id] = 1; + } + }; + + var unregister = function unregister(id) { + if (registry[id]) { + registry[id]--; + + if (registry[id] <= 0) { + delete registry[id]; + } + } + }; + + var has = function has(id) { + return registry[id] && registry[id] > 0; + }; + + module.exports = { + register: register, + unregister: unregister, + has: has + }; +},95,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, '__esModule', { + value: true + }); + var privateData = new WeakMap(); + var wrappers = new WeakMap(); + + function pd(event) { + var retv = privateData.get(event); + return retv; + } + + function setCancelFlag(data) { + if (data.passiveListener != null) { + if (typeof console !== "undefined" && typeof console.error === "function") { + console.error("Unable to preventDefault inside passive event listener invocation.", data.passiveListener); + } + + return; + } + + if (!data.event.cancelable) { + return; + } + + data.canceled = true; + + if (typeof data.event.preventDefault === "function") { + data.event.preventDefault(); + } + } + + function Event(eventTarget, event) { + privateData.set(this, { + eventTarget: eventTarget, + event: event, + eventPhase: 2, + currentTarget: eventTarget, + canceled: false, + stopped: false, + immediateStopped: false, + passiveListener: null, + timeStamp: event.timeStamp || Date.now() + }); + Object.defineProperty(this, "isTrusted", { + value: false, + enumerable: true + }); + var keys = Object.keys(event); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + + if (!(key in this)) { + Object.defineProperty(this, key, defineRedirectDescriptor(key)); + } + } + } + + Event.prototype = { + get type() { + return pd(this).event.type; + }, + + get target() { + return pd(this).eventTarget; + }, + + get currentTarget() { + return pd(this).currentTarget; + }, + + composedPath: function composedPath() { + var currentTarget = pd(this).currentTarget; + + if (currentTarget == null) { + return []; + } + + return [currentTarget]; + }, + + get NONE() { + return 0; + }, + + get CAPTURING_PHASE() { + return 1; + }, + + get AT_TARGET() { + return 2; + }, + + get BUBBLING_PHASE() { + return 3; + }, + + get eventPhase() { + return pd(this).eventPhase; + }, + + stopPropagation: function stopPropagation() { + var data = pd(this); + data.stopped = true; + + if (typeof data.event.stopPropagation === "function") { + data.event.stopPropagation(); + } + }, + stopImmediatePropagation: function stopImmediatePropagation() { + var data = pd(this); + data.stopped = true; + data.immediateStopped = true; + + if (typeof data.event.stopImmediatePropagation === "function") { + data.event.stopImmediatePropagation(); + } + }, + + get bubbles() { + return Boolean(pd(this).event.bubbles); + }, + + get cancelable() { + return Boolean(pd(this).event.cancelable); + }, + + preventDefault: function preventDefault() { + setCancelFlag(pd(this)); + }, + + get defaultPrevented() { + return pd(this).canceled; + }, + + get composed() { + return Boolean(pd(this).event.composed); + }, + + get timeStamp() { + return pd(this).timeStamp; + }, + + get srcElement() { + return pd(this).eventTarget; + }, + + get cancelBubble() { + return pd(this).stopped; + }, + + set cancelBubble(value) { + if (!value) { + return; + } + + var data = pd(this); + data.stopped = true; + + if (typeof data.event.cancelBubble === "boolean") { + data.event.cancelBubble = true; + } + }, + + get returnValue() { + return !pd(this).canceled; + }, + + set returnValue(value) { + if (!value) { + setCancelFlag(pd(this)); + } + }, + + initEvent: function initEvent() {} + }; + Object.defineProperty(Event.prototype, "constructor", { + value: Event, + configurable: true, + writable: true + }); + + if (typeof window !== "undefined" && typeof window.Event !== "undefined") { + Object.setPrototypeOf(Event.prototype, window.Event.prototype); + wrappers.set(window.Event.prototype, Event); + } + + function defineRedirectDescriptor(key) { + return { + get: function get() { + return pd(this).event[key]; + }, + set: function set(value) { + pd(this).event[key] = value; + }, + configurable: true, + enumerable: true + }; + } + + function defineCallDescriptor(key) { + return { + value: function value() { + var event = pd(this).event; + return event[key].apply(event, arguments); + }, + configurable: true, + enumerable: true + }; + } + + function defineWrapper(BaseEvent, proto) { + var keys = Object.keys(proto); + + if (keys.length === 0) { + return BaseEvent; + } + + function CustomEvent(eventTarget, event) { + BaseEvent.call(this, eventTarget, event); + } + + CustomEvent.prototype = Object.create(BaseEvent.prototype, { + constructor: { + value: CustomEvent, + configurable: true, + writable: true + } + }); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + + if (!(key in BaseEvent.prototype)) { + var descriptor = Object.getOwnPropertyDescriptor(proto, key); + var isFunc = typeof descriptor.value === "function"; + Object.defineProperty(CustomEvent.prototype, key, isFunc ? defineCallDescriptor(key) : defineRedirectDescriptor(key)); + } + } + + return CustomEvent; + } + + function getWrapper(proto) { + if (proto == null || proto === Object.prototype) { + return Event; + } + + var wrapper = wrappers.get(proto); + + if (wrapper == null) { + wrapper = defineWrapper(getWrapper(Object.getPrototypeOf(proto)), proto); + wrappers.set(proto, wrapper); + } + + return wrapper; + } + + function wrapEvent(eventTarget, event) { + var Wrapper = getWrapper(Object.getPrototypeOf(event)); + return new Wrapper(eventTarget, event); + } + + function isStopped(event) { + return pd(event).immediateStopped; + } + + function setEventPhase(event, eventPhase) { + pd(event).eventPhase = eventPhase; + } + + function setCurrentTarget(event, currentTarget) { + pd(event).currentTarget = currentTarget; + } + + function setPassiveListener(event, passiveListener) { + pd(event).passiveListener = passiveListener; + } + + var listenersMap = new WeakMap(); + var CAPTURE = 1; + var BUBBLE = 2; + var ATTRIBUTE = 3; + + function isObject(x) { + return x !== null && typeof x === "object"; + } + + function getListeners(eventTarget) { + var listeners = listenersMap.get(eventTarget); + + if (listeners == null) { + throw new TypeError("'this' is expected an EventTarget object, but got another value."); + } + + return listeners; + } + + function defineEventAttributeDescriptor(eventName) { + return { + get: function get() { + var listeners = getListeners(this); + var node = listeners.get(eventName); + + while (node != null) { + if (node.listenerType === ATTRIBUTE) { + return node.listener; + } + + node = node.next; + } + + return null; + }, + set: function set(listener) { + if (typeof listener !== "function" && !isObject(listener)) { + listener = null; + } + + var listeners = getListeners(this); + var prev = null; + var node = listeners.get(eventName); + + while (node != null) { + if (node.listenerType === ATTRIBUTE) { + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + } else { + prev = node; + } + + node = node.next; + } + + if (listener !== null) { + var newNode = { + listener: listener, + listenerType: ATTRIBUTE, + passive: false, + once: false, + next: null + }; + + if (prev === null) { + listeners.set(eventName, newNode); + } else { + prev.next = newNode; + } + } + }, + configurable: true, + enumerable: true + }; + } + + function defineEventAttribute(eventTargetPrototype, eventName) { + Object.defineProperty(eventTargetPrototype, "on" + eventName, defineEventAttributeDescriptor(eventName)); + } + + function defineCustomEventTarget(eventNames) { + function CustomEventTarget() { + EventTarget.call(this); + } + + CustomEventTarget.prototype = Object.create(EventTarget.prototype, { + constructor: { + value: CustomEventTarget, + configurable: true, + writable: true + } + }); + + for (var i = 0; i < eventNames.length; ++i) { + defineEventAttribute(CustomEventTarget.prototype, eventNames[i]); + } + + return CustomEventTarget; + } + + function EventTarget() { + if (this instanceof EventTarget) { + listenersMap.set(this, new Map()); + return; + } + + if (arguments.length === 1 && Array.isArray(arguments[0])) { + return defineCustomEventTarget(arguments[0]); + } + + if (arguments.length > 0) { + var types = new Array(arguments.length); + + for (var i = 0; i < arguments.length; ++i) { + types[i] = arguments[i]; + } + + return defineCustomEventTarget(types); + } + + throw new TypeError("Cannot call a class as a function"); + } + + EventTarget.prototype = { + addEventListener: function addEventListener(eventName, listener, options) { + if (listener == null) { + return; + } + + if (typeof listener !== "function" && !isObject(listener)) { + throw new TypeError("'listener' should be a function or an object."); + } + + var listeners = getListeners(this); + var optionsIsObj = isObject(options); + var capture = optionsIsObj ? Boolean(options.capture) : Boolean(options); + var listenerType = capture ? CAPTURE : BUBBLE; + var newNode = { + listener: listener, + listenerType: listenerType, + passive: optionsIsObj && Boolean(options.passive), + once: optionsIsObj && Boolean(options.once), + next: null + }; + var node = listeners.get(eventName); + + if (node === undefined) { + listeners.set(eventName, newNode); + return; + } + + var prev = null; + + while (node != null) { + if (node.listener === listener && node.listenerType === listenerType) { + return; + } + + prev = node; + node = node.next; + } + + prev.next = newNode; + }, + removeEventListener: function removeEventListener(eventName, listener, options) { + if (listener == null) { + return; + } + + var listeners = getListeners(this); + var capture = isObject(options) ? Boolean(options.capture) : Boolean(options); + var listenerType = capture ? CAPTURE : BUBBLE; + var prev = null; + var node = listeners.get(eventName); + + while (node != null) { + if (node.listener === listener && node.listenerType === listenerType) { + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + + return; + } + + prev = node; + node = node.next; + } + }, + dispatchEvent: function dispatchEvent(event) { + if (event == null || typeof event.type !== "string") { + throw new TypeError('"event.type" should be a string.'); + } + + var listeners = getListeners(this); + var eventName = event.type; + var node = listeners.get(eventName); + + if (node == null) { + return true; + } + + var wrappedEvent = wrapEvent(this, event); + var prev = null; + + while (node != null) { + if (node.once) { + if (prev !== null) { + prev.next = node.next; + } else if (node.next !== null) { + listeners.set(eventName, node.next); + } else { + listeners.delete(eventName); + } + } else { + prev = node; + } + + setPassiveListener(wrappedEvent, node.passive ? node.listener : null); + + if (typeof node.listener === "function") { + try { + node.listener.call(this, wrappedEvent); + } catch (err) { + if (typeof console !== "undefined" && typeof console.error === "function") { + console.error(err); + } + } + } else if (node.listenerType !== ATTRIBUTE && typeof node.listener.handleEvent === "function") { + node.listener.handleEvent(wrappedEvent); + } + + if (isStopped(wrappedEvent)) { + break; + } + + node = node.next; + } + + setPassiveListener(wrappedEvent, null); + setEventPhase(wrappedEvent, 0); + setCurrentTarget(wrappedEvent, null); + return !wrappedEvent.defaultPrevented; + } + }; + Object.defineProperty(EventTarget.prototype, "constructor", { + value: EventTarget, + configurable: true, + writable: true + }); + + if (typeof window !== "undefined" && typeof window.EventTarget !== "undefined") { + Object.setPrototypeOf(EventTarget.prototype, window.EventTarget.prototype); + } + + exports.defineEventAttribute = defineEventAttribute; + exports.EventTarget = EventTarget; + exports.default = EventTarget; + module.exports = EventTarget; + module.exports.EventTarget = module.exports["default"] = EventTarget; + module.exports.defineEventAttribute = defineEventAttribute; +},96,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _createPerformanceLogger = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var GlobalPerformanceLogger = (0, _createPerformanceLogger.default)(); + module.exports = GlobalPerformanceLogger; +},97,[5,98]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createPerformanceLogger; + exports.getCurrentTimestamp = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _global$nativeQPLTime; + + var _cookies = {}; + var PRINT_TO_CONSOLE = false; + var getCurrentTimestamp = (_global$nativeQPLTime = global.nativeQPLTimestamp) != null ? _global$nativeQPLTime : global.performance.now.bind(global.performance); + exports.getCurrentTimestamp = getCurrentTimestamp; + + var PerformanceLogger = function () { + function PerformanceLogger() { + (0, _classCallCheck2.default)(this, PerformanceLogger); + this._timespans = {}; + this._extras = {}; + this._points = {}; + this._pointExtras = {}; + this._closed = false; + } + + (0, _createClass2.default)(PerformanceLogger, [{ + key: "addTimespan", + value: function addTimespan(key, startTime, endTime, startExtras, endExtras) { + if (this._closed) { + return; + } + + if (this._timespans[key]) { + return; + } + + this._timespans[key] = { + startTime: startTime, + endTime: endTime, + totalTime: endTime - (startTime || 0), + startExtras: startExtras, + endExtras: endExtras + }; + } + }, { + key: "append", + value: function append(performanceLogger) { + this._timespans = (0, _extends2.default)({}, performanceLogger.getTimespans(), this._timespans); + this._extras = (0, _extends2.default)({}, performanceLogger.getExtras(), this._extras); + this._points = (0, _extends2.default)({}, performanceLogger.getPoints(), this._points); + this._pointExtras = (0, _extends2.default)({}, performanceLogger.getPointExtras(), this._pointExtras); + } + }, { + key: "clear", + value: function clear() { + this._timespans = {}; + this._extras = {}; + this._points = {}; + } + }, { + key: "clearCompleted", + value: function clearCompleted() { + for (var _key in this._timespans) { + var _this$_timespans$_key; + + if (((_this$_timespans$_key = this._timespans[_key]) == null ? undefined : _this$_timespans$_key.totalTime) != null) { + delete this._timespans[_key]; + } + } + + this._extras = {}; + this._points = {}; + } + }, { + key: "close", + value: function close() { + this._closed = true; + } + }, { + key: "currentTimestamp", + value: function currentTimestamp() { + return getCurrentTimestamp(); + } + }, { + key: "getExtras", + value: function getExtras() { + return this._extras; + } + }, { + key: "getPoints", + value: function getPoints() { + return this._points; + } + }, { + key: "getPointExtras", + value: function getPointExtras() { + return this._pointExtras; + } + }, { + key: "getTimespans", + value: function getTimespans() { + return this._timespans; + } + }, { + key: "hasTimespan", + value: function hasTimespan(key) { + return !!this._timespans[key]; + } + }, { + key: "isClosed", + value: function isClosed() { + return this._closed; + } + }, { + key: "logEverything", + value: function logEverything() {} + }, { + key: "markPoint", + value: function markPoint(key) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentTimestamp(); + var extras = arguments.length > 2 ? arguments[2] : undefined; + + if (this._closed) { + return; + } + + if (this._points[key] != null) { + return; + } + + this._points[key] = timestamp; + + if (extras) { + this._pointExtras[key] = extras; + } + } + }, { + key: "removeExtra", + value: function removeExtra(key) { + var value = this._extras[key]; + delete this._extras[key]; + return value; + } + }, { + key: "setExtra", + value: function setExtra(key, value) { + if (this._closed) { + return; + } + + if (this._extras.hasOwnProperty(key)) { + return; + } + + this._extras[key] = value; + } + }, { + key: "startTimespan", + value: function startTimespan(key) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentTimestamp(); + var extras = arguments.length > 2 ? arguments[2] : undefined; + + if (this._closed) { + return; + } + + if (this._timespans[key]) { + return; + } + + this._timespans[key] = { + startTime: timestamp, + startExtras: extras + }; + _cookies[key] = _$$_REQUIRE(_dependencyMap[4]).beginAsyncEvent(key); + } + }, { + key: "stopTimespan", + value: function stopTimespan(key) { + var timestamp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getCurrentTimestamp(); + var extras = arguments.length > 2 ? arguments[2] : undefined; + + if (this._closed) { + return; + } + + var timespan = this._timespans[key]; + + if (!timespan || timespan.startTime == null) { + return; + } + + if (timespan.endTime != null) { + return; + } + + timespan.endExtras = extras; + timespan.endTime = timestamp; + timespan.totalTime = timespan.endTime - (timespan.startTime || 0); + + if (_cookies[key] != null) { + _$$_REQUIRE(_dependencyMap[4]).endAsyncEvent(key, _cookies[key]); + + delete _cookies[key]; + } + } + }]); + return PerformanceLogger; + }(); + + function createPerformanceLogger() { + return new PerformanceLogger(); + } +},98,[5,6,7,8,47]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + exports.byteLength = byteLength; + exports.toByteArray = toByteArray; + exports.fromByteArray = fromByteArray; + var lookup = []; + var revLookup = []; + var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; + var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + + for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i]; + revLookup[code.charCodeAt(i)] = i; + } + + revLookup['-'.charCodeAt(0)] = 62; + revLookup['_'.charCodeAt(0)] = 63; + + function getLens(b64) { + var len = b64.length; + + if (len % 4 > 0) { + throw new Error('Invalid string. Length must be a multiple of 4'); + } + + var validLen = b64.indexOf('='); + if (validLen === -1) validLen = len; + var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4; + return [validLen, placeHoldersLen]; + } + + function byteLength(b64) { + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function _byteLength(b64, validLen, placeHoldersLen) { + return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; + } + + function toByteArray(b64) { + var tmp; + var lens = getLens(b64); + var validLen = lens[0]; + var placeHoldersLen = lens[1]; + var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen)); + var curByte = 0; + var len = placeHoldersLen > 0 ? validLen - 4 : validLen; + var i; + + for (i = 0; i < len; i += 4) { + tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)]; + arr[curByte++] = tmp >> 16 & 0xFF; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 2) { + tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4; + arr[curByte++] = tmp & 0xFF; + } + + if (placeHoldersLen === 1) { + tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2; + arr[curByte++] = tmp >> 8 & 0xFF; + arr[curByte++] = tmp & 0xFF; + } + + return arr; + } + + function tripletToBase64(num) { + return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]; + } + + function encodeChunk(uint8, start, end) { + var tmp; + var output = []; + + for (var i = start; i < end; i += 3) { + tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF); + output.push(tripletToBase64(tmp)); + } + + return output.join(''); + } + + function fromByteArray(uint8) { + var tmp; + var len = uint8.length; + var extraBytes = len % 3; + var parts = []; + var maxChunkLength = 16383; + + for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) { + parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength)); + } + + if (extraBytes === 1) { + tmp = uint8[len - 1]; + parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '=='); + } else if (extraBytes === 2) { + tmp = (uint8[len - 2] << 8) + uint8[len - 1]; + parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '='); + } + + return parts.join(''); + } +},99,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeNetworkingIOS = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _convertRequestBody = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var RCTNetworking = { + addListener: function addListener(eventType, listener, context) { + return _RCTDeviceEventEmitter.default.addListener(eventType, listener, context); + }, + sendRequest: function sendRequest(method, trackingName, url, headers, data, responseType, incrementalUpdates, timeout, callback, withCredentials) { + var body = (0, _convertRequestBody.default)(data); + + _NativeNetworkingIOS.default.sendRequest({ + method: method, + url: url, + data: (0, _extends2.default)({}, body, { + trackingName: trackingName + }), + headers: headers, + responseType: responseType, + incrementalUpdates: incrementalUpdates, + timeout: timeout, + withCredentials: withCredentials + }, callback); + }, + abortRequest: function abortRequest(requestId) { + _NativeNetworkingIOS.default.abortRequest(requestId); + }, + clearCookies: function clearCookies(callback) { + _NativeNetworkingIOS.default.clearCookies(callback); + } + }; + module.exports = RCTNetworking; +},100,[5,6,30,101,102]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('Networking'); + + exports.default = _default; +},101,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function convertRequestBody(body) { + if (typeof body === 'string') { + return { + string: body + }; + } + + if (body instanceof _$$_REQUIRE(_dependencyMap[0])) { + return { + blob: body.data + }; + } + + if (body instanceof _$$_REQUIRE(_dependencyMap[1])) { + return { + formData: body.getParts() + }; + } + + if (body instanceof ArrayBuffer || ArrayBuffer.isView(body)) { + return { + base64: _$$_REQUIRE(_dependencyMap[2])(body) + }; + } + + return body; + } + + module.exports = convertRequestBody; +},102,[94,103,104]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var FormData = function () { + function FormData() { + _$$_REQUIRE(_dependencyMap[0])(this, FormData); + + this._parts = []; + } + + _$$_REQUIRE(_dependencyMap[1])(FormData, [{ + key: "append", + value: function append(key, value) { + this._parts.push([key, value]); + } + }, { + key: "getParts", + value: function getParts() { + return this._parts.map(function (_ref) { + var _ref2 = _$$_REQUIRE(_dependencyMap[2])(_ref, 2), + name = _ref2[0], + value = _ref2[1]; + + var contentDisposition = 'form-data; name="' + name + '"'; + var headers = { + 'content-disposition': contentDisposition + }; + + if (typeof value === 'object' && value) { + if (typeof value.name === 'string') { + headers['content-disposition'] += '; filename="' + value.name + '"'; + } + + if (typeof value.type === 'string') { + headers['content-type'] = value.type; + } + + return _$$_REQUIRE(_dependencyMap[3])({}, value, { + headers: headers, + fieldName: name + }); + } + + return { + string: String(value), + headers: headers, + fieldName: name + }; + }); + } + }]); + + return FormData; + }(); + + module.exports = FormData; +},103,[7,8,41,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function binaryToBase64(data) { + if (data instanceof ArrayBuffer) { + data = new Uint8Array(data); + } + + if (data instanceof Uint8Array) { + return _$$_REQUIRE(_dependencyMap[0]).fromByteArray(data); + } + + if (!ArrayBuffer.isView(data)) { + throw new Error('data must be ArrayBuffer or typed array'); + } + + var _ref = data, + buffer = _ref.buffer, + byteOffset = _ref.byteOffset, + byteLength = _ref.byteLength; + return _$$_REQUIRE(_dependencyMap[0]).fromByteArray(new Uint8Array(buffer, byteOffset, byteLength)); + } + + module.exports = binaryToBase64; +},104,[99]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + _$$_REQUIRE(_dependencyMap[0]); + + module.exports = { + fetch: fetch, + Headers: Headers, + Request: Request, + Response: Response + }; +},105,[106]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'], factory) : factory(global.WHATWGFetch = {}); + })(this, function (exports) { + 'use strict'; + + var global = typeof globalThis !== 'undefined' && globalThis || typeof self !== 'undefined' && self || typeof global !== 'undefined' && global; + var support = { + searchParams: 'URLSearchParams' in global, + iterable: 'Symbol' in global && 'iterator' in Symbol, + blob: 'FileReader' in global && 'Blob' in global && function () { + try { + new Blob(); + return true; + } catch (e) { + return false; + } + }(), + formData: 'FormData' in global, + arrayBuffer: 'ArrayBuffer' in global + }; + + function isDataView(obj) { + return obj && DataView.prototype.isPrototypeOf(obj); + } + + if (support.arrayBuffer) { + var viewClasses = ['[object Int8Array]', '[object Uint8Array]', '[object Uint8ClampedArray]', '[object Int16Array]', '[object Uint16Array]', '[object Int32Array]', '[object Uint32Array]', '[object Float32Array]', '[object Float64Array]']; + + var isArrayBufferView = ArrayBuffer.isView || function (obj) { + return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1; + }; + } + + function normalizeName(name) { + if (typeof name !== 'string') { + name = String(name); + } + + if (/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(name) || name === '') { + throw new TypeError('Invalid character in header field name: "' + name + '"'); + } + + return name.toLowerCase(); + } + + function normalizeValue(value) { + if (typeof value !== 'string') { + value = String(value); + } + + return value; + } + + function iteratorFor(items) { + var iterator = { + next: function next() { + var value = items.shift(); + return { + done: value === undefined, + value: value + }; + } + }; + + if (support.iterable) { + iterator[Symbol.iterator] = function () { + return iterator; + }; + } + + return iterator; + } + + function Headers(headers) { + this.map = {}; + + if (headers instanceof Headers) { + headers.forEach(function (value, name) { + this.append(name, value); + }, this); + } else if (Array.isArray(headers)) { + headers.forEach(function (header) { + this.append(header[0], header[1]); + }, this); + } else if (headers) { + Object.getOwnPropertyNames(headers).forEach(function (name) { + this.append(name, headers[name]); + }, this); + } + } + + Headers.prototype.append = function (name, value) { + name = normalizeName(name); + value = normalizeValue(value); + var oldValue = this.map[name]; + this.map[name] = oldValue ? oldValue + ', ' + value : value; + }; + + Headers.prototype['delete'] = function (name) { + delete this.map[normalizeName(name)]; + }; + + Headers.prototype.get = function (name) { + name = normalizeName(name); + return this.has(name) ? this.map[name] : null; + }; + + Headers.prototype.has = function (name) { + return this.map.hasOwnProperty(normalizeName(name)); + }; + + Headers.prototype.set = function (name, value) { + this.map[normalizeName(name)] = normalizeValue(value); + }; + + Headers.prototype.forEach = function (callback, thisArg) { + for (var name in this.map) { + if (this.map.hasOwnProperty(name)) { + callback.call(thisArg, this.map[name], name, this); + } + } + }; + + Headers.prototype.keys = function () { + var items = []; + this.forEach(function (value, name) { + items.push(name); + }); + return iteratorFor(items); + }; + + Headers.prototype.values = function () { + var items = []; + this.forEach(function (value) { + items.push(value); + }); + return iteratorFor(items); + }; + + Headers.prototype.entries = function () { + var items = []; + this.forEach(function (value, name) { + items.push([name, value]); + }); + return iteratorFor(items); + }; + + if (support.iterable) { + Headers.prototype[Symbol.iterator] = Headers.prototype.entries; + } + + function consumed(body) { + if (body.bodyUsed) { + return Promise.reject(new TypeError('Already read')); + } + + body.bodyUsed = true; + } + + function fileReaderReady(reader) { + return new Promise(function (resolve, reject) { + reader.onload = function () { + resolve(reader.result); + }; + + reader.onerror = function () { + reject(reader.error); + }; + }); + } + + function readBlobAsArrayBuffer(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsArrayBuffer(blob); + return promise; + } + + function readBlobAsText(blob) { + var reader = new FileReader(); + var promise = fileReaderReady(reader); + reader.readAsText(blob); + return promise; + } + + function readArrayBufferAsText(buf) { + var view = new Uint8Array(buf); + var chars = new Array(view.length); + + for (var i = 0; i < view.length; i++) { + chars[i] = String.fromCharCode(view[i]); + } + + return chars.join(''); + } + + function bufferClone(buf) { + if (buf.slice) { + return buf.slice(0); + } else { + var view = new Uint8Array(buf.byteLength); + view.set(new Uint8Array(buf)); + return view.buffer; + } + } + + function Body() { + this.bodyUsed = false; + + this._initBody = function (body) { + this.bodyUsed = this.bodyUsed; + this._bodyInit = body; + + if (!body) { + this._bodyText = ''; + } else if (typeof body === 'string') { + this._bodyText = body; + } else if (support.blob && Blob.prototype.isPrototypeOf(body)) { + this._bodyBlob = body; + } else if (support.formData && FormData.prototype.isPrototypeOf(body)) { + this._bodyFormData = body; + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this._bodyText = body.toString(); + } else if (support.arrayBuffer && support.blob && isDataView(body)) { + this._bodyArrayBuffer = bufferClone(body.buffer); + this._bodyInit = new Blob([this._bodyArrayBuffer]); + } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) { + this._bodyArrayBuffer = bufferClone(body); + } else { + this._bodyText = body = Object.prototype.toString.call(body); + } + + if (!this.headers.get('content-type')) { + if (typeof body === 'string') { + this.headers.set('content-type', 'text/plain;charset=UTF-8'); + } else if (this._bodyBlob && this._bodyBlob.type) { + this.headers.set('content-type', this._bodyBlob.type); + } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) { + this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8'); + } + } + }; + + if (support.blob) { + this.blob = function () { + var rejected = consumed(this); + + if (rejected) { + return rejected; + } + + if (this._bodyBlob) { + return Promise.resolve(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(new Blob([this._bodyArrayBuffer])); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as blob'); + } else { + return Promise.resolve(new Blob([this._bodyText])); + } + }; + + this.arrayBuffer = function () { + if (this._bodyArrayBuffer) { + var isConsumed = consumed(this); + + if (isConsumed) { + return isConsumed; + } + + if (ArrayBuffer.isView(this._bodyArrayBuffer)) { + return Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset, this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength)); + } else { + return Promise.resolve(this._bodyArrayBuffer); + } + } else { + return this.blob().then(readBlobAsArrayBuffer); + } + }; + } + + this.text = function () { + var rejected = consumed(this); + + if (rejected) { + return rejected; + } + + if (this._bodyBlob) { + return readBlobAsText(this._bodyBlob); + } else if (this._bodyArrayBuffer) { + return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer)); + } else if (this._bodyFormData) { + throw new Error('could not read FormData body as text'); + } else { + return Promise.resolve(this._bodyText); + } + }; + + if (support.formData) { + this.formData = function () { + return this.text().then(decode); + }; + } + + this.json = function () { + return this.text().then(JSON.parse); + }; + + return this; + } + + var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']; + + function normalizeMethod(method) { + var upcased = method.toUpperCase(); + return methods.indexOf(upcased) > -1 ? upcased : method; + } + + function Request(input, options) { + if (!(this instanceof Request)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + } + + options = options || {}; + var body = options.body; + + if (input instanceof Request) { + if (input.bodyUsed) { + throw new TypeError('Already read'); + } + + this.url = input.url; + this.credentials = input.credentials; + + if (!options.headers) { + this.headers = new Headers(input.headers); + } + + this.method = input.method; + this.mode = input.mode; + this.signal = input.signal; + + if (!body && input._bodyInit != null) { + body = input._bodyInit; + input.bodyUsed = true; + } + } else { + this.url = String(input); + } + + this.credentials = options.credentials || this.credentials || 'same-origin'; + + if (options.headers || !this.headers) { + this.headers = new Headers(options.headers); + } + + this.method = normalizeMethod(options.method || this.method || 'GET'); + this.mode = options.mode || this.mode || null; + this.signal = options.signal || this.signal; + this.referrer = null; + + if ((this.method === 'GET' || this.method === 'HEAD') && body) { + throw new TypeError('Body not allowed for GET or HEAD requests'); + } + + this._initBody(body); + + if (this.method === 'GET' || this.method === 'HEAD') { + if (options.cache === 'no-store' || options.cache === 'no-cache') { + var reParamSearch = /([?&])_=[^&]*/; + + if (reParamSearch.test(this.url)) { + this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime()); + } else { + var reQueryString = /\?/; + this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime(); + } + } + } + } + + Request.prototype.clone = function () { + return new Request(this, { + body: this._bodyInit + }); + }; + + function decode(body) { + var form = new FormData(); + body.trim().split('&').forEach(function (bytes) { + if (bytes) { + var split = bytes.split('='); + var name = split.shift().replace(/\+/g, ' '); + var value = split.join('=').replace(/\+/g, ' '); + form.append(decodeURIComponent(name), decodeURIComponent(value)); + } + }); + return form; + } + + function parseHeaders(rawHeaders) { + var headers = new Headers(); + var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' '); + preProcessedHeaders.split('\r').map(function (header) { + return header.indexOf('\n') === 0 ? header.substr(1, header.length) : header; + }).forEach(function (line) { + var parts = line.split(':'); + var key = parts.shift().trim(); + + if (key) { + var value = parts.join(':').trim(); + headers.append(key, value); + } + }); + return headers; + } + + Body.call(Request.prototype); + + function Response(bodyInit, options) { + if (!(this instanceof Response)) { + throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.'); + } + + if (!options) { + options = {}; + } + + this.type = 'default'; + this.status = options.status === undefined ? 200 : options.status; + this.ok = this.status >= 200 && this.status < 300; + this.statusText = options.statusText === undefined ? '' : '' + options.statusText; + this.headers = new Headers(options.headers); + this.url = options.url || ''; + + this._initBody(bodyInit); + } + + Body.call(Response.prototype); + + Response.prototype.clone = function () { + return new Response(this._bodyInit, { + status: this.status, + statusText: this.statusText, + headers: new Headers(this.headers), + url: this.url + }); + }; + + Response.error = function () { + var response = new Response(null, { + status: 0, + statusText: '' + }); + response.type = 'error'; + return response; + }; + + var redirectStatuses = [301, 302, 303, 307, 308]; + + Response.redirect = function (url, status) { + if (redirectStatuses.indexOf(status) === -1) { + throw new RangeError('Invalid status code'); + } + + return new Response(null, { + status: status, + headers: { + location: url + } + }); + }; + + exports.DOMException = global.DOMException; + + try { + new exports.DOMException(); + } catch (err) { + exports.DOMException = function (message, name) { + this.message = message; + this.name = name; + var error = Error(message); + this.stack = error.stack; + }; + + exports.DOMException.prototype = Object.create(Error.prototype); + exports.DOMException.prototype.constructor = exports.DOMException; + } + + function fetch(input, init) { + return new Promise(function (resolve, reject) { + var request = new Request(input, init); + + if (request.signal && request.signal.aborted) { + return reject(new exports.DOMException('Aborted', 'AbortError')); + } + + var xhr = new XMLHttpRequest(); + + function abortXhr() { + xhr.abort(); + } + + xhr.onload = function () { + var options = { + status: xhr.status, + statusText: xhr.statusText, + headers: parseHeaders(xhr.getAllResponseHeaders() || '') + }; + options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL'); + var body = 'response' in xhr ? xhr.response : xhr.responseText; + setTimeout(function () { + resolve(new Response(body, options)); + }, 0); + }; + + xhr.onerror = function () { + setTimeout(function () { + reject(new TypeError('Network request failed')); + }, 0); + }; + + xhr.ontimeout = function () { + setTimeout(function () { + reject(new TypeError('Network request failed')); + }, 0); + }; + + xhr.onabort = function () { + setTimeout(function () { + reject(new exports.DOMException('Aborted', 'AbortError')); + }, 0); + }; + + function fixUrl(url) { + try { + return url === '' && global.location.href ? global.location.href : url; + } catch (e) { + return url; + } + } + + xhr.open(request.method, fixUrl(request.url), true); + + if (request.credentials === 'include') { + xhr.withCredentials = true; + } else if (request.credentials === 'omit') { + xhr.withCredentials = false; + } + + if ('responseType' in xhr) { + if (support.blob) { + xhr.responseType = 'blob'; + } else if (support.arrayBuffer && request.headers.get('Content-Type') && request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1) { + xhr.responseType = 'arraybuffer'; + } + } + + if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) { + Object.getOwnPropertyNames(init.headers).forEach(function (name) { + xhr.setRequestHeader(name, normalizeValue(init.headers[name])); + }); + } else { + request.headers.forEach(function (value, name) { + xhr.setRequestHeader(name, value); + }); + } + + if (request.signal) { + request.signal.addEventListener('abort', abortXhr); + + xhr.onreadystatechange = function () { + if (xhr.readyState === 4) { + request.signal.removeEventListener('abort', abortXhr); + } + }; + } + + xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit); + }); + } + + fetch.polyfill = true; + + if (!global.fetch) { + global.fetch = fetch; + global.Headers = Headers; + global.Request = Request; + global.Response = Response; + } + + exports.Headers = Headers; + exports.Request = Request; + exports.Response = Response; + exports.fetch = fetch; + Object.defineProperty(exports, '__esModule', { + value: true + }); + }); +},106,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Blob = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _BlobManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _binaryToBase = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _NativeWebSocketModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _WebSocketEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _base64Js = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _eventTargetShim = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var CONNECTING = 0; + var OPEN = 1; + var CLOSING = 2; + var CLOSED = 3; + var CLOSE_NORMAL = 1000; + var WEBSOCKET_EVENTS = ['close', 'error', 'message', 'open']; + var nextWebSocketId = 0; + + var WebSocket = function (_ref) { + (0, _inherits2.default)(WebSocket, _ref); + + var _super = _createSuper(WebSocket); + + function WebSocket(url, protocols, options) { + var _this; + + (0, _classCallCheck2.default)(this, WebSocket); + _this = _super.call(this); + _this.CONNECTING = CONNECTING; + _this.OPEN = OPEN; + _this.CLOSING = CLOSING; + _this.CLOSED = CLOSED; + _this.readyState = CONNECTING; + _this.url = url; + + if (typeof protocols === 'string') { + protocols = [protocols]; + } + + var _ref2 = options || {}, + _ref2$headers = _ref2.headers, + headers = _ref2$headers === undefined ? {} : _ref2$headers, + unrecognized = (0, _objectWithoutProperties2.default)(_ref2, ["headers"]); + + if (unrecognized && typeof unrecognized.origin === 'string') { + console.warn('Specifying `origin` as a WebSocket connection option is deprecated. Include it under `headers` instead.'); + headers.origin = unrecognized.origin; + delete unrecognized.origin; + } + + if (Object.keys(unrecognized).length > 0) { + console.warn('Unrecognized WebSocket connection option(s) `' + Object.keys(unrecognized).join('`, `') + '`. ' + 'Did you mean to put these under `headers`?'); + } + + if (!Array.isArray(protocols)) { + protocols = null; + } + + _this._eventEmitter = new _NativeEventEmitter.default(_Platform.default.OS !== 'ios' ? null : _NativeWebSocketModule.default); + _this._socketId = nextWebSocketId++; + + _this._registerEvents(); + + _NativeWebSocketModule.default.connect(url, protocols, { + headers: headers + }, _this._socketId); + + return _this; + } + + (0, _createClass2.default)(WebSocket, [{ + key: "binaryType", + get: function get() { + return this._binaryType; + }, + set: function set(binaryType) { + if (binaryType !== 'blob' && binaryType !== 'arraybuffer') { + throw new Error("binaryType must be either 'blob' or 'arraybuffer'"); + } + + if (this._binaryType === 'blob' || binaryType === 'blob') { + (0, _invariant.default)(_BlobManager.default.isAvailable, 'Native module BlobModule is required for blob support'); + + if (binaryType === 'blob') { + _BlobManager.default.addWebSocketHandler(this._socketId); + } else { + _BlobManager.default.removeWebSocketHandler(this._socketId); + } + } + + this._binaryType = binaryType; + } + }, { + key: "close", + value: function close(code, reason) { + if (this.readyState === this.CLOSING || this.readyState === this.CLOSED) { + return; + } + + this.readyState = this.CLOSING; + + this._close(code, reason); + } + }, { + key: "send", + value: function send(data) { + if (this.readyState === this.CONNECTING) { + throw new Error('INVALID_STATE_ERR'); + } + + if (data instanceof _Blob.default) { + (0, _invariant.default)(_BlobManager.default.isAvailable, 'Native module BlobModule is required for blob support'); + + _BlobManager.default.sendOverSocket(data, this._socketId); + + return; + } + + if (typeof data === 'string') { + _NativeWebSocketModule.default.send(data, this._socketId); + + return; + } + + if (data instanceof ArrayBuffer || ArrayBuffer.isView(data)) { + _NativeWebSocketModule.default.sendBinary((0, _binaryToBase.default)(data), this._socketId); + + return; + } + + throw new Error('Unsupported data type'); + } + }, { + key: "ping", + value: function ping() { + if (this.readyState === this.CONNECTING) { + throw new Error('INVALID_STATE_ERR'); + } + + _NativeWebSocketModule.default.ping(this._socketId); + } + }, { + key: "_close", + value: function _close(code, reason) { + var statusCode = typeof code === 'number' ? code : CLOSE_NORMAL; + var closeReason = typeof reason === 'string' ? reason : ''; + + _NativeWebSocketModule.default.close(statusCode, closeReason, this._socketId); + + if (_BlobManager.default.isAvailable && this._binaryType === 'blob') { + _BlobManager.default.removeWebSocketHandler(this._socketId); + } + } + }, { + key: "_unregisterEvents", + value: function _unregisterEvents() { + this._subscriptions.forEach(function (e) { + return e.remove(); + }); + + this._subscriptions = []; + } + }, { + key: "_registerEvents", + value: function _registerEvents() { + var _this2 = this; + + this._subscriptions = [this._eventEmitter.addListener('websocketMessage', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + + var data = ev.data; + + switch (ev.type) { + case 'binary': + data = _base64Js.default.toByteArray(ev.data).buffer; + break; + + case 'blob': + data = _BlobManager.default.createFromOptions(ev.data); + break; + } + + _this2.dispatchEvent(new _WebSocketEvent.default('message', { + data: data + })); + }), this._eventEmitter.addListener('websocketOpen', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + + _this2.readyState = _this2.OPEN; + _this2.protocol = ev.protocol; + + _this2.dispatchEvent(new _WebSocketEvent.default('open')); + }), this._eventEmitter.addListener('websocketClosed', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + + _this2.readyState = _this2.CLOSED; + + _this2.dispatchEvent(new _WebSocketEvent.default('close', { + code: ev.code, + reason: ev.reason + })); + + _this2._unregisterEvents(); + + _this2.close(); + }), this._eventEmitter.addListener('websocketFailed', function (ev) { + if (ev.id !== _this2._socketId) { + return; + } + + _this2.readyState = _this2.CLOSED; + + _this2.dispatchEvent(new _WebSocketEvent.default('error', { + message: ev.message + })); + + _this2.dispatchEvent(new _WebSocketEvent.default('close', { + message: ev.message + })); + + _this2._unregisterEvents(); + + _this2.close(); + })]; + } + }]); + return WebSocket; + }(_eventTargetShim.default.apply(undefined, WEBSOCKET_EVENTS)); + + WebSocket.CONNECTING = CONNECTING; + WebSocket.OPEN = OPEN; + WebSocket.CLOSING = CLOSING; + WebSocket.CLOSED = CLOSED; + module.exports = WebSocket; +},107,[5,108,7,8,12,14,16,94,92,110,104,37,111,112,99,96,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _objectWithoutProperties(source, excluded) { + if (source == null) return {}; + + var target = _$$_REQUIRE(_dependencyMap[0])(source, excluded); + + var key, i; + + if (Object.getOwnPropertySymbols) { + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); + + for (i = 0; i < sourceSymbolKeys.length; i++) { + key = sourceSymbolKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; + target[key] = source[key]; + } + } + + return target; + } + + module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; +},108,[109]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; +},109,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var NativeEventEmitter = function () { + function NativeEventEmitter(nativeModule) { + (0, _classCallCheck2.default)(this, NativeEventEmitter); + + if (_Platform.default.OS === 'ios') { + (0, _invariant.default)(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.'); + } + + var hasAddListener = !!nativeModule && typeof nativeModule.addListener === 'function'; + var hasRemoveListeners = !!nativeModule && typeof nativeModule.removeListeners === 'function'; + + if (nativeModule && hasAddListener && hasRemoveListeners) { + this._nativeModule = nativeModule; + } else if (nativeModule != null) { + if (!hasAddListener) { + console.warn('`new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.'); + } + + if (!hasRemoveListeners) { + console.warn('`new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.'); + } + } + } + + (0, _createClass2.default)(NativeEventEmitter, [{ + key: "addListener", + value: function addListener(eventType, listener, context) { + var _this$_nativeModule, + _this = this; + + (_this$_nativeModule = this._nativeModule) == null ? undefined : _this$_nativeModule.addListener(eventType); + + var subscription = _RCTDeviceEventEmitter.default.addListener(eventType, listener, context); + + return { + remove: function remove() { + if (subscription != null) { + var _this$_nativeModule2; + + (_this$_nativeModule2 = _this._nativeModule) == null ? undefined : _this$_nativeModule2.removeListeners(1); + subscription.remove(); + subscription = null; + } + } + }; + } + }, { + key: "removeListener", + value: function removeListener(eventType, listener) { + var _this$_nativeModule3; + + (_this$_nativeModule3 = this._nativeModule) == null ? undefined : _this$_nativeModule3.removeListeners(1); + + _RCTDeviceEventEmitter.default.removeListener(eventType, listener); + } + }, { + key: "emit", + value: function emit(eventType) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + _RCTDeviceEventEmitter.default.emit.apply(_RCTDeviceEventEmitter.default, [eventType].concat(args)); + } + }, { + key: "removeAllListeners", + value: function removeAllListeners(eventType) { + var _this$_nativeModule4; + + (0, _invariant.default)(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.'); + (_this$_nativeModule4 = this._nativeModule) == null ? undefined : _this$_nativeModule4.removeListeners(this.listenerCount(eventType)); + + _RCTDeviceEventEmitter.default.removeAllListeners(eventType); + } + }, { + key: "listenerCount", + value: function listenerCount(eventType) { + return _RCTDeviceEventEmitter.default.listenerCount(eventType); + } + }]); + return NativeEventEmitter; + }(); + + exports.default = NativeEventEmitter; +},110,[5,7,8,37,30,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('WebSocketModule'); + + exports.default = _default; +},111,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var WebSocketEvent = function WebSocketEvent(type, eventInitDict) { + _$$_REQUIRE(_dependencyMap[0])(this, WebSocketEvent); + + this.type = type.toString(); + + _$$_REQUIRE(_dependencyMap[1])(this, eventInitDict); + }; + + module.exports = WebSocketEvent; +},112,[7,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var File = function (_Blob) { + _$$_REQUIRE(_dependencyMap[2])(File, _Blob); + + var _super = _createSuper(File); + + function File(parts, name, options) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, File); + + _$$_REQUIRE(_dependencyMap[4])(parts != null && name != null, 'Failed to construct `File`: Must pass both `parts` and `name` arguments.'); + + _this = _super.call(this, parts, options); + _this.data.name = name; + return _this; + } + + _$$_REQUIRE(_dependencyMap[5])(File, [{ + key: "name", + get: function get() { + _$$_REQUIRE(_dependencyMap[4])(this.data.name != null, 'Files must have a name set.'); + + return this.data.name; + } + }, { + key: "lastModified", + get: function get() { + return this.data.lastModified || 0; + } + }]); + + return File; + }(_$$_REQUIRE(_dependencyMap[6])); + + module.exports = File; +},113,[16,14,12,7,36,8,94]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NativeFileReaderModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var READER_EVENTS = ['abort', 'error', 'load', 'loadstart', 'loadend', 'progress']; + var EMPTY = 0; + var LOADING = 1; + var DONE = 2; + + var FileReader = function (_ref) { + (0, _inherits2.default)(FileReader, _ref); + + var _super = _createSuper(FileReader); + + function FileReader() { + var _this; + + (0, _classCallCheck2.default)(this, FileReader); + _this = _super.call(this); + _this.EMPTY = EMPTY; + _this.LOADING = LOADING; + _this.DONE = DONE; + _this._aborted = false; + _this._subscriptions = []; + + _this._reset(); + + return _this; + } + + (0, _createClass2.default)(FileReader, [{ + key: "_reset", + value: function _reset() { + this._readyState = EMPTY; + this._error = null; + this._result = null; + } + }, { + key: "_clearSubscriptions", + value: function _clearSubscriptions() { + this._subscriptions.forEach(function (sub) { + return sub.remove(); + }); + + this._subscriptions = []; + } + }, { + key: "_setReadyState", + value: function _setReadyState(newState) { + this._readyState = newState; + this.dispatchEvent({ + type: 'readystatechange' + }); + + if (newState === DONE) { + if (this._aborted) { + this.dispatchEvent({ + type: 'abort' + }); + } else if (this._error) { + this.dispatchEvent({ + type: 'error' + }); + } else { + this.dispatchEvent({ + type: 'load' + }); + } + + this.dispatchEvent({ + type: 'loadend' + }); + } + } + }, { + key: "readAsArrayBuffer", + value: function readAsArrayBuffer() { + throw new Error('FileReader.readAsArrayBuffer is not implemented'); + } + }, { + key: "readAsDataURL", + value: function readAsDataURL(blob) { + var _this2 = this; + + this._aborted = false; + + if (blob == null) { + throw new TypeError("Failed to execute 'readAsDataURL' on 'FileReader': parameter 1 is not of type 'Blob'"); + } + + _NativeFileReaderModule.default.readAsDataURL(blob.data).then(function (text) { + if (_this2._aborted) { + return; + } + + _this2._result = text; + + _this2._setReadyState(DONE); + }, function (error) { + if (_this2._aborted) { + return; + } + + _this2._error = error; + + _this2._setReadyState(DONE); + }); + } + }, { + key: "readAsText", + value: function readAsText(blob) { + var _this3 = this; + + var encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'UTF-8'; + this._aborted = false; + + if (blob == null) { + throw new TypeError("Failed to execute 'readAsText' on 'FileReader': parameter 1 is not of type 'Blob'"); + } + + _NativeFileReaderModule.default.readAsText(blob.data, encoding).then(function (text) { + if (_this3._aborted) { + return; + } + + _this3._result = text; + + _this3._setReadyState(DONE); + }, function (error) { + if (_this3._aborted) { + return; + } + + _this3._error = error; + + _this3._setReadyState(DONE); + }); + } + }, { + key: "abort", + value: function abort() { + this._aborted = true; + + if (this._readyState !== EMPTY && this._readyState !== DONE) { + this._reset(); + + this._setReadyState(DONE); + } + + this._reset(); + } + }, { + key: "readyState", + get: function get() { + return this._readyState; + } + }, { + key: "error", + get: function get() { + return this._error; + } + }, { + key: "result", + get: function get() { + return this._result; + } + }]); + return FileReader; + }(_$$_REQUIRE(_dependencyMap[7]).apply(undefined, READER_EVENTS)); + + FileReader.EMPTY = EMPTY; + FileReader.LOADING = LOADING; + FileReader.DONE = DONE; + module.exports = FileReader; +},114,[5,7,8,12,14,16,115,96]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('FileReaderModule'); + + exports.default = _default; +},115,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.URL = exports.URLSearchParams = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeBlobModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Symbol$iterator; + + var BLOB_URL_PREFIX = null; + + if (_NativeBlobModule.default && typeof _NativeBlobModule.default.getConstants().BLOB_URI_SCHEME === 'string') { + var constants = _NativeBlobModule.default.getConstants(); + + BLOB_URL_PREFIX = constants.BLOB_URI_SCHEME + ':'; + + if (typeof constants.BLOB_URI_HOST === 'string') { + BLOB_URL_PREFIX += "//" + constants.BLOB_URI_HOST + "/"; + } + } + + _Symbol$iterator = Symbol.iterator; + + var URLSearchParams = function () { + function URLSearchParams(params) { + var _this = this; + + (0, _classCallCheck2.default)(this, URLSearchParams); + this._searchParams = []; + + if (typeof params === 'object') { + Object.keys(params).forEach(function (key) { + return _this.append(key, params[key]); + }); + } + } + + (0, _createClass2.default)(URLSearchParams, [{ + key: "append", + value: function append(key, value) { + this._searchParams.push([key, value]); + } + }, { + key: "delete", + value: function _delete(name) { + throw new Error('URLSearchParams.delete is not implemented'); + } + }, { + key: "get", + value: function get(name) { + throw new Error('URLSearchParams.get is not implemented'); + } + }, { + key: "getAll", + value: function getAll(name) { + throw new Error('URLSearchParams.getAll is not implemented'); + } + }, { + key: "has", + value: function has(name) { + throw new Error('URLSearchParams.has is not implemented'); + } + }, { + key: "set", + value: function set(name, value) { + throw new Error('URLSearchParams.set is not implemented'); + } + }, { + key: "sort", + value: function sort() { + throw new Error('URLSearchParams.sort is not implemented'); + } + }, { + key: _Symbol$iterator, + value: function value() { + return this._searchParams[Symbol.iterator](); + } + }, { + key: "toString", + value: function toString() { + if (this._searchParams.length === 0) { + return ''; + } + + var last = this._searchParams.length - 1; + return this._searchParams.reduce(function (acc, curr, index) { + return acc + curr.join('=') + (index === last ? '' : '&'); + }, ''); + } + }]); + return URLSearchParams; + }(); + + exports.URLSearchParams = URLSearchParams; + + function validateBaseUrl(url) { + return /^(?:(?:(?:https?|ftp):)?\/\/)(?:(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)*(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/.test(url); + } + + var URL = function () { + function URL(url, base) { + (0, _classCallCheck2.default)(this, URL); + this._searchParamsInstance = null; + var baseUrl = null; + + if (!base || validateBaseUrl(url)) { + this._url = url; + + if (!this._url.endsWith('/')) { + this._url += '/'; + } + } else { + if (typeof base === 'string') { + baseUrl = base; + + if (!validateBaseUrl(baseUrl)) { + throw new TypeError("Invalid base URL: " + baseUrl); + } + } else if (typeof base === 'object') { + baseUrl = base.toString(); + } + + if (baseUrl.endsWith('/')) { + baseUrl = baseUrl.slice(0, baseUrl.length - 1); + } + + if (!url.startsWith('/')) { + url = "/" + url; + } + + if (baseUrl.endsWith(url)) { + url = ''; + } + + this._url = "" + baseUrl + url; + } + } + + (0, _createClass2.default)(URL, [{ + key: "hash", + get: function get() { + throw new Error('URL.hash is not implemented'); + } + }, { + key: "host", + get: function get() { + throw new Error('URL.host is not implemented'); + } + }, { + key: "hostname", + get: function get() { + throw new Error('URL.hostname is not implemented'); + } + }, { + key: "href", + get: function get() { + return this.toString(); + } + }, { + key: "origin", + get: function get() { + throw new Error('URL.origin is not implemented'); + } + }, { + key: "password", + get: function get() { + throw new Error('URL.password is not implemented'); + } + }, { + key: "pathname", + get: function get() { + throw new Error('URL.pathname not implemented'); + } + }, { + key: "port", + get: function get() { + throw new Error('URL.port is not implemented'); + } + }, { + key: "protocol", + get: function get() { + throw new Error('URL.protocol is not implemented'); + } + }, { + key: "search", + get: function get() { + throw new Error('URL.search is not implemented'); + } + }, { + key: "searchParams", + get: function get() { + if (this._searchParamsInstance == null) { + this._searchParamsInstance = new URLSearchParams(); + } + + return this._searchParamsInstance; + } + }, { + key: "toJSON", + value: function toJSON() { + return this.toString(); + } + }, { + key: "toString", + value: function toString() { + if (this._searchParamsInstance === null) { + return this._url; + } + + var separator = this._url.indexOf('?') > -1 ? '&' : '?'; + return this._url + separator + this._searchParamsInstance.toString(); + } + }, { + key: "username", + get: function get() { + throw new Error('URL.username is not implemented'); + } + }], [{ + key: "createObjectURL", + value: function createObjectURL(blob) { + if (BLOB_URL_PREFIX === null) { + throw new Error('Cannot create URL for blob!'); + } + + return "" + BLOB_URL_PREFIX + blob.data.blobId + "?offset=" + blob.data.offset + "&size=" + blob.size; + } + }, { + key: "revokeObjectURL", + value: function revokeObjectURL(url) {} + }]); + return URL; + }(); + + exports.URL = URL; +},116,[5,7,8,93]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var AbortSignal = function (_eventTargetShim$Even) { + _$$_REQUIRE(_dependencyMap[2])(AbortSignal, _eventTargetShim$Even); + + var _super = _createSuper(AbortSignal); + + function AbortSignal() { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AbortSignal); + + _this = _super.call(this); + throw new TypeError("AbortSignal cannot be constructed directly"); + return _this; + } + + _$$_REQUIRE(_dependencyMap[4])(AbortSignal, [{ + key: "aborted", + get: function get() { + var aborted = abortedFlags.get(this); + + if (typeof aborted !== "boolean") { + throw new TypeError("Expected 'this' to be an 'AbortSignal' object, but got " + (this === null ? "null" : typeof this)); + } + + return aborted; + } + }]); + + return AbortSignal; + }(_$$_REQUIRE(_dependencyMap[5]).EventTarget); + + _$$_REQUIRE(_dependencyMap[5]).defineEventAttribute(AbortSignal.prototype, "abort"); + + function createAbortSignal() { + var signal = Object.create(AbortSignal.prototype); + + _$$_REQUIRE(_dependencyMap[5]).EventTarget.call(signal); + + abortedFlags.set(signal, false); + return signal; + } + + function abortSignal(signal) { + if (abortedFlags.get(signal) !== false) { + return; + } + + abortedFlags.set(signal, true); + signal.dispatchEvent({ + type: "abort" + }); + } + + var abortedFlags = new WeakMap(); + Object.defineProperties(AbortSignal.prototype, { + aborted: { + enumerable: true + } + }); + + if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { + Object.defineProperty(AbortSignal.prototype, Symbol.toStringTag, { + configurable: true, + value: "AbortSignal" + }); + } + + var AbortController = function () { + function AbortController() { + _$$_REQUIRE(_dependencyMap[3])(this, AbortController); + + signals.set(this, createAbortSignal()); + } + + _$$_REQUIRE(_dependencyMap[4])(AbortController, [{ + key: "signal", + get: function get() { + return getSignal(this); + } + }, { + key: "abort", + value: function abort() { + abortSignal(getSignal(this)); + } + }]); + + return AbortController; + }(); + + var signals = new WeakMap(); + + function getSignal(controller) { + var signal = signals.get(controller); + + if (signal == null) { + throw new TypeError("Expected 'this' to be an 'AbortController' object, but got " + (controller === null ? "null" : typeof controller)); + } + + return signal; + } + + Object.defineProperties(AbortController.prototype, { + signal: { + enumerable: true + }, + abort: { + enumerable: true + } + }); + + if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") { + Object.defineProperty(AbortController.prototype, Symbol.toStringTag, { + configurable: true, + value: "AbortController" + }); + } + + exports.AbortController = AbortController; + exports.AbortSignal = AbortSignal; + exports.default = AbortController; + module.exports = AbortController; + module.exports.AbortController = module.exports["default"] = AbortController; + module.exports.AbortSignal = AbortSignal; +},117,[16,14,12,7,8,96]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + if (!global.alert) { + global.alert = function (text) { + _$$_REQUIRE(_dependencyMap[0]).alert('Alert', '' + text); + }; + } +},118,[119]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _RCTAlertManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var Alert = function () { + function Alert() { + (0, _classCallCheck2.default)(this, Alert); + } + + (0, _createClass2.default)(Alert, null, [{ + key: "alert", + value: function alert(title, message, buttons, options) { + if (_Platform.default.OS === 'ios') { + Alert.prompt(title, message, buttons, 'default'); + } else if (_Platform.default.OS === 'android') { + var NativeDialogManagerAndroid = _$$_REQUIRE(_dependencyMap[5]).default; + + if (!NativeDialogManagerAndroid) { + return; + } + + var constants = NativeDialogManagerAndroid.getConstants(); + var config = { + title: title || '', + message: message || '', + cancelable: false + }; + + if (options && options.cancelable) { + config.cancelable = options.cancelable; + } + + var defaultPositiveText = 'OK'; + var validButtons = buttons ? buttons.slice(0, 3) : [{ + text: defaultPositiveText + }]; + var buttonPositive = validButtons.pop(); + var buttonNegative = validButtons.pop(); + var buttonNeutral = validButtons.pop(); + + if (buttonNeutral) { + config.buttonNeutral = buttonNeutral.text || ''; + } + + if (buttonNegative) { + config.buttonNegative = buttonNegative.text || ''; + } + + if (buttonPositive) { + config.buttonPositive = buttonPositive.text || defaultPositiveText; + } + + var onAction = function onAction(action, buttonKey) { + if (action === constants.buttonClicked) { + if (buttonKey === constants.buttonNeutral) { + buttonNeutral.onPress && buttonNeutral.onPress(); + } else if (buttonKey === constants.buttonNegative) { + buttonNegative.onPress && buttonNegative.onPress(); + } else if (buttonKey === constants.buttonPositive) { + buttonPositive.onPress && buttonPositive.onPress(); + } + } else if (action === constants.dismissed) { + options && options.onDismiss && options.onDismiss(); + } + }; + + var onError = function onError(errorMessage) { + return console.warn(errorMessage); + }; + + NativeDialogManagerAndroid.showAlert(config, onError, onAction); + } + } + }, { + key: "prompt", + value: function prompt(title, message, callbackOrButtons) { + var type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'plain-text'; + var defaultValue = arguments.length > 4 ? arguments[4] : undefined; + var keyboardType = arguments.length > 5 ? arguments[5] : undefined; + + if (_Platform.default.OS === 'ios') { + var callbacks = []; + var buttons = []; + var cancelButtonKey; + var destructiveButtonKey; + + if (typeof callbackOrButtons === 'function') { + callbacks = [callbackOrButtons]; + } else if (Array.isArray(callbackOrButtons)) { + callbackOrButtons.forEach(function (btn, index) { + callbacks[index] = btn.onPress; + + if (btn.style === 'cancel') { + cancelButtonKey = String(index); + } else if (btn.style === 'destructive') { + destructiveButtonKey = String(index); + } + + if (btn.text || index < (callbackOrButtons || []).length - 1) { + var btnDef = {}; + btnDef[index] = btn.text || ''; + buttons.push(btnDef); + } + }); + } + + _RCTAlertManager.default.alertWithArgs({ + title: title || '', + message: message || undefined, + buttons: buttons, + type: type || undefined, + defaultValue: defaultValue, + cancelButtonKey: cancelButtonKey, + destructiveButtonKey: destructiveButtonKey, + keyboardType: keyboardType + }, function (id, value) { + var cb = callbacks[id]; + cb && cb(value); + }); + } + } + }]); + return Alert; + }(); + + module.exports = Alert; +},119,[5,7,8,37,120,122]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeAlertManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + module.exports = { + alertWithArgs: function alertWithArgs(args, callback) { + if (_NativeAlertManager.default == null) { + return; + } + + _NativeAlertManager.default.alertWithArgs(args, callback); + } + }; +},120,[5,121]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('AlertManager'); + + exports.default = _default; +},121,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('DialogManagerAndroid'); + + exports.default = _default; +},122,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var navigator = global.navigator; + + if (navigator === undefined) { + global.navigator = navigator = {}; + } + + _$$_REQUIRE(_dependencyMap[0]).polyfillObjectProperty(navigator, 'product', function () { + return 'ReactNative'; + }); +},123,[72]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var registerModule; + + if (global.RN$Bridgeless === true && global.RN$registerCallableModule) { + registerModule = global.RN$registerCallableModule; + } else { + var BatchedBridge = _$$_REQUIRE(_dependencyMap[0]); + + registerModule = function registerModule(moduleName, factory) { + return BatchedBridge.registerLazyCallableModule(moduleName, factory); + }; + } + + registerModule('Systrace', function () { + return _$$_REQUIRE(_dependencyMap[1]); + }); + registerModule('JSTimers', function () { + return _$$_REQUIRE(_dependencyMap[2]); + }); + registerModule('HeapCapture', function () { + return _$$_REQUIRE(_dependencyMap[3]); + }); + registerModule('SamplingProfiler', function () { + return _$$_REQUIRE(_dependencyMap[4]); + }); + registerModule('RCTLog', function () { + return _$$_REQUIRE(_dependencyMap[5]); + }); + registerModule('RCTDeviceEventEmitter', function () { + return _$$_REQUIRE(_dependencyMap[6]).default; + }); + registerModule('RCTNativeAppEventEmitter', function () { + return _$$_REQUIRE(_dependencyMap[7]); + }); + registerModule('GlobalPerformanceLogger', function () { + return _$$_REQUIRE(_dependencyMap[8]); + }); + registerModule('JSDevSupportModule', function () { + return _$$_REQUIRE(_dependencyMap[9]); + }); + { + registerModule('HMRClient', function () { + return _$$_REQUIRE(_dependencyMap[10]); + }); + } +},124,[45,47,84,125,127,129,30,130,97,131,133]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeJSCHeapCapture = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var HeapCapture = { + captureHeap: function captureHeap(path) { + var error = null; + + try { + global.nativeCaptureHeap(path); + } catch (e) { + error = e.toString(); + } + + if (_NativeJSCHeapCapture.default) { + _NativeJSCHeapCapture.default.captureComplete(path, error); + } + } + }; + module.exports = HeapCapture; +},125,[5,126]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('JSCHeapCapture'); + + exports.default = _default; +},126,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var SamplingProfiler = { + poke: function poke(token) { + var error = null; + var result = null; + + try { + result = global.pokeSamplingProfiler(); + + if (result === null) {} else {} + } catch (e) { + error = e.toString(); + } + + var NativeJSCSamplingProfiler = _$$_REQUIRE(_dependencyMap[0]).default; + + if (NativeJSCSamplingProfiler) { + NativeJSCSamplingProfiler.operationComplete(token, result, error); + } + } + }; + module.exports = SamplingProfiler; +},127,[128]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('JSCSamplingProfiler'); + + exports.default = _default; +},128,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var levelsMap = { + log: 'log', + info: 'info', + warn: 'warn', + error: 'error', + fatal: 'error' + }; + var warningHandler = null; + var RCTLog = { + logIfNoNativeHook: function logIfNoNativeHook(level) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + if (typeof global.nativeLoggingHook === 'undefined') { + RCTLog.logToConsole.apply(RCTLog, [level].concat(args)); + } else { + if (warningHandler && level === 'warn') { + warningHandler.apply(undefined, args); + } + } + }, + logToConsole: function logToConsole(level) { + var logFn = levelsMap[level]; + + _$$_REQUIRE(_dependencyMap[0])(logFn, 'Level "' + level + '" not one of ' + Object.keys(levelsMap).toString()); + + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + }, + setWarningHandler: function setWarningHandler(handler) { + warningHandler = handler; + } + }; + module.exports = RCTLog; +},129,[36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var RCTNativeAppEventEmitter = _RCTDeviceEventEmitter.default; + module.exports = RCTNativeAppEventEmitter; +},130,[5,30]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeJSDevSupport = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var JSDevSupportModule = { + getJSHierarchy: function getJSHierarchy(tag) { + if (_NativeJSDevSupport.default) { + var constants = _NativeJSDevSupport.default.getConstants(); + + try { + var computeComponentStackForErrorReporting = _$$_REQUIRE(_dependencyMap[2]).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.computeComponentStackForErrorReporting; + + var componentStack = computeComponentStackForErrorReporting(tag); + + if (!componentStack) { + _NativeJSDevSupport.default.onFailure(constants.ERROR_CODE_VIEW_NOT_FOUND, "Component stack doesn't exist for tag " + tag); + } else { + _NativeJSDevSupport.default.onSuccess(componentStack); + } + } catch (e) { + _NativeJSDevSupport.default.onFailure(constants.ERROR_CODE_EXCEPTION, e.message); + } + } + } + }; + module.exports = JSDevSupportModule; +},131,[5,132,54]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('JSDevSupport'); + + exports.default = _default; +},132,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var HMRClientProdShim = { + setup: function setup() {}, + enable: function enable() { + console.error("Fast Refresh is disabled in JavaScript bundles built in production mode. Did you forget to run Metro?"); + }, + disable: function disable() {}, + registerBundle: function registerBundle() {}, + log: function log() {} + }; + module.exports = HMRClientProdShim; +},133,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function __fetchSegment(segmentId, options, callback) { + var SegmentFetcher = _$$_REQUIRE(_dependencyMap[0]).default; + + SegmentFetcher.fetchSegment(segmentId, options, function (errorObject) { + if (errorObject) { + var error = new Error(errorObject.message); + error.code = errorObject.code; + callback(error); + } + + callback(null); + }); + } + + global.__fetchSegment = __fetchSegment; + + function __getSegment(segmentId, options, callback) { + var SegmentFetcher = _$$_REQUIRE(_dependencyMap[0]).default; + + if (!SegmentFetcher.getSegment) { + throw new Error('SegmentFetcher.getSegment must be defined'); + } + + SegmentFetcher.getSegment(segmentId, options, function (errorObject, path) { + if (errorObject) { + var error = new Error(errorObject.message); + error.code = errorObject.code; + callback(error); + } + + callback(null, path); + }); + } + + global.__getSegment = __getSegment; +},134,[135]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('SegmentFetcher'); + + exports.default = _default; +},135,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = { + get BatchedBridge() { + return _$$_REQUIRE(_dependencyMap[0]); + }, + + get ExceptionsManager() { + return _$$_REQUIRE(_dependencyMap[1]); + }, + + get Platform() { + return _$$_REQUIRE(_dependencyMap[2]); + }, + + get RCTEventEmitter() { + return _$$_REQUIRE(_dependencyMap[3]); + }, + + get ReactNativeViewConfigRegistry() { + return _$$_REQUIRE(_dependencyMap[4]); + }, + + get TextInputState() { + return _$$_REQUIRE(_dependencyMap[5]); + }, + + get UIManager() { + return _$$_REQUIRE(_dependencyMap[6]); + }, + + get deepDiffer() { + return _$$_REQUIRE(_dependencyMap[7]); + }, + + get deepFreezeAndThrowOnMutationInDev() { + return _$$_REQUIRE(_dependencyMap[8]); + }, + + get flattenStyle() { + return _$$_REQUIRE(_dependencyMap[9]); + }, + + get ReactFiberErrorDialog() { + return _$$_REQUIRE(_dependencyMap[10]).default; + }, + + get legacySendAccessibilityEvent() { + return _$$_REQUIRE(_dependencyMap[11]); + } + + }; +},136,[45,62,37,137,138,139,155,176,177,178,179,53]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var RCTEventEmitter = { + register: function register(eventEmitter) { + if (global.RN$Bridgeless) { + global.RN$registerCallableModule('RCTEventEmitter', function () { + return eventEmitter; + }); + } else { + _$$_REQUIRE(_dependencyMap[0]).registerCallableModule('RCTEventEmitter', eventEmitter); + } + } + }; + module.exports = RCTEventEmitter; +},137,[45]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var customBubblingEventTypes = {}; + var customDirectEventTypes = {}; + exports.customBubblingEventTypes = customBubblingEventTypes; + exports.customDirectEventTypes = customDirectEventTypes; + var viewConfigCallbacks = new Map(); + var viewConfigs = new Map(); + + function processEventTypes(viewConfig) { + var bubblingEventTypes = viewConfig.bubblingEventTypes, + directEventTypes = viewConfig.directEventTypes; + + if (bubblingEventTypes != null) { + for (var _topLevelType in bubblingEventTypes) { + if (customBubblingEventTypes[_topLevelType] == null) { + customBubblingEventTypes[_topLevelType] = bubblingEventTypes[_topLevelType]; + } + } + } + + if (directEventTypes != null) { + for (var _topLevelType2 in directEventTypes) { + if (customDirectEventTypes[_topLevelType2] == null) { + customDirectEventTypes[_topLevelType2] = directEventTypes[_topLevelType2]; + } + } + } + } + + exports.register = function (name, callback) { + (0, _invariant.default)(!viewConfigCallbacks.has(name), 'Tried to register two views with the same name %s', name); + (0, _invariant.default)(typeof callback === 'function', 'View config getter callback for component `%s` must be a function (received `%s`)', name, callback === null ? 'null' : typeof callback); + viewConfigCallbacks.set(name, callback); + return name; + }; + + exports.get = function (name) { + var viewConfig; + + if (!viewConfigs.has(name)) { + var callback = viewConfigCallbacks.get(name); + + if (typeof callback !== 'function') { + (0, _invariant.default)(false, 'View config getter callback for component `%s` must be a function (received `%s`).%s', name, callback === null ? 'null' : typeof callback, typeof name[0] === 'string' && /[a-z]/.test(name[0]) ? ' Make sure to start component names with a capital letter.' : ''); + } + + viewConfig = callback(); + processEventTypes(viewConfig); + viewConfigs.set(name, viewConfig); + viewConfigCallbacks.set(name, null); + } else { + viewConfig = viewConfigs.get(name); + } + + (0, _invariant.default)(viewConfig, 'View config not found for name %s', name); + return viewConfig; + }; +},138,[5,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var React = _$$_REQUIRE(_dependencyMap[0]); + + var currentlyFocusedInputRef = null; + var inputs = new Set(); + + function currentlyFocusedInput() { + return currentlyFocusedInputRef; + } + + function currentlyFocusedField() { + return _$$_REQUIRE(_dependencyMap[1]).findNodeHandle(currentlyFocusedInputRef); + } + + function focusInput(textField) { + if (currentlyFocusedInputRef !== textField && textField != null) { + currentlyFocusedInputRef = textField; + } + } + + function blurInput(textField) { + if (currentlyFocusedInputRef === textField && textField != null) { + currentlyFocusedInputRef = null; + } + } + + function focusField(textFieldID) { + return; + } + + function blurField(textFieldID) { + return; + } + + function focusTextInput(textField) { + if (typeof textField === 'number') { + return; + } + + if (currentlyFocusedInputRef !== textField && textField != null) { + focusInput(textField); + { + _$$_REQUIRE(_dependencyMap[2]).Commands.focus(textField); + } + } + } + + function blurTextInput(textField) { + if (typeof textField === 'number') { + return; + } + + if (currentlyFocusedInputRef === textField && textField != null) { + blurInput(textField); + { + _$$_REQUIRE(_dependencyMap[2]).Commands.blur(textField); + } + } + } + + function registerInput(textField) { + if (typeof textField === 'number') { + return; + } + + inputs.add(textField); + } + + function unregisterInput(textField) { + if (typeof textField === 'number') { + return; + } + + inputs.delete(textField); + } + + function isTextInput(textField) { + if (typeof textField === 'number') { + return false; + } + + return inputs.has(textField); + } + + module.exports = { + currentlyFocusedInput: currentlyFocusedInput, + focusInput: focusInput, + blurInput: blurInput, + currentlyFocusedField: currentlyFocusedField, + focusField: focusField, + blurField: blurField, + focusTextInput: focusTextInput, + blurTextInput: blurTextInput, + registerInput: registerInput, + unregisterInput: unregisterInput, + isTextInput: isTextInput + }; +},139,[17,54,140]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _RCTTextInputViewConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['focus', 'blur', 'setTextAndSelection'] + }); + exports.Commands = Commands; + var SinglelineTextInputNativeComponent = NativeComponentRegistry.get('RCTSinglelineTextInputView', function () { + return _RCTTextInputViewConfig.default; + }); + var _default = SinglelineTextInputNativeComponent; + exports.default = _default; +},140,[5,141,142,154]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + function codegenNativeCommands(options) { + var commandObj = {}; + options.supportedCommands.forEach(function (command) { + commandObj[command] = function (ref) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (0, _$$_REQUIRE(_dependencyMap[0]).dispatchCommand)(ref, command, args); + }; + }); + return commandObj; + } + + var _default = codegenNativeCommands; + exports.default = _default; +},141,[54]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReactNativeViewViewConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var RCTTextInputViewConfig = { + uiViewClassName: 'RCTSinglelineTextInputView', + bubblingEventTypes: { + topBlur: { + phasedRegistrationNames: { + bubbled: 'onBlur', + captured: 'onBlurCapture' + } + }, + topChange: { + phasedRegistrationNames: { + bubbled: 'onChange', + captured: 'onChangeCapture' + } + }, + topEndEditing: { + phasedRegistrationNames: { + bubbled: 'onEndEditing', + captured: 'onEndEditingCapture' + } + }, + topFocus: { + phasedRegistrationNames: { + bubbled: 'onFocus', + captured: 'onFocusCapture' + } + }, + topKeyPress: { + phasedRegistrationNames: { + bubbled: 'onKeyPress', + captured: 'onKeyPressCapture' + } + }, + topSubmitEditing: { + phasedRegistrationNames: { + bubbled: 'onSubmitEditing', + captured: 'onSubmitEditingCapture' + } + }, + topTouchCancel: { + phasedRegistrationNames: { + bubbled: 'onTouchCancel', + captured: 'onTouchCancelCapture' + } + }, + topTouchEnd: { + phasedRegistrationNames: { + bubbled: 'onTouchEnd', + captured: 'onTouchEndCapture' + } + }, + topTouchMove: { + phasedRegistrationNames: { + bubbled: 'onTouchMove', + captured: 'onTouchMoveCapture' + } + } + }, + directEventTypes: {}, + validAttributes: (0, _extends2.default)({}, _ReactNativeViewViewConfig.default.validAttributes, { + fontSize: true, + fontWeight: true, + fontVariant: true, + textShadowOffset: { + diff: _$$_REQUIRE(_dependencyMap[3]) + }, + allowFontScaling: true, + fontStyle: true, + textTransform: true, + textAlign: true, + fontFamily: true, + lineHeight: true, + isHighlighted: true, + writingDirection: true, + textDecorationLine: true, + textShadowRadius: true, + letterSpacing: true, + textDecorationStyle: true, + textDecorationColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + color: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + maxFontSizeMultiplier: true, + textShadowColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + editable: true, + inputAccessoryViewID: true, + caretHidden: true, + enablesReturnKeyAutomatically: true, + placeholderTextColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + onSelectionChange: true, + clearButtonMode: true, + onContentSizeChange: true, + keyboardType: true, + selection: true, + returnKeyType: true, + blurOnSubmit: true, + mostRecentEventCount: true, + onChange: true, + scrollEnabled: true, + selectionColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + contextMenuHidden: true, + secureTextEntry: true, + onTextInput: true, + placeholder: true, + autoCorrect: true, + onScroll: true, + multiline: true, + textContentType: true, + maxLength: true, + autoCapitalize: true, + keyboardAppearance: true, + passwordRules: true, + spellCheck: true, + selectTextOnFocus: true, + text: true, + clearTextOnFocus: true + }) + }; + module.exports = RCTTextInputViewConfig; +},142,[5,6,143,150,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReactNativeViewViewConfigAndroid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var ReactNativeViewConfig = { + uiViewClassName: 'RCTView', + baseModuleName: null, + Manager: 'ViewManager', + Commands: {}, + Constants: {}, + bubblingEventTypes: (0, _extends2.default)({}, _ReactNativeViewViewConfigAndroid.default.bubblingEventTypes, { + topBlur: { + phasedRegistrationNames: { + bubbled: 'onBlur', + captured: 'onBlurCapture' + } + }, + topChange: { + phasedRegistrationNames: { + bubbled: 'onChange', + captured: 'onChangeCapture' + } + }, + topEndEditing: { + phasedRegistrationNames: { + bubbled: 'onEndEditing', + captured: 'onEndEditingCapture' + } + }, + topFocus: { + phasedRegistrationNames: { + bubbled: 'onFocus', + captured: 'onFocusCapture' + } + }, + topKeyPress: { + phasedRegistrationNames: { + bubbled: 'onKeyPress', + captured: 'onKeyPressCapture' + } + }, + topPress: { + phasedRegistrationNames: { + bubbled: 'onPress', + captured: 'onPressCapture' + } + }, + topSubmitEditing: { + phasedRegistrationNames: { + bubbled: 'onSubmitEditing', + captured: 'onSubmitEditingCapture' + } + }, + topTouchCancel: { + phasedRegistrationNames: { + bubbled: 'onTouchCancel', + captured: 'onTouchCancelCapture' + } + }, + topTouchEnd: { + phasedRegistrationNames: { + bubbled: 'onTouchEnd', + captured: 'onTouchEndCapture' + } + }, + topTouchMove: { + phasedRegistrationNames: { + bubbled: 'onTouchMove', + captured: 'onTouchMoveCapture' + } + }, + topTouchStart: { + phasedRegistrationNames: { + bubbled: 'onTouchStart', + captured: 'onTouchStartCapture' + } + } + }), + directEventTypes: (0, _extends2.default)({}, _ReactNativeViewViewConfigAndroid.default.directEventTypes, { + topAccessibilityAction: { + registrationName: 'onAccessibilityAction' + }, + topAccessibilityEscape: { + registrationName: 'onAccessibilityEscape' + }, + topAccessibilityTap: { + registrationName: 'onAccessibilityTap' + }, + topLayout: { + registrationName: 'onLayout' + }, + topMagicTap: { + registrationName: 'onMagicTap' + }, + onGestureHandlerEvent: { + registrationName: 'onGestureHandlerEvent' + }, + onGestureHandlerStateChange: { + registrationName: 'onGestureHandlerStateChange' + } + }), + validAttributes: (0, _extends2.default)({}, _ReactNativeViewViewConfigAndroid.default.validAttributes, { + accessibilityActions: true, + accessibilityElementsHidden: true, + accessibilityHint: true, + accessibilityIgnoresInvertColors: true, + accessibilityLabel: true, + accessibilityLiveRegion: true, + accessibilityRole: true, + accessibilityStates: true, + accessibilityState: true, + accessibilityValue: true, + accessibilityViewIsModal: true, + accessible: true, + alignContent: true, + alignItems: true, + alignSelf: true, + aspectRatio: true, + backfaceVisibility: true, + backgroundColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderBottomColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderBottomEndRadius: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderBottomStartRadius: true, + borderBottomWidth: true, + borderColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderEndColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderEndWidth: true, + borderLeftColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderLeftWidth: true, + borderRadius: true, + borderRightColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderRightWidth: true, + borderStartColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderStartWidth: true, + borderStyle: true, + borderTopColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderTopEndRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderTopStartRadius: true, + borderTopWidth: true, + borderWidth: true, + bottom: true, + clickable: true, + collapsable: true, + direction: true, + display: true, + elevation: true, + end: true, + flex: true, + flexBasis: true, + flexDirection: true, + flexGrow: true, + flexShrink: true, + flexWrap: true, + height: true, + hitSlop: { + diff: _$$_REQUIRE(_dependencyMap[5]) + }, + importantForAccessibility: true, + justifyContent: true, + left: true, + margin: true, + marginBottom: true, + marginEnd: true, + marginHorizontal: true, + marginLeft: true, + marginRight: true, + marginStart: true, + marginTop: true, + marginVertical: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + nativeID: true, + needsOffscreenAlphaCompositing: true, + onAccessibilityAction: true, + onAccessibilityEscape: true, + onAccessibilityTap: true, + onLayout: true, + onMagicTap: true, + opacity: true, + overflow: true, + padding: true, + paddingBottom: true, + paddingEnd: true, + paddingHorizontal: true, + paddingLeft: true, + paddingRight: true, + paddingStart: true, + paddingTop: true, + paddingVertical: true, + pointerEvents: true, + position: true, + removeClippedSubviews: true, + renderToHardwareTextureAndroid: true, + right: true, + rotation: true, + scaleX: true, + scaleY: true, + shadowColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + shadowOffset: { + diff: _$$_REQUIRE(_dependencyMap[6]) + }, + shadowOpacity: true, + shadowRadius: true, + shouldRasterizeIOS: true, + start: true, + style: { + alignContent: true, + alignItems: true, + alignSelf: true, + aspectRatio: true, + backfaceVisibility: true, + backgroundColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderBottomColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderBottomEndRadius: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderBottomStartRadius: true, + borderBottomWidth: true, + borderColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderEndColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderEndWidth: true, + borderLeftColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderLeftWidth: true, + borderRadius: true, + borderRightColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderRightWidth: true, + borderStartColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderStartWidth: true, + borderStyle: true, + borderTopColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + borderTopEndRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderTopStartRadius: true, + borderTopWidth: true, + borderWidth: true, + bottom: true, + color: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + decomposedMatrix: true, + direction: true, + display: true, + elevation: true, + end: true, + flex: true, + flexBasis: true, + flexDirection: true, + flexGrow: true, + flexShrink: true, + flexWrap: true, + fontFamily: true, + fontSize: true, + fontStyle: true, + fontVariant: true, + fontWeight: true, + height: true, + includeFontPadding: true, + justifyContent: true, + left: true, + letterSpacing: true, + lineHeight: true, + margin: true, + marginBottom: true, + marginEnd: true, + marginHorizontal: true, + marginLeft: true, + marginRight: true, + marginStart: true, + marginTop: true, + marginVertical: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + opacity: true, + overflow: true, + overlayColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + padding: true, + paddingBottom: true, + paddingEnd: true, + paddingHorizontal: true, + paddingLeft: true, + paddingRight: true, + paddingStart: true, + paddingTop: true, + paddingVertical: true, + position: true, + resizeMode: true, + right: true, + rotation: true, + scaleX: true, + scaleY: true, + shadowColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + shadowOffset: { + diff: _$$_REQUIRE(_dependencyMap[6]) + }, + shadowOpacity: true, + shadowRadius: true, + start: true, + textAlign: true, + textAlignVertical: true, + textDecorationColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + textDecorationLine: true, + textDecorationStyle: true, + textShadowColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + textShadowOffset: true, + textShadowRadius: true, + textTransform: true, + tintColor: { + process: _$$_REQUIRE(_dependencyMap[4]) + }, + top: true, + transform: _reactNative.Platform.OS === 'ios' ? { + diff: _$$_REQUIRE(_dependencyMap[7]) + } : { + process: _$$_REQUIRE(_dependencyMap[8]) + }, + transformMatrix: true, + translateX: true, + translateY: true, + width: true, + writingDirection: true, + zIndex: true + }, + testID: true, + top: true, + transform: _reactNative.Platform.OS === 'ios' ? { + diff: _$$_REQUIRE(_dependencyMap[7]) + } : { + process: _$$_REQUIRE(_dependencyMap[8]) + }, + translateX: true, + translateY: true, + width: true, + zIndex: true + }) + }; + module.exports = ReactNativeViewConfig; +},143,[5,6,144,28,145,149,150,151,152]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ReactNativeViewViewConfigAndroid = { + uiViewClassName: 'RCTView', + bubblingEventTypes: { + topSelect: { + phasedRegistrationNames: { + bubbled: 'onSelect', + captured: 'onSelectCapture' + } + }, + topAssetDidLoad: { + phasedRegistrationNames: { + bubbled: 'onAssetDidLoad', + captured: 'onAssetDidLoadCapture' + } + } + }, + directEventTypes: { + topClick: { + registrationName: 'onClick' + }, + topContentSizeChange: { + registrationName: 'onContentSizeChange' + }, + topLoadingError: { + registrationName: 'onLoadingError' + }, + topLoadingFinish: { + registrationName: 'onLoadingFinish' + }, + topLoadingStart: { + registrationName: 'onLoadingStart' + }, + topMessage: { + registrationName: 'onMessage' + }, + topMomentumScrollBegin: { + registrationName: 'onMomentumScrollBegin' + }, + topMomentumScrollEnd: { + registrationName: 'onMomentumScrollEnd' + }, + topScroll: { + registrationName: 'onScroll' + }, + topScrollBeginDrag: { + registrationName: 'onScrollBeginDrag' + }, + topScrollEndDrag: { + registrationName: 'onScrollEndDrag' + }, + topSelectionChange: { + registrationName: 'onSelectionChange' + }, + onAssetDidLoad: { + registrationName: 'onAssetDidLoad' + } + }, + validAttributes: { + hasTVPreferredFocus: true, + focusable: true, + nativeBackgroundAndroid: true, + nativeForegroundAndroid: true, + nextFocusDown: true, + nextFocusForward: true, + nextFocusLeft: true, + nextFocusRight: true, + nextFocusUp: true + } + }; + module.exports = ReactNativeViewViewConfigAndroid; +},144,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function processColor(color) { + if (color === undefined || color === null) { + return color; + } + + var normalizedColor = _$$_REQUIRE(_dependencyMap[0])(color); + + if (normalizedColor === null || normalizedColor === undefined) { + return undefined; + } + + if (typeof normalizedColor === 'object') { + var processColorObject = _$$_REQUIRE(_dependencyMap[1]).processColorObject; + + var processedColorObj = processColorObject(normalizedColor); + + if (processedColorObj != null) { + return processedColorObj; + } + } + + if (typeof normalizedColor !== 'number') { + return null; + } + + normalizedColor = (normalizedColor << 24 | normalizedColor >>> 8) >>> 0; + return normalizedColor; + } + + module.exports = processColor; +},145,[146,148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _normalizeColor2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function normalizeColor(color) { + if (typeof color === 'object' && color != null) { + var _require = _$$_REQUIRE(_dependencyMap[2]), + normalizeColorObject = _require.normalizeColorObject; + + var normalizedColor = normalizeColorObject(color); + + if (normalizedColor != null) { + return color; + } + } + + if (typeof color === 'string' || typeof color === 'number') { + return (0, _normalizeColor2.default)(color); + } + } + + module.exports = normalizeColor; +},146,[5,147,148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function normalizeColor(color) { + if (typeof color === 'number') { + if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) { + return color; + } + + return null; + } + + if (typeof color !== 'string') { + return null; + } + + var matchers = getMatchers(); + var match; + + if (match = matchers.hex6.exec(color)) { + return parseInt(match[1] + 'ff', 16) >>> 0; + } + + var colorFromKeyword = normalizeKeyword(color); + + if (colorFromKeyword != null) { + return colorFromKeyword; + } + + if (match = matchers.rgb.exec(color)) { + return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | 0x000000ff) >>> 0; + } + + if (match = matchers.rgba.exec(color)) { + return (parse255(match[1]) << 24 | parse255(match[2]) << 16 | parse255(match[3]) << 8 | parse1(match[4])) >>> 0; + } + + if (match = matchers.hex3.exec(color)) { + return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + 'ff', 16) >>> 0; + } + + if (match = matchers.hex8.exec(color)) { + return parseInt(match[1], 16) >>> 0; + } + + if (match = matchers.hex4.exec(color)) { + return parseInt(match[1] + match[1] + match[2] + match[2] + match[3] + match[3] + match[4] + match[4], 16) >>> 0; + } + + if (match = matchers.hsl.exec(color)) { + return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | 0x000000ff) >>> 0; + } + + if (match = matchers.hsla.exec(color)) { + return (hslToRgb(parse360(match[1]), parsePercentage(match[2]), parsePercentage(match[3])) | parse1(match[4])) >>> 0; + } + + return null; + } + + function hue2rgb(p, q, t) { + if (t < 0) { + t += 1; + } + + if (t > 1) { + t -= 1; + } + + if (t < 0.16666666666666666) { + return p + (q - p) * 6 * t; + } + + if (t < 0.5) { + return q; + } + + if (t < 0.6666666666666666) { + return p + (q - p) * (0.6666666666666666 - t) * 6; + } + + return p; + } + + function hslToRgb(h, s, l) { + var q = l < 0.5 ? l * (1 + s) : l + s - l * s; + var p = 2 * l - q; + var r = hue2rgb(p, q, h + 0.3333333333333333); + var g = hue2rgb(p, q, h); + var b = hue2rgb(p, q, h - 0.3333333333333333); + return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8; + } + + var NUMBER = '[-+]?\\d*\\.?\\d+'; + var PERCENTAGE = "[-+]?\\d*\\.?\\d+%"; + + function call() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return '\\(\\s*(' + args.join(')\\s*,\\s*(') + ')\\s*\\)'; + } + + var cachedMatchers; + + function getMatchers() { + if (cachedMatchers === undefined) { + cachedMatchers = { + rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)), + rgba: new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)), + hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)), + hsla: new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)), + hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, + hex6: /^#([0-9a-fA-F]{6})$/, + hex8: /^#([0-9a-fA-F]{8})$/ + }; + } + + return cachedMatchers; + } + + function parse255(str) { + var int = parseInt(str, 10); + + if (int < 0) { + return 0; + } + + if (int > 255) { + return 255; + } + + return int; + } + + function parse360(str) { + var int = parseFloat(str); + return (int % 360 + 360) % 360 / 360; + } + + function parse1(str) { + var num = parseFloat(str); + + if (num < 0) { + return 0; + } + + if (num > 1) { + return 255; + } + + return Math.round(num * 255); + } + + function parsePercentage(str) { + var int = parseFloat(str); + + if (int < 0) { + return 0; + } + + if (int > 100) { + return 1; + } + + return int / 100; + } + + function normalizeKeyword(name) { + switch (name) { + case 'transparent': + return 0x00000000; + + case 'aliceblue': + return 0xf0f8ffff; + + case 'antiquewhite': + return 0xfaebd7ff; + + case 'aqua': + return 0x00ffffff; + + case 'aquamarine': + return 0x7fffd4ff; + + case 'azure': + return 0xf0ffffff; + + case 'beige': + return 0xf5f5dcff; + + case 'bisque': + return 0xffe4c4ff; + + case 'black': + return 0x000000ff; + + case 'blanchedalmond': + return 0xffebcdff; + + case 'blue': + return 0x0000ffff; + + case 'blueviolet': + return 0x8a2be2ff; + + case 'brown': + return 0xa52a2aff; + + case 'burlywood': + return 0xdeb887ff; + + case 'burntsienna': + return 0xea7e5dff; + + case 'cadetblue': + return 0x5f9ea0ff; + + case 'chartreuse': + return 0x7fff00ff; + + case 'chocolate': + return 0xd2691eff; + + case 'coral': + return 0xff7f50ff; + + case 'cornflowerblue': + return 0x6495edff; + + case 'cornsilk': + return 0xfff8dcff; + + case 'crimson': + return 0xdc143cff; + + case 'cyan': + return 0x00ffffff; + + case 'darkblue': + return 0x00008bff; + + case 'darkcyan': + return 0x008b8bff; + + case 'darkgoldenrod': + return 0xb8860bff; + + case 'darkgray': + return 0xa9a9a9ff; + + case 'darkgreen': + return 0x006400ff; + + case 'darkgrey': + return 0xa9a9a9ff; + + case 'darkkhaki': + return 0xbdb76bff; + + case 'darkmagenta': + return 0x8b008bff; + + case 'darkolivegreen': + return 0x556b2fff; + + case 'darkorange': + return 0xff8c00ff; + + case 'darkorchid': + return 0x9932ccff; + + case 'darkred': + return 0x8b0000ff; + + case 'darksalmon': + return 0xe9967aff; + + case 'darkseagreen': + return 0x8fbc8fff; + + case 'darkslateblue': + return 0x483d8bff; + + case 'darkslategray': + return 0x2f4f4fff; + + case 'darkslategrey': + return 0x2f4f4fff; + + case 'darkturquoise': + return 0x00ced1ff; + + case 'darkviolet': + return 0x9400d3ff; + + case 'deeppink': + return 0xff1493ff; + + case 'deepskyblue': + return 0x00bfffff; + + case 'dimgray': + return 0x696969ff; + + case 'dimgrey': + return 0x696969ff; + + case 'dodgerblue': + return 0x1e90ffff; + + case 'firebrick': + return 0xb22222ff; + + case 'floralwhite': + return 0xfffaf0ff; + + case 'forestgreen': + return 0x228b22ff; + + case 'fuchsia': + return 0xff00ffff; + + case 'gainsboro': + return 0xdcdcdcff; + + case 'ghostwhite': + return 0xf8f8ffff; + + case 'gold': + return 0xffd700ff; + + case 'goldenrod': + return 0xdaa520ff; + + case 'gray': + return 0x808080ff; + + case 'green': + return 0x008000ff; + + case 'greenyellow': + return 0xadff2fff; + + case 'grey': + return 0x808080ff; + + case 'honeydew': + return 0xf0fff0ff; + + case 'hotpink': + return 0xff69b4ff; + + case 'indianred': + return 0xcd5c5cff; + + case 'indigo': + return 0x4b0082ff; + + case 'ivory': + return 0xfffff0ff; + + case 'khaki': + return 0xf0e68cff; + + case 'lavender': + return 0xe6e6faff; + + case 'lavenderblush': + return 0xfff0f5ff; + + case 'lawngreen': + return 0x7cfc00ff; + + case 'lemonchiffon': + return 0xfffacdff; + + case 'lightblue': + return 0xadd8e6ff; + + case 'lightcoral': + return 0xf08080ff; + + case 'lightcyan': + return 0xe0ffffff; + + case 'lightgoldenrodyellow': + return 0xfafad2ff; + + case 'lightgray': + return 0xd3d3d3ff; + + case 'lightgreen': + return 0x90ee90ff; + + case 'lightgrey': + return 0xd3d3d3ff; + + case 'lightpink': + return 0xffb6c1ff; + + case 'lightsalmon': + return 0xffa07aff; + + case 'lightseagreen': + return 0x20b2aaff; + + case 'lightskyblue': + return 0x87cefaff; + + case 'lightslategray': + return 0x778899ff; + + case 'lightslategrey': + return 0x778899ff; + + case 'lightsteelblue': + return 0xb0c4deff; + + case 'lightyellow': + return 0xffffe0ff; + + case 'lime': + return 0x00ff00ff; + + case 'limegreen': + return 0x32cd32ff; + + case 'linen': + return 0xfaf0e6ff; + + case 'magenta': + return 0xff00ffff; + + case 'maroon': + return 0x800000ff; + + case 'mediumaquamarine': + return 0x66cdaaff; + + case 'mediumblue': + return 0x0000cdff; + + case 'mediumorchid': + return 0xba55d3ff; + + case 'mediumpurple': + return 0x9370dbff; + + case 'mediumseagreen': + return 0x3cb371ff; + + case 'mediumslateblue': + return 0x7b68eeff; + + case 'mediumspringgreen': + return 0x00fa9aff; + + case 'mediumturquoise': + return 0x48d1ccff; + + case 'mediumvioletred': + return 0xc71585ff; + + case 'midnightblue': + return 0x191970ff; + + case 'mintcream': + return 0xf5fffaff; + + case 'mistyrose': + return 0xffe4e1ff; + + case 'moccasin': + return 0xffe4b5ff; + + case 'navajowhite': + return 0xffdeadff; + + case 'navy': + return 0x000080ff; + + case 'oldlace': + return 0xfdf5e6ff; + + case 'olive': + return 0x808000ff; + + case 'olivedrab': + return 0x6b8e23ff; + + case 'orange': + return 0xffa500ff; + + case 'orangered': + return 0xff4500ff; + + case 'orchid': + return 0xda70d6ff; + + case 'palegoldenrod': + return 0xeee8aaff; + + case 'palegreen': + return 0x98fb98ff; + + case 'paleturquoise': + return 0xafeeeeff; + + case 'palevioletred': + return 0xdb7093ff; + + case 'papayawhip': + return 0xffefd5ff; + + case 'peachpuff': + return 0xffdab9ff; + + case 'peru': + return 0xcd853fff; + + case 'pink': + return 0xffc0cbff; + + case 'plum': + return 0xdda0ddff; + + case 'powderblue': + return 0xb0e0e6ff; + + case 'purple': + return 0x800080ff; + + case 'rebeccapurple': + return 0x663399ff; + + case 'red': + return 0xff0000ff; + + case 'rosybrown': + return 0xbc8f8fff; + + case 'royalblue': + return 0x4169e1ff; + + case 'saddlebrown': + return 0x8b4513ff; + + case 'salmon': + return 0xfa8072ff; + + case 'sandybrown': + return 0xf4a460ff; + + case 'seagreen': + return 0x2e8b57ff; + + case 'seashell': + return 0xfff5eeff; + + case 'sienna': + return 0xa0522dff; + + case 'silver': + return 0xc0c0c0ff; + + case 'skyblue': + return 0x87ceebff; + + case 'slateblue': + return 0x6a5acdff; + + case 'slategray': + return 0x708090ff; + + case 'slategrey': + return 0x708090ff; + + case 'snow': + return 0xfffafaff; + + case 'springgreen': + return 0x00ff7fff; + + case 'steelblue': + return 0x4682b4ff; + + case 'tan': + return 0xd2b48cff; + + case 'teal': + return 0x008080ff; + + case 'thistle': + return 0xd8bfd8ff; + + case 'tomato': + return 0xff6347ff; + + case 'turquoise': + return 0x40e0d0ff; + + case 'violet': + return 0xee82eeff; + + case 'wheat': + return 0xf5deb3ff; + + case 'white': + return 0xffffffff; + + case 'whitesmoke': + return 0xf5f5f5ff; + + case 'yellow': + return 0xffff00ff; + + case 'yellowgreen': + return 0x9acd32ff; + } + + return null; + } + + module.exports = normalizeColor; +},147,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.processColorObject = exports.normalizeColorObject = exports.DynamicColorIOSPrivate = exports.PlatformColor = undefined; + + var PlatformColor = function PlatformColor() { + for (var _len = arguments.length, names = new Array(_len), _key = 0; _key < _len; _key++) { + names[_key] = arguments[_key]; + } + + return { + semantic: names + }; + }; + + exports.PlatformColor = PlatformColor; + + var DynamicColorIOSPrivate = function DynamicColorIOSPrivate(tuple) { + return { + dynamic: { + light: tuple.light, + dark: tuple.dark, + highContrastLight: tuple.highContrastLight, + highContrastDark: tuple.highContrastDark + } + }; + }; + + exports.DynamicColorIOSPrivate = DynamicColorIOSPrivate; + + var normalizeColorObject = function normalizeColorObject(color) { + if ('semantic' in color) { + return color; + } else if ('dynamic' in color && color.dynamic !== undefined) { + var normalizeColor = _$$_REQUIRE(_dependencyMap[0]); + + var dynamic = color.dynamic; + var dynamicColor = { + dynamic: { + light: normalizeColor(dynamic.light), + dark: normalizeColor(dynamic.dark), + highContrastLight: normalizeColor(dynamic.highContrastLight), + highContrastDark: normalizeColor(dynamic.highContrastDark) + } + }; + return dynamicColor; + } + + return null; + }; + + exports.normalizeColorObject = normalizeColorObject; + + var processColorObject = function processColorObject(color) { + if ('dynamic' in color && color.dynamic != null) { + var processColor = _$$_REQUIRE(_dependencyMap[1]); + + var dynamic = color.dynamic; + var dynamicColor = { + dynamic: { + light: processColor(dynamic.light), + dark: processColor(dynamic.dark), + highContrastLight: processColor(dynamic.highContrastLight), + highContrastDark: processColor(dynamic.highContrastDark) + } + }; + return dynamicColor; + } + + return color; + }; + + exports.processColorObject = processColorObject; +},148,[146,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var dummyInsets = { + top: undefined, + left: undefined, + right: undefined, + bottom: undefined + }; + + var insetsDiffer = function insetsDiffer(one, two) { + one = one || dummyInsets; + two = two || dummyInsets; + return one !== two && (one.top !== two.top || one.left !== two.left || one.right !== two.right || one.bottom !== two.bottom); + }; + + module.exports = insetsDiffer; +},149,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var dummySize = { + width: undefined, + height: undefined + }; + + var sizesDiffer = function sizesDiffer(one, two) { + one = one || dummySize; + two = two || dummySize; + return one !== two && (one.width !== two.width || one.height !== two.height); + }; + + module.exports = sizesDiffer; +},150,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var matricesDiffer = function matricesDiffer(one, two) { + if (one === two) { + return false; + } + + return !one || !two || one[12] !== two[12] || one[13] !== two[13] || one[14] !== two[14] || one[5] !== two[5] || one[10] !== two[10] || one[0] !== two[0] || one[1] !== two[1] || one[2] !== two[2] || one[3] !== two[3] || one[4] !== two[4] || one[6] !== two[6] || one[7] !== two[7] || one[8] !== two[8] || one[9] !== two[9] || one[11] !== two[11] || one[15] !== two[15]; + }; + + module.exports = matricesDiffer; +},151,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function processTransform(transform) { + { + return transform; + } + + var result = _$$_REQUIRE(_dependencyMap[0]).createIdentityMatrix(); + + transform.forEach(function (transformation) { + var key = Object.keys(transformation)[0]; + var value = transformation[key]; + + switch (key) { + case 'matrix': + _$$_REQUIRE(_dependencyMap[0]).multiplyInto(result, result, value); + + break; + + case 'perspective': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reusePerspectiveCommand, [value]); + + break; + + case 'rotateX': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseRotateXCommand, [_convertToRadians(value)]); + + break; + + case 'rotateY': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseRotateYCommand, [_convertToRadians(value)]); + + break; + + case 'rotate': + case 'rotateZ': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseRotateZCommand, [_convertToRadians(value)]); + + break; + + case 'scale': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseScaleCommand, [value]); + + break; + + case 'scaleX': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseScaleXCommand, [value]); + + break; + + case 'scaleY': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseScaleYCommand, [value]); + + break; + + case 'translate': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseTranslate3dCommand, [value[0], value[1], value[2] || 0]); + + break; + + case 'translateX': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseTranslate2dCommand, [value, 0]); + + break; + + case 'translateY': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseTranslate2dCommand, [0, value]); + + break; + + case 'skewX': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseSkewXCommand, [_convertToRadians(value)]); + + break; + + case 'skewY': + _multiplyTransform(result, _$$_REQUIRE(_dependencyMap[0]).reuseSkewYCommand, [_convertToRadians(value)]); + + break; + + default: + throw new Error('Invalid transform name: ' + key); + } + }); + return result; + } + + function _multiplyTransform(result, matrixMathFunction, args) { + var matrixToApply = _$$_REQUIRE(_dependencyMap[0]).createIdentityMatrix(); + + var argsWithIdentity = [matrixToApply].concat(args); + matrixMathFunction.apply(this, argsWithIdentity); + + _$$_REQUIRE(_dependencyMap[0]).multiplyInto(result, result, matrixToApply); + } + + function _convertToRadians(value) { + var floatValue = parseFloat(value); + return value.indexOf('rad') > -1 ? floatValue : floatValue * Math.PI / 180; + } + + module.exports = processTransform; +},152,[153]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var MatrixMath = { + createIdentityMatrix: function createIdentityMatrix() { + return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]; + }, + createCopy: function createCopy(m) { + return [m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10], m[11], m[12], m[13], m[14], m[15]]; + }, + createOrthographic: function createOrthographic(left, right, bottom, top, near, far) { + var a = 2 / (right - left); + var b = 2 / (top - bottom); + var c = -2 / (far - near); + var tx = -(right + left) / (right - left); + var ty = -(top + bottom) / (top - bottom); + var tz = -(far + near) / (far - near); + return [a, 0, 0, 0, 0, b, 0, 0, 0, 0, c, 0, tx, ty, tz, 1]; + }, + createFrustum: function createFrustum(left, right, bottom, top, near, far) { + var r_width = 1 / (right - left); + var r_height = 1 / (top - bottom); + var r_depth = 1 / (near - far); + var x = 2 * (near * r_width); + var y = 2 * (near * r_height); + var A = (right + left) * r_width; + var B = (top + bottom) * r_height; + var C = (far + near) * r_depth; + var D = 2 * (far * near * r_depth); + return [x, 0, 0, 0, 0, y, 0, 0, A, B, C, -1, 0, 0, D, 0]; + }, + createPerspective: function createPerspective(fovInRadians, aspect, near, far) { + var h = 1 / Math.tan(fovInRadians / 2); + var r_depth = 1 / (near - far); + var C = (far + near) * r_depth; + var D = 2 * (far * near * r_depth); + return [h / aspect, 0, 0, 0, 0, h, 0, 0, 0, 0, C, -1, 0, 0, D, 0]; + }, + createTranslate2d: function createTranslate2d(x, y) { + var mat = MatrixMath.createIdentityMatrix(); + MatrixMath.reuseTranslate2dCommand(mat, x, y); + return mat; + }, + reuseTranslate2dCommand: function reuseTranslate2dCommand(matrixCommand, x, y) { + matrixCommand[12] = x; + matrixCommand[13] = y; + }, + reuseTranslate3dCommand: function reuseTranslate3dCommand(matrixCommand, x, y, z) { + matrixCommand[12] = x; + matrixCommand[13] = y; + matrixCommand[14] = z; + }, + createScale: function createScale(factor) { + var mat = MatrixMath.createIdentityMatrix(); + MatrixMath.reuseScaleCommand(mat, factor); + return mat; + }, + reuseScaleCommand: function reuseScaleCommand(matrixCommand, factor) { + matrixCommand[0] = factor; + matrixCommand[5] = factor; + }, + reuseScale3dCommand: function reuseScale3dCommand(matrixCommand, x, y, z) { + matrixCommand[0] = x; + matrixCommand[5] = y; + matrixCommand[10] = z; + }, + reusePerspectiveCommand: function reusePerspectiveCommand(matrixCommand, p) { + matrixCommand[11] = -1 / p; + }, + reuseScaleXCommand: function reuseScaleXCommand(matrixCommand, factor) { + matrixCommand[0] = factor; + }, + reuseScaleYCommand: function reuseScaleYCommand(matrixCommand, factor) { + matrixCommand[5] = factor; + }, + reuseScaleZCommand: function reuseScaleZCommand(matrixCommand, factor) { + matrixCommand[10] = factor; + }, + reuseRotateXCommand: function reuseRotateXCommand(matrixCommand, radians) { + matrixCommand[5] = Math.cos(radians); + matrixCommand[6] = Math.sin(radians); + matrixCommand[9] = -Math.sin(radians); + matrixCommand[10] = Math.cos(radians); + }, + reuseRotateYCommand: function reuseRotateYCommand(matrixCommand, amount) { + matrixCommand[0] = Math.cos(amount); + matrixCommand[2] = -Math.sin(amount); + matrixCommand[8] = Math.sin(amount); + matrixCommand[10] = Math.cos(amount); + }, + reuseRotateZCommand: function reuseRotateZCommand(matrixCommand, radians) { + matrixCommand[0] = Math.cos(radians); + matrixCommand[1] = Math.sin(radians); + matrixCommand[4] = -Math.sin(radians); + matrixCommand[5] = Math.cos(radians); + }, + createRotateZ: function createRotateZ(radians) { + var mat = MatrixMath.createIdentityMatrix(); + MatrixMath.reuseRotateZCommand(mat, radians); + return mat; + }, + reuseSkewXCommand: function reuseSkewXCommand(matrixCommand, radians) { + matrixCommand[4] = Math.tan(radians); + }, + reuseSkewYCommand: function reuseSkewYCommand(matrixCommand, radians) { + matrixCommand[1] = Math.tan(radians); + }, + multiplyInto: function multiplyInto(out, a, b) { + var a00 = a[0], + a01 = a[1], + a02 = a[2], + a03 = a[3], + a10 = a[4], + a11 = a[5], + a12 = a[6], + a13 = a[7], + a20 = a[8], + a21 = a[9], + a22 = a[10], + a23 = a[11], + a30 = a[12], + a31 = a[13], + a32 = a[14], + a33 = a[15]; + var b0 = b[0], + b1 = b[1], + b2 = b[2], + b3 = b[3]; + out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[4]; + b1 = b[5]; + b2 = b[6]; + b3 = b[7]; + out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[8]; + b1 = b[9]; + b2 = b[10]; + b3 = b[11]; + out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + b0 = b[12]; + b1 = b[13]; + b2 = b[14]; + b3 = b[15]; + out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; + out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; + out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; + out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; + }, + determinant: function determinant(matrix) { + var _matrix = _$$_REQUIRE(_dependencyMap[0])(matrix, 16), + m00 = _matrix[0], + m01 = _matrix[1], + m02 = _matrix[2], + m03 = _matrix[3], + m10 = _matrix[4], + m11 = _matrix[5], + m12 = _matrix[6], + m13 = _matrix[7], + m20 = _matrix[8], + m21 = _matrix[9], + m22 = _matrix[10], + m23 = _matrix[11], + m30 = _matrix[12], + m31 = _matrix[13], + m32 = _matrix[14], + m33 = _matrix[15]; + + return m03 * m12 * m21 * m30 - m02 * m13 * m21 * m30 - m03 * m11 * m22 * m30 + m01 * m13 * m22 * m30 + m02 * m11 * m23 * m30 - m01 * m12 * m23 * m30 - m03 * m12 * m20 * m31 + m02 * m13 * m20 * m31 + m03 * m10 * m22 * m31 - m00 * m13 * m22 * m31 - m02 * m10 * m23 * m31 + m00 * m12 * m23 * m31 + m03 * m11 * m20 * m32 - m01 * m13 * m20 * m32 - m03 * m10 * m21 * m32 + m00 * m13 * m21 * m32 + m01 * m10 * m23 * m32 - m00 * m11 * m23 * m32 - m02 * m11 * m20 * m33 + m01 * m12 * m20 * m33 + m02 * m10 * m21 * m33 - m00 * m12 * m21 * m33 - m01 * m10 * m22 * m33 + m00 * m11 * m22 * m33; + }, + inverse: function inverse(matrix) { + var det = MatrixMath.determinant(matrix); + + if (!det) { + return matrix; + } + + var _matrix2 = _$$_REQUIRE(_dependencyMap[0])(matrix, 16), + m00 = _matrix2[0], + m01 = _matrix2[1], + m02 = _matrix2[2], + m03 = _matrix2[3], + m10 = _matrix2[4], + m11 = _matrix2[5], + m12 = _matrix2[6], + m13 = _matrix2[7], + m20 = _matrix2[8], + m21 = _matrix2[9], + m22 = _matrix2[10], + m23 = _matrix2[11], + m30 = _matrix2[12], + m31 = _matrix2[13], + m32 = _matrix2[14], + m33 = _matrix2[15]; + + return [(m12 * m23 * m31 - m13 * m22 * m31 + m13 * m21 * m32 - m11 * m23 * m32 - m12 * m21 * m33 + m11 * m22 * m33) / det, (m03 * m22 * m31 - m02 * m23 * m31 - m03 * m21 * m32 + m01 * m23 * m32 + m02 * m21 * m33 - m01 * m22 * m33) / det, (m02 * m13 * m31 - m03 * m12 * m31 + m03 * m11 * m32 - m01 * m13 * m32 - m02 * m11 * m33 + m01 * m12 * m33) / det, (m03 * m12 * m21 - m02 * m13 * m21 - m03 * m11 * m22 + m01 * m13 * m22 + m02 * m11 * m23 - m01 * m12 * m23) / det, (m13 * m22 * m30 - m12 * m23 * m30 - m13 * m20 * m32 + m10 * m23 * m32 + m12 * m20 * m33 - m10 * m22 * m33) / det, (m02 * m23 * m30 - m03 * m22 * m30 + m03 * m20 * m32 - m00 * m23 * m32 - m02 * m20 * m33 + m00 * m22 * m33) / det, (m03 * m12 * m30 - m02 * m13 * m30 - m03 * m10 * m32 + m00 * m13 * m32 + m02 * m10 * m33 - m00 * m12 * m33) / det, (m02 * m13 * m20 - m03 * m12 * m20 + m03 * m10 * m22 - m00 * m13 * m22 - m02 * m10 * m23 + m00 * m12 * m23) / det, (m11 * m23 * m30 - m13 * m21 * m30 + m13 * m20 * m31 - m10 * m23 * m31 - m11 * m20 * m33 + m10 * m21 * m33) / det, (m03 * m21 * m30 - m01 * m23 * m30 - m03 * m20 * m31 + m00 * m23 * m31 + m01 * m20 * m33 - m00 * m21 * m33) / det, (m01 * m13 * m30 - m03 * m11 * m30 + m03 * m10 * m31 - m00 * m13 * m31 - m01 * m10 * m33 + m00 * m11 * m33) / det, (m03 * m11 * m20 - m01 * m13 * m20 - m03 * m10 * m21 + m00 * m13 * m21 + m01 * m10 * m23 - m00 * m11 * m23) / det, (m12 * m21 * m30 - m11 * m22 * m30 - m12 * m20 * m31 + m10 * m22 * m31 + m11 * m20 * m32 - m10 * m21 * m32) / det, (m01 * m22 * m30 - m02 * m21 * m30 + m02 * m20 * m31 - m00 * m22 * m31 - m01 * m20 * m32 + m00 * m21 * m32) / det, (m02 * m11 * m30 - m01 * m12 * m30 - m02 * m10 * m31 + m00 * m12 * m31 + m01 * m10 * m32 - m00 * m11 * m32) / det, (m01 * m12 * m20 - m02 * m11 * m20 + m02 * m10 * m21 - m00 * m12 * m21 - m01 * m10 * m22 + m00 * m11 * m22) / det]; + }, + transpose: function transpose(m) { + return [m[0], m[4], m[8], m[12], m[1], m[5], m[9], m[13], m[2], m[6], m[10], m[14], m[3], m[7], m[11], m[15]]; + }, + multiplyVectorByMatrix: function multiplyVectorByMatrix(v, m) { + var _v = _$$_REQUIRE(_dependencyMap[0])(v, 4), + vx = _v[0], + vy = _v[1], + vz = _v[2], + vw = _v[3]; + + return [vx * m[0] + vy * m[4] + vz * m[8] + vw * m[12], vx * m[1] + vy * m[5] + vz * m[9] + vw * m[13], vx * m[2] + vy * m[6] + vz * m[10] + vw * m[14], vx * m[3] + vy * m[7] + vz * m[11] + vw * m[15]]; + }, + v3Length: function v3Length(a) { + return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); + }, + v3Normalize: function v3Normalize(vector, v3Length) { + var im = 1 / (v3Length || MatrixMath.v3Length(vector)); + return [vector[0] * im, vector[1] * im, vector[2] * im]; + }, + v3Dot: function v3Dot(a, b) { + return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + }, + v3Combine: function v3Combine(a, b, aScale, bScale) { + return [aScale * a[0] + bScale * b[0], aScale * a[1] + bScale * b[1], aScale * a[2] + bScale * b[2]]; + }, + v3Cross: function v3Cross(a, b) { + return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; + }, + quaternionToDegreesXYZ: function quaternionToDegreesXYZ(q, matrix, row) { + var _q = _$$_REQUIRE(_dependencyMap[0])(q, 4), + qx = _q[0], + qy = _q[1], + qz = _q[2], + qw = _q[3]; + + var qw2 = qw * qw; + var qx2 = qx * qx; + var qy2 = qy * qy; + var qz2 = qz * qz; + var test = qx * qy + qz * qw; + var unit = qw2 + qx2 + qy2 + qz2; + var conv = 180 / Math.PI; + + if (test > 0.49999 * unit) { + return [0, 2 * Math.atan2(qx, qw) * conv, 90]; + } + + if (test < -0.49999 * unit) { + return [0, -2 * Math.atan2(qx, qw) * conv, -90]; + } + + return [MatrixMath.roundTo3Places(Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx2 - 2 * qz2) * conv), MatrixMath.roundTo3Places(Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy2 - 2 * qz2) * conv), MatrixMath.roundTo3Places(Math.asin(2 * qx * qy + 2 * qz * qw) * conv)]; + }, + roundTo3Places: function roundTo3Places(n) { + var arr = n.toString().split('e'); + return Math.round(arr[0] + 'e' + (arr[1] ? +arr[1] - 3 : 3)) * 0.001; + }, + decomposeMatrix: function decomposeMatrix(transformMatrix) { + _$$_REQUIRE(_dependencyMap[1])(transformMatrix.length === 16, 'Matrix decomposition needs a list of 3d matrix values, received %s', transformMatrix); + + var perspective = []; + var quaternion = []; + var scale = []; + var skew = []; + var translation = []; + + if (!transformMatrix[15]) { + return; + } + + var matrix = []; + var perspectiveMatrix = []; + + for (var i = 0; i < 4; i++) { + matrix.push([]); + + for (var j = 0; j < 4; j++) { + var value = transformMatrix[i * 4 + j] / transformMatrix[15]; + matrix[i].push(value); + perspectiveMatrix.push(j === 3 ? 0 : value); + } + } + + perspectiveMatrix[15] = 1; + + if (!MatrixMath.determinant(perspectiveMatrix)) { + return; + } + + if (matrix[0][3] !== 0 || matrix[1][3] !== 0 || matrix[2][3] !== 0) { + var rightHandSide = [matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]]; + var inversePerspectiveMatrix = MatrixMath.inverse(perspectiveMatrix); + var transposedInversePerspectiveMatrix = MatrixMath.transpose(inversePerspectiveMatrix); + perspective = MatrixMath.multiplyVectorByMatrix(rightHandSide, transposedInversePerspectiveMatrix); + } else { + perspective[0] = perspective[1] = perspective[2] = 0; + perspective[3] = 1; + } + + for (var _i = 0; _i < 3; _i++) { + translation[_i] = matrix[3][_i]; + } + + var row = []; + + for (var _i2 = 0; _i2 < 3; _i2++) { + row[_i2] = [matrix[_i2][0], matrix[_i2][1], matrix[_i2][2]]; + } + + scale[0] = MatrixMath.v3Length(row[0]); + row[0] = MatrixMath.v3Normalize(row[0], scale[0]); + skew[0] = MatrixMath.v3Dot(row[0], row[1]); + row[1] = MatrixMath.v3Combine(row[1], row[0], 1.0, -skew[0]); + scale[1] = MatrixMath.v3Length(row[1]); + row[1] = MatrixMath.v3Normalize(row[1], scale[1]); + skew[0] /= scale[1]; + skew[1] = MatrixMath.v3Dot(row[0], row[2]); + row[2] = MatrixMath.v3Combine(row[2], row[0], 1.0, -skew[1]); + skew[2] = MatrixMath.v3Dot(row[1], row[2]); + row[2] = MatrixMath.v3Combine(row[2], row[1], 1.0, -skew[2]); + scale[2] = MatrixMath.v3Length(row[2]); + row[2] = MatrixMath.v3Normalize(row[2], scale[2]); + skew[1] /= scale[2]; + skew[2] /= scale[2]; + var pdum3 = MatrixMath.v3Cross(row[1], row[2]); + + if (MatrixMath.v3Dot(row[0], pdum3) < 0) { + for (var _i3 = 0; _i3 < 3; _i3++) { + scale[_i3] *= -1; + row[_i3][0] *= -1; + row[_i3][1] *= -1; + row[_i3][2] *= -1; + } + } + + quaternion[0] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] - row[1][1] - row[2][2], 0)); + quaternion[1] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] + row[1][1] - row[2][2], 0)); + quaternion[2] = 0.5 * Math.sqrt(Math.max(1 - row[0][0] - row[1][1] + row[2][2], 0)); + quaternion[3] = 0.5 * Math.sqrt(Math.max(1 + row[0][0] + row[1][1] + row[2][2], 0)); + + if (row[2][1] > row[1][2]) { + quaternion[0] = -quaternion[0]; + } + + if (row[0][2] > row[2][0]) { + quaternion[1] = -quaternion[1]; + } + + if (row[1][0] > row[0][1]) { + quaternion[2] = -quaternion[2]; + } + + var rotationDegrees; + + if (quaternion[0] < 0.001 && quaternion[0] >= 0 && quaternion[1] < 0.001 && quaternion[1] >= 0) { + rotationDegrees = [0, 0, MatrixMath.roundTo3Places(Math.atan2(row[0][1], row[0][0]) * 180 / Math.PI)]; + } else { + rotationDegrees = MatrixMath.quaternionToDegreesXYZ(quaternion, matrix, row); + } + + return { + rotationDegrees: rotationDegrees, + perspective: perspective, + quaternion: quaternion, + scale: scale, + skew: skew, + translation: translation, + rotate: rotationDegrees[2], + rotateX: rotationDegrees[0], + rotateY: rotationDegrees[1], + scaleX: scale[0], + scaleY: scale[1], + translateX: translation[0], + translateY: translation[1] + }; + } + }; + module.exports = MatrixMath; +},153,[41,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.setRuntimeConfigProvider = setRuntimeConfigProvider; + exports.get = get; + exports.getWithFallback_DEPRECATED = getWithFallback_DEPRECATED; + exports.unstable_hasStaticViewConfig = unstable_hasStaticViewConfig; + exports.unstable_hasComponent = unstable_hasComponent; + + var _UIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReactNativeViewConfigRegistry = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _getNativeComponentAttributes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _verifyComponentAttributeEquivalence = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var getRuntimeConfig; + var componentNameToExists = new Map(); + + function setRuntimeConfigProvider(runtimeConfigProvider) { + (0, _invariant.default)(getRuntimeConfig == null, 'NativeComponentRegistry.setRuntimeConfigProvider() called more than once.'); + getRuntimeConfig = runtimeConfigProvider; + } + + function get(name, viewConfigProvider) { + _ReactNativeViewConfigRegistry.default.register(name, function () { + var _getRuntimeConfig; + + var _ref = (_getRuntimeConfig = getRuntimeConfig == null ? undefined : getRuntimeConfig(name)) != null ? _getRuntimeConfig : { + native: true, + verify: false + }, + native = _ref.native, + verify = _ref.verify; + + var viewConfig = native ? (0, _getNativeComponentAttributes.default)(name) : (0, _$$_REQUIRE(_dependencyMap[7]).createViewConfig)(viewConfigProvider()); + + if (verify) { + if (native) { + (0, _verifyComponentAttributeEquivalence.default)(viewConfig, (0, _$$_REQUIRE(_dependencyMap[7]).createViewConfig)(viewConfigProvider())); + } else { + (0, _verifyComponentAttributeEquivalence.default)((0, _getNativeComponentAttributes.default)(name), viewConfig); + } + } + + return viewConfig; + }); + + return name; + } + + function getWithFallback_DEPRECATED(name, viewConfigProvider) { + if (getRuntimeConfig == null) { + if (hasNativeViewConfig(name)) { + return get(name, viewConfigProvider); + } + } else { + if (getRuntimeConfig(name) != null) { + return get(name, viewConfigProvider); + } + } + + var FallbackNativeComponent = function FallbackNativeComponent(props) { + return null; + }; + + FallbackNativeComponent.displayName = "Fallback(" + name + ")"; + return FallbackNativeComponent; + } + + function hasNativeViewConfig(name) { + (0, _invariant.default)(getRuntimeConfig == null, 'Unexpected invocation!'); + return _UIManager.default.getViewManagerConfig(name) != null; + } + + function unstable_hasStaticViewConfig(name) { + var _getRuntimeConfig2; + + var _ref2 = (_getRuntimeConfig2 = getRuntimeConfig == null ? undefined : getRuntimeConfig(name)) != null ? _getRuntimeConfig2 : { + native: true + }, + native = _ref2.native; + + return !native; + } + + function unstable_hasComponent(name) { + var hasNativeComponent = componentNameToExists.get(name); + + if (hasNativeComponent == null) { + if (global.__nativeComponentRegistry__hasComponent) { + hasNativeComponent = global.__nativeComponentRegistry__hasComponent(name); + componentNameToExists.set(name, hasNativeComponent); + } else { + throw "unstable_hasComponent('" + name + "'): Global function is not registered"; + } + } + + return hasNativeComponent; + } +},154,[5,155,138,161,174,36,17,175]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _UIManagerInjection = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var UIManager = global.RN$Bridgeless === true ? _$$_REQUIRE(_dependencyMap[2]) : _UIManagerInjection.default.unstable_UIManager == null ? _$$_REQUIRE(_dependencyMap[3]) : _UIManagerInjection.default.unstable_UIManager; + module.exports = UIManager; +},155,[5,156,157,158]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var _default = { + unstable_UIManager: null + }; + exports.default = _default; +},156,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = { + getViewManagerConfig: function getViewManagerConfig(viewManagerName) { + console.warn('Attempting to get config for view manager: ' + viewManagerName); + + if (viewManagerName === 'RCTVirtualText') { + return {}; + } + + return null; + }, + hasViewManagerConfig: function hasViewManagerConfig(viewManagerName) { + return viewManagerName === 'RCTVirtualText' || viewManagerName === 'RCTShimmeringView'; + }, + getConstants: function getConstants() { + return {}; + }, + getConstantsForViewManager: function getConstantsForViewManager(viewManagerName) {}, + getDefaultEventTypes: function getDefaultEventTypes() { + return []; + }, + lazilyLoadView: function lazilyLoadView(name) {}, + createView: function createView(reactTag, viewName, rootTag, props) {}, + updateView: function updateView(reactTag, viewName, props) {}, + focus: function focus(reactTag) {}, + blur: function blur(reactTag) {}, + findSubviewIn: function findSubviewIn(reactTag, point, callback) {}, + dispatchViewManagerCommand: function dispatchViewManagerCommand(reactTag, commandID, commandArgs) {}, + measure: function measure(reactTag, callback) {}, + measureInWindow: function measureInWindow(reactTag, callback) {}, + viewIsDescendantOf: function viewIsDescendantOf(reactTag, ancestorReactTag, callback) {}, + measureLayout: function measureLayout(reactTag, ancestorReactTag, errorCallback, callback) {}, + measureLayoutRelativeToParent: function measureLayoutRelativeToParent(reactTag, errorCallback, callback) {}, + setJSResponder: function setJSResponder(reactTag, blockNativeResponder) {}, + clearJSResponder: function clearJSResponder() {}, + configureNextLayoutAnimation: function configureNextLayoutAnimation(config, callback, errorCallback) {}, + removeSubviewsFromContainerWithID: function removeSubviewsFromContainerWithID(containerID) {}, + replaceExistingNonRootView: function replaceExistingNonRootView(reactTag, newReactTag) {}, + setChildren: function setChildren(containerTag, reactTags) {}, + manageChildren: function manageChildren(containerTag, moveFromIndices, moveToIndices, addChildReactTags, addAtIndices, removeAtIndices) {}, + setLayoutAnimationEnabledExperimental: function setLayoutAnimationEnabledExperimental(enabled) {}, + sendAccessibilityEvent: function sendAccessibilityEvent(reactTag, eventType) {}, + showPopupMenu: function showPopupMenu(reactTag, items, error, success) {}, + dismissPopupMenu: function dismissPopupMenu() {} + }; +},157,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _NativeUIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var viewManagerConfigs = {}; + var triedLoadingConfig = new Set(); + var NativeUIManagerConstants = {}; + var isNativeUIManagerConstantsSet = false; + + function _getConstants() { + if (!isNativeUIManagerConstantsSet) { + NativeUIManagerConstants = _NativeUIManager.default.getConstants(); + isNativeUIManagerConstantsSet = true; + } + + return NativeUIManagerConstants; + } + + function _getViewManagerConfig(viewManagerName) { + if (viewManagerConfigs[viewManagerName] === undefined && global.nativeCallSyncHook && _NativeUIManager.default.getConstantsForViewManager) { + try { + viewManagerConfigs[viewManagerName] = _NativeUIManager.default.getConstantsForViewManager(viewManagerName); + } catch (e) { + console.error("NativeUIManager.getConstantsForViewManager('" + viewManagerName + "') threw an exception.", e); + viewManagerConfigs[viewManagerName] = null; + } + } + + var config = viewManagerConfigs[viewManagerName]; + + if (config) { + return config; + } + + if (!global.nativeCallSyncHook) { + return config; + } + + if (_NativeUIManager.default.lazilyLoadView && !triedLoadingConfig.has(viewManagerName)) { + var result = _NativeUIManager.default.lazilyLoadView(viewManagerName); + + triedLoadingConfig.add(viewManagerName); + + if (result != null && result.viewConfig != null) { + _getConstants()[viewManagerName] = result.viewConfig; + lazifyViewManagerConfig(viewManagerName); + } + } + + return viewManagerConfigs[viewManagerName]; + } + + var UIManagerJS = (0, _extends2.default)({}, _NativeUIManager.default, { + createView: function createView(reactTag, viewName, rootTag, props) { + if (viewManagerConfigs[viewName] === undefined) { + _getViewManagerConfig(viewName); + } + + _NativeUIManager.default.createView(reactTag, viewName, rootTag, props); + }, + getConstants: function getConstants() { + return _getConstants(); + }, + getViewManagerConfig: function getViewManagerConfig(viewManagerName) { + return _getViewManagerConfig(viewManagerName); + }, + hasViewManagerConfig: function hasViewManagerConfig(viewManagerName) { + return _getViewManagerConfig(viewManagerName) != null; + } + }); + _NativeUIManager.default.getViewManagerConfig = UIManagerJS.getViewManagerConfig; + + function lazifyViewManagerConfig(viewName) { + var viewConfig = _getConstants()[viewName]; + + viewManagerConfigs[viewName] = viewConfig; + + if (viewConfig.Manager) { + _$$_REQUIRE(_dependencyMap[3])(viewConfig, 'Constants', { + get: function get() { + var viewManager = _$$_REQUIRE(_dependencyMap[4])[viewConfig.Manager]; + + var constants = {}; + viewManager && Object.keys(viewManager).forEach(function (key) { + var value = viewManager[key]; + + if (typeof value !== 'function') { + constants[key] = value; + } + }); + return constants; + } + }); + + _$$_REQUIRE(_dependencyMap[3])(viewConfig, 'Commands', { + get: function get() { + var viewManager = _$$_REQUIRE(_dependencyMap[4])[viewConfig.Manager]; + + var commands = {}; + var index = 0; + viewManager && Object.keys(viewManager).forEach(function (key) { + var value = viewManager[key]; + + if (typeof value === 'function') { + commands[key] = index++; + } + }); + return commands; + } + }); + } + } + + { + Object.keys(_getConstants()).forEach(function (viewName) { + lazifyViewManagerConfig(viewName); + }); + } + + if (!global.nativeCallSyncHook) { + Object.keys(_getConstants()).forEach(function (viewManagerName) { + if (!_$$_REQUIRE(_dependencyMap[5]).includes(viewManagerName)) { + if (!viewManagerConfigs[viewManagerName]) { + viewManagerConfigs[viewManagerName] = _getConstants()[viewManagerName]; + } + + _$$_REQUIRE(_dependencyMap[3])(_NativeUIManager.default, viewManagerName, { + get: function get() { + console.warn("Accessing view manager configs directly off UIManager via UIManager['" + viewManagerName + "'] " + ("is no longer supported. Use UIManager.getViewManagerConfig('" + viewManagerName + "') instead.")); + return UIManagerJS.getViewManagerConfig(viewManagerName); + } + }); + } + }); + } + + module.exports = UIManagerJS; +},158,[5,6,159,50,40,160]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('UIManager'); + + exports.default = _default; +},159,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = ['clearJSResponder', 'configureNextLayoutAnimation', 'createView', 'dismissPopupMenu', 'dispatchViewManagerCommand', 'findSubviewIn', 'getConstantsForViewManager', 'getDefaultEventTypes', 'manageChildren', 'measure', 'measureInWindow', 'measureLayout', 'measureLayoutRelativeToParent', 'removeRootView', 'removeSubviewsFromContainerWithID', 'replaceExistingNonRootView', 'sendAccessibilityEvent', 'setChildren', 'setJSResponder', 'setLayoutAnimationEnabledExperimental', 'showPopupMenu', 'updateView', 'viewIsDescendantOf', 'PopupMenu', 'LazyViewManagersEnabled', 'ViewManagerNames', 'StyleConstants', 'AccessibilityEventTypes', 'UIView', 'getViewManagerConfig', 'hasViewManagerConfig', 'blur', 'focus', 'genericBubblingEventTypes', 'genericDirectEventTypes', 'lazilyLoadView']; +},160,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function getNativeComponentAttributes(uiViewClassName) { + var viewConfig = _$$_REQUIRE(_dependencyMap[0]).getViewManagerConfig(uiViewClassName); + + _$$_REQUIRE(_dependencyMap[1])(viewConfig != null && viewConfig.NativeProps != null, 'requireNativeComponent: "%s" was not found in the UIManager.', uiViewClassName); + + var baseModuleName = viewConfig.baseModuleName, + bubblingEventTypes = viewConfig.bubblingEventTypes, + directEventTypes = viewConfig.directEventTypes; + var nativeProps = viewConfig.NativeProps; + + while (baseModuleName) { + var baseModule = _$$_REQUIRE(_dependencyMap[0]).getViewManagerConfig(baseModuleName); + + if (!baseModule) { + baseModuleName = null; + } else { + bubblingEventTypes = _$$_REQUIRE(_dependencyMap[2])({}, baseModule.bubblingEventTypes, bubblingEventTypes); + directEventTypes = _$$_REQUIRE(_dependencyMap[2])({}, baseModule.directEventTypes, directEventTypes); + nativeProps = _$$_REQUIRE(_dependencyMap[2])({}, baseModule.NativeProps, nativeProps); + baseModuleName = baseModule.baseModuleName; + } + } + + var validAttributes = {}; + + for (var key in nativeProps) { + var typeName = nativeProps[key]; + var diff = getDifferForType(typeName); + var process = getProcessorForType(typeName); + validAttributes[key] = diff == null && process == null ? true : { + diff: diff, + process: process + }; + } + + validAttributes.style = _$$_REQUIRE(_dependencyMap[3]); + + _$$_REQUIRE(_dependencyMap[2])(viewConfig, { + uiViewClassName: uiViewClassName, + validAttributes: validAttributes, + bubblingEventTypes: bubblingEventTypes, + directEventTypes: directEventTypes + }); + + if (!hasAttachedDefaultEventTypes) { + attachDefaultEventTypes(viewConfig); + hasAttachedDefaultEventTypes = true; + } + + return viewConfig; + } + + var hasAttachedDefaultEventTypes = false; + + function attachDefaultEventTypes(viewConfig) { + var constants = _$$_REQUIRE(_dependencyMap[0]).getConstants(); + + if (constants.ViewManagerNames || constants.LazyViewManagersEnabled) { + viewConfig = merge(viewConfig, _$$_REQUIRE(_dependencyMap[0]).getDefaultEventTypes()); + } else { + viewConfig.bubblingEventTypes = merge(viewConfig.bubblingEventTypes, constants.genericBubblingEventTypes); + viewConfig.directEventTypes = merge(viewConfig.directEventTypes, constants.genericDirectEventTypes); + } + } + + function merge(destination, source) { + if (!source) { + return destination; + } + + if (!destination) { + return source; + } + + for (var key in source) { + if (!source.hasOwnProperty(key)) { + continue; + } + + var sourceValue = source[key]; + + if (destination.hasOwnProperty(key)) { + var destinationValue = destination[key]; + + if (typeof sourceValue === 'object' && typeof destinationValue === 'object') { + sourceValue = merge(destinationValue, sourceValue); + } + } + + destination[key] = sourceValue; + } + + return destination; + } + + function getDifferForType(typeName) { + switch (typeName) { + case 'CATransform3D': + return _$$_REQUIRE(_dependencyMap[4]); + + case 'CGPoint': + return _$$_REQUIRE(_dependencyMap[5]); + + case 'CGSize': + return _$$_REQUIRE(_dependencyMap[6]); + + case 'UIEdgeInsets': + return _$$_REQUIRE(_dependencyMap[7]); + + case 'Point': + return _$$_REQUIRE(_dependencyMap[5]); + } + + return null; + } + + function getProcessorForType(typeName) { + switch (typeName) { + case 'CGColor': + case 'UIColor': + return _$$_REQUIRE(_dependencyMap[8]); + + case 'CGColorArray': + case 'UIColorArray': + return _$$_REQUIRE(_dependencyMap[9]); + + case 'CGImage': + case 'UIImage': + case 'RCTImageSource': + return _$$_REQUIRE(_dependencyMap[10]); + + case 'Color': + return _$$_REQUIRE(_dependencyMap[8]); + + case 'ColorArray': + return _$$_REQUIRE(_dependencyMap[9]); + } + + return null; + } + + module.exports = getNativeComponentAttributes; +},161,[155,36,6,162,151,163,150,149,145,164,165]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _processColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _processTransform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _sizesDiffer = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var colorAttributes = { + process: _processColor.default + }; + var ReactNativeStyleAttributes = { + alignContent: true, + alignItems: true, + alignSelf: true, + aspectRatio: true, + borderBottomWidth: true, + borderEndWidth: true, + borderLeftWidth: true, + borderRightWidth: true, + borderStartWidth: true, + borderTopWidth: true, + borderWidth: true, + bottom: true, + direction: true, + display: true, + end: true, + flex: true, + flexBasis: true, + flexDirection: true, + flexGrow: true, + flexShrink: true, + flexWrap: true, + height: true, + justifyContent: true, + left: true, + margin: true, + marginBottom: true, + marginEnd: true, + marginHorizontal: true, + marginLeft: true, + marginRight: true, + marginStart: true, + marginTop: true, + marginVertical: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + overflow: true, + padding: true, + paddingBottom: true, + paddingEnd: true, + paddingHorizontal: true, + paddingLeft: true, + paddingRight: true, + paddingStart: true, + paddingTop: true, + paddingVertical: true, + position: true, + right: true, + start: true, + top: true, + width: true, + zIndex: true, + elevation: true, + shadowColor: colorAttributes, + shadowOffset: { + diff: _sizesDiffer.default + }, + shadowOpacity: true, + shadowRadius: true, + decomposedMatrix: true, + rotation: true, + scaleX: true, + scaleY: true, + transform: { + process: _processTransform.default + }, + transformMatrix: true, + translateX: true, + translateY: true, + backfaceVisibility: true, + backgroundColor: colorAttributes, + borderBottomColor: colorAttributes, + borderBottomEndRadius: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderBottomStartRadius: true, + borderColor: colorAttributes, + borderEndColor: colorAttributes, + borderLeftColor: colorAttributes, + borderRadius: true, + borderRightColor: colorAttributes, + borderStartColor: colorAttributes, + borderStyle: true, + borderTopColor: colorAttributes, + borderTopEndRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderTopStartRadius: true, + opacity: true, + color: colorAttributes, + fontFamily: true, + fontSize: true, + fontStyle: true, + fontVariant: true, + fontWeight: true, + includeFontPadding: true, + letterSpacing: true, + lineHeight: true, + textAlign: true, + textAlignVertical: true, + textDecorationColor: colorAttributes, + textDecorationLine: true, + textDecorationStyle: true, + textShadowColor: colorAttributes, + textShadowOffset: true, + textShadowRadius: true, + textTransform: true, + writingDirection: true, + overlayColor: colorAttributes, + resizeMode: true, + tintColor: colorAttributes + }; + module.exports = ReactNativeStyleAttributes; +},162,[5,145,152,150]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var dummyPoint = { + x: undefined, + y: undefined + }; + + var pointsDiffer = function pointsDiffer(one, two) { + one = one || dummyPoint; + two = two || dummyPoint; + return one !== two && (one.x !== two.x || one.y !== two.y); + }; + + module.exports = pointsDiffer; +},163,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _processColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var TRANSPARENT = 0; + + function processColorArray(colors) { + return colors == null ? null : colors.map(processColorElement); + } + + function processColorElement(color) { + var value = (0, _processColor.default)(color); + + if (value == null) { + console.error('Invalid value in color array:', color); + return TRANSPARENT; + } + + return value; + } + + module.exports = processColorArray; +},164,[5,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _customSourceTransformer, _serverURL, _scriptURL; + + var _sourceCodeScriptURL; + + function getSourceCodeScriptURL() { + if (_sourceCodeScriptURL) { + return _sourceCodeScriptURL; + } + + var sourceCode = global.nativeExtensions && global.nativeExtensions.SourceCode; + + if (!sourceCode) { + sourceCode = _$$_REQUIRE(_dependencyMap[0]).default; + } + + _sourceCodeScriptURL = sourceCode.getConstants().scriptURL; + return _sourceCodeScriptURL; + } + + function getDevServerURL() { + if (_serverURL === undefined) { + var sourceCodeScriptURL = getSourceCodeScriptURL(); + var match = sourceCodeScriptURL && sourceCodeScriptURL.match(/^https?:\/\/.*?\//); + + if (match) { + _serverURL = match[0]; + } else { + _serverURL = null; + } + } + + return _serverURL; + } + + function _coerceLocalScriptURL(scriptURL) { + if (scriptURL) { + if (scriptURL.startsWith('assets://')) { + return null; + } + + scriptURL = scriptURL.substring(0, scriptURL.lastIndexOf('/') + 1); + + if (!scriptURL.includes('://')) { + scriptURL = 'file://' + scriptURL; + } + } + + return scriptURL; + } + + function getScriptURL() { + if (_scriptURL === undefined) { + _scriptURL = _coerceLocalScriptURL(getSourceCodeScriptURL()); + } + + return _scriptURL; + } + + function setCustomSourceTransformer(transformer) { + _customSourceTransformer = transformer; + } + + function resolveAssetSource(source) { + if (typeof source === 'object') { + return source; + } + + var asset = _$$_REQUIRE(_dependencyMap[1]).getAssetByID(source); + + if (!asset) { + return null; + } + + var resolver = new (_$$_REQUIRE(_dependencyMap[2]))(getDevServerURL(), getScriptURL(), asset); + + if (_customSourceTransformer) { + return _customSourceTransformer(resolver); + } + + return resolver.defaultAsset(); + } + + module.exports = resolveAssetSource; + module.exports.pickScale = _$$_REQUIRE(_dependencyMap[3]).pickScale; + module.exports.setCustomSourceTransformer = setCustomSourceTransformer; +},165,[166,167,168,169]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NativeModule = TurboModuleRegistry.getEnforcing('SourceCode'); + var constants = null; + var NativeSourceCode = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + + return constants; + } + }; + var _default = NativeSourceCode; + exports.default = _default; +},166,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var assets = []; + + function registerAsset(asset) { + return assets.push(asset); + } + + function getAssetByID(assetId) { + return assets[assetId - 1]; + } + + module.exports = { + registerAsset: registerAsset, + getAssetByID: getAssetByID + }; +},167,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function getScaledAssetPath(asset) { + var scale = _$$_REQUIRE(_dependencyMap[0]).pickScale(asset.scales, _$$_REQUIRE(_dependencyMap[1]).get()); + + var scaleSuffix = scale === 1 ? '' : '@' + scale + 'x'; + + var assetDir = _$$_REQUIRE(_dependencyMap[2]).getBasePath(asset); + + return assetDir + '/' + asset.name + scaleSuffix + '.' + asset.type; + } + + function getAssetPathInDrawableFolder(asset) { + var scale = _$$_REQUIRE(_dependencyMap[0]).pickScale(asset.scales, _$$_REQUIRE(_dependencyMap[1]).get()); + + var drawbleFolder = _$$_REQUIRE(_dependencyMap[2]).getAndroidResourceFolderName(asset, scale); + + var fileName = _$$_REQUIRE(_dependencyMap[2]).getAndroidResourceIdentifier(asset); + + return drawbleFolder + '/' + fileName + '.' + asset.type; + } + + var AssetSourceResolver = function () { + function AssetSourceResolver(serverUrl, jsbundleUrl, asset) { + _$$_REQUIRE(_dependencyMap[3])(this, AssetSourceResolver); + + this.serverUrl = serverUrl; + this.jsbundleUrl = jsbundleUrl; + this.asset = asset; + } + + _$$_REQUIRE(_dependencyMap[4])(AssetSourceResolver, [{ + key: "isLoadedFromServer", + value: function isLoadedFromServer() { + return !!this.serverUrl; + } + }, { + key: "isLoadedFromFileSystem", + value: function isLoadedFromFileSystem() { + return !!(this.jsbundleUrl && this.jsbundleUrl.startsWith('file://')); + } + }, { + key: "defaultAsset", + value: function defaultAsset() { + if (this.isLoadedFromServer()) { + return this.assetServerURL(); + } + + { + return this.scaledAssetURLNearBundle(); + } + } + }, { + key: "assetServerURL", + value: function assetServerURL() { + _$$_REQUIRE(_dependencyMap[5])(!!this.serverUrl, 'need server to load from'); + + return this.fromSource(this.serverUrl + getScaledAssetPath(this.asset) + '?platform=' + "ios" + '&hash=' + this.asset.hash); + } + }, { + key: "scaledAssetPath", + value: function scaledAssetPath() { + return this.fromSource(getScaledAssetPath(this.asset)); + } + }, { + key: "scaledAssetURLNearBundle", + value: function scaledAssetURLNearBundle() { + var path = this.jsbundleUrl || 'file://'; + return this.fromSource(path + getScaledAssetPath(this.asset).replace(/\.\.\//g, '_')); + } + }, { + key: "resourceIdentifierWithoutScale", + value: function resourceIdentifierWithoutScale() { + _$$_REQUIRE(_dependencyMap[5])(false, 'resource identifiers work on Android'); + + return this.fromSource(_$$_REQUIRE(_dependencyMap[2]).getAndroidResourceIdentifier(this.asset)); + } + }, { + key: "drawableFolderInBundle", + value: function drawableFolderInBundle() { + var path = this.jsbundleUrl || 'file://'; + return this.fromSource(path + getAssetPathInDrawableFolder(this.asset)); + } + }, { + key: "fromSource", + value: function fromSource(source) { + return { + __packager_asset: true, + width: this.asset.width, + height: this.asset.height, + uri: source, + scale: _$$_REQUIRE(_dependencyMap[0]).pickScale(this.asset.scales, _$$_REQUIRE(_dependencyMap[1]).get()) + }; + } + }]); + + return AssetSourceResolver; + }(); + + AssetSourceResolver.pickScale = _$$_REQUIRE(_dependencyMap[0]).pickScale; + module.exports = AssetSourceResolver; +},168,[169,170,173,7,8,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.pickScale = pickScale; + exports.setUrlCacheBreaker = setUrlCacheBreaker; + exports.getUrlCacheBreaker = getUrlCacheBreaker; + + var _PixelRatio = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var cacheBreaker; + var warnIfCacheBreakerUnset = true; + + function pickScale(scales, deviceScale) { + if (deviceScale == null) { + deviceScale = _PixelRatio.default.get(); + } + + for (var i = 0; i < scales.length; i++) { + if (scales[i] >= deviceScale) { + return scales[i]; + } + } + + return scales[scales.length - 1] || 1; + } + + function setUrlCacheBreaker(appendage) { + cacheBreaker = appendage; + } + + function getUrlCacheBreaker() { + if (cacheBreaker == null) { + return ''; + } + + return cacheBreaker; + } +},169,[5,170]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var PixelRatio = function () { + function PixelRatio() { + _$$_REQUIRE(_dependencyMap[0])(this, PixelRatio); + } + + _$$_REQUIRE(_dependencyMap[1])(PixelRatio, null, [{ + key: "get", + value: function get() { + return _$$_REQUIRE(_dependencyMap[2]).get('window').scale; + } + }, { + key: "getFontScale", + value: function getFontScale() { + return _$$_REQUIRE(_dependencyMap[2]).get('window').fontScale || PixelRatio.get(); + } + }, { + key: "getPixelSizeForLayoutSize", + value: function getPixelSizeForLayoutSize(layoutSize) { + return Math.round(layoutSize * PixelRatio.get()); + } + }, { + key: "roundToNearestPixel", + value: function roundToNearestPixel(layoutSize) { + var ratio = PixelRatio.get(); + return Math.round(layoutSize * ratio) / ratio; + } + }, { + key: "startDetecting", + value: function startDetecting() {} + }]); + + return PixelRatio; + }(); + + module.exports = PixelRatio; +},170,[7,8,171]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _EventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NativeDeviceInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var eventEmitter = new _EventEmitter.default(); + var dimensionsInitialized = false; + var dimensions; + + var Dimensions = function () { + function Dimensions() { + (0, _classCallCheck2.default)(this, Dimensions); + } + + (0, _createClass2.default)(Dimensions, null, [{ + key: "get", + value: function get(dim) { + (0, _invariant.default)(dimensions[dim], 'No dimension set for key ' + dim); + return dimensions[dim]; + } + }, { + key: "set", + value: function set(dims) { + var screen = dims.screen, + window = dims.window; + var windowPhysicalPixels = dims.windowPhysicalPixels; + + if (windowPhysicalPixels) { + window = { + width: windowPhysicalPixels.width / windowPhysicalPixels.scale, + height: windowPhysicalPixels.height / windowPhysicalPixels.scale, + scale: windowPhysicalPixels.scale, + fontScale: windowPhysicalPixels.fontScale + }; + } + + var screenPhysicalPixels = dims.screenPhysicalPixels; + + if (screenPhysicalPixels) { + screen = { + width: screenPhysicalPixels.width / screenPhysicalPixels.scale, + height: screenPhysicalPixels.height / screenPhysicalPixels.scale, + scale: screenPhysicalPixels.scale, + fontScale: screenPhysicalPixels.fontScale + }; + } else if (screen == null) { + screen = window; + } + + dimensions = { + window: window, + screen: screen + }; + + if (dimensionsInitialized) { + eventEmitter.emit('change', dimensions); + } else { + dimensionsInitialized = true; + } + } + }, { + key: "addEventListener", + value: function addEventListener(type, handler) { + (0, _invariant.default)(type === 'change', 'Trying to subscribe to unknown event: "%s"', type); + return eventEmitter.addListener(type, handler); + } + }, { + key: "removeEventListener", + value: function removeEventListener(type, handler) { + (0, _invariant.default)(type === 'change', 'Trying to remove listener for unknown event: "%s"', type); + eventEmitter.removeListener(type, handler); + } + }]); + return Dimensions; + }(); + + var initialDims = global.nativeExtensions && global.nativeExtensions.DeviceInfo && global.nativeExtensions.DeviceInfo.Dimensions; + + if (!initialDims) { + _RCTDeviceEventEmitter.default.addListener('didUpdateDimensions', function (update) { + Dimensions.set(update); + }); + + initialDims = _NativeDeviceInfo.default.getConstants().Dimensions; + } + + Dimensions.set(initialDims); + module.exports = Dimensions; +},171,[5,7,8,31,30,172,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NativeModule = TurboModuleRegistry.getEnforcing('DeviceInfo'); + var constants = null; + var NativeDeviceInfo = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + + return constants; + } + }; + var _default = NativeDeviceInfo; + exports.default = _default; +},172,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var androidScaleSuffix = { + '0.75': 'ldpi', + '1': 'mdpi', + '1.5': 'hdpi', + '2': 'xhdpi', + '3': 'xxhdpi', + '4': 'xxxhdpi' + }; + + function getAndroidAssetSuffix(scale) { + if (scale.toString() in androidScaleSuffix) { + return androidScaleSuffix[scale.toString()]; + } + + throw new Error('no such scale ' + scale.toString()); + } + + var drawableFileTypes = new Set(['gif', 'jpeg', 'jpg', 'png', 'svg', 'webp', 'xml']); + + function getAndroidResourceFolderName(asset, scale) { + if (!drawableFileTypes.has(asset.type)) { + return 'raw'; + } + + var suffix = getAndroidAssetSuffix(scale); + + if (!suffix) { + throw new Error("Don't know which android drawable suffix to use for scale: " + scale + '\nAsset: ' + JSON.stringify(asset, null, '\t') + '\nPossible scales are:' + JSON.stringify(androidScaleSuffix, null, '\t')); + } + + return 'drawable-' + suffix; + } + + function getAndroidResourceIdentifier(asset) { + return (getBasePath(asset) + '/' + asset.name).toLowerCase().replace(/\//g, '_').replace(/([^a-z0-9_])/g, '').replace(/^assets_/, ''); + } + + function getBasePath(asset) { + var basePath = asset.httpServerLocation; + return basePath.startsWith('/') ? basePath.substr(1) : basePath; + } + + module.exports = { + getAndroidResourceFolderName: getAndroidResourceFolderName, + getAndroidResourceIdentifier: getAndroidResourceIdentifier, + getBasePath: getBasePath + }; +},173,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = verifyComponentAttributeEquivalence; + exports.lefthandObjectDiff = lefthandObjectDiff; + exports.getConfigWithoutViewProps = getConfigWithoutViewProps; + exports.stringifyViewConfig = stringifyViewConfig; + + var _ReactNativeViewViewConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var IGNORED_KEYS = ['transform', 'hitSlop']; + + function verifyComponentAttributeEquivalence(nativeViewConfig, staticViewConfig) { + for (var _i = 0, _arr = ['validAttributes', 'bubblingEventTypes', 'directEventTypes']; _i < _arr.length; _i++) { + var prop = _arr[_i]; + var diff = Object.keys(lefthandObjectDiff(nativeViewConfig[prop], staticViewConfig[prop])); + + if (diff.length > 0) { + var _staticViewConfig$uiV; + + var name = (_staticViewConfig$uiV = staticViewConfig.uiViewClassName) != null ? _staticViewConfig$uiV : nativeViewConfig.uiViewClassName; + console.error("'" + name + "' has a view config that does not match native. " + ("'" + prop + "' is missing: " + diff.join(', '))); + } + } + } + + function lefthandObjectDiff(leftObj, rightObj) { + var differentKeys = {}; + + function compare(leftItem, rightItem, key) { + if (typeof leftItem !== typeof rightItem && leftItem != null) { + differentKeys[key] = rightItem; + return; + } + + if (typeof leftItem === 'object') { + var objDiff = lefthandObjectDiff(leftItem, rightItem); + + if (Object.keys(objDiff).length > 1) { + differentKeys[key] = objDiff; + } + + return; + } + + if (leftItem !== rightItem) { + differentKeys[key] = rightItem; + return; + } + } + + for (var key in leftObj) { + if (IGNORED_KEYS.includes(key)) { + continue; + } + + if (!rightObj) { + differentKeys[key] = {}; + } else if (leftObj.hasOwnProperty(key)) { + compare(leftObj[key], rightObj[key], key); + } + } + + return differentKeys; + } + + function getConfigWithoutViewProps(viewConfig, propName) { + if (!viewConfig[propName]) { + return {}; + } + + return Object.keys(viewConfig[propName]).filter(function (prop) { + return !_ReactNativeViewViewConfig.default[propName][prop]; + }).reduce(function (obj, prop) { + obj[prop] = viewConfig[propName][prop]; + return obj; + }, {}); + } + + function stringifyViewConfig(viewConfig) { + return JSON.stringify(viewConfig, function (key, val) { + if (typeof val === 'function') { + return "\u0192 " + val.name; + } + + return val; + }, 2); + } +},174,[5,143]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createViewConfig = createViewConfig; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReactNativeViewViewConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + function createViewConfig(partialViewConfig) { + return { + uiViewClassName: partialViewConfig.uiViewClassName, + Commands: {}, + bubblingEventTypes: composeIndexers(_ReactNativeViewViewConfig.default.bubblingEventTypes, partialViewConfig.bubblingEventTypes), + directEventTypes: composeIndexers(_ReactNativeViewViewConfig.default.directEventTypes, partialViewConfig.directEventTypes), + validAttributes: composeIndexers(_ReactNativeViewViewConfig.default.validAttributes, partialViewConfig.validAttributes) + }; + } + + function composeIndexers(maybeA, maybeB) { + var _ref; + + return maybeA == null || maybeB == null ? (_ref = maybeA != null ? maybeA : maybeB) != null ? _ref : {} : (0, _extends2.default)({}, maybeA, maybeB); + } +},175,[5,6,143]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var logListeners; + + function unstable_setLogListeners(listeners) { + logListeners = listeners; + } + + var deepDiffer = function deepDiffer(one, two) { + var maxDepthOrOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; + var maybeOptions = arguments.length > 3 ? arguments[3] : undefined; + var options = typeof maxDepthOrOptions === 'number' ? maybeOptions : maxDepthOrOptions; + var maxDepth = typeof maxDepthOrOptions === 'number' ? maxDepthOrOptions : -1; + + if (maxDepth === 0) { + return true; + } + + if (one === two) { + return false; + } + + if (typeof one === 'function' && typeof two === 'function') { + var unsafelyIgnoreFunctions = options == null ? undefined : options.unsafelyIgnoreFunctions; + + if (unsafelyIgnoreFunctions == null) { + if (logListeners && logListeners.onDifferentFunctionsIgnored && (!options || !('unsafelyIgnoreFunctions' in options))) { + logListeners.onDifferentFunctionsIgnored(one.name, two.name); + } + + unsafelyIgnoreFunctions = true; + } + + return !unsafelyIgnoreFunctions; + } + + if (typeof one !== 'object' || one === null) { + return one !== two; + } + + if (typeof two !== 'object' || two === null) { + return true; + } + + if (one.constructor !== two.constructor) { + return true; + } + + if (Array.isArray(one)) { + var len = one.length; + + if (two.length !== len) { + return true; + } + + for (var ii = 0; ii < len; ii++) { + if (deepDiffer(one[ii], two[ii], maxDepth - 1, options)) { + return true; + } + } + } else { + for (var key in one) { + if (deepDiffer(one[key], two[key], maxDepth - 1, options)) { + return true; + } + } + + for (var twoKey in two) { + if (one[twoKey] === undefined && two[twoKey] !== undefined) { + return true; + } + } + } + + return false; + }; + + module.exports = deepDiffer; + module.exports.unstable_setLogListeners = unstable_setLogListeners; +},176,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function deepFreezeAndThrowOnMutationInDev(object) { + return object; + } + + module.exports = deepFreezeAndThrowOnMutationInDev; +},177,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function flattenStyle(style) { + if (style === null || typeof style !== 'object') { + return undefined; + } + + if (!Array.isArray(style)) { + return style; + } + + var result = {}; + + for (var i = 0, styleLength = style.length; i < styleLength; ++i) { + var computedStyle = flattenStyle(style[i]); + + if (computedStyle) { + for (var key in computedStyle) { + result[key] = computedStyle[key]; + } + } + } + + return result; + } + + module.exports = flattenStyle; +},178,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var ReactFiberErrorDialog = { + showErrorDialog: function showErrorDialog(_ref) { + var componentStack = _ref.componentStack, + errorValue = _ref.error; + var error; + + if (errorValue instanceof Error) { + error = errorValue; + } else if (typeof errorValue === 'string') { + error = new (_$$_REQUIRE(_dependencyMap[0]).SyntheticError)(errorValue); + } else { + error = new (_$$_REQUIRE(_dependencyMap[0]).SyntheticError)('Unspecified error'); + } + + try { + error.componentStack = componentStack; + error.isComponentError = true; + } catch (_unused) {} + + (0, _$$_REQUIRE(_dependencyMap[0]).handleException)(error, false); + return false; + } + }; + var _default = ReactFiberErrorDialog; + exports.default = _default; +},179,[62]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + { + module.exports = _$$_REQUIRE(_dependencyMap[0]); + } +},180,[181]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** @license React v0.20.2 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + 'use strict'; + + var _f, g, h, k; + + if ("object" === typeof performance && "function" === typeof performance.now) { + var l = performance; + + exports.unstable_now = function () { + return l.now(); + }; + } else { + var p = Date, + q = p.now(); + + exports.unstable_now = function () { + return p.now() - q; + }; + } + + if ("undefined" === typeof window || "function" !== typeof MessageChannel) { + var t = null, + u = null, + w = function w() { + if (null !== t) try { + var a = exports.unstable_now(); + t(true, a); + t = null; + } catch (b) { + throw setTimeout(w, 0), b; + } + }; + + _f = function f(a) { + null !== t ? setTimeout(_f, 0, a) : (t = a, setTimeout(w, 0)); + }; + + g = function g(a, b) { + u = setTimeout(a, b); + }; + + h = function h() { + clearTimeout(u); + }; + + exports.unstable_shouldYield = function () { + return false; + }; + + k = exports.unstable_forceFrameRate = function () {}; + } else { + var x = window.setTimeout, + y = window.clearTimeout; + + if ("undefined" !== typeof console) { + var z = window.cancelAnimationFrame; + "function" !== typeof window.requestAnimationFrame && console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"); + "function" !== typeof z && console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"); + } + + var A = false, + B = null, + C = -1, + D = 5, + E = 0; + + exports.unstable_shouldYield = function () { + return exports.unstable_now() >= E; + }; + + k = function k() {}; + + exports.unstable_forceFrameRate = function (a) { + 0 > a || 125 < a ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported") : D = 0 < a ? Math.floor(1E3 / a) : 5; + }; + + var F = new MessageChannel(), + G = F.port2; + + F.port1.onmessage = function () { + if (null !== B) { + var a = exports.unstable_now(); + E = a + D; + + try { + B(true, a) ? G.postMessage(null) : (A = false, B = null); + } catch (b) { + throw G.postMessage(null), b; + } + } else A = false; + }; + + _f = function _f(a) { + B = a; + A || (A = true, G.postMessage(null)); + }; + + g = function g(a, b) { + C = x(function () { + a(exports.unstable_now()); + }, b); + }; + + h = function h() { + y(C); + C = -1; + }; + } + + function H(a, b) { + var c = a.length; + a.push(b); + + a: for (;;) { + var d = c - 1 >>> 1, + e = a[d]; + if (undefined !== e && 0 < I(e, b)) a[d] = b, a[c] = e, c = d;else break a; + } + } + + function J(a) { + a = a[0]; + return undefined === a ? null : a; + } + + function K(a) { + var b = a[0]; + + if (undefined !== b) { + var c = a.pop(); + + if (c !== b) { + a[0] = c; + + a: for (var d = 0, e = a.length; d < e;) { + var m = 2 * (d + 1) - 1, + n = a[m], + v = m + 1, + r = a[v]; + if (undefined !== n && 0 > I(n, c)) undefined !== r && 0 > I(r, n) ? (a[d] = r, a[v] = c, d = v) : (a[d] = n, a[m] = c, d = m);else if (undefined !== r && 0 > I(r, c)) a[d] = r, a[v] = c, d = v;else break a; + } + } + + return b; + } + + return null; + } + + function I(a, b) { + var c = a.sortIndex - b.sortIndex; + return 0 !== c ? c : a.id - b.id; + } + + var L = [], + M = [], + N = 1, + O = null, + P = 3, + Q = false, + R = false, + S = false; + + function T(a) { + for (var b = J(M); null !== b;) { + if (null === b.callback) K(M);else if (b.startTime <= a) K(M), b.sortIndex = b.expirationTime, H(L, b);else break; + b = J(M); + } + } + + function U(a) { + S = false; + T(a); + if (!R) if (null !== J(L)) R = true, _f(V);else { + var b = J(M); + null !== b && g(U, b.startTime - a); + } + } + + function V(a, b) { + R = false; + S && (S = false, h()); + Q = true; + var c = P; + + try { + T(b); + + for (O = J(L); null !== O && (!(O.expirationTime > b) || a && !exports.unstable_shouldYield());) { + var d = O.callback; + + if ("function" === typeof d) { + O.callback = null; + P = O.priorityLevel; + var e = d(O.expirationTime <= b); + b = exports.unstable_now(); + "function" === typeof e ? O.callback = e : O === J(L) && K(L); + T(b); + } else K(L); + + O = J(L); + } + + if (null !== O) var m = true;else { + var n = J(M); + null !== n && g(U, n.startTime - b); + m = false; + } + return m; + } finally { + O = null, P = c, Q = false; + } + } + + var W = k; + exports.unstable_IdlePriority = 5; + exports.unstable_ImmediatePriority = 1; + exports.unstable_LowPriority = 4; + exports.unstable_NormalPriority = 3; + exports.unstable_Profiling = null; + exports.unstable_UserBlockingPriority = 2; + + exports.unstable_cancelCallback = function (a) { + a.callback = null; + }; + + exports.unstable_continueExecution = function () { + R || Q || (R = true, _f(V)); + }; + + exports.unstable_getCurrentPriorityLevel = function () { + return P; + }; + + exports.unstable_getFirstCallbackNode = function () { + return J(L); + }; + + exports.unstable_next = function (a) { + switch (P) { + case 1: + case 2: + case 3: + var b = 3; + break; + + default: + b = P; + } + + var c = P; + P = b; + + try { + return a(); + } finally { + P = c; + } + }; + + exports.unstable_pauseExecution = function () {}; + + exports.unstable_requestPaint = W; + + exports.unstable_runWithPriority = function (a, b) { + switch (a) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + + default: + a = 3; + } + + var c = P; + P = a; + + try { + return b(); + } finally { + P = c; + } + }; + + exports.unstable_scheduleCallback = function (a, b, c) { + var d = exports.unstable_now(); + "object" === typeof c && null !== c ? (c = c.delay, c = "number" === typeof c && 0 < c ? d + c : d) : c = d; + + switch (a) { + case 1: + var e = -1; + break; + + case 2: + e = 250; + break; + + case 5: + e = 1073741823; + break; + + case 4: + e = 1E4; + break; + + default: + e = 5E3; + } + + e = c + e; + a = { + id: N++, + callback: b, + priorityLevel: a, + startTime: c, + expirationTime: e, + sortIndex: -1 + }; + c > d ? (a.sortIndex = c, H(M, a), null === J(L) && a === J(M) && (S ? h() : S = true, g(U, c - d))) : (a.sortIndex = e, H(L, a), R || Q || (R = true, _f(V))); + return a; + }; + + exports.unstable_wrapCallback = function (a) { + var b = P; + return function () { + var c = P; + P = b; + + try { + return a.apply(this, arguments); + } finally { + P = c; + } + }; + }; +},181,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var PlatformActivityIndicator = _Platform.default.OS === 'android' ? _$$_REQUIRE(_dependencyMap[7]) : _$$_REQUIRE(_dependencyMap[8]).default; + var GRAY = '#999999'; + + var ActivityIndicator = function ActivityIndicator(_ref, forwardedRef) { + var _ref$animating = _ref.animating, + animating = _ref$animating === undefined ? true : _ref$animating, + _ref$color = _ref.color, + color = _ref$color === undefined ? _Platform.default.OS === 'ios' ? GRAY : null : _ref$color, + _ref$hidesWhenStopped = _ref.hidesWhenStopped, + hidesWhenStopped = _ref$hidesWhenStopped === undefined ? true : _ref$hidesWhenStopped, + onLayout = _ref.onLayout, + _ref$size = _ref.size, + size = _ref$size === undefined ? 'small' : _ref$size, + style = _ref.style, + restProps = (0, _objectWithoutProperties2.default)(_ref, ["animating", "color", "hidesWhenStopped", "onLayout", "size", "style"]); + var sizeStyle; + var sizeProp; + + switch (size) { + case 'small': + sizeStyle = styles.sizeSmall; + sizeProp = 'small'; + break; + + case 'large': + sizeStyle = styles.sizeLarge; + sizeProp = 'large'; + break; + + default: + sizeStyle = { + height: size, + width: size + }; + break; + } + + var nativeProps = (0, _extends2.default)({ + animating: animating, + color: color, + hidesWhenStopped: hidesWhenStopped + }, restProps, { + ref: forwardedRef, + style: sizeStyle, + size: sizeProp + }); + var androidProps = { + styleAttr: 'Normal', + indeterminate: true + }; + return React.createElement(_View.default, { + onLayout: onLayout, + style: _StyleSheet.default.compose(styles.container, style) + }, _Platform.default.OS === 'android' ? React.createElement(PlatformActivityIndicator, (0, _extends2.default)({}, nativeProps, androidProps)) : React.createElement(PlatformActivityIndicator, nativeProps)); + }; + + var ActivityIndicatorWithRef = React.forwardRef(ActivityIndicator); + ActivityIndicatorWithRef.displayName = 'ActivityIndicator'; + + var styles = _StyleSheet.default.create({ + container: { + alignItems: 'center', + justifyContent: 'center' + }, + sizeSmall: { + width: 20, + height: 20 + }, + sizeLarge: { + width: 36, + height: 36 + } + }); + + module.exports = ActivityIndicatorWithRef; +},182,[5,6,108,17,37,183,184,187,189]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var hairlineWidth = _$$_REQUIRE(_dependencyMap[0]).roundToNearestPixel(0.4); + + if (hairlineWidth === 0) { + hairlineWidth = 1 / _$$_REQUIRE(_dependencyMap[0]).get(); + } + + var absoluteFill = { + position: 'absolute', + left: 0, + right: 0, + top: 0, + bottom: 0 + }; + module.exports = { + hairlineWidth: hairlineWidth, + absoluteFill: absoluteFill, + absoluteFillObject: absoluteFill, + compose: function compose(style1, style2) { + if (style1 != null && style2 != null) { + return [style1, style2]; + } else { + return style1 != null ? style1 : style2; + } + }, + flatten: _$$_REQUIRE(_dependencyMap[1]), + setStyleAttributePreprocessor: function setStyleAttributePreprocessor(property, process) { + var value; + + if (_$$_REQUIRE(_dependencyMap[2])[property] === true) { + value = { + process: process + }; + } else if (typeof _$$_REQUIRE(_dependencyMap[2])[property] === 'object') { + value = _$$_REQUIRE(_dependencyMap[3])({}, _$$_REQUIRE(_dependencyMap[2])[property], { + process: process + }); + } else { + console.error(property + " is not a valid style attribute"); + return; + } + + _$$_REQUIRE(_dependencyMap[2])[property] = value; + }, + create: function create(obj) { + return obj; + } + }; +},183,[170,178,162,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _TextAncestor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var View = React.forwardRef(function (props, forwardedRef) { + return React.createElement(_TextAncestor.default.Provider, { + value: false + }, React.createElement(_ViewNativeComponent.default, (0, _extends2.default)({}, props, { + ref: forwardedRef + }))); + }); + View.displayName = 'View'; + module.exports = View; +},184,[5,6,185,186,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _Platform = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + var _ReactNativeViewViewConfigAndroid = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ViewNativeComponent = NativeComponentRegistry.get('RCTView', function () { + return _Platform.default.OS === 'android' ? _ReactNativeViewViewConfigAndroid.default : { + uiViewClassName: 'RCTView' + }; + }); + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['hotspotUpdate', 'setPressed'] + }); + exports.Commands = Commands; + var _default = ViewNativeComponent; + exports.default = _default; +},185,[154,5,37,141,144,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var React = _$$_REQUIRE(_dependencyMap[0]); + + var TextAncestorContext = React.createContext(false); + module.exports = TextAncestorContext; +},186,[17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]); +},187,[188]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var UnimplementedView = function (_React$Component) { + (0, _inherits2.default)(UnimplementedView, _React$Component); + + var _super = _createSuper(UnimplementedView); + + function UnimplementedView() { + (0, _classCallCheck2.default)(this, UnimplementedView); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(UnimplementedView, [{ + key: "render", + value: function render() { + var View = _$$_REQUIRE(_dependencyMap[8]); + + return React.createElement(View, { + style: [styles.unimplementedView, this.props.style] + }, this.props.children); + } + }]); + return UnimplementedView; + }(React.Component); + + var styles = _StyleSheet.default.create({ + unimplementedView: {} + }); + + module.exports = UnimplementedView; +},188,[5,7,8,12,14,16,17,183,184]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('ActivityIndicatorView', { + paperComponentName: 'RCTActivityIndicatorView' + }); + + exports.default = _default; +},189,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _requireNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _UIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + function codegenNativeComponent(componentName, options) { + var componentNameInUse = options && options.paperComponentName != null ? options.paperComponentName : componentName; + + if (options != null && options.paperComponentNameDeprecated != null) { + if (_UIManager.default.getViewManagerConfig(componentName)) { + componentNameInUse = componentName; + } else if (options.paperComponentNameDeprecated != null && _UIManager.default.getViewManagerConfig(options.paperComponentNameDeprecated)) { + componentNameInUse = options.paperComponentNameDeprecated; + } else { + var _options$paperCompone; + + throw new Error("Failed to find native component for either " + componentName + " or " + ((_options$paperCompone = options.paperComponentNameDeprecated) != null ? _options$paperCompone : '(unknown)')); + } + } + + return (0, _requireNativeComponent.default)(componentNameInUse); + } + + var _default = codegenNativeComponent; + exports.default = _default; +},190,[5,191,155]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var requireNativeComponent = function requireNativeComponent(uiViewClassName) { + return _$$_REQUIRE(_dependencyMap[0])(uiViewClassName, function () { + return _$$_REQUIRE(_dependencyMap[1])(uiViewClassName); + }); + }; + + module.exports = requireNativeComponent; +},191,[192,161]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var register = _$$_REQUIRE(_dependencyMap[0]).ReactNativeViewConfigRegistry.register; + + var createReactNativeComponentClass = function createReactNativeComponentClass(name, callback) { + return register(name, callback); + }; + + module.exports = createReactNativeComponentClass; +},192,[136]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Text = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _TouchableNativeFeedback = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _TouchableOpacity = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Button = function (_React$Component) { + (0, _inherits2.default)(Button, _React$Component); + + var _super = _createSuper(Button); + + function Button() { + (0, _classCallCheck2.default)(this, Button); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Button, [{ + key: "render", + value: function render() { + var _this$props$accessibi, _this$props$accessibi2; + + var _this$props = this.props, + accessibilityLabel = _this$props.accessibilityLabel, + color = _this$props.color, + onPress = _this$props.onPress, + touchSoundDisabled = _this$props.touchSoundDisabled, + title = _this$props.title, + hasTVPreferredFocus = _this$props.hasTVPreferredFocus, + nextFocusDown = _this$props.nextFocusDown, + nextFocusForward = _this$props.nextFocusForward, + nextFocusLeft = _this$props.nextFocusLeft, + nextFocusRight = _this$props.nextFocusRight, + nextFocusUp = _this$props.nextFocusUp, + testID = _this$props.testID, + accessible = _this$props.accessible, + accessibilityActions = _this$props.accessibilityActions, + accessibilityHint = _this$props.accessibilityHint, + onAccessibilityAction = _this$props.onAccessibilityAction; + var buttonStyles = [styles.button]; + var textStyles = [styles.text]; + + if (color) { + if (_Platform.default.OS === 'ios') { + textStyles.push({ + color: color + }); + } else { + buttonStyles.push({ + backgroundColor: color + }); + } + } + + var disabled = this.props.disabled != null ? this.props.disabled : (_this$props$accessibi = this.props.accessibilityState) == null ? undefined : _this$props$accessibi.disabled; + var accessibilityState = disabled !== ((_this$props$accessibi2 = this.props.accessibilityState) == null ? undefined : _this$props$accessibi2.disabled) ? (0, _extends2.default)({}, this.props.accessibilityState, { + disabled: disabled + }) : this.props.accessibilityState; + + if (disabled) { + buttonStyles.push(styles.buttonDisabled); + textStyles.push(styles.textDisabled); + } + + (0, _invariant.default)(typeof title === 'string', 'The title prop of a Button must be a string'); + var formattedTitle = _Platform.default.OS === 'android' ? title.toUpperCase() : title; + var Touchable = _Platform.default.OS === 'android' ? _TouchableNativeFeedback.default : _TouchableOpacity.default; + return React.createElement(Touchable, { + accessible: accessible, + accessibilityActions: accessibilityActions, + onAccessibilityAction: onAccessibilityAction, + accessibilityLabel: accessibilityLabel, + accessibilityHint: accessibilityHint, + accessibilityRole: "button", + accessibilityState: accessibilityState, + hasTVPreferredFocus: hasTVPreferredFocus, + nextFocusDown: nextFocusDown, + nextFocusForward: nextFocusForward, + nextFocusLeft: nextFocusLeft, + nextFocusRight: nextFocusRight, + nextFocusUp: nextFocusUp, + testID: testID, + disabled: disabled, + onPress: onPress, + touchSoundDisabled: touchSoundDisabled + }, React.createElement(_View.default, { + style: buttonStyles + }, React.createElement(_Text.default, { + style: textStyles, + disabled: disabled + }, formattedTitle))); + } + }]); + return Button; + }(React.Component); + + var styles = _StyleSheet.default.create({ + button: _Platform.default.select({ + ios: {}, + android: { + elevation: 4, + backgroundColor: '#2196F3', + borderRadius: 2 + } + }), + text: (0, _extends2.default)({ + textAlign: 'center', + margin: 8 + }, _Platform.default.select({ + ios: { + color: '#007AFF', + fontSize: 18 + }, + android: { + color: 'white', + fontWeight: '500' + } + })), + buttonDisabled: _Platform.default.select({ + ios: {}, + android: { + elevation: 0, + backgroundColor: '#dfdfdf' + } + }), + textDisabled: _Platform.default.select({ + ios: { + color: '#cdcdcd' + }, + android: { + color: '#a1a1a1' + } + }) + }); + + module.exports = Button; +},193,[5,6,7,8,12,14,16,17,37,183,194,219,220,184,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _DeprecatedTextPropTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var PressabilityDebug = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _usePressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _processColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _TextAncestor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Text = React.forwardRef(function (props, forwardedRef) { + var accessible = props.accessible, + allowFontScaling = props.allowFontScaling, + ellipsizeMode = props.ellipsizeMode, + onLongPress = props.onLongPress, + onPress = props.onPress, + _onPressIn = props.onPressIn, + _onPressOut = props.onPressOut, + _onResponderGrant = props.onResponderGrant, + _onResponderMove = props.onResponderMove, + _onResponderRelease = props.onResponderRelease, + _onResponderTerminate = props.onResponderTerminate, + onResponderTerminationRequest = props.onResponderTerminationRequest, + onStartShouldSetResponder = props.onStartShouldSetResponder, + pressRetentionOffset = props.pressRetentionOffset, + suppressHighlighting = props.suppressHighlighting, + restProps = (0, _objectWithoutProperties2.default)(props, ["accessible", "allowFontScaling", "ellipsizeMode", "onLongPress", "onPress", "onPressIn", "onPressOut", "onResponderGrant", "onResponderMove", "onResponderRelease", "onResponderTerminate", "onResponderTerminationRequest", "onStartShouldSetResponder", "pressRetentionOffset", "suppressHighlighting"]); + + var _useState = (0, React.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + isHighlighted = _useState2[0], + setHighlighted = _useState2[1]; + + var isPressable = (onPress != null || onLongPress != null || onStartShouldSetResponder != null) && restProps.disabled !== true; + var initialized = useLazyInitialization(isPressable); + var config = (0, React.useMemo)(function () { + return initialized ? { + disabled: !isPressable, + pressRectOffset: pressRetentionOffset, + onLongPress: onLongPress, + onPress: onPress, + onPressIn: function onPressIn(event) { + setHighlighted(!suppressHighlighting); + _onPressIn == null ? undefined : _onPressIn(event); + }, + onPressOut: function onPressOut(event) { + setHighlighted(false); + _onPressOut == null ? undefined : _onPressOut(event); + }, + onResponderTerminationRequest_DEPRECATED: onResponderTerminationRequest, + onStartShouldSetResponder_DEPRECATED: onStartShouldSetResponder + } : null; + }, [initialized, isPressable, pressRetentionOffset, onLongPress, onPress, _onPressIn, _onPressOut, onResponderTerminationRequest, onStartShouldSetResponder, suppressHighlighting]); + var eventHandlers = (0, _usePressability.default)(config); + var eventHandlersForText = (0, React.useMemo)(function () { + return eventHandlers == null ? null : { + onResponderGrant: function onResponderGrant(event) { + eventHandlers.onResponderGrant(event); + + if (_onResponderGrant != null) { + _onResponderGrant(event); + } + }, + onResponderMove: function onResponderMove(event) { + eventHandlers.onResponderMove(event); + + if (_onResponderMove != null) { + _onResponderMove(event); + } + }, + onResponderRelease: function onResponderRelease(event) { + eventHandlers.onResponderRelease(event); + + if (_onResponderRelease != null) { + _onResponderRelease(event); + } + }, + onResponderTerminate: function onResponderTerminate(event) { + eventHandlers.onResponderTerminate(event); + + if (_onResponderTerminate != null) { + _onResponderTerminate(event); + } + }, + onResponderTerminationRequest: eventHandlers.onResponderTerminationRequest, + onStartShouldSetResponder: eventHandlers.onStartShouldSetResponder + }; + }, [eventHandlers, _onResponderGrant, _onResponderMove, _onResponderRelease, _onResponderTerminate]); + var selectionColor = restProps.selectionColor == null ? null : (0, _processColor.default)(restProps.selectionColor); + var style = restProps.style; + var numberOfLines = restProps.numberOfLines; + + if (numberOfLines != null && !(numberOfLines >= 0)) { + console.error("'numberOfLines' in must be a non-negative number, received: " + numberOfLines + ". The value will be set to 0."); + numberOfLines = 0; + } + + var hasTextAncestor = (0, React.useContext)(_TextAncestor.default); + return hasTextAncestor ? React.createElement(_$$_REQUIRE(_dependencyMap[12]).NativeVirtualText, (0, _extends2.default)({}, restProps, eventHandlersForText, { + isHighlighted: isHighlighted, + numberOfLines: numberOfLines, + selectionColor: selectionColor, + style: style, + ref: forwardedRef + })) : React.createElement(_TextAncestor.default.Provider, { + value: true + }, React.createElement(_$$_REQUIRE(_dependencyMap[12]).NativeText, (0, _extends2.default)({}, restProps, eventHandlersForText, { + accessible: accessible !== false, + allowFontScaling: allowFontScaling !== false, + ellipsizeMode: ellipsizeMode != null ? ellipsizeMode : 'tail', + isHighlighted: isHighlighted, + numberOfLines: numberOfLines, + selectionColor: selectionColor, + style: style, + ref: forwardedRef + }))); + }); + Text.displayName = 'Text'; + Text.propTypes = _DeprecatedTextPropTypes.default; + + function useLazyInitialization(newValue) { + var _useState3 = (0, React.useState)(newValue), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + oldValue = _useState4[0], + setValue = _useState4[1]; + + if (!oldValue && newValue) { + setValue(newValue); + } + + return oldValue; + } + + module.exports = Text; +},194,[5,6,41,108,195,209,210,183,145,186,17,36,217]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var stylePropType = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var DataDetectorTypes = ['phoneNumber', 'link', 'email', 'none', 'all']; + module.exports = { + ellipsizeMode: _$$_REQUIRE(_dependencyMap[2]).oneOf(['head', 'middle', 'tail', 'clip']), + numberOfLines: _$$_REQUIRE(_dependencyMap[2]).number, + textBreakStrategy: _$$_REQUIRE(_dependencyMap[2]).oneOf(['simple', 'highQuality', 'balanced']), + onLayout: _$$_REQUIRE(_dependencyMap[2]).func, + onPress: _$$_REQUIRE(_dependencyMap[2]).func, + onLongPress: _$$_REQUIRE(_dependencyMap[2]).func, + pressRetentionOffset: _$$_REQUIRE(_dependencyMap[3]), + selectable: _$$_REQUIRE(_dependencyMap[2]).bool, + selectionColor: _$$_REQUIRE(_dependencyMap[4]), + suppressHighlighting: _$$_REQUIRE(_dependencyMap[2]).bool, + style: stylePropType, + testID: _$$_REQUIRE(_dependencyMap[2]).string, + nativeID: _$$_REQUIRE(_dependencyMap[2]).string, + allowFontScaling: _$$_REQUIRE(_dependencyMap[2]).bool, + maxFontSizeMultiplier: _$$_REQUIRE(_dependencyMap[2]).number, + accessible: _$$_REQUIRE(_dependencyMap[2]).bool, + adjustsFontSizeToFit: _$$_REQUIRE(_dependencyMap[2]).bool, + minimumFontScale: _$$_REQUIRE(_dependencyMap[2]).number, + disabled: _$$_REQUIRE(_dependencyMap[2]).bool, + dataDetectorType: _$$_REQUIRE(_dependencyMap[2]).oneOf(DataDetectorTypes) + }; +},195,[196,198,201,208,205]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function DeprecatedStyleSheetPropType(shape) { + var shapePropType = _$$_REQUIRE(_dependencyMap[0])(shape); + + return function (props, propName, componentName, location) { + var newProps = props; + + if (props[propName]) { + newProps = {}; + newProps[propName] = _$$_REQUIRE(_dependencyMap[1])(props[propName]); + } + + for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) { + rest[_key - 4] = arguments[_key]; + } + + return shapePropType.apply(undefined, [newProps, propName, componentName, location].concat(rest)); + }; + } + + module.exports = DeprecatedStyleSheetPropType; +},196,[197,178]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function deprecatedCreateStrictShapeTypeChecker(shapeTypes) { + function checkType(isRequired, props, propName, componentName, location) { + if (!props[propName]) { + if (isRequired) { + _$$_REQUIRE(_dependencyMap[0])(false, "Required object `" + propName + "` was not specified in " + ("`" + componentName + "`.")); + } + + return; + } + + var propValue = props[propName]; + var propType = typeof propValue; + var locationName = location || '(unknown)'; + + if (propType !== 'object') { + _$$_REQUIRE(_dependencyMap[0])(false, "Invalid " + locationName + " `" + propName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); + } + + var allKeys = _$$_REQUIRE(_dependencyMap[1])({}, props[propName], shapeTypes); + + for (var _len = arguments.length, rest = new Array(_len > 5 ? _len - 5 : 0), _key = 5; _key < _len; _key++) { + rest[_key - 5] = arguments[_key]; + } + + for (var _key2 in allKeys) { + var checker = shapeTypes[_key2]; + + if (!checker) { + _$$_REQUIRE(_dependencyMap[0])(false, "Invalid props." + propName + " key `" + _key2 + "` supplied to `" + componentName + "`." + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')); + } + + var error = checker.apply(undefined, [propValue, _key2, componentName, location].concat(rest)); + + if (error) { + _$$_REQUIRE(_dependencyMap[0])(false, error.message + '\nBad object: ' + JSON.stringify(props[propName], null, ' ')); + } + } + } + + function chainedCheckType(props, propName, componentName, location) { + for (var _len2 = arguments.length, rest = new Array(_len2 > 4 ? _len2 - 4 : 0), _key3 = 4; _key3 < _len2; _key3++) { + rest[_key3 - 4] = arguments[_key3]; + } + + return checkType.apply(undefined, [false, props, propName, componentName, location].concat(rest)); + } + + chainedCheckType.isRequired = checkType.bind(null, true); + return chainedCheckType; + } + + module.exports = deprecatedCreateStrictShapeTypeChecker; +},197,[36,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DeprecatedTextStylePropTypes = _$$_REQUIRE(_dependencyMap[0])({}, _$$_REQUIRE(_dependencyMap[1]), { + color: _$$_REQUIRE(_dependencyMap[2]), + fontFamily: _$$_REQUIRE(_dependencyMap[3]).string, + fontSize: _$$_REQUIRE(_dependencyMap[3]).number, + fontStyle: _$$_REQUIRE(_dependencyMap[3]).oneOf(['normal', 'italic']), + fontWeight: _$$_REQUIRE(_dependencyMap[3]).oneOf(['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900']), + fontVariant: _$$_REQUIRE(_dependencyMap[3]).arrayOf(_$$_REQUIRE(_dependencyMap[3]).oneOf(['small-caps', 'oldstyle-nums', 'lining-nums', 'tabular-nums', 'proportional-nums'])), + textShadowOffset: _$$_REQUIRE(_dependencyMap[3]).shape({ + width: _$$_REQUIRE(_dependencyMap[3]).number, + height: _$$_REQUIRE(_dependencyMap[3]).number + }), + textShadowRadius: _$$_REQUIRE(_dependencyMap[3]).number, + textShadowColor: _$$_REQUIRE(_dependencyMap[2]), + letterSpacing: _$$_REQUIRE(_dependencyMap[3]).number, + lineHeight: _$$_REQUIRE(_dependencyMap[3]).number, + textAlign: _$$_REQUIRE(_dependencyMap[3]).oneOf(['auto', 'left', 'right', 'center', 'justify']), + textAlignVertical: _$$_REQUIRE(_dependencyMap[3]).oneOf(['auto', 'top', 'bottom', 'center']), + includeFontPadding: _$$_REQUIRE(_dependencyMap[3]).bool, + textDecorationLine: _$$_REQUIRE(_dependencyMap[3]).oneOf(['none', 'underline', 'line-through', 'underline line-through']), + textDecorationStyle: _$$_REQUIRE(_dependencyMap[3]).oneOf(['solid', 'double', 'dotted', 'dashed']), + textDecorationColor: _$$_REQUIRE(_dependencyMap[2]), + textTransform: _$$_REQUIRE(_dependencyMap[3]).oneOf(['none', 'capitalize', 'uppercase', 'lowercase']), + writingDirection: _$$_REQUIRE(_dependencyMap[3]).oneOf(['auto', 'ltr', 'rtl']) + }); + + module.exports = DeprecatedTextStylePropTypes; +},198,[6,199,205,201]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DeprecatedViewStylePropTypes = _$$_REQUIRE(_dependencyMap[0])({}, _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), { + backfaceVisibility: _$$_REQUIRE(_dependencyMap[4]).oneOf(['visible', 'hidden']), + backgroundColor: _$$_REQUIRE(_dependencyMap[5]), + borderColor: _$$_REQUIRE(_dependencyMap[5]), + borderTopColor: _$$_REQUIRE(_dependencyMap[5]), + borderRightColor: _$$_REQUIRE(_dependencyMap[5]), + borderBottomColor: _$$_REQUIRE(_dependencyMap[5]), + borderLeftColor: _$$_REQUIRE(_dependencyMap[5]), + borderStartColor: _$$_REQUIRE(_dependencyMap[5]), + borderEndColor: _$$_REQUIRE(_dependencyMap[5]), + borderRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderTopLeftRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderTopRightRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderTopStartRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderTopEndRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderBottomLeftRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderBottomRightRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderBottomStartRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderBottomEndRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderStyle: _$$_REQUIRE(_dependencyMap[4]).oneOf(['solid', 'dotted', 'dashed']), + borderWidth: _$$_REQUIRE(_dependencyMap[4]).number, + borderTopWidth: _$$_REQUIRE(_dependencyMap[4]).number, + borderRightWidth: _$$_REQUIRE(_dependencyMap[4]).number, + borderBottomWidth: _$$_REQUIRE(_dependencyMap[4]).number, + borderLeftWidth: _$$_REQUIRE(_dependencyMap[4]).number, + opacity: _$$_REQUIRE(_dependencyMap[4]).number, + elevation: _$$_REQUIRE(_dependencyMap[4]).number + }); + + module.exports = DeprecatedViewStylePropTypes; +},199,[6,200,204,206,201,205]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var LayoutPropTypes = { + display: _$$_REQUIRE(_dependencyMap[0]).oneOf(['none', 'flex']), + width: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + height: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + start: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + end: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + top: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + left: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + right: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + bottom: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + minWidth: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + maxWidth: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + minHeight: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + maxHeight: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + margin: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginVertical: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginHorizontal: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginTop: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginBottom: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginLeft: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginRight: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginStart: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + marginEnd: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + padding: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingVertical: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingHorizontal: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingTop: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingBottom: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingLeft: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingRight: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingStart: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + paddingEnd: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + borderWidth: _$$_REQUIRE(_dependencyMap[0]).number, + borderTopWidth: _$$_REQUIRE(_dependencyMap[0]).number, + borderStartWidth: _$$_REQUIRE(_dependencyMap[0]).number, + borderEndWidth: _$$_REQUIRE(_dependencyMap[0]).number, + borderRightWidth: _$$_REQUIRE(_dependencyMap[0]).number, + borderBottomWidth: _$$_REQUIRE(_dependencyMap[0]).number, + borderLeftWidth: _$$_REQUIRE(_dependencyMap[0]).number, + position: _$$_REQUIRE(_dependencyMap[0]).oneOf(['absolute', 'relative']), + flexDirection: _$$_REQUIRE(_dependencyMap[0]).oneOf(['row', 'row-reverse', 'column', 'column-reverse']), + flexWrap: _$$_REQUIRE(_dependencyMap[0]).oneOf(['wrap', 'nowrap', 'wrap-reverse']), + justifyContent: _$$_REQUIRE(_dependencyMap[0]).oneOf(['flex-start', 'flex-end', 'center', 'space-between', 'space-around', 'space-evenly']), + alignItems: _$$_REQUIRE(_dependencyMap[0]).oneOf(['flex-start', 'flex-end', 'center', 'stretch', 'baseline']), + alignSelf: _$$_REQUIRE(_dependencyMap[0]).oneOf(['auto', 'flex-start', 'flex-end', 'center', 'stretch', 'baseline']), + alignContent: _$$_REQUIRE(_dependencyMap[0]).oneOf(['flex-start', 'flex-end', 'center', 'stretch', 'space-between', 'space-around']), + overflow: _$$_REQUIRE(_dependencyMap[0]).oneOf(['visible', 'hidden', 'scroll']), + flex: _$$_REQUIRE(_dependencyMap[0]).number, + flexGrow: _$$_REQUIRE(_dependencyMap[0]).number, + flexShrink: _$$_REQUIRE(_dependencyMap[0]).number, + flexBasis: _$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).string]), + aspectRatio: _$$_REQUIRE(_dependencyMap[0]).number, + zIndex: _$$_REQUIRE(_dependencyMap[0]).number, + direction: _$$_REQUIRE(_dependencyMap[0]).oneOf(['inherit', 'ltr', 'rtl']) + }; + module.exports = LayoutPropTypes; +},200,[201]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + { + module.exports = _$$_REQUIRE(_dependencyMap[0])(); + } +},201,[202]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function emptyFunction() {} + + function emptyFunctionWithReset() {} + + emptyFunctionWithReset.resetWarningCache = emptyFunction; + + module.exports = function () { + function shim(props, propName, componentName, location, propFullName, secret) { + if (secret === _$$_REQUIRE(_dependencyMap[0])) { + return; + } + + var err = new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"); + err.name = 'Invariant Violation'; + throw err; + } + + ; + shim.isRequired = shim; + + function getShim() { + return shim; + } + + ; + var ReactPropTypes = { + array: shim, + bool: shim, + func: shim, + number: shim, + object: shim, + string: shim, + symbol: shim, + any: shim, + arrayOf: getShim, + element: shim, + elementType: shim, + instanceOf: getShim, + node: shim, + objectOf: getShim, + oneOf: getShim, + oneOfType: getShim, + shape: getShim, + exact: getShim, + checkPropTypes: emptyFunctionWithReset, + resetWarningCache: emptyFunction + }; + ReactPropTypes.PropTypes = ReactPropTypes; + return ReactPropTypes; + }; +},202,[203]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + module.exports = ReactPropTypesSecret; +},203,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DeprecatedShadowPropTypesIOS = { + shadowColor: _$$_REQUIRE(_dependencyMap[0]), + shadowOffset: _$$_REQUIRE(_dependencyMap[1]).shape({ + width: _$$_REQUIRE(_dependencyMap[1]).number, + height: _$$_REQUIRE(_dependencyMap[1]).number + }), + shadowOpacity: _$$_REQUIRE(_dependencyMap[1]).number, + shadowRadius: _$$_REQUIRE(_dependencyMap[1]).number + }; + module.exports = DeprecatedShadowPropTypesIOS; +},204,[205,201]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var colorPropType = function colorPropType(isRequired, props, propName, componentName, location, propFullName) { + var color = props[propName]; + + if (color === undefined || color === null) { + if (isRequired) { + return new Error('Required ' + location + ' `' + (propFullName || propName) + '` was not specified in `' + componentName + '`.'); + } + + return; + } + + if (typeof color === 'number') { + return; + } + + if (_$$_REQUIRE(_dependencyMap[0])(color) === null) { + return new Error('Invalid ' + location + ' `' + (propFullName || propName) + '` supplied to `' + componentName + '`: ' + color + '\n' + "Valid color formats are\n - '#f0f' (#rgb)\n - '#f0fc' (#rgba)\n - '#ff00ff' (#rrggbb)\n - '#ff00ff00' (#rrggbbaa)\n - 'rgb(255, 255, 255)'\n - 'rgba(255, 255, 255, 1.0)'\n - 'hsl(360, 100%, 100%)'\n - 'hsla(360, 100%, 100%, 1.0)'\n - 'transparent'\n - 'red'\n - 0xff00ff00 (0xrrggbbaa)\n"); + } + }; + + var ColorPropType = colorPropType.bind(null, false); + ColorPropType.isRequired = colorPropType.bind(null, true); + module.exports = ColorPropType; +},205,[146]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var TransformMatrixPropType = function TransformMatrixPropType(props, propName, componentName) { + if (props[propName]) { + return new Error("The transformMatrix style property is deprecated. Use `transform: [{ matrix: ... }]` instead."); + } + }; + + var DecomposedMatrixPropType = function DecomposedMatrixPropType(props, propName, componentName) { + if (props[propName]) { + return new Error("The decomposedMatrix style property is deprecated. Use `transform: [...]` instead."); + } + }; + + var DeprecatedTransformPropTypes = { + transform: _$$_REQUIRE(_dependencyMap[0]).arrayOf(_$$_REQUIRE(_dependencyMap[0]).oneOfType([_$$_REQUIRE(_dependencyMap[0]).shape({ + perspective: _$$_REQUIRE(_dependencyMap[0]).number + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + rotate: _$$_REQUIRE(_dependencyMap[0]).string + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + rotateX: _$$_REQUIRE(_dependencyMap[0]).string + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + rotateY: _$$_REQUIRE(_dependencyMap[0]).string + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + rotateZ: _$$_REQUIRE(_dependencyMap[0]).string + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + scale: _$$_REQUIRE(_dependencyMap[0]).number + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + scaleX: _$$_REQUIRE(_dependencyMap[0]).number + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + scaleY: _$$_REQUIRE(_dependencyMap[0]).number + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + translateX: _$$_REQUIRE(_dependencyMap[0]).number + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + translateY: _$$_REQUIRE(_dependencyMap[0]).number + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + skewX: _$$_REQUIRE(_dependencyMap[0]).string + }), _$$_REQUIRE(_dependencyMap[0]).shape({ + skewY: _$$_REQUIRE(_dependencyMap[0]).string + })])), + transformMatrix: TransformMatrixPropType, + decomposedMatrix: DecomposedMatrixPropType, + scaleX: _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[0]).number, 'Use the transform prop instead.'), + scaleY: _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[0]).number, 'Use the transform prop instead.'), + rotation: _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[0]).number, 'Use the transform prop instead.'), + translateX: _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[0]).number, 'Use the transform prop instead.'), + translateY: _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[0]).number, 'Use the transform prop instead.') + }; + module.exports = DeprecatedTransformPropTypes; +},206,[201,207]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _UIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function deprecatedPropType(propType, explanation) { + return function validate(props, propName, componentName) { + if (global.RN$Bridgeless !== true && !_UIManager.default.hasViewManagerConfig(componentName) && props[propName] !== undefined) { + console.warn("`" + propName + "` supplied to `" + componentName + "` has been deprecated. " + explanation); + } + + for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) { + rest[_key - 3] = arguments[_key]; + } + + return propType.apply(undefined, [props, propName, componentName].concat(rest)); + }; + } + + module.exports = deprecatedPropType; +},207,[5,155]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DeprecatedEdgeInsetsPropType = _$$_REQUIRE(_dependencyMap[0]).shape({ + top: _$$_REQUIRE(_dependencyMap[0]).number, + left: _$$_REQUIRE(_dependencyMap[0]).number, + bottom: _$$_REQUIRE(_dependencyMap[0]).number, + right: _$$_REQUIRE(_dependencyMap[0]).number + }); + + module.exports = DeprecatedEdgeInsetsPropType; +},208,[201]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PressabilityDebugView = PressabilityDebugView; + exports.isEnabled = isEnabled; + exports.setEnabled = setEnabled; + + var _normalizeColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function PressabilityDebugView(_ref) { + var color = _ref.color, + hitSlop = _ref.hitSlop; + return null; + } + + var isDebugEnabled = false; + + function isEnabled() { + return false; + } + + function setEnabled(value) {} +},209,[5,146,184,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = usePressability; + + var _Pressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[2]); + + function usePressability(config) { + var pressabilityRef = (0, _react.useRef)(null); + + if (config != null && pressabilityRef.current == null) { + pressabilityRef.current = new _Pressability.default(config); + } + + var pressability = pressabilityRef.current; + (0, _react.useEffect)(function () { + if (config != null && pressability != null) { + pressability.configure(config); + } + }, [config, pressability]); + (0, _react.useEffect)(function () { + if (pressability != null) { + return function () { + pressability.reset(); + }; + } + }, [pressability]); + return pressability == null ? null : pressability.getEventHandlers(); + } +},210,[5,211,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _SoundManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _PressabilityPerformanceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _UIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Transitions = Object.freeze({ + NOT_RESPONDER: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN', + RESPONDER_RELEASE: 'ERROR', + RESPONDER_TERMINATED: 'ERROR', + ENTER_PRESS_RECT: 'ERROR', + LEAVE_PRESS_RECT: 'ERROR', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_INACTIVE_PRESS_IN: { + DELAY: 'RESPONDER_ACTIVE_PRESS_IN', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_INACTIVE_PRESS_OUT: { + DELAY: 'RESPONDER_ACTIVE_PRESS_OUT', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_INACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_ACTIVE_PRESS_IN: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN' + }, + RESPONDER_ACTIVE_PRESS_OUT: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + RESPONDER_ACTIVE_LONG_PRESS_IN: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', + LONG_PRESS_DETECTED: 'RESPONDER_ACTIVE_LONG_PRESS_IN' + }, + RESPONDER_ACTIVE_LONG_PRESS_OUT: { + DELAY: 'ERROR', + RESPONDER_GRANT: 'ERROR', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_IN', + LEAVE_PRESS_RECT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', + LONG_PRESS_DETECTED: 'ERROR' + }, + ERROR: { + DELAY: 'NOT_RESPONDER', + RESPONDER_GRANT: 'RESPONDER_INACTIVE_PRESS_IN', + RESPONDER_RELEASE: 'NOT_RESPONDER', + RESPONDER_TERMINATED: 'NOT_RESPONDER', + ENTER_PRESS_RECT: 'NOT_RESPONDER', + LEAVE_PRESS_RECT: 'NOT_RESPONDER', + LONG_PRESS_DETECTED: 'NOT_RESPONDER' + } + }); + + var isActiveSignal = function isActiveSignal(signal) { + return signal === 'RESPONDER_ACTIVE_PRESS_IN' || signal === 'RESPONDER_ACTIVE_LONG_PRESS_IN'; + }; + + var isActivationSignal = function isActivationSignal(signal) { + return signal === 'RESPONDER_ACTIVE_PRESS_OUT' || signal === 'RESPONDER_ACTIVE_PRESS_IN'; + }; + + var isPressInSignal = function isPressInSignal(signal) { + return signal === 'RESPONDER_INACTIVE_PRESS_IN' || signal === 'RESPONDER_ACTIVE_PRESS_IN' || signal === 'RESPONDER_ACTIVE_LONG_PRESS_IN'; + }; + + var isTerminalSignal = function isTerminalSignal(signal) { + return signal === 'RESPONDER_TERMINATED' || signal === 'RESPONDER_RELEASE'; + }; + + var DEFAULT_LONG_PRESS_DELAY_MS = 500; + var DEFAULT_PRESS_RECT_OFFSETS = { + bottom: 30, + left: 20, + right: 20, + top: 20 + }; + var DEFAULT_MIN_PRESS_DURATION = 130; + + var Pressability = function () { + function Pressability(config) { + var _this = this; + + (0, _classCallCheck2.default)(this, Pressability); + this._eventHandlers = null; + this._hoverInDelayTimeout = null; + this._hoverOutDelayTimeout = null; + this._isHovered = false; + this._longPressDelayTimeout = null; + this._pressDelayTimeout = null; + this._pressOutDelayTimeout = null; + this._responderID = null; + this._responderRegion = null; + this._touchState = 'NOT_RESPONDER'; + + this._measureCallback = function (left, top, width, height, pageX, pageY) { + if (!left && !top && !width && !height && !pageX && !pageY) { + return; + } + + _this._responderRegion = { + bottom: pageY + height, + left: pageX, + right: pageX + width, + top: pageY + }; + }; + + this.configure(config); + } + + (0, _createClass2.default)(Pressability, [{ + key: "configure", + value: function configure(config) { + this._config = config; + } + }, { + key: "reset", + value: function reset() { + this._cancelHoverInDelayTimeout(); + + this._cancelHoverOutDelayTimeout(); + + this._cancelLongPressDelayTimeout(); + + this._cancelPressDelayTimeout(); + + this._cancelPressOutDelayTimeout(); + + this._config = Object.freeze({}); + } + }, { + key: "getEventHandlers", + value: function getEventHandlers() { + if (this._eventHandlers == null) { + this._eventHandlers = this._createEventHandlers(); + } + + return this._eventHandlers; + } + }, { + key: "_createEventHandlers", + value: function _createEventHandlers() { + var _this2 = this; + + var focusEventHandlers = { + onBlur: function onBlur(event) { + var onBlur = _this2._config.onBlur; + + if (onBlur != null) { + onBlur(event); + } + }, + onFocus: function onFocus(event) { + var onFocus = _this2._config.onFocus; + + if (onFocus != null) { + onFocus(event); + } + } + }; + var responderEventHandlers = { + onStartShouldSetResponder: function onStartShouldSetResponder() { + var disabled = _this2._config.disabled; + + if (disabled == null) { + var onStartShouldSetResponder_DEPRECATED = _this2._config.onStartShouldSetResponder_DEPRECATED; + return onStartShouldSetResponder_DEPRECATED == null ? true : onStartShouldSetResponder_DEPRECATED(); + } + + return !disabled; + }, + onResponderGrant: function onResponderGrant(event) { + event.persist(); + + _this2._cancelPressOutDelayTimeout(); + + _this2._responderID = event.currentTarget; + _this2._touchState = 'NOT_RESPONDER'; + + _this2._receiveSignal('RESPONDER_GRANT', event); + + var delayPressIn = normalizeDelay(_this2._config.delayPressIn); + + if (delayPressIn > 0) { + _this2._pressDelayTimeout = setTimeout(function () { + _this2._receiveSignal('DELAY', event); + }, delayPressIn); + } else { + _this2._receiveSignal('DELAY', event); + } + + var delayLongPress = normalizeDelay(_this2._config.delayLongPress, 10, DEFAULT_LONG_PRESS_DELAY_MS - delayPressIn); + _this2._longPressDelayTimeout = setTimeout(function () { + _this2._handleLongPress(event); + }, delayLongPress + delayPressIn); + }, + onResponderMove: function onResponderMove(event) { + var onPressMove = _this2._config.onPressMove; + + if (onPressMove != null) { + onPressMove(event); + } + + var responderRegion = _this2._responderRegion; + + if (responderRegion == null) { + return; + } + + var touch = getTouchFromPressEvent(event); + + if (touch == null) { + _this2._cancelLongPressDelayTimeout(); + + _this2._receiveSignal('LEAVE_PRESS_RECT', event); + + return; + } + + if (_this2._touchActivatePosition != null) { + var deltaX = _this2._touchActivatePosition.pageX - touch.pageX; + var deltaY = _this2._touchActivatePosition.pageY - touch.pageY; + + if (Math.hypot(deltaX, deltaY) > 10) { + _this2._cancelLongPressDelayTimeout(); + } + } + + if (_this2._isTouchWithinResponderRegion(touch, responderRegion)) { + _this2._receiveSignal('ENTER_PRESS_RECT', event); + } else { + _this2._cancelLongPressDelayTimeout(); + + _this2._receiveSignal('LEAVE_PRESS_RECT', event); + } + }, + onResponderRelease: function onResponderRelease(event) { + _this2._receiveSignal('RESPONDER_RELEASE', event); + }, + onResponderTerminate: function onResponderTerminate(event) { + _this2._receiveSignal('RESPONDER_TERMINATED', event); + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + var cancelable = _this2._config.cancelable; + + if (cancelable == null) { + var onResponderTerminationRequest_DEPRECATED = _this2._config.onResponderTerminationRequest_DEPRECATED; + return onResponderTerminationRequest_DEPRECATED == null ? true : onResponderTerminationRequest_DEPRECATED(); + } + + return cancelable; + }, + onClick: function onClick(event) { + var _this2$_config = _this2._config, + onPress = _this2$_config.onPress, + disabled = _this2$_config.disabled; + + if (onPress != null && disabled !== true) { + onPress(event); + } + } + }; + var mouseEventHandlers = _Platform.default.OS === 'ios' || _Platform.default.OS === 'android' ? null : { + onMouseEnter: function onMouseEnter(event) { + if ((0, _$$_REQUIRE(_dependencyMap[10]).isHoverEnabled)()) { + _this2._isHovered = true; + + _this2._cancelHoverOutDelayTimeout(); + + var onHoverIn = _this2._config.onHoverIn; + + if (onHoverIn != null) { + var delayHoverIn = normalizeDelay(_this2._config.delayHoverIn); + + if (delayHoverIn > 0) { + event.persist(); + _this2._hoverInDelayTimeout = setTimeout(function () { + onHoverIn(event); + }, delayHoverIn); + } else { + onHoverIn(event); + } + } + } + }, + onMouseLeave: function onMouseLeave(event) { + if (_this2._isHovered) { + _this2._isHovered = false; + + _this2._cancelHoverInDelayTimeout(); + + var onHoverOut = _this2._config.onHoverOut; + + if (onHoverOut != null) { + var delayHoverOut = normalizeDelay(_this2._config.delayHoverOut); + + if (delayHoverOut > 0) { + event.persist(); + _this2._hoverInDelayTimeout = setTimeout(function () { + onHoverOut(event); + }, delayHoverOut); + } else { + onHoverOut(event); + } + } + } + } + }; + return (0, _extends2.default)({}, focusEventHandlers, responderEventHandlers, mouseEventHandlers); + } + }, { + key: "_receiveSignal", + value: function _receiveSignal(signal, event) { + var _Transitions$prevStat; + + if (event.nativeEvent.timestamp != null) { + _PressabilityPerformanceEventEmitter.default.emitEvent(function () { + return { + signal: signal, + nativeTimestamp: event.nativeEvent.timestamp + }; + }); + } + + var prevState = this._touchState; + var nextState = (_Transitions$prevStat = Transitions[prevState]) == null ? undefined : _Transitions$prevStat[signal]; + + if (this._responderID == null && signal === 'RESPONDER_RELEASE') { + return; + } + + (0, _invariant.default)(nextState != null && nextState !== 'ERROR', 'Pressability: Invalid signal `%s` for state `%s` on responder: %s', signal, prevState, typeof this._responderID === 'number' ? this._responderID : '<>'); + + if (prevState !== nextState) { + this._performTransitionSideEffects(prevState, nextState, signal, event); + + this._touchState = nextState; + } + } + }, { + key: "_performTransitionSideEffects", + value: function _performTransitionSideEffects(prevState, nextState, signal, event) { + if (isTerminalSignal(signal)) { + this._touchActivatePosition = null; + + this._cancelLongPressDelayTimeout(); + } + + var isInitialTransition = prevState === 'NOT_RESPONDER' && nextState === 'RESPONDER_INACTIVE_PRESS_IN'; + var isActivationTransition = !isActivationSignal(prevState) && isActivationSignal(nextState); + + if (isInitialTransition || isActivationTransition) { + this._measureResponderRegion(); + } + + if (isPressInSignal(prevState) && signal === 'LONG_PRESS_DETECTED') { + var onLongPress = this._config.onLongPress; + + if (onLongPress != null) { + onLongPress(event); + } + } + + var isPrevActive = isActiveSignal(prevState); + var isNextActive = isActiveSignal(nextState); + + if (!isPrevActive && isNextActive) { + this._activate(event); + } else if (isPrevActive && !isNextActive) { + this._deactivate(event); + } + + if (isPressInSignal(prevState) && signal === 'RESPONDER_RELEASE') { + if (!isNextActive && !isPrevActive) { + this._activate(event); + + this._deactivate(event); + } + + var _this$_config = this._config, + _onLongPress = _this$_config.onLongPress, + onPress = _this$_config.onPress, + android_disableSound = _this$_config.android_disableSound; + + if (onPress != null) { + var isPressCanceledByLongPress = _onLongPress != null && prevState === 'RESPONDER_ACTIVE_LONG_PRESS_IN' && this._shouldLongPressCancelPress(); + + if (!isPressCanceledByLongPress) { + if (_Platform.default.OS === 'android' && android_disableSound !== true) { + _SoundManager.default.playTouchSound(); + } + + onPress(event); + } + } + } + + this._cancelPressDelayTimeout(); + } + }, { + key: "_activate", + value: function _activate(event) { + var onPressIn = this._config.onPressIn; + + var _getTouchFromPressEve = getTouchFromPressEvent(event), + pageX = _getTouchFromPressEve.pageX, + pageY = _getTouchFromPressEve.pageY; + + this._touchActivatePosition = { + pageX: pageX, + pageY: pageY + }; + this._touchActivateTime = Date.now(); + + if (onPressIn != null) { + onPressIn(event); + } + } + }, { + key: "_deactivate", + value: function _deactivate(event) { + var onPressOut = this._config.onPressOut; + + if (onPressOut != null) { + var _this$_touchActivateT; + + var minPressDuration = normalizeDelay(this._config.minPressDuration, 0, DEFAULT_MIN_PRESS_DURATION); + var pressDuration = Date.now() - ((_this$_touchActivateT = this._touchActivateTime) != null ? _this$_touchActivateT : 0); + var delayPressOut = Math.max(minPressDuration - pressDuration, normalizeDelay(this._config.delayPressOut)); + + if (delayPressOut > 0) { + event.persist(); + this._pressOutDelayTimeout = setTimeout(function () { + onPressOut(event); + }, delayPressOut); + } else { + onPressOut(event); + } + } + + this._touchActivateTime = null; + } + }, { + key: "_measureResponderRegion", + value: function _measureResponderRegion() { + if (this._responderID == null) { + return; + } + + if (typeof this._responderID === 'number') { + _UIManager.default.measure(this._responderID, this._measureCallback); + } else { + this._responderID.measure(this._measureCallback); + } + } + }, { + key: "_isTouchWithinResponderRegion", + value: function _isTouchWithinResponderRegion(touch, responderRegion) { + var _pressRectOffset$bott, _pressRectOffset$left, _pressRectOffset$righ, _pressRectOffset$top; + + var hitSlop = (0, _$$_REQUIRE(_dependencyMap[11]).normalizeRect)(this._config.hitSlop); + var pressRectOffset = (0, _$$_REQUIRE(_dependencyMap[11]).normalizeRect)(this._config.pressRectOffset); + var regionBottom = responderRegion.bottom; + var regionLeft = responderRegion.left; + var regionRight = responderRegion.right; + var regionTop = responderRegion.top; + + if (hitSlop != null) { + if (hitSlop.bottom != null) { + regionBottom += hitSlop.bottom; + } + + if (hitSlop.left != null) { + regionLeft -= hitSlop.left; + } + + if (hitSlop.right != null) { + regionRight += hitSlop.right; + } + + if (hitSlop.top != null) { + regionTop -= hitSlop.top; + } + } + + regionBottom += (_pressRectOffset$bott = pressRectOffset == null ? undefined : pressRectOffset.bottom) != null ? _pressRectOffset$bott : DEFAULT_PRESS_RECT_OFFSETS.bottom; + regionLeft -= (_pressRectOffset$left = pressRectOffset == null ? undefined : pressRectOffset.left) != null ? _pressRectOffset$left : DEFAULT_PRESS_RECT_OFFSETS.left; + regionRight += (_pressRectOffset$righ = pressRectOffset == null ? undefined : pressRectOffset.right) != null ? _pressRectOffset$righ : DEFAULT_PRESS_RECT_OFFSETS.right; + regionTop -= (_pressRectOffset$top = pressRectOffset == null ? undefined : pressRectOffset.top) != null ? _pressRectOffset$top : DEFAULT_PRESS_RECT_OFFSETS.top; + return touch.pageX > regionLeft && touch.pageX < regionRight && touch.pageY > regionTop && touch.pageY < regionBottom; + } + }, { + key: "_handleLongPress", + value: function _handleLongPress(event) { + if (this._touchState === 'RESPONDER_ACTIVE_PRESS_IN' || this._touchState === 'RESPONDER_ACTIVE_LONG_PRESS_IN') { + this._receiveSignal('LONG_PRESS_DETECTED', event); + } + } + }, { + key: "_shouldLongPressCancelPress", + value: function _shouldLongPressCancelPress() { + return this._config.onLongPressShouldCancelPress_DEPRECATED == null || this._config.onLongPressShouldCancelPress_DEPRECATED(); + } + }, { + key: "_cancelHoverInDelayTimeout", + value: function _cancelHoverInDelayTimeout() { + if (this._hoverInDelayTimeout != null) { + clearTimeout(this._hoverInDelayTimeout); + this._hoverInDelayTimeout = null; + } + } + }, { + key: "_cancelHoverOutDelayTimeout", + value: function _cancelHoverOutDelayTimeout() { + if (this._hoverOutDelayTimeout != null) { + clearTimeout(this._hoverOutDelayTimeout); + this._hoverOutDelayTimeout = null; + } + } + }, { + key: "_cancelLongPressDelayTimeout", + value: function _cancelLongPressDelayTimeout() { + if (this._longPressDelayTimeout != null) { + clearTimeout(this._longPressDelayTimeout); + this._longPressDelayTimeout = null; + } + } + }, { + key: "_cancelPressDelayTimeout", + value: function _cancelPressDelayTimeout() { + if (this._pressDelayTimeout != null) { + clearTimeout(this._pressDelayTimeout); + this._pressDelayTimeout = null; + } + } + }, { + key: "_cancelPressOutDelayTimeout", + value: function _cancelPressOutDelayTimeout() { + if (this._pressOutDelayTimeout != null) { + clearTimeout(this._pressOutDelayTimeout); + this._pressOutDelayTimeout = null; + } + } + }]); + return Pressability; + }(); + + exports.default = Pressability; + + function normalizeDelay(delay) { + var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var fallback = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + return Math.max(min, delay != null ? delay : fallback); + } + + var getTouchFromPressEvent = function getTouchFromPressEvent(event) { + var _event$nativeEvent = event.nativeEvent, + changedTouches = _event$nativeEvent.changedTouches, + touches = _event$nativeEvent.touches; + + if (touches != null && touches.length > 0) { + return touches[0]; + } + + if (changedTouches != null && changedTouches.length > 0) { + return changedTouches[0]; + } + + return event.nativeEvent; + }; +},211,[5,6,7,8,36,212,214,37,155,17,215,216]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeSoundManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var SoundManager = { + playTouchSound: function playTouchSound() { + if (_NativeSoundManager.default) { + _NativeSoundManager.default.playTouchSound(); + } + } + }; + module.exports = SoundManager; +},212,[5,213]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('SoundManager'); + + exports.default = _default; +},213,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var PressabilityPerformanceEventEmitter = function () { + function PressabilityPerformanceEventEmitter() { + (0, _classCallCheck2.default)(this, PressabilityPerformanceEventEmitter); + this._listeners = []; + } + + (0, _createClass2.default)(PressabilityPerformanceEventEmitter, [{ + key: "addListener", + value: function addListener(listener) { + this._listeners.push(listener); + } + }, { + key: "removeListener", + value: function removeListener(listener) { + var index = this._listeners.indexOf(listener); + + if (index > -1) { + this._listeners.splice(index, 1); + } + } + }, { + key: "emitEvent", + value: function emitEvent(constructEvent) { + if (this._listeners.length === 0) { + return; + } + + var event = constructEvent(); + + this._listeners.forEach(function (listener) { + return listener(event); + }); + } + }]); + return PressabilityPerformanceEventEmitter; + }(); + + var PressabilityPerformanceEventEmitterSingleton = new PressabilityPerformanceEventEmitter(); + var _default = PressabilityPerformanceEventEmitterSingleton; + exports.default = _default; +},214,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.isHoverEnabled = isHoverEnabled; + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var isEnabled = false; + + if (_Platform.default.OS === 'web') { + var canUseDOM = Boolean(typeof window !== 'undefined' && window.document && window.document.createElement); + + if (canUseDOM) { + var HOVER_THRESHOLD_MS = 1000; + var lastTouchTimestamp = 0; + + var enableHover = function enableHover() { + if (isEnabled || Date.now() - lastTouchTimestamp < HOVER_THRESHOLD_MS) { + return; + } + + isEnabled = true; + }; + + var disableHover = function disableHover() { + lastTouchTimestamp = Date.now(); + + if (isEnabled) { + isEnabled = false; + } + }; + + document.addEventListener('touchstart', disableHover, true); + document.addEventListener('touchmove', disableHover, true); + document.addEventListener('mousemove', enableHover, true); + } + } + + function isHoverEnabled() { + return isEnabled; + } +},215,[5,37]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createSquare = createSquare; + exports.normalizeRect = normalizeRect; + + function createSquare(size) { + return { + bottom: size, + left: size, + right: size, + top: size + }; + } + + function normalizeRect(rectOrSize) { + return typeof rectOrSize === 'number' ? createSquare(rectOrSize) : rectOrSize; + } +},216,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NativeVirtualText = exports.NativeText = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReactNativeViewAttributes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _UIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createReactNativeComponentClass = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var NativeText = (0, _createReactNativeComponentClass.default)('RCTText', function () { + return { + validAttributes: (0, _extends2.default)({}, _ReactNativeViewAttributes.default.UIView, { + isHighlighted: true, + numberOfLines: true, + ellipsizeMode: true, + allowFontScaling: true, + maxFontSizeMultiplier: true, + disabled: true, + selectable: true, + selectionColor: true, + adjustsFontSizeToFit: true, + minimumFontScale: true, + textBreakStrategy: true, + onTextLayout: true, + onInlineViewLayout: true, + dataDetectorType: true, + android_hyphenationFrequency: true + }), + directEventTypes: { + topTextLayout: { + registrationName: 'onTextLayout' + }, + topInlineViewLayout: { + registrationName: 'onInlineViewLayout' + } + }, + uiViewClassName: 'RCTText' + }; + }); + exports.NativeText = NativeText; + var NativeVirtualText = !global.RN$Bridgeless && !_UIManager.default.hasViewManagerConfig('RCTVirtualText') ? NativeText : (0, _createReactNativeComponentClass.default)('RCTVirtualText', function () { + return { + validAttributes: (0, _extends2.default)({}, _ReactNativeViewAttributes.default.UIView, { + isHighlighted: true, + maxFontSizeMultiplier: true + }), + uiViewClassName: 'RCTVirtualText' + }; + }); + exports.NativeVirtualText = NativeVirtualText; +},217,[5,6,218,155,192]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReactNativeStyleAttributes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var UIView = { + pointerEvents: true, + accessible: true, + accessibilityActions: true, + accessibilityLabel: true, + accessibilityLiveRegion: true, + accessibilityRole: true, + accessibilityState: true, + accessibilityValue: true, + accessibilityHint: true, + importantForAccessibility: true, + nativeID: true, + testID: true, + renderToHardwareTextureAndroid: true, + shouldRasterizeIOS: true, + onLayout: true, + onAccessibilityAction: true, + onAccessibilityTap: true, + onMagicTap: true, + onAccessibilityEscape: true, + collapsable: true, + needsOffscreenAlphaCompositing: true, + style: _ReactNativeStyleAttributes.default + }; + var RCTView = (0, _extends2.default)({}, UIView, { + removeClippedSubviews: true + }); + var ReactNativeViewAttributes = { + UIView: UIView, + RCTView: RCTView + }; + module.exports = ReactNativeViewAttributes; +},218,[5,6,162]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Pressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _ReactNative = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _processColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TouchableNativeFeedback = function (_React$Component) { + (0, _inherits2.default)(TouchableNativeFeedback, _React$Component); + + var _super = _createSuper(TouchableNativeFeedback); + + function TouchableNativeFeedback() { + var _this; + + (0, _classCallCheck2.default)(this, TouchableNativeFeedback); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + pressability: new _Pressability.default(_this._createPressabilityConfig()) + }; + return _this; + } + + (0, _createClass2.default)(TouchableNativeFeedback, [{ + key: "_createPressabilityConfig", + value: function _createPressabilityConfig() { + var _this$props$accessibi, + _this2 = this; + + return { + cancelable: !this.props.rejectResponderTermination, + disabled: this.props.disabled != null ? this.props.disabled : (_this$props$accessibi = this.props.accessibilityState) == null ? undefined : _this$props$accessibi.disabled, + hitSlop: this.props.hitSlop, + delayLongPress: this.props.delayLongPress, + delayPressIn: this.props.delayPressIn, + delayPressOut: this.props.delayPressOut, + minPressDuration: 0, + pressRectOffset: this.props.pressRetentionOffset, + android_disableSound: this.props.touchSoundDisabled, + onLongPress: this.props.onLongPress, + onPress: this.props.onPress, + onPressIn: function onPressIn(event) { + if (_Platform.default.OS === 'android') { + _this2._dispatchHotspotUpdate(event); + + _this2._dispatchPressedStateChange(true); + } + + if (_this2.props.onPressIn != null) { + _this2.props.onPressIn(event); + } + }, + onPressMove: function onPressMove(event) { + if (_Platform.default.OS === 'android') { + _this2._dispatchHotspotUpdate(event); + } + }, + onPressOut: function onPressOut(event) { + if (_Platform.default.OS === 'android') { + _this2._dispatchPressedStateChange(false); + } + + if (_this2.props.onPressOut != null) { + _this2.props.onPressOut(event); + } + } + }; + } + }, { + key: "_dispatchPressedStateChange", + value: function _dispatchPressedStateChange(pressed) { + if (_Platform.default.OS === 'android') { + var hostComponentRef = _ReactNative.default.findHostInstance_DEPRECATED(this); + + if (hostComponentRef == null) { + console.warn("Touchable: Unable to find HostComponent instance. Has your Touchable component been unmounted?"); + } else { + _$$_REQUIRE(_dependencyMap[15]).Commands.setPressed(hostComponentRef, pressed); + } + } + } + }, { + key: "_dispatchHotspotUpdate", + value: function _dispatchHotspotUpdate(event) { + if (_Platform.default.OS === 'android') { + var _event$nativeEvent = event.nativeEvent, + locationX = _event$nativeEvent.locationX, + locationY = _event$nativeEvent.locationY; + + var hostComponentRef = _ReactNative.default.findHostInstance_DEPRECATED(this); + + if (hostComponentRef == null) { + console.warn("Touchable: Unable to find HostComponent instance. Has your Touchable component been unmounted?"); + } else { + _$$_REQUIRE(_dependencyMap[15]).Commands.hotspotUpdate(hostComponentRef, locationX != null ? locationX : 0, locationY != null ? locationY : 0); + } + } + } + }, { + key: "render", + value: function render() { + var element = React.Children.only(this.props.children); + var children = [element.props.children]; + + var _this$state$pressabil = this.state.pressability.getEventHandlers(), + onBlur = _this$state$pressabil.onBlur, + onFocus = _this$state$pressabil.onFocus, + eventHandlersWithoutBlurAndFocus = (0, _objectWithoutProperties2.default)(_this$state$pressabil, ["onBlur", "onFocus"]); + + var accessibilityState = this.props.disabled != null ? (0, _extends2.default)({}, this.props.accessibilityState, { + disabled: this.props.disabled + }) : this.props.accessibilityState; + return React.cloneElement.apply(React, [element, (0, _extends2.default)({}, eventHandlersWithoutBlurAndFocus, getBackgroundProp(this.props.background === undefined ? TouchableNativeFeedback.SelectableBackground() : this.props.background, this.props.useForeground === true), { + accessible: this.props.accessible !== false, + accessibilityHint: this.props.accessibilityHint, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityRole: this.props.accessibilityRole, + accessibilityState: accessibilityState, + accessibilityActions: this.props.accessibilityActions, + onAccessibilityAction: this.props.onAccessibilityAction, + accessibilityValue: this.props.accessibilityValue, + importantForAccessibility: this.props.importantForAccessibility, + accessibilityLiveRegion: this.props.accessibilityLiveRegion, + accessibilityViewIsModal: this.props.accessibilityViewIsModal, + accessibilityElementsHidden: this.props.accessibilityElementsHidden, + hasTVPreferredFocus: this.props.hasTVPreferredFocus, + hitSlop: this.props.hitSlop, + focusable: this.props.focusable !== false && this.props.onPress !== undefined && !this.props.disabled, + nativeID: this.props.nativeID, + nextFocusDown: this.props.nextFocusDown, + nextFocusForward: this.props.nextFocusForward, + nextFocusLeft: this.props.nextFocusLeft, + nextFocusRight: this.props.nextFocusRight, + nextFocusUp: this.props.nextFocusUp, + onLayout: this.props.onLayout, + testID: this.props.testID + })].concat(children)); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + this.state.pressability.configure(this._createPressabilityConfig()); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.state.pressability.reset(); + } + }]); + return TouchableNativeFeedback; + }(React.Component); + + TouchableNativeFeedback.SelectableBackground = function (rippleRadius) { + return { + type: 'ThemeAttrAndroid', + attribute: 'selectableItemBackground', + rippleRadius: rippleRadius + }; + }; + + TouchableNativeFeedback.SelectableBackgroundBorderless = function (rippleRadius) { + return { + type: 'ThemeAttrAndroid', + attribute: 'selectableItemBackgroundBorderless', + rippleRadius: rippleRadius + }; + }; + + TouchableNativeFeedback.Ripple = function (color, borderless, rippleRadius) { + var processedColor = (0, _processColor.default)(color); + (0, _invariant.default)(processedColor == null || typeof processedColor === 'number', 'Unexpected color given for Ripple color'); + return { + type: 'RippleAndroid', + color: processedColor, + borderless: borderless, + rippleRadius: rippleRadius + }; + }; + + TouchableNativeFeedback.canUseNativeForeground = function () { + return _Platform.default.OS === 'android' && _Platform.default.Version >= 23; + }; + + var getBackgroundProp = _Platform.default.OS === 'android' ? function (background, useForeground) { + return useForeground && TouchableNativeFeedback.canUseNativeForeground() ? { + nativeForegroundAndroid: background + } : { + nativeBackgroundAndroid: background + }; + } : function (background, useForeground) { + return null; + }; + TouchableNativeFeedback.displayName = 'TouchableNativeFeedback'; + module.exports = TouchableNativeFeedback; +},219,[5,6,108,7,8,12,14,16,211,54,37,184,145,17,36,185]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Pressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Animated = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Easing = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _flattenStyle2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TouchableOpacity = function (_React$Component) { + (0, _inherits2.default)(TouchableOpacity, _React$Component); + + var _super = _createSuper(TouchableOpacity); + + function TouchableOpacity() { + var _this; + + (0, _classCallCheck2.default)(this, TouchableOpacity); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + anim: new _Animated.default.Value(_this._getChildStyleOpacityWithDefault()), + pressability: new _Pressability.default(_this._createPressabilityConfig()) + }; + return _this; + } + + (0, _createClass2.default)(TouchableOpacity, [{ + key: "_createPressabilityConfig", + value: function _createPressabilityConfig() { + var _this$props$disabled, + _this$props$accessibi, + _this2 = this; + + return { + cancelable: !this.props.rejectResponderTermination, + disabled: (_this$props$disabled = this.props.disabled) != null ? _this$props$disabled : (_this$props$accessibi = this.props.accessibilityState) == null ? undefined : _this$props$accessibi.disabled, + hitSlop: this.props.hitSlop, + delayLongPress: this.props.delayLongPress, + delayPressIn: this.props.delayPressIn, + delayPressOut: this.props.delayPressOut, + minPressDuration: 0, + pressRectOffset: this.props.pressRetentionOffset, + onBlur: function onBlur(event) { + if (_Platform.default.isTV) { + _this2._opacityInactive(250); + } + + if (_this2.props.onBlur != null) { + _this2.props.onBlur(event); + } + }, + onFocus: function onFocus(event) { + if (_Platform.default.isTV) { + _this2._opacityActive(150); + } + + if (_this2.props.onFocus != null) { + _this2.props.onFocus(event); + } + }, + onLongPress: this.props.onLongPress, + onPress: this.props.onPress, + onPressIn: function onPressIn(event) { + _this2._opacityActive(event.dispatchConfig.registrationName === 'onResponderGrant' ? 0 : 150); + + if (_this2.props.onPressIn != null) { + _this2.props.onPressIn(event); + } + }, + onPressOut: function onPressOut(event) { + _this2._opacityInactive(250); + + if (_this2.props.onPressOut != null) { + _this2.props.onPressOut(event); + } + } + }; + } + }, { + key: "_setOpacityTo", + value: function _setOpacityTo(toValue, duration) { + _Animated.default.timing(this.state.anim, { + toValue: toValue, + duration: duration, + easing: _Easing.default.inOut(_Easing.default.quad), + useNativeDriver: true + }).start(); + } + }, { + key: "_opacityActive", + value: function _opacityActive(duration) { + var _this$props$activeOpa; + + this._setOpacityTo((_this$props$activeOpa = this.props.activeOpacity) != null ? _this$props$activeOpa : 0.2, duration); + } + }, { + key: "_opacityInactive", + value: function _opacityInactive(duration) { + this._setOpacityTo(this._getChildStyleOpacityWithDefault(), duration); + } + }, { + key: "_getChildStyleOpacityWithDefault", + value: function _getChildStyleOpacityWithDefault() { + var _flattenStyle; + + var opacity = (_flattenStyle = (0, _flattenStyle2.default)(this.props.style)) == null ? undefined : _flattenStyle.opacity; + return typeof opacity === 'number' ? opacity : 1; + } + }, { + key: "render", + value: function render() { + var _this$state$pressabil = this.state.pressability.getEventHandlers(), + onBlur = _this$state$pressabil.onBlur, + onFocus = _this$state$pressabil.onFocus, + eventHandlersWithoutBlurAndFocus = (0, _objectWithoutProperties2.default)(_this$state$pressabil, ["onBlur", "onFocus"]); + + var accessibilityState = this.props.disabled != null ? (0, _extends2.default)({}, this.props.accessibilityState, { + disabled: this.props.disabled + }) : this.props.accessibilityState; + return React.createElement(_Animated.default.View, (0, _extends2.default)({ + accessible: this.props.accessible !== false, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityHint: this.props.accessibilityHint, + accessibilityRole: this.props.accessibilityRole, + accessibilityState: accessibilityState, + accessibilityActions: this.props.accessibilityActions, + onAccessibilityAction: this.props.onAccessibilityAction, + accessibilityValue: this.props.accessibilityValue, + importantForAccessibility: this.props.importantForAccessibility, + accessibilityLiveRegion: this.props.accessibilityLiveRegion, + accessibilityViewIsModal: this.props.accessibilityViewIsModal, + accessibilityElementsHidden: this.props.accessibilityElementsHidden, + style: [this.props.style, { + opacity: this.state.anim + }], + nativeID: this.props.nativeID, + testID: this.props.testID, + onLayout: this.props.onLayout, + nextFocusDown: this.props.nextFocusDown, + nextFocusForward: this.props.nextFocusForward, + nextFocusLeft: this.props.nextFocusLeft, + nextFocusRight: this.props.nextFocusRight, + nextFocusUp: this.props.nextFocusUp, + hasTVPreferredFocus: this.props.hasTVPreferredFocus, + hitSlop: this.props.hitSlop, + focusable: this.props.focusable !== false && this.props.onPress !== undefined, + ref: this.props.hostRef + }, eventHandlersWithoutBlurAndFocus), this.props.children, null); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + this.state.pressability.configure(this._createPressabilityConfig()); + + if (this.props.disabled !== prevProps.disabled) { + this._opacityInactive(250); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.state.pressability.reset(); + } + }]); + return TouchableOpacity; + }(React.Component); + + var Touchable = React.forwardRef(function (props, ref) { + return React.createElement(TouchableOpacity, (0, _extends2.default)({}, props, { + hostRef: ref + })); + }); + Touchable.displayName = 'TouchableOpacity'; + module.exports = Touchable; +},220,[5,6,108,7,8,12,14,16,211,221,245,178,37,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var Animated = _Platform.default.isTesting ? _$$_REQUIRE(_dependencyMap[3]) : _$$_REQUIRE(_dependencyMap[4]); + module.exports = (0, _extends2.default)({ + get FlatList() { + return _$$_REQUIRE(_dependencyMap[5]); + }, + + get Image() { + return _$$_REQUIRE(_dependencyMap[6]); + }, + + get ScrollView() { + return _$$_REQUIRE(_dependencyMap[7]); + }, + + get SectionList() { + return _$$_REQUIRE(_dependencyMap[8]); + }, + + get Text() { + return _$$_REQUIRE(_dependencyMap[9]); + }, + + get View() { + return _$$_REQUIRE(_dependencyMap[10]); + } + + }, Animated); +},221,[5,6,37,222,233,255,283,293,294,297,298]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var emptyAnimation = { + start: function start() {}, + stop: function stop() {}, + reset: function reset() {}, + _startNativeLoop: function _startNativeLoop() {}, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return false; + } + }; + + var spring = function spring(value, config) { + var anyValue = value; + return _$$_REQUIRE(_dependencyMap[0])({}, emptyAnimation, { + start: function start(callback) { + anyValue.setValue(config.toValue); + callback && callback({ + finished: true + }); + } + }); + }; + + var timing = function timing(value, config) { + var anyValue = value; + return _$$_REQUIRE(_dependencyMap[0])({}, emptyAnimation, { + start: function start(callback) { + anyValue.setValue(config.toValue); + callback && callback({ + finished: true + }); + } + }); + }; + + var decay = function decay(value, config) { + return emptyAnimation; + }; + + var sequence = function sequence(animations) { + return emptyAnimation; + }; + + var parallel = function parallel(animations, config) { + return emptyAnimation; + }; + + var delay = function delay(time) { + return emptyAnimation; + }; + + var stagger = function stagger(time, animations) { + return emptyAnimation; + }; + + var loop = function loop(animation) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$iterations = _ref.iterations, + iterations = _ref$iterations === undefined ? -1 : _ref$iterations; + + return emptyAnimation; + }; + + module.exports = { + Value: _$$_REQUIRE(_dependencyMap[1]), + ValueXY: _$$_REQUIRE(_dependencyMap[2]), + Interpolation: _$$_REQUIRE(_dependencyMap[3]), + Node: _$$_REQUIRE(_dependencyMap[4]), + decay: decay, + timing: timing, + spring: spring, + add: _$$_REQUIRE(_dependencyMap[5]).add, + subtract: _$$_REQUIRE(_dependencyMap[5]).subtract, + divide: _$$_REQUIRE(_dependencyMap[5]).divide, + multiply: _$$_REQUIRE(_dependencyMap[5]).multiply, + modulo: _$$_REQUIRE(_dependencyMap[5]).modulo, + diffClamp: _$$_REQUIRE(_dependencyMap[5]).diffClamp, + delay: delay, + sequence: sequence, + parallel: parallel, + stagger: stagger, + loop: loop, + event: _$$_REQUIRE(_dependencyMap[5]).event, + createAnimatedComponent: _$$_REQUIRE(_dependencyMap[6]), + attachNativeEvent: _$$_REQUIRE(_dependencyMap[7]).attachNativeEvent, + forkEvent: _$$_REQUIRE(_dependencyMap[5]).forkEvent, + unforkEvent: _$$_REQUIRE(_dependencyMap[5]).unforkEvent, + Event: _$$_REQUIRE(_dependencyMap[7]).AnimatedEvent + }; +},222,[6,223,232,227,229,233,249,248]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function _flush(rootNode) { + var animatedStyles = new Set(); + + function findAnimatedStyles(node) { + if (typeof node.update === 'function') { + animatedStyles.add(node); + } else { + node.__getChildren().forEach(findAnimatedStyles); + } + } + + findAnimatedStyles(rootNode); + animatedStyles.forEach(function (animatedStyle) { + return animatedStyle.update(); + }); + } + + function _executeAsAnimatedBatch(id, operation) { + _$$_REQUIRE(_dependencyMap[2]).API.setWaitingForIdentifier(id); + + operation(); + + _$$_REQUIRE(_dependencyMap[2]).API.unsetWaitingForIdentifier(id); + } + + var AnimatedValue = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[3])(AnimatedValue, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedValue); + + function AnimatedValue(value) { + var _this; + + _$$_REQUIRE(_dependencyMap[4])(this, AnimatedValue); + + _this = _super.call(this); + + if (typeof value !== 'number') { + throw new Error('AnimatedValue: Attempting to set value to undefined'); + } + + _this._startingValue = _this._value = value; + _this._offset = 0; + _this._animation = null; + return _this; + } + + _$$_REQUIRE(_dependencyMap[5])(AnimatedValue, [{ + key: "__detach", + value: function __detach() { + var _this2 = this; + + if (this.__isNative) { + _$$_REQUIRE(_dependencyMap[2]).API.getValue(this.__getNativeTag(), function (value) { + _this2._value = value; + }); + } + + this.stopAnimation(); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedValue.prototype), "__detach", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._value + this._offset; + } + }, { + key: "setValue", + value: function setValue(value) { + var _this3 = this; + + if (this._animation) { + this._animation.stop(); + + this._animation = null; + } + + this._updateValue(value, !this.__isNative); + + if (this.__isNative) { + _executeAsAnimatedBatch(this.__getNativeTag().toString(), function () { + _$$_REQUIRE(_dependencyMap[2]).API.setAnimatedNodeValue(_this3.__getNativeTag(), value); + }); + } + } + }, { + key: "setOffset", + value: function setOffset(offset) { + this._offset = offset; + + if (this.__isNative) { + _$$_REQUIRE(_dependencyMap[2]).API.setAnimatedNodeOffset(this.__getNativeTag(), offset); + } + } + }, { + key: "flattenOffset", + value: function flattenOffset() { + this._value += this._offset; + this._offset = 0; + + if (this.__isNative) { + _$$_REQUIRE(_dependencyMap[2]).API.flattenAnimatedNodeOffset(this.__getNativeTag()); + } + } + }, { + key: "extractOffset", + value: function extractOffset() { + this._offset += this._value; + this._value = 0; + + if (this.__isNative) { + _$$_REQUIRE(_dependencyMap[2]).API.extractAnimatedNodeOffset(this.__getNativeTag()); + } + } + }, { + key: "stopAnimation", + value: function stopAnimation(callback) { + this.stopTracking(); + this._animation && this._animation.stop(); + this._animation = null; + callback && callback(this.__getValue()); + } + }, { + key: "resetAnimation", + value: function resetAnimation(callback) { + this.stopAnimation(callback); + this._value = this._startingValue; + + if (this.__isNative) { + _$$_REQUIRE(_dependencyMap[2]).API.setAnimatedNodeValue(this.__getNativeTag(), this._startingValue); + } + } + }, { + key: "_onAnimatedValueUpdateReceived", + value: function _onAnimatedValueUpdateReceived(value) { + this._updateValue(value, false); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new (_$$_REQUIRE(_dependencyMap[7]))(this, config); + } + }, { + key: "animate", + value: function animate(animation, callback) { + var _this4 = this; + + var handle = null; + + if (animation.__isInteraction) { + handle = _$$_REQUIRE(_dependencyMap[8]).createInteractionHandle(); + } + + var previousAnimation = this._animation; + this._animation && this._animation.stop(); + this._animation = animation; + animation.start(this._value, function (value) { + _this4._updateValue(value, true); + }, function (result) { + _this4._animation = null; + + if (handle !== null) { + _$$_REQUIRE(_dependencyMap[8]).clearInteractionHandle(handle); + } + + callback && callback(result); + }, previousAnimation, this); + } + }, { + key: "stopTracking", + value: function stopTracking() { + this._tracking && this._tracking.__detach(); + this._tracking = null; + } + }, { + key: "track", + value: function track(tracking) { + this.stopTracking(); + this._tracking = tracking; + } + }, { + key: "_updateValue", + value: function _updateValue(value, flush) { + if (value === undefined) { + throw new Error('AnimatedValue: Attempting to set value to undefined'); + } + + this._value = value; + + if (flush) { + _flush(this); + } + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedValue.prototype), "__callListeners", this).call(this, this.__getValue()); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'value', + value: this._value, + offset: this._offset + }; + } + }]); + + return AnimatedValue; + }(_$$_REQUIRE(_dependencyMap[9])); + + module.exports = AnimatedValue; +},223,[16,14,224,12,7,8,90,227,230,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeAnimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _NativeAnimatedTurboModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var NativeAnimatedModule = _Platform.default.OS === 'ios' && global.RN$Bridgeless === true ? _NativeAnimatedTurboModule.default : _NativeAnimatedModule.default; + var __nativeAnimatedNodeTagCount = 1; + var __nativeAnimationIdCount = 1; + var nativeEventEmitter; + var waitingForQueuedOperations = new Set(); + var queueOperations = false; + var queue = []; + var API = { + getValue: function getValue(tag, saveValueCallback) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + NativeAnimatedModule.getValue(tag, saveValueCallback); + }); + }, + setWaitingForIdentifier: function setWaitingForIdentifier(id) { + waitingForQueuedOperations.add(id); + queueOperations = true; + }, + unsetWaitingForIdentifier: function unsetWaitingForIdentifier(id) { + waitingForQueuedOperations.delete(id); + + if (waitingForQueuedOperations.size === 0) { + queueOperations = false; + API.disableQueue(); + } + }, + disableQueue: function disableQueue() { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + + if (_Platform.default.OS === 'android') { + NativeAnimatedModule.startOperationBatch(); + } + + for (var q = 0, l = queue.length; q < l; q++) { + queue[q](); + } + + queue.length = 0; + + if (_Platform.default.OS === 'android') { + NativeAnimatedModule.finishOperationBatch(); + } + }, + queueOperation: function queueOperation(fn) { + if (queueOperations) { + queue.push(fn); + } else { + fn(); + } + }, + createAnimatedNode: function createAnimatedNode(tag, config) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.createAnimatedNode(tag, config); + }); + }, + startListeningToAnimatedNodeValue: function startListeningToAnimatedNodeValue(tag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.startListeningToAnimatedNodeValue(tag); + }); + }, + stopListeningToAnimatedNodeValue: function stopListeningToAnimatedNodeValue(tag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.stopListeningToAnimatedNodeValue(tag); + }); + }, + connectAnimatedNodes: function connectAnimatedNodes(parentTag, childTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.connectAnimatedNodes(parentTag, childTag); + }); + }, + disconnectAnimatedNodes: function disconnectAnimatedNodes(parentTag, childTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.disconnectAnimatedNodes(parentTag, childTag); + }); + }, + startAnimatingNode: function startAnimatingNode(animationId, nodeTag, config, endCallback) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.startAnimatingNode(animationId, nodeTag, config, endCallback); + }); + }, + stopAnimation: function stopAnimation(animationId) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.stopAnimation(animationId); + }); + }, + setAnimatedNodeValue: function setAnimatedNodeValue(nodeTag, value) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.setAnimatedNodeValue(nodeTag, value); + }); + }, + setAnimatedNodeOffset: function setAnimatedNodeOffset(nodeTag, offset) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.setAnimatedNodeOffset(nodeTag, offset); + }); + }, + flattenAnimatedNodeOffset: function flattenAnimatedNodeOffset(nodeTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.flattenAnimatedNodeOffset(nodeTag); + }); + }, + extractAnimatedNodeOffset: function extractAnimatedNodeOffset(nodeTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.extractAnimatedNodeOffset(nodeTag); + }); + }, + connectAnimatedNodeToView: function connectAnimatedNodeToView(nodeTag, viewTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.connectAnimatedNodeToView(nodeTag, viewTag); + }); + }, + disconnectAnimatedNodeFromView: function disconnectAnimatedNodeFromView(nodeTag, viewTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.disconnectAnimatedNodeFromView(nodeTag, viewTag); + }); + }, + restoreDefaultValues: function restoreDefaultValues(nodeTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + + if (NativeAnimatedModule.restoreDefaultValues != null) { + API.queueOperation(function () { + return NativeAnimatedModule.restoreDefaultValues(nodeTag); + }); + } + }, + dropAnimatedNode: function dropAnimatedNode(tag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.dropAnimatedNode(tag); + }); + }, + addAnimatedEventToView: function addAnimatedEventToView(viewTag, eventName, eventMapping) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.addAnimatedEventToView(viewTag, eventName, eventMapping); + }); + }, + removeAnimatedEventFromView: function removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag) { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + API.queueOperation(function () { + return NativeAnimatedModule.removeAnimatedEventFromView(viewTag, eventName, animatedNodeTag); + }); + } + }; + var SUPPORTED_STYLES = { + opacity: true, + transform: true, + borderRadius: true, + borderBottomEndRadius: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderBottomStartRadius: true, + borderTopEndRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderTopStartRadius: true, + elevation: true, + zIndex: true, + shadowOpacity: true, + shadowRadius: true, + scaleX: true, + scaleY: true, + translateX: true, + translateY: true + }; + var SUPPORTED_TRANSFORMS = { + translateX: true, + translateY: true, + scale: true, + scaleX: true, + scaleY: true, + rotate: true, + rotateX: true, + rotateY: true, + rotateZ: true, + perspective: true + }; + var SUPPORTED_INTERPOLATION_PARAMS = { + inputRange: true, + outputRange: true, + extrapolate: true, + extrapolateRight: true, + extrapolateLeft: true + }; + + function addWhitelistedStyleProp(prop) { + SUPPORTED_STYLES[prop] = true; + } + + function addWhitelistedTransformProp(prop) { + SUPPORTED_TRANSFORMS[prop] = true; + } + + function addWhitelistedInterpolationParam(param) { + SUPPORTED_INTERPOLATION_PARAMS[param] = true; + } + + function validateTransform(configs) { + configs.forEach(function (config) { + if (!SUPPORTED_TRANSFORMS.hasOwnProperty(config.property)) { + throw new Error("Property '" + config.property + "' is not supported by native animated module"); + } + }); + } + + function validateStyles(styles) { + for (var _key in styles) { + if (!SUPPORTED_STYLES.hasOwnProperty(_key)) { + throw new Error("Style property '" + _key + "' is not supported by native animated module"); + } + } + } + + function validateInterpolation(config) { + for (var _key2 in config) { + if (!SUPPORTED_INTERPOLATION_PARAMS.hasOwnProperty(_key2)) { + throw new Error("Interpolation property '" + _key2 + "' is not supported by native animated module"); + } + } + } + + function generateNewNodeTag() { + return __nativeAnimatedNodeTagCount++; + } + + function generateNewAnimationId() { + return __nativeAnimationIdCount++; + } + + function assertNativeAnimatedModule() { + (0, _invariant.default)(NativeAnimatedModule, 'Native animated module is not available'); + } + + var _warnedMissingNativeAnimated = false; + + function shouldUseNativeDriver(config) { + if (config.useNativeDriver == null) { + console.warn("Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`"); + } + + if (config.useNativeDriver === true && !NativeAnimatedModule) { + if (!_warnedMissingNativeAnimated) { + console.warn("Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`. Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md"); + _warnedMissingNativeAnimated = true; + } + + return false; + } + + return config.useNativeDriver || false; + } + + function transformDataType(value) { + if (typeof value !== 'string') { + return value; + } + + if (/deg$/.test(value)) { + var degrees = parseFloat(value) || 0; + var radians = degrees * Math.PI / 180.0; + return radians; + } else { + return value; + } + } + + module.exports = { + API: API, + addWhitelistedStyleProp: addWhitelistedStyleProp, + addWhitelistedTransformProp: addWhitelistedTransformProp, + addWhitelistedInterpolationParam: addWhitelistedInterpolationParam, + validateStyles: validateStyles, + validateTransform: validateTransform, + validateInterpolation: validateInterpolation, + generateNewNodeTag: generateNewNodeTag, + generateNewAnimationId: generateNewAnimationId, + assertNativeAnimatedModule: assertNativeAnimatedModule, + shouldUseNativeDriver: shouldUseNativeDriver, + transformDataType: transformDataType, + + get nativeEventEmitter() { + if (!nativeEventEmitter) { + nativeEventEmitter = new _NativeEventEmitter.default(_Platform.default.OS !== 'ios' ? null : NativeAnimatedModule); + } + + return nativeEventEmitter; + } + + }; +},224,[5,225,226,110,37,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('NativeAnimatedModule'); + + exports.default = _default; +},225,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('NativeAnimatedTurboModule'); + + exports.default = _default; +},226,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var linear = function linear(t) { + return t; + }; + + function createInterpolation(config) { + if (config.outputRange && typeof config.outputRange[0] === 'string') { + return createInterpolationFromStringOutputRange(config); + } + + var outputRange = config.outputRange; + checkInfiniteRange('outputRange', outputRange); + var inputRange = config.inputRange; + checkInfiniteRange('inputRange', inputRange); + checkValidInputRange(inputRange); + + _$$_REQUIRE(_dependencyMap[2])(inputRange.length === outputRange.length, 'inputRange (' + inputRange.length + ') and outputRange (' + outputRange.length + ') must have the same length'); + + var easing = config.easing || linear; + var extrapolateLeft = 'extend'; + + if (config.extrapolateLeft !== undefined) { + extrapolateLeft = config.extrapolateLeft; + } else if (config.extrapolate !== undefined) { + extrapolateLeft = config.extrapolate; + } + + var extrapolateRight = 'extend'; + + if (config.extrapolateRight !== undefined) { + extrapolateRight = config.extrapolateRight; + } else if (config.extrapolate !== undefined) { + extrapolateRight = config.extrapolate; + } + + return function (input) { + _$$_REQUIRE(_dependencyMap[2])(typeof input === 'number', 'Cannot interpolation an input which is not a number'); + + var range = findRange(input, inputRange); + return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight); + }; + } + + function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight) { + var result = input; + + if (result < inputMin) { + if (extrapolateLeft === 'identity') { + return result; + } else if (extrapolateLeft === 'clamp') { + result = inputMin; + } else if (extrapolateLeft === 'extend') {} + } + + if (result > inputMax) { + if (extrapolateRight === 'identity') { + return result; + } else if (extrapolateRight === 'clamp') { + result = inputMax; + } else if (extrapolateRight === 'extend') {} + } + + if (outputMin === outputMax) { + return outputMin; + } + + if (inputMin === inputMax) { + if (input <= inputMin) { + return outputMin; + } + + return outputMax; + } + + if (inputMin === -(1 / 0)) { + result = -result; + } else if (inputMax === Infinity) { + result = result - inputMin; + } else { + result = (result - inputMin) / (inputMax - inputMin); + } + + result = easing(result); + + if (outputMin === -(1 / 0)) { + result = -result; + } else if (outputMax === Infinity) { + result = result + outputMin; + } else { + result = result * (outputMax - outputMin) + outputMin; + } + + return result; + } + + function colorToRgba(input) { + var normalizedColor = _$$_REQUIRE(_dependencyMap[3])(input); + + if (normalizedColor === null || typeof normalizedColor !== 'number') { + return input; + } + + normalizedColor = normalizedColor || 0; + var r = (normalizedColor & 0xff000000) >>> 24; + var g = (normalizedColor & 0x00ff0000) >>> 16; + var b = (normalizedColor & 0x0000ff00) >>> 8; + var a = (normalizedColor & 0x000000ff) / 255; + return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")"; + } + + var stringShapeRegex = /[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g; + + function createInterpolationFromStringOutputRange(config) { + var outputRange = config.outputRange; + + _$$_REQUIRE(_dependencyMap[2])(outputRange.length >= 2, 'Bad output range'); + + outputRange = outputRange.map(colorToRgba); + checkPattern(outputRange); + var outputRanges = outputRange[0].match(stringShapeRegex).map(function () { + return []; + }); + outputRange.forEach(function (value) { + value.match(stringShapeRegex).forEach(function (number, i) { + outputRanges[i].push(+number); + }); + }); + var interpolations = outputRange[0].match(stringShapeRegex).map(function (value, i) { + return createInterpolation(_$$_REQUIRE(_dependencyMap[4])({}, config, { + outputRange: outputRanges[i] + })); + }); + var shouldRound = isRgbOrRgba(outputRange[0]); + return function (input) { + var i = 0; + return outputRange[0].replace(stringShapeRegex, function () { + var val = +interpolations[i++](input); + + if (shouldRound) { + val = i < 4 ? Math.round(val) : Math.round(val * 1000) / 1000; + } + + return String(val); + }); + }; + } + + function isRgbOrRgba(range) { + return typeof range === 'string' && range.startsWith('rgb'); + } + + function checkPattern(arr) { + var pattern = arr[0].replace(stringShapeRegex, ''); + + for (var i = 1; i < arr.length; ++i) { + _$$_REQUIRE(_dependencyMap[2])(pattern === arr[i].replace(stringShapeRegex, ''), 'invalid pattern ' + arr[0] + ' and ' + arr[i]); + } + } + + function findRange(input, inputRange) { + var i; + + for (i = 1; i < inputRange.length - 1; ++i) { + if (inputRange[i] >= input) { + break; + } + } + + return i - 1; + } + + function checkValidInputRange(arr) { + _$$_REQUIRE(_dependencyMap[2])(arr.length >= 2, 'inputRange must have at least 2 elements'); + + for (var i = 1; i < arr.length; ++i) { + _$$_REQUIRE(_dependencyMap[2])(arr[i] >= arr[i - 1], 'inputRange must be monotonically non-decreasing ' + arr); + } + } + + function checkInfiniteRange(name, arr) { + _$$_REQUIRE(_dependencyMap[2])(arr.length >= 2, name + ' must have at least 2 elements'); + + _$$_REQUIRE(_dependencyMap[2])(arr.length !== 2 || arr[0] !== -(1 / 0) || arr[1] !== Infinity, name + 'cannot be ]-infinity;+infinity[ ' + arr); + } + + var AnimatedInterpolation = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[5])(AnimatedInterpolation, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedInterpolation); + + function AnimatedInterpolation(parent, config) { + var _this; + + _$$_REQUIRE(_dependencyMap[6])(this, AnimatedInterpolation); + + _this = _super.call(this); + _this._parent = parent; + _this._config = config; + _this._interpolation = createInterpolation(config); + return _this; + } + + _$$_REQUIRE(_dependencyMap[7])(AnimatedInterpolation, [{ + key: "__makeNative", + value: function __makeNative() { + this._parent.__makeNative(); + + _$$_REQUIRE(_dependencyMap[8])(_$$_REQUIRE(_dependencyMap[0])(AnimatedInterpolation.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + var parentValue = this._parent.__getValue(); + + _$$_REQUIRE(_dependencyMap[2])(typeof parentValue === 'number', 'Cannot interpolate an input which is not a number.'); + + return this._interpolation(parentValue); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new AnimatedInterpolation(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._parent.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._parent.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[8])(_$$_REQUIRE(_dependencyMap[0])(AnimatedInterpolation.prototype), "__detach", this).call(this); + } + }, { + key: "__transformDataType", + value: function __transformDataType(range) { + return range.map(_$$_REQUIRE(_dependencyMap[9]).transformDataType); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + inputRange: this._config.inputRange, + outputRange: this.__transformDataType(this._config.outputRange), + extrapolateLeft: this._config.extrapolateLeft || this._config.extrapolate || 'extend', + extrapolateRight: this._config.extrapolateRight || this._config.extrapolate || 'extend', + type: 'interpolation' + }; + } + }]); + + return AnimatedInterpolation; + }(_$$_REQUIRE(_dependencyMap[10])); + + AnimatedInterpolation.__createInterpolation = createInterpolation; + module.exports = AnimatedInterpolation; +},227,[16,14,36,146,6,12,7,8,90,224,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedWithChildren = function (_AnimatedNode) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedWithChildren, _AnimatedNode); + + var _super = _createSuper(AnimatedWithChildren); + + function AnimatedWithChildren() { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedWithChildren); + + _this = _super.call(this); + _this._children = []; + return _this; + } + + _$$_REQUIRE(_dependencyMap[4])(AnimatedWithChildren, [{ + key: "__makeNative", + value: function __makeNative() { + if (!this.__isNative) { + this.__isNative = true; + + for (var _iterator = _createForOfIteratorHelperLoose(this._children), _step; !(_step = _iterator()).done;) { + var child = _step.value; + + child.__makeNative(); + + _$$_REQUIRE(_dependencyMap[5]).API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + } + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedWithChildren.prototype), "__makeNative", this).call(this); + } + }, { + key: "__addChild", + value: function __addChild(child) { + if (this._children.length === 0) { + this.__attach(); + } + + this._children.push(child); + + if (this.__isNative) { + child.__makeNative(); + + _$$_REQUIRE(_dependencyMap[5]).API.connectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + } + }, { + key: "__removeChild", + value: function __removeChild(child) { + var index = this._children.indexOf(child); + + if (index === -1) { + console.warn("Trying to remove a child that doesn't exist"); + return; + } + + if (this.__isNative && child.__isNative) { + _$$_REQUIRE(_dependencyMap[5]).API.disconnectAnimatedNodes(this.__getNativeTag(), child.__getNativeTag()); + } + + this._children.splice(index, 1); + + if (this._children.length === 0) { + this.__detach(); + } + } + }, { + key: "__getChildren", + value: function __getChildren() { + return this._children; + } + }, { + key: "__callListeners", + value: function __callListeners(value) { + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedWithChildren.prototype), "__callListeners", this).call(this, value); + + if (!this.__isNative) { + for (var _iterator2 = _createForOfIteratorHelperLoose(this._children), _step2; !(_step2 = _iterator2()).done;) { + var child = _step2.value; + + if (child.__getValue) { + child.__callListeners(child.__getValue()); + } + } + } + } + }]); + + return AnimatedWithChildren; + }(_$$_REQUIRE(_dependencyMap[7])); + + module.exports = AnimatedWithChildren; +},228,[16,14,12,7,8,224,90,229]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _uniqueId = 1; + + var AnimatedNode = function () { + function AnimatedNode() { + _$$_REQUIRE(_dependencyMap[0])(this, AnimatedNode); + + this._listeners = {}; + } + + _$$_REQUIRE(_dependencyMap[1])(AnimatedNode, [{ + key: "__attach", + value: function __attach() {} + }, { + key: "__detach", + value: function __detach() { + if (this.__isNative && this.__nativeTag != null) { + _$$_REQUIRE(_dependencyMap[2]).API.dropAnimatedNode(this.__nativeTag); + + this.__nativeTag = undefined; + } + } + }, { + key: "__getValue", + value: function __getValue() {} + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + return this.__getValue(); + } + }, { + key: "__addChild", + value: function __addChild(child) {} + }, { + key: "__removeChild", + value: function __removeChild(child) {} + }, { + key: "__getChildren", + value: function __getChildren() { + return []; + } + }, { + key: "__makeNative", + value: function __makeNative() { + if (!this.__isNative) { + throw new Error('This node cannot be made a "native" animated node'); + } + + if (this.hasListeners()) { + this._startListeningToNativeValueUpdates(); + } + } + }, { + key: "addListener", + value: function addListener(callback) { + var id = String(_uniqueId++); + this._listeners[id] = callback; + + if (this.__isNative) { + this._startListeningToNativeValueUpdates(); + } + + return id; + } + }, { + key: "removeListener", + value: function removeListener(id) { + delete this._listeners[id]; + + if (this.__isNative && !this.hasListeners()) { + this._stopListeningForNativeValueUpdates(); + } + } + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + this._listeners = {}; + + if (this.__isNative) { + this._stopListeningForNativeValueUpdates(); + } + } + }, { + key: "hasListeners", + value: function hasListeners() { + return !!Object.keys(this._listeners).length; + } + }, { + key: "_startListeningToNativeValueUpdates", + value: function _startListeningToNativeValueUpdates() { + var _this = this; + + if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) { + return; + } + + if (this.__shouldUpdateListenersForNewNativeTag) { + this.__shouldUpdateListenersForNewNativeTag = false; + + this._stopListeningForNativeValueUpdates(); + } + + _$$_REQUIRE(_dependencyMap[2]).API.startListeningToAnimatedNodeValue(this.__getNativeTag()); + + this.__nativeAnimatedValueListener = _$$_REQUIRE(_dependencyMap[2]).nativeEventEmitter.addListener('onAnimatedValueUpdate', function (data) { + if (data.tag !== _this.__getNativeTag()) { + return; + } + + _this._onAnimatedValueUpdateReceived(data.value); + }); + } + }, { + key: "_onAnimatedValueUpdateReceived", + value: function _onAnimatedValueUpdateReceived(value) { + this.__callListeners(value); + } + }, { + key: "__callListeners", + value: function __callListeners(value) { + for (var _key in this._listeners) { + this._listeners[_key]({ + value: value + }); + } + } + }, { + key: "_stopListeningForNativeValueUpdates", + value: function _stopListeningForNativeValueUpdates() { + if (!this.__nativeAnimatedValueListener) { + return; + } + + this.__nativeAnimatedValueListener.remove(); + + this.__nativeAnimatedValueListener = null; + + _$$_REQUIRE(_dependencyMap[2]).API.stopListeningToAnimatedNodeValue(this.__getNativeTag()); + } + }, { + key: "__getNativeTag", + value: function __getNativeTag() { + var _this$__nativeTag; + + _$$_REQUIRE(_dependencyMap[2]).assertNativeAnimatedModule(); + + _$$_REQUIRE(_dependencyMap[3])(this.__isNative, 'Attempt to get native tag from node not marked as "native"'); + + var nativeTag = (_this$__nativeTag = this.__nativeTag) != null ? _this$__nativeTag : _$$_REQUIRE(_dependencyMap[2]).generateNewNodeTag(); + + if (this.__nativeTag == null) { + this.__nativeTag = nativeTag; + + _$$_REQUIRE(_dependencyMap[2]).API.createAnimatedNode(nativeTag, this.__getNativeConfig()); + + this.__shouldUpdateListenersForNewNativeTag = true; + } + + return nativeTag; + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + throw new Error('This JS animated node type cannot be used as native animated node'); + } + }, { + key: "toJSON", + value: function toJSON() { + return this.__getValue(); + } + }]); + + return AnimatedNode; + }(); + + module.exports = AnimatedNode; +},229,[7,8,224,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _EventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _emitter = new _EventEmitter.default(); + + var DEBUG_DELAY = 0; + var DEBUG = false; + var InteractionManager = { + Events: { + interactionStart: 'interactionStart', + interactionComplete: 'interactionComplete' + }, + runAfterInteractions: function runAfterInteractions(task) { + var tasks = []; + var promise = new Promise(function (resolve) { + _scheduleUpdate(); + + if (task) { + tasks.push(task); + } + + tasks.push({ + run: resolve, + name: 'resolve ' + (task && task.name || '?') + }); + + _taskQueue.enqueueTasks(tasks); + }); + return { + then: promise.then.bind(promise), + done: function done() { + if (promise.done) { + return promise.done.apply(promise, arguments); + } else { + console.warn('Tried to call done when not supported by current Promise implementation.'); + } + }, + cancel: function cancel() { + _taskQueue.cancelTasks(tasks); + } + }; + }, + createInteractionHandle: function createInteractionHandle() { + DEBUG; + + _scheduleUpdate(); + + var handle = ++_inc; + + _addInteractionSet.add(handle); + + return handle; + }, + clearInteractionHandle: function clearInteractionHandle(handle) { + DEBUG; + + _$$_REQUIRE(_dependencyMap[2])(!!handle, 'InteractionManager: Must provide a handle to clear.'); + + _scheduleUpdate(); + + _addInteractionSet.delete(handle); + + _deleteInteractionSet.add(handle); + }, + addListener: _emitter.addListener.bind(_emitter), + setDeadline: function setDeadline(deadline) { + _deadline = deadline; + } + }; + + var _interactionSet = new Set(); + + var _addInteractionSet = new Set(); + + var _deleteInteractionSet = new Set(); + + var _taskQueue = new (_$$_REQUIRE(_dependencyMap[3]))({ + onMoreTasks: _scheduleUpdate + }); + + var _nextUpdateHandle = 0; + var _inc = 0; + + var _deadline = -1; + + function _scheduleUpdate() { + if (!_nextUpdateHandle) { + if (_deadline > 0) { + _nextUpdateHandle = setTimeout(_processUpdate, 0); + } else { + _nextUpdateHandle = setImmediate(_processUpdate); + } + } + } + + function _processUpdate() { + _nextUpdateHandle = 0; + var interactionCount = _interactionSet.size; + + _addInteractionSet.forEach(function (handle) { + return _interactionSet.add(handle); + }); + + _deleteInteractionSet.forEach(function (handle) { + return _interactionSet.delete(handle); + }); + + var nextInteractionCount = _interactionSet.size; + + if (interactionCount !== 0 && nextInteractionCount === 0) { + _emitter.emit(InteractionManager.Events.interactionComplete); + } else if (interactionCount === 0 && nextInteractionCount !== 0) { + _emitter.emit(InteractionManager.Events.interactionStart); + } + + if (nextInteractionCount === 0) { + while (_taskQueue.hasTasksToProcess()) { + _taskQueue.processNext(); + + if (_deadline > 0 && _$$_REQUIRE(_dependencyMap[4]).getEventLoopRunningTime() >= _deadline) { + _scheduleUpdate(); + + break; + } + } + } + + _addInteractionSet.clear(); + + _deleteInteractionSet.clear(); + } + + module.exports = InteractionManager; +},230,[5,31,36,231,45]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DEBUG = false; + + var TaskQueue = function () { + function TaskQueue(_ref) { + var onMoreTasks = _ref.onMoreTasks; + + _$$_REQUIRE(_dependencyMap[0])(this, TaskQueue); + + this._onMoreTasks = onMoreTasks; + this._queueStack = [{ + tasks: [], + popable: false + }]; + } + + _$$_REQUIRE(_dependencyMap[1])(TaskQueue, [{ + key: "enqueue", + value: function enqueue(task) { + this._getCurrentQueue().push(task); + } + }, { + key: "enqueueTasks", + value: function enqueueTasks(tasks) { + var _this = this; + + tasks.forEach(function (task) { + return _this.enqueue(task); + }); + } + }, { + key: "cancelTasks", + value: function cancelTasks(tasksToCancel) { + this._queueStack = this._queueStack.map(function (queue) { + return _$$_REQUIRE(_dependencyMap[2])({}, queue, { + tasks: queue.tasks.filter(function (task) { + return tasksToCancel.indexOf(task) === -1; + }) + }); + }).filter(function (queue, idx) { + return queue.tasks.length > 0 || idx === 0; + }); + } + }, { + key: "hasTasksToProcess", + value: function hasTasksToProcess() { + return this._getCurrentQueue().length > 0; + } + }, { + key: "processNext", + value: function processNext() { + var queue = this._getCurrentQueue(); + + if (queue.length) { + var task = queue.shift(); + + try { + if (typeof task === 'object' && task.gen) { + DEBUG; + + this._genPromise(task); + } else if (typeof task === 'object' && task.run) { + DEBUG; + task.run(); + } else { + _$$_REQUIRE(_dependencyMap[3])(typeof task === 'function', 'Expected Function, SimpleTask, or PromiseTask, but got:\n' + JSON.stringify(task, null, 2)); + + DEBUG; + task(); + } + } catch (e) { + e.message = 'TaskQueue: Error with task ' + (task.name || '') + ': ' + e.message; + throw e; + } + } + } + }, { + key: "_getCurrentQueue", + value: function _getCurrentQueue() { + var stackIdx = this._queueStack.length - 1; + var queue = this._queueStack[stackIdx]; + + if (queue.popable && queue.tasks.length === 0 && this._queueStack.length > 1) { + this._queueStack.pop(); + + DEBUG; + return this._getCurrentQueue(); + } else { + return queue.tasks; + } + } + }, { + key: "_genPromise", + value: function _genPromise(task) { + var _this2 = this; + + this._queueStack.push({ + tasks: [], + popable: false + }); + + var stackIdx = this._queueStack.length - 1; + var stackItem = this._queueStack[stackIdx]; + DEBUG; + DEBUG; + task.gen().then(function () { + DEBUG; + stackItem.popable = true; + _this2.hasTasksToProcess() && _this2._onMoreTasks(); + }).catch(function (ex) { + ex.message = "TaskQueue: Error resolving Promise in task " + task.name + ": " + ex.message; + throw ex; + }).done(); + } + }]); + + return TaskQueue; + }(); + + module.exports = TaskQueue; +},231,[7,8,6,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _uniqueId = 1; + + var AnimatedValueXY = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedValueXY, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedValueXY); + + function AnimatedValueXY(valueIn) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedValueXY); + + _this = _super.call(this); + var value = valueIn || { + x: 0, + y: 0 + }; + + if (typeof value.x === 'number' && typeof value.y === 'number') { + _this.x = new (_$$_REQUIRE(_dependencyMap[4]))(value.x); + _this.y = new (_$$_REQUIRE(_dependencyMap[4]))(value.y); + } else { + _$$_REQUIRE(_dependencyMap[5])(value.x instanceof _$$_REQUIRE(_dependencyMap[4]) && value.y instanceof _$$_REQUIRE(_dependencyMap[4]), "AnimatedValueXY must be initialized with an object of numbers or AnimatedValues."); + + _this.x = value.x; + _this.y = value.y; + } + + _this._listeners = {}; + return _this; + } + + _$$_REQUIRE(_dependencyMap[6])(AnimatedValueXY, [{ + key: "setValue", + value: function setValue(value) { + this.x.setValue(value.x); + this.y.setValue(value.y); + } + }, { + key: "setOffset", + value: function setOffset(offset) { + this.x.setOffset(offset.x); + this.y.setOffset(offset.y); + } + }, { + key: "flattenOffset", + value: function flattenOffset() { + this.x.flattenOffset(); + this.y.flattenOffset(); + } + }, { + key: "extractOffset", + value: function extractOffset() { + this.x.extractOffset(); + this.y.extractOffset(); + } + }, { + key: "__getValue", + value: function __getValue() { + return { + x: this.x.__getValue(), + y: this.y.__getValue() + }; + } + }, { + key: "resetAnimation", + value: function resetAnimation(callback) { + this.x.resetAnimation(); + this.y.resetAnimation(); + callback && callback(this.__getValue()); + } + }, { + key: "stopAnimation", + value: function stopAnimation(callback) { + this.x.stopAnimation(); + this.y.stopAnimation(); + callback && callback(this.__getValue()); + } + }, { + key: "addListener", + value: function addListener(callback) { + var _this2 = this; + + var id = String(_uniqueId++); + + var jointCallback = function jointCallback(_ref) { + var number = _ref.value; + callback(_this2.__getValue()); + }; + + this._listeners[id] = { + x: this.x.addListener(jointCallback), + y: this.y.addListener(jointCallback) + }; + return id; + } + }, { + key: "removeListener", + value: function removeListener(id) { + this.x.removeListener(this._listeners[id].x); + this.y.removeListener(this._listeners[id].y); + delete this._listeners[id]; + } + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + this.x.removeAllListeners(); + this.y.removeAllListeners(); + this._listeners = {}; + } + }, { + key: "getLayout", + value: function getLayout() { + return { + left: this.x, + top: this.y + }; + } + }, { + key: "getTranslateTransform", + value: function getTranslateTransform() { + return [{ + translateX: this.x + }, { + translateY: this.y + }]; + } + }]); + + return AnimatedValueXY; + }(_$$_REQUIRE(_dependencyMap[7])); + + module.exports = AnimatedValueXY; +},232,[16,14,12,7,223,36,8,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var add = function add(a, b) { + return new (_$$_REQUIRE(_dependencyMap[0]))(a, b); + }; + + var subtract = function subtract(a, b) { + return new (_$$_REQUIRE(_dependencyMap[1]))(a, b); + }; + + var divide = function divide(a, b) { + return new (_$$_REQUIRE(_dependencyMap[2]))(a, b); + }; + + var multiply = function multiply(a, b) { + return new (_$$_REQUIRE(_dependencyMap[3]))(a, b); + }; + + var modulo = function modulo(a, modulus) { + return new (_$$_REQUIRE(_dependencyMap[4]))(a, modulus); + }; + + var diffClamp = function diffClamp(a, min, max) { + return new (_$$_REQUIRE(_dependencyMap[5]))(a, min, max); + }; + + var _combineCallbacks = function _combineCallbacks(callback, config) { + if (callback && config.onComplete) { + return function () { + config.onComplete && config.onComplete.apply(config, arguments); + callback && callback.apply(undefined, arguments); + }; + } else { + return callback || config.onComplete; + } + }; + + var maybeVectorAnim = function maybeVectorAnim(value, config, anim) { + if (value instanceof _$$_REQUIRE(_dependencyMap[6])) { + var configX = _$$_REQUIRE(_dependencyMap[7])({}, config); + + var configY = _$$_REQUIRE(_dependencyMap[7])({}, config); + + for (var key in config) { + var _config$key = config[key], + x = _config$key.x, + y = _config$key.y; + + if (x !== undefined && y !== undefined) { + configX[key] = x; + configY[key] = y; + } + } + + var aX = anim(value.x, configX); + var aY = anim(value.y, configY); + return parallel([aX, aY], { + stopTogether: false + }); + } + + return null; + }; + + var spring = function spring(value, config) { + var _start = function start(animatedValue, configuration, callback) { + callback = _combineCallbacks(callback, configuration); + var singleValue = animatedValue; + var singleConfig = configuration; + singleValue.stopTracking(); + + if (configuration.toValue instanceof _$$_REQUIRE(_dependencyMap[8])) { + singleValue.track(new (_$$_REQUIRE(_dependencyMap[9]))(singleValue, configuration.toValue, _$$_REQUIRE(_dependencyMap[10]), singleConfig, callback)); + } else { + singleValue.animate(new (_$$_REQUIRE(_dependencyMap[10]))(singleConfig), callback); + } + }; + + return maybeVectorAnim(value, config, spring) || { + start: function start(callback) { + _start(value, config, callback); + }, + stop: function stop() { + value.stopAnimation(); + }, + reset: function reset() { + value.resetAnimation(); + }, + _startNativeLoop: function _startNativeLoop(iterations) { + var singleConfig = _$$_REQUIRE(_dependencyMap[7])({}, config, { + iterations: iterations + }); + + _start(value, singleConfig); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return config.useNativeDriver || false; + } + }; + }; + + var timing = function timing(value, config) { + var _start2 = function start(animatedValue, configuration, callback) { + callback = _combineCallbacks(callback, configuration); + var singleValue = animatedValue; + var singleConfig = configuration; + singleValue.stopTracking(); + + if (configuration.toValue instanceof _$$_REQUIRE(_dependencyMap[8])) { + singleValue.track(new (_$$_REQUIRE(_dependencyMap[9]))(singleValue, configuration.toValue, _$$_REQUIRE(_dependencyMap[11]), singleConfig, callback)); + } else { + singleValue.animate(new (_$$_REQUIRE(_dependencyMap[11]))(singleConfig), callback); + } + }; + + return maybeVectorAnim(value, config, timing) || { + start: function start(callback) { + _start2(value, config, callback); + }, + stop: function stop() { + value.stopAnimation(); + }, + reset: function reset() { + value.resetAnimation(); + }, + _startNativeLoop: function _startNativeLoop(iterations) { + var singleConfig = _$$_REQUIRE(_dependencyMap[7])({}, config, { + iterations: iterations + }); + + _start2(value, singleConfig); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return config.useNativeDriver || false; + } + }; + }; + + var decay = function decay(value, config) { + var _start3 = function start(animatedValue, configuration, callback) { + callback = _combineCallbacks(callback, configuration); + var singleValue = animatedValue; + var singleConfig = configuration; + singleValue.stopTracking(); + singleValue.animate(new (_$$_REQUIRE(_dependencyMap[12]))(singleConfig), callback); + }; + + return maybeVectorAnim(value, config, decay) || { + start: function start(callback) { + _start3(value, config, callback); + }, + stop: function stop() { + value.stopAnimation(); + }, + reset: function reset() { + value.resetAnimation(); + }, + _startNativeLoop: function _startNativeLoop(iterations) { + var singleConfig = _$$_REQUIRE(_dependencyMap[7])({}, config, { + iterations: iterations + }); + + _start3(value, singleConfig); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return config.useNativeDriver || false; + } + }; + }; + + var sequence = function sequence(animations) { + var current = 0; + return { + start: function start(callback) { + var onComplete = function onComplete(result) { + if (!result.finished) { + callback && callback(result); + return; + } + + current++; + + if (current === animations.length) { + callback && callback(result); + return; + } + + animations[current].start(onComplete); + }; + + if (animations.length === 0) { + callback && callback({ + finished: true + }); + } else { + animations[current].start(onComplete); + } + }, + stop: function stop() { + if (current < animations.length) { + animations[current].stop(); + } + }, + reset: function reset() { + animations.forEach(function (animation, idx) { + if (idx <= current) { + animation.reset(); + } + }); + current = 0; + }, + _startNativeLoop: function _startNativeLoop() { + throw new Error('Loops run using the native driver cannot contain Animated.sequence animations'); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return false; + } + }; + }; + + var parallel = function parallel(animations, config) { + var doneCount = 0; + var hasEnded = {}; + var stopTogether = !(config && config.stopTogether === false); + var result = { + start: function start(callback) { + if (doneCount === animations.length) { + callback && callback({ + finished: true + }); + return; + } + + animations.forEach(function (animation, idx) { + var cb = function cb(endResult) { + hasEnded[idx] = true; + doneCount++; + + if (doneCount === animations.length) { + doneCount = 0; + callback && callback(endResult); + return; + } + + if (!endResult.finished && stopTogether) { + result.stop(); + } + }; + + if (!animation) { + cb({ + finished: true + }); + } else { + animation.start(cb); + } + }); + }, + stop: function stop() { + animations.forEach(function (animation, idx) { + !hasEnded[idx] && animation.stop(); + hasEnded[idx] = true; + }); + }, + reset: function reset() { + animations.forEach(function (animation, idx) { + animation.reset(); + hasEnded[idx] = false; + doneCount = 0; + }); + }, + _startNativeLoop: function _startNativeLoop() { + throw new Error('Loops run using the native driver cannot contain Animated.parallel animations'); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return false; + } + }; + return result; + }; + + var delay = function delay(time) { + return timing(new (_$$_REQUIRE(_dependencyMap[13]))(0), { + toValue: 0, + delay: time, + duration: 0, + useNativeDriver: false + }); + }; + + var stagger = function stagger(time, animations) { + return parallel(animations.map(function (animation, i) { + return sequence([delay(time * i), animation]); + })); + }; + + var loop = function loop(animation) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$iterations = _ref.iterations, + iterations = _ref$iterations === undefined ? -1 : _ref$iterations, + _ref$resetBeforeItera = _ref.resetBeforeIteration, + resetBeforeIteration = _ref$resetBeforeItera === undefined ? true : _ref$resetBeforeItera; + + var isFinished = false; + var iterationsSoFar = 0; + return { + start: function start(callback) { + var restart = function restart() { + var result = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + finished: true + }; + + if (isFinished || iterationsSoFar === iterations || result.finished === false) { + callback && callback(result); + } else { + iterationsSoFar++; + resetBeforeIteration && animation.reset(); + animation.start(restart); + } + }; + + if (!animation || iterations === 0) { + callback && callback({ + finished: true + }); + } else { + if (animation._isUsingNativeDriver()) { + animation._startNativeLoop(iterations); + } else { + restart(); + } + } + }, + stop: function stop() { + isFinished = true; + animation.stop(); + }, + reset: function reset() { + iterationsSoFar = 0; + isFinished = false; + animation.reset(); + }, + _startNativeLoop: function _startNativeLoop() { + throw new Error('Loops run using the native driver cannot contain Animated.loop animations'); + }, + _isUsingNativeDriver: function _isUsingNativeDriver() { + return animation._isUsingNativeDriver(); + } + }; + }; + + function forkEvent(event, listener) { + if (!event) { + return listener; + } else if (event instanceof _$$_REQUIRE(_dependencyMap[14]).AnimatedEvent) { + event.__addListener(listener); + + return event; + } else { + return function () { + typeof event === 'function' && event.apply(undefined, arguments); + listener.apply(undefined, arguments); + }; + } + } + + function unforkEvent(event, listener) { + if (event && event instanceof _$$_REQUIRE(_dependencyMap[14]).AnimatedEvent) { + event.__removeListener(listener); + } + } + + var event = function event(argMapping, config) { + var animatedEvent = new (_$$_REQUIRE(_dependencyMap[14]).AnimatedEvent)(argMapping, config); + + if (animatedEvent.__isNative) { + return animatedEvent; + } else { + return animatedEvent.__getHandler(); + } + }; + + module.exports = { + Value: _$$_REQUIRE(_dependencyMap[13]), + ValueXY: _$$_REQUIRE(_dependencyMap[6]), + Interpolation: _$$_REQUIRE(_dependencyMap[15]), + Node: _$$_REQUIRE(_dependencyMap[8]), + decay: decay, + timing: timing, + spring: spring, + add: add, + subtract: subtract, + divide: divide, + multiply: multiply, + modulo: modulo, + diffClamp: diffClamp, + delay: delay, + sequence: sequence, + parallel: parallel, + stagger: stagger, + loop: loop, + event: event, + createAnimatedComponent: _$$_REQUIRE(_dependencyMap[16]), + attachNativeEvent: _$$_REQUIRE(_dependencyMap[14]).attachNativeEvent, + forkEvent: forkEvent, + unforkEvent: unforkEvent, + Event: _$$_REQUIRE(_dependencyMap[14]).AnimatedEvent + }; +},233,[234,235,236,237,238,239,232,6,229,240,241,244,247,223,248,227,249]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedAddition = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedAddition, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedAddition); + + function AnimatedAddition(a, b) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedAddition); + + _this = _super.call(this); + _this._a = typeof a === 'number' ? new (_$$_REQUIRE(_dependencyMap[4]))(a) : a; + _this._b = typeof b === 'number' ? new (_$$_REQUIRE(_dependencyMap[4]))(b) : b; + return _this; + } + + _$$_REQUIRE(_dependencyMap[5])(AnimatedAddition, [{ + key: "__makeNative", + value: function __makeNative() { + this._a.__makeNative(); + + this._b.__makeNative(); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedAddition.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._a.__getValue() + this._b.__getValue(); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new (_$$_REQUIRE(_dependencyMap[7]))(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + + this._b.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedAddition.prototype), "__detach", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'addition', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + + return AnimatedAddition; + }(_$$_REQUIRE(_dependencyMap[8])); + + module.exports = AnimatedAddition; +},234,[16,14,12,7,223,8,90,227,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedSubtraction = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedSubtraction, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedSubtraction); + + function AnimatedSubtraction(a, b) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedSubtraction); + + _this = _super.call(this); + _this._a = typeof a === 'number' ? new (_$$_REQUIRE(_dependencyMap[4]))(a) : a; + _this._b = typeof b === 'number' ? new (_$$_REQUIRE(_dependencyMap[4]))(b) : b; + return _this; + } + + _$$_REQUIRE(_dependencyMap[5])(AnimatedSubtraction, [{ + key: "__makeNative", + value: function __makeNative() { + this._a.__makeNative(); + + this._b.__makeNative(); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedSubtraction.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._a.__getValue() - this._b.__getValue(); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new (_$$_REQUIRE(_dependencyMap[7]))(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + + this._b.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedSubtraction.prototype), "__detach", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'subtraction', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + + return AnimatedSubtraction; + }(_$$_REQUIRE(_dependencyMap[8])); + + module.exports = AnimatedSubtraction; +},235,[16,14,12,7,223,8,90,227,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedDivision = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedDivision, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedDivision); + + function AnimatedDivision(a, b) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedDivision); + + _this = _super.call(this); + _this._warnedAboutDivideByZero = false; + + if (b === 0 || b instanceof _$$_REQUIRE(_dependencyMap[4]) && b.__getValue() === 0) { + console.error('Detected potential division by zero in AnimatedDivision'); + } + + _this._a = typeof a === 'number' ? new (_$$_REQUIRE(_dependencyMap[5]))(a) : a; + _this._b = typeof b === 'number' ? new (_$$_REQUIRE(_dependencyMap[5]))(b) : b; + return _this; + } + + _$$_REQUIRE(_dependencyMap[6])(AnimatedDivision, [{ + key: "__makeNative", + value: function __makeNative() { + this._a.__makeNative(); + + this._b.__makeNative(); + + _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[0])(AnimatedDivision.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + var a = this._a.__getValue(); + + var b = this._b.__getValue(); + + if (b === 0) { + if (!this._warnedAboutDivideByZero) { + console.error('Detected division by zero in AnimatedDivision'); + this._warnedAboutDivideByZero = true; + } + + return 0; + } + + this._warnedAboutDivideByZero = false; + return a / b; + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new (_$$_REQUIRE(_dependencyMap[8]))(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + + this._b.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[0])(AnimatedDivision.prototype), "__detach", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'division', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + + return AnimatedDivision; + }(_$$_REQUIRE(_dependencyMap[9])); + + module.exports = AnimatedDivision; +},236,[16,14,12,7,229,223,8,90,227,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedMultiplication = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedMultiplication, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedMultiplication); + + function AnimatedMultiplication(a, b) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedMultiplication); + + _this = _super.call(this); + _this._a = typeof a === 'number' ? new (_$$_REQUIRE(_dependencyMap[4]))(a) : a; + _this._b = typeof b === 'number' ? new (_$$_REQUIRE(_dependencyMap[4]))(b) : b; + return _this; + } + + _$$_REQUIRE(_dependencyMap[5])(AnimatedMultiplication, [{ + key: "__makeNative", + value: function __makeNative() { + this._a.__makeNative(); + + this._b.__makeNative(); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedMultiplication.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._a.__getValue() * this._b.__getValue(); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new (_$$_REQUIRE(_dependencyMap[7]))(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + + this._b.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + + this._b.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedMultiplication.prototype), "__detach", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'multiplication', + input: [this._a.__getNativeTag(), this._b.__getNativeTag()] + }; + } + }]); + + return AnimatedMultiplication; + }(_$$_REQUIRE(_dependencyMap[8])); + + module.exports = AnimatedMultiplication; +},237,[16,14,12,7,223,8,90,227,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedModulo = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedModulo, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedModulo); + + function AnimatedModulo(a, modulus) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedModulo); + + _this = _super.call(this); + _this._a = a; + _this._modulus = modulus; + return _this; + } + + _$$_REQUIRE(_dependencyMap[4])(AnimatedModulo, [{ + key: "__makeNative", + value: function __makeNative() { + this._a.__makeNative(); + + _$$_REQUIRE(_dependencyMap[5])(_$$_REQUIRE(_dependencyMap[0])(AnimatedModulo.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + return (this._a.__getValue() % this._modulus + this._modulus) % this._modulus; + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new (_$$_REQUIRE(_dependencyMap[6]))(this, config); + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[5])(_$$_REQUIRE(_dependencyMap[0])(AnimatedModulo.prototype), "__detach", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'modulus', + input: this._a.__getNativeTag(), + modulus: this._modulus + }; + } + }]); + + return AnimatedModulo; + }(_$$_REQUIRE(_dependencyMap[7])); + + module.exports = AnimatedModulo; +},238,[16,14,12,7,8,90,227,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedDiffClamp = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedDiffClamp, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedDiffClamp); + + function AnimatedDiffClamp(a, min, max) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedDiffClamp); + + _this = _super.call(this); + _this._a = a; + _this._min = min; + _this._max = max; + _this._value = _this._lastValue = _this._a.__getValue(); + return _this; + } + + _$$_REQUIRE(_dependencyMap[4])(AnimatedDiffClamp, [{ + key: "__makeNative", + value: function __makeNative() { + this._a.__makeNative(); + + _$$_REQUIRE(_dependencyMap[5])(_$$_REQUIRE(_dependencyMap[0])(AnimatedDiffClamp.prototype), "__makeNative", this).call(this); + } + }, { + key: "interpolate", + value: function interpolate(config) { + return new (_$$_REQUIRE(_dependencyMap[6]))(this, config); + } + }, { + key: "__getValue", + value: function __getValue() { + var value = this._a.__getValue(); + + var diff = value - this._lastValue; + this._lastValue = value; + this._value = Math.min(Math.max(this._value + diff, this._min), this._max); + return this._value; + } + }, { + key: "__attach", + value: function __attach() { + this._a.__addChild(this); + } + }, { + key: "__detach", + value: function __detach() { + this._a.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[5])(_$$_REQUIRE(_dependencyMap[0])(AnimatedDiffClamp.prototype), "__detach", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + return { + type: 'diffclamp', + input: this._a.__getNativeTag(), + min: this._min, + max: this._max + }; + } + }]); + + return AnimatedDiffClamp; + }(_$$_REQUIRE(_dependencyMap[7])); + + module.exports = AnimatedDiffClamp; +},239,[16,14,12,7,8,90,227,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedTracking = function (_AnimatedNode) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedTracking, _AnimatedNode); + + var _super = _createSuper(AnimatedTracking); + + function AnimatedTracking(value, parent, animationClass, animationConfig, callback) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedTracking); + + _this = _super.call(this); + _this._value = value; + _this._parent = parent; + _this._animationClass = animationClass; + _this._animationConfig = animationConfig; + _this._useNativeDriver = _$$_REQUIRE(_dependencyMap[4]).shouldUseNativeDriver(animationConfig); + _this._callback = callback; + + _this.__attach(); + + return _this; + } + + _$$_REQUIRE(_dependencyMap[5])(AnimatedTracking, [{ + key: "__makeNative", + value: function __makeNative() { + this.__isNative = true; + + this._parent.__makeNative(); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedTracking.prototype), "__makeNative", this).call(this); + + this._value.__makeNative(); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._parent.__getValue(); + } + }, { + key: "__attach", + value: function __attach() { + this._parent.__addChild(this); + + if (this._useNativeDriver) { + this.__makeNative(); + } + } + }, { + key: "__detach", + value: function __detach() { + this._parent.__removeChild(this); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedTracking.prototype), "__detach", this).call(this); + } + }, { + key: "update", + value: function update() { + this._value.animate(new this._animationClass(_$$_REQUIRE(_dependencyMap[7])({}, this._animationConfig, { + toValue: this._animationConfig.toValue.__getValue() + })), this._callback); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var animation = new this._animationClass(_$$_REQUIRE(_dependencyMap[7])({}, this._animationConfig, { + toValue: undefined + })); + + var animationConfig = animation.__getNativeAnimationConfig(); + + return { + type: 'tracking', + animationId: _$$_REQUIRE(_dependencyMap[4]).generateNewAnimationId(), + animationConfig: animationConfig, + toValue: this._parent.__getNativeTag(), + value: this._value.__getNativeTag() + }; + } + }]); + + return AnimatedTracking; + }(_$$_REQUIRE(_dependencyMap[8])); + + module.exports = AnimatedTracking; +},240,[16,14,12,7,224,8,90,6,229]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SpringAnimation = function (_Animation) { + _$$_REQUIRE(_dependencyMap[2])(SpringAnimation, _Animation); + + var _super = _createSuper(SpringAnimation); + + function SpringAnimation(config) { + var _config$overshootClam, _config$restDisplacem, _config$restSpeedThre, _config$velocity, _config$velocity2, _config$delay, _config$isInteraction, _config$iterations; + + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, SpringAnimation); + + _this = _super.call(this); + _this._overshootClamping = (_config$overshootClam = config.overshootClamping) != null ? _config$overshootClam : false; + _this._restDisplacementThreshold = (_config$restDisplacem = config.restDisplacementThreshold) != null ? _config$restDisplacem : 0.001; + _this._restSpeedThreshold = (_config$restSpeedThre = config.restSpeedThreshold) != null ? _config$restSpeedThre : 0.001; + _this._initialVelocity = (_config$velocity = config.velocity) != null ? _config$velocity : 0; + _this._lastVelocity = (_config$velocity2 = config.velocity) != null ? _config$velocity2 : 0; + _this._toValue = config.toValue; + _this._delay = (_config$delay = config.delay) != null ? _config$delay : 0; + _this._useNativeDriver = _$$_REQUIRE(_dependencyMap[4]).shouldUseNativeDriver(config); + _this.__isInteraction = (_config$isInteraction = config.isInteraction) != null ? _config$isInteraction : !_this._useNativeDriver; + _this.__iterations = (_config$iterations = config.iterations) != null ? _config$iterations : 1; + + if (config.stiffness !== undefined || config.damping !== undefined || config.mass !== undefined) { + var _config$stiffness, _config$damping, _config$mass; + + _$$_REQUIRE(_dependencyMap[5])(config.bounciness === undefined && config.speed === undefined && config.tension === undefined && config.friction === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one'); + + _this._stiffness = (_config$stiffness = config.stiffness) != null ? _config$stiffness : 100; + _this._damping = (_config$damping = config.damping) != null ? _config$damping : 10; + _this._mass = (_config$mass = config.mass) != null ? _config$mass : 1; + } else if (config.bounciness !== undefined || config.speed !== undefined) { + var _config$bounciness, _config$speed; + + _$$_REQUIRE(_dependencyMap[5])(config.tension === undefined && config.friction === undefined && config.stiffness === undefined && config.damping === undefined && config.mass === undefined, 'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one'); + + var springConfig = _$$_REQUIRE(_dependencyMap[6]).fromBouncinessAndSpeed((_config$bounciness = config.bounciness) != null ? _config$bounciness : 8, (_config$speed = config.speed) != null ? _config$speed : 12); + + _this._stiffness = springConfig.stiffness; + _this._damping = springConfig.damping; + _this._mass = 1; + } else { + var _config$tension, _config$friction; + + var _springConfig = _$$_REQUIRE(_dependencyMap[6]).fromOrigamiTensionAndFriction((_config$tension = config.tension) != null ? _config$tension : 40, (_config$friction = config.friction) != null ? _config$friction : 7); + + _this._stiffness = _springConfig.stiffness; + _this._damping = _springConfig.damping; + _this._mass = 1; + } + + _$$_REQUIRE(_dependencyMap[5])(_this._stiffness > 0, 'Stiffness value must be greater than 0'); + + _$$_REQUIRE(_dependencyMap[5])(_this._damping > 0, 'Damping value must be greater than 0'); + + _$$_REQUIRE(_dependencyMap[5])(_this._mass > 0, 'Mass value must be greater than 0'); + + return _this; + } + + _$$_REQUIRE(_dependencyMap[7])(SpringAnimation, [{ + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + var _this$_initialVelocit; + + return { + type: 'spring', + overshootClamping: this._overshootClamping, + restDisplacementThreshold: this._restDisplacementThreshold, + restSpeedThreshold: this._restSpeedThreshold, + stiffness: this._stiffness, + damping: this._damping, + mass: this._mass, + initialVelocity: (_this$_initialVelocit = this._initialVelocity) != null ? _this$_initialVelocit : this._lastVelocity, + toValue: this._toValue, + iterations: this.__iterations + }; + } + }, { + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + var _this2 = this; + + this.__active = true; + this._startPosition = fromValue; + this._lastPosition = this._startPosition; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + this._lastTime = Date.now(); + this._frameTime = 0.0; + + if (previousAnimation instanceof SpringAnimation) { + var internalState = previousAnimation.getInternalState(); + this._lastPosition = internalState.lastPosition; + this._lastVelocity = internalState.lastVelocity; + this._initialVelocity = this._lastVelocity; + this._lastTime = internalState.lastTime; + } + + var start = function start() { + if (_this2._useNativeDriver) { + _this2.__startNativeAnimation(animatedValue); + } else { + _this2.onUpdate(); + } + }; + + if (this._delay) { + this._timeout = setTimeout(start, this._delay); + } else { + start(); + } + } + }, { + key: "getInternalState", + value: function getInternalState() { + return { + lastPosition: this._lastPosition, + lastVelocity: this._lastVelocity, + lastTime: this._lastTime + }; + } + }, { + key: "onUpdate", + value: function onUpdate() { + var MAX_STEPS = 64; + var now = Date.now(); + + if (now > this._lastTime + MAX_STEPS) { + now = this._lastTime + MAX_STEPS; + } + + var deltaTime = (now - this._lastTime) / 1000; + this._frameTime += deltaTime; + var c = this._damping; + var m = this._mass; + var k = this._stiffness; + var v0 = -this._initialVelocity; + var zeta = c / (2 * Math.sqrt(k * m)); + var omega0 = Math.sqrt(k / m); + var omega1 = omega0 * Math.sqrt(1.0 - zeta * zeta); + var x0 = this._toValue - this._startPosition; + var position = 0.0; + var velocity = 0.0; + var t = this._frameTime; + + if (zeta < 1) { + var envelope = Math.exp(-zeta * omega0 * t); + position = this._toValue - envelope * ((v0 + zeta * omega0 * x0) / omega1 * Math.sin(omega1 * t) + x0 * Math.cos(omega1 * t)); + velocity = zeta * omega0 * envelope * (Math.sin(omega1 * t) * (v0 + zeta * omega0 * x0) / omega1 + x0 * Math.cos(omega1 * t)) - envelope * (Math.cos(omega1 * t) * (v0 + zeta * omega0 * x0) - omega1 * x0 * Math.sin(omega1 * t)); + } else { + var _envelope = Math.exp(-omega0 * t); + + position = this._toValue - _envelope * (x0 + (v0 + omega0 * x0) * t); + velocity = _envelope * (v0 * (t * omega0 - 1) + t * x0 * (omega0 * omega0)); + } + + this._lastTime = now; + this._lastPosition = position; + this._lastVelocity = velocity; + + this._onUpdate(position); + + if (!this.__active) { + return; + } + + var isOvershooting = false; + + if (this._overshootClamping && this._stiffness !== 0) { + if (this._startPosition < this._toValue) { + isOvershooting = position > this._toValue; + } else { + isOvershooting = position < this._toValue; + } + } + + var isVelocity = Math.abs(velocity) <= this._restSpeedThreshold; + + var isDisplacement = true; + + if (this._stiffness !== 0) { + isDisplacement = Math.abs(this._toValue - position) <= this._restDisplacementThreshold; + } + + if (isOvershooting || isVelocity && isDisplacement) { + if (this._stiffness !== 0) { + this._lastPosition = this._toValue; + this._lastVelocity = 0; + + this._onUpdate(this._toValue); + } + + this.__debouncedOnEnd({ + finished: true + }); + + return; + } + + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + }, { + key: "stop", + value: function stop() { + _$$_REQUIRE(_dependencyMap[8])(_$$_REQUIRE(_dependencyMap[0])(SpringAnimation.prototype), "stop", this).call(this); + + this.__active = false; + clearTimeout(this._timeout); + global.cancelAnimationFrame(this._animationFrame); + + this.__debouncedOnEnd({ + finished: false + }); + } + }]); + + return SpringAnimation; + }(_$$_REQUIRE(_dependencyMap[9])); + + module.exports = SpringAnimation; +},241,[16,14,12,7,224,36,242,8,90,243]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function stiffnessFromOrigamiValue(oValue) { + return (oValue - 30) * 3.62 + 194; + } + + function dampingFromOrigamiValue(oValue) { + return (oValue - 8) * 3 + 25; + } + + function fromOrigamiTensionAndFriction(tension, friction) { + return { + stiffness: stiffnessFromOrigamiValue(tension), + damping: dampingFromOrigamiValue(friction) + }; + } + + function fromBouncinessAndSpeed(bounciness, speed) { + function normalize(value, startValue, endValue) { + return (value - startValue) / (endValue - startValue); + } + + function projectNormal(n, start, end) { + return start + n * (end - start); + } + + function linearInterpolation(t, start, end) { + return t * end + (1 - t) * start; + } + + function quadraticOutInterpolation(t, start, end) { + return linearInterpolation(2 * t - t * t, start, end); + } + + function b3Friction1(x) { + return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28; + } + + function b3Friction2(x) { + return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2; + } + + function b3Friction3(x) { + return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84; + } + + function b3Nobounce(tension) { + if (tension <= 18) { + return b3Friction1(tension); + } else if (tension > 18 && tension <= 44) { + return b3Friction2(tension); + } else { + return b3Friction3(tension); + } + } + + var b = normalize(bounciness / 1.7, 0, 20); + b = projectNormal(b, 0, 0.8); + var s = normalize(speed / 1.7, 0, 20); + var bouncyTension = projectNormal(s, 0.5, 200); + var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01); + return { + stiffness: stiffnessFromOrigamiValue(bouncyTension), + damping: dampingFromOrigamiValue(bouncyFriction) + }; + } + + module.exports = { + fromOrigamiTensionAndFriction: fromOrigamiTensionAndFriction, + fromBouncinessAndSpeed: fromBouncinessAndSpeed + }; +},242,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var startNativeAnimationNextId = 1; + + var Animation = function () { + function Animation() { + _$$_REQUIRE(_dependencyMap[0])(this, Animation); + } + + _$$_REQUIRE(_dependencyMap[1])(Animation, [{ + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {} + }, { + key: "stop", + value: function stop() { + if (this.__nativeId) { + _$$_REQUIRE(_dependencyMap[2]).API.stopAnimation(this.__nativeId); + } + } + }, { + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + throw new Error('This animation type cannot be offloaded to native'); + } + }, { + key: "__debouncedOnEnd", + value: function __debouncedOnEnd(result) { + var onEnd = this.__onEnd; + this.__onEnd = null; + onEnd && onEnd(result); + } + }, { + key: "__startNativeAnimation", + value: function __startNativeAnimation(animatedValue) { + var startNativeAnimationWaitId = startNativeAnimationNextId + ":startAnimation"; + startNativeAnimationNextId += 1; + + _$$_REQUIRE(_dependencyMap[2]).API.setWaitingForIdentifier(startNativeAnimationWaitId); + + try { + animatedValue.__makeNative(); + + this.__nativeId = _$$_REQUIRE(_dependencyMap[2]).generateNewAnimationId(); + + _$$_REQUIRE(_dependencyMap[2]).API.startAnimatingNode(this.__nativeId, animatedValue.__getNativeTag(), this.__getNativeAnimationConfig(), this.__debouncedOnEnd.bind(this)); + } catch (e) { + throw e; + } finally { + _$$_REQUIRE(_dependencyMap[2]).API.unsetWaitingForIdentifier(startNativeAnimationWaitId); + } + } + }]); + + return Animation; + }(); + + module.exports = Animation; +},243,[7,8,224]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _easeInOut; + + function easeInOut() { + if (!_easeInOut) { + var Easing = _$$_REQUIRE(_dependencyMap[2]); + + _easeInOut = Easing.inOut(Easing.ease); + } + + return _easeInOut; + } + + var TimingAnimation = function (_Animation) { + _$$_REQUIRE(_dependencyMap[3])(TimingAnimation, _Animation); + + var _super = _createSuper(TimingAnimation); + + function TimingAnimation(config) { + var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction; + + var _this; + + _$$_REQUIRE(_dependencyMap[4])(this, TimingAnimation); + + _this = _super.call(this); + _this._toValue = config.toValue; + _this._easing = (_config$easing = config.easing) != null ? _config$easing : easeInOut(); + _this._duration = (_config$duration = config.duration) != null ? _config$duration : 500; + _this._delay = (_config$delay = config.delay) != null ? _config$delay : 0; + _this.__iterations = (_config$iterations = config.iterations) != null ? _config$iterations : 1; + _this._useNativeDriver = _$$_REQUIRE(_dependencyMap[5]).shouldUseNativeDriver(config); + _this.__isInteraction = (_config$isInteraction = config.isInteraction) != null ? _config$isInteraction : !_this._useNativeDriver; + return _this; + } + + _$$_REQUIRE(_dependencyMap[6])(TimingAnimation, [{ + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + var frameDuration = 16.666666666666668; + var frames = []; + var numFrames = Math.round(this._duration / frameDuration); + + for (var frame = 0; frame < numFrames; frame++) { + frames.push(this._easing(frame / numFrames)); + } + + frames.push(this._easing(1)); + return { + type: 'frames', + frames: frames, + toValue: this._toValue, + iterations: this.__iterations + }; + } + }, { + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + var _this2 = this; + + this.__active = true; + this._fromValue = fromValue; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + + var start = function start() { + if (_this2._duration === 0 && !_this2._useNativeDriver) { + _this2._onUpdate(_this2._toValue); + + _this2.__debouncedOnEnd({ + finished: true + }); + } else { + _this2._startTime = Date.now(); + + if (_this2._useNativeDriver) { + _this2.__startNativeAnimation(animatedValue); + } else { + _this2._animationFrame = requestAnimationFrame(_this2.onUpdate.bind(_this2)); + } + } + }; + + if (this._delay) { + this._timeout = setTimeout(start, this._delay); + } else { + start(); + } + } + }, { + key: "onUpdate", + value: function onUpdate() { + var now = Date.now(); + + if (now >= this._startTime + this._duration) { + if (this._duration === 0) { + this._onUpdate(this._toValue); + } else { + this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue)); + } + + this.__debouncedOnEnd({ + finished: true + }); + + return; + } + + this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue)); + + if (this.__active) { + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: "stop", + value: function stop() { + _$$_REQUIRE(_dependencyMap[7])(_$$_REQUIRE(_dependencyMap[0])(TimingAnimation.prototype), "stop", this).call(this); + + this.__active = false; + clearTimeout(this._timeout); + global.cancelAnimationFrame(this._animationFrame); + + this.__debouncedOnEnd({ + finished: false + }); + } + }]); + + return TimingAnimation; + }(_$$_REQUIRE(_dependencyMap[8])); + + module.exports = TimingAnimation; +},244,[16,14,245,12,7,224,8,90,243]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _ease; + + var Easing = function () { + function Easing() { + _$$_REQUIRE(_dependencyMap[0])(this, Easing); + } + + _$$_REQUIRE(_dependencyMap[1])(Easing, null, [{ + key: "step0", + value: function step0(n) { + return n > 0 ? 1 : 0; + } + }, { + key: "step1", + value: function step1(n) { + return n >= 1 ? 1 : 0; + } + }, { + key: "linear", + value: function linear(t) { + return t; + } + }, { + key: "ease", + value: function ease(t) { + if (!_ease) { + _ease = Easing.bezier(0.42, 0, 1, 1); + } + + return _ease(t); + } + }, { + key: "quad", + value: function quad(t) { + return t * t; + } + }, { + key: "cubic", + value: function cubic(t) { + return t * t * t; + } + }, { + key: "poly", + value: function poly(n) { + return function (t) { + return Math.pow(t, n); + }; + } + }, { + key: "sin", + value: function sin(t) { + return 1 - Math.cos(t * Math.PI / 2); + } + }, { + key: "circle", + value: function circle(t) { + return 1 - Math.sqrt(1 - t * t); + } + }, { + key: "exp", + value: function exp(t) { + return Math.pow(2, 10 * (t - 1)); + } + }, { + key: "elastic", + value: function elastic() { + var bounciness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var p = bounciness * Math.PI; + return function (t) { + return 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p); + }; + } + }, { + key: "back", + value: function back() { + var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1.70158; + return function (t) { + return t * t * ((s + 1) * t - s); + }; + } + }, { + key: "bounce", + value: function bounce(t) { + if (t < 0.36363636363636365) { + return 7.5625 * t * t; + } + + if (t < 0.7272727272727273) { + var _t = t - 0.5454545454545454; + + return 7.5625 * _t * _t + 0.75; + } + + if (t < 0.9090909090909091) { + var _t2 = t - 0.8181818181818182; + + return 7.5625 * _t2 * _t2 + 0.9375; + } + + var t2 = t - 0.9545454545454546; + return 7.5625 * t2 * t2 + 0.984375; + } + }, { + key: "bezier", + value: function bezier(x1, y1, x2, y2) { + var _bezier = _$$_REQUIRE(_dependencyMap[2]); + + return _bezier(x1, y1, x2, y2); + } + }, { + key: "in", + value: function _in(easing) { + return easing; + } + }, { + key: "out", + value: function out(easing) { + return function (t) { + return 1 - easing(1 - t); + }; + } + }, { + key: "inOut", + value: function inOut(easing) { + return function (t) { + if (t < 0.5) { + return easing(t * 2) / 2; + } + + return 1 - easing((1 - t) * 2) / 2; + }; + } + }]); + + return Easing; + }(); + + module.exports = Easing; +},245,[7,8,246]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var NEWTON_ITERATIONS = 4; + var NEWTON_MIN_SLOPE = 0.001; + var SUBDIVISION_PRECISION = 0.0000001; + var SUBDIVISION_MAX_ITERATIONS = 10; + var kSplineTableSize = 11; + var kSampleStepSize = 0.1; + var float32ArraySupported = typeof Float32Array === 'function'; + + function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; + } + + function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; + } + + function C(aA1) { + return 3.0 * aA1; + } + + function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + } + + function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); + } + + function binarySubdivide(aX, _aA, _aB, mX1, mX2) { + var currentX, + currentT, + i = 0, + aA = _aA, + aB = _aB; + + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); + + return currentT; + } + + function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) { + var aGuessT = _aGuessT; + + for (var i = 0; i < NEWTON_ITERATIONS; ++i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + + if (currentSlope === 0.0) { + return aGuessT; + } + + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + + return aGuessT; + } + + module.exports = function bezier(mX1, mY1, mX2, mY2) { + if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) { + throw new Error('bezier x values must be in [0, 1] range'); + } + + var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + + if (mX1 !== mY1 || mX2 !== mY2) { + for (var i = 0; i < kSplineTableSize; ++i) { + sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); + } + } + + function getTForX(aX) { + var intervalStart = 0.0; + var currentSample = 1; + var lastSample = 10; + + for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + + --currentSample; + var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); + var guessForT = intervalStart + dist * kSampleStepSize; + var initialSlope = getSlope(guessForT, mX1, mX2); + + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT, mX1, mX2); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); + } + } + + return function BezierEasing(x) { + if (mX1 === mY1 && mX2 === mY2) { + return x; + } + + if (x === 0) { + return 0; + } + + if (x === 1) { + return 1; + } + + return calcBezier(getTForX(x), mY1, mY2); + }; + }; +},246,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DecayAnimation = function (_Animation) { + _$$_REQUIRE(_dependencyMap[2])(DecayAnimation, _Animation); + + var _super = _createSuper(DecayAnimation); + + function DecayAnimation(config) { + var _config$deceleration, _config$isInteraction, _config$iterations; + + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, DecayAnimation); + + _this = _super.call(this); + _this._deceleration = (_config$deceleration = config.deceleration) != null ? _config$deceleration : 0.998; + _this._velocity = config.velocity; + _this._useNativeDriver = _$$_REQUIRE(_dependencyMap[4]).shouldUseNativeDriver(config); + _this.__isInteraction = (_config$isInteraction = config.isInteraction) != null ? _config$isInteraction : !_this._useNativeDriver; + _this.__iterations = (_config$iterations = config.iterations) != null ? _config$iterations : 1; + return _this; + } + + _$$_REQUIRE(_dependencyMap[5])(DecayAnimation, [{ + key: "__getNativeAnimationConfig", + value: function __getNativeAnimationConfig() { + return { + type: 'decay', + deceleration: this._deceleration, + velocity: this._velocity, + iterations: this.__iterations + }; + } + }, { + key: "start", + value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) { + this.__active = true; + this._lastValue = fromValue; + this._fromValue = fromValue; + this._onUpdate = onUpdate; + this.__onEnd = onEnd; + this._startTime = Date.now(); + + if (this._useNativeDriver) { + this.__startNativeAnimation(animatedValue); + } else { + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: "onUpdate", + value: function onUpdate() { + var now = Date.now(); + var value = this._fromValue + this._velocity / (1 - this._deceleration) * (1 - Math.exp(-(1 - this._deceleration) * (now - this._startTime))); + + this._onUpdate(value); + + if (Math.abs(this._lastValue - value) < 0.1) { + this.__debouncedOnEnd({ + finished: true + }); + + return; + } + + this._lastValue = value; + + if (this.__active) { + this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this)); + } + } + }, { + key: "stop", + value: function stop() { + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(DecayAnimation.prototype), "stop", this).call(this); + + this.__active = false; + global.cancelAnimationFrame(this._animationFrame); + + this.__debouncedOnEnd({ + finished: false + }); + } + }]); + + return DecayAnimation; + }(_$$_REQUIRE(_dependencyMap[7])); + + module.exports = DecayAnimation; +},247,[16,14,12,7,224,8,90,243]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function attachNativeEvent(viewRef, eventName, argMapping) { + var eventMappings = []; + + var traverse = function traverse(value, path) { + if (value instanceof _$$_REQUIRE(_dependencyMap[0])) { + value.__makeNative(); + + eventMappings.push({ + nativeEventPath: path, + animatedValueTag: value.__getNativeTag() + }); + } else if (value instanceof _$$_REQUIRE(_dependencyMap[1])) { + traverse(value.x, path.concat('x')); + traverse(value.y, path.concat('y')); + } else if (typeof value === 'object') { + for (var _key in value) { + traverse(value[_key], path.concat(_key)); + } + } + }; + + _$$_REQUIRE(_dependencyMap[2])(argMapping[0] && argMapping[0].nativeEvent, 'Native driven events only support animated values contained inside `nativeEvent`.'); + + traverse(argMapping[0].nativeEvent, []); + + var viewTag = _$$_REQUIRE(_dependencyMap[3]).findNodeHandle(viewRef); + + if (viewTag != null) { + eventMappings.forEach(function (mapping) { + _$$_REQUIRE(_dependencyMap[4]).API.addAnimatedEventToView(viewTag, eventName, mapping); + }); + } + + return { + detach: function detach() { + if (viewTag != null) { + eventMappings.forEach(function (mapping) { + _$$_REQUIRE(_dependencyMap[4]).API.removeAnimatedEventFromView(viewTag, eventName, mapping.animatedValueTag); + }); + } + } + }; + } + + var AnimatedEvent = function () { + function AnimatedEvent(argMapping, config) { + _$$_REQUIRE(_dependencyMap[5])(this, AnimatedEvent); + + this._listeners = []; + this._argMapping = argMapping; + + if (config == null) { + console.warn('Animated.event now requires a second argument for options'); + config = { + useNativeDriver: false + }; + } + + if (config.listener) { + this.__addListener(config.listener); + } + + this._callListeners = this._callListeners.bind(this); + this._attachedEvent = null; + this.__isNative = _$$_REQUIRE(_dependencyMap[4]).shouldUseNativeDriver(config); + } + + _$$_REQUIRE(_dependencyMap[6])(AnimatedEvent, [{ + key: "__addListener", + value: function __addListener(callback) { + this._listeners.push(callback); + } + }, { + key: "__removeListener", + value: function __removeListener(callback) { + this._listeners = this._listeners.filter(function (listener) { + return listener !== callback; + }); + } + }, { + key: "__attach", + value: function __attach(viewRef, eventName) { + _$$_REQUIRE(_dependencyMap[2])(this.__isNative, 'Only native driven events need to be attached.'); + + this._attachedEvent = attachNativeEvent(viewRef, eventName, this._argMapping); + } + }, { + key: "__detach", + value: function __detach(viewTag, eventName) { + _$$_REQUIRE(_dependencyMap[2])(this.__isNative, 'Only native driven events need to be detached.'); + + this._attachedEvent && this._attachedEvent.detach(); + } + }, { + key: "__getHandler", + value: function __getHandler() { + var _this = this; + + if (this.__isNative) { + { + return this._callListeners; + } + } + + var validatedMapping = false; + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { + args[_key3] = arguments[_key3]; + } + + var traverse = function traverse(recMapping, recEvt) { + if (recMapping instanceof _$$_REQUIRE(_dependencyMap[0])) { + if (typeof recEvt === 'number') { + recMapping.setValue(recEvt); + } + } else if (recMapping instanceof _$$_REQUIRE(_dependencyMap[1])) { + if (typeof recEvt === 'object') { + traverse(recMapping.x, recEvt.x); + traverse(recMapping.y, recEvt.y); + } + } else if (typeof recMapping === 'object') { + for (var mappingKey in recMapping) { + traverse(recMapping[mappingKey], recEvt[mappingKey]); + } + } + }; + + _this._argMapping.forEach(function (mapping, idx) { + traverse(mapping, args[idx]); + }); + + _this._callListeners.apply(_this, args); + }; + } + }, { + key: "_callListeners", + value: function _callListeners() { + for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) { + args[_key4] = arguments[_key4]; + } + + this._listeners.forEach(function (listener) { + return listener.apply(undefined, args); + }); + } + }]); + + return AnimatedEvent; + }(); + + module.exports = { + AnimatedEvent: AnimatedEvent, + attachNativeEvent: attachNativeEvent + }; +},248,[223,232,36,54,224,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var createAnimatedComponentInjection = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _createAnimatedCompon; + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var React = _$$_REQUIRE(_dependencyMap[9]); + + var animatedComponentNextId = 1; + + function createAnimatedComponent(Component) { + _$$_REQUIRE(_dependencyMap[10])(typeof Component !== 'function' || Component.prototype && Component.prototype.isReactComponent, "`createAnimatedComponent` does not support stateless functional components; use a class component instead."); + + var AnimatedComponent = function (_React$Component) { + (0, _inherits2.default)(AnimatedComponent, _React$Component); + + var _super = _createSuper(AnimatedComponent); + + function AnimatedComponent() { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedComponent); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this._invokeAnimatedPropsCallbackOnMount = false; + _this._eventDetachers = []; + _this._animatedComponentId = animatedComponentNextId++ + ":animatedComponent"; + + _this._isFabric = function () { + var _this$_component$_int, _this$_component$_int2, _this$_component$getN, _this$_component$getN2, _this$_component$getS, _this$_component$getS2; + + if (_this._component == null) { + return false; + } + + return ((_this$_component$_int = _this._component['_internalInstanceHandle']) == null ? undefined : (_this$_component$_int2 = _this$_component$_int.stateNode) == null ? undefined : _this$_component$_int2.canonical) != null || _this._component.getNativeScrollRef != null && _this._component.getNativeScrollRef() != null && ((_this$_component$getN = _this._component.getNativeScrollRef()['_internalInstanceHandle']) == null ? undefined : (_this$_component$getN2 = _this$_component$getN.stateNode) == null ? undefined : _this$_component$getN2.canonical) != null || _this._component.getScrollResponder != null && _this._component.getScrollResponder() != null && _this._component.getScrollResponder().getNativeScrollRef != null && _this._component.getScrollResponder().getNativeScrollRef() != null && ((_this$_component$getS = _this._component.getScrollResponder().getNativeScrollRef()['_internalInstanceHandle']) == null ? undefined : (_this$_component$getS2 = _this$_component$getS.stateNode) == null ? undefined : _this$_component$getS2.canonical) != null; + }; + + _this._waitForUpdate = function () { + if (_this._isFabric()) { + _$$_REQUIRE(_dependencyMap[11]).API.setWaitingForIdentifier(_this._animatedComponentId); + } + }; + + _this._markUpdateComplete = function () { + if (_this._isFabric()) { + _$$_REQUIRE(_dependencyMap[11]).API.unsetWaitingForIdentifier(_this._animatedComponentId); + } + }; + + _this._animatedPropsCallback = function () { + if (_this._component == null) { + _this._invokeAnimatedPropsCallbackOnMount = true; + } else if (typeof _this._component.setNativeProps !== 'function' || _this._isFabric()) { + _this.forceUpdate(); + } else if (!_this._propsAnimated.__isNative) { + _this._component.setNativeProps(_this._propsAnimated.__getAnimatedValue()); + } else { + throw new Error("Attempting to run JS driven animation on animated node that has been moved to \"native\" earlier by starting an animation with `useNativeDriver: true`"); + } + }; + + _this._setComponentRef = _$$_REQUIRE(_dependencyMap[12])({ + getForwardedRef: function getForwardedRef() { + return _this.props.forwardedRef; + }, + setLocalRef: function setLocalRef(ref) { + _this._prevComponent = _this._component; + _this._component = ref; + } + }); + return _this; + } + + (0, _createClass2.default)(AnimatedComponent, [{ + key: "_attachNativeEvents", + value: function _attachNativeEvents() { + var _this$_component, + _this2 = this; + + var scrollableNode = (_this$_component = this._component) != null && _this$_component.getScrollableNode ? this._component.getScrollableNode() : this._component; + + var _loop = function _loop(key) { + var prop = _this2.props[key]; + + if (prop instanceof _$$_REQUIRE(_dependencyMap[13]).AnimatedEvent && prop.__isNative) { + prop.__attach(scrollableNode, key); + + _this2._eventDetachers.push(function () { + return prop.__detach(scrollableNode, key); + }); + } + }; + + for (var key in this.props) { + _loop(key); + } + } + }, { + key: "_detachNativeEvents", + value: function _detachNativeEvents() { + this._eventDetachers.forEach(function (remove) { + return remove(); + }); + + this._eventDetachers = []; + } + }, { + key: "_attachProps", + value: function _attachProps(nextProps) { + var oldPropsAnimated = this._propsAnimated; + this._propsAnimated = new (_$$_REQUIRE(_dependencyMap[14]))(nextProps, this._animatedPropsCallback); + + this._propsAnimated.__attach(); + + if (oldPropsAnimated) { + oldPropsAnimated.__restoreDefaultValues(); + + oldPropsAnimated.__detach(); + } + } + }, { + key: "render", + value: function render() { + var _ref = this._propsAnimated.__getValue() || {}, + _ref$style = _ref.style, + style = _ref$style === undefined ? {} : _ref$style, + props = (0, _objectWithoutProperties2.default)(_ref, ["style"]); + + var _ref2 = this.props.passthroughAnimatedPropExplicitValues || {}, + _ref2$style = _ref2.style, + passthruStyle = _ref2$style === undefined ? {} : _ref2$style, + passthruProps = (0, _objectWithoutProperties2.default)(_ref2, ["style"]); + + var mergedStyle = (0, _extends2.default)({}, style, passthruStyle); + return React.createElement(Component, (0, _extends2.default)({}, props, passthruProps, { + collapsable: false, + style: mergedStyle, + ref: this._setComponentRef + })); + } + }, { + key: "UNSAFE_componentWillMount", + value: function UNSAFE_componentWillMount() { + this._waitForUpdate(); + + this._attachProps(this.props); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + if (this._invokeAnimatedPropsCallbackOnMount) { + this._invokeAnimatedPropsCallbackOnMount = false; + + this._animatedPropsCallback(); + } + + this._propsAnimated.setNativeView(this._component); + + this._attachNativeEvents(); + + this._markUpdateComplete(); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + this._waitForUpdate(); + + this._attachProps(newProps); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (this._component !== this._prevComponent) { + this._propsAnimated.setNativeView(this._component); + } + + if (this._component !== this._prevComponent || prevProps !== this.props) { + this._detachNativeEvents(); + + this._attachNativeEvents(); + } + + this._markUpdateComplete(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._propsAnimated && this._propsAnimated.__detach(); + + this._detachNativeEvents(); + + this._markUpdateComplete(); + + this._component = null; + this._prevComponent = null; + } + }]); + return AnimatedComponent; + }(React.Component); + + return React.forwardRef(function AnimatedComponentWrapper(props, ref) { + return React.createElement(AnimatedComponent, (0, _extends2.default)({}, props, ref == null ? null : { + forwardedRef: ref + })); + }); + } + + module.exports = (_createAnimatedCompon = createAnimatedComponentInjection.recordAndRetrieve()) != null ? _createAnimatedCompon : createAnimatedComponent; +},249,[5,6,108,7,8,12,14,16,250,17,36,224,251,248,252]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.inject = inject; + exports.recordAndRetrieve = recordAndRetrieve; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var injected; + + function inject(newInjected) { + if (injected !== undefined) { + return; + } + + injected = newInjected; + } + + function recordAndRetrieve() { + if (injected === undefined) { + injected = null; + } + + return injected; + } +},250,[17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function setAndForwardRef(_ref) { + var getForwardedRef = _ref.getForwardedRef, + setLocalRef = _ref.setLocalRef; + return function forwardRef(ref) { + var forwardedRef = getForwardedRef(); + setLocalRef(ref); + + if (typeof forwardedRef === 'function') { + forwardedRef(ref); + } else if (typeof forwardedRef === 'object' && forwardedRef != null) { + forwardedRef.current = ref; + } + }; + } + + module.exports = setAndForwardRef; +},251,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedProps = function (_AnimatedNode) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedProps, _AnimatedNode); + + var _super = _createSuper(AnimatedProps); + + function AnimatedProps(props, callback) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedProps); + + _this = _super.call(this); + + if (props.style) { + props = _$$_REQUIRE(_dependencyMap[4])({}, props, { + style: new (_$$_REQUIRE(_dependencyMap[5]))(props.style) + }); + } + + _this._props = props; + _this._callback = callback; + return _this; + } + + _$$_REQUIRE(_dependencyMap[6])(AnimatedProps, [{ + key: "__getValue", + value: function __getValue() { + var props = {}; + + for (var key in this._props) { + var value = this._props[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[7])) { + if (!value.__isNative || value instanceof _$$_REQUIRE(_dependencyMap[5])) { + props[key] = value.__getValue(); + } + } else if (value instanceof _$$_REQUIRE(_dependencyMap[8]).AnimatedEvent) { + props[key] = value.__getHandler(); + } else { + props[key] = value; + } + } + + return props; + } + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + var props = {}; + + for (var key in this._props) { + var value = this._props[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[7])) { + props[key] = value.__getAnimatedValue(); + } + } + + return props; + } + }, { + key: "__attach", + value: function __attach() { + for (var key in this._props) { + var value = this._props[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[7])) { + value.__addChild(this); + } + } + } + }, { + key: "__detach", + value: function __detach() { + if (this.__isNative && this._animatedView) { + this.__disconnectAnimatedView(); + } + + for (var key in this._props) { + var value = this._props[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[7])) { + value.__removeChild(this); + } + } + + _$$_REQUIRE(_dependencyMap[9])(_$$_REQUIRE(_dependencyMap[0])(AnimatedProps.prototype), "__detach", this).call(this); + } + }, { + key: "update", + value: function update() { + this._callback(); + } + }, { + key: "__makeNative", + value: function __makeNative() { + if (!this.__isNative) { + this.__isNative = true; + + for (var key in this._props) { + var value = this._props[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[7])) { + value.__makeNative(); + } + } + + if (this._animatedView) { + this.__connectAnimatedView(); + } + } + } + }, { + key: "setNativeView", + value: function setNativeView(animatedView) { + if (this._animatedView === animatedView) { + return; + } + + this._animatedView = animatedView; + + if (this.__isNative) { + this.__connectAnimatedView(); + } + } + }, { + key: "__connectAnimatedView", + value: function __connectAnimatedView() { + _$$_REQUIRE(_dependencyMap[10])(this.__isNative, 'Expected node to be marked as "native"'); + + var nativeViewTag = _$$_REQUIRE(_dependencyMap[11]).findNodeHandle(this._animatedView); + + _$$_REQUIRE(_dependencyMap[10])(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + + _$$_REQUIRE(_dependencyMap[12]).API.connectAnimatedNodeToView(this.__getNativeTag(), nativeViewTag); + } + }, { + key: "__disconnectAnimatedView", + value: function __disconnectAnimatedView() { + _$$_REQUIRE(_dependencyMap[10])(this.__isNative, 'Expected node to be marked as "native"'); + + var nativeViewTag = _$$_REQUIRE(_dependencyMap[11]).findNodeHandle(this._animatedView); + + _$$_REQUIRE(_dependencyMap[10])(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + + _$$_REQUIRE(_dependencyMap[12]).API.disconnectAnimatedNodeFromView(this.__getNativeTag(), nativeViewTag); + } + }, { + key: "__restoreDefaultValues", + value: function __restoreDefaultValues() { + if (this.__isNative) { + _$$_REQUIRE(_dependencyMap[12]).API.restoreDefaultValues(this.__getNativeTag()); + } + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var propsConfig = {}; + + for (var propKey in this._props) { + var value = this._props[propKey]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[7])) { + value.__makeNative(); + + propsConfig[propKey] = value.__getNativeTag(); + } + } + + return { + type: 'props', + props: propsConfig + }; + } + }]); + + return AnimatedProps; + }(_$$_REQUIRE(_dependencyMap[7])); + + module.exports = AnimatedProps; +},252,[16,14,12,7,6,253,8,229,248,90,36,54,224]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedStyle = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedStyle, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedStyle); + + function AnimatedStyle(style) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedStyle); + + _this = _super.call(this); + style = _$$_REQUIRE(_dependencyMap[4])(style) || {}; + + if (style.transform) { + style = _$$_REQUIRE(_dependencyMap[5])({}, style, { + transform: new (_$$_REQUIRE(_dependencyMap[6]))(style.transform) + }); + } + + _this._style = style; + return _this; + } + + _$$_REQUIRE(_dependencyMap[7])(AnimatedStyle, [{ + key: "_walkStyleAndGetValues", + value: function _walkStyleAndGetValues(style) { + var updatedStyle = {}; + + for (var key in style) { + var value = style[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[8])) { + if (!value.__isNative) { + updatedStyle[key] = value.__getValue(); + } + } else if (value && !Array.isArray(value) && typeof value === 'object') { + updatedStyle[key] = this._walkStyleAndGetValues(value); + } else { + updatedStyle[key] = value; + } + } + + return updatedStyle; + } + }, { + key: "__getValue", + value: function __getValue() { + return this._walkStyleAndGetValues(this._style); + } + }, { + key: "_walkStyleAndGetAnimatedValues", + value: function _walkStyleAndGetAnimatedValues(style) { + var updatedStyle = {}; + + for (var key in style) { + var value = style[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[8])) { + updatedStyle[key] = value.__getAnimatedValue(); + } else if (value && !Array.isArray(value) && typeof value === 'object') { + updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value); + } + } + + return updatedStyle; + } + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + return this._walkStyleAndGetAnimatedValues(this._style); + } + }, { + key: "__attach", + value: function __attach() { + for (var key in this._style) { + var value = this._style[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[8])) { + value.__addChild(this); + } + } + } + }, { + key: "__detach", + value: function __detach() { + for (var key in this._style) { + var value = this._style[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[8])) { + value.__removeChild(this); + } + } + + _$$_REQUIRE(_dependencyMap[9])(_$$_REQUIRE(_dependencyMap[0])(AnimatedStyle.prototype), "__detach", this).call(this); + } + }, { + key: "__makeNative", + value: function __makeNative() { + for (var key in this._style) { + var value = this._style[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[8])) { + value.__makeNative(); + } + } + + _$$_REQUIRE(_dependencyMap[9])(_$$_REQUIRE(_dependencyMap[0])(AnimatedStyle.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var styleConfig = {}; + + for (var styleKey in this._style) { + if (this._style[styleKey] instanceof _$$_REQUIRE(_dependencyMap[8])) { + var style = this._style[styleKey]; + + style.__makeNative(); + + styleConfig[styleKey] = style.__getNativeTag(); + } + } + + _$$_REQUIRE(_dependencyMap[10]).validateStyles(styleConfig); + + return { + type: 'style', + style: styleConfig + }; + } + }]); + + return AnimatedStyle; + }(_$$_REQUIRE(_dependencyMap[11])); + + module.exports = AnimatedStyle; +},253,[16,14,12,7,178,6,254,8,229,90,224,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedTransform = function (_AnimatedWithChildren) { + _$$_REQUIRE(_dependencyMap[2])(AnimatedTransform, _AnimatedWithChildren); + + var _super = _createSuper(AnimatedTransform); + + function AnimatedTransform(transforms) { + var _this; + + _$$_REQUIRE(_dependencyMap[3])(this, AnimatedTransform); + + _this = _super.call(this); + _this._transforms = transforms; + return _this; + } + + _$$_REQUIRE(_dependencyMap[4])(AnimatedTransform, [{ + key: "__makeNative", + value: function __makeNative() { + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[5])) { + value.__makeNative(); + } + } + }); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedTransform.prototype), "__makeNative", this).call(this); + } + }, { + key: "__getValue", + value: function __getValue() { + return this._transforms.map(function (transform) { + var result = {}; + + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[5])) { + result[key] = value.__getValue(); + } else { + result[key] = value; + } + } + + return result; + }); + } + }, { + key: "__getAnimatedValue", + value: function __getAnimatedValue() { + return this._transforms.map(function (transform) { + var result = {}; + + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[5])) { + result[key] = value.__getAnimatedValue(); + } else { + result[key] = value; + } + } + + return result; + }); + } + }, { + key: "__attach", + value: function __attach() { + var _this2 = this; + + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[5])) { + value.__addChild(_this2); + } + } + }); + } + }, { + key: "__detach", + value: function __detach() { + var _this3 = this; + + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[5])) { + value.__removeChild(_this3); + } + } + }); + + _$$_REQUIRE(_dependencyMap[6])(_$$_REQUIRE(_dependencyMap[0])(AnimatedTransform.prototype), "__detach", this).call(this); + } + }, { + key: "__getNativeConfig", + value: function __getNativeConfig() { + var transConfigs = []; + + this._transforms.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _$$_REQUIRE(_dependencyMap[5])) { + transConfigs.push({ + type: 'animated', + property: key, + nodeTag: value.__getNativeTag() + }); + } else { + transConfigs.push({ + type: 'static', + property: key, + value: _$$_REQUIRE(_dependencyMap[7]).transformDataType(value) + }); + } + } + }); + + _$$_REQUIRE(_dependencyMap[7]).validateTransform(transConfigs); + + return { + type: 'transform', + transforms: transConfigs + }; + } + }]); + + return AnimatedTransform; + }(_$$_REQUIRE(_dependencyMap[8])); + + module.exports = AnimatedTransform; +},254,[16,14,12,7,8,229,90,224,228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var FlatListWithEventThrottle = React.forwardRef(function (props, ref) { + return React.createElement(_$$_REQUIRE(_dependencyMap[3]), (0, _extends2.default)({ + scrollEventThrottle: 0.0001 + }, props, { + ref: ref + })); + }); + module.exports = _$$_REQUIRE(_dependencyMap[4])(FlatListWithEventThrottle); +},255,[5,6,17,256,249]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _defineProperty2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var React = _$$_REQUIRE(_dependencyMap[9]); + + function removeClippedSubviewsOrDefault(removeClippedSubviews) { + return removeClippedSubviews != null ? removeClippedSubviews : false; + } + + function numColumnsOrDefault(numColumns) { + return numColumns != null ? numColumns : 1; + } + + var FlatList = function (_React$PureComponent) { + (0, _inherits2.default)(FlatList, _React$PureComponent); + + var _super = _createSuper(FlatList); + + function FlatList(_props) { + var _this; + + (0, _classCallCheck2.default)(this, FlatList); + _this = _super.call(this, _props); + _this._virtualizedListPairs = []; + + _this._captureRef = function (ref) { + _this._listRef = ref; + }; + + _this._getItem = function (data, index) { + var numColumns = numColumnsOrDefault(_this.props.numColumns); + + if (numColumns > 1) { + var ret = []; + + for (var kk = 0; kk < numColumns; kk++) { + var _item = data[index * numColumns + kk]; + + if (_item != null) { + ret.push(_item); + } + } + + return ret; + } else { + return data[index]; + } + }; + + _this._getItemCount = function (data) { + if (data) { + var numColumns = numColumnsOrDefault(_this.props.numColumns); + return numColumns > 1 ? Math.ceil(data.length / numColumns) : data.length; + } else { + return 0; + } + }; + + _this._keyExtractor = function (items, index) { + var _this$props$keyExtrac; + + var numColumns = numColumnsOrDefault(_this.props.numColumns); + var keyExtractor = (_this$props$keyExtrac = _this.props.keyExtractor) != null ? _this$props$keyExtrac : _$$_REQUIRE(_dependencyMap[10]).keyExtractor; + + if (numColumns > 1) { + if (Array.isArray(items)) { + return items.map(function (item, kk) { + return keyExtractor(item, index * numColumns + kk); + }).join(':'); + } else { + _$$_REQUIRE(_dependencyMap[11])(Array.isArray(items), "FlatList: Encountered internal consistency error, expected each item to consist of an array with 1-%s columns; instead, received a single item.", numColumns); + } + } else { + return keyExtractor(items, index); + } + }; + + _this._renderer = function () { + var _this$props = _this.props, + ListItemComponent = _this$props.ListItemComponent, + renderItem = _this$props.renderItem, + columnWrapperStyle = _this$props.columnWrapperStyle; + var numColumns = numColumnsOrDefault(_this.props.numColumns); + var virtualizedListRenderKey = ListItemComponent ? 'ListItemComponent' : 'renderItem'; + + var renderer = function renderer(props) { + if (ListItemComponent) { + return React.createElement(ListItemComponent, props); + } else if (renderItem) { + return renderItem(props); + } else { + return null; + } + }; + + return (0, _defineProperty2.default)({}, virtualizedListRenderKey, function (info) { + if (numColumns > 1) { + var _item2 = info.item, + _index = info.index; + + _$$_REQUIRE(_dependencyMap[11])(Array.isArray(_item2), 'Expected array of items with numColumns > 1'); + + return React.createElement(_$$_REQUIRE(_dependencyMap[12]), { + style: _$$_REQUIRE(_dependencyMap[13]).compose(styles.row, columnWrapperStyle) + }, _item2.map(function (it, kk) { + var element = renderer({ + item: it, + index: _index * numColumns + kk, + separators: info.separators + }); + return element != null ? React.createElement(React.Fragment, { + key: kk + }, element) : null; + })); + } else { + return renderer(info); + } + }); + }; + + _this._checkProps(_this.props); + + if (_this.props.viewabilityConfigCallbackPairs) { + _this._virtualizedListPairs = _this.props.viewabilityConfigCallbackPairs.map(function (pair) { + return { + viewabilityConfig: pair.viewabilityConfig, + onViewableItemsChanged: _this._createOnViewableItemsChanged(pair.onViewableItemsChanged) + }; + }); + } else if (_this.props.onViewableItemsChanged) { + _this._virtualizedListPairs.push({ + viewabilityConfig: _this.props.viewabilityConfig, + onViewableItemsChanged: _this._createOnViewableItemsChanged(_this.props.onViewableItemsChanged) + }); + } + + return _this; + } + + (0, _createClass2.default)(FlatList, [{ + key: "scrollToEnd", + value: function scrollToEnd(params) { + if (this._listRef) { + this._listRef.scrollToEnd(params); + } + } + }, { + key: "scrollToIndex", + value: function scrollToIndex(params) { + if (this._listRef) { + this._listRef.scrollToIndex(params); + } + } + }, { + key: "scrollToItem", + value: function scrollToItem(params) { + if (this._listRef) { + this._listRef.scrollToItem(params); + } + } + }, { + key: "scrollToOffset", + value: function scrollToOffset(params) { + if (this._listRef) { + this._listRef.scrollToOffset(params); + } + } + }, { + key: "recordInteraction", + value: function recordInteraction() { + if (this._listRef) { + this._listRef.recordInteraction(); + } + } + }, { + key: "flashScrollIndicators", + value: function flashScrollIndicators() { + if (this._listRef) { + this._listRef.flashScrollIndicators(); + } + } + }, { + key: "getScrollResponder", + value: function getScrollResponder() { + if (this._listRef) { + return this._listRef.getScrollResponder(); + } + } + }, { + key: "getNativeScrollRef", + value: function getNativeScrollRef() { + if (this._listRef) { + return this._listRef.getScrollRef(); + } + } + }, { + key: "getScrollableNode", + value: function getScrollableNode() { + if (this._listRef) { + return this._listRef.getScrollableNode(); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + if (this._listRef) { + this._listRef.setNativeProps(props); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + _$$_REQUIRE(_dependencyMap[11])(prevProps.numColumns === this.props.numColumns, "Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component."); + + _$$_REQUIRE(_dependencyMap[11])(prevProps.onViewableItemsChanged === this.props.onViewableItemsChanged, 'Changing onViewableItemsChanged on the fly is not supported'); + + _$$_REQUIRE(_dependencyMap[11])(!_$$_REQUIRE(_dependencyMap[14])(prevProps.viewabilityConfig, this.props.viewabilityConfig), 'Changing viewabilityConfig on the fly is not supported'); + + _$$_REQUIRE(_dependencyMap[11])(prevProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs, 'Changing viewabilityConfigCallbackPairs on the fly is not supported'); + + this._checkProps(this.props); + } + }, { + key: "_checkProps", + value: function _checkProps(props) { + var getItem = props.getItem, + getItemCount = props.getItemCount, + horizontal = props.horizontal, + columnWrapperStyle = props.columnWrapperStyle, + onViewableItemsChanged = props.onViewableItemsChanged, + viewabilityConfigCallbackPairs = props.viewabilityConfigCallbackPairs; + var numColumns = numColumnsOrDefault(this.props.numColumns); + + _$$_REQUIRE(_dependencyMap[11])(!getItem && !getItemCount, 'FlatList does not support custom data formats.'); + + if (numColumns > 1) { + _$$_REQUIRE(_dependencyMap[11])(!horizontal, 'numColumns does not support horizontal.'); + } else { + _$$_REQUIRE(_dependencyMap[11])(!columnWrapperStyle, 'columnWrapperStyle not supported for single column lists'); + } + + _$$_REQUIRE(_dependencyMap[11])(!(onViewableItemsChanged && viewabilityConfigCallbackPairs), "FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs."); + } + }, { + key: "_pushMultiColumnViewable", + value: function _pushMultiColumnViewable(arr, v) { + var _this$props$keyExtrac2; + + var numColumns = numColumnsOrDefault(this.props.numColumns); + var keyExtractor = (_this$props$keyExtrac2 = this.props.keyExtractor) != null ? _this$props$keyExtrac2 : _$$_REQUIRE(_dependencyMap[10]).keyExtractor; + v.item.forEach(function (item, ii) { + _$$_REQUIRE(_dependencyMap[11])(v.index != null, 'Missing index!'); + + var index = v.index * numColumns + ii; + arr.push((0, _extends2.default)({}, v, { + item: item, + key: keyExtractor(item, index), + index: index + })); + }); + } + }, { + key: "_createOnViewableItemsChanged", + value: function _createOnViewableItemsChanged(onViewableItemsChanged) { + var _this2 = this; + + return function (info) { + var numColumns = numColumnsOrDefault(_this2.props.numColumns); + + if (onViewableItemsChanged) { + if (numColumns > 1) { + var changed = []; + var viewableItems = []; + info.viewableItems.forEach(function (v) { + return _this2._pushMultiColumnViewable(viewableItems, v); + }); + info.changed.forEach(function (v) { + return _this2._pushMultiColumnViewable(changed, v); + }); + onViewableItemsChanged({ + viewableItems: viewableItems, + changed: changed + }); + } else { + onViewableItemsChanged(info); + } + } + }; + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + numColumns = _this$props2.numColumns, + columnWrapperStyle = _this$props2.columnWrapperStyle, + _removeClippedSubviews = _this$props2.removeClippedSubviews, + restProps = (0, _objectWithoutProperties2.default)(_this$props2, ["numColumns", "columnWrapperStyle", "removeClippedSubviews"]); + return React.createElement(_$$_REQUIRE(_dependencyMap[15]), (0, _extends2.default)({}, restProps, { + getItem: this._getItem, + getItemCount: this._getItemCount, + keyExtractor: this._keyExtractor, + ref: this._captureRef, + viewabilityConfigCallbackPairs: this._virtualizedListPairs, + removeClippedSubviews: removeClippedSubviewsOrDefault(_removeClippedSubviews) + }, this._renderer())); + } + }]); + return FlatList; + }(React.PureComponent); + + var styles = _$$_REQUIRE(_dependencyMap[13]).create({ + row: { + flexDirection: 'row' + } + }); + + module.exports = FlatList; +},256,[5,108,6,27,7,8,12,14,16,17,257,36,184,183,176,258]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.elementsThatOverlapOffsets = elementsThatOverlapOffsets; + exports.newRangeCount = newRangeCount; + exports.computeWindowedRenderLimits = computeWindowedRenderLimits; + exports.keyExtractor = keyExtractor; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + function elementsThatOverlapOffsets(offsets, itemCount, getFrameMetrics) { + var out = []; + var outLength = 0; + + for (var ii = 0; ii < itemCount; ii++) { + var frame = getFrameMetrics(ii); + var trailingOffset = frame.offset + frame.length; + + for (var kk = 0; kk < offsets.length; kk++) { + if (out[kk] == null && trailingOffset >= offsets[kk]) { + out[kk] = ii; + outLength++; + + if (kk === offsets.length - 1) { + (0, _invariant.default)(outLength === offsets.length, 'bad offsets input, should be in increasing order: %s', JSON.stringify(offsets)); + return out; + } + } + } + } + + return out; + } + + function newRangeCount(prev, next) { + return next.last - next.first + 1 - Math.max(0, 1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first)); + } + + function computeWindowedRenderLimits(data, getItemCount, maxToRenderPerBatch, windowSize, prev, getFrameMetricsApprox, scrollMetrics) { + var itemCount = getItemCount(data); + + if (itemCount === 0) { + return prev; + } + + var offset = scrollMetrics.offset, + velocity = scrollMetrics.velocity, + visibleLength = scrollMetrics.visibleLength; + var visibleBegin = Math.max(0, offset); + var visibleEnd = visibleBegin + visibleLength; + var overscanLength = (windowSize - 1) * visibleLength; + var leadFactor = 0.5; + var fillPreference = velocity > 1 ? 'after' : velocity < -1 ? 'before' : 'none'; + var overscanBegin = Math.max(0, visibleBegin - 0.5 * overscanLength); + var overscanEnd = Math.max(0, visibleEnd + leadFactor * overscanLength); + var lastItemOffset = getFrameMetricsApprox(itemCount - 1).offset; + + if (lastItemOffset < overscanBegin) { + return { + first: Math.max(0, itemCount - 1 - maxToRenderPerBatch), + last: itemCount - 1 + }; + } + + var _elementsThatOverlapO = elementsThatOverlapOffsets([overscanBegin, visibleBegin, visibleEnd, overscanEnd], itemCount, getFrameMetricsApprox), + _elementsThatOverlapO2 = (0, _slicedToArray2.default)(_elementsThatOverlapO, 4), + overscanFirst = _elementsThatOverlapO2[0], + first = _elementsThatOverlapO2[1], + last = _elementsThatOverlapO2[2], + overscanLast = _elementsThatOverlapO2[3]; + + overscanFirst = overscanFirst == null ? 0 : overscanFirst; + first = first == null ? Math.max(0, overscanFirst) : first; + overscanLast = overscanLast == null ? itemCount - 1 : overscanLast; + last = last == null ? Math.min(overscanLast, first + maxToRenderPerBatch - 1) : last; + var visible = { + first: first, + last: last + }; + var newCellCount = newRangeCount(prev, visible); + + while (true) { + if (first <= overscanFirst && last >= overscanLast) { + break; + } + + var maxNewCells = newCellCount >= maxToRenderPerBatch; + var firstWillAddMore = first <= prev.first || first > prev.last; + var firstShouldIncrement = first > overscanFirst && (!maxNewCells || !firstWillAddMore); + var lastWillAddMore = last >= prev.last || last < prev.first; + var lastShouldIncrement = last < overscanLast && (!maxNewCells || !lastWillAddMore); + + if (maxNewCells && !firstShouldIncrement && !lastShouldIncrement) { + break; + } + + if (firstShouldIncrement && !(fillPreference === 'after' && lastShouldIncrement && lastWillAddMore)) { + if (firstWillAddMore) { + newCellCount++; + } + + first--; + } + + if (lastShouldIncrement && !(fillPreference === 'before' && firstShouldIncrement && firstWillAddMore)) { + if (lastWillAddMore) { + newCellCount++; + } + + last++; + } + } + + if (!(last >= first && first >= 0 && last < itemCount && first >= overscanFirst && last <= overscanLast && first <= visible.first && last >= visible.last)) { + throw new Error('Bad window calculation ' + JSON.stringify({ + first: first, + last: last, + itemCount: itemCount, + overscanFirst: overscanFirst, + overscanLast: overscanLast, + visible: visible + })); + } + + return { + first: first, + last: last + }; + } + + function keyExtractor(item, index) { + if (typeof item === 'object' && (item == null ? undefined : item.key) != null) { + return item.key; + } + + if (typeof item === 'object' && (item == null ? undefined : item.id) != null) { + return item.id; + } + + return String(index); + } +},257,[5,41,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _defineProperty2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _usedIndexForKey = false; + var _keylessItemComponentName = ''; + + function horizontalOrDefault(horizontal) { + return horizontal != null ? horizontal : false; + } + + function initialNumToRenderOrDefault(initialNumToRender) { + return initialNumToRender != null ? initialNumToRender : 10; + } + + function maxToRenderPerBatchOrDefault(maxToRenderPerBatch) { + return maxToRenderPerBatch != null ? maxToRenderPerBatch : 10; + } + + function onEndReachedThresholdOrDefault(onEndReachedThreshold) { + return onEndReachedThreshold != null ? onEndReachedThreshold : 2; + } + + function scrollEventThrottleOrDefault(scrollEventThrottle) { + return scrollEventThrottle != null ? scrollEventThrottle : 50; + } + + function windowSizeOrDefault(windowSize) { + return windowSize != null ? windowSize : 21; + } + + var VirtualizedList = function (_React$PureComponent) { + (0, _inherits2.default)(VirtualizedList, _React$PureComponent); + + var _super = _createSuper(VirtualizedList); + + function VirtualizedList(_props) { + var _this$props$updateCel; + + var _this; + + (0, _classCallCheck2.default)(this, VirtualizedList); + _this = _super.call(this, _props); + + _this._getScrollMetrics = function () { + return _this._scrollMetrics; + }; + + _this._getOutermostParentListRef = function () { + if (_this._isNestedWithSameOrientation()) { + return _this.context.getOutermostParentListRef(); + } else { + return (0, _assertThisInitialized2.default)(_this); + } + }; + + _this._getNestedChildState = function (key) { + var existingChildData = _this._nestedChildLists.get(key); + + return existingChildData && existingChildData.state; + }; + + _this._registerAsNestedChild = function (childList) { + var childListsInCell = _this._cellKeysToChildListKeys.get(childList.cellKey) || new Set(); + childListsInCell.add(childList.key); + + _this._cellKeysToChildListKeys.set(childList.cellKey, childListsInCell); + + var existingChildData = _this._nestedChildLists.get(childList.key); + + if (existingChildData && existingChildData.ref !== null) { + console.error("A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.\n\n" + describeNestedLists((0, _extends2.default)({}, childList, { + horizontal: !!childList.ref.props.horizontal + }))); + } + + _this._nestedChildLists.set(childList.key, { + ref: childList.ref, + state: null + }); + + if (_this._hasInteracted) { + childList.ref.recordInteraction(); + } + }; + + _this._unregisterAsNestedChild = function (childList) { + _this._nestedChildLists.set(childList.key, { + ref: null, + state: childList.state + }); + }; + + _this._onUpdateSeparators = function (keys, newProps) { + keys.forEach(function (key) { + var ref = key != null && _this._cellRefs[key]; + ref && ref.updateSeparatorProps(newProps); + }); + }; + + _this._getSpacerKey = function (isVertical) { + return isVertical ? 'height' : 'width'; + }; + + _this._averageCellLength = 0; + _this._cellKeysToChildListKeys = new Map(); + _this._cellRefs = {}; + _this._frames = {}; + _this._footerLength = 0; + _this._hasDoneInitialScroll = false; + _this._hasInteracted = false; + _this._hasMore = false; + _this._hasWarned = {}; + _this._headerLength = 0; + _this._hiPriInProgress = false; + _this._highestMeasuredFrameIndex = 0; + _this._indicesToKeys = new Map(); + _this._nestedChildLists = new Map(); + _this._offsetFromParentVirtualizedList = 0; + _this._prevParentOffset = 0; + _this._scrollMetrics = { + contentLength: 0, + dOffset: 0, + dt: 10, + offset: 0, + timestamp: 0, + velocity: 0, + visibleLength: 0 + }; + _this._scrollRef = null; + _this._sentEndForContentLength = 0; + _this._totalCellLength = 0; + _this._totalCellsMeasured = 0; + _this._viewabilityTuples = []; + + _this._captureScrollRef = function (ref) { + _this._scrollRef = ref; + }; + + _this._defaultRenderScrollComponent = function (props) { + var onRefresh = props.onRefresh; + + if (_this._isNestedWithSameOrientation()) { + return React.createElement(_$$_REQUIRE(_dependencyMap[10]), props); + } else if (onRefresh) { + var _props$refreshing; + + _$$_REQUIRE(_dependencyMap[11])(typeof props.refreshing === 'boolean', '`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `' + JSON.stringify((_props$refreshing = props.refreshing) != null ? _props$refreshing : 'undefined') + '`'); + + return React.createElement(_$$_REQUIRE(_dependencyMap[12]), (0, _extends2.default)({}, props, { + refreshControl: props.refreshControl == null ? React.createElement(_$$_REQUIRE(_dependencyMap[13]), { + refreshing: props.refreshing, + onRefresh: onRefresh, + progressViewOffset: props.progressViewOffset + }) : props.refreshControl + })); + } else { + return React.createElement(_$$_REQUIRE(_dependencyMap[12]), props); + } + }; + + _this._onCellUnmount = function (cellKey) { + var curr = _this._frames[cellKey]; + + if (curr) { + _this._frames[cellKey] = (0, _extends2.default)({}, curr, { + inLayout: false + }); + } + }; + + _this._onLayout = function (e) { + if (_this._isNestedWithSameOrientation()) { + _this.measureLayoutRelativeToContainingList(); + } else { + _this._scrollMetrics.visibleLength = _this._selectLength(e.nativeEvent.layout); + } + + _this.props.onLayout && _this.props.onLayout(e); + + _this._scheduleCellsToRenderUpdate(); + + _this._maybeCallOnEndReached(); + }; + + _this._onLayoutEmpty = function (e) { + _this.props.onLayout && _this.props.onLayout(e); + }; + + _this._onLayoutFooter = function (e) { + _this._triggerRemeasureForChildListsInCell(_this._getFooterCellKey()); + + _this._footerLength = _this._selectLength(e.nativeEvent.layout); + }; + + _this._onLayoutHeader = function (e) { + _this._headerLength = _this._selectLength(e.nativeEvent.layout); + }; + + _this._onContentSizeChange = function (width, height) { + if (width > 0 && height > 0 && _this.props.initialScrollIndex != null && _this.props.initialScrollIndex > 0 && !_this._hasDoneInitialScroll) { + if (_this.props.contentOffset == null) { + _this.scrollToIndex({ + animated: false, + index: _this.props.initialScrollIndex + }); + } + + _this._hasDoneInitialScroll = true; + } + + if (_this.props.onContentSizeChange) { + _this.props.onContentSizeChange(width, height); + } + + _this._scrollMetrics.contentLength = _this._selectLength({ + height: height, + width: width + }); + + _this._scheduleCellsToRenderUpdate(); + + _this._maybeCallOnEndReached(); + }; + + _this._convertParentScrollMetrics = function (metrics) { + var offset = metrics.offset - _this._offsetFromParentVirtualizedList; + var visibleLength = metrics.visibleLength; + var dOffset = offset - _this._scrollMetrics.offset; + var contentLength = _this._scrollMetrics.contentLength; + return { + visibleLength: visibleLength, + contentLength: contentLength, + offset: offset, + dOffset: dOffset + }; + }; + + _this._onScroll = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList.ref && childList.ref._onScroll(e); + }); + + if (_this.props.onScroll) { + _this.props.onScroll(e); + } + + var timestamp = e.timeStamp; + + var visibleLength = _this._selectLength(e.nativeEvent.layoutMeasurement); + + var contentLength = _this._selectLength(e.nativeEvent.contentSize); + + var offset = _this._selectOffset(e.nativeEvent.contentOffset); + + var dOffset = offset - _this._scrollMetrics.offset; + + if (_this._isNestedWithSameOrientation()) { + if (_this._scrollMetrics.contentLength === 0) { + return; + } + + var _this$_convertParentS = _this._convertParentScrollMetrics({ + visibleLength: visibleLength, + offset: offset + }); + + visibleLength = _this$_convertParentS.visibleLength; + contentLength = _this$_convertParentS.contentLength; + offset = _this$_convertParentS.offset; + dOffset = _this$_convertParentS.dOffset; + } + + var dt = _this._scrollMetrics.timestamp ? Math.max(1, timestamp - _this._scrollMetrics.timestamp) : 1; + var velocity = dOffset / dt; + + if (dt > 500 && _this._scrollMetrics.dt > 500 && contentLength > 5 * visibleLength && !_this._hasWarned.perf) { + _$$_REQUIRE(_dependencyMap[14])("VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.", { + dt: dt, + prevDt: _this._scrollMetrics.dt, + contentLength: contentLength + }); + + _this._hasWarned.perf = true; + } + + _this._scrollMetrics = { + contentLength: contentLength, + dt: dt, + dOffset: dOffset, + offset: offset, + timestamp: timestamp, + velocity: velocity, + visibleLength: visibleLength + }; + + _this._updateViewableItems(_this.props.data); + + if (!_this.props) { + return; + } + + _this._maybeCallOnEndReached(); + + if (velocity !== 0) { + _this._fillRateHelper.activate(); + } + + _this._computeBlankness(); + + _this._scheduleCellsToRenderUpdate(); + }; + + _this._onScrollBeginDrag = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList.ref && childList.ref._onScrollBeginDrag(e); + }); + + _this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.recordInteraction(); + }); + + _this._hasInteracted = true; + _this.props.onScrollBeginDrag && _this.props.onScrollBeginDrag(e); + }; + + _this._onScrollEndDrag = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList.ref && childList.ref._onScrollEndDrag(e); + }); + + var velocity = e.nativeEvent.velocity; + + if (velocity) { + _this._scrollMetrics.velocity = _this._selectOffset(velocity); + } + + _this._computeBlankness(); + + _this.props.onScrollEndDrag && _this.props.onScrollEndDrag(e); + }; + + _this._onMomentumScrollBegin = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList.ref && childList.ref._onMomentumScrollBegin(e); + }); + + _this.props.onMomentumScrollBegin && _this.props.onMomentumScrollBegin(e); + }; + + _this._onMomentumScrollEnd = function (e) { + _this._nestedChildLists.forEach(function (childList) { + childList.ref && childList.ref._onMomentumScrollEnd(e); + }); + + _this._scrollMetrics.velocity = 0; + + _this._computeBlankness(); + + _this.props.onMomentumScrollEnd && _this.props.onMomentumScrollEnd(e); + }; + + _this._updateCellsToRender = function () { + var _this$props = _this.props, + data = _this$props.data, + getItemCount = _this$props.getItemCount, + _onEndReachedThreshold = _this$props.onEndReachedThreshold; + var onEndReachedThreshold = onEndReachedThresholdOrDefault(_onEndReachedThreshold); + + var isVirtualizationDisabled = _this._isVirtualizationDisabled(); + + _this._updateViewableItems(data); + + if (!data) { + return; + } + + _this.setState(function (state) { + var newState; + var _this$_scrollMetrics = _this._scrollMetrics, + contentLength = _this$_scrollMetrics.contentLength, + offset = _this$_scrollMetrics.offset, + visibleLength = _this$_scrollMetrics.visibleLength; + + if (!isVirtualizationDisabled) { + if (visibleLength > 0 && contentLength > 0) { + if (!_this.props.initialScrollIndex || _this._scrollMetrics.offset) { + newState = (0, _$$_REQUIRE(_dependencyMap[15]).computeWindowedRenderLimits)(_this.props.data, _this.props.getItemCount, maxToRenderPerBatchOrDefault(_this.props.maxToRenderPerBatch), windowSizeOrDefault(_this.props.windowSize), state, _this._getFrameMetricsApprox, _this._scrollMetrics); + } + } + } else { + var distanceFromEnd = contentLength - visibleLength - offset; + var renderAhead = distanceFromEnd < onEndReachedThreshold * visibleLength ? maxToRenderPerBatchOrDefault(_this.props.maxToRenderPerBatch) : 0; + newState = { + first: 0, + last: Math.min(state.last + renderAhead, getItemCount(data) - 1) + }; + } + + if (newState && _this._nestedChildLists.size > 0) { + var newFirst = newState.first; + var newLast = newState.last; + + for (var ii = newFirst; ii <= newLast; ii++) { + var cellKeyForIndex = _this._indicesToKeys.get(ii); + + var childListKeys = cellKeyForIndex && _this._cellKeysToChildListKeys.get(cellKeyForIndex); + + if (!childListKeys) { + continue; + } + + var someChildHasMore = false; + + for (var _iterator = _createForOfIteratorHelperLoose(childListKeys), _step; !(_step = _iterator()).done;) { + var childKey = _step.value; + + var childList = _this._nestedChildLists.get(childKey); + + if (childList && childList.ref && childList.ref.hasMore()) { + someChildHasMore = true; + break; + } + } + + if (someChildHasMore) { + newState.last = ii; + break; + } + } + } + + if (newState != null && newState.first === state.first && newState.last === state.last) { + newState = null; + } + + return newState; + }); + }; + + _this._createViewToken = function (index, isViewable) { + var _this$props2 = _this.props, + data = _this$props2.data, + getItem = _this$props2.getItem; + var item = getItem(data, index); + return { + index: index, + item: item, + key: _this._keyExtractor(item, index), + isViewable: isViewable + }; + }; + + _this._getFrameMetricsApprox = function (index) { + var frame = _this._getFrameMetrics(index); + + if (frame && frame.index === index) { + return frame; + } else { + var getItemLayout = _this.props.getItemLayout; + + _$$_REQUIRE(_dependencyMap[11])(!getItemLayout, 'Should not have to estimate frames when a measurement metrics function is provided'); + + return { + length: _this._averageCellLength, + offset: _this._averageCellLength * index + }; + } + }; + + _this._getFrameMetrics = function (index) { + var _this$props3 = _this.props, + data = _this$props3.data, + getItem = _this$props3.getItem, + getItemCount = _this$props3.getItemCount, + getItemLayout = _this$props3.getItemLayout; + + _$$_REQUIRE(_dependencyMap[11])(getItemCount(data) > index, 'Tried to get frame for out of range index ' + index); + + var item = getItem(data, index); + + var frame = item && _this._frames[_this._keyExtractor(item, index)]; + + if (!frame || frame.index !== index) { + if (getItemLayout) { + frame = getItemLayout(data, index); + } + } + + return frame; + }; + + _$$_REQUIRE(_dependencyMap[11])(!_props.onScroll || !_props.onScroll.__isNative, "Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent to support native onScroll events with useNativeDriver"); + + _$$_REQUIRE(_dependencyMap[11])(windowSizeOrDefault(_props.windowSize) > 0, 'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.'); + + _this._fillRateHelper = new (_$$_REQUIRE(_dependencyMap[16]))(_this._getFrameMetrics); + _this._updateCellsToRenderBatcher = new (_$$_REQUIRE(_dependencyMap[17]))(_this._updateCellsToRender, (_this$props$updateCel = _this.props.updateCellsBatchingPeriod) != null ? _this$props$updateCel : 50); + + if (_this.props.viewabilityConfigCallbackPairs) { + _this._viewabilityTuples = _this.props.viewabilityConfigCallbackPairs.map(function (pair) { + return { + viewabilityHelper: new (_$$_REQUIRE(_dependencyMap[18]))(pair.viewabilityConfig), + onViewableItemsChanged: pair.onViewableItemsChanged + }; + }); + } else if (_this.props.onViewableItemsChanged) { + _this._viewabilityTuples.push({ + viewabilityHelper: new (_$$_REQUIRE(_dependencyMap[18]))(_this.props.viewabilityConfig), + onViewableItemsChanged: _this.props.onViewableItemsChanged + }); + } + + var initialState = { + first: _this.props.initialScrollIndex || 0, + last: Math.min(_this.props.getItemCount(_this.props.data), (_this.props.initialScrollIndex || 0) + initialNumToRenderOrDefault(_this.props.initialNumToRender)) - 1 + }; + + if (_this._isNestedWithSameOrientation()) { + var storedState = _this.context.getNestedChildState(_this._getListKey()); + + if (storedState) { + initialState = storedState; + _this.state = storedState; + _this._frames = storedState.frames; + } + } + + _this.state = initialState; + return _this; + } + + (0, _createClass2.default)(VirtualizedList, [{ + key: "scrollToEnd", + value: function scrollToEnd(params) { + var animated = params ? params.animated : true; + var veryLast = this.props.getItemCount(this.props.data) - 1; + + var frame = this._getFrameMetricsApprox(veryLast); + + var offset = Math.max(0, frame.offset + frame.length + this._footerLength - this._scrollMetrics.visibleLength); + + if (this._scrollRef == null) { + return; + } + + if (this._scrollRef.scrollTo == null) { + console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."); + return; + } + + this._scrollRef.scrollTo(horizontalOrDefault(this.props.horizontal) ? { + x: offset, + animated: animated + } : { + y: offset, + animated: animated + }); + } + }, { + key: "scrollToIndex", + value: function scrollToIndex(params) { + var _this$props4 = this.props, + data = _this$props4.data, + horizontal = _this$props4.horizontal, + getItemCount = _this$props4.getItemCount, + getItemLayout = _this$props4.getItemLayout, + onScrollToIndexFailed = _this$props4.onScrollToIndexFailed; + var animated = params.animated, + index = params.index, + viewOffset = params.viewOffset, + viewPosition = params.viewPosition; + + _$$_REQUIRE(_dependencyMap[11])(index >= 0, "scrollToIndex out of range: requested index " + index + " but minimum is 0"); + + _$$_REQUIRE(_dependencyMap[11])(getItemCount(data) >= 1, "scrollToIndex out of range: item length " + getItemCount(data) + " but minimum is 1"); + + _$$_REQUIRE(_dependencyMap[11])(index < getItemCount(data), "scrollToIndex out of range: requested index " + index + " is out of 0 to " + (getItemCount(data) - 1)); + + if (!getItemLayout && index > this._highestMeasuredFrameIndex) { + _$$_REQUIRE(_dependencyMap[11])(!!onScrollToIndexFailed, "scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures."); + + onScrollToIndexFailed({ + averageItemLength: this._averageCellLength, + highestMeasuredFrameIndex: this._highestMeasuredFrameIndex, + index: index + }); + return; + } + + var frame = this._getFrameMetricsApprox(index); + + var offset = Math.max(0, frame.offset - (viewPosition || 0) * (this._scrollMetrics.visibleLength - frame.length)) - (viewOffset || 0); + + if (this._scrollRef == null) { + return; + } + + if (this._scrollRef.scrollTo == null) { + console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."); + return; + } + + this._scrollRef.scrollTo(horizontal ? { + x: offset, + animated: animated + } : { + y: offset, + animated: animated + }); + } + }, { + key: "scrollToItem", + value: function scrollToItem(params) { + var item = params.item; + var _this$props5 = this.props, + data = _this$props5.data, + getItem = _this$props5.getItem, + getItemCount = _this$props5.getItemCount; + var itemCount = getItemCount(data); + + for (var _index = 0; _index < itemCount; _index++) { + if (getItem(data, _index) === item) { + this.scrollToIndex((0, _extends2.default)({}, params, { + index: _index + })); + break; + } + } + } + }, { + key: "scrollToOffset", + value: function scrollToOffset(params) { + var animated = params.animated, + offset = params.offset; + + if (this._scrollRef == null) { + return; + } + + if (this._scrollRef.scrollTo == null) { + console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."); + return; + } + + this._scrollRef.scrollTo(horizontalOrDefault(this.props.horizontal) ? { + x: offset, + animated: animated + } : { + y: offset, + animated: animated + }); + } + }, { + key: "recordInteraction", + value: function recordInteraction() { + this._nestedChildLists.forEach(function (childList) { + childList.ref && childList.ref.recordInteraction(); + }); + + this._viewabilityTuples.forEach(function (t) { + t.viewabilityHelper.recordInteraction(); + }); + + this._updateViewableItems(this.props.data); + } + }, { + key: "flashScrollIndicators", + value: function flashScrollIndicators() { + if (this._scrollRef == null) { + return; + } + + this._scrollRef.flashScrollIndicators(); + } + }, { + key: "getScrollResponder", + value: function getScrollResponder() { + if (this._scrollRef && this._scrollRef.getScrollResponder) { + return this._scrollRef.getScrollResponder(); + } + } + }, { + key: "getScrollableNode", + value: function getScrollableNode() { + if (this._scrollRef && this._scrollRef.getScrollableNode) { + return this._scrollRef.getScrollableNode(); + } else { + return _$$_REQUIRE(_dependencyMap[19]).findNodeHandle(this._scrollRef); + } + } + }, { + key: "getScrollRef", + value: function getScrollRef() { + if (this._scrollRef && this._scrollRef.getScrollRef) { + return this._scrollRef.getScrollRef(); + } else { + return this._scrollRef; + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + if (this._scrollRef) { + this._scrollRef.setNativeProps(props); + } + } + }, { + key: "_getCellKey", + value: function _getCellKey() { + var _this$context; + + return ((_this$context = this.context) == null ? undefined : _this$context.cellKey) || 'rootList'; + } + }, { + key: "_getListKey", + value: function _getListKey() { + return this.props.listKey || this._getCellKey(); + } + }, { + key: "_getDebugInfo", + value: function _getDebugInfo() { + var _this$context2; + + return { + listKey: this._getListKey(), + cellKey: this._getCellKey(), + horizontal: horizontalOrDefault(this.props.horizontal), + parent: (_this$context2 = this.context) == null ? undefined : _this$context2.debugInfo + }; + } + }, { + key: "hasMore", + value: function hasMore() { + return this._hasMore; + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + if (this._isNestedWithSameOrientation()) { + this.context.registerAsNestedChild({ + cellKey: this._getCellKey(), + key: this._getListKey(), + ref: this, + parentDebugInfo: this.context.debugInfo + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._isNestedWithSameOrientation()) { + this.context.unregisterAsNestedChild({ + key: this._getListKey(), + state: { + first: this.state.first, + last: this.state.last, + frames: this._frames + } + }); + } + + this._updateViewableItems(null); + + this._updateCellsToRenderBatcher.dispose({ + abort: true + }); + + this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.dispose(); + }); + + this._fillRateHelper.deactivateAndFlush(); + } + }, { + key: "_pushCells", + value: function _pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, first, last, inversionStyle) { + var _this2 = this; + + var _this$props6 = this.props, + CellRendererComponent = _this$props6.CellRendererComponent, + ItemSeparatorComponent = _this$props6.ItemSeparatorComponent, + data = _this$props6.data, + getItem = _this$props6.getItem, + getItemCount = _this$props6.getItemCount, + horizontal = _this$props6.horizontal; + var stickyOffset = this.props.ListHeaderComponent ? 1 : 0; + var end = getItemCount(data) - 1; + var prevCellKey; + last = Math.min(end, last); + + var _loop = function _loop(ii) { + var item = getItem(data, ii); + + var key = _this2._keyExtractor(item, ii); + + _this2._indicesToKeys.set(ii, key); + + if (stickyIndicesFromProps.has(ii + stickyOffset)) { + stickyHeaderIndices.push(cells.length); + } + + cells.push(React.createElement(CellRenderer, { + CellRendererComponent: CellRendererComponent, + ItemSeparatorComponent: ii < end ? ItemSeparatorComponent : undefined, + cellKey: key, + fillRateHelper: _this2._fillRateHelper, + horizontal: horizontal, + index: ii, + inversionStyle: inversionStyle, + item: item, + key: key, + prevCellKey: prevCellKey, + onUpdateSeparators: _this2._onUpdateSeparators, + onLayout: function onLayout(e) { + return _this2._onCellLayout(e, key, ii); + }, + onUnmount: _this2._onCellUnmount, + parentProps: _this2.props, + ref: function ref(_ref) { + _this2._cellRefs[key] = _ref; + } + })); + prevCellKey = key; + }; + + for (var ii = first; ii <= last; ii++) { + _loop(ii); + } + } + }, { + key: "_isVirtualizationDisabled", + value: function _isVirtualizationDisabled() { + return this.props.disableVirtualization || false; + } + }, { + key: "_isNestedWithSameOrientation", + value: function _isNestedWithSameOrientation() { + var nestedContext = this.context; + return !!(nestedContext && !!nestedContext.horizontal === horizontalOrDefault(this.props.horizontal)); + } + }, { + key: "_keyExtractor", + value: function _keyExtractor(item, index) { + if (this.props.keyExtractor != null) { + return this.props.keyExtractor(item, index); + } + + var key = (0, _$$_REQUIRE(_dependencyMap[15]).keyExtractor)(item, index); + + if (key === String(index)) { + _usedIndexForKey = true; + + if (item.type && item.type.displayName) { + _keylessItemComponentName = item.type.displayName; + } + } + + return key; + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$props7 = this.props, + ListEmptyComponent = _this$props7.ListEmptyComponent, + ListFooterComponent = _this$props7.ListFooterComponent, + ListHeaderComponent = _this$props7.ListHeaderComponent; + var _this$props8 = this.props, + data = _this$props8.data, + horizontal = _this$props8.horizontal; + + var isVirtualizationDisabled = this._isVirtualizationDisabled(); + + var inversionStyle = this.props.inverted ? horizontalOrDefault(this.props.horizontal) ? styles.horizontallyInverted : styles.verticallyInverted : null; + var cells = []; + var stickyIndicesFromProps = new Set(this.props.stickyHeaderIndices); + var stickyHeaderIndices = []; + + if (ListHeaderComponent) { + if (stickyIndicesFromProps.has(0)) { + stickyHeaderIndices.push(0); + } + + var element = React.isValidElement(ListHeaderComponent) ? ListHeaderComponent : React.createElement(ListHeaderComponent, null); + cells.push(React.createElement(_$$_REQUIRE(_dependencyMap[20]).VirtualizedListCellContextProvider, { + cellKey: this._getCellKey() + '-header', + key: "$header" + }, React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + onLayout: this._onLayoutHeader, + style: _$$_REQUIRE(_dependencyMap[21]).compose(inversionStyle, this.props.ListHeaderComponentStyle) + }, element))); + } + + var itemCount = this.props.getItemCount(data); + + if (itemCount > 0) { + _usedIndexForKey = false; + _keylessItemComponentName = ''; + + var spacerKey = this._getSpacerKey(!horizontal); + + var lastInitialIndex = this.props.initialScrollIndex ? -1 : initialNumToRenderOrDefault(this.props.initialNumToRender) - 1; + var _this$state = this.state, + first = _this$state.first, + last = _this$state.last; + + this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, 0, lastInitialIndex, inversionStyle); + + var firstAfterInitial = Math.max(lastInitialIndex + 1, first); + + if (!isVirtualizationDisabled && first > lastInitialIndex + 1) { + var insertedStickySpacer = false; + + if (stickyIndicesFromProps.size > 0) { + var stickyOffset = ListHeaderComponent ? 1 : 0; + + for (var ii = firstAfterInitial - 1; ii > lastInitialIndex; ii--) { + if (stickyIndicesFromProps.has(ii + stickyOffset)) { + var initBlock = this._getFrameMetricsApprox(lastInitialIndex); + + var stickyBlock = this._getFrameMetricsApprox(ii); + + var leadSpace = stickyBlock.offset - initBlock.offset - (this.props.initialScrollIndex ? 0 : initBlock.length); + cells.push(React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + key: "$sticky_lead", + style: (0, _defineProperty2.default)({}, spacerKey, leadSpace) + })); + + this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, ii, ii, inversionStyle); + + var trailSpace = this._getFrameMetricsApprox(first).offset - (stickyBlock.offset + stickyBlock.length); + cells.push(React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + key: "$sticky_trail", + style: (0, _defineProperty2.default)({}, spacerKey, trailSpace) + })); + insertedStickySpacer = true; + break; + } + } + } + + if (!insertedStickySpacer) { + var _initBlock = this._getFrameMetricsApprox(lastInitialIndex); + + var firstSpace = this._getFrameMetricsApprox(first).offset - (_initBlock.offset + _initBlock.length); + + cells.push(React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + key: "$lead_spacer", + style: (0, _defineProperty2.default)({}, spacerKey, firstSpace) + })); + } + } + + this._pushCells(cells, stickyHeaderIndices, stickyIndicesFromProps, firstAfterInitial, last, inversionStyle); + + if (!this._hasWarned.keys && _usedIndexForKey) { + console.warn("VirtualizedList: missing keys for items, make sure to specify a key or id property on each item or provide a custom keyExtractor.", _keylessItemComponentName); + this._hasWarned.keys = true; + } + + if (!isVirtualizationDisabled && last < itemCount - 1) { + var lastFrame = this._getFrameMetricsApprox(last); + + var end = this.props.getItemLayout ? itemCount - 1 : Math.min(itemCount - 1, this._highestMeasuredFrameIndex); + + var endFrame = this._getFrameMetricsApprox(end); + + var tailSpacerLength = endFrame.offset + endFrame.length - (lastFrame.offset + lastFrame.length); + cells.push(React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + key: "$tail_spacer", + style: (0, _defineProperty2.default)({}, spacerKey, tailSpacerLength) + })); + } + } else if (ListEmptyComponent) { + var _element = React.isValidElement(ListEmptyComponent) ? ListEmptyComponent : React.createElement(ListEmptyComponent, null); + + cells.push(React.cloneElement(_element, { + key: '$empty', + onLayout: function onLayout(event) { + _this3._onLayoutEmpty(event); + + if (_element.props.onLayout) { + _element.props.onLayout(event); + } + }, + style: _$$_REQUIRE(_dependencyMap[21]).compose(inversionStyle, _element.props.style) + })); + } + + if (ListFooterComponent) { + var _element2 = React.isValidElement(ListFooterComponent) ? ListFooterComponent : React.createElement(ListFooterComponent, null); + + cells.push(React.createElement(_$$_REQUIRE(_dependencyMap[20]).VirtualizedListCellContextProvider, { + cellKey: this._getFooterCellKey(), + key: "$footer" + }, React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + onLayout: this._onLayoutFooter, + style: _$$_REQUIRE(_dependencyMap[21]).compose(inversionStyle, this.props.ListFooterComponentStyle) + }, _element2))); + } + + var scrollProps = (0, _extends2.default)({}, this.props, { + onContentSizeChange: this._onContentSizeChange, + onLayout: this._onLayout, + onScroll: this._onScroll, + onScrollBeginDrag: this._onScrollBeginDrag, + onScrollEndDrag: this._onScrollEndDrag, + onMomentumScrollBegin: this._onMomentumScrollBegin, + onMomentumScrollEnd: this._onMomentumScrollEnd, + scrollEventThrottle: scrollEventThrottleOrDefault(this.props.scrollEventThrottle), + invertStickyHeaders: this.props.invertStickyHeaders !== undefined ? this.props.invertStickyHeaders : this.props.inverted, + stickyHeaderIndices: stickyHeaderIndices, + style: inversionStyle ? [inversionStyle, this.props.style] : this.props.style + }); + this._hasMore = this.state.last < this.props.getItemCount(this.props.data) - 1; + var innerRet = React.createElement(_$$_REQUIRE(_dependencyMap[20]).VirtualizedListContextProvider, { + value: { + cellKey: null, + getScrollMetrics: this._getScrollMetrics, + horizontal: horizontalOrDefault(this.props.horizontal), + getOutermostParentListRef: this._getOutermostParentListRef, + getNestedChildState: this._getNestedChildState, + registerAsNestedChild: this._registerAsNestedChild, + unregisterAsNestedChild: this._unregisterAsNestedChild, + debugInfo: this._getDebugInfo() + } + }, React.cloneElement((this.props.renderScrollComponent || this._defaultRenderScrollComponent)(scrollProps), { + ref: this._captureScrollRef + }, cells)); + var ret = innerRet; + + if (this.props.debug) { + return React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + style: styles.debug + }, ret, this._renderDebugOverlay()); + } else { + return ret; + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var _this$props9 = this.props, + data = _this$props9.data, + extraData = _this$props9.extraData; + + if (data !== prevProps.data || extraData !== prevProps.extraData) { + this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.resetViewableIndices(); + }); + } + + var hiPriInProgress = this._hiPriInProgress; + + this._scheduleCellsToRenderUpdate(); + + if (hiPriInProgress) { + this._hiPriInProgress = false; + } + } + }, { + key: "_computeBlankness", + value: function _computeBlankness() { + this._fillRateHelper.computeBlankness(this.props, this.state, this._scrollMetrics); + } + }, { + key: "_onCellLayout", + value: function _onCellLayout(e, cellKey, index) { + var layout = e.nativeEvent.layout; + var next = { + offset: this._selectOffset(layout), + length: this._selectLength(layout), + index: index, + inLayout: true + }; + var curr = this._frames[cellKey]; + + if (!curr || next.offset !== curr.offset || next.length !== curr.length || index !== curr.index) { + this._totalCellLength += next.length - (curr ? curr.length : 0); + this._totalCellsMeasured += curr ? 0 : 1; + this._averageCellLength = this._totalCellLength / this._totalCellsMeasured; + this._frames[cellKey] = next; + this._highestMeasuredFrameIndex = Math.max(this._highestMeasuredFrameIndex, index); + + this._scheduleCellsToRenderUpdate(); + } else { + this._frames[cellKey].inLayout = true; + } + + this._triggerRemeasureForChildListsInCell(cellKey); + + this._computeBlankness(); + + this._updateViewableItems(this.props.data); + } + }, { + key: "_triggerRemeasureForChildListsInCell", + value: function _triggerRemeasureForChildListsInCell(cellKey) { + var childListKeys = this._cellKeysToChildListKeys.get(cellKey); + + if (childListKeys) { + for (var _iterator2 = _createForOfIteratorHelperLoose(childListKeys), _step2; !(_step2 = _iterator2()).done;) { + var childKey = _step2.value; + + var childList = this._nestedChildLists.get(childKey); + + childList && childList.ref && childList.ref.measureLayoutRelativeToContainingList(); + } + } + } + }, { + key: "measureLayoutRelativeToContainingList", + value: function measureLayoutRelativeToContainingList() { + var _this4 = this; + + try { + if (!this._scrollRef) { + return; + } + + this._scrollRef.measureLayout(this.context.getOutermostParentListRef().getScrollRef(), function (x, y, width, height) { + _this4._offsetFromParentVirtualizedList = _this4._selectOffset({ + x: x, + y: y + }); + _this4._scrollMetrics.contentLength = _this4._selectLength({ + width: width, + height: height + }); + + var scrollMetrics = _this4._convertParentScrollMetrics(_this4.context.getScrollMetrics()); + + var metricsChanged = _this4._scrollMetrics.visibleLength !== scrollMetrics.visibleLength || _this4._scrollMetrics.offset !== scrollMetrics.offset; + + if (metricsChanged) { + _this4._scrollMetrics.visibleLength = scrollMetrics.visibleLength; + _this4._scrollMetrics.offset = scrollMetrics.offset; + + _this4._cellKeysToChildListKeys.forEach(function (childListKeys) { + if (childListKeys) { + for (var _iterator3 = _createForOfIteratorHelperLoose(childListKeys), _step3; !(_step3 = _iterator3()).done;) { + var childKey = _step3.value; + + var childList = _this4._nestedChildLists.get(childKey); + + childList && childList.ref && childList.ref.measureLayoutRelativeToContainingList(); + } + } + }); + } + }, function (error) { + console.warn("VirtualizedList: Encountered an error while measuring a list's offset from its containing VirtualizedList."); + }); + } catch (error) { + console.warn('measureLayoutRelativeToContainingList threw an error', error.stack); + } + } + }, { + key: "_getFooterCellKey", + value: function _getFooterCellKey() { + return this._getCellKey() + '-footer'; + } + }, { + key: "_renderDebugOverlay", + value: function _renderDebugOverlay() { + var normalize = this._scrollMetrics.visibleLength / (this._scrollMetrics.contentLength || 1); + var framesInLayout = []; + var itemCount = this.props.getItemCount(this.props.data); + + for (var ii = 0; ii < itemCount; ii++) { + var frame = this._getFrameMetricsApprox(ii); + + if (frame.inLayout) { + framesInLayout.push(frame); + } + } + + var windowTop = this._getFrameMetricsApprox(this.state.first).offset; + + var frameLast = this._getFrameMetricsApprox(this.state.last); + + var windowLen = frameLast.offset + frameLast.length - windowTop; + var visTop = this._scrollMetrics.offset; + var visLen = this._scrollMetrics.visibleLength; + return React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + style: [styles.debugOverlayBase, styles.debugOverlay] + }, framesInLayout.map(function (f, ii) { + return React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + key: 'f' + ii, + style: [styles.debugOverlayBase, styles.debugOverlayFrame, { + top: f.offset * normalize, + height: f.length * normalize + }] + }); + }), React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + style: [styles.debugOverlayBase, styles.debugOverlayFrameLast, { + top: windowTop * normalize, + height: windowLen * normalize + }] + }), React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + style: [styles.debugOverlayBase, styles.debugOverlayFrameVis, { + top: visTop * normalize, + height: visLen * normalize + }] + })); + } + }, { + key: "_selectLength", + value: function _selectLength(metrics) { + return !horizontalOrDefault(this.props.horizontal) ? metrics.height : metrics.width; + } + }, { + key: "_selectOffset", + value: function _selectOffset(metrics) { + return !horizontalOrDefault(this.props.horizontal) ? metrics.y : metrics.x; + } + }, { + key: "_maybeCallOnEndReached", + value: function _maybeCallOnEndReached() { + var _this$props10 = this.props, + data = _this$props10.data, + getItemCount = _this$props10.getItemCount, + onEndReached = _this$props10.onEndReached, + onEndReachedThreshold = _this$props10.onEndReachedThreshold; + var _this$_scrollMetrics2 = this._scrollMetrics, + contentLength = _this$_scrollMetrics2.contentLength, + visibleLength = _this$_scrollMetrics2.visibleLength, + offset = _this$_scrollMetrics2.offset; + var distanceFromEnd = contentLength - visibleLength - offset; + var threshold = onEndReachedThreshold != null ? onEndReachedThreshold * visibleLength : 2; + + if (onEndReached && this.state.last === getItemCount(data) - 1 && distanceFromEnd < threshold && this._scrollMetrics.contentLength !== this._sentEndForContentLength) { + this._sentEndForContentLength = this._scrollMetrics.contentLength; + onEndReached({ + distanceFromEnd: distanceFromEnd + }); + } else if (distanceFromEnd > threshold) { + this._sentEndForContentLength = 0; + } + } + }, { + key: "_scheduleCellsToRenderUpdate", + value: function _scheduleCellsToRenderUpdate() { + var _this$state2 = this.state, + first = _this$state2.first, + last = _this$state2.last; + var _this$_scrollMetrics3 = this._scrollMetrics, + offset = _this$_scrollMetrics3.offset, + visibleLength = _this$_scrollMetrics3.visibleLength, + velocity = _this$_scrollMetrics3.velocity; + var itemCount = this.props.getItemCount(this.props.data); + var hiPri = false; + var onEndReachedThreshold = onEndReachedThresholdOrDefault(this.props.onEndReachedThreshold); + var scrollingThreshold = onEndReachedThreshold * visibleLength / 2; + + if (first > 0) { + var distTop = offset - this._getFrameMetricsApprox(first).offset; + + hiPri = hiPri || distTop < 0 || velocity < -2 && distTop < scrollingThreshold; + } + + if (last < itemCount - 1) { + var distBottom = this._getFrameMetricsApprox(last).offset - (offset + visibleLength); + hiPri = hiPri || distBottom < 0 || velocity > 2 && distBottom < scrollingThreshold; + } + + if (hiPri && (this._averageCellLength || this.props.getItemLayout) && !this._hiPriInProgress) { + this._hiPriInProgress = true; + + this._updateCellsToRenderBatcher.dispose({ + abort: true + }); + + this._updateCellsToRender(); + + return; + } else { + this._updateCellsToRenderBatcher.schedule(); + } + } + }, { + key: "_updateViewableItems", + value: function _updateViewableItems(data) { + var _this5 = this; + + var getItemCount = this.props.getItemCount; + + this._viewabilityTuples.forEach(function (tuple) { + tuple.viewabilityHelper.onUpdate(getItemCount(data), _this5._scrollMetrics.offset, _this5._scrollMetrics.visibleLength, _this5._getFrameMetrics, _this5._createViewToken, tuple.onViewableItemsChanged, _this5.state); + }); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(newProps, prevState) { + var data = newProps.data, + getItemCount = newProps.getItemCount; + var maxToRenderPerBatch = maxToRenderPerBatchOrDefault(newProps.maxToRenderPerBatch); + return { + first: Math.max(0, Math.min(prevState.first, getItemCount(data) - 1 - maxToRenderPerBatch)), + last: Math.max(0, Math.min(prevState.last, getItemCount(data) - 1)) + }; + } + }]); + return VirtualizedList; + }(React.PureComponent); + + VirtualizedList.contextType = _$$_REQUIRE(_dependencyMap[20]).VirtualizedListContext; + + var CellRenderer = function (_React$Component) { + (0, _inherits2.default)(CellRenderer, _React$Component); + + var _super2 = _createSuper(CellRenderer); + + function CellRenderer() { + var _this6; + + (0, _classCallCheck2.default)(this, CellRenderer); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this6 = _super2.call.apply(_super2, [this].concat(args)); + _this6.state = { + separatorProps: { + highlighted: false, + leadingItem: _this6.props.item + } + }; + _this6._separators = { + highlight: function highlight() { + var _this6$props = _this6.props, + cellKey = _this6$props.cellKey, + prevCellKey = _this6$props.prevCellKey; + + _this6.props.onUpdateSeparators([cellKey, prevCellKey], { + highlighted: true + }); + }, + unhighlight: function unhighlight() { + var _this6$props2 = _this6.props, + cellKey = _this6$props2.cellKey, + prevCellKey = _this6$props2.prevCellKey; + + _this6.props.onUpdateSeparators([cellKey, prevCellKey], { + highlighted: false + }); + }, + updateProps: function updateProps(select, newProps) { + var _this6$props3 = _this6.props, + cellKey = _this6$props3.cellKey, + prevCellKey = _this6$props3.prevCellKey; + + _this6.props.onUpdateSeparators([select === 'leading' ? prevCellKey : cellKey], newProps); + } + }; + return _this6; + } + + (0, _createClass2.default)(CellRenderer, [{ + key: "updateSeparatorProps", + value: function updateSeparatorProps(newProps) { + this.setState(function (state) { + return { + separatorProps: (0, _extends2.default)({}, state.separatorProps, newProps) + }; + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.props.onUnmount(this.props.cellKey); + } + }, { + key: "_renderElement", + value: function _renderElement(renderItem, ListItemComponent, item, index) { + if (renderItem && ListItemComponent) { + console.warn("VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take precedence over renderItem."); + } + + if (ListItemComponent) { + return React.createElement(ListItemComponent, { + item: item, + index: index, + separators: this._separators + }); + } + + if (renderItem) { + return renderItem({ + item: item, + index: index, + separators: this._separators + }); + } + + _$$_REQUIRE(_dependencyMap[11])(false, 'VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.'); + } + }, { + key: "render", + value: function render() { + var _this$props11 = this.props, + CellRendererComponent = _this$props11.CellRendererComponent, + ItemSeparatorComponent = _this$props11.ItemSeparatorComponent, + fillRateHelper = _this$props11.fillRateHelper, + horizontal = _this$props11.horizontal, + item = _this$props11.item, + index = _this$props11.index, + inversionStyle = _this$props11.inversionStyle, + parentProps = _this$props11.parentProps; + var renderItem = parentProps.renderItem, + getItemLayout = parentProps.getItemLayout, + ListItemComponent = parentProps.ListItemComponent; + + var element = this._renderElement(renderItem, ListItemComponent, item, index); + + var onLayout = getItemLayout && !parentProps.debug && !fillRateHelper.enabled() ? undefined : this.props.onLayout; + var itemSeparator = ItemSeparatorComponent && React.createElement(ItemSeparatorComponent, this.state.separatorProps); + var cellStyle = inversionStyle ? horizontal ? [styles.rowReverse, inversionStyle] : [styles.columnReverse, inversionStyle] : horizontal ? [styles.row, inversionStyle] : inversionStyle; + var result = !CellRendererComponent ? React.createElement(_$$_REQUIRE(_dependencyMap[10]), { + style: cellStyle, + onLayout: onLayout + }, element, itemSeparator) : React.createElement(CellRendererComponent, (0, _extends2.default)({}, this.props, { + style: cellStyle, + onLayout: onLayout + }), element, itemSeparator); + return React.createElement(_$$_REQUIRE(_dependencyMap[20]).VirtualizedListCellContextProvider, { + cellKey: this.props.cellKey + }, result); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, prevState) { + return { + separatorProps: (0, _extends2.default)({}, prevState.separatorProps, { + leadingItem: props.item + }) + }; + } + }]); + return CellRenderer; + }(React.Component); + + function describeNestedLists(childList) { + var trace = 'VirtualizedList trace:\n' + (" Child (" + (childList.horizontal ? 'horizontal' : 'vertical') + "):\n") + (" listKey: " + childList.key + "\n") + (" cellKey: " + childList.cellKey); + var debugInfo = childList.parentDebugInfo; + + while (debugInfo) { + trace += "\n Parent (" + (debugInfo.horizontal ? 'horizontal' : 'vertical') + "):\n" + (" listKey: " + debugInfo.listKey + "\n") + (" cellKey: " + debugInfo.cellKey); + debugInfo = debugInfo.parent; + } + + return trace; + } + + var styles = _$$_REQUIRE(_dependencyMap[21]).create({ + verticallyInverted: { + transform: [{ + scaleY: -1 + }] + }, + horizontallyInverted: { + transform: [{ + scaleX: -1 + }] + }, + row: { + flexDirection: 'row' + }, + rowReverse: { + flexDirection: 'row-reverse' + }, + columnReverse: { + flexDirection: 'column-reverse' + }, + debug: { + flex: 1 + }, + debugOverlayBase: { + position: 'absolute', + top: 0, + right: 0 + }, + debugOverlay: { + bottom: 0, + width: 20, + borderColor: 'blue', + borderWidth: 1 + }, + debugOverlayFrame: { + left: 0, + backgroundColor: 'orange' + }, + debugOverlayFrameLast: { + left: 0, + borderColor: 'green', + borderWidth: 2 + }, + debugOverlayFrameVis: { + left: 0, + borderColor: 'red', + borderWidth: 2 + } + }); + + module.exports = VirtualizedList; +},258,[5,27,6,7,8,15,12,14,16,17,184,36,259,275,278,257,279,280,281,54,282,183]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _AnimatedImplementation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Dimensions = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _ReactNative = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _ScrollViewStickyHeader = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _UIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _Keyboard = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _FrameRateLogger = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _TextInputState = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _dismissKeyboard = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _flattenStyle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _processDecelerationRate = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + var _splitLayoutProps2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _setAndForwardRef = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _ScrollViewContext = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[27])); + + var _ScrollViewCommands = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[28])); + + var _AndroidHorizontalScrollContentViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[29])); + + var _AndroidHorizontalScrollViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[30])); + + var _ScrollContentViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[31])); + + var _ScrollViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[32])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + _$$_REQUIRE(_dependencyMap[13]); + + var _ref = _Platform.default.OS === 'android' ? { + NativeHorizontalScrollViewTuple: [_AndroidHorizontalScrollViewNativeComponent.default, _AndroidHorizontalScrollContentViewNativeComponent.default], + NativeVerticalScrollViewTuple: [_ScrollViewNativeComponent.default, _View.default] + } : { + NativeHorizontalScrollViewTuple: [_ScrollViewNativeComponent.default, _ScrollContentViewNativeComponent.default], + NativeVerticalScrollViewTuple: [_ScrollViewNativeComponent.default, _ScrollContentViewNativeComponent.default] + }, + NativeHorizontalScrollViewTuple = _ref.NativeHorizontalScrollViewTuple, + NativeVerticalScrollViewTuple = _ref.NativeVerticalScrollViewTuple; + + var IS_ANIMATING_TOUCH_START_THRESHOLD_MS = 16; + + var ScrollView = function (_React$Component) { + (0, _inherits2.default)(ScrollView, _React$Component); + + var _super = _createSuper(ScrollView); + + function ScrollView(props) { + var _this$props$contentOf, _this$props$contentOf2, _this$props$contentIn, _this$props$contentIn2; + + var _this; + + (0, _classCallCheck2.default)(this, ScrollView); + _this = _super.call(this, props); + _this._scrollAnimatedValueAttachment = null; + _this._stickyHeaderRefs = new Map(); + _this._headerLayoutYs = new Map(); + _this._keyboardWillOpenTo = null; + _this._additionalScrollOffset = 0; + _this._isTouching = false; + _this._lastMomentumScrollBeginTime = 0; + _this._lastMomentumScrollEndTime = 0; + _this._observedScrollSinceBecomingResponder = false; + _this._becameResponderWhileAnimating = false; + _this._preventNegativeScrollOffset = null; + _this._animated = null; + _this._subscriptionKeyboardWillShow = null; + _this._subscriptionKeyboardWillHide = null; + _this._subscriptionKeyboardDidShow = null; + _this._subscriptionKeyboardDidHide = null; + _this.state = { + layoutHeight: null + }; + _this._setNativeRef = (0, _setAndForwardRef.default)({ + getForwardedRef: function getForwardedRef() { + return _this.props.scrollViewRef; + }, + setLocalRef: function setLocalRef(ref) { + _this._scrollViewRef = ref; + + if (ref) { + ref.getScrollResponder = _this.getScrollResponder; + ref.getScrollableNode = _this.getScrollableNode; + ref.getInnerViewNode = _this.getInnerViewNode; + ref.getInnerViewRef = _this.getInnerViewRef; + ref.getNativeScrollRef = _this.getNativeScrollRef; + ref.scrollTo = _this.scrollTo; + ref.scrollToEnd = _this.scrollToEnd; + ref.flashScrollIndicators = _this.flashScrollIndicators; + ref.scrollResponderZoomTo = _this.scrollResponderZoomTo; + ref.scrollResponderScrollNativeHandleToKeyboard = _this.scrollResponderScrollNativeHandleToKeyboard; + } + } + }); + + _this.getScrollResponder = function () { + return (0, _assertThisInitialized2.default)(_this); + }; + + _this.getScrollableNode = function () { + return _ReactNative.default.findNodeHandle(_this._scrollViewRef); + }; + + _this.getInnerViewNode = function () { + return _ReactNative.default.findNodeHandle(_this._innerViewRef); + }; + + _this.getInnerViewRef = function () { + return _this._innerViewRef; + }; + + _this.getNativeScrollRef = function () { + return _this._scrollViewRef; + }; + + _this.scrollTo = function (options, deprecatedX, deprecatedAnimated) { + var x, y, animated; + + if (typeof options === 'number') { + console.warn("`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead."); + y = options; + x = deprecatedX; + animated = deprecatedAnimated; + } else if (options) { + y = options.y; + x = options.x; + animated = options.animated; + } + + if (_this._scrollViewRef == null) { + return; + } + + _ScrollViewCommands.default.scrollTo(_this._scrollViewRef, x || 0, y || 0, animated !== false); + }; + + _this.scrollToEnd = function (options) { + var animated = (options && options.animated) !== false; + + if (_this._scrollViewRef == null) { + return; + } + + _ScrollViewCommands.default.scrollToEnd(_this._scrollViewRef, animated); + }; + + _this.flashScrollIndicators = function () { + if (_this._scrollViewRef == null) { + return; + } + + _ScrollViewCommands.default.flashScrollIndicators(_this._scrollViewRef); + }; + + _this.scrollResponderScrollNativeHandleToKeyboard = function (nodeHandle, additionalOffset, preventNegativeScrollOffset) { + _this._additionalScrollOffset = additionalOffset || 0; + _this._preventNegativeScrollOffset = !!preventNegativeScrollOffset; + + if (_this._innerViewRef == null) { + return; + } + + if (typeof nodeHandle === 'number') { + _UIManager.default.measureLayout(nodeHandle, _ReactNative.default.findNodeHandle((0, _assertThisInitialized2.default)(_this)), _this._textInputFocusError, _this._inputMeasureAndScrollToKeyboard); + } else { + nodeHandle.measureLayout(_this._innerViewRef, _this._inputMeasureAndScrollToKeyboard, _this._textInputFocusError); + } + }; + + _this.scrollResponderZoomTo = function (rect, animated) { + (0, _invariant.default)(_Platform.default.OS === 'ios', 'zoomToRect is not implemented'); + + if ('animated' in rect) { + _this._animated = rect.animated; + delete rect.animated; + } else if (typeof animated !== 'undefined') { + console.warn('`scrollResponderZoomTo` `animated` argument is deprecated. Use `options.animated` instead'); + } + + if (_this._scrollViewRef == null) { + return; + } + + _ScrollViewCommands.default.zoomToRect(_this._scrollViewRef, rect, animated !== false); + }; + + _this._inputMeasureAndScrollToKeyboard = function (left, top, width, height) { + var keyboardScreenY = _Dimensions.default.get('window').height; + + var scrollTextInputIntoVisibleRect = function scrollTextInputIntoVisibleRect() { + if (_this._keyboardWillOpenTo != null) { + keyboardScreenY = _this._keyboardWillOpenTo.endCoordinates.screenY; + } + + var scrollOffsetY = top - keyboardScreenY + height + _this._additionalScrollOffset; + + if (_this._preventNegativeScrollOffset === true) { + scrollOffsetY = Math.max(0, scrollOffsetY); + } + + _this.scrollTo({ + x: 0, + y: scrollOffsetY, + animated: true + }); + + _this._additionalScrollOffset = 0; + _this._preventNegativeScrollOffset = false; + }; + + if (_this._keyboardWillOpenTo == null) { + setTimeout(function () { + scrollTextInputIntoVisibleRect(); + }, 0); + } else { + scrollTextInputIntoVisibleRect(); + } + }; + + _this._handleScroll = function (e) { + _this._observedScrollSinceBecomingResponder = true; + _this.props.onScroll && _this.props.onScroll(e); + }; + + _this._handleLayout = function (e) { + if (_this.props.invertStickyHeaders === true) { + _this.setState({ + layoutHeight: e.nativeEvent.layout.height + }); + } + + if (_this.props.onLayout) { + _this.props.onLayout(e); + } + }; + + _this._handleContentOnLayout = function (e) { + var _e$nativeEvent$layout = e.nativeEvent.layout, + width = _e$nativeEvent$layout.width, + height = _e$nativeEvent$layout.height; + _this.props.onContentSizeChange && _this.props.onContentSizeChange(width, height); + }; + + _this._scrollViewRef = null; + _this._innerViewRef = null; + _this._setInnerViewRef = (0, _setAndForwardRef.default)({ + getForwardedRef: function getForwardedRef() { + return _this.props.innerViewRef; + }, + setLocalRef: function setLocalRef(ref) { + _this._innerViewRef = ref; + } + }); + + _this.scrollResponderKeyboardWillShow = function (e) { + _this._keyboardWillOpenTo = e; + _this.props.onKeyboardWillShow && _this.props.onKeyboardWillShow(e); + }; + + _this.scrollResponderKeyboardWillHide = function (e) { + _this._keyboardWillOpenTo = null; + _this.props.onKeyboardWillHide && _this.props.onKeyboardWillHide(e); + }; + + _this.scrollResponderKeyboardDidShow = function (e) { + if (e) { + _this._keyboardWillOpenTo = e; + } + + _this.props.onKeyboardDidShow && _this.props.onKeyboardDidShow(e); + }; + + _this.scrollResponderKeyboardDidHide = function (e) { + _this._keyboardWillOpenTo = null; + _this.props.onKeyboardDidHide && _this.props.onKeyboardDidHide(e); + }; + + _this._handleMomentumScrollBegin = function (e) { + _this._lastMomentumScrollBeginTime = global.performance.now(); + _this.props.onMomentumScrollBegin && _this.props.onMomentumScrollBegin(e); + }; + + _this._handleMomentumScrollEnd = function (e) { + _FrameRateLogger.default.endScroll(); + + _this._lastMomentumScrollEndTime = global.performance.now(); + _this.props.onMomentumScrollEnd && _this.props.onMomentumScrollEnd(e); + }; + + _this._handleScrollBeginDrag = function (e) { + _FrameRateLogger.default.beginScroll(); + + if (_Platform.default.OS === 'android' && _this.props.keyboardDismissMode === 'on-drag') { + (0, _dismissKeyboard.default)(); + } + + _this.props.onScrollBeginDrag && _this.props.onScrollBeginDrag(e); + }; + + _this._handleScrollEndDrag = function (e) { + var velocity = e.nativeEvent.velocity; + + if (!_this._isAnimating() && (!velocity || velocity.x === 0 && velocity.y === 0)) { + _FrameRateLogger.default.endScroll(); + } + + _this.props.onScrollEndDrag && _this.props.onScrollEndDrag(e); + }; + + _this._isAnimating = function () { + var now = global.performance.now(); + var timeSinceLastMomentumScrollEnd = now - _this._lastMomentumScrollEndTime; + var isAnimating = timeSinceLastMomentumScrollEnd < IS_ANIMATING_TOUCH_START_THRESHOLD_MS || _this._lastMomentumScrollEndTime < _this._lastMomentumScrollBeginTime; + return isAnimating; + }; + + _this._handleResponderGrant = function (e) { + _this._observedScrollSinceBecomingResponder = false; + _this.props.onResponderGrant && _this.props.onResponderGrant(e); + _this._becameResponderWhileAnimating = _this._isAnimating(); + }; + + _this._handleResponderReject = function () {}; + + _this._handleResponderRelease = function (e) { + _this._isTouching = e.nativeEvent.touches.length !== 0; + _this.props.onResponderRelease && _this.props.onResponderRelease(e); + + if (typeof e.target === 'number') { + return; + } + + var currentlyFocusedTextInput = _TextInputState.default.currentlyFocusedInput(); + + if (_this.props.keyboardShouldPersistTaps !== true && _this.props.keyboardShouldPersistTaps !== 'always' && _this._keyboardIsDismissible() && e.target !== currentlyFocusedTextInput && !_this._observedScrollSinceBecomingResponder && !_this._becameResponderWhileAnimating) { + _TextInputState.default.blurTextInput(currentlyFocusedTextInput); + } + }; + + _this._handleResponderTerminationRequest = function () { + return !_this._observedScrollSinceBecomingResponder; + }; + + _this._handleScrollShouldSetResponder = function () { + if (_this.props.disableScrollViewPanResponder === true) { + return false; + } + + return _this._isTouching; + }; + + _this._handleStartShouldSetResponder = function (e) { + if (_this.props.disableScrollViewPanResponder === true) { + return false; + } + + var currentlyFocusedInput = _TextInputState.default.currentlyFocusedInput(); + + if (_this.props.keyboardShouldPersistTaps === 'handled' && _this._keyboardIsDismissible() && e.target !== currentlyFocusedInput) { + return true; + } + + return false; + }; + + _this._handleStartShouldSetResponderCapture = function (e) { + if (_this._isAnimating()) { + return true; + } + + if (_this.props.disableScrollViewPanResponder === true) { + return false; + } + + var keyboardShouldPersistTaps = _this.props.keyboardShouldPersistTaps; + var keyboardNeverPersistTaps = !keyboardShouldPersistTaps || keyboardShouldPersistTaps === 'never'; + + if (typeof e.target === 'number') { + return false; + } + + if (keyboardNeverPersistTaps && _this._keyboardIsDismissible() && e.target != null && !_TextInputState.default.isTextInput(e.target)) { + return true; + } + + return false; + }; + + _this._keyboardIsDismissible = function () { + var currentlyFocusedInput = _TextInputState.default.currentlyFocusedInput(); + + var hasFocusedTextInput = currentlyFocusedInput != null && _TextInputState.default.isTextInput(currentlyFocusedInput); + + var softKeyboardMayBeOpen = _this._keyboardWillOpenTo != null || _Platform.default.OS === 'android'; + return hasFocusedTextInput && softKeyboardMayBeOpen; + }; + + _this._handleTouchEnd = function (e) { + var nativeEvent = e.nativeEvent; + _this._isTouching = nativeEvent.touches.length !== 0; + _this.props.onTouchEnd && _this.props.onTouchEnd(e); + }; + + _this._handleTouchCancel = function (e) { + _this._isTouching = false; + _this.props.onTouchCancel && _this.props.onTouchCancel(e); + }; + + _this._handleTouchStart = function (e) { + _this._isTouching = true; + _this.props.onTouchStart && _this.props.onTouchStart(e); + }; + + _this._handleTouchMove = function (e) { + _this.props.onTouchMove && _this.props.onTouchMove(e); + }; + + _this._scrollAnimatedValue = new _AnimatedImplementation.default.Value((_this$props$contentOf = (_this$props$contentOf2 = _this.props.contentOffset) == null ? undefined : _this$props$contentOf2.y) != null ? _this$props$contentOf : 0); + + _this._scrollAnimatedValue.setOffset((_this$props$contentIn = (_this$props$contentIn2 = _this.props.contentInset) == null ? undefined : _this$props$contentIn2.top) != null ? _this$props$contentIn : 0); + + return _this; + } + + (0, _createClass2.default)(ScrollView, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (typeof this.props.keyboardShouldPersistTaps === 'boolean') { + console.warn("'keyboardShouldPersistTaps={" + (this.props.keyboardShouldPersistTaps === true ? 'true' : 'false') + "}' is deprecated. " + ("Use 'keyboardShouldPersistTaps=\"" + (this.props.keyboardShouldPersistTaps ? 'always' : 'never') + "\"' instead")); + } + + this._keyboardWillOpenTo = null; + this._additionalScrollOffset = 0; + this._subscriptionKeyboardWillShow = _Keyboard.default.addListener('keyboardWillShow', this.scrollResponderKeyboardWillShow); + this._subscriptionKeyboardWillHide = _Keyboard.default.addListener('keyboardWillHide', this.scrollResponderKeyboardWillHide); + this._subscriptionKeyboardDidShow = _Keyboard.default.addListener('keyboardDidShow', this.scrollResponderKeyboardDidShow); + this._subscriptionKeyboardDidHide = _Keyboard.default.addListener('keyboardDidHide', this.scrollResponderKeyboardDidHide); + + this._updateAnimatedNodeAttachment(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var prevContentInsetTop = prevProps.contentInset ? prevProps.contentInset.top : 0; + var newContentInsetTop = this.props.contentInset ? this.props.contentInset.top : 0; + + if (prevContentInsetTop !== newContentInsetTop) { + this._scrollAnimatedValue.setOffset(newContentInsetTop || 0); + } + + this._updateAnimatedNodeAttachment(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._subscriptionKeyboardWillShow != null) { + this._subscriptionKeyboardWillShow.remove(); + } + + if (this._subscriptionKeyboardWillHide != null) { + this._subscriptionKeyboardWillHide.remove(); + } + + if (this._subscriptionKeyboardDidShow != null) { + this._subscriptionKeyboardDidShow.remove(); + } + + if (this._subscriptionKeyboardDidHide != null) { + this._subscriptionKeyboardDidHide.remove(); + } + + if (this._scrollAnimatedValueAttachment) { + this._scrollAnimatedValueAttachment.detach(); + } + } + }, { + key: "_textInputFocusError", + value: function _textInputFocusError() { + console.warn('Error measuring text field.'); + } + }, { + key: "_getKeyForIndex", + value: function _getKeyForIndex(index, childArray) { + var child = childArray[index]; + return child && child.key; + } + }, { + key: "_updateAnimatedNodeAttachment", + value: function _updateAnimatedNodeAttachment() { + if (this._scrollAnimatedValueAttachment) { + this._scrollAnimatedValueAttachment.detach(); + } + + if (this.props.stickyHeaderIndices && this.props.stickyHeaderIndices.length > 0) { + this._scrollAnimatedValueAttachment = _AnimatedImplementation.default.attachNativeEvent(this._scrollViewRef, 'onScroll', [{ + nativeEvent: { + contentOffset: { + y: this._scrollAnimatedValue + } + } + }]); + } + } + }, { + key: "_setStickyHeaderRef", + value: function _setStickyHeaderRef(key, ref) { + if (ref) { + this._stickyHeaderRefs.set(key, ref); + } else { + this._stickyHeaderRefs.delete(key); + } + } + }, { + key: "_onStickyHeaderLayout", + value: function _onStickyHeaderLayout(index, event, key) { + var stickyHeaderIndices = this.props.stickyHeaderIndices; + + if (!stickyHeaderIndices) { + return; + } + + var childArray = React.Children.toArray(this.props.children); + + if (key !== this._getKeyForIndex(index, childArray)) { + return; + } + + var layoutY = event.nativeEvent.layout.y; + + this._headerLayoutYs.set(key, layoutY); + + var indexOfIndex = stickyHeaderIndices.indexOf(index); + var previousHeaderIndex = stickyHeaderIndices[indexOfIndex - 1]; + + if (previousHeaderIndex != null) { + var previousHeader = this._stickyHeaderRefs.get(this._getKeyForIndex(previousHeaderIndex, childArray)); + + previousHeader && previousHeader.setNextHeaderY && previousHeader.setNextHeaderY(layoutY); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _ref2 = this.props.horizontal === true ? NativeHorizontalScrollViewTuple : NativeVerticalScrollViewTuple, + _ref3 = (0, _slicedToArray2.default)(_ref2, 2), + NativeDirectionalScrollView = _ref3[0], + NativeDirectionalScrollContentView = _ref3[1]; + + var contentContainerStyle = [this.props.horizontal === true && styles.contentContainerHorizontal, this.props.contentContainerStyle]; + var contentSizeChangeProps = this.props.onContentSizeChange == null ? null : { + onLayout: this._handleContentOnLayout + }; + var stickyHeaderIndices = this.props.stickyHeaderIndices; + var children = this.props.children; + + if (stickyHeaderIndices != null && stickyHeaderIndices.length > 0) { + var childArray = React.Children.toArray(this.props.children); + children = childArray.map(function (child, index) { + var indexOfIndex = child ? stickyHeaderIndices.indexOf(index) : -1; + + if (indexOfIndex > -1) { + var key = child.key; + var nextIndex = stickyHeaderIndices[indexOfIndex + 1]; + var StickyHeaderComponent = _this2.props.StickyHeaderComponent || _ScrollViewStickyHeader.default; + return React.createElement(StickyHeaderComponent, { + key: key, + nativeID: 'StickyHeader-' + key, + ref: function ref(_ref4) { + return _this2._setStickyHeaderRef(key, _ref4); + }, + nextHeaderLayoutY: _this2._headerLayoutYs.get(_this2._getKeyForIndex(nextIndex, childArray)), + onLayout: function onLayout(event) { + return _this2._onStickyHeaderLayout(index, event, key); + }, + scrollAnimatedValue: _this2._scrollAnimatedValue, + inverted: _this2.props.invertStickyHeaders, + hiddenOnScroll: _this2.props.stickyHeaderHiddenOnScroll, + scrollViewHeight: _this2.state.layoutHeight + }, child); + } else { + return child; + } + }); + } + + children = React.createElement(_ScrollViewContext.default.Provider, { + value: this.props.horizontal === true ? _ScrollViewContext.HORIZONTAL : _ScrollViewContext.VERTICAL + }, children); + var hasStickyHeaders = Array.isArray(stickyHeaderIndices) && stickyHeaderIndices.length > 0; + var contentContainer = React.createElement(NativeDirectionalScrollContentView, (0, _extends2.default)({}, contentSizeChangeProps, { + ref: this._setInnerViewRef, + style: contentContainerStyle, + removeClippedSubviews: _Platform.default.OS === 'android' && hasStickyHeaders ? false : this.props.removeClippedSubviews, + collapsable: false + }), children); + var alwaysBounceHorizontal = this.props.alwaysBounceHorizontal !== undefined ? this.props.alwaysBounceHorizontal : this.props.horizontal; + var alwaysBounceVertical = this.props.alwaysBounceVertical !== undefined ? this.props.alwaysBounceVertical : !this.props.horizontal; + var baseStyle = this.props.horizontal === true ? styles.baseHorizontal : styles.baseVertical; + var props = (0, _extends2.default)({}, this.props, { + alwaysBounceHorizontal: alwaysBounceHorizontal, + alwaysBounceVertical: alwaysBounceVertical, + style: _StyleSheet.default.compose(baseStyle, this.props.style), + onContentSizeChange: null, + onLayout: this._handleLayout, + onMomentumScrollBegin: this._handleMomentumScrollBegin, + onMomentumScrollEnd: this._handleMomentumScrollEnd, + onResponderGrant: this._handleResponderGrant, + onResponderReject: this._handleResponderReject, + onResponderRelease: this._handleResponderRelease, + onResponderTerminationRequest: this._handleResponderTerminationRequest, + onScrollBeginDrag: this._handleScrollBeginDrag, + onScrollEndDrag: this._handleScrollEndDrag, + onScrollShouldSetResponder: this._handleScrollShouldSetResponder, + onStartShouldSetResponder: this._handleStartShouldSetResponder, + onStartShouldSetResponderCapture: this._handleStartShouldSetResponderCapture, + onTouchEnd: this._handleTouchEnd, + onTouchMove: this._handleTouchMove, + onTouchStart: this._handleTouchStart, + onTouchCancel: this._handleTouchCancel, + onScroll: this._handleScroll, + scrollEventThrottle: hasStickyHeaders ? 1 : this.props.scrollEventThrottle, + sendMomentumEvents: this.props.onMomentumScrollBegin || this.props.onMomentumScrollEnd ? true : false, + snapToStart: this.props.snapToStart !== false, + snapToEnd: this.props.snapToEnd !== false, + pagingEnabled: _Platform.default.select({ + ios: this.props.pagingEnabled === true && this.props.snapToInterval == null && this.props.snapToOffsets == null, + android: this.props.pagingEnabled === true || this.props.snapToInterval != null || this.props.snapToOffsets != null + }) + }); + var decelerationRate = this.props.decelerationRate; + + if (decelerationRate != null) { + props.decelerationRate = (0, _processDecelerationRate.default)(decelerationRate); + } + + var refreshControl = this.props.refreshControl; + + if (refreshControl) { + if (_Platform.default.OS === 'ios') { + return React.createElement(NativeDirectionalScrollView, (0, _extends2.default)({}, props, { + ref: this._setNativeRef + }), refreshControl, contentContainer); + } else if (_Platform.default.OS === 'android') { + var _splitLayoutProps = (0, _splitLayoutProps2.default)((0, _flattenStyle.default)(props.style)), + outer = _splitLayoutProps.outer, + inner = _splitLayoutProps.inner; + + return React.cloneElement(refreshControl, { + style: _StyleSheet.default.compose(baseStyle, outer) + }, React.createElement(NativeDirectionalScrollView, (0, _extends2.default)({}, props, { + style: _StyleSheet.default.compose(baseStyle, inner), + ref: this._setNativeRef + }), contentContainer)); + } + } + + return React.createElement(NativeDirectionalScrollView, (0, _extends2.default)({}, props, { + ref: this._setNativeRef + }), contentContainer); + } + }]); + return ScrollView; + }(React.Component); + + ScrollView.Context = _ScrollViewContext.default; + + var styles = _StyleSheet.default.create({ + baseVertical: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'column', + overflow: 'scroll' + }, + baseHorizontal: { + flexGrow: 1, + flexShrink: 1, + flexDirection: 'row', + overflow: 'scroll' + }, + contentContainerHorizontal: { + flexDirection: 'row' + } + }); + + function Wrapper(props, ref) { + return React.createElement(ScrollView, (0, _extends2.default)({}, props, { + scrollViewRef: ref + })); + } + + Wrapper.displayName = 'ScrollView'; + var ForwardedScrollView = React.forwardRef(Wrapper); + ForwardedScrollView.Context = _ScrollViewContext.default; + ForwardedScrollView.displayName = 'ScrollView'; + module.exports = ForwardedScrollView; +},259,[5,6,41,7,8,15,12,14,16,233,171,37,17,54,260,183,184,155,261,265,139,263,178,36,267,268,251,269,270,271,272,273,274]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedImplementation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedAddition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _AnimatedDiffClamp = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _AnimatedNode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedView = _AnimatedImplementation.default.createAnimatedComponent(_View.default); + + var ScrollViewStickyHeader = function (_React$Component) { + (0, _inherits2.default)(ScrollViewStickyHeader, _React$Component); + + var _super = _createSuper(ScrollViewStickyHeader); + + function ScrollViewStickyHeader() { + var _this; + + (0, _classCallCheck2.default)(this, ScrollViewStickyHeader); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + measured: false, + layoutY: 0, + layoutHeight: 0, + nextHeaderLayoutY: _this.props.nextHeaderLayoutY, + translateY: null + }; + _this._translateY = null; + _this._shouldRecreateTranslateY = true; + _this._haveReceivedInitialZeroTranslateY = true; + _this._debounceTimeout = _Platform.default.OS === 'android' ? 15 : 64; + + _this.setNextHeaderY = function (y) { + _this._shouldRecreateTranslateY = true; + + _this.setState({ + nextHeaderLayoutY: y + }); + }; + + _this._onLayout = function (event) { + var layoutY = event.nativeEvent.layout.y; + var layoutHeight = event.nativeEvent.layout.height; + var measured = true; + + if (layoutY !== _this.state.layoutY || layoutHeight !== _this.state.layoutHeight || measured !== _this.state.measured) { + _this._shouldRecreateTranslateY = true; + } + + _this.setState({ + measured: measured, + layoutY: layoutY, + layoutHeight: layoutHeight + }); + + _this.props.onLayout(event); + + var child = React.Children.only(_this.props.children); + + if (child.props.onLayout) { + child.props.onLayout(event); + } + }; + + _this._setComponentRef = function (ref) { + _this._ref = ref; + }; + + return _this; + } + + (0, _createClass2.default)(ScrollViewStickyHeader, [{ + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._translateY != null && this._animatedValueListenerId != null) { + this._translateY.removeListener(this._animatedValueListenerId); + } + + if (this._timer) { + clearTimeout(this._timer); + } + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + if (nextProps.scrollViewHeight !== this.props.scrollViewHeight || nextProps.scrollAnimatedValue !== this.props.scrollAnimatedValue || nextProps.inverted !== this.props.inverted) { + this._shouldRecreateTranslateY = true; + } + } + }, { + key: "updateTranslateListener", + value: function updateTranslateListener(translateY, isFabric, offset) { + var _this2 = this; + + if (this._translateY != null && this._animatedValueListenerId != null) { + this._translateY.removeListener(this._animatedValueListenerId); + } + + offset ? this._translateY = new _AnimatedAddition.default(translateY, offset) : this._translateY = translateY; + this._shouldRecreateTranslateY = false; + + if (!isFabric) { + return; + } + + if (!this._animatedValueListener) { + this._animatedValueListener = function (_ref) { + var value = _ref.value; + + if (value === 0 && !_this2._haveReceivedInitialZeroTranslateY) { + _this2._haveReceivedInitialZeroTranslateY = true; + return; + } + + if (_this2._timer) { + clearTimeout(_this2._timer); + } + + _this2._timer = setTimeout(function () { + if (value !== _this2.state.translateY) { + _this2.setState({ + translateY: value + }); + } + }, _this2._debounceTimeout); + }; + } + + if (this.state.translateY !== 0 && this.state.translateY != null) { + this._haveReceivedInitialZeroTranslateY = false; + } + + this._animatedValueListenerId = translateY.addListener(this._animatedValueListener); + } + }, { + key: "render", + value: function render() { + var _this$_ref$_internalI, _this$_ref$_internalI2; + + var isFabric = !!(this._ref && (_this$_ref$_internalI = this._ref['_internalInstanceHandle']) != null && (_this$_ref$_internalI2 = _this$_ref$_internalI.stateNode) != null && _this$_ref$_internalI2.canonical); + + if (this._shouldRecreateTranslateY) { + var _this$props = this.props, + inverted = _this$props.inverted, + scrollViewHeight = _this$props.scrollViewHeight; + var _this$state = this.state, + measured = _this$state.measured, + layoutHeight = _this$state.layoutHeight, + layoutY = _this$state.layoutY, + nextHeaderLayoutY = _this$state.nextHeaderLayoutY; + var inputRange = [-1, 0]; + var outputRange = [0, 0]; + + if (measured) { + if (inverted) { + if (scrollViewHeight != null) { + var stickStartPoint = layoutY + layoutHeight - scrollViewHeight; + + if (stickStartPoint > 0) { + inputRange.push(stickStartPoint); + outputRange.push(0); + inputRange.push(stickStartPoint + 1); + outputRange.push(1); + var collisionPoint = (nextHeaderLayoutY || 0) - layoutHeight - scrollViewHeight; + + if (collisionPoint > stickStartPoint) { + inputRange.push(collisionPoint, collisionPoint + 1); + outputRange.push(collisionPoint - stickStartPoint, collisionPoint - stickStartPoint); + } + } + } + } else { + inputRange.push(layoutY); + outputRange.push(0); + + var _collisionPoint = (nextHeaderLayoutY || 0) - layoutHeight; + + if (_collisionPoint >= layoutY) { + inputRange.push(_collisionPoint, _collisionPoint + 1); + outputRange.push(_collisionPoint - layoutY, _collisionPoint - layoutY); + } else { + inputRange.push(layoutY + 1); + outputRange.push(1); + } + } + } + + this.updateTranslateListener(this.props.scrollAnimatedValue.interpolate({ + inputRange: inputRange, + outputRange: outputRange + }), isFabric, this.props.hiddenOnScroll ? new _AnimatedDiffClamp.default(this.props.scrollAnimatedValue.interpolate({ + extrapolateLeft: 'clamp', + inputRange: [layoutY, layoutY + 1], + outputRange: [0, 1] + }).interpolate({ + inputRange: [0, 1], + outputRange: [0, -1] + }), -this.state.layoutHeight, 0) : null); + } + + var child = React.Children.only(this.props.children); + var passthroughAnimatedPropExplicitValues = isFabric && this.state.translateY != null ? { + style: { + transform: [{ + translateY: this.state.translateY + }] + } + } : null; + return React.createElement(AnimatedView, { + collapsable: false, + nativeID: this.props.nativeID, + onLayout: this._onLayout, + ref: this._setComponentRef, + style: [child.props.style, styles.header, { + transform: [{ + translateY: this._translateY + }] + }], + passthroughAnimatedPropExplicitValues: passthroughAnimatedPropExplicitValues + }, React.cloneElement(child, { + style: styles.fill, + onLayout: undefined + })); + } + }]); + return ScrollViewStickyHeader; + }(React.Component); + + var styles = _StyleSheet.default.create({ + header: { + zIndex: 10, + position: 'relative' + }, + fill: { + flex: 1 + } + }); + + module.exports = ScrollViewStickyHeader; +},260,[5,7,8,12,14,16,233,234,239,229,17,183,184,37]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _LayoutAnimation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _dismissKeyboard = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _NativeKeyboardObserver = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var Keyboard = function () { + function Keyboard() { + (0, _classCallCheck2.default)(this, Keyboard); + this._emitter = new _NativeEventEmitter.default(_Platform.default.OS !== 'ios' ? null : _NativeKeyboardObserver.default); + } + + (0, _createClass2.default)(Keyboard, [{ + key: "addListener", + value: function addListener(eventType, listener, context) { + return this._emitter.addListener(eventType, listener); + } + }, { + key: "removeListener", + value: function removeListener(eventType, listener) { + this._emitter.removeListener(eventType, listener); + } + }, { + key: "removeAllListeners", + value: function removeAllListeners(eventType) { + this._emitter.removeAllListeners(eventType); + } + }, { + key: "dismiss", + value: function dismiss() { + (0, _dismissKeyboard.default)(); + } + }, { + key: "scheduleLayoutAnimation", + value: function scheduleLayoutAnimation(event) { + var duration = event.duration, + easing = event.easing; + + if (duration != null && duration !== 0) { + _LayoutAnimation.default.configureNext({ + duration: duration, + update: { + duration: duration, + type: easing != null && _LayoutAnimation.default.Types[easing] || 'keyboard' + } + }); + } + } + }]); + return Keyboard; + }(); + + module.exports = new Keyboard(); +},261,[5,7,8,110,262,263,37,264]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function configureNext(config, onAnimationDidEnd, onAnimationDidFail) { + var _config$duration, _global; + + if (_Platform.default.isTesting) { + return; + } + + var animationCompletionHasRun = false; + + var onAnimationComplete = function onAnimationComplete() { + if (animationCompletionHasRun) { + return; + } + + animationCompletionHasRun = true; + clearTimeout(raceWithAnimationId); + onAnimationDidEnd == null ? undefined : onAnimationDidEnd(); + }; + + var raceWithAnimationId = setTimeout(onAnimationComplete, ((_config$duration = config.duration) != null ? _config$duration : 0) + 17); + var FabricUIManager = (_global = global) == null ? undefined : _global.nativeFabricUIManager; + + if (FabricUIManager != null && FabricUIManager.configureNextLayoutAnimation) { + var _global2, _global2$nativeFabric; + + (_global2 = global) == null ? undefined : (_global2$nativeFabric = _global2.nativeFabricUIManager) == null ? undefined : _global2$nativeFabric.configureNextLayoutAnimation(config, onAnimationComplete, onAnimationDidFail != null ? onAnimationDidFail : function () {}); + return; + } + + if (_$$_REQUIRE(_dependencyMap[2]) != null && _$$_REQUIRE(_dependencyMap[2]).configureNextLayoutAnimation) { + _$$_REQUIRE(_dependencyMap[2]).configureNextLayoutAnimation(config, onAnimationComplete != null ? onAnimationComplete : function () {}, onAnimationDidFail != null ? onAnimationDidFail : function () {}); + } + } + + function create(duration, type, property) { + return { + duration: duration, + create: { + type: type, + property: property + }, + update: { + type: type + }, + delete: { + type: type, + property: property + } + }; + } + + var Presets = { + easeInEaseOut: create(300, 'easeInEaseOut', 'opacity'), + linear: create(500, 'linear', 'opacity'), + spring: { + duration: 700, + create: { + type: 'linear', + property: 'opacity' + }, + update: { + type: 'spring', + springDamping: 0.4 + }, + delete: { + type: 'linear', + property: 'opacity' + } + } + }; + var LayoutAnimation = { + configureNext: configureNext, + create: create, + Types: Object.freeze({ + spring: 'spring', + linear: 'linear', + easeInEaseOut: 'easeInEaseOut', + easeIn: 'easeIn', + easeOut: 'easeOut', + keyboard: 'keyboard' + }), + Properties: Object.freeze({ + opacity: 'opacity', + scaleX: 'scaleX', + scaleY: 'scaleY', + scaleXY: 'scaleXY' + }), + checkConfig: function checkConfig() { + console.error('LayoutAnimation.checkConfig(...) has been disabled.'); + }, + Presets: Presets, + easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut), + linear: configureNext.bind(null, Presets.linear), + spring: configureNext.bind(null, Presets.spring) + }; + module.exports = LayoutAnimation; +},262,[5,37,155]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function dismissKeyboard() { + _$$_REQUIRE(_dependencyMap[0]).blurTextInput(_$$_REQUIRE(_dependencyMap[0]).currentlyFocusedInput()); + } + + module.exports = dismissKeyboard; +},263,[139]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('KeyboardObserver'); + + exports.default = _default; +},264,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeFrameRateLogger = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var FrameRateLogger = { + setGlobalOptions: function setGlobalOptions(options) { + if (options.debug !== undefined) { + _$$_REQUIRE(_dependencyMap[2])(_NativeFrameRateLogger.default, 'Trying to debug FrameRateLogger without the native module!'); + } + + if (_NativeFrameRateLogger.default) { + var optionsClone = { + debug: !!options.debug, + reportStackTraces: !!options.reportStackTraces + }; + + _NativeFrameRateLogger.default.setGlobalOptions(optionsClone); + } + }, + setContext: function setContext(context) { + _NativeFrameRateLogger.default && _NativeFrameRateLogger.default.setContext(context); + }, + beginScroll: function beginScroll() { + _NativeFrameRateLogger.default && _NativeFrameRateLogger.default.beginScroll(); + }, + endScroll: function endScroll() { + _NativeFrameRateLogger.default && _NativeFrameRateLogger.default.endScroll(); + } + }; + module.exports = FrameRateLogger; +},265,[5,266,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('FrameRateLogger'); + + exports.default = _default; +},266,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function processDecelerationRate(decelerationRate) { + if (decelerationRate === 'normal') { + return _Platform.default.select({ + ios: 0.998, + android: 0.985 + }); + } else if (decelerationRate === 'fast') { + return _Platform.default.select({ + ios: 0.99, + android: 0.9 + }); + } + + return decelerationRate; + } + + module.exports = processDecelerationRate; +},267,[5,37]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = splitLayoutProps; + + function splitLayoutProps(props) { + var outer = null; + var inner = null; + + if (props != null) { + outer = {}; + inner = {}; + + for (var _i = 0, _Object$keys = Object.keys(props); _i < _Object$keys.length; _i++) { + var prop = _Object$keys[_i]; + + switch (prop) { + case 'margin': + case 'marginHorizontal': + case 'marginVertical': + case 'marginBottom': + case 'marginTop': + case 'marginLeft': + case 'marginRight': + case 'flex': + case 'flexGrow': + case 'flexShrink': + case 'flexBasis': + case 'alignSelf': + case 'height': + case 'minHeight': + case 'maxHeight': + case 'width': + case 'minWidth': + case 'maxWidth': + case 'position': + case 'left': + case 'right': + case 'bottom': + case 'top': + case 'transform': + outer[prop] = props[prop]; + break; + + default: + inner[prop] = props[prop]; + break; + } + } + } + + return { + outer: outer, + inner: inner + }; + } +},268,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.VERTICAL = exports.HORIZONTAL = exports.default = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ScrollViewContext = React.createContext(null); + var _default = ScrollViewContext; + exports.default = _default; + var HORIZONTAL = Object.freeze({ + horizontal: true + }); + exports.HORIZONTAL = HORIZONTAL; + var VERTICAL = Object.freeze({ + horizontal: false + }); + exports.VERTICAL = VERTICAL; +},269,[17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = (0, _codegenNativeCommands.default)({ + supportedCommands: ['flashScrollIndicators', 'scrollTo', 'scrollToEnd', 'zoomToRect'] + }); + + exports.default = _default; +},270,[5,141,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('AndroidHorizontalScrollContentView'); + + exports.default = _default; +},271,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var AndroidHorizontalScrollViewNativeComponent = NativeComponentRegistry.get('AndroidHorizontalScrollView', function () { + return { + uiViewClassName: 'AndroidHorizontalScrollView', + bubblingEventTypes: {}, + directEventTypes: {}, + validAttributes: { + decelerationRate: true, + disableIntervalMomentum: true, + endFillColor: { + process: _$$_REQUIRE(_dependencyMap[1]) + }, + fadingEdgeLength: true, + nestedScrollEnabled: true, + overScrollMode: true, + pagingEnabled: true, + persistentScrollbar: true, + scrollEnabled: true, + scrollPerfTag: true, + sendMomentumEvents: true, + showsHorizontalScrollIndicator: true, + snapToAlignment: true, + snapToEnd: true, + snapToInterval: true, + snapToStart: true, + snapToOffsets: true, + contentOffset: true + } + }; + }); + var _default = AndroidHorizontalScrollViewNativeComponent; + exports.default = _default; +},272,[154,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ScrollContentViewNativeComponent = NativeComponentRegistry.get('RCTScrollContentView', function () { + return { + uiViewClassName: 'RCTScrollContentView', + bubblingEventTypes: {}, + directEventTypes: {}, + validAttributes: {} + }; + }); + var _default = ScrollContentViewNativeComponent; + exports.default = _default; +},273,[154]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ScrollViewNativeComponent = NativeComponentRegistry.get('RCTScrollView', function () { + return { + uiViewClassName: 'RCTScrollView', + bubblingEventTypes: {}, + directEventTypes: { + topScrollToTop: { + registrationName: 'onScrollToTop' + } + }, + validAttributes: { + alwaysBounceHorizontal: true, + alwaysBounceVertical: true, + automaticallyAdjustContentInsets: true, + automaticallyAdjustsScrollIndicatorInsets: true, + bounces: true, + bouncesZoom: true, + canCancelContentTouches: true, + centerContent: true, + contentInset: { + diff: _$$_REQUIRE(_dependencyMap[1]) + }, + contentOffset: { + diff: _$$_REQUIRE(_dependencyMap[1]) + }, + contentInsetAdjustmentBehavior: true, + decelerationRate: true, + directionalLockEnabled: true, + disableIntervalMomentum: true, + endFillColor: { + process: _$$_REQUIRE(_dependencyMap[2]) + }, + fadingEdgeLength: true, + indicatorStyle: true, + inverted: true, + keyboardDismissMode: true, + maintainVisibleContentPosition: true, + maximumZoomScale: true, + minimumZoomScale: true, + nestedScrollEnabled: true, + onMomentumScrollBegin: true, + onMomentumScrollEnd: true, + onScroll: true, + onScrollBeginDrag: true, + onScrollEndDrag: true, + onScrollToTop: true, + overScrollMode: true, + pagingEnabled: true, + persistentScrollbar: true, + pinchGestureEnabled: true, + scrollEnabled: true, + scrollEventThrottle: true, + scrollIndicatorInsets: { + diff: _$$_REQUIRE(_dependencyMap[1]) + }, + scrollPerfTag: true, + scrollToOverflowEnabled: true, + scrollsToTop: true, + sendMomentumEvents: true, + showsHorizontalScrollIndicator: true, + showsVerticalScrollIndicator: true, + snapToAlignment: true, + snapToEnd: true, + snapToInterval: true, + snapToOffsets: true, + snapToStart: true, + zoomScale: true + } + }; + }); + var _default = ScrollViewNativeComponent; + exports.default = _default; +},274,[154,163,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _AndroidSwipeRefreshLayoutNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _PullToRefreshViewNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var React = _$$_REQUIRE(_dependencyMap[10]); + + var RefreshControl = function (_React$Component) { + (0, _inherits2.default)(RefreshControl, _React$Component); + + var _super = _createSuper(RefreshControl); + + function RefreshControl() { + var _this; + + (0, _classCallCheck2.default)(this, RefreshControl); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this._lastNativeRefreshing = false; + + _this._onRefresh = function () { + _this._lastNativeRefreshing = true; + _this.props.onRefresh && _this.props.onRefresh(); + + _this.forceUpdate(); + }; + + _this._setNativeRef = function (ref) { + _this._nativeRef = ref; + }; + + return _this; + } + + (0, _createClass2.default)(RefreshControl, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._lastNativeRefreshing = this.props.refreshing; + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (this.props.refreshing !== prevProps.refreshing) { + this._lastNativeRefreshing = this.props.refreshing; + } else if (this.props.refreshing !== this._lastNativeRefreshing && this._nativeRef) { + { + _PullToRefreshViewNativeComponent.Commands.setNativeRefreshing(this._nativeRef, this.props.refreshing); + } + this._lastNativeRefreshing = this.props.refreshing; + } + } + }, { + key: "render", + value: function render() { + { + var _this$props = this.props, + enabled = _this$props.enabled, + colors = _this$props.colors, + progressBackgroundColor = _this$props.progressBackgroundColor, + size = _this$props.size, + props = (0, _objectWithoutProperties2.default)(_this$props, ["enabled", "colors", "progressBackgroundColor", "size"]); + return React.createElement(_PullToRefreshViewNativeComponent.default, (0, _extends2.default)({}, props, { + ref: this._setNativeRef, + onRefresh: this._onRefresh + })); + } + } + }]); + return RefreshControl; + }(React.Component); + + module.exports = RefreshControl; +},275,[5,6,108,7,8,12,14,16,276,277,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['setNativeRefreshing'] + }); + exports.Commands = Commands; + + var _default = (0, _codegenNativeComponent.default)('AndroidSwipeRefreshLayout'); + + exports.default = _default; +},276,[17,5,141,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['setNativeRefreshing'] + }); + exports.Commands = Commands; + + var _default = (0, _codegenNativeComponent.default)('PullToRefreshView', { + paperComponentName: 'RCTRefreshControl', + excludedPlatforms: ['android'] + }); + + exports.default = _default; +},277,[17,5,190,141]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function infoLog() { + return undefined; + } + + module.exports = infoLog; +},278,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var Info = function Info() { + _$$_REQUIRE(_dependencyMap[0])(this, Info); + + this.any_blank_count = 0; + this.any_blank_ms = 0; + this.any_blank_speed_sum = 0; + this.mostly_blank_count = 0; + this.mostly_blank_ms = 0; + this.pixels_blank = 0; + this.pixels_sampled = 0; + this.pixels_scrolled = 0; + this.total_time_spent = 0; + this.sample_count = 0; + }; + + var DEBUG = false; + var _listeners = []; + var _minSampleCount = 10; + var _sampleRate = null; + + var FillRateHelper = function () { + function FillRateHelper(getFrameMetrics) { + _$$_REQUIRE(_dependencyMap[0])(this, FillRateHelper); + + this._anyBlankStartTime = null; + this._enabled = false; + this._info = new Info(); + this._mostlyBlankStartTime = null; + this._samplesStartTime = null; + this._getFrameMetrics = getFrameMetrics; + this._enabled = (_sampleRate || 0) > Math.random(); + + this._resetData(); + } + + _$$_REQUIRE(_dependencyMap[1])(FillRateHelper, [{ + key: "activate", + value: function activate() { + if (this._enabled && this._samplesStartTime == null) { + DEBUG; + this._samplesStartTime = global.performance.now(); + } + } + }, { + key: "deactivateAndFlush", + value: function deactivateAndFlush() { + if (!this._enabled) { + return; + } + + var start = this._samplesStartTime; + + if (start == null) { + DEBUG; + return; + } + + if (this._info.sample_count < _minSampleCount) { + this._resetData(); + + return; + } + + var total_time_spent = global.performance.now() - start; + + var info = _$$_REQUIRE(_dependencyMap[2])({}, this._info, { + total_time_spent: total_time_spent + }); + + _listeners.forEach(function (listener) { + return listener(info); + }); + + this._resetData(); + } + }, { + key: "computeBlankness", + value: function computeBlankness(props, state, scrollMetrics) { + if (!this._enabled || props.getItemCount(props.data) === 0 || this._samplesStartTime == null) { + return 0; + } + + var dOffset = scrollMetrics.dOffset, + offset = scrollMetrics.offset, + velocity = scrollMetrics.velocity, + visibleLength = scrollMetrics.visibleLength; + this._info.sample_count++; + this._info.pixels_sampled += Math.round(visibleLength); + this._info.pixels_scrolled += Math.round(Math.abs(dOffset)); + var scrollSpeed = Math.round(Math.abs(velocity) * 1000); + var now = global.performance.now(); + + if (this._anyBlankStartTime != null) { + this._info.any_blank_ms += now - this._anyBlankStartTime; + } + + this._anyBlankStartTime = null; + + if (this._mostlyBlankStartTime != null) { + this._info.mostly_blank_ms += now - this._mostlyBlankStartTime; + } + + this._mostlyBlankStartTime = null; + var blankTop = 0; + var first = state.first; + + var firstFrame = this._getFrameMetrics(first); + + while (first <= state.last && (!firstFrame || !firstFrame.inLayout)) { + firstFrame = this._getFrameMetrics(first); + first++; + } + + if (firstFrame && first > 0) { + blankTop = Math.min(visibleLength, Math.max(0, firstFrame.offset - offset)); + } + + var blankBottom = 0; + var last = state.last; + + var lastFrame = this._getFrameMetrics(last); + + while (last >= state.first && (!lastFrame || !lastFrame.inLayout)) { + lastFrame = this._getFrameMetrics(last); + last--; + } + + if (lastFrame && last < props.getItemCount(props.data) - 1) { + var bottomEdge = lastFrame.offset + lastFrame.length; + blankBottom = Math.min(visibleLength, Math.max(0, offset + visibleLength - bottomEdge)); + } + + var pixels_blank = Math.round(blankTop + blankBottom); + var blankness = pixels_blank / visibleLength; + + if (blankness > 0) { + this._anyBlankStartTime = now; + this._info.any_blank_speed_sum += scrollSpeed; + this._info.any_blank_count++; + this._info.pixels_blank += pixels_blank; + + if (blankness > 0.5) { + this._mostlyBlankStartTime = now; + this._info.mostly_blank_count++; + } + } else if (scrollSpeed < 0.01 || Math.abs(dOffset) < 1) { + this.deactivateAndFlush(); + } + + return blankness; + } + }, { + key: "enabled", + value: function enabled() { + return this._enabled; + } + }, { + key: "_resetData", + value: function _resetData() { + this._anyBlankStartTime = null; + this._info = new Info(); + this._mostlyBlankStartTime = null; + this._samplesStartTime = null; + } + }], [{ + key: "addListener", + value: function addListener(callback) { + if (_sampleRate === null) { + console.warn('Call `FillRateHelper.setSampleRate` before `addListener`.'); + } + + _listeners.push(callback); + + return { + remove: function remove() { + _listeners = _listeners.filter(function (listener) { + return callback !== listener; + }); + } + }; + } + }, { + key: "setSampleRate", + value: function setSampleRate(sampleRate) { + _sampleRate = sampleRate; + } + }, { + key: "setMinSampleCount", + value: function setMinSampleCount(minSampleCount) { + _minSampleCount = minSampleCount; + } + }]); + + return FillRateHelper; + }(); + + module.exports = FillRateHelper; +},279,[7,8,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var Batchinator = function () { + function Batchinator(callback, delayMS) { + _$$_REQUIRE(_dependencyMap[0])(this, Batchinator); + + this._delay = delayMS; + this._callback = callback; + } + + _$$_REQUIRE(_dependencyMap[1])(Batchinator, [{ + key: "dispose", + value: function dispose() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + abort: false + }; + + if (this._taskHandle) { + this._taskHandle.cancel(); + + if (!options.abort) { + this._callback(); + } + + this._taskHandle = null; + } + } + }, { + key: "schedule", + value: function schedule() { + var _this = this; + + if (this._taskHandle) { + return; + } + + var timeoutHandle = setTimeout(function () { + _this._taskHandle = _$$_REQUIRE(_dependencyMap[2]).runAfterInteractions(function () { + _this._taskHandle = null; + + _this._callback(); + }); + }, this._delay); + this._taskHandle = { + cancel: function cancel() { + return clearTimeout(timeoutHandle); + } + }; + } + }]); + + return Batchinator; + }(); + + module.exports = Batchinator; +},280,[7,8,230]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + var ViewabilityHelper = function () { + function ViewabilityHelper() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { + viewAreaCoveragePercentThreshold: 0 + }; + + _$$_REQUIRE(_dependencyMap[0])(this, ViewabilityHelper); + + this._hasInteracted = false; + this._timers = new Set(); + this._viewableIndices = []; + this._viewableItems = new Map(); + this._config = config; + } + + _$$_REQUIRE(_dependencyMap[1])(ViewabilityHelper, [{ + key: "dispose", + value: function dispose() { + this._timers.forEach(clearTimeout); + } + }, { + key: "computeViewableItems", + value: function computeViewableItems(itemCount, scrollOffset, viewportHeight, getFrameMetrics, renderRange) { + var _this$_config = this._config, + itemVisiblePercentThreshold = _this$_config.itemVisiblePercentThreshold, + viewAreaCoveragePercentThreshold = _this$_config.viewAreaCoveragePercentThreshold; + var viewAreaMode = viewAreaCoveragePercentThreshold != null; + var viewablePercentThreshold = viewAreaMode ? viewAreaCoveragePercentThreshold : itemVisiblePercentThreshold; + + _$$_REQUIRE(_dependencyMap[2])(viewablePercentThreshold != null && itemVisiblePercentThreshold != null !== (viewAreaCoveragePercentThreshold != null), 'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold'); + + var viewableIndices = []; + + if (itemCount === 0) { + return viewableIndices; + } + + var firstVisible = -1; + + var _ref = renderRange || { + first: 0, + last: itemCount - 1 + }, + first = _ref.first, + last = _ref.last; + + if (last >= itemCount) { + console.warn('Invalid render range computing viewability ' + JSON.stringify({ + renderRange: renderRange, + itemCount: itemCount + })); + return []; + } + + for (var idx = first; idx <= last; idx++) { + var metrics = getFrameMetrics(idx); + + if (!metrics) { + continue; + } + + var top = metrics.offset - scrollOffset; + var bottom = top + metrics.length; + + if (top < viewportHeight && bottom > 0) { + firstVisible = idx; + + if (_isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, metrics.length)) { + viewableIndices.push(idx); + } + } else if (firstVisible >= 0) { + break; + } + } + + return viewableIndices; + } + }, { + key: "onUpdate", + value: function onUpdate(itemCount, scrollOffset, viewportHeight, getFrameMetrics, createViewToken, onViewableItemsChanged, renderRange) { + var _this = this; + + if (this._config.waitForInteraction && !this._hasInteracted || itemCount === 0 || !getFrameMetrics(0)) { + return; + } + + var viewableIndices = []; + + if (itemCount) { + viewableIndices = this.computeViewableItems(itemCount, scrollOffset, viewportHeight, getFrameMetrics, renderRange); + } + + if (this._viewableIndices.length === viewableIndices.length && this._viewableIndices.every(function (v, ii) { + return v === viewableIndices[ii]; + })) { + return; + } + + this._viewableIndices = viewableIndices; + + if (this._config.minimumViewTime) { + var handle = setTimeout(function () { + _this._timers.delete(handle); + + _this._onUpdateSync(viewableIndices, onViewableItemsChanged, createViewToken); + }, this._config.minimumViewTime); + + this._timers.add(handle); + } else { + this._onUpdateSync(viewableIndices, onViewableItemsChanged, createViewToken); + } + } + }, { + key: "resetViewableIndices", + value: function resetViewableIndices() { + this._viewableIndices = []; + } + }, { + key: "recordInteraction", + value: function recordInteraction() { + this._hasInteracted = true; + } + }, { + key: "_onUpdateSync", + value: function _onUpdateSync(viewableIndicesToCheck, onViewableItemsChanged, createViewToken) { + var _this2 = this; + + viewableIndicesToCheck = viewableIndicesToCheck.filter(function (ii) { + return _this2._viewableIndices.includes(ii); + }); + var prevItems = this._viewableItems; + var nextItems = new Map(viewableIndicesToCheck.map(function (ii) { + var viewable = createViewToken(ii, true); + return [viewable.key, viewable]; + })); + var changed = []; + + for (var _iterator = _createForOfIteratorHelperLoose(nextItems), _step; !(_step = _iterator()).done;) { + var _ref2 = _step.value; + + var _ref3 = _$$_REQUIRE(_dependencyMap[3])(_ref2, 2); + + var key = _ref3[0]; + var viewable = _ref3[1]; + + if (!prevItems.has(key)) { + changed.push(viewable); + } + } + + for (var _iterator2 = _createForOfIteratorHelperLoose(prevItems), _step2; !(_step2 = _iterator2()).done;) { + var _ref4 = _step2.value; + + var _ref5 = _$$_REQUIRE(_dependencyMap[3])(_ref4, 2); + + var _key = _ref5[0]; + var _viewable = _ref5[1]; + + if (!nextItems.has(_key)) { + changed.push(_$$_REQUIRE(_dependencyMap[4])({}, _viewable, { + isViewable: false + })); + } + } + + if (changed.length > 0) { + this._viewableItems = nextItems; + onViewableItemsChanged({ + viewableItems: Array.from(nextItems.values()), + changed: changed, + viewabilityConfig: this._config + }); + } + } + }]); + + return ViewabilityHelper; + }(); + + function _isViewable(viewAreaMode, viewablePercentThreshold, top, bottom, viewportHeight, itemLength) { + if (_isEntirelyVisible(top, bottom, viewportHeight)) { + return true; + } else { + var pixels = _getPixelsVisible(top, bottom, viewportHeight); + + var percent = 100 * (viewAreaMode ? pixels / viewportHeight : pixels / itemLength); + return percent >= viewablePercentThreshold; + } + } + + function _getPixelsVisible(top, bottom, viewportHeight) { + var visibleHeight = Math.min(bottom, viewportHeight) - Math.max(top, 0); + return Math.max(0, visibleHeight); + } + + function _isEntirelyVisible(top, bottom, viewportHeight) { + return top >= 0 && bottom <= viewportHeight && bottom > top; + } + + module.exports = ViewabilityHelper; +},281,[7,8,36,41,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.VirtualizedListContextResetter = VirtualizedListContextResetter; + exports.VirtualizedListContextProvider = VirtualizedListContextProvider; + exports.VirtualizedListCellContextProvider = VirtualizedListCellContextProvider; + exports.VirtualizedListContext = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var VirtualizedListContext = React.createContext(null); + exports.VirtualizedListContext = VirtualizedListContext; + + function VirtualizedListContextResetter(_ref) { + var children = _ref.children; + return React.createElement(VirtualizedListContext.Provider, { + value: null + }, children); + } + + function VirtualizedListContextProvider(_ref2) { + var children = _ref2.children, + value = _ref2.value; + var context = (0, React.useMemo)(function () { + return { + cellKey: null, + getScrollMetrics: value.getScrollMetrics, + horizontal: value.horizontal, + getOutermostParentListRef: value.getOutermostParentListRef, + getNestedChildState: value.getNestedChildState, + registerAsNestedChild: value.registerAsNestedChild, + unregisterAsNestedChild: value.unregisterAsNestedChild, + debugInfo: { + cellKey: value.debugInfo.cellKey, + horizontal: value.debugInfo.horizontal, + listKey: value.debugInfo.listKey, + parent: value.debugInfo.parent + } + }; + }, [value.getScrollMetrics, value.horizontal, value.getOutermostParentListRef, value.getNestedChildState, value.registerAsNestedChild, value.unregisterAsNestedChild, value.debugInfo.cellKey, value.debugInfo.horizontal, value.debugInfo.listKey, value.debugInfo.parent]); + return React.createElement(VirtualizedListContext.Provider, { + value: context + }, children); + } + + function VirtualizedListCellContextProvider(_ref3) { + var cellKey = _ref3.cellKey, + children = _ref3.children; + var context = (0, React.useContext)(VirtualizedListContext); + return React.createElement(VirtualizedListContext.Provider, { + value: context == null ? null : (0, _extends2.default)({}, context, { + cellKey: cellKey + }) + }, children); + } +},282,[5,6,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + module.exports = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); +},283,[17,249,284]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _DeprecatedImagePropType = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _ImageInjection = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _ImageAnalyticsTagContext = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _flattenStyle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _resolveAssetSource = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _NativeImageLoaderIOS = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _ImageViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function getSize(uri, success, failure) { + _NativeImageLoaderIOS.default.getSize(uri).then(function (_ref) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), + width = _ref2[0], + height = _ref2[1]; + + return success(width, height); + }).catch(failure || function () { + console.warn('Failed to get size for image ' + uri); + }); + } + + function getSizeWithHeaders(uri, headers, success, failure) { + return _NativeImageLoaderIOS.default.getSizeWithHeaders(uri, headers).then(function (sizes) { + success(sizes.width, sizes.height); + }).catch(failure || function () { + console.warn('Failed to get size for image: ' + uri); + }); + } + + function prefetchWithMetadata(url, queryRootName, rootTag) { + if (_NativeImageLoaderIOS.default.prefetchImageWithMetadata) { + return _NativeImageLoaderIOS.default.prefetchImageWithMetadata(url, queryRootName, rootTag ? rootTag : 0); + } else { + return _NativeImageLoaderIOS.default.prefetchImage(url); + } + } + + function prefetch(url) { + return _NativeImageLoaderIOS.default.prefetchImage(url); + } + + function queryCache(urls) { + return _regenerator.default.async(function queryCache$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(_NativeImageLoaderIOS.default.queryCache(urls)); + + case 2: + return _context.abrupt("return", _context.sent); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + var Image = function Image(props, forwardedRef) { + var source = (0, _resolveAssetSource.default)(props.source) || { + uri: undefined, + width: undefined, + height: undefined + }; + var sources; + var style; + + if (Array.isArray(source)) { + style = (0, _flattenStyle.default)([styles.base, props.style]) || {}; + sources = source; + } else { + var _width = source.width, + _height = source.height, + uri = source.uri; + style = (0, _flattenStyle.default)([{ + width: _width, + height: _height + }, styles.base, props.style]) || {}; + sources = [source]; + + if (uri === '') { + console.warn('source.uri should not be an empty string'); + } + } + + var resizeMode = props.resizeMode || style.resizeMode || 'cover'; + var tintColor = style.tintColor; + + if (props.src != null) { + console.warn('The component requires a `source` property rather than `src`.'); + } + + if (props.children != null) { + throw new Error('The component cannot contain children. If you want to render content on top of the image, consider using the component or absolute positioning.'); + } + + return React.createElement(_ImageAnalyticsTagContext.default.Consumer, null, function (analyticTag) { + return React.createElement(_ImageViewNativeComponent.default, (0, _extends2.default)({}, props, { + ref: forwardedRef, + style: style, + resizeMode: resizeMode, + tintColor: tintColor, + source: sources, + internal_analyticTag: analyticTag + })); + }); + }; + + Image = React.forwardRef(Image); + + if (_ImageInjection.default.unstable_createImageComponent != null) { + Image = _ImageInjection.default.unstable_createImageComponent(Image); + } + + Image.displayName = 'Image'; + Image.getSize = getSize; + Image.getSizeWithHeaders = getSizeWithHeaders; + Image.prefetch = prefetch; + Image.prefetchWithMetadata = prefetchWithMetadata; + Image.queryCache = queryCache; + Image.resolveAssetSource = _resolveAssetSource.default; + Image.propTypes = _DeprecatedImagePropType.default; + + var styles = _StyleSheet.default.create({ + base: { + overflow: 'hidden' + } + }); + + module.exports = Image; +},284,[5,80,6,41,285,17,183,288,291,178,165,292,289]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = { + style: _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])), + source: _$$_REQUIRE(_dependencyMap[2]), + defaultSource: _$$_REQUIRE(_dependencyMap[3]).oneOfType([_$$_REQUIRE(_dependencyMap[3]).shape({ + uri: _$$_REQUIRE(_dependencyMap[3]).string, + width: _$$_REQUIRE(_dependencyMap[3]).number, + height: _$$_REQUIRE(_dependencyMap[3]).number, + scale: _$$_REQUIRE(_dependencyMap[3]).number + }), _$$_REQUIRE(_dependencyMap[3]).number]), + accessible: _$$_REQUIRE(_dependencyMap[3]).bool, + accessibilityLabel: _$$_REQUIRE(_dependencyMap[3]).node, + blurRadius: _$$_REQUIRE(_dependencyMap[3]).number, + capInsets: _$$_REQUIRE(_dependencyMap[4]), + resizeMethod: _$$_REQUIRE(_dependencyMap[3]).oneOf(['auto', 'resize', 'scale']), + resizeMode: _$$_REQUIRE(_dependencyMap[3]).oneOf(['cover', 'contain', 'stretch', 'repeat', 'center']), + testID: _$$_REQUIRE(_dependencyMap[3]).string, + onLayout: _$$_REQUIRE(_dependencyMap[3]).func, + onLoadStart: _$$_REQUIRE(_dependencyMap[3]).func, + onProgress: _$$_REQUIRE(_dependencyMap[3]).func, + onError: _$$_REQUIRE(_dependencyMap[3]).func, + onPartialLoad: _$$_REQUIRE(_dependencyMap[3]).func, + onLoad: _$$_REQUIRE(_dependencyMap[3]).func, + onLoadEnd: _$$_REQUIRE(_dependencyMap[3]).func + }; +},285,[196,286,287,201,208]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ImageStylePropTypes = _$$_REQUIRE(_dependencyMap[0])({}, _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), { + resizeMode: _$$_REQUIRE(_dependencyMap[4]).oneOf(['center', 'contain', 'cover', 'repeat', 'stretch']), + backfaceVisibility: _$$_REQUIRE(_dependencyMap[4]).oneOf(['visible', 'hidden']), + backgroundColor: _$$_REQUIRE(_dependencyMap[5]), + borderColor: _$$_REQUIRE(_dependencyMap[5]), + borderWidth: _$$_REQUIRE(_dependencyMap[4]).number, + borderRadius: _$$_REQUIRE(_dependencyMap[4]).number, + overflow: _$$_REQUIRE(_dependencyMap[4]).oneOf(['visible', 'hidden']), + tintColor: _$$_REQUIRE(_dependencyMap[5]), + opacity: _$$_REQUIRE(_dependencyMap[4]).number, + overlayColor: _$$_REQUIRE(_dependencyMap[4]).string, + borderTopLeftRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderTopRightRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderBottomLeftRadius: _$$_REQUIRE(_dependencyMap[4]).number, + borderBottomRightRadius: _$$_REQUIRE(_dependencyMap[4]).number + }); + + module.exports = ImageStylePropTypes; +},286,[6,200,204,206,201,205]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ImageURISourcePropType = _$$_REQUIRE(_dependencyMap[0]).shape({ + uri: _$$_REQUIRE(_dependencyMap[0]).string, + bundle: _$$_REQUIRE(_dependencyMap[0]).string, + method: _$$_REQUIRE(_dependencyMap[0]).string, + headers: _$$_REQUIRE(_dependencyMap[0]).objectOf(_$$_REQUIRE(_dependencyMap[0]).string), + body: _$$_REQUIRE(_dependencyMap[0]).string, + cache: _$$_REQUIRE(_dependencyMap[0]).oneOf(['default', 'reload', 'force-cache', 'only-if-cached']), + width: _$$_REQUIRE(_dependencyMap[0]).number, + height: _$$_REQUIRE(_dependencyMap[0]).number, + scale: _$$_REQUIRE(_dependencyMap[0]).number + }); + + var ImageSourcePropType = _$$_REQUIRE(_dependencyMap[0]).oneOfType([ImageURISourcePropType, _$$_REQUIRE(_dependencyMap[0]).number, _$$_REQUIRE(_dependencyMap[0]).arrayOf(ImageURISourcePropType)]); + + module.exports = ImageSourcePropType; +},287,[201]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _ImageViewNativeComponent = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _TextInlineImageNativeComponent = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = { + unstable_createImageComponent: null + }; + exports.default = _default; +},288,[17,5,289,290]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ImageViewNativeComponent = NativeComponentRegistry.get('RCTImageView', function () { + return { + uiViewClassName: 'RCTImageView', + bubblingEventTypes: {}, + directEventTypes: { + topLoadStart: { + registrationName: 'onLoadStart' + }, + topProgress: { + registrationName: 'onProgress' + }, + topError: { + registrationName: 'onError' + }, + topPartialLoad: { + registrationName: 'onPartialLoad' + }, + topLoad: { + registrationName: 'onLoad' + }, + topLoadEnd: { + registrationName: 'onLoadEnd' + } + }, + validAttributes: { + blurRadius: true, + capInsets: { + diff: _$$_REQUIRE(_dependencyMap[1]) + }, + defaultSource: { + process: _$$_REQUIRE(_dependencyMap[2]) + }, + defaultSrc: true, + fadeDuration: true, + headers: true, + internal_analyticTag: true, + loadingIndicatorSrc: true, + onError: true, + onLoad: true, + onLoadEnd: true, + onLoadStart: true, + onPartialLoad: true, + onProgress: true, + overlayColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + progressiveRenderingEnabled: true, + resizeMethod: true, + resizeMode: true, + shouldNotifyLoadEvents: true, + source: true, + src: true, + tintColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + } + } + }; + }); + var _default = ImageViewNativeComponent; + exports.default = _default; +},289,[154,149,165,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var TextInlineImage = NativeComponentRegistry.get('RCTTextInlineImage', function () { + return { + uiViewClassName: 'RCTImageView', + bubblingEventTypes: {}, + directEventTypes: { + topLoadStart: { + registrationName: 'onLoadStart' + }, + topProgress: { + registrationName: 'onProgress' + }, + topError: { + registrationName: 'onError' + }, + topPartialLoad: { + registrationName: 'onPartialLoad' + }, + topLoad: { + registrationName: 'onLoad' + }, + topLoadEnd: { + registrationName: 'onLoadEnd' + } + }, + validAttributes: { + blurRadius: true, + capInsets: { + diff: _$$_REQUIRE(_dependencyMap[1]) + }, + defaultSource: { + process: _$$_REQUIRE(_dependencyMap[2]) + }, + defaultSrc: true, + fadeDuration: true, + headers: true, + internal_analyticTag: true, + loadingIndicatorSrc: true, + onError: true, + onLoad: true, + onLoadEnd: true, + onLoadStart: true, + onPartialLoad: true, + onProgress: true, + overlayColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + progressiveRenderingEnabled: true, + resizeMethod: true, + resizeMode: true, + shouldNotifyLoadEvents: true, + source: true, + src: true, + tintColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + } + } + }; + }); + module.exports = TextInlineImage; +},290,[154,149,165,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Context = React.createContext(null); + var _default = Context; + exports.default = _default; +},291,[17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('ImageLoader'); + + exports.default = _default; +},292,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ScrollViewWithEventThrottle = React.forwardRef(function (props, ref) { + return React.createElement(_$$_REQUIRE(_dependencyMap[3]), (0, _extends2.default)({ + scrollEventThrottle: 0.0001 + }, props, { + ref: ref + })); + }); + module.exports = _$$_REQUIRE(_dependencyMap[4])(ScrollViewWithEventThrottle); +},293,[5,6,17,259,249]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _SectionList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var SectionListWithEventThrottle = React.forwardRef(function (props, ref) { + return React.createElement(_SectionList.default, (0, _extends2.default)({ + scrollEventThrottle: 0.0001 + }, props, { + ref: ref + })); + }); + module.exports = _$$_REQUIRE(_dependencyMap[4])(SectionListWithEventThrottle); +},294,[5,6,17,295,249]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _VirtualizedSectionList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SectionList = function (_React$PureComponent) { + (0, _inherits2.default)(SectionList, _React$PureComponent); + + var _super = _createSuper(SectionList); + + function SectionList() { + var _this; + + (0, _classCallCheck2.default)(this, SectionList); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this._captureRef = function (ref) { + _this._wrapperListRef = ref; + }; + + return _this; + } + + (0, _createClass2.default)(SectionList, [{ + key: "scrollToLocation", + value: function scrollToLocation(params) { + if (this._wrapperListRef != null) { + this._wrapperListRef.scrollToLocation(params); + } + } + }, { + key: "recordInteraction", + value: function recordInteraction() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + + listRef && listRef.recordInteraction(); + } + }, { + key: "flashScrollIndicators", + value: function flashScrollIndicators() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + + listRef && listRef.flashScrollIndicators(); + } + }, { + key: "getScrollResponder", + value: function getScrollResponder() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + + if (listRef) { + return listRef.getScrollResponder(); + } + } + }, { + key: "getScrollableNode", + value: function getScrollableNode() { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + + if (listRef) { + return listRef.getScrollableNode(); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + var listRef = this._wrapperListRef && this._wrapperListRef.getListRef(); + + if (listRef) { + listRef.setNativeProps(props); + } + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + _stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled, + restProps = (0, _objectWithoutProperties2.default)(_this$props, ["stickySectionHeadersEnabled"]); + var stickySectionHeadersEnabled = _stickySectionHeadersEnabled != null ? _stickySectionHeadersEnabled : _Platform.default.OS === 'ios'; + return React.createElement(_VirtualizedSectionList.default, (0, _extends2.default)({}, restProps, { + stickySectionHeadersEnabled: stickySectionHeadersEnabled, + ref: this._captureRef, + getItemCount: function getItemCount(items) { + return items.length; + }, + getItem: function getItem(items, index) { + return items[index]; + } + })); + } + }]); + return SectionList; + }(React.PureComponent); + + exports.default = SectionList; +},295,[5,6,108,7,8,12,14,16,37,17,296]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var VirtualizedSectionList = function (_React$PureComponent) { + (0, _inherits2.default)(VirtualizedSectionList, _React$PureComponent); + + var _super = _createSuper(VirtualizedSectionList); + + function VirtualizedSectionList() { + var _this; + + (0, _classCallCheck2.default)(this, VirtualizedSectionList); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this._keyExtractor = function (item, index) { + var info = _this._subExtractor(index); + + return info && info.key || String(index); + }; + + _this._convertViewable = function (viewable) { + var _info$index; + + (0, _invariant.default)(viewable.index != null, 'Received a broken ViewToken'); + + var info = _this._subExtractor(viewable.index); + + if (!info) { + return null; + } + + var keyExtractorWithNullableIndex = info.section.keyExtractor; + + var keyExtractorWithNonNullableIndex = _this.props.keyExtractor || _$$_REQUIRE(_dependencyMap[13]).keyExtractor; + + var key = keyExtractorWithNullableIndex != null ? keyExtractorWithNullableIndex(viewable.item, info.index) : keyExtractorWithNonNullableIndex(viewable.item, (_info$index = info.index) != null ? _info$index : 0); + return (0, _extends2.default)({}, viewable, { + index: info.index, + key: key, + section: info.section + }); + }; + + _this._onViewableItemsChanged = function (_ref) { + var viewableItems = _ref.viewableItems, + changed = _ref.changed; + var onViewableItemsChanged = _this.props.onViewableItemsChanged; + + if (onViewableItemsChanged != null) { + onViewableItemsChanged({ + viewableItems: viewableItems.map(_this._convertViewable, (0, _assertThisInitialized2.default)(_this)).filter(Boolean), + changed: changed.map(_this._convertViewable, (0, _assertThisInitialized2.default)(_this)).filter(Boolean) + }); + } + }; + + _this._renderItem = function (listItemCount) { + return function (_ref2) { + var item = _ref2.item, + index = _ref2.index; + + var info = _this._subExtractor(index); + + if (!info) { + return null; + } + + var infoIndex = info.index; + + if (infoIndex == null) { + var section = info.section; + + if (info.header === true) { + var renderSectionHeader = _this.props.renderSectionHeader; + return renderSectionHeader ? renderSectionHeader({ + section: section + }) : null; + } else { + var renderSectionFooter = _this.props.renderSectionFooter; + return renderSectionFooter ? renderSectionFooter({ + section: section + }) : null; + } + } else { + var renderItem = info.section.renderItem || _this.props.renderItem; + + var SeparatorComponent = _this._getSeparatorComponent(index, info, listItemCount); + + (0, _invariant.default)(renderItem, 'no renderItem!'); + return React.createElement(ItemWithSeparator, { + SeparatorComponent: SeparatorComponent, + LeadingSeparatorComponent: infoIndex === 0 ? _this.props.SectionSeparatorComponent : undefined, + cellKey: info.key, + index: infoIndex, + item: item, + leadingItem: info.leadingItem, + leadingSection: info.leadingSection, + prevCellKey: (_this._subExtractor(index - 1) || {}).key, + setSelfHighlightCallback: _this._setUpdateHighlightFor, + setSelfUpdatePropsCallback: _this._setUpdatePropsFor, + updateHighlightFor: _this._updateHighlightFor, + updatePropsFor: _this._updatePropsFor, + renderItem: renderItem, + section: info.section, + trailingItem: info.trailingItem, + trailingSection: info.trailingSection, + inverted: !!_this.props.inverted + }); + } + }; + }; + + _this._updatePropsFor = function (cellKey, value) { + var updateProps = _this._updatePropsMap[cellKey]; + + if (updateProps != null) { + updateProps(value); + } + }; + + _this._updateHighlightFor = function (cellKey, value) { + var updateHighlight = _this._updateHighlightMap[cellKey]; + + if (updateHighlight != null) { + updateHighlight(value); + } + }; + + _this._setUpdateHighlightFor = function (cellKey, updateHighlightFn) { + if (updateHighlightFn != null) { + _this._updateHighlightMap[cellKey] = updateHighlightFn; + } else { + delete _this._updateHighlightFor[cellKey]; + } + }; + + _this._setUpdatePropsFor = function (cellKey, updatePropsFn) { + if (updatePropsFn != null) { + _this._updatePropsMap[cellKey] = updatePropsFn; + } else { + delete _this._updatePropsMap[cellKey]; + } + }; + + _this._updateHighlightMap = {}; + _this._updatePropsMap = {}; + + _this._captureRef = function (ref) { + _this._listRef = ref; + }; + + return _this; + } + + (0, _createClass2.default)(VirtualizedSectionList, [{ + key: "scrollToLocation", + value: function scrollToLocation(params) { + var index = params.itemIndex; + + for (var i = 0; i < params.sectionIndex; i++) { + index += this.props.getItemCount(this.props.sections[i].data) + 2; + } + + var viewOffset = params.viewOffset || 0; + + if (this._listRef == null) { + return; + } + + if (params.itemIndex > 0 && this.props.stickySectionHeadersEnabled) { + var frame = this._listRef._getFrameMetricsApprox(index - params.itemIndex); + + viewOffset += frame.length; + } + + var toIndexParams = (0, _extends2.default)({}, params, { + viewOffset: viewOffset, + index: index + }); + + this._listRef.scrollToIndex(toIndexParams); + } + }, { + key: "getListRef", + value: function getListRef() { + return this._listRef; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + ItemSeparatorComponent = _this$props.ItemSeparatorComponent, + SectionSeparatorComponent = _this$props.SectionSeparatorComponent, + _renderItem = _this$props.renderItem, + renderSectionFooter = _this$props.renderSectionFooter, + renderSectionHeader = _this$props.renderSectionHeader, + _sections = _this$props.sections, + stickySectionHeadersEnabled = _this$props.stickySectionHeadersEnabled, + passThroughProps = (0, _objectWithoutProperties2.default)(_this$props, ["ItemSeparatorComponent", "SectionSeparatorComponent", "renderItem", "renderSectionFooter", "renderSectionHeader", "sections", "stickySectionHeadersEnabled"]); + var listHeaderOffset = this.props.ListHeaderComponent ? 1 : 0; + var stickyHeaderIndices = this.props.stickySectionHeadersEnabled ? [] : undefined; + var itemCount = 0; + + for (var _iterator = _createForOfIteratorHelperLoose(this.props.sections), _step; !(_step = _iterator()).done;) { + var section = _step.value; + + if (stickyHeaderIndices != null) { + stickyHeaderIndices.push(itemCount + listHeaderOffset); + } + + itemCount += 2; + itemCount += this.props.getItemCount(section.data); + } + + var renderItem = this._renderItem(itemCount); + + return React.createElement(_reactNative.VirtualizedList, (0, _extends2.default)({}, passThroughProps, { + keyExtractor: this._keyExtractor, + stickyHeaderIndices: stickyHeaderIndices, + renderItem: renderItem, + data: this.props.sections, + getItem: function getItem(sections, index) { + return _this2._getItem(_this2.props, sections, index); + }, + getItemCount: function getItemCount() { + return itemCount; + }, + onViewableItemsChanged: this.props.onViewableItemsChanged ? this._onViewableItemsChanged : undefined, + ref: this._captureRef + })); + } + }, { + key: "_getItem", + value: function _getItem(props, sections, index) { + if (!sections) { + return null; + } + + var itemIdx = index - 1; + + for (var i = 0; i < sections.length; i++) { + var section = sections[i]; + var sectionData = section.data; + var itemCount = props.getItemCount(sectionData); + + if (itemIdx === -1 || itemIdx === itemCount) { + return section; + } else if (itemIdx < itemCount) { + return props.getItem(sectionData, itemIdx); + } else { + itemIdx -= itemCount + 2; + } + } + + return null; + } + }, { + key: "_subExtractor", + value: function _subExtractor(index) { + var itemIndex = index; + var _this$props2 = this.props, + getItem = _this$props2.getItem, + getItemCount = _this$props2.getItemCount, + keyExtractor = _this$props2.keyExtractor, + sections = _this$props2.sections; + + for (var i = 0; i < sections.length; i++) { + var section = sections[i]; + var sectionData = section.data; + var key = section.key || String(i); + itemIndex -= 1; + + if (itemIndex >= getItemCount(sectionData) + 1) { + itemIndex -= getItemCount(sectionData) + 1; + } else if (itemIndex === -1) { + return { + section: section, + key: key + ':header', + index: null, + header: true, + trailingSection: sections[i + 1] + }; + } else if (itemIndex === getItemCount(sectionData)) { + return { + section: section, + key: key + ':footer', + index: null, + header: false, + trailingSection: sections[i + 1] + }; + } else { + var extractor = section.keyExtractor || keyExtractor || _$$_REQUIRE(_dependencyMap[13]).keyExtractor; + + return { + section: section, + key: key + ':' + extractor(getItem(sectionData, itemIndex), itemIndex), + index: itemIndex, + leadingItem: getItem(sectionData, itemIndex - 1), + leadingSection: sections[i - 1], + trailingItem: getItem(sectionData, itemIndex + 1), + trailingSection: sections[i + 1] + }; + } + } + } + }, { + key: "_getSeparatorComponent", + value: function _getSeparatorComponent(index, info, listItemCount) { + info = info || this._subExtractor(index); + + if (!info) { + return null; + } + + var ItemSeparatorComponent = info.section.ItemSeparatorComponent || this.props.ItemSeparatorComponent; + var SectionSeparatorComponent = this.props.SectionSeparatorComponent; + var isLastItemInList = index === listItemCount - 1; + var isLastItemInSection = info.index === this.props.getItemCount(info.section.data) - 1; + + if (SectionSeparatorComponent && isLastItemInSection) { + return SectionSeparatorComponent; + } + + if (ItemSeparatorComponent && !isLastItemInSection && !isLastItemInList) { + return ItemSeparatorComponent; + } + + return null; + } + }]); + return VirtualizedSectionList; + }(React.PureComponent); + + function ItemWithSeparator(props) { + var LeadingSeparatorComponent = props.LeadingSeparatorComponent, + SeparatorComponent = props.SeparatorComponent, + cellKey = props.cellKey, + prevCellKey = props.prevCellKey, + setSelfHighlightCallback = props.setSelfHighlightCallback, + updateHighlightFor = props.updateHighlightFor, + setSelfUpdatePropsCallback = props.setSelfUpdatePropsCallback, + updatePropsFor = props.updatePropsFor, + item = props.item, + index = props.index, + section = props.section, + inverted = props.inverted; + + var _React$useState = React.useState(false), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + leadingSeparatorHiglighted = _React$useState2[0], + setLeadingSeparatorHighlighted = _React$useState2[1]; + + var _React$useState3 = React.useState(false), + _React$useState4 = (0, _slicedToArray2.default)(_React$useState3, 2), + separatorHighlighted = _React$useState4[0], + setSeparatorHighlighted = _React$useState4[1]; + + var _React$useState5 = React.useState({ + leadingItem: props.leadingItem, + leadingSection: props.leadingSection, + section: props.section, + trailingItem: props.item, + trailingSection: props.trailingSection + }), + _React$useState6 = (0, _slicedToArray2.default)(_React$useState5, 2), + leadingSeparatorProps = _React$useState6[0], + setLeadingSeparatorProps = _React$useState6[1]; + + var _React$useState7 = React.useState({ + leadingItem: props.item, + leadingSection: props.leadingSection, + section: props.section, + trailingItem: props.trailingItem, + trailingSection: props.trailingSection + }), + _React$useState8 = (0, _slicedToArray2.default)(_React$useState7, 2), + separatorProps = _React$useState8[0], + setSeparatorProps = _React$useState8[1]; + + React.useEffect(function () { + setSelfHighlightCallback(cellKey, setSeparatorHighlighted); + setSelfUpdatePropsCallback(cellKey, setSeparatorProps); + return function () { + setSelfUpdatePropsCallback(cellKey, null); + setSelfHighlightCallback(cellKey, null); + }; + }, [cellKey, setSelfHighlightCallback, setSeparatorProps, setSelfUpdatePropsCallback]); + var separators = { + highlight: function highlight() { + setLeadingSeparatorHighlighted(true); + setSeparatorHighlighted(true); + + if (prevCellKey != null) { + updateHighlightFor(prevCellKey, true); + } + }, + unhighlight: function unhighlight() { + setLeadingSeparatorHighlighted(false); + setSeparatorHighlighted(false); + + if (prevCellKey != null) { + updateHighlightFor(prevCellKey, false); + } + }, + updateProps: function updateProps(select, newProps) { + if (select === 'leading') { + if (LeadingSeparatorComponent != null) { + setLeadingSeparatorProps((0, _extends2.default)({}, leadingSeparatorProps, newProps)); + } else if (prevCellKey != null) { + updatePropsFor(prevCellKey, (0, _extends2.default)({}, leadingSeparatorProps, newProps)); + } + } else if (select === 'trailing' && SeparatorComponent != null) { + setSeparatorProps((0, _extends2.default)({}, separatorProps, newProps)); + } + } + }; + var element = props.renderItem({ + item: item, + index: index, + section: section, + separators: separators + }); + var leadingSeparator = LeadingSeparatorComponent != null && React.createElement(LeadingSeparatorComponent, (0, _extends2.default)({ + highlighted: leadingSeparatorHiglighted + }, leadingSeparatorProps)); + var separator = SeparatorComponent != null && React.createElement(SeparatorComponent, (0, _extends2.default)({ + highlighted: separatorHighlighted + }, separatorProps)); + return leadingSeparator || separator ? React.createElement(_reactNative.View, null, inverted === false ? leadingSeparator : separator, element, inverted === false ? separator : leadingSeparator) : element; + } + + module.exports = VirtualizedSectionList; +},296,[5,41,108,6,7,8,15,12,14,16,36,28,17,257]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + module.exports = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); +},297,[17,249,194]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + module.exports = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); +},298,[17,249,184]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var warnedKeys = {}; + + function warnOnce(key, message) { + if (warnedKeys[key]) { + return; + } + + console.warn(message); + warnedKeys[key] = true; + } + + module.exports = warnOnce; +},299,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _RCTDatePickerNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DatePickerIOS = function (_React$Component) { + (0, _inherits2.default)(DatePickerIOS, _React$Component); + + var _super = _createSuper(DatePickerIOS); + + function DatePickerIOS() { + var _this; + + (0, _classCallCheck2.default)(this, DatePickerIOS); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this._picker = null; + + _this._onChange = function (event) { + var nativeTimeStamp = event.nativeEvent.timestamp; + _this.props.onDateChange && _this.props.onDateChange(new Date(nativeTimeStamp)); + _this.props.onChange && _this.props.onChange(event); + + _this.forceUpdate(); + }; + + return _this; + } + + (0, _createClass2.default)(DatePickerIOS, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + if (this.props.date) { + var propsTimeStamp = this.props.date.getTime(); + + if (this._picker) { + _RCTDatePickerNativeComponent.Commands.setNativeDate(this._picker, propsTimeStamp); + } + } + } + }, { + key: "render", + value: function render() { + var _props$mode, + _this2 = this; + + var props = this.props; + var mode = (_props$mode = props.mode) != null ? _props$mode : 'datetime'; + (0, _invariant.default)(props.date || props.initialDate, 'A selected date or initial date should be specified.'); + return React.createElement(_View.default, { + style: props.style + }, React.createElement(_RCTDatePickerNativeComponent.default, { + testID: props.testID, + ref: function ref(picker) { + _this2._picker = picker; + }, + style: getHeight(props.pickerStyle, mode), + date: props.date ? props.date.getTime() : props.initialDate ? props.initialDate.getTime() : undefined, + locale: props.locale != null && props.locale !== '' ? props.locale : undefined, + maximumDate: props.maximumDate ? props.maximumDate.getTime() : undefined, + minimumDate: props.minimumDate ? props.minimumDate.getTime() : undefined, + mode: mode, + minuteInterval: props.minuteInterval, + timeZoneOffsetInMinutes: props.timeZoneOffsetInMinutes, + onChange: this._onChange, + onStartShouldSetResponder: function onStartShouldSetResponder() { + return true; + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + return false; + }, + pickerStyle: props.pickerStyle + })); + } + }]); + return DatePickerIOS; + }(React.Component); + + var inlineHeightForDatePicker = 318.5; + var inlineHeightForTimePicker = 49.5; + var compactHeight = 40; + var spinnerHeight = 216; + + var styles = _StyleSheet.default.create({ + datePickerIOS: { + height: spinnerHeight + }, + datePickerIOSCompact: { + height: compactHeight + }, + datePickerIOSInline: { + height: 417.5 + }, + datePickerIOSInlineDate: { + height: 368 + }, + datePickerIOSInlineTime: { + height: inlineHeightForTimePicker + } + }); + + function getHeight(pickerStyle, mode) { + if (pickerStyle === 'compact') { + return styles.datePickerIOSCompact; + } + + if (pickerStyle === 'inline') { + switch (mode) { + case 'date': + return styles.datePickerIOSInlineDate; + + case 'time': + return styles.datePickerIOSInlineTime; + + default: + return styles.datePickerIOSInline; + } + } + + return styles.datePickerIOS; + } + + module.exports = DatePickerIOS; +},300,[5,7,8,12,14,16,17,301,183,184,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['setNativeDate'] + }); + exports.Commands = Commands; + + var _default = (0, _codegenNativeComponent.default)('DatePicker', { + paperComponentName: 'RCTDatePicker', + excludedPlatforms: ['android'] + }); + + exports.default = _default; +},301,[5,141,190,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]); +},302,[188]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Image = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _flattenStyle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ImageBackground = function (_React$Component) { + (0, _inherits2.default)(ImageBackground, _React$Component); + + var _super = _createSuper(ImageBackground); + + function ImageBackground() { + var _this; + + (0, _classCallCheck2.default)(this, ImageBackground); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this._viewRef = null; + + _this._captureRef = function (ref) { + _this._viewRef = ref; + }; + + return _this; + } + + (0, _createClass2.default)(ImageBackground, [{ + key: "setNativeProps", + value: function setNativeProps(props) { + var viewRef = this._viewRef; + + if (viewRef) { + viewRef.setNativeProps(props); + } + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + children = _this$props.children, + style = _this$props.style, + imageStyle = _this$props.imageStyle, + imageRef = _this$props.imageRef, + props = (0, _objectWithoutProperties2.default)(_this$props, ["children", "style", "imageStyle", "imageRef"]); + var flattenedStyle = (0, _flattenStyle.default)(style); + return React.createElement(_View.default, { + accessibilityIgnoresInvertColors: true, + style: style, + ref: this._captureRef + }, React.createElement(_Image.default, (0, _extends2.default)({}, props, { + style: [_StyleSheet.default.absoluteFill, { + width: flattenedStyle == null ? undefined : flattenedStyle.width, + height: flattenedStyle == null ? undefined : flattenedStyle.height + }, imageStyle], + ref: imageRef + })), children); + } + }]); + return ImageBackground; + }(React.Component); + + module.exports = ImageBackground; +},303,[5,6,108,7,8,12,14,16,284,17,183,178,184]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _RCTInputAccessoryViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var InputAccessoryView = function (_React$Component) { + (0, _inherits2.default)(InputAccessoryView, _React$Component); + + var _super = _createSuper(InputAccessoryView); + + function InputAccessoryView() { + (0, _classCallCheck2.default)(this, InputAccessoryView); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(InputAccessoryView, [{ + key: "render", + value: function render() { + if (_Platform.default.OS !== 'ios') { + console.warn(' is only supported on iOS.'); + } + + if (React.Children.count(this.props.children) === 0) { + return null; + } + + return React.createElement(_RCTInputAccessoryViewNativeComponent.default, { + style: [this.props.style, styles.container], + nativeID: this.props.nativeID, + backgroundColor: this.props.backgroundColor + }, this.props.children); + } + }]); + return InputAccessoryView; + }(React.Component); + + var styles = _StyleSheet.default.create({ + container: { + position: 'absolute' + } + }); + + module.exports = InputAccessoryView; +},304,[5,7,8,12,14,16,17,37,183,305]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('InputAccessory', { + interfaceOnly: true, + paperComponentName: 'RCTInputAccessoryView', + excludedPlatforms: ['android'] + }); + + exports.default = _default; +},305,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Keyboard = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _LayoutAnimation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var KeyboardAvoidingView = function (_React$Component) { + (0, _inherits2.default)(KeyboardAvoidingView, _React$Component); + + var _super = _createSuper(KeyboardAvoidingView); + + function KeyboardAvoidingView(props) { + var _this; + + (0, _classCallCheck2.default)(this, KeyboardAvoidingView); + _this = _super.call(this, props); + _this._frame = null; + _this._keyboardEvent = null; + _this._subscriptions = []; + _this._initialFrameHeight = 0; + + _this._onKeyboardChange = function (event) { + _this._keyboardEvent = event; + + _this._updateBottomIfNecesarry(); + }; + + _this._onLayout = function (event) { + var wasFrameNull = _this._frame == null; + _this._frame = event.nativeEvent.layout; + + if (!_this._initialFrameHeight) { + _this._initialFrameHeight = _this._frame.height; + } + + if (wasFrameNull) { + _this._updateBottomIfNecesarry(); + } + }; + + _this._updateBottomIfNecesarry = function () { + if (_this._keyboardEvent == null) { + _this.setState({ + bottom: 0 + }); + + return; + } + + var _this$_keyboardEvent = _this._keyboardEvent, + duration = _this$_keyboardEvent.duration, + easing = _this$_keyboardEvent.easing, + endCoordinates = _this$_keyboardEvent.endCoordinates; + + var height = _this._relativeKeyboardHeight(endCoordinates); + + if (_this.state.bottom === height) { + return; + } + + if (duration && easing) { + _LayoutAnimation.default.configureNext({ + duration: duration > 10 ? duration : 10, + update: { + duration: duration > 10 ? duration : 10, + type: _LayoutAnimation.default.Types[easing] || 'keyboard' + } + }); + } + + _this.setState({ + bottom: height + }); + }; + + _this.state = { + bottom: 0 + }; + _this.viewRef = React.createRef(); + return _this; + } + + (0, _createClass2.default)(KeyboardAvoidingView, [{ + key: "_relativeKeyboardHeight", + value: function _relativeKeyboardHeight(keyboardFrame) { + var _this$props$keyboardV; + + var frame = this._frame; + + if (!frame || !keyboardFrame) { + return 0; + } + + var keyboardY = keyboardFrame.screenY - ((_this$props$keyboardV = this.props.keyboardVerticalOffset) != null ? _this$props$keyboardV : 0); + return Math.max(frame.y + frame.height - keyboardY, 0); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + if (_Platform.default.OS === 'ios') { + this._subscriptions = [_Keyboard.default.addListener('keyboardWillChangeFrame', this._onKeyboardChange)]; + } else { + this._subscriptions = [_Keyboard.default.addListener('keyboardDidHide', this._onKeyboardChange), _Keyboard.default.addListener('keyboardDidShow', this._onKeyboardChange)]; + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._subscriptions.forEach(function (subscription) { + subscription.remove(); + }); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + behavior = _this$props.behavior, + children = _this$props.children, + contentContainerStyle = _this$props.contentContainerStyle, + _this$props$enabled = _this$props.enabled, + enabled = _this$props$enabled === undefined ? true : _this$props$enabled, + _this$props$keyboardV2 = _this$props.keyboardVerticalOffset, + keyboardVerticalOffset = _this$props$keyboardV2 === undefined ? 0 : _this$props$keyboardV2, + style = _this$props.style, + props = (0, _objectWithoutProperties2.default)(_this$props, ["behavior", "children", "contentContainerStyle", "enabled", "keyboardVerticalOffset", "style"]); + var bottomHeight = enabled === true ? this.state.bottom : 0; + + switch (behavior) { + case 'height': + var heightStyle; + + if (this._frame != null && this.state.bottom > 0) { + heightStyle = { + height: this._initialFrameHeight - bottomHeight, + flex: 0 + }; + } + + return React.createElement(_View.default, (0, _extends2.default)({ + ref: this.viewRef, + style: _StyleSheet.default.compose(style, heightStyle), + onLayout: this._onLayout + }, props), children); + + case 'position': + return React.createElement(_View.default, (0, _extends2.default)({ + ref: this.viewRef, + style: style, + onLayout: this._onLayout + }, props), React.createElement(_View.default, { + style: _StyleSheet.default.compose(contentContainerStyle, { + bottom: bottomHeight + }) + }, children)); + + case 'padding': + return React.createElement(_View.default, (0, _extends2.default)({ + ref: this.viewRef, + style: _StyleSheet.default.compose(style, { + paddingBottom: bottomHeight + }), + onLayout: this._onLayout + }, props), children); + + default: + return React.createElement(_View.default, (0, _extends2.default)({ + ref: this.viewRef, + onLayout: this._onLayout, + style: style + }, props), children); + } + } + }]); + return KeyboardAvoidingView; + }(React.Component); + + var _default = KeyboardAvoidingView; + exports.default = _default; +},306,[5,6,108,7,8,12,14,16,261,262,37,17,183,184]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _RCTMaskedViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MaskedViewIOS = function (_React$Component) { + (0, _inherits2.default)(MaskedViewIOS, _React$Component); + + var _super = _createSuper(MaskedViewIOS); + + function MaskedViewIOS() { + var _this; + + (0, _classCallCheck2.default)(this, MaskedViewIOS); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this._hasWarnedInvalidRenderMask = false; + return _this; + } + + (0, _createClass2.default)(MaskedViewIOS, [{ + key: "render", + value: function render() { + var _this$props = this.props, + maskElement = _this$props.maskElement, + children = _this$props.children, + otherViewProps = (0, _objectWithoutProperties2.default)(_this$props, ["maskElement", "children"]); + + if (!React.isValidElement(maskElement)) { + if (!this._hasWarnedInvalidRenderMask) { + console.warn("MaskedView: Invalid `maskElement` prop was passed to MaskedView. Expected a React Element. No mask will render."); + this._hasWarnedInvalidRenderMask = true; + } + + return React.createElement(_View.default, otherViewProps, children); + } + + return React.createElement(_RCTMaskedViewNativeComponent.default, otherViewProps, React.createElement(_View.default, { + pointerEvents: "none", + style: _StyleSheet.default.absoluteFill + }, maskElement), children); + } + }]); + return MaskedViewIOS; + }(React.Component); + + module.exports = MaskedViewIOS; +},307,[5,108,7,8,12,14,16,17,183,184,308]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('RCTMaskedView'); + + exports.default = _default; +},308,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _defineProperty2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _ModalInjection = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NativeModalManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _RCTModalHostViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _container, _ModalInjection$unsta; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var React = _$$_REQUIRE(_dependencyMap[11]); + + var ModalEventEmitter = _NativeModalManager.default != null ? new _NativeEventEmitter.default(_NativeModalManager.default) : null; + var uniqueModalIdentifier = 0; + + var Modal = function (_React$Component) { + (0, _inherits2.default)(Modal, _React$Component); + + var _super = _createSuper(Modal); + + function Modal(props) { + var _this; + + (0, _classCallCheck2.default)(this, Modal); + _this = _super.call(this, props); + _this._identifier = uniqueModalIdentifier++; + return _this; + } + + (0, _createClass2.default)(Modal, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + if (ModalEventEmitter) { + this._eventSubscription = ModalEventEmitter.addListener('modalDismissed', function (event) { + if (event.modalID === _this2._identifier && _this2.props.onDismiss) { + _this2.props.onDismiss(); + } + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._eventSubscription) { + this._eventSubscription.remove(); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() {} + }, { + key: "render", + value: function render() { + var _this3 = this; + + if (this.props.visible !== true) { + return null; + } + + var containerStyles = { + backgroundColor: this.props.transparent === true ? 'transparent' : 'white' + }; + var animationType = this.props.animationType || 'none'; + var presentationStyle = this.props.presentationStyle; + + if (!presentationStyle) { + presentationStyle = 'fullScreen'; + + if (this.props.transparent === true) { + presentationStyle = 'overFullScreen'; + } + } + + var innerChildren = this.props.children; + return React.createElement(_RCTModalHostViewNativeComponent.default, { + animationType: animationType, + presentationStyle: presentationStyle, + transparent: this.props.transparent, + hardwareAccelerated: this.props.hardwareAccelerated, + onRequestClose: this.props.onRequestClose, + onShow: this.props.onShow, + onDismiss: function onDismiss() { + if (_this3.props.onDismiss) { + _this3.props.onDismiss(); + } + }, + visible: this.props.visible, + statusBarTranslucent: this.props.statusBarTranslucent, + identifier: this._identifier, + style: styles.modal, + onStartShouldSetResponder: this._shouldSetResponder, + supportedOrientations: this.props.supportedOrientations, + onOrientationChange: this.props.onOrientationChange + }, React.createElement(_$$_REQUIRE(_dependencyMap[12]).VirtualizedListContextResetter, null, React.createElement(_$$_REQUIRE(_dependencyMap[13]).Context.Provider, { + value: null + }, React.createElement(_$$_REQUIRE(_dependencyMap[14]), { + style: [styles.container, containerStyles], + collapsable: false + }, innerChildren)))); + } + }, { + key: "_shouldSetResponder", + value: function _shouldSetResponder() { + return true; + } + }]); + return Modal; + }(React.Component); + + Modal.defaultProps = { + visible: true, + hardwareAccelerated: false + }; + Modal.contextType = _$$_REQUIRE(_dependencyMap[15]).RootTagContext; + var side = _$$_REQUIRE(_dependencyMap[16]).getConstants().isRTL ? 'right' : 'left'; + + var styles = _$$_REQUIRE(_dependencyMap[17]).create({ + modal: { + position: 'absolute' + }, + container: (_container = {}, (0, _defineProperty2.default)(_container, side, 0), (0, _defineProperty2.default)(_container, "top", 0), (0, _defineProperty2.default)(_container, "flex", 1), _container) + }); + + var ExportedModal = (_ModalInjection$unsta = _ModalInjection.default.unstable_Modal) != null ? _ModalInjection$unsta : Modal; + module.exports = ExportedModal; +},309,[5,27,7,8,12,14,16,310,110,311,312,17,282,259,184,313,314,183]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var _default = { + unstable_Modal: null + }; + exports.default = _default; +},310,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('ModalManager'); + + exports.default = _default; +},311,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('ModalHostView', { + interfaceOnly: true, + paperComponentName: 'RCTModalHostView' + }); + + exports.default = _default; +},312,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createRootTag = createRootTag; + exports.RootTagContext = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var RootTagContext = React.createContext(0); + exports.RootTagContext = RootTagContext; + + function createRootTag(rootTag) { + return rootTag; + } +},313,[17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeI18nManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var i18nConstants = getI18nManagerConstants(); + + function getI18nManagerConstants() { + if (_NativeI18nManager.default) { + var _NativeI18nManager$ge = _NativeI18nManager.default.getConstants(), + isRTL = _NativeI18nManager$ge.isRTL, + doLeftAndRightSwapInRTL = _NativeI18nManager$ge.doLeftAndRightSwapInRTL, + localeIdentifier = _NativeI18nManager$ge.localeIdentifier; + + return { + isRTL: isRTL, + doLeftAndRightSwapInRTL: doLeftAndRightSwapInRTL, + localeIdentifier: localeIdentifier + }; + } + + return { + isRTL: false, + doLeftAndRightSwapInRTL: true + }; + } + + module.exports = { + getConstants: function getConstants() { + return i18nConstants; + }, + allowRTL: function allowRTL(shouldAllow) { + if (!_NativeI18nManager.default) { + return; + } + + _NativeI18nManager.default.allowRTL(shouldAllow); + }, + forceRTL: function forceRTL(shouldForce) { + if (!_NativeI18nManager.default) { + return; + } + + _NativeI18nManager.default.forceRTL(shouldForce); + }, + swapLeftAndRightInRTL: function swapLeftAndRightInRTL(flipStyles) { + if (!_NativeI18nManager.default) { + return; + } + + _NativeI18nManager.default.swapLeftAndRightInRTL(flipStyles); + }, + isRTL: i18nConstants.isRTL, + doLeftAndRightSwapInRTL: i18nConstants.doLeftAndRightSwapInRTL + }; +},314,[5,315]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('I18nManager'); + + exports.default = _default; +},315,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _useAndroidRippleForView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _usePressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function Pressable(props, forwardedRef) { + var accessible = props.accessible, + android_disableSound = props.android_disableSound, + android_ripple = props.android_ripple, + cancelable = props.cancelable, + children = props.children, + delayLongPress = props.delayLongPress, + disabled = props.disabled, + focusable = props.focusable, + onLongPress = props.onLongPress, + onPress = props.onPress, + _onPressIn = props.onPressIn, + _onPressOut = props.onPressOut, + pressRetentionOffset = props.pressRetentionOffset, + style = props.style, + testOnly_pressed = props.testOnly_pressed, + unstable_pressDelay = props.unstable_pressDelay, + restProps = (0, _objectWithoutProperties2.default)(props, ["accessible", "android_disableSound", "android_ripple", "cancelable", "children", "delayLongPress", "disabled", "focusable", "onLongPress", "onPress", "onPressIn", "onPressOut", "pressRetentionOffset", "style", "testOnly_pressed", "unstable_pressDelay"]); + var viewRef = (0, React.useRef)(null); + (0, React.useImperativeHandle)(forwardedRef, function () { + return viewRef.current; + }); + var android_rippleConfig = (0, _useAndroidRippleForView.default)(android_ripple, viewRef); + + var _usePressState = usePressState(testOnly_pressed === true), + _usePressState2 = (0, _slicedToArray2.default)(_usePressState, 2), + pressed = _usePressState2[0], + setPressed = _usePressState2[1]; + + var hitSlop = (0, _$$_REQUIRE(_dependencyMap[8]).normalizeRect)(props.hitSlop); + var accessibilityState = disabled != null ? (0, _extends2.default)({}, props.accessibilityState, { + disabled: disabled + }) : props.accessibilityState; + var restPropsWithDefaults = (0, _extends2.default)({}, restProps, android_rippleConfig == null ? undefined : android_rippleConfig.viewProps, { + accessible: accessible !== false, + accessibilityState: accessibilityState, + focusable: focusable !== false, + hitSlop: hitSlop + }); + var config = (0, React.useMemo)(function () { + return { + cancelable: cancelable, + disabled: disabled, + hitSlop: hitSlop, + pressRectOffset: pressRetentionOffset, + android_disableSound: android_disableSound, + delayLongPress: delayLongPress, + delayPressIn: unstable_pressDelay, + onLongPress: onLongPress, + onPress: onPress, + onPressIn: function onPressIn(event) { + if (android_rippleConfig != null) { + android_rippleConfig.onPressIn(event); + } + + setPressed(true); + + if (_onPressIn != null) { + _onPressIn(event); + } + }, + onPressMove: android_rippleConfig == null ? undefined : android_rippleConfig.onPressMove, + onPressOut: function onPressOut(event) { + if (android_rippleConfig != null) { + android_rippleConfig.onPressOut(event); + } + + setPressed(false); + + if (_onPressOut != null) { + _onPressOut(event); + } + } + }; + }, [android_disableSound, android_rippleConfig, cancelable, delayLongPress, disabled, hitSlop, onLongPress, onPress, _onPressIn, _onPressOut, pressRetentionOffset, setPressed, unstable_pressDelay]); + var eventHandlers = (0, _usePressability.default)(config); + return React.createElement(_View.default, (0, _extends2.default)({}, restPropsWithDefaults, eventHandlers, { + ref: viewRef, + style: typeof style === 'function' ? style({ + pressed: pressed + }) : style, + collapsable: false + }), typeof children === 'function' ? children({ + pressed: pressed + }) : children, null); + } + + function usePressState(forcePressed) { + var _useState = (0, React.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + pressed = _useState2[0], + setPressed = _useState2[1]; + + return [pressed || forcePressed, setPressed]; + } + + var MemoedPressable = React.memo(React.forwardRef(Pressable)); + MemoedPressable.displayName = 'Pressable'; + var _default = MemoedPressable; + exports.default = _default; +},316,[5,6,41,108,17,317,210,184,216]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useAndroidRippleForView; + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function useAndroidRippleForView(rippleConfig, viewRef) { + var _ref = rippleConfig != null ? rippleConfig : {}, + color = _ref.color, + borderless = _ref.borderless, + radius = _ref.radius, + foreground = _ref.foreground; + + return (0, React.useMemo)(function () { + if (_reactNative.Platform.OS === 'android' && _reactNative.Platform.Version >= 21 && (color != null || borderless != null || radius != null)) { + var processedColor = (0, _reactNative.processColor)(color); + (0, _invariant.default)(processedColor == null || typeof processedColor === 'number', 'Unexpected color given for Ripple color'); + var nativeRippleValue = { + type: 'RippleAndroid', + color: processedColor, + borderless: borderless === true, + rippleRadius: radius + }; + return { + viewProps: foreground === true ? { + nativeForegroundAndroid: nativeRippleValue + } : { + nativeBackgroundAndroid: nativeRippleValue + }, + onPressIn: function onPressIn(event) { + var view = viewRef.current; + + if (view != null) { + var _event$nativeEvent$lo, _event$nativeEvent$lo2; + + _$$_REQUIRE(_dependencyMap[4]).Commands.hotspotUpdate(view, (_event$nativeEvent$lo = event.nativeEvent.locationX) != null ? _event$nativeEvent$lo : 0, (_event$nativeEvent$lo2 = event.nativeEvent.locationY) != null ? _event$nativeEvent$lo2 : 0); + + _$$_REQUIRE(_dependencyMap[4]).Commands.setPressed(view, true); + } + }, + onPressMove: function onPressMove(event) { + var view = viewRef.current; + + if (view != null) { + var _event$nativeEvent$lo3, _event$nativeEvent$lo4; + + _$$_REQUIRE(_dependencyMap[4]).Commands.hotspotUpdate(view, (_event$nativeEvent$lo3 = event.nativeEvent.locationX) != null ? _event$nativeEvent$lo3 : 0, (_event$nativeEvent$lo4 = event.nativeEvent.locationY) != null ? _event$nativeEvent$lo4 : 0); + } + }, + onPressOut: function onPressOut(event) { + var view = viewRef.current; + + if (view != null) { + _$$_REQUIRE(_dependencyMap[4]).Commands.setPressed(view, false); + } + } + }; + } + + return null; + }, [borderless, color, foreground, radius, viewRef]); + } +},317,[5,36,28,17,185]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _RCTProgressViewNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ProgressViewIOS = function ProgressViewIOS(props, forwardedRef) { + return React.createElement(_RCTProgressViewNativeComponent.default, (0, _extends2.default)({}, props, { + style: [styles.progressView, props.style], + ref: forwardedRef + })); + }; + + var styles = _StyleSheet.default.create({ + progressView: { + height: 2 + } + }); + + var ProgressViewIOSWithRef = React.forwardRef(ProgressViewIOS); + module.exports = ProgressViewIOSWithRef; +},318,[5,6,17,183,319]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('RCTProgressView'); + + exports.default = _default; +},319,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var exported; + + if (_Platform.default.OS === 'android') { + exported = React.forwardRef(function SafeAreaView(props, forwardedRef) { + var emulateUnlessSupported = props.emulateUnlessSupported, + localProps = (0, _objectWithoutProperties2.default)(props, ["emulateUnlessSupported"]); + return React.createElement(_View.default, (0, _extends2.default)({}, localProps, { + ref: forwardedRef + })); + }); + } else { + var RCTSafeAreaViewNativeComponent = _$$_REQUIRE(_dependencyMap[6]).default; + + exported = React.forwardRef(function SafeAreaView(props, forwardedRef) { + return React.createElement(RCTSafeAreaViewNativeComponent, (0, _extends2.default)({ + emulateUnlessSupported: true + }, props, { + ref: forwardedRef + })); + }); + } + + var _default = exported; + exports.default = _default; +},320,[5,6,108,37,17,184,321]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('SafeAreaView', { + paperComponentName: 'RCTSafeAreaView', + interfaceOnly: true + }); + + exports.default = _default; +},321,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _RCTSegmentedControlNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SegmentedControlIOS = function (_React$Component) { + (0, _inherits2.default)(SegmentedControlIOS, _React$Component); + + var _super = _createSuper(SegmentedControlIOS); + + function SegmentedControlIOS() { + var _this; + + (0, _classCallCheck2.default)(this, SegmentedControlIOS); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this._onChange = function (event) { + _this.props.onChange && _this.props.onChange(event); + _this.props.onValueChange && _this.props.onValueChange(event.nativeEvent.value); + }; + + return _this; + } + + (0, _createClass2.default)(SegmentedControlIOS, [{ + key: "render", + value: function render() { + var _this$props = this.props, + enabled = _this$props.enabled, + forwardedRef = _this$props.forwardedRef, + onValueChange = _this$props.onValueChange, + style = _this$props.style, + values = _this$props.values, + props = (0, _objectWithoutProperties2.default)(_this$props, ["enabled", "forwardedRef", "onValueChange", "style", "values"]); + return React.createElement(_RCTSegmentedControlNativeComponent.default, (0, _extends2.default)({}, props, { + ref: forwardedRef, + style: [styles.segmentedControl, style], + enabled: enabled !== false, + values: values != null ? values : [], + onChange: this._onChange + })); + } + }]); + return SegmentedControlIOS; + }(React.Component); + + var styles = _StyleSheet.default.create({ + segmentedControl: { + height: 28 + } + }); + + var SegmentedControlIOSWithRef = React.forwardRef(function (props, forwardedRef) { + return React.createElement(SegmentedControlIOS, (0, _extends2.default)({}, props, { + forwardedRef: forwardedRef + })); + }); + module.exports = SegmentedControlIOSWithRef; +},322,[5,6,108,7,8,12,14,16,17,183,323]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('RCTSegmentedControl'); + + exports.default = _default; +},323,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _SliderNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Slider = function Slider(props, forwardedRef) { + var _props$accessibilityS; + + var style = _StyleSheet.default.compose(styles.slider, props.style); + + var _props$value = props.value, + value = _props$value === undefined ? 0.5 : _props$value, + _props$minimumValue = props.minimumValue, + minimumValue = _props$minimumValue === undefined ? 0 : _props$minimumValue, + _props$maximumValue = props.maximumValue, + maximumValue = _props$maximumValue === undefined ? 1 : _props$maximumValue, + _props$step = props.step, + step = _props$step === undefined ? 0 : _props$step, + onValueChange = props.onValueChange, + onSlidingComplete = props.onSlidingComplete, + localProps = (0, _objectWithoutProperties2.default)(props, ["value", "minimumValue", "maximumValue", "step", "onValueChange", "onSlidingComplete"]); + var onValueChangeEvent = onValueChange ? function (event) { + var userEvent = true; + + if (_Platform.default.OS === 'android') { + userEvent = event.nativeEvent.fromUser != null && event.nativeEvent.fromUser; + } + + userEvent && onValueChange(event.nativeEvent.value); + } : null; + var onChangeEvent = onValueChangeEvent; + var onSlidingCompleteEvent = onSlidingComplete ? function (event) { + onSlidingComplete(event.nativeEvent.value); + } : null; + var disabled = props.disabled === true || ((_props$accessibilityS = props.accessibilityState) == null ? undefined : _props$accessibilityS.disabled) === true; + var accessibilityState = disabled ? (0, _extends2.default)({}, props.accessibilityState, { + disabled: true + }) : props.accessibilityState; + return React.createElement(_SliderNativeComponent.default, (0, _extends2.default)({}, localProps, { + accessibilityState: accessibilityState, + enabled: !disabled, + disabled: disabled, + maximumValue: maximumValue, + minimumValue: minimumValue, + onChange: onChangeEvent, + onResponderTerminationRequest: function onResponderTerminationRequest() { + return false; + }, + onSlidingComplete: onSlidingCompleteEvent, + onStartShouldSetResponder: function onStartShouldSetResponder() { + return true; + }, + onValueChange: onValueChangeEvent, + ref: forwardedRef, + step: step, + style: style, + value: value + })); + }; + + var SliderWithRef = React.forwardRef(Slider); + var styles; + + if (_Platform.default.OS === 'ios') { + styles = _StyleSheet.default.create({ + slider: { + height: 40 + } + }); + } else { + styles = _StyleSheet.default.create({ + slider: {} + }); + } + + module.exports = SliderWithRef; +},324,[5,6,108,17,37,325,183]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('Slider', { + interfaceOnly: true, + paperComponentName: 'RCTSlider' + }); + + exports.default = _default; +},325,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _processColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _NativeStatusBarManagerAndroid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _NativeStatusBarManagerIOS = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NativeStatusBarManag; + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function mergePropsStack(propsStack, defaultValues) { + return propsStack.reduce(function (prev, cur) { + for (var prop in cur) { + if (cur[prop] != null) { + prev[prop] = cur[prop]; + } + } + + return prev; + }, (0, _extends2.default)({}, defaultValues)); + } + + function createStackEntry(props) { + var _props$animated, _props$showHideTransi; + + var animated = (_props$animated = props.animated) != null ? _props$animated : false; + var showHideTransition = (_props$showHideTransi = props.showHideTransition) != null ? _props$showHideTransi : 'fade'; + return { + backgroundColor: props.backgroundColor != null ? { + value: props.backgroundColor, + animated: animated + } : null, + barStyle: props.barStyle != null ? { + value: props.barStyle, + animated: animated + } : null, + translucent: props.translucent, + hidden: props.hidden != null ? { + value: props.hidden, + animated: animated, + transition: showHideTransition + } : null, + networkActivityIndicatorVisible: props.networkActivityIndicatorVisible + }; + } + + var StatusBar = function (_React$Component) { + (0, _inherits2.default)(StatusBar, _React$Component); + + var _super = _createSuper(StatusBar); + + function StatusBar() { + var _this; + + (0, _classCallCheck2.default)(this, StatusBar); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this._stackEntry = null; + return _this; + } + + (0, _createClass2.default)(StatusBar, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._stackEntry = StatusBar.pushStackEntry(this.props); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + StatusBar.popStackEntry(this._stackEntry); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this._stackEntry = StatusBar.replaceStackEntry(this._stackEntry, this.props); + } + }, { + key: "render", + value: function render() { + return null; + } + }], [{ + key: "setHidden", + value: function setHidden(hidden, animation) { + animation = animation || 'none'; + StatusBar._defaultProps.hidden.value = hidden; + + if (_Platform.default.OS === 'ios') { + _NativeStatusBarManagerIOS.default.setHidden(hidden, animation); + } else if (_Platform.default.OS === 'android') { + _NativeStatusBarManagerAndroid.default.setHidden(hidden); + } + } + }, { + key: "setBarStyle", + value: function setBarStyle(style, animated) { + animated = animated || false; + StatusBar._defaultProps.barStyle.value = style; + + if (_Platform.default.OS === 'ios') { + _NativeStatusBarManagerIOS.default.setStyle(style, animated); + } else if (_Platform.default.OS === 'android') { + _NativeStatusBarManagerAndroid.default.setStyle(style); + } + } + }, { + key: "setNetworkActivityIndicatorVisible", + value: function setNetworkActivityIndicatorVisible(visible) { + if (_Platform.default.OS !== 'ios') { + console.warn('`setNetworkActivityIndicatorVisible` is only available on iOS'); + return; + } + + StatusBar._defaultProps.networkActivityIndicatorVisible = visible; + + _NativeStatusBarManagerIOS.default.setNetworkActivityIndicatorVisible(visible); + } + }, { + key: "setBackgroundColor", + value: function setBackgroundColor(color, animated) { + if (_Platform.default.OS !== 'android') { + console.warn('`setBackgroundColor` is only available on Android'); + return; + } + + animated = animated || false; + StatusBar._defaultProps.backgroundColor.value = color; + var processedColor = (0, _processColor.default)(color); + + if (processedColor == null) { + console.warn("`StatusBar.setBackgroundColor`: Color " + color + " parsed to null or undefined"); + return; + } + + (0, _invariant.default)(typeof processedColor === 'number', 'Unexpected color given for StatusBar.setBackgroundColor'); + + _NativeStatusBarManagerAndroid.default.setColor(processedColor, animated); + } + }, { + key: "setTranslucent", + value: function setTranslucent(translucent) { + if (_Platform.default.OS !== 'android') { + console.warn('`setTranslucent` is only available on Android'); + return; + } + + StatusBar._defaultProps.translucent = translucent; + + _NativeStatusBarManagerAndroid.default.setTranslucent(translucent); + } + }, { + key: "pushStackEntry", + value: function pushStackEntry(props) { + var entry = createStackEntry(props); + + StatusBar._propsStack.push(entry); + + StatusBar._updatePropsStack(); + + return entry; + } + }, { + key: "popStackEntry", + value: function popStackEntry(entry) { + var index = StatusBar._propsStack.indexOf(entry); + + if (index !== -1) { + StatusBar._propsStack.splice(index, 1); + } + + StatusBar._updatePropsStack(); + } + }, { + key: "replaceStackEntry", + value: function replaceStackEntry(entry, props) { + var newEntry = createStackEntry(props); + + var index = StatusBar._propsStack.indexOf(entry); + + if (index !== -1) { + StatusBar._propsStack[index] = newEntry; + } + + StatusBar._updatePropsStack(); + + return newEntry; + } + }]); + return StatusBar; + }(React.Component); + + StatusBar._propsStack = []; + StatusBar._defaultProps = createStackEntry({ + backgroundColor: _Platform.default.OS === 'android' ? (_NativeStatusBarManag = _NativeStatusBarManagerAndroid.default.getConstants().DEFAULT_BACKGROUND_COLOR) != null ? _NativeStatusBarManag : 'black' : 'black', + barStyle: 'default', + translucent: false, + hidden: false, + networkActivityIndicatorVisible: false + }); + StatusBar._updateImmediate = null; + StatusBar._currentValues = null; + StatusBar.currentHeight = _Platform.default.OS === 'android' ? _NativeStatusBarManagerAndroid.default.getConstants().HEIGHT : null; + + StatusBar._updatePropsStack = function () { + clearImmediate(StatusBar._updateImmediate); + StatusBar._updateImmediate = setImmediate(function () { + var oldProps = StatusBar._currentValues; + var mergedProps = mergePropsStack(StatusBar._propsStack, StatusBar._defaultProps); + + if (_Platform.default.OS === 'ios') { + if (!oldProps || oldProps.barStyle.value !== mergedProps.barStyle.value) { + _NativeStatusBarManagerIOS.default.setStyle(mergedProps.barStyle.value, mergedProps.barStyle.animated || false); + } + + if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) { + _NativeStatusBarManagerIOS.default.setHidden(mergedProps.hidden.value, mergedProps.hidden.animated ? mergedProps.hidden.transition : 'none'); + } + + if (!oldProps || oldProps.networkActivityIndicatorVisible !== mergedProps.networkActivityIndicatorVisible) { + _NativeStatusBarManagerIOS.default.setNetworkActivityIndicatorVisible(mergedProps.networkActivityIndicatorVisible); + } + } else if (_Platform.default.OS === 'android') { + _NativeStatusBarManagerAndroid.default.setStyle(mergedProps.barStyle.value); + + var processedColor = (0, _processColor.default)(mergedProps.backgroundColor.value); + + if (processedColor == null) { + console.warn("`StatusBar._updatePropsStack`: Color " + mergedProps.backgroundColor.value + " parsed to null or undefined"); + } else { + (0, _invariant.default)(typeof processedColor === 'number', 'Unexpected color given in StatusBar._updatePropsStack'); + + _NativeStatusBarManagerAndroid.default.setColor(processedColor, mergedProps.backgroundColor.animated); + } + + if (!oldProps || oldProps.hidden.value !== mergedProps.hidden.value) { + _NativeStatusBarManagerAndroid.default.setHidden(mergedProps.hidden.value); + } + + if (!oldProps || oldProps.translucent !== mergedProps.translucent) { + _NativeStatusBarManagerAndroid.default.setTranslucent(mergedProps.translucent); + } + } + + StatusBar._currentValues = mergedProps; + }); + }; + + module.exports = StatusBar; +},326,[5,7,8,12,14,16,6,17,37,36,145,327,328]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NativeModule = TurboModuleRegistry.getEnforcing('StatusBarManager'); + var constants = null; + var NativeStatusBarManager = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + + return constants; + }, + setColor: function setColor(color, animated) { + NativeModule.setColor(color, animated); + }, + setTranslucent: function setTranslucent(translucent) { + NativeModule.setTranslucent(translucent); + }, + setStyle: function setStyle(statusBarStyle) { + NativeModule.setStyle(statusBarStyle); + }, + setHidden: function setHidden(hidden) { + NativeModule.setHidden(hidden); + } + }; + var _default = NativeStatusBarManager; + exports.default = _default; +},327,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NativeModule = TurboModuleRegistry.getEnforcing('StatusBarManager'); + var constants = null; + var NativeStatusBarManager = { + getConstants: function getConstants() { + if (constants == null) { + constants = NativeModule.getConstants(); + } + + return constants; + }, + getHeight: function getHeight(callback) { + NativeModule.getHeight(callback); + }, + setNetworkActivityIndicatorVisible: function setNetworkActivityIndicatorVisible(visible) { + NativeModule.setNetworkActivityIndicatorVisible(visible); + }, + addListener: function addListener(eventType) { + NativeModule.addListener(eventType); + }, + removeListeners: function removeListeners(count) { + NativeModule.removeListeners(count); + }, + setStyle: function setStyle(statusBarStyle, animated) { + NativeModule.setStyle(statusBarStyle, animated); + }, + setHidden: function setHidden(hidden, withAnimation) { + NativeModule.setHidden(hidden, withAnimation); + } + }; + var _default = NativeStatusBarManager; + exports.default = _default; +},328,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _useMergeRefs = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _AndroidSwitchNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _SwitchNativeComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var returnsFalse = function returnsFalse() { + return false; + }; + + var returnsTrue = function returnsTrue() { + return true; + }; + + var SwitchWithForwardedRef = React.forwardRef(function Switch(props, forwardedRef) { + var disabled = props.disabled, + ios_backgroundColor = props.ios_backgroundColor, + onChange = props.onChange, + onValueChange = props.onValueChange, + style = props.style, + thumbColor = props.thumbColor, + trackColor = props.trackColor, + value = props.value, + restProps = (0, _objectWithoutProperties2.default)(props, ["disabled", "ios_backgroundColor", "onChange", "onValueChange", "style", "thumbColor", "trackColor", "value"]); + var trackColorForFalse = trackColor == null ? undefined : trackColor.false; + var trackColorForTrue = trackColor == null ? undefined : trackColor.true; + var nativeSwitchRef = React.useRef(null); + var ref = (0, _useMergeRefs.default)(nativeSwitchRef, forwardedRef); + + var _React$useState = React.useState({ + value: null + }), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + native = _React$useState2[0], + setNative = _React$useState2[1]; + + var handleChange = function handleChange(event) { + onChange == null ? undefined : onChange(event); + onValueChange == null ? undefined : onValueChange(event.nativeEvent.value); + setNative({ + value: event.nativeEvent.value + }); + }; + + React.useLayoutEffect(function () { + var _nativeSwitchRef$curr; + + var jsValue = value === true; + var shouldUpdateNativeSwitch = native.value != null && native.value !== jsValue; + + if (shouldUpdateNativeSwitch && ((_nativeSwitchRef$curr = nativeSwitchRef.current) == null ? undefined : _nativeSwitchRef$curr.setNativeProps) != null) { + if (_Platform.default.OS === 'android') { + _AndroidSwitchNativeComponent.Commands.setNativeValue(nativeSwitchRef.current, jsValue); + } else { + _SwitchNativeComponent.Commands.setValue(nativeSwitchRef.current, jsValue); + } + } + }, [value, native]); + + if (_Platform.default.OS === 'android') { + var _props$accessibilityR; + + var platformProps = { + enabled: disabled !== true, + on: value === true, + style: style, + thumbTintColor: thumbColor, + trackColorForFalse: trackColorForFalse, + trackColorForTrue: trackColorForTrue, + trackTintColor: value === true ? trackColorForTrue : trackColorForFalse + }; + return React.createElement(_AndroidSwitchNativeComponent.default, (0, _extends2.default)({}, restProps, platformProps, { + accessibilityRole: (_props$accessibilityR = props.accessibilityRole) != null ? _props$accessibilityR : 'switch', + onChange: handleChange, + onResponderTerminationRequest: returnsFalse, + onStartShouldSetResponder: returnsTrue, + ref: ref + })); + } else { + var _props$accessibilityR2; + + var _platformProps = { + disabled: disabled, + onTintColor: trackColorForTrue, + style: _StyleSheet.default.compose({ + height: 31, + width: 51 + }, _StyleSheet.default.compose(style, ios_backgroundColor == null ? null : { + backgroundColor: ios_backgroundColor, + borderRadius: 16 + })), + thumbTintColor: thumbColor, + tintColor: trackColorForFalse, + value: value === true + }; + return React.createElement(_SwitchNativeComponent.default, (0, _extends2.default)({}, restProps, _platformProps, { + accessibilityRole: (_props$accessibilityR2 = props.accessibilityRole) != null ? _props$accessibilityR2 : 'switch', + onChange: handleChange, + onResponderTerminationRequest: returnsFalse, + onStartShouldSetResponder: returnsTrue, + ref: ref + })); + } + }); + var _default = SwitchWithForwardedRef; + exports.default = _default; +},329,[5,6,41,108,37,17,183,330,331,332]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useMergeRefs; + + var _react = _$$_REQUIRE(_dependencyMap[0]); + + function useMergeRefs() { + for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { + refs[_key] = arguments[_key]; + } + + return (0, _react.useCallback)(function (current) { + for (var _i = 0, _refs = refs; _i < _refs.length; _i++) { + var ref = _refs[_i]; + + if (ref != null) { + if (typeof ref === 'function') { + ref(current); + } else { + ref.current = current; + } + } + } + }, [].concat(refs)); + } +},330,[17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['setNativeValue'] + }); + exports.Commands = Commands; + + var _default = (0, _codegenNativeComponent.default)('AndroidSwitch', { + interfaceOnly: true + }); + + exports.default = _default; +},331,[17,5,141,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['setValue'] + }); + exports.Commands = Commands; + + var _default = (0, _codegenNativeComponent.default)('Switch', { + paperComponentName: 'RCTSwitch', + excludedPlatforms: ['android'] + }); + + exports.default = _default; +},332,[17,5,190,141]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _DeprecatedTextInputPropTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Text = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _TextAncestor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _TextInputState = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _nullthrows = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _setAndForwardRef = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _usePressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var useLayoutEffect = React.useLayoutEffect, + useRef = React.useRef, + useState = React.useState; + var AndroidTextInput; + var AndroidTextInputCommands; + var RCTSinglelineTextInputView; + var RCTSinglelineTextInputNativeCommands; + var RCTMultilineTextInputView; + var RCTMultilineTextInputNativeCommands; + + if (_Platform.default.OS === 'android') { + AndroidTextInput = _$$_REQUIRE(_dependencyMap[15]).default; + AndroidTextInputCommands = _$$_REQUIRE(_dependencyMap[15]).Commands; + } else if (_Platform.default.OS === 'ios') { + RCTSinglelineTextInputView = _$$_REQUIRE(_dependencyMap[16]).default; + RCTSinglelineTextInputNativeCommands = _$$_REQUIRE(_dependencyMap[16]).Commands; + RCTMultilineTextInputView = _$$_REQUIRE(_dependencyMap[17]).default; + RCTMultilineTextInputNativeCommands = _$$_REQUIRE(_dependencyMap[17]).Commands; + } + + var emptyFunctionThatReturnsTrue = function emptyFunctionThatReturnsTrue() { + return true; + }; + + function InternalTextInput(props) { + var _props$selection$end, _props$blurOnSubmit; + + var inputRef = useRef(null); + var selection = props.selection == null ? null : { + start: props.selection.start, + end: (_props$selection$end = props.selection.end) != null ? _props$selection$end : props.selection.start + }; + + var _useState = useState(0), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + mostRecentEventCount = _useState2[0], + setMostRecentEventCount = _useState2[1]; + + var _useState3 = useState(props.value), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + lastNativeText = _useState4[0], + setLastNativeText = _useState4[1]; + + var _useState5 = useState({ + selection: selection, + mostRecentEventCount: mostRecentEventCount + }), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + lastNativeSelectionState = _useState6[0], + setLastNativeSelection = _useState6[1]; + + var lastNativeSelection = lastNativeSelectionState.selection; + var lastNativeSelectionEventCount = lastNativeSelectionState.mostRecentEventCount; + + if (lastNativeSelectionEventCount < mostRecentEventCount) { + selection = null; + } + + var viewCommands; + + if (AndroidTextInputCommands) { + viewCommands = AndroidTextInputCommands; + } else { + viewCommands = props.multiline === true ? RCTMultilineTextInputNativeCommands : RCTSinglelineTextInputNativeCommands; + } + + var text = typeof props.value === 'string' ? props.value : typeof props.defaultValue === 'string' ? props.defaultValue : ''; + useLayoutEffect(function () { + var nativeUpdate = {}; + + if (lastNativeText !== props.value && typeof props.value === 'string') { + nativeUpdate.text = props.value; + setLastNativeText(props.value); + } + + if (selection && lastNativeSelection && (lastNativeSelection.start !== selection.start || lastNativeSelection.end !== selection.end)) { + nativeUpdate.selection = selection; + setLastNativeSelection({ + selection: selection, + mostRecentEventCount: mostRecentEventCount + }); + } + + if (Object.keys(nativeUpdate).length === 0) { + return; + } + + if (inputRef.current != null) { + var _selection$start, _selection, _selection$end, _selection2; + + viewCommands.setTextAndSelection(inputRef.current, mostRecentEventCount, text, (_selection$start = (_selection = selection) == null ? undefined : _selection.start) != null ? _selection$start : -1, (_selection$end = (_selection2 = selection) == null ? undefined : _selection2.end) != null ? _selection$end : -1); + } + }, [mostRecentEventCount, inputRef, props.value, props.defaultValue, lastNativeText, selection, lastNativeSelection, text, viewCommands]); + useLayoutEffect(function () { + var inputRefValue = inputRef.current; + + if (inputRefValue != null) { + _TextInputState.default.registerInput(inputRefValue); + + return function () { + _TextInputState.default.unregisterInput(inputRefValue); + + if (_TextInputState.default.currentlyFocusedInput() === inputRefValue) { + (0, _nullthrows.default)(inputRefValue).blur(); + } + }; + } + }, [inputRef]); + + function clear() { + if (inputRef.current != null) { + viewCommands.setTextAndSelection(inputRef.current, mostRecentEventCount, '', 0, 0); + } + } + + function isFocused() { + return _TextInputState.default.currentlyFocusedInput() === inputRef.current; + } + + function getNativeRef() { + return inputRef.current; + } + + var _setNativeRef = (0, _setAndForwardRef.default)({ + getForwardedRef: function getForwardedRef() { + return props.forwardedRef; + }, + setLocalRef: function setLocalRef(ref) { + inputRef.current = ref; + + if (ref) { + ref.clear = clear; + ref.isFocused = isFocused; + ref.getNativeRef = getNativeRef; + } + } + }); + + var _onChange = function _onChange(event) { + var text = event.nativeEvent.text; + props.onChange && props.onChange(event); + props.onChangeText && props.onChangeText(text); + + if (inputRef.current == null) { + return; + } + + setLastNativeText(text); + setMostRecentEventCount(event.nativeEvent.eventCount); + }; + + var _onSelectionChange = function _onSelectionChange(event) { + props.onSelectionChange && props.onSelectionChange(event); + + if (inputRef.current == null) { + return; + } + + setLastNativeSelection({ + selection: event.nativeEvent.selection, + mostRecentEventCount: mostRecentEventCount + }); + }; + + var _onFocus = function _onFocus(event) { + _TextInputState.default.focusInput(inputRef.current); + + if (props.onFocus) { + props.onFocus(event); + } + }; + + var _onBlur = function _onBlur(event) { + _TextInputState.default.blurInput(inputRef.current); + + if (props.onBlur) { + props.onBlur(event); + } + }; + + var _onScroll = function _onScroll(event) { + props.onScroll && props.onScroll(event); + }; + + var textInput = null; + var blurOnSubmit = (_props$blurOnSubmit = props.blurOnSubmit) != null ? _props$blurOnSubmit : !props.multiline; + var accessible = props.accessible !== false; + var focusable = props.focusable !== false; + var config = React.useMemo(function () { + return { + onPress: function onPress(event) { + if (props.editable !== false) { + if (inputRef.current != null) { + inputRef.current.focus(); + } + } + }, + onPressIn: props.onPressIn, + onPressOut: props.onPressOut, + cancelable: _Platform.default.OS === 'ios' ? !props.rejectResponderTermination : null + }; + }, [props.editable, props.onPressIn, props.onPressOut, props.rejectResponderTermination]); + var caretHidden = props.caretHidden; + + if (_Platform.default.isTesting) { + caretHidden = true; + } + + var _ref = (0, _usePressability.default)(config) || {}, + onBlur = _ref.onBlur, + onFocus = _ref.onFocus, + eventHandlers = (0, _objectWithoutProperties2.default)(_ref, ["onBlur", "onFocus"]); + + if (_Platform.default.OS === 'ios') { + var RCTTextInputView = props.multiline === true ? RCTMultilineTextInputView : RCTSinglelineTextInputView; + var style = props.multiline === true ? [styles.multilineInput, props.style] : props.style; + textInput = React.createElement(RCTTextInputView, (0, _extends2.default)({ + ref: _setNativeRef + }, props, eventHandlers, { + accessible: accessible, + blurOnSubmit: blurOnSubmit, + caretHidden: caretHidden, + dataDetectorTypes: props.dataDetectorTypes, + focusable: focusable, + mostRecentEventCount: mostRecentEventCount, + onBlur: _onBlur, + onChange: _onChange, + onContentSizeChange: props.onContentSizeChange, + onFocus: _onFocus, + onScroll: _onScroll, + onSelectionChange: _onSelectionChange, + onSelectionChangeShouldSetResponder: emptyFunctionThatReturnsTrue, + selection: selection, + style: style, + text: text + })); + } else if (_Platform.default.OS === 'android') { + var _props$placeholder; + + var _style = [props.style]; + var autoCapitalize = props.autoCapitalize || 'sentences'; + var placeholder = (_props$placeholder = props.placeholder) != null ? _props$placeholder : ''; + var children = props.children; + var childCount = React.Children.count(children); + (0, _invariant.default)(!(props.value != null && childCount), 'Cannot specify both value and children.'); + + if (childCount > 1) { + children = React.createElement(_Text.default, null, children); + } + + textInput = React.createElement(AndroidTextInput, (0, _extends2.default)({ + ref: _setNativeRef + }, props, eventHandlers, { + accessible: accessible, + autoCapitalize: autoCapitalize, + blurOnSubmit: blurOnSubmit, + caretHidden: caretHidden, + children: children, + disableFullscreenUI: props.disableFullscreenUI, + focusable: focusable, + mostRecentEventCount: mostRecentEventCount, + onBlur: _onBlur, + onChange: _onChange, + onFocus: _onFocus, + onScroll: _onScroll, + onSelectionChange: _onSelectionChange, + placeholder: placeholder, + selection: selection, + style: _style, + text: text, + textBreakStrategy: props.textBreakStrategy + })); + } + + return React.createElement(_TextAncestor.default.Provider, { + value: true + }, textInput); + } + + var ExportedForwardRef = React.forwardRef(function TextInput(_ref2, forwardedRef) { + var _ref2$allowFontScalin = _ref2.allowFontScaling, + allowFontScaling = _ref2$allowFontScalin === undefined ? true : _ref2$allowFontScalin, + _ref2$rejectResponder = _ref2.rejectResponderTermination, + rejectResponderTermination = _ref2$rejectResponder === undefined ? true : _ref2$rejectResponder, + _ref2$underlineColorA = _ref2.underlineColorAndroid, + underlineColorAndroid = _ref2$underlineColorA === undefined ? 'transparent' : _ref2$underlineColorA, + restProps = (0, _objectWithoutProperties2.default)(_ref2, ["allowFontScaling", "rejectResponderTermination", "underlineColorAndroid"]); + return React.createElement(InternalTextInput, (0, _extends2.default)({ + allowFontScaling: allowFontScaling, + rejectResponderTermination: rejectResponderTermination, + underlineColorAndroid: underlineColorAndroid + }, restProps, { + forwardedRef: forwardedRef + })); + }); + ExportedForwardRef.propTypes = _DeprecatedTextInputPropTypes.default; + ExportedForwardRef.State = { + currentlyFocusedInput: _TextInputState.default.currentlyFocusedInput, + currentlyFocusedField: _TextInputState.default.currentlyFocusedField, + focusTextInput: _TextInputState.default.focusTextInput, + blurTextInput: _TextInputState.default.blurTextInput + }; + + var styles = _StyleSheet.default.create({ + multilineInput: { + paddingTop: 5 + } + }); + + module.exports = ExportedForwardRef; +},333,[5,6,108,41,17,334,37,183,194,186,139,36,337,251,210,338,140,340]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DataDetectorTypes = ['phoneNumber', 'link', 'address', 'calendarEvent', 'none', 'all']; + module.exports = _$$_REQUIRE(_dependencyMap[0])({}, _$$_REQUIRE(_dependencyMap[1]), { + autoCapitalize: _$$_REQUIRE(_dependencyMap[2]).oneOf(['none', 'sentences', 'words', 'characters']), + autoComplete: _$$_REQUIRE(_dependencyMap[2]).oneOf(['cc-csc', 'cc-exp', 'cc-exp-month', 'cc-exp-year', 'cc-number', 'email', 'name', 'password', 'postal-code', 'street-address', 'tel', 'username', 'off']), + autoCorrect: _$$_REQUIRE(_dependencyMap[2]).bool, + spellCheck: _$$_REQUIRE(_dependencyMap[2]).bool, + autoFocus: _$$_REQUIRE(_dependencyMap[2]).bool, + allowFontScaling: _$$_REQUIRE(_dependencyMap[2]).bool, + maxFontSizeMultiplier: _$$_REQUIRE(_dependencyMap[2]).number, + editable: _$$_REQUIRE(_dependencyMap[2]).bool, + keyboardType: _$$_REQUIRE(_dependencyMap[2]).oneOf(['default', 'email-address', 'numeric', 'phone-pad', 'number-pad', 'url', 'ascii-capable', 'numbers-and-punctuation', 'name-phone-pad', 'decimal-pad', 'twitter', 'web-search', 'ascii-capable-number-pad', 'visible-password']), + keyboardAppearance: _$$_REQUIRE(_dependencyMap[2]).oneOf(['default', 'light', 'dark']), + returnKeyType: _$$_REQUIRE(_dependencyMap[2]).oneOf(['done', 'go', 'next', 'search', 'send', 'none', 'previous', 'default', 'emergency-call', 'google', 'join', 'route', 'yahoo']), + returnKeyLabel: _$$_REQUIRE(_dependencyMap[2]).string, + maxLength: _$$_REQUIRE(_dependencyMap[2]).number, + numberOfLines: _$$_REQUIRE(_dependencyMap[2]).number, + disableFullscreenUI: _$$_REQUIRE(_dependencyMap[2]).bool, + enablesReturnKeyAutomatically: _$$_REQUIRE(_dependencyMap[2]).bool, + multiline: _$$_REQUIRE(_dependencyMap[2]).bool, + textBreakStrategy: _$$_REQUIRE(_dependencyMap[2]).oneOf(['simple', 'highQuality', 'balanced']), + onBlur: _$$_REQUIRE(_dependencyMap[2]).func, + onFocus: _$$_REQUIRE(_dependencyMap[2]).func, + onChange: _$$_REQUIRE(_dependencyMap[2]).func, + onChangeText: _$$_REQUIRE(_dependencyMap[2]).func, + onContentSizeChange: _$$_REQUIRE(_dependencyMap[2]).func, + onTextInput: _$$_REQUIRE(_dependencyMap[2]).func, + onEndEditing: _$$_REQUIRE(_dependencyMap[2]).func, + onSelectionChange: _$$_REQUIRE(_dependencyMap[2]).func, + onSubmitEditing: _$$_REQUIRE(_dependencyMap[2]).func, + onKeyPress: _$$_REQUIRE(_dependencyMap[2]).func, + onLayout: _$$_REQUIRE(_dependencyMap[2]).func, + onScroll: _$$_REQUIRE(_dependencyMap[2]).func, + placeholder: _$$_REQUIRE(_dependencyMap[2]).string, + placeholderTextColor: _$$_REQUIRE(_dependencyMap[3]), + scrollEnabled: _$$_REQUIRE(_dependencyMap[2]).bool, + secureTextEntry: _$$_REQUIRE(_dependencyMap[2]).bool, + selectionColor: _$$_REQUIRE(_dependencyMap[3]), + selection: _$$_REQUIRE(_dependencyMap[2]).shape({ + start: _$$_REQUIRE(_dependencyMap[2]).number.isRequired, + end: _$$_REQUIRE(_dependencyMap[2]).number + }), + value: _$$_REQUIRE(_dependencyMap[2]).string, + defaultValue: _$$_REQUIRE(_dependencyMap[2]).string, + clearButtonMode: _$$_REQUIRE(_dependencyMap[2]).oneOf(['never', 'while-editing', 'unless-editing', 'always']), + clearTextOnFocus: _$$_REQUIRE(_dependencyMap[2]).bool, + selectTextOnFocus: _$$_REQUIRE(_dependencyMap[2]).bool, + blurOnSubmit: _$$_REQUIRE(_dependencyMap[2]).bool, + style: _$$_REQUIRE(_dependencyMap[4]).style, + underlineColorAndroid: _$$_REQUIRE(_dependencyMap[3]), + inlineImageLeft: _$$_REQUIRE(_dependencyMap[2]).string, + inlineImagePadding: _$$_REQUIRE(_dependencyMap[2]).number, + rejectResponderTermination: _$$_REQUIRE(_dependencyMap[2]).bool, + dataDetectorTypes: _$$_REQUIRE(_dependencyMap[2]).oneOfType([_$$_REQUIRE(_dependencyMap[2]).oneOf(DataDetectorTypes), _$$_REQUIRE(_dependencyMap[2]).arrayOf(_$$_REQUIRE(_dependencyMap[2]).oneOf(DataDetectorTypes))]), + caretHidden: _$$_REQUIRE(_dependencyMap[2]).bool, + contextMenuHidden: _$$_REQUIRE(_dependencyMap[2]).bool, + inputAccessoryViewID: _$$_REQUIRE(_dependencyMap[2]).string, + textContentType: _$$_REQUIRE(_dependencyMap[2]).oneOf(['none', 'URL', 'addressCity', 'addressCityAndState', 'addressState', 'countryName', 'creditCardNumber', 'emailAddress', 'familyName', 'fullStreetAddress', 'givenName', 'jobTitle', 'location', 'middleName', 'name', 'namePrefix', 'nameSuffix', 'nickname', 'organizationName', 'postalCode', 'streetAddressLine1', 'streetAddressLine2', 'sublocality', 'telephoneNumber', 'username', 'password', 'newPassword', 'oneTimeCode']), + showSoftInputOnFocus: _$$_REQUIRE(_dependencyMap[2]).bool + }); +},334,[6,335,201,205,195]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var stylePropType = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + module.exports = { + accessible: _$$_REQUIRE(_dependencyMap[2]).bool, + accessibilityLabel: _$$_REQUIRE(_dependencyMap[2]).node, + accessibilityHint: _$$_REQUIRE(_dependencyMap[2]).string, + accessibilityActions: _$$_REQUIRE(_dependencyMap[2]).arrayOf(_$$_REQUIRE(_dependencyMap[2]).string), + accessibilityIgnoresInvertColors: _$$_REQUIRE(_dependencyMap[2]).bool, + accessibilityRole: _$$_REQUIRE(_dependencyMap[2]).oneOf(_$$_REQUIRE(_dependencyMap[3]).DeprecatedAccessibilityRoles), + accessibilityState: _$$_REQUIRE(_dependencyMap[2]).object, + accessibilityValue: _$$_REQUIRE(_dependencyMap[2]).object, + accessibilityLiveRegion: _$$_REQUIRE(_dependencyMap[2]).oneOf(['none', 'polite', 'assertive']), + importantForAccessibility: _$$_REQUIRE(_dependencyMap[2]).oneOf(['auto', 'yes', 'no', 'no-hide-descendants']), + accessibilityViewIsModal: _$$_REQUIRE(_dependencyMap[2]).bool, + accessibilityElementsHidden: _$$_REQUIRE(_dependencyMap[2]).bool, + onAccessibilityAction: _$$_REQUIRE(_dependencyMap[2]).func, + onAccessibilityTap: _$$_REQUIRE(_dependencyMap[2]).func, + onMagicTap: _$$_REQUIRE(_dependencyMap[2]).func, + testID: _$$_REQUIRE(_dependencyMap[2]).string, + nativeID: _$$_REQUIRE(_dependencyMap[2]).string, + onResponderGrant: _$$_REQUIRE(_dependencyMap[2]).func, + onResponderMove: _$$_REQUIRE(_dependencyMap[2]).func, + onResponderReject: _$$_REQUIRE(_dependencyMap[2]).func, + onResponderRelease: _$$_REQUIRE(_dependencyMap[2]).func, + onResponderTerminate: _$$_REQUIRE(_dependencyMap[2]).func, + onResponderTerminationRequest: _$$_REQUIRE(_dependencyMap[2]).func, + onStartShouldSetResponder: _$$_REQUIRE(_dependencyMap[2]).func, + onStartShouldSetResponderCapture: _$$_REQUIRE(_dependencyMap[2]).func, + onMoveShouldSetResponder: _$$_REQUIRE(_dependencyMap[2]).func, + onMoveShouldSetResponderCapture: _$$_REQUIRE(_dependencyMap[2]).func, + hitSlop: _$$_REQUIRE(_dependencyMap[4]), + onLayout: _$$_REQUIRE(_dependencyMap[2]).func, + pointerEvents: _$$_REQUIRE(_dependencyMap[2]).oneOf(['box-none', 'none', 'box-only', 'auto']), + style: stylePropType, + removeClippedSubviews: _$$_REQUIRE(_dependencyMap[2]).bool, + renderToHardwareTextureAndroid: _$$_REQUIRE(_dependencyMap[2]).bool, + shouldRasterizeIOS: _$$_REQUIRE(_dependencyMap[2]).bool, + collapsable: _$$_REQUIRE(_dependencyMap[2]).bool, + needsOffscreenAlphaCompositing: _$$_REQUIRE(_dependencyMap[2]).bool + }; +},335,[196,199,201,336,208]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = { + DeprecatedAccessibilityRoles: ['none', 'button', 'togglebutton', 'link', 'search', 'image', 'keyboardkey', 'text', 'adjustable', 'imagebutton', 'header', 'summary', 'alert', 'checkbox', 'combobox', 'menu', 'menubar', 'menuitem', 'progressbar', 'radio', 'radiogroup', 'scrollbar', 'spinbutton', 'switch', 'tab', 'tablist', 'timer', 'list', 'toolbar'] + }; +},336,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function nullthrows(x, message) { + if (x != null) { + return x; + } + + var error = new Error(message !== undefined ? message : 'Got unexpected ' + x); + error.framesToPop = 1; + throw error; + } + + module.exports = nullthrows; + module.exports.default = nullthrows; + Object.defineProperty(module.exports, '__esModule', { + value: true + }); +},337,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _AndroidTextInputViewConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['focus', 'blur', 'setTextAndSelection'] + }); + exports.Commands = Commands; + var AndroidTextInputNativeComponent = NativeComponentRegistry.get('AndroidTextInput', function () { + return _AndroidTextInputViewConfig.default; + }); + var _default = AndroidTextInputNativeComponent; + exports.default = _default; +},338,[5,141,339,154]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReactNativeViewViewConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var AndroidTextInputViewConfig = { + uiViewClassName: 'AndroidTextInput', + bubblingEventTypes: { + topBlur: { + phasedRegistrationNames: { + bubbled: 'onBlur', + captured: 'onBlurCapture' + } + }, + topEndEditing: { + phasedRegistrationNames: { + bubbled: 'onEndEditing', + captured: 'onEndEditingCapture' + } + }, + topFocus: { + phasedRegistrationNames: { + bubbled: 'onFocus', + captured: 'onFocusCapture' + } + }, + topKeyPress: { + phasedRegistrationNames: { + bubbled: 'onKeyPress', + captured: 'onKeyPressCapture' + } + }, + topSubmitEditing: { + phasedRegistrationNames: { + bubbled: 'onSubmitEditing', + captured: 'onSubmitEditingCapture' + } + }, + topTextInput: { + phasedRegistrationNames: { + bubbled: 'onTextInput', + captured: 'onTextInputCapture' + } + } + }, + directEventTypes: {}, + validAttributes: (0, _extends2.default)({}, _ReactNativeViewViewConfig.default.validAttributes, { + maxFontSizeMultiplier: true, + adjustsFontSizeToFit: true, + minimumFontScale: true, + autoFocus: true, + placeholder: true, + inlineImagePadding: true, + contextMenuHidden: true, + textShadowColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + maxLength: true, + selectTextOnFocus: true, + textShadowRadius: true, + underlineColorAndroid: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + textDecorationLine: true, + blurOnSubmit: true, + textAlignVertical: true, + fontStyle: true, + textShadowOffset: true, + selectionColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + selection: true, + placeholderTextColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + importantForAutofill: true, + lineHeight: true, + textTransform: true, + returnKeyType: true, + keyboardType: true, + multiline: true, + color: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + autoCompleteType: true, + autoComplete: true, + numberOfLines: true, + letterSpacing: true, + returnKeyLabel: true, + fontSize: true, + onKeyPress: true, + cursorColor: { + process: _$$_REQUIRE(_dependencyMap[3]) + }, + text: true, + showSoftInputOnFocus: true, + textAlign: true, + autoCapitalize: true, + autoCorrect: true, + caretHidden: true, + secureTextEntry: true, + textBreakStrategy: true, + onScroll: true, + onContentSizeChange: true, + disableFullscreenUI: true, + includeFontPadding: true, + fontWeight: true, + fontFamily: true, + allowFontScaling: true, + onSelectionChange: true, + mostRecentEventCount: true, + inlineImageLeft: true, + editable: true, + fontVariant: true + }) + }; + module.exports = AndroidTextInputViewConfig; +},339,[5,6,143,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Commands = undefined; + + var _codegenNativeCommands = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _RCTTextInputViewConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var NativeComponentRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Commands = (0, _codegenNativeCommands.default)({ + supportedCommands: ['focus', 'blur', 'setTextAndSelection'] + }); + exports.Commands = Commands; + var MultilineTextInputNativeComponent = NativeComponentRegistry.get('RCTMultilineTextInputView', function () { + return _RCTTextInputViewConfig.default; + }); + var _default = MultilineTextInputNativeComponent; + exports.default = _default; +},340,[5,141,142,154]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _BoundingDimensions = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Position = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _UIManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _SoundManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var extractSingleTouch = function extractSingleTouch(nativeEvent) { + var touches = nativeEvent.touches; + var changedTouches = nativeEvent.changedTouches; + var hasTouches = touches && touches.length > 0; + var hasChangedTouches = changedTouches && changedTouches.length > 0; + return !hasTouches && hasChangedTouches ? changedTouches[0] : hasTouches ? touches[0] : nativeEvent; + }; + + var States = { + NOT_RESPONDER: 'NOT_RESPONDER', + RESPONDER_INACTIVE_PRESS_IN: 'RESPONDER_INACTIVE_PRESS_IN', + RESPONDER_INACTIVE_PRESS_OUT: 'RESPONDER_INACTIVE_PRESS_OUT', + RESPONDER_ACTIVE_PRESS_IN: 'RESPONDER_ACTIVE_PRESS_IN', + RESPONDER_ACTIVE_PRESS_OUT: 'RESPONDER_ACTIVE_PRESS_OUT', + RESPONDER_ACTIVE_LONG_PRESS_IN: 'RESPONDER_ACTIVE_LONG_PRESS_IN', + RESPONDER_ACTIVE_LONG_PRESS_OUT: 'RESPONDER_ACTIVE_LONG_PRESS_OUT', + ERROR: 'ERROR' + }; + var baseStatesConditions = { + NOT_RESPONDER: false, + RESPONDER_INACTIVE_PRESS_IN: false, + RESPONDER_INACTIVE_PRESS_OUT: false, + RESPONDER_ACTIVE_PRESS_IN: false, + RESPONDER_ACTIVE_PRESS_OUT: false, + RESPONDER_ACTIVE_LONG_PRESS_IN: false, + RESPONDER_ACTIVE_LONG_PRESS_OUT: false, + ERROR: false + }; + var IsActive = (0, _extends2.default)({}, baseStatesConditions, { + RESPONDER_ACTIVE_PRESS_OUT: true, + RESPONDER_ACTIVE_PRESS_IN: true + }); + var IsPressingIn = (0, _extends2.default)({}, baseStatesConditions, { + RESPONDER_INACTIVE_PRESS_IN: true, + RESPONDER_ACTIVE_PRESS_IN: true, + RESPONDER_ACTIVE_LONG_PRESS_IN: true + }); + var IsLongPressingIn = (0, _extends2.default)({}, baseStatesConditions, { + RESPONDER_ACTIVE_LONG_PRESS_IN: true + }); + var Signals = { + DELAY: 'DELAY', + RESPONDER_GRANT: 'RESPONDER_GRANT', + RESPONDER_RELEASE: 'RESPONDER_RELEASE', + RESPONDER_TERMINATED: 'RESPONDER_TERMINATED', + ENTER_PRESS_RECT: 'ENTER_PRESS_RECT', + LEAVE_PRESS_RECT: 'LEAVE_PRESS_RECT', + LONG_PRESS_DETECTED: 'LONG_PRESS_DETECTED' + }; + var Transitions = { + NOT_RESPONDER: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, + RESPONDER_RELEASE: States.ERROR, + RESPONDER_TERMINATED: States.ERROR, + ENTER_PRESS_RECT: States.ERROR, + LEAVE_PRESS_RECT: States.ERROR, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_INACTIVE_PRESS_IN: { + DELAY: States.RESPONDER_ACTIVE_PRESS_IN, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_INACTIVE_PRESS_OUT: { + DELAY: States.RESPONDER_ACTIVE_PRESS_OUT, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_INACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_ACTIVE_PRESS_IN: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN + }, + RESPONDER_ACTIVE_PRESS_OUT: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + RESPONDER_ACTIVE_LONG_PRESS_IN: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, + LONG_PRESS_DETECTED: States.RESPONDER_ACTIVE_LONG_PRESS_IN + }, + RESPONDER_ACTIVE_LONG_PRESS_OUT: { + DELAY: States.ERROR, + RESPONDER_GRANT: States.ERROR, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_IN, + LEAVE_PRESS_RECT: States.RESPONDER_ACTIVE_LONG_PRESS_OUT, + LONG_PRESS_DETECTED: States.ERROR + }, + error: { + DELAY: States.NOT_RESPONDER, + RESPONDER_GRANT: States.RESPONDER_INACTIVE_PRESS_IN, + RESPONDER_RELEASE: States.NOT_RESPONDER, + RESPONDER_TERMINATED: States.NOT_RESPONDER, + ENTER_PRESS_RECT: States.NOT_RESPONDER, + LEAVE_PRESS_RECT: States.NOT_RESPONDER, + LONG_PRESS_DETECTED: States.NOT_RESPONDER + } + }; + var HIGHLIGHT_DELAY_MS = 130; + var PRESS_EXPAND_PX = 20; + var LONG_PRESS_THRESHOLD = 500; + var LONG_PRESS_DELAY_MS = 370; + var LONG_PRESS_ALLOWED_MOVEMENT = 10; + var TouchableMixin = { + componentDidMount: function componentDidMount() { + if (!_Platform.default.isTV) { + return; + } + }, + componentWillUnmount: function componentWillUnmount() { + this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); + this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); + this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); + }, + touchableGetInitialState: function touchableGetInitialState() { + return { + touchable: { + touchState: undefined, + responderID: null + } + }; + }, + touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest() { + return !this.props.rejectResponderTermination; + }, + touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder() { + return !this.props.disabled; + }, + touchableLongPressCancelsPress: function touchableLongPressCancelsPress() { + return true; + }, + touchableHandleResponderGrant: function touchableHandleResponderGrant(e) { + var dispatchID = e.currentTarget; + e.persist(); + this.pressOutDelayTimeout && clearTimeout(this.pressOutDelayTimeout); + this.pressOutDelayTimeout = null; + this.state.touchable.touchState = States.NOT_RESPONDER; + this.state.touchable.responderID = dispatchID; + + this._receiveSignal(Signals.RESPONDER_GRANT, e); + + var delayMS = this.touchableGetHighlightDelayMS !== undefined ? Math.max(this.touchableGetHighlightDelayMS(), 0) : HIGHLIGHT_DELAY_MS; + delayMS = isNaN(delayMS) ? HIGHLIGHT_DELAY_MS : delayMS; + + if (delayMS !== 0) { + this.touchableDelayTimeout = setTimeout(this._handleDelay.bind(this, e), delayMS); + } else { + this._handleDelay(e); + } + + var longDelayMS = this.touchableGetLongPressDelayMS !== undefined ? Math.max(this.touchableGetLongPressDelayMS(), 10) : LONG_PRESS_DELAY_MS; + longDelayMS = isNaN(longDelayMS) ? LONG_PRESS_DELAY_MS : longDelayMS; + this.longPressDelayTimeout = setTimeout(this._handleLongDelay.bind(this, e), longDelayMS + delayMS); + }, + touchableHandleResponderRelease: function touchableHandleResponderRelease(e) { + this.pressInLocation = null; + + this._receiveSignal(Signals.RESPONDER_RELEASE, e); + }, + touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) { + this.pressInLocation = null; + + this._receiveSignal(Signals.RESPONDER_TERMINATED, e); + }, + touchableHandleResponderMove: function touchableHandleResponderMove(e) { + if (!this.state.touchable.positionOnActivate) { + return; + } + + var positionOnActivate = this.state.touchable.positionOnActivate; + var dimensionsOnActivate = this.state.touchable.dimensionsOnActivate; + var pressRectOffset = this.touchableGetPressRectOffset ? this.touchableGetPressRectOffset() : { + left: PRESS_EXPAND_PX, + right: PRESS_EXPAND_PX, + top: PRESS_EXPAND_PX, + bottom: PRESS_EXPAND_PX + }; + var pressExpandLeft = pressRectOffset.left; + var pressExpandTop = pressRectOffset.top; + var pressExpandRight = pressRectOffset.right; + var pressExpandBottom = pressRectOffset.bottom; + var hitSlop = this.touchableGetHitSlop ? this.touchableGetHitSlop() : null; + + if (hitSlop) { + pressExpandLeft += hitSlop.left || 0; + pressExpandTop += hitSlop.top || 0; + pressExpandRight += hitSlop.right || 0; + pressExpandBottom += hitSlop.bottom || 0; + } + + var touch = extractSingleTouch(e.nativeEvent); + var pageX = touch && touch.pageX; + var pageY = touch && touch.pageY; + + if (this.pressInLocation) { + var movedDistance = this._getDistanceBetweenPoints(pageX, pageY, this.pressInLocation.pageX, this.pressInLocation.pageY); + + if (movedDistance > LONG_PRESS_ALLOWED_MOVEMENT) { + this._cancelLongPressDelayTimeout(); + } + } + + var isTouchWithinActive = pageX > positionOnActivate.left - pressExpandLeft && pageY > positionOnActivate.top - pressExpandTop && pageX < positionOnActivate.left + dimensionsOnActivate.width + pressExpandRight && pageY < positionOnActivate.top + dimensionsOnActivate.height + pressExpandBottom; + + if (isTouchWithinActive) { + var prevState = this.state.touchable.touchState; + + this._receiveSignal(Signals.ENTER_PRESS_RECT, e); + + var curState = this.state.touchable.touchState; + + if (curState === States.RESPONDER_INACTIVE_PRESS_IN && prevState !== States.RESPONDER_INACTIVE_PRESS_IN) { + this._cancelLongPressDelayTimeout(); + } + } else { + this._cancelLongPressDelayTimeout(); + + this._receiveSignal(Signals.LEAVE_PRESS_RECT, e); + } + }, + touchableHandleFocus: function touchableHandleFocus(e) { + this.props.onFocus && this.props.onFocus(e); + }, + touchableHandleBlur: function touchableHandleBlur(e) { + this.props.onBlur && this.props.onBlur(e); + }, + _remeasureMetricsOnActivation: function _remeasureMetricsOnActivation() { + var responderID = this.state.touchable.responderID; + + if (responderID == null) { + return; + } + + if (typeof responderID === 'number') { + _UIManager.default.measure(responderID, this._handleQueryLayout); + } else { + responderID.measure(this._handleQueryLayout); + } + }, + _handleQueryLayout: function _handleQueryLayout(l, t, w, h, globalX, globalY) { + if (!l && !t && !w && !h && !globalX && !globalY) { + return; + } + + this.state.touchable.positionOnActivate && _Position.default.release(this.state.touchable.positionOnActivate); + this.state.touchable.dimensionsOnActivate && _BoundingDimensions.default.release(this.state.touchable.dimensionsOnActivate); + this.state.touchable.positionOnActivate = _Position.default.getPooled(globalX, globalY); + this.state.touchable.dimensionsOnActivate = _BoundingDimensions.default.getPooled(w, h); + }, + _handleDelay: function _handleDelay(e) { + this.touchableDelayTimeout = null; + + this._receiveSignal(Signals.DELAY, e); + }, + _handleLongDelay: function _handleLongDelay(e) { + this.longPressDelayTimeout = null; + var curState = this.state.touchable.touchState; + + if (curState === States.RESPONDER_ACTIVE_PRESS_IN || curState === States.RESPONDER_ACTIVE_LONG_PRESS_IN) { + this._receiveSignal(Signals.LONG_PRESS_DETECTED, e); + } + }, + _receiveSignal: function _receiveSignal(signal, e) { + var responderID = this.state.touchable.responderID; + var curState = this.state.touchable.touchState; + var nextState = Transitions[curState] && Transitions[curState][signal]; + + if (!responderID && signal === Signals.RESPONDER_RELEASE) { + return; + } + + if (!nextState) { + throw new Error('Unrecognized signal `' + signal + '` or state `' + curState + '` for Touchable responder `' + typeof this.state.touchable.responderID === 'number' ? this.state.touchable.responderID : "host component`"); + } + + if (nextState === States.ERROR) { + throw new Error('Touchable cannot transition from `' + curState + '` to `' + signal + '` for responder `' + typeof this.state.touchable.responderID === 'number' ? this.state.touchable.responderID : "<>`"); + } + + if (curState !== nextState) { + this._performSideEffectsForTransition(curState, nextState, signal, e); + + this.state.touchable.touchState = nextState; + } + }, + _cancelLongPressDelayTimeout: function _cancelLongPressDelayTimeout() { + this.longPressDelayTimeout && clearTimeout(this.longPressDelayTimeout); + this.longPressDelayTimeout = null; + }, + _isHighlight: function _isHighlight(state) { + return state === States.RESPONDER_ACTIVE_PRESS_IN || state === States.RESPONDER_ACTIVE_LONG_PRESS_IN; + }, + _savePressInLocation: function _savePressInLocation(e) { + var touch = extractSingleTouch(e.nativeEvent); + var pageX = touch && touch.pageX; + var pageY = touch && touch.pageY; + var locationX = touch && touch.locationX; + var locationY = touch && touch.locationY; + this.pressInLocation = { + pageX: pageX, + pageY: pageY, + locationX: locationX, + locationY: locationY + }; + }, + _getDistanceBetweenPoints: function _getDistanceBetweenPoints(aX, aY, bX, bY) { + var deltaX = aX - bX; + var deltaY = aY - bY; + return Math.sqrt(deltaX * deltaX + deltaY * deltaY); + }, + _performSideEffectsForTransition: function _performSideEffectsForTransition(curState, nextState, signal, e) { + var curIsHighlight = this._isHighlight(curState); + + var newIsHighlight = this._isHighlight(nextState); + + var isFinalSignal = signal === Signals.RESPONDER_TERMINATED || signal === Signals.RESPONDER_RELEASE; + + if (isFinalSignal) { + this._cancelLongPressDelayTimeout(); + } + + var isInitialTransition = curState === States.NOT_RESPONDER && nextState === States.RESPONDER_INACTIVE_PRESS_IN; + var isActiveTransition = !IsActive[curState] && IsActive[nextState]; + + if (isInitialTransition || isActiveTransition) { + this._remeasureMetricsOnActivation(); + } + + if (IsPressingIn[curState] && signal === Signals.LONG_PRESS_DETECTED) { + this.touchableHandleLongPress && this.touchableHandleLongPress(e); + } + + if (newIsHighlight && !curIsHighlight) { + this._startHighlight(e); + } else if (!newIsHighlight && curIsHighlight) { + this._endHighlight(e); + } + + if (IsPressingIn[curState] && signal === Signals.RESPONDER_RELEASE) { + var hasLongPressHandler = !!this.props.onLongPress; + var pressIsLongButStillCallOnPress = IsLongPressingIn[curState] && (!hasLongPressHandler || !this.touchableLongPressCancelsPress()); + var shouldInvokePress = !IsLongPressingIn[curState] || pressIsLongButStillCallOnPress; + + if (shouldInvokePress && this.touchableHandlePress) { + if (!newIsHighlight && !curIsHighlight) { + this._startHighlight(e); + + this._endHighlight(e); + } + + if (_Platform.default.OS === 'android' && !this.props.touchSoundDisabled) { + _SoundManager.default.playTouchSound(); + } + + this.touchableHandlePress(e); + } + } + + this.touchableDelayTimeout && clearTimeout(this.touchableDelayTimeout); + this.touchableDelayTimeout = null; + }, + _startHighlight: function _startHighlight(e) { + this._savePressInLocation(e); + + this.touchableHandleActivePressIn && this.touchableHandleActivePressIn(e); + }, + _endHighlight: function _endHighlight(e) { + var _this = this; + + if (this.touchableHandleActivePressOut) { + if (this.touchableGetPressOutDelayMS && this.touchableGetPressOutDelayMS()) { + this.pressOutDelayTimeout = setTimeout(function () { + _this.touchableHandleActivePressOut(e); + }, this.touchableGetPressOutDelayMS()); + } else { + this.touchableHandleActivePressOut(e); + } + } + }, + withoutDefaultFocusAndBlur: {} + }; + var touchableHandleFocus = TouchableMixin.touchableHandleFocus, + touchableHandleBlur = TouchableMixin.touchableHandleBlur, + TouchableMixinWithoutDefaultFocusAndBlur = (0, _objectWithoutProperties2.default)(TouchableMixin, ["touchableHandleFocus", "touchableHandleBlur"]); + TouchableMixin.withoutDefaultFocusAndBlur = TouchableMixinWithoutDefaultFocusAndBlur; + var Touchable = { + Mixin: TouchableMixin, + renderDebugView: function renderDebugView(_ref) { + var color = _ref.color, + hitSlop = _ref.hitSlop; + return null; + } + }; + module.exports = Touchable; +},341,[5,108,6,17,342,37,344,155,212]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _PooledClass = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var twoArgumentPooler = _PooledClass.default.twoArgumentPooler; + + function BoundingDimensions(width, height) { + this.width = width; + this.height = height; + } + + BoundingDimensions.prototype.destructor = function () { + this.width = null; + this.height = null; + }; + + BoundingDimensions.getPooledFromElement = function (element) { + return BoundingDimensions.getPooled(element.offsetWidth, element.offsetHeight); + }; + + _PooledClass.default.addPoolingTo(BoundingDimensions, twoArgumentPooler); + + module.exports = BoundingDimensions; +},342,[5,343]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var oneArgumentPooler = function oneArgumentPooler(copyFieldsFrom) { + var Klass = this; + + if (Klass.instancePool.length) { + var _instance = Klass.instancePool.pop(); + + Klass.call(_instance, copyFieldsFrom); + return _instance; + } else { + return new Klass(copyFieldsFrom); + } + }; + + var twoArgumentPooler = function twoArgumentPooler(a1, a2) { + var Klass = this; + + if (Klass.instancePool.length) { + var _instance2 = Klass.instancePool.pop(); + + Klass.call(_instance2, a1, a2); + return _instance2; + } else { + return new Klass(a1, a2); + } + }; + + var threeArgumentPooler = function threeArgumentPooler(a1, a2, a3) { + var Klass = this; + + if (Klass.instancePool.length) { + var _instance3 = Klass.instancePool.pop(); + + Klass.call(_instance3, a1, a2, a3); + return _instance3; + } else { + return new Klass(a1, a2, a3); + } + }; + + var fourArgumentPooler = function fourArgumentPooler(a1, a2, a3, a4) { + var Klass = this; + + if (Klass.instancePool.length) { + var _instance4 = Klass.instancePool.pop(); + + Klass.call(_instance4, a1, a2, a3, a4); + return _instance4; + } else { + return new Klass(a1, a2, a3, a4); + } + }; + + var standardReleaser = function standardReleaser(instance) { + var Klass = this; + (0, _invariant.default)(instance instanceof Klass, 'Trying to release an instance into a pool of a different type.'); + instance.destructor(); + + if (Klass.instancePool.length < Klass.poolSize) { + Klass.instancePool.push(instance); + } + }; + + var DEFAULT_POOL_SIZE = 10; + var DEFAULT_POOLER = oneArgumentPooler; + + var addPoolingTo = function addPoolingTo(CopyConstructor, pooler) { + var NewKlass = CopyConstructor; + NewKlass.instancePool = []; + NewKlass.getPooled = pooler || DEFAULT_POOLER; + + if (!NewKlass.poolSize) { + NewKlass.poolSize = DEFAULT_POOL_SIZE; + } + + NewKlass.release = standardReleaser; + return NewKlass; + }; + + var PooledClass = { + addPoolingTo: addPoolingTo, + oneArgumentPooler: oneArgumentPooler, + twoArgumentPooler: twoArgumentPooler, + threeArgumentPooler: threeArgumentPooler, + fourArgumentPooler: fourArgumentPooler + }; + module.exports = PooledClass; +},343,[5,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _PooledClass = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var twoArgumentPooler = _PooledClass.default.twoArgumentPooler; + + function Position(left, top) { + this.left = left; + this.top = top; + } + + Position.prototype.destructor = function () { + this.left = null; + this.top = null; + }; + + _PooledClass.default.addPoolingTo(Position, twoArgumentPooler); + + module.exports = Position; +},344,[5,343]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Pressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TouchableHighlight = function (_React$Component) { + (0, _inherits2.default)(TouchableHighlight, _React$Component); + + var _super = _createSuper(TouchableHighlight); + + function TouchableHighlight() { + var _this; + + (0, _classCallCheck2.default)(this, TouchableHighlight); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this._isMounted = false; + _this.state = { + pressability: new _Pressability.default(_this._createPressabilityConfig()), + extraStyles: _this.props.testOnly_pressed === true ? _this._createExtraStyles() : null + }; + return _this; + } + + (0, _createClass2.default)(TouchableHighlight, [{ + key: "_createPressabilityConfig", + value: function _createPressabilityConfig() { + var _this$props$accessibi, + _this2 = this; + + return { + cancelable: !this.props.rejectResponderTermination, + disabled: this.props.disabled != null ? this.props.disabled : (_this$props$accessibi = this.props.accessibilityState) == null ? undefined : _this$props$accessibi.disabled, + hitSlop: this.props.hitSlop, + delayLongPress: this.props.delayLongPress, + delayPressIn: this.props.delayPressIn, + delayPressOut: this.props.delayPressOut, + minPressDuration: 0, + pressRectOffset: this.props.pressRetentionOffset, + android_disableSound: this.props.touchSoundDisabled, + onBlur: function onBlur(event) { + if (_Platform.default.isTV) { + _this2._hideUnderlay(); + } + + if (_this2.props.onBlur != null) { + _this2.props.onBlur(event); + } + }, + onFocus: function onFocus(event) { + if (_Platform.default.isTV) { + _this2._showUnderlay(); + } + + if (_this2.props.onFocus != null) { + _this2.props.onFocus(event); + } + }, + onLongPress: this.props.onLongPress, + onPress: function onPress(event) { + if (_this2._hideTimeout != null) { + clearTimeout(_this2._hideTimeout); + } + + if (!_Platform.default.isTV) { + var _this2$props$delayPre; + + _this2._showUnderlay(); + + _this2._hideTimeout = setTimeout(function () { + _this2._hideUnderlay(); + }, (_this2$props$delayPre = _this2.props.delayPressOut) != null ? _this2$props$delayPre : 0); + } + + if (_this2.props.onPress != null) { + _this2.props.onPress(event); + } + }, + onPressIn: function onPressIn(event) { + if (_this2._hideTimeout != null) { + clearTimeout(_this2._hideTimeout); + _this2._hideTimeout = null; + } + + _this2._showUnderlay(); + + if (_this2.props.onPressIn != null) { + _this2.props.onPressIn(event); + } + }, + onPressOut: function onPressOut(event) { + if (_this2._hideTimeout == null) { + _this2._hideUnderlay(); + } + + if (_this2.props.onPressOut != null) { + _this2.props.onPressOut(event); + } + } + }; + } + }, { + key: "_createExtraStyles", + value: function _createExtraStyles() { + var _this$props$activeOpa; + + return { + child: { + opacity: (_this$props$activeOpa = this.props.activeOpacity) != null ? _this$props$activeOpa : 0.85 + }, + underlay: { + backgroundColor: this.props.underlayColor === undefined ? 'black' : this.props.underlayColor + } + }; + } + }, { + key: "_showUnderlay", + value: function _showUnderlay() { + if (!this._isMounted || !this._hasPressHandler()) { + return; + } + + this.setState({ + extraStyles: this._createExtraStyles() + }); + + if (this.props.onShowUnderlay != null) { + this.props.onShowUnderlay(); + } + } + }, { + key: "_hideUnderlay", + value: function _hideUnderlay() { + if (this._hideTimeout != null) { + clearTimeout(this._hideTimeout); + this._hideTimeout = null; + } + + if (this.props.testOnly_pressed === true) { + return; + } + + if (this._hasPressHandler()) { + this.setState({ + extraStyles: null + }); + + if (this.props.onHideUnderlay != null) { + this.props.onHideUnderlay(); + } + } + } + }, { + key: "_hasPressHandler", + value: function _hasPressHandler() { + return this.props.onPress != null || this.props.onPressIn != null || this.props.onPressOut != null || this.props.onLongPress != null; + } + }, { + key: "render", + value: function render() { + var _this$state$extraStyl, _this$state$extraStyl2; + + var child = React.Children.only(this.props.children); + + var _this$state$pressabil = this.state.pressability.getEventHandlers(), + onBlur = _this$state$pressabil.onBlur, + onFocus = _this$state$pressabil.onFocus, + eventHandlersWithoutBlurAndFocus = (0, _objectWithoutProperties2.default)(_this$state$pressabil, ["onBlur", "onFocus"]); + + var accessibilityState = this.props.disabled != null ? (0, _extends2.default)({}, this.props.accessibilityState, { + disabled: this.props.disabled + }) : this.props.accessibilityState; + return React.createElement(_View.default, (0, _extends2.default)({ + accessible: this.props.accessible !== false, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityHint: this.props.accessibilityHint, + accessibilityRole: this.props.accessibilityRole, + accessibilityState: accessibilityState, + accessibilityValue: this.props.accessibilityValue, + accessibilityActions: this.props.accessibilityActions, + onAccessibilityAction: this.props.onAccessibilityAction, + importantForAccessibility: this.props.importantForAccessibility, + accessibilityLiveRegion: this.props.accessibilityLiveRegion, + accessibilityViewIsModal: this.props.accessibilityViewIsModal, + accessibilityElementsHidden: this.props.accessibilityElementsHidden, + style: _StyleSheet.default.compose(this.props.style, (_this$state$extraStyl = this.state.extraStyles) == null ? undefined : _this$state$extraStyl.underlay), + onLayout: this.props.onLayout, + hitSlop: this.props.hitSlop, + hasTVPreferredFocus: this.props.hasTVPreferredFocus, + nextFocusDown: this.props.nextFocusDown, + nextFocusForward: this.props.nextFocusForward, + nextFocusLeft: this.props.nextFocusLeft, + nextFocusRight: this.props.nextFocusRight, + nextFocusUp: this.props.nextFocusUp, + focusable: this.props.focusable !== false && this.props.onPress !== undefined, + nativeID: this.props.nativeID, + testID: this.props.testID, + ref: this.props.hostRef + }, eventHandlersWithoutBlurAndFocus), React.cloneElement(child, { + style: _StyleSheet.default.compose(child.props.style, (_this$state$extraStyl2 = this.state.extraStyles) == null ? undefined : _this$state$extraStyl2.child) + }), null); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this._isMounted = true; + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + this.state.pressability.configure(this._createPressabilityConfig()); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._isMounted = false; + + if (this._hideTimeout != null) { + clearTimeout(this._hideTimeout); + } + + this.state.pressability.reset(); + } + }]); + return TouchableHighlight; + }(React.Component); + + var Touchable = React.forwardRef(function (props, hostRef) { + return React.createElement(TouchableHighlight, (0, _extends2.default)({}, props, { + hostRef: hostRef + })); + }); + Touchable.displayName = 'TouchableHighlight'; + module.exports = Touchable; +},345,[5,6,108,7,8,12,14,16,211,183,37,184,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Pressability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PASSTHROUGH_PROPS = ['accessibilityActions', 'accessibilityElementsHidden', 'accessibilityHint', 'accessibilityIgnoresInvertColors', 'accessibilityLabel', 'accessibilityLiveRegion', 'accessibilityRole', 'accessibilityValue', 'accessibilityViewIsModal', 'hitSlop', 'importantForAccessibility', 'nativeID', 'onAccessibilityAction', 'onBlur', 'onFocus', 'onLayout', 'testID']; + + var TouchableWithoutFeedback = function (_React$Component) { + (0, _inherits2.default)(TouchableWithoutFeedback, _React$Component); + + var _super = _createSuper(TouchableWithoutFeedback); + + function TouchableWithoutFeedback() { + var _this; + + (0, _classCallCheck2.default)(this, TouchableWithoutFeedback); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + pressability: new _Pressability.default(createPressabilityConfig(_this.props)) + }; + return _this; + } + + (0, _createClass2.default)(TouchableWithoutFeedback, [{ + key: "render", + value: function render() { + var element = React.Children.only(this.props.children); + var children = [element.props.children]; + + var _this$state$pressabil = this.state.pressability.getEventHandlers(), + onBlur = _this$state$pressabil.onBlur, + onFocus = _this$state$pressabil.onFocus, + eventHandlersWithoutBlurAndFocus = (0, _objectWithoutProperties2.default)(_this$state$pressabil, ["onBlur", "onFocus"]); + + var elementProps = (0, _extends2.default)({}, eventHandlersWithoutBlurAndFocus, { + accessible: this.props.accessible !== false, + accessibilityState: this.props.disabled != null ? (0, _extends2.default)({}, this.props.accessibilityState, { + disabled: this.props.disabled + }) : this.props.accessibilityState, + focusable: this.props.focusable !== false && this.props.onPress !== undefined + }); + + for (var _i = 0, _PASSTHROUGH_PROPS = PASSTHROUGH_PROPS; _i < _PASSTHROUGH_PROPS.length; _i++) { + var prop = _PASSTHROUGH_PROPS[_i]; + + if (this.props[prop] !== undefined) { + elementProps[prop] = this.props[prop]; + } + } + + return React.cloneElement.apply(React, [element, elementProps].concat(children)); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this.state.pressability.configure(createPressabilityConfig(this.props)); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.state.pressability.reset(); + } + }]); + return TouchableWithoutFeedback; + }(React.Component); + + function createPressabilityConfig(props) { + var _props$accessibilityS; + + return { + cancelable: !props.rejectResponderTermination, + disabled: props.disabled !== null ? props.disabled : (_props$accessibilityS = props.accessibilityState) == null ? undefined : _props$accessibilityS.disabled, + hitSlop: props.hitSlop, + delayLongPress: props.delayLongPress, + delayPressIn: props.delayPressIn, + delayPressOut: props.delayPressOut, + minPressDuration: 0, + pressRectOffset: props.pressRetentionOffset, + android_disableSound: props.touchSoundDisabled, + onBlur: props.onBlur, + onFocus: props.onFocus, + onLongPress: props.onLongPress, + onPress: props.onPress, + onPressIn: props.onPressIn, + onPressOut: props.onPressOut + }; + } + + TouchableWithoutFeedback.displayName = 'TouchableWithoutFeedback'; + module.exports = TouchableWithoutFeedback; +},346,[5,6,108,7,8,12,14,16,211,184,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeActionSheetManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var ActionSheetIOS = { + showActionSheetWithOptions: function showActionSheetWithOptions(options, callback) { + _$$_REQUIRE(_dependencyMap[4])(typeof options === 'object' && options !== null, 'Options must be a valid object'); + + _$$_REQUIRE(_dependencyMap[4])(typeof callback === 'function', 'Must provide a valid callback'); + + _$$_REQUIRE(_dependencyMap[4])(_NativeActionSheetManager.default, "ActionSheetManager doesn't exist"); + + var tintColor = options.tintColor, + cancelButtonTintColor = options.cancelButtonTintColor, + destructiveButtonIndex = options.destructiveButtonIndex, + remainingOptions = (0, _objectWithoutProperties2.default)(options, ["tintColor", "cancelButtonTintColor", "destructiveButtonIndex"]); + var destructiveButtonIndices = null; + + if (Array.isArray(destructiveButtonIndex)) { + destructiveButtonIndices = destructiveButtonIndex; + } else if (typeof destructiveButtonIndex === 'number') { + destructiveButtonIndices = [destructiveButtonIndex]; + } + + var processedTintColor = _$$_REQUIRE(_dependencyMap[5])(tintColor); + + var processedCancelButtonTintColor = _$$_REQUIRE(_dependencyMap[5])(cancelButtonTintColor); + + _$$_REQUIRE(_dependencyMap[4])(processedTintColor == null || typeof processedTintColor === 'number', 'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions tintColor'); + + _$$_REQUIRE(_dependencyMap[4])(processedCancelButtonTintColor == null || typeof processedCancelButtonTintColor === 'number', 'Unexpected color given for ActionSheetIOS.showActionSheetWithOptions cancelButtonTintColor'); + + _NativeActionSheetManager.default.showActionSheetWithOptions((0, _extends2.default)({}, remainingOptions, { + tintColor: processedTintColor, + cancelButtonTintColor: processedCancelButtonTintColor, + destructiveButtonIndices: destructiveButtonIndices + }), callback); + }, + showShareActionSheetWithOptions: function showShareActionSheetWithOptions(options, failureCallback, successCallback) { + _$$_REQUIRE(_dependencyMap[4])(typeof options === 'object' && options !== null, 'Options must be a valid object'); + + _$$_REQUIRE(_dependencyMap[4])(typeof failureCallback === 'function', 'Must provide a valid failureCallback'); + + _$$_REQUIRE(_dependencyMap[4])(typeof successCallback === 'function', 'Must provide a valid successCallback'); + + _$$_REQUIRE(_dependencyMap[4])(_NativeActionSheetManager.default, "ActionSheetManager doesn't exist"); + + _NativeActionSheetManager.default.showShareActionSheetWithOptions((0, _extends2.default)({}, options, { + tintColor: _$$_REQUIRE(_dependencyMap[5])(options.tintColor) + }), failureCallback, successCallback); + } + }; + module.exports = ActionSheetIOS; +},347,[5,6,108,348,36,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('ActionSheetManager'); + + exports.default = _default; +},348,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _EventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeAppearance = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var eventEmitter = new _EventEmitter.default(); + + if (_NativeAppearance.default) { + var nativeEventEmitter = new _NativeEventEmitter.default(_Platform.default.OS !== 'ios' ? null : _NativeAppearance.default); + nativeEventEmitter.addListener('appearanceChanged', function (newAppearance) { + var colorScheme = newAppearance.colorScheme; + (0, _invariant.default)(colorScheme === 'dark' || colorScheme === 'light' || colorScheme == null, "Unrecognized color scheme. Did you mean 'dark' or 'light'?"); + eventEmitter.emit('change', { + colorScheme: colorScheme + }); + }); + } + + module.exports = { + getColorScheme: function getColorScheme() { + var nativeColorScheme = _NativeAppearance.default == null ? null : _NativeAppearance.default.getColorScheme() || null; + (0, _invariant.default)(nativeColorScheme === 'dark' || nativeColorScheme === 'light' || nativeColorScheme == null, "Unrecognized color scheme. Did you mean 'dark' or 'light'?"); + return nativeColorScheme; + }, + addChangeListener: function addChangeListener(listener) { + return eventEmitter.addListener('change', listener); + }, + removeChangeListener: function removeChangeListener(listener) { + eventEmitter.removeListener('change', listener); + } + }; +},349,[5,31,110,350,36,37]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('Appearance'); + + exports.default = _default; +},350,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createPerformanceLogger = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeHeadlessJsTaskSupport = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _HeadlessJsTaskError = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var runnables = {}; + var runCount = 1; + var sections = {}; + var taskProviders = new Map(); + var taskCancelProviders = new Map(); + + var componentProviderInstrumentationHook = function componentProviderInstrumentationHook(component) { + return component(); + }; + + var wrapperComponentProvider; + var showArchitectureIndicator = false; + var AppRegistry = { + setWrapperComponentProvider: function setWrapperComponentProvider(provider) { + wrapperComponentProvider = provider; + }, + enableArchitectureIndicator: function enableArchitectureIndicator(enabled) { + showArchitectureIndicator = enabled; + }, + registerConfig: function registerConfig(config) { + config.forEach(function (appConfig) { + if (appConfig.run) { + AppRegistry.registerRunnable(appConfig.appKey, appConfig.run); + } else { + _$$_REQUIRE(_dependencyMap[5])(appConfig.component != null, "AppRegistry.registerConfig(...): Every config is expected to set either `run` or `component`, but `%s` has neither.", appConfig.appKey); + + AppRegistry.registerComponent(appConfig.appKey, appConfig.component, appConfig.section); + } + }); + }, + registerComponent: function registerComponent(appKey, componentProvider, section) { + var scopedPerformanceLogger = (0, _createPerformanceLogger.default)(); + runnables[appKey] = { + componentProvider: componentProvider, + run: function run(appParameters, displayMode) { + _$$_REQUIRE(_dependencyMap[6])(componentProviderInstrumentationHook(componentProvider, scopedPerformanceLogger), appParameters.initialProps, appParameters.rootTag, wrapperComponentProvider && wrapperComponentProvider(appParameters), appParameters.fabric, showArchitectureIndicator, scopedPerformanceLogger, appKey === 'LogBox', appKey, (0, _$$_REQUIRE(_dependencyMap[7]).coerceDisplayMode)(displayMode), appParameters.concurrentRoot); + } + }; + + if (section) { + sections[appKey] = runnables[appKey]; + } + + return appKey; + }, + registerRunnable: function registerRunnable(appKey, run) { + runnables[appKey] = { + run: run + }; + return appKey; + }, + registerSection: function registerSection(appKey, component) { + AppRegistry.registerComponent(appKey, component, true); + }, + getAppKeys: function getAppKeys() { + return Object.keys(runnables); + }, + getSectionKeys: function getSectionKeys() { + return Object.keys(sections); + }, + getSections: function getSections() { + return (0, _extends2.default)({}, sections); + }, + getRunnable: function getRunnable(appKey) { + return runnables[appKey]; + }, + getRegistry: function getRegistry() { + return { + sections: AppRegistry.getSectionKeys(), + runnables: (0, _extends2.default)({}, runnables) + }; + }, + setComponentProviderInstrumentationHook: function setComponentProviderInstrumentationHook(hook) { + componentProviderInstrumentationHook = hook; + }, + runApplication: function runApplication(appKey, appParameters, displayMode) { + if (appKey !== 'LogBox') { + var logParams = ''; + var msg = 'Running "' + appKey + logParams; + + _$$_REQUIRE(_dependencyMap[8])(msg); + + _$$_REQUIRE(_dependencyMap[9]).addSource('AppRegistry.runApplication' + runCount++, function () { + return msg; + }); + } + + _$$_REQUIRE(_dependencyMap[5])(runnables[appKey] && runnables[appKey].run, "\"" + appKey + "\" has not been registered. This can happen if:\n" + '* Metro (the local dev server) is run from the wrong folder. ' + 'Check if Metro is running, stop it and restart it in the current project.\n' + "* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called."); + + _$$_REQUIRE(_dependencyMap[10]).setActiveScene({ + name: appKey + }); + + runnables[appKey].run(appParameters, displayMode); + }, + setSurfaceProps: function setSurfaceProps(appKey, appParameters, displayMode) { + if (appKey !== 'LogBox') { + var msg = 'Updating props for Surface "' + appKey + '" with ' + JSON.stringify(appParameters); + + _$$_REQUIRE(_dependencyMap[8])(msg); + + _$$_REQUIRE(_dependencyMap[9]).addSource('AppRegistry.setSurfaceProps' + runCount++, function () { + return msg; + }); + } + + _$$_REQUIRE(_dependencyMap[5])(runnables[appKey] && runnables[appKey].run, "\"" + appKey + "\" has not been registered. This can happen if:\n" + '* Metro (the local dev server) is run from the wrong folder. ' + 'Check if Metro is running, stop it and restart it in the current project.\n' + "* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called."); + + runnables[appKey].run(appParameters, displayMode); + }, + unmountApplicationComponentAtRootTag: function unmountApplicationComponentAtRootTag(rootTag) { + _$$_REQUIRE(_dependencyMap[11]).unmountComponentAtNodeAndRemoveContainer(rootTag); + }, + registerHeadlessTask: function registerHeadlessTask(taskKey, taskProvider) { + this.registerCancellableHeadlessTask(taskKey, taskProvider, function () { + return function () {}; + }); + }, + registerCancellableHeadlessTask: function registerCancellableHeadlessTask(taskKey, taskProvider, taskCancelProvider) { + if (taskProviders.has(taskKey)) { + console.warn("registerHeadlessTask or registerCancellableHeadlessTask called multiple times for same key '" + taskKey + "'"); + } + + taskProviders.set(taskKey, taskProvider); + taskCancelProviders.set(taskKey, taskCancelProvider); + }, + startHeadlessTask: function startHeadlessTask(taskId, taskKey, data) { + var taskProvider = taskProviders.get(taskKey); + + if (!taskProvider) { + console.warn("No task registered for key " + taskKey); + + if (_NativeHeadlessJsTaskSupport.default) { + _NativeHeadlessJsTaskSupport.default.notifyTaskFinished(taskId); + } + + return; + } + + taskProvider()(data).then(function () { + if (_NativeHeadlessJsTaskSupport.default) { + _NativeHeadlessJsTaskSupport.default.notifyTaskFinished(taskId); + } + }).catch(function (reason) { + console.error(reason); + + if (_NativeHeadlessJsTaskSupport.default && reason instanceof _HeadlessJsTaskError.default) { + _NativeHeadlessJsTaskSupport.default.notifyTaskRetry(taskId).then(function (retryPosted) { + if (!retryPosted) { + _NativeHeadlessJsTaskSupport.default.notifyTaskFinished(taskId); + } + }); + } + }); + }, + cancelHeadlessTask: function cancelHeadlessTask(taskId, taskKey) { + var taskCancelProvider = taskCancelProviders.get(taskKey); + + if (!taskCancelProvider) { + throw new Error("No task canceller registered for key '" + taskKey + "'"); + } + + taskCancelProvider()(); + } + }; + + _$$_REQUIRE(_dependencyMap[12]).registerCallableModule('AppRegistry', AppRegistry); + + { + AppRegistry.registerComponent('LogBox', function () { + return function NoOp() { + return null; + }; + }); + } + module.exports = AppRegistry; +},351,[5,6,98,352,353,36,354,361,278,362,366,54,45]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('HeadlessJsTaskSupport'); + + exports.default = _default; +},352,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _wrapNativeSuper2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var HeadlessJsTaskError = function (_Error) { + (0, _inherits2.default)(HeadlessJsTaskError, _Error); + + var _super = _createSuper(HeadlessJsTaskError); + + function HeadlessJsTaskError() { + (0, _classCallCheck2.default)(this, HeadlessJsTaskError); + return _super.apply(this, arguments); + } + + return HeadlessJsTaskError; + }((0, _wrapNativeSuper2.default)(Error)); + + exports.default = HeadlessJsTaskError; +},353,[5,7,12,14,16,63]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _GlobalPerformanceLogger = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _PerformanceLoggerContext = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _getCachedComponentWithDebugName = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var React = _$$_REQUIRE(_dependencyMap[5]); + + _$$_REQUIRE(_dependencyMap[6]); + + function renderApplication(RootComponent, initialProps, rootTag, WrapperComponent, fabric, showArchitectureIndicator, scopedPerformanceLogger, isLogBox, debugName, displayMode, useConcurrentRoot) { + _$$_REQUIRE(_dependencyMap[7])(rootTag, 'Expect to have a valid rootTag, instead got ', rootTag); + + var performanceLogger = scopedPerformanceLogger != null ? scopedPerformanceLogger : _GlobalPerformanceLogger.default; + var renderable = React.createElement(_PerformanceLoggerContext.default.Provider, { + value: performanceLogger + }, React.createElement(_$$_REQUIRE(_dependencyMap[8]), { + rootTag: rootTag, + fabric: fabric, + showArchitectureIndicator: showArchitectureIndicator, + WrapperComponent: WrapperComponent, + initialProps: initialProps != null ? initialProps : Object.freeze({}), + internal_excludeLogBox: isLogBox + }, React.createElement(RootComponent, (0, _extends2.default)({}, initialProps, { + rootTag: rootTag + })))); + performanceLogger.startTimespan('renderApplication_React_render'); + performanceLogger.setExtra('usedReactFabric', fabric ? '1' : '0'); + + if (fabric) { + _$$_REQUIRE(_dependencyMap[9]).render(renderable, rootTag, null, useConcurrentRoot); + } else { + _$$_REQUIRE(_dependencyMap[10]).render(renderable, rootTag); + } + + performanceLogger.stopTimespan('renderApplication_React_render'); + } + + module.exports = renderApplication; +},354,[5,6,97,355,356,17,357,36,358,359,54]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.usePerformanceLogger = usePerformanceLogger; + exports.default = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _GlobalPerformanceLogger = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var PerformanceLoggerContext = React.createContext(_GlobalPerformanceLogger.default); + + function usePerformanceLogger() { + return (0, React.useContext)(PerformanceLoggerContext); + } + + var _default = PerformanceLoggerContext; + exports.default = _default; +},355,[17,5,97]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = getCachedComponentWithDisplayName; + var cache = new Map(); + + function getCachedComponentWithDisplayName(displayName) { + var ComponentWithDisplayName = cache.get(displayName); + + if (!ComponentWithDisplayName) { + ComponentWithDisplayName = function ComponentWithDisplayName(_ref) { + var children = _ref.children; + return children; + }; + + ComponentWithDisplayName.displayName = displayName; + cache.set(displayName, ComponentWithDisplayName); + } + + return ComponentWithDisplayName; + } +},356,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]); + + function emptyFunction() {} + + var BackHandler = { + exitApp: emptyFunction, + addEventListener: function addEventListener(_eventName, _handler) { + return { + remove: emptyFunction + }; + }, + removeEventListener: function removeEventListener(_eventName, _handler) {} + }; + module.exports = BackHandler; +},357,[188]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _View = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _StyleSheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AppContainer = function (_React$Component) { + (0, _inherits2.default)(AppContainer, _React$Component); + + var _super = _createSuper(AppContainer); + + function AppContainer() { + var _this; + + (0, _classCallCheck2.default)(this, AppContainer); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + inspector: null, + mainKey: 1, + hasError: false + }; + _this._subscription = null; + return _this; + } + + (0, _createClass2.default)(AppContainer, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this._subscription != null) { + this._subscription.remove(); + } + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var logBox = null; + var innerView = React.createElement(_View.default, { + collapsable: !this.state.inspector, + key: this.state.mainKey, + pointerEvents: "box-none", + style: styles.appContainer, + ref: function ref(_ref) { + _this3._mainRef = _ref; + } + }, this.props.children); + var Wrapper = this.props.WrapperComponent; + + if (Wrapper != null) { + innerView = React.createElement(Wrapper, { + initialProps: this.props.initialProps, + fabric: this.props.fabric === true, + showArchitectureIndicator: this.props.showArchitectureIndicator === true + }, innerView); + } + + return React.createElement(_$$_REQUIRE(_dependencyMap[10]).RootTagContext.Provider, { + value: (0, _$$_REQUIRE(_dependencyMap[10]).createRootTag)(this.props.rootTag) + }, React.createElement(_View.default, { + style: styles.appContainer, + pointerEvents: "box-none" + }, !this.state.hasError && innerView, this.state.inspector, logBox)); + } + }]); + return AppContainer; + }(React.Component); + + AppContainer.getDerivedStateFromError = undefined; + + var styles = _StyleSheet.default.create({ + appContainer: { + flex: 1 + } + }); + + module.exports = AppContainer; +},358,[5,7,8,12,14,16,184,30,183,17,313]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ReactFabric; + { + ReactFabric = _$$_REQUIRE(_dependencyMap[0]); + } + + if (global.RN$Bridgeless) { + global.RN$stopSurface = ReactFabric.stopSurface; + } else { + _$$_REQUIRE(_dependencyMap[1]).BatchedBridge.registerCallableModule('ReactFabric', ReactFabric); + } + + module.exports = ReactFabric; +},359,[360,136]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + _$$_REQUIRE(_dependencyMap[0]); + + var React = _$$_REQUIRE(_dependencyMap[1]); + + function invokeGuardedCallbackImpl(name, func, context, a, b, c, d, e, f) { + var funcArgs = Array.prototype.slice.call(arguments, 3); + + try { + func.apply(context, funcArgs); + } catch (error) { + this.onError(error); + } + } + + var hasError = false, + caughtError = null, + hasRethrowError = false, + rethrowError = null, + reporter = { + onError: function onError(error) { + hasError = true; + caughtError = error; + } + }; + + function invokeGuardedCallback(name, func, context, a, b, c, d, e, f) { + hasError = false; + caughtError = null; + invokeGuardedCallbackImpl.apply(reporter, arguments); + } + + function invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) { + invokeGuardedCallback.apply(this, arguments); + + if (hasError) { + if (hasError) { + var error = caughtError; + hasError = false; + caughtError = null; + } else throw Error("clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue."); + + hasRethrowError || (hasRethrowError = true, rethrowError = error); + } + } + + var isArrayImpl = Array.isArray, + getFiberCurrentPropsFromNode = null, + getInstanceFromNode = null, + getNodeFromInstance = null; + + function executeDispatch(event, listener, inst) { + var type = event.type || "unknown-event"; + event.currentTarget = getNodeFromInstance(inst); + invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event); + event.currentTarget = null; + } + + function executeDirectDispatch(event) { + var dispatchListener = event._dispatchListeners, + dispatchInstance = event._dispatchInstances; + if (isArrayImpl(dispatchListener)) throw Error("executeDirectDispatch(...): Invalid `event`."); + event.currentTarget = dispatchListener ? getNodeFromInstance(dispatchInstance) : null; + dispatchListener = dispatchListener ? dispatchListener(event) : null; + event.currentTarget = null; + event._dispatchListeners = null; + event._dispatchInstances = null; + return dispatchListener; + } + + function functionThatReturnsTrue() { + return true; + } + + function functionThatReturnsFalse() { + return false; + } + + function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) { + this.dispatchConfig = dispatchConfig; + this._targetInst = targetInst; + this.nativeEvent = nativeEvent; + this._dispatchInstances = this._dispatchListeners = null; + dispatchConfig = this.constructor.Interface; + + for (var propName in dispatchConfig) { + dispatchConfig.hasOwnProperty(propName) && ((targetInst = dispatchConfig[propName]) ? this[propName] = targetInst(nativeEvent) : "target" === propName ? this.target = nativeEventTarget : this[propName] = nativeEvent[propName]); + } + + this.isDefaultPrevented = (null != nativeEvent.defaultPrevented ? nativeEvent.defaultPrevented : false === nativeEvent.returnValue) ? functionThatReturnsTrue : functionThatReturnsFalse; + this.isPropagationStopped = functionThatReturnsFalse; + return this; + } + + _$$_REQUIRE(_dependencyMap[2])(SyntheticEvent.prototype, { + preventDefault: function preventDefault() { + this.defaultPrevented = true; + var event = this.nativeEvent; + event && (event.preventDefault ? event.preventDefault() : "unknown" !== typeof event.returnValue && (event.returnValue = false), this.isDefaultPrevented = functionThatReturnsTrue); + }, + stopPropagation: function stopPropagation() { + var event = this.nativeEvent; + event && (event.stopPropagation ? event.stopPropagation() : "unknown" !== typeof event.cancelBubble && (event.cancelBubble = true), this.isPropagationStopped = functionThatReturnsTrue); + }, + persist: function persist() { + this.isPersistent = functionThatReturnsTrue; + }, + isPersistent: functionThatReturnsFalse, + destructor: function destructor() { + var Interface = this.constructor.Interface, + propName; + + for (propName in Interface) { + this[propName] = null; + } + + this.nativeEvent = this._targetInst = this.dispatchConfig = null; + this.isPropagationStopped = this.isDefaultPrevented = functionThatReturnsFalse; + this._dispatchInstances = this._dispatchListeners = null; + } + }); + + SyntheticEvent.Interface = { + type: null, + target: null, + currentTarget: function currentTarget() { + return null; + }, + eventPhase: null, + bubbles: null, + cancelable: null, + timeStamp: function timeStamp(event) { + return event.timeStamp || Date.now(); + }, + defaultPrevented: null, + isTrusted: null + }; + + SyntheticEvent.extend = function (Interface) { + function E() {} + + function Class() { + return Super.apply(this, arguments); + } + + var Super = this; + E.prototype = Super.prototype; + var prototype = new E(); + + _$$_REQUIRE(_dependencyMap[2])(prototype, Class.prototype); + + Class.prototype = prototype; + Class.prototype.constructor = Class; + Class.Interface = _$$_REQUIRE(_dependencyMap[2])({}, Super.Interface, Interface); + Class.extend = Super.extend; + addEventPoolingTo(Class); + return Class; + }; + + addEventPoolingTo(SyntheticEvent); + + function createOrGetPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) { + if (this.eventPool.length) { + var instance = this.eventPool.pop(); + this.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst); + return instance; + } + + return new this(dispatchConfig, targetInst, nativeEvent, nativeInst); + } + + function releasePooledEvent(event) { + if (!(event instanceof this)) throw Error("Trying to release an event instance into a pool of a different type."); + event.destructor(); + 10 > this.eventPool.length && this.eventPool.push(event); + } + + function addEventPoolingTo(EventConstructor) { + EventConstructor.getPooled = createOrGetPooledEvent; + EventConstructor.eventPool = []; + EventConstructor.release = releasePooledEvent; + } + + var ResponderSyntheticEvent = SyntheticEvent.extend({ + touchHistory: function touchHistory() { + return null; + } + }); + + function isStartish(topLevelType) { + return "topTouchStart" === topLevelType; + } + + function isMoveish(topLevelType) { + return "topTouchMove" === topLevelType; + } + + var startDependencies = ["topTouchStart"], + moveDependencies = ["topTouchMove"], + endDependencies = ["topTouchCancel", "topTouchEnd"], + touchBank = [], + touchHistory = { + touchBank: touchBank, + numberActiveTouches: 0, + indexOfSingleActiveTouch: -1, + mostRecentTimeStamp: 0 + }; + + function timestampForTouch(touch) { + return touch.timeStamp || touch.timestamp; + } + + function getTouchIdentifier(_ref) { + _ref = _ref.identifier; + if (null == _ref) throw Error("Touch object is missing identifier."); + return _ref; + } + + function recordTouchStart(touch) { + var identifier = getTouchIdentifier(touch), + touchRecord = touchBank[identifier]; + touchRecord ? (touchRecord.touchActive = true, touchRecord.startPageX = touch.pageX, touchRecord.startPageY = touch.pageY, touchRecord.startTimeStamp = timestampForTouch(touch), touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchRecord.previousPageX = touch.pageX, touchRecord.previousPageY = touch.pageY, touchRecord.previousTimeStamp = timestampForTouch(touch)) : (touchRecord = { + touchActive: true, + startPageX: touch.pageX, + startPageY: touch.pageY, + startTimeStamp: timestampForTouch(touch), + currentPageX: touch.pageX, + currentPageY: touch.pageY, + currentTimeStamp: timestampForTouch(touch), + previousPageX: touch.pageX, + previousPageY: touch.pageY, + previousTimeStamp: timestampForTouch(touch) + }, touchBank[identifier] = touchRecord); + touchHistory.mostRecentTimeStamp = timestampForTouch(touch); + } + + function recordTouchMove(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord && (touchRecord.touchActive = true, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)); + } + + function recordTouchEnd(touch) { + var touchRecord = touchBank[getTouchIdentifier(touch)]; + touchRecord && (touchRecord.touchActive = false, touchRecord.previousPageX = touchRecord.currentPageX, touchRecord.previousPageY = touchRecord.currentPageY, touchRecord.previousTimeStamp = touchRecord.currentTimeStamp, touchRecord.currentPageX = touch.pageX, touchRecord.currentPageY = touch.pageY, touchRecord.currentTimeStamp = timestampForTouch(touch), touchHistory.mostRecentTimeStamp = timestampForTouch(touch)); + } + + var instrumentationCallback, + ResponderTouchHistoryStore = { + instrument: function instrument(callback) { + instrumentationCallback = callback; + }, + recordTouchTrack: function recordTouchTrack(topLevelType, nativeEvent) { + null != instrumentationCallback && instrumentationCallback(topLevelType, nativeEvent); + if (isMoveish(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchMove);else if (isStartish(topLevelType)) nativeEvent.changedTouches.forEach(recordTouchStart), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches && (touchHistory.indexOfSingleActiveTouch = nativeEvent.touches[0].identifier);else if ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType) if (nativeEvent.changedTouches.forEach(recordTouchEnd), touchHistory.numberActiveTouches = nativeEvent.touches.length, 1 === touchHistory.numberActiveTouches) for (topLevelType = 0; topLevelType < touchBank.length; topLevelType++) { + if (nativeEvent = touchBank[topLevelType], null != nativeEvent && nativeEvent.touchActive) { + touchHistory.indexOfSingleActiveTouch = topLevelType; + break; + } + } + }, + touchHistory: touchHistory + }; + + function accumulate(current, next) { + if (null == next) throw Error("accumulate(...): Accumulated items must not be null or undefined."); + return null == current ? next : isArrayImpl(current) ? current.concat(next) : isArrayImpl(next) ? [current].concat(next) : [current, next]; + } + + function accumulateInto(current, next) { + if (null == next) throw Error("accumulateInto(...): Accumulated items must not be null or undefined."); + if (null == current) return next; + + if (isArrayImpl(current)) { + if (isArrayImpl(next)) return current.push.apply(current, next), current; + current.push(next); + return current; + } + + return isArrayImpl(next) ? [current].concat(next) : [current, next]; + } + + function forEachAccumulated(arr, cb, scope) { + Array.isArray(arr) ? arr.forEach(cb, scope) : arr && cb.call(scope, arr); + } + + var responderInst = null, + trackedTouchCount = 0; + + function changeResponder(nextResponderInst, blockHostResponder) { + var oldResponderInst = responderInst; + responderInst = nextResponderInst; + if (null !== ResponderEventPlugin.GlobalResponderHandler) ResponderEventPlugin.GlobalResponderHandler.onChange(oldResponderInst, nextResponderInst, blockHostResponder); + } + + var eventTypes = { + startShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onStartShouldSetResponder", + captured: "onStartShouldSetResponderCapture" + }, + dependencies: startDependencies + }, + scrollShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onScrollShouldSetResponder", + captured: "onScrollShouldSetResponderCapture" + }, + dependencies: ["topScroll"] + }, + selectionChangeShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onSelectionChangeShouldSetResponder", + captured: "onSelectionChangeShouldSetResponderCapture" + }, + dependencies: ["topSelectionChange"] + }, + moveShouldSetResponder: { + phasedRegistrationNames: { + bubbled: "onMoveShouldSetResponder", + captured: "onMoveShouldSetResponderCapture" + }, + dependencies: moveDependencies + }, + responderStart: { + registrationName: "onResponderStart", + dependencies: startDependencies + }, + responderMove: { + registrationName: "onResponderMove", + dependencies: moveDependencies + }, + responderEnd: { + registrationName: "onResponderEnd", + dependencies: endDependencies + }, + responderRelease: { + registrationName: "onResponderRelease", + dependencies: endDependencies + }, + responderTerminationRequest: { + registrationName: "onResponderTerminationRequest", + dependencies: [] + }, + responderGrant: { + registrationName: "onResponderGrant", + dependencies: [] + }, + responderReject: { + registrationName: "onResponderReject", + dependencies: [] + }, + responderTerminate: { + registrationName: "onResponderTerminate", + dependencies: [] + } + }; + + function getParent(inst) { + do { + inst = inst.return; + } while (inst && 5 !== inst.tag); + + return inst ? inst : null; + } + + function traverseTwoPhase(inst, fn, arg) { + for (var path = []; inst;) { + path.push(inst), inst = getParent(inst); + } + + for (inst = path.length; 0 < inst--;) { + fn(path[inst], "captured", arg); + } + + for (inst = 0; inst < path.length; inst++) { + fn(path[inst], "bubbled", arg); + } + } + + function getListener(inst, registrationName) { + inst = inst.stateNode; + if (null === inst) return null; + inst = getFiberCurrentPropsFromNode(inst); + if (null === inst) return null; + if ((inst = inst[registrationName]) && "function" !== typeof inst) throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof inst + "` type."); + return inst; + } + + function accumulateDirectionalDispatches(inst, phase, event) { + if (phase = getListener(inst, event.dispatchConfig.phasedRegistrationNames[phase])) event._dispatchListeners = accumulateInto(event._dispatchListeners, phase), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + + function accumulateDirectDispatchesSingle(event) { + if (event && event.dispatchConfig.registrationName) { + var inst = event._targetInst; + + if (inst && event && event.dispatchConfig.registrationName) { + var listener = getListener(inst, event.dispatchConfig.registrationName); + listener && (event._dispatchListeners = accumulateInto(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst)); + } + } + } + + function accumulateTwoPhaseDispatchesSingleSkipTarget(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + var targetInst = event._targetInst; + targetInst = targetInst ? getParent(targetInst) : null; + traverseTwoPhase(targetInst, accumulateDirectionalDispatches, event); + } + } + + function accumulateTwoPhaseDispatchesSingle(event) { + event && event.dispatchConfig.phasedRegistrationNames && traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event); + } + + var ResponderEventPlugin = { + _getResponder: function _getResponder() { + return responderInst; + }, + eventTypes: eventTypes, + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (isStartish(topLevelType)) trackedTouchCount += 1;else if ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType) if (0 <= trackedTouchCount) --trackedTouchCount;else return null; + ResponderTouchHistoryStore.recordTouchTrack(topLevelType, nativeEvent); + + if (targetInst && ("topScroll" === topLevelType && !nativeEvent.responderIgnoreScroll || 0 < trackedTouchCount && "topSelectionChange" === topLevelType || isStartish(topLevelType) || isMoveish(topLevelType))) { + var shouldSetEventType = isStartish(topLevelType) ? eventTypes.startShouldSetResponder : isMoveish(topLevelType) ? eventTypes.moveShouldSetResponder : "topSelectionChange" === topLevelType ? eventTypes.selectionChangeShouldSetResponder : eventTypes.scrollShouldSetResponder; + if (responderInst) b: { + var JSCompiler_temp = responderInst; + + for (var depthA = 0, tempA = JSCompiler_temp; tempA; tempA = getParent(tempA)) { + depthA++; + } + + tempA = 0; + + for (var tempB = targetInst; tempB; tempB = getParent(tempB)) { + tempA++; + } + + for (; 0 < depthA - tempA;) { + JSCompiler_temp = getParent(JSCompiler_temp), depthA--; + } + + for (; 0 < tempA - depthA;) { + targetInst = getParent(targetInst), tempA--; + } + + for (; depthA--;) { + if (JSCompiler_temp === targetInst || JSCompiler_temp === targetInst.alternate) break b; + JSCompiler_temp = getParent(JSCompiler_temp); + targetInst = getParent(targetInst); + } + + JSCompiler_temp = null; + } else JSCompiler_temp = targetInst; + targetInst = JSCompiler_temp; + JSCompiler_temp = targetInst === responderInst; + shouldSetEventType = ResponderSyntheticEvent.getPooled(shouldSetEventType, targetInst, nativeEvent, nativeEventTarget); + shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory; + JSCompiler_temp ? forEachAccumulated(shouldSetEventType, accumulateTwoPhaseDispatchesSingleSkipTarget) : forEachAccumulated(shouldSetEventType, accumulateTwoPhaseDispatchesSingle); + + b: { + JSCompiler_temp = shouldSetEventType._dispatchListeners; + targetInst = shouldSetEventType._dispatchInstances; + if (isArrayImpl(JSCompiler_temp)) for (depthA = 0; depthA < JSCompiler_temp.length && !shouldSetEventType.isPropagationStopped(); depthA++) { + if (JSCompiler_temp[depthA](shouldSetEventType, targetInst[depthA])) { + JSCompiler_temp = targetInst[depthA]; + break b; + } + } else if (JSCompiler_temp && JSCompiler_temp(shouldSetEventType, targetInst)) { + JSCompiler_temp = targetInst; + break b; + } + JSCompiler_temp = null; + } + + shouldSetEventType._dispatchInstances = null; + shouldSetEventType._dispatchListeners = null; + shouldSetEventType.isPersistent() || shouldSetEventType.constructor.release(shouldSetEventType); + if (JSCompiler_temp && JSCompiler_temp !== responderInst) { + if (shouldSetEventType = ResponderSyntheticEvent.getPooled(eventTypes.responderGrant, JSCompiler_temp, nativeEvent, nativeEventTarget), shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(shouldSetEventType, accumulateDirectDispatchesSingle), targetInst = true === executeDirectDispatch(shouldSetEventType), responderInst) { + if (depthA = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminationRequest, responderInst, nativeEvent, nativeEventTarget), depthA.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(depthA, accumulateDirectDispatchesSingle), tempA = !depthA._dispatchListeners || executeDirectDispatch(depthA), depthA.isPersistent() || depthA.constructor.release(depthA), tempA) { + depthA = ResponderSyntheticEvent.getPooled(eventTypes.responderTerminate, responderInst, nativeEvent, nativeEventTarget); + depthA.touchHistory = ResponderTouchHistoryStore.touchHistory; + forEachAccumulated(depthA, accumulateDirectDispatchesSingle); + var JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, [shouldSetEventType, depthA]); + changeResponder(JSCompiler_temp, targetInst); + } else shouldSetEventType = ResponderSyntheticEvent.getPooled(eventTypes.responderReject, JSCompiler_temp, nativeEvent, nativeEventTarget), shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(shouldSetEventType, accumulateDirectDispatchesSingle), JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, shouldSetEventType); + } else JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, shouldSetEventType), changeResponder(JSCompiler_temp, targetInst); + } else JSCompiler_temp$jscomp$0 = null; + } else JSCompiler_temp$jscomp$0 = null; + + shouldSetEventType = responderInst && isStartish(topLevelType); + JSCompiler_temp = responderInst && isMoveish(topLevelType); + targetInst = responderInst && ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType); + if (shouldSetEventType = shouldSetEventType ? eventTypes.responderStart : JSCompiler_temp ? eventTypes.responderMove : targetInst ? eventTypes.responderEnd : null) shouldSetEventType = ResponderSyntheticEvent.getPooled(shouldSetEventType, responderInst, nativeEvent, nativeEventTarget), shouldSetEventType.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(shouldSetEventType, accumulateDirectDispatchesSingle), JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, shouldSetEventType); + shouldSetEventType = responderInst && "topTouchCancel" === topLevelType; + if (topLevelType = responderInst && !shouldSetEventType && ("topTouchEnd" === topLevelType || "topTouchCancel" === topLevelType)) a: { + if ((topLevelType = nativeEvent.touches) && 0 !== topLevelType.length) for (JSCompiler_temp = 0; JSCompiler_temp < topLevelType.length; JSCompiler_temp++) { + if (targetInst = topLevelType[JSCompiler_temp].target, null !== targetInst && undefined !== targetInst && 0 !== targetInst) { + depthA = getInstanceFromNode(targetInst); + + b: { + for (targetInst = responderInst; depthA;) { + if (targetInst === depthA || targetInst === depthA.alternate) { + targetInst = true; + break b; + } + + depthA = getParent(depthA); + } + + targetInst = false; + } + + if (targetInst) { + topLevelType = false; + break a; + } + } + } + topLevelType = true; + } + if (topLevelType = shouldSetEventType ? eventTypes.responderTerminate : topLevelType ? eventTypes.responderRelease : null) nativeEvent = ResponderSyntheticEvent.getPooled(topLevelType, responderInst, nativeEvent, nativeEventTarget), nativeEvent.touchHistory = ResponderTouchHistoryStore.touchHistory, forEachAccumulated(nativeEvent, accumulateDirectDispatchesSingle), JSCompiler_temp$jscomp$0 = accumulate(JSCompiler_temp$jscomp$0, nativeEvent), changeResponder(null); + return JSCompiler_temp$jscomp$0; + }, + GlobalResponderHandler: null, + injection: { + injectGlobalResponderHandler: function injectGlobalResponderHandler(GlobalResponderHandler) { + ResponderEventPlugin.GlobalResponderHandler = GlobalResponderHandler; + } + } + }, + eventPluginOrder = null, + namesToPlugins = {}; + + function recomputePluginOrdering() { + if (eventPluginOrder) for (var pluginName in namesToPlugins) { + var pluginModule = namesToPlugins[pluginName], + pluginIndex = eventPluginOrder.indexOf(pluginName); + if (!(-1 < pluginIndex)) throw Error("EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `" + pluginName + "`."); + + if (!plugins[pluginIndex]) { + if (!pluginModule.extractEvents) throw Error("EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `" + pluginName + "` does not."); + plugins[pluginIndex] = pluginModule; + pluginIndex = pluginModule.eventTypes; + + for (var eventName in pluginIndex) { + var JSCompiler_inline_result = undefined; + var dispatchConfig = pluginIndex[eventName], + eventName$jscomp$0 = eventName; + if (eventNameDispatchConfigs.hasOwnProperty(eventName$jscomp$0)) throw Error("EventPluginRegistry: More than one plugin attempted to publish the same event name, `" + eventName$jscomp$0 + "`."); + eventNameDispatchConfigs[eventName$jscomp$0] = dispatchConfig; + var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames; + + if (phasedRegistrationNames) { + for (JSCompiler_inline_result in phasedRegistrationNames) { + phasedRegistrationNames.hasOwnProperty(JSCompiler_inline_result) && publishRegistrationName(phasedRegistrationNames[JSCompiler_inline_result], pluginModule, eventName$jscomp$0); + } + + JSCompiler_inline_result = true; + } else dispatchConfig.registrationName ? (publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName$jscomp$0), JSCompiler_inline_result = true) : JSCompiler_inline_result = false; + + if (!JSCompiler_inline_result) throw Error("EventPluginRegistry: Failed to publish event `" + eventName + "` for plugin `" + pluginName + "`."); + } + } + } + } + + function publishRegistrationName(registrationName, pluginModule) { + if (registrationNameModules[registrationName]) throw Error("EventPluginRegistry: More than one plugin attempted to publish the same registration name, `" + registrationName + "`."); + registrationNameModules[registrationName] = pluginModule; + } + + var plugins = [], + eventNameDispatchConfigs = {}, + registrationNameModules = {}; + + function getListener$1(inst, registrationName) { + inst = inst.stateNode; + if (null === inst) return null; + inst = getFiberCurrentPropsFromNode(inst); + if (null === inst) return null; + if ((inst = inst[registrationName]) && "function" !== typeof inst) throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof inst + "` type."); + return inst; + } + + var customBubblingEventTypes = _$$_REQUIRE(_dependencyMap[3]).ReactNativeViewConfigRegistry.customBubblingEventTypes, + customDirectEventTypes = _$$_REQUIRE(_dependencyMap[3]).ReactNativeViewConfigRegistry.customDirectEventTypes; + + function accumulateDirectionalDispatches$1(inst, phase, event) { + if (phase = getListener$1(inst, event.dispatchConfig.phasedRegistrationNames[phase])) event._dispatchListeners = accumulateInto(event._dispatchListeners, phase), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst); + } + + function accumulateTwoPhaseDispatchesSingle$1(event) { + if (event && event.dispatchConfig.phasedRegistrationNames) { + for (var inst = event._targetInst, path = []; inst;) { + path.push(inst); + + do { + inst = inst.return; + } while (inst && 5 !== inst.tag); + + inst = inst ? inst : null; + } + + for (inst = path.length; 0 < inst--;) { + accumulateDirectionalDispatches$1(path[inst], "captured", event); + } + + for (inst = 0; inst < path.length; inst++) { + accumulateDirectionalDispatches$1(path[inst], "bubbled", event); + } + } + } + + function accumulateDirectDispatchesSingle$1(event) { + if (event && event.dispatchConfig.registrationName) { + var inst = event._targetInst; + + if (inst && event && event.dispatchConfig.registrationName) { + var listener = getListener$1(inst, event.dispatchConfig.registrationName); + listener && (event._dispatchListeners = accumulateInto(event._dispatchListeners, listener), event._dispatchInstances = accumulateInto(event._dispatchInstances, inst)); + } + } + } + + if (eventPluginOrder) throw Error("EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React."); + eventPluginOrder = Array.prototype.slice.call(["ResponderEventPlugin", "ReactNativeBridgeEventPlugin"]); + recomputePluginOrdering(); + var injectedNamesToPlugins$jscomp$inline_216 = { + ResponderEventPlugin: ResponderEventPlugin, + ReactNativeBridgeEventPlugin: { + eventTypes: {}, + extractEvents: function extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget) { + if (null == targetInst) return null; + var bubbleDispatchConfig = customBubblingEventTypes[topLevelType], + directDispatchConfig = customDirectEventTypes[topLevelType]; + if (!bubbleDispatchConfig && !directDispatchConfig) throw Error('Unsupported top level event type "' + topLevelType + '" dispatched'); + topLevelType = SyntheticEvent.getPooled(bubbleDispatchConfig || directDispatchConfig, targetInst, nativeEvent, nativeEventTarget); + if (bubbleDispatchConfig) forEachAccumulated(topLevelType, accumulateTwoPhaseDispatchesSingle$1);else if (directDispatchConfig) forEachAccumulated(topLevelType, accumulateDirectDispatchesSingle$1);else return null; + return topLevelType; + } + } + }, + isOrderingDirty$jscomp$inline_217 = false, + pluginName$jscomp$inline_218; + + for (pluginName$jscomp$inline_218 in injectedNamesToPlugins$jscomp$inline_216) { + if (injectedNamesToPlugins$jscomp$inline_216.hasOwnProperty(pluginName$jscomp$inline_218)) { + var pluginModule$jscomp$inline_219 = injectedNamesToPlugins$jscomp$inline_216[pluginName$jscomp$inline_218]; + + if (!namesToPlugins.hasOwnProperty(pluginName$jscomp$inline_218) || namesToPlugins[pluginName$jscomp$inline_218] !== pluginModule$jscomp$inline_219) { + if (namesToPlugins[pluginName$jscomp$inline_218]) throw Error("EventPluginRegistry: Cannot inject two different event plugins using the same name, `" + pluginName$jscomp$inline_218 + "`."); + namesToPlugins[pluginName$jscomp$inline_218] = pluginModule$jscomp$inline_219; + isOrderingDirty$jscomp$inline_217 = true; + } + } + } + + isOrderingDirty$jscomp$inline_217 && recomputePluginOrdering(); + + function getInstanceFromInstance(instanceHandle) { + return instanceHandle; + } + + getFiberCurrentPropsFromNode = function getFiberCurrentPropsFromNode(inst) { + return inst.canonical.currentProps; + }; + + getInstanceFromNode = getInstanceFromInstance; + + getNodeFromInstance = function getNodeFromInstance(inst) { + inst = inst.stateNode.canonical; + if (!inst._nativeTag) throw Error("All native instances should have a tag."); + return inst; + }; + + ResponderEventPlugin.injection.injectGlobalResponderHandler({ + onChange: function onChange(from, to, blockNativeResponder) { + var fromOrTo = from || to; + (fromOrTo = fromOrTo && fromOrTo.stateNode) && fromOrTo.canonical._internalInstanceHandle ? (from && nativeFabricUIManager.setIsJSResponder(from.stateNode.node, false, blockNativeResponder || false), to && nativeFabricUIManager.setIsJSResponder(to.stateNode.node, true, blockNativeResponder || false)) : null !== to ? _$$_REQUIRE(_dependencyMap[3]).UIManager.setJSResponder(to.stateNode.canonical._nativeTag, blockNativeResponder) : _$$_REQUIRE(_dependencyMap[3]).UIManager.clearJSResponder(); + } + }); + var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, + REACT_ELEMENT_TYPE = 60103, + REACT_PORTAL_TYPE = 60106, + REACT_FRAGMENT_TYPE = 60107, + REACT_STRICT_MODE_TYPE = 60108, + REACT_PROFILER_TYPE = 60114, + REACT_PROVIDER_TYPE = 60109, + REACT_CONTEXT_TYPE = 60110, + REACT_FORWARD_REF_TYPE = 60112, + REACT_SUSPENSE_TYPE = 60113, + REACT_SUSPENSE_LIST_TYPE = 60120, + REACT_MEMO_TYPE = 60115, + REACT_LAZY_TYPE = 60116, + REACT_DEBUG_TRACING_MODE_TYPE = 60129, + REACT_OFFSCREEN_TYPE = 60130, + REACT_LEGACY_HIDDEN_TYPE = 60131, + REACT_CACHE_TYPE = 60132; + + if ("function" === typeof Symbol && Symbol.for) { + var symbolFor = Symbol.for; + REACT_ELEMENT_TYPE = symbolFor("react.element"); + REACT_PORTAL_TYPE = symbolFor("react.portal"); + REACT_FRAGMENT_TYPE = symbolFor("react.fragment"); + REACT_STRICT_MODE_TYPE = symbolFor("react.strict_mode"); + REACT_PROFILER_TYPE = symbolFor("react.profiler"); + REACT_PROVIDER_TYPE = symbolFor("react.provider"); + REACT_CONTEXT_TYPE = symbolFor("react.context"); + REACT_FORWARD_REF_TYPE = symbolFor("react.forward_ref"); + REACT_SUSPENSE_TYPE = symbolFor("react.suspense"); + REACT_SUSPENSE_LIST_TYPE = symbolFor("react.suspense_list"); + REACT_MEMO_TYPE = symbolFor("react.memo"); + REACT_LAZY_TYPE = symbolFor("react.lazy"); + symbolFor("react.scope"); + REACT_DEBUG_TRACING_MODE_TYPE = symbolFor("react.debug_trace_mode"); + REACT_OFFSCREEN_TYPE = symbolFor("react.offscreen"); + REACT_LEGACY_HIDDEN_TYPE = symbolFor("react.legacy_hidden"); + REACT_CACHE_TYPE = symbolFor("react.cache"); + } + + var MAYBE_ITERATOR_SYMBOL = "function" === typeof Symbol && Symbol.iterator; + + function getIteratorFn(maybeIterable) { + if (null === maybeIterable || "object" !== typeof maybeIterable) return null; + maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"]; + return "function" === typeof maybeIterable ? maybeIterable : null; + } + + function getComponentNameFromType(type) { + if (null == type) return null; + if ("function" === typeof type) return type.displayName || type.name || null; + if ("string" === typeof type) return type; + + switch (type) { + case REACT_FRAGMENT_TYPE: + return "Fragment"; + + case REACT_PORTAL_TYPE: + return "Portal"; + + case REACT_PROFILER_TYPE: + return "Profiler"; + + case REACT_STRICT_MODE_TYPE: + return "StrictMode"; + + case REACT_SUSPENSE_TYPE: + return "Suspense"; + + case REACT_SUSPENSE_LIST_TYPE: + return "SuspenseList"; + + case REACT_CACHE_TYPE: + return "Cache"; + } + + if ("object" === typeof type) switch (type.$$typeof) { + case REACT_CONTEXT_TYPE: + return (type.displayName || "Context") + ".Consumer"; + + case REACT_PROVIDER_TYPE: + return (type._context.displayName || "Context") + ".Provider"; + + case REACT_FORWARD_REF_TYPE: + var innerType = type.render; + type = type.displayName; + type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"); + return type; + + case REACT_MEMO_TYPE: + return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo"; + + case REACT_LAZY_TYPE: + innerType = type._payload; + type = type._init; + + try { + return getComponentNameFromType(type(innerType)); + } catch (x) {} + + } + return null; + } + + function getComponentNameFromFiber(fiber) { + var type = fiber.type; + + switch (fiber.tag) { + case 24: + return "Cache"; + + case 9: + return (type.displayName || "Context") + ".Consumer"; + + case 10: + return (type._context.displayName || "Context") + ".Provider"; + + case 18: + return "DehydratedFragment"; + + case 11: + return fiber = type.render, fiber = fiber.displayName || fiber.name || "", type.displayName || ("" !== fiber ? "ForwardRef(" + fiber + ")" : "ForwardRef"); + + case 7: + return "Fragment"; + + case 5: + return type; + + case 4: + return "Portal"; + + case 3: + return "Root"; + + case 6: + return "Text"; + + case 16: + return getComponentNameFromType(type); + + case 23: + return "LegacyHidden"; + + case 8: + return type === REACT_STRICT_MODE_TYPE ? "StrictMode" : "Mode"; + + case 22: + return "Offscreen"; + + case 12: + return "Profiler"; + + case 21: + return "Scope"; + + case 13: + return "Suspense"; + + case 19: + return "SuspenseList"; + + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if ("function" === typeof type) return type.displayName || type.name || null; + if ("string" === typeof type) return type; + } + + return null; + } + + function getNearestMountedFiber(fiber) { + var node = fiber, + nearestMounted = fiber; + if (fiber.alternate) for (; node.return;) { + node = node.return; + } else { + fiber = node; + + do { + node = fiber, 0 !== (node.flags & 2050) && (nearestMounted = node.return), fiber = node.return; + } while (fiber); + } + return 3 === node.tag ? nearestMounted : null; + } + + function assertIsMounted(fiber) { + if (getNearestMountedFiber(fiber) !== fiber) throw Error("Unable to find node on an unmounted component."); + } + + function findCurrentFiberUsingSlowPath(fiber) { + var alternate = fiber.alternate; + + if (!alternate) { + alternate = getNearestMountedFiber(fiber); + if (null === alternate) throw Error("Unable to find node on an unmounted component."); + return alternate !== fiber ? null : fiber; + } + + for (var a = fiber, b = alternate;;) { + var parentA = a.return; + if (null === parentA) break; + var parentB = parentA.alternate; + + if (null === parentB) { + b = parentA.return; + + if (null !== b) { + a = b; + continue; + } + + break; + } + + if (parentA.child === parentB.child) { + for (parentB = parentA.child; parentB;) { + if (parentB === a) return assertIsMounted(parentA), fiber; + if (parentB === b) return assertIsMounted(parentA), alternate; + parentB = parentB.sibling; + } + + throw Error("Unable to find node on an unmounted component."); + } + + if (a.return !== b.return) a = parentA, b = parentB;else { + for (var didFindChild = false, child$0 = parentA.child; child$0;) { + if (child$0 === a) { + didFindChild = true; + a = parentA; + b = parentB; + break; + } + + if (child$0 === b) { + didFindChild = true; + b = parentA; + a = parentB; + break; + } + + child$0 = child$0.sibling; + } + + if (!didFindChild) { + for (child$0 = parentB.child; child$0;) { + if (child$0 === a) { + didFindChild = true; + a = parentB; + b = parentA; + break; + } + + if (child$0 === b) { + didFindChild = true; + b = parentB; + a = parentA; + break; + } + + child$0 = child$0.sibling; + } + + if (!didFindChild) throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue."); + } + } + if (a.alternate !== b) throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue."); + } + + if (3 !== a.tag) throw Error("Unable to find node on an unmounted component."); + return a.stateNode.current === a ? fiber : alternate; + } + + function findCurrentHostFiber(parent) { + parent = findCurrentFiberUsingSlowPath(parent); + return null !== parent ? findCurrentHostFiberImpl(parent) : null; + } + + function findCurrentHostFiberImpl(node) { + if (5 === node.tag || 6 === node.tag) return node; + + for (node = node.child; null !== node;) { + var match = findCurrentHostFiberImpl(node); + if (null !== match) return match; + node = node.sibling; + } + + return null; + } + + function mountSafeCallback_NOT_REALLY_SAFE(context, callback) { + return function () { + if (callback && ("boolean" !== typeof context.__isMounted || context.__isMounted)) return callback.apply(context, arguments); + }; + } + + var emptyObject = {}, + removedKeys = null, + removedKeyCount = 0, + deepDifferOptions = { + unsafelyIgnoreFunctions: true + }; + + function defaultDiffer(prevProp, nextProp) { + return "object" !== typeof nextProp || null === nextProp ? true : _$$_REQUIRE(_dependencyMap[3]).deepDiffer(prevProp, nextProp, deepDifferOptions); + } + + function restoreDeletedValuesInNestedArray(updatePayload, node, validAttributes) { + if (isArrayImpl(node)) for (var i = node.length; i-- && 0 < removedKeyCount;) { + restoreDeletedValuesInNestedArray(updatePayload, node[i], validAttributes); + } else if (node && 0 < removedKeyCount) for (i in removedKeys) { + if (removedKeys[i]) { + var nextProp = node[i]; + + if (undefined !== nextProp) { + var attributeConfig = validAttributes[i]; + + if (attributeConfig) { + "function" === typeof nextProp && (nextProp = true); + "undefined" === typeof nextProp && (nextProp = null); + if ("object" !== typeof attributeConfig) updatePayload[i] = nextProp;else if ("function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process) nextProp = "function" === typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, updatePayload[i] = nextProp; + removedKeys[i] = false; + removedKeyCount--; + } + } + } + } + } + + function diffNestedProperty(updatePayload, prevProp, nextProp, validAttributes) { + if (!updatePayload && prevProp === nextProp) return updatePayload; + if (!prevProp || !nextProp) return nextProp ? addNestedProperty(updatePayload, nextProp, validAttributes) : prevProp ? clearNestedProperty(updatePayload, prevProp, validAttributes) : updatePayload; + if (!isArrayImpl(prevProp) && !isArrayImpl(nextProp)) return diffProperties(updatePayload, prevProp, nextProp, validAttributes); + + if (isArrayImpl(prevProp) && isArrayImpl(nextProp)) { + var minLength = prevProp.length < nextProp.length ? prevProp.length : nextProp.length, + i; + + for (i = 0; i < minLength; i++) { + updatePayload = diffNestedProperty(updatePayload, prevProp[i], nextProp[i], validAttributes); + } + + for (; i < prevProp.length; i++) { + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + + for (; i < nextProp.length; i++) { + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + + return updatePayload; + } + + return isArrayImpl(prevProp) ? diffProperties(updatePayload, _$$_REQUIRE(_dependencyMap[3]).flattenStyle(prevProp), nextProp, validAttributes) : diffProperties(updatePayload, prevProp, _$$_REQUIRE(_dependencyMap[3]).flattenStyle(nextProp), validAttributes); + } + + function addNestedProperty(updatePayload, nextProp, validAttributes) { + if (!nextProp) return updatePayload; + if (!isArrayImpl(nextProp)) return diffProperties(updatePayload, emptyObject, nextProp, validAttributes); + + for (var i = 0; i < nextProp.length; i++) { + updatePayload = addNestedProperty(updatePayload, nextProp[i], validAttributes); + } + + return updatePayload; + } + + function clearNestedProperty(updatePayload, prevProp, validAttributes) { + if (!prevProp) return updatePayload; + if (!isArrayImpl(prevProp)) return diffProperties(updatePayload, prevProp, emptyObject, validAttributes); + + for (var i = 0; i < prevProp.length; i++) { + updatePayload = clearNestedProperty(updatePayload, prevProp[i], validAttributes); + } + + return updatePayload; + } + + function diffProperties(updatePayload, prevProps, nextProps, validAttributes) { + var attributeConfig, propKey; + + for (propKey in nextProps) { + if (attributeConfig = validAttributes[propKey]) { + var prevProp = prevProps[propKey]; + var nextProp = nextProps[propKey]; + "function" === typeof nextProp && (nextProp = true, "function" === typeof prevProp && (prevProp = true)); + "undefined" === typeof nextProp && (nextProp = null, "undefined" === typeof prevProp && (prevProp = null)); + removedKeys && (removedKeys[propKey] = false); + if (updatePayload && undefined !== updatePayload[propKey]) { + if ("object" !== typeof attributeConfig) updatePayload[propKey] = nextProp;else { + if ("function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process) attributeConfig = "function" === typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, updatePayload[propKey] = attributeConfig; + } + } else if (prevProp !== nextProp) if ("object" !== typeof attributeConfig) defaultDiffer(prevProp, nextProp) && ((updatePayload || (updatePayload = {}))[propKey] = nextProp);else if ("function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process) { + if (undefined === prevProp || ("function" === typeof attributeConfig.diff ? attributeConfig.diff(prevProp, nextProp) : defaultDiffer(prevProp, nextProp))) attributeConfig = "function" === typeof attributeConfig.process ? attributeConfig.process(nextProp) : nextProp, (updatePayload || (updatePayload = {}))[propKey] = attributeConfig; + } else removedKeys = null, removedKeyCount = 0, updatePayload = diffNestedProperty(updatePayload, prevProp, nextProp, attributeConfig), 0 < removedKeyCount && updatePayload && (restoreDeletedValuesInNestedArray(updatePayload, nextProp, attributeConfig), removedKeys = null); + } + } + + for (var propKey$2 in prevProps) { + undefined === nextProps[propKey$2] && (!(attributeConfig = validAttributes[propKey$2]) || updatePayload && undefined !== updatePayload[propKey$2] || (prevProp = prevProps[propKey$2], undefined !== prevProp && ("object" !== typeof attributeConfig || "function" === typeof attributeConfig.diff || "function" === typeof attributeConfig.process ? ((updatePayload || (updatePayload = {}))[propKey$2] = null, removedKeys || (removedKeys = {}), removedKeys[propKey$2] || (removedKeys[propKey$2] = true, removedKeyCount++)) : updatePayload = clearNestedProperty(updatePayload, prevProp, attributeConfig)))); + } + + return updatePayload; + } + + function batchedUpdatesImpl(fn, bookkeeping) { + return fn(bookkeeping); + } + + var isInsideEventHandler = false; + + function batchedUpdates(fn, bookkeeping) { + if (isInsideEventHandler) return fn(bookkeeping); + isInsideEventHandler = true; + + try { + return batchedUpdatesImpl(fn, bookkeeping); + } finally { + isInsideEventHandler = false; + } + } + + var eventQueue = null; + + function executeDispatchesAndReleaseTopLevel(e) { + if (e) { + var dispatchListeners = e._dispatchListeners, + dispatchInstances = e._dispatchInstances; + if (isArrayImpl(dispatchListeners)) for (var i = 0; i < dispatchListeners.length && !e.isPropagationStopped(); i++) { + executeDispatch(e, dispatchListeners[i], dispatchInstances[i]); + } else dispatchListeners && executeDispatch(e, dispatchListeners, dispatchInstances); + e._dispatchListeners = null; + e._dispatchInstances = null; + e.isPersistent() || e.constructor.release(e); + } + } + + function dispatchEvent(target, topLevelType, nativeEvent) { + var eventTarget = null; + + if (null != target) { + var stateNode = target.stateNode; + null != stateNode && (eventTarget = stateNode.canonical); + } + + batchedUpdates(function () { + var JSCompiler_inline_result = eventTarget; + + for (var events = null, legacyPlugins = plugins, i = 0; i < legacyPlugins.length; i++) { + var possiblePlugin = legacyPlugins[i]; + possiblePlugin && (possiblePlugin = possiblePlugin.extractEvents(topLevelType, target, nativeEvent, JSCompiler_inline_result)) && (events = accumulateInto(events, possiblePlugin)); + } + + JSCompiler_inline_result = events; + null !== JSCompiler_inline_result && (eventQueue = accumulateInto(eventQueue, JSCompiler_inline_result)); + JSCompiler_inline_result = eventQueue; + eventQueue = null; + + if (JSCompiler_inline_result) { + forEachAccumulated(JSCompiler_inline_result, executeDispatchesAndReleaseTopLevel); + if (eventQueue) throw Error("processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented."); + if (hasRethrowError) throw JSCompiler_inline_result = rethrowError, hasRethrowError = false, rethrowError = null, JSCompiler_inline_result; + } + }); + } + + var rendererID = null, + injectedHook = null; + + function onCommitRoot(root) { + if (injectedHook && "function" === typeof injectedHook.onCommitFiberRoot) try { + injectedHook.onCommitFiberRoot(rendererID, root, undefined, 128 === (root.current.flags & 128)); + } catch (err) {} + } + + var nextTransitionLane = 64, + nextRetryLane = 4194304; + + function getHighestPriorityLanes(lanes) { + switch (lanes & -lanes) { + case 1: + return 1; + + case 2: + return 2; + + case 4: + return 4; + + case 8: + return 8; + + case 16: + return 16; + + case 32: + return 32; + + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return lanes & 4194240; + + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return lanes & 130023424; + + case 134217728: + return 134217728; + + case 268435456: + return 268435456; + + case 536870912: + return 536870912; + + case 1073741824: + return 1073741824; + + default: + return lanes; + } + } + + function getNextLanes(root, wipLanes) { + var pendingLanes = root.pendingLanes; + if (0 === pendingLanes) return 0; + var nextLanes = 0, + suspendedLanes = root.suspendedLanes, + pingedLanes = root.pingedLanes, + nonIdlePendingLanes = pendingLanes & 268435455; + + if (0 !== nonIdlePendingLanes) { + var nonIdleUnblockedLanes = nonIdlePendingLanes & ~suspendedLanes; + 0 !== nonIdleUnblockedLanes ? nextLanes = getHighestPriorityLanes(nonIdleUnblockedLanes) : (pingedLanes &= nonIdlePendingLanes, 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes))); + } else nonIdlePendingLanes = pendingLanes & ~suspendedLanes, 0 !== nonIdlePendingLanes ? nextLanes = getHighestPriorityLanes(nonIdlePendingLanes) : 0 !== pingedLanes && (nextLanes = getHighestPriorityLanes(pingedLanes)); + + if (0 === nextLanes) return 0; + if (0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && (suspendedLanes = nextLanes & -nextLanes, pingedLanes = wipLanes & -wipLanes, suspendedLanes >= pingedLanes || 16 === suspendedLanes && 0 !== (pingedLanes & 4194240))) return wipLanes; + 0 !== (nextLanes & 4) && (nextLanes |= pendingLanes & 16); + wipLanes = root.entangledLanes; + if (0 !== wipLanes) for (root = root.entanglements, wipLanes &= nextLanes; 0 < wipLanes;) { + pendingLanes = 31 - clz32(wipLanes), suspendedLanes = 1 << pendingLanes, nextLanes |= root[pendingLanes], wipLanes &= ~suspendedLanes; + } + return nextLanes; + } + + function computeExpirationTime(lane, currentTime) { + switch (lane) { + case 1: + case 2: + case 4: + return currentTime + 250; + + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return currentTime + 5e3; + + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + + default: + return -1; + } + } + + function getLanesToRetrySynchronouslyOnError(root) { + root = root.pendingLanes & -1073741825; + return 0 !== root ? root : root & 1073741824 ? 1073741824 : 0; + } + + function createLaneMap(initial) { + for (var laneMap = [], i = 0; 31 > i; i++) { + laneMap.push(initial); + } + + return laneMap; + } + + function markRootUpdated(root, updateLane, eventTime) { + root.pendingLanes |= updateLane; + 536870912 !== updateLane && (root.suspendedLanes = 0, root.pingedLanes = 0); + root = root.eventTimes; + updateLane = 31 - clz32(updateLane); + root[updateLane] = eventTime; + } + + function markRootFinished(root, remainingLanes) { + var noLongerPendingLanes = root.pendingLanes & ~remainingLanes; + root.pendingLanes = remainingLanes; + root.suspendedLanes = 0; + root.pingedLanes = 0; + root.expiredLanes &= remainingLanes; + root.mutableReadLanes &= remainingLanes; + root.entangledLanes &= remainingLanes; + remainingLanes = root.entanglements; + var eventTimes = root.eventTimes; + + for (root = root.expirationTimes; 0 < noLongerPendingLanes;) { + var index$7 = 31 - clz32(noLongerPendingLanes), + lane = 1 << index$7; + remainingLanes[index$7] = 0; + eventTimes[index$7] = -1; + root[index$7] = -1; + noLongerPendingLanes &= ~lane; + } + } + + function markRootEntangled(root, entangledLanes) { + var rootEntangledLanes = root.entangledLanes |= entangledLanes; + + for (root = root.entanglements; rootEntangledLanes;) { + var index$8 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$8; + lane & entangledLanes | root[index$8] & entangledLanes && (root[index$8] |= entangledLanes); + rootEntangledLanes &= ~lane; + } + } + + var clz32 = Math.clz32 ? Math.clz32 : clz32Fallback, + log = Math.log, + LN2 = Math.LN2; + + function clz32Fallback(lanes) { + return 0 === lanes ? 32 : 31 - (log(lanes) / LN2 | 0) | 0; + } + + var currentUpdatePriority = 0; + + function lanesToEventPriority(lanes) { + lanes &= -lanes; + return 1 < lanes ? 4 < lanes ? 0 !== (lanes & 268435455) ? 16 : 536870912 : 4 : 1; + } + + function shim() { + throw Error("The current renderer does not support mutation. This error is likely caused by a bug in React. Please file an issue."); + } + + function shim$1() { + throw Error("The current renderer does not support hydration. This error is likely caused by a bug in React. Please file an issue."); + } + + var _nativeFabricUIManage = nativeFabricUIManager, + createNode = _nativeFabricUIManage.createNode, + cloneNode = _nativeFabricUIManage.cloneNode, + cloneNodeWithNewChildren = _nativeFabricUIManage.cloneNodeWithNewChildren, + cloneNodeWithNewChildrenAndProps = _nativeFabricUIManage.cloneNodeWithNewChildrenAndProps, + cloneNodeWithNewProps = _nativeFabricUIManage.cloneNodeWithNewProps, + createChildNodeSet = _nativeFabricUIManage.createChildSet, + appendChildNode = _nativeFabricUIManage.appendChild, + appendChildNodeToSet = _nativeFabricUIManage.appendChildToSet, + completeRoot = _nativeFabricUIManage.completeRoot, + registerEventHandler = _nativeFabricUIManage.registerEventHandler, + fabricMeasure = _nativeFabricUIManage.measure, + fabricMeasureInWindow = _nativeFabricUIManage.measureInWindow, + fabricMeasureLayout = _nativeFabricUIManage.measureLayout, + FabricDiscretePriority = _nativeFabricUIManage.unstable_DiscreteEventPriority, + fabricGetCurrentEventPriority = _nativeFabricUIManage.unstable_getCurrentEventPriority, + getViewConfigForType = _$$_REQUIRE(_dependencyMap[3]).ReactNativeViewConfigRegistry.get, + nextReactTag = 2; + + registerEventHandler && registerEventHandler(dispatchEvent); + + var ReactFabricHostComponent = function () { + function ReactFabricHostComponent(tag, viewConfig, props, internalInstanceHandle) { + this._nativeTag = tag; + this.viewConfig = viewConfig; + this.currentProps = props; + this._internalInstanceHandle = internalInstanceHandle; + } + + var _proto = ReactFabricHostComponent.prototype; + + _proto.blur = function () { + _$$_REQUIRE(_dependencyMap[3]).TextInputState.blurTextInput(this); + }; + + _proto.focus = function () { + _$$_REQUIRE(_dependencyMap[3]).TextInputState.focusTextInput(this); + }; + + _proto.measure = function (callback) { + fabricMeasure(this._internalInstanceHandle.stateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + + _proto.measureInWindow = function (callback) { + fabricMeasureInWindow(this._internalInstanceHandle.stateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, callback)); + }; + + _proto.measureLayout = function (relativeToNativeNode, onSuccess, onFail) { + "number" !== typeof relativeToNativeNode && relativeToNativeNode instanceof ReactFabricHostComponent && fabricMeasureLayout(this._internalInstanceHandle.stateNode.node, relativeToNativeNode._internalInstanceHandle.stateNode.node, mountSafeCallback_NOT_REALLY_SAFE(this, onFail), mountSafeCallback_NOT_REALLY_SAFE(this, onSuccess)); + }; + + _proto.setNativeProps = function () {}; + + return ReactFabricHostComponent; + }(); + + function createTextInstance(text, rootContainerInstance, hostContext, internalInstanceHandle) { + if (!hostContext.isInAParentText) throw Error("Text strings must be rendered within a component."); + hostContext = nextReactTag; + nextReactTag += 2; + return { + node: createNode(hostContext, "RCTRawText", rootContainerInstance, { + text: text + }, internalInstanceHandle) + }; + } + + var scheduleTimeout = setTimeout, + cancelTimeout = clearTimeout; + + function cloneHiddenInstance(instance) { + var node = instance.node; + var JSCompiler_inline_result = diffProperties(null, emptyObject, { + style: { + display: "none" + } + }, instance.canonical.viewConfig.validAttributes); + return { + node: cloneNodeWithNewProps(node, JSCompiler_inline_result), + canonical: instance.canonical + }; + } + + function describeComponentFrame(name, source, ownerName) { + source = ""; + ownerName && (source = " (created by " + ownerName + ")"); + return "\n in " + (name || "Unknown") + source; + } + + function describeFunctionComponentFrame(fn, source) { + return fn ? describeComponentFrame(fn.displayName || fn.name || null, source, null) : ""; + } + + var hasOwnProperty = Object.prototype.hasOwnProperty, + valueStack = [], + index = -1; + + function createCursor(defaultValue) { + return { + current: defaultValue + }; + } + + function pop(cursor) { + 0 > index || (cursor.current = valueStack[index], valueStack[index] = null, index--); + } + + function push(cursor, value) { + index++; + valueStack[index] = cursor.current; + cursor.current = value; + } + + var emptyContextObject = {}, + contextStackCursor = createCursor(emptyContextObject), + didPerformWorkStackCursor = createCursor(false), + previousContext = emptyContextObject; + + function getMaskedContext(workInProgress, unmaskedContext) { + var contextTypes = workInProgress.type.contextTypes; + if (!contextTypes) return emptyContextObject; + var instance = workInProgress.stateNode; + if (instance && instance.__reactInternalMemoizedUnmaskedChildContext === unmaskedContext) return instance.__reactInternalMemoizedMaskedChildContext; + var context = {}, + key; + + for (key in contextTypes) { + context[key] = unmaskedContext[key]; + } + + instance && (workInProgress = workInProgress.stateNode, workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext, workInProgress.__reactInternalMemoizedMaskedChildContext = context); + return context; + } + + function isContextProvider(type) { + type = type.childContextTypes; + return null !== type && undefined !== type; + } + + function popContext() { + pop(didPerformWorkStackCursor); + pop(contextStackCursor); + } + + function pushTopLevelContextObject(fiber, context, didChange) { + if (contextStackCursor.current !== emptyContextObject) throw Error("Unexpected context found on stack. This error is likely caused by a bug in React. Please file an issue."); + push(contextStackCursor, context); + push(didPerformWorkStackCursor, didChange); + } + + function processChildContext(fiber, type, parentContext) { + var instance = fiber.stateNode; + type = type.childContextTypes; + if ("function" !== typeof instance.getChildContext) return parentContext; + instance = instance.getChildContext(); + + for (var contextKey in instance) { + if (!(contextKey in type)) throw Error((getComponentNameFromFiber(fiber) || "Unknown") + '.getChildContext(): key "' + contextKey + '" is not defined in childContextTypes.'); + } + + return _$$_REQUIRE(_dependencyMap[2])({}, parentContext, instance); + } + + function pushContextProvider(workInProgress) { + workInProgress = (workInProgress = workInProgress.stateNode) && workInProgress.__reactInternalMemoizedMergedChildContext || emptyContextObject; + previousContext = contextStackCursor.current; + push(contextStackCursor, workInProgress); + push(didPerformWorkStackCursor, didPerformWorkStackCursor.current); + return true; + } + + function invalidateContextProvider(workInProgress, type, didChange) { + var instance = workInProgress.stateNode; + if (!instance) throw Error("Expected to have an instance by this point. This error is likely caused by a bug in React. Please file an issue."); + didChange ? (workInProgress = processChildContext(workInProgress, type, previousContext), instance.__reactInternalMemoizedMergedChildContext = workInProgress, pop(didPerformWorkStackCursor), pop(contextStackCursor), push(contextStackCursor, workInProgress)) : pop(didPerformWorkStackCursor); + push(didPerformWorkStackCursor, didChange); + } + + var syncQueue = null, + includesLegacySyncCallbacks = false, + isFlushingSyncQueue = false; + + function flushSyncCallbacks() { + if (!isFlushingSyncQueue && null !== syncQueue) { + isFlushingSyncQueue = true; + var i = 0, + previousUpdatePriority = currentUpdatePriority; + + try { + var queue = syncQueue; + + for (currentUpdatePriority = 1; i < queue.length; i++) { + var callback = queue[i]; + + do { + callback = callback(true); + } while (null !== callback); + } + + syncQueue = null; + includesLegacySyncCallbacks = false; + } catch (error) { + throw null !== syncQueue && (syncQueue = syncQueue.slice(i + 1)), _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[4]).unstable_ImmediatePriority, flushSyncCallbacks), error; + } finally { + currentUpdatePriority = previousUpdatePriority, isFlushingSyncQueue = false; + } + } + + return null; + } + + var ReactCurrentBatchConfig = ReactSharedInternals.ReactCurrentBatchConfig; + + function is(x, y) { + return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; + } + + var objectIs = "function" === typeof Object.is ? Object.is : is; + + function shallowEqual(objA, objB) { + if (objectIs(objA, objB)) return true; + if ("object" !== typeof objA || null === objA || "object" !== typeof objB || null === objB) return false; + var keysA = Object.keys(objA), + keysB = Object.keys(objB); + if (keysA.length !== keysB.length) return false; + + for (keysB = 0; keysB < keysA.length; keysB++) { + if (!hasOwnProperty.call(objB, keysA[keysB]) || !objectIs(objA[keysA[keysB]], objB[keysA[keysB]])) return false; + } + + return true; + } + + function describeFiber(fiber) { + switch (fiber.tag) { + case 5: + return describeComponentFrame(fiber.type, null, null); + + case 16: + return describeComponentFrame("Lazy", null, null); + + case 13: + return describeComponentFrame("Suspense", null, null); + + case 19: + return describeComponentFrame("SuspenseList", null, null); + + case 0: + case 2: + case 15: + return describeFunctionComponentFrame(fiber.type, null); + + case 11: + return describeFunctionComponentFrame(fiber.type.render, null); + + case 1: + return fiber = describeFunctionComponentFrame(fiber.type, null), fiber; + + default: + return ""; + } + } + + function resolveDefaultProps(Component, baseProps) { + if (Component && Component.defaultProps) { + baseProps = _$$_REQUIRE(_dependencyMap[2])({}, baseProps); + Component = Component.defaultProps; + + for (var propName in Component) { + undefined === baseProps[propName] && (baseProps[propName] = Component[propName]); + } + + return baseProps; + } + + return baseProps; + } + + var valueCursor = createCursor(null), + currentlyRenderingFiber = null, + lastContextDependency = null, + lastFullyObservedContext = null; + + function resetContextDependencies() { + lastFullyObservedContext = lastContextDependency = currentlyRenderingFiber = null; + } + + function popProvider(context) { + var currentValue = valueCursor.current; + pop(valueCursor); + context._currentValue2 = currentValue; + } + + function scheduleWorkOnParentPath(parent, renderLanes) { + for (; null !== parent;) { + var alternate = parent.alternate; + if ((parent.childLanes & renderLanes) === renderLanes) { + if (null === alternate || (alternate.childLanes & renderLanes) === renderLanes) break;else alternate.childLanes |= renderLanes; + } else parent.childLanes |= renderLanes, null !== alternate && (alternate.childLanes |= renderLanes); + parent = parent.return; + } + } + + function prepareToReadContext(workInProgress, renderLanes) { + currentlyRenderingFiber = workInProgress; + lastFullyObservedContext = lastContextDependency = null; + workInProgress = workInProgress.dependencies; + null !== workInProgress && null !== workInProgress.firstContext && (0 !== (workInProgress.lanes & renderLanes) && (didReceiveUpdate = true), workInProgress.firstContext = null); + } + + function readContext(context) { + var value = context._currentValue2; + if (lastFullyObservedContext !== context) if (context = { + context: context, + memoizedValue: value, + next: null + }, null === lastContextDependency) { + if (null === currentlyRenderingFiber) throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."); + lastContextDependency = context; + currentlyRenderingFiber.dependencies = { + lanes: 0, + firstContext: context + }; + } else lastContextDependency = lastContextDependency.next = context; + return value; + } + + var interleavedQueues = null, + hasForceUpdate = false; + + function initializeUpdateQueue(fiber) { + fiber.updateQueue = { + baseState: fiber.memoizedState, + firstBaseUpdate: null, + lastBaseUpdate: null, + shared: { + pending: null, + interleaved: null, + lanes: 0 + }, + effects: null + }; + } + + function cloneUpdateQueue(current, workInProgress) { + current = current.updateQueue; + workInProgress.updateQueue === current && (workInProgress.updateQueue = { + baseState: current.baseState, + firstBaseUpdate: current.firstBaseUpdate, + lastBaseUpdate: current.lastBaseUpdate, + shared: current.shared, + effects: current.effects + }); + } + + function createUpdate(eventTime, lane) { + return { + eventTime: eventTime, + lane: lane, + tag: 0, + payload: null, + callback: null, + next: null + }; + } + + function enqueueUpdate(fiber, update) { + var updateQueue = fiber.updateQueue; + null !== updateQueue && (updateQueue = updateQueue.shared, null !== workInProgressRoot && 0 !== (fiber.mode & 1) && 0 === (executionContext & 8) ? (fiber = updateQueue.interleaved, null === fiber ? (update.next = update, null === interleavedQueues ? interleavedQueues = [updateQueue] : interleavedQueues.push(updateQueue)) : (update.next = fiber.next, fiber.next = update), updateQueue.interleaved = update) : (fiber = updateQueue.pending, null === fiber ? update.next = update : (update.next = fiber.next, fiber.next = update), updateQueue.pending = update)); + } + + function entangleTransitions(root, fiber, lane) { + fiber = fiber.updateQueue; + + if (null !== fiber && (fiber = fiber.shared, 0 !== (lane & 4194240))) { + var queueLanes = fiber.lanes; + queueLanes &= root.pendingLanes; + lane |= queueLanes; + fiber.lanes = lane; + markRootEntangled(root, lane); + } + } + + function enqueueCapturedUpdate(workInProgress, capturedUpdate) { + var queue = workInProgress.updateQueue, + current = workInProgress.alternate; + + if (null !== current && (current = current.updateQueue, queue === current)) { + var newFirst = null, + newLast = null; + queue = queue.firstBaseUpdate; + + if (null !== queue) { + do { + var clone = { + eventTime: queue.eventTime, + lane: queue.lane, + tag: queue.tag, + payload: queue.payload, + callback: queue.callback, + next: null + }; + null === newLast ? newFirst = newLast = clone : newLast = newLast.next = clone; + queue = queue.next; + } while (null !== queue); + + null === newLast ? newFirst = newLast = capturedUpdate : newLast = newLast.next = capturedUpdate; + } else newFirst = newLast = capturedUpdate; + + queue = { + baseState: current.baseState, + firstBaseUpdate: newFirst, + lastBaseUpdate: newLast, + shared: current.shared, + effects: current.effects + }; + workInProgress.updateQueue = queue; + return; + } + + workInProgress = queue.lastBaseUpdate; + null === workInProgress ? queue.firstBaseUpdate = capturedUpdate : workInProgress.next = capturedUpdate; + queue.lastBaseUpdate = capturedUpdate; + } + + function processUpdateQueue(workInProgress$jscomp$0, props, instance, renderLanes) { + var queue = workInProgress$jscomp$0.updateQueue; + hasForceUpdate = false; + var firstBaseUpdate = queue.firstBaseUpdate, + lastBaseUpdate = queue.lastBaseUpdate, + pendingQueue = queue.shared.pending; + + if (null !== pendingQueue) { + queue.shared.pending = null; + var lastPendingUpdate = pendingQueue, + firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = null; + null === lastBaseUpdate ? firstBaseUpdate = firstPendingUpdate : lastBaseUpdate.next = firstPendingUpdate; + lastBaseUpdate = lastPendingUpdate; + var current = workInProgress$jscomp$0.alternate; + null !== current && (current = current.updateQueue, pendingQueue = current.lastBaseUpdate, pendingQueue !== lastBaseUpdate && (null === pendingQueue ? current.firstBaseUpdate = firstPendingUpdate : pendingQueue.next = firstPendingUpdate, current.lastBaseUpdate = lastPendingUpdate)); + } + + if (null !== firstBaseUpdate) { + var newState = queue.baseState; + lastBaseUpdate = 0; + current = firstPendingUpdate = lastPendingUpdate = null; + pendingQueue = firstBaseUpdate; + + do { + var updateLane = pendingQueue.lane, + updateEventTime = pendingQueue.eventTime; + + if ((renderLanes & updateLane) === updateLane) { + null !== current && (current = current.next = { + eventTime: updateEventTime, + lane: 0, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }); + + a: { + var workInProgress = workInProgress$jscomp$0, + update = pendingQueue; + updateLane = props; + updateEventTime = instance; + + switch (update.tag) { + case 1: + workInProgress = update.payload; + + if ("function" === typeof workInProgress) { + newState = workInProgress.call(updateEventTime, newState, updateLane); + break a; + } + + newState = workInProgress; + break a; + + case 3: + workInProgress.flags = workInProgress.flags & -16385 | 128; + + case 0: + workInProgress = update.payload; + updateLane = "function" === typeof workInProgress ? workInProgress.call(updateEventTime, newState, updateLane) : workInProgress; + if (null === updateLane || undefined === updateLane) break a; + newState = _$$_REQUIRE(_dependencyMap[2])({}, newState, updateLane); + break a; + + case 2: + hasForceUpdate = true; + } + } + + null !== pendingQueue.callback && 0 !== pendingQueue.lane && (workInProgress$jscomp$0.flags |= 64, updateLane = queue.effects, null === updateLane ? queue.effects = [pendingQueue] : updateLane.push(pendingQueue)); + } else updateEventTime = { + eventTime: updateEventTime, + lane: updateLane, + tag: pendingQueue.tag, + payload: pendingQueue.payload, + callback: pendingQueue.callback, + next: null + }, null === current ? (firstPendingUpdate = current = updateEventTime, lastPendingUpdate = newState) : current = current.next = updateEventTime, lastBaseUpdate |= updateLane; + + pendingQueue = pendingQueue.next; + if (null === pendingQueue) if (pendingQueue = queue.shared.pending, null === pendingQueue) break;else updateLane = pendingQueue, pendingQueue = updateLane.next, updateLane.next = null, queue.lastBaseUpdate = updateLane, queue.shared.pending = null; + } while (1); + + null === current && (lastPendingUpdate = newState); + queue.baseState = lastPendingUpdate; + queue.firstBaseUpdate = firstPendingUpdate; + queue.lastBaseUpdate = current; + props = queue.shared.interleaved; + + if (null !== props) { + queue = props; + + do { + lastBaseUpdate |= queue.lane, queue = queue.next; + } while (queue !== props); + } else null === firstBaseUpdate && (queue.shared.lanes = 0); + + workInProgressRootSkippedLanes |= lastBaseUpdate; + workInProgress$jscomp$0.lanes = lastBaseUpdate; + workInProgress$jscomp$0.memoizedState = newState; + } + } + + function commitUpdateQueue(finishedWork, finishedQueue, instance) { + finishedWork = finishedQueue.effects; + finishedQueue.effects = null; + if (null !== finishedWork) for (finishedQueue = 0; finishedQueue < finishedWork.length; finishedQueue++) { + var effect = finishedWork[finishedQueue], + callback = effect.callback; + + if (null !== callback) { + effect.callback = null; + if ("function" !== typeof callback) throw Error("Invalid argument passed as callback. Expected a function. Instead received: " + callback); + callback.call(instance); + } + } + } + + var emptyRefsObject = new React.Component().refs; + + function applyDerivedStateFromProps(workInProgress, ctor, getDerivedStateFromProps, nextProps) { + ctor = workInProgress.memoizedState; + getDerivedStateFromProps = getDerivedStateFromProps(nextProps, ctor); + getDerivedStateFromProps = null === getDerivedStateFromProps || undefined === getDerivedStateFromProps ? ctor : _$$_REQUIRE(_dependencyMap[2])({}, ctor, getDerivedStateFromProps); + workInProgress.memoizedState = getDerivedStateFromProps; + 0 === workInProgress.lanes && (workInProgress.updateQueue.baseState = getDerivedStateFromProps); + } + + var classComponentUpdater = { + isMounted: function isMounted(component) { + return (component = component._reactInternals) ? getNearestMountedFiber(component) === component : false; + }, + enqueueSetState: function enqueueSetState(inst, payload, callback) { + inst = inst._reactInternals; + var eventTime = requestEventTime(), + lane = requestUpdateLane(inst), + update = createUpdate(eventTime, lane); + update.payload = payload; + undefined !== callback && null !== callback && (update.callback = callback); + enqueueUpdate(inst, update); + payload = scheduleUpdateOnFiber(inst, lane, eventTime); + null !== payload && entangleTransitions(payload, inst, lane); + }, + enqueueReplaceState: function enqueueReplaceState(inst, payload, callback) { + inst = inst._reactInternals; + var eventTime = requestEventTime(), + lane = requestUpdateLane(inst), + update = createUpdate(eventTime, lane); + update.tag = 1; + update.payload = payload; + undefined !== callback && null !== callback && (update.callback = callback); + enqueueUpdate(inst, update); + payload = scheduleUpdateOnFiber(inst, lane, eventTime); + null !== payload && entangleTransitions(payload, inst, lane); + }, + enqueueForceUpdate: function enqueueForceUpdate(inst, callback) { + inst = inst._reactInternals; + var eventTime = requestEventTime(), + lane = requestUpdateLane(inst), + update = createUpdate(eventTime, lane); + update.tag = 2; + undefined !== callback && null !== callback && (update.callback = callback); + enqueueUpdate(inst, update); + callback = scheduleUpdateOnFiber(inst, lane, eventTime); + null !== callback && entangleTransitions(callback, inst, lane); + } + }; + + function checkShouldComponentUpdate(workInProgress, ctor, oldProps, newProps, oldState, newState, nextContext) { + workInProgress = workInProgress.stateNode; + return "function" === typeof workInProgress.shouldComponentUpdate ? workInProgress.shouldComponentUpdate(newProps, newState, nextContext) : ctor.prototype && ctor.prototype.isPureReactComponent ? !shallowEqual(oldProps, newProps) || !shallowEqual(oldState, newState) : true; + } + + function constructClassInstance(workInProgress, ctor, props) { + var isLegacyContextConsumer = false, + unmaskedContext = emptyContextObject; + var context = ctor.contextType; + "object" === typeof context && null !== context ? context = readContext(context) : (unmaskedContext = isContextProvider(ctor) ? previousContext : contextStackCursor.current, isLegacyContextConsumer = ctor.contextTypes, context = (isLegacyContextConsumer = null !== isLegacyContextConsumer && undefined !== isLegacyContextConsumer) ? getMaskedContext(workInProgress, unmaskedContext) : emptyContextObject); + ctor = new ctor(props, context); + workInProgress.memoizedState = null !== ctor.state && undefined !== ctor.state ? ctor.state : null; + ctor.updater = classComponentUpdater; + workInProgress.stateNode = ctor; + ctor._reactInternals = workInProgress; + isLegacyContextConsumer && (workInProgress = workInProgress.stateNode, workInProgress.__reactInternalMemoizedUnmaskedChildContext = unmaskedContext, workInProgress.__reactInternalMemoizedMaskedChildContext = context); + return ctor; + } + + function callComponentWillReceiveProps(workInProgress, instance, newProps, nextContext) { + workInProgress = instance.state; + "function" === typeof instance.componentWillReceiveProps && instance.componentWillReceiveProps(newProps, nextContext); + "function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext); + instance.state !== workInProgress && classComponentUpdater.enqueueReplaceState(instance, instance.state, null); + } + + function mountClassInstance(workInProgress, ctor, newProps, renderLanes) { + var instance = workInProgress.stateNode; + instance.props = newProps; + instance.state = workInProgress.memoizedState; + instance.refs = emptyRefsObject; + initializeUpdateQueue(workInProgress); + var contextType = ctor.contextType; + "object" === typeof contextType && null !== contextType ? instance.context = readContext(contextType) : (contextType = isContextProvider(ctor) ? previousContext : contextStackCursor.current, instance.context = getMaskedContext(workInProgress, contextType)); + instance.state = workInProgress.memoizedState; + contextType = ctor.getDerivedStateFromProps; + "function" === typeof contextType && (applyDerivedStateFromProps(workInProgress, ctor, contextType, newProps), instance.state = workInProgress.memoizedState); + "function" === typeof ctor.getDerivedStateFromProps || "function" === typeof instance.getSnapshotBeforeUpdate || "function" !== typeof instance.UNSAFE_componentWillMount && "function" !== typeof instance.componentWillMount || (ctor = instance.state, "function" === typeof instance.componentWillMount && instance.componentWillMount(), "function" === typeof instance.UNSAFE_componentWillMount && instance.UNSAFE_componentWillMount(), ctor !== instance.state && classComponentUpdater.enqueueReplaceState(instance, instance.state, null), processUpdateQueue(workInProgress, newProps, instance, renderLanes), instance.state = workInProgress.memoizedState); + "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4); + } + + function coerceRef(returnFiber, current, element) { + returnFiber = element.ref; + + if (null !== returnFiber && "function" !== typeof returnFiber && "object" !== typeof returnFiber) { + if (element._owner) { + element = element._owner; + + if (element) { + if (1 !== element.tag) throw Error("Function components cannot have string refs. We recommend using useRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref"); + var inst = element.stateNode; + } + + if (!inst) throw Error("Missing owner for string ref " + returnFiber + ". This error is likely caused by a bug in React. Please file an issue."); + var stringRef = "" + returnFiber; + if (null !== current && null !== current.ref && "function" === typeof current.ref && current.ref._stringRef === stringRef) return current.ref; + + current = function current(value) { + var refs = inst.refs; + refs === emptyRefsObject && (refs = inst.refs = {}); + null === value ? delete refs[stringRef] : refs[stringRef] = value; + }; + + current._stringRef = stringRef; + return current; + } + + if ("string" !== typeof returnFiber) throw Error("Expected ref to be a function, a string, an object returned by React.createRef(), or null."); + if (!element._owner) throw Error("Element ref was specified as a string (" + returnFiber + ") but no owner was set. This could happen for one of the following reasons:\n1. You may be adding a ref to a function component\n2. You may be adding a ref to a component that was not created inside a component's render method\n3. You have multiple copies of React loaded\nSee https://reactjs.org/link/refs-must-have-owner for more information."); + } + + return returnFiber; + } + + function throwOnInvalidObjectType(returnFiber, newChild) { + returnFiber = Object.prototype.toString.call(newChild); + throw Error("Objects are not valid as a React child (found: " + ("[object Object]" === returnFiber ? "object with keys {" + Object.keys(newChild).join(", ") + "}" : returnFiber) + "). If you meant to render a collection of children, use an array instead."); + } + + function ChildReconciler(shouldTrackSideEffects) { + function deleteChild(returnFiber, childToDelete) { + if (shouldTrackSideEffects) { + var deletions = returnFiber.deletions; + null === deletions ? (returnFiber.deletions = [childToDelete], returnFiber.flags |= 16) : deletions.push(childToDelete); + } + } + + function deleteRemainingChildren(returnFiber, currentFirstChild) { + if (!shouldTrackSideEffects) return null; + + for (; null !== currentFirstChild;) { + deleteChild(returnFiber, currentFirstChild), currentFirstChild = currentFirstChild.sibling; + } + + return null; + } + + function mapRemainingChildren(returnFiber, currentFirstChild) { + for (returnFiber = new Map(); null !== currentFirstChild;) { + null !== currentFirstChild.key ? returnFiber.set(currentFirstChild.key, currentFirstChild) : returnFiber.set(currentFirstChild.index, currentFirstChild), currentFirstChild = currentFirstChild.sibling; + } + + return returnFiber; + } + + function useFiber(fiber, pendingProps) { + fiber = createWorkInProgress(fiber, pendingProps); + fiber.index = 0; + fiber.sibling = null; + return fiber; + } + + function placeChild(newFiber, lastPlacedIndex, newIndex) { + newFiber.index = newIndex; + if (!shouldTrackSideEffects) return lastPlacedIndex; + newIndex = newFiber.alternate; + if (null !== newIndex) return newIndex = newIndex.index, newIndex < lastPlacedIndex ? (newFiber.flags |= 2, lastPlacedIndex) : newIndex; + newFiber.flags |= 2; + return lastPlacedIndex; + } + + function placeSingleChild(newFiber) { + shouldTrackSideEffects && null === newFiber.alternate && (newFiber.flags |= 2); + return newFiber; + } + + function updateTextNode(returnFiber, current, textContent, lanes) { + if (null === current || 6 !== current.tag) return current = createFiberFromText(textContent, returnFiber.mode, lanes), current.return = returnFiber, current; + current = useFiber(current, textContent); + current.return = returnFiber; + return current; + } + + function updateElement(returnFiber, current, element, lanes) { + var elementType = element.type; + if (elementType === REACT_FRAGMENT_TYPE) return updateFragment(returnFiber, current, element.props.children, lanes, element.key); + if (null !== current && current.elementType === elementType) return lanes = useFiber(current, element.props), lanes.ref = coerceRef(returnFiber, current, element), lanes.return = returnFiber, lanes; + lanes = createFiberFromTypeAndProps(element.type, element.key, element.props, null, returnFiber.mode, lanes); + lanes.ref = coerceRef(returnFiber, current, element); + lanes.return = returnFiber; + return lanes; + } + + function updatePortal(returnFiber, current, portal, lanes) { + if (null === current || 4 !== current.tag || current.stateNode.containerInfo !== portal.containerInfo || current.stateNode.implementation !== portal.implementation) return current = createFiberFromPortal(portal, returnFiber.mode, lanes), current.return = returnFiber, current; + current = useFiber(current, portal.children || []); + current.return = returnFiber; + return current; + } + + function updateFragment(returnFiber, current, fragment, lanes, key) { + if (null === current || 7 !== current.tag) return current = createFiberFromFragment(fragment, returnFiber.mode, lanes, key), current.return = returnFiber, current; + current = useFiber(current, fragment); + current.return = returnFiber; + return current; + } + + function createChild(returnFiber, newChild, lanes) { + if ("string" === typeof newChild || "number" === typeof newChild) return newChild = createFiberFromText("" + newChild, returnFiber.mode, lanes), newChild.return = returnFiber, newChild; + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return lanes = createFiberFromTypeAndProps(newChild.type, newChild.key, newChild.props, null, returnFiber.mode, lanes), lanes.ref = coerceRef(returnFiber, null, newChild), lanes.return = returnFiber, lanes; + + case REACT_PORTAL_TYPE: + return newChild = createFiberFromPortal(newChild, returnFiber.mode, lanes), newChild.return = returnFiber, newChild; + } + + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return newChild = createFiberFromFragment(newChild, returnFiber.mode, lanes, null), newChild.return = returnFiber, newChild; + throwOnInvalidObjectType(returnFiber, newChild); + } + + return null; + } + + function updateSlot(returnFiber, oldFiber, newChild, lanes) { + var key = null !== oldFiber ? oldFiber.key : null; + if ("string" === typeof newChild || "number" === typeof newChild) return null !== key ? null : updateTextNode(returnFiber, oldFiber, "" + newChild, lanes); + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return newChild.key === key ? updateElement(returnFiber, oldFiber, newChild, lanes) : null; + + case REACT_PORTAL_TYPE: + return newChild.key === key ? updatePortal(returnFiber, oldFiber, newChild, lanes) : null; + } + + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return null !== key ? null : updateFragment(returnFiber, oldFiber, newChild, lanes, null); + throwOnInvalidObjectType(returnFiber, newChild); + } + + return null; + } + + function updateFromMap(existingChildren, returnFiber, newIdx, newChild, lanes) { + if ("string" === typeof newChild || "number" === typeof newChild) return existingChildren = existingChildren.get(newIdx) || null, updateTextNode(returnFiber, existingChildren, "" + newChild, lanes); + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + return existingChildren = existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, updateElement(returnFiber, existingChildren, newChild, lanes); + + case REACT_PORTAL_TYPE: + return existingChildren = existingChildren.get(null === newChild.key ? newIdx : newChild.key) || null, updatePortal(returnFiber, existingChildren, newChild, lanes); + } + + if (isArrayImpl(newChild) || getIteratorFn(newChild)) return existingChildren = existingChildren.get(newIdx) || null, updateFragment(returnFiber, existingChildren, newChild, lanes, null); + throwOnInvalidObjectType(returnFiber, newChild); + } + + return null; + } + + function reconcileChildrenArray(returnFiber, currentFirstChild, newChildren, lanes) { + for (var resultingFirstChild = null, previousNewFiber = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null; null !== oldFiber && newIdx < newChildren.length; newIdx++) { + oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; + var newFiber = updateSlot(returnFiber, oldFiber, newChildren[newIdx], lanes); + + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber ? resultingFirstChild = newFiber : previousNewFiber.sibling = newFiber; + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + + if (newIdx === newChildren.length) return deleteRemainingChildren(returnFiber, oldFiber), resultingFirstChild; + + if (null === oldFiber) { + for (; newIdx < newChildren.length; newIdx++) { + oldFiber = createChild(returnFiber, newChildren[newIdx], lanes), null !== oldFiber && (currentFirstChild = placeChild(oldFiber, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = oldFiber : previousNewFiber.sibling = oldFiber, previousNewFiber = oldFiber); + } + + return resultingFirstChild; + } + + for (oldFiber = mapRemainingChildren(returnFiber, oldFiber); newIdx < newChildren.length; newIdx++) { + nextOldFiber = updateFromMap(oldFiber, returnFiber, newIdx, newChildren[newIdx], lanes), null !== nextOldFiber && (shouldTrackSideEffects && null !== nextOldFiber.alternate && oldFiber.delete(null === nextOldFiber.key ? newIdx : nextOldFiber.key), currentFirstChild = placeChild(nextOldFiber, currentFirstChild, newIdx), null === previousNewFiber ? resultingFirstChild = nextOldFiber : previousNewFiber.sibling = nextOldFiber, previousNewFiber = nextOldFiber); + } + + shouldTrackSideEffects && oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return resultingFirstChild; + } + + function reconcileChildrenIterator(returnFiber, currentFirstChild, newChildrenIterable, lanes) { + var iteratorFn = getIteratorFn(newChildrenIterable); + if ("function" !== typeof iteratorFn) throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue."); + newChildrenIterable = iteratorFn.call(newChildrenIterable); + if (null == newChildrenIterable) throw Error("An iterable object provided no iterator."); + + for (var previousNewFiber = iteratorFn = null, oldFiber = currentFirstChild, newIdx = currentFirstChild = 0, nextOldFiber = null, step = newChildrenIterable.next(); null !== oldFiber && !step.done; newIdx++, step = newChildrenIterable.next()) { + oldFiber.index > newIdx ? (nextOldFiber = oldFiber, oldFiber = null) : nextOldFiber = oldFiber.sibling; + var newFiber = updateSlot(returnFiber, oldFiber, step.value, lanes); + + if (null === newFiber) { + null === oldFiber && (oldFiber = nextOldFiber); + break; + } + + shouldTrackSideEffects && oldFiber && null === newFiber.alternate && deleteChild(returnFiber, oldFiber); + currentFirstChild = placeChild(newFiber, currentFirstChild, newIdx); + null === previousNewFiber ? iteratorFn = newFiber : previousNewFiber.sibling = newFiber; + previousNewFiber = newFiber; + oldFiber = nextOldFiber; + } + + if (step.done) return deleteRemainingChildren(returnFiber, oldFiber), iteratorFn; + + if (null === oldFiber) { + for (; !step.done; newIdx++, step = newChildrenIterable.next()) { + step = createChild(returnFiber, step.value, lanes), null !== step && (currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? iteratorFn = step : previousNewFiber.sibling = step, previousNewFiber = step); + } + + return iteratorFn; + } + + for (oldFiber = mapRemainingChildren(returnFiber, oldFiber); !step.done; newIdx++, step = newChildrenIterable.next()) { + step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes), null !== step && (shouldTrackSideEffects && null !== step.alternate && oldFiber.delete(null === step.key ? newIdx : step.key), currentFirstChild = placeChild(step, currentFirstChild, newIdx), null === previousNewFiber ? iteratorFn = step : previousNewFiber.sibling = step, previousNewFiber = step); + } + + shouldTrackSideEffects && oldFiber.forEach(function (child) { + return deleteChild(returnFiber, child); + }); + return iteratorFn; + } + + return function (returnFiber, currentFirstChild, newChild, lanes) { + var isUnkeyedTopLevelFragment = "object" === typeof newChild && null !== newChild && newChild.type === REACT_FRAGMENT_TYPE && null === newChild.key; + isUnkeyedTopLevelFragment && (newChild = newChild.props.children); + + if ("object" === typeof newChild && null !== newChild) { + switch (newChild.$$typeof) { + case REACT_ELEMENT_TYPE: + a: { + var key = newChild.key; + + for (isUnkeyedTopLevelFragment = currentFirstChild; null !== isUnkeyedTopLevelFragment;) { + if (isUnkeyedTopLevelFragment.key === key) { + key = newChild.type; + + if (key === REACT_FRAGMENT_TYPE) { + if (7 === isUnkeyedTopLevelFragment.tag) { + deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment.sibling); + currentFirstChild = useFiber(isUnkeyedTopLevelFragment, newChild.props.children); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + } else if (isUnkeyedTopLevelFragment.elementType === key) { + deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment.sibling); + currentFirstChild = useFiber(isUnkeyedTopLevelFragment, newChild.props); + currentFirstChild.ref = coerceRef(returnFiber, isUnkeyedTopLevelFragment, newChild); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } + + deleteRemainingChildren(returnFiber, isUnkeyedTopLevelFragment); + break; + } else deleteChild(returnFiber, isUnkeyedTopLevelFragment); + + isUnkeyedTopLevelFragment = isUnkeyedTopLevelFragment.sibling; + } + + newChild.type === REACT_FRAGMENT_TYPE ? (currentFirstChild = createFiberFromFragment(newChild.props.children, returnFiber.mode, lanes, newChild.key), currentFirstChild.return = returnFiber, returnFiber = currentFirstChild) : (lanes = createFiberFromTypeAndProps(newChild.type, newChild.key, newChild.props, null, returnFiber.mode, lanes), lanes.ref = coerceRef(returnFiber, currentFirstChild, newChild), lanes.return = returnFiber, returnFiber = lanes); + } + + return placeSingleChild(returnFiber); + + case REACT_PORTAL_TYPE: + a: { + for (isUnkeyedTopLevelFragment = newChild.key; null !== currentFirstChild;) { + if (currentFirstChild.key === isUnkeyedTopLevelFragment) { + if (4 === currentFirstChild.tag && currentFirstChild.stateNode.containerInfo === newChild.containerInfo && currentFirstChild.stateNode.implementation === newChild.implementation) { + deleteRemainingChildren(returnFiber, currentFirstChild.sibling); + currentFirstChild = useFiber(currentFirstChild, newChild.children || []); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + break a; + } else { + deleteRemainingChildren(returnFiber, currentFirstChild); + break; + } + } else deleteChild(returnFiber, currentFirstChild); + currentFirstChild = currentFirstChild.sibling; + } + + currentFirstChild = createFiberFromPortal(newChild, returnFiber.mode, lanes); + currentFirstChild.return = returnFiber; + returnFiber = currentFirstChild; + } + + return placeSingleChild(returnFiber); + } + + if (isArrayImpl(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes); + if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, lanes); + throwOnInvalidObjectType(returnFiber, newChild); + } + + if ("string" === typeof newChild || "number" === typeof newChild) return newChild = "" + newChild, null !== currentFirstChild && 6 === currentFirstChild.tag ? (deleteRemainingChildren(returnFiber, currentFirstChild.sibling), currentFirstChild = useFiber(currentFirstChild, newChild), currentFirstChild.return = returnFiber, returnFiber = currentFirstChild) : (deleteRemainingChildren(returnFiber, currentFirstChild), currentFirstChild = createFiberFromText(newChild, returnFiber.mode, lanes), currentFirstChild.return = returnFiber, returnFiber = currentFirstChild), placeSingleChild(returnFiber); + if ("undefined" === typeof newChild && !isUnkeyedTopLevelFragment) switch (returnFiber.tag) { + case 1: + case 0: + case 11: + case 15: + throw Error((getComponentNameFromFiber(returnFiber) || "Component") + "(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null."); + } + return deleteRemainingChildren(returnFiber, currentFirstChild); + }; + } + + var reconcileChildFibers = ChildReconciler(true), + mountChildFibers = ChildReconciler(false), + NO_CONTEXT = {}, + contextStackCursor$1 = createCursor(NO_CONTEXT), + contextFiberStackCursor = createCursor(NO_CONTEXT), + rootInstanceStackCursor = createCursor(NO_CONTEXT); + + function requiredContext(c) { + if (c === NO_CONTEXT) throw Error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."); + return c; + } + + function pushHostContainer(fiber, nextRootInstance) { + push(rootInstanceStackCursor, nextRootInstance); + push(contextFiberStackCursor, fiber); + push(contextStackCursor$1, NO_CONTEXT); + pop(contextStackCursor$1); + push(contextStackCursor$1, { + isInAParentText: false + }); + } + + function popHostContainer() { + pop(contextStackCursor$1); + pop(contextFiberStackCursor); + pop(rootInstanceStackCursor); + } + + function pushHostContext(fiber) { + requiredContext(rootInstanceStackCursor.current); + var context = requiredContext(contextStackCursor$1.current); + var JSCompiler_inline_result = fiber.type; + JSCompiler_inline_result = "AndroidTextInput" === JSCompiler_inline_result || "RCTMultilineTextInputView" === JSCompiler_inline_result || "RCTSinglelineTextInputView" === JSCompiler_inline_result || "RCTText" === JSCompiler_inline_result || "RCTVirtualText" === JSCompiler_inline_result; + JSCompiler_inline_result = context.isInAParentText !== JSCompiler_inline_result ? { + isInAParentText: JSCompiler_inline_result + } : context; + context !== JSCompiler_inline_result && (push(contextFiberStackCursor, fiber), push(contextStackCursor$1, JSCompiler_inline_result)); + } + + function popHostContext(fiber) { + contextFiberStackCursor.current === fiber && (pop(contextStackCursor$1), pop(contextFiberStackCursor)); + } + + var suspenseStackCursor = createCursor(0); + + function findFirstSuspended(row) { + for (var node = row; null !== node;) { + if (13 === node.tag) { + var state = node.memoizedState; + if (null !== state && (null === state.dehydrated || shim$1() || shim$1())) return node; + } else if (19 === node.tag && undefined !== node.memoizedProps.revealOrder) { + if (0 !== (node.flags & 128)) return node; + } else if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + + if (node === row) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === row) return null; + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + + return null; + } + + var workInProgressSources = []; + + function resetWorkInProgressVersions() { + for (var i = 0; i < workInProgressSources.length; i++) { + workInProgressSources[i]._workInProgressVersionSecondary = null; + } + + workInProgressSources.length = 0; + } + + var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentBatchConfig$1 = ReactSharedInternals.ReactCurrentBatchConfig, + renderLanes = 0, + currentlyRenderingFiber$1 = null, + currentHook = null, + workInProgressHook = null, + didScheduleRenderPhaseUpdate = false, + didScheduleRenderPhaseUpdateDuringThisPass = false; + + function throwInvalidHookError() { + throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."); + } + + function areHookInputsEqual(nextDeps, prevDeps) { + if (null === prevDeps) return false; + + for (var i = 0; i < prevDeps.length && i < nextDeps.length; i++) { + if (!objectIs(nextDeps[i], prevDeps[i])) return false; + } + + return true; + } + + function renderWithHooks(current, workInProgress, Component, props, secondArg, nextRenderLanes) { + renderLanes = nextRenderLanes; + currentlyRenderingFiber$1 = workInProgress; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + workInProgress.lanes = 0; + ReactCurrentDispatcher$1.current = null === current || null === current.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate; + current = Component(props, secondArg); + + if (didScheduleRenderPhaseUpdateDuringThisPass) { + nextRenderLanes = 0; + + do { + didScheduleRenderPhaseUpdateDuringThisPass = false; + if (!(25 > nextRenderLanes)) throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop."); + nextRenderLanes += 1; + workInProgressHook = currentHook = null; + workInProgress.updateQueue = null; + ReactCurrentDispatcher$1.current = HooksDispatcherOnRerender; + current = Component(props, secondArg); + } while (didScheduleRenderPhaseUpdateDuringThisPass); + } + + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + workInProgress = null !== currentHook && null !== currentHook.next; + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + didScheduleRenderPhaseUpdate = false; + if (workInProgress) throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement."); + return current; + } + + function mountWorkInProgressHook() { + var hook = { + memoizedState: null, + baseState: null, + baseQueue: null, + queue: null, + next: null + }; + null === workInProgressHook ? currentlyRenderingFiber$1.memoizedState = workInProgressHook = hook : workInProgressHook = workInProgressHook.next = hook; + return workInProgressHook; + } + + function updateWorkInProgressHook() { + if (null === currentHook) { + var nextCurrentHook = currentlyRenderingFiber$1.alternate; + nextCurrentHook = null !== nextCurrentHook ? nextCurrentHook.memoizedState : null; + } else nextCurrentHook = currentHook.next; + + var nextWorkInProgressHook = null === workInProgressHook ? currentlyRenderingFiber$1.memoizedState : workInProgressHook.next; + if (null !== nextWorkInProgressHook) workInProgressHook = nextWorkInProgressHook, currentHook = nextCurrentHook;else { + if (null === nextCurrentHook) throw Error("Rendered more hooks than during the previous render."); + currentHook = nextCurrentHook; + nextCurrentHook = { + memoizedState: currentHook.memoizedState, + baseState: currentHook.baseState, + baseQueue: currentHook.baseQueue, + queue: currentHook.queue, + next: null + }; + null === workInProgressHook ? currentlyRenderingFiber$1.memoizedState = workInProgressHook = nextCurrentHook : workInProgressHook = workInProgressHook.next = nextCurrentHook; + } + return workInProgressHook; + } + + function basicStateReducer(state, action) { + return "function" === typeof action ? action(state) : action; + } + + function updateReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error("Should have a queue. This is likely a bug in React. Please file an issue."); + queue.lastRenderedReducer = reducer; + var current = currentHook, + baseQueue = current.baseQueue, + pendingQueue = queue.pending; + + if (null !== pendingQueue) { + if (null !== baseQueue) { + var baseFirst = baseQueue.next; + baseQueue.next = pendingQueue.next; + pendingQueue.next = baseFirst; + } + + current.baseQueue = baseQueue = pendingQueue; + queue.pending = null; + } + + if (null !== baseQueue) { + pendingQueue = baseQueue.next; + current = current.baseState; + var newBaseQueueFirst = baseFirst = null, + newBaseQueueLast = null, + update = pendingQueue; + + do { + var updateLane = update.lane; + if ((renderLanes & updateLane) === updateLane) null !== newBaseQueueLast && (newBaseQueueLast = newBaseQueueLast.next = { + lane: 0, + action: update.action, + eagerReducer: update.eagerReducer, + eagerState: update.eagerState, + next: null + }), current = update.eagerReducer === reducer ? update.eagerState : reducer(current, update.action);else { + var clone = { + lane: updateLane, + action: update.action, + eagerReducer: update.eagerReducer, + eagerState: update.eagerState, + next: null + }; + null === newBaseQueueLast ? (newBaseQueueFirst = newBaseQueueLast = clone, baseFirst = current) : newBaseQueueLast = newBaseQueueLast.next = clone; + currentlyRenderingFiber$1.lanes |= updateLane; + workInProgressRootSkippedLanes |= updateLane; + } + update = update.next; + } while (null !== update && update !== pendingQueue); + + null === newBaseQueueLast ? baseFirst = current : newBaseQueueLast.next = newBaseQueueFirst; + objectIs(current, hook.memoizedState) || (didReceiveUpdate = true); + hook.memoizedState = current; + hook.baseState = baseFirst; + hook.baseQueue = newBaseQueueLast; + queue.lastRenderedState = current; + } + + reducer = queue.interleaved; + + if (null !== reducer) { + baseQueue = reducer; + + do { + pendingQueue = baseQueue.lane, currentlyRenderingFiber$1.lanes |= pendingQueue, workInProgressRootSkippedLanes |= pendingQueue, baseQueue = baseQueue.next; + } while (baseQueue !== reducer); + } else null === baseQueue && (queue.lanes = 0); + + return [hook.memoizedState, queue.dispatch]; + } + + function rerenderReducer(reducer) { + var hook = updateWorkInProgressHook(), + queue = hook.queue; + if (null === queue) throw Error("Should have a queue. This is likely a bug in React. Please file an issue."); + queue.lastRenderedReducer = reducer; + var dispatch = queue.dispatch, + lastRenderPhaseUpdate = queue.pending, + newState = hook.memoizedState; + + if (null !== lastRenderPhaseUpdate) { + queue.pending = null; + var update = lastRenderPhaseUpdate = lastRenderPhaseUpdate.next; + + do { + newState = reducer(newState, update.action), update = update.next; + } while (update !== lastRenderPhaseUpdate); + + objectIs(newState, hook.memoizedState) || (didReceiveUpdate = true); + hook.memoizedState = newState; + null === hook.baseQueue && (hook.baseState = newState); + queue.lastRenderedState = newState; + } + + return [newState, dispatch]; + } + + function readFromUnsubcribedMutableSource(root, source, getSnapshot) { + var getVersion = source._getVersion; + getVersion = getVersion(source._source); + var JSCompiler_inline_result = source._workInProgressVersionSecondary; + if (null !== JSCompiler_inline_result) root = JSCompiler_inline_result === getVersion;else if (root = root.mutableReadLanes, root = (renderLanes & root) === root) source._workInProgressVersionSecondary = getVersion, workInProgressSources.push(source); + if (root) return getSnapshot(source._source); + workInProgressSources.push(source); + throw Error("Cannot read from mutable source during the current render without tearing. This may be a bug in React. Please file an issue."); + } + + function _useMutableSource(hook, source, getSnapshot, subscribe) { + var root = workInProgressRoot; + if (null === root) throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue."); + + var getVersion = source._getVersion, + version = getVersion(source._source), + dispatcher = ReactCurrentDispatcher$1.current, + _dispatcher$useState = dispatcher.useState(function () { + return readFromUnsubcribedMutableSource(root, source, getSnapshot); + }), + setSnapshot = _dispatcher$useState[1], + snapshot = _dispatcher$useState[0]; + + _dispatcher$useState = workInProgressHook; + var memoizedState = hook.memoizedState, + refs = memoizedState.refs, + prevGetSnapshot = refs.getSnapshot, + prevSource = memoizedState.source; + memoizedState = memoizedState.subscribe; + var fiber = currentlyRenderingFiber$1; + hook.memoizedState = { + refs: refs, + source: source, + subscribe: subscribe + }; + dispatcher.useEffect(function () { + refs.getSnapshot = getSnapshot; + refs.setSnapshot = setSnapshot; + var maybeNewVersion = getVersion(source._source); + objectIs(version, maybeNewVersion) || (maybeNewVersion = getSnapshot(source._source), objectIs(snapshot, maybeNewVersion) || (setSnapshot(maybeNewVersion), maybeNewVersion = requestUpdateLane(fiber), root.mutableReadLanes |= maybeNewVersion & root.pendingLanes), markRootEntangled(root, root.mutableReadLanes)); + }, [getSnapshot, source, subscribe]); + dispatcher.useEffect(function () { + return subscribe(source._source, function () { + var latestGetSnapshot = refs.getSnapshot, + latestSetSnapshot = refs.setSnapshot; + + try { + latestSetSnapshot(latestGetSnapshot(source._source)); + var lane = requestUpdateLane(fiber); + root.mutableReadLanes |= lane & root.pendingLanes; + } catch (error) { + latestSetSnapshot(function () { + throw error; + }); + } + }); + }, [source, subscribe]); + objectIs(prevGetSnapshot, getSnapshot) && objectIs(prevSource, source) && objectIs(memoizedState, subscribe) || (hook = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: snapshot + }, hook.dispatch = setSnapshot = dispatchAction.bind(null, currentlyRenderingFiber$1, hook), _dispatcher$useState.queue = hook, _dispatcher$useState.baseQueue = null, snapshot = readFromUnsubcribedMutableSource(root, source, getSnapshot), _dispatcher$useState.memoizedState = _dispatcher$useState.baseState = snapshot); + return snapshot; + } + + function updateMutableSource(source, getSnapshot, subscribe) { + var hook = updateWorkInProgressHook(); + return _useMutableSource(hook, source, getSnapshot, subscribe); + } + + function mountState(initialState) { + var hook = mountWorkInProgressHook(); + "function" === typeof initialState && (initialState = initialState()); + hook.memoizedState = hook.baseState = initialState; + initialState = hook.queue = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: basicStateReducer, + lastRenderedState: initialState + }; + initialState = initialState.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, initialState); + return [hook.memoizedState, initialState]; + } + + function pushEffect(tag, create, destroy, deps) { + tag = { + tag: tag, + create: create, + destroy: destroy, + deps: deps, + next: null + }; + create = currentlyRenderingFiber$1.updateQueue; + null === create ? (create = { + lastEffect: null + }, currentlyRenderingFiber$1.updateQueue = create, create.lastEffect = tag.next = tag) : (destroy = create.lastEffect, null === destroy ? create.lastEffect = tag.next = tag : (deps = destroy.next, destroy.next = tag, tag.next = deps, create.lastEffect = tag)); + return tag; + } + + function updateRef() { + return updateWorkInProgressHook().memoizedState; + } + + function mountEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = mountWorkInProgressHook(); + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(1 | hookFlags, create, undefined, undefined === deps ? null : deps); + } + + function updateEffectImpl(fiberFlags, hookFlags, create, deps) { + var hook = updateWorkInProgressHook(); + deps = undefined === deps ? null : deps; + var destroy = undefined; + + if (null !== currentHook) { + var prevEffect = currentHook.memoizedState; + destroy = prevEffect.destroy; + + if (null !== deps && areHookInputsEqual(deps, prevEffect.deps)) { + hook.memoizedState = pushEffect(hookFlags, create, destroy, deps); + return; + } + } + + currentlyRenderingFiber$1.flags |= fiberFlags; + hook.memoizedState = pushEffect(1 | hookFlags, create, destroy, deps); + } + + function mountEffect(create, deps) { + return mountEffectImpl(1049600, 4, create, deps); + } + + function updateEffect(create, deps) { + return updateEffectImpl(1024, 4, create, deps); + } + + function updateLayoutEffect(create, deps) { + return updateEffectImpl(4, 2, create, deps); + } + + function imperativeHandleEffect(create, ref) { + if ("function" === typeof ref) return create = create(), ref(create), function () { + ref(null); + }; + if (null !== ref && undefined !== ref) return create = create(), ref.current = create, function () { + ref.current = null; + }; + } + + function updateImperativeHandle(ref, create, deps) { + deps = null !== deps && undefined !== deps ? deps.concat([ref]) : null; + return updateEffectImpl(4, 2, imperativeHandleEffect.bind(null, create, ref), deps); + } + + function mountDebugValue() {} + + function updateCallback(callback, deps) { + var hook = updateWorkInProgressHook(); + deps = undefined === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== prevState && null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; + hook.memoizedState = [callback, deps]; + return callback; + } + + function updateMemo(nextCreate, deps) { + var hook = updateWorkInProgressHook(); + deps = undefined === deps ? null : deps; + var prevState = hook.memoizedState; + if (null !== prevState && null !== deps && areHookInputsEqual(deps, prevState[1])) return prevState[0]; + nextCreate = nextCreate(); + hook.memoizedState = [nextCreate, deps]; + return nextCreate; + } + + function startTransition(setPending, callback) { + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 0 !== previousPriority && 4 > previousPriority ? previousPriority : 4; + setPending(true); + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setPending(false), callback(); + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$1.transition = prevTransition; + } + } + + function dispatchAction(fiber, queue, action) { + var eventTime = requestEventTime(), + lane = requestUpdateLane(fiber), + update = { + lane: lane, + action: action, + eagerReducer: null, + eagerState: null, + next: null + }, + alternate = fiber.alternate; + if (fiber === currentlyRenderingFiber$1 || null !== alternate && alternate === currentlyRenderingFiber$1) didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true, lane = queue.pending, null === lane ? update.next = update : (update.next = lane.next, lane.next = update), queue.pending = update;else { + if (null !== workInProgressRoot && 0 !== (fiber.mode & 1) && 0 === (executionContext & 8)) { + var interleaved = queue.interleaved; + null === interleaved ? (update.next = update, null === interleavedQueues ? interleavedQueues = [queue] : interleavedQueues.push(queue)) : (update.next = interleaved.next, interleaved.next = update); + queue.interleaved = update; + } else interleaved = queue.pending, null === interleaved ? update.next = update : (update.next = interleaved.next, interleaved.next = update), queue.pending = update; + + if (0 === fiber.lanes && (null === alternate || 0 === alternate.lanes) && (alternate = queue.lastRenderedReducer, null !== alternate)) try { + var currentState = queue.lastRenderedState, + eagerState = alternate(currentState, action); + update.eagerReducer = alternate; + update.eagerState = eagerState; + if (objectIs(eagerState, currentState)) return; + } catch (error) {} finally {} + update = scheduleUpdateOnFiber(fiber, lane, eventTime); + 0 !== (lane & 4194240) && null !== update && (fiber = queue.lanes, fiber &= update.pendingLanes, lane |= fiber, queue.lanes = lane, markRootEntangled(update, lane)); + } + } + + var ContextOnlyDispatcher = { + readContext: readContext, + useCallback: throwInvalidHookError, + useContext: throwInvalidHookError, + useEffect: throwInvalidHookError, + useImperativeHandle: throwInvalidHookError, + useLayoutEffect: throwInvalidHookError, + useMemo: throwInvalidHookError, + useReducer: throwInvalidHookError, + useRef: throwInvalidHookError, + useState: throwInvalidHookError, + useDebugValue: throwInvalidHookError, + useDeferredValue: throwInvalidHookError, + useTransition: throwInvalidHookError, + useMutableSource: throwInvalidHookError, + useOpaqueIdentifier: throwInvalidHookError, + unstable_isNewReconciler: false + }, + HooksDispatcherOnMount = { + readContext: readContext, + useCallback: function useCallback(callback, deps) { + mountWorkInProgressHook().memoizedState = [callback, undefined === deps ? null : deps]; + return callback; + }, + useContext: readContext, + useEffect: mountEffect, + useImperativeHandle: function useImperativeHandle(ref, create, deps) { + deps = null !== deps && undefined !== deps ? deps.concat([ref]) : null; + return mountEffectImpl(4, 2, imperativeHandleEffect.bind(null, create, ref), deps); + }, + useLayoutEffect: function useLayoutEffect(create, deps) { + return mountEffectImpl(4, 2, create, deps); + }, + useMemo: function useMemo(nextCreate, deps) { + var hook = mountWorkInProgressHook(); + deps = undefined === deps ? null : deps; + nextCreate = nextCreate(); + hook.memoizedState = [nextCreate, deps]; + return nextCreate; + }, + useReducer: function useReducer(reducer, initialArg, init) { + var hook = mountWorkInProgressHook(); + initialArg = undefined !== init ? init(initialArg) : initialArg; + hook.memoizedState = hook.baseState = initialArg; + reducer = hook.queue = { + pending: null, + interleaved: null, + lanes: 0, + dispatch: null, + lastRenderedReducer: reducer, + lastRenderedState: initialArg + }; + reducer = reducer.dispatch = dispatchAction.bind(null, currentlyRenderingFiber$1, reducer); + return [hook.memoizedState, reducer]; + }, + useRef: function useRef(initialValue) { + var hook = mountWorkInProgressHook(); + initialValue = { + current: initialValue + }; + return hook.memoizedState = initialValue; + }, + useState: mountState, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var _mountState = mountState(value), + prevValue = _mountState[0], + setValue = _mountState[1]; + + mountEffect(function () { + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.transition = prevTransition; + } + }, [value]); + return prevValue; + }, + useTransition: function useTransition() { + var _mountState2 = mountState(false), + isPending = _mountState2[0]; + + _mountState2 = startTransition.bind(null, _mountState2[1]); + mountWorkInProgressHook().memoizedState = _mountState2; + return [isPending, _mountState2]; + }, + useMutableSource: function useMutableSource(source, getSnapshot, subscribe) { + var hook = mountWorkInProgressHook(); + hook.memoizedState = { + refs: { + getSnapshot: getSnapshot, + setSnapshot: null + }, + source: source, + subscribe: subscribe + }; + return _useMutableSource(hook, source, getSnapshot, subscribe); + }, + useOpaqueIdentifier: function useOpaqueIdentifier() { + throw Error("Not yet implemented"); + }, + unstable_isNewReconciler: false + }, + HooksDispatcherOnUpdate = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: updateReducer, + useRef: updateRef, + useState: function useState() { + return updateReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var _updateState = updateReducer(basicStateReducer), + prevValue = _updateState[0], + setValue = _updateState[1]; + + updateEffect(function () { + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.transition = prevTransition; + } + }, [value]); + return prevValue; + }, + useTransition: function useTransition() { + var isPending = updateReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useOpaqueIdentifier: function useOpaqueIdentifier() { + return updateReducer(basicStateReducer)[0]; + }, + unstable_isNewReconciler: false + }, + HooksDispatcherOnRerender = { + readContext: readContext, + useCallback: updateCallback, + useContext: readContext, + useEffect: updateEffect, + useImperativeHandle: updateImperativeHandle, + useLayoutEffect: updateLayoutEffect, + useMemo: updateMemo, + useReducer: rerenderReducer, + useRef: updateRef, + useState: function useState() { + return rerenderReducer(basicStateReducer); + }, + useDebugValue: mountDebugValue, + useDeferredValue: function useDeferredValue(value) { + var _rerenderState = rerenderReducer(basicStateReducer), + prevValue = _rerenderState[0], + setValue = _rerenderState[1]; + + updateEffect(function () { + var prevTransition = ReactCurrentBatchConfig$1.transition; + ReactCurrentBatchConfig$1.transition = 1; + + try { + setValue(value); + } finally { + ReactCurrentBatchConfig$1.transition = prevTransition; + } + }, [value]); + return prevValue; + }, + useTransition: function useTransition() { + var isPending = rerenderReducer(basicStateReducer)[0], + start = updateWorkInProgressHook().memoizedState; + return [isPending, start]; + }, + useMutableSource: updateMutableSource, + useOpaqueIdentifier: function useOpaqueIdentifier() { + return rerenderReducer(basicStateReducer)[0]; + }, + unstable_isNewReconciler: false + }; + + function createCapturedValue(value, source) { + try { + var info = "", + node = source; + + do { + info += describeFiber(node), node = node.return; + } while (node); + + var JSCompiler_inline_result = info; + } catch (x) { + JSCompiler_inline_result = "\nError generating stack: " + x.message + "\n" + x.stack; + } + + return { + value: value, + source: source, + stack: JSCompiler_inline_result + }; + } + + if ("function" !== typeof _$$_REQUIRE(_dependencyMap[3]).ReactFiberErrorDialog.showErrorDialog) throw Error("Expected ReactFiberErrorDialog.showErrorDialog to be a function."); + + function logCapturedError(boundary, errorInfo) { + try { + false !== _$$_REQUIRE(_dependencyMap[3]).ReactFiberErrorDialog.showErrorDialog({ + componentStack: null !== errorInfo.stack ? errorInfo.stack : "", + error: errorInfo.value, + errorBoundary: null !== boundary && 1 === boundary.tag ? boundary.stateNode : null + }) && console.error(errorInfo.value); + } catch (e) { + setTimeout(function () { + throw e; + }); + } + } + + var PossiblyWeakMap = "function" === typeof WeakMap ? WeakMap : Map; + + function createRootErrorUpdate(fiber, errorInfo, lane) { + lane = createUpdate(-1, lane); + lane.tag = 3; + lane.payload = { + element: null + }; + var error = errorInfo.value; + + lane.callback = function () { + hasUncaughtError || (hasUncaughtError = true, firstUncaughtError = error); + logCapturedError(fiber, errorInfo); + }; + + return lane; + } + + function createClassErrorUpdate(fiber, errorInfo, lane) { + lane = createUpdate(-1, lane); + lane.tag = 3; + var getDerivedStateFromError = fiber.type.getDerivedStateFromError; + + if ("function" === typeof getDerivedStateFromError) { + var error = errorInfo.value; + + lane.payload = function () { + logCapturedError(fiber, errorInfo); + return getDerivedStateFromError(error); + }; + } + + var inst = fiber.stateNode; + null !== inst && "function" === typeof inst.componentDidCatch && (lane.callback = function () { + "function" !== typeof getDerivedStateFromError && (null === legacyErrorBoundariesThatAlreadyFailed ? legacyErrorBoundariesThatAlreadyFailed = new Set([this]) : legacyErrorBoundariesThatAlreadyFailed.add(this), logCapturedError(fiber, errorInfo)); + var stack = errorInfo.stack; + this.componentDidCatch(errorInfo.value, { + componentStack: null !== stack ? stack : "" + }); + }); + return lane; + } + + var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner, + didReceiveUpdate = false; + + function reconcileChildren(current, workInProgress, nextChildren, renderLanes) { + workInProgress.child = null === current ? mountChildFibers(workInProgress, null, nextChildren, renderLanes) : reconcileChildFibers(workInProgress, current.child, nextChildren, renderLanes); + } + + function updateForwardRef(current, workInProgress, Component, nextProps, renderLanes) { + Component = Component.render; + var ref = workInProgress.ref; + prepareToReadContext(workInProgress, renderLanes); + nextProps = renderWithHooks(current, workInProgress, Component, nextProps, ref, renderLanes); + if (null !== current && !didReceiveUpdate) return workInProgress.updateQueue = current.updateQueue, workInProgress.flags &= -1029, current.lanes &= ~renderLanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, nextProps, renderLanes); + return workInProgress.child; + } + + function updateMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) { + if (null === current) { + var type = Component.type; + if ("function" === typeof type && !shouldConstruct(type) && undefined === type.defaultProps && null === Component.compare && undefined === Component.defaultProps) return workInProgress.tag = 15, workInProgress.type = type, updateSimpleMemoComponent(current, workInProgress, type, nextProps, updateLanes, renderLanes); + current = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress, workInProgress.mode, renderLanes); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + + type = current.child; + if (0 === (updateLanes & renderLanes) && (updateLanes = type.memoizedProps, Component = Component.compare, Component = null !== Component ? Component : shallowEqual, Component(updateLanes, nextProps) && current.ref === workInProgress.ref)) return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + current = createWorkInProgress(type, nextProps); + current.ref = workInProgress.ref; + current.return = workInProgress; + return workInProgress.child = current; + } + + function updateSimpleMemoComponent(current, workInProgress, Component, nextProps, updateLanes, renderLanes) { + if (null !== current && shallowEqual(current.memoizedProps, nextProps) && current.ref === workInProgress.ref) { + didReceiveUpdate = false; + if (0 === (renderLanes & updateLanes)) return workInProgress.lanes = current.lanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + 0 !== (current.flags & 32768) && (didReceiveUpdate = true); + } + + return updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes); + } + + function updateOffscreenComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + nextChildren = nextProps.children, + prevState = null !== current ? current.memoizedState : null; + if ("hidden" === nextProps.mode || "unstable-defer-without-hiding" === nextProps.mode) { + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null + }, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= renderLanes;else { + if (0 === (renderLanes & 1073741824)) return current = null !== prevState ? prevState.baseLanes | renderLanes : renderLanes, workInProgress.lanes = workInProgress.childLanes = 1073741824, workInProgress.memoizedState = { + baseLanes: current, + cachePool: null + }, workInProgress.updateQueue = null, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= current, null; + workInProgress.memoizedState = { + baseLanes: 0, + cachePool: null + }; + nextProps = null !== prevState ? prevState.baseLanes : renderLanes; + push(subtreeRenderLanesCursor, subtreeRenderLanes); + subtreeRenderLanes |= nextProps; + } + } else null !== prevState ? (nextProps = prevState.baseLanes | renderLanes, workInProgress.memoizedState = null) : nextProps = renderLanes, push(subtreeRenderLanesCursor, subtreeRenderLanes), subtreeRenderLanes |= nextProps; + reconcileChildren(current, workInProgress, nextChildren, renderLanes); + return workInProgress.child; + } + + function markRef(current, workInProgress) { + var ref = workInProgress.ref; + if (null === current && null !== ref || null !== current && current.ref !== ref) workInProgress.flags |= 256; + } + + function updateFunctionComponent(current, workInProgress, Component, nextProps, renderLanes) { + var context = isContextProvider(Component) ? previousContext : contextStackCursor.current; + context = getMaskedContext(workInProgress, context); + prepareToReadContext(workInProgress, renderLanes); + Component = renderWithHooks(current, workInProgress, Component, nextProps, context, renderLanes); + if (null !== current && !didReceiveUpdate) return workInProgress.updateQueue = current.updateQueue, workInProgress.flags &= -1029, current.lanes &= ~renderLanes, bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + workInProgress.flags |= 1; + reconcileChildren(current, workInProgress, Component, renderLanes); + return workInProgress.child; + } + + function updateClassComponent(current, workInProgress, Component, nextProps, renderLanes) { + if (isContextProvider(Component)) { + var hasContext = true; + pushContextProvider(workInProgress); + } else hasContext = false; + + prepareToReadContext(workInProgress, renderLanes); + if (null === workInProgress.stateNode) null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2), constructClassInstance(workInProgress, Component, nextProps), mountClassInstance(workInProgress, Component, nextProps, renderLanes), nextProps = true;else if (null === current) { + var instance = workInProgress.stateNode, + oldProps = workInProgress.memoizedProps; + instance.props = oldProps; + var oldContext = instance.context, + contextType = Component.contextType; + "object" === typeof contextType && null !== contextType ? contextType = readContext(contextType) : (contextType = isContextProvider(Component) ? previousContext : contextStackCursor.current, contextType = getMaskedContext(workInProgress, contextType)); + var getDerivedStateFromProps = Component.getDerivedStateFromProps, + hasNewLifecycles = "function" === typeof getDerivedStateFromProps || "function" === typeof instance.getSnapshotBeforeUpdate; + hasNewLifecycles || "function" !== typeof instance.UNSAFE_componentWillReceiveProps && "function" !== typeof instance.componentWillReceiveProps || (oldProps !== nextProps || oldContext !== contextType) && callComponentWillReceiveProps(workInProgress, instance, nextProps, contextType); + hasForceUpdate = false; + var oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + oldContext = workInProgress.memoizedState; + oldProps !== nextProps || oldState !== oldContext || didPerformWorkStackCursor.current || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps, nextProps), oldContext = workInProgress.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(workInProgress, Component, oldProps, nextProps, oldState, oldContext, contextType)) ? (hasNewLifecycles || "function" !== typeof instance.UNSAFE_componentWillMount && "function" !== typeof instance.componentWillMount || ("function" === typeof instance.componentWillMount && instance.componentWillMount(), "function" === typeof instance.UNSAFE_componentWillMount && instance.UNSAFE_componentWillMount()), "function" === typeof instance.componentDidMount && (workInProgress.flags |= 4)) : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4), workInProgress.memoizedProps = nextProps, workInProgress.memoizedState = oldContext), instance.props = nextProps, instance.state = oldContext, instance.context = contextType, nextProps = oldProps) : ("function" === typeof instance.componentDidMount && (workInProgress.flags |= 4), nextProps = false); + } else { + instance = workInProgress.stateNode; + cloneUpdateQueue(current, workInProgress); + oldProps = workInProgress.memoizedProps; + contextType = workInProgress.type === workInProgress.elementType ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); + instance.props = contextType; + hasNewLifecycles = workInProgress.pendingProps; + oldState = instance.context; + oldContext = Component.contextType; + "object" === typeof oldContext && null !== oldContext ? oldContext = readContext(oldContext) : (oldContext = isContextProvider(Component) ? previousContext : contextStackCursor.current, oldContext = getMaskedContext(workInProgress, oldContext)); + var getDerivedStateFromProps$jscomp$0 = Component.getDerivedStateFromProps; + (getDerivedStateFromProps = "function" === typeof getDerivedStateFromProps$jscomp$0 || "function" === typeof instance.getSnapshotBeforeUpdate) || "function" !== typeof instance.UNSAFE_componentWillReceiveProps && "function" !== typeof instance.componentWillReceiveProps || (oldProps !== hasNewLifecycles || oldState !== oldContext) && callComponentWillReceiveProps(workInProgress, instance, nextProps, oldContext); + hasForceUpdate = false; + oldState = workInProgress.memoizedState; + instance.state = oldState; + processUpdateQueue(workInProgress, nextProps, instance, renderLanes); + var newState = workInProgress.memoizedState; + oldProps !== hasNewLifecycles || oldState !== newState || didPerformWorkStackCursor.current || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps$jscomp$0 && (applyDerivedStateFromProps(workInProgress, Component, getDerivedStateFromProps$jscomp$0, nextProps), newState = workInProgress.memoizedState), (contextType = hasForceUpdate || checkShouldComponentUpdate(workInProgress, Component, contextType, nextProps, oldState, newState, oldContext) || false) ? (getDerivedStateFromProps || "function" !== typeof instance.UNSAFE_componentWillUpdate && "function" !== typeof instance.componentWillUpdate || ("function" === typeof instance.componentWillUpdate && instance.componentWillUpdate(nextProps, newState, oldContext), "function" === typeof instance.UNSAFE_componentWillUpdate && instance.UNSAFE_componentWillUpdate(nextProps, newState, oldContext)), "function" === typeof instance.componentDidUpdate && (workInProgress.flags |= 4), "function" === typeof instance.getSnapshotBeforeUpdate && (workInProgress.flags |= 512)) : ("function" !== typeof instance.componentDidUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 4), "function" !== typeof instance.getSnapshotBeforeUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 512), workInProgress.memoizedProps = nextProps, workInProgress.memoizedState = newState), instance.props = nextProps, instance.state = newState, instance.context = oldContext, nextProps = contextType) : ("function" !== typeof instance.componentDidUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 4), "function" !== typeof instance.getSnapshotBeforeUpdate || oldProps === current.memoizedProps && oldState === current.memoizedState || (workInProgress.flags |= 512), nextProps = false); + } + return finishClassComponent(current, workInProgress, Component, nextProps, hasContext, renderLanes); + } + + function finishClassComponent(current, workInProgress, Component, shouldUpdate, hasContext, renderLanes) { + markRef(current, workInProgress); + var didCaptureError = 0 !== (workInProgress.flags & 128); + if (!shouldUpdate && !didCaptureError) return hasContext && invalidateContextProvider(workInProgress, Component, false), bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + shouldUpdate = workInProgress.stateNode; + ReactCurrentOwner$1.current = workInProgress; + var nextChildren = didCaptureError && "function" !== typeof Component.getDerivedStateFromError ? null : shouldUpdate.render(); + workInProgress.flags |= 1; + null !== current && didCaptureError ? (workInProgress.child = reconcileChildFibers(workInProgress, current.child, null, renderLanes), workInProgress.child = reconcileChildFibers(workInProgress, null, nextChildren, renderLanes)) : reconcileChildren(current, workInProgress, nextChildren, renderLanes); + workInProgress.memoizedState = shouldUpdate.state; + hasContext && invalidateContextProvider(workInProgress, Component, true); + return workInProgress.child; + } + + function pushHostRootContext(workInProgress) { + var root = workInProgress.stateNode; + root.pendingContext ? pushTopLevelContextObject(workInProgress, root.pendingContext, root.pendingContext !== root.context) : root.context && pushTopLevelContextObject(workInProgress, root.context, false); + pushHostContainer(workInProgress, root.containerInfo); + } + + var SUSPENDED_MARKER = { + dehydrated: null, + retryLane: 0 + }; + + function mountSuspenseOffscreenState(renderLanes) { + return { + baseLanes: renderLanes, + cachePool: null + }; + } + + function updateSuspenseComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + suspenseContext = suspenseStackCursor.current, + showFallback = false, + JSCompiler_temp; + (JSCompiler_temp = 0 !== (workInProgress.flags & 128)) || (JSCompiler_temp = null !== current && null === current.memoizedState ? false : 0 !== (suspenseContext & 2)); + JSCompiler_temp ? (showFallback = true, workInProgress.flags &= -129) : null !== current && null === current.memoizedState || undefined === nextProps.fallback || true === nextProps.unstable_avoidThisFallback || (suspenseContext |= 1); + push(suspenseStackCursor, suspenseContext & 1); + + if (null === current) { + current = nextProps.children; + suspenseContext = nextProps.fallback; + if (showFallback) return current = mountSuspenseFallbackChildren(workInProgress, current, suspenseContext, renderLanes), workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, current; + if ("number" === typeof nextProps.unstable_expectedLoadTime) return current = mountSuspenseFallbackChildren(workInProgress, current, suspenseContext, renderLanes), workInProgress.child.memoizedState = mountSuspenseOffscreenState(renderLanes), workInProgress.memoizedState = SUSPENDED_MARKER, workInProgress.lanes = 4194304, current; + renderLanes = createFiberFromOffscreen({ + mode: "visible", + children: current + }, workInProgress.mode, renderLanes, null); + renderLanes.return = workInProgress; + return workInProgress.child = renderLanes; + } + + if (null !== current.memoizedState) { + if (showFallback) return nextProps = updateSuspenseFallbackChildren(current, workInProgress, nextProps.children, nextProps.fallback, renderLanes), showFallback = workInProgress.child, suspenseContext = current.child.memoizedState, showFallback.memoizedState = null === suspenseContext ? mountSuspenseOffscreenState(renderLanes) : { + baseLanes: suspenseContext.baseLanes | renderLanes, + cachePool: null + }, showFallback.childLanes = current.childLanes & ~renderLanes, workInProgress.memoizedState = SUSPENDED_MARKER, nextProps; + renderLanes = updateSuspensePrimaryChildren(current, workInProgress, nextProps.children, renderLanes); + workInProgress.memoizedState = null; + return renderLanes; + } + + if (showFallback) return nextProps = updateSuspenseFallbackChildren(current, workInProgress, nextProps.children, nextProps.fallback, renderLanes), showFallback = workInProgress.child, suspenseContext = current.child.memoizedState, showFallback.memoizedState = null === suspenseContext ? mountSuspenseOffscreenState(renderLanes) : { + baseLanes: suspenseContext.baseLanes | renderLanes, + cachePool: null + }, showFallback.childLanes = current.childLanes & ~renderLanes, workInProgress.memoizedState = SUSPENDED_MARKER, nextProps; + renderLanes = updateSuspensePrimaryChildren(current, workInProgress, nextProps.children, renderLanes); + workInProgress.memoizedState = null; + return renderLanes; + } + + function mountSuspenseFallbackChildren(workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode, + progressedPrimaryFragment = workInProgress.child; + primaryChildren = { + mode: "hidden", + children: primaryChildren + }; + 0 === (mode & 1) && null !== progressedPrimaryFragment ? (progressedPrimaryFragment.childLanes = 0, progressedPrimaryFragment.pendingProps = primaryChildren) : progressedPrimaryFragment = createFiberFromOffscreen(primaryChildren, mode, 0, null); + fallbackChildren = createFiberFromFragment(fallbackChildren, mode, renderLanes, null); + progressedPrimaryFragment.return = workInProgress; + fallbackChildren.return = workInProgress; + progressedPrimaryFragment.sibling = fallbackChildren; + workInProgress.child = progressedPrimaryFragment; + return fallbackChildren; + } + + function updateSuspensePrimaryChildren(current, workInProgress, primaryChildren, renderLanes) { + var currentPrimaryChildFragment = current.child; + current = currentPrimaryChildFragment.sibling; + primaryChildren = createWorkInProgress(currentPrimaryChildFragment, { + mode: "visible", + children: primaryChildren + }); + 0 === (workInProgress.mode & 1) && (primaryChildren.lanes = renderLanes); + primaryChildren.return = workInProgress; + primaryChildren.sibling = null; + null !== current && (renderLanes = workInProgress.deletions, null === renderLanes ? (workInProgress.deletions = [current], workInProgress.flags |= 16) : renderLanes.push(current)); + return workInProgress.child = primaryChildren; + } + + function updateSuspenseFallbackChildren(current, workInProgress, primaryChildren, fallbackChildren, renderLanes) { + var mode = workInProgress.mode; + current = current.child; + var currentFallbackChildFragment = current.sibling, + primaryChildProps = { + mode: "hidden", + children: primaryChildren + }; + 0 === (mode & 1) && workInProgress.child !== current ? (primaryChildren = workInProgress.child, primaryChildren.childLanes = 0, primaryChildren.pendingProps = primaryChildProps, workInProgress.deletions = null) : (primaryChildren = createWorkInProgress(current, primaryChildProps), primaryChildren.subtreeFlags = current.subtreeFlags & 1835008); + null !== currentFallbackChildFragment ? fallbackChildren = createWorkInProgress(currentFallbackChildFragment, fallbackChildren) : (fallbackChildren = createFiberFromFragment(fallbackChildren, mode, renderLanes, null), fallbackChildren.flags |= 2); + fallbackChildren.return = workInProgress; + primaryChildren.return = workInProgress; + primaryChildren.sibling = fallbackChildren; + workInProgress.child = primaryChildren; + return fallbackChildren; + } + + function scheduleWorkOnFiber(fiber, renderLanes) { + fiber.lanes |= renderLanes; + var alternate = fiber.alternate; + null !== alternate && (alternate.lanes |= renderLanes); + scheduleWorkOnParentPath(fiber.return, renderLanes); + } + + function initSuspenseListRenderState(workInProgress, isBackwards, tail, lastContentRow, tailMode) { + var renderState = workInProgress.memoizedState; + null === renderState ? workInProgress.memoizedState = { + isBackwards: isBackwards, + rendering: null, + renderingStartTime: 0, + last: lastContentRow, + tail: tail, + tailMode: tailMode + } : (renderState.isBackwards = isBackwards, renderState.rendering = null, renderState.renderingStartTime = 0, renderState.last = lastContentRow, renderState.tail = tail, renderState.tailMode = tailMode); + } + + function updateSuspenseListComponent(current, workInProgress, renderLanes) { + var nextProps = workInProgress.pendingProps, + revealOrder = nextProps.revealOrder, + tailMode = nextProps.tail; + reconcileChildren(current, workInProgress, nextProps.children, renderLanes); + nextProps = suspenseStackCursor.current; + if (0 !== (nextProps & 2)) nextProps = nextProps & 1 | 2, workInProgress.flags |= 128;else { + if (null !== current && 0 !== (current.flags & 128)) a: for (current = workInProgress.child; null !== current;) { + if (13 === current.tag) null !== current.memoizedState && scheduleWorkOnFiber(current, renderLanes);else if (19 === current.tag) scheduleWorkOnFiber(current, renderLanes);else if (null !== current.child) { + current.child.return = current; + current = current.child; + continue; + } + if (current === workInProgress) break a; + + for (; null === current.sibling;) { + if (null === current.return || current.return === workInProgress) break a; + current = current.return; + } + + current.sibling.return = current.return; + current = current.sibling; + } + nextProps &= 1; + } + push(suspenseStackCursor, nextProps); + if (0 === (workInProgress.mode & 1)) workInProgress.memoizedState = null;else switch (revealOrder) { + case "forwards": + renderLanes = workInProgress.child; + + for (revealOrder = null; null !== renderLanes;) { + current = renderLanes.alternate, null !== current && null === findFirstSuspended(current) && (revealOrder = renderLanes), renderLanes = renderLanes.sibling; + } + + renderLanes = revealOrder; + null === renderLanes ? (revealOrder = workInProgress.child, workInProgress.child = null) : (revealOrder = renderLanes.sibling, renderLanes.sibling = null); + initSuspenseListRenderState(workInProgress, false, revealOrder, renderLanes, tailMode); + break; + + case "backwards": + renderLanes = null; + revealOrder = workInProgress.child; + + for (workInProgress.child = null; null !== revealOrder;) { + current = revealOrder.alternate; + + if (null !== current && null === findFirstSuspended(current)) { + workInProgress.child = revealOrder; + break; + } + + current = revealOrder.sibling; + revealOrder.sibling = renderLanes; + renderLanes = revealOrder; + revealOrder = current; + } + + initSuspenseListRenderState(workInProgress, true, renderLanes, null, tailMode); + break; + + case "together": + initSuspenseListRenderState(workInProgress, false, null, null, undefined); + break; + + default: + workInProgress.memoizedState = null; + } + return workInProgress.child; + } + + function bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) { + null !== current && (workInProgress.dependencies = current.dependencies); + workInProgressRootSkippedLanes |= workInProgress.lanes; + if (0 === (renderLanes & workInProgress.childLanes)) return null; + if (null !== current && workInProgress.child !== current.child) throw Error("Resuming work not yet implemented."); + + if (null !== workInProgress.child) { + current = workInProgress.child; + renderLanes = createWorkInProgress(current, current.pendingProps); + workInProgress.child = renderLanes; + + for (renderLanes.return = workInProgress; null !== current.sibling;) { + current = current.sibling, renderLanes = renderLanes.sibling = createWorkInProgress(current, current.pendingProps), renderLanes.return = workInProgress; + } + + renderLanes.sibling = null; + } + + return workInProgress.child; + } + + function hadNoMutationsEffects(current, completedWork) { + if (null !== current && current.child === completedWork.child) return true; + if (0 !== (completedWork.flags & 16)) return false; + + for (current = completedWork.child; null !== current;) { + if (0 !== (current.flags & 6454) || 0 !== (current.subtreeFlags & 6454)) return false; + current = current.sibling; + } + + return true; + } + + var _appendAllChildren, updateHostContainer, updateHostComponent$1, updateHostText$1; + + _appendAllChildren = function appendAllChildren(parent, workInProgress, needsVisibilityToggle, isHidden) { + for (var node = workInProgress.child; null !== node;) { + if (5 === node.tag) { + var instance = node.stateNode; + needsVisibilityToggle && isHidden && (instance = cloneHiddenInstance(instance)); + appendChildNode(parent.node, instance.node); + } else if (6 === node.tag) { + instance = node.stateNode; + if (needsVisibilityToggle && isHidden) throw Error("Not yet implemented."); + appendChildNode(parent.node, instance.node); + } else if (4 !== node.tag) { + if (13 === node.tag && 0 !== (node.flags & 4) && (instance = null !== node.memoizedState)) { + var primaryChildParent = node.child; + + if (null !== primaryChildParent && (null !== primaryChildParent.child && (primaryChildParent.child.return = primaryChildParent, _appendAllChildren(parent, primaryChildParent, true, instance)), instance = primaryChildParent.sibling, null !== instance)) { + instance.return = node; + node = instance; + continue; + } + } + + if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + } + + if (node === workInProgress) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === workInProgress) return; + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + }; + + function appendAllChildrenToContainer(containerChildSet, workInProgress, needsVisibilityToggle, isHidden) { + for (var node = workInProgress.child; null !== node;) { + if (5 === node.tag) { + var instance = node.stateNode; + needsVisibilityToggle && isHidden && (instance = cloneHiddenInstance(instance)); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (6 === node.tag) { + instance = node.stateNode; + if (needsVisibilityToggle && isHidden) throw Error("Not yet implemented."); + appendChildNodeToSet(containerChildSet, instance.node); + } else if (4 !== node.tag) { + if (13 === node.tag && 0 !== (node.flags & 4) && (instance = null !== node.memoizedState)) { + var primaryChildParent = node.child; + + if (null !== primaryChildParent && (null !== primaryChildParent.child && (primaryChildParent.child.return = primaryChildParent, appendAllChildrenToContainer(containerChildSet, primaryChildParent, true, instance)), instance = primaryChildParent.sibling, null !== instance)) { + instance.return = node; + node = instance; + continue; + } + } + + if (null !== node.child) { + node.child.return = node; + node = node.child; + continue; + } + } + + if (node === workInProgress) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === workInProgress) return; + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + } + + updateHostContainer = function updateHostContainer(current, workInProgress) { + var portalOrRoot = workInProgress.stateNode; + + if (!hadNoMutationsEffects(current, workInProgress)) { + current = portalOrRoot.containerInfo; + var newChildSet = createChildNodeSet(current); + appendAllChildrenToContainer(newChildSet, workInProgress, false, false); + portalOrRoot.pendingChildren = newChildSet; + workInProgress.flags |= 4; + completeRoot(current, newChildSet); + } + }; + + updateHostComponent$1 = function updateHostComponent$1(current, workInProgress, type, newProps) { + type = current.stateNode; + var oldProps = current.memoizedProps; + if ((current = hadNoMutationsEffects(current, workInProgress)) && oldProps === newProps) workInProgress.stateNode = type;else { + var recyclableInstance = workInProgress.stateNode; + requiredContext(contextStackCursor$1.current); + var updatePayload = null; + oldProps !== newProps && (oldProps = diffProperties(null, oldProps, newProps, recyclableInstance.canonical.viewConfig.validAttributes), recyclableInstance.canonical.currentProps = newProps, updatePayload = oldProps); + current && null === updatePayload ? workInProgress.stateNode = type : (newProps = updatePayload, oldProps = type.node, type = { + node: current ? null !== newProps ? cloneNodeWithNewProps(oldProps, newProps) : cloneNode(oldProps) : null !== newProps ? cloneNodeWithNewChildrenAndProps(oldProps, newProps) : cloneNodeWithNewChildren(oldProps), + canonical: type.canonical + }, workInProgress.stateNode = type, current ? workInProgress.flags |= 4 : _appendAllChildren(type, workInProgress, false, false)); + } + }; + + updateHostText$1 = function updateHostText$1(current, workInProgress, oldText, newText) { + oldText !== newText ? (current = requiredContext(rootInstanceStackCursor.current), oldText = requiredContext(contextStackCursor$1.current), workInProgress.stateNode = createTextInstance(newText, current, oldText, workInProgress), workInProgress.flags |= 4) : workInProgress.stateNode = current.stateNode; + }; + + function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { + switch (renderState.tailMode) { + case "hidden": + hasRenderedATailFallback = renderState.tail; + + for (var lastTailNode = null; null !== hasRenderedATailFallback;) { + null !== hasRenderedATailFallback.alternate && (lastTailNode = hasRenderedATailFallback), hasRenderedATailFallback = hasRenderedATailFallback.sibling; + } + + null === lastTailNode ? renderState.tail = null : lastTailNode.sibling = null; + break; + + case "collapsed": + lastTailNode = renderState.tail; + + for (var lastTailNode$69 = null; null !== lastTailNode;) { + null !== lastTailNode.alternate && (lastTailNode$69 = lastTailNode), lastTailNode = lastTailNode.sibling; + } + + null === lastTailNode$69 ? hasRenderedATailFallback || null === renderState.tail ? renderState.tail = null : renderState.tail.sibling = null : lastTailNode$69.sibling = null; + } + } + + function bubbleProperties(completedWork) { + var didBailout = null !== completedWork.alternate && completedWork.alternate.child === completedWork.child, + newChildLanes = 0, + subtreeFlags = 0; + if (didBailout) for (var child$70 = completedWork.child; null !== child$70;) { + newChildLanes |= child$70.lanes | child$70.childLanes, subtreeFlags |= child$70.subtreeFlags & 1835008, subtreeFlags |= child$70.flags & 1835008, child$70.return = completedWork, child$70 = child$70.sibling; + } else for (child$70 = completedWork.child; null !== child$70;) { + newChildLanes |= child$70.lanes | child$70.childLanes, subtreeFlags |= child$70.subtreeFlags, subtreeFlags |= child$70.flags, child$70.return = completedWork, child$70 = child$70.sibling; + } + completedWork.subtreeFlags |= subtreeFlags; + completedWork.childLanes = newChildLanes; + return didBailout; + } + + function completeWork(current, workInProgress, renderLanes) { + var newProps = workInProgress.pendingProps; + + switch (workInProgress.tag) { + case 2: + case 16: + case 15: + case 0: + case 11: + case 7: + case 8: + case 12: + case 9: + case 14: + return bubbleProperties(workInProgress), null; + + case 1: + return isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null; + + case 3: + return newProps = workInProgress.stateNode, popHostContainer(), pop(didPerformWorkStackCursor), pop(contextStackCursor), resetWorkInProgressVersions(), newProps.pendingContext && (newProps.context = newProps.pendingContext, newProps.pendingContext = null), null !== current && null !== current.child || newProps.hydrate || (workInProgress.flags |= 512), updateHostContainer(current, workInProgress), bubbleProperties(workInProgress), null; + + case 5: + popHostContext(workInProgress); + renderLanes = requiredContext(rootInstanceStackCursor.current); + var type = workInProgress.type; + if (null !== current && null != workInProgress.stateNode) updateHostComponent$1(current, workInProgress, type, newProps, renderLanes), current.ref !== workInProgress.ref && (workInProgress.flags |= 256);else { + if (!newProps) { + if (null === workInProgress.stateNode) throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); + bubbleProperties(workInProgress); + return null; + } + + requiredContext(contextStackCursor$1.current); + current = nextReactTag; + nextReactTag += 2; + type = getViewConfigForType(type); + var updatePayload = diffProperties(null, emptyObject, newProps, type.validAttributes); + renderLanes = createNode(current, type.uiViewClassName, renderLanes, updatePayload, workInProgress); + current = new ReactFabricHostComponent(current, type, newProps, workInProgress); + current = { + node: renderLanes, + canonical: current + }; + + _appendAllChildren(current, workInProgress, false, false); + + workInProgress.stateNode = current; + null !== workInProgress.ref && (workInProgress.flags |= 256); + } + bubbleProperties(workInProgress); + return null; + + case 6: + if (current && null != workInProgress.stateNode) updateHostText$1(current, workInProgress, current.memoizedProps, newProps);else { + if ("string" !== typeof newProps && null === workInProgress.stateNode) throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue."); + current = requiredContext(rootInstanceStackCursor.current); + renderLanes = requiredContext(contextStackCursor$1.current); + workInProgress.stateNode = createTextInstance(newProps, current, renderLanes, workInProgress); + } + bubbleProperties(workInProgress); + return null; + + case 13: + pop(suspenseStackCursor); + newProps = workInProgress.memoizedState; + if (0 !== (workInProgress.flags & 128)) return workInProgress.lanes = renderLanes, workInProgress; + newProps = null !== newProps; + renderLanes = false; + null !== current && (renderLanes = null !== current.memoizedState); + if (newProps && !renderLanes && 0 !== (workInProgress.mode & 1)) if (null === current && true !== workInProgress.memoizedProps.unstable_avoidThisFallback || 0 !== (suspenseStackCursor.current & 1)) 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 3);else { + if (0 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus) workInProgressRootExitStatus = 4; + null === workInProgressRoot || 0 === (workInProgressRootSkippedLanes & 268435455) && 0 === (workInProgressRootUpdatedLanes & 268435455) || markRootSuspended$1(workInProgressRoot, workInProgressRootRenderLanes); + } + newProps && (workInProgress.flags |= 4); + bubbleProperties(workInProgress); + return null; + + case 4: + return popHostContainer(), updateHostContainer(current, workInProgress), bubbleProperties(workInProgress), null; + + case 10: + return popProvider(workInProgress.type._context), bubbleProperties(workInProgress), null; + + case 17: + return isContextProvider(workInProgress.type) && popContext(), bubbleProperties(workInProgress), null; + + case 19: + pop(suspenseStackCursor); + type = workInProgress.memoizedState; + if (null === type) return bubbleProperties(workInProgress), null; + newProps = 0 !== (workInProgress.flags & 128); + updatePayload = type.rendering; + if (null === updatePayload) { + if (newProps) cutOffTailIfNeeded(type, false);else { + if (0 !== workInProgressRootExitStatus || null !== current && 0 !== (current.flags & 128)) for (current = workInProgress.child; null !== current;) { + updatePayload = findFirstSuspended(current); + + if (null !== updatePayload) { + workInProgress.flags |= 128; + cutOffTailIfNeeded(type, false); + current = updatePayload.updateQueue; + null !== current && (workInProgress.updateQueue = current, workInProgress.flags |= 4); + workInProgress.subtreeFlags = 0; + current = renderLanes; + + for (newProps = workInProgress.child; null !== newProps;) { + renderLanes = newProps, type = current, renderLanes.flags &= 1835010, updatePayload = renderLanes.alternate, null === updatePayload ? (renderLanes.childLanes = 0, renderLanes.lanes = type, renderLanes.child = null, renderLanes.subtreeFlags = 0, renderLanes.memoizedProps = null, renderLanes.memoizedState = null, renderLanes.updateQueue = null, renderLanes.dependencies = null, renderLanes.stateNode = null) : (renderLanes.childLanes = updatePayload.childLanes, renderLanes.lanes = updatePayload.lanes, renderLanes.child = updatePayload.child, renderLanes.subtreeFlags = 0, renderLanes.deletions = null, renderLanes.memoizedProps = updatePayload.memoizedProps, renderLanes.memoizedState = updatePayload.memoizedState, renderLanes.updateQueue = updatePayload.updateQueue, renderLanes.type = updatePayload.type, type = updatePayload.dependencies, renderLanes.dependencies = null === type ? null : { + lanes: type.lanes, + firstContext: type.firstContext + }), newProps = newProps.sibling; + } + + push(suspenseStackCursor, suspenseStackCursor.current & 1 | 2); + return workInProgress.child; + } + + current = current.sibling; + } + null !== type.tail && _$$_REQUIRE(_dependencyMap[4]).unstable_now() > workInProgressRootRenderTargetTime && (workInProgress.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress.lanes = 4194304); + } + } else { + if (!newProps) if (current = findFirstSuspended(updatePayload), null !== current) { + if (workInProgress.flags |= 128, newProps = true, current = current.updateQueue, null !== current && (workInProgress.updateQueue = current, workInProgress.flags |= 4), cutOffTailIfNeeded(type, true), null === type.tail && "hidden" === type.tailMode && !updatePayload.alternate) return bubbleProperties(workInProgress), null; + } else 2 * _$$_REQUIRE(_dependencyMap[4]).unstable_now() - type.renderingStartTime > workInProgressRootRenderTargetTime && 1073741824 !== renderLanes && (workInProgress.flags |= 128, newProps = true, cutOffTailIfNeeded(type, false), workInProgress.lanes = 4194304); + type.isBackwards ? (updatePayload.sibling = workInProgress.child, workInProgress.child = updatePayload) : (current = type.last, null !== current ? current.sibling = updatePayload : workInProgress.child = updatePayload, type.last = updatePayload); + } + if (null !== type.tail) return workInProgress = type.tail, type.rendering = workInProgress, type.tail = workInProgress.sibling, type.renderingStartTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now(), workInProgress.sibling = null, current = suspenseStackCursor.current, push(suspenseStackCursor, newProps ? current & 1 | 2 : current & 1), workInProgress; + bubbleProperties(workInProgress); + return null; + + case 22: + case 23: + return popRenderLanes(), renderLanes = null !== workInProgress.memoizedState, null !== current && null !== current.memoizedState !== renderLanes && "unstable-defer-without-hiding" !== newProps.mode && (workInProgress.flags |= 4), renderLanes && 0 === (subtreeRenderLanes & 1073741824) && 0 !== (workInProgress.mode & 1) || bubbleProperties(workInProgress), null; + } + + throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue."); + } + + function unwindWork(workInProgress) { + switch (workInProgress.tag) { + case 1: + isContextProvider(workInProgress.type) && popContext(); + var flags = workInProgress.flags; + return flags & 16384 ? (workInProgress.flags = flags & -16385 | 128, workInProgress) : null; + + case 3: + popHostContainer(); + pop(didPerformWorkStackCursor); + pop(contextStackCursor); + resetWorkInProgressVersions(); + flags = workInProgress.flags; + if (0 !== (flags & 128)) throw Error("The root failed to unmount after an error. This is likely a bug in React. Please file an issue."); + workInProgress.flags = flags & -16385 | 128; + return workInProgress; + + case 5: + return popHostContext(workInProgress), null; + + case 13: + return pop(suspenseStackCursor), flags = workInProgress.flags, flags & 16384 ? (workInProgress.flags = flags & -16385 | 128, workInProgress) : null; + + case 19: + return pop(suspenseStackCursor), null; + + case 4: + return popHostContainer(), null; + + case 10: + return popProvider(workInProgress.type._context), null; + + case 22: + case 23: + return popRenderLanes(), null; + + case 24: + return null; + + default: + return null; + } + } + + var PossiblyWeakSet = "function" === typeof WeakSet ? WeakSet : Set, + nextEffect = null; + + function safelyDetachRef(current, nearestMountedAncestor) { + var ref = current.ref; + if (null !== ref) if ("function" === typeof ref) try { + ref(null); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } else ref.current = null; + } + + var shouldFireAfterActiveInstanceBlur = false; + + function commitBeforeMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect;) { + if (root = nextEffect, firstChild = root.child, 0 !== (root.subtreeFlags & 516) && null !== firstChild) firstChild.return = root, nextEffect = firstChild;else for (; null !== nextEffect;) { + root = nextEffect; + + try { + var current = root.alternate; + if (0 !== (root.flags & 512)) switch (root.tag) { + case 0: + case 11: + case 15: + break; + + case 1: + if (null !== current) { + var prevProps = current.memoizedProps, + prevState = current.memoizedState, + instance = root.stateNode, + snapshot = instance.getSnapshotBeforeUpdate(root.elementType === root.type ? prevProps : resolveDefaultProps(root.type, prevProps), prevState); + instance.__reactInternalSnapshotBeforeUpdate = snapshot; + } + + break; + + case 3: + break; + + case 5: + case 6: + case 4: + case 17: + break; + + default: + throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); + } + } catch (error) { + captureCommitPhaseError(root, root.return, error); + } + + firstChild = root.sibling; + + if (null !== firstChild) { + firstChild.return = root.return; + nextEffect = firstChild; + break; + } + + nextEffect = root.return; + } + } + + current = shouldFireAfterActiveInstanceBlur; + shouldFireAfterActiveInstanceBlur = false; + return current; + } + + function commitHookEffectListUnmount(flags, finishedWork, nearestMountedAncestor$jscomp$0) { + var updateQueue = finishedWork.updateQueue; + updateQueue = null !== updateQueue ? updateQueue.lastEffect : null; + + if (null !== updateQueue) { + var effect = updateQueue = updateQueue.next; + + do { + if ((effect.tag & flags) === flags) { + var destroy = effect.destroy; + effect.destroy = undefined; + + if (undefined !== destroy) { + var current = finishedWork, + nearestMountedAncestor = nearestMountedAncestor$jscomp$0; + + try { + destroy(); + } catch (error) { + captureCommitPhaseError(current, nearestMountedAncestor, error); + } + } + } + + effect = effect.next; + } while (effect !== updateQueue); + } + } + + function commitHookEffectListMount(tag, finishedWork) { + finishedWork = finishedWork.updateQueue; + finishedWork = null !== finishedWork ? finishedWork.lastEffect : null; + + if (null !== finishedWork) { + var effect = finishedWork = finishedWork.next; + + do { + if ((effect.tag & tag) === tag) { + var create$82 = effect.create; + effect.destroy = create$82(); + } + + effect = effect.next; + } while (effect !== finishedWork); + } + } + + function detachFiberAfterEffects(fiber) { + var alternate = fiber.alternate; + null !== alternate && (fiber.alternate = null, detachFiberAfterEffects(alternate)); + fiber.child = null; + fiber.deletions = null; + fiber.sibling = null; + fiber.stateNode = null; + fiber.return = null; + fiber.dependencies = null; + fiber.memoizedProps = null; + fiber.memoizedState = null; + fiber.pendingProps = null; + fiber.stateNode = null; + fiber.updateQueue = null; + } + + function commitWork(current, finishedWork) { + switch (finishedWork.tag) { + case 0: + case 11: + case 14: + case 15: + commitHookEffectListUnmount(3, finishedWork, finishedWork.return); + return; + + case 12: + return; + + case 13: + null !== finishedWork.memoizedState && (globalMostRecentFallbackTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now()); + attachSuspenseRetryListeners(finishedWork); + return; + + case 19: + attachSuspenseRetryListeners(finishedWork); + return; + + case 22: + case 23: + return; + } + + a: { + switch (finishedWork.tag) { + case 1: + case 5: + case 6: + break a; + + case 3: + case 4: + break a; + } + + throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); + } + } + + function attachSuspenseRetryListeners(finishedWork) { + var wakeables = finishedWork.updateQueue; + + if (null !== wakeables) { + finishedWork.updateQueue = null; + var retryCache = finishedWork.stateNode; + null === retryCache && (retryCache = finishedWork.stateNode = new PossiblyWeakSet()); + wakeables.forEach(function (wakeable) { + var retry = resolveRetryWakeable.bind(null, finishedWork, wakeable); + retryCache.has(wakeable) || (retryCache.add(wakeable), wakeable.then(retry, retry)); + }); + } + } + + function commitMutationEffects(root, firstChild) { + for (nextEffect = firstChild; null !== nextEffect;) { + root = nextEffect; + firstChild = root.deletions; + if (null !== firstChild) for (var i = 0; i < firstChild.length; i++) { + var childToDelete = firstChild[i]; + + try { + a: for (var node = childToDelete;;) { + var current = node; + if (injectedHook && "function" === typeof injectedHook.onCommitFiberUnmount) try { + injectedHook.onCommitFiberUnmount(rendererID, current); + } catch (err) {} + + switch (current.tag) { + case 0: + case 11: + case 14: + case 15: + var updateQueue = current.updateQueue; + + if (null !== updateQueue) { + var lastEffect = updateQueue.lastEffect; + + if (null !== lastEffect) { + var firstEffect = lastEffect.next, + effect = firstEffect; + + do { + var _effect = effect, + destroy = _effect.destroy, + tag = _effect.tag; + + if (undefined !== destroy && 0 !== (tag & 2)) { + _effect = current; + var nearestMountedAncestor = root; + + try { + destroy(); + } catch (error) { + captureCommitPhaseError(_effect, nearestMountedAncestor, error); + } + } + + effect = effect.next; + } while (effect !== firstEffect); + } + } + + break; + + case 1: + safelyDetachRef(current, root); + var instance = current.stateNode; + if ("function" === typeof instance.componentWillUnmount) try { + effect = current, _effect = instance, _effect.props = effect.memoizedProps, _effect.state = effect.memoizedState, _effect.componentWillUnmount(); + } catch (unmountError) { + captureCommitPhaseError(current, root, unmountError); + } + break; + + case 5: + safelyDetachRef(current, root); + break; + + case 4: + createChildNodeSet(current.stateNode.containerInfo); + } + + if (null !== node.child) node.child.return = node, node = node.child;else { + if (node === childToDelete) break; + + for (; null === node.sibling;) { + if (null === node.return || node.return === childToDelete) break a; + node = node.return; + } + + node.sibling.return = node.return; + node = node.sibling; + } + } + + var alternate = childToDelete.alternate; + null !== alternate && (alternate.return = null); + childToDelete.return = null; + } catch (error) { + captureCommitPhaseError(childToDelete, root, error); + } + } + firstChild = root.child; + if (0 !== (root.subtreeFlags & 6454) && null !== firstChild) firstChild.return = root, nextEffect = firstChild;else for (; null !== nextEffect;) { + root = nextEffect; + + try { + var flags = root.flags; + + if (flags & 256) { + var current$jscomp$0 = root.alternate; + + if (null !== current$jscomp$0) { + var currentRef = current$jscomp$0.ref; + null !== currentRef && ("function" === typeof currentRef ? currentRef(null) : currentRef.current = null); + } + } + + switch (flags & 2054) { + case 2: + root.flags &= -3; + break; + + case 6: + root.flags &= -3; + commitWork(root.alternate, root); + break; + + case 2048: + root.flags &= -2049; + break; + + case 2052: + root.flags &= -2049; + commitWork(root.alternate, root); + break; + + case 4: + commitWork(root.alternate, root); + } + } catch (error) { + captureCommitPhaseError(root, root.return, error); + } + + firstChild = root.sibling; + + if (null !== firstChild) { + firstChild.return = root.return; + nextEffect = firstChild; + break; + } + + nextEffect = root.return; + } + } + } + + function commitLayoutEffects(finishedWork) { + for (nextEffect = finishedWork; null !== nextEffect;) { + var fiber = nextEffect, + firstChild = fiber.child; + if (0 !== (fiber.subtreeFlags & 324) && null !== firstChild) firstChild.return = fiber, nextEffect = firstChild;else for (fiber = finishedWork; null !== nextEffect;) { + firstChild = nextEffect; + + if (0 !== (firstChild.flags & 324)) { + var current = firstChild.alternate; + + try { + if (0 !== (firstChild.flags & 68)) switch (firstChild.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(3, firstChild); + break; + + case 1: + var instance = firstChild.stateNode; + if (firstChild.flags & 4) if (null === current) instance.componentDidMount();else { + var prevProps = firstChild.elementType === firstChild.type ? current.memoizedProps : resolveDefaultProps(firstChild.type, current.memoizedProps); + instance.componentDidUpdate(prevProps, current.memoizedState, instance.__reactInternalSnapshotBeforeUpdate); + } + var updateQueue = firstChild.updateQueue; + null !== updateQueue && commitUpdateQueue(firstChild, updateQueue, instance); + break; + + case 3: + var updateQueue$83 = firstChild.updateQueue; + + if (null !== updateQueue$83) { + current = null; + if (null !== firstChild.child) switch (firstChild.child.tag) { + case 5: + current = firstChild.child.stateNode.canonical; + break; + + case 1: + current = firstChild.child.stateNode; + } + commitUpdateQueue(firstChild, updateQueue$83, current); + } + + break; + + case 5: + null === current && firstChild.flags & 4 && shim(); + break; + + case 6: + break; + + case 4: + break; + + case 12: + break; + + case 13: + break; + + case 19: + case 17: + case 21: + case 22: + case 23: + break; + + default: + throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue."); + } + + if (firstChild.flags & 256) { + current = undefined; + var ref = firstChild.ref; + + if (null !== ref) { + var instance$jscomp$0 = firstChild.stateNode; + + switch (firstChild.tag) { + case 5: + current = instance$jscomp$0.canonical; + break; + + default: + current = instance$jscomp$0; + } + + "function" === typeof ref ? ref(current) : ref.current = current; + } + } + } catch (error) { + captureCommitPhaseError(firstChild, firstChild.return, error); + } + } + + if (firstChild === fiber) { + nextEffect = null; + break; + } + + current = firstChild.sibling; + + if (null !== current) { + current.return = firstChild.return; + nextEffect = current; + break; + } + + nextEffect = firstChild.return; + } + } + } + + var ceil = Math.ceil, + ReactCurrentDispatcher$2 = ReactSharedInternals.ReactCurrentDispatcher, + ReactCurrentOwner$2 = ReactSharedInternals.ReactCurrentOwner, + ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig, + executionContext = 0, + workInProgressRoot = null, + workInProgress = null, + workInProgressRootRenderLanes = 0, + subtreeRenderLanes = 0, + subtreeRenderLanesCursor = createCursor(0), + workInProgressRootExitStatus = 0, + workInProgressRootFatalError = null, + workInProgressRootSkippedLanes = 0, + workInProgressRootUpdatedLanes = 0, + workInProgressRootPingedLanes = 0, + globalMostRecentFallbackTime = 0, + workInProgressRootRenderTargetTime = Infinity, + hasUncaughtError = false, + firstUncaughtError = null, + legacyErrorBoundariesThatAlreadyFailed = null, + rootDoesHavePassiveEffects = false, + rootWithPendingPassiveEffects = null, + pendingPassiveEffectsLanes = 0, + nestedUpdateCount = 0, + rootWithNestedUpdates = null, + currentEventTime = -1, + currentEventTransitionLane = 0; + + function requestEventTime() { + return 0 !== (executionContext & 24) ? _$$_REQUIRE(_dependencyMap[4]).unstable_now() : -1 !== currentEventTime ? currentEventTime : currentEventTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now(); + } + + function requestUpdateLane(fiber) { + if (0 === (fiber.mode & 1)) return 1; + if (0 !== (executionContext & 8) && 0 !== workInProgressRootRenderLanes) return workInProgressRootRenderLanes & -workInProgressRootRenderLanes; + if (0 !== ReactCurrentBatchConfig.transition) return 0 === currentEventTransitionLane && (fiber = nextTransitionLane, nextTransitionLane <<= 1, 0 === (nextTransitionLane & 4194240) && (nextTransitionLane = 64), currentEventTransitionLane = fiber), currentEventTransitionLane; + fiber = currentUpdatePriority; + if (0 === fiber) a: { + fiber = fabricGetCurrentEventPriority ? fabricGetCurrentEventPriority() : null; + if (null != fiber) switch (fiber) { + case FabricDiscretePriority: + fiber = 1; + break a; + } + fiber = 16; + } + return fiber; + } + + function scheduleUpdateOnFiber(fiber, lane, eventTime) { + if (50 < nestedUpdateCount) throw nestedUpdateCount = 0, rootWithNestedUpdates = null, Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops."); + var root = markUpdateLaneFromFiberToRoot(fiber, lane); + if (null === root) return null; + markRootUpdated(root, lane, eventTime); + root === workInProgressRoot && (0 === (executionContext & 8) && (workInProgressRootUpdatedLanes |= lane), 4 === workInProgressRootExitStatus && markRootSuspended$1(root, workInProgressRootRenderLanes)); + 1 === lane ? 0 !== (executionContext & 4) && 0 === (executionContext & 24) ? performSyncWorkOnRoot(root) : (ensureRootIsScheduled(root, eventTime), 0 === executionContext && 0 === (fiber.mode & 1) && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks())) : ensureRootIsScheduled(root, eventTime); + return root; + } + + function markUpdateLaneFromFiberToRoot(sourceFiber, lane) { + sourceFiber.lanes |= lane; + var alternate = sourceFiber.alternate; + null !== alternate && (alternate.lanes |= lane); + alternate = sourceFiber; + + for (sourceFiber = sourceFiber.return; null !== sourceFiber;) { + sourceFiber.childLanes |= lane, alternate = sourceFiber.alternate, null !== alternate && (alternate.childLanes |= lane), alternate = sourceFiber, sourceFiber = sourceFiber.return; + } + + return 3 === alternate.tag ? alternate.stateNode : null; + } + + function ensureRootIsScheduled(root, currentTime) { + for (var existingCallbackNode = root.callbackNode, suspendedLanes = root.suspendedLanes, pingedLanes = root.pingedLanes, expirationTimes = root.expirationTimes, lanes = root.pendingLanes; 0 < lanes;) { + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5, + expirationTime = expirationTimes[index$5]; + + if (-1 === expirationTime) { + if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + } else expirationTime <= currentTime && (root.expiredLanes |= lane); + + lanes &= ~lane; + } + + suspendedLanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0); + if (0 === suspendedLanes) null !== existingCallbackNode && _$$_REQUIRE(_dependencyMap[4]).unstable_cancelCallback(existingCallbackNode), root.callbackNode = null, root.callbackPriority = 0;else if (currentTime = suspendedLanes & -suspendedLanes, root.callbackPriority !== currentTime) { + null != existingCallbackNode && _$$_REQUIRE(_dependencyMap[4]).unstable_cancelCallback(existingCallbackNode); + if (1 === currentTime) 0 === root.tag ? (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), includesLegacySyncCallbacks = true, null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)) : (existingCallbackNode = performSyncWorkOnRoot.bind(null, root), null === syncQueue ? syncQueue = [existingCallbackNode] : syncQueue.push(existingCallbackNode)), _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[4]).unstable_ImmediatePriority, flushSyncCallbacks), existingCallbackNode = null;else { + switch (lanesToEventPriority(suspendedLanes)) { + case 1: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_ImmediatePriority; + break; + + case 4: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_UserBlockingPriority; + break; + + case 16: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_NormalPriority; + break; + + case 536870912: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_IdlePriority; + break; + + default: + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_NormalPriority; + } + + existingCallbackNode = _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(existingCallbackNode, performConcurrentWorkOnRoot.bind(null, root)); + } + root.callbackPriority = currentTime; + root.callbackNode = existingCallbackNode; + } + } + + function performConcurrentWorkOnRoot(root, didTimeout) { + currentEventTime = -1; + currentEventTransitionLane = 0; + if (0 !== (executionContext & 24)) throw Error("Should not already be working."); + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) return null; + var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : 0); + if (0 === lanes) return null; + var JSCompiler_inline_result = 0 !== (lanes & root.expiredLanes) ? false : 0 === (lanes & 30); + + if (JSCompiler_inline_result && !didTimeout) { + didTimeout = lanes; + JSCompiler_inline_result = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + if (workInProgressRoot !== root || workInProgressRootRenderLanes !== didTimeout) workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now() + 500, prepareFreshStack(root, didTimeout); + + do { + try { + workLoopConcurrent(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (1); + + resetContextDependencies(); + ReactCurrentDispatcher$2.current = prevDispatcher; + executionContext = JSCompiler_inline_result; + null !== workInProgress ? didTimeout = 0 : (workInProgressRoot = null, workInProgressRootRenderLanes = 0, didTimeout = workInProgressRootExitStatus); + } else didTimeout = renderRootSync(root, lanes); + + if (0 !== didTimeout) { + 2 === didTimeout && (executionContext |= 32, root.hydrate && (root.hydrate = false, shim(root.containerInfo)), JSCompiler_inline_result = getLanesToRetrySynchronouslyOnError(root), 0 !== JSCompiler_inline_result && (lanes = JSCompiler_inline_result, didTimeout = renderRootSync(root, JSCompiler_inline_result))); + if (1 === didTimeout) throw originalCallbackNode = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()), originalCallbackNode; + root.finishedWork = root.current.alternate; + root.finishedLanes = lanes; + + switch (didTimeout) { + case 0: + case 1: + throw Error("Root did not complete. This is a bug in React."); + + case 2: + commitRoot(root); + break; + + case 3: + markRootSuspended$1(root, lanes); + + if ((lanes & 130023424) === lanes && (didTimeout = globalMostRecentFallbackTime + 500 - _$$_REQUIRE(_dependencyMap[4]).unstable_now(), 10 < didTimeout)) { + if (0 !== getNextLanes(root, 0)) break; + JSCompiler_inline_result = root.suspendedLanes; + + if ((JSCompiler_inline_result & lanes) !== lanes) { + requestEventTime(); + root.pingedLanes |= root.suspendedLanes & JSCompiler_inline_result; + break; + } + + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), didTimeout); + break; + } + + commitRoot(root); + break; + + case 4: + markRootSuspended$1(root, lanes); + if ((lanes & 4194240) === lanes) break; + didTimeout = root.eventTimes; + + for (JSCompiler_inline_result = -1; 0 < lanes;) { + var index$4 = 31 - clz32(lanes); + prevDispatcher = 1 << index$4; + index$4 = didTimeout[index$4]; + index$4 > JSCompiler_inline_result && (JSCompiler_inline_result = index$4); + lanes &= ~prevDispatcher; + } + + lanes = JSCompiler_inline_result; + lanes = _$$_REQUIRE(_dependencyMap[4]).unstable_now() - lanes; + lanes = (120 > lanes ? 120 : 480 > lanes ? 480 : 1080 > lanes ? 1080 : 1920 > lanes ? 1920 : 3e3 > lanes ? 3e3 : 4320 > lanes ? 4320 : 1960 * ceil(lanes / 1960)) - lanes; + + if (10 < lanes) { + root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root), lanes); + break; + } + + commitRoot(root); + break; + + case 5: + commitRoot(root); + break; + + default: + throw Error("Unknown root exit status."); + } + } + + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()); + return root.callbackNode === originalCallbackNode ? performConcurrentWorkOnRoot.bind(null, root) : null; + } + + function markRootSuspended$1(root, suspendedLanes) { + suspendedLanes &= ~workInProgressRootPingedLanes; + suspendedLanes &= ~workInProgressRootUpdatedLanes; + root.suspendedLanes |= suspendedLanes; + root.pingedLanes &= ~suspendedLanes; + + for (root = root.expirationTimes; 0 < suspendedLanes;) { + var index$6 = 31 - clz32(suspendedLanes), + lane = 1 << index$6; + root[index$6] = -1; + suspendedLanes &= ~lane; + } + } + + function performSyncWorkOnRoot(root) { + if (0 !== (executionContext & 24)) throw Error("Should not already be working."); + flushPassiveEffects(); + var lanes = getNextLanes(root, 0); + if (0 === (lanes & 1)) return ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()), null; + var exitStatus = renderRootSync(root, lanes); + + if (0 !== root.tag && 2 === exitStatus) { + executionContext |= 32; + root.hydrate && (root.hydrate = false, shim(root.containerInfo)); + var errorRetryLanes = getLanesToRetrySynchronouslyOnError(root); + 0 !== errorRetryLanes && (lanes = errorRetryLanes, exitStatus = renderRootSync(root, lanes)); + } + + if (1 === exitStatus) throw exitStatus = workInProgressRootFatalError, prepareFreshStack(root, 0), markRootSuspended$1(root, lanes), ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()), exitStatus; + root.finishedWork = root.current.alternate; + root.finishedLanes = lanes; + commitRoot(root); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()); + return null; + } + + function popRenderLanes() { + subtreeRenderLanes = subtreeRenderLanesCursor.current; + pop(subtreeRenderLanesCursor); + } + + function prepareFreshStack(root, lanes) { + root.finishedWork = null; + root.finishedLanes = 0; + var timeoutHandle = root.timeoutHandle; + -1 !== timeoutHandle && (root.timeoutHandle = -1, cancelTimeout(timeoutHandle)); + if (null !== workInProgress) for (timeoutHandle = workInProgress.return; null !== timeoutHandle;) { + var interruptedWork = timeoutHandle; + + switch (interruptedWork.tag) { + case 1: + interruptedWork = interruptedWork.type.childContextTypes; + null !== interruptedWork && undefined !== interruptedWork && popContext(); + break; + + case 3: + popHostContainer(); + pop(didPerformWorkStackCursor); + pop(contextStackCursor); + resetWorkInProgressVersions(); + break; + + case 5: + popHostContext(interruptedWork); + break; + + case 4: + popHostContainer(); + break; + + case 13: + pop(suspenseStackCursor); + break; + + case 19: + pop(suspenseStackCursor); + break; + + case 10: + popProvider(interruptedWork.type._context); + break; + + case 22: + case 23: + popRenderLanes(); + } + + timeoutHandle = timeoutHandle.return; + } + workInProgressRoot = root; + workInProgress = createWorkInProgress(root.current, null); + workInProgressRootRenderLanes = subtreeRenderLanes = lanes; + workInProgressRootExitStatus = 0; + workInProgressRootFatalError = null; + workInProgressRootPingedLanes = workInProgressRootUpdatedLanes = workInProgressRootSkippedLanes = 0; + + if (null !== interleavedQueues) { + for (root = 0; root < interleavedQueues.length; root++) { + if (lanes = interleavedQueues[root], timeoutHandle = lanes.interleaved, null !== timeoutHandle) { + lanes.interleaved = null; + interruptedWork = timeoutHandle.next; + var lastPendingUpdate = lanes.pending; + + if (null !== lastPendingUpdate) { + var firstPendingUpdate = lastPendingUpdate.next; + lastPendingUpdate.next = interruptedWork; + timeoutHandle.next = firstPendingUpdate; + } + + lanes.pending = timeoutHandle; + } + } + + interleavedQueues = null; + } + } + + function handleError(root$jscomp$0, thrownValue) { + do { + var erroredWork = workInProgress; + + try { + resetContextDependencies(); + ReactCurrentDispatcher$1.current = ContextOnlyDispatcher; + + if (didScheduleRenderPhaseUpdate) { + for (var hook = currentlyRenderingFiber$1.memoizedState; null !== hook;) { + var queue = hook.queue; + null !== queue && (queue.pending = null); + hook = hook.next; + } + + didScheduleRenderPhaseUpdate = false; + } + + renderLanes = 0; + workInProgressHook = currentHook = currentlyRenderingFiber$1 = null; + didScheduleRenderPhaseUpdateDuringThisPass = false; + ReactCurrentOwner$2.current = null; + + if (null === erroredWork || null === erroredWork.return) { + workInProgressRootExitStatus = 1; + workInProgressRootFatalError = thrownValue; + workInProgress = null; + break; + } + + a: { + var root = root$jscomp$0, + returnFiber = erroredWork.return, + sourceFiber = erroredWork, + value = thrownValue; + thrownValue = workInProgressRootRenderLanes; + sourceFiber.flags |= 8192; + + if (null !== value && "object" === typeof value && "function" === typeof value.then) { + var wakeable = value, + tag = sourceFiber.tag; + + if (0 === (sourceFiber.mode & 1) && (0 === tag || 11 === tag || 15 === tag)) { + var currentSource = sourceFiber.alternate; + currentSource ? (sourceFiber.updateQueue = currentSource.updateQueue, sourceFiber.memoizedState = currentSource.memoizedState, sourceFiber.lanes = currentSource.lanes) : (sourceFiber.updateQueue = null, sourceFiber.memoizedState = null); + } + + var hasInvisibleParentBoundary = 0 !== (suspenseStackCursor.current & 1), + workInProgress$30 = returnFiber; + + do { + var JSCompiler_temp; + + if (JSCompiler_temp = 13 === workInProgress$30.tag) { + var nextState = workInProgress$30.memoizedState; + if (null !== nextState) JSCompiler_temp = null !== nextState.dehydrated ? true : false;else { + var props = workInProgress$30.memoizedProps; + JSCompiler_temp = undefined === props.fallback ? false : true !== props.unstable_avoidThisFallback ? true : hasInvisibleParentBoundary ? false : true; + } + } + + if (JSCompiler_temp) { + var wakeables = workInProgress$30.updateQueue; + + if (null === wakeables) { + var updateQueue = new Set(); + updateQueue.add(wakeable); + workInProgress$30.updateQueue = updateQueue; + } else wakeables.add(wakeable); + + if (0 === (workInProgress$30.mode & 1) && workInProgress$30 !== returnFiber) { + workInProgress$30.flags |= 128; + sourceFiber.flags |= 32768; + sourceFiber.flags &= -10053; + if (1 === sourceFiber.tag) if (null === sourceFiber.alternate) sourceFiber.tag = 17;else { + var update = createUpdate(-1, 1); + update.tag = 2; + enqueueUpdate(sourceFiber, update); + } + sourceFiber.lanes |= 1; + break a; + } + + value = undefined; + sourceFiber = thrownValue; + var pingCache = root.pingCache; + null === pingCache ? (pingCache = root.pingCache = new PossiblyWeakMap(), value = new Set(), pingCache.set(wakeable, value)) : (value = pingCache.get(wakeable), undefined === value && (value = new Set(), pingCache.set(wakeable, value))); + + if (!value.has(sourceFiber)) { + value.add(sourceFiber); + var ping = pingSuspendedRoot.bind(null, root, wakeable, sourceFiber); + wakeable.then(ping, ping); + } + + workInProgress$30.flags |= 16384; + workInProgress$30.lanes = thrownValue; + break a; + } + + workInProgress$30 = workInProgress$30.return; + } while (null !== workInProgress$30); + + value = Error((getComponentNameFromFiber(sourceFiber) || "A React component") + " suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display."); + } + + 5 !== workInProgressRootExitStatus && (workInProgressRootExitStatus = 2); + value = createCapturedValue(value, sourceFiber); + workInProgress$30 = returnFiber; + + do { + switch (workInProgress$30.tag) { + case 3: + root = value; + workInProgress$30.flags |= 16384; + thrownValue &= -thrownValue; + workInProgress$30.lanes |= thrownValue; + var update$31 = createRootErrorUpdate(workInProgress$30, root, thrownValue); + enqueueCapturedUpdate(workInProgress$30, update$31); + break a; + + case 1: + root = value; + var ctor = workInProgress$30.type, + instance = workInProgress$30.stateNode; + + if (0 === (workInProgress$30.flags & 128) && ("function" === typeof ctor.getDerivedStateFromError || null !== instance && "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance)))) { + workInProgress$30.flags |= 16384; + thrownValue &= -thrownValue; + workInProgress$30.lanes |= thrownValue; + var update$34 = createClassErrorUpdate(workInProgress$30, root, thrownValue); + enqueueCapturedUpdate(workInProgress$30, update$34); + break a; + } + + } + + workInProgress$30 = workInProgress$30.return; + } while (null !== workInProgress$30); + } + + completeUnitOfWork(erroredWork); + } catch (yetAnotherThrownValue) { + thrownValue = yetAnotherThrownValue; + workInProgress === erroredWork && null !== erroredWork && (workInProgress = erroredWork = erroredWork.return); + continue; + } + + break; + } while (1); + } + + function pushDispatcher() { + var prevDispatcher = ReactCurrentDispatcher$2.current; + ReactCurrentDispatcher$2.current = ContextOnlyDispatcher; + return null === prevDispatcher ? ContextOnlyDispatcher : prevDispatcher; + } + + function renderRootSync(root, lanes) { + var prevExecutionContext = executionContext; + executionContext |= 8; + var prevDispatcher = pushDispatcher(); + workInProgressRoot === root && workInProgressRootRenderLanes === lanes || prepareFreshStack(root, lanes); + + do { + try { + workLoopSync(); + break; + } catch (thrownValue) { + handleError(root, thrownValue); + } + } while (1); + + resetContextDependencies(); + executionContext = prevExecutionContext; + ReactCurrentDispatcher$2.current = prevDispatcher; + if (null !== workInProgress) throw Error("Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue."); + workInProgressRoot = null; + workInProgressRootRenderLanes = 0; + return workInProgressRootExitStatus; + } + + function workLoopSync() { + for (; null !== workInProgress;) { + performUnitOfWork(workInProgress); + } + } + + function workLoopConcurrent() { + for (; null !== workInProgress && !_$$_REQUIRE(_dependencyMap[4]).unstable_shouldYield();) { + performUnitOfWork(workInProgress); + } + } + + function performUnitOfWork(unitOfWork) { + var next = beginWork$1(unitOfWork.alternate, unitOfWork, subtreeRenderLanes); + unitOfWork.memoizedProps = unitOfWork.pendingProps; + null === next ? completeUnitOfWork(unitOfWork) : workInProgress = next; + ReactCurrentOwner$2.current = null; + } + + function completeUnitOfWork(unitOfWork) { + var completedWork = unitOfWork; + + do { + var current = completedWork.alternate; + unitOfWork = completedWork.return; + + if (0 === (completedWork.flags & 8192)) { + if (current = completeWork(current, completedWork, subtreeRenderLanes), null !== current) { + workInProgress = current; + return; + } + } else { + current = unwindWork(completedWork); + + if (null !== current) { + current.flags &= 8191; + workInProgress = current; + return; + } + + null !== unitOfWork && (unitOfWork.flags |= 8192, unitOfWork.subtreeFlags = 0, unitOfWork.deletions = null); + } + + completedWork = completedWork.sibling; + + if (null !== completedWork) { + workInProgress = completedWork; + return; + } + + workInProgress = completedWork = unitOfWork; + } while (null !== completedWork); + + 0 === workInProgressRootExitStatus && (workInProgressRootExitStatus = 5); + } + + function commitRoot(root) { + var previousUpdateLanePriority = currentUpdatePriority, + prevTransition = ReactCurrentBatchConfig$2.transition; + + try { + ReactCurrentBatchConfig$2.transition = 0, currentUpdatePriority = 1, commitRootImpl(root, previousUpdateLanePriority); + } finally { + ReactCurrentBatchConfig$2.transition = prevTransition, currentUpdatePriority = previousUpdateLanePriority; + } + + return null; + } + + function commitRootImpl(root, renderPriorityLevel) { + do { + flushPassiveEffects(); + } while (null !== rootWithPendingPassiveEffects); + + if (0 !== (executionContext & 24)) throw Error("Should not already be working."); + var finishedWork = root.finishedWork, + lanes = root.finishedLanes; + if (null === finishedWork) return null; + root.finishedWork = null; + root.finishedLanes = 0; + if (finishedWork === root.current) throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue."); + root.callbackNode = null; + root.callbackPriority = 0; + var remainingLanes = finishedWork.lanes | finishedWork.childLanes; + markRootFinished(root, remainingLanes); + root === workInProgressRoot && (workInProgress = workInProgressRoot = null, workInProgressRootRenderLanes = 0); + 0 === (finishedWork.subtreeFlags & 1040) && 0 === (finishedWork.flags & 1040) || rootDoesHavePassiveEffects || (rootDoesHavePassiveEffects = true, _$$_REQUIRE(_dependencyMap[4]).unstable_scheduleCallback(_$$_REQUIRE(_dependencyMap[4]).unstable_NormalPriority, function () { + flushPassiveEffects(); + return null; + })); + remainingLanes = 0 !== (finishedWork.flags & 8054); + + if (0 !== (finishedWork.subtreeFlags & 8054) || remainingLanes) { + remainingLanes = ReactCurrentBatchConfig$2.transition; + ReactCurrentBatchConfig$2.transition = 0; + var previousPriority = currentUpdatePriority; + currentUpdatePriority = 1; + var prevExecutionContext = executionContext; + executionContext |= 16; + ReactCurrentOwner$2.current = null; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffects(root, finishedWork); + root.current = finishedWork; + commitLayoutEffects(finishedWork, root, lanes); + + _$$_REQUIRE(_dependencyMap[4]).unstable_requestPaint(); + + executionContext = prevExecutionContext; + currentUpdatePriority = previousPriority; + ReactCurrentBatchConfig$2.transition = remainingLanes; + } else root.current = finishedWork; + + rootDoesHavePassiveEffects && (rootDoesHavePassiveEffects = false, rootWithPendingPassiveEffects = root, pendingPassiveEffectsLanes = lanes); + remainingLanes = root.pendingLanes; + 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + 0 !== (remainingLanes & 1) ? root === rootWithNestedUpdates ? nestedUpdateCount++ : (nestedUpdateCount = 0, rootWithNestedUpdates = root) : nestedUpdateCount = 0; + onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + ensureRootIsScheduled(root, _$$_REQUIRE(_dependencyMap[4]).unstable_now()); + if (hasUncaughtError) throw hasUncaughtError = false, root = firstUncaughtError, firstUncaughtError = null, root; + if (0 !== (executionContext & 4)) return null; + 0 !== (pendingPassiveEffectsLanes & 1) && 0 !== root.tag && flushPassiveEffects(); + flushSyncCallbacks(); + return null; + } + + function flushPassiveEffects() { + if (null !== rootWithPendingPassiveEffects) { + var renderPriority = lanesToEventPriority(pendingPassiveEffectsLanes), + prevTransition = ReactCurrentBatchConfig$2.transition, + previousPriority = currentUpdatePriority; + + try { + ReactCurrentBatchConfig$2.transition = 0; + currentUpdatePriority = 16 > renderPriority ? 16 : renderPriority; + if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = false;else { + renderPriority = rootWithPendingPassiveEffects; + rootWithPendingPassiveEffects = null; + pendingPassiveEffectsLanes = 0; + if (0 !== (executionContext & 24)) throw Error("Cannot flush passive effects while already rendering."); + var prevExecutionContext = executionContext; + executionContext |= 16; + + for (nextEffect = renderPriority.current; null !== nextEffect;) { + var fiber = nextEffect, + child = fiber.child; + + if (0 !== (nextEffect.flags & 16)) { + var deletions = fiber.deletions; + + if (null !== deletions) { + for (var i = 0; i < deletions.length; i++) { + var fiberToDelete = deletions[i]; + + for (nextEffect = fiberToDelete; null !== nextEffect;) { + var fiber$jscomp$0 = nextEffect; + + switch (fiber$jscomp$0.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(4, fiber$jscomp$0, fiber); + } + + var child$jscomp$0 = fiber$jscomp$0.child; + if (null !== child$jscomp$0) child$jscomp$0.return = fiber$jscomp$0, nextEffect = child$jscomp$0;else for (; null !== nextEffect;) { + fiber$jscomp$0 = nextEffect; + var sibling = fiber$jscomp$0.sibling, + returnFiber = fiber$jscomp$0.return; + detachFiberAfterEffects(fiber$jscomp$0); + + if (fiber$jscomp$0 === fiberToDelete) { + nextEffect = null; + break; + } + + if (null !== sibling) { + sibling.return = returnFiber; + nextEffect = sibling; + break; + } + + nextEffect = returnFiber; + } + } + } + + var previousFiber = fiber.alternate; + + if (null !== previousFiber) { + var detachedChild = previousFiber.child; + + if (null !== detachedChild) { + previousFiber.child = null; + + do { + var detachedSibling = detachedChild.sibling; + detachedChild.sibling = null; + detachedChild = detachedSibling; + } while (null !== detachedChild); + } + } + + nextEffect = fiber; + } + } + + if (0 !== (fiber.subtreeFlags & 1040) && null !== child) child.return = fiber, nextEffect = child;else b: for (; null !== nextEffect;) { + fiber = nextEffect; + if (0 !== (fiber.flags & 1024)) switch (fiber.tag) { + case 0: + case 11: + case 15: + commitHookEffectListUnmount(5, fiber, fiber.return); + } + var sibling$jscomp$0 = fiber.sibling; + + if (null !== sibling$jscomp$0) { + sibling$jscomp$0.return = fiber.return; + nextEffect = sibling$jscomp$0; + break b; + } + + nextEffect = fiber.return; + } + } + + var finishedWork = renderPriority.current; + + for (nextEffect = finishedWork; null !== nextEffect;) { + child = nextEffect; + var firstChild = child.child; + if (0 !== (child.subtreeFlags & 1040) && null !== firstChild) firstChild.return = child, nextEffect = firstChild;else b: for (child = finishedWork; null !== nextEffect;) { + deletions = nextEffect; + if (0 !== (deletions.flags & 1024)) try { + switch (deletions.tag) { + case 0: + case 11: + case 15: + commitHookEffectListMount(5, deletions); + } + } catch (error) { + captureCommitPhaseError(deletions, deletions.return, error); + } + + if (deletions === child) { + nextEffect = null; + break b; + } + + var sibling$jscomp$1 = deletions.sibling; + + if (null !== sibling$jscomp$1) { + sibling$jscomp$1.return = deletions.return; + nextEffect = sibling$jscomp$1; + break b; + } + + nextEffect = deletions.return; + } + } + + executionContext = prevExecutionContext; + flushSyncCallbacks(); + if (injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot) try { + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); + } catch (err) {} + JSCompiler_inline_result = true; + } + return JSCompiler_inline_result; + } finally { + currentUpdatePriority = previousPriority, ReactCurrentBatchConfig$2.transition = prevTransition; + } + } + + return false; + } + + function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error) { + sourceFiber = createCapturedValue(error, sourceFiber); + sourceFiber = createRootErrorUpdate(rootFiber, sourceFiber, 1); + enqueueUpdate(rootFiber, sourceFiber); + sourceFiber = requestEventTime(); + rootFiber = markUpdateLaneFromFiberToRoot(rootFiber, 1); + null !== rootFiber && (markRootUpdated(rootFiber, 1, sourceFiber), ensureRootIsScheduled(rootFiber, sourceFiber)); + } + + function captureCommitPhaseError(sourceFiber, nearestMountedAncestor, error) { + if (3 === sourceFiber.tag) captureCommitPhaseErrorOnRoot(sourceFiber, sourceFiber, error);else for (nearestMountedAncestor = sourceFiber.return; null !== nearestMountedAncestor;) { + if (3 === nearestMountedAncestor.tag) { + captureCommitPhaseErrorOnRoot(nearestMountedAncestor, sourceFiber, error); + break; + } else if (1 === nearestMountedAncestor.tag) { + var instance = nearestMountedAncestor.stateNode; + + if ("function" === typeof nearestMountedAncestor.type.getDerivedStateFromError || "function" === typeof instance.componentDidCatch && (null === legacyErrorBoundariesThatAlreadyFailed || !legacyErrorBoundariesThatAlreadyFailed.has(instance))) { + sourceFiber = createCapturedValue(error, sourceFiber); + sourceFiber = createClassErrorUpdate(nearestMountedAncestor, sourceFiber, 1); + enqueueUpdate(nearestMountedAncestor, sourceFiber); + sourceFiber = requestEventTime(); + nearestMountedAncestor = markUpdateLaneFromFiberToRoot(nearestMountedAncestor, 1); + null !== nearestMountedAncestor && (markRootUpdated(nearestMountedAncestor, 1, sourceFiber), ensureRootIsScheduled(nearestMountedAncestor, sourceFiber)); + break; + } + } + + nearestMountedAncestor = nearestMountedAncestor.return; + } + } + + function pingSuspendedRoot(root, wakeable, pingedLanes) { + var pingCache = root.pingCache; + null !== pingCache && pingCache.delete(wakeable); + wakeable = requestEventTime(); + root.pingedLanes |= root.suspendedLanes & pingedLanes; + workInProgressRoot === root && (workInProgressRootRenderLanes & pingedLanes) === pingedLanes && (4 === workInProgressRootExitStatus || 3 === workInProgressRootExitStatus && (workInProgressRootRenderLanes & 130023424) === workInProgressRootRenderLanes && 500 > _$$_REQUIRE(_dependencyMap[4]).unstable_now() - globalMostRecentFallbackTime ? prepareFreshStack(root, 0) : workInProgressRootPingedLanes |= pingedLanes); + ensureRootIsScheduled(root, wakeable); + } + + function resolveRetryWakeable(boundaryFiber, wakeable) { + var retryCache = boundaryFiber.stateNode; + null !== retryCache && retryCache.delete(wakeable); + wakeable = 0; + 0 === wakeable && (0 === (boundaryFiber.mode & 1) ? wakeable = 1 : (wakeable = nextRetryLane, nextRetryLane <<= 1, 0 === (nextRetryLane & 130023424) && (nextRetryLane = 4194304))); + retryCache = requestEventTime(); + boundaryFiber = markUpdateLaneFromFiberToRoot(boundaryFiber, wakeable); + null !== boundaryFiber && (markRootUpdated(boundaryFiber, wakeable, retryCache), ensureRootIsScheduled(boundaryFiber, retryCache)); + } + + var beginWork$1; + + beginWork$1 = function beginWork$1(current, workInProgress, renderLanes) { + var updateLanes = workInProgress.lanes; + if (null !== current) { + if (current.memoizedProps !== workInProgress.pendingProps || didPerformWorkStackCursor.current) didReceiveUpdate = true;else { + if (0 === (renderLanes & updateLanes)) { + didReceiveUpdate = false; + + switch (workInProgress.tag) { + case 3: + pushHostRootContext(workInProgress); + break; + + case 5: + pushHostContext(workInProgress); + break; + + case 1: + isContextProvider(workInProgress.type) && pushContextProvider(workInProgress); + break; + + case 4: + pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo); + break; + + case 10: + updateLanes = workInProgress.type._context; + var nextValue = workInProgress.memoizedProps.value; + push(valueCursor, updateLanes._currentValue2); + updateLanes._currentValue2 = nextValue; + break; + + case 13: + if (null !== workInProgress.memoizedState) { + if (0 !== (renderLanes & workInProgress.child.childLanes)) return updateSuspenseComponent(current, workInProgress, renderLanes); + push(suspenseStackCursor, suspenseStackCursor.current & 1); + workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + return null !== workInProgress ? workInProgress.sibling : null; + } + + push(suspenseStackCursor, suspenseStackCursor.current & 1); + break; + + case 19: + updateLanes = 0 !== (renderLanes & workInProgress.childLanes); + + if (0 !== (current.flags & 128)) { + if (updateLanes) return updateSuspenseListComponent(current, workInProgress, renderLanes); + workInProgress.flags |= 128; + } + + nextValue = workInProgress.memoizedState; + null !== nextValue && (nextValue.rendering = null, nextValue.tail = null, nextValue.lastEffect = null); + push(suspenseStackCursor, suspenseStackCursor.current); + if (updateLanes) break;else return null; + + case 22: + case 23: + return workInProgress.lanes = 0, updateOffscreenComponent(current, workInProgress, renderLanes); + } + + return bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + } + + didReceiveUpdate = 0 !== (current.flags & 32768) ? true : false; + } + } else didReceiveUpdate = false; + workInProgress.lanes = 0; + + switch (workInProgress.tag) { + case 2: + updateLanes = workInProgress.type; + null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2); + current = workInProgress.pendingProps; + nextValue = getMaskedContext(workInProgress, contextStackCursor.current); + prepareToReadContext(workInProgress, renderLanes); + nextValue = renderWithHooks(null, workInProgress, updateLanes, current, nextValue, renderLanes); + workInProgress.flags |= 1; + + if ("object" === typeof nextValue && null !== nextValue && "function" === typeof nextValue.render && undefined === nextValue.$$typeof) { + workInProgress.tag = 1; + workInProgress.memoizedState = null; + workInProgress.updateQueue = null; + + if (isContextProvider(updateLanes)) { + var hasContext = true; + pushContextProvider(workInProgress); + } else hasContext = false; + + workInProgress.memoizedState = null !== nextValue.state && undefined !== nextValue.state ? nextValue.state : null; + initializeUpdateQueue(workInProgress); + nextValue.updater = classComponentUpdater; + workInProgress.stateNode = nextValue; + nextValue._reactInternals = workInProgress; + mountClassInstance(workInProgress, updateLanes, current, renderLanes); + workInProgress = finishClassComponent(null, workInProgress, updateLanes, true, hasContext, renderLanes); + } else workInProgress.tag = 0, reconcileChildren(null, workInProgress, nextValue, renderLanes), workInProgress = workInProgress.child; + + return workInProgress; + + case 16: + nextValue = workInProgress.elementType; + + a: { + null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2); + current = workInProgress.pendingProps; + hasContext = nextValue._init; + nextValue = hasContext(nextValue._payload); + workInProgress.type = nextValue; + hasContext = workInProgress.tag = resolveLazyComponentTag(nextValue); + current = resolveDefaultProps(nextValue, current); + + switch (hasContext) { + case 0: + workInProgress = updateFunctionComponent(null, workInProgress, nextValue, current, renderLanes); + break a; + + case 1: + workInProgress = updateClassComponent(null, workInProgress, nextValue, current, renderLanes); + break a; + + case 11: + workInProgress = updateForwardRef(null, workInProgress, nextValue, current, renderLanes); + break a; + + case 14: + workInProgress = updateMemoComponent(null, workInProgress, nextValue, resolveDefaultProps(nextValue.type, current), updateLanes, renderLanes); + break a; + } + + throw Error("Element type is invalid. Received a promise that resolves to: " + nextValue + ". Lazy element type must resolve to a class or function."); + } + + return workInProgress; + + case 0: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), updateFunctionComponent(current, workInProgress, updateLanes, nextValue, renderLanes); + + case 1: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), updateClassComponent(current, workInProgress, updateLanes, nextValue, renderLanes); + + case 3: + pushHostRootContext(workInProgress); + updateLanes = workInProgress.updateQueue; + if (null === current || null === updateLanes) throw Error("If the root does not have an updateQueue, we should have already bailed out. This error is likely caused by a bug in React. Please file an issue."); + nextValue = workInProgress.pendingProps; + updateLanes = workInProgress.memoizedState.element; + cloneUpdateQueue(current, workInProgress); + processUpdateQueue(workInProgress, nextValue, null, renderLanes); + nextValue = workInProgress.memoizedState.element; + nextValue === updateLanes ? workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes) : (reconcileChildren(current, workInProgress, nextValue, renderLanes), workInProgress = workInProgress.child); + return workInProgress; + + case 5: + return pushHostContext(workInProgress), updateLanes = workInProgress.pendingProps.children, markRef(current, workInProgress), reconcileChildren(current, workInProgress, updateLanes, renderLanes), workInProgress.child; + + case 6: + return null; + + case 13: + return updateSuspenseComponent(current, workInProgress, renderLanes); + + case 4: + return pushHostContainer(workInProgress, workInProgress.stateNode.containerInfo), updateLanes = workInProgress.pendingProps, null === current ? workInProgress.child = reconcileChildFibers(workInProgress, null, updateLanes, renderLanes) : reconcileChildren(current, workInProgress, updateLanes, renderLanes), workInProgress.child; + + case 11: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), updateForwardRef(current, workInProgress, updateLanes, nextValue, renderLanes); + + case 7: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps, renderLanes), workInProgress.child; + + case 8: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + + case 12: + return reconcileChildren(current, workInProgress, workInProgress.pendingProps.children, renderLanes), workInProgress.child; + + case 10: + a: { + updateLanes = workInProgress.type._context; + nextValue = workInProgress.pendingProps; + hasContext = workInProgress.memoizedProps; + var newValue = nextValue.value; + push(valueCursor, updateLanes._currentValue2); + updateLanes._currentValue2 = newValue; + if (null !== hasContext) if (objectIs(hasContext.value, newValue)) { + if (hasContext.children === nextValue.children && !didPerformWorkStackCursor.current) { + workInProgress = bailoutOnAlreadyFinishedWork(current, workInProgress, renderLanes); + break a; + } + } else for (newValue = workInProgress.child, null !== newValue && (newValue.return = workInProgress); null !== newValue;) { + var list = newValue.dependencies; + + if (null !== list) { + hasContext = newValue.child; + + for (var dependency = list.firstContext; null !== dependency;) { + if (dependency.context === updateLanes) { + if (1 === newValue.tag) { + dependency = createUpdate(-1, renderLanes & -renderLanes); + dependency.tag = 2; + var updateQueue = newValue.updateQueue; + + if (null !== updateQueue) { + updateQueue = updateQueue.shared; + var pending = updateQueue.pending; + null === pending ? dependency.next = dependency : (dependency.next = pending.next, pending.next = dependency); + updateQueue.pending = dependency; + } + } + + newValue.lanes |= renderLanes; + dependency = newValue.alternate; + null !== dependency && (dependency.lanes |= renderLanes); + scheduleWorkOnParentPath(newValue.return, renderLanes); + list.lanes |= renderLanes; + break; + } + + dependency = dependency.next; + } + } else hasContext = 10 === newValue.tag ? newValue.type === workInProgress.type ? null : newValue.child : newValue.child; + + if (null !== hasContext) hasContext.return = newValue;else for (hasContext = newValue; null !== hasContext;) { + if (hasContext === workInProgress) { + hasContext = null; + break; + } + + newValue = hasContext.sibling; + + if (null !== newValue) { + newValue.return = hasContext.return; + hasContext = newValue; + break; + } + + hasContext = hasContext.return; + } + newValue = hasContext; + } + reconcileChildren(current, workInProgress, nextValue.children, renderLanes); + workInProgress = workInProgress.child; + } + + return workInProgress; + + case 9: + return nextValue = workInProgress.type, updateLanes = workInProgress.pendingProps.children, prepareToReadContext(workInProgress, renderLanes), nextValue = readContext(nextValue), updateLanes = updateLanes(nextValue), workInProgress.flags |= 1, reconcileChildren(current, workInProgress, updateLanes, renderLanes), workInProgress.child; + + case 14: + return nextValue = workInProgress.type, hasContext = resolveDefaultProps(nextValue, workInProgress.pendingProps), hasContext = resolveDefaultProps(nextValue.type, hasContext), updateMemoComponent(current, workInProgress, nextValue, hasContext, updateLanes, renderLanes); + + case 15: + return updateSimpleMemoComponent(current, workInProgress, workInProgress.type, workInProgress.pendingProps, updateLanes, renderLanes); + + case 17: + return updateLanes = workInProgress.type, nextValue = workInProgress.pendingProps, nextValue = workInProgress.elementType === updateLanes ? nextValue : resolveDefaultProps(updateLanes, nextValue), null !== current && (current.alternate = null, workInProgress.alternate = null, workInProgress.flags |= 2), workInProgress.tag = 1, isContextProvider(updateLanes) ? (current = true, pushContextProvider(workInProgress)) : current = false, prepareToReadContext(workInProgress, renderLanes), constructClassInstance(workInProgress, updateLanes, nextValue), mountClassInstance(workInProgress, updateLanes, nextValue, renderLanes), finishClassComponent(null, workInProgress, updateLanes, true, current, renderLanes); + + case 19: + return updateSuspenseListComponent(current, workInProgress, renderLanes); + + case 22: + return updateOffscreenComponent(current, workInProgress, renderLanes); + + case 23: + return updateOffscreenComponent(current, workInProgress, renderLanes); + } + + throw Error("Unknown unit of work tag (" + workInProgress.tag + "). This error is likely caused by a bug in React. Please file an issue."); + }; + + function FiberNode(tag, pendingProps, key, mode) { + this.tag = tag; + this.key = key; + this.sibling = this.child = this.return = this.stateNode = this.type = this.elementType = null; + this.index = 0; + this.ref = null; + this.pendingProps = pendingProps; + this.dependencies = this.memoizedState = this.updateQueue = this.memoizedProps = null; + this.mode = mode; + this.subtreeFlags = this.flags = 0; + this.deletions = null; + this.childLanes = this.lanes = 0; + this.alternate = null; + } + + function createFiber(tag, pendingProps, key, mode) { + return new FiberNode(tag, pendingProps, key, mode); + } + + function shouldConstruct(Component) { + Component = Component.prototype; + return !(!Component || !Component.isReactComponent); + } + + function resolveLazyComponentTag(Component) { + if ("function" === typeof Component) return shouldConstruct(Component) ? 1 : 0; + + if (undefined !== Component && null !== Component) { + Component = Component.$$typeof; + if (Component === REACT_FORWARD_REF_TYPE) return 11; + if (Component === REACT_MEMO_TYPE) return 14; + } + + return 2; + } + + function createWorkInProgress(current, pendingProps) { + var workInProgress = current.alternate; + null === workInProgress ? (workInProgress = createFiber(current.tag, pendingProps, current.key, current.mode), workInProgress.elementType = current.elementType, workInProgress.type = current.type, workInProgress.stateNode = current.stateNode, workInProgress.alternate = current, current.alternate = workInProgress) : (workInProgress.pendingProps = pendingProps, workInProgress.type = current.type, workInProgress.flags = 0, workInProgress.subtreeFlags = 0, workInProgress.deletions = null); + workInProgress.flags = current.flags & 1835008; + workInProgress.childLanes = current.childLanes; + workInProgress.lanes = current.lanes; + workInProgress.child = current.child; + workInProgress.memoizedProps = current.memoizedProps; + workInProgress.memoizedState = current.memoizedState; + workInProgress.updateQueue = current.updateQueue; + pendingProps = current.dependencies; + workInProgress.dependencies = null === pendingProps ? null : { + lanes: pendingProps.lanes, + firstContext: pendingProps.firstContext + }; + workInProgress.sibling = current.sibling; + workInProgress.index = current.index; + workInProgress.ref = current.ref; + return workInProgress; + } + + function createFiberFromTypeAndProps(type, key, pendingProps, owner, mode, lanes) { + var fiberTag = 2; + owner = type; + if ("function" === typeof type) shouldConstruct(type) && (fiberTag = 1);else if ("string" === typeof type) fiberTag = 5;else a: switch (type) { + case REACT_FRAGMENT_TYPE: + return createFiberFromFragment(pendingProps.children, mode, lanes, key); + + case REACT_DEBUG_TRACING_MODE_TYPE: + fiberTag = 8; + mode |= 4; + break; + + case REACT_STRICT_MODE_TYPE: + fiberTag = 8; + mode |= 8; + break; + + case REACT_PROFILER_TYPE: + return type = createFiber(12, pendingProps, key, mode | 2), type.elementType = REACT_PROFILER_TYPE, type.lanes = lanes, type; + + case REACT_SUSPENSE_TYPE: + return type = createFiber(13, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_TYPE, type.lanes = lanes, type; + + case REACT_SUSPENSE_LIST_TYPE: + return type = createFiber(19, pendingProps, key, mode), type.elementType = REACT_SUSPENSE_LIST_TYPE, type.lanes = lanes, type; + + case REACT_OFFSCREEN_TYPE: + return createFiberFromOffscreen(pendingProps, mode, lanes, key); + + case REACT_LEGACY_HIDDEN_TYPE: + return type = createFiber(23, pendingProps, key, mode), type.elementType = REACT_LEGACY_HIDDEN_TYPE, type.lanes = lanes, type; + + default: + if ("object" === typeof type && null !== type) switch (type.$$typeof) { + case REACT_PROVIDER_TYPE: + fiberTag = 10; + break a; + + case REACT_CONTEXT_TYPE: + fiberTag = 9; + break a; + + case REACT_FORWARD_REF_TYPE: + fiberTag = 11; + break a; + + case REACT_MEMO_TYPE: + fiberTag = 14; + break a; + + case REACT_LAZY_TYPE: + fiberTag = 16; + owner = null; + break a; + } + throw Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: " + (null == type ? type : typeof type) + "."); + } + key = createFiber(fiberTag, pendingProps, key, mode); + key.elementType = type; + key.type = owner; + key.lanes = lanes; + return key; + } + + function createFiberFromFragment(elements, mode, lanes, key) { + elements = createFiber(7, elements, key, mode); + elements.lanes = lanes; + return elements; + } + + function createFiberFromOffscreen(pendingProps, mode, lanes, key) { + pendingProps = createFiber(22, pendingProps, key, mode); + pendingProps.elementType = REACT_OFFSCREEN_TYPE; + pendingProps.lanes = lanes; + return pendingProps; + } + + function createFiberFromText(content, mode, lanes) { + content = createFiber(6, content, null, mode); + content.lanes = lanes; + return content; + } + + function createFiberFromPortal(portal, mode, lanes) { + mode = createFiber(4, null !== portal.children ? portal.children : [], portal.key, mode); + mode.lanes = lanes; + mode.stateNode = { + containerInfo: portal.containerInfo, + pendingChildren: null, + implementation: portal.implementation + }; + return mode; + } + + function FiberRootNode(containerInfo, tag, hydrate) { + this.tag = tag; + this.containerInfo = containerInfo; + this.finishedWork = this.pingCache = this.current = this.pendingChildren = null; + this.timeoutHandle = -1; + this.pendingContext = this.context = null; + this.hydrate = hydrate; + this.callbackNode = null; + this.callbackPriority = 0; + this.eventTimes = createLaneMap(0); + this.expirationTimes = createLaneMap(-1); + this.entangledLanes = this.finishedLanes = this.mutableReadLanes = this.expiredLanes = this.pingedLanes = this.suspendedLanes = this.pendingLanes = 0; + this.entanglements = createLaneMap(0); + } + + function createPortal(children, containerInfo, implementation) { + var key = 3 < arguments.length && undefined !== arguments[3] ? arguments[3] : null; + return { + $$typeof: REACT_PORTAL_TYPE, + key: null == key ? null : "" + key, + children: children, + containerInfo: containerInfo, + implementation: implementation + }; + } + + function findHostInstance(component) { + var fiber = component._reactInternals; + + if (undefined === fiber) { + if ("function" === typeof component.render) throw Error("Unable to find node on an unmounted component."); + throw Error("Argument appears to not be a ReactComponent. Keys: " + Object.keys(component)); + } + + component = findCurrentHostFiber(fiber); + return null === component ? null : component.stateNode; + } + + function updateContainer(element, container, parentComponent, callback) { + var current = container.current, + eventTime = requestEventTime(), + lane = requestUpdateLane(current); + + a: if (parentComponent) { + parentComponent = parentComponent._reactInternals; + + b: { + if (getNearestMountedFiber(parentComponent) !== parentComponent || 1 !== parentComponent.tag) throw Error("Expected subtree parent to be a mounted class component. This error is likely caused by a bug in React. Please file an issue."); + var JSCompiler_inline_result = parentComponent; + + do { + switch (JSCompiler_inline_result.tag) { + case 3: + JSCompiler_inline_result = JSCompiler_inline_result.stateNode.context; + break b; + + case 1: + if (isContextProvider(JSCompiler_inline_result.type)) { + JSCompiler_inline_result = JSCompiler_inline_result.stateNode.__reactInternalMemoizedMergedChildContext; + break b; + } + + } + + JSCompiler_inline_result = JSCompiler_inline_result.return; + } while (null !== JSCompiler_inline_result); + + throw Error("Found unexpected detached subtree parent. This error is likely caused by a bug in React. Please file an issue."); + } + + if (1 === parentComponent.tag) { + var Component = parentComponent.type; + + if (isContextProvider(Component)) { + parentComponent = processChildContext(parentComponent, Component, JSCompiler_inline_result); + break a; + } + } + + parentComponent = JSCompiler_inline_result; + } else parentComponent = emptyContextObject; + + null === container.context ? container.context = parentComponent : container.pendingContext = parentComponent; + container = createUpdate(eventTime, lane); + container.payload = { + element: element + }; + callback = undefined === callback ? null : callback; + null !== callback && (container.callback = callback); + enqueueUpdate(current, container); + element = scheduleUpdateOnFiber(current, lane, eventTime); + null !== element && entangleTransitions(element, current, lane); + return lane; + } + + function emptyFindFiberByHostInstance() { + return null; + } + + function findNodeHandle(componentOrHandle) { + if (null == componentOrHandle) return null; + if ("number" === typeof componentOrHandle) return componentOrHandle; + if (componentOrHandle._nativeTag) return componentOrHandle._nativeTag; + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) return componentOrHandle.canonical._nativeTag; + componentOrHandle = findHostInstance(componentOrHandle); + return null == componentOrHandle ? componentOrHandle : componentOrHandle.canonical ? componentOrHandle.canonical._nativeTag : componentOrHandle._nativeTag; + } + + batchedUpdatesImpl = function batchedUpdatesImpl(fn, a) { + var prevExecutionContext = executionContext; + executionContext |= 1; + + try { + return fn(a); + } finally { + executionContext = prevExecutionContext, 0 === executionContext && (workInProgressRootRenderTargetTime = _$$_REQUIRE(_dependencyMap[4]).unstable_now() + 500, includesLegacySyncCallbacks && flushSyncCallbacks()); + } + }; + + var roots = new Map(), + devToolsConfig$jscomp$inline_939 = { + findFiberByHostInstance: getInstanceFromInstance, + bundleType: 0, + version: "18.0.0-experimental-568dc3532", + rendererPackageName: "react-native-renderer", + rendererConfig: { + getInspectorDataForViewTag: function getInspectorDataForViewTag() { + throw Error("getInspectorDataForViewTag() is not available in production"); + }, + getInspectorDataForViewAtPoint: function () { + throw Error("getInspectorDataForViewAtPoint() is not available in production."); + }.bind(null, findNodeHandle) + } + }; + var internals$jscomp$inline_1177 = { + bundleType: devToolsConfig$jscomp$inline_939.bundleType, + version: devToolsConfig$jscomp$inline_939.version, + rendererPackageName: devToolsConfig$jscomp$inline_939.rendererPackageName, + rendererConfig: devToolsConfig$jscomp$inline_939.rendererConfig, + overrideHookState: null, + overrideHookStateDeletePath: null, + overrideHookStateRenamePath: null, + overrideProps: null, + overridePropsDeletePath: null, + overridePropsRenamePath: null, + setErrorHandler: null, + setSuspenseHandler: null, + scheduleUpdate: null, + currentDispatcherRef: ReactSharedInternals.ReactCurrentDispatcher, + findHostInstanceByFiber: function findHostInstanceByFiber(fiber) { + fiber = findCurrentHostFiber(fiber); + return null === fiber ? null : fiber.stateNode; + }, + findFiberByHostInstance: devToolsConfig$jscomp$inline_939.findFiberByHostInstance || emptyFindFiberByHostInstance, + findHostInstancesForRefresh: null, + scheduleRefresh: null, + scheduleRoot: null, + setRefreshHandler: null, + getCurrentFiber: null, + reconcilerVersion: "18.0.0-experimental-568dc3532" + }; + + if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { + var hook$jscomp$inline_1178 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + if (!hook$jscomp$inline_1178.isDisabled && hook$jscomp$inline_1178.supportsFiber) try { + rendererID = hook$jscomp$inline_1178.inject(internals$jscomp$inline_1177), injectedHook = hook$jscomp$inline_1178; + } catch (err) {} + } + + exports.createPortal = function (children, containerTag) { + return createPortal(children, containerTag, null, 2 < arguments.length && undefined !== arguments[2] ? arguments[2] : null); + }; + + exports.dispatchCommand = function (handle, command, args) { + null != handle._nativeTag && (handle._internalInstanceHandle ? nativeFabricUIManager.dispatchCommand(handle._internalInstanceHandle.stateNode.node, command, args) : _$$_REQUIRE(_dependencyMap[3]).UIManager.dispatchViewManagerCommand(handle._nativeTag, command, args)); + }; + + exports.findHostInstance_DEPRECATED = function (componentOrHandle) { + if (null == componentOrHandle) return null; + if (componentOrHandle._nativeTag) return componentOrHandle; + if (componentOrHandle.canonical && componentOrHandle.canonical._nativeTag) return componentOrHandle.canonical; + componentOrHandle = findHostInstance(componentOrHandle); + return null == componentOrHandle ? componentOrHandle : componentOrHandle.canonical ? componentOrHandle.canonical : componentOrHandle; + }; + + exports.findNodeHandle = findNodeHandle; + + exports.render = function (element, containerTag, callback, concurrentRoot) { + var root = roots.get(containerTag); + root || (root = concurrentRoot ? 1 : 0, concurrentRoot = new FiberRootNode(containerTag, root, false), root = createFiber(3, null, null, 1 === root ? 1 : 0), concurrentRoot.current = root, root.stateNode = concurrentRoot, root.memoizedState = { + element: null + }, initializeUpdateQueue(root), root = concurrentRoot, roots.set(containerTag, root)); + updateContainer(element, root, null, callback); + + a: if (element = root.current, element.child) switch (element.child.tag) { + case 5: + element = element.child.stateNode.canonical; + break a; + + default: + element = element.child.stateNode; + } else element = null; + + return element; + }; + + exports.sendAccessibilityEvent = function (handle, eventType) { + null != handle._nativeTag && (handle._internalInstanceHandle ? nativeFabricUIManager.sendAccessibilityEvent(handle._internalInstanceHandle.stateNode.node, eventType) : _$$_REQUIRE(_dependencyMap[3]).legacySendAccessibilityEvent(handle._nativeTag, eventType)); + }; + + exports.stopSurface = function (containerTag) { + var root = roots.get(containerTag); + root && updateContainer(null, root, null, function () { + roots.delete(containerTag); + }); + }; + + exports.unmountComponentAtNode = function (containerTag) { + this.stopSurface(containerTag); + }; +},360,[56,17,6,136,180]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.coerceDisplayMode = coerceDisplayMode; + exports.default = undefined; + var DisplayMode = Object.freeze({ + VISIBLE: 1, + SUSPENDED: 2, + HIDDEN: 3 + }); + + function coerceDisplayMode(value) { + switch (value) { + case DisplayMode.SUSPENDED: + return DisplayMode.SUSPENDED; + + case DisplayMode.HIDDEN: + return DisplayMode.HIDDEN; + + default: + return DisplayMode.VISIBLE; + } + } + + var _default = DisplayMode; + exports.default = _default; +},361,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NativeRedBox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NativeBugReporting = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function defaultExtras() { + BugReporting.addFileSource('react_hierarchy.txt', function () { + return _$$_REQUIRE(_dependencyMap[7])(); + }); + } + + var BugReporting = function () { + function BugReporting() { + (0, _classCallCheck2.default)(this, BugReporting); + } + + (0, _createClass2.default)(BugReporting, null, [{ + key: "_maybeInit", + value: function _maybeInit() { + if (!BugReporting._subscription) { + BugReporting._subscription = _RCTDeviceEventEmitter.default.addListener('collectBugExtraData', BugReporting.collectExtraData, null); + defaultExtras(); + } + + if (!BugReporting._redboxSubscription) { + BugReporting._redboxSubscription = _RCTDeviceEventEmitter.default.addListener('collectRedBoxExtraData', BugReporting.collectExtraData, null); + } + } + }, { + key: "addSource", + value: function addSource(key, callback) { + return this._addSource(key, callback, BugReporting._extraSources); + } + }, { + key: "addFileSource", + value: function addFileSource(key, callback) { + return this._addSource(key, callback, BugReporting._fileSources); + } + }, { + key: "_addSource", + value: function _addSource(key, callback, source) { + BugReporting._maybeInit(); + + if (source.has(key)) { + console.warn("BugReporting.add* called multiple times for same key '" + key + "'"); + } + + source.set(key, callback); + return { + remove: function remove() { + source.delete(key); + } + }; + } + }, { + key: "collectExtraData", + value: function collectExtraData() { + var extraData = {}; + + for (var _iterator = _createForOfIteratorHelperLoose(BugReporting._extraSources), _step; !(_step = _iterator()).done;) { + var _ref = _step.value; + + var _ref2 = (0, _slicedToArray2.default)(_ref, 2); + + var _key = _ref2[0]; + var callback = _ref2[1]; + extraData[_key] = callback(); + } + + var fileData = {}; + + for (var _iterator2 = _createForOfIteratorHelperLoose(BugReporting._fileSources), _step2; !(_step2 = _iterator2()).done;) { + var _ref3 = _step2.value; + + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2); + + var _key2 = _ref4[0]; + var _callback = _ref4[1]; + fileData[_key2] = _callback(); + } + + if (_NativeBugReporting.default != null && _NativeBugReporting.default.setExtraData != null) { + _NativeBugReporting.default.setExtraData(extraData, fileData); + } + + if (_NativeRedBox.default != null && _NativeRedBox.default.setExtraData != null) { + _NativeRedBox.default.setExtraData(extraData, 'From BugReporting.js'); + } + + return { + extras: extraData, + files: fileData + }; + } + }]); + return BugReporting; + }(); + + BugReporting._extraSources = new Map(); + BugReporting._fileSources = new Map(); + BugReporting._subscription = null; + BugReporting._redboxSubscription = null; + module.exports = BugReporting; +},362,[5,41,7,8,30,363,364,365]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('RedBox'); + + exports.default = _default; +},363,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('BugReporting'); + + exports.default = _default; +},364,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function dumpReactTree() { + try { + return getReactTree(); + } catch (e) { + return 'Failed to dump react tree: ' + e; + } + } + + function getReactTree() { + return "React tree dumps have been temporarily disabled while React is upgraded to Fiber."; + } + + module.exports = dumpReactTree; +},365,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _listeners = []; + var _activeScene = { + name: 'default' + }; + var SceneTracker = { + setActiveScene: function setActiveScene(scene) { + _activeScene = scene; + + _listeners.forEach(function (listener) { + return listener(_activeScene); + }); + }, + getActiveScene: function getActiveScene() { + return _activeScene; + }, + addActiveSceneChangedListener: function addActiveSceneChangedListener(callback) { + _listeners.push(callback); + + return { + remove: function remove() { + _listeners = _listeners.filter(function (listener) { + return callback !== listener; + }); + } + }; + } + }; + module.exports = SceneTracker; +},366,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _logError = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NativeAppState = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var AppState = function () { + function AppState() { + var _this = this; + + (0, _classCallCheck2.default)(this, AppState); + this.currentState = null; + + if (_NativeAppState.default == null) { + this.isAvailable = false; + } else { + this.isAvailable = true; + var emitter = new _NativeEventEmitter.default(_Platform.default.OS !== 'ios' ? null : _NativeAppState.default); + this._emitter = emitter; + this.currentState = _NativeAppState.default.getConstants().initialAppState; + var eventUpdated = false; + emitter.addListener('appStateDidChange', function (appStateData) { + eventUpdated = true; + _this.currentState = appStateData.app_state; + }); + + _NativeAppState.default.getCurrentAppState(function (appStateData) { + if (!eventUpdated && _this.currentState !== appStateData.app_state) { + _this.currentState = appStateData.app_state; + emitter.emit('appStateDidChange', appStateData); + } + }, _logError.default); + } + } + + (0, _createClass2.default)(AppState, [{ + key: "addEventListener", + value: function addEventListener(type, handler) { + var emitter = this._emitter; + + if (emitter == null) { + throw new Error('Cannot use AppState when `isAvailable` is false.'); + } + + switch (type) { + case 'change': + var changeHandler = handler; + return emitter.addListener('appStateDidChange', function (appStateData) { + changeHandler(appStateData.app_state); + }); + + case 'memoryWarning': + var memoryWarningHandler = handler; + return emitter.addListener('memoryWarning', memoryWarningHandler); + + case 'blur': + case 'focus': + var focusOrBlurHandler = handler; + return emitter.addListener('appStateFocusChange', function (hasFocus) { + if (type === 'blur' && !hasFocus) { + focusOrBlurHandler(); + } + + if (type === 'focus' && hasFocus) { + focusOrBlurHandler(); + } + }); + } + + throw new Error('Trying to subscribe to unknown event: ' + type); + } + }, { + key: "removeEventListener", + value: function removeEventListener(type, listener) { + var emitter = this._emitter; + + if (emitter == null) { + throw new Error('Cannot use AppState when `isAvailable` is false.'); + } + + switch (type) { + case 'change': + emitter.removeListener('appStateDidChange', listener); + return; + + case 'memoryWarning': + emitter.removeListener('memoryWarning', listener); + return; + + case 'blur': + case 'focus': + emitter.addListener('appStateFocusChange', listener); + return; + } + + throw new Error('Trying to unsubscribe from unknown event: ' + type); + } + }]); + return AppState; + }(); + + module.exports = new AppState(); +},367,[5,7,8,110,368,369,37]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var logError = function logError() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (args.length === 1 && args[0] instanceof Error) { + var err = args[0]; + console.error('Error: "' + err.message + '". Stack:\n' + err.stack); + } else {} + }; + + module.exports = logError; +},368,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('AppState'); + + exports.default = _default; +},369,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _NativeAsyncLocalStorage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeAsyncSQLiteDBStorage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var RCTAsyncStorage = _NativeAsyncSQLiteDBStorage.default || _NativeAsyncLocalStorage.default; + var AsyncStorage = { + _getRequests: [], + _getKeys: [], + _immediate: null, + getItem: function getItem(key, callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiGet([key], function (errors, result) { + var value = result && result[0] && result[0][1] ? result[0][1] : null; + var errs = convertErrors(errors); + callback && callback(errs && errs[0], value); + + if (errs) { + reject(errs[0]); + } else { + resolve(value); + } + }); + }); + }, + setItem: function setItem(key, value, callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiSet([[key, value]], function (errors) { + var errs = convertErrors(errors); + callback && callback(errs && errs[0]); + + if (errs) { + reject(errs[0]); + } else { + resolve(); + } + }); + }); + }, + removeItem: function removeItem(key, callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiRemove([key], function (errors) { + var errs = convertErrors(errors); + callback && callback(errs && errs[0]); + + if (errs) { + reject(errs[0]); + } else { + resolve(); + } + }); + }); + }, + mergeItem: function mergeItem(key, value, callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiMerge([[key, value]], function (errors) { + var errs = convertErrors(errors); + callback && callback(errs && errs[0]); + + if (errs) { + reject(errs[0]); + } else { + resolve(); + } + }); + }); + }, + clear: function clear(callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.clear(function (error) { + callback && callback(convertError(error)); + + if (error && convertError(error)) { + reject(convertError(error)); + } else { + resolve(); + } + }); + }); + }, + getAllKeys: function getAllKeys(callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.getAllKeys(function (error, keys) { + callback && callback(convertError(error), keys); + + if (error) { + reject(convertError(error)); + } else { + resolve(keys); + } + }); + }); + }, + flushGetRequests: function flushGetRequests() { + var getRequests = this._getRequests; + var getKeys = this._getKeys; + this._getRequests = []; + this._getKeys = []; + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + RCTAsyncStorage.multiGet(getKeys, function (errors, result) { + var map = {}; + result && result.forEach(function (_ref) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + + map[key] = value; + return value; + }); + var reqLength = getRequests.length; + + for (var i = 0; i < reqLength; i++) { + var request = getRequests[i]; + var requestKeys = request.keys; + var requestResult = requestKeys.map(function (key) { + return [key, map[key]]; + }); + request.callback && request.callback(null, requestResult); + request.resolve && request.resolve(requestResult); + } + }); + }, + multiGet: function multiGet(keys, callback) { + var _this = this; + + if (!this._immediate) { + this._immediate = setImmediate(function () { + _this._immediate = null; + + _this.flushGetRequests(); + }); + } + + return new Promise(function (resolve, reject) { + _this._getRequests.push({ + keys: keys, + callback: callback, + keyIndex: _this._getKeys.length, + resolve: resolve, + reject: reject + }); + + keys.forEach(function (key) { + if (_this._getKeys.indexOf(key) === -1) { + _this._getKeys.push(key); + } + }); + }); + }, + multiSet: function multiSet(keyValuePairs, callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiSet(keyValuePairs, function (errors) { + var error = convertErrors(errors); + callback && callback(error); + + if (error) { + reject(error); + } else { + resolve(); + } + }); + }); + }, + multiRemove: function multiRemove(keys, callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiRemove(keys, function (errors) { + var error = convertErrors(errors); + callback && callback(error); + + if (error) { + reject(error); + } else { + resolve(); + } + }); + }); + }, + multiMerge: function multiMerge(keyValuePairs, callback) { + (0, _invariant.default)(RCTAsyncStorage, 'RCTAsyncStorage not available'); + return new Promise(function (resolve, reject) { + RCTAsyncStorage.multiMerge(keyValuePairs, function (errors) { + var error = convertErrors(errors); + callback && callback(error); + + if (error) { + reject(error); + } else { + resolve(); + } + }); + }); + } + }; + + if (RCTAsyncStorage && !RCTAsyncStorage.multiMerge) { + delete AsyncStorage.mergeItem; + delete AsyncStorage.multiMerge; + } + + function convertErrors(errs) { + if (!errs) { + return null; + } + + return (Array.isArray(errs) ? errs : [errs]).map(function (e) { + return convertError(e); + }); + } + + function convertError(error) { + if (!error) { + return null; + } + + var out = new Error(error.message); + out.key = error.key; + return out; + } + + module.exports = AsyncStorage; +},370,[5,41,371,372,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('AsyncLocalStorage'); + + exports.default = _default; +},371,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('AsyncSQLiteDBStorage'); + + exports.default = _default; +},372,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeClipboard = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + module.exports = { + getString: function getString() { + return _NativeClipboard.default.getString(); + }, + setString: function setString(content) { + _NativeClipboard.default.setString(content); + } + }; +},373,[5,374]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('Clipboard'); + + exports.default = _default; +},374,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeDeviceInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + module.exports = _NativeDeviceInfo.default; +},375,[5,172]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeDevSettings = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var DevSettings = { + addMenuItem: function addMenuItem(title, handler) {}, + reload: function reload(reason) {}, + onFastRefresh: function onFastRefresh() {} + }; + module.exports = DevSettings; +},376,[5,377,110,37]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('DevSettings'); + + exports.default = _default; +},377,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeImagePickerIOS = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var ImagePickerIOS = { + canRecordVideos: function canRecordVideos(callback) { + (0, _invariant.default)(_NativeImagePickerIOS.default, 'ImagePickerIOS is not available'); + return _NativeImagePickerIOS.default.canRecordVideos(callback); + }, + canUseCamera: function canUseCamera(callback) { + (0, _invariant.default)(_NativeImagePickerIOS.default, 'ImagePickerIOS is not available'); + return _NativeImagePickerIOS.default.canUseCamera(callback); + }, + openCameraDialog: function openCameraDialog(config, successCallback, cancelCallback) { + (0, _invariant.default)(_NativeImagePickerIOS.default, 'ImagePickerIOS is not available'); + var newConfig = { + videoMode: true, + unmirrorFrontFacingCamera: false + }; + + if (config.videoMode != null) { + newConfig.videoMode = config.videoMode; + } + + if (config.unmirrorFrontFacingCamera != null) { + newConfig.unmirrorFrontFacingCamera = config.unmirrorFrontFacingCamera; + } + + return _NativeImagePickerIOS.default.openCameraDialog(newConfig, successCallback, cancelCallback); + }, + openSelectDialog: function openSelectDialog(config, successCallback, cancelCallback) { + (0, _invariant.default)(_NativeImagePickerIOS.default, 'ImagePickerIOS is not available'); + var newConfig = { + showImages: true, + showVideos: false + }; + + if (config.showImages != null) { + newConfig.showImages = config.showImages; + } + + if (config.showVideos != null) { + newConfig.showVideos = config.showVideos; + } + + return _NativeImagePickerIOS.default.openSelectDialog(newConfig, successCallback, cancelCallback); + }, + removePendingVideo: function removePendingVideo(url) { + (0, _invariant.default)(_NativeImagePickerIOS.default, 'ImagePickerIOS is not available'); + + _NativeImagePickerIOS.default.removePendingVideo(url); + }, + clearAllPendingVideos: function clearAllPendingVideos() { + (0, _invariant.default)(_NativeImagePickerIOS.default, 'ImagePickerIOS is not available'); + + _NativeImagePickerIOS.default.clearAllPendingVideos(); + } + }; + module.exports = ImagePickerIOS; +},378,[5,379,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('ImagePickerIOS'); + + exports.default = _default; +},379,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NativeEventEmitter2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _InteractionManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NativeLinkingManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _NativeIntentAndroid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _nullthrows = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Linking = function (_NativeEventEmitter) { + (0, _inherits2.default)(Linking, _NativeEventEmitter); + + var _super = _createSuper(Linking); + + function Linking() { + (0, _classCallCheck2.default)(this, Linking); + return _super.call(this, _Platform.default.OS === 'ios' ? (0, _nullthrows.default)(_NativeLinkingManager.default) : undefined); + } + + (0, _createClass2.default)(Linking, [{ + key: "addEventListener", + value: function addEventListener(eventType, listener, context) { + return this.addListener(eventType, listener); + } + }, { + key: "removeEventListener", + value: function removeEventListener(eventType, listener) { + this.removeListener(eventType, listener); + } + }, { + key: "openURL", + value: function openURL(url) { + this._validateURL(url); + + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).openURL(url); + } else { + return (0, _nullthrows.default)(_NativeLinkingManager.default).openURL(url); + } + } + }, { + key: "canOpenURL", + value: function canOpenURL(url) { + this._validateURL(url); + + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).canOpenURL(url); + } else { + return (0, _nullthrows.default)(_NativeLinkingManager.default).canOpenURL(url); + } + } + }, { + key: "openSettings", + value: function openSettings() { + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).openSettings(); + } else { + return (0, _nullthrows.default)(_NativeLinkingManager.default).openSettings(); + } + } + }, { + key: "getInitialURL", + value: function getInitialURL() { + return _Platform.default.OS === 'android' ? _InteractionManager.default.runAfterInteractions().then(function () { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).getInitialURL(); + }) : (0, _nullthrows.default)(_NativeLinkingManager.default).getInitialURL(); + } + }, { + key: "sendIntent", + value: function sendIntent(action, extras) { + if (_Platform.default.OS === 'android') { + return (0, _nullthrows.default)(_NativeIntentAndroid.default).sendIntent(action, extras); + } else { + return new Promise(function (resolve, reject) { + return reject(new Error('Unsupported')); + }); + } + } + }, { + key: "_validateURL", + value: function _validateURL(url) { + (0, _invariant.default)(typeof url === 'string', 'Invalid URL: should be a string. Was: ' + url); + (0, _invariant.default)(url, 'Invalid URL: cannot be empty'); + } + }]); + return Linking; + }(_NativeEventEmitter2.default); + + module.exports = new Linking(); +},380,[5,7,8,12,14,16,110,230,37,381,382,36,337]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('LinkingManager'); + + exports.default = _default; +},381,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('IntentAndroid'); + + exports.default = _default; +},382,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _RCTLog = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var LogBox; + { + LogBox = { + install: function install() {}, + uninstall: function uninstall() {}, + isInstalled: function isInstalled() { + return false; + }, + ignoreLogs: function ignoreLogs(patterns) {}, + ignoreAllLogs: function ignoreAllLogs(value) {}, + clearAllLogs: function clearAllLogs() {}, + addLog: function addLog(log) {}, + addException: function addException(error) {} + }; + } + module.exports = LogBox; +},383,[5,37,129]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var PanResponder = { + _initializeGestureState: function _initializeGestureState(gestureState) { + gestureState.moveX = 0; + gestureState.moveY = 0; + gestureState.x0 = 0; + gestureState.y0 = 0; + gestureState.dx = 0; + gestureState.dy = 0; + gestureState.vx = 0; + gestureState.vy = 0; + gestureState.numberActiveTouches = 0; + gestureState._accountsForMovesUpTo = 0; + }, + _updateGestureStateOnMove: function _updateGestureStateOnMove(gestureState, touchHistory) { + gestureState.numberActiveTouches = touchHistory.numberActiveTouches; + gestureState.moveX = _$$_REQUIRE(_dependencyMap[0]).currentCentroidXOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo); + gestureState.moveY = _$$_REQUIRE(_dependencyMap[0]).currentCentroidYOfTouchesChangedAfter(touchHistory, gestureState._accountsForMovesUpTo); + var movedAfter = gestureState._accountsForMovesUpTo; + + var prevX = _$$_REQUIRE(_dependencyMap[0]).previousCentroidXOfTouchesChangedAfter(touchHistory, movedAfter); + + var x = _$$_REQUIRE(_dependencyMap[0]).currentCentroidXOfTouchesChangedAfter(touchHistory, movedAfter); + + var prevY = _$$_REQUIRE(_dependencyMap[0]).previousCentroidYOfTouchesChangedAfter(touchHistory, movedAfter); + + var y = _$$_REQUIRE(_dependencyMap[0]).currentCentroidYOfTouchesChangedAfter(touchHistory, movedAfter); + + var nextDX = gestureState.dx + (x - prevX); + var nextDY = gestureState.dy + (y - prevY); + var dt = touchHistory.mostRecentTimeStamp - gestureState._accountsForMovesUpTo; + gestureState.vx = (nextDX - gestureState.dx) / dt; + gestureState.vy = (nextDY - gestureState.dy) / dt; + gestureState.dx = nextDX; + gestureState.dy = nextDY; + gestureState._accountsForMovesUpTo = touchHistory.mostRecentTimeStamp; + }, + create: function create(config) { + var interactionState = { + handle: null + }; + var gestureState = { + stateID: Math.random(), + moveX: 0, + moveY: 0, + x0: 0, + y0: 0, + dx: 0, + dy: 0, + vx: 0, + vy: 0, + numberActiveTouches: 0, + _accountsForMovesUpTo: 0 + }; + var panHandlers = { + onStartShouldSetResponder: function onStartShouldSetResponder(event) { + return config.onStartShouldSetPanResponder == null ? false : config.onStartShouldSetPanResponder(event, gestureState); + }, + onMoveShouldSetResponder: function onMoveShouldSetResponder(event) { + return config.onMoveShouldSetPanResponder == null ? false : config.onMoveShouldSetPanResponder(event, gestureState); + }, + onStartShouldSetResponderCapture: function onStartShouldSetResponderCapture(event) { + if (event.nativeEvent.touches.length === 1) { + PanResponder._initializeGestureState(gestureState); + } + + gestureState.numberActiveTouches = event.touchHistory.numberActiveTouches; + return config.onStartShouldSetPanResponderCapture != null ? config.onStartShouldSetPanResponderCapture(event, gestureState) : false; + }, + onMoveShouldSetResponderCapture: function onMoveShouldSetResponderCapture(event) { + var touchHistory = event.touchHistory; + + if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) { + return false; + } + + PanResponder._updateGestureStateOnMove(gestureState, touchHistory); + + return config.onMoveShouldSetPanResponderCapture ? config.onMoveShouldSetPanResponderCapture(event, gestureState) : false; + }, + onResponderGrant: function onResponderGrant(event) { + if (!interactionState.handle) { + interactionState.handle = _$$_REQUIRE(_dependencyMap[1]).createInteractionHandle(); + } + + gestureState.x0 = _$$_REQUIRE(_dependencyMap[0]).currentCentroidX(event.touchHistory); + gestureState.y0 = _$$_REQUIRE(_dependencyMap[0]).currentCentroidY(event.touchHistory); + gestureState.dx = 0; + gestureState.dy = 0; + + if (config.onPanResponderGrant) { + config.onPanResponderGrant(event, gestureState); + } + + return config.onShouldBlockNativeResponder == null ? true : config.onShouldBlockNativeResponder(event, gestureState); + }, + onResponderReject: function onResponderReject(event) { + clearInteractionHandle(interactionState, config.onPanResponderReject, event, gestureState); + }, + onResponderRelease: function onResponderRelease(event) { + clearInteractionHandle(interactionState, config.onPanResponderRelease, event, gestureState); + + PanResponder._initializeGestureState(gestureState); + }, + onResponderStart: function onResponderStart(event) { + var touchHistory = event.touchHistory; + gestureState.numberActiveTouches = touchHistory.numberActiveTouches; + + if (config.onPanResponderStart) { + config.onPanResponderStart(event, gestureState); + } + }, + onResponderMove: function onResponderMove(event) { + var touchHistory = event.touchHistory; + + if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) { + return; + } + + PanResponder._updateGestureStateOnMove(gestureState, touchHistory); + + if (config.onPanResponderMove) { + config.onPanResponderMove(event, gestureState); + } + }, + onResponderEnd: function onResponderEnd(event) { + var touchHistory = event.touchHistory; + gestureState.numberActiveTouches = touchHistory.numberActiveTouches; + clearInteractionHandle(interactionState, config.onPanResponderEnd, event, gestureState); + }, + onResponderTerminate: function onResponderTerminate(event) { + clearInteractionHandle(interactionState, config.onPanResponderTerminate, event, gestureState); + + PanResponder._initializeGestureState(gestureState); + }, + onResponderTerminationRequest: function onResponderTerminationRequest(event) { + return config.onPanResponderTerminationRequest == null ? true : config.onPanResponderTerminationRequest(event, gestureState); + } + }; + return { + panHandlers: panHandlers, + getInteractionHandle: function getInteractionHandle() { + return interactionState.handle; + } + }; + } + }; + + function clearInteractionHandle(interactionState, callback, event, gestureState) { + if (interactionState.handle) { + _$$_REQUIRE(_dependencyMap[1]).clearInteractionHandle(interactionState.handle); + + interactionState.handle = null; + } + + if (callback) { + callback(event, gestureState); + } + } + + module.exports = PanResponder; +},384,[385,230]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var TouchHistoryMath = { + centroidDimension: function centroidDimension(touchHistory, touchesChangedAfter, isXAxis, ofCurrent) { + var touchBank = touchHistory.touchBank; + var total = 0; + var count = 0; + var oneTouchData = touchHistory.numberActiveTouches === 1 ? touchHistory.touchBank[touchHistory.indexOfSingleActiveTouch] : null; + + if (oneTouchData !== null) { + if (oneTouchData.touchActive && oneTouchData.currentTimeStamp > touchesChangedAfter) { + total += ofCurrent && isXAxis ? oneTouchData.currentPageX : ofCurrent && !isXAxis ? oneTouchData.currentPageY : !ofCurrent && isXAxis ? oneTouchData.previousPageX : oneTouchData.previousPageY; + count = 1; + } + } else { + for (var i = 0; i < touchBank.length; i++) { + var touchTrack = touchBank[i]; + + if (touchTrack !== null && touchTrack !== undefined && touchTrack.touchActive && touchTrack.currentTimeStamp >= touchesChangedAfter) { + var toAdd = undefined; + + if (ofCurrent && isXAxis) { + toAdd = touchTrack.currentPageX; + } else if (ofCurrent && !isXAxis) { + toAdd = touchTrack.currentPageY; + } else if (!ofCurrent && isXAxis) { + toAdd = touchTrack.previousPageX; + } else { + toAdd = touchTrack.previousPageY; + } + + total += toAdd; + count++; + } + } + } + + return count > 0 ? total / count : TouchHistoryMath.noCentroid; + }, + currentCentroidXOfTouchesChangedAfter: function currentCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, true); + }, + currentCentroidYOfTouchesChangedAfter: function currentCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, true); + }, + previousCentroidXOfTouchesChangedAfter: function previousCentroidXOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, true, false); + }, + previousCentroidYOfTouchesChangedAfter: function previousCentroidYOfTouchesChangedAfter(touchHistory, touchesChangedAfter) { + return TouchHistoryMath.centroidDimension(touchHistory, touchesChangedAfter, false, false); + }, + currentCentroidX: function currentCentroidX(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, true, true); + }, + currentCentroidY: function currentCentroidY(touchHistory) { + return TouchHistoryMath.centroidDimension(touchHistory, 0, false, true); + }, + noCentroid: -1 + }; + module.exports = TouchHistoryMath; +},385,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NativeDialogManagerAndroid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NativePermissionsAndroid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var PERMISSION_REQUEST_RESULT = Object.freeze({ + GRANTED: 'granted', + DENIED: 'denied', + NEVER_ASK_AGAIN: 'never_ask_again' + }); + var PERMISSIONS = Object.freeze({ + READ_CALENDAR: 'android.permission.READ_CALENDAR', + WRITE_CALENDAR: 'android.permission.WRITE_CALENDAR', + CAMERA: 'android.permission.CAMERA', + READ_CONTACTS: 'android.permission.READ_CONTACTS', + WRITE_CONTACTS: 'android.permission.WRITE_CONTACTS', + GET_ACCOUNTS: 'android.permission.GET_ACCOUNTS', + ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION', + ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION', + ACCESS_BACKGROUND_LOCATION: 'android.permission.ACCESS_BACKGROUND_LOCATION', + RECORD_AUDIO: 'android.permission.RECORD_AUDIO', + READ_PHONE_STATE: 'android.permission.READ_PHONE_STATE', + CALL_PHONE: 'android.permission.CALL_PHONE', + READ_CALL_LOG: 'android.permission.READ_CALL_LOG', + WRITE_CALL_LOG: 'android.permission.WRITE_CALL_LOG', + ADD_VOICEMAIL: 'com.android.voicemail.permission.ADD_VOICEMAIL', + USE_SIP: 'android.permission.USE_SIP', + PROCESS_OUTGOING_CALLS: 'android.permission.PROCESS_OUTGOING_CALLS', + BODY_SENSORS: 'android.permission.BODY_SENSORS', + SEND_SMS: 'android.permission.SEND_SMS', + RECEIVE_SMS: 'android.permission.RECEIVE_SMS', + READ_SMS: 'android.permission.READ_SMS', + RECEIVE_WAP_PUSH: 'android.permission.RECEIVE_WAP_PUSH', + RECEIVE_MMS: 'android.permission.RECEIVE_MMS', + READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE', + WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE', + BLUETOOTH_CONNECT: 'android.permission.BLUETOOTH_CONNECT', + BLUETOOTH_SCAN: 'android.permission.BLUETOOTH_SCAN', + BLUETOOTH_ADVERTISE: 'android.permission.BLUETOOTH_ADVERTISE', + ACCESS_MEDIA_LOCATION: 'android.permission.ACCESS_MEDIA_LOCATION' + }); + + var PermissionsAndroid = function () { + function PermissionsAndroid() { + (0, _classCallCheck2.default)(this, PermissionsAndroid); + this.PERMISSIONS = PERMISSIONS; + this.RESULTS = PERMISSION_REQUEST_RESULT; + } + + (0, _createClass2.default)(PermissionsAndroid, [{ + key: "checkPermission", + value: function checkPermission(permission) { + console.warn('"PermissionsAndroid.checkPermission" is deprecated. Use "PermissionsAndroid.check" instead'); + { + console.warn('"PermissionsAndroid" module works only for Android platform.'); + return Promise.resolve(false); + } + (0, _invariant.default)(_NativePermissionsAndroid.default, 'PermissionsAndroid is not installed correctly.'); + return _NativePermissionsAndroid.default.checkPermission(permission); + } + }, { + key: "check", + value: function check(permission) { + { + console.warn('"PermissionsAndroid" module works only for Android platform.'); + return Promise.resolve(false); + } + (0, _invariant.default)(_NativePermissionsAndroid.default, 'PermissionsAndroid is not installed correctly.'); + return _NativePermissionsAndroid.default.checkPermission(permission); + } + }, { + key: "requestPermission", + value: function requestPermission(permission, rationale) { + var response; + return _regenerator.default.async(function requestPermission$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + console.warn('"PermissionsAndroid.requestPermission" is deprecated. Use "PermissionsAndroid.request" instead'); + console.warn('"PermissionsAndroid" module works only for Android platform.'); + return _context.abrupt("return", Promise.resolve(false)); + + case 4: + _context.next = 6; + return _regenerator.default.awrap(this.request(permission, rationale)); + + case 6: + response = _context.sent; + return _context.abrupt("return", response === this.RESULTS.GRANTED); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "request", + value: function request(permission, rationale) { + var shouldShowRationale; + return _regenerator.default.async(function request$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + console.warn('"PermissionsAndroid" module works only for Android platform.'); + return _context2.abrupt("return", Promise.resolve(this.RESULTS.DENIED)); + + case 3: + (0, _invariant.default)(_NativePermissionsAndroid.default, 'PermissionsAndroid is not installed correctly.'); + + if (!rationale) { + _context2.next = 10; + break; + } + + _context2.next = 7; + return _regenerator.default.awrap(_NativePermissionsAndroid.default.shouldShowRequestPermissionRationale(permission)); + + case 7: + shouldShowRationale = _context2.sent; + + if (!(shouldShowRationale && !!_NativeDialogManagerAndroid.default)) { + _context2.next = 10; + break; + } + + return _context2.abrupt("return", new Promise(function (resolve, reject) { + var options = (0, _extends2.default)({}, rationale); + + _NativeDialogManagerAndroid.default.showAlert(options, function () { + return reject(new Error('Error showing rationale')); + }, function () { + return resolve(_NativePermissionsAndroid.default.requestPermission(permission)); + }); + })); + + case 10: + return _context2.abrupt("return", _NativePermissionsAndroid.default.requestPermission(permission)); + + case 11: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "requestMultiple", + value: function requestMultiple(permissions) { + { + console.warn('"PermissionsAndroid" module works only for Android platform.'); + return Promise.resolve({}); + } + (0, _invariant.default)(_NativePermissionsAndroid.default, 'PermissionsAndroid is not installed correctly.'); + return _NativePermissionsAndroid.default.requestMultiplePermissions(permissions); + } + }]); + return PermissionsAndroid; + }(); + + var PermissionsAndroidInstance = new PermissionsAndroid(); + module.exports = PermissionsAndroidInstance; +},386,[5,80,6,7,8,122,387,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('PermissionsAndroid'); + + exports.default = _default; +},387,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _NativePushNotificationManagerIOS = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Platform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var PushNotificationEmitter = new _NativeEventEmitter.default(_Platform.default.OS !== 'ios' ? null : _NativePushNotificationManagerIOS.default); + + var _notifHandlers = new Map(); + + var DEVICE_NOTIF_EVENT = 'remoteNotificationReceived'; + var NOTIF_REGISTER_EVENT = 'remoteNotificationsRegistered'; + var NOTIF_REGISTRATION_ERROR_EVENT = 'remoteNotificationRegistrationError'; + var DEVICE_LOCAL_NOTIF_EVENT = 'localNotificationReceived'; + + var PushNotificationIOS = function () { + function PushNotificationIOS(nativeNotif) { + var _this = this; + + (0, _classCallCheck2.default)(this, PushNotificationIOS); + this._data = {}; + this._remoteNotificationCompleteCallbackCalled = false; + this._isRemote = nativeNotif.remote; + + if (this._isRemote) { + this._notificationId = nativeNotif.notificationId; + } + + if (nativeNotif.remote) { + Object.keys(nativeNotif).forEach(function (notifKey) { + var notifVal = nativeNotif[notifKey]; + + if (notifKey === 'aps') { + _this._alert = notifVal.alert; + _this._sound = notifVal.sound; + _this._badgeCount = notifVal.badge; + _this._category = notifVal.category; + _this._contentAvailable = notifVal['content-available']; + _this._threadID = notifVal['thread-id']; + } else { + _this._data[notifKey] = notifVal; + } + }); + } else { + this._badgeCount = nativeNotif.applicationIconBadgeNumber; + this._sound = nativeNotif.soundName; + this._alert = nativeNotif.alertBody; + this._data = nativeNotif.userInfo; + this._category = nativeNotif.category; + } + } + + (0, _createClass2.default)(PushNotificationIOS, [{ + key: "finish", + value: function finish(fetchResult) { + if (!this._isRemote || !this._notificationId || this._remoteNotificationCompleteCallbackCalled) { + return; + } + + this._remoteNotificationCompleteCallbackCalled = true; + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.onFinishRemoteNotification(this._notificationId, fetchResult); + } + }, { + key: "getMessage", + value: function getMessage() { + return this._alert; + } + }, { + key: "getSound", + value: function getSound() { + return this._sound; + } + }, { + key: "getCategory", + value: function getCategory() { + return this._category; + } + }, { + key: "getAlert", + value: function getAlert() { + return this._alert; + } + }, { + key: "getContentAvailable", + value: function getContentAvailable() { + return this._contentAvailable; + } + }, { + key: "getBadgeCount", + value: function getBadgeCount() { + return this._badgeCount; + } + }, { + key: "getData", + value: function getData() { + return this._data; + } + }, { + key: "getThreadID", + value: function getThreadID() { + return this._threadID; + } + }], [{ + key: "presentLocalNotification", + value: function presentLocalNotification(details) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.presentLocalNotification(details); + } + }, { + key: "scheduleLocalNotification", + value: function scheduleLocalNotification(details) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.scheduleLocalNotification(details); + } + }, { + key: "cancelAllLocalNotifications", + value: function cancelAllLocalNotifications() { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.cancelAllLocalNotifications(); + } + }, { + key: "removeAllDeliveredNotifications", + value: function removeAllDeliveredNotifications() { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.removeAllDeliveredNotifications(); + } + }, { + key: "getDeliveredNotifications", + value: function getDeliveredNotifications(callback) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.getDeliveredNotifications(callback); + } + }, { + key: "removeDeliveredNotifications", + value: function removeDeliveredNotifications(identifiers) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.removeDeliveredNotifications(identifiers); + } + }, { + key: "setApplicationIconBadgeNumber", + value: function setApplicationIconBadgeNumber(number) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.setApplicationIconBadgeNumber(number); + } + }, { + key: "getApplicationIconBadgeNumber", + value: function getApplicationIconBadgeNumber(callback) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.getApplicationIconBadgeNumber(callback); + } + }, { + key: "cancelLocalNotifications", + value: function cancelLocalNotifications(userInfo) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.cancelLocalNotifications(userInfo); + } + }, { + key: "getScheduledLocalNotifications", + value: function getScheduledLocalNotifications(callback) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.getScheduledLocalNotifications(callback); + } + }, { + key: "addEventListener", + value: function addEventListener(type, handler) { + (0, _invariant.default)(type === 'notification' || type === 'register' || type === 'registrationError' || type === 'localNotification', 'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events'); + var listener; + + if (type === 'notification') { + listener = PushNotificationEmitter.addListener(DEVICE_NOTIF_EVENT, function (notifData) { + handler(new PushNotificationIOS(notifData)); + }); + } else if (type === 'localNotification') { + listener = PushNotificationEmitter.addListener(DEVICE_LOCAL_NOTIF_EVENT, function (notifData) { + handler(new PushNotificationIOS(notifData)); + }); + } else if (type === 'register') { + listener = PushNotificationEmitter.addListener(NOTIF_REGISTER_EVENT, function (registrationInfo) { + handler(registrationInfo.deviceToken); + }); + } else if (type === 'registrationError') { + listener = PushNotificationEmitter.addListener(NOTIF_REGISTRATION_ERROR_EVENT, function (errorInfo) { + handler(errorInfo); + }); + } + + _notifHandlers.set(type, listener); + } + }, { + key: "removeEventListener", + value: function removeEventListener(type, handler) { + (0, _invariant.default)(type === 'notification' || type === 'register' || type === 'registrationError' || type === 'localNotification', 'PushNotificationIOS only supports `notification`, `register`, `registrationError`, and `localNotification` events'); + + var listener = _notifHandlers.get(type); + + if (!listener) { + return; + } + + listener.remove(); + + _notifHandlers.delete(type); + } + }, { + key: "requestPermissions", + value: function requestPermissions(permissions) { + var requestedPermissions = { + alert: true, + badge: true, + sound: true + }; + + if (permissions) { + requestedPermissions = { + alert: !!permissions.alert, + badge: !!permissions.badge, + sound: !!permissions.sound + }; + } + + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + return _NativePushNotificationManagerIOS.default.requestPermissions(requestedPermissions); + } + }, { + key: "abandonPermissions", + value: function abandonPermissions() { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.abandonPermissions(); + } + }, { + key: "checkPermissions", + value: function checkPermissions(callback) { + (0, _invariant.default)(typeof callback === 'function', 'Must provide a valid callback'); + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.checkPermissions(callback); + } + }, { + key: "getInitialNotification", + value: function getInitialNotification() { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + return _NativePushNotificationManagerIOS.default.getInitialNotification().then(function (notification) { + return notification && new PushNotificationIOS(notification); + }); + } + }, { + key: "getAuthorizationStatus", + value: function getAuthorizationStatus(callback) { + (0, _invariant.default)(_NativePushNotificationManagerIOS.default, 'PushNotificationManager is not available.'); + + _NativePushNotificationManagerIOS.default.getAuthorizationStatus(callback); + } + }]); + return PushNotificationIOS; + }(); + + PushNotificationIOS.FetchResult = { + NewData: 'UIBackgroundFetchResultNewData', + NoData: 'UIBackgroundFetchResultNoData', + ResultFailed: 'UIBackgroundFetchResultFailed' + }; + module.exports = PushNotificationIOS; +},388,[5,7,8,110,389,36,37]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('PushNotificationManager'); + + exports.default = _default; +},389,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _RCTDeviceEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _NativeSettingsManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var subscriptions = []; + var Settings = { + _settings: _NativeSettingsManager.default && _NativeSettingsManager.default.getConstants().settings, + get: function get(key) { + return this._settings[key]; + }, + set: function set(settings) { + this._settings = (0, _extends2.default)(this._settings, settings); + + _NativeSettingsManager.default.setValues(settings); + }, + watchKeys: function watchKeys(keys, callback) { + if (typeof keys === 'string') { + keys = [keys]; + } + + (0, _invariant.default)(Array.isArray(keys), 'keys should be a string or array of strings'); + var sid = subscriptions.length; + subscriptions.push({ + keys: keys, + callback: callback + }); + return sid; + }, + clearWatch: function clearWatch(watchId) { + if (watchId < subscriptions.length) { + subscriptions[watchId] = { + keys: [], + callback: null + }; + } + }, + _sendObservations: function _sendObservations(body) { + var _this = this; + + Object.keys(body).forEach(function (key) { + var newValue = body[key]; + var didChange = _this._settings[key] !== newValue; + _this._settings[key] = newValue; + + if (didChange) { + subscriptions.forEach(function (sub) { + if (sub.keys.indexOf(key) !== -1 && sub.callback) { + sub.callback(); + } + }); + } + }); + } + }; + + _RCTDeviceEventEmitter.default.addListener('settingsUpdated', Settings._sendObservations.bind(Settings)); + + module.exports = Settings; +},390,[5,6,30,391,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('SettingsManager'); + + exports.default = _default; +},391,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _NativeActionSheetManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NativeShareModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var Share = function () { + function Share() { + (0, _classCallCheck2.default)(this, Share); + } + + (0, _createClass2.default)(Share, null, [{ + key: "share", + value: function share(content) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _$$_REQUIRE(_dependencyMap[6])(typeof content === 'object' && content !== null, 'Content to share must be a valid object'); + + _$$_REQUIRE(_dependencyMap[6])(typeof content.url === 'string' || typeof content.message === 'string', 'At least one of URL and message is required'); + + _$$_REQUIRE(_dependencyMap[6])(typeof options === 'object' && options !== null, 'Options must be a valid object'); + + { + return new Promise(function (resolve, reject) { + var tintColor = _$$_REQUIRE(_dependencyMap[7])(options.tintColor); + + _$$_REQUIRE(_dependencyMap[6])(tintColor == null || typeof tintColor === 'number', 'Unexpected color given for options.tintColor'); + + _$$_REQUIRE(_dependencyMap[6])(_NativeActionSheetManager.default, 'NativeActionSheetManager is not registered on iOS, but it should be.'); + + _NativeActionSheetManager.default.showShareActionSheetWithOptions({ + message: typeof content.message === 'string' ? content.message : undefined, + url: typeof content.url === 'string' ? content.url : undefined, + subject: options.subject, + tintColor: typeof tintColor === 'number' ? tintColor : undefined, + excludedActivityTypes: options.excludedActivityTypes + }, function (error) { + return reject(error); + }, function (success, activityType) { + if (success) { + resolve({ + action: 'sharedAction', + activityType: activityType + }); + } else { + resolve({ + action: 'dismissedAction', + activityType: null + }); + } + }); + }); + } + } + }]); + return Share; + }(); + + Share.sharedAction = 'sharedAction'; + Share.dismissedAction = 'dismissedAction'; + module.exports = Share; +},392,[5,6,7,8,348,393,36,145]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.get('ShareModule'); + + exports.default = _default; +},393,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ToastAndroid = { + show: function show(message, duration) { + console.warn('ToastAndroid is not supported on this platform.'); + }, + showWithGravity: function showWithGravity(message, duration, gravity) { + console.warn('ToastAndroid is not supported on this platform.'); + }, + showWithGravityAndOffset: function showWithGravityAndOffset(message, duration, gravity, xOffset, yOffset) { + console.warn('ToastAndroid is not supported on this platform.'); + } + }; + module.exports = ToastAndroid; +},394,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useColorScheme; + + var _react = _$$_REQUIRE(_dependencyMap[0]); + + var _Appearance = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + function useColorScheme() { + var subscription = (0, _react.useMemo)(function () { + return { + getCurrentValue: function getCurrentValue() { + return _Appearance.default.getColorScheme(); + }, + subscribe: function subscribe(callback) { + var appearanceSubscription = _Appearance.default.addChangeListener(callback); + + return function () { + appearanceSubscription.remove(); + }; + } + }; + }, []); + return (0, _$$_REQUIRE(_dependencyMap[3]).useSubscription)(subscription); + } +},395,[17,5,349,396]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + { + module.exports = _$$_REQUIRE(_dependencyMap[0]); + } +},396,[397]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * use-subscription.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + 'use strict'; + + exports.useSubscription = function (a) { + return _$$_REQUIRE(_dependencyMap[0]).useSyncExternalStore(a.subscribe, a.getCurrentValue); + }; +},397,[398]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + { + module.exports = _$$_REQUIRE(_dependencyMap[0]); + } +},398,[399]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license React + * use-sync-external-store-shim.native.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + 'use strict'; + + var e = _$$_REQUIRE(_dependencyMap[0]); + + function h(a, b) { + return a === b && (0 !== a || 1 / a === 1 / b) || a !== a && b !== b; + } + + var k = "function" === typeof Object.is ? Object.is : h, + l = e.useState, + m = e.useEffect, + n = e.useLayoutEffect, + p = e.useDebugValue; + + function q(a, b) { + var d = b(), + f = l({ + inst: { + value: d, + getSnapshot: b + } + }), + c = f[0].inst, + g = f[1]; + n(function () { + c.value = d; + c.getSnapshot = b; + r(c) && g({ + inst: c + }); + }, [a, d, b]); + m(function () { + r(c) && g({ + inst: c + }); + return a(function () { + r(c) && g({ + inst: c + }); + }); + }, [a]); + p(d); + return d; + } + + function r(a) { + var b = a.getSnapshot; + a = a.value; + + try { + var d = b(); + return !k(a, d); + } catch (f) { + return true; + } + } + + exports.useSyncExternalStore = undefined !== e.useSyncExternalStore ? e.useSyncExternalStore : q; +},399,[17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useWindowDimensions; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _Dimensions = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[3]); + + function useWindowDimensions() { + var _useState = (0, _react.useState)(function () { + return _Dimensions.default.get('window'); + }), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + dimensions = _useState2[0], + setDimensions = _useState2[1]; + + (0, _react.useEffect)(function () { + function handleChange(_ref) { + var window = _ref.window; + + if (dimensions.width !== window.width || dimensions.height !== window.height || dimensions.scale !== window.scale || dimensions.fontScale !== window.fontScale) { + setDimensions(window); + } + } + + var subscription = _Dimensions.default.addEventListener('change', handleChange); + + handleChange({ + window: _Dimensions.default.get('window') + }); + return function () { + subscription.remove(); + }; + }, [dimensions]); + return dimensions; + } +},400,[5,41,171,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var UTFSequence = _$$_REQUIRE(_dependencyMap[0])({ + BOM: "\uFEFF", + BULLET: "\u2022", + BULLET_SP: "\xA0\u2022\xA0", + MIDDOT: "\xB7", + MIDDOT_SP: "\xA0\xB7\xA0", + MIDDOT_KATAKANA: "\u30FB", + MDASH: "\u2014", + MDASH_SP: "\xA0\u2014\xA0", + NDASH: "\u2013", + NDASH_SP: "\xA0\u2013\xA0", + NBSP: "\xA0", + PIZZA: "\uD83C\uDF55", + TRIANGLE_LEFT: "\u25C0", + TRIANGLE_RIGHT: "\u25B6" + }); + + module.exports = UTFSequence; +},401,[177]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _NativeVibration = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _vibrating = false; + var _id = 0; + var _default_vibration_length = 400; + + function vibrateByPattern(pattern) { + var repeat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (_vibrating) { + return; + } + + _vibrating = true; + + if (pattern[0] === 0) { + _NativeVibration.default.vibrate(_default_vibration_length); + + pattern = pattern.slice(1); + } + + if (pattern.length === 0) { + _vibrating = false; + return; + } + + setTimeout(function () { + return vibrateScheduler(++_id, pattern, repeat, 1); + }, pattern[0]); + } + + function vibrateScheduler(id, pattern, repeat, nextIndex) { + if (!_vibrating || id !== _id) { + return; + } + + _NativeVibration.default.vibrate(_default_vibration_length); + + if (nextIndex >= pattern.length) { + if (repeat) { + nextIndex = 0; + } else { + _vibrating = false; + return; + } + } + + setTimeout(function () { + return vibrateScheduler(id, pattern, repeat, nextIndex + 1); + }, pattern[nextIndex]); + } + + var Vibration = { + vibrate: function vibrate() { + var pattern = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _default_vibration_length; + var repeat = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + { + if (_vibrating) { + return; + } + + if (typeof pattern === 'number') { + _NativeVibration.default.vibrate(pattern); + } else if (Array.isArray(pattern)) { + vibrateByPattern(pattern, repeat); + } else { + throw new Error('Vibration pattern should be a number or array'); + } + } + }, + cancel: function cancel() { + { + _vibrating = false; + } + } + }; + module.exports = Vibration; +},402,[5,403]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var TurboModuleRegistry = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _default = TurboModuleRegistry.getEnforcing('Vibration'); + + exports.default = _default; +},403,[39]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _$$_REQUIRE(_dependencyMap[0])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _$$_REQUIRE(_dependencyMap[0])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _$$_REQUIRE(_dependencyMap[1])(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var React = _$$_REQUIRE(_dependencyMap[2]); + + var YellowBox; + { + YellowBox = function (_React$Component2) { + _$$_REQUIRE(_dependencyMap[3])(YellowBox, _React$Component2); + + var _super2 = _createSuper(YellowBox); + + function YellowBox() { + _$$_REQUIRE(_dependencyMap[4])(this, YellowBox); + + return _super2.apply(this, arguments); + } + + _$$_REQUIRE(_dependencyMap[5])(YellowBox, [{ + key: "render", + value: function render() { + return null; + } + }], [{ + key: "ignoreWarnings", + value: function ignoreWarnings(patterns) {} + }, { + key: "install", + value: function install() {} + }, { + key: "uninstall", + value: function uninstall() {} + }]); + + return YellowBox; + }(React.Component); + } + module.exports = YellowBox; +},404,[16,14,17,12,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DynamicColorIOS = undefined; + + var DynamicColorIOS = function DynamicColorIOS(tuple) { + return (0, _$$_REQUIRE(_dependencyMap[0]).DynamicColorIOSPrivate)({ + light: tuple.light, + dark: tuple.dark, + highContrastLight: tuple.highContrastLight, + highContrastDark: tuple.highContrastDark + }); + }; + + exports.DynamicColorIOS = DynamicColorIOS; +},405,[148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var PointPropType = _$$_REQUIRE(_dependencyMap[0]).shape({ + x: _$$_REQUIRE(_dependencyMap[0]).number, + y: _$$_REQUIRE(_dependencyMap[0]).number + }); + + module.exports = PointPropType; +},406,[201]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + var aStackPool = []; + var bStackPool = []; + /** + * Checks if two values are equal. Values may be primitives, arrays, or objects. + * Returns true if both arguments have the same keys and values. + * + * @see http://underscorejs.org + * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. + * @license MIT + */ + + function areEqual(a, b) { + var aStack = aStackPool.length ? aStackPool.pop() : []; + var bStack = bStackPool.length ? bStackPool.pop() : []; + var result = eq(a, b, aStack, bStack); + aStack.length = 0; + bStack.length = 0; + aStackPool.push(aStack); + bStackPool.push(bStack); + return result; + } + + function eq(a, b, aStack, bStack) { + if (a === b) { + return a !== 0 || 1 / a == 1 / b; + } + + if (a == null || b == null) { + return false; + } + + if (typeof a != 'object' || typeof b != 'object') { + return false; + } + + var objToStr = Object.prototype.toString; + var className = objToStr.call(a); + + if (className != objToStr.call(b)) { + return false; + } + + switch (className) { + case '[object String]': + return a == String(b); + + case '[object Number]': + return isNaN(a) || isNaN(b) ? false : a == Number(b); + + case '[object Date]': + case '[object Boolean]': + return +a == +b; + + case '[object RegExp]': + return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; + } + + var length = aStack.length; + + while (length--) { + if (aStack[length] == a) { + return bStack[length] == b; + } + } + + aStack.push(a); + bStack.push(b); + var size = 0; + + if (className === '[object Array]') { + size = a.length; + + if (size !== b.length) { + return false; + } + + while (size--) { + if (!eq(a[size], b[size], aStack, bStack)) { + return false; + } + } + } else { + if (a.constructor !== b.constructor) { + return false; + } + + if (a.hasOwnProperty('valueOf') && b.hasOwnProperty('valueOf')) { + return a.valueOf() == b.valueOf(); + } + + var keys = Object.keys(a); + + if (keys.length != Object.keys(b).length) { + return false; + } + + for (var i = 0; i < keys.length; i++) { + if (!eq(a[keys[i]], b[keys[i]], aStack, bStack)) { + return false; + } + } + } + + aStack.pop(); + bStack.pop(); + return true; + } + + module.exports = areEqual; +},407,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNGestureHandlerModule = _reactNative.NativeModules.RNGestureHandlerModule; + + if (RNGestureHandlerModule == null) { + console.error("react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).\n\n For installation instructions, please refer to https://docs.swmansion.com/react-native-gesture-handler/docs/#installation".split('\n').map(function (line) { + return line.trim(); + }).join('\n')); + } + + var _default = RNGestureHandlerModule; + exports.default = _default; +},408,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _NativeModules$Platfo; + + var _default = (_NativeModules$Platfo = _reactNative.NativeModules == null ? undefined : _reactNative.NativeModules.PlatformConstants) != null ? _NativeModules$Platfo : _reactNative.Platform.constants; + + exports.default = _default; +},409,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NativeViewGestureHandler = exports.nativeViewProps = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createHandler = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var nativeViewProps = [].concat((0, _toConsumableArray2.default)(_$$_REQUIRE(_dependencyMap[3]).baseProps), ['shouldActivateOnStart', 'disallowInterruption']); + exports.nativeViewProps = nativeViewProps; + var NativeViewGestureHandler = (0, _createHandler.default)({ + name: 'NativeViewGestureHandler', + allowedProps: nativeViewProps, + config: {} + }); + exports.NativeViewGestureHandler = NativeViewGestureHandler; +},410,[5,21,20,4]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "PureNativeButton", { + enumerable: true, + get: function get() { + return _GestureHandlerButton.default; + } + }); + exports.BorderlessButton = exports.RectButton = exports.BaseButton = exports.RawButton = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _createNativeWrapper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _GestureHandlerButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RawButton = (0, _createNativeWrapper.default)(_GestureHandlerButton.default, { + shouldCancelWhenOutside: false, + shouldActivateOnStart: false + }); + exports.RawButton = RawButton; + + var BaseButton = function (_React$Component) { + (0, _inherits2.default)(BaseButton, _React$Component); + + var _super = _createSuper(BaseButton); + + function BaseButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, BaseButton); + _this = _super.call(this, props); + + _this.handleEvent = function (_ref) { + var nativeEvent = _ref.nativeEvent; + var state = nativeEvent.state, + oldState = nativeEvent.oldState, + pointerInside = nativeEvent.pointerInside; + + var active = pointerInside && state === _$$_REQUIRE(_dependencyMap[12]).State.ACTIVE; + + if (active !== _this.lastActive && _this.props.onActiveStateChange) { + _this.props.onActiveStateChange(active); + } + + if (oldState === _$$_REQUIRE(_dependencyMap[12]).State.ACTIVE && state !== _$$_REQUIRE(_dependencyMap[12]).State.CANCELLED && _this.lastActive && _this.props.onPress) { + _this.props.onPress(active); + } + + _this.lastActive = active; + }; + + _this.onHandlerStateChange = function (e) { + _this.props.onHandlerStateChange == null ? undefined : _this.props.onHandlerStateChange(e); + + _this.handleEvent(e); + }; + + _this.onGestureEvent = function (e) { + _this.props.onGestureEvent == null ? undefined : _this.props.onGestureEvent(e); + + _this.handleEvent(e); + }; + + _this.lastActive = false; + return _this; + } + + (0, _createClass2.default)(BaseButton, [{ + key: "render", + value: function render() { + var _this$props = this.props, + rippleColor = _this$props.rippleColor, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["rippleColor"]); + return React.createElement(RawButton, (0, _extends2.default)({ + rippleColor: (0, _reactNative.processColor)(rippleColor) + }, rest, { + onGestureEvent: this.onGestureEvent, + onHandlerStateChange: this.onHandlerStateChange + })); + } + }]); + return BaseButton; + }(React.Component); + + exports.BaseButton = BaseButton; + + var AnimatedBaseButton = _reactNative.Animated.createAnimatedComponent(BaseButton); + + var btnStyles = _reactNative.StyleSheet.create({ + underlay: { + position: 'absolute', + left: 0, + right: 0, + bottom: 0, + top: 0 + } + }); + + var RectButton = function (_React$Component2) { + (0, _inherits2.default)(RectButton, _React$Component2); + + var _super2 = _createSuper(RectButton); + + function RectButton(props) { + var _this2; + + (0, _classCallCheck2.default)(this, RectButton); + _this2 = _super2.call(this, props); + + _this2.onActiveStateChange = function (active) { + if (_reactNative.Platform.OS !== 'android') { + _this2.opacity.setValue(active ? _this2.props.activeOpacity : 0); + } + + _this2.props.onActiveStateChange == null ? undefined : _this2.props.onActiveStateChange(active); + }; + + _this2.opacity = new _reactNative.Animated.Value(0); + return _this2; + } + + (0, _createClass2.default)(RectButton, [{ + key: "render", + value: function render() { + var _this$props2 = this.props, + children = _this$props2.children, + style = _this$props2.style, + rest = (0, _objectWithoutProperties2.default)(_this$props2, ["children", "style"]); + + var resolvedStyle = _reactNative.StyleSheet.flatten(style != null ? style : {}); + + return React.createElement(BaseButton, (0, _extends2.default)({}, rest, { + style: resolvedStyle, + onActiveStateChange: this.onActiveStateChange + }), React.createElement(_reactNative.Animated.View, { + style: [btnStyles.underlay, { + opacity: this.opacity, + backgroundColor: this.props.underlayColor, + borderRadius: resolvedStyle.borderRadius, + borderTopLeftRadius: resolvedStyle.borderTopLeftRadius, + borderTopRightRadius: resolvedStyle.borderTopRightRadius, + borderBottomLeftRadius: resolvedStyle.borderBottomLeftRadius, + borderBottomRightRadius: resolvedStyle.borderBottomRightRadius + }] + }), children); + } + }]); + return RectButton; + }(React.Component); + + exports.RectButton = RectButton; + RectButton.defaultProps = { + activeOpacity: 0.105, + underlayColor: 'black' + }; + + var BorderlessButton = function (_React$Component3) { + (0, _inherits2.default)(BorderlessButton, _React$Component3); + + var _super3 = _createSuper(BorderlessButton); + + function BorderlessButton(props) { + var _this3; + + (0, _classCallCheck2.default)(this, BorderlessButton); + _this3 = _super3.call(this, props); + + _this3.onActiveStateChange = function (active) { + if (_reactNative.Platform.OS !== 'android') { + _this3.opacity.setValue(active ? _this3.props.activeOpacity : 1); + } + + _this3.props.onActiveStateChange == null ? undefined : _this3.props.onActiveStateChange(active); + }; + + _this3.opacity = new _reactNative.Animated.Value(1); + return _this3; + } + + (0, _createClass2.default)(BorderlessButton, [{ + key: "render", + value: function render() { + var _this$props3 = this.props, + children = _this$props3.children, + style = _this$props3.style, + rest = (0, _objectWithoutProperties2.default)(_this$props3, ["children", "style"]); + return React.createElement(AnimatedBaseButton, (0, _extends2.default)({}, rest, { + onActiveStateChange: this.onActiveStateChange, + style: [style, _reactNative.Platform.OS === 'ios' && { + opacity: this.opacity + }] + }), children); + } + }]); + return BorderlessButton; + }(React.Component); + + exports.BorderlessButton = BorderlessButton; + BorderlessButton.defaultProps = { + activeOpacity: 0.3, + borderless: true + }; +},411,[5,6,108,7,8,12,14,16,17,28,412,413,3]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createNativeWrapper; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NATIVE_WRAPPER_PROPS_FILTER = [].concat((0, _toConsumableArray2.default)(_$$_REQUIRE(_dependencyMap[4]).nativeViewProps), ['onGestureHandlerEvent', 'onGestureHandlerStateChange']); + + function createNativeWrapper(Component) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var ComponentWrapper = React.forwardRef(function (props, ref) { + var gestureHandlerProps = Object.keys(props).reduce(function (res, key) { + var allowedKeys = NATIVE_WRAPPER_PROPS_FILTER; + + if (allowedKeys.includes(key)) { + res[key] = props[key]; + } + + return res; + }, (0, _extends2.default)({}, config)); + + var _ref = (0, React.useRef)(); + + var _gestureHandlerRef = (0, React.useRef)(); + + (0, React.useImperativeHandle)(ref, function () { + var node = _gestureHandlerRef.current; + + if (_ref.current && node) { + _ref.current.handlerTag = node.handlerTag; + return _ref.current; + } + + return null; + }, [_ref, _gestureHandlerRef]); + return React.createElement(_$$_REQUIRE(_dependencyMap[4]).NativeViewGestureHandler, (0, _extends2.default)({}, gestureHandlerProps, { + ref: _gestureHandlerRef + }), React.createElement(Component, (0, _extends2.default)({}, props, { + ref: _ref + }))); + }); + ComponentWrapper.displayName = Component.displayName || 'ComponentWrapper'; + return ComponentWrapper; + } +},412,[5,6,21,17,410]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNGestureHandlerButton = (0, _reactNative.requireNativeComponent)('RNGestureHandlerButton'); + var _default = RNGestureHandlerButton; + exports.default = _default; +},413,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "TouchableNativeFeedback", { + enumerable: true, + get: function get() { + return _TouchableNativeFeedback.default; + } + }); + Object.defineProperty(exports, "TouchableWithoutFeedback", { + enumerable: true, + get: function get() { + return _TouchableWithoutFeedback.default; + } + }); + Object.defineProperty(exports, "TouchableOpacity", { + enumerable: true, + get: function get() { + return _TouchableOpacity.default; + } + }); + Object.defineProperty(exports, "TouchableHighlight", { + enumerable: true, + get: function get() { + return _TouchableHighlight.default; + } + }); + + var _TouchableNativeFeedback = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _TouchableWithoutFeedback = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _TouchableOpacity = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _TouchableHighlight = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); +},414,[5,415,416,418,419]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.TouchableNativeFeedback; + exports.default = _default; +},415,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _GenericTouchable = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var TouchableWithoutFeedback = React.forwardRef(function (props, ref) { + return React.createElement(_GenericTouchable.default, (0, _extends2.default)({ + ref: ref + }, props)); + }); + TouchableWithoutFeedback.defaultProps = _GenericTouchable.default.defaultProps; + var _default = TouchableWithoutFeedback; + exports.default = _default; +},416,[5,6,17,417]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.TOUCHABLE_STATE = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TOUCHABLE_STATE = { + UNDETERMINED: 0, + BEGAN: 1, + MOVED_OUTSIDE: 2 + }; + exports.TOUCHABLE_STATE = TOUCHABLE_STATE; + + var GenericTouchable = function (_Component) { + (0, _inherits2.default)(GenericTouchable, _Component); + + var _super = _createSuper(GenericTouchable); + + function GenericTouchable() { + var _this; + + (0, _classCallCheck2.default)(this, GenericTouchable); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.longPressDetected = false; + _this.pointerInside = true; + _this.STATE = TOUCHABLE_STATE.UNDETERMINED; + + _this.onGestureEvent = function (_ref) { + var pointerInside = _ref.nativeEvent.pointerInside; + + if (_this.pointerInside !== pointerInside) { + if (pointerInside) { + _this.onMoveIn(); + } else { + _this.onMoveOut(); + } + } + + _this.pointerInside = pointerInside; + }; + + _this.onHandlerStateChange = function (_ref2) { + var nativeEvent = _ref2.nativeEvent; + var state = nativeEvent.state; + + if (state === _$$_REQUIRE(_dependencyMap[9]).State.CANCELLED || state === _$$_REQUIRE(_dependencyMap[9]).State.FAILED) { + _this.moveToState(TOUCHABLE_STATE.UNDETERMINED); + } else if (state === (_reactNative.Platform.OS !== 'android' ? _$$_REQUIRE(_dependencyMap[9]).State.ACTIVE : _$$_REQUIRE(_dependencyMap[9]).State.BEGAN) && _this.STATE === TOUCHABLE_STATE.UNDETERMINED) { + _this.handlePressIn(); + } else if (state === _$$_REQUIRE(_dependencyMap[9]).State.END) { + var shouldCallOnPress = !_this.longPressDetected && _this.STATE !== TOUCHABLE_STATE.MOVED_OUTSIDE && _this.pressOutTimeout === null; + + _this.handleGoToUndetermined(); + + if (shouldCallOnPress) { + _this.props.onPress == null ? undefined : _this.props.onPress(); + } + } + }; + + _this.onLongPressDetected = function () { + _this.longPressDetected = true; + _this.props.onLongPress == null ? undefined : _this.props.onLongPress(); + }; + + return _this; + } + + (0, _createClass2.default)(GenericTouchable, [{ + key: "handlePressIn", + value: function handlePressIn() { + var _this2 = this; + + if (this.props.delayPressIn) { + this.pressInTimeout = setTimeout(function () { + _this2.moveToState(TOUCHABLE_STATE.BEGAN); + + _this2.pressInTimeout = null; + }, this.props.delayPressIn); + } else { + this.moveToState(TOUCHABLE_STATE.BEGAN); + } + + if (this.props.onLongPress) { + var time = (this.props.delayPressIn || 0) + (this.props.delayLongPress || 0); + this.longPressTimeout = setTimeout(this.onLongPressDetected, time); + } + } + }, { + key: "handleMoveOutside", + value: function handleMoveOutside() { + var _this3 = this; + + if (this.props.delayPressOut) { + this.pressOutTimeout = this.pressOutTimeout || setTimeout(function () { + _this3.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE); + + _this3.pressOutTimeout = null; + }, this.props.delayPressOut); + } else { + this.moveToState(TOUCHABLE_STATE.MOVED_OUTSIDE); + } + } + }, { + key: "handleGoToUndetermined", + value: function handleGoToUndetermined() { + var _this4 = this; + + clearTimeout(this.pressOutTimeout); + + if (this.props.delayPressOut) { + this.pressOutTimeout = setTimeout(function () { + if (_this4.STATE === TOUCHABLE_STATE.UNDETERMINED) { + _this4.moveToState(TOUCHABLE_STATE.BEGAN); + } + + _this4.moveToState(TOUCHABLE_STATE.UNDETERMINED); + + _this4.pressOutTimeout = null; + }, this.props.delayPressOut); + } else { + if (this.STATE === TOUCHABLE_STATE.UNDETERMINED) { + this.moveToState(TOUCHABLE_STATE.BEGAN); + } + + this.moveToState(TOUCHABLE_STATE.UNDETERMINED); + } + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this.reset(); + } + }, { + key: "reset", + value: function reset() { + this.longPressDetected = false; + this.pointerInside = true; + clearTimeout(this.pressInTimeout); + clearTimeout(this.pressOutTimeout); + clearTimeout(this.longPressTimeout); + this.pressOutTimeout = null; + this.longPressTimeout = null; + this.pressInTimeout = null; + } + }, { + key: "moveToState", + value: function moveToState(newState) { + var _this$props$onStateCh, _this$props4; + + if (newState === this.STATE) { + return; + } + + if (newState === TOUCHABLE_STATE.BEGAN) { + var _this$props$onPressIn, _this$props; + + (_this$props$onPressIn = (_this$props = this.props).onPressIn) == null ? undefined : _this$props$onPressIn.call(_this$props); + } else if (newState === TOUCHABLE_STATE.MOVED_OUTSIDE) { + var _this$props$onPressOu, _this$props2; + + (_this$props$onPressOu = (_this$props2 = this.props).onPressOut) == null ? undefined : _this$props$onPressOu.call(_this$props2); + } else if (newState === TOUCHABLE_STATE.UNDETERMINED) { + this.reset(); + + if (this.STATE === TOUCHABLE_STATE.BEGAN) { + var _this$props$onPressOu2, _this$props3; + + (_this$props$onPressOu2 = (_this$props3 = this.props).onPressOut) == null ? undefined : _this$props$onPressOu2.call(_this$props3); + } + } + + (_this$props$onStateCh = (_this$props4 = this.props).onStateChange) == null ? undefined : _this$props$onStateCh.call(_this$props4, this.STATE, newState); + this.STATE = newState; + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.reset(); + } + }, { + key: "onMoveIn", + value: function onMoveIn() { + if (this.STATE === TOUCHABLE_STATE.MOVED_OUTSIDE) { + this.moveToState(TOUCHABLE_STATE.BEGAN); + } + } + }, { + key: "onMoveOut", + value: function onMoveOut() { + clearTimeout(this.longPressTimeout); + this.longPressTimeout = null; + + if (this.STATE === TOUCHABLE_STATE.BEGAN) { + this.handleMoveOutside(); + } + } + }, { + key: "render", + value: function render() { + var coreProps = { + accessible: this.props.accessible !== false, + accessibilityLabel: this.props.accessibilityLabel, + accessibilityHint: this.props.accessibilityHint, + accessibilityRole: this.props.accessibilityRole, + accessibilityState: this.props.accessibilityState, + nativeID: this.props.nativeID, + onLayout: this.props.onLayout, + hitSlop: this.props.hitSlop + }; + return React.createElement(_$$_REQUIRE(_dependencyMap[10]).BaseButton, (0, _extends2.default)({ + style: this.props.containerStyle, + onHandlerStateChange: this.props.disabled ? undefined : this.onHandlerStateChange, + onGestureEvent: this.onGestureEvent, + hitSlop: this.props.hitSlop, + shouldActivateOnStart: this.props.shouldActivateOnStart, + disallowInterruption: this.props.disallowInterruption, + testID: this.props.testID + }, this.props.extraButtonProps), React.createElement(_reactNative.Animated.View, (0, _extends2.default)({}, coreProps, { + style: this.props.style + }), this.props.children)); + } + }]); + return GenericTouchable; + }(React.Component); + + exports.default = GenericTouchable; + GenericTouchable.defaultProps = { + delayLongPress: 600, + extraButtonProps: { + rippleColor: 'transparent' + } + }; +},417,[5,6,7,8,12,14,16,17,28,3,411]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _GenericTouchable = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TouchableOpacity = function (_Component) { + (0, _inherits2.default)(TouchableOpacity, _Component); + + var _super = _createSuper(TouchableOpacity); + + function TouchableOpacity() { + var _this; + + (0, _classCallCheck2.default)(this, TouchableOpacity); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.getChildStyleOpacityWithDefault = function () { + var childStyle = _reactNative.StyleSheet.flatten(_this.props.style) || {}; + return childStyle.opacity == null ? 1 : childStyle.opacity; + }; + + _this.opacity = new _reactNative.Animated.Value(_this.getChildStyleOpacityWithDefault()); + + _this.setOpacityTo = function (value, duration) { + _reactNative.Animated.timing(_this.opacity, { + toValue: value, + duration: duration, + easing: _reactNative.Easing.inOut(_reactNative.Easing.quad), + useNativeDriver: true + }).start(); + }; + + _this.onStateChange = function (_from, to) { + if (to === _GenericTouchable.TOUCHABLE_STATE.BEGAN) { + _this.setOpacityTo(_this.props.activeOpacity, 0); + } else if (to === _GenericTouchable.TOUCHABLE_STATE.UNDETERMINED || to === _GenericTouchable.TOUCHABLE_STATE.MOVED_OUTSIDE) { + _this.setOpacityTo(_this.getChildStyleOpacityWithDefault(), 150); + } + }; + + return _this; + } + + (0, _createClass2.default)(TouchableOpacity, [{ + key: "render", + value: function render() { + var _this$props = this.props, + _this$props$style = _this$props.style, + style = _this$props$style === undefined ? {} : _this$props$style, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["style"]); + return React.createElement(_GenericTouchable.default, (0, _extends2.default)({}, rest, { + style: [style, { + opacity: this.opacity + }], + onStateChange: this.onStateChange + }), this.props.children ? this.props.children : React.createElement(_reactNative.View, null)); + } + }]); + return TouchableOpacity; + }(React.Component); + + exports.default = TouchableOpacity; + TouchableOpacity.defaultProps = (0, _extends2.default)({}, _GenericTouchable.default.defaultProps, { + activeOpacity: 0.2 + }); +},418,[5,6,108,7,8,12,14,16,28,417,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _GenericTouchable = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TouchableHighlight = function (_Component) { + (0, _inherits2.default)(TouchableHighlight, _Component); + + var _super = _createSuper(TouchableHighlight); + + function TouchableHighlight(props) { + var _this; + + (0, _classCallCheck2.default)(this, TouchableHighlight); + _this = _super.call(this, props); + + _this.showUnderlay = function () { + if (!_this.hasPressHandler()) { + return; + } + + _this.setState({ + extraChildStyle: { + opacity: _this.props.activeOpacity + }, + extraUnderlayStyle: { + backgroundColor: _this.props.underlayColor + } + }); + + _this.props.onShowUnderlay == null ? undefined : _this.props.onShowUnderlay(); + }; + + _this.hasPressHandler = function () { + return _this.props.onPress || _this.props.onPressIn || _this.props.onPressOut || _this.props.onLongPress; + }; + + _this.hideUnderlay = function () { + _this.setState({ + extraChildStyle: null, + extraUnderlayStyle: null + }); + + _this.props.onHideUnderlay == null ? undefined : _this.props.onHideUnderlay(); + }; + + _this.onStateChange = function (_from, to) { + if (to === _GenericTouchable.TOUCHABLE_STATE.BEGAN) { + _this.showUnderlay(); + } else if (to === _GenericTouchable.TOUCHABLE_STATE.UNDETERMINED || to === _GenericTouchable.TOUCHABLE_STATE.MOVED_OUTSIDE) { + _this.hideUnderlay(); + } + }; + + _this.state = { + extraChildStyle: null, + extraUnderlayStyle: null + }; + return _this; + } + + (0, _createClass2.default)(TouchableHighlight, [{ + key: "renderChildren", + value: function renderChildren() { + if (!this.props.children) { + return React.createElement(_reactNative.View, null); + } + + var child = React.Children.only(this.props.children); + return React.cloneElement(child, { + style: _reactNative.StyleSheet.compose(child.props.style, this.state.extraChildStyle) + }); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + _this$props$style = _this$props.style, + style = _this$props$style === undefined ? {} : _this$props$style, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["style"]); + var extraUnderlayStyle = this.state.extraUnderlayStyle; + return React.createElement(_GenericTouchable.default, (0, _extends2.default)({}, rest, { + style: [style, extraUnderlayStyle], + onStateChange: this.onStateChange + }), this.renderChildren()); + } + }]); + return TouchableHighlight; + }(React.Component); + + exports.default = TouchableHighlight; + TouchableHighlight.defaultProps = (0, _extends2.default)({}, _GenericTouchable.default.defaultProps, { + activeOpacity: 0.85, + delayPressOut: 100, + underlayColor: 'black' + }); +},419,[5,6,108,7,8,12,14,16,17,417,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FlatList = exports.DrawerLayoutAndroid = exports.TextInput = exports.Switch = exports.ScrollView = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _createNativeWrapper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ScrollView = (0, _createNativeWrapper.default)(_reactNative.ScrollView, { + disallowInterruption: true, + shouldCancelWhenOutside: false + }); + exports.ScrollView = ScrollView; + var Switch = (0, _createNativeWrapper.default)(_reactNative.Switch, { + shouldCancelWhenOutside: false, + shouldActivateOnStart: true, + disallowInterruption: true + }); + exports.Switch = Switch; + var TextInput = (0, _createNativeWrapper.default)(_reactNative.TextInput); + exports.TextInput = TextInput; + var DrawerLayoutAndroid = (0, _createNativeWrapper.default)(_reactNative.DrawerLayoutAndroid, { + disallowInterruption: true + }); + exports.DrawerLayoutAndroid = DrawerLayoutAndroid; + DrawerLayoutAndroid.positions = { + Left: 'left', + Right: 'right' + }; + var FlatList = React.forwardRef(function (props, ref) { + return React.createElement(_reactNative.FlatList, (0, _extends2.default)({ + ref: ref + }, props, { + renderScrollComponent: function renderScrollComponent(scrollProps) { + return React.createElement(ScrollView, scrollProps); + } + })); + }); + exports.FlatList = FlatList; +},420,[5,6,17,28,412]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = gestureHandlerRootHOC; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[1]); + + var _hoistNonReactStatics = _$$_REQUIRE(_dependencyMap[2])(_$$_REQUIRE(_dependencyMap[3])); + + var _GestureHandlerRootView = _$$_REQUIRE(_dependencyMap[2])(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function gestureHandlerRootHOC(Component, containerStyles) { + function Wrapper(props) { + return React.createElement(_GestureHandlerRootView.default, { + style: [styles.container, containerStyles] + }, React.createElement(Component, props)); + } + + Wrapper.displayName = "gestureHandlerRootHOC(" + (Component.displayName || Component.name) + ")"; + (0, _hoistNonReactStatics.default)(Wrapper, Component); + return Wrapper; + } + + var styles = _reactNative.StyleSheet.create({ + container: { + flex: 1 + } + }); +},421,[17,28,5,422,425]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var REACT_STATICS = { + childContextTypes: true, + contextType: true, + contextTypes: true, + defaultProps: true, + displayName: true, + getDefaultProps: true, + getDerivedStateFromError: true, + getDerivedStateFromProps: true, + mixins: true, + propTypes: true, + type: true + }; + var KNOWN_STATICS = { + name: true, + length: true, + prototype: true, + caller: true, + callee: true, + arguments: true, + arity: true + }; + var FORWARD_REF_STATICS = { + '$$typeof': true, + render: true, + defaultProps: true, + displayName: true, + propTypes: true + }; + var MEMO_STATICS = { + '$$typeof': true, + compare: true, + defaultProps: true, + displayName: true, + propTypes: true, + type: true + }; + var TYPE_STATICS = {}; + TYPE_STATICS[_$$_REQUIRE(_dependencyMap[0]).ForwardRef] = FORWARD_REF_STATICS; + TYPE_STATICS[_$$_REQUIRE(_dependencyMap[0]).Memo] = MEMO_STATICS; + + function getStatics(component) { + if (_$$_REQUIRE(_dependencyMap[0]).isMemo(component)) { + return MEMO_STATICS; + } + + return TYPE_STATICS[component['$$typeof']] || REACT_STATICS; + } + + var defineProperty = Object.defineProperty; + var getOwnPropertyNames = Object.getOwnPropertyNames; + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; + var getPrototypeOf = Object.getPrototypeOf; + var objectPrototype = Object.prototype; + + function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { + if (typeof sourceComponent !== 'string') { + if (objectPrototype) { + var inheritedComponent = getPrototypeOf(sourceComponent); + + if (inheritedComponent && inheritedComponent !== objectPrototype) { + hoistNonReactStatics(targetComponent, inheritedComponent, blacklist); + } + } + + var keys = getOwnPropertyNames(sourceComponent); + + if (getOwnPropertySymbols) { + keys = keys.concat(getOwnPropertySymbols(sourceComponent)); + } + + var targetStatics = getStatics(targetComponent); + var sourceStatics = getStatics(sourceComponent); + + for (var i = 0; i < keys.length; ++i) { + var key = keys[i]; + + if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) { + var descriptor = getOwnPropertyDescriptor(sourceComponent, key); + + try { + defineProperty(targetComponent, key, descriptor); + } catch (e) {} + } + } + } + + return targetComponent; + } + + module.exports = hoistNonReactStatics; +},422,[423]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + { + module.exports = _$$_REQUIRE(_dependencyMap[0]); + } +},423,[424]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + 'use strict'; + + var b = "function" === typeof Symbol && Symbol.for, + c = b ? Symbol.for("react.element") : 60103, + d = b ? Symbol.for("react.portal") : 60106, + e = b ? Symbol.for("react.fragment") : 60107, + f = b ? Symbol.for("react.strict_mode") : 60108, + g = b ? Symbol.for("react.profiler") : 60114, + h = b ? Symbol.for("react.provider") : 60109, + k = b ? Symbol.for("react.context") : 60110, + l = b ? Symbol.for("react.async_mode") : 60111, + m = b ? Symbol.for("react.concurrent_mode") : 60111, + n = b ? Symbol.for("react.forward_ref") : 60112, + p = b ? Symbol.for("react.suspense") : 60113, + q = b ? Symbol.for("react.suspense_list") : 60120, + r = b ? Symbol.for("react.memo") : 60115, + t = b ? Symbol.for("react.lazy") : 60116, + v = b ? Symbol.for("react.block") : 60121, + w = b ? Symbol.for("react.fundamental") : 60117, + x = b ? Symbol.for("react.responder") : 60118, + y = b ? Symbol.for("react.scope") : 60119; + + function z(a) { + if ("object" === typeof a && null !== a) { + var u = a.$$typeof; + + switch (u) { + case c: + switch (a = a.type, a) { + case l: + case m: + case e: + case g: + case f: + case p: + return a; + + default: + switch (a = a && a.$$typeof, a) { + case k: + case n: + case t: + case r: + case h: + return a; + + default: + return u; + } + + } + + case d: + return u; + } + } + } + + function A(a) { + return z(a) === m; + } + + exports.AsyncMode = l; + exports.ConcurrentMode = m; + exports.ContextConsumer = k; + exports.ContextProvider = h; + exports.Element = c; + exports.ForwardRef = n; + exports.Fragment = e; + exports.Lazy = t; + exports.Memo = r; + exports.Portal = d; + exports.Profiler = g; + exports.StrictMode = f; + exports.Suspense = p; + + exports.isAsyncMode = function (a) { + return A(a) || z(a) === l; + }; + + exports.isConcurrentMode = A; + + exports.isContextConsumer = function (a) { + return z(a) === k; + }; + + exports.isContextProvider = function (a) { + return z(a) === h; + }; + + exports.isElement = function (a) { + return "object" === typeof a && null !== a && a.$$typeof === c; + }; + + exports.isForwardRef = function (a) { + return z(a) === n; + }; + + exports.isFragment = function (a) { + return z(a) === e; + }; + + exports.isLazy = function (a) { + return z(a) === t; + }; + + exports.isMemo = function (a) { + return z(a) === r; + }; + + exports.isPortal = function (a) { + return z(a) === d; + }; + + exports.isProfiler = function (a) { + return z(a) === g; + }; + + exports.isStrictMode = function (a) { + return z(a) === f; + }; + + exports.isSuspense = function (a) { + return z(a) === p; + }; + + exports.isValidElementType = function (a) { + return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === typeof a && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v); + }; + + exports.typeOf = z; +},424,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.View; + exports.default = _default; +},425,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DRAG_TOSS = 0.05; + + var Swipeable = function (_Component) { + (0, _inherits2.default)(Swipeable, _Component); + + var _super = _createSuper(Swipeable); + + function Swipeable(_props) { + var _this; + + (0, _classCallCheck2.default)(this, Swipeable); + _this = _super.call(this, _props); + + _this.updateAnimatedEvent = function (props, state) { + var friction = props.friction, + overshootFriction = props.overshootFriction; + var dragX = state.dragX, + rowTranslation = state.rowTranslation, + _state$leftWidth = state.leftWidth, + leftWidth = _state$leftWidth === undefined ? 0 : _state$leftWidth, + _state$rowWidth = state.rowWidth, + rowWidth = _state$rowWidth === undefined ? 0 : _state$rowWidth; + var _state$rightOffset = state.rightOffset, + rightOffset = _state$rightOffset === undefined ? rowWidth : _state$rightOffset; + var rightWidth = Math.max(0, rowWidth - rightOffset); + var _props$overshootLeft = props.overshootLeft, + overshootLeft = _props$overshootLeft === undefined ? leftWidth > 0 : _props$overshootLeft, + _props$overshootRight = props.overshootRight, + overshootRight = _props$overshootRight === undefined ? rightWidth > 0 : _props$overshootRight; + + var transX = _reactNative.Animated.add(rowTranslation, dragX.interpolate({ + inputRange: [0, friction], + outputRange: [0, 1] + })).interpolate({ + inputRange: [-rightWidth - (overshootRight ? 1 : overshootFriction), -rightWidth, leftWidth, leftWidth + (overshootLeft ? 1 : overshootFriction)], + outputRange: [-rightWidth - (overshootRight || overshootFriction > 1 ? 1 : 0), -rightWidth, leftWidth, leftWidth + (overshootLeft || overshootFriction > 1 ? 1 : 0)] + }); + + _this.transX = transX; + _this.showLeftAction = leftWidth > 0 ? transX.interpolate({ + inputRange: [-1, 0, leftWidth], + outputRange: [0, 0, 1] + }) : new _reactNative.Animated.Value(0); + _this.leftActionTranslate = _this.showLeftAction.interpolate({ + inputRange: [0, Number.MIN_VALUE], + outputRange: [-10000, 0], + extrapolate: 'clamp' + }); + _this.showRightAction = rightWidth > 0 ? transX.interpolate({ + inputRange: [-rightWidth, 0, 1], + outputRange: [1, 0, 0] + }) : new _reactNative.Animated.Value(0); + _this.rightActionTranslate = _this.showRightAction.interpolate({ + inputRange: [0, Number.MIN_VALUE], + outputRange: [-10000, 0], + extrapolate: 'clamp' + }); + }; + + _this.onTapHandlerStateChange = function (_ref) { + var nativeEvent = _ref.nativeEvent; + + if (nativeEvent.oldState === _$$_REQUIRE(_dependencyMap[9]).State.ACTIVE) { + _this.close(); + } + }; + + _this.onHandlerStateChange = function (ev) { + if (ev.nativeEvent.oldState === _$$_REQUIRE(_dependencyMap[9]).State.ACTIVE) { + _this.handleRelease(ev); + } + }; + + _this.handleRelease = function (ev) { + var _ev$nativeEvent = ev.nativeEvent, + velocityX = _ev$nativeEvent.velocityX, + dragX = _ev$nativeEvent.translationX; + var _this$state = _this.state, + _this$state$leftWidth = _this$state.leftWidth, + leftWidth = _this$state$leftWidth === undefined ? 0 : _this$state$leftWidth, + _this$state$rowWidth = _this$state.rowWidth, + rowWidth = _this$state$rowWidth === undefined ? 0 : _this$state$rowWidth, + rowState = _this$state.rowState; + var _this$state$rightOffs = _this.state.rightOffset, + rightOffset = _this$state$rightOffs === undefined ? rowWidth : _this$state$rightOffs; + var rightWidth = rowWidth - rightOffset; + var _this$props = _this.props, + friction = _this$props.friction, + _this$props$leftThres = _this$props.leftThreshold, + leftThreshold = _this$props$leftThres === undefined ? leftWidth / 2 : _this$props$leftThres, + _this$props$rightThre = _this$props.rightThreshold, + rightThreshold = _this$props$rightThre === undefined ? rightWidth / 2 : _this$props$rightThre; + var startOffsetX = _this.currentOffset() + dragX / friction; + var translationX = (dragX + DRAG_TOSS * velocityX) / friction; + var toValue = 0; + + if (rowState === 0) { + if (translationX > leftThreshold) { + toValue = leftWidth; + } else if (translationX < -rightThreshold) { + toValue = -rightWidth; + } + } else if (rowState === 1) { + if (translationX > -leftThreshold) { + toValue = leftWidth; + } + } else { + if (translationX < rightThreshold) { + toValue = -rightWidth; + } + } + + _this.animateRow(startOffsetX, toValue, velocityX / friction); + }; + + _this.animateRow = function (fromValue, toValue, velocityX) { + var _this$state2 = _this.state, + dragX = _this$state2.dragX, + rowTranslation = _this$state2.rowTranslation; + dragX.setValue(0); + rowTranslation.setValue(fromValue); + + _this.setState({ + rowState: Math.sign(toValue) + }); + + _reactNative.Animated.spring(rowTranslation, (0, _extends2.default)({ + restSpeedThreshold: 1.7, + restDisplacementThreshold: 0.4, + velocity: velocityX, + bounciness: 0, + toValue: toValue, + useNativeDriver: _this.props.useNativeAnimations + }, _this.props.animationOptions)).start(function (_ref2) { + var finished = _ref2.finished; + + if (finished) { + if (toValue > 0 && _this.props.onSwipeableLeftOpen) { + _this.props.onSwipeableLeftOpen(); + } else if (toValue < 0 && _this.props.onSwipeableRightOpen) { + _this.props.onSwipeableRightOpen(); + } + + if (toValue === 0) { + _this.props.onSwipeableClose == null ? undefined : _this.props.onSwipeableClose(); + } else { + _this.props.onSwipeableOpen == null ? undefined : _this.props.onSwipeableOpen(); + } + } + }); + + if (toValue > 0 && _this.props.onSwipeableLeftWillOpen) { + _this.props.onSwipeableLeftWillOpen(); + } else if (toValue < 0 && _this.props.onSwipeableRightWillOpen) { + _this.props.onSwipeableRightWillOpen(); + } + + if (toValue === 0) { + _this.props.onSwipeableWillClose == null ? undefined : _this.props.onSwipeableWillClose(); + } else { + _this.props.onSwipeableWillOpen == null ? undefined : _this.props.onSwipeableWillOpen(); + } + }; + + _this.onRowLayout = function (_ref3) { + var nativeEvent = _ref3.nativeEvent; + + _this.setState({ + rowWidth: nativeEvent.layout.width + }); + }; + + _this.currentOffset = function () { + var _this$state3 = _this.state, + _this$state3$leftWidt = _this$state3.leftWidth, + leftWidth = _this$state3$leftWidt === undefined ? 0 : _this$state3$leftWidt, + _this$state3$rowWidth = _this$state3.rowWidth, + rowWidth = _this$state3$rowWidth === undefined ? 0 : _this$state3$rowWidth, + rowState = _this$state3.rowState; + var _this$state$rightOffs2 = _this.state.rightOffset, + rightOffset = _this$state$rightOffs2 === undefined ? rowWidth : _this$state$rightOffs2; + var rightWidth = rowWidth - rightOffset; + + if (rowState === 1) { + return leftWidth; + } else if (rowState === -1) { + return -rightWidth; + } + + return 0; + }; + + _this.close = function () { + _this.animateRow(_this.currentOffset(), 0); + }; + + _this.openLeft = function () { + var _this$state$leftWidth2 = _this.state.leftWidth, + leftWidth = _this$state$leftWidth2 === undefined ? 0 : _this$state$leftWidth2; + + _this.animateRow(_this.currentOffset(), leftWidth); + }; + + _this.openRight = function () { + var _this$state$rowWidth2 = _this.state.rowWidth, + rowWidth = _this$state$rowWidth2 === undefined ? 0 : _this$state$rowWidth2; + var _this$state$rightOffs3 = _this.state.rightOffset, + rightOffset = _this$state$rightOffs3 === undefined ? rowWidth : _this$state$rightOffs3; + var rightWidth = rowWidth - rightOffset; + + _this.animateRow(_this.currentOffset(), -rightWidth); + }; + + var _dragX = new _reactNative.Animated.Value(0); + + _this.state = { + dragX: _dragX, + rowTranslation: new _reactNative.Animated.Value(0), + rowState: 0, + leftWidth: undefined, + rightOffset: undefined, + rowWidth: undefined + }; + + _this.updateAnimatedEvent(_props, _this.state); + + _this.onGestureEvent = _reactNative.Animated.event([{ + nativeEvent: { + translationX: _dragX + } + }], { + useNativeDriver: _props.useNativeAnimations + }); + return _this; + } + + (0, _createClass2.default)(Swipeable, [{ + key: "UNSAFE_componentWillUpdate", + value: function UNSAFE_componentWillUpdate(props, state) { + if (this.props.friction !== props.friction || this.props.overshootLeft !== props.overshootLeft || this.props.overshootRight !== props.overshootRight || this.props.overshootFriction !== props.overshootFriction || this.state.leftWidth !== state.leftWidth || this.state.rightOffset !== state.rightOffset || this.state.rowWidth !== state.rowWidth) { + this.updateAnimatedEvent(props, state); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var rowState = this.state.rowState; + var _this$props2 = this.props, + children = _this$props2.children, + renderLeftActions = _this$props2.renderLeftActions, + renderRightActions = _this$props2.renderRightActions; + var left = renderLeftActions && React.createElement(_reactNative.Animated.View, { + style: [styles.leftActions, { + transform: [{ + translateX: this.leftActionTranslate + }] + }] + }, renderLeftActions(this.showLeftAction, this.transX), React.createElement(_reactNative.View, { + onLayout: function onLayout(_ref4) { + var nativeEvent = _ref4.nativeEvent; + return _this2.setState({ + leftWidth: nativeEvent.layout.x + }); + } + })); + var right = renderRightActions && React.createElement(_reactNative.Animated.View, { + style: [styles.rightActions, { + transform: [{ + translateX: this.rightActionTranslate + }] + }] + }, renderRightActions(this.showRightAction, this.transX), React.createElement(_reactNative.View, { + onLayout: function onLayout(_ref5) { + var nativeEvent = _ref5.nativeEvent; + return _this2.setState({ + rightOffset: nativeEvent.layout.x + }); + } + })); + return React.createElement(_$$_REQUIRE(_dependencyMap[10]).PanGestureHandler, (0, _extends2.default)({ + activeOffsetX: [-10, 10] + }, this.props, { + onGestureEvent: this.onGestureEvent, + onHandlerStateChange: this.onHandlerStateChange + }), React.createElement(_reactNative.Animated.View, { + onLayout: this.onRowLayout, + style: [styles.container, this.props.containerStyle] + }, left, right, React.createElement(_$$_REQUIRE(_dependencyMap[10]).TapGestureHandler, { + enabled: rowState !== 0, + onHandlerStateChange: this.onTapHandlerStateChange + }, React.createElement(_reactNative.Animated.View, { + pointerEvents: rowState === 0 ? 'auto' : 'box-only', + style: [{ + transform: [{ + translateX: this.transX + }] + }, this.props.childrenContainerStyle] + }, children)))); + } + }]); + return Swipeable; + }(React.Component); + + exports.default = Swipeable; + Swipeable.defaultProps = { + friction: 1, + overshootFriction: 1, + useNativeAnimations: true + }; + + var styles = _reactNative.StyleSheet.create({ + container: { + overflow: 'hidden' + }, + leftActions: (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject, { + flexDirection: _reactNative.I18nManager.isRTL ? 'row-reverse' : 'row' + }), + rightActions: (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject, { + flexDirection: _reactNative.I18nManager.isRTL ? 'row' : 'row-reverse' + }) + }); +},426,[5,6,7,8,12,14,16,17,28,3,4]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DRAG_TOSS = 0.05; + var IDLE = 'Idle'; + var DRAGGING = 'Dragging'; + var SETTLING = 'Settling'; + + var DrawerLayout = function (_Component) { + (0, _inherits2.default)(DrawerLayout, _Component); + + var _super = _createSuper(DrawerLayout); + + function DrawerLayout(_props) { + var _this; + + (0, _classCallCheck2.default)(this, DrawerLayout); + _this = _super.call(this, _props); + _this.accessibilityIsModalView = React.createRef(); + _this.pointerEventsView = React.createRef(); + _this.panGestureHandler = React.createRef(); + _this.drawerShown = false; + + _this.updateAnimatedEvent = function (props, state) { + var drawerPosition = props.drawerPosition, + drawerWidth = props.drawerWidth, + drawerType = props.drawerType; + var dragXValue = state.dragX, + touchXValue = state.touchX, + drawerTranslation = state.drawerTranslation, + containerWidth = state.containerWidth; + var dragX = dragXValue; + var touchX = touchXValue; + + if (drawerPosition !== 'left') { + dragX = _reactNative.Animated.multiply(new _reactNative.Animated.Value(-1), dragXValue); + touchX = _reactNative.Animated.add(new _reactNative.Animated.Value(containerWidth), _reactNative.Animated.multiply(new _reactNative.Animated.Value(-1), touchXValue)); + touchXValue.setValue(containerWidth); + } else { + touchXValue.setValue(0); + } + + var translationX = dragX; + + if (drawerType === 'front') { + var startPositionX = _reactNative.Animated.add(touchX, _reactNative.Animated.multiply(new _reactNative.Animated.Value(-1), dragX)); + + var dragOffsetFromOnStartPosition = startPositionX.interpolate({ + inputRange: [drawerWidth - 1, drawerWidth, drawerWidth + 1], + outputRange: [0, 0, 1] + }); + translationX = _reactNative.Animated.add(dragX, dragOffsetFromOnStartPosition); + } + + _this.openValue = _reactNative.Animated.add(translationX, drawerTranslation).interpolate({ + inputRange: [0, drawerWidth], + outputRange: [0, 1], + extrapolate: 'clamp' + }); + var gestureOptions = { + useNativeDriver: props.useNativeAnimations + }; + + if (_this.props.onDrawerSlide) { + gestureOptions.listener = function (ev) { + var translationX = Math.floor(Math.abs(ev.nativeEvent.translationX)); + var position = translationX / _this.state.containerWidth; + _this.props.onDrawerSlide == null ? undefined : _this.props.onDrawerSlide(position); + }; + } + + _this.onGestureEvent = _reactNative.Animated.event([{ + nativeEvent: { + translationX: dragXValue, + x: touchXValue + } + }], gestureOptions); + }; + + _this.handleContainerLayout = function (_ref) { + var nativeEvent = _ref.nativeEvent; + + _this.setState({ + containerWidth: nativeEvent.layout.width + }); + }; + + _this.emitStateChanged = function (newState, drawerWillShow) { + _this.props.onDrawerStateChanged == null ? undefined : _this.props.onDrawerStateChanged(newState, drawerWillShow); + }; + + _this.openingHandlerStateChange = function (_ref2) { + var nativeEvent = _ref2.nativeEvent; + + if (nativeEvent.oldState === _$$_REQUIRE(_dependencyMap[10]).State.ACTIVE) { + _this.handleRelease({ + nativeEvent: nativeEvent + }); + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.ACTIVE) { + _this.emitStateChanged(DRAGGING, false); + + if (_this.props.keyboardDismissMode === 'on-drag') { + _reactNative.Keyboard.dismiss(); + } + + if (_this.props.hideStatusBar) { + _reactNative.StatusBar.setHidden(true, _this.props.statusBarAnimation || 'slide'); + } + } + }; + + _this.onTapHandlerStateChange = function (_ref3) { + var nativeEvent = _ref3.nativeEvent; + + if (_this.drawerShown && nativeEvent.oldState === _$$_REQUIRE(_dependencyMap[10]).State.ACTIVE && _this.props.drawerLockMode !== 'locked-open') { + _this.closeDrawer(); + } + }; + + _this.handleRelease = function (_ref4) { + var nativeEvent = _ref4.nativeEvent; + var _this$props = _this.props, + drawerWidth = _this$props.drawerWidth, + drawerPosition = _this$props.drawerPosition, + drawerType = _this$props.drawerType; + var containerWidth = _this.state.containerWidth; + var dragX = nativeEvent.translationX, + velocityX = nativeEvent.velocityX, + touchX = nativeEvent.x; + + if (drawerPosition !== 'left') { + dragX = -dragX; + touchX = containerWidth - touchX; + velocityX = -velocityX; + } + + var gestureStartX = touchX - dragX; + var dragOffsetBasedOnStart = 0; + + if (drawerType === 'front') { + dragOffsetBasedOnStart = gestureStartX > drawerWidth ? gestureStartX - drawerWidth : 0; + } + + var startOffsetX = dragX + dragOffsetBasedOnStart + (_this.drawerShown ? drawerWidth : 0); + var projOffsetX = startOffsetX + DRAG_TOSS * velocityX; + var shouldOpen = projOffsetX > drawerWidth / 2; + + if (shouldOpen) { + _this.animateDrawer(startOffsetX, drawerWidth, velocityX); + } else { + _this.animateDrawer(startOffsetX, 0, velocityX); + } + }; + + _this.updateShowing = function (showing) { + var _this$accessibilityIs, _this$pointerEventsVi, _this$panGestureHandl; + + _this.drawerShown = showing; + (_this$accessibilityIs = _this.accessibilityIsModalView.current) == null ? undefined : _this$accessibilityIs.setNativeProps({ + accessibilityViewIsModal: showing + }); + (_this$pointerEventsVi = _this.pointerEventsView.current) == null ? undefined : _this$pointerEventsVi.setNativeProps({ + pointerEvents: showing ? 'auto' : 'none' + }); + var _this$props2 = _this.props, + drawerPosition = _this$props2.drawerPosition, + minSwipeDistance = _this$props2.minSwipeDistance, + edgeWidth = _this$props2.edgeWidth; + var fromLeft = drawerPosition === 'left'; + var gestureOrientation = (fromLeft ? 1 : -1) * (_this.drawerShown ? -1 : 1); + var hitSlop = fromLeft ? { + left: 0, + width: showing ? undefined : edgeWidth + } : { + right: 0, + width: showing ? undefined : edgeWidth + }; + (_this$panGestureHandl = _this.panGestureHandler.current) == null ? undefined : _this$panGestureHandl.setNativeProps({ + hitSlop: hitSlop, + activeOffsetX: gestureOrientation * minSwipeDistance + }); + }; + + _this.animateDrawer = function (fromValue, toValue, velocity, speed) { + _this.state.dragX.setValue(0); + + _this.state.touchX.setValue(_this.props.drawerPosition === 'left' ? 0 : _this.state.containerWidth); + + if (fromValue != null) { + var nextFramePosition = fromValue; + + if (_this.props.useNativeAnimations) { + if (fromValue < toValue && velocity > 0) { + nextFramePosition = Math.min(fromValue + velocity / 60.0, toValue); + } else if (fromValue > toValue && velocity < 0) { + nextFramePosition = Math.max(fromValue + velocity / 60.0, toValue); + } + } + + _this.state.drawerTranslation.setValue(nextFramePosition); + } + + var willShow = toValue !== 0; + + _this.updateShowing(willShow); + + _this.emitStateChanged(SETTLING, willShow); + + if (_this.props.hideStatusBar) { + _reactNative.StatusBar.setHidden(willShow, _this.props.statusBarAnimation || 'slide'); + } + + _reactNative.Animated.spring(_this.state.drawerTranslation, { + velocity: velocity, + bounciness: 0, + toValue: toValue, + useNativeDriver: _this.props.useNativeAnimations, + speed: speed != null ? speed : undefined + }).start(function (_ref5) { + var finished = _ref5.finished; + + if (finished) { + _this.emitStateChanged(IDLE, willShow); + + if (willShow) { + _this.props.onDrawerOpen == null ? undefined : _this.props.onDrawerOpen(); + } else { + _this.props.onDrawerClose == null ? undefined : _this.props.onDrawerClose(); + } + } + }); + }; + + _this.openDrawer = function () { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _this.animateDrawer(undefined, _this.props.drawerWidth, options.velocity ? options.velocity : 0); + + _this.forceUpdate(); + }; + + _this.closeDrawer = function () { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _this.animateDrawer(undefined, 0, options.velocity ? options.velocity : 0); + + _this.forceUpdate(); + }; + + _this.renderOverlay = function () { + (0, _invariant.default)(_this.openValue, 'should be set'); + + var overlayOpacity = _this.openValue.interpolate({ + inputRange: [0, 1], + outputRange: [0, 1], + extrapolate: 'clamp' + }); + + var dynamicOverlayStyles = { + opacity: overlayOpacity, + backgroundColor: _this.props.overlayColor + }; + return React.createElement(_$$_REQUIRE(_dependencyMap[11]).TapGestureHandler, { + onHandlerStateChange: _this.onTapHandlerStateChange + }, React.createElement(_reactNative.Animated.View, { + pointerEvents: _this.drawerShown ? 'auto' : 'none', + ref: _this.pointerEventsView, + style: [styles.overlay, dynamicOverlayStyles] + })); + }; + + _this.renderDrawer = function () { + var _this$props3 = _this.props, + drawerBackgroundColor = _this$props3.drawerBackgroundColor, + drawerWidth = _this$props3.drawerWidth, + drawerPosition = _this$props3.drawerPosition, + drawerType = _this$props3.drawerType, + drawerContainerStyle = _this$props3.drawerContainerStyle, + contentContainerStyle = _this$props3.contentContainerStyle; + var fromLeft = drawerPosition === 'left'; + var drawerSlide = drawerType !== 'back'; + var containerSlide = drawerType !== 'front'; + var reverseContentDirection = _reactNative.I18nManager.isRTL ? fromLeft : !fromLeft; + var dynamicDrawerStyles = { + backgroundColor: drawerBackgroundColor, + width: drawerWidth + }; + var openValue = _this.openValue; + (0, _invariant.default)(openValue, 'should be set'); + var containerStyles; + + if (containerSlide) { + var containerTranslateX = openValue.interpolate({ + inputRange: [0, 1], + outputRange: fromLeft ? [0, drawerWidth] : [0, -drawerWidth], + extrapolate: 'clamp' + }); + containerStyles = { + transform: [{ + translateX: containerTranslateX + }] + }; + } + + var drawerTranslateX = 0; + + if (drawerSlide) { + var closedDrawerOffset = fromLeft ? -drawerWidth : drawerWidth; + drawerTranslateX = openValue.interpolate({ + inputRange: [0, 1], + outputRange: [closedDrawerOffset, 0], + extrapolate: 'clamp' + }); + } + + var drawerStyles = { + transform: [{ + translateX: drawerTranslateX + }], + flexDirection: reverseContentDirection ? 'row-reverse' : 'row' + }; + return React.createElement(_reactNative.Animated.View, { + style: styles.main, + onLayout: _this.handleContainerLayout + }, React.createElement(_reactNative.Animated.View, { + style: [drawerType === 'front' ? styles.containerOnBack : styles.containerInFront, containerStyles, contentContainerStyle], + importantForAccessibility: _this.drawerShown ? 'no-hide-descendants' : 'yes' + }, typeof _this.props.children === 'function' ? _this.props.children(_this.openValue) : _this.props.children, _this.renderOverlay()), React.createElement(_reactNative.Animated.View, { + pointerEvents: "box-none", + ref: _this.accessibilityIsModalView, + accessibilityViewIsModal: _this.drawerShown, + style: [styles.drawerContainer, drawerStyles, drawerContainerStyle] + }, React.createElement(_reactNative.View, { + style: dynamicDrawerStyles + }, _this.props.renderNavigationView(_this.openValue)))); + }; + + _this.setPanGestureRef = function (ref) { + _this.panGestureHandler.current = ref; + _this.props.onGestureRef == null ? undefined : _this.props.onGestureRef(ref); + }; + + var _dragX = new _reactNative.Animated.Value(0); + + var _touchX = new _reactNative.Animated.Value(0); + + var _drawerTranslation = new _reactNative.Animated.Value(0); + + _this.state = { + dragX: _dragX, + touchX: _touchX, + drawerTranslation: _drawerTranslation, + containerWidth: 0 + }; + + _this.updateAnimatedEvent(_props, _this.state); + + return _this; + } + + (0, _createClass2.default)(DrawerLayout, [{ + key: "UNSAFE_componentWillUpdate", + value: function UNSAFE_componentWillUpdate(props, state) { + if (this.props.drawerPosition !== props.drawerPosition || this.props.drawerWidth !== props.drawerWidth || this.props.drawerType !== props.drawerType || this.state.containerWidth !== state.containerWidth) { + this.updateAnimatedEvent(props, state); + } + } + }, { + key: "render", + value: function render() { + var _this$props4 = this.props, + drawerPosition = _this$props4.drawerPosition, + drawerLockMode = _this$props4.drawerLockMode, + edgeWidth = _this$props4.edgeWidth, + minSwipeDistance = _this$props4.minSwipeDistance; + var fromLeft = drawerPosition === 'left'; + var gestureOrientation = (fromLeft ? 1 : -1) * (this.drawerShown ? -1 : 1); + var hitSlop = fromLeft ? { + left: 0, + width: this.drawerShown ? undefined : edgeWidth + } : { + right: 0, + width: this.drawerShown ? undefined : edgeWidth + }; + return React.createElement(_$$_REQUIRE(_dependencyMap[11]).PanGestureHandler, { + ref: this.setPanGestureRef, + hitSlop: hitSlop, + activeOffsetX: gestureOrientation * minSwipeDistance, + failOffsetY: [-15, 15], + onGestureEvent: this.onGestureEvent, + onHandlerStateChange: this.openingHandlerStateChange, + enableTrackpadTwoFingerGesture: this.props.enableTrackpadTwoFingerGesture, + enabled: drawerLockMode !== 'locked-closed' && drawerLockMode !== 'locked-open' + }, this.renderDrawer()); + } + }]); + return DrawerLayout; + }(React.Component); + + exports.default = DrawerLayout; + DrawerLayout.defaultProps = { + drawerWidth: 200, + drawerPosition: 'left', + useNativeAnimations: true, + drawerType: 'front', + edgeWidth: 20, + minSwipeDistance: 3, + overlayColor: 'rgba(0, 0, 0, 0.7)', + drawerLockMode: 'unlocked', + enableTrackpadTwoFingerGesture: false + }; + DrawerLayout.positions = { + Left: 'left', + Right: 'right' + }; + + var styles = _reactNative.StyleSheet.create({ + drawerContainer: (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject, { + zIndex: 1001, + flexDirection: 'row' + }), + containerInFront: (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject, { + zIndex: 1002 + }), + containerOnBack: (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject), + main: { + flex: 1, + zIndex: 0, + overflow: 'hidden' + }, + overlay: (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject, { + zIndex: 1000 + }) + }); +},427,[5,6,7,8,12,14,16,17,36,28,3,4]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _EpaperLayoutConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _PublicationsManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Publication = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _SslConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _ContentManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + global.__DEV__ = false; + + if (!global.btoa) { + global.btoa = _$$_REQUIRE(_dependencyMap[10]).encode; + } + + if (!global.atob) { + global.atob = _$$_REQUIRE(_dependencyMap[10]).decode; + } + + global.newsmemoryStartupParams = {}; + + global.setNewsmemoryStartupParams = function (params) { + global.newsmemoryStartupParams = params; + }; + + global.updateNewsmemoryStartupParams = function () { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var current = global.getNewsmemoryStartupParams() || {}; + global.newsmemoryStartupParams = (0, _extends2.default)({}, current, params); + }; + + global.getNewsmemoryStartupParams = function () { + return global.newsmemoryStartupParams; + }; + + global.isIssueInNewsmemoryStartupParams = function () { + if (global.newsmemoryStartupParams) { + var _global$newsmemorySta = global.newsmemoryStartupParams, + date = _global$newsmemorySta.date, + selDate = _global$newsmemorySta.selDate, + issue = _global$newsmemorySta.issue; + return selDate !== undefined || date !== undefined || issue !== undefined; + } + + return false; + }; + + global.shouldForceNewsmemoryWithStartupParams = function () { + if (global.newsmemoryStartupParams) { + var schemaPath = global.newsmemoryStartupParams.schemaPath; + return schemaPath === "load" || global.isIssueInNewsmemoryStartupParams(); + } + + return false; + }; + + global.resetNewsmemoryStartupParams = function () { + global.newsmemoryStartupParams = {}; + }; + + global.initBaseValues = function (props) { + var language = props.language, + pSetup = props.pSetup, + machine = props.machine, + splashBgColor = props.splashBgColor, + loadingColor = props.loadingColor, + appName = props.appName, + appVersionName = props.appVersionName, + appVersionCode = props.appVersionCode, + androidVersionName = props.androidVersionName, + iosIapSharedSecret = props.iosIapSharedSecret, + androidAppId = props.androidAppId, + pushService = props.pushService, + pushChannel = props.pushChannel, + pushChannelSilent = props.pushChannelSilent, + masAppId = props.masAppId, + hcmAppId = props.hcmAppId, + oneSignalAppId = props.oneSignalAppId, + facebookAppId = props.facebookAppId, + isAddon = props.isAddon, + addonNeedsCloseButton = props.addonNeedsCloseButton, + addonNeedsSafeArea = props.addonNeedsSafeArea, + isTecnaviaHelperApp = props.isTecnaviaHelperApp, + debugMode = props.debugMode, + densityDPI = props.densityDPI, + isHuawei = props.isHuawei, + isKindle = props.isKindle, + initialOrientation = props.initialOrientation, + developerName = props.developerName, + externalLinkAccountURL = props.externalLinkAccountURL, + token = props.token, + apiKey = props.apiKey; + global.splashBgColor = splashBgColor; + global.loadingColor = loadingColor; + global.appName = appName; + global.appVersionName = appVersionName; + global.androidVersionName = androidVersionName; + global.appVersionCode = appVersionCode; + global.iosIapSharedSecret = iosIapSharedSecret; + global.androidAppId = androidAppId; + global.pushService = pushService; + global.pushChannel = pushChannel; + global.pushChannelSilent = pushChannelSilent; + global.masAppId = masAppId; + global.hcmAppId = hcmAppId; + global.oneSignalAppId = oneSignalAppId; + global.facebookAppId = facebookAppId; + global.isDebug = global.__DEV__ || debugMode; + global.isApiDebug = global.isDebug; + global.cssDebug = global.isDebug; + global.isHuawei = isHuawei; + global.isKindle = isKindle; + global.locale = language; + global.pSetup = pSetup; + global.server = machine; + global.isTecnaviaHelperApp = isTecnaviaHelperApp; + global.densityDPI = densityDPI; + global.initialOrientation = initialOrientation; + global.isAddon = isAddon; + global.addonNeedsCloseButton = isAddon && addonNeedsCloseButton; + global.addonNeedsSafeArea = isAddon && addonNeedsSafeArea; + global.apiKey = apiKey; + global.developerName = developerName || "Tecnavia"; + global.externalLinkAccountURL = externalLinkAccountURL; + + if (token) { + global.updateNewsmemoryStartupParams({ + token: token + }); + } + + _$$_REQUIRE(_dependencyMap[11]).NetworkUtils.isHTTPS = global.isHTTPS(); + _$$_REQUIRE(_dependencyMap[11]).Logger.enableLog = global.isDebug; + + if (global.__DEV__ && !global.isTaAddon()) {} + + global.initialized = true; + }; + + global.initialized = false; + global.startup = true; + global.lastAppSide = undefined; + global.lastRssCategory = undefined; + global.pSetup = ""; + global.server = ""; + global.locale = ""; + global.isDebug = false; + global.isAddon = false; + global.addonNeedsCloseButton = false; + global.addonNeedsSafeArea = false; + global.isTecnaviaHelperApp = false; + global.developer = "amauri"; + global.isApiDebug = false; + global.cssDebug = false; + global.adsTestDevices = ["EF6F266379A7547A0AC501AC591D60A1"]; + global.isLayoutDebug = false; + global.developerName = undefined; + global.externalLinkAccountURL = undefined; + global.apiKey = undefined; + global.unauthorized = false; + global.machineId = undefined; + global.openingPushNotificationDate = new Date(); + global.advertisingTrackingConsent = undefined; + + global.isTaAddon = function () { + return global.isAddon || global.isTecnaviaHelperApp; + }; + + global.TaAddonNeedsCloseButton = function () { + return global.addonNeedsCloseButton; + }; + + global.appNeedsSafeArea = function () { + return !global.isTaAddon() ? true : global.addonNeedsSafeArea; + }; + + global.getRssFavoritesConfig = function () { + if (!global.rssFavoritesConfig) { + global.rssFavoritesConfig = new (_$$_REQUIRE(_dependencyMap[12]).RssFavoritesConfig)(); + } + + return global.rssFavoritesConfig; + }; + + global.getEpaperLayoutConfig = function () { + if (!global.epaperLayoutConfig) { + global.epaperLayoutConfig = new _EpaperLayoutConfig.default(); + } + + return global.epaperLayoutConfig; + }; + + global.getLocaleConfig = function () { + if (!global.localeConfig) { + global.localeConfig = new (_$$_REQUIRE(_dependencyMap[13]).LocaleConfig)(); + } + + return global.localeConfig; + }; + + global.getSslConfig = function () { + if (!global.sslConfig) { + global.sslConfig = new _SslConfig.default(); + } + + return global.sslConfig; + }; + + global.strings = function (name) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return global.getLocaleConfig().strings(name, params); + }; + + global.date = function (time) { + return global.getLocaleConfig().date(time); + }; + + global.formattedDate = function (str, format) { + return global.getLocaleConfig().formattedDate(str, format); + }; + + global.getAudio = function () { + return global.getLocaleConfig().audioMgr; + }; + + global.getAdsConfig = function () { + if (!global.adsConfig) { + global.adsConfig = new (_$$_REQUIRE(_dependencyMap[14]).AdsConfig)(); + } + + return global.adsConfig; + }; + + global.getVerticalsConfig = function () { + if (!global.verticalsConfig) { + global.verticalsConfig = new (_$$_REQUIRE(_dependencyMap[15]).VerticalsConfig)(); + } + + return global.verticalsConfig; + }; + + global.getNewsmemoryConfig = function () { + if (!global.newsmemoryConfig) { + global.newsmemoryConfig = new _NewsmemoryConfig.default(); + } + + return global.newsmemoryConfig; + }; + + global.getRssIndexManager = function () { + if (!global.rssIndexManager) { + global.rssIndexManager = new (_$$_REQUIRE(_dependencyMap[16]).RssIndexManager)(); + } + + return global.rssIndexManager; + }; + + global.getRssIndex = function (pSetup) { + return global.getRssIndexManager().getIndex(pSetup); + }; + + global.getFontsManager = function () { + if (!global.fontsManager) { + global.fontsManager = new (_$$_REQUIRE(_dependencyMap[17]).FontsManager)(); + } + + return global.fontsManager; + }; + + global.getFontsConfig = function (paper) { + return global.getFontsManager().getConfig(paper); + }; + + global.getUserSettings = function () { + if (!global.userConfig) { + global.userConfig = new (_$$_REQUIRE(_dependencyMap[18]).UserConfig)(); + } + + return global.userConfig; + }; + + global.getAppPSetup = function () { + var pSetup; + + var _global$getUserSettin = global.getUserSettings(), + notificationEmail = _global$getUserSettin.notificationEmail; + + if (notificationEmail) { + var _StringUtils$parseNot = _$$_REQUIRE(_dependencyMap[11]).StringUtils.parseNotificationEmail(notificationEmail); + + pSetup = _StringUtils$parseNot.pSetup; + var paperSetupManager = global.getPaperSetupManager(); + + if (paperSetupManager) { + var activePSetup = paperSetupManager.activePSetup; + + if (!activePSetup) { + paperSetupManager.setActivePSetup(pSetup); + } else { + var _NewsmemoryUtils$pars = _newsmemoryUtils.default.parseXpSetup(activePSetup), + mainActivepSetup = _NewsmemoryUtils$pars.mainpSetup; + + if (pSetup !== mainActivepSetup) { + paperSetupManager.setActivePSetup(pSetup); + } + } + } + } + + if (!pSetup) { + var _global = global; + pSetup = _global.pSetup; + } + + return pSetup.trim(); + }; + + global.getAppServer = function () { + var server; + + var _global$getUserSettin2 = global.getUserSettings(), + notificationEmail = _global$getUserSettin2.notificationEmail; + + if (notificationEmail) { + var _StringUtils$parseNot2 = _$$_REQUIRE(_dependencyMap[11]).StringUtils.parseNotificationEmail(notificationEmail); + + server = _StringUtils$parseNot2.server; + } + + if (!server) { + var _global2 = global; + server = _global2.server; + } + + return server.trim(); + }; + + global.isHTTPS = function () { + return global.getAppServer().indexOf("https://") === 0; + }; + + global.getPaperSetupManager = function () { + if (!global.paperSetupManager) { + global.paperSetupManager = new (_$$_REQUIRE(_dependencyMap[19]).PaperSetupManager)(); + } + + return global.paperSetupManager; + }; + + global.getMainPSetup = function () { + return global.getPaperSetupManager().getMainPSetupConfig(); + }; + + global.getActivePSetup = function () { + return global.getPaperSetupManager().getActivePSetupConfig(); + }; + + global.getRSSActivePSetup = function () { + return global.getPaperSetupManager().getRSSActivePSetupConfig(); + }; + + global.initPSetup = function _callee(pSetup, machine, extraParams) { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", global.getPaperSetupManager().init(pSetup, machine, extraParams)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + global.initConfigOnly = function _callee2(pSetup, machine) { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", global.getPaperSetupManager().initConfigOnly(pSetup, machine)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }; + + global.setPSetupConfig = function _callee3(pSetup, pSetupConfig) { + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", global.getPaperSetupManager().setPSetupConfig(pSetup, pSetupConfig)); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }; + + global.loadPSetup = function _callee4(pSetup, machine, extraParams, external) { + return _regenerator.default.async(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + return _context4.abrupt("return", global.getPaperSetupManager().load(pSetup, machine, (0, _extends2.default)({ + fromCache: true + }, extraParams), external)); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + }; + + global.reloadActivePSetup = function _callee5(extraParams) { + return _regenerator.default.async(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", global.getPaperSetupManager().reload(extraParams)); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + }; + + global.getPublicationsManager = function () { + if (!global.publicationsManager) { + global.publicationsManager = new _PublicationsManager.default(); + } + + return global.publicationsManager; + }; + + global.loadPublications = function _callee6() { + return _regenerator.default.async(function _callee6$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", global.getPublicationsManager().load()); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + }; + + global.setCurrentPublication = function (params) { + return global.getPublicationsManager().setCurrentPublication(params); + }; + + global.getCurrentPublication = function _callee7() { + return _regenerator.default.async(function _callee7$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", global.getPublicationsManager().getCurrentPublication()); + + case 1: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + }; + + global.getContentManager = function () { + if (!global.contentManager) { + global.contentManager = new _ContentManager.default(); + } + + return global.contentManager; + }; + + global.analyzeUsedSpace = function _callee8() { + return _regenerator.default.async(function _callee8$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + return _context8.abrupt("return", global.getContentManager().analyze()); + + case 1: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + }; + + global.getUsedSpace = function () { + var _global$getContentMan = global.getContentManager(), + usedSpace = _global$getContentMan.usedSpace, + numberOfPapersDirs = _global$getContentMan.numberOfPapersDirs, + numberOfIssuesDirs = _global$getContentMan.numberOfIssuesDirs, + numberOfPagesDirs = _global$getContentMan.numberOfPagesDirs; + + return { + usedSpace: usedSpace, + numberOfPapersDirs: numberOfPapersDirs, + numberOfIssuesDirs: numberOfIssuesDirs, + numberOfPagesDirs: numberOfPagesDirs + }; + }; + + _$$_REQUIRE(_dependencyMap[11]).Logger.enableLog = false; + _$$_REQUIRE(_dependencyMap[11]).Logger.enableLogCaller = false; + _$$_REQUIRE(_dependencyMap[11]).Logger.initializedLogSession = false; + _$$_REQUIRE(_dependencyMap[11]).Logger.logSessionFileName = ""; + global.getLocaleConfig().initLocale(); +},428,[5,80,6,429,1859,1722,1723,603,1960,1961,486,462,1962,1976,2012,2059,2066,2074,2077,1849]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _PublicationsManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var EpaperLayoutConfig = function () { + function EpaperLayoutConfig() { + (0, _classCallCheck2.default)(this, EpaperLayoutConfig); + this.isTablet = _$$_REQUIRE(_dependencyMap[6]).PlatformUtils.isTablet(); + this.config = {}; + } + + (0, _createClass2.default)(EpaperLayoutConfig, [{ + key: "_addPublicationsButton", + value: function _addPublicationsButton() { + if (this.mainFooter.buttons && this.mainFooter.buttons.length > 0) { + var moreButton = this.mainFooter.buttons.find(function (button) { + return button && button.getAction() === _$$_REQUIRE(_dependencyMap[7]).ACTIONS.openMore.key; + }); + + if (!moreButton) { + var more = _$$_REQUIRE(_dependencyMap[8]).main.buttons.find(function (button) { + return button && button.function === _$$_REQUIRE(_dependencyMap[7]).ACTIONS.openMore.key; + }); + + if (more) { + this.mainFooter.buttons.push(new (_$$_REQUIRE(_dependencyMap[9]).Icon)(more)); + } + } + } + + var publicationsButton; + + if (this.mainFooter.more && this.mainFooter.more.length > 0) { + publicationsButton = this.mainFooter.more.find(function (button) { + return button && button.getAction() === _$$_REQUIRE(_dependencyMap[7]).ACTIONS.openOptionPagePublications.key; + }); + } + + if (!publicationsButton) { + if (this.mainFooter.buttons && this.mainFooter.buttons.length > 0) { + publicationsButton = this.mainFooter.buttons.find(function (button) { + return button && button.getAction() === _$$_REQUIRE(_dependencyMap[7]).ACTIONS.openOptionPagePublications.key; + }); + } + + if (!publicationsButton) { + if (!this.mainFooter.more) { + this.mainFooter.more = []; + } + + var pubs = _$$_REQUIRE(_dependencyMap[8]).main.more.find(function (button) { + return button && button.function === _$$_REQUIRE(_dependencyMap[7]).ACTIONS.openOptionPagePublications.key; + }); + + if (pubs) { + var id = this.mainFooter.more.length + 1; + pubs.id = id; + this.mainFooter.more.push(new (_$$_REQUIRE(_dependencyMap[9]).Icon)(pubs)); + } + } + } + } + }, { + key: "getIconByAction", + value: function getIconByAction(action) { + var button; + + if (this.mainFooter) { + button = this.mainFooter.getButtonByAction(action); + } + + if (!button && this.articleFooter) { + button = this.articleFooter.getButtonByAction(action); + } + + if (!button && this.firstLevelIndexFooter) { + button = this.firstLevelIndexFooter.getButtonByAction(action); + } + + if (!button && this.secondLevelIndexFooter) { + button = this.secondLevelIndexFooter.getButtonByAction(action); + } + + if (!button && this.articleHeader) { + button = this.articleHeader.getButtonByAction(action); + } + + if (!button && this.firstLevelIndexHeader) { + button = this.firstLevelIndexHeader.getButtonByAction(action); + } + + if (!button && this.secondLevelIndexHeader) { + button = this.secondLevelIndexHeader.getButtonByAction(action); + } + + if (!button && this.navigationModel) { + button = this.navigationModel.getButtonByAction(action); + } + + return button; + } + }, { + key: "init", + value: function init(pSetup, type, remote) { + var fromPublicationsPage, + response, + _this$config, + main, + article, + index, + navigation, + _global$getActivePSet, + isGenericApp, + publicationsManager, + firstLevel, + secondLevel, + _args = arguments; + + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + fromPublicationsPage = _args.length > 3 && _args[3] !== undefined ? _args[3] : false; + this.type = type; + + if (!remote) { + _context.next = 25; + break; + } + + _context.prev = 3; + _context.next = 6; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.getEpaperLayoutConfig()); + + case 6: + response = _context.sent; + this.config = response && response.data || {}; + global.getNewsmemoryConfig().setLayout(pSetup, this.config); + _context.next = 16; + break; + + case 11: + _context.prev = 11; + _context.t0 = _context["catch"](3); + _context.next = 15; + return _regenerator.default.awrap(global.getNewsmemoryConfig().getLayout(pSetup)); + + case 15: + this.config = _context.sent; + + case 16: + _context.prev = 16; + _context.next = 19; + return _regenerator.default.awrap(global.getNewsmemoryConfig().resetTranslationAvailable()); + + case 19: + _context.next = 23; + break; + + case 21: + _context.prev = 21; + _context.t1 = _context["catch"](16); + + case 23: + _context.next = 28; + break; + + case 25: + _context.next = 27; + return _regenerator.default.awrap(global.getNewsmemoryConfig().getLayout(pSetup)); + + case 27: + this.config = _context.sent; + + case 28: + if (!this.config || !this.config.main) { + switch (this.type) { + case EpaperLayoutConfig.Type.hybridLite: + case EpaperLayoutConfig.Type.hybrid: + case EpaperLayoutConfig.Type.lite: + default: + this.config = this.isTablet ? _$$_REQUIRE(_dependencyMap[8]) : _$$_REQUIRE(_dependencyMap[10]); + } + } + + _this$config = this.config, main = _this$config.main, article = _this$config.article, index = _this$config.index, navigation = _this$config.navigation; + + if (main) { + this.mainFooter = new (_$$_REQUIRE(_dependencyMap[11]).Footer)(main); + _global$getActivePSet = global.getActivePSetup(), isGenericApp = _global$getActivePSet.isGenericApp; + + if (_$$_REQUIRE(_dependencyMap[12]).PaperSetupManager.isGenericAppConfigured() && !isGenericApp) { + publicationsManager = global.getPublicationsManager(); + + if (fromPublicationsPage || publicationsManager.getPublications().length > 1) { + this._addPublicationsButton(); + } + } + } + + if (article) { + this.articleFooter = new (_$$_REQUIRE(_dependencyMap[11]).Footer)(article.footer); + this.articleHeader = new (_$$_REQUIRE(_dependencyMap[13]).Header)(article); + } + + if (index) { + firstLevel = index.firstLevel, secondLevel = index.secondLevel; + + if (firstLevel) { + this.firstLevelIndexHeader = new (_$$_REQUIRE(_dependencyMap[13]).Header)(firstLevel); + this.firstLevelIndexFooter = new (_$$_REQUIRE(_dependencyMap[11]).Footer)(firstLevel.footer || article.footer); + } + + if (secondLevel) { + this.secondLevelIndexHeader = new (_$$_REQUIRE(_dependencyMap[13]).Header)(secondLevel); + this.secondLevelIndexFooter = new (_$$_REQUIRE(_dependencyMap[11]).Footer)(secondLevel.footer || article.footer); + } + } + + if (navigation) { + this.navigationModel = new (_$$_REQUIRE(_dependencyMap[14]).Navigation)(navigation); + } + + case 34: + case "end": + return _context.stop(); + } + } + }, null, this, [[3, 11], [16, 21]], Promise); + } + }]); + return EpaperLayoutConfig; + }(); + + exports.default = EpaperLayoutConfig; + EpaperLayoutConfig.Type = { + normal: 0, + lite: 1, + hybrid: 2, + hybridLite: 3 + }; +},429,[5,80,7,8,430,1722,462,1725,1804,1805,1845,1846,1849,1853,1858]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _downloadUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _ApplicationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _newsmemoryUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Session = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NewsmemoryAJAX = function () { + function NewsmemoryAJAX() { + (0, _classCallCheck2.default)(this, NewsmemoryAJAX); + } + + (0, _createClass2.default)(NewsmemoryAJAX, null, [{ + key: "getDomain", + value: function getDomain(canUseCDN) { + var _global$getActivePSet = global.getActivePSetup(), + machine = _global$getActivePSet.machine; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + cdnServer = _global$getNewsmemory.cdnServer; + + return canUseCDN && cdnServer || machine; + } + }, { + key: "baseUrl", + value: function baseUrl(canUseCDN) { + return _Api.default.baseUrl(NewsmemoryAJAX.getDomain(canUseCDN)); + } + }, { + key: "getDefaultGETParams", + value: function getDefaultGETParams() { + var _global$getActivePSet2 = global.getActivePSetup(), + pSetup = _global$getActivePSet2.pSetup; + + return { + pSetup: pSetup + }; + } + }, { + key: "getEncryptedCallsParams", + value: function getEncryptedCallsParams() { + var useCDN = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + var _global$getActivePSet3 = global.getActivePSetup(), + pSetup = _global$getActivePSet3.pSetup, + encryptFilenames = _global$getActivePSet3.encryptFilenames; + + if (useCDN && encryptFilenames === _$$_REQUIRE(_dependencyMap[17]).ENCRYPT_FILENAME_TYPE.XPAPER) { + var _NewsmemoryUtils$pars = _newsmemoryUtils.default.parseXpSetup(pSetup), + xpSetup = _NewsmemoryUtils$pars.xpSetup; + + if (xpSetup) { + return { + pSetup: xpSetup + }; + } + } + + return {}; + } + }, { + key: "getResourceCDNParams", + value: function getResourceCDNParams(secret, resourceName, resourceValues, resourceFileTimes) { + var useCDN = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + var params = {}; + + if (secret) { + params = (0, _extends2.default)({}, NewsmemoryAJAX.getEncryptedCallsParams(useCDN), { + cc: _newsmemoryUtils.default.encryptFilenames(resourceValues, secret) + }); + + if (resourceFileTimes) { + params.mtime = resourceFileTimes.join(","); + } + } else { + params[resourceName] = resourceValues.join(","); + + if (resourceFileTimes) { + params.ts = _newsmemoryUtils.default.getCDNChecksum(resourceFileTimes); + } + } + + return params; + } + }, { + key: "get", + value: function get(params) { + var config, + skipDefaultParams, + headers, + _args = arguments; + return _regenerator.default.async(function get$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + config = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + skipDefaultParams = _args.length > 2 && _args[2] !== undefined ? _args[2] : false; + headers = _args.length > 3 && _args[3] !== undefined ? _args[3] : {}; + return _context.abrupt("return", _Api.default.get(NewsmemoryAJAX.baseUrl(), config, (0, _extends2.default)({}, NewsmemoryAJAX.getDefaultGETParams(), params), skipDefaultParams, headers)); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "post", + value: function post(baseUrl) { + var getParams, + data, + config, + headers, + params, + url, + _args2 = arguments; + return _regenerator.default.async(function post$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + getParams = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {}; + data = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : {}; + config = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : { + responseType: "text" + }; + headers = _args2.length > 4 && _args2[4] !== undefined ? _args2[4] : {}; + params = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), getParams); + url = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(baseUrl, params); + return _context2.abrupt("return", _Api.default.post(url, config, data, true, headers)); + + case 7: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "login", + value: function login(_ref, timeout) { + var username, password, TAUID, TOKEN, challenge, rest; + return _regenerator.default.async(function login$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + username = _ref.username, password = _ref.password, TAUID = _ref.TAUID, TOKEN = _ref.TOKEN, challenge = _ref.challenge, rest = (0, _objectWithoutProperties2.default)(_ref, ["username", "password", "TAUID", "TOKEN", "challenge"]); + return _context3.abrupt("return", NewsmemoryAJAX.get((0, _extends2.default)({ + action: "login", + timepc: new Date().getTime() / 1000 || 0, + username: !_$$_REQUIRE(_dependencyMap[18]).JSUtils.isNull(username) ? username : undefined, + password: password, + challenge: challenge, + TAUID: TAUID, + TOKEN: TOKEN, + LocalUA: _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.getUserAgent() + }, rest), { + timeout: timeout + })); + + case 2: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "createIAPUser", + value: function createIAPUser() { + return _regenerator.default.async(function createIAPUser$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + return _context4.abrupt("return", NewsmemoryAJAX.get({ + action: "createIAPUser" + })); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getEditionsAndIssues", + value: function getEditionsAndIssues() { + var params, + _global$getActivePSet4, + loadEditionsUrl, + _NewsmemoryUtils$pars2, + mainpSetup, + result, + _args5 = arguments; + + return _regenerator.default.async(function getEditionsAndIssues$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}; + _global$getActivePSet4 = global.getActivePSetup(), loadEditionsUrl = _global$getActivePSet4.loadEditionsUrl; + _NewsmemoryUtils$pars2 = _newsmemoryUtils.default.parseXpSetup(global.getActivePSetup().pSetup), mainpSetup = _NewsmemoryUtils$pars2.mainpSetup; + _context5.prev = 3; + _context5.next = 6; + return _regenerator.default.awrap(_Api.default.get(loadEditionsUrl, {}, (0, _extends2.default)({}, NewsmemoryAJAX.getDefaultGETParams(), { + pSetup: mainpSetup + }, params))); + + case 6: + result = _context5.sent; + return _context5.abrupt("return", result.data); + + case 10: + _context5.prev = 10; + _context5.t0 = _context5["catch"](3); + + case 12: + return _context5.abrupt("return", {}); + + case 13: + case "end": + return _context5.stop(); + } + } + }, null, null, [[3, 10]], Promise); + } + }, { + key: "getIssues", + value: function getIssues(edition) { + var _global$getActivePSet5, defaultMaxIssues, udb, newsmemoryConfig, prefEdi, favEdi, result; + + return _regenerator.default.async(function getIssues$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _global$getActivePSet5 = global.getActivePSetup(), defaultMaxIssues = _global$getActivePSet5.defaultMaxIssues, udb = _global$getActivePSet5.udb; + newsmemoryConfig = global.getNewsmemoryConfig(); + _context6.next = 4; + return _regenerator.default.awrap(newsmemoryConfig.getPrefEdi(udb)); + + case 4: + prefEdi = _context6.sent; + _context6.next = 7; + return _regenerator.default.awrap(newsmemoryConfig.getFavEdi()); + + case 7: + favEdi = _context6.sent; + _context6.prev = 8; + _context6.next = 11; + return _regenerator.default.awrap(NewsmemoryAJAX.get({ + action: "issues", + maxIssues: defaultMaxIssues, + edition: edition, + prefEdi: prefEdi, + favEdi: favEdi + })); + + case 11: + result = _context6.sent; + return _context6.abrupt("return", result.data); + + case 15: + _context6.prev = 15; + _context6.t0 = _context6["catch"](8); + + case 17: + return _context6.abrupt("return", []); + + case 18: + case "end": + return _context6.stop(); + } + } + }, null, null, [[8, 15]], Promise); + } + }, { + key: "getEditions", + value: function getEditions(issue) { + var result; + return _regenerator.default.async(function getEditions$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + _context7.prev = 0; + _context7.next = 3; + return _regenerator.default.awrap(NewsmemoryAJAX.get({ + action: "editions", + issue: issue + })); + + case 3: + result = _context7.sent; + return _context7.abrupt("return", result.data); + + case 7: + _context7.prev = 7; + _context7.t0 = _context7["catch"](0); + + case 9: + return _context7.abrupt("return", []); + + case 10: + case "end": + return _context7.stop(); + } + } + }, null, null, [[0, 7]], Promise); + } + }, { + key: "translateArticle", + value: function translateArticle(config) { + var _global$getActivePSet6, translationServer, useCDN, baseUrl, target, issue, edition, filename, artid, filetime, secret, defaultParams, result; + + return _regenerator.default.async(function translateArticle$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + _global$getActivePSet6 = global.getActivePSetup(), translationServer = _global$getActivePSet6.translationServer; + useCDN = false; + + if (translationServer) { + baseUrl = _Api.default.baseUrl(translationServer); + } else { + useCDN = _newsmemoryUtils.default.isCDNEnabled(); + baseUrl = NewsmemoryAJAX.baseUrl(useCDN); + } + + _context8.prev = 3; + target = config.target, issue = config.issue, edition = config.edition, filename = config.filename, artid = config.artid, filetime = config.filetime, secret = config.secret; + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, useCDN), NewsmemoryAJAX.getDefaultGETParams(), { + action: "translate", + target: target, + issue: issue, + edition: edition, + artid: artid + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename], [filetime], useCDN)); + _context8.next = 8; + return _regenerator.default.awrap(_Api.default.get(baseUrl, {}, defaultParams, true)); + + case 8: + result = _context8.sent; + return _context8.abrupt("return", result.data); + + case 12: + _context8.prev = 12; + _context8.t0 = _context8["catch"](3); + + case 14: + return _context8.abrupt("return", ""); + + case 15: + case "end": + return _context8.stop(); + } + } + }, null, null, [[3, 12]], Promise); + } + }, { + key: "translationsAvailable", + value: function translationsAvailable() { + var result; + return _regenerator.default.async(function translationsAvailable$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + _context9.prev = 0; + _context9.next = 3; + return _regenerator.default.awrap(NewsmemoryAJAX.get({ + action: "languages" + })); + + case 3: + result = _context9.sent; + return _context9.abrupt("return", result.data); + + case 7: + _context9.prev = 7; + _context9.t0 = _context9["catch"](0); + + case 9: + return _context9.abrupt("return", {}); + + case 10: + case "end": + return _context9.stop(); + } + } + }, null, null, [[0, 7]], Promise); + } + }, { + key: "share", + value: function share(config) { + var _global$getActivePSet7, loginStatus, TAUID, TOKEN, params, result; + + return _regenerator.default.async(function share$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _global$getActivePSet7 = global.getActivePSetup(), loginStatus = _global$getActivePSet7.loginStatus; + TAUID = loginStatus.TAUID, TOKEN = loginStatus.TOKEN; + params = (0, _extends2.default)({ + action: "share" + }, config, { + TAUID: TAUID, + TOKEN: TOKEN + }); + _context10.prev = 3; + _context10.next = 6; + return _regenerator.default.awrap(NewsmemoryAJAX.get(params)); + + case 6: + result = _context10.sent; + return _context10.abrupt("return", result.data); + + case 10: + _context10.prev = 10; + _context10.t0 = _context10["catch"](3); + + case 12: + return _context10.abrupt("return", {}); + + case 13: + case "end": + return _context10.stop(); + } + } + }, null, null, [[3, 10]], Promise); + } + }, { + key: "downloadEditionDB", + value: function downloadEditionDB(paper, issue, edition, appendFirstPages, config) { + var _global$getActivePSet8, loginStatus, encryptFilenames, TAUID, TOKEN, oneTimeToken, adtype, defaultParams, _global$getNewsmemory2, dbDownloadPSetup, dbURL, destinationPath, zipDBFilename, speedInKbps, _await$DownloadUtils$, filenames, responseHeaders, result; + + return _regenerator.default.async(function downloadEditionDB$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + _global$getActivePSet8 = global.getActivePSetup(), loginStatus = _global$getActivePSet8.loginStatus, encryptFilenames = _global$getActivePSet8.encryptFilenames; + TAUID = loginStatus.TAUID, TOKEN = loginStatus.TOKEN, oneTimeToken = loginStatus.oneTimeToken; + adtype = _newsmemoryUtils.default.normalizeEdition(edition) + "_pages"; + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), { + action: "adfile", + issue: issue, + adtype: adtype, + edition: edition, + TAUID: TAUID, + TOKEN: TOKEN, + oneTimeToken: oneTimeToken, + uAVCC: loginStatus.getReceiptToken(), + appendFirstPages: appendFirstPages ? 1 : 0 + }); + + if (encryptFilenames > _$$_REQUIRE(_dependencyMap[17]).ENCRYPT_FILENAME_TYPE.NONE) { + defaultParams.e = 1; + } + + _global$getNewsmemory2 = global.getNewsmemoryConfig(), dbDownloadPSetup = _global$getNewsmemory2.dbDownloadPSetup; + + if (dbDownloadPSetup) { + defaultParams.pSetup = dbDownloadPSetup; + } + + dbURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(), defaultParams); + destinationPath = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue); + zipDBFilename = issue + "_" + adtype + ".zip"; + _context11.next = 12; + return _regenerator.default.awrap(_downloadUtils.default.getEditionDatabaseAndPages(dbURL, zipDBFilename, destinationPath, (0, _extends2.default)({ + completionCallback: function completionCallback(_ref2) { + var speed = _ref2.speed; + speedInKbps = speed; + } + }, config))); + + case 12: + _await$DownloadUtils$ = _context11.sent; + filenames = _await$DownloadUtils$.filenames; + responseHeaders = _await$DownloadUtils$.responseHeaders; + result = (0, _extends2.default)({}, filenames, { + responseHeaders: responseHeaders + }); + + if (speedInKbps) { + result.speed = speedInKbps; + } + + return _context11.abrupt("return", result); + + case 18: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getHrImageUrl", + value: function getHrImageUrl(issue, graph, xmlId, boxId, filename, filetime, secret) { + var type = graph ? "jpg" : "gif"; + + var useCDN = _newsmemoryUtils.default.isCDNEnabled(); + + var defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, useCDN), NewsmemoryAJAX.getDefaultGETParams(), { + action: "hrimage", + issue: issue, + xmlId: xmlId, + boxId: boxId, + type: type + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename], [filetime], useCDN)); + return _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + } + }, { + key: "getPagePath", + value: function getPagePath(paper, issue, pageFileName) { + return _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + pageFileName + "/"; + } + }, { + key: "getHrPath", + value: function getHrPath(paper, issue, pageFileName, graph, xmlId, boxId) { + var type = graph ? "jpg" : "gif"; + var imageName = "pag_" + xmlId + "_" + boxId + "." + type; + return NewsmemoryAJAX.getPagePath(paper, issue, pageFileName) + imageName; + } + }, { + key: "downloadHRImage", + value: function downloadHRImage(paper, issue, filename, filetime, xmlId, boxId, graph, secret) { + var type, imageName, url, destinationFolder, path, _await$getImageSize, width, height; + + return _regenerator.default.async(function downloadHRImage$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + type = graph ? "jpg" : "gif"; + imageName = "pag_" + xmlId + "_" + boxId + "." + type; + url = NewsmemoryAJAX.getHrImageUrl(issue, graph, xmlId, boxId, filename, filetime, secret); + _context12.prev = 3; + destinationFolder = NewsmemoryAJAX.getPagePath(paper, issue, filename); + _context12.next = 7; + return _regenerator.default.awrap(_downloadUtils.default.downloadResourceInFolder(url, destinationFolder, imageName)); + + case 7: + path = _context12.sent; + _context12.next = 10; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[19]).getImageSize)("file://" + path)); + + case 10: + _await$getImageSize = _context12.sent; + width = _await$getImageSize.width; + height = _await$getImageSize.height; + return _context12.abrupt("return", { + path: path, + name: _tecnaviaFileUtils.default.getFilename(path), + width: width, + height: height + }); + + case 16: + _context12.prev = 16; + _context12.t0 = _context12["catch"](3); + throw _context12.t0; + + case 19: + case "end": + return _context12.stop(); + } + } + }, null, null, [[3, 16]], Promise); + } + }, { + key: "downloadImage", + value: function downloadImage(paper, issue, image, filename, filetime, secret) { + var useCDN, defaultParams, imageURL, destinationFolder, path, width, height, _await$getImageSize2; + + return _regenerator.default.async(function downloadImage$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + useCDN = _newsmemoryUtils.default.isCDNEnabled(); + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, useCDN), NewsmemoryAJAX.getDefaultGETParams(), { + action: "base64image", + issue: issue, + image: image + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename], [filetime], useCDN)); + imageURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + _context13.prev = 3; + destinationFolder = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + filename + "/"; + _context13.next = 7; + return _regenerator.default.awrap(_downloadUtils.default.downloadResourceInFolder(imageURL, destinationFolder, image)); + + case 7: + path = _context13.sent; + width = 0; + height = 0; + + if (!path.endsWith(_$$_REQUIRE(_dependencyMap[20]).EPaperImageName.PDF)) { + _context13.next = 15; + break; + } + + width = 100; + height = 100; + _context13.next = 24; + break; + + case 15: + _context13.next = 17; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[19]).getImageSize)("file://" + path)); + + case 17: + _await$getImageSize2 = _context13.sent; + width = _await$getImageSize2.width; + height = _await$getImageSize2.height; + + if (!(width === 0 || height === 0)) { + _context13.next = 24; + break; + } + + _context13.next = 23; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[18]).FileUtils.unlink(path)); + + case 23: + throw new Error("Invalid size " + width + "x" + height + " for image " + path); + + case 24: + return _context13.abrupt("return", { + path: path, + name: _tecnaviaFileUtils.default.getFilename(path), + width: width, + height: height + }); + + case 27: + _context13.prev = 27; + _context13.t0 = _context13["catch"](3); + throw _context13.t0; + + case 30: + case "end": + return _context13.stop(); + } + } + }, null, null, [[3, 27]], Promise); + } + }, { + key: "downloadPageZip", + value: function downloadPageZip(paper, issue, filename, filetime, secret) { + var useCDN, defaultParams, zipURL, destinationFolder, LOW, GRAPH, GIF, PDF, images; + return _regenerator.default.async(function downloadPageZip$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + useCDN = _newsmemoryUtils.default.isCDNEnabled(); + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, useCDN), NewsmemoryAJAX.getDefaultGETParams(), { + action: "zippedimages", + issue: issue + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename], [filetime], useCDN)); + zipURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + _context14.prev = 3; + destinationFolder = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + filename + "/"; + _context14.next = 7; + return _regenerator.default.awrap(_downloadUtils.default.downloadResourceAndUnzipInFolder(zipURL, destinationFolder)); + + case 7: + LOW = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.LOW, GRAPH = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.GRAPH, GIF = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.GIF, PDF = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.PDF; + _context14.next = 10; + return _regenerator.default.awrap(_downloadUtils.default.scanPageFolderForImages(destinationFolder, [LOW, GRAPH, GIF, PDF])); + + case 10: + images = _context14.sent; + return _context14.abrupt("return", images); + + case 14: + _context14.prev = 14; + _context14.t0 = _context14["catch"](3); + throw _context14.t0; + + case 17: + case "end": + return _context14.stop(); + } + } + }, null, null, [[3, 14]], Promise); + } + }, { + key: "downloadHRImagesZip", + value: function downloadHRImagesZip(paper, issue, filename, filetime, secret) { + var useCDN, page, defaultParams, zipURL, destinationFolder, path, success; + return _regenerator.default.async(function downloadHRImagesZip$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + useCDN = _newsmemoryUtils.default.isCDNEnabled(); + page = filename.substring(0, filename.length - 2); + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, useCDN), NewsmemoryAJAX.getDefaultGETParams(), { + action: "zippedhrimages", + mode: "g", + issue: issue + }, NewsmemoryAJAX.getResourceCDNParams(secret, "page", [page], [filetime], useCDN)); + zipURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + _context15.prev = 4; + destinationFolder = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + filename + "/"; + _context15.next = 8; + return _regenerator.default.awrap(_downloadUtils.default.downloadResourceInFolder(zipURL, destinationFolder, _newsmemoryUtils.ARCHIVE_ZIP_GRAPH_FILENAME)); + + case 8: + path = _context15.sent; + _context15.next = 11; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(path)); + + case 11: + success = _context15.sent; + + if (!success) { + _context15.next = 14; + break; + } + + return _context15.abrupt("return", path); + + case 14: + return _context15.abrupt("return", null); + + case 17: + _context15.prev = 17; + _context15.t0 = _context15["catch"](4); + throw _context15.t0; + + case 20: + case "end": + return _context15.stop(); + } + } + }, null, null, [[4, 17]], Promise); + } + }, { + key: "downloadMultiplePagesZips", + value: function downloadMultiplePagesZips(paper, issue, filenames, filetimes, secret) { + var useCDN, defaultParams, zipURL, destinationFolder, LOW, GRAPH, GIF, PDF; + return _regenerator.default.async(function downloadMultiplePagesZips$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + useCDN = _newsmemoryUtils.default.isCDNEnabled(); + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, useCDN), NewsmemoryAJAX.getDefaultGETParams(), { + action: "multizippedimages", + issue: issue + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filenames", filenames, filetimes, useCDN)); + zipURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + _context17.prev = 3; + destinationFolder = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue); + _context17.next = 7; + return _regenerator.default.awrap(_downloadUtils.default.downloadResourceAndUnzipInFolder(zipURL, destinationFolder)); + + case 7: + LOW = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.LOW, GRAPH = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.GRAPH, GIF = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.GIF, PDF = _$$_REQUIRE(_dependencyMap[20]).EPaperImageName.PDF; + return _context17.abrupt("return", Promise.all(filenames.map(function _callee(filename) { + return _regenerator.default.async(function _callee$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + return _context16.abrupt("return", _downloadUtils.default.scanPageFolderForImages(destinationFolder + filename, [LOW, GRAPH, GIF, PDF])); + + case 1: + case "end": + return _context16.stop(); + } + } + }, null, null, null, Promise); + }))); + + case 11: + _context17.prev = 11; + _context17.t0 = _context17["catch"](3); + throw _context17.t0; + + case 14: + case "end": + return _context17.stop(); + } + } + }, null, null, [[3, 11]], Promise); + } + }, { + key: "downloadFullPaper", + value: function downloadFullPaper(paper, issue, edition) { + var _global$getActivePSet9, loginStatus, TAUID, TOKEN, oneTimeToken, _global$getNewsmemory3, network, defaultParams, zipURL, destinationFolder; + + return _regenerator.default.async(function downloadFullPaper$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + _global$getActivePSet9 = global.getActivePSetup(), loginStatus = _global$getActivePSet9.loginStatus; + TAUID = loginStatus.TAUID, TOKEN = loginStatus.TOKEN, oneTimeToken = loginStatus.oneTimeToken; + _global$getNewsmemory3 = global.getNewsmemoryConfig(), network = _global$getNewsmemory3.network; + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), { + action: "zippedpaper", + issue: issue, + edition: edition, + TAUID: TAUID, + TOKEN: TOKEN, + oneTimeToken: oneTimeToken, + network: network, + uAVCC: loginStatus.getReceiptToken() + }); + zipURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(), defaultParams); + _context18.prev = 5; + destinationFolder = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue); + _context18.next = 9; + return _regenerator.default.awrap(_downloadUtils.default.downloadResourceAndUnzipInFolder(zipURL, destinationFolder)); + + case 9: + _context18.next = 14; + break; + + case 11: + _context18.prev = 11; + _context18.t0 = _context18["catch"](5); + throw _context18.t0; + + case 14: + case "end": + return _context18.stop(); + } + } + }, null, null, [[5, 11]], Promise); + } + }, { + key: "downloadPaperIndex", + value: function downloadPaperIndex(issue, edition) { + var _global$getActivePSet10, loginStatus, TAUID, TOKEN, oneTimeToken, params, _await$NewsmemoryAJAX, data; + + return _regenerator.default.async(function downloadPaperIndex$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + _global$getActivePSet10 = global.getActivePSetup(), loginStatus = _global$getActivePSet10.loginStatus; + TAUID = loginStatus.TAUID, TOKEN = loginStatus.TOKEN, oneTimeToken = loginStatus.oneTimeToken; + params = { + action: "index", + issue: issue, + edition: edition, + TAUID: TAUID, + TOKEN: TOKEN, + oneTimeToken: oneTimeToken, + uAVCC: loginStatus.getReceiptToken() + }; + _context19.next = 5; + return _regenerator.default.awrap(NewsmemoryAJAX.get(params)); + + case 5: + _await$NewsmemoryAJAX = _context19.sent; + data = _await$NewsmemoryAJAX.data; + + if (!data) { + _context19.next = 9; + break; + } + + return _context19.abrupt("return", data); + + case 9: + throw new Error("NewsmemoryAJAX - downloadPaperIndex: no data returned"); + + case 10: + case "end": + return _context19.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "downloadArticles", + value: function downloadArticles(issue, edition, filename, secret) { + var params, _await$NewsmemoryAJAX2, data; + + return _regenerator.default.async(function downloadArticles$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + _context20.prev = 0; + params = (0, _extends2.default)({ + action: "articles", + issue: issue, + edition: edition + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename])); + _context20.next = 4; + return _regenerator.default.awrap(NewsmemoryAJAX.get(params)); + + case 4: + _await$NewsmemoryAJAX2 = _context20.sent; + data = _await$NewsmemoryAJAX2.data; + + if (!data) { + _context20.next = 8; + break; + } + + return _context20.abrupt("return", data); + + case 8: + _context20.next = 12; + break; + + case 10: + _context20.prev = 10; + _context20.t0 = _context20["catch"](0); + + case 12: + throw new Error("NewsmemoryAJAX - downloadArticles: no data returned"); + + case 13: + case "end": + return _context20.stop(); + } + } + }, null, null, [[0, 10]], Promise); + } + }, { + key: "getAvailableLanguages", + value: function getAvailableLanguages() { + return _regenerator.default.async(function getAvailableLanguages$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + return _context21.abrupt("return", NewsmemoryAJAX.get({ + action: "languages" + })); + + case 1: + case "end": + return _context21.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getRemoteSharePage", + value: function getRemoteSharePage(type, shareId) { + return _regenerator.default.async(function getRemoteSharePage$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + return _context22.abrupt("return", NewsmemoryAJAX.get({ + action: "publink", + type: type, + forwardShareId: shareId + })); + + case 1: + case "end": + return _context22.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getEpaperLayoutConfig", + value: function getEpaperLayoutConfig() { + return _regenerator.default.async(function getEpaperLayoutConfig$(_context23) { + while (1) { + switch (_context23.prev = _context23.next) { + case 0: + return _context23.abrupt("return", NewsmemoryAJAX.get({ + action: "buttons" + })); + + case 1: + case "end": + return _context23.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getApplication", + value: function getApplication() { + var defaultParams, zipURL, response, tmpFile, destinationFolder; + return _regenerator.default.async(function getApplication$(_context24) { + while (1) { + switch (_context24.prev = _context24.next) { + case 0: + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), { + action: "application" + }); + zipURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(), defaultParams); + _context24.prev = 2; + _context24.next = 5; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.fetch(zipURL)); + + case 5: + response = _context24.sent; + + if (!response) { + _context24.next = 23; + break; + } + + tmpFile = response.path(); + destinationFolder = _ApplicationManager.default.getDirectory() + "/"; + _context24.prev = 9; + _context24.next = 12; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(destinationFolder)); + + case 12: + _context24.next = 16; + break; + + case 14: + _context24.prev = 14; + _context24.t0 = _context24["catch"](9); + + case 16: + _context24.next = 18; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(destinationFolder)); + + case 18: + _context24.next = 20; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unzip(tmpFile, destinationFolder)); + + case 20: + _context24.next = 22; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.clearUnusedDownloadedFiles(tmpFile)); + + case 22: + return _context24.abrupt("return", true); + + case 23: + _context24.next = 28; + break; + + case 25: + _context24.prev = 25; + _context24.t1 = _context24["catch"](2); + throw new Error("Failed to download " + zipURL); + + case 28: + return _context24.abrupt("return", false); + + case 29: + case "end": + return _context24.stop(); + } + } + }, null, null, [[2, 25], [9, 14]], Promise); + } + }, { + key: "getCDNStatus", + value: function getCDNStatus(issue, edition) { + var _global$getActivePSet11, loginStatus, TAUID, TOKEN, oneTimeToken, defaultParams; + + return _regenerator.default.async(function getCDNStatus$(_context25) { + while (1) { + switch (_context25.prev = _context25.next) { + case 0: + _global$getActivePSet11 = global.getActivePSetup(), loginStatus = _global$getActivePSet11.loginStatus; + TAUID = loginStatus.TAUID, TOKEN = loginStatus.TOKEN, oneTimeToken = loginStatus.oneTimeToken; + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), { + action: "cdn", + issue: issue, + edition: edition, + TAUID: TAUID, + TOKEN: TOKEN, + oneTimeToken: oneTimeToken, + uAVCC: loginStatus.getReceiptToken() + }); + return _context25.abrupt("return", NewsmemoryAJAX.get(defaultParams)); + + case 4: + case "end": + return _context25.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getChildArtImageUrl", + value: function getChildArtImageUrl(issue, xmlId, images, medDpi, pageW, pageH, filename, filetime, secret) { + var useCDN = _newsmemoryUtils.default.isCDNEnabled(); + + var defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, true), NewsmemoryAJAX.getDefaultGETParams(), { + action: "loadImage", + type: "printImage", + xmlId: xmlId, + issue: issue, + images: images, + medDpi: medDpi, + pageW: pageW, + pageH: pageH + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename], [filetime], useCDN)); + + var imageURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + + return imageURL; + } + }, { + key: "getInArticleImageUrl", + value: function getInArticleImageUrl(paper, issue, edition, image, imageIssue, filename, filetime, secret) { + var useCDN = _newsmemoryUtils.default.isCDNEnabled(); + + var defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, true), NewsmemoryAJAX.getDefaultGETParams(), { + action: "loadImage", + type: "Image", + paper: paper, + issue: issue, + edition: edition, + val: image, + imageIssue: imageIssue !== issue ? imageIssue : undefined + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename], [filetime], useCDN)); + + var imageURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + + return imageURL; + } + }, { + key: "getSpecialSectionUrl", + value: function getSpecialSectionUrl(action, issue, edition, secret) { + var isSpecialSection = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + var showSections = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; + + var useCDN = _newsmemoryUtils.default.isCDNEnabled(); + + var defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(true, useCDN), NewsmemoryAJAX.getDefaultGETParams(), { + action: action, + issue: issue + }, NewsmemoryAJAX.getResourceCDNParams(secret, "edition", [edition], [0], useCDN)); + + if (isSpecialSection) { + defaultParams.editionfromcalling = global.getNewsmemoryConfig().editionfromcalling; + } + + if (action === "indexspecial") { + defaultParams.showSections = showSections ? 1 : 0; + defaultParams.remote = 1; + } + + var specialSectionsURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(useCDN), defaultParams); + + return specialSectionsURL; + } + }, { + key: "getDownloadPdfUrl", + value: function getDownloadPdfUrl(newspaper, page) { + var issue, edition, secret, filename, pageNumber, _global$getActivePSet12, loginStatus, TAUID, TOKEN, oneTimeToken, defaultParams, downloadPdfURL; + + return _regenerator.default.async(function getDownloadPdfUrl$(_context26) { + while (1) { + switch (_context26.prev = _context26.next) { + case 0: + issue = newspaper.getIssue(); + edition = newspaper.getEdition(); + secret = newspaper.getSecret(); + filename = page.getFilename(); + pageNumber = page.getPage(); + _global$getActivePSet12 = global.getActivePSetup(), loginStatus = _global$getActivePSet12.loginStatus; + TAUID = loginStatus.TAUID, TOKEN = loginStatus.TOKEN, oneTimeToken = loginStatus.oneTimeToken; + defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), { + action: "page", + issue: issue, + edition: edition, + page: pageNumber, + TAUID: TAUID, + TOKEN: TOKEN, + oneTimeToken: oneTimeToken, + uAVCC: loginStatus.getReceiptToken() + }, NewsmemoryAJAX.getResourceCDNParams(secret, "filename", [filename])); + downloadPdfURL = _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(), defaultParams); + return _context26.abrupt("return", downloadPdfURL); + + case 10: + case "end": + return _context26.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "downloadPDF", + value: function downloadPDF(newspaper, page) { + var _global$getActivePSet13, paperName, issue, pageNumber, url, destinationFilename, destination, resource; + + return _regenerator.default.async(function downloadPDF$(_context27) { + while (1) { + switch (_context27.prev = _context27.next) { + case 0: + _context27.prev = 0; + _global$getActivePSet13 = global.getActivePSetup(), paperName = _global$getActivePSet13.paperName; + paperName = _newsmemoryUtils.default.normalizePaperName(paperName); + issue = newspaper.getIssue(); + pageNumber = _pageUtils.default.removeZerosFromPageNumber(page.getPage()); + _context27.next = 7; + return _regenerator.default.awrap(NewsmemoryAJAX.getDownloadPdfUrl(newspaper, page)); + + case 7: + url = _context27.sent; + destinationFilename = paperName + "_" + issue + "_" + pageNumber + ".pdf"; + destination = _tecnaviaFileUtils.default.getDownloadedPdfDirectory() + "/" + destinationFilename; + _context27.next = 12; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(destination)); + + case 12: + if (_context27.sent) { + _context27.next = 18; + break; + } + + _context27.next = 15; + return _regenerator.default.awrap(_downloadUtils.default.downloadResourceInFolder(url, _tecnaviaFileUtils.default.getDownloadedPdfDirectory() + "/", destinationFilename)); + + case 15: + resource = _context27.sent; + _context27.next = 19; + break; + + case 18: + resource = destination; + + case 19: + return _context27.abrupt("return", { + path: resource, + name: destinationFilename, + url: url + }); + + case 22: + _context27.prev = 22; + _context27.t0 = _context27["catch"](0); + throw _context27.t0; + + case 25: + case "end": + return _context27.stop(); + } + } + }, null, null, [[0, 22]], Promise); + } + }, { + key: "uploadSessionReport", + value: function uploadSessionReport(sessionId, session) { + var _global$getActivePSet14, sessionUploadBaseURL, baseUrl, report; + + return _regenerator.default.async(function uploadSessionReport$(_context28) { + while (1) { + switch (_context28.prev = _context28.next) { + case 0: + _context28.prev = 0; + _global$getActivePSet14 = global.getActivePSetup(), sessionUploadBaseURL = _global$getActivePSet14.sessionUploadBaseURL; + baseUrl = sessionUploadBaseURL || NewsmemoryAJAX.baseUrl(); + report = JSON.stringify(session.getReport()); + _context28.next = 6; + return _regenerator.default.awrap(NewsmemoryAJAX.post(baseUrl, { + action: "uploadSessionReport" + }, { + sessionId: sessionId, + report: report + })); + + case 6: + return _context28.abrupt("return", true); + + case 9: + _context28.prev = 9; + _context28.t0 = _context28["catch"](0); + + case 11: + return _context28.abrupt("return", false); + + case 12: + case "end": + return _context28.stop(); + } + } + }, null, null, [[0, 9]], Promise); + } + }, { + key: "getVideoURL", + value: function getVideoURL(videoURL) { + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeArea(), + width = _DeviceUtils$getSafeA.width, + height = _DeviceUtils$getSafeA.height; + + var defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), { + action: "video", + videoURL: _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(videoURL, { + width: Math.min(width, height) + }) + }); + return _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(), defaultParams); + } + }, { + key: "getIubendaCMPBaseURL", + value: function getIubendaCMPBaseURL() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var defaultParams = (0, _extends2.default)({}, _Api.default.getDefaultParams(), NewsmemoryAJAX.getDefaultGETParams(), { + action: "cmp" + }, params); + return _$$_REQUIRE(_dependencyMap[18]).StringUtils.appendParams(NewsmemoryAJAX.baseUrl(), defaultParams); + } + }, { + key: "validateReceipt", + value: function validateReceipt() { + var params, + _global$getActivePSet15, + loginStatus, + TAUID, + _args29 = arguments; + + return _regenerator.default.async(function validateReceipt$(_context29) { + while (1) { + switch (_context29.prev = _context29.next) { + case 0: + params = _args29.length > 0 && _args29[0] !== undefined ? _args29[0] : {}; + _global$getActivePSet15 = global.getActivePSetup(), loginStatus = _global$getActivePSet15.loginStatus; + TAUID = loginStatus.TAUID; + + if (_$$_REQUIRE(_dependencyMap[18]).JSUtils.isNull(params.TAUID) && _$$_REQUIRE(_dependencyMap[21]).LoginStatus.isValidTAUID(TAUID)) { + params.TAUID = TAUID; + } + + return _context29.abrupt("return", _Api.default.validateReceipt(params)); + + case 5: + case "end": + return _context29.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return NewsmemoryAJAX; + }(); + + exports.default = NewsmemoryAJAX; +},430,[5,80,108,6,7,8,431,458,586,574,602,603,710,714,638,715,716,717,462,588,587,721]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.HTTP_CODES = exports.MAX_RETRIES = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _axios = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var instance = _axios.default.create(); + + var TECNAVIA_ENDPOINT = "/default_react_native.php"; + var MAX_RETRIES = 3; + exports.MAX_RETRIES = MAX_RETRIES; + var HTTP_CODES = { + PARTIAL_CONTENT: 206, + UNAUTHORIZED: 401, + INTERNAL_SERVER_ERROR: 500, + NOT_IMPLEMENTED: 501, + BAD_GATEWAY: 502, + SERVICE_UNAVAILABLE: 503, + GATEWAY_TIMEOUT: 504 + }; + exports.HTTP_CODES = HTTP_CODES; + + var API = function () { + function API() { + (0, _classCallCheck2.default)(this, API); + } + + (0, _createClass2.default)(API, null, [{ + key: "setReadAndNetworkTimeouts", + value: function setReadAndNetworkTimeouts(readTimeout, timeout) { + instance.defaults.timeout = timeout; + _tecnaviaFileUtils.default.networkTimeout = timeout; + _tecnaviaFileUtils.default.readTimeout = _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isAndroid() ? readTimeout : timeout; + } + }, { + key: "set2GTimeout", + value: function set2GTimeout() { + API.timeout = API.DEFAULT_CONNECTION_TIMEOUT_2G; + API.readTimeout = API.DEFAULT_READ_TIMEOUT_2G; + API.setReadAndNetworkTimeouts(API.readTimeout, API.timeout); + } + }, { + key: "set3GTimeout", + value: function set3GTimeout() { + API.timeout = API.DEFAULT_CONNECTION_TIMEOUT_3G; + API.readTimeout = API.DEFAULT_READ_TIMEOUT_3G; + API.setReadAndNetworkTimeouts(API.readTimeout, API.timeout); + } + }, { + key: "set4GTimeout", + value: function set4GTimeout() { + API.timeout = API.DEFAULT_CONNECTION_TIMEOUT_4G; + API.readTimeout = API.DEFAULT_READ_TIMEOUT_4G; + API.setReadAndNetworkTimeouts(API.readTimeout, API.timeout); + } + }, { + key: "setTimeout", + value: function setTimeout() { + if (_$$_REQUIRE(_dependencyMap[9]).NetworkUtils.is2G()) { + API.set2GTimeout(); + } else if (_$$_REQUIRE(_dependencyMap[9]).NetworkUtils.is3G()) { + API.set3GTimeout(); + } else if (_$$_REQUIRE(_dependencyMap[9]).NetworkUtils.is4G()) { + API.set4GTimeout(); + } else { + API.set4GTimeout(); + } + } + }, { + key: "getServer", + value: function getServer() { + var server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getAppServer(); + return _$$_REQUIRE(_dependencyMap[9]).NetworkUtils.addDefaultProtocol(server.trim()); + } + }, { + key: "baseUrl", + value: function baseUrl() { + var server = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getAppServer(); + return API.getServer(server).concat(TECNAVIA_ENDPOINT); + } + }, { + key: "getDefaultParams", + value: function getDefaultParams() { + var excludeDeviceParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var excludeUserParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var _global = global, + getAppPSetup = _global.getAppPSetup, + isApiDebug = _global.isApiDebug, + developer = _global.developer; + var developerParams = {}; + + if (isApiDebug) { + developerParams.isDebug = isApiDebug; + developerParams.developer = developer; + } + + return (0, _extends2.default)({ + pSetup: getAppPSetup() + }, excludeUserParams ? {} : API.getUserParams(), excludeDeviceParams ? {} : API.getDeviceParams(), { + version: _deviceUtils.default.getAppVersion() + }, developerParams); + } + }, { + key: "getUserParams", + value: function getUserParams() { + var _global2 = global, + MACHINEID = _global2.machineId; + return { + MACHINEID: MACHINEID, + t: new Date().getTime() + }; + } + }, { + key: "getDeviceParams", + value: function getDeviceParams() { + return { + os: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isAndroid() ? "android" : "ios", + isEInk: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isEInk() ? 1 : undefined, + isKindle: _deviceUtils.default.isKindle() ? 1 : undefined, + isPhone: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isTablet() ? 0 : 1, + apiVersion: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getSystemSDK() + }; + } + }, { + key: "head", + value: function head(url) { + return _regenerator.default.async(function head$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", instance.head(url)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "ajax", + value: function ajax(url) { + return _regenerator.default.async(function ajax$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", instance.get(url)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "get", + value: function get(url) { + var config, + otherParams, + skipDefaultParams, + headers, + params, + _args3 = arguments; + return _regenerator.default.async(function get$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + config = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {}; + otherParams = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : {}; + skipDefaultParams = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : false; + headers = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : {}; + params = otherParams; + + if (!skipDefaultParams) { + params = (0, _extends2.default)({}, API.getDefaultParams(), params); + } + + _context3.prev = 6; + _context3.next = 9; + return _regenerator.default.awrap(instance.get(url, (0, _extends2.default)({ + headers: (0, _extends2.default)({ + "User-Agent": _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getUserAgent() + }, headers) + }, config, { + params: params, + paramsSerializer: _$$_REQUIRE(_dependencyMap[9]).StringUtils.getQuerystring + }))); + + case 9: + return _context3.abrupt("return", _context3.sent); + + case 12: + _context3.prev = 12; + _context3.t0 = _context3["catch"](6); + throw _context3.t0; + + case 15: + case "end": + return _context3.stop(); + } + } + }, null, null, [[6, 12]], Promise); + } + }, { + key: "post", + value: function post(url) { + var config, + otherParams, + skipDefaultParams, + headers, + data, + queryString, + _args4 = arguments; + return _regenerator.default.async(function post$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + config = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : {}; + otherParams = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : {}; + skipDefaultParams = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : false; + headers = _args4.length > 4 && _args4[4] !== undefined ? _args4[4] : {}; + data = otherParams; + + if (!skipDefaultParams) { + data = (0, _extends2.default)({}, API.getDefaultParams(), data); + } + + queryString = _$$_REQUIRE(_dependencyMap[9]).StringUtils.getQuerystring(data); + _context4.prev = 7; + _context4.next = 10; + return _regenerator.default.awrap(instance.post(url, queryString, (0, _extends2.default)({ + headers: (0, _extends2.default)({ + Accept: "application/x-www-form-urlencoded", + "User-Agent": _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getUserAgent() + }, headers) + }, config))); + + case 10: + return _context4.abrupt("return", _context4.sent); + + case 13: + _context4.prev = 13; + _context4.t0 = _context4["catch"](7); + throw _context4.t0; + + case 16: + case "end": + return _context4.stop(); + } + } + }, null, null, [[7, 13]], Promise); + } + }, { + key: "remp", + value: function remp(url, params) { + return _regenerator.default.async(function remp$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", API.get(url, {}, params)); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "rssIndex", + value: function rssIndex(_ref) { + var customUrl, pSetup, machine, rest, otherParams; + return _regenerator.default.async(function rssIndex$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + customUrl = _ref.customUrl, pSetup = _ref.pSetup, machine = _ref.machine, rest = (0, _objectWithoutProperties2.default)(_ref, ["customUrl", "pSetup", "machine"]); + otherParams = {}; + + if (!customUrl) { + otherParams = (0, _extends2.default)({ + action: "RSSindex", + pSetup: pSetup + }, rest); + } + + return _context6.abrupt("return", API.get(customUrl || API.baseUrl(machine), { + responseType: "text" + }, otherParams)); + + case 4: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getWithParams", + value: function getWithParams(params) { + var config, + machine, + skipDefaultParams, + _args7 = arguments; + return _regenerator.default.async(function getWithParams$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + config = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {}; + machine = _args7.length > 2 ? _args7[2] : undefined; + skipDefaultParams = _args7.length > 3 && _args7[3] !== undefined ? _args7[3] : false; + return _context7.abrupt("return", API.get(API.baseUrl(machine), config, params, skipDefaultParams)); + + case 4: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "cities", + value: function cities(_ref2) { + var wording; + return _regenerator.default.async(function cities$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + wording = _ref2.wording; + return _context8.abrupt("return", API.getWithParams({ + action: "utilscities", + wording: wording + })); + + case 2: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "closestCities", + value: function closestCities(_ref3) { + var lat, lon; + return _regenerator.default.async(function closestCities$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + lat = _ref3.lat, lon = _ref3.lon; + return _context9.abrupt("return", API.getWithParams({ + action: "utilsclosestcity", + lat: lat, + lon: lon + })); + + case 2: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "deleteDeviceToPushServer", + value: function deleteDeviceToPushServer(_ref4) { + var token, rest; + return _regenerator.default.async(function deleteDeviceToPushServer$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + token = _ref4.token, rest = (0, _objectWithoutProperties2.default)(_ref4, ["token"]); + return _context10.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "push_deletion_service", + package_id: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getPackagedId(), + reg_id: token + }, rest))); + + case 2: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "registerDeviceToPushServer", + value: function registerDeviceToPushServer(_ref5) { + var token, rest; + return _regenerator.default.async(function registerDeviceToPushServer$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + token = _ref5.token, rest = (0, _objectWithoutProperties2.default)(_ref5, ["token"]); + return _context11.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "push_registration_service", + package_id: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getPackagedId(), + reg_id: token + }, rest))); + + case 2: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "notices", + value: function notices() { + var _ref6, + machine, + rest, + _args12 = arguments; + + return _regenerator.default.async(function notices$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + _ref6 = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {}, machine = _ref6.machine, rest = (0, _objectWithoutProperties2.default)(_ref6, ["machine"]); + return _context12.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "advertisements" + }, rest), {}, machine)); + + case 2: + case "end": + return _context12.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "noticeURI", + value: function noticeURI() { + var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + machine = _ref7.machine, + rest = (0, _objectWithoutProperties2.default)(_ref7, ["machine"]); + + return _$$_REQUIRE(_dependencyMap[9]).StringUtils.appendParams(API.baseUrl(machine), (0, _extends2.default)({}, API.getDefaultParams(), { + action: "notices" + }, rest)); + } + }, { + key: "sslCertificatesURI", + value: function sslCertificatesURI() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var cdnServer = arguments.length > 1 ? arguments[1] : undefined; + var excludeParams = cdnServer ? true : false; + return _$$_REQUIRE(_dependencyMap[9]).StringUtils.appendParams(API.baseUrl(cdnServer), (0, _extends2.default)({}, API.getDefaultParams(excludeParams, excludeParams), params, { + os: "android", + action: "certificates" + })); + } + }, { + key: "pSetup", + value: function pSetup(_ref8) { + var machine, rest; + return _regenerator.default.async(function pSetup$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + machine = _ref8.machine, rest = (0, _objectWithoutProperties2.default)(_ref8, ["machine"]); + return _context13.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "message", + bundleVersion: _deviceUtils.default.getBundleVersion(), + version: _deviceUtils.default.getAppVersion(), + inches: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getScreenInches(), + device: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getDeviceId() + }, rest), { + responseType: "text" + }, machine)); + + case 2: + case "end": + return _context13.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getBundleDownloadUrl", + value: function getBundleDownloadUrl() { + var defaultParams = API.getDefaultParams(); + defaultParams.action = "getBundle"; + defaultParams.bundleVersion = _deviceUtils.default.getBundleVersion(); + return _$$_REQUIRE(_dependencyMap[9]).StringUtils.appendParams(API.baseUrl(), defaultParams); + } + }, { + key: "customLanguagePack", + value: function customLanguagePack(_ref9) { + var machine, rest; + return _regenerator.default.async(function customLanguagePack$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + machine = _ref9.machine, rest = (0, _objectWithoutProperties2.default)(_ref9, ["machine"]); + return _context14.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "locale" + }, rest), {}, machine)); + + case 2: + case "end": + return _context14.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "customFonts", + value: function customFonts(_ref10) { + var machine, rest; + return _regenerator.default.async(function customFonts$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + machine = _ref10.machine, rest = (0, _objectWithoutProperties2.default)(_ref10, ["machine"]); + return _context15.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "fonts" + }, rest), {}, machine)); + + case 2: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "checkConfigUpdate", + value: function checkConfigUpdate(_ref11) { + var machine, rest; + return _regenerator.default.async(function checkConfigUpdate$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + machine = _ref11.machine, rest = (0, _objectWithoutProperties2.default)(_ref11, ["machine"]); + return _context16.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "checkconfigupdate" + }, rest), {}, machine)); + + case 2: + case "end": + return _context16.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getConfig", + value: function getConfig(_ref12) { + var machine, rest; + return _regenerator.default.async(function getConfig$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + machine = _ref12.machine, rest = (0, _objectWithoutProperties2.default)(_ref12, ["machine"]); + return _context17.abrupt("return", API.getWithParams((0, _extends2.default)({ + action: "config" + }, rest), {}, machine)); + + case 2: + case "end": + return _context17.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getAppStoreMetadata", + value: function getAppStoreMetadata() { + return _regenerator.default.async(function getAppStoreMetadata$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + return _context18.abrupt("return", API.getWithParams({ + action: "appstoremetadata", + bundleId: _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.getPackagedId() + })); + + case 1: + case "end": + return _context18.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getGoogleAccessToken", + value: function getGoogleAccessToken() { + return _regenerator.default.async(function getGoogleAccessToken$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + return _context19.abrupt("return", API.getWithParams({ + action: "getGoogleToken" + })); + + case 1: + case "end": + return _context19.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "validateReceipt", + value: function validateReceipt() { + var params, + _args20 = arguments; + return _regenerator.default.async(function validateReceipt$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + params = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {}; + return _context20.abrupt("return", API.post(_$$_REQUIRE(_dependencyMap[9]).StringUtils.appendParams(API.baseUrl(), (0, _extends2.default)({}, API.getDefaultParams(), { + action: "validatereceipt" + })), {}, params, true)); + + case 2: + case "end": + return _context20.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getMaster", + value: function getMaster() { + var server = global.getAppServer(); + + if (_$$_REQUIRE(_dependencyMap[9]).StringUtils.isTecnaviaDomain(server)) { + var splitted = server.replace(/https?:\/\//, "").split(/(?:-|\.)(?!com)/); + + if (splitted.length > 3) { + if (splitted.length === 5) { + splitted.splice(0, 1); + } + + splitted[0] = "server"; + + if (splitted.length === 4) { + splitted[3] = "admin." + splitted[3]; + splitted.splice(2, 1); + } + + server = splitted.join(global.isHTTPS() ? "-" : "."); + } + } + + return server; + } + }, { + key: "sendLogToServer", + value: function sendLogToServer() { + var url; + return _regenerator.default.async(function sendLogToServer$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + url = _$$_REQUIRE(_dependencyMap[9]).StringUtils.appendParams(API.baseUrl(API.getMaster()), (0, _extends2.default)({}, API.getDefaultParams(), { + action: "upload_log" + })); + _context21.prev = 1; + _context21.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.post(url, { + name: "uploadedfile", + filename: _$$_REQUIRE(_dependencyMap[9]).Logger.logSessionFileName, + type: "text/plain", + data: _tecnaviaFileUtils.default.wrap(_$$_REQUIRE(_dependencyMap[10]).LOG_BASE_PATH + "/" + _$$_REQUIRE(_dependencyMap[9]).Logger.logSessionFileName) + })); + + case 4: + return _context21.abrupt("return", true); + + case 7: + _context21.prev = 7; + _context21.t0 = _context21["catch"](1); + return _context21.abrupt("return", false); + + case 10: + case "end": + return _context21.stop(); + } + } + }, null, null, [[1, 7]], Promise); + } + }, { + key: "sendLog", + value: function sendLog() { + var result; + return _regenerator.default.async(function sendLog$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + _context22.next = 2; + return _regenerator.default.awrap(API.sendLogToServer()); + + case 2: + result = _context22.sent; + _context22.next = 5; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[9]).Logger.deleteLogFile()); + + case 5: + _context22.next = 7; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[9]).Logger.createNewSessionLog()); + + case 7: + return _context22.abrupt("return", result); + + case 8: + case "end": + return _context22.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "requestWithRetry", + value: function requestWithRetry(_ref13) { + var request, + onRetry, + _ref13$maxRetries, + maxRetries, + result, + retries, + _len, + args, + _key, + response, + _args23 = arguments; + + return _regenerator.default.async(function requestWithRetry$(_context23) { + while (1) { + switch (_context23.prev = _context23.next) { + case 0: + request = _ref13.request, onRetry = _ref13.onRetry, _ref13$maxRetries = _ref13.maxRetries, maxRetries = _ref13$maxRetries === undefined ? MAX_RETRIES : _ref13$maxRetries; + retries = 0; + + for (_len = _args23.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = _args23[_key]; + } + + case 3: + _context23.prev = 3; + + if (retries > 0) { + if (onRetry) { + onRetry(retries, maxRetries); + } + } + + _context23.next = 7; + return _regenerator.default.awrap(request.apply(undefined, args)); + + case 7: + response = _context23.sent; + result = response.data; + _context23.next = 15; + break; + + case 11: + _context23.prev = 11; + _context23.t0 = _context23["catch"](3); + + if (!(_context23.t0.response && _context23.t0.response.status === HTTP_CODES.UNAUTHORIZED)) { + _context23.next = 15; + break; + } + + throw _context23.t0; + + case 15: + retries += 1; + + case 16: + if (!result && retries < maxRetries) { + _context23.next = 3; + break; + } + + case 17: + return _context23.abrupt("return", result); + + case 18: + case "end": + return _context23.stop(); + } + } + }, null, null, [[3, 11]], Promise); + } + }]); + return API; + }(); + + exports.default = API; + API.DEFAULT_CONNECTION_TIMEOUT_2G = 60000; + API.DEFAULT_CONNECTION_TIMEOUT_3G = 30000; + API.DEFAULT_CONNECTION_TIMEOUT_4G = 15000; + API.DEFAULT_READ_TIMEOUT_2G = 240000; + API.DEFAULT_READ_TIMEOUT_3G = 120000; + API.DEFAULT_READ_TIMEOUT_4G = 60000; + API.timeout = 0; + API.readTimeout = 0; +},431,[5,80,108,6,7,8,432,458,574,462,543]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]); +},432,[433]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function createInstance(defaultConfig) { + var context = new (_$$_REQUIRE(_dependencyMap[0]))(defaultConfig); + + var instance = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[0]).prototype.request, context); + + _$$_REQUIRE(_dependencyMap[2]).extend(instance, _$$_REQUIRE(_dependencyMap[0]).prototype, context); + + _$$_REQUIRE(_dependencyMap[2]).extend(instance, context); + + return instance; + } + + var axios = createInstance(_$$_REQUIRE(_dependencyMap[3])); + axios.Axios = _$$_REQUIRE(_dependencyMap[0]); + + axios.create = function create(instanceConfig) { + return createInstance(_$$_REQUIRE(_dependencyMap[4])(axios.defaults, instanceConfig)); + }; + + axios.Cancel = _$$_REQUIRE(_dependencyMap[5]); + axios.CancelToken = _$$_REQUIRE(_dependencyMap[6]); + axios.isCancel = _$$_REQUIRE(_dependencyMap[7]); + + axios.all = function all(promises) { + return Promise.all(promises); + }; + + axios.spread = _$$_REQUIRE(_dependencyMap[8]); + module.exports = axios; + module.exports.default = axios; +},433,[434,437,436,441,438,455,456,454,457]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function Axios(instanceConfig) { + this.defaults = instanceConfig; + this.interceptors = { + request: new (_$$_REQUIRE(_dependencyMap[0]))(), + response: new (_$$_REQUIRE(_dependencyMap[0]))() + }; + } + + Axios.prototype.request = function request(config) { + if (typeof config === 'string') { + config = arguments[1] || {}; + config.url = arguments[0]; + } else { + config = config || {}; + } + + config = _$$_REQUIRE(_dependencyMap[1])(this.defaults, config); + + if (config.method) { + config.method = config.method.toLowerCase(); + } else if (this.defaults.method) { + config.method = this.defaults.method.toLowerCase(); + } else { + config.method = 'get'; + } + + var chain = [_$$_REQUIRE(_dependencyMap[2]), undefined]; + var promise = Promise.resolve(config); + this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { + chain.unshift(interceptor.fulfilled, interceptor.rejected); + }); + this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { + chain.push(interceptor.fulfilled, interceptor.rejected); + }); + + while (chain.length) { + promise = promise.then(chain.shift(), chain.shift()); + } + + return promise; + }; + + Axios.prototype.getUri = function getUri(config) { + config = _$$_REQUIRE(_dependencyMap[1])(this.defaults, config); + return _$$_REQUIRE(_dependencyMap[3])(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); + }; + + _$$_REQUIRE(_dependencyMap[4]).forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { + Axios.prototype[method] = function (url, config) { + return this.request(_$$_REQUIRE(_dependencyMap[4]).merge(config || {}, { + method: method, + url: url + })); + }; + }); + + _$$_REQUIRE(_dependencyMap[4]).forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + Axios.prototype[method] = function (url, data, config) { + return this.request(_$$_REQUIRE(_dependencyMap[4]).merge(config || {}, { + method: method, + url: url, + data: data + })); + }; + }); + + module.exports = Axios; +},434,[435,438,439,446,436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function InterceptorManager() { + this.handlers = []; + } + + InterceptorManager.prototype.use = function use(fulfilled, rejected) { + this.handlers.push({ + fulfilled: fulfilled, + rejected: rejected + }); + return this.handlers.length - 1; + }; + + InterceptorManager.prototype.eject = function eject(id) { + if (this.handlers[id]) { + this.handlers[id] = null; + } + }; + + InterceptorManager.prototype.forEach = function forEach(fn) { + _$$_REQUIRE(_dependencyMap[0]).forEach(this.handlers, function forEachHandler(h) { + if (h !== null) { + fn(h); + } + }); + }; + + module.exports = InterceptorManager; +},435,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var toString = Object.prototype.toString; + + function isArray(val) { + return toString.call(val) === '[object Array]'; + } + + function isUndefined(val) { + return typeof val === 'undefined'; + } + + function isBuffer(val) { + return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); + } + + function isArrayBuffer(val) { + return toString.call(val) === '[object ArrayBuffer]'; + } + + function isFormData(val) { + return typeof FormData !== 'undefined' && val instanceof FormData; + } + + function isArrayBufferView(val) { + var result; + + if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { + result = ArrayBuffer.isView(val); + } else { + result = val && val.buffer && val.buffer instanceof ArrayBuffer; + } + + return result; + } + + function isString(val) { + return typeof val === 'string'; + } + + function isNumber(val) { + return typeof val === 'number'; + } + + function isObject(val) { + return val !== null && typeof val === 'object'; + } + + function isDate(val) { + return toString.call(val) === '[object Date]'; + } + + function isFile(val) { + return toString.call(val) === '[object File]'; + } + + function isBlob(val) { + return toString.call(val) === '[object Blob]'; + } + + function isFunction(val) { + return toString.call(val) === '[object Function]'; + } + + function isStream(val) { + return isObject(val) && isFunction(val.pipe); + } + + function isURLSearchParams(val) { + return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; + } + + function trim(str) { + return str.replace(/^\s*/, '').replace(/\s*$/, ''); + } + + function isStandardBrowserEnv() { + if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) { + return false; + } + + return typeof window !== 'undefined' && typeof document !== 'undefined'; + } + + function forEach(obj, fn) { + if (obj === null || typeof obj === 'undefined') { + return; + } + + if (typeof obj !== 'object') { + obj = [obj]; + } + + if (isArray(obj)) { + for (var i = 0, l = obj.length; i < l; i++) { + fn.call(null, obj[i], i, obj); + } + } else { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + fn.call(null, obj[key], key, obj); + } + } + } + } + + function merge() { + var result = {}; + + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = merge(result[key], val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + + return result; + } + + function deepMerge() { + var result = {}; + + function assignValue(val, key) { + if (typeof result[key] === 'object' && typeof val === 'object') { + result[key] = deepMerge(result[key], val); + } else if (typeof val === 'object') { + result[key] = deepMerge({}, val); + } else { + result[key] = val; + } + } + + for (var i = 0, l = arguments.length; i < l; i++) { + forEach(arguments[i], assignValue); + } + + return result; + } + + function extend(a, b, thisArg) { + forEach(b, function assignValue(val, key) { + if (thisArg && typeof val === 'function') { + a[key] = _$$_REQUIRE(_dependencyMap[0])(val, thisArg); + } else { + a[key] = val; + } + }); + return a; + } + + module.exports = { + isArray: isArray, + isArrayBuffer: isArrayBuffer, + isBuffer: isBuffer, + isFormData: isFormData, + isArrayBufferView: isArrayBufferView, + isString: isString, + isNumber: isNumber, + isObject: isObject, + isUndefined: isUndefined, + isDate: isDate, + isFile: isFile, + isBlob: isBlob, + isFunction: isFunction, + isStream: isStream, + isURLSearchParams: isURLSearchParams, + isStandardBrowserEnv: isStandardBrowserEnv, + forEach: forEach, + merge: merge, + deepMerge: deepMerge, + extend: extend, + trim: trim + }; +},436,[437]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function bind(fn, thisArg) { + return function wrap() { + var args = new Array(arguments.length); + + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + + return fn.apply(thisArg, args); + }; + }; +},437,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function mergeConfig(config1, config2) { + config2 = config2 || {}; + var config = {}; + var valueFromConfig2Keys = ['url', 'method', 'params', 'data']; + var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy']; + var defaultToConfig2Keys = ['baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer', 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken', 'socketPath']; + + _$$_REQUIRE(_dependencyMap[0]).forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { + if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } + }); + + _$$_REQUIRE(_dependencyMap[0]).forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) { + if (_$$_REQUIRE(_dependencyMap[0]).isObject(config2[prop])) { + config[prop] = _$$_REQUIRE(_dependencyMap[0]).deepMerge(config1[prop], config2[prop]); + } else if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } else if (_$$_REQUIRE(_dependencyMap[0]).isObject(config1[prop])) { + config[prop] = _$$_REQUIRE(_dependencyMap[0]).deepMerge(config1[prop]); + } else if (typeof config1[prop] !== 'undefined') { + config[prop] = config1[prop]; + } + }); + + _$$_REQUIRE(_dependencyMap[0]).forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { + if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } else if (typeof config1[prop] !== 'undefined') { + config[prop] = config1[prop]; + } + }); + + var axiosKeys = valueFromConfig2Keys.concat(mergeDeepPropertiesKeys).concat(defaultToConfig2Keys); + var otherKeys = Object.keys(config2).filter(function filterAxiosKeys(key) { + return axiosKeys.indexOf(key) === -1; + }); + + _$$_REQUIRE(_dependencyMap[0]).forEach(otherKeys, function otherKeysDefaultToConfig2(prop) { + if (typeof config2[prop] !== 'undefined') { + config[prop] = config2[prop]; + } else if (typeof config1[prop] !== 'undefined') { + config[prop] = config1[prop]; + } + }); + + return config; + }; +},438,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function throwIfCancellationRequested(config) { + if (config.cancelToken) { + config.cancelToken.throwIfRequested(); + } + } + + module.exports = function dispatchRequest(config) { + throwIfCancellationRequested(config); + config.headers = config.headers || {}; + config.data = _$$_REQUIRE(_dependencyMap[0])(config.data, config.headers, config.transformRequest); + config.headers = _$$_REQUIRE(_dependencyMap[1]).merge(config.headers.common || {}, config.headers[config.method] || {}, config.headers); + + _$$_REQUIRE(_dependencyMap[1]).forEach(['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], function cleanHeaderConfig(method) { + delete config.headers[method]; + }); + + var adapter = config.adapter || _$$_REQUIRE(_dependencyMap[2]).adapter; + + return adapter(config).then(function onAdapterResolution(response) { + throwIfCancellationRequested(config); + response.data = _$$_REQUIRE(_dependencyMap[0])(response.data, response.headers, config.transformResponse); + return response; + }, function onAdapterRejection(reason) { + if (!_$$_REQUIRE(_dependencyMap[3])(reason)) { + throwIfCancellationRequested(config); + + if (reason && reason.response) { + reason.response.data = _$$_REQUIRE(_dependencyMap[0])(reason.response.data, reason.response.headers, config.transformResponse); + } + } + + return Promise.reject(reason); + }); + }; +},439,[440,436,441,454]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function transformData(data, headers, fns) { + _$$_REQUIRE(_dependencyMap[0]).forEach(fns, function transform(fn) { + data = fn(data, headers); + }); + + return data; + }; +},440,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var DEFAULT_CONTENT_TYPE = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + + function setContentTypeIfUnset(headers, value) { + if (!_$$_REQUIRE(_dependencyMap[0]).isUndefined(headers) && _$$_REQUIRE(_dependencyMap[0]).isUndefined(headers['Content-Type'])) { + headers['Content-Type'] = value; + } + } + + function getDefaultAdapter() { + var adapter; + + if (typeof XMLHttpRequest !== 'undefined') { + adapter = _$$_REQUIRE(_dependencyMap[1]); + } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { + adapter = _$$_REQUIRE(_dependencyMap[2]); + } + + return adapter; + } + + var defaults = { + adapter: getDefaultAdapter(), + transformRequest: [function transformRequest(data, headers) { + _$$_REQUIRE(_dependencyMap[3])(headers, 'Accept'); + + _$$_REQUIRE(_dependencyMap[3])(headers, 'Content-Type'); + + if (_$$_REQUIRE(_dependencyMap[0]).isFormData(data) || _$$_REQUIRE(_dependencyMap[0]).isArrayBuffer(data) || _$$_REQUIRE(_dependencyMap[0]).isBuffer(data) || _$$_REQUIRE(_dependencyMap[0]).isStream(data) || _$$_REQUIRE(_dependencyMap[0]).isFile(data) || _$$_REQUIRE(_dependencyMap[0]).isBlob(data)) { + return data; + } + + if (_$$_REQUIRE(_dependencyMap[0]).isArrayBufferView(data)) { + return data.buffer; + } + + if (_$$_REQUIRE(_dependencyMap[0]).isURLSearchParams(data)) { + setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); + return data.toString(); + } + + if (_$$_REQUIRE(_dependencyMap[0]).isObject(data)) { + setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); + return JSON.stringify(data); + } + + return data; + }], + transformResponse: [function transformResponse(data) { + if (typeof data === 'string') { + try { + data = JSON.parse(data); + } catch (e) {} + } + + return data; + }], + timeout: 0, + xsrfCookieName: 'XSRF-TOKEN', + xsrfHeaderName: 'X-XSRF-TOKEN', + maxContentLength: -1, + validateStatus: function validateStatus(status) { + return status >= 200 && status < 300; + } + }; + defaults.headers = { + common: { + 'Accept': 'application/json, text/plain, */*' + } + }; + + _$$_REQUIRE(_dependencyMap[0]).forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { + defaults.headers[method] = {}; + }); + + _$$_REQUIRE(_dependencyMap[0]).forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { + defaults.headers[method] = _$$_REQUIRE(_dependencyMap[0]).merge(DEFAULT_CONTENT_TYPE); + }); + + module.exports = defaults; +},441,[436,442,442,453]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function xhrAdapter(config) { + return new Promise(function dispatchXhrRequest(resolve, reject) { + var requestData = config.data; + var requestHeaders = config.headers; + + if (_$$_REQUIRE(_dependencyMap[0]).isFormData(requestData)) { + delete requestHeaders['Content-Type']; + } + + var request = new XMLHttpRequest(); + + if (config.auth) { + var username = config.auth.username || ''; + var password = config.auth.password || ''; + requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); + } + + var fullPath = _$$_REQUIRE(_dependencyMap[1])(config.baseURL, config.url); + + request.open(config.method.toUpperCase(), _$$_REQUIRE(_dependencyMap[2])(fullPath, config.params, config.paramsSerializer), true); + request.timeout = config.timeout; + + request.onreadystatechange = function handleLoad() { + if (!request || request.readyState !== 4) { + return; + } + + if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { + return; + } + + var responseHeaders = 'getAllResponseHeaders' in request ? _$$_REQUIRE(_dependencyMap[3])(request.getAllResponseHeaders()) : null; + var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; + var response = { + data: responseData, + status: request.status, + statusText: request.statusText, + headers: responseHeaders, + config: config, + request: request + }; + + _$$_REQUIRE(_dependencyMap[4])(resolve, reject, response); + + request = null; + }; + + request.onabort = function handleAbort() { + if (!request) { + return; + } + + reject(_$$_REQUIRE(_dependencyMap[5])('Request aborted', config, 'ECONNABORTED', request)); + request = null; + }; + + request.onerror = function handleError() { + reject(_$$_REQUIRE(_dependencyMap[5])('Network Error', config, null, request)); + request = null; + }; + + request.ontimeout = function handleTimeout() { + var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; + + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; + } + + reject(_$$_REQUIRE(_dependencyMap[5])(timeoutErrorMessage, config, 'ECONNABORTED', request)); + request = null; + }; + + if (_$$_REQUIRE(_dependencyMap[0]).isStandardBrowserEnv()) { + var cookies = _$$_REQUIRE(_dependencyMap[6]); + + var xsrfValue = (config.withCredentials || _$$_REQUIRE(_dependencyMap[7])(fullPath)) && config.xsrfCookieName ? cookies.read(config.xsrfCookieName) : undefined; + + if (xsrfValue) { + requestHeaders[config.xsrfHeaderName] = xsrfValue; + } + } + + if ('setRequestHeader' in request) { + _$$_REQUIRE(_dependencyMap[0]).forEach(requestHeaders, function setRequestHeader(val, key) { + if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { + delete requestHeaders[key]; + } else { + request.setRequestHeader(key, val); + } + }); + } + + if (!_$$_REQUIRE(_dependencyMap[0]).isUndefined(config.withCredentials)) { + request.withCredentials = !!config.withCredentials; + } + + if (config.responseType) { + try { + request.responseType = config.responseType; + } catch (e) { + if (config.responseType !== 'json') { + throw e; + } + } + } + + if (typeof config.onDownloadProgress === 'function') { + request.addEventListener('progress', config.onDownloadProgress); + } + + if (typeof config.onUploadProgress === 'function' && request.upload) { + request.upload.addEventListener('progress', config.onUploadProgress); + } + + if (config.cancelToken) { + config.cancelToken.promise.then(function onCanceled(cancel) { + if (!request) { + return; + } + + request.abort(); + reject(cancel); + request = null; + }); + } + + if (requestData === undefined) { + requestData = null; + } + + request.send(requestData); + }); + }; +},442,[436,443,446,447,448,449,451,452]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function buildFullPath(baseURL, requestedURL) { + if (baseURL && !_$$_REQUIRE(_dependencyMap[0])(requestedURL)) { + return _$$_REQUIRE(_dependencyMap[1])(baseURL, requestedURL); + } + + return requestedURL; + }; +},443,[444,445]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function isAbsoluteURL(url) { + return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); + }; +},444,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') : baseURL; + }; +},445,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function encode(val) { + return encodeURIComponent(val).replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']'); + } + + module.exports = function buildURL(url, params, paramsSerializer) { + if (!params) { + return url; + } + + var serializedParams; + + if (paramsSerializer) { + serializedParams = paramsSerializer(params); + } else if (_$$_REQUIRE(_dependencyMap[0]).isURLSearchParams(params)) { + serializedParams = params.toString(); + } else { + var parts = []; + + _$$_REQUIRE(_dependencyMap[0]).forEach(params, function serialize(val, key) { + if (val === null || typeof val === 'undefined') { + return; + } + + if (_$$_REQUIRE(_dependencyMap[0]).isArray(val)) { + key = key + '[]'; + } else { + val = [val]; + } + + _$$_REQUIRE(_dependencyMap[0]).forEach(val, function parseValue(v) { + if (_$$_REQUIRE(_dependencyMap[0]).isDate(v)) { + v = v.toISOString(); + } else if (_$$_REQUIRE(_dependencyMap[0]).isObject(v)) { + v = JSON.stringify(v); + } + + parts.push(encode(key) + '=' + encode(v)); + }); + }); + + serializedParams = parts.join('&'); + } + + if (serializedParams) { + var hashmarkIndex = url.indexOf('#'); + + if (hashmarkIndex !== -1) { + url = url.slice(0, hashmarkIndex); + } + + url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; + } + + return url; + }; +},446,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var ignoreDuplicateOf = ['age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent']; + + module.exports = function parseHeaders(headers) { + var parsed = {}; + var key; + var val; + var i; + + if (!headers) { + return parsed; + } + + _$$_REQUIRE(_dependencyMap[0]).forEach(headers.split('\n'), function parser(line) { + i = line.indexOf(':'); + key = _$$_REQUIRE(_dependencyMap[0]).trim(line.substr(0, i)).toLowerCase(); + val = _$$_REQUIRE(_dependencyMap[0]).trim(line.substr(i + 1)); + + if (key) { + if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { + return; + } + + if (key === 'set-cookie') { + parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); + } else { + parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; + } + } + }); + + return parsed; + }; +},447,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function settle(resolve, reject, response) { + var validateStatus = response.config.validateStatus; + + if (!validateStatus || validateStatus(response.status)) { + resolve(response); + } else { + reject(_$$_REQUIRE(_dependencyMap[0])('Request failed with status code ' + response.status, response.config, null, response.request, response)); + } + }; +},448,[449]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function createError(message, config, code, request, response) { + var error = new Error(message); + return _$$_REQUIRE(_dependencyMap[0])(error, config, code, request, response); + }; +},449,[450]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function enhanceError(error, config, code, request, response) { + error.config = config; + + if (code) { + error.code = code; + } + + error.request = request; + error.response = response; + error.isAxiosError = true; + + error.toJSON = function () { + return { + message: this.message, + name: this.name, + description: this.description, + number: this.number, + fileName: this.fileName, + lineNumber: this.lineNumber, + columnNumber: this.columnNumber, + stack: this.stack, + config: this.config, + code: this.code + }; + }; + + return error; + }; +},450,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]).isStandardBrowserEnv() ? function standardBrowserEnv() { + return { + write: function write(name, value, expires, path, domain, secure) { + var cookie = []; + cookie.push(name + '=' + encodeURIComponent(value)); + + if (_$$_REQUIRE(_dependencyMap[0]).isNumber(expires)) { + cookie.push('expires=' + new Date(expires).toGMTString()); + } + + if (_$$_REQUIRE(_dependencyMap[0]).isString(path)) { + cookie.push('path=' + path); + } + + if (_$$_REQUIRE(_dependencyMap[0]).isString(domain)) { + cookie.push('domain=' + domain); + } + + if (secure === true) { + cookie.push('secure'); + } + + document.cookie = cookie.join('; '); + }, + read: function read(name) { + var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); + return match ? decodeURIComponent(match[3]) : null; + }, + remove: function remove(name) { + this.write(name, '', Date.now() - 86400000); + } + }; + }() : function nonStandardBrowserEnv() { + return { + write: function write() {}, + read: function read() { + return null; + }, + remove: function remove() {} + }; + }(); +},451,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = _$$_REQUIRE(_dependencyMap[0]).isStandardBrowserEnv() ? function standardBrowserEnv() { + var msie = /(msie|trident)/i.test(navigator.userAgent); + var urlParsingNode = document.createElement('a'); + var originURL; + + function resolveURL(url) { + var href = url; + + if (msie) { + urlParsingNode.setAttribute('href', href); + href = urlParsingNode.href; + } + + urlParsingNode.setAttribute('href', href); + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === '/' ? urlParsingNode.pathname : '/' + urlParsingNode.pathname + }; + } + + originURL = resolveURL(window.location.href); + return function isURLSameOrigin(requestURL) { + var parsed = _$$_REQUIRE(_dependencyMap[0]).isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() : function nonStandardBrowserEnv() { + return function isURLSameOrigin() { + return true; + }; + }(); +},452,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function normalizeHeaderName(headers, normalizedName) { + _$$_REQUIRE(_dependencyMap[0]).forEach(headers, function processHeader(value, name) { + if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { + headers[normalizedName] = value; + delete headers[name]; + } + }); + }; +},453,[436]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function isCancel(value) { + return !!(value && value.__CANCEL__); + }; +},454,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function Cancel(message) { + this.message = message; + } + + Cancel.prototype.toString = function toString() { + return 'Cancel' + (this.message ? ': ' + this.message : ''); + }; + + Cancel.prototype.__CANCEL__ = true; + module.exports = Cancel; +},455,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function CancelToken(executor) { + if (typeof executor !== 'function') { + throw new TypeError('executor must be a function.'); + } + + var resolvePromise; + this.promise = new Promise(function promiseExecutor(resolve) { + resolvePromise = resolve; + }); + var token = this; + executor(function cancel(message) { + if (token.reason) { + return; + } + + token.reason = new (_$$_REQUIRE(_dependencyMap[0]))(message); + resolvePromise(token.reason); + }); + } + + CancelToken.prototype.throwIfRequested = function throwIfRequested() { + if (this.reason) { + throw this.reason; + } + }; + + CancelToken.source = function source() { + var cancel; + var token = new CancelToken(function executor(c) { + cancel = c; + }); + return { + token: token, + cancel: cancel + }; + }; + + module.exports = CancelToken; +},456,[455]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + module.exports = function spread(callback) { + return function wrap(arr) { + return callback.apply(null, arr); + }; + }; +},457,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _reactNativeIdleTimer = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var DeviceUtils = function () { + function DeviceUtils() { + (0, _classCallCheck2.default)(this, DeviceUtils); + } + + (0, _createClass2.default)(DeviceUtils, null, [{ + key: "isHuawei", + value: function isHuawei() { + return global.isHuawei; + } + }, { + key: "isKindle", + value: function isKindle() { + return global.isKindle; + } + }, { + key: "getAppVersion", + value: function getAppVersion() { + return global.appVersionName; + } + }, { + key: "getBundleVersion", + value: function getBundleVersion() { + return _$$_REQUIRE(_dependencyMap[6]).bundleVersion; + } + }, { + key: "getAppCode", + value: function getAppCode() { + return global.appVersionCode; + } + }, { + key: "isUsingHermes", + value: function isUsingHermes() { + return !!global.HermesInternal; + } + }, { + key: "setScreenDimensions", + value: function setScreenDimensions() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + width = _ref.width, + height = _ref.height, + _ref$orientation = _ref.orientation, + orientation = _ref$orientation === undefined ? _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.getStartupOrientation() : _ref$orientation, + _ref$fullOrientation = _ref.fullOrientation, + fullOrientation = _ref$fullOrientation === undefined ? global.initialOrientation : _ref$fullOrientation, + _ref$locked = _ref.locked, + locked = _ref$locked === undefined ? false : _ref$locked, + _ref$lockedOrientatio = _ref.lockedOrientation, + lockedOrientation = _ref$lockedOrientatio === undefined ? _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.getStartupOrientation() : _ref$lockedOrientatio; + + var size = {}; + + var _Dimensions$get = _reactNative.Dimensions.get("window"), + windowWidth = _Dimensions$get.width, + windowHeight = _Dimensions$get.height; + + var _Dimensions$get2 = _reactNative.Dimensions.get("screen"), + screenWidth = _Dimensions$get2.width, + screenHeight = _Dimensions$get2.height; + + if (DeviceUtils.isPortrait(orientation)) { + size.width = width || Math.min(screenWidth, screenHeight); + size.height = height || Math.max(windowWidth, windowHeight); + size.isPortrait = true; + } else { + size.width = width || Math.max(windowWidth, windowHeight); + size.height = height || Math.min(windowWidth, windowHeight); + size.isPortrait = false; + } + + var somethingChange = !_$$_REQUIRE(_dependencyMap[7]).JSUtils.areEqualShallow(DeviceUtils.screenDimensions, size); + DeviceUtils.currentOrientation = orientation; + DeviceUtils.currentFullOrientation = fullOrientation || orientation; + DeviceUtils.screenDimensions = size; + DeviceUtils.orientationIsLocked = locked; + DeviceUtils.lockedOrientation = lockedOrientation; + var hideStatusBar = _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isIOS() && !_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isTablet() && !DeviceUtils.isPortrait(); + + _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.setStatusBarHidden(hideStatusBar); + + return somethingChange; + } + }, { + key: "getScreenDimensions", + value: function getScreenDimensions() { + return DeviceUtils.screenDimensions; + } + }, { + key: "setSafeArea", + value: function setSafeArea() { + var insets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DeviceUtils.insets; + var frame = arguments.length > 1 ? arguments[1] : undefined; + + if (DeviceUtils.safeAreaEventCoolDown) { + clearTimeout(DeviceUtils.safeAreaEventCoolDown); + DeviceUtils.safeAreaEventCoolDown = undefined; + } + + if (insets) { + DeviceUtils.safeAreaEventCoolDown = setTimeout(function () { + var top = insets.top, + bottom = insets.bottom, + left = insets.left, + right = insets.right; + DeviceUtils.insets = insets; + + var _ref2 = frame || DeviceUtils.screenDimensions, + width = _ref2.width, + height = _ref2.height; + + var newSafeArea = { + width: width - left - right, + height: height - top - bottom + }; + + if (!DeviceUtils.safeArea || !_$$_REQUIRE(_dependencyMap[7]).JSUtils.areEqualShallow(newSafeArea, DeviceUtils.safeArea)) { + DeviceUtils.safeArea = newSafeArea; + + _$$_REQUIRE(_dependencyMap[8]).EventRegister.emit(_events.default.ON_SAFE_AREA_CHANGE); + } + }, DeviceUtils.SAFE_AREA_CHANGE_COOL_DOWN_SECS); + } + } + }, { + key: "setSafeAreaFromScreenDimensions", + value: function setSafeAreaFromScreenDimensions() { + var insets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DeviceUtils.insets; + var top = insets.top, + bottom = insets.bottom, + left = insets.left, + right = insets.right; + var _DeviceUtils$screenDi = DeviceUtils.screenDimensions, + width = _DeviceUtils$screenDi.width, + height = _DeviceUtils$screenDi.height; + var newSafeArea = { + width: width - left - right, + height: height - top - bottom + }; + DeviceUtils.safeArea = newSafeArea; + } + }, { + key: "getSafeArea", + value: function getSafeArea() { + var _DeviceUtils$screenDi2 = DeviceUtils.screenDimensions, + width = _DeviceUtils$screenDi2.width, + height = _DeviceUtils$screenDi2.height; + return DeviceUtils.safeArea || { + width: width, + height: height + }; + } + }, { + key: "getSafeAreaWidth", + value: function getSafeAreaWidth() { + var insets = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DeviceUtils.insets; + var frame = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DeviceUtils.screenDimensions; + var width = frame.width; + var left = insets.left, + right = insets.right; + return width - left - right; + } + }, { + key: "getSafeAreaInsets", + value: function getSafeAreaInsets() { + return DeviceUtils.insets; + } + }, { + key: "isPortrait", + value: function isPortrait(orientation) { + if (orientation) { + return _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isPortrait(orientation); + } + + return DeviceUtils.screenDimensions.isPortrait !== undefined ? DeviceUtils.screenDimensions.isPortrait : true; + } + }, { + key: "getCurrentOrientation", + value: function getCurrentOrientation() { + return DeviceUtils.currentOrientation; + } + }, { + key: "getCurrentFullOrientation", + value: function getCurrentFullOrientation() { + return DeviceUtils.currentFullOrientation || DeviceUtils.currentOrientation; + } + }, { + key: "getTextVersionName", + value: function getTextVersionName() { + if (_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isIOS()) { + return global.appVersionName; + } + + if (global.appVersionName !== global.androidVersionName && global.androidVersionName) { + return global.androidVersionName + " (" + global.appVersionName + ")"; + } + + return global.appVersionName; + } + }, { + key: "setAppearance", + value: function setAppearance(theme) { + DeviceUtils.currentTheme = theme; + } + }, { + key: "getAppearance", + value: function getAppearance() { + return DeviceUtils.currentTheme; + } + }, { + key: "isDark", + value: function isDark() { + return DeviceUtils.currentTheme === "dark"; + } + }, { + key: "setCurrentAppState", + value: function setCurrentAppState(state) { + DeviceUtils.currentAppState = state; + } + }, { + key: "getCurrentAppState", + value: function getCurrentAppState() { + return DeviceUtils.currentAppState; + } + }, { + key: "isAppActive", + value: function isAppActive() { + return DeviceUtils.currentAppState === "active"; + } + }, { + key: "isAppInBackground", + value: function isAppInBackground() { + return DeviceUtils.currentAppState === "background"; + } + }, { + key: "getReferenceDpi", + value: function getReferenceDpi() { + var _global$getActivePSet = global.getActivePSetup(), + deviceDpi = _global$getActivePSet.deviceDpi; + + if (_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isIOS() && deviceDpi) { + return deviceDpi / _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.info.pixelRatio; + } + + return _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.defaultDpi; + } + }, { + key: "enableIdleTimer", + value: function enableIdleTimer() { + if (DeviceUtils.idleTimerDisabled) { + _reactNativeIdleTimer.default.setIdleTimerDisabled(false); + + DeviceUtils.idleTimerDisabled = false; + } + } + }, { + key: "disableIdleTimer", + value: function disableIdleTimer() { + if (!DeviceUtils.idleTimerDisabled) { + _reactNativeIdleTimer.default.setIdleTimerDisabled(true); + + DeviceUtils.idleTimerDisabled = true; + } + } + }, { + key: "isIdleTimerDisabled", + value: function isIdleTimerDisabled() { + return DeviceUtils.idleTimerDisabled; + } + }, { + key: "delayIdleTimer", + value: function delayIdleTimer(time) { + DeviceUtils.disableIdleTimer(); + + if (DeviceUtils.idleScreenTimerDelay) { + DeviceUtils.idleScreenTimerDelay.stop(); + } + + DeviceUtils.idleScreenTimerDelay = new (_$$_REQUIRE(_dependencyMap[7]).LongTimer)(time, DeviceUtils.enableIdleTimer).start(); + } + }]); + return DeviceUtils; + }(); + + exports.default = DeviceUtils; + DeviceUtils.SAFE_AREA_CHANGE_COOL_DOWN_SECS = 250; + DeviceUtils.screenDimensions = {}; + DeviceUtils.insets = { + top: 0, + bottom: 0, + left: 0, + right: 0 + }; + DeviceUtils.orientationIsLocked = false; + DeviceUtils.idleTimerDisabled = false; +},458,[5,7,8,28,459,460,461,462,572]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var _require = _$$_REQUIRE(_dependencyMap[0]), + NativeModules = _require.NativeModules; + + module.exports = NativeModules.IdleTimerManager; +},459,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var Events = function Events() { + (0, _classCallCheck2.default)(this, Events); + }; + + exports.default = Events; + Events.LIVE_CONFIG_SET_VALUE = "live_config_set_value"; + Events.LIVE_CONFIG_GET_VALUE = "live_config_get_value"; + Events.TOGGLE_LAYOUT = "toggle_layout"; + Events.TOGGLE_DRAWER_ITEM = "toggle_drawer_item"; + Events.SYSTEM_FONT_SIZE_CHANGED = "system_font_size_changed"; + Events.TOGGLE_FULLSCREEN_FONT_SIZE = "toggle_fullscreen_font_size"; + Events.TOGGLE_NEWSMEMORY_GRAPH_SIZE = "toggle_newsmemory_graph_size"; + Events.TOGGLE_THEME = "toggle_theme"; + Events.GALLERY_THUMBNAIL_CLICK = "gallery_thumbnail_click"; + Events.GALLERY_VIEWPAGER_SCROLL = "gallery_viewpager_scroll"; + Events.TOGGLE_FAVORITE = "toggle_favorite"; + Events.CLEAR_FAVORITES = "clear_favorites"; + Events.PAYWALL_GO_BACK_HOME = "paywall_go_back_home"; + Events.PAYWALL_OPEN_WEBSCREEN = "paywall_open_webscreen"; + Events.PAYWALL_USER_STATUS_UPDATE = "paywall_user_status_update"; + Events.PAYWALL_OPEN_NEWSMEMORY_OPTIONSPAGE = "paywall_open_newsmemory_optionspage"; + Events.PAYWALL_OPEN_POPUP = "paywall_open_popup"; + Events.PAYWALL_VALIDATE = "paywall_validate"; + Events.PAYWALL_LOGOUT = "paywall_logout"; + Events.ON_ACCESSIBILITY_MODE_CHANGE = "on_accessibility_mode_change"; + Events.TRIGGER_RSS_DB_UPDATE = "triggerRssDbUpdate"; + Events.ON_RSS_DB_DOWNLOAD = "onRssDbDownload"; + Events.ON_RSS_BASE_SCREEN_BLUR = "onRssBaseScreenBlur"; + Events.TOGGLE_JOB_FAVORITE = "toggle_job_favorite"; + Events.TOGGLE_JOB_SEARCH = "toggle_job_search"; + Events.TOGGLE_REAL_ESTATE_FAVORITE = "toggle_real_estate_favorite"; + Events.TOGGLE_REAL_ESTATE_SEARCH = "toggle_real_estate_search"; + Events.TOGGLE_AUTO_FAVORITE = "toggle_auto_favorite"; + Events.TOGGLE_AUTO_SEARCH = "toggle_auto_search"; + Events.TOGGLE_EVENTS_FAVORITE = "toggle_events_favorite"; + Events.TOGGLE_EVENTS_SEARCH = "toggle_events_search"; + Events.TOGGLE_FOOTER_VISIBILITY = "toggle_footer_visibility"; + Events.RSS_ACTIVE_SCREEN = "rss_active_screen"; + Events.LIST_VERTICAL_SCROLLING = "list_vertical_scrolling"; + Events.FOOTER_ITEM_CLICK = "footer_item_click"; + Events.TTS_ENGINE_STARTED = "tts_start"; + Events.TTS_ENGINE_PROGRESS = "tts_progress"; + Events.TTS_ENGINE_STOPPED = "tts_stop"; + Events.TOGGLE_ARTICLE_GRAPHIC = "toggle_article_graphic"; + Events.TOGGLE_ARTICLE_TEXT = "toggle_article_text"; + Events.ENABLE_ARTICLE_EXTRA = "enable_article_extra"; + Events.DISABLE_ARTICLE_EXTRA = "disable_article_extra"; + Events.TOGGLE_ARTICLE_EXTRA_CHANGE_BUTTON_VISIBILITY = "toggle_article_extra_change_button_visibility"; + Events.ARTICLE_GRAPHIC_ZOOM_CHANGE = "article_graphic_zoom_change"; + Events.ARTICLE_GRAPH_ZOOM_UNFIT = "article_graphic_zoom_unfit"; + Events.ARTICLE_TEXT_ZOOM_CHANGE = "article_text_zoom_change"; + Events.ARTICLE_SCROLL_LAYOUT = "article_scroll_layout"; + Events.ARTICLE_SCROLL = "article_scroll"; + Events.LOAD_NATIVE_ADS = "load_native_ads"; + Events.ON_COLOR_CHANGE = "on_color_change"; + Events.ON_ORIENTATION_CHANGE = "on_orientation_change"; + Events.ON_SAFE_AREA_CHANGE = "on_safe_area_change"; + Events.ON_SAFE_AREA_COLOR_CHANGE = "on_safe_area_color_change"; + Events.ON_CONNECTIVITY_CHANGE = "on_connectivity_change"; + Events.NEWSMEMORY_FOOTER_BUTTON_HIDE = "on_newsmemory_footer_button_hide"; + Events.NEWSMEMORY_FOOTER_BUTTON_HIDE_STARTUP = "on_newsmemory_footer_button_hide_startup"; + Events.NEWSMEMORY_FOOTER_BUTTON_SHOW = "on_newsmemory_footer_button_show"; + Events.NEWSMEMORY_FOOTER_TOGGLE_VISIBILITY = "newsmemory_footer_toggle_visibility"; + Events.ON_NEWSMEMORY_FOOTER_BUTTON_ACTIVE = "on_newsmemory_footer_button_active"; + Events.ON_NEWSMEMORY_FOOTER_BUTTON_INACTIVE = "on_newsmemory_footer_button_inactive"; + Events.TOGGLE_FONT_CHANGE_BUTTON_VISIBILITY = "toggle_font_change_button_visibility"; + Events.TOGGLE_GRAPH_CHANGE_BUTTON_VISIBILITY = "toggle_graph_change_button_visibility"; + Events.TOGGLE_GRAPH_UNFIT_CHANGE_BUTTON_VISIBILITY = "toggle_graph_unfit_change_button_visibility"; + Events.TRANSLATE_CHANGE_BUTTON_VISIBILITY = "translate_change_button_visibility"; + Events.TRANSLATE_CHANGE_BUTTON_BADGE = "translate_change_button_badge"; + Events.TTS_CHANGE_BUTTON_VISIBILITY = "tts_change_button_visibility"; + Events.SHARE_CHANGE_BUTTON_VISIBILITY = "share_change_button_visibility"; + Events.TOGGLE_GRAPHIC_CHANGE_BUTTON_VISIBILITY = "toggle_graphic_change_button_visibility"; + Events.NEWSMEMORY_TOGGLE_FIT = "newsmemory_toggle_fit"; + Events.NEWSMEMORY_REQUEST_DOWNLOAD_IMAGE = "newsmemory_request_download_image"; + Events.NEWSMEMORY_REQUEST_DOWNLOADED_IMAGE = "newsmemory_request_downloaded_image"; + Events.NEWSMEMORY_SAVE_HR = "newsmemory_save_hr"; + Events.NEWSMEMORY_REQUEST_DOWNLOAD_HR = "newsmemory_request_download_hr"; + Events.NEWSMEMORY_HR_DOWNLOAD_ERROR = "newsmemory_hr_download_error"; + Events.NEWSMEMORY_HR_DOWNLOAD_SUCCESS = "newsmemory_hr_download_success"; + Events.NEWSMEMORY_MISSING_HR_WARNING_SHOW = "newsmemory_missing_hr_show"; + Events.NEWSMEMORY_MISSING_HR_WARNING_HIDE = "newsmemory_missing_hr_hide"; + Events.NEWSMEMORY_DOWNLOAD_EDITION = "newsmemory_download_edition"; + Events.NEWSMEMORY_RELOAD_EDITION = "newsmemory_reload_edition"; + Events.NEWSMEMORY_DOWNLOAD_LATEST_EDITION = "newsmemory_download_latest_edition"; + Events.NEWSMEMORY_DB_DOWNLOAD_STARTED = "db_download_started"; + Events.NEWSMEMORY_DB_DOWNLOAD_PROGRESS = "db_download_progress"; + Events.NEWSMEMORY_DB_DOWNLOAD_FINISHED = "db_download_finished"; + Events.NEWSMEMORY_DB_DOWNLOAD_RETRY = "db_download_retry"; + Events.NEWSMEMORY_ON_EXTRA_GO_TO_PAGE_PRESS = "newsmemory_on_extra_go_to_page_press"; + Events.NEWSMEMORY_SHOW_EXTRA = "newsmemory_show_extra"; + Events.NEWSMEMORY_HIDE_EXTRA = "newsmemory_hide_extra"; + Events.NEWSMEMORY_NEWSPAPER_LOADING = "newsmemory_newspaper_loading"; + Events.NEWSMEMORY_NEWSPAPER_LOADED = "newsmemory_newspaper_loaded"; + Events.NEWSMEMORY_NEWSPAPER_CHANGED = "newsmemory_newspaper_changed"; + Events.NEWSMEMORY_LOGIN_CHECK_STARTED = "newsmemory_login_check_started"; + Events.NEWSMEMORY_LOGIN_CHECK_ENDED = "newsmemory_login_check_ended"; + Events.NEWSMEMORY_DOWNLOAD_PROGRESS = "download_progress"; + Events.NEWSMEMORY_INITIAL_DOWNLOAD_STARTED = "initial_download_started"; + Events.NEWSMEMORY_INITIAL_DOWNLOAD_FINISHED = "initial_download_finished"; + Events.NEWSMEMORY_DOWNLOAD_FULL_EDITION = "newsmemory_download_full_edition"; + Events.NEWSMEMORY_FULL_DOWNLOAD_STARTED = "full_download_started"; + Events.NEWSMEMORY_FULL_DOWNLOAD_PROGRESS = "full_download_progress"; + Events.NEWSMEMORY_FULL_DOWNLOAD_FINISHED = "full_download_finished"; + Events.NEWSMEMORY_UPDATE_REQUESTED = "update_requested"; + Events.NEWSMEMORY_UPDATE_STARTED = "update_started"; + Events.NEWSMEMORY_UPDATE_FINISHED = "update_finished"; + Events.NEWSMEMORY_CLEAR_HIGH_RES_QUEUE = "clear_high_res_queue"; + Events.NEWSMEMORY_RESTART_HIGH_RES_QUEUE = "restart_high_res_queue"; + Events.NEWSMEMORY_RESUME_HIGH_RES_QUEUE = "resume_high_res_queue"; + Events.NEWSMEMORY_PAUSE_HIGH_RES_QUEUE = "pause_high_res_queue"; + Events.NEWSMEMORY_VIEWPAGER_PAN_UP = "newsmemory_viewpager_pan_up"; + Events.NEWSMEMORY_VIEWPAGER_GESTURE_START = "newsmemory_viewpager_gesture_start"; + Events.NEWSMEMORY_VIEWPAGER_GESTURE_END = "newsmemory_viewpager_gesture_end"; + Events.OPEN_OPTIONSPAGE = "open_optionspage"; + Events.OPEN_OPTIONSPAGE_ACCESSIBILITY = "open_optionspage_accessibility"; + Events.OPEN_SETTINGS = "open_settings"; + Events.CLOSE_OPTIONSPAGE = "close_optionspage"; + Events.CLOSE_OPTIONSPAGE_ACCESSIBILITY = "close_optionspage_accessibility"; + Events.NEWSMEMORY_INDEX_CHANGE = "newsmemory_index_change"; + Events.NEWSMEMORY_ARTICLE_CHANGE = "newsmemory_article_change"; + Events.NEWSMEMORY_ARTICLE_JUMP = "newsmemory_article_jump"; + Events.NEWSMEMORY_ARTICLE_HIGHLIGHT = "newsmemory_article_highlight"; + Events.NEWSMEMORY_ARTICLE_CLOSE = "newsmemory_article_close"; + Events.NEWSMEMORY_SHOW_NAVIGATION_BUTTONS = "newsmemory_show_navigation_buttons"; + Events.NEWSMEMORY_RESET_NAVIGATION_BUTTONS_POSITION = "newsmemory_reset_navigation_buttons_position"; + Events.NEWSMEMORY_REMOVE_HIGHLIGHT = "newsmemory_remove_highlight"; + Events.NEWSMEMORY_GENERATE_PNG = "newsmemory_generate_png"; + Events.NEWSMEMORY_PNG_GENERATED = "newsmemory_png_generated"; + Events.NEWSMEMORY_CONFIG_CHANGE = "newsmemory_config_change"; + Events.NEWSMEMORY_ON_CLEAR_STORAGE = "newsmemory_clear_storage"; + Events.NEWSMEMORY_OPEN_OFFLINE_EDITION_MENU = "newsmemory_open_offline_editions_menu"; + Events.NEWSMEMORY_OPEN_SPECIAL_SECTION = "newsmemory_open_special_section"; + Events.NEWSMEMORY_ON_LOAD_MAIN_EDITION_FROM_SPECIAL = "newsmemory_on_load_main_edition_from_special"; + Events.NEWSMEMORY_ON_LOAD_SPECIAL = "newsmemory_on_load_special"; + Events.NEWSMEMORY_ON_ARTICLE_GRAPH_LOADED = "newsmemory_on_article_graph_loaded"; + Events.NEWSMEMORY_ON_ZOOM = "newsmemory_on_zoom"; + Events.NEWSMEMORY_ON_CLICK = "newsmemory_on_click"; + Events.NEWSMEMORY_ON_LONG_PRESS = "newsmemory_on_long_press"; + Events.NEWSMEMORY_DID_FOCUS = "newsmemory_did_focus"; + Events.NEWSMEMORY_CLOSE_CURRENT_DB = "newsmemory_close_current_db"; + Events.ON_STATE_CHANGE_GOING_FOREGROUND = "on_state_change_going_foreground"; + Events.ON_STATE_CHANGE_GOING_BACKGROUND = "on_state_change_going_background"; + Events.ON_STATE_CHANGE_GOING_INACTIVE = "on_state_change_going_inactive"; + Events.ON_THUMBNAIL_CLOSE = "on_thumbnail_close"; + Events.ON_CONNECTION_TYPE_CHANGE = "on_connection_type_change"; + Events.SWIPER_SCROLL_BEGIN = "swiper_scroll_begin"; + Events.SWIPER_SCROLL_END = "swiper_scroll_end"; + Events.CHANGE_ADS_VISIBILITY = "change_ads_visibility"; + Events.PAPER_SETUP_API_RETRY = "paper_setup_api_retry"; + Events.CONFIG_UPDATE_CHECK = "config_update_check"; + Events.CONFIG_FORCE_UPDATE = "config_force_update"; + Events.TRIGGER_NEWSMEMORY_RESTART = "trigger_newsmemory_restart"; + Events.ON_VOICE_RECOGNITION_START = "on_voice_recognition_start"; + Events.ON_VOICE_RECOGNITION = "on_voice_recognition"; + Events.ON_SIMULATE_ACCESSIBILITY_CHANGE = "on_simulate_accessibility_change"; + Events.ON_POSTPONE_ACTION = "on_postpone_action"; +},460,[5,7]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bundleVersion = undefined; + var bundleVersion = "001"; + exports.bundleVersion = bundleVersion; +},461,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "ColorUtils", { + enumerable: true, + get: function get() { + return _colorUtils.default; + } + }); + Object.defineProperty(exports, "colors", { + enumerable: true, + get: function get() { + return _colorUtils.colors; + } + }); + Object.defineProperty(exports, "CssUtils", { + enumerable: true, + get: function get() { + return _cssUtils.default; + } + }); + Object.defineProperty(exports, "DateUtils", { + enumerable: true, + get: function get() { + return _dateUtils.default; + } + }); + Object.defineProperty(exports, "FileUtils", { + enumerable: true, + get: function get() { + return _fileUtils.default; + } + }); + Object.defineProperty(exports, "FontUtils", { + enumerable: true, + get: function get() { + return _fontUtils.default; + } + }); + Object.defineProperty(exports, "JSUtils", { + enumerable: true, + get: function get() { + return _jsUtils.default; + } + }); + Object.defineProperty(exports, "PromiseTimeout", { + enumerable: true, + get: function get() { + return _jsUtils.PromiseTimeout; + } + }); + Object.defineProperty(exports, "LocationMgr", { + enumerable: true, + get: function get() { + return _locationUtils.default; + } + }); + Object.defineProperty(exports, "LongTimer", { + enumerable: true, + get: function get() { + return _longTimer.default; + } + }); + Object.defineProperty(exports, "NetworkUtils", { + enumerable: true, + get: function get() { + return _networkUtils.default; + } + }); + Object.defineProperty(exports, "PlatformUtils", { + enumerable: true, + get: function get() { + return _platformUtils.default; + } + }); + Object.defineProperty(exports, "StorageUtils", { + enumerable: true, + get: function get() { + return _storageUtils.default; + } + }); + Object.defineProperty(exports, "StringUtils", { + enumerable: true, + get: function get() { + return _stringUtils.default; + } + }); + Object.defineProperty(exports, "Logger", { + enumerable: true, + get: function get() { + return _log.default; + } + }); + + var _colorUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _cssUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _dateUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + var _fileUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); + + var _fontUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[5])); + + var _jsUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _locationUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[7])); + + var _longTimer = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[8])); + + var _networkUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[9])); + + var _platformUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[10])); + + var _storageUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[11])); + + var _stringUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[12])); + + var _log = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } +},462,[463,5,465,466,483,542,520,545,550,551,531,560,514,543]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.colors = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var colors = { + articleHighlight: "rgba(255,0,0,0.25)", + keyboardHighlight: "rgba(170,170,170,0.5)", + textShadow: "rgba(0, 0, 0, 0.75)", + articleHeader: "rgba(255, 255, 255, 0.4)", + modalBackgroundLight: "rgba(0, 0, 0, 0.4)", + modalBackground: "rgba(0, 0, 0, 0.7)", + barColor: "rgba(0, 122, 255, 1)", + articleContainerBorderColor: "#3c3c4349", + hintBackgroundColor: "#FFECB3", + transparent: "transparent", + transparent1200: "#00000033", + transparent600: "#0000009f", + transparent200: "#000000cc", + black: "#000000", + white: "#FFFFFF", + white_transparent_135: "#FFFFFF87", + grey: "#dcdcdc", + red: "#ff0000", + grey50: "#FAFAFA", + grey100: "#F5F5F5", + grey200: "#eeeeee", + grey210: "#e7e7e7", + grey300: "#bcbcbc", + grey400: "#737373", + grey900: "#212121", + grey1000: "#262626", + grey1010: "#272727", + grey1200: "#121212", + title: "rgb(51, 51, 51)", + summary: "rgb(77, 77, 77)", + details: "rgb(89, 89, 89)", + ios_system_blue: "#007AFF", + ios_system_blue_dark: "#0A84FF", + ios_secondary_system_background: "#F2F2F7", + ios_secondary_system_background_dark: "#2C2C2E", + md_red_50: "#FFEBEE", + md_red_100: "#FFCDD2", + md_red_200: "#EF9A9A", + md_red_300: "#E57373", + md_red_400: "#EF5350", + md_red_500: "#F44336", + md_red_600: "#E53935", + md_red_700: "#D32F2F", + md_red_800: "#C62828", + md_red_900: "#B71C1C", + md_red_A100: "#FF8A80", + md_red_A200: "#FF5252", + md_red_A400: "#FF1744", + md_red_A700: "#D50000", + md_pink_50: "#FCE4EC", + md_pink_100: "#F8BBD0", + md_pink_200: "#F48FB1", + md_pink_300: "#F06292", + md_pink_400: "#EC407A", + md_pink_500: "#E91E63", + md_pink_600: "#D81B60", + md_pink_700: "#C2185B", + md_pink_800: "#AD1457", + md_pink_900: "#880E4F", + md_pink_A100: "#FF80AB", + md_pink_A200: "#FF4081", + md_pink_A400: "#F50057", + md_pink_A700: "#C51162", + md_purple_50: "#F3E5F5", + md_purple_100: "#E1BEE7", + md_purple_200: "#CE93D8", + md_purple_300: "#BA68C8", + md_purple_400: "#AB47BC", + md_purple_500: "#9C27B0", + md_purple_600: "#8E24AA", + md_purple_700: "#7B1FA2", + md_purple_800: "#6A1B9A", + md_purple_900: "#4A148C", + md_purple_A100: "#EA80FC", + md_purple_A200: "#E040FB", + md_purple_A400: "#D500F9", + md_purple_A700: "#AA00FF", + md_deep_purple_50: "#EDE7F6", + md_deep_purple_100: "#D1C4E9", + md_deep_purple_200: "#B39DDB", + md_deep_purple_300: "#9575CD", + md_deep_purple_400: "#7E57C2", + md_deep_purple_500: "#673AB7", + md_deep_purple_600: "#5E35B1", + md_deep_purple_700: "#512DA8", + md_deep_purple_800: "#4527A0", + md_deep_purple_900: "#311B92", + md_deep_purple_A100: "#B388FF", + md_deep_purple_A200: "#7C4DFF", + md_deep_purple_A400: "#651FFF", + md_deep_purple_A700: "#6200EA", + md_indigo_50: "#E8EAF6", + md_indigo_100: "#C5CAE9", + md_indigo_200: "#9FA8DA", + md_indigo_300: "#7986CB", + md_indigo_400: "#5C6BC0", + md_indigo_500: "#3F51B5", + md_indigo_600: "#3949AB", + md_indigo_700: "#303F9F", + md_indigo_800: "#283593", + md_indigo_900: "#1A237E", + md_indigo_A100: "#8C9EFF", + md_indigo_A200: "#536DFE", + md_indigo_A400: "#3D5AFE", + md_indigo_A700: "#304FFE", + md_blue_50: "#E3F2FD", + md_blue_100: "#BBDEFB", + md_blue_200: "#90CAF9", + md_blue_300: "#64B5F6", + md_blue_400: "#42A5F5", + md_blue_500: "#2196F3", + md_blue_600: "#1E88E5", + md_blue_700: "#1976D2", + md_blue_800: "#1565C0", + md_blue_900: "#0D47A1", + md_blue_A100: "#82B1FF", + md_blue_A200: "#448AFF", + md_blue_A400: "#2979FF", + md_blue_A700: "#2962FF", + md_light_blue_50: "#E1F5FE", + md_light_blue_100: "#B3E5FC", + md_light_blue_200: "#81D4fA", + md_light_blue_300: "#4fC3F7", + md_light_blue_400: "#29B6FC", + md_light_blue_500: "#03A9F4", + md_light_blue_600: "#039BE5", + md_light_blue_700: "#0288D1", + md_light_blue_800: "#0277BD", + md_light_blue_900: "#01579B", + md_light_blue_A100: "#80D8FF", + md_light_blue_A200: "#40C4FF", + md_light_blue_A400: "#00B0FF", + md_light_blue_A700: "#0091EA", + md_cyan_50: "#E0F7FA", + md_cyan_100: "#B2EBF2", + md_cyan_200: "#80DEEA", + md_cyan_300: "#4DD0E1", + md_cyan_400: "#26C6DA", + md_cyan_500: "#00BCD4", + md_cyan_600: "#00ACC1", + md_cyan_700: "#0097A7", + md_cyan_800: "#00838F", + md_cyan_900: "#006064", + md_cyan_A100: "#84FFFF", + md_cyan_A200: "#18FFFF", + md_cyan_A400: "#00E5FF", + md_cyan_A700: "#00B8D4", + md_teal_50: "#E0F2F1", + md_teal_100: "#B2DFDB", + md_teal_200: "#80CBC4", + md_teal_300: "#4DB6AC", + md_teal_400: "#26A69A", + md_teal_500: "#009688", + md_teal_600: "#00897B", + md_teal_700: "#00796B", + md_teal_800: "#00695C", + md_teal_900: "#004D40", + md_teal_A100: "#A7FFEB", + md_teal_A200: "#64FFDA", + md_teal_A400: "#1DE9B6", + md_teal_A700: "#00BFA5", + md_green_50: "#E8F5E9", + md_green_100: "#C8E6C9", + md_green_200: "#A5D6A7", + md_green_300: "#81C784", + md_green_400: "#66BB6A", + md_green_500: "#4CAF50", + md_green_600: "#43A047", + md_green_700: "#388E3C", + md_green_800: "#2E7D32", + md_green_900: "#1B5E20", + md_green_A100: "#B9F6CA", + md_green_A200: "#69F0AE", + md_green_A400: "#00E676", + md_green_A700: "#00C853", + md_light_green_50: "#F1F8E9", + md_light_green_100: "#DCEDC8", + md_light_green_200: "#C5E1A5", + md_light_green_300: "#AED581", + md_light_green_400: "#9CCC65", + md_light_green_500: "#8BC34A", + md_light_green_600: "#7CB342", + md_light_green_700: "#689F38", + md_light_green_800: "#558B2F", + md_light_green_900: "#33691E", + md_light_green_A100: "#CCFF90", + md_light_green_A200: "#B2FF59", + md_light_green_A400: "#76FF03", + md_light_green_A700: "#64DD17", + md_lime_50: "#F9FBE7", + md_lime_100: "#F0F4C3", + md_lime_200: "#E6EE9C", + md_lime_300: "#DCE775", + md_lime_400: "#D4E157", + md_lime_500: "#CDDC39", + md_lime_600: "#C0CA33", + md_lime_700: "#A4B42B", + md_lime_800: "#9E9D24", + md_lime_900: "#827717", + md_lime_A100: "#F4FF81", + md_lime_A200: "#EEFF41", + md_lime_A400: "#C6FF00", + md_lime_A700: "#AEEA00", + md_yellow_50: "#FFFDE7", + md_yellow_100: "#FFF9C4", + md_yellow_200: "#FFF590", + md_yellow_300: "#FFF176", + md_yellow_400: "#FFEE58", + md_yellow_500: "#FFEB3B", + md_yellow_600: "#FDD835", + md_yellow_700: "#FBC02D", + md_yellow_800: "#F9A825", + md_yellow_900: "#F57F17", + md_yellow_A100: "#FFFF82", + md_yellow_A200: "#FFFF00", + md_yellow_A400: "#FFEA00", + md_yellow_A700: "#FFD600", + md_amber_50: "#FFF8E1", + md_amber_100: "#FFECB3", + md_amber_200: "#FFE082", + md_amber_300: "#FFD54F", + md_amber_400: "#FFCA28", + md_amber_500: "#FFC107", + md_amber_600: "#FFB300", + md_amber_700: "#FFA000", + md_amber_800: "#FF8F00", + md_amber_900: "#FF6F00", + md_amber_A100: "#FFE57F", + md_amber_A200: "#FFD740", + md_amber_A400: "#FFC400", + md_amber_A700: "#FFAB00", + md_orange_50: "#FFF3E0", + md_orange_100: "#FFE0B2", + md_orange_200: "#FFCC80", + md_orange_300: "#FFB74D", + md_orange_400: "#FFA726", + md_orange_500: "#FF9800", + md_orange_600: "#FB8C00", + md_orange_700: "#F57C00", + md_orange_800: "#EF6C00", + md_orange_900: "#E65100", + md_orange_A100: "#FFD180", + md_orange_A200: "#FFAB40", + md_orange_A400: "#FF9100", + md_orange_A700: "#FF6D00", + md_deep_orange_50: "#FBE9A7", + md_deep_orange_100: "#FFCCBC", + md_deep_orange_200: "#FFAB91", + md_deep_orange_300: "#FF8A65", + md_deep_orange_400: "#FF7043", + md_deep_orange_500: "#FF5722", + md_deep_orange_600: "#F4511E", + md_deep_orange_700: "#E64A19", + md_deep_orange_800: "#D84315", + md_deep_orange_900: "#BF360C", + md_deep_orange_A100: "#FF9E80", + md_deep_orange_A200: "#FF6E40", + md_deep_orange_A400: "#FF3D00", + md_deep_orange_A700: "#DD2600", + md_brown_50: "#EFEBE9", + md_brown_100: "#D7CCC8", + md_brown_200: "#BCAAA4", + md_brown_300: "#A1887F", + md_brown_400: "#8D6E63", + md_brown_500: "#795548", + md_brown_600: "#6D4C41", + md_brown_700: "#5D4037", + md_brown_800: "#4E342E", + md_brown_900: "#3E2723", + md_grey_50: "#FAFAFA", + md_grey_100: "#F5F5F5", + md_grey_200: "#EEEEEE", + md_grey_300: "#E0E0E0", + md_grey_400: "#BDBDBD", + md_grey_500: "#9E9E9E", + md_grey_600: "#757575", + md_grey_700: "#616161", + md_grey_800: "#424242", + md_grey_900: "#212121", + md_black_1000: "#000000", + md_white_1000: "#ffffff", + md_blue_grey_50: "#ECEFF1", + md_blue_grey_100: "#CFD8DC", + md_blue_grey_200: "#B0BBC5", + md_blue_grey_300: "#90A4AE", + md_blue_grey_400: "#78909C", + md_blue_grey_500: "#607D8B", + md_blue_grey_600: "#546E7A", + md_blue_grey_700: "#455A64", + md_blue_grey_800: "#37474F", + md_blue_grey_900: "#263238" + }; + exports.colors = colors; + + var ColorUtils = function () { + function ColorUtils() { + (0, _classCallCheck2.default)(this, ColorUtils); + } + + (0, _createClass2.default)(ColorUtils, null, [{ + key: "convertHexFromShorthand", + value: function convertHexFromShorthand(hex) { + var result; + + if (hex.length <= 4) { + var shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i; + result = hex.replace(shorthandRegex, function (_, r, g, b) { + return r + r + g + g + b + b; + }); + } else { + result = hex; + } + + return result; + } + }, { + key: "componentToHex", + value: function componentToHex(component) { + var hex = parseInt(component, 10).toString(16); + return hex.length === 1 ? "0".concat(hex) : hex; + } + }, { + key: "rgbTOrrggbb", + value: function rgbTOrrggbb(rgb) { + if (rgb) { + if (rgb.match(/^#[a-f\d]{6}$/i) !== null) { + return rgb; + } + + if (rgb.match(/^#[a-f\d]{3}$/i) !== null) { + return "#" + rgb[1] + rgb[1] + rgb[2] + rgb[2] + rgb[3] + rgb[3]; + } + } + + return undefined; + } + }, { + key: "hexToChannels", + value: function hexToChannels(hex) { + return /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(hex); + } + }, { + key: "RGBAToChannels", + value: function RGBAToChannels(rgba) { + return /^rgba\(([\d]{1,3}),([\d]{1,3}),([\d]{1,3}),([\d\.]+)\)$/.exec(rgba); + } + }, { + key: "getRedChannelFromHex", + value: function getRedChannelFromHex(hex) { + var result = ColorUtils.hexToChannels(hex); + return result ? parseInt(result[1], 16) : 0; + } + }, { + key: "getGreenChannelFromHex", + value: function getGreenChannelFromHex(hex) { + var result = ColorUtils.hexToChannels(hex); + return result ? parseInt(result[2], 16) : 0; + } + }, { + key: "getBlueChannelFromHex", + value: function getBlueChannelFromHex(hex) { + var result = ColorUtils.hexToChannels(hex); + return result ? parseInt(result[3], 16) : 0; + } + }, { + key: "getAlphaChannelFromHex", + value: function getAlphaChannelFromHex(hex) { + var result = ColorUtils.hexToChannels(hex); + return result && result.length === 5 ? parseInt(result[4], 16) : null; + } + }, { + key: "applyDarknessToChannel", + value: function applyDarknessToChannel(color, darkPercentageDecrease) { + return Math.min(255, Math.round(Math.max(0, color + color * (darkPercentageDecrease / 100)))); + } + }, { + key: "applyDarknessToHex", + value: function applyDarknessToHex(hex) { + var darkPercentageDecrease = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 255; + var red = ColorUtils.applyDarknessToChannel(ColorUtils.getRedChannelFromHex(hex), darkPercentageDecrease); + var green = ColorUtils.applyDarknessToChannel(ColorUtils.getGreenChannelFromHex(hex), darkPercentageDecrease); + var blue = ColorUtils.applyDarknessToChannel(ColorUtils.getBlueChannelFromHex(hex), darkPercentageDecrease); + return "#".concat(ColorUtils.componentToHex(red)).concat(ColorUtils.componentToHex(green)).concat(ColorUtils.componentToHex(blue)).concat(ColorUtils.componentToHex(alpha)); + } + }, { + key: "applyDarknessToColor", + value: function applyDarknessToColor(color) { + var darkPercentageDecrease = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var alpha = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 255; + var hex = color; + + if (color.startsWith("rgba")) { + hex = ColorUtils.RGBAToHex(color); + } + + return ColorUtils.applyDarknessToHex(hex, darkPercentageDecrease, alpha); + } + }, { + key: "hexToRGBA", + value: function hexToRGBA(hex) { + var red = parseInt(hex.slice(1, 3), 16); + var green = parseInt(hex.slice(3, 5), 16); + var blue = parseInt(hex.slice(5, 7), 16); + var alpha = parseInt(hex.slice(7, 9), 16); + return "rgba(\"" + red + "\",\"" + green + "\",\"" + blue + "\",\"" + alpha + "\")"; + } + }, { + key: "hexToRGBAComponents", + value: function hexToRGBAComponents(hex) { + var red = parseInt(hex.slice(1, 3), 16); + var green = parseInt(hex.slice(3, 5), 16); + var blue = parseInt(hex.slice(5, 7), 16); + var alpha = parseInt(hex.slice(7, 9), 16); + return { + red: red, + green: green, + blue: blue, + alpha: alpha + }; + } + }, { + key: "RGBAChannelsToHex", + value: function RGBAChannelsToHex(red, green, blue, alpha) { + return "#".concat(ColorUtils.componentToHex(red)).concat(ColorUtils.componentToHex(green)).concat(ColorUtils.componentToHex(blue)).concat(ColorUtils.componentToHex(alpha * 255)); + } + }, { + key: "RGBAToHex", + value: function RGBAToHex(rgba) { + var _ColorUtils$RGBAToCha = ColorUtils.RGBAToChannels(rgba), + _ColorUtils$RGBAToCha2 = (0, _toArray2.default)(_ColorUtils$RGBAToCha), + match = _ColorUtils$RGBAToCha2[0], + channels = _ColorUtils$RGBAToCha2.slice(1); + + return ColorUtils.RGBAChannelsToHex.apply(ColorUtils, (0, _toConsumableArray2.default)(channels)); + } + }, { + key: "RGBToHex", + value: function RGBToHex(red, green, blue) { + return "#".concat(ColorUtils.componentToHex(red)).concat(ColorUtils.componentToHex(green)).concat(ColorUtils.componentToHex(blue)); + } + }, { + key: "getDarknessScore", + value: function getDarknessScore(color) { + var redChannel = ColorUtils.getRedChannelFromHex(color); + var greenChannel = ColorUtils.getGreenChannelFromHex(color); + var blueChannel = ColorUtils.getBlueChannelFromHex(color); + return 1 - (0.299 * redChannel + 0.587 * greenChannel + 0.114 * blueChannel) / 255; + } + }, { + key: "isClearColor", + value: function isClearColor(color) { + return ColorUtils.getDarknessScore(color) < 0.4; + } + }, { + key: "determineTextColor", + value: function determineTextColor(color) { + return ColorUtils.isClearColor(color) ? colors.grey1000 : colors.white; + } + }]); + return ColorUtils; + }(); + + exports.default = ColorUtils; +},463,[5,21,464,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _toArray(arr) { + return _$$_REQUIRE(_dependencyMap[0])(arr) || _$$_REQUIRE(_dependencyMap[1])(arr) || _$$_REQUIRE(_dependencyMap[2])(arr) || _$$_REQUIRE(_dependencyMap[3])(); + } + + module.exports = _toArray, module.exports.__esModule = true, module.exports["default"] = module.exports; +},464,[42,24,25,44]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var CssUtils = function () { + function CssUtils() { + (0, _classCallCheck2.default)(this, CssUtils); + } + + (0, _createClass2.default)(CssUtils, null, [{ + key: "grayscaleValue", + value: function grayscaleValue(style) { + var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; + var value = CssUtils.parseFilterValue(CssUtils.getFilterAttributeStyle(style), "grayscale"); + + if (value !== undefined) { + return value; + } + + return defaultValue; + } + }, { + key: "getAttributeFromStyle", + value: function getAttributeFromStyle(key) { + var _attributeValue; + + var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + var remove = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var attributeValue; + + if (key) { + if (Array.isArray(style)) { + for (var i = 0; i < style.length; i++) { + var _CssUtils$getAttribut; + + attributeValue = (_CssUtils$getAttribut = CssUtils.getAttributeFromStyle(key, style[i], undefined, remove)) != null ? _CssUtils$getAttribut : attributeValue; + } + } else if (typeof style === "object") { + if (style[key] !== undefined) { + attributeValue = style[key]; + + if (remove) { + delete style[key]; + } + } + } + } + + return (_attributeValue = attributeValue) != null ? _attributeValue : defaultValue; + } + }, { + key: "getFilterAttributeStyle", + value: function getFilterAttributeStyle() { + var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return CssUtils.getAttributeFromStyle("filter", style, defaultValue); + } + }, { + key: "getTintColorAttributeStyle", + value: function getTintColorAttributeStyle() { + var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return CssUtils.getAttributeFromStyle("tintColor", style, defaultValue); + } + }, { + key: "deleteKeysFromStyle", + value: function deleteKeysFromStyle(style) { + var keys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (style === null || style === undefined) { + return style; + } + + if (Array.isArray(style)) { + return style.map(function (item) { + return CssUtils.deleteKeysFromStyle(item, keys); + }); + } + + if (typeof style === "object") { + var newStyle = {}; + Object.keys(style).forEach(function (attribute) { + if (!keys.includes(attribute)) { + newStyle[attribute] = style[attribute]; + } + }); + return newStyle; + } + + return style; + } + }, { + key: "parseFilterValue", + value: function parseFilterValue(filter, filterType) { + var regex = new RegExp(filterType + "\\(([0-9]{1,3})%\\)"); + + if (filter) { + var result = regex.exec(filter); + + if (result && result[1]) { + return parseInt(result[1], 10); + } + } + + return undefined; + } + }, { + key: "getConstraintInsideStyle", + value: function getConstraintInsideStyle(style, constraint, dpiDivider) { + var constraints = { + start: 0, + end: 0, + top: 0, + bottom: 0 + }; + Object.keys(style).forEach(function (key) { + if (key.startsWith(constraint)) { + if (key.includes("Left") || key.includes("Start")) { + constraints.start = style[key]; + } else if (key.includes("Right") || key.includes("End")) { + constraints.end = style[key]; + } else if (key.includes("Top")) { + constraints.top = style[key]; + } else if (key.includes("Bottom")) { + constraints.bottom = style[key]; + } else if (key.includes("Horizontal")) { + constraints.start = style[key] / 2; + constraints.end = style[key] / 2; + } else if (key.includes("Vertical")) { + constraints.top = style[key] / 2; + constraints.bottom = style[key] / 2; + } else if (key === constraint || key === constraint + "Width") { + constraints.start = style[key]; + constraints.end = style[key]; + constraints.top = style[key]; + constraints.bottom = style[key]; + } + } + }); + return { + start: constraints.start / dpiDivider, + end: constraints.end / dpiDivider, + top: constraints.top / dpiDivider, + bottom: constraints.bottom / dpiDivider + }; + } + }, { + key: "updateSizeByApplingStyle", + value: function updateSizeByApplingStyle(size, style) { + var margin = CssUtils.getConstraintInsideStyle(style, "margin", 1); + var padding = CssUtils.getConstraintInsideStyle(style, "padding", 1); + var border = CssUtils.getConstraintInsideStyle(style, "border", 1); + var horizontalConstraint = margin.start + margin.end + padding.start + padding.end + border.start + border.end; + var verticalConstraint = margin.top + margin.bottom + padding.top + padding.bottom + border.top + border.bottom; + return { + width: Math.max(0, size.width - horizontalConstraint), + height: Math.max(0, size.height - verticalConstraint) + }; + } + }]); + return CssUtils; + }(); + + exports.default = CssUtils; +},465,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _moment = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var DateUtils = function () { + function DateUtils() { + (0, _classCallCheck2.default)(this, DateUtils); + } + + (0, _createClass2.default)(DateUtils, null, [{ + key: "getSeparator", + value: function getSeparator() { + var locale = _moment.default.locale(); + + if (locale.includes("de") || locale.includes("fr")) { + return "."; + } + + if (locale.includes("ar") || locale.includes("du")) { + return "-"; + } + + return "/"; + } + }, { + key: "getCalendarText", + value: function getCalendarText(issue, dateFormat) { + var calendarText = ""; + + switch (dateFormat) { + case "0": + case "1": + case "14": + calendarText = issue.substr(issue.length - 2); + break; + + case "2": + case "4": + case "98": + calendarText = issue.substr(4, 2); + break; + } + + if (calendarText.length > 0 && dateFormat !== "98") { + calendarText = "" + parseInt(calendarText, 10); + } + + return calendarText; + } + }, { + key: "getPatternByDateFormat", + value: function getPatternByDateFormat(separator, dateFormat, showWeek) { + var pattern = ""; + + switch (dateFormat) { + case "0": + pattern = "DD" + separator + "MM" + separator + "YYYY"; + break; + + case "1": + pattern = "MM" + separator + "DD" + separator + "YYYY"; + break; + + case "2": + case "98": + pattern = "MM YYYY"; + break; + + case "4": + pattern = "MMMM YYYY"; + break; + + default: + pattern = "YYYYMMDD"; + } + + if (showWeek && dateFormat !== "98") { + pattern = "ddd " + pattern; + } + + return pattern; + } + }, { + key: "getCurrentYear", + value: function getCurrentYear() { + return (0, _moment.default)().year(); + } + }, { + key: "formatDate", + value: function formatDate(issue, pattern) { + var date = issue; + + try { + date = (0, _moment.default)(issue, "YYYYMMDD").format(pattern); + } catch (e) {} + + return date; + } + }, { + key: "subDaysToToday", + value: function subDaysToToday() { + var days = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var mToday = (0, _moment.default)(); + return mToday.subtract(days, "days"); + } + }, { + key: "addDaysToToday", + value: function addDaysToToday() { + var days = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + return (0, _moment.default)().add(days, "days"); + } + }, { + key: "addDaysToDate", + value: function addDaysToDate(date) { + var days = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + return (0, _moment.default)(date).add(days, "days"); + } + }, { + key: "subDaysToDate", + value: function subDaysToDate(date) { + var days = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + return (0, _moment.default)(date).subtract(days, "days"); + } + }, { + key: "getMomentStartOfDay", + value: function getMomentStartOfDay(date) { + return (0, _moment.default)(date).startOf("day"); + } + }, { + key: "getMomentDate", + value: function getMomentDate(date, format) { + if (format) { + return (0, _moment.default)(date, format); + } + + return (0, _moment.default)(date); + } + }, { + key: "getDaysFromDateToToday", + value: function getDaysFromDateToToday(date) { + var mDate = (0, _moment.default)(date); + var mToday = (0, _moment.default)(); + return mToday.diff(mDate, "days") + 1; + } + }, { + key: "getDateString", + value: function getDateString(date, format) { + return (0, _moment.default)(date).format(format); + } + }, { + key: "toDate", + value: function toDate(date, format) { + return (0, _moment.default)(date, format).toDate(); + } + }, { + key: "unixToString", + value: function unixToString(unix, format) { + return _moment.default.unix(unix).utc().format(format); + } + }, { + key: "stringToUnix", + value: function stringToUnix(string, format) { + return (0, _moment.default)(string, format).unix(); + } + }, { + key: "fromNow", + value: function fromNow(value, format) { + if (format && typeof value === "string") { + return (0, _moment.default)(value, format).fromNow(); + } + + return _moment.default.unix(value).fromNow(); + } + }, { + key: "getTodayString", + value: function getTodayString(pattern) { + return (0, _moment.default)().format(pattern); + } + }, { + key: "getYesterdayString", + value: function getYesterdayString(pattern) { + return (0, _moment.default)().subtract(1, "day").format(pattern); + } + }, { + key: "getTomorrowString", + value: function getTomorrowString(pattern) { + return (0, _moment.default)().add(1, "day").format(pattern); + } + }, { + key: "getTimeRange", + value: function getTimeRange(timeRange) { + switch (timeRange) { + case "today": + return this.today(); + + case "tomorrow": + return this.tomorrow(); + + case "this_week": + return this.thisWeek(); + + case "next_week": + return this.nextWeek(); + + case "this_weekend": + return this.thisWeekend(); + + default: + return undefined; + } + } + }, { + key: "getTimeRangeString", + value: function getTimeRangeString(timeRange) { + switch (timeRange) { + case "all": + return global.strings("all"); + + case "today": + return global.strings("str_today"); + + case "tomorrow": + return global.strings("str_tomorrow"); + + case "this_week": + return global.strings("str_this_week"); + + case "next_week": + return global.strings("str_next_week"); + + case "this_weekend": + return global.strings("str_this_weekend"); + + case "custom": + return global.strings("str_custom"); + + default: + return ""; + } + } + }, { + key: "logTimestamp", + value: function logTimestamp() { + return (0, _moment.default)().format("HH:mm:ss.SSS"); + } + }, { + key: "today", + value: function today() { + return { + begin: (0, _moment.default)().startOf("day"), + end: (0, _moment.default)().startOf("day") + }; + } + }, { + key: "tomorrow", + value: function tomorrow() { + return { + begin: (0, _moment.default)().add(1, "day"), + end: (0, _moment.default)().add(1, "day") + }; + } + }, { + key: "thisWeek", + value: function thisWeek() { + var monday = (0, _moment.default)().weekday(1); + var sunday = (0, _moment.default)().weekday(8); + return { + begin: monday.utc().startOf("day"), + end: sunday.utc().startOf("day") + }; + } + }, { + key: "nextWeek", + value: function nextWeek() { + var monday = (0, _moment.default)().weekday(8); + var sunday = (0, _moment.default)().weekday(15); + return { + begin: monday.utc().startOf("day"), + end: sunday.utc().startOf("day") + }; + } + }, { + key: "thisWeekend", + value: function thisWeekend() { + var friday = (0, _moment.default)().weekday(5); + var sunday = (0, _moment.default)().weekday(8); + return { + begin: friday.utc().startOf("day"), + end: sunday.utc().startOf("day") + }; + } + }, { + key: "nextWeekend", + value: function nextWeekend() { + var friday = (0, _moment.default)().weekday(12); + var sunday = (0, _moment.default)().weekday(15); + return { + begin: friday.utc().startOf("day"), + end: sunday.utc().startOf("day") + }; + } + }, { + key: "customDateRange", + value: function customDateRange(startDate, endDate) { + var begin = (0, _moment.default)(startDate); + var end = (0, _moment.default)(endDate); + return { + begin: begin, + end: end + }; + } + }, { + key: "initMomentLocale", + value: function initMomentLocale(locale) { + if (locale.indexOf("ar") === 0) { + _$$_REQUIRE(_dependencyMap[4]); + + _moment.default.locale("ar"); + } else if (locale.indexOf("it") === 0) { + _$$_REQUIRE(_dependencyMap[5]); + + _moment.default.locale("it"); + } else if (locale.indexOf("da") === 0) { + _$$_REQUIRE(_dependencyMap[6]); + + _moment.default.locale("da"); + } else if (locale.indexOf("de") === 0) { + _$$_REQUIRE(_dependencyMap[7]); + + _moment.default.locale("de"); + } else if (locale.indexOf("fr-FR") === 0) { + _$$_REQUIRE(_dependencyMap[8]); + + _moment.default.locale("fr"); + } else if (locale.indexOf("nl-NL") === 0) { + _$$_REQUIRE(_dependencyMap[9]); + + _moment.default.locale("nl"); + } else if (locale.indexOf("es-ES") === 0) { + _$$_REQUIRE(_dependencyMap[10]); + + _moment.default.locale("es"); + } else if (locale.indexOf("ro-RO") === 0) { + _$$_REQUIRE(_dependencyMap[11]); + + _moment.default.locale("ro"); + } else if (locale.indexOf("sv") === 0) { + _$$_REQUIRE(_dependencyMap[12]); + + _moment.default.locale("sv"); + } else if (locale.indexOf("pt-PT") === 0) { + _$$_REQUIRE(_dependencyMap[13]); + + _moment.default.locale("pt"); + } else if (locale.indexOf("pt-BR") === 0) { + _$$_REQUIRE(_dependencyMap[14]); + + _moment.default.locale("pt-br"); + } else if (locale.indexOf("nl-BE") === 0) { + _$$_REQUIRE(_dependencyMap[15]); + + _moment.default.locale("nl-be"); + } else if (locale.indexOf("nn-NO") === 0) { + _$$_REQUIRE(_dependencyMap[16]); + + _moment.default.locale("nn"); + } else if (locale.indexOf("nb-NO") === 0) { + _$$_REQUIRE(_dependencyMap[17]); + + _moment.default.locale("nb"); + } else if (locale.indexOf("sl") === 0) { + _$$_REQUIRE(_dependencyMap[18]); + + _moment.default.locale("sl"); + } else { + _moment.default.locale("en"); + } + } + }, { + key: "getClosestEventDate", + value: function getClosestEventDate(event) { + var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date(); + var numberOfEventInstances = event.instances.length; + var startDate; + var outputResult = ""; + var now = this.getMomentStartOfDay(start); + + for (var i = 0; i < numberOfEventInstances; i++) { + startDate = DateUtils.getMomentDate(event.instances[i].startDateTime); + + if (startDate >= now) { + outputResult += startDate.utc().format("ddd, LL"); + return outputResult; + } + } + + return "The Event is over"; + } + }, { + key: "getCurrentDateString", + value: function getCurrentDateString() { + var currentDate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date(); + var year = String(currentDate.getUTCFullYear()); + var month = String(currentDate.getUTCMonth() + 1); + var date = String(currentDate.getUTCDate()); + var hours = String(currentDate.getUTCHours()); + var minutes = String(currentDate.getUTCMinutes()); + var seconds = String(currentDate.getUTCSeconds()); + + if (typeof month.padStart === "function") { + month = month.padStart(2, "0"); + date = date.padStart(2, "0"); + hours = hours.padStart(2, "0"); + minutes = minutes.padStart(2, "0"); + seconds = seconds.padStart(2, "0"); + } else { + if (month.length === 1) { + month = "0" + month; + } + + if (date.length === 1) { + date = "0" + date; + } + + if (hours.length === 1) { + hours = "0" + hours; + } + + if (minutes.length === 1) { + minutes = "0" + minutes; + } + + if (seconds.length === 1) { + seconds = "0" + seconds; + } + } + + var str = year + month + date + hours + minutes + seconds; + return str; + } + }, { + key: "getDayAndMonthStringByLanguage", + value: function getDayAndMonthStringByLanguage(issue, dateFormat, language) { + switch (dateFormat) { + case "0": + case "1": + switch (language) { + case "1": + case "2": + case "3": + case "4": + case "11": + case "6": + case "7": + return DateUtils.formatDate(issue, "DD MMMM"); + + case "5": + case "9": + case "10": + return DateUtils.formatDate(issue, "DD [de] MMMM"); + + case "8": + case "12": + case "13": + return DateUtils.formatDate(issue, "DD[.] MMMM"); + + default: + return DateUtils.formatDate(issue, "MMMM Do"); + } + + case "2": + case "98": + return DateUtils.formatDate(issue, "MM YYYY"); + + case "4": + return DateUtils.formatDate(issue, "MMMM YYYY"); + + default: + return DateUtils.formatDate(issue, "YYYYMMDD"); + } + } + }, { + key: "getUnixTimestampFromDateTimeString", + value: function getUnixTimestampFromDateTimeString(dateTimeString) { + if (dateTimeString) { + if (dateTimeString.length === 8) { + dateTimeString += "_000000"; + } + + if (dateTimeString.length === 14 || dateTimeString.length === 15) { + var format = "YYYYMMDDHHmmss"; + + if (dateTimeString.length === 15) { + format = "YYYYMMDD_HHmmss"; + } + + return DateUtils.stringToUnix(dateTimeString + " +0000", format + " Z") * 1000; + } + } + + return undefined; + } + }]); + return DateUtils; + }(); + + exports.default = DateUtils; + DateUtils.SECOND_IN_MILLS = 1000; + DateUtils.MINUTE_IN_MILLS = 60 * DateUtils.SECOND_IN_MILLS; + DateUtils.HOUR_IN_MILLS = 60 * DateUtils.MINUTE_IN_MILLS; + DateUtils.DAY_IN_MILLS = 24 * DateUtils.HOUR_IN_MILLS; + + DateUtils.dateFormatter = function (date) { + if (!date) { + return ""; + } + + var out = ""; + + for (var c = 0; c < date.length; c++) { + if (date[c] === "T" || date[c] === "Z") { + out += " "; + } else { + out += date[c]; + } + } + + return out.substring(0, 10); + }; +},466,[5,7,8,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.moment = factory(); + })(this, function () { + 'use strict'; + + var hookCallback; + + function hooks() { + return hookCallback.apply(null, arguments); + } + + function setHookCallback(callback) { + hookCallback = callback; + } + + function isArray(input) { + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; + } + + function isObject(input) { + return input != null && Object.prototype.toString.call(input) === '[object Object]'; + } + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function isObjectEmpty(obj) { + if (Object.getOwnPropertyNames) { + return Object.getOwnPropertyNames(obj).length === 0; + } else { + var k; + + for (k in obj) { + if (hasOwnProp(obj, k)) { + return false; + } + } + + return true; + } + } + + function isUndefined(input) { + return input === undefined; + } + + function isNumber(input) { + return typeof input === 'number' || Object.prototype.toString.call(input) === '[object Number]'; + } + + function isDate(input) { + return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; + } + + function map(arr, fn) { + var res = [], + i, + arrLen = arr.length; + + for (i = 0; i < arrLen; ++i) { + res.push(fn(arr[i], i)); + } + + return res; + } + + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; + } + } + + if (hasOwnProp(b, 'toString')) { + a.toString = b.toString; + } + + if (hasOwnProp(b, 'valueOf')) { + a.valueOf = b.valueOf; + } + + return a; + } + + function createUTC(input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, true).utc(); + } + + function defaultParsingFlags() { + return { + empty: false, + unusedTokens: [], + unusedInput: [], + overflow: -2, + charsLeftOver: 0, + nullInput: false, + invalidEra: null, + invalidMonth: null, + invalidFormat: false, + userInvalidated: false, + iso: false, + parsedDateParts: [], + era: null, + meridiem: null, + rfc2822: false, + weekdayMismatch: false + }; + } + + function getParsingFlags(m) { + if (m._pf == null) { + m._pf = defaultParsingFlags(); + } + + return m._pf; + } + + var some; + + if (Array.prototype.some) { + some = Array.prototype.some; + } else { + some = function some(fun) { + var t = Object(this), + len = t.length >>> 0, + i; + + for (i = 0; i < len; i++) { + if (i in t && fun.call(this, t[i], i, t)) { + return true; + } + } + + return false; + }; + } + + function isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m), + parsedParts = some.call(flags.parsedDateParts, function (i) { + return i != null; + }), + isNowValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts); + + if (m._strict) { + isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; + } + + if (Object.isFrozen == null || !Object.isFrozen(m)) { + m._isValid = isNowValid; + } else { + return isNowValid; + } + } + + return m._isValid; + } + + function createInvalid(flags) { + var m = createUTC(NaN); + + if (flags != null) { + extend(getParsingFlags(m), flags); + } else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } + + var momentProperties = hooks.momentProperties = [], + updateInProgress = false; + + function copyConfig(to, from) { + var i, + prop, + val, + momentPropertiesLen = momentProperties.length; + + if (!isUndefined(from._isAMomentObject)) { + to._isAMomentObject = from._isAMomentObject; + } + + if (!isUndefined(from._i)) { + to._i = from._i; + } + + if (!isUndefined(from._f)) { + to._f = from._f; + } + + if (!isUndefined(from._l)) { + to._l = from._l; + } + + if (!isUndefined(from._strict)) { + to._strict = from._strict; + } + + if (!isUndefined(from._tzm)) { + to._tzm = from._tzm; + } + + if (!isUndefined(from._isUTC)) { + to._isUTC = from._isUTC; + } + + if (!isUndefined(from._offset)) { + to._offset = from._offset; + } + + if (!isUndefined(from._pf)) { + to._pf = getParsingFlags(from); + } + + if (!isUndefined(from._locale)) { + to._locale = from._locale; + } + + if (momentPropertiesLen > 0) { + for (i = 0; i < momentPropertiesLen; i++) { + prop = momentProperties[i]; + val = from[prop]; + + if (!isUndefined(val)) { + to[prop] = val; + } + } + } + + return to; + } + + function Moment(config) { + copyConfig(this, config); + this._d = new Date(config._d != null ? config._d.getTime() : NaN); + + if (!this.isValid()) { + this._d = new Date(NaN); + } + + if (updateInProgress === false) { + updateInProgress = true; + hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment(obj) { + return obj instanceof Moment || obj != null && obj._isAMomentObject != null; + } + + function warn(msg) { + if (hooks.suppressDeprecationWarnings === false && typeof console !== 'undefined' && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + return extend(function () { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(null, msg); + } + + if (firstTime) { + var args = [], + arg, + i, + key, + argLen = arguments.length; + + for (i = 0; i < argLen; i++) { + arg = ''; + + if (typeof arguments[i] === 'object') { + arg += '\n[' + i + '] '; + + for (key in arguments[0]) { + if (hasOwnProp(arguments[0], key)) { + arg += key + ': ' + arguments[0][key] + ', '; + } + } + + arg = arg.slice(0, -2); + } else { + arg = arguments[i]; + } + + args.push(arg); + } + + warn(msg + '\nArguments: ' + Array.prototype.slice.call(args).join('') + '\n' + new Error().stack); + firstTime = false; + } + + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (hooks.deprecationHandler != null) { + hooks.deprecationHandler(name, msg); + } + + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + hooks.suppressDeprecationWarnings = false; + hooks.deprecationHandler = null; + + function isFunction(input) { + return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function set(config) { + var prop, i; + + for (i in config) { + if (hasOwnProp(config, i)) { + prop = config[i]; + + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + } + + this._config = config; + this._dayOfMonthOrdinalParseLenient = new RegExp((this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + '|' + /\d{1,2}/.source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), + prop; + + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + + for (prop in parentConfig) { + if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) { + res[prop] = extend({}, res[prop]); + } + } + + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } + } + + var keys; + + if (Object.keys) { + keys = Object.keys; + } else { + keys = function keys(obj) { + var i, + res = []; + + for (i in obj) { + if (hasOwnProp(obj, i)) { + res.push(i); + } + } + + return res; + }; + } + + var defaultCalendar = { + sameDay: '[Today at] LT', + nextDay: '[Tomorrow at] LT', + nextWeek: 'dddd [at] LT', + lastDay: '[Yesterday at] LT', + lastWeek: '[Last] dddd [at] LT', + sameElse: 'L' + }; + + function calendar(key, mom, now) { + var output = this._calendar[key] || this._calendar['sameElse']; + return isFunction(output) ? output.call(mom, now) : output; + } + + function zeroFill(number, targetLength, forceSign) { + var absNumber = '' + Math.abs(number), + zerosToFill = targetLength - absNumber.length, + sign = number >= 0; + return (sign ? forceSign ? '+' : '' : '-') + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; + } + + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, + localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, + formatFunctions = {}, + formatTokenFunctions = {}; + + function addFormatToken(token, padded, ordinal, callback) { + var func = callback; + + if (typeof callback === 'string') { + func = function func() { + return this[callback](); + }; + } + + if (token) { + formatTokenFunctions[token] = func; + } + + if (padded) { + formatTokenFunctions[padded[0]] = function () { + return zeroFill(func.apply(this, arguments), padded[1], padded[2]); + }; + } + + if (ordinal) { + formatTokenFunctions[ordinal] = function () { + return this.localeData().ordinal(func.apply(this, arguments), token); + }; + } + } + + function removeFormattingTokens(input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|\]$/g, ''); + } + + return input.replace(/\\/g, ''); + } + + function makeFormatFunction(format) { + var array = format.match(formattingTokens), + i, + length; + + for (i = 0, length = array.length; i < length; i++) { + if (formatTokenFunctions[array[i]]) { + array[i] = formatTokenFunctions[array[i]]; + } else { + array[i] = removeFormattingTokens(array[i]); + } + } + + return function (mom) { + var output = '', + i; + + for (i = 0; i < length; i++) { + output += isFunction(array[i]) ? array[i].call(mom, format) : array[i]; + } + + return output; + }; + } + + function formatMoment(m, format) { + if (!m.isValid()) { + return m.localeData().invalidDate(); + } + + format = expandFormat(format, m.localeData()); + formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); + return formatFunctions[format](m); + } + + function expandFormat(format, locale) { + var i = 5; + + function replaceLongDateFormatTokens(input) { + return locale.longDateFormat(input) || input; + } + + localFormattingTokens.lastIndex = 0; + + while (i >= 0 && localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + localFormattingTokens.lastIndex = 0; + i -= 1; + } + + return format; + } + + var defaultLongDateFormat = { + LTS: 'h:mm:ss A', + LT: 'h:mm A', + L: 'MM/DD/YYYY', + LL: 'MMMM D, YYYY', + LLL: 'MMMM D, YYYY h:mm A', + LLLL: 'dddd, MMMM D, YYYY h:mm A' + }; + + function longDateFormat(key) { + var format = this._longDateFormat[key], + formatUpper = this._longDateFormat[key.toUpperCase()]; + + if (format || !formatUpper) { + return format; + } + + this._longDateFormat[key] = formatUpper.match(formattingTokens).map(function (tok) { + if (tok === 'MMMM' || tok === 'MM' || tok === 'DD' || tok === 'dddd') { + return tok.slice(1); + } + + return tok; + }).join(''); + return this._longDateFormat[key]; + } + + var defaultInvalidDate = 'Invalid date'; + + function invalidDate() { + return this._invalidDate; + } + + var defaultOrdinal = '%d', + defaultDayOfMonthOrdinalParse = /\d{1,2}/; + + function ordinal(number) { + return this._ordinal.replace('%d', number); + } + + var defaultRelativeTime = { + future: 'in %s', + past: '%s ago', + s: 'a few seconds', + ss: '%d seconds', + m: 'a minute', + mm: '%d minutes', + h: 'an hour', + hh: '%d hours', + d: 'a day', + dd: '%d days', + w: 'a week', + ww: '%d weeks', + M: 'a month', + MM: '%d months', + y: 'a year', + yy: '%d years' + }; + + function relativeTime(number, withoutSuffix, string, isFuture) { + var output = this._relativeTime[string]; + return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number); + } + + function pastFuture(diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return isFunction(format) ? format(output) : format.replace(/%s/i, output); + } + + var aliases = {}; + + function addUnitAlias(unit, shorthand) { + var lowerCase = unit.toLowerCase(); + aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; + } + + function normalizeUnits(units) { + return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; + } + + function normalizeObjectUnits(inputObject) { + var normalizedInput = {}, + normalizedProp, + prop; + + for (prop in inputObject) { + if (hasOwnProp(inputObject, prop)) { + normalizedProp = normalizeUnits(prop); + + if (normalizedProp) { + normalizedInput[normalizedProp] = inputObject[prop]; + } + } + } + + return normalizedInput; + } + + var priorities = {}; + + function addUnitPriority(unit, priority) { + priorities[unit] = priority; + } + + function getPrioritizedUnits(unitsObj) { + var units = [], + u; + + for (u in unitsObj) { + if (hasOwnProp(unitsObj, u)) { + units.push({ + unit: u, + priority: priorities[u] + }); + } + } + + units.sort(function (a, b) { + return a.priority - b.priority; + }); + return units; + } + + function isLeapYear(year) { + return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0; + } + + function absFloor(number) { + if (number < 0) { + return Math.ceil(number) || 0; + } else { + return Math.floor(number); + } + } + + function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, + value = 0; + + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + + return value; + } + + function makeGetSet(unit, keepTime) { + return function (value) { + if (value != null) { + set$1(this, unit, value); + hooks.updateOffset(this, keepTime); + return this; + } else { + return get(this, unit); + } + }; + } + + function get(mom, unit) { + return mom.isValid() ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function set$1(mom, unit, value) { + if (mom.isValid() && !isNaN(value)) { + if (unit === 'FullYear' && isLeapYear(mom.year()) && mom.month() === 1 && mom.date() === 29) { + value = toInt(value); + + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value, mom.month(), daysInMonth(value, mom.month())); + } else { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + } + } + + function stringGet(units) { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](); + } + + return this; + } + + function stringSet(units, value) { + if (typeof units === 'object') { + units = normalizeObjectUnits(units); + var prioritized = getPrioritizedUnits(units), + i, + prioritizedLen = prioritized.length; + + for (i = 0; i < prioritizedLen; i++) { + this[prioritized[i].unit](units[prioritized[i].unit]); + } + } else { + units = normalizeUnits(units); + + if (isFunction(this[units])) { + return this[units](value); + } + } + + return this; + } + + var match1 = /\d/, + match2 = /\d\d/, + match3 = /\d{3}/, + match4 = /\d{4}/, + match6 = /[+-]?\d{6}/, + match1to2 = /\d\d?/, + match3to4 = /\d\d\d\d?/, + match5to6 = /\d\d\d\d\d\d?/, + match1to3 = /\d{1,3}/, + match1to4 = /\d{1,4}/, + match1to6 = /[+-]?\d{1,6}/, + matchUnsigned = /\d+/, + matchSigned = /[+-]?\d+/, + matchOffset = /Z|[+-]\d\d:?\d\d/gi, + matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, + matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, + matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, + regexes; + regexes = {}; + + function addRegexToken(token, regex, strictRegex) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { + return isStrict && strictRegex ? strictRegex : regex; + }; + } + + function getParseRegexForToken(token, config) { + if (!hasOwnProp(regexes, token)) { + return new RegExp(unescapeFormat(token)); + } + + return regexes[token](config._strict, config._locale); + } + + function unescapeFormat(s) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + + var tokens = {}; + + function addParseToken(token, callback) { + var i, + func = callback, + tokenLen; + + if (typeof token === 'string') { + token = [token]; + } + + if (isNumber(callback)) { + func = function func(input, array) { + array[callback] = toInt(input); + }; + } + + tokenLen = token.length; + + for (i = 0; i < tokenLen; i++) { + tokens[token[i]] = func; + } + } + + function addWeekParseToken(token, callback) { + addParseToken(token, function (input, array, config, token) { + config._w = config._w || {}; + callback(input, config._w, config, token); + }); + } + + function addTimeToArrayFromToken(token, input, config) { + if (input != null && hasOwnProp(tokens, token)) { + tokens[token](input, config._a, config, token); + } + } + + var YEAR = 0, + MONTH = 1, + DATE = 2, + HOUR = 3, + MINUTE = 4, + SECOND = 5, + MILLISECOND = 6, + WEEK = 7, + WEEKDAY = 8; + + function mod(n, x) { + return (n % x + x) % x; + } + + var indexOf; + + if (Array.prototype.indexOf) { + indexOf = Array.prototype.indexOf; + } else { + indexOf = function indexOf(o) { + var i; + + for (i = 0; i < this.length; ++i) { + if (this[i] === o) { + return i; + } + } + + return -1; + }; + } + + function daysInMonth(year, month) { + if (isNaN(year) || isNaN(month)) { + return NaN; + } + + var modMonth = mod(month, 12); + year += (month - modMonth) / 12; + return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2; + } + + addFormatToken('M', ['MM', 2], 'Mo', function () { + return this.month() + 1; + }); + addFormatToken('MMM', 0, 0, function (format) { + return this.localeData().monthsShort(this, format); + }); + addFormatToken('MMMM', 0, 0, function (format) { + return this.localeData().months(this, format); + }); + addUnitAlias('month', 'M'); + addUnitPriority('month', 8); + addRegexToken('M', match1to2); + addRegexToken('MM', match1to2, match2); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); + addParseToken(['M', 'MM'], function (input, array) { + array[MONTH] = toInt(input) - 1; + }); + addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { + var month = config._locale.monthsParse(input, token, config._strict); + + if (month != null) { + array[MONTH] = month; + } else { + getParsingFlags(config).invalidMonth = input; + } + }); + var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), + defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), + MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, + defaultMonthsShortRegex = matchWord, + defaultMonthsRegex = matchWord; + + function localeMonths(m, format) { + if (!m) { + return isArray(this._months) ? this._months : this._months['standalone']; + } + + return isArray(this._months) ? this._months[m.month()] : this._months[(this._months.isFormat || MONTHS_IN_FORMAT).test(format) ? 'format' : 'standalone'][m.month()]; + } + + function localeMonthsShort(m, format) { + if (!m) { + return isArray(this._monthsShort) ? this._monthsShort : this._monthsShort['standalone']; + } + + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + function handleStrictParse(monthName, format, strict) { + var i, + ii, + mom, + llc = monthName.toLocaleLowerCase(); + + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + + for (i = 0; i < 12; ++i) { + mom = createUTC([2000, i]); + this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); + this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } + } + + function localeMonthsParse(monthName, format, strict) { + var i, mom, regex; + + if (this._monthsParseExact) { + return handleStrictParse.call(this, monthName, format, strict); + } + + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + } + + for (i = 0; i < 12; i++) { + mom = createUTC([2000, i]); + + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); + this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); + } + + if (!strict && !this._monthsParse[i]) { + regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); + this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + + if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { + return i; + } + } + } + + function setMonth(mom, value) { + var dayOfMonth; + + if (!mom.isValid()) { + return mom; + } + + if (typeof value === 'string') { + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + + if (!isNumber(value)) { + return mom; + } + } + } + + dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); + + mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); + + return mom; + } + + function getSetMonth(value) { + if (value != null) { + setMonth(this, value); + hooks.updateOffset(this, true); + return this; + } else { + return get(this, 'Month'); + } + } + + function getDaysInMonth() { + return daysInMonth(this.year(), this.month()); + } + + function monthsShortRegex(isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + if (!hasOwnProp(this, '_monthsShortRegex')) { + this._monthsShortRegex = defaultMonthsShortRegex; + } + + return this._monthsShortStrictRegex && isStrict ? this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + function monthsRegex(isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + if (!hasOwnProp(this, '_monthsRegex')) { + this._monthsRegex = defaultMonthsRegex; + } + + return this._monthsStrictRegex && isStrict ? this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse() { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], + longPieces = [], + mixedPieces = [], + i, + mom; + + for (i = 0; i < 12; i++) { + mom = createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + } + + for (i = 0; i < 24; i++) { + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + } + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? zeroFill(y, 4) : '+' + y; + }); + addFormatToken(0, ['YY', 2], 0, function () { + return this.year() % 100; + }); + addFormatToken(0, ['YYYY', 4], 0, 'year'); + addFormatToken(0, ['YYYYY', 5], 0, 'year'); + addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); + addUnitAlias('year', 'y'); + addUnitPriority('year', 1); + addRegexToken('Y', matchSigned); + addRegexToken('YY', match1to2, match2); + addRegexToken('YYYY', match1to4, match4); + addRegexToken('YYYYY', match1to6, match6); + addRegexToken('YYYYYY', match1to6, match6); + addParseToken(['YYYYY', 'YYYYYY'], YEAR); + addParseToken('YYYY', function (input, array) { + array[YEAR] = input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = hooks.parseTwoDigitYear(input); + }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); + + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + + hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; + + var getSetYear = makeGetSet('FullYear', true); + + function getIsLeapYear() { + return isLeapYear(this.year()); + } + + function createDate(y, m, d, h, M, s, ms) { + var date; + + if (y < 100 && y >= 0) { + date = new Date(y + 400, m, d, h, M, s, ms); + + if (isFinite(date.getFullYear())) { + date.setFullYear(y); + } + } else { + date = new Date(y, m, d, h, M, s, ms); + } + + return date; + } + + function createUTCDate(y) { + var date, args; + + if (y < 100 && y >= 0) { + args = Array.prototype.slice.call(arguments); + args[0] = y + 400; + date = new Date(Date.UTC.apply(null, args)); + + if (isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); + } + } else { + date = new Date(Date.UTC.apply(null, arguments)); + } + + return date; + } + + function firstWeekOffset(year, dow, doy) { + var fwd = 7 + dow - doy, + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + return -fwdlw + fwd - 1; + } + + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, + resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; + } + + return { + year: resYear, + dayOfYear: resDayOfYear + }; + } + + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, + resYear; + + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; + } + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + addUnitPriority('week', 5); + addUnitPriority('isoWeek', 5); + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + function localeWeek(mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow: 0, + doy: 6 + }; + + function localeFirstDayOfWeek() { + return this._week.dow; + } + + function localeFirstDayOfYear() { + return this._week.doy; + } + + function getSetWeek(input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek(input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + addFormatToken('d', 0, 'do', 'day'); + addFormatToken('dd', 0, 0, function (format) { + return this.localeData().weekdaysMin(this, format); + }); + addFormatToken('ddd', 0, 0, function (format) { + return this.localeData().weekdaysShort(this, format); + }); + addFormatToken('dddd', 0, 0, function (format) { + return this.localeData().weekdays(this, format); + }); + addFormatToken('e', 0, 0, 'weekday'); + addFormatToken('E', 0, 0, 'isoWeekday'); + addUnitAlias('day', 'd'); + addUnitAlias('weekday', 'e'); + addUnitAlias('isoWeekday', 'E'); + addUnitPriority('day', 11); + addUnitPriority('weekday', 11); + addUnitPriority('isoWeekday', 11); + addRegexToken('d', match1to2); + addRegexToken('e', match1to2); + addRegexToken('E', match1to2); + addRegexToken('dd', function (isStrict, locale) { + return locale.weekdaysMinRegex(isStrict); + }); + addRegexToken('ddd', function (isStrict, locale) { + return locale.weekdaysShortRegex(isStrict); + }); + addRegexToken('dddd', function (isStrict, locale) { + return locale.weekdaysRegex(isStrict); + }); + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); + + if (weekday != null) { + week.d = weekday; + } else { + getParsingFlags(config).invalidWeekday = input; + } + }); + addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { + week[token] = toInt(input); + }); + + function parseWeekday(input, locale) { + if (typeof input !== 'string') { + return input; + } + + if (!isNaN(input)) { + return parseInt(input, 10); + } + + input = locale.weekdaysParse(input); + + if (typeof input === 'number') { + return input; + } + + return null; + } + + function parseIsoWeekday(input, locale) { + if (typeof input === 'string') { + return locale.weekdaysParse(input) % 7 || 7; + } + + return isNaN(input) ? null : input; + } + + function shiftWeekdays(ws, n) { + return ws.slice(n, 7).concat(ws.slice(0, n)); + } + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), + defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), + defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), + defaultWeekdaysRegex = matchWord, + defaultWeekdaysShortRegex = matchWord, + defaultWeekdaysMinRegex = matchWord; + + function localeWeekdays(m, format) { + var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format) ? 'format' : 'standalone']; + return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays; + } + + function localeWeekdaysShort(m) { + return m === true ? shiftWeekdays(this._weekdaysShort, this._week.dow) : m ? this._weekdaysShort[m.day()] : this._weekdaysShort; + } + + function localeWeekdaysMin(m) { + return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin; + } + + function handleStrictParse$1(weekdayName, format, strict) { + var i, + ii, + mom, + llc = weekdayName.toLocaleLowerCase(); + + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._shortWeekdaysParse = []; + this._minWeekdaysParse = []; + + for (i = 0; i < 7; ++i) { + mom = createUTC([2000, 1]).day(i); + this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); + this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); + this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._shortWeekdaysParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._weekdaysParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._weekdaysParse, llc); + + if (ii !== -1) { + return ii; + } + + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } + } + + function localeWeekdaysParse(weekdayName, format, strict) { + var i, mom, regex; + + if (this._weekdaysParseExact) { + return handleStrictParse$1.call(this, weekdayName, format, strict); + } + + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } + + for (i = 0; i < 7; i++) { + mom = createUTC([2000, 1]).day(i); + + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$', 'i'); + } + + if (!this._weekdaysParse[i]) { + regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); + this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { + return i; + } + } + } + + function getSetDayOfWeek(input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + + if (input != null) { + input = parseWeekday(input, this.localeData()); + return this.add(input - day, 'd'); + } else { + return day; + } + } + + function getSetLocaleDayOfWeek(input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, 'd'); + } + + function getSetISODayOfWeek(input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + + if (input != null) { + var weekday = parseIsoWeekday(input, this.localeData()); + return this.day(this.day() % 7 ? weekday : weekday - 7); + } else { + return this.day() || 7; + } + } + + function weekdaysRegex(isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + + if (isStrict) { + return this._weekdaysStrictRegex; + } else { + return this._weekdaysRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysRegex')) { + this._weekdaysRegex = defaultWeekdaysRegex; + } + + return this._weekdaysStrictRegex && isStrict ? this._weekdaysStrictRegex : this._weekdaysRegex; + } + } + + function weekdaysShortRegex(isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + + if (isStrict) { + return this._weekdaysShortStrictRegex; + } else { + return this._weekdaysShortRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysShortRegex')) { + this._weekdaysShortRegex = defaultWeekdaysShortRegex; + } + + return this._weekdaysShortStrictRegex && isStrict ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex; + } + } + + function weekdaysMinRegex(isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + + if (isStrict) { + return this._weekdaysMinStrictRegex; + } else { + return this._weekdaysMinRegex; + } + } else { + if (!hasOwnProp(this, '_weekdaysMinRegex')) { + this._weekdaysMinRegex = defaultWeekdaysMinRegex; + } + + return this._weekdaysMinStrictRegex && isStrict ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex; + } + } + + function computeWeekdaysParse() { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var minPieces = [], + shortPieces = [], + longPieces = [], + mixedPieces = [], + i, + mom, + minp, + shortp, + longp; + + for (i = 0; i < 7; i++) { + mom = createUTC([2000, 1]).day(i); + minp = regexEscape(this.weekdaysMin(mom, '')); + shortp = regexEscape(this.weekdaysShort(mom, '')); + longp = regexEscape(this.weekdays(mom, '')); + minPieces.push(minp); + shortPieces.push(shortp); + longPieces.push(longp); + mixedPieces.push(minp); + mixedPieces.push(shortp); + mixedPieces.push(longp); + } + + minPieces.sort(cmpLenRev); + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._weekdaysShortRegex = this._weekdaysRegex; + this._weekdaysMinRegex = this._weekdaysRegex; + this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); + } + + function hFormat() { + return this.hours() % 12 || 12; + } + + function kFormat() { + return this.hours() || 24; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + addFormatToken('k', ['kk', 2], 0, kFormat); + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); + }); + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + zeroFill(this.seconds(), 2); + }); + + function meridiem(token, lowercase) { + addFormatToken(token, 0, 0, function () { + return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); + }); + } + + meridiem('a', true); + meridiem('A', false); + addUnitAlias('hour', 'h'); + addUnitPriority('hour', 13); + + function matchMeridiem(isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('k', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + addRegexToken('kk', match1to2, match2); + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + addParseToken(['H', 'HH'], HOUR); + addParseToken(['k', 'kk'], function (input, array, config) { + var kInput = toInt(input); + array[HOUR] = kInput === 24 ? 0 : kInput; + }); + addParseToken(['a', 'A'], function (input, array, config) { + config._isPm = config._locale.isPM(input); + config._meridiem = input; + }); + addParseToken(['h', 'hh'], function (input, array, config) { + array[HOUR] = toInt(input); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4, + pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4, + pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); + + function localeIsPM(input) { + return (input + '').toLowerCase().charAt(0) === 'p'; + } + + var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i, + getSetHour = makeGetSet('Hours', true); + + function localeMeridiem(hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; + } + } + + var baseConfig = { + calendar: defaultCalendar, + longDateFormat: defaultLongDateFormat, + invalidDate: defaultInvalidDate, + ordinal: defaultOrdinal, + dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse, + relativeTime: defaultRelativeTime, + months: defaultLocaleMonths, + monthsShort: defaultLocaleMonthsShort, + week: defaultLocaleWeek, + weekdays: defaultLocaleWeekdays, + weekdaysMin: defaultLocaleWeekdaysMin, + weekdaysShort: defaultLocaleWeekdaysShort, + meridiemParse: defaultLocaleMeridiemParse + }; + var locales = {}, + localeFamilies = {}, + globalLocale; + + function commonPrefix(arr1, arr2) { + var i, + minl = Math.min(arr1.length, arr2.length); + + for (i = 0; i < minl; i += 1) { + if (arr1[i] !== arr2[i]) { + return i; + } + } + + return minl; + } + + function normalizeLocale(key) { + return key ? key.toLowerCase().replace('_', '-') : key; + } + + function chooseLocale(names) { + var i = 0, + j, + next, + locale, + split; + + while (i < names.length) { + split = normalizeLocale(names[i]).split('-'); + j = split.length; + next = normalizeLocale(names[i + 1]); + next = next ? next.split('-') : null; + + while (j > 0) { + locale = loadLocale(split.slice(0, j).join('-')); + + if (locale) { + return locale; + } + + if (next && next.length >= j && commonPrefix(split, next) >= j - 1) { + break; + } + + j--; + } + + i++; + } + + return globalLocale; + } + + function isLocaleNameSane(name) { + return name.match('^[^/\\\\]*$') != null; + } + + function loadLocale(name) { + var oldLocale = null, + aliasedRequire; + + if (locales[name] === undefined && typeof module !== 'undefined' && module && module.exports && isLocaleNameSane(name)) { + try { + oldLocale = globalLocale._abbr; + aliasedRequire = _$$_REQUIRE; + aliasedRequire('./locale/' + name); + getSetGlobalLocale(oldLocale); + } catch (e) { + locales[name] = null; + } + } + + return locales[name]; + } + + function getSetGlobalLocale(key, values) { + var data; + + if (key) { + if (isUndefined(values)) { + data = getLocale(key); + } else { + data = defineLocale(key, values); + } + + if (data) { + globalLocale = data; + } else { + if (typeof console !== 'undefined' && console.warn) { + console.warn('Locale ' + key + ' not found. Did you forget to load it?'); + } + } + } + + return globalLocale._abbr; + } + + function defineLocale(name, config) { + if (config !== null) { + var locale, + parentConfig = baseConfig; + config.abbr = name; + + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."); + parentConfig = locales[name]._config; + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + parentConfig = locales[config.parentLocale]._config; + } else { + locale = loadLocale(config.parentLocale); + + if (locale != null) { + parentConfig = locale._config; + } else { + if (!localeFamilies[config.parentLocale]) { + localeFamilies[config.parentLocale] = []; + } + + localeFamilies[config.parentLocale].push({ + name: name, + config: config + }); + return null; + } + } + } + + locales[name] = new Locale(mergeConfigs(parentConfig, config)); + + if (localeFamilies[name]) { + localeFamilies[name].forEach(function (x) { + defineLocale(x.name, x.config); + }); + } + + getSetGlobalLocale(name); + return locales[name]; + } else { + delete locales[name]; + return null; + } + } + + function updateLocale(name, config) { + if (config != null) { + var locale, + tmpLocale, + parentConfig = baseConfig; + + if (locales[name] != null && locales[name].parentLocale != null) { + locales[name].set(mergeConfigs(locales[name]._config, config)); + } else { + tmpLocale = loadLocale(name); + + if (tmpLocale != null) { + parentConfig = tmpLocale._config; + } + + config = mergeConfigs(parentConfig, config); + + if (tmpLocale == null) { + config.abbr = name; + } + + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + } + + getSetGlobalLocale(name); + } else { + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + + if (name === getSetGlobalLocale()) { + getSetGlobalLocale(name); + } + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + + return locales[name]; + } + + function getLocale(key) { + var locale; + + if (key && key._locale && key._locale._abbr) { + key = key._locale._abbr; + } + + if (!key) { + return globalLocale; + } + + if (!isArray(key)) { + locale = loadLocale(key); + + if (locale) { + return locale; + } + + key = [key]; + } + + return chooseLocale(key); + } + + function listLocales() { + return keys(locales); + } + + function checkOverflow(m) { + var overflow, + a = m._a; + + if (a && getParsingFlags(m).overflow === -2) { + overflow = a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : a[HOUR] < 0 || a[HOUR] > 24 || a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0) ? HOUR : a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : -1; + + if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { + overflow = DATE; + } + + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } + + getParsingFlags(m).overflow = overflow; + } + + return m; + } + + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, + basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, + tzRegex = /Z|[+-]\d\d(?::?\d\d)?/, + isoDates = [['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], ['GGGG-[W]WW', /\d{4}-W\d\d/, false], ['YYYY-DDD', /\d{4}-\d{3}/], ['YYYY-MM', /\d{4}-\d\d/, false], ['YYYYYYMMDD', /[+-]\d{10}/], ['YYYYMMDD', /\d{8}/], ['GGGG[W]WWE', /\d{4}W\d{3}/], ['GGGG[W]WW', /\d{4}W\d{2}/, false], ['YYYYDDD', /\d{7}/], ['YYYYMM', /\d{6}/, false], ['YYYY', /\d{4}/, false]], + isoTimes = [['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], ['HH:mm:ss', /\d\d:\d\d:\d\d/], ['HH:mm', /\d\d:\d\d/], ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], ['HHmmss', /\d\d\d\d\d\d/], ['HHmm', /\d\d\d\d/], ['HH', /\d\d/]], + aspNetJsonRegex = /^\/?Date\((-?\d+)/i, + rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, + obsOffsets = { + UT: 0, + GMT: 0, + EDT: -240, + EST: -300, + CDT: -300, + CST: -360, + MDT: -360, + MST: -420, + PDT: -420, + PST: -480 + }; + + function configFromISO(config) { + var i, + l, + string = config._i, + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, + dateFormat, + timeFormat, + tzFormat, + isoDatesLen = isoDates.length, + isoTimesLen = isoTimes.length; + + if (match) { + getParsingFlags(config).iso = true; + + for (i = 0, l = isoDatesLen; i < l; i++) { + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; + break; + } + } + + if (dateFormat == null) { + config._isValid = false; + return; + } + + if (match[3]) { + for (i = 0, l = isoTimesLen; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + + if (timeFormat == null) { + config._isValid = false; + return; + } + } + + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; + } + + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); + configFromStringAndFormat(config); + } else { + config._isValid = false; + } + } + + function extractFromRFC2822Strings(yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) { + var result = [untruncateYear(yearStr), defaultLocaleMonthsShort.indexOf(monthStr), parseInt(dayStr, 10), parseInt(hourStr, 10), parseInt(minuteStr, 10)]; + + if (secondStr) { + result.push(parseInt(secondStr, 10)); + } + + return result; + } + + function untruncateYear(yearStr) { + var year = parseInt(yearStr, 10); + + if (year <= 49) { + return 2000 + year; + } else if (year <= 999) { + return 1900 + year; + } + + return year; + } + + function preprocessRFC2822(s) { + return s.replace(/\([^()]*\)|[\n\t]/g, ' ').replace(/(\s\s+)/g, ' ').replace(/^\s\s*/, '').replace(/\s\s*$/, ''); + } + + function checkWeekday(weekdayStr, parsedInput, config) { + if (weekdayStr) { + var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr), + weekdayActual = new Date(parsedInput[0], parsedInput[1], parsedInput[2]).getDay(); + + if (weekdayProvided !== weekdayActual) { + getParsingFlags(config).weekdayMismatch = true; + config._isValid = false; + return false; + } + } + + return true; + } + + function calculateOffset(obsOffset, militaryOffset, numOffset) { + if (obsOffset) { + return obsOffsets[obsOffset]; + } else if (militaryOffset) { + return 0; + } else { + var hm = parseInt(numOffset, 10), + m = hm % 100, + h = (hm - m) / 100; + return h * 60 + m; + } + } + + function configFromRFC2822(config) { + var match = rfc2822.exec(preprocessRFC2822(config._i)), + parsedArray; + + if (match) { + parsedArray = extractFromRFC2822Strings(match[4], match[3], match[2], match[5], match[6], match[7]); + + if (!checkWeekday(match[1], parsedArray, config)) { + return; + } + + config._a = parsedArray; + config._tzm = calculateOffset(match[8], match[9], match[10]); + config._d = createUTCDate.apply(null, config._a); + + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + + getParsingFlags(config).rfc2822 = true; + } else { + config._isValid = false; + } + } + + function configFromString(config) { + var matched = aspNetJsonRegex.exec(config._i); + + if (matched !== null) { + config._d = new Date(+matched[1]); + return; + } + + configFromISO(config); + + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } + + configFromRFC2822(config); + + if (config._isValid === false) { + delete config._isValid; + } else { + return; + } + + if (config._strict) { + config._isValid = false; + } else { + hooks.createFromInputFallback(config); + } + } + + hooks.createFromInputFallback = deprecate("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.", function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + }); + + function defaults(a, b, c) { + if (a != null) { + return a; + } + + if (b != null) { + return b; + } + + return c; + } + + function currentDateArray(config) { + var nowValue = new Date(hooks.now()); + + if (config._useUTC) { + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; + } + + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; + } + + function configFromArray(config) { + var i, + date, + input = [], + currentDate, + expectedWeekday, + yearToUse; + + if (config._d) { + return; + } + + currentDate = currentDateArray(config); + + if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { + dayOfYearFromWeekInfo(config); + } + + if (config._dayOfYear != null) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) { + getParsingFlags(config)._overflowDayOfYear = true; + } + + date = createUTCDate(yearToUse, 0, config._dayOfYear); + config._a[MONTH] = date.getUTCMonth(); + config._a[DATE] = date.getUTCDate(); + } + + for (i = 0; i < 3 && config._a[i] == null; ++i) { + config._a[i] = input[i] = currentDate[i]; + } + + for (; i < 7; i++) { + config._a[i] = input[i] = config._a[i] == null ? i === 2 ? 1 : 0 : config._a[i]; + } + + if (config._a[HOUR] === 24 && config._a[MINUTE] === 0 && config._a[SECOND] === 0 && config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } + + config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + expectedWeekday = config._useUTC ? config._d.getUTCDay() : config._d.getDay(); + + if (config._tzm != null) { + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + } + + if (config._nextDay) { + config._a[HOUR] = 24; + } + + if (config._w && typeof config._w.d !== 'undefined' && config._w.d !== expectedWeekday) { + getParsingFlags(config).weekdayMismatch = true; + } + } + + function dayOfYearFromWeekInfo(config) { + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek; + w = config._w; + + if (w.GG != null || w.W != null || w.E != null) { + dow = 1; + doy = 4; + weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(createLocal(), 1, 4).year); + week = defaults(w.W, 1); + weekday = defaults(w.E, 1); + + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } + } else { + dow = config._locale._week.dow; + doy = config._locale._week.doy; + curWeek = weekOfYear(createLocal(), dow, doy); + weekYear = defaults(w.gg, config._a[YEAR], curWeek.year); + week = defaults(w.w, curWeek.week); + + if (w.d != null) { + weekday = w.d; + + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; + } + } else if (w.e != null) { + weekday = w.e + dow; + + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + weekday = dow; + } + } + + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + } + + hooks.ISO_8601 = function () {}; + + hooks.RFC_2822 = function () {}; + + function configFromStringAndFormat(config) { + if (config._f === hooks.ISO_8601) { + configFromISO(config); + return; + } + + if (config._f === hooks.RFC_2822) { + configFromRFC2822(config); + return; + } + + config._a = []; + getParsingFlags(config).empty = true; + var string = '' + config._i, + i, + parsedInput, + tokens, + token, + skipped, + stringLength = string.length, + totalParsedInputLength = 0, + era, + tokenLen; + tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; + tokenLen = tokens.length; + + for (i = 0; i < tokenLen; i++) { + token = tokens[i]; + parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + + if (parsedInput) { + skipped = string.substr(0, string.indexOf(parsedInput)); + + if (skipped.length > 0) { + getParsingFlags(config).unusedInput.push(skipped); + } + + string = string.slice(string.indexOf(parsedInput) + parsedInput.length); + totalParsedInputLength += parsedInput.length; + } + + if (formatTokenFunctions[token]) { + if (parsedInput) { + getParsingFlags(config).empty = false; + } else { + getParsingFlags(config).unusedTokens.push(token); + } + + addTimeToArrayFromToken(token, parsedInput, config); + } else if (config._strict && !parsedInput) { + getParsingFlags(config).unusedTokens.push(token); + } + } + + getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; + + if (string.length > 0) { + getParsingFlags(config).unusedInput.push(string); + } + + if (config._a[HOUR] <= 12 && getParsingFlags(config).bigHour === true && config._a[HOUR] > 0) { + getParsingFlags(config).bigHour = undefined; + } + + getParsingFlags(config).parsedDateParts = config._a.slice(0); + getParsingFlags(config).meridiem = config._meridiem; + config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); + era = getParsingFlags(config).era; + + if (era !== null) { + config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]); + } + + configFromArray(config); + checkOverflow(config); + } + + function meridiemFixWrap(locale, hour, meridiem) { + var isPm; + + if (meridiem == null) { + return hour; + } + + if (locale.meridiemHour != null) { + return locale.meridiemHour(hour, meridiem); + } else if (locale.isPM != null) { + isPm = locale.isPM(meridiem); + + if (isPm && hour < 12) { + hour += 12; + } + + if (!isPm && hour === 12) { + hour = 0; + } + + return hour; + } else { + return hour; + } + } + + function configFromStringAndArray(config) { + var tempConfig, + bestMoment, + scoreToBeat, + i, + currentScore, + validFormatFound, + bestFormatIsValid = false, + configfLen = config._f.length; + + if (configfLen === 0) { + getParsingFlags(config).invalidFormat = true; + config._d = new Date(NaN); + return; + } + + for (i = 0; i < configfLen; i++) { + currentScore = 0; + validFormatFound = false; + tempConfig = copyConfig({}, config); + + if (config._useUTC != null) { + tempConfig._useUTC = config._useUTC; + } + + tempConfig._f = config._f[i]; + configFromStringAndFormat(tempConfig); + + if (isValid(tempConfig)) { + validFormatFound = true; + } + + currentScore += getParsingFlags(tempConfig).charsLeftOver; + currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; + getParsingFlags(tempConfig).score = currentScore; + + if (!bestFormatIsValid) { + if (scoreToBeat == null || currentScore < scoreToBeat || validFormatFound) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + + if (validFormatFound) { + bestFormatIsValid = true; + } + } + } else { + if (currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + } + } + } + + extend(config, bestMoment || tempConfig); + } + + function configFromObject(config) { + if (config._d) { + return; + } + + var i = normalizeObjectUnits(config._i), + dayOrDate = i.day === undefined ? i.date : i.day; + config._a = map([i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); + configFromArray(config); + } + + function createFromConfig(config) { + var res = new Moment(checkOverflow(prepareConfig(config))); + + if (res._nextDay) { + res.add(1, 'd'); + res._nextDay = undefined; + } + + return res; + } + + function prepareConfig(config) { + var input = config._i, + format = config._f; + config._locale = config._locale || getLocale(config._l); + + if (input === null || format === undefined && input === '') { + return createInvalid({ + nullInput: true + }); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isDate(input)) { + config._d = input; + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else { + configFromInput(config); + } + + if (!isValid(config)) { + config._d = null; + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + + if (isUndefined(input)) { + config._d = new Date(hooks.now()); + } else if (isDate(input)) { + config._d = new Date(input.valueOf()); + } else if (typeof input === 'string') { + configFromString(config); + } else if (isArray(input)) { + config._a = map(input.slice(0), function (obj) { + return parseInt(obj, 10); + }); + configFromArray(config); + } else if (isObject(input)) { + configFromObject(config); + } else if (isNumber(input)) { + config._d = new Date(input); + } else { + hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC(input, format, locale, strict, isUTC) { + var c = {}; + + if (format === true || format === false) { + strict = format; + format = undefined; + } + + if (locale === true || locale === false) { + strict = locale; + locale = undefined; + } + + if (isObject(input) && isObjectEmpty(input) || isArray(input) && input.length === 0) { + input = undefined; + } + + c._isAMomentObject = true; + c._useUTC = c._isUTC = isUTC; + c._l = locale; + c._i = input; + c._f = format; + c._strict = strict; + return createFromConfig(c); + } + + function createLocal(input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate('moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return createInvalid(); + } + }), + prototypeMax = deprecate('moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/', function () { + var other = createLocal.apply(null, arguments); + + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return createInvalid(); + } + }); + + function pickBy(fn, moments) { + var res, i; + + if (moments.length === 1 && isArray(moments[0])) { + moments = moments[0]; + } + + if (!moments.length) { + return createLocal(); + } + + res = moments[0]; + + for (i = 1; i < moments.length; ++i) { + if (!moments[i].isValid() || moments[i][fn](res)) { + res = moments[i]; + } + } + + return res; + } + + function min() { + var args = [].slice.call(arguments, 0); + return pickBy('isBefore', args); + } + + function max() { + var args = [].slice.call(arguments, 0); + return pickBy('isAfter', args); + } + + var now = function now() { + return Date.now ? Date.now() : +new Date(); + }; + + var ordering = ['year', 'quarter', 'month', 'week', 'day', 'hour', 'minute', 'second', 'millisecond']; + + function isDurationValid(m) { + var key, + unitHasDecimal = false, + i, + orderLen = ordering.length; + + for (key in m) { + if (hasOwnProp(m, key) && !(indexOf.call(ordering, key) !== -1 && (m[key] == null || !isNaN(m[key])))) { + return false; + } + } + + for (i = 0; i < orderLen; ++i) { + if (m[ordering[i]]) { + if (unitHasDecimal) { + return false; + } + + if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) { + unitHasDecimal = true; + } + } + } + + return true; + } + + function isValid$1() { + return this._isValid; + } + + function createInvalid$1() { + return createDuration(NaN); + } + + function Duration(duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || normalizedInput.isoWeek || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + this._isValid = isDurationValid(normalizedInput); + this._milliseconds = +milliseconds + seconds * 1e3 + minutes * 6e4 + hours * 1000 * 60 * 60; + this._days = +days + weeks * 7; + this._months = +months + quarters * 3 + years * 12; + this._data = {}; + this._locale = getLocale(); + + this._bubble(); + } + + function isDuration(obj) { + return obj instanceof Duration; + } + + function absRound(number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + + function compareArrays(array1, array2, dontConvert) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + + for (i = 0; i < len; i++) { + if (dontConvert && array1[i] !== array2[i] || !dontConvert && toInt(array1[i]) !== toInt(array2[i])) { + diffs++; + } + } + + return diffs + lengthDiff; + } + + function offset(token, separator) { + addFormatToken(token, 0, 0, function () { + var offset = this.utcOffset(), + sign = '+'; + + if (offset < 0) { + offset = -offset; + sign = '-'; + } + + return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~offset % 60, 2); + }); + } + + offset('Z', ':'); + offset('ZZ', ''); + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); + addParseToken(['Z', 'ZZ'], function (input, array, config) { + config._useUTC = true; + config._tzm = offsetFromString(matchShortOffset, input); + }); + var chunkOffset = /([\+\-]|\d\d)/gi; + + function offsetFromString(matcher, string) { + var matches = (string || '').match(matcher), + chunk, + parts, + minutes; + + if (matches === null) { + return null; + } + + chunk = matches[matches.length - 1] || []; + parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + minutes = +(parts[1] * 60) + toInt(parts[2]); + return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes; + } + + function cloneWithOffset(input, model) { + var res, diff; + + if (model._isUTC) { + res = model.clone(); + diff = (isMoment(input) || isDate(input) ? input.valueOf() : createLocal(input).valueOf()) - res.valueOf(); + + res._d.setTime(res._d.valueOf() + diff); + + hooks.updateOffset(res, false); + return res; + } else { + return createLocal(input).local(); + } + } + + function getDateOffset(m) { + return -Math.round(m._d.getTimezoneOffset()); + } + + hooks.updateOffset = function () {}; + + function getSetOffset(input, keepLocalTime, keepMinutes) { + var offset = this._offset || 0, + localAdjust; + + if (!this.isValid()) { + return input != null ? this : NaN; + } + + if (input != null) { + if (typeof input === 'string') { + input = offsetFromString(matchShortOffset, input); + + if (input === null) { + return this; + } + } else if (Math.abs(input) < 16 && !keepMinutes) { + input = input * 60; + } + + if (!this._isUTC && keepLocalTime) { + localAdjust = getDateOffset(this); + } + + this._offset = input; + this._isUTC = true; + + if (localAdjust != null) { + this.add(localAdjust, 'm'); + } + + if (offset !== input) { + if (!keepLocalTime || this._changeInProgress) { + addSubtract(this, createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + hooks.updateOffset(this, true); + this._changeInProgress = null; + } + } + + return this; + } else { + return this._isUTC ? offset : getDateOffset(this); + } + } + + function getSetZone(input, keepLocalTime) { + if (input != null) { + if (typeof input !== 'string') { + input = -input; + } + + this.utcOffset(input, keepLocalTime); + return this; + } else { + return -this.utcOffset(); + } + } + + function setOffsetToUTC(keepLocalTime) { + return this.utcOffset(0, keepLocalTime); + } + + function setOffsetToLocal(keepLocalTime) { + if (this._isUTC) { + this.utcOffset(0, keepLocalTime); + this._isUTC = false; + + if (keepLocalTime) { + this.subtract(getDateOffset(this), 'm'); + } + } + + return this; + } + + function setOffsetToParsedOffset() { + if (this._tzm != null) { + this.utcOffset(this._tzm, false, true); + } else if (typeof this._i === 'string') { + var tZone = offsetFromString(matchOffset, this._i); + + if (tZone != null) { + this.utcOffset(tZone); + } else { + this.utcOffset(0, true); + } + } + + return this; + } + + function hasAlignedHourOffset(input) { + if (!this.isValid()) { + return false; + } + + input = input ? createLocal(input).utcOffset() : 0; + return (this.utcOffset() - input) % 60 === 0; + } + + function isDaylightSavingTime() { + return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset(); + } + + function isDaylightSavingTimeShifted() { + if (!isUndefined(this._isDSTShifted)) { + return this._isDSTShifted; + } + + var c = {}, + other; + copyConfig(c, this); + c = prepareConfig(c); + + if (c._a) { + other = c._isUTC ? createUTC(c._a) : createLocal(c._a); + this._isDSTShifted = this.isValid() && compareArrays(c._a, other.toArray()) > 0; + } else { + this._isDSTShifted = false; + } + + return this._isDSTShifted; + } + + function isLocal() { + return this.isValid() ? !this._isUTC : false; + } + + function isUtcOffset() { + return this.isValid() ? this._isUTC : false; + } + + function isUtc() { + return this.isValid() ? this._isUTC && this._offset === 0 : false; + } + + var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, + isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/; + + function createDuration(input, key) { + var duration = input, + match = null, + sign, + ret, + diffRes; + + if (isDuration(input)) { + duration = { + ms: input._milliseconds, + d: input._days, + M: input._months + }; + } else if (isNumber(input) || !isNaN(+input)) { + duration = {}; + + if (key) { + duration[key] = +input; + } else { + duration.milliseconds = +input; + } + } else if (match = aspNetRegex.exec(input)) { + sign = match[1] === '-' ? -1 : 1; + duration = { + y: 0, + d: toInt(match[DATE]) * sign, + h: toInt(match[HOUR]) * sign, + m: toInt(match[MINUTE]) * sign, + s: toInt(match[SECOND]) * sign, + ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign + }; + } else if (match = isoRegex.exec(input)) { + sign = match[1] === '-' ? -1 : 1; + duration = { + y: parseIso(match[2], sign), + M: parseIso(match[3], sign), + w: parseIso(match[4], sign), + d: parseIso(match[5], sign), + h: parseIso(match[6], sign), + m: parseIso(match[7], sign), + s: parseIso(match[8], sign) + }; + } else if (duration == null) { + duration = {}; + } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { + diffRes = momentsDifference(createLocal(duration.from), createLocal(duration.to)); + duration = {}; + duration.ms = diffRes.milliseconds; + duration.M = diffRes.months; + } + + ret = new Duration(duration); + + if (isDuration(input) && hasOwnProp(input, '_locale')) { + ret._locale = input._locale; + } + + if (isDuration(input) && hasOwnProp(input, '_isValid')) { + ret._isValid = input._isValid; + } + + return ret; + } + + createDuration.fn = Duration.prototype; + createDuration.invalid = createInvalid$1; + + function parseIso(inp, sign) { + var res = inp && parseFloat(inp.replace(',', '.')); + return (isNaN(res) ? 0 : res) * sign; + } + + function positiveMomentsDifference(base, other) { + var res = {}; + res.months = other.month() - base.month() + (other.year() - base.year()) * 12; + + if (base.clone().add(res.months, 'M').isAfter(other)) { + --res.months; + } + + res.milliseconds = +other - +base.clone().add(res.months, 'M'); + return res; + } + + function momentsDifference(base, other) { + var res; + + if (!(base.isValid() && other.isValid())) { + return { + milliseconds: 0, + months: 0 + }; + } + + other = cloneWithOffset(other, base); + + if (base.isBefore(other)) { + res = positiveMomentsDifference(base, other); + } else { + res = positiveMomentsDifference(other, base); + res.milliseconds = -res.milliseconds; + res.months = -res.months; + } + + return res; + } + + function createAdder(direction, name) { + return function (val, period) { + var dur, tmp; + + if (period !== null && !isNaN(+period)) { + deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period). ' + 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'); + tmp = val; + val = period; + period = tmp; + } + + dur = createDuration(val, period); + addSubtract(this, dur, direction); + return this; + }; + } + + function addSubtract(mom, duration, isAdding, updateOffset) { + var milliseconds = duration._milliseconds, + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + return; + } + + updateOffset = updateOffset == null ? true : updateOffset; + + if (months) { + setMonth(mom, get(mom, 'Month') + months * isAdding); + } + + if (days) { + set$1(mom, 'Date', get(mom, 'Date') + days * isAdding); + } + + if (milliseconds) { + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); + } + + if (updateOffset) { + hooks.updateOffset(mom, days || months); + } + } + + var add = createAdder(1, 'add'), + subtract = createAdder(-1, 'subtract'); + + function isString(input) { + return typeof input === 'string' || input instanceof String; + } + + function isMomentInput(input) { + return isMoment(input) || isDate(input) || isString(input) || isNumber(input) || isNumberOrStringArray(input) || isMomentInputObject(input) || input === null || input === undefined; + } + + function isMomentInputObject(input) { + var objectTest = isObject(input) && !isObjectEmpty(input), + propertyTest = false, + properties = ['years', 'year', 'y', 'months', 'month', 'M', 'days', 'day', 'd', 'dates', 'date', 'D', 'hours', 'hour', 'h', 'minutes', 'minute', 'm', 'seconds', 'second', 's', 'milliseconds', 'millisecond', 'ms'], + i, + property, + propertyLen = properties.length; + + for (i = 0; i < propertyLen; i += 1) { + property = properties[i]; + propertyTest = propertyTest || hasOwnProp(input, property); + } + + return objectTest && propertyTest; + } + + function isNumberOrStringArray(input) { + var arrayTest = isArray(input), + dataTypeTest = false; + + if (arrayTest) { + dataTypeTest = input.filter(function (item) { + return !isNumber(item) && isString(input); + }).length === 0; + } + + return arrayTest && dataTypeTest; + } + + function isCalendarSpec(input) { + var objectTest = isObject(input) && !isObjectEmpty(input), + propertyTest = false, + properties = ['sameDay', 'nextDay', 'lastDay', 'nextWeek', 'lastWeek', 'sameElse'], + i, + property; + + for (i = 0; i < properties.length; i += 1) { + property = properties[i]; + propertyTest = propertyTest || hasOwnProp(input, property); + } + + return objectTest && propertyTest; + } + + function getCalendarFormat(myMoment, now) { + var diff = myMoment.diff(now, 'days', true); + return diff < -6 ? 'sameElse' : diff < -1 ? 'lastWeek' : diff < 0 ? 'lastDay' : diff < 1 ? 'sameDay' : diff < 2 ? 'nextDay' : diff < 7 ? 'nextWeek' : 'sameElse'; + } + + function calendar$1(time, formats) { + if (arguments.length === 1) { + if (!arguments[0]) { + time = undefined; + formats = undefined; + } else if (isMomentInput(arguments[0])) { + time = arguments[0]; + formats = undefined; + } else if (isCalendarSpec(arguments[0])) { + formats = arguments[0]; + time = undefined; + } + } + + var now = time || createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + format = hooks.calendarFormat(this, sod) || 'sameElse', + output = formats && (isFunction(formats[format]) ? formats[format].call(this, now) : formats[format]); + return this.format(output || this.localeData().calendar(format, this, createLocal(now))); + } + + function clone() { + return new Moment(this); + } + + function isAfter(input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(units) || 'millisecond'; + + if (units === 'millisecond') { + return this.valueOf() > localInput.valueOf(); + } else { + return localInput.valueOf() < this.clone().startOf(units).valueOf(); + } + } + + function isBefore(input, units) { + var localInput = isMoment(input) ? input : createLocal(input); + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(units) || 'millisecond'; + + if (units === 'millisecond') { + return this.valueOf() < localInput.valueOf(); + } else { + return this.clone().endOf(units).valueOf() < localInput.valueOf(); + } + } + + function isBetween(from, to, units, inclusivity) { + var localFrom = isMoment(from) ? from : createLocal(from), + localTo = isMoment(to) ? to : createLocal(to); + + if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) { + return false; + } + + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(localFrom, units) : !this.isBefore(localFrom, units)) && (inclusivity[1] === ')' ? this.isBefore(localTo, units) : !this.isAfter(localTo, units)); + } + + function isSame(input, units) { + var localInput = isMoment(input) ? input : createLocal(input), + inputMs; + + if (!(this.isValid() && localInput.isValid())) { + return false; + } + + units = normalizeUnits(units) || 'millisecond'; + + if (units === 'millisecond') { + return this.valueOf() === localInput.valueOf(); + } else { + inputMs = localInput.valueOf(); + return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); + } + } + + function isSameOrAfter(input, units) { + return this.isSame(input, units) || this.isAfter(input, units); + } + + function isSameOrBefore(input, units) { + return this.isSame(input, units) || this.isBefore(input, units); + } + + function diff(input, units, asFloat) { + var that, zoneDelta, output; + + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + units = normalizeUnits(units); + + switch (units) { + case 'year': + output = monthDiff(this, that) / 12; + break; + + case 'month': + output = monthDiff(this, that); + break; + + case 'quarter': + output = monthDiff(this, that) / 3; + break; + + case 'second': + output = (this - that) / 1e3; + break; + + case 'minute': + output = (this - that) / 6e4; + break; + + case 'hour': + output = (this - that) / 36e5; + break; + + case 'day': + output = (this - that - zoneDelta) / 864e5; + break; + + case 'week': + output = (this - that - zoneDelta) / 6048e5; + break; + + default: + output = this - that; + } + + return asFloat ? output : absFloor(output); + } + + function monthDiff(a, b) { + if (a.date() < b.date()) { + return -monthDiff(b, a); + } + + var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()), + anchor = a.clone().add(wholeMonthDiff, 'months'), + anchor2, + adjust; + + if (b - anchor < 0) { + anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); + adjust = (b - anchor) / (anchor - anchor2); + } else { + anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); + adjust = (b - anchor) / (anchor2 - anchor); + } + + return -(wholeMonthDiff + adjust) || 0; + } + + hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; + + function toString() { + return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); + } + + function toISOString(keepOffset) { + if (!this.isValid()) { + return null; + } + + var utc = keepOffset !== true, + m = utc ? this.clone().utc() : this; + + if (m.year() < 0 || m.year() > 9999) { + return formatMoment(m, utc ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + + if (isFunction(Date.prototype.toISOString)) { + if (utc) { + return this.toDate().toISOString(); + } else { + return new Date(this.valueOf() + this.utcOffset() * 60 * 1000).toISOString().replace('Z', formatMoment(m, 'Z')); + } + } + + return formatMoment(m, utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'); + } + + function inspect() { + if (!this.isValid()) { + return 'moment.invalid(/* ' + this._i + ' */)'; + } + + var func = 'moment', + zone = '', + prefix, + year, + datetime, + suffix; + + if (!this.isLocal()) { + func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone'; + zone = 'Z'; + } + + prefix = '[' + func + '("]'; + year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY'; + datetime = '-MM-DD[T]HH:mm:ss.SSS'; + suffix = zone + '[")]'; + return this.format(prefix + year + datetime + suffix); + } + + function format(inputString) { + if (!inputString) { + inputString = this.isUtc() ? hooks.defaultFormatUtc : hooks.defaultFormat; + } + + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } + + function from(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + to: this, + from: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function fromNow(withoutSuffix) { + return this.from(createLocal(), withoutSuffix); + } + + function to(time, withoutSuffix) { + if (this.isValid() && (isMoment(time) && time.isValid() || createLocal(time).isValid())) { + return createDuration({ + from: this, + to: time + }).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function toNow(withoutSuffix) { + return this.to(createLocal(), withoutSuffix); + } + + function locale(key) { + var newLocaleData; + + if (key === undefined) { + return this._locale._abbr; + } else { + newLocaleData = getLocale(key); + + if (newLocaleData != null) { + this._locale = newLocaleData; + } + + return this; + } + } + + var lang = deprecate('moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', function (key) { + if (key === undefined) { + return this.localeData(); + } else { + return this.locale(key); + } + }); + + function localeData() { + return this._locale; + } + + var MS_PER_SECOND = 1000, + MS_PER_MINUTE = 60000, + MS_PER_HOUR = 3600000, + MS_PER_400_YEARS = 12622780800000; + + function mod$1(dividend, divisor) { + return (dividend % divisor + divisor) % divisor; + } + + function localStartOfDate(y, m, d) { + if (y < 100 && y >= 0) { + return new Date(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return new Date(y, m, d).valueOf(); + } + } + + function utcStartOfDate(y, m, d) { + if (y < 100 && y >= 0) { + return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS; + } else { + return Date.UTC(y, m, d); + } + } + + function startOf(units) { + var time, startOfDate; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year(), 0, 1); + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3, 1); + break; + + case 'month': + time = startOfDate(this.year(), this.month(), 1); + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday()); + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1)); + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date()); + break; + + case 'hour': + time = this._d.valueOf(); + time -= mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR); + break; + + case 'minute': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_MINUTE); + break; + + case 'second': + time = this._d.valueOf(); + time -= mod$1(time, MS_PER_SECOND); + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function endOf(units) { + var time, startOfDate; + units = normalizeUnits(units); + + if (units === undefined || units === 'millisecond' || !this.isValid()) { + return this; + } + + startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate; + + switch (units) { + case 'year': + time = startOfDate(this.year() + 1, 0, 1) - 1; + break; + + case 'quarter': + time = startOfDate(this.year(), this.month() - this.month() % 3 + 3, 1) - 1; + break; + + case 'month': + time = startOfDate(this.year(), this.month() + 1, 1) - 1; + break; + + case 'week': + time = startOfDate(this.year(), this.month(), this.date() - this.weekday() + 7) - 1; + break; + + case 'isoWeek': + time = startOfDate(this.year(), this.month(), this.date() - (this.isoWeekday() - 1) + 7) - 1; + break; + + case 'day': + case 'date': + time = startOfDate(this.year(), this.month(), this.date() + 1) - 1; + break; + + case 'hour': + time = this._d.valueOf(); + time += MS_PER_HOUR - mod$1(time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE), MS_PER_HOUR) - 1; + break; + + case 'minute': + time = this._d.valueOf(); + time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1; + break; + + case 'second': + time = this._d.valueOf(); + time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1; + break; + } + + this._d.setTime(time); + + hooks.updateOffset(this, true); + return this; + } + + function valueOf() { + return this._d.valueOf() - (this._offset || 0) * 60000; + } + + function unix() { + return Math.floor(this.valueOf() / 1000); + } + + function toDate() { + return new Date(this.valueOf()); + } + + function toArray() { + var m = this; + return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; + } + + function toObject() { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; + } + + function toJSON() { + return this.isValid() ? this.toISOString() : null; + } + + function isValid$2() { + return isValid(this); + } + + function parsingFlags() { + return extend({}, getParsingFlags(this)); + } + + function invalidAt() { + return getParsingFlags(this).overflow; + } + + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + addFormatToken('N', 0, 0, 'eraAbbr'); + addFormatToken('NN', 0, 0, 'eraAbbr'); + addFormatToken('NNN', 0, 0, 'eraAbbr'); + addFormatToken('NNNN', 0, 0, 'eraName'); + addFormatToken('NNNNN', 0, 0, 'eraNarrow'); + addFormatToken('y', ['y', 1], 'yo', 'eraYear'); + addFormatToken('y', ['yy', 2], 0, 'eraYear'); + addFormatToken('y', ['yyy', 3], 0, 'eraYear'); + addFormatToken('y', ['yyyy', 4], 0, 'eraYear'); + addRegexToken('N', matchEraAbbr); + addRegexToken('NN', matchEraAbbr); + addRegexToken('NNN', matchEraAbbr); + addRegexToken('NNNN', matchEraName); + addRegexToken('NNNNN', matchEraNarrow); + addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (input, array, config, token) { + var era = config._locale.erasParse(input, token, config._strict); + + if (era) { + getParsingFlags(config).era = era; + } else { + getParsingFlags(config).invalidEra = input; + } + }); + addRegexToken('y', matchUnsigned); + addRegexToken('yy', matchUnsigned); + addRegexToken('yyy', matchUnsigned); + addRegexToken('yyyy', matchUnsigned); + addRegexToken('yo', matchEraYearOrdinal); + addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR); + addParseToken(['yo'], function (input, array, config, token) { + var match; + + if (config._locale._eraYearOrdinalRegex) { + match = input.match(config._locale._eraYearOrdinalRegex); + } + + if (config._locale.eraYearOrdinalParse) { + array[YEAR] = config._locale.eraYearOrdinalParse(input, match); + } else { + array[YEAR] = parseInt(input, 10); + } + }); + + function localeEras(m, format) { + var i, + l, + date, + eras = this._eras || getLocale('en')._eras; + + for (i = 0, l = eras.length; i < l; ++i) { + switch (typeof eras[i].since) { + case 'string': + date = hooks(eras[i].since).startOf('day'); + eras[i].since = date.valueOf(); + break; + } + + switch (typeof eras[i].until) { + case 'undefined': + eras[i].until = 1 / 0; + break; + + case 'string': + date = hooks(eras[i].until).startOf('day').valueOf(); + eras[i].until = date.valueOf(); + break; + } + } + + return eras; + } + + function localeErasParse(eraName, format, strict) { + var i, + l, + eras = this.eras(), + name, + abbr, + narrow; + eraName = eraName.toUpperCase(); + + for (i = 0, l = eras.length; i < l; ++i) { + name = eras[i].name.toUpperCase(); + abbr = eras[i].abbr.toUpperCase(); + narrow = eras[i].narrow.toUpperCase(); + + if (strict) { + switch (format) { + case 'N': + case 'NN': + case 'NNN': + if (abbr === eraName) { + return eras[i]; + } + + break; + + case 'NNNN': + if (name === eraName) { + return eras[i]; + } + + break; + + case 'NNNNN': + if (narrow === eraName) { + return eras[i]; + } + + break; + } + } else if ([name, abbr, narrow].indexOf(eraName) >= 0) { + return eras[i]; + } + } + } + + function localeErasConvertYear(era, year) { + var dir = era.since <= era.until ? 1 : -1; + + if (year === undefined) { + return hooks(era.since).year(); + } else { + return hooks(era.since).year() + (year - era.offset) * dir; + } + } + + function getEraName() { + var i, + l, + val, + eras = this.localeData().eras(); + + for (i = 0, l = eras.length; i < l; ++i) { + val = this.clone().startOf('day').valueOf(); + + if (eras[i].since <= val && val <= eras[i].until) { + return eras[i].name; + } + + if (eras[i].until <= val && val <= eras[i].since) { + return eras[i].name; + } + } + + return ''; + } + + function getEraNarrow() { + var i, + l, + val, + eras = this.localeData().eras(); + + for (i = 0, l = eras.length; i < l; ++i) { + val = this.clone().startOf('day').valueOf(); + + if (eras[i].since <= val && val <= eras[i].until) { + return eras[i].narrow; + } + + if (eras[i].until <= val && val <= eras[i].since) { + return eras[i].narrow; + } + } + + return ''; + } + + function getEraAbbr() { + var i, + l, + val, + eras = this.localeData().eras(); + + for (i = 0, l = eras.length; i < l; ++i) { + val = this.clone().startOf('day').valueOf(); + + if (eras[i].since <= val && val <= eras[i].until) { + return eras[i].abbr; + } + + if (eras[i].until <= val && val <= eras[i].since) { + return eras[i].abbr; + } + } + + return ''; + } + + function getEraYear() { + var i, + l, + dir, + val, + eras = this.localeData().eras(); + + for (i = 0, l = eras.length; i < l; ++i) { + dir = eras[i].since <= eras[i].until ? 1 : -1; + val = this.clone().startOf('day').valueOf(); + + if (eras[i].since <= val && val <= eras[i].until || eras[i].until <= val && val <= eras[i].since) { + return (this.year() - hooks(eras[i].since).year()) * dir + eras[i].offset; + } + } + + return this.year(); + } + + function erasNameRegex(isStrict) { + if (!hasOwnProp(this, '_erasNameRegex')) { + computeErasParse.call(this); + } + + return isStrict ? this._erasNameRegex : this._erasRegex; + } + + function erasAbbrRegex(isStrict) { + if (!hasOwnProp(this, '_erasAbbrRegex')) { + computeErasParse.call(this); + } + + return isStrict ? this._erasAbbrRegex : this._erasRegex; + } + + function erasNarrowRegex(isStrict) { + if (!hasOwnProp(this, '_erasNarrowRegex')) { + computeErasParse.call(this); + } + + return isStrict ? this._erasNarrowRegex : this._erasRegex; + } + + function matchEraAbbr(isStrict, locale) { + return locale.erasAbbrRegex(isStrict); + } + + function matchEraName(isStrict, locale) { + return locale.erasNameRegex(isStrict); + } + + function matchEraNarrow(isStrict, locale) { + return locale.erasNarrowRegex(isStrict); + } + + function matchEraYearOrdinal(isStrict, locale) { + return locale._eraYearOrdinalRegex || matchUnsigned; + } + + function computeErasParse() { + var abbrPieces = [], + namePieces = [], + narrowPieces = [], + mixedPieces = [], + i, + l, + eras = this.eras(); + + for (i = 0, l = eras.length; i < l; ++i) { + namePieces.push(regexEscape(eras[i].name)); + abbrPieces.push(regexEscape(eras[i].abbr)); + narrowPieces.push(regexEscape(eras[i].narrow)); + mixedPieces.push(regexEscape(eras[i].name)); + mixedPieces.push(regexEscape(eras[i].abbr)); + mixedPieces.push(regexEscape(eras[i].narrow)); + } + + this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i'); + this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i'); + this._erasNarrowRegex = new RegExp('^(' + narrowPieces.join('|') + ')', 'i'); + } + + addFormatToken(0, ['gg', 2], 0, function () { + return this.weekYear() % 100; + }); + addFormatToken(0, ['GG', 2], 0, function () { + return this.isoWeekYear() % 100; + }); + + function addWeekYearFormatToken(token, getter) { + addFormatToken(0, [token, token.length], 0, getter); + } + + addWeekYearFormatToken('gggg', 'weekYear'); + addWeekYearFormatToken('ggggg', 'weekYear'); + addWeekYearFormatToken('GGGG', 'isoWeekYear'); + addWeekYearFormatToken('GGGGG', 'isoWeekYear'); + addUnitAlias('weekYear', 'gg'); + addUnitAlias('isoWeekYear', 'GG'); + addUnitPriority('weekYear', 1); + addUnitPriority('isoWeekYear', 1); + addRegexToken('G', matchSigned); + addRegexToken('g', matchSigned); + addRegexToken('GG', match1to2, match2); + addRegexToken('gg', match1to2, match2); + addRegexToken('GGGG', match1to4, match4); + addRegexToken('gggg', match1to4, match4); + addRegexToken('GGGGG', match1to6, match6); + addRegexToken('ggggg', match1to6, match6); + addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { + week[token.substr(0, 2)] = toInt(input); + }); + addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { + week[token] = hooks.parseTwoDigitYear(input); + }); + + function getSetWeekYear(input) { + return getSetWeekYearHelper.call(this, input, this.week(), this.weekday(), this.localeData()._week.dow, this.localeData()._week.doy); + } + + function getSetISOWeekYear(input) { + return getSetWeekYearHelper.call(this, input, this.isoWeek(), this.isoWeekday(), 1, 4); + } + + function getISOWeeksInYear() { + return weeksInYear(this.year(), 1, 4); + } + + function getISOWeeksInISOWeekYear() { + return weeksInYear(this.isoWeekYear(), 1, 4); + } + + function getWeeksInYear() { + var weekInfo = this.localeData()._week; + + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + + function getWeeksInWeekYear() { + var weekInfo = this.localeData()._week; + + return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy); + } + + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + + if (week > weeksTarget) { + week = weeksTarget; + } + + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + addFormatToken('Q', 0, 'Qo', 'quarter'); + addUnitAlias('quarter', 'Q'); + addUnitPriority('quarter', 7); + addRegexToken('Q', match1); + addParseToken('Q', function (input, array) { + array[MONTH] = (toInt(input) - 1) * 3; + }); + + function getSetQuarter(input) { + return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); + } + + addFormatToken('D', ['DD', 2], 'Do', 'date'); + addUnitAlias('date', 'D'); + addUnitPriority('date', 9); + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + return isStrict ? locale._dayOfMonthOrdinalParse || locale._ordinalParse : locale._dayOfMonthOrdinalParseLenient; + }); + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0]); + }); + var getSetDayOfMonth = makeGetSet('Date', true); + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + addUnitAlias('dayOfYear', 'DDD'); + addUnitPriority('dayOfYear', 4); + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + function getSetDayOfYear(input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add(input - dayOfYear, 'd'); + } + + addFormatToken('m', ['mm', 2], 0, 'minute'); + addUnitAlias('minute', 'm'); + addUnitPriority('minute', 14); + addRegexToken('m', match1to2); + addRegexToken('mm', match1to2, match2); + addParseToken(['m', 'mm'], MINUTE); + var getSetMinute = makeGetSet('Minutes', false); + addFormatToken('s', ['ss', 2], 0, 'second'); + addUnitAlias('second', 's'); + addUnitPriority('second', 15); + addRegexToken('s', match1to2); + addRegexToken('ss', match1to2, match2); + addParseToken(['s', 'ss'], SECOND); + var getSetSecond = makeGetSet('Seconds', false); + addFormatToken('S', 0, 0, function () { + return ~~(this.millisecond() / 100); + }); + addFormatToken(0, ['SS', 2], 0, function () { + return ~~(this.millisecond() / 10); + }); + addFormatToken(0, ['SSS', 3], 0, 'millisecond'); + addFormatToken(0, ['SSSS', 4], 0, function () { + return this.millisecond() * 10; + }); + addFormatToken(0, ['SSSSS', 5], 0, function () { + return this.millisecond() * 100; + }); + addFormatToken(0, ['SSSSSS', 6], 0, function () { + return this.millisecond() * 1000; + }); + addFormatToken(0, ['SSSSSSS', 7], 0, function () { + return this.millisecond() * 10000; + }); + addFormatToken(0, ['SSSSSSSS', 8], 0, function () { + return this.millisecond() * 100000; + }); + addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { + return this.millisecond() * 1000000; + }); + addUnitAlias('millisecond', 'ms'); + addUnitPriority('millisecond', 16); + addRegexToken('S', match1to3, match1); + addRegexToken('SS', match1to3, match2); + addRegexToken('SSS', match1to3, match3); + var token, getSetMillisecond; + + for (token = 'SSSS'; token.length <= 9; token += 'S') { + addRegexToken(token, matchUnsigned); + } + + function parseMs(input, array) { + array[MILLISECOND] = toInt(('0.' + input) * 1000); + } + + for (token = 'S'; token.length <= 9; token += 'S') { + addParseToken(token, parseMs); + } + + getSetMillisecond = makeGetSet('Milliseconds', false); + addFormatToken('z', 0, 0, 'zoneAbbr'); + addFormatToken('zz', 0, 0, 'zoneName'); + + function getZoneAbbr() { + return this._isUTC ? 'UTC' : ''; + } + + function getZoneName() { + return this._isUTC ? 'Coordinated Universal Time' : ''; + } + + var proto = Moment.prototype; + proto.add = add; + proto.calendar = calendar$1; + proto.clone = clone; + proto.diff = diff; + proto.endOf = endOf; + proto.format = format; + proto.from = from; + proto.fromNow = fromNow; + proto.to = to; + proto.toNow = toNow; + proto.get = stringGet; + proto.invalidAt = invalidAt; + proto.isAfter = isAfter; + proto.isBefore = isBefore; + proto.isBetween = isBetween; + proto.isSame = isSame; + proto.isSameOrAfter = isSameOrAfter; + proto.isSameOrBefore = isSameOrBefore; + proto.isValid = isValid$2; + proto.lang = lang; + proto.locale = locale; + proto.localeData = localeData; + proto.max = prototypeMax; + proto.min = prototypeMin; + proto.parsingFlags = parsingFlags; + proto.set = stringSet; + proto.startOf = startOf; + proto.subtract = subtract; + proto.toArray = toArray; + proto.toObject = toObject; + proto.toDate = toDate; + proto.toISOString = toISOString; + proto.inspect = inspect; + + if (typeof Symbol !== 'undefined' && Symbol.for != null) { + proto[Symbol.for('nodejs.util.inspect.custom')] = function () { + return 'Moment<' + this.format() + '>'; + }; + } + + proto.toJSON = toJSON; + proto.toString = toString; + proto.unix = unix; + proto.valueOf = valueOf; + proto.creationData = creationData; + proto.eraName = getEraName; + proto.eraNarrow = getEraNarrow; + proto.eraAbbr = getEraAbbr; + proto.eraYear = getEraYear; + proto.year = getSetYear; + proto.isLeapYear = getIsLeapYear; + proto.weekYear = getSetWeekYear; + proto.isoWeekYear = getSetISOWeekYear; + proto.quarter = proto.quarters = getSetQuarter; + proto.month = getSetMonth; + proto.daysInMonth = getDaysInMonth; + proto.week = proto.weeks = getSetWeek; + proto.isoWeek = proto.isoWeeks = getSetISOWeek; + proto.weeksInYear = getWeeksInYear; + proto.weeksInWeekYear = getWeeksInWeekYear; + proto.isoWeeksInYear = getISOWeeksInYear; + proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear; + proto.date = getSetDayOfMonth; + proto.day = proto.days = getSetDayOfWeek; + proto.weekday = getSetLocaleDayOfWeek; + proto.isoWeekday = getSetISODayOfWeek; + proto.dayOfYear = getSetDayOfYear; + proto.hour = proto.hours = getSetHour; + proto.minute = proto.minutes = getSetMinute; + proto.second = proto.seconds = getSetSecond; + proto.millisecond = proto.milliseconds = getSetMillisecond; + proto.utcOffset = getSetOffset; + proto.utc = setOffsetToUTC; + proto.local = setOffsetToLocal; + proto.parseZone = setOffsetToParsedOffset; + proto.hasAlignedHourOffset = hasAlignedHourOffset; + proto.isDST = isDaylightSavingTime; + proto.isLocal = isLocal; + proto.isUtcOffset = isUtcOffset; + proto.isUtc = isUtc; + proto.isUTC = isUtc; + proto.zoneAbbr = getZoneAbbr; + proto.zoneName = getZoneName; + proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/', getSetZone); + proto.isDSTShifted = deprecate('isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information', isDaylightSavingTimeShifted); + + function createUnix(input) { + return createLocal(input * 1000); + } + + function createInZone() { + return createLocal.apply(null, arguments).parseZone(); + } + + function preParsePostFormat(string) { + return string; + } + + var proto$1 = Locale.prototype; + proto$1.calendar = calendar; + proto$1.longDateFormat = longDateFormat; + proto$1.invalidDate = invalidDate; + proto$1.ordinal = ordinal; + proto$1.preparse = preParsePostFormat; + proto$1.postformat = preParsePostFormat; + proto$1.relativeTime = relativeTime; + proto$1.pastFuture = pastFuture; + proto$1.set = set; + proto$1.eras = localeEras; + proto$1.erasParse = localeErasParse; + proto$1.erasConvertYear = localeErasConvertYear; + proto$1.erasAbbrRegex = erasAbbrRegex; + proto$1.erasNameRegex = erasNameRegex; + proto$1.erasNarrowRegex = erasNarrowRegex; + proto$1.months = localeMonths; + proto$1.monthsShort = localeMonthsShort; + proto$1.monthsParse = localeMonthsParse; + proto$1.monthsRegex = monthsRegex; + proto$1.monthsShortRegex = monthsShortRegex; + proto$1.week = localeWeek; + proto$1.firstDayOfYear = localeFirstDayOfYear; + proto$1.firstDayOfWeek = localeFirstDayOfWeek; + proto$1.weekdays = localeWeekdays; + proto$1.weekdaysMin = localeWeekdaysMin; + proto$1.weekdaysShort = localeWeekdaysShort; + proto$1.weekdaysParse = localeWeekdaysParse; + proto$1.weekdaysRegex = weekdaysRegex; + proto$1.weekdaysShortRegex = weekdaysShortRegex; + proto$1.weekdaysMinRegex = weekdaysMinRegex; + proto$1.isPM = localeIsPM; + proto$1.meridiem = localeMeridiem; + + function get$1(format, index, field, setter) { + var locale = getLocale(), + utc = createUTC().set(setter, index); + return locale[field](utc, format); + } + + function listMonthsImpl(format, index, field) { + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return get$1(format, index, field, 'month'); + } + + var i, + out = []; + + for (i = 0; i < 12; i++) { + out[i] = get$1(format, i, field, 'month'); + } + + return out; + } + + function listWeekdaysImpl(localeSorted, format, index, field) { + if (typeof localeSorted === 'boolean') { + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; + + if (isNumber(format)) { + index = format; + format = undefined; + } + + format = format || ''; + } + + var locale = getLocale(), + shift = localeSorted ? locale._week.dow : 0, + i, + out = []; + + if (index != null) { + return get$1(format, (index + shift) % 7, field, 'day'); + } + + for (i = 0; i < 7; i++) { + out[i] = get$1(format, (i + shift) % 7, field, 'day'); + } + + return out; + } + + function listMonths(format, index) { + return listMonthsImpl(format, index, 'months'); + } + + function listMonthsShort(format, index) { + return listMonthsImpl(format, index, 'monthsShort'); + } + + function listWeekdays(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + } + + function listWeekdaysShort(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); + } + + function listWeekdaysMin(localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); + } + + getSetGlobalLocale('en', { + eras: [{ + since: '0001-01-01', + until: 1 / 0, + offset: 1, + name: 'Anno Domini', + narrow: 'AD', + abbr: 'AD' + }, { + since: '0000-12-31', + until: -(1 / 0), + offset: 1, + name: 'Before Christ', + narrow: 'BC', + abbr: 'BC' + }], + dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/, + ordinal: function ordinal(number) { + var b = number % 10, + output = toInt(number % 100 / 10) === 1 ? 'th' : b === 1 ? 'st' : b === 2 ? 'nd' : b === 3 ? 'rd' : 'th'; + return number + output; + } + }); + hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', getSetGlobalLocale); + hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', getLocale); + var mathAbs = Math.abs; + + function abs() { + var data = this._data; + this._milliseconds = mathAbs(this._milliseconds); + this._days = mathAbs(this._days); + this._months = mathAbs(this._months); + data.milliseconds = mathAbs(data.milliseconds); + data.seconds = mathAbs(data.seconds); + data.minutes = mathAbs(data.minutes); + data.hours = mathAbs(data.hours); + data.months = mathAbs(data.months); + data.years = mathAbs(data.years); + return this; + } + + function addSubtract$1(duration, input, value, direction) { + var other = createDuration(input, value); + duration._milliseconds += direction * other._milliseconds; + duration._days += direction * other._days; + duration._months += direction * other._months; + return duration._bubble(); + } + + function add$1(input, value) { + return addSubtract$1(this, input, value, 1); + } + + function subtract$1(input, value) { + return addSubtract$1(this, input, value, -1); + } + + function absCeil(number) { + if (number < 0) { + return Math.floor(number); + } else { + return Math.ceil(number); + } + } + + function bubble() { + var milliseconds = this._milliseconds, + days = this._days, + months = this._months, + data = this._data, + seconds, + minutes, + hours, + years, + monthsFromDays; + + if (!(milliseconds >= 0 && days >= 0 && months >= 0 || milliseconds <= 0 && days <= 0 && months <= 0)) { + milliseconds += absCeil(monthsToDays(months) + days) * 864e5; + days = 0; + months = 0; + } + + data.milliseconds = milliseconds % 1000; + seconds = absFloor(milliseconds / 1000); + data.seconds = seconds % 60; + minutes = absFloor(seconds / 60); + data.minutes = minutes % 60; + hours = absFloor(minutes / 60); + data.hours = hours % 24; + days += absFloor(hours / 24); + monthsFromDays = absFloor(daysToMonths(days)); + months += monthsFromDays; + days -= absCeil(monthsToDays(monthsFromDays)); + years = absFloor(months / 12); + months %= 12; + data.days = days; + data.months = months; + data.years = years; + return this; + } + + function daysToMonths(days) { + return days * 4800 / 146097; + } + + function monthsToDays(months) { + return months * 146097 / 4800; + } + + function as(units) { + if (!this.isValid()) { + return NaN; + } + + var days, + months, + milliseconds = this._milliseconds; + units = normalizeUnits(units); + + if (units === 'month' || units === 'quarter' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + + switch (units) { + case 'month': + return months; + + case 'quarter': + return months / 3; + + case 'year': + return months / 12; + } + } else { + days = this._days + Math.round(monthsToDays(this._months)); + + switch (units) { + case 'week': + return days / 7 + milliseconds / 6048e5; + + case 'day': + return days + milliseconds / 864e5; + + case 'hour': + return days * 24 + milliseconds / 36e5; + + case 'minute': + return days * 1440 + milliseconds / 6e4; + + case 'second': + return days * 86400 + milliseconds / 1000; + + case 'millisecond': + return Math.floor(days * 864e5) + milliseconds; + + default: + throw new Error('Unknown unit ' + units); + } + } + } + + function valueOf$1() { + if (!this.isValid()) { + return NaN; + } + + return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6; + } + + function makeAs(alias) { + return function () { + return this.as(alias); + }; + } + + var asMilliseconds = makeAs('ms'), + asSeconds = makeAs('s'), + asMinutes = makeAs('m'), + asHours = makeAs('h'), + asDays = makeAs('d'), + asWeeks = makeAs('w'), + asMonths = makeAs('M'), + asQuarters = makeAs('Q'), + asYears = makeAs('y'); + + function clone$1() { + return createDuration(this); + } + + function get$2(units) { + units = normalizeUnits(units); + return this.isValid() ? this[units + 's']() : NaN; + } + + function makeGetter(name) { + return function () { + return this.isValid() ? this._data[name] : NaN; + }; + } + + var milliseconds = makeGetter('milliseconds'), + seconds = makeGetter('seconds'), + minutes = makeGetter('minutes'), + hours = makeGetter('hours'), + days = makeGetter('days'), + months = makeGetter('months'), + years = makeGetter('years'); + + function weeks() { + return absFloor(this.days() / 7); + } + + var round = Math.round, + thresholds = { + ss: 44, + s: 45, + m: 45, + h: 22, + d: 26, + w: null, + M: 11 + }; + + function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { + return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); + } + + function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) { + var duration = createDuration(posNegDuration).abs(), + seconds = round(duration.as('s')), + minutes = round(duration.as('m')), + hours = round(duration.as('h')), + days = round(duration.as('d')), + months = round(duration.as('M')), + weeks = round(duration.as('w')), + years = round(duration.as('y')), + a = seconds <= thresholds.ss && ['s', seconds] || seconds < thresholds.s && ['ss', seconds] || minutes <= 1 && ['m'] || minutes < thresholds.m && ['mm', minutes] || hours <= 1 && ['h'] || hours < thresholds.h && ['hh', hours] || days <= 1 && ['d'] || days < thresholds.d && ['dd', days]; + + if (thresholds.w != null) { + a = a || weeks <= 1 && ['w'] || weeks < thresholds.w && ['ww', weeks]; + } + + a = a || months <= 1 && ['M'] || months < thresholds.M && ['MM', months] || years <= 1 && ['y'] || ['yy', years]; + a[2] = withoutSuffix; + a[3] = +posNegDuration > 0; + a[4] = locale; + return substituteTimeAgo.apply(null, a); + } + + function getSetRelativeTimeRounding(roundingFunction) { + if (roundingFunction === undefined) { + return round; + } + + if (typeof roundingFunction === 'function') { + round = roundingFunction; + return true; + } + + return false; + } + + function getSetRelativeTimeThreshold(threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + + if (limit === undefined) { + return thresholds[threshold]; + } + + thresholds[threshold] = limit; + + if (threshold === 's') { + thresholds.ss = limit - 1; + } + + return true; + } + + function humanize(argWithSuffix, argThresholds) { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var withSuffix = false, + th = thresholds, + locale, + output; + + if (typeof argWithSuffix === 'object') { + argThresholds = argWithSuffix; + argWithSuffix = false; + } + + if (typeof argWithSuffix === 'boolean') { + withSuffix = argWithSuffix; + } + + if (typeof argThresholds === 'object') { + th = _$$_REQUIRE(_dependencyMap[0])({}, thresholds, argThresholds); + + if (argThresholds.s != null && argThresholds.ss == null) { + th.ss = argThresholds.s - 1; + } + } + + locale = this.localeData(); + output = relativeTime$1(this, !withSuffix, th, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var abs$1 = Math.abs; + + function sign(x) { + return (x > 0) - (x < 0) || +x; + } + + function toISOString$1() { + if (!this.isValid()) { + return this.localeData().invalidDate(); + } + + var seconds = abs$1(this._milliseconds) / 1000, + days = abs$1(this._days), + months = abs$1(this._months), + minutes, + hours, + years, + s, + total = this.asSeconds(), + totalSign, + ymSign, + daysSign, + hmsSign; + + if (!total) { + return 'P0D'; + } + + minutes = absFloor(seconds / 60); + hours = absFloor(minutes / 60); + seconds %= 60; + minutes %= 60; + years = absFloor(months / 12); + months %= 12; + s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : ''; + totalSign = total < 0 ? '-' : ''; + ymSign = sign(this._months) !== sign(total) ? '-' : ''; + daysSign = sign(this._days) !== sign(total) ? '-' : ''; + hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : ''; + return totalSign + 'P' + (years ? ymSign + years + 'Y' : '') + (months ? ymSign + months + 'M' : '') + (days ? daysSign + days + 'D' : '') + (hours || minutes || seconds ? 'T' : '') + (hours ? hmsSign + hours + 'H' : '') + (minutes ? hmsSign + minutes + 'M' : '') + (seconds ? hmsSign + s + 'S' : ''); + } + + var proto$2 = Duration.prototype; + proto$2.isValid = isValid$1; + proto$2.abs = abs; + proto$2.add = add$1; + proto$2.subtract = subtract$1; + proto$2.as = as; + proto$2.asMilliseconds = asMilliseconds; + proto$2.asSeconds = asSeconds; + proto$2.asMinutes = asMinutes; + proto$2.asHours = asHours; + proto$2.asDays = asDays; + proto$2.asWeeks = asWeeks; + proto$2.asMonths = asMonths; + proto$2.asQuarters = asQuarters; + proto$2.asYears = asYears; + proto$2.valueOf = valueOf$1; + proto$2._bubble = bubble; + proto$2.clone = clone$1; + proto$2.get = get$2; + proto$2.milliseconds = milliseconds; + proto$2.seconds = seconds; + proto$2.minutes = minutes; + proto$2.hours = hours; + proto$2.days = days; + proto$2.weeks = weeks; + proto$2.months = months; + proto$2.years = years; + proto$2.humanize = humanize; + proto$2.toISOString = toISOString$1; + proto$2.toString = toISOString$1; + proto$2.toJSON = toISOString$1; + proto$2.locale = locale; + proto$2.localeData = localeData; + proto$2.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', toISOString$1); + proto$2.lang = lang; + addFormatToken('X', 0, 0, 'unix'); + addFormatToken('x', 0, 0, 'valueOf'); + addRegexToken('x', matchSigned); + addRegexToken('X', matchTimestamp); + addParseToken('X', function (input, array, config) { + config._d = new Date(parseFloat(input) * 1000); + }); + addParseToken('x', function (input, array, config) { + config._d = new Date(toInt(input)); + }); + hooks.version = '2.29.4'; + setHookCallback(createLocal); + hooks.fn = proto; + hooks.min = min; + hooks.max = max; + hooks.now = now; + hooks.utc = createUTC; + hooks.unix = createUnix; + hooks.months = listMonths; + hooks.isDate = isDate; + hooks.locale = getSetGlobalLocale; + hooks.invalid = createInvalid; + hooks.duration = createDuration; + hooks.isMoment = isMoment; + hooks.weekdays = listWeekdays; + hooks.parseZone = createInZone; + hooks.localeData = getLocale; + hooks.isDuration = isDuration; + hooks.monthsShort = listMonthsShort; + hooks.weekdaysMin = listWeekdaysMin; + hooks.defineLocale = defineLocale; + hooks.updateLocale = updateLocale; + hooks.locales = listLocales; + hooks.weekdaysShort = listWeekdaysShort; + hooks.normalizeUnits = normalizeUnits; + hooks.relativeTimeRounding = getSetRelativeTimeRounding; + hooks.relativeTimeThreshold = getSetRelativeTimeThreshold; + hooks.calendarFormat = getCalendarFormat; + hooks.prototype = proto; + hooks.HTML5_FMT = { + DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', + DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', + DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', + DATE: 'YYYY-MM-DD', + TIME: 'HH:mm', + TIME_SECONDS: 'HH:mm:ss', + TIME_MS: 'HH:mm:ss.SSS', + WEEK: 'GGGG-[W]WW', + MONTH: 'YYYY-MM' + }; + return hooks; + }); +},467,[6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var symbolMap = { + 1: '١', + 2: '٢', + 3: '٣', + 4: '٤', + 5: '٥', + 6: '٦', + 7: '٧', + 8: '٨', + 9: '٩', + 0: '٠' + }, + numberMap = { + '١': '1', + '٢': '2', + '٣': '3', + '٤': '4', + '٥': '5', + '٦': '6', + '٧': '7', + '٨': '8', + '٩': '9', + '٠': '0' + }, + pluralForm = function pluralForm(n) { + return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; + }, + plurals = { + s: ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'], + m: ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'], + h: ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'], + d: ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'], + M: ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'], + y: ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام'] + }, + pluralize = function pluralize(u) { + return function (number, withoutSuffix, string, isFuture) { + var f = pluralForm(number), + str = plurals[u][pluralForm(number)]; + + if (f === 2) { + str = str[withoutSuffix ? 0 : 1]; + } + + return str.replace(/%d/i, number); + }; + }, + months = ['يناير', 'فبراير', 'مارس', 'أبريل', 'مايو', 'يونيو', 'يوليو', 'أغسطس', 'سبتمبر', 'أكتوبر', 'نوفمبر', 'ديسمبر']; + + var ar = moment.defineLocale('ar', { + months: months, + monthsShort: months, + weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), + weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), + weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: "D/\u200FM/\u200FYYYY", + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + meridiemParse: /ص|م/, + isPM: function isPM(input) { + return 'م' === input; + }, + meridiem: function meridiem(hour, minute, isLower) { + if (hour < 12) { + return 'ص'; + } else { + return 'م'; + } + }, + calendar: { + sameDay: '[اليوم عند الساعة] LT', + nextDay: '[غدًا عند الساعة] LT', + nextWeek: 'dddd [عند الساعة] LT', + lastDay: '[أمس عند الساعة] LT', + lastWeek: 'dddd [عند الساعة] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'بعد %s', + past: 'منذ %s', + s: pluralize('s'), + ss: pluralize('s'), + m: pluralize('m'), + mm: pluralize('m'), + h: pluralize('h'), + hh: pluralize('h'), + d: pluralize('d'), + dd: pluralize('d'), + M: pluralize('M'), + MM: pluralize('M'), + y: pluralize('y'), + yy: pluralize('y') + }, + preparse: function preparse(string) { + return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { + return numberMap[match]; + }).replace(/،/g, ','); + }, + postformat: function postformat(string) { + return string.replace(/\d/g, function (match) { + return symbolMap[match]; + }).replace(/,/g, '،'); + }, + week: { + dow: 6, + doy: 12 + } + }); + return ar; + }); +},468,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var it = moment.defineLocale('it', { + months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), + monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), + weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'), + weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'), + weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'), + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + calendar: { + sameDay: function sameDay() { + return '[Oggi a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT'; + }, + nextDay: function nextDay() { + return '[Domani a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT'; + }, + nextWeek: function nextWeek() { + return 'dddd [a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT'; + }, + lastDay: function lastDay() { + return '[Ieri a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT'; + }, + lastWeek: function lastWeek() { + switch (this.day()) { + case 0: + return '[La scorsa] dddd [a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT'; + + default: + return '[Lo scorso] dddd [a' + (this.hours() > 1 ? 'lle ' : this.hours() === 0 ? ' ' : "ll'") + ']LT'; + } + }, + sameElse: 'L' + }, + relativeTime: { + future: 'tra %s', + past: '%s fa', + s: 'alcuni secondi', + ss: '%d secondi', + m: 'un minuto', + mm: '%d minuti', + h: "un'ora", + hh: '%d ore', + d: 'un giorno', + dd: '%d giorni', + w: 'una settimana', + ww: '%d settimane', + M: 'un mese', + MM: '%d mesi', + y: 'un anno', + yy: '%d anni' + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 1, + doy: 4 + } + }); + return it; + }); +},469,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var da = moment.defineLocale('da', { + months: 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'), + monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), + weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), + weekdaysShort: 'søn_man_tir_ons_tor_fre_lør'.split('_'), + weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'), + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY HH:mm', + LLLL: 'dddd [d.] D. MMMM YYYY [kl.] HH:mm' + }, + calendar: { + sameDay: '[i dag kl.] LT', + nextDay: '[i morgen kl.] LT', + nextWeek: 'på dddd [kl.] LT', + lastDay: '[i går kl.] LT', + lastWeek: '[i] dddd[s kl.] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'om %s', + past: '%s siden', + s: 'få sekunder', + ss: '%d sekunder', + m: 'et minut', + mm: '%d minutter', + h: 'en time', + hh: '%d timer', + d: 'en dag', + dd: '%d dage', + M: 'en måned', + MM: '%d måneder', + y: 'et år', + yy: '%d år' + }, + dayOfMonthOrdinalParse: /\d{1,2}\./, + ordinal: '%d.', + week: { + dow: 1, + doy: 4 + } + }); + return da; + }); +},470,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + function processRelativeTime(number, withoutSuffix, key, isFuture) { + var format = { + m: ['eine Minute', 'einer Minute'], + h: ['eine Stunde', 'einer Stunde'], + d: ['ein Tag', 'einem Tag'], + dd: [number + ' Tage', number + ' Tagen'], + w: ['eine Woche', 'einer Woche'], + M: ['ein Monat', 'einem Monat'], + MM: [number + ' Monate', number + ' Monaten'], + y: ['ein Jahr', 'einem Jahr'], + yy: [number + ' Jahre', number + ' Jahren'] + }; + return withoutSuffix ? format[key][0] : format[key][1]; + } + + var de = moment.defineLocale('de', { + months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), + monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'), + monthsParseExact: true, + weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), + weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), + weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY HH:mm', + LLLL: 'dddd, D. MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[heute um] LT [Uhr]', + sameElse: 'L', + nextDay: '[morgen um] LT [Uhr]', + nextWeek: 'dddd [um] LT [Uhr]', + lastDay: '[gestern um] LT [Uhr]', + lastWeek: '[letzten] dddd [um] LT [Uhr]' + }, + relativeTime: { + future: 'in %s', + past: 'vor %s', + s: 'ein paar Sekunden', + ss: '%d Sekunden', + m: processRelativeTime, + mm: '%d Minuten', + h: processRelativeTime, + hh: '%d Stunden', + d: processRelativeTime, + dd: processRelativeTime, + w: processRelativeTime, + ww: '%d Wochen', + M: processRelativeTime, + MM: processRelativeTime, + y: processRelativeTime, + yy: processRelativeTime + }, + dayOfMonthOrdinalParse: /\d{1,2}\./, + ordinal: '%d.', + week: { + dow: 1, + doy: 4 + } + }); + return de; + }); +},471,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, + monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i, + monthsRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i, + monthsParse = [/^janv/i, /^févr/i, /^mars/i, /^avr/i, /^mai/i, /^juin/i, /^juil/i, /^août/i, /^sept/i, /^oct/i, /^nov/i, /^déc/i]; + var fr = moment.defineLocale('fr', { + months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), + monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: monthsStrictRegex, + monthsShortStrictRegex: monthsShortStrictRegex, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), + weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), + weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[Aujourd’hui à] LT', + nextDay: '[Demain à] LT', + nextWeek: 'dddd [à] LT', + lastDay: '[Hier à] LT', + lastWeek: 'dddd [dernier à] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'dans %s', + past: 'il y a %s', + s: 'quelques secondes', + ss: '%d secondes', + m: 'une minute', + mm: '%d minutes', + h: 'une heure', + hh: '%d heures', + d: 'un jour', + dd: '%d jours', + w: 'une semaine', + ww: '%d semaines', + M: 'un mois', + MM: '%d mois', + y: 'un an', + yy: '%d ans' + }, + dayOfMonthOrdinalParse: /\d{1,2}(er|)/, + ordinal: function ordinal(number, period) { + switch (period) { + case 'D': + return number + (number === 1 ? 'er' : ''); + + default: + case 'M': + case 'Q': + case 'DDD': + case 'd': + return number + (number === 1 ? 'er' : 'e'); + + case 'w': + case 'W': + return number + (number === 1 ? 're' : 'e'); + } + }, + week: { + dow: 1, + doy: 4 + } + }); + return fr; + }); +},472,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), + monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'), + monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i], + monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; + var nl = moment.defineLocale('nl', { + months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), + monthsShort: function monthsShort(m, format) { + if (!m) { + return monthsShortWithDots; + } else if (/-MMM-/.test(format)) { + return monthsShortWithoutDots[m.month()]; + } else { + return monthsShortWithDots[m.month()]; + } + }, + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, + monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), + weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), + weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD-MM-YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[vandaag om] LT', + nextDay: '[morgen om] LT', + nextWeek: 'dddd [om] LT', + lastDay: '[gisteren om] LT', + lastWeek: '[afgelopen] dddd [om] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'over %s', + past: '%s geleden', + s: 'een paar seconden', + ss: '%d seconden', + m: 'één minuut', + mm: '%d minuten', + h: 'één uur', + hh: '%d uur', + d: 'één dag', + dd: '%d dagen', + w: 'één week', + ww: '%d weken', + M: 'één maand', + MM: '%d maanden', + y: 'één jaar', + yy: '%d jaar' + }, + dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, + ordinal: function ordinal(number) { + return number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de'); + }, + week: { + dow: 1, + doy: 4 + } + }); + return nl; + }); +},473,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), + _monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'), + monthsParse = [/^ene/i, /^feb/i, /^mar/i, /^abr/i, /^may/i, /^jun/i, /^jul/i, /^ago/i, /^sep/i, /^oct/i, /^nov/i, /^dic/i], + monthsRegex = /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i; + + var es = moment.defineLocale('es', { + months: 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), + monthsShort: function monthsShort(m, format) { + if (!m) { + return monthsShortDot; + } else if (/-MMM-/.test(format)) { + return _monthsShort[m.month()]; + } else { + return monthsShortDot[m.month()]; + } + }, + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: /^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i, + monthsShortStrictRegex: /^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), + weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), + weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY H:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY H:mm' + }, + calendar: { + sameDay: function sameDay() { + return '[hoy a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextDay: function nextDay() { + return '[mañana a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + nextWeek: function nextWeek() { + return 'dddd [a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastDay: function lastDay() { + return '[ayer a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + lastWeek: function lastWeek() { + return '[el] dddd [pasado a la' + (this.hours() !== 1 ? 's' : '') + '] LT'; + }, + sameElse: 'L' + }, + relativeTime: { + future: 'en %s', + past: 'hace %s', + s: 'unos segundos', + ss: '%d segundos', + m: 'un minuto', + mm: '%d minutos', + h: 'una hora', + hh: '%d horas', + d: 'un día', + dd: '%d días', + w: 'una semana', + ww: '%d semanas', + M: 'un mes', + MM: '%d meses', + y: 'un año', + yy: '%d años' + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 1, + doy: 4 + }, + invalidDate: 'Fecha inválida' + }); + return es; + }); +},474,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + function relativeTimeWithPlural(number, withoutSuffix, key) { + var format = { + ss: 'secunde', + mm: 'minute', + hh: 'ore', + dd: 'zile', + ww: 'săptămâni', + MM: 'luni', + yy: 'ani' + }, + separator = ' '; + + if (number % 100 >= 20 || number >= 100 && number % 100 === 0) { + separator = ' de '; + } + + return number + separator + format[key]; + } + + var ro = moment.defineLocale('ro', { + months: 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'), + monthsShort: 'ian._feb._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'), + monthsParseExact: true, + weekdays: 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'), + weekdaysShort: 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'), + weekdaysMin: 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'), + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY H:mm', + LLLL: 'dddd, D MMMM YYYY H:mm' + }, + calendar: { + sameDay: '[azi la] LT', + nextDay: '[mâine la] LT', + nextWeek: 'dddd [la] LT', + lastDay: '[ieri la] LT', + lastWeek: '[fosta] dddd [la] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'peste %s', + past: '%s în urmă', + s: 'câteva secunde', + ss: relativeTimeWithPlural, + m: 'un minut', + mm: relativeTimeWithPlural, + h: 'o oră', + hh: relativeTimeWithPlural, + d: 'o zi', + dd: relativeTimeWithPlural, + w: 'o săptămână', + ww: relativeTimeWithPlural, + M: 'o lună', + MM: relativeTimeWithPlural, + y: 'un an', + yy: relativeTimeWithPlural + }, + week: { + dow: 1, + doy: 7 + } + }); + return ro; + }); +},475,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var sv = moment.defineLocale('sv', { + months: 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), + monthsShort: 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), + weekdays: 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), + weekdaysShort: 'sön_mån_tis_ons_tor_fre_lör'.split('_'), + weekdaysMin: 'sö_må_ti_on_to_fr_lö'.split('_'), + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'YYYY-MM-DD', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY [kl.] HH:mm', + LLLL: 'dddd D MMMM YYYY [kl.] HH:mm', + lll: 'D MMM YYYY HH:mm', + llll: 'ddd D MMM YYYY HH:mm' + }, + calendar: { + sameDay: '[Idag] LT', + nextDay: '[Imorgon] LT', + lastDay: '[Igår] LT', + nextWeek: '[På] dddd LT', + lastWeek: '[I] dddd[s] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'om %s', + past: 'för %s sedan', + s: 'några sekunder', + ss: '%d sekunder', + m: 'en minut', + mm: '%d minuter', + h: 'en timme', + hh: '%d timmar', + d: 'en dag', + dd: '%d dagar', + M: 'en månad', + MM: '%d månader', + y: 'ett år', + yy: '%d år' + }, + dayOfMonthOrdinalParse: /\d{1,2}(\:e|\:a)/, + ordinal: function ordinal(number) { + var b = number % 10, + output = ~~(number % 100 / 10) === 1 ? ':e' : b === 1 ? ':a' : b === 2 ? ':a' : b === 3 ? ':e' : ':e'; + return number + output; + }, + week: { + dow: 1, + doy: 4 + } + }); + return sv; + }); +},476,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var pt = moment.defineLocale('pt', { + months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'), + monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), + weekdays: 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), + weekdaysShort: 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), + weekdaysMin: 'Do_2ª_3ª_4ª_5ª_6ª_Sá'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY HH:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY HH:mm' + }, + calendar: { + sameDay: '[Hoje às] LT', + nextDay: '[Amanhã às] LT', + nextWeek: 'dddd [às] LT', + lastDay: '[Ontem às] LT', + lastWeek: function lastWeek() { + return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'; + }, + sameElse: 'L' + }, + relativeTime: { + future: 'em %s', + past: 'há %s', + s: 'segundos', + ss: '%d segundos', + m: 'um minuto', + mm: '%d minutos', + h: 'uma hora', + hh: '%d horas', + d: 'um dia', + dd: '%d dias', + w: 'uma semana', + ww: '%d semanas', + M: 'um mês', + MM: '%d meses', + y: 'um ano', + yy: '%d anos' + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + week: { + dow: 1, + doy: 4 + } + }); + return pt; + }); +},477,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var ptBr = moment.defineLocale('pt-br', { + months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split('_'), + monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'), + weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split('_'), + weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'), + weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D [de] MMMM [de] YYYY', + LLL: 'D [de] MMMM [de] YYYY [às] HH:mm', + LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm' + }, + calendar: { + sameDay: '[Hoje às] LT', + nextDay: '[Amanhã às] LT', + nextWeek: 'dddd [às] LT', + lastDay: '[Ontem às] LT', + lastWeek: function lastWeek() { + return this.day() === 0 || this.day() === 6 ? '[Último] dddd [às] LT' : '[Última] dddd [às] LT'; + }, + sameElse: 'L' + }, + relativeTime: { + future: 'em %s', + past: 'há %s', + s: 'poucos segundos', + ss: '%d segundos', + m: 'um minuto', + mm: '%d minutos', + h: 'uma hora', + hh: '%d horas', + d: 'um dia', + dd: '%d dias', + M: 'um mês', + MM: '%d meses', + y: 'um ano', + yy: '%d anos' + }, + dayOfMonthOrdinalParse: /\d{1,2}º/, + ordinal: '%dº', + invalidDate: 'Data inválida' + }); + return ptBr; + }); +},478,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), + monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'), + monthsParse = [/^jan/i, /^feb/i, /^maart|mrt.?$/i, /^apr/i, /^mei$/i, /^jun[i.]?$/i, /^jul[i.]?$/i, /^aug/i, /^sep/i, /^okt/i, /^nov/i, /^dec/i], + monthsRegex = /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december|jan\.?|feb\.?|mrt\.?|apr\.?|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i; + var nlBe = moment.defineLocale('nl-be', { + months: 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), + monthsShort: function monthsShort(m, format) { + if (!m) { + return monthsShortWithDots; + } else if (/-MMM-/.test(format)) { + return monthsShortWithoutDots[m.month()]; + } else { + return monthsShortWithDots[m.month()]; + } + }, + monthsRegex: monthsRegex, + monthsShortRegex: monthsRegex, + monthsStrictRegex: /^(januari|februari|maart|april|mei|ju[nl]i|augustus|september|oktober|november|december)/i, + monthsShortStrictRegex: /^(jan\.?|feb\.?|mrt\.?|apr\.?|mei|ju[nl]\.?|aug\.?|sep\.?|okt\.?|nov\.?|dec\.?)/i, + monthsParse: monthsParse, + longMonthsParse: monthsParse, + shortMonthsParse: monthsParse, + weekdays: 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), + weekdaysShort: 'zo._ma._di._wo._do._vr._za.'.split('_'), + weekdaysMin: 'zo_ma_di_wo_do_vr_za'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD/MM/YYYY', + LL: 'D MMMM YYYY', + LLL: 'D MMMM YYYY HH:mm', + LLLL: 'dddd D MMMM YYYY HH:mm' + }, + calendar: { + sameDay: '[vandaag om] LT', + nextDay: '[morgen om] LT', + nextWeek: 'dddd [om] LT', + lastDay: '[gisteren om] LT', + lastWeek: '[afgelopen] dddd [om] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'over %s', + past: '%s geleden', + s: 'een paar seconden', + ss: '%d seconden', + m: 'één minuut', + mm: '%d minuten', + h: 'één uur', + hh: '%d uur', + d: 'één dag', + dd: '%d dagen', + M: 'één maand', + MM: '%d maanden', + y: 'één jaar', + yy: '%d jaar' + }, + dayOfMonthOrdinalParse: /\d{1,2}(ste|de)/, + ordinal: function ordinal(number) { + return number + (number === 1 || number === 8 || number >= 20 ? 'ste' : 'de'); + }, + week: { + dow: 1, + doy: 4 + } + }); + return nlBe; + }); +},479,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var nn = moment.defineLocale('nn', { + months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), + monthsParseExact: true, + weekdays: 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), + weekdaysShort: 'su._må._ty._on._to._fr._lau.'.split('_'), + weekdaysMin: 'su_må_ty_on_to_fr_la'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY [kl.] H:mm', + LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm' + }, + calendar: { + sameDay: '[I dag klokka] LT', + nextDay: '[I morgon klokka] LT', + nextWeek: 'dddd [klokka] LT', + lastDay: '[I går klokka] LT', + lastWeek: '[Føregåande] dddd [klokka] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'om %s', + past: '%s sidan', + s: 'nokre sekund', + ss: '%d sekund', + m: 'eit minutt', + mm: '%d minutt', + h: 'ein time', + hh: '%d timar', + d: 'ein dag', + dd: '%d dagar', + w: 'ei veke', + ww: '%d veker', + M: 'ein månad', + MM: '%d månader', + y: 'eit år', + yy: '%d år' + }, + dayOfMonthOrdinalParse: /\d{1,2}\./, + ordinal: '%d.', + week: { + dow: 1, + doy: 4 + } + }); + return nn; + }); +},480,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + var nb = moment.defineLocale('nb', { + months: 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), + monthsShort: 'jan._feb._mars_apr._mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), + monthsParseExact: true, + weekdays: 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), + weekdaysShort: 'sø._ma._ti._on._to._fr._lø.'.split('_'), + weekdaysMin: 'sø_ma_ti_on_to_fr_lø'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'HH:mm', + LTS: 'HH:mm:ss', + L: 'DD.MM.YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY [kl.] HH:mm', + LLLL: 'dddd D. MMMM YYYY [kl.] HH:mm' + }, + calendar: { + sameDay: '[i dag kl.] LT', + nextDay: '[i morgen kl.] LT', + nextWeek: 'dddd [kl.] LT', + lastDay: '[i går kl.] LT', + lastWeek: '[forrige] dddd [kl.] LT', + sameElse: 'L' + }, + relativeTime: { + future: 'om %s', + past: '%s siden', + s: 'noen sekunder', + ss: '%d sekunder', + m: 'ett minutt', + mm: '%d minutter', + h: 'en time', + hh: '%d timer', + d: 'en dag', + dd: '%d dager', + w: 'en uke', + ww: '%d uker', + M: 'en måned', + MM: '%d måneder', + y: 'ett år', + yy: '%d år' + }, + dayOfMonthOrdinalParse: /\d{1,2}\./, + ordinal: '%d.', + week: { + dow: 1, + doy: 4 + } + }); + return nb; + }); +},481,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' && typeof _$$_REQUIRE === 'function' ? factory(_$$_REQUIRE(_dependencyMap[0])) : typeof define === 'function' && define.amd ? define(['../moment'], factory) : factory(global.moment); + })(this, function (moment) { + 'use strict'; + + function processRelativeTime(number, withoutSuffix, key, isFuture) { + var result = number + ' '; + + switch (key) { + case 's': + return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; + + case 'ss': + if (number === 1) { + result += withoutSuffix ? 'sekundo' : 'sekundi'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'sekundi' : 'sekundah'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'sekunde' : 'sekundah'; + } else { + result += 'sekund'; + } + + return result; + + case 'm': + return withoutSuffix ? 'ena minuta' : 'eno minuto'; + + case 'mm': + if (number === 1) { + result += withoutSuffix ? 'minuta' : 'minuto'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'minuti' : 'minutama'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'minute' : 'minutami'; + } else { + result += withoutSuffix || isFuture ? 'minut' : 'minutami'; + } + + return result; + + case 'h': + return withoutSuffix ? 'ena ura' : 'eno uro'; + + case 'hh': + if (number === 1) { + result += withoutSuffix ? 'ura' : 'uro'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'uri' : 'urama'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'ure' : 'urami'; + } else { + result += withoutSuffix || isFuture ? 'ur' : 'urami'; + } + + return result; + + case 'd': + return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; + + case 'dd': + if (number === 1) { + result += withoutSuffix || isFuture ? 'dan' : 'dnem'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'dni' : 'dnevoma'; + } else { + result += withoutSuffix || isFuture ? 'dni' : 'dnevi'; + } + + return result; + + case 'M': + return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; + + case 'MM': + if (number === 1) { + result += withoutSuffix || isFuture ? 'mesec' : 'mesecem'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'meseca' : 'mesecema'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'mesece' : 'meseci'; + } else { + result += withoutSuffix || isFuture ? 'mesecev' : 'meseci'; + } + + return result; + + case 'y': + return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; + + case 'yy': + if (number === 1) { + result += withoutSuffix || isFuture ? 'leto' : 'letom'; + } else if (number === 2) { + result += withoutSuffix || isFuture ? 'leti' : 'letoma'; + } else if (number < 5) { + result += withoutSuffix || isFuture ? 'leta' : 'leti'; + } else { + result += withoutSuffix || isFuture ? 'let' : 'leti'; + } + + return result; + } + } + + var sl = moment.defineLocale('sl', { + months: 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), + monthsShort: 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), + monthsParseExact: true, + weekdays: 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), + weekdaysShort: 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), + weekdaysMin: 'ne_po_to_sr_če_pe_so'.split('_'), + weekdaysParseExact: true, + longDateFormat: { + LT: 'H:mm', + LTS: 'H:mm:ss', + L: 'DD. MM. YYYY', + LL: 'D. MMMM YYYY', + LLL: 'D. MMMM YYYY H:mm', + LLLL: 'dddd, D. MMMM YYYY H:mm' + }, + calendar: { + sameDay: '[danes ob] LT', + nextDay: '[jutri ob] LT', + nextWeek: function nextWeek() { + switch (this.day()) { + case 0: + return '[v] [nedeljo] [ob] LT'; + + case 3: + return '[v] [sredo] [ob] LT'; + + case 6: + return '[v] [soboto] [ob] LT'; + + case 1: + case 2: + case 4: + case 5: + return '[v] dddd [ob] LT'; + } + }, + lastDay: '[včeraj ob] LT', + lastWeek: function lastWeek() { + switch (this.day()) { + case 0: + return '[prejšnjo] [nedeljo] [ob] LT'; + + case 3: + return '[prejšnjo] [sredo] [ob] LT'; + + case 6: + return '[prejšnjo] [soboto] [ob] LT'; + + case 1: + case 2: + case 4: + case 5: + return '[prejšnji] dddd [ob] LT'; + } + }, + sameElse: 'L' + }, + relativeTime: { + future: 'čez %s', + past: 'pred %s', + s: processRelativeTime, + ss: processRelativeTime, + m: processRelativeTime, + mm: processRelativeTime, + h: processRelativeTime, + hh: processRelativeTime, + d: processRelativeTime, + dd: processRelativeTime, + M: processRelativeTime, + MM: processRelativeTime, + y: processRelativeTime, + yy: processRelativeTime + }, + dayOfMonthOrdinalParse: /\d{1,2}\./, + ordinal: '%d.', + week: { + dow: 1, + doy: 7 + } + }); + return sl; + }); +},482,[467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNativeFs = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _rnFetchBlob = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNativePrint = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNativeImageMarker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _stringUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _platformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var FileUtils = function () { + function FileUtils() { + (0, _classCallCheck2.default)(this, FileUtils); + } + + (0, _createClass2.default)(FileUtils, null, [{ + key: "getMainBundleDirectory", + value: function getMainBundleDirectory() { + return _platformUtils.default.isIOS() ? "" + FileUtils.mainBundleDirectory : "" + FileUtils.DocumentDirectoryPath; + } + }, { + key: "getCacheDirectory", + value: function getCacheDirectory() { + return _platformUtils.default.isIOS() ? "" + FileUtils.temporaryDirectory : "" + FileUtils.cacheDirectory; + } + }, { + key: "getLibraryDirectory", + value: function getLibraryDirectory() { + return FileUtils.libraryDirectory; + } + }, { + key: "getDocumentsDirectory", + value: function getDocumentsDirectory() { + return FileUtils.documentDirectory; + } + }, { + key: "getBundleFilename", + value: function getBundleFilename() { + return _platformUtils.default.isIOS() ? "index.ios.bundle" : "android.bundle"; + } + }, { + key: "exists", + value: function exists(path) { + return _regenerator.default.async(function exists$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _reactNativeFs.default.exists(path)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "empty", + value: function empty(path) { + return _regenerator.default.async(function empty$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + _context2.next = 3; + return _regenerator.default.awrap(_reactNativeFs.default.readDir(path)); + + case 3: + _context2.t0 = _context2.sent.length; + return _context2.abrupt("return", !(_context2.t0 > 0)); + + case 7: + _context2.prev = 7; + _context2.t1 = _context2["catch"](0); + return _context2.abrupt("return", false); + + case 10: + case "end": + return _context2.stop(); + } + } + }, null, null, [[0, 7]], Promise); + } + }, { + key: "unlink", + value: function unlink(path) { + return _regenerator.default.async(function unlink$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", _reactNativeFs.default.unlink(path)); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "mkdir", + value: function mkdir(path) { + return _regenerator.default.async(function mkdir$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + return _context4.abrupt("return", _reactNativeFs.default.mkdir(path)); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "appendFile", + value: function appendFile(path, text) { + return _regenerator.default.async(function appendFile$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", _rnFetchBlob.default.fs.appendFile(path, text, "utf8")); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getFiles", + value: function getFiles(path) { + return _regenerator.default.async(function getFiles$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", _rnFetchBlob.default.fs.ls(path)); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "copyFile", + value: function copyFile(source, target) { + return _regenerator.default.async(function copyFile$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", _reactNativeFs.default.copyFile(source, target)); + + case 1: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "moveFile", + value: function moveFile(source, target, options) { + return _regenerator.default.async(function moveFile$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + return _context8.abrupt("return", _reactNativeFs.default.moveFile(source, target, options)); + + case 1: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "assetPath", + value: function assetPath(file) { + return _rnFetchBlob.default.fs.asset(file); + } + }, { + key: "readFileBase64", + value: function readFileBase64(path) { + return _regenerator.default.async(function readFileBase64$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + return _context9.abrupt("return", _rnFetchBlob.default.fs.readFile(path, "base64")); + + case 1: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "readFile", + value: function readFile(path) { + return _regenerator.default.async(function readFile$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + return _context10.abrupt("return", _rnFetchBlob.default.fs.readFile(path)); + + case 1: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "write", + value: function write(path, content) { + var encoding, + _args11 = arguments; + return _regenerator.default.async(function write$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + encoding = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : "utf8"; + return _context11.abrupt("return", _rnFetchBlob.default.fs.writeFile(path, content, encoding)); + + case 2: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "scanFile", + value: function scanFile(path) { + return _regenerator.default.async(function scanFile$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + return _context12.abrupt("return", _rnFetchBlob.default.fs.scanFile([{ + path: path + }])); + + case 1: + case "end": + return _context12.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "fetch", + value: function fetch(url) { + var config, + _config$timeout, + timeout, + _config$readTimeout, + readTimeout, + startCallBack, + progressCallback, + _config$cacheEnabled, + cacheEnabled, + _config$requestHeader, + requestHeaders, + tmpFile, + fallbackContentLength, + status, + headers, + timeouts, + downloadTask, + _args13 = arguments; + + return _regenerator.default.async(function fetch$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + config = _args13.length > 1 && _args13[1] !== undefined ? _args13[1] : {}; + _config$timeout = config.timeout, timeout = _config$timeout === undefined ? FileUtils.networkTimeout : _config$timeout, _config$readTimeout = config.readTimeout, readTimeout = _config$readTimeout === undefined ? FileUtils.readTimeout : _config$readTimeout, startCallBack = config.startCallBack, progressCallback = config.progressCallback, _config$cacheEnabled = config.cacheEnabled, cacheEnabled = _config$cacheEnabled === undefined ? false : _config$cacheEnabled, _config$requestHeader = config.requestHeaders, requestHeaders = _config$requestHeader === undefined ? {} : _config$requestHeader; + _context13.prev = 2; + + if (cacheEnabled) { + tmpFile = FileUtils.temporaryDirectory + "/" + _stringUtils.default.getMd5(url); + } else { + tmpFile = FileUtils.temporaryDirectory + "/" + _stringUtils.default.getMd5(url + new Date().getMilliseconds()); + } + + fallbackContentLength = -1; + status = -1; + headers = {}; + timeouts = { + readTimeout: readTimeout + }; + + if (_platformUtils.default.isAndroid()) { + timeouts.connectionTimeout = timeout; + } + + _context13.t0 = !cacheEnabled; + + if (_context13.t0) { + _context13.next = 14; + break; + } + + _context13.next = 13; + return _regenerator.default.awrap(FileUtils.exists(tmpFile)); + + case 13: + _context13.t0 = !_context13.sent; + + case 14: + if (!_context13.t0) { + _context13.next = 18; + break; + } + + downloadTask = _reactNativeFs.default.downloadFile((0, _extends2.default)({ + fromUrl: url, + toFile: tmpFile, + headers: requestHeaders + }, timeouts, { + begin: function begin(res) { + var statusCode = res.statusCode, + contentLength = res.contentLength, + responseHeaders = res.headers; + status = statusCode; + + if (responseHeaders) { + headers = responseHeaders; + + if (!responseHeaders["Content-Length"] && responseHeaders["Length-If-Chunked"]) { + fallbackContentLength = parseInt(responseHeaders["Length-If-Chunked"], 10); + } + } + + if (startCallBack) { + startCallBack(Math.max(contentLength, fallbackContentLength)); + } + }, + progress: function progress(res) { + if (progressCallback) { + var contentLength = res.contentLength; + var bytesWritten = res.bytesWritten; + + if (contentLength === -1) { + contentLength = fallbackContentLength; + } + + progressCallback(bytesWritten, contentLength); + } + } + })); + _context13.next = 18; + return _regenerator.default.awrap(downloadTask.promise); + + case 18: + return _context13.abrupt("return", { + respInfo: { + status: status, + headers: headers + }, + path: function path() { + return tmpFile; + } + }); + + case 21: + _context13.prev = 21; + _context13.t1 = _context13["catch"](2); + throw _context13.t1; + + case 24: + case "end": + return _context13.stop(); + } + } + }, null, null, [[2, 21]], Promise); + } + }, { + key: "fetchBase64", + value: function fetchBase64(uri) { + var data, base64; + return _regenerator.default.async(function fetchBase64$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + _context14.next = 2; + return _regenerator.default.awrap(FileUtils.fetch(uri)); + + case 2: + data = _context14.sent; + _context14.next = 5; + return _regenerator.default.awrap(FileUtils.readFileBase64(data.path())); + + case 5: + base64 = _context14.sent; + return _context14.abrupt("return", base64); + + case 7: + case "end": + return _context14.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "post", + value: function post(url, postData) { + return _regenerator.default.async(function post$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + return _context15.abrupt("return", _rnFetchBlob.default.fetch("POST", url, { + "Content-Type": "application/octet-stream" + }, [postData])); + + case 1: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "wrap", + value: function wrap(path) { + return _rnFetchBlob.default.wrap(path); + } + }, { + key: "zip", + value: function zip(source, target) { + return (0, _$$_REQUIRE(_dependencyMap[11]).zip)(source, target); + } + }, { + key: "zipFiles", + value: function zipFiles(files, target) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return (0, _$$_REQUIRE(_dependencyMap[11]).zipFiles)(files, target, options); + } + }, { + key: "unzip", + value: function unzip(source, target) { + return _regenerator.default.async(function unzip$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + return _context16.abrupt("return", (0, _$$_REQUIRE(_dependencyMap[11]).unzip)(source, target)); + + case 1: + case "end": + return _context16.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "zipEntryToBase64", + value: function zipEntryToBase64(archiveName, fileName) { + return _regenerator.default.async(function zipEntryToBase64$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + return _context17.abrupt("return", (0, _$$_REQUIRE(_dependencyMap[11]).zipEntryToBase64)(archiveName, fileName)); + + case 1: + case "end": + return _context17.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "clearUnusedDownloadedFiles", + value: function clearUnusedDownloadedFiles() { + var _len, + args, + _key, + i, + _args18 = arguments; + + return _regenerator.default.async(function clearUnusedDownloadedFiles$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + for (_len = _args18.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = _args18[_key]; + } + + if (!args) { + _context18.next = 14; + break; + } + + i = 0; + + case 3: + if (!(i < args.length)) { + _context18.next = 14; + break; + } + + _context18.prev = 4; + _context18.next = 7; + return _regenerator.default.awrap(FileUtils.unlink(args[i])); + + case 7: + _context18.next = 11; + break; + + case 9: + _context18.prev = 9; + _context18.t0 = _context18["catch"](4); + + case 11: + i++; + _context18.next = 3; + break; + + case 14: + case "end": + return _context18.stop(); + } + } + }, null, null, [[4, 9]], Promise); + } + }, { + key: "stat", + value: function stat(filepath) { + return _regenerator.default.async(function stat$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + return _context19.abrupt("return", _reactNativeFs.default.stat(filepath)); + + case 1: + case "end": + return _context19.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "readDir", + value: function readDir(filePath) { + return _regenerator.default.async(function readDir$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + return _context20.abrupt("return", _reactNativeFs.default.readDir(filePath)); + + case 1: + case "end": + return _context20.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getCacheSize", + value: function getCacheSize() { + var result; + return _regenerator.default.async(function getCacheSize$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + result = 0; + _context21.prev = 1; + _context21.next = 4; + return _regenerator.default.awrap(FileUtils.getFolderSize(FileUtils.getCacheDirectory())); + + case 4: + result = _context21.sent; + _context21.next = 9; + break; + + case 7: + _context21.prev = 7; + _context21.t0 = _context21["catch"](1); + + case 9: + return _context21.abrupt("return", result); + + case 10: + case "end": + return _context21.stop(); + } + } + }, null, null, [[1, 7]], Promise); + } + }, { + key: "getFolderSize", + value: function getFolderSize(folder) { + var result, files, i; + return _regenerator.default.async(function getFolderSize$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + result = 0; + _context22.prev = 1; + _context22.next = 4; + return _regenerator.default.awrap(FileUtils.readDir(folder)); + + case 4: + files = _context22.sent; + i = 0; + + case 6: + if (!(i < files.length)) { + _context22.next = 18; + break; + } + + if (!files[i].isDirectory()) { + _context22.next = 14; + break; + } + + _context22.t0 = result; + _context22.next = 11; + return _regenerator.default.awrap(FileUtils.getFolderSize(files[i].path)); + + case 11: + result = _context22.t0 += _context22.sent; + _context22.next = 15; + break; + + case 14: + result += files[i].size; + + case 15: + i++; + _context22.next = 6; + break; + + case 18: + _context22.next = 22; + break; + + case 20: + _context22.prev = 20; + _context22.t1 = _context22["catch"](1); + + case 22: + return _context22.abrupt("return", result); + + case 23: + case "end": + return _context22.stop(); + } + } + }, null, null, [[1, 20]], Promise); + } + }, { + key: "getFilename", + value: function getFilename(pathToFile) { + return pathToFile.substring(pathToFile.lastIndexOf("/") + 1); + } + }, { + key: "getCanonicalPath", + value: function getCanonicalPath(path) { + var basePath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "/"; + + if (path.startsWith("..")) { + path = (basePath + "/" + path).replace(/\/{2,}/g, "/"); + } + + var segments = path.split("/"); + var i = 0; + + while (i < segments.length - 1) { + if (segments[i + 1] === "..") { + segments.splice(i, 2); + i -= 1; + + if (i < 0) { + throw new Error("Impossible to resolve canonical path"); + } + } else { + i += 1; + } + } + + return segments.join("/"); + } + }, { + key: "printHTML", + value: function printHTML(html, fileName, printToLetter) { + var isLandscape, + _args23 = arguments; + return _regenerator.default.async(function printHTML$(_context23) { + while (1) { + switch (_context23.prev = _context23.next) { + case 0: + isLandscape = _args23.length > 3 && _args23[3] !== undefined ? _args23[3] : false; + return _context23.abrupt("return", _reactNativePrint.default.print({ + html: html, + fileName: fileName, + printToLetter: printToLetter, + isLandscape: isLandscape + })); + + case 2: + case "end": + return _context23.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "printFile", + value: function printFile(path, fileName) { + return _regenerator.default.async(function printFile$(_context24) { + while (1) { + switch (_context24.prev = _context24.next) { + case 0: + return _context24.abrupt("return", _reactNativePrint.default.print({ + filePath: path, + fileName: fileName + })); + + case 1: + case "end": + return _context24.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "clearCache", + value: function clearCache() { + return _regenerator.default.async(function clearCache$(_context25) { + while (1) { + switch (_context25.prev = _context25.next) { + case 0: + return _context25.abrupt("return", FileUtils.unlink(FileUtils.getCacheDirectory())); + + case 1: + case "end": + return _context25.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "addTextWatermarkToImage", + value: function addTextWatermarkToImage(params) { + return _regenerator.default.async(function addTextWatermarkToImage$(_context26) { + while (1) { + switch (_context26.prev = _context26.next) { + case 0: + return _context26.abrupt("return", _reactNativeImageMarker.default.markText(params)); + + case 1: + case "end": + return _context26.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "addImageWatermarkToImage", + value: function addImageWatermarkToImage(params) { + return _regenerator.default.async(function addImageWatermarkToImage$(_context27) { + while (1) { + switch (_context27.prev = _context27.next) { + case 0: + return _context27.abrupt("return", _reactNativeImageMarker.default.markImage(params)); + + case 1: + case "end": + return _context27.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return FileUtils; + }(); + + exports.default = FileUtils; + FileUtils.networkTimeout = 0; + FileUtils.readTimeout = 0; + FileUtils.mainBundleDirectory = _reactNativeFs.default.MainBundlePath; + FileUtils.cacheDirectory = _reactNativeFs.default.CachesDirectoryPath; + FileUtils.documentDirectory = _reactNativeFs.default.DocumentDirectoryPath; + FileUtils.libraryDirectory = _reactNativeFs.default.LibraryDirectoryPath; + FileUtils.temporaryDirectory = _reactNativeFs.default.TemporaryDirectoryPath; + FileUtils.picturesDirectory = _reactNativeFs.default.PicturesDirectoryPath; +},483,[5,80,6,7,8,484,487,512,513,514,531,541]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var RNFSManager = _$$_REQUIRE(_dependencyMap[0]).NativeModules.RNFSManager; + + var NativeEventEmitter = _$$_REQUIRE(_dependencyMap[0]).NativeEventEmitter; + + var RNFS_NativeEventEmitter = new NativeEventEmitter(RNFSManager); + var isIOS = true; + var RNFSFileTypeRegular = RNFSManager.RNFSFileTypeRegular; + var RNFSFileTypeDirectory = RNFSManager.RNFSFileTypeDirectory; + var jobId = 0; + + var getJobId = function getJobId() { + jobId += 1; + return jobId; + }; + + var normalizeFilePath = function normalizeFilePath(path) { + return path.startsWith('file://') ? path.slice(7) : path; + }; + + function readFileGeneric(filepath, encodingOrOptions, command) { + var options = { + encoding: 'utf8' + }; + + if (encodingOrOptions) { + if (typeof encodingOrOptions === 'string') { + options.encoding = encodingOrOptions; + } else if (typeof encodingOrOptions === 'object') { + options = encodingOrOptions; + } + } + + return command(normalizeFilePath(filepath)).then(function (b64) { + var contents; + + if (options.encoding === 'utf8') { + contents = _$$_REQUIRE(_dependencyMap[1]).decode(_$$_REQUIRE(_dependencyMap[2]).decode(b64)); + } else if (options.encoding === 'ascii') { + contents = _$$_REQUIRE(_dependencyMap[2]).decode(b64); + } else if (options.encoding === 'base64') { + contents = b64; + } else { + throw new Error('Invalid encoding type "' + String(options.encoding) + '"'); + } + + return contents; + }); + } + + function readDirGeneric(dirpath, command) { + return command(normalizeFilePath(dirpath)).then(function (files) { + return files.map(function (file) { + return { + ctime: file.ctime && new Date(file.ctime * 1000) || null, + mtime: file.mtime && new Date(file.mtime * 1000) || null, + name: file.name, + path: file.path, + size: file.size, + isFile: function isFile() { + return file.type === RNFSFileTypeRegular; + }, + isDirectory: function isDirectory() { + return file.type === RNFSFileTypeDirectory; + } + }; + }); + }); + } + + var RNFS = { + mkdir: function mkdir(filepath) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return RNFSManager.mkdir(normalizeFilePath(filepath), options).then(function () { + return undefined; + }); + }, + moveFile: function moveFile(filepath, destPath) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return RNFSManager.moveFile(normalizeFilePath(filepath), normalizeFilePath(destPath), options).then(function () { + return undefined; + }); + }, + copyFile: function copyFile(filepath, destPath) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return RNFSManager.copyFile(normalizeFilePath(filepath), normalizeFilePath(destPath), options).then(function () { + return undefined; + }); + }, + pathForBundle: function pathForBundle(bundleNamed) { + return RNFSManager.pathForBundle(bundleNamed); + }, + pathForGroup: function pathForGroup(groupName) { + return RNFSManager.pathForGroup(groupName); + }, + getFSInfo: function getFSInfo() { + return RNFSManager.getFSInfo(); + }, + getAllExternalFilesDirs: function getAllExternalFilesDirs() { + return RNFSManager.getAllExternalFilesDirs(); + }, + unlink: function unlink(filepath) { + return RNFSManager.unlink(normalizeFilePath(filepath)).then(function () { + return undefined; + }); + }, + exists: function exists(filepath) { + return RNFSManager.exists(normalizeFilePath(filepath)); + }, + stopDownload: function stopDownload(jobId) { + RNFSManager.stopDownload(jobId); + }, + resumeDownload: function resumeDownload(jobId) { + RNFSManager.resumeDownload(jobId); + }, + isResumable: function isResumable(jobId) { + return RNFSManager.isResumable(jobId); + }, + stopUpload: function stopUpload(jobId) { + RNFSManager.stopUpload(jobId); + }, + completeHandlerIOS: function completeHandlerIOS(jobId) { + return RNFSManager.completeHandlerIOS(jobId); + }, + readDir: function readDir(dirpath) { + return readDirGeneric(dirpath, RNFSManager.readDir); + }, + readDirAssets: function readDirAssets(dirpath) { + if (!RNFSManager.readDirAssets) { + throw new Error('readDirAssets is not available on this platform'); + } + + return readDirGeneric(dirpath, RNFSManager.readDirAssets); + }, + existsAssets: function existsAssets(filepath) { + if (!RNFSManager.existsAssets) { + throw new Error('existsAssets is not available on this platform'); + } + + return RNFSManager.existsAssets(filepath); + }, + existsRes: function existsRes(filename) { + if (!RNFSManager.existsRes) { + throw new Error('existsRes is not available on this platform'); + } + + return RNFSManager.existsRes(filename); + }, + readdir: function readdir(dirpath) { + return RNFS.readDir(normalizeFilePath(dirpath)).then(function (files) { + return files.map(function (file) { + return file.name; + }); + }); + }, + setReadable: function setReadable(filepath, readable, ownerOnly) { + return RNFSManager.setReadable(filepath, readable, ownerOnly).then(function (result) { + return result; + }); + }, + stat: function stat(filepath) { + return RNFSManager.stat(normalizeFilePath(filepath)).then(function (result) { + return { + 'path': filepath, + 'ctime': new Date(result.ctime * 1000), + 'mtime': new Date(result.mtime * 1000), + 'size': result.size, + 'mode': result.mode, + 'originalFilepath': result.originalFilepath, + isFile: function isFile() { + return result.type === RNFSFileTypeRegular; + }, + isDirectory: function isDirectory() { + return result.type === RNFSFileTypeDirectory; + } + }; + }); + }, + readFile: function readFile(filepath, encodingOrOptions) { + return readFileGeneric(filepath, encodingOrOptions, RNFSManager.readFile); + }, + read: function read(filepath) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var encodingOrOptions = arguments.length > 3 ? arguments[3] : undefined; + var options = { + encoding: 'utf8' + }; + + if (encodingOrOptions) { + if (typeof encodingOrOptions === 'string') { + options.encoding = encodingOrOptions; + } else if (typeof encodingOrOptions === 'object') { + options = encodingOrOptions; + } + } + + return RNFSManager.read(normalizeFilePath(filepath), length, position).then(function (b64) { + var contents; + + if (options.encoding === 'utf8') { + contents = _$$_REQUIRE(_dependencyMap[1]).decode(_$$_REQUIRE(_dependencyMap[2]).decode(b64)); + } else if (options.encoding === 'ascii') { + contents = _$$_REQUIRE(_dependencyMap[2]).decode(b64); + } else if (options.encoding === 'base64') { + contents = b64; + } else { + throw new Error('Invalid encoding type "' + String(options.encoding) + '"'); + } + + return contents; + }); + }, + readFileAssets: function readFileAssets(filepath, encodingOrOptions) { + if (!RNFSManager.readFileAssets) { + throw new Error('readFileAssets is not available on this platform'); + } + + return readFileGeneric(filepath, encodingOrOptions, RNFSManager.readFileAssets); + }, + readFileRes: function readFileRes(filename, encodingOrOptions) { + if (!RNFSManager.readFileRes) { + throw new Error('readFileRes is not available on this platform'); + } + + return readFileGeneric(filename, encodingOrOptions, RNFSManager.readFileRes); + }, + hash: function hash(filepath, algorithm) { + return RNFSManager.hash(normalizeFilePath(filepath), algorithm); + }, + copyFileAssets: function copyFileAssets(filepath, destPath) { + if (!RNFSManager.copyFileAssets) { + throw new Error('copyFileAssets is not available on this platform'); + } + + return RNFSManager.copyFileAssets(normalizeFilePath(filepath), normalizeFilePath(destPath)).then(function () { + return undefined; + }); + }, + copyFileRes: function copyFileRes(filename, destPath) { + if (!RNFSManager.copyFileRes) { + throw new Error('copyFileRes is not available on this platform'); + } + + return RNFSManager.copyFileRes(filename, normalizeFilePath(destPath)).then(function () { + return undefined; + }); + }, + copyAssetsFileIOS: function copyAssetsFileIOS(imageUri, destPath, width, height) { + var scale = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1.0; + var compression = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1.0; + var resizeMode = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'contain'; + return RNFSManager.copyAssetsFileIOS(imageUri, destPath, width, height, scale, compression, resizeMode); + }, + copyAssetsVideoIOS: function copyAssetsVideoIOS(imageUri, destPath) { + return RNFSManager.copyAssetsVideoIOS(imageUri, destPath); + }, + writeFile: function writeFile(filepath, contents, encodingOrOptions) { + var b64; + var options = { + encoding: 'utf8' + }; + + if (encodingOrOptions) { + if (typeof encodingOrOptions === 'string') { + options.encoding = encodingOrOptions; + } else if (typeof encodingOrOptions === 'object') { + options = _$$_REQUIRE(_dependencyMap[3])({}, options, encodingOrOptions); + } + } + + if (options.encoding === 'utf8') { + b64 = _$$_REQUIRE(_dependencyMap[2]).encode(_$$_REQUIRE(_dependencyMap[1]).encode(contents)); + } else if (options.encoding === 'ascii') { + b64 = _$$_REQUIRE(_dependencyMap[2]).encode(contents); + } else if (options.encoding === 'base64') { + b64 = contents; + } else { + throw new Error('Invalid encoding type "' + options.encoding + '"'); + } + + return RNFSManager.writeFile(normalizeFilePath(filepath), b64, options).then(function () { + return undefined; + }); + }, + appendFile: function appendFile(filepath, contents, encodingOrOptions) { + var b64; + var options = { + encoding: 'utf8' + }; + + if (encodingOrOptions) { + if (typeof encodingOrOptions === 'string') { + options.encoding = encodingOrOptions; + } else if (typeof encodingOrOptions === 'object') { + options = encodingOrOptions; + } + } + + if (options.encoding === 'utf8') { + b64 = _$$_REQUIRE(_dependencyMap[2]).encode(_$$_REQUIRE(_dependencyMap[1]).encode(contents)); + } else if (options.encoding === 'ascii') { + b64 = _$$_REQUIRE(_dependencyMap[2]).encode(contents); + } else if (options.encoding === 'base64') { + b64 = contents; + } else { + throw new Error('Invalid encoding type "' + options.encoding + '"'); + } + + return RNFSManager.appendFile(normalizeFilePath(filepath), b64); + }, + write: function write(filepath, contents, position, encodingOrOptions) { + var b64; + var options = { + encoding: 'utf8' + }; + + if (encodingOrOptions) { + if (typeof encodingOrOptions === 'string') { + options.encoding = encodingOrOptions; + } else if (typeof encodingOrOptions === 'object') { + options = encodingOrOptions; + } + } + + if (options.encoding === 'utf8') { + b64 = _$$_REQUIRE(_dependencyMap[2]).encode(_$$_REQUIRE(_dependencyMap[1]).encode(contents)); + } else if (options.encoding === 'ascii') { + b64 = _$$_REQUIRE(_dependencyMap[2]).encode(contents); + } else if (options.encoding === 'base64') { + b64 = contents; + } else { + throw new Error('Invalid encoding type "' + options.encoding + '"'); + } + + if (position === undefined) { + position = -1; + } + + return RNFSManager.write(normalizeFilePath(filepath), b64, position).then(function () { + return undefined; + }); + }, + downloadFile: function downloadFile(options) { + if (typeof options !== 'object') throw new Error('downloadFile: Invalid value for argument `options`'); + if (typeof options.fromUrl !== 'string') throw new Error('downloadFile: Invalid value for property `fromUrl`'); + if (typeof options.toFile !== 'string') throw new Error('downloadFile: Invalid value for property `toFile`'); + if (options.headers && typeof options.headers !== 'object') throw new Error('downloadFile: Invalid value for property `headers`'); + if (options.background && typeof options.background !== 'boolean') throw new Error('downloadFile: Invalid value for property `background`'); + if (options.progressDivider && typeof options.progressDivider !== 'number') throw new Error('downloadFile: Invalid value for property `progressDivider`'); + if (options.progressInterval && typeof options.progressInterval !== 'number') throw new Error('downloadFile: Invalid value for property `progressInterval`'); + if (options.readTimeout && typeof options.readTimeout !== 'number') throw new Error('downloadFile: Invalid value for property `readTimeout`'); + if (options.connectionTimeout && typeof options.connectionTimeout !== 'number') throw new Error('downloadFile: Invalid value for property `connectionTimeout`'); + if (options.backgroundTimeout && typeof options.backgroundTimeout !== 'number') throw new Error('downloadFile: Invalid value for property `backgroundTimeout`'); + var jobId = getJobId(); + var subscriptions = []; + + if (options.begin) { + subscriptions.push(RNFS_NativeEventEmitter.addListener('DownloadBegin', function (res) { + if (res.jobId === jobId) options.begin(res); + })); + } + + if (options.progress) { + subscriptions.push(RNFS_NativeEventEmitter.addListener('DownloadProgress', function (res) { + if (res.jobId === jobId) options.progress(res); + })); + } + + if (options.resumable) { + subscriptions.push(RNFS_NativeEventEmitter.addListener('DownloadResumable', function (res) { + if (res.jobId === jobId) options.resumable(res); + })); + } + + var bridgeOptions = { + jobId: jobId, + fromUrl: options.fromUrl, + toFile: normalizeFilePath(options.toFile), + headers: options.headers || {}, + background: !!options.background, + progressDivider: options.progressDivider || 0, + progressInterval: options.progressInterval || 0, + readTimeout: options.readTimeout || 15000, + connectionTimeout: options.connectionTimeout || 5000, + backgroundTimeout: options.backgroundTimeout || 3600000, + hasBeginCallback: options.begin instanceof Function, + hasProgressCallback: options.progress instanceof Function, + hasResumableCallback: options.resumable instanceof Function + }; + return { + jobId: jobId, + promise: RNFSManager.downloadFile(bridgeOptions).then(function (res) { + subscriptions.forEach(function (sub) { + return sub.remove(); + }); + return res; + }).catch(function (e) { + return Promise.reject(e); + }) + }; + }, + uploadFiles: function uploadFiles(options) { + if (!RNFSManager.uploadFiles) { + return { + jobId: -1, + promise: Promise.reject(new Error('`uploadFiles` is unsupported on this platform')) + }; + } + + var jobId = getJobId(); + var subscriptions = []; + if (typeof options !== 'object') throw new Error('uploadFiles: Invalid value for argument `options`'); + if (typeof options.toUrl !== 'string') throw new Error('uploadFiles: Invalid value for property `toUrl`'); + if (!Array.isArray(options.files)) throw new Error('uploadFiles: Invalid value for property `files`'); + if (options.headers && typeof options.headers !== 'object') throw new Error('uploadFiles: Invalid value for property `headers`'); + if (options.fields && typeof options.fields !== 'object') throw new Error('uploadFiles: Invalid value for property `fields`'); + if (options.method && typeof options.method !== 'string') throw new Error('uploadFiles: Invalid value for property `method`'); + + if (options.begin) { + subscriptions.push(RNFS_NativeEventEmitter.addListener('UploadBegin', options.begin)); + } else if (options.beginCallback) { + subscriptions.push(RNFS_NativeEventEmitter.addListener('UploadBegin', options.beginCallback)); + } + + if (options.progress) { + subscriptions.push(RNFS_NativeEventEmitter.addListener('UploadProgress', options.progress)); + } else if (options.progressCallback) { + subscriptions.push(RNFS_NativeEventEmitter.addListener('UploadProgress', options.progressCallback)); + } + + var bridgeOptions = { + jobId: jobId, + toUrl: options.toUrl, + files: options.files, + binaryStreamOnly: options.binaryStreamOnly || false, + headers: options.headers || {}, + fields: options.fields || {}, + method: options.method || 'POST', + hasBeginCallback: options.begin instanceof Function || options.beginCallback instanceof Function, + hasProgressCallback: options.progress instanceof Function || options.progressCallback instanceof Function + }; + return { + jobId: jobId, + promise: RNFSManager.uploadFiles(bridgeOptions).then(function (res) { + subscriptions.forEach(function (sub) { + return sub.remove(); + }); + return res; + }) + }; + }, + touch: function touch(filepath, mtime, ctime) { + if (ctime && !(ctime instanceof Date)) throw new Error('touch: Invalid value for argument `ctime`'); + if (mtime && !(mtime instanceof Date)) throw new Error('touch: Invalid value for argument `mtime`'); + var ctimeTime = 0; + { + ctimeTime = ctime && ctime.getTime(); + } + return RNFSManager.touch(normalizeFilePath(filepath), mtime && mtime.getTime(), ctimeTime); + }, + scanFile: function scanFile(path) { + return RNFSManager.scanFile(path); + }, + MainBundlePath: RNFSManager.RNFSMainBundlePath, + CachesDirectoryPath: RNFSManager.RNFSCachesDirectoryPath, + ExternalCachesDirectoryPath: RNFSManager.RNFSExternalCachesDirectoryPath, + DocumentDirectoryPath: RNFSManager.RNFSDocumentDirectoryPath, + DownloadDirectoryPath: RNFSManager.RNFSDownloadDirectoryPath, + ExternalDirectoryPath: RNFSManager.RNFSExternalDirectoryPath, + ExternalStorageDirectoryPath: RNFSManager.RNFSExternalStorageDirectoryPath, + TemporaryDirectoryPath: RNFSManager.RNFSTemporaryDirectoryPath, + LibraryDirectoryPath: RNFSManager.RNFSLibraryDirectoryPath, + PicturesDirectoryPath: RNFSManager.RNFSPicturesDirectoryPath, + FileProtectionKeys: RNFSManager.RNFSFileProtectionKeys + }; + module.exports = RNFS; +},484,[28,485,486,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root) { + var stringFromCharCode = String.fromCharCode; + + function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + var value; + var extra; + + while (counter < length) { + value = string.charCodeAt(counter++); + + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + extra = string.charCodeAt(counter++); + + if ((extra & 0xFC00) == 0xDC00) { + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + + return output; + } + + function ucs2encode(array) { + var length = array.length; + var index = -1; + var value; + var output = ''; + + while (++index < length) { + value = array[index]; + + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + + output += stringFromCharCode(value); + } + + return output; + } + + function checkScalarValue(codePoint) { + if (codePoint >= 0xD800 && codePoint <= 0xDFFF) { + throw Error('Lone surrogate U+' + codePoint.toString(16).toUpperCase() + ' is not a scalar value'); + } + } + + function createByte(codePoint, shift) { + return stringFromCharCode(codePoint >> shift & 0x3F | 0x80); + } + + function encodeCodePoint(codePoint) { + if ((codePoint & 0xFFFFFF80) == 0) { + return stringFromCharCode(codePoint); + } + + var symbol = ''; + + if ((codePoint & 0xFFFFF800) == 0) { + symbol = stringFromCharCode(codePoint >> 6 & 0x1F | 0xC0); + } else if ((codePoint & 0xFFFF0000) == 0) { + checkScalarValue(codePoint); + symbol = stringFromCharCode(codePoint >> 12 & 0x0F | 0xE0); + symbol += createByte(codePoint, 6); + } else if ((codePoint & 0xFFE00000) == 0) { + symbol = stringFromCharCode(codePoint >> 18 & 0x07 | 0xF0); + symbol += createByte(codePoint, 12); + symbol += createByte(codePoint, 6); + } + + symbol += stringFromCharCode(codePoint & 0x3F | 0x80); + return symbol; + } + + function utf8encode(string) { + var codePoints = ucs2decode(string); + var length = codePoints.length; + var index = -1; + var codePoint; + var byteString = ''; + + while (++index < length) { + codePoint = codePoints[index]; + byteString += encodeCodePoint(codePoint); + } + + return byteString; + } + + function readContinuationByte() { + if (byteIndex >= byteCount) { + throw Error('Invalid byte index'); + } + + var continuationByte = byteArray[byteIndex] & 0xFF; + byteIndex++; + + if ((continuationByte & 0xC0) == 0x80) { + return continuationByte & 0x3F; + } + + throw Error('Invalid continuation byte'); + } + + function decodeSymbol() { + var byte1; + var byte2; + var byte3; + var byte4; + var codePoint; + + if (byteIndex > byteCount) { + throw Error('Invalid byte index'); + } + + if (byteIndex == byteCount) { + return false; + } + + byte1 = byteArray[byteIndex] & 0xFF; + byteIndex++; + + if ((byte1 & 0x80) == 0) { + return byte1; + } + + if ((byte1 & 0xE0) == 0xC0) { + byte2 = readContinuationByte(); + codePoint = (byte1 & 0x1F) << 6 | byte2; + + if (codePoint >= 0x80) { + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + if ((byte1 & 0xF0) == 0xE0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + codePoint = (byte1 & 0x0F) << 12 | byte2 << 6 | byte3; + + if (codePoint >= 0x0800) { + checkScalarValue(codePoint); + return codePoint; + } else { + throw Error('Invalid continuation byte'); + } + } + + if ((byte1 & 0xF8) == 0xF0) { + byte2 = readContinuationByte(); + byte3 = readContinuationByte(); + byte4 = readContinuationByte(); + codePoint = (byte1 & 0x07) << 0x12 | byte2 << 0x0C | byte3 << 0x06 | byte4; + + if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) { + return codePoint; + } + } + + throw Error('Invalid UTF-8 detected'); + } + + var byteArray; + var byteCount; + var byteIndex; + + function utf8decode(byteString) { + byteArray = ucs2decode(byteString); + byteCount = byteArray.length; + byteIndex = 0; + var codePoints = []; + var tmp; + + while ((tmp = decodeSymbol()) !== false) { + codePoints.push(tmp); + } + + return ucs2encode(codePoints); + } + + root.version = '3.0.0'; + root.encode = utf8encode; + root.decode = utf8decode; + })(typeof exports === 'undefined' ? this.utf8 = {} : exports); +},485,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root) { + var freeExports = typeof exports == 'object' && exports; + var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; + var freeGlobal = typeof global == 'object' && global; + + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + var InvalidCharacterError = function InvalidCharacterError(message) { + this.message = message; + }; + + InvalidCharacterError.prototype = new Error(); + InvalidCharacterError.prototype.name = 'InvalidCharacterError'; + + var error = function error(message) { + throw new InvalidCharacterError(message); + }; + + var TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; + var REGEX_SPACE_CHARACTERS = /[\t\n\f\r ]/g; + + var decode = function decode(input) { + input = String(input).replace(REGEX_SPACE_CHARACTERS, ''); + var length = input.length; + + if (length % 4 == 0) { + input = input.replace(/==?$/, ''); + length = input.length; + } + + if (length % 4 == 1 || /[^+a-zA-Z0-9/]/.test(input)) { + error('Invalid character: the string to be decoded is not correctly encoded.'); + } + + var bitCounter = 0; + var bitStorage; + var buffer; + var output = ''; + var position = -1; + + while (++position < length) { + buffer = TABLE.indexOf(input.charAt(position)); + bitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer; + + if (bitCounter++ % 4) { + output += String.fromCharCode(0xFF & bitStorage >> (-2 * bitCounter & 6)); + } + } + + return output; + }; + + var encode = function encode(input) { + input = String(input); + + if (/[^\0-\xFF]/.test(input)) { + error("The string to be encoded contains characters outside of the Latin1 range."); + } + + var padding = input.length % 3; + var output = ''; + var position = -1; + var a; + var b; + var c; + var d; + var buffer; + var length = input.length - padding; + + while (++position < length) { + a = input.charCodeAt(position) << 16; + b = input.charCodeAt(++position) << 8; + c = input.charCodeAt(++position); + buffer = a + b + c; + output += TABLE.charAt(buffer >> 18 & 0x3F) + TABLE.charAt(buffer >> 12 & 0x3F) + TABLE.charAt(buffer >> 6 & 0x3F) + TABLE.charAt(buffer & 0x3F); + } + + if (padding == 2) { + a = input.charCodeAt(position) << 8; + b = input.charCodeAt(++position); + buffer = a + b; + output += TABLE.charAt(buffer >> 10) + TABLE.charAt(buffer >> 4 & 0x3F) + TABLE.charAt(buffer << 2 & 0x3F) + '='; + } else if (padding == 1) { + buffer = input.charCodeAt(position); + output += TABLE.charAt(buffer >> 2) + TABLE.charAt(buffer << 4 & 0x3F) + '=='; + } + + return output; + }; + + var base64 = { + 'encode': encode, + 'decode': decode, + 'version': '0.1.0' + }; + + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + define(function () { + return base64; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { + freeModule.exports = base64; + } else { + for (var key in base64) { + base64.hasOwnProperty(key) && (freeExports[key] = base64[key]); + } + } + } else { + root.base64 = base64; + } + })(this); +},486,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _uri = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _fs = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _uuid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _base = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _polyfill = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _lodash = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _android = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _ios = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _jsonStream = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var RNFetchBlobSession = _fs.default.RNFetchBlobSession, + readStream = _fs.default.readStream, + createFile = _fs.default.createFile, + unlink = _fs.default.unlink, + exists = _fs.default.exists, + mkdir = _fs.default.mkdir, + session = _fs.default.session, + writeStream = _fs.default.writeStream, + readFile = _fs.default.readFile, + ls = _fs.default.ls, + isDir = _fs.default.isDir, + mv = _fs.default.mv, + cp = _fs.default.cp; + var Blob = _polyfill.default.Blob; + var emitter = _reactNative.DeviceEventEmitter; + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + + if (_reactNative.Platform.OS === 'ios') { + _reactNative.AppState.addEventListener('change', function (e) { + if (e === 'active') RNFetchBlob.emitExpiredEvent(function () {}); + }); + } + + emitter.addListener("RNFetchBlobMessage", function (e) { + if (e.event === 'warn') { + console.warn(e.detail); + } else if (e.event === 'error') { + throw e.detail; + } else {} + }); + + if (!RNFetchBlob || !RNFetchBlob.fetchBlobForm || !RNFetchBlob.fetchBlob) { + console.warn('rn-fetch-blob could not find valid native module.', 'please make sure you have linked native modules using `rnpm link`,', 'and restart RN packager or manually compile IOS/Android project.'); + } + + function wrap(path) { + var prefix = path.startsWith('content://') ? 'RNFetchBlob-content://' : 'RNFetchBlob-file://'; + return prefix + path; + } + + function config(options) { + return { + fetch: fetch.bind(options) + }; + } + + function fetchFile() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var method = arguments.length > 1 ? arguments[1] : undefined; + var url = arguments.length > 2 ? arguments[2] : undefined; + var headers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var body = arguments.length > 4 ? arguments[4] : undefined; + + if (!_uri.default.isFileURI(url)) { + throw "could not fetch file from an invalid URI : " + url; + } + + url = _uri.default.unwrapFileURI(url); + var promise = null; + var cursor = 0; + var total = -1; + var cacheData = ''; + var info = null; + + var _progress, _uploadProgress, _stateChange; + + switch (method.toLowerCase()) { + case 'post': + break; + + case 'put': + break; + + default: + promise = _fs.default.stat(url).then(function (stat) { + total = stat.size; + return _fs.default.readStream(url, headers.encoding || 'utf8', Math.floor(headers.bufferSize) || 409600, Math.floor(headers.interval) || 100); + }).then(function (stream) { + return new Promise(function (resolve, reject) { + stream.open(); + info = { + state: "2", + headers: { + 'source': 'system-fs' + }, + status: 200, + respType: 'text', + rnfbEncode: headers.encoding || 'utf8' + }; + + _stateChange(info); + + stream.onData(function (chunk) { + _progress && _progress(cursor, total, chunk); + if (headers.noCache) return; + cacheData += chunk; + }); + stream.onError(function (err) { + reject(err); + }); + stream.onEnd(function () { + resolve(new FetchBlobResponse(null, info, cacheData)); + }); + }); + }); + break; + } + + promise.progress = function (fn) { + _progress = fn; + return promise; + }; + + promise.stateChange = function (fn) { + _stateChange = fn; + return promise; + }; + + promise.uploadProgress = function (fn) { + _uploadProgress = fn; + return promise; + }; + + return promise; + } + + function fetch() { + var taskId = (0, _uuid.default)(); + var options = this || {}; + var subscription, subscriptionUpload, stateEvent, partEvent; + var respInfo = {}; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var _ref = [].concat(args), + method = _ref[0], + url = _ref[1], + headers = _ref[2], + body = _ref[3]; + + headers = _lodash.default.reduce(headers, function (result, value, key) { + result[key] = value || ''; + return result; + }, {}); + + if (_uri.default.isFileURI(url)) { + return fetchFile(options, method, url, headers, body); + } + + var promiseResolve; + var promiseReject; + var promise = new Promise(function (resolve, reject) { + promiseResolve = resolve; + promiseReject = reject; + var nativeMethodName = Array.isArray(body) ? 'fetchBlobForm' : 'fetchBlob'; + subscription = emitter.addListener('RNFetchBlobProgress', function (e) { + if (e.taskId === taskId && promise.onProgress) { + promise.onProgress(e.written, e.total, e.chunk); + } + }); + subscriptionUpload = emitter.addListener('RNFetchBlobProgress-upload', function (e) { + if (e.taskId === taskId && promise.onUploadProgress) { + promise.onUploadProgress(e.written, e.total); + } + }); + stateEvent = emitter.addListener('RNFetchBlobState', function (e) { + if (e.taskId === taskId) respInfo = e; + promise.onStateChange && promise.onStateChange(e); + }); + subscription = emitter.addListener('RNFetchBlobExpire', function (e) { + if (e.taskId === taskId && promise.onExpire) { + promise.onExpire(e); + } + }); + partEvent = emitter.addListener('RNFetchBlobServerPush', function (e) { + if (e.taskId === taskId && promise.onPartData) { + promise.onPartData(e.chunk); + } + }); + + if (body instanceof Blob && body.isRNFetchBlobPolyfill) { + body = body.getRNFetchBlobRef(); + } + + var req = RNFetchBlob[nativeMethodName]; + req(options, taskId, method, url, headers || {}, body, function (err, rawType, data) { + subscription.remove(); + subscriptionUpload.remove(); + stateEvent.remove(); + partEvent.remove(); + delete promise['progress']; + delete promise['uploadProgress']; + delete promise['stateChange']; + delete promise['part']; + delete promise['cancel']; + + promise.cancel = function () {}; + + if (err) reject(new Error(err, respInfo));else { + if (options.path || options.fileCache || options.addAndroidDownloads || options.key || options.auto && respInfo.respType === 'blob') { + if (options.session) session(options.session).add(data); + } + + respInfo.rnfbEncode = rawType; + resolve(new FetchBlobResponse(taskId, respInfo, data)); + } + }); + }); + + promise.progress = function () { + var interval = 250; + var count = -1; + + var fn = function fn() {}; + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (args.length === 2) { + interval = args[0].interval || interval; + count = args[0].count || count; + fn = args[1]; + } else { + fn = args[0]; + } + + promise.onProgress = fn; + RNFetchBlob.enableProgressReport(taskId, interval, count); + return promise; + }; + + promise.uploadProgress = function () { + var interval = 250; + var count = -1; + + var fn = function fn() {}; + + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + if (args.length === 2) { + interval = args[0].interval || interval; + count = args[0].count || count; + fn = args[1]; + } else { + fn = args[0]; + } + + promise.onUploadProgress = fn; + RNFetchBlob.enableUploadProgressReport(taskId, interval, count); + return promise; + }; + + promise.part = function (fn) { + promise.onPartData = fn; + return promise; + }; + + promise.stateChange = function (fn) { + promise.onStateChange = fn; + return promise; + }; + + promise.expire = function (fn) { + promise.onExpire = fn; + return promise; + }; + + promise.cancel = function (fn) { + fn = fn || function () {}; + + subscription.remove(); + subscriptionUpload.remove(); + stateEvent.remove(); + RNFetchBlob.cancelRequest(taskId, fn); + promiseReject(new Error("canceled")); + }; + + promise.taskId = taskId; + return promise; + } + + var FetchBlobResponse = function FetchBlobResponse(taskId, info, data) { + var _this = this; + + (0, _classCallCheck2.default)(this, FetchBlobResponse); + this.data = data; + this.taskId = taskId; + this.type = info.rnfbEncode; + this.respInfo = info; + + this.info = function () { + return _this.respInfo; + }; + + this.array = function () { + var cType = info.headers['Content-Type'] || info.headers['content-type']; + return new Promise(function (resolve, reject) { + switch (_this.type) { + case 'base64': + break; + + case 'path': + _fs.default.readFile(_this.data, 'ascii').then(resolve); + + break; + + default: + break; + } + }); + }; + + this.blob = function () { + var Blob = _polyfill.default.Blob; + var cType = info.headers['Content-Type'] || info.headers['content-type']; + return new Promise(function (resolve, reject) { + switch (_this.type) { + case 'base64': + Blob.build(_this.data, { + type: cType + ';BASE64' + }).then(resolve); + break; + + case 'path': + _polyfill.default.Blob.build(wrap(_this.data), { + type: cType + }).then(resolve); + + break; + + default: + _polyfill.default.Blob.build(_this.data, { + type: 'text/plain' + }).then(resolve); + + break; + } + }); + }; + + this.text = function () { + var res = _this.data; + + switch (_this.type) { + case 'base64': + return _base.default.decode(_this.data); + + case 'path': + return _fs.default.readFile(_this.data, 'base64').then(function (b64) { + return Promise.resolve(_base.default.decode(b64)); + }); + + default: + return _this.data; + } + }; + + this.json = function () { + switch (_this.type) { + case 'base64': + return JSON.parse(_base.default.decode(_this.data)); + + case 'path': + return _fs.default.readFile(_this.data, 'utf8').then(function (text) { + return Promise.resolve(JSON.parse(text)); + }); + + default: + return JSON.parse(_this.data); + } + }; + + this.base64 = function () { + switch (_this.type) { + case 'base64': + return _this.data; + + case 'path': + return _fs.default.readFile(_this.data, 'base64'); + + default: + return _base.default.encode(_this.data); + } + }; + + this.flush = function () { + var path = _this.path(); + + if (!path || _this.type !== 'path') return; + return unlink(path); + }; + + this.path = function () { + if (_this.type === 'path') return _this.data; + return null; + }; + + this.session = function (name) { + if (_this.type === 'path') return session(name).add(_this.data);else { + console.warn('only file paths can be add into session.'); + return null; + } + }; + + this.readStream = function (encoding) { + if (_this.type === 'path') { + return readStream(_this.data, encoding); + } else { + console.warn('RNFetchblob', 'this response data does not contains any available stream'); + return null; + } + }; + + this.readFile = function (encoding) { + if (_this.type === 'path') { + return readFile(_this.data, encoding); + } else { + console.warn('RNFetchblob', 'this response does not contains a readable file'); + return null; + } + }; + }; + + var _default = { + fetch: fetch, + base64: _base.default, + android: _android.default, + ios: _ios.default, + config: config, + session: session, + fs: _fs.default, + wrap: wrap, + polyfill: _polyfill.default, + JSONStream: _jsonStream.default + }; + exports.default = _default; +},487,[5,7,28,488,489,493,486,495,507,508,509,510]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var _default = { + isFileURI: function isFileURI(uri) { + if (typeof uri !== 'string') return false; + return /^RNFetchBlob-file\:\/\//.test(uri); + }, + isJSONStreamURI: function isJSONStreamURI(uri) { + if (typeof uri !== 'string') return false; + return /^JSONStream\:\/\//.test(uri); + }, + removeURIScheme: function removeURIScheme(uri, iterations) { + iterations = iterations || 1; + var result = uri; + + for (var i = 0; i < iterations; i++) { + result = String(result).replace(/^[^\:]+\:\/\//, ''); + } + + return String(result); + }, + unwrapFileURI: function unwrapFileURI(uri) { + return String(uri).replace(/^RNFetchBlob-file\:\/\//, ''); + } + }; + exports.default = _default; +},488,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _RNFetchBlobSession = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _RNFetchBlobWriteStream = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + var _RNFetchBlobReadStream = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); + + var _RNFetchBlobFile = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[5])); + + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + var dirs = { + DocumentDir: RNFetchBlob.DocumentDir, + CacheDir: RNFetchBlob.CacheDir, + PictureDir: RNFetchBlob.PictureDir, + MusicDir: RNFetchBlob.MusicDir, + MovieDir: RNFetchBlob.MovieDir, + DownloadDir: RNFetchBlob.DownloadDir, + DCIMDir: RNFetchBlob.DCIMDir, + SDCardDir: RNFetchBlob.SDCardDir, + SDCardApplicationDir: RNFetchBlob.SDCardApplicationDir, + MainBundleDir: RNFetchBlob.MainBundleDir, + LibraryDir: RNFetchBlob.LibraryDir + }; + + function addCode(code, error) { + error.code = code; + return error; + } + + function session(name) { + var s = _RNFetchBlobSession.default.getSession(name); + + if (s) return new _RNFetchBlobSession.default(name);else { + _RNFetchBlobSession.default.setSession(name, []); + + return new _RNFetchBlobSession.default(name, []); + } + } + + function asset(path) { + if (_reactNative.Platform.OS === 'ios') { + if (/^assets-library\:\/\//.test(path)) return path; + } + + return 'bundle-assets://' + path; + } + + function createFile(path, data) { + var encoding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'utf8'; + + if (encoding.toLowerCase() === 'ascii') { + return Array.isArray(data) ? RNFetchBlob.createFileASCII(path, data) : Promise.reject(addCode('EINVAL', new TypeError('`data` of ASCII file must be an array with 0..255 numbers'))); + } else { + return RNFetchBlob.createFile(path, data, encoding); + } + } + + function writeStream(path) { + var encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'utf8'; + var append = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + return new Promise(function (resolve, reject) { + RNFetchBlob.writeStream(path, encoding, append, function (errCode, errMsg, streamId) { + if (errMsg) { + var err = new Error(errMsg); + err.code = errCode; + reject(err); + } else resolve(new _RNFetchBlobWriteStream.default(streamId, encoding)); + }); + }); + } + + function readStream(path) { + var encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'utf8'; + var bufferSize = arguments.length > 2 ? arguments[2] : undefined; + var tick = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10; + + if (typeof path !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + return Promise.resolve(new _RNFetchBlobReadStream.default(path, encoding, bufferSize, tick)); + } + + function mkdir(path) { + if (typeof path !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + return RNFetchBlob.mkdir(path); + } + + function pathForAppGroup(groupName) { + return RNFetchBlob.pathForAppGroup(groupName); + } + + function syncPathAppGroup(groupName) { + if (_reactNative.Platform.OS === 'ios') { + return RNFetchBlob.syncPathAppGroup(groupName); + } else { + return ''; + } + } + + function readFile(path) { + var encoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'utf8'; + + if (typeof path !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + return RNFetchBlob.readFile(path, encoding); + } + + function writeFile(path, data) { + var encoding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'utf8'; + + if (typeof path !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + if (encoding.toLocaleLowerCase() === 'ascii') { + if (!Array.isArray(data)) { + return Promise.reject(addCode('EINVAL', new TypeError('"data" must be an Array when encoding is "ascii"'))); + } else return RNFetchBlob.writeFileArray(path, data, false); + } else { + if (typeof data !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError("\"data\" must be a String when encoding is \"utf8\" or \"base64\", but it is \"" + typeof data + "\""))); + } else return RNFetchBlob.writeFile(path, encoding, data, false); + } + } + + function appendFile(path, data) { + var encoding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'utf8'; + + if (typeof path !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + if (encoding.toLocaleLowerCase() === 'ascii') { + if (!Array.isArray(data)) { + return Promise.reject(addCode('EINVAL', new TypeError('`data` of ASCII file must be an array with 0..255 numbers'))); + } else return RNFetchBlob.writeFileArray(path, data, true); + } else { + if (typeof data !== 'string') { + return Promise.reject(addCode('EINVAL'), new TypeError("\"data\" must be a String when encoding is \"utf8\" or \"base64\", but it is \"" + typeof data + "\"")); + } else return RNFetchBlob.writeFile(path, encoding, data, true); + } + } + + function stat(path) { + return new Promise(function (resolve, reject) { + if (typeof path !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + RNFetchBlob.stat(path, function (err, stat) { + if (err) reject(new Error(err));else { + if (stat) { + stat.size = parseInt(stat.size); + stat.lastModified = parseInt(stat.lastModified); + } + + resolve(stat); + } + }); + }); + } + + function scanFile(pairs) { + return new Promise(function (resolve, reject) { + if (pairs === undefined) { + return reject(addCode('EINVAL', new TypeError('Missing argument'))); + } + + RNFetchBlob.scanFile(pairs, function (err) { + if (err) reject(addCode('EUNSPECIFIED', new Error(err)));else resolve(); + }); + }); + } + + function hash(path, algorithm) { + if (typeof path !== 'string' || typeof algorithm !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" and/or "algorithm"'))); + } + + return RNFetchBlob.hash(path, algorithm); + } + + function cp(path, dest) { + return new Promise(function (resolve, reject) { + if (typeof path !== 'string' || typeof dest !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "path" and/or "destination"'))); + } + + RNFetchBlob.cp(path, dest, function (err, res) { + if (err) reject(addCode('EUNSPECIFIED', new Error(err)));else resolve(res); + }); + }); + } + + function mv(path, dest) { + return new Promise(function (resolve, reject) { + if (typeof path !== 'string' || typeof dest !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "path" and/or "destination"'))); + } + + RNFetchBlob.mv(path, dest, function (err, res) { + if (err) reject(addCode('EUNSPECIFIED', new Error(err)));else resolve(res); + }); + }); + } + + function lstat(path) { + return new Promise(function (resolve, reject) { + if (typeof path !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + RNFetchBlob.lstat(path, function (err, stat) { + if (err) reject(addCode('EUNSPECIFIED', new Error(err)));else resolve(stat); + }); + }); + } + + function ls(path) { + if (typeof path !== 'string') { + return Promise.reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + return RNFetchBlob.ls(path); + } + + function unlink(path) { + return new Promise(function (resolve, reject) { + if (typeof path !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + RNFetchBlob.unlink(path, function (err) { + if (err) { + reject(addCode('EUNSPECIFIED', new Error(err))); + } else resolve(); + }); + }); + } + + function exists(path) { + return new Promise(function (resolve, reject) { + if (typeof path !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + try { + RNFetchBlob.exists(path, function (exist) { + resolve(exist); + }); + } catch (err) { + reject(addCode('EUNSPECIFIED', new Error(err))); + } + }); + } + + function slice(src, dest, start, end) { + if (typeof src !== 'string' || typeof dest !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "src" and/or "destination"'))); + } + + var p = Promise.resolve(); + var size = 0; + + function normalize(num, size) { + if (num < 0) return Math.max(0, size + num); + if (!num && num !== 0) return size; + return num; + } + + if (start < 0 || end < 0 || !start || !end) { + p = p.then(function () { + return stat(src); + }).then(function (stat) { + size = Math.floor(stat.size); + start = normalize(start || 0, size); + end = normalize(end, size); + }); + } + + return p.then(function () { + return RNFetchBlob.slice(src, dest, start, end); + }); + } + + function isDir(path) { + return new Promise(function (resolve, reject) { + if (typeof path !== 'string') { + return reject(addCode('EINVAL', new TypeError('Missing argument "path" '))); + } + + try { + RNFetchBlob.exists(path, function (exist, isDir) { + resolve(isDir); + }); + } catch (err) { + reject(addCode('EUNSPECIFIED', new Error(err))); + } + }); + } + + function df() { + return new Promise(function (resolve, reject) { + RNFetchBlob.df(function (err, stat) { + if (err) reject(addCode('EUNSPECIFIED', new Error(err)));else resolve(stat); + }); + }); + } + + var _default = { + RNFetchBlobSession: _RNFetchBlobSession.default, + unlink: unlink, + mkdir: mkdir, + session: session, + ls: ls, + readStream: readStream, + mv: mv, + cp: cp, + writeStream: writeStream, + writeFile: writeFile, + appendFile: appendFile, + pathForAppGroup: pathForAppGroup, + syncPathAppGroup: syncPathAppGroup, + readFile: readFile, + hash: hash, + exists: exists, + createFile: createFile, + isDir: isDir, + stat: stat, + lstat: lstat, + scanFile: scanFile, + dirs: dirs, + slice: slice, + asset: asset, + df: df + }; + exports.default = _default; +},489,[28,5,490,491,492,494]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + var sessions = {}; + + var RNFetchBlobSession = function () { + function RNFetchBlobSession(name, list) { + (0, _classCallCheck2.default)(this, RNFetchBlobSession); + this.name = name; + + if (!sessions[name]) { + if (Array.isArray(list)) sessions[name] = list;else sessions[name] = []; + } + } + + (0, _createClass2.default)(RNFetchBlobSession, [{ + key: "add", + value: function add(path) { + sessions[this.name].push(path); + return this; + } + }, { + key: "remove", + value: function remove(path) { + var list = sessions[this.name]; + + for (var _iterator = _createForOfIteratorHelperLoose(list), _step; !(_step = _iterator()).done;) { + var i = _step.value; + + if (list[i] === path) { + sessions[this.name].splice(i, 1); + break; + } + } + + return this; + } + }, { + key: "list", + value: function list() { + return sessions[this.name]; + } + }, { + key: "dispose", + value: function dispose() { + var _this = this; + + return new Promise(function (resolve, reject) { + RNFetchBlob.removeSession(sessions[_this.name], function (err) { + if (err) reject(new Error(err));else { + delete sessions[_this.name]; + resolve(); + } + }); + }); + } + }], [{ + key: "getSession", + value: function getSession(name) { + return sessions[name]; + } + }, { + key: "setSession", + value: function setSession(name, val) { + sessions[name] = val; + } + }, { + key: "removeSession", + value: function removeSession(name) { + delete sessions[name]; + } + }]); + return RNFetchBlobSession; + }(); + + exports.default = RNFetchBlobSession; +},490,[5,7,8,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + + var RNFetchBlobWriteStream = function () { + function RNFetchBlobWriteStream(streamId, encoding, append) { + (0, _classCallCheck2.default)(this, RNFetchBlobWriteStream); + this.id = streamId; + this.encoding = encoding; + this.append = append; + } + + (0, _createClass2.default)(RNFetchBlobWriteStream, [{ + key: "write", + value: function write(data) { + var _this = this; + + return new Promise(function (resolve, reject) { + try { + var method = _this.encoding === 'ascii' ? 'writeArrayChunk' : 'writeChunk'; + + if (_this.encoding.toLocaleLowerCase() === 'ascii' && !Array.isArray(data)) { + reject(new Error('ascii input data must be an Array')); + return; + } + + RNFetchBlob[method](_this.id, data, function (error) { + if (error) reject(new Error(error));else resolve(_this); + }); + } catch (err) { + reject(new Error(err)); + } + }); + } + }, { + key: "close", + value: function close() { + var _this2 = this; + + return new Promise(function (resolve, reject) { + try { + RNFetchBlob.closeStream(_this2.id, function () { + resolve(); + }); + } catch (err) { + reject(new Error(err)); + } + }); + } + }]); + return RNFetchBlobWriteStream; + }(); + + exports.default = RNFetchBlobWriteStream; +},491,[5,7,8,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _uuid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + var emitter = _reactNative.DeviceEventEmitter; + + var RNFetchBlobReadStream = function () { + function RNFetchBlobReadStream(path, encoding, bufferSize, tick) { + var _this = this; + + (0, _classCallCheck2.default)(this, RNFetchBlobReadStream); + this.tick = 10; + if (!path) throw Error('RNFetchBlob could not open file stream with empty `path`'); + this.encoding = encoding || 'utf8'; + this.bufferSize = bufferSize; + this.path = path; + this.closed = false; + this.tick = tick; + + this._onData = function () {}; + + this._onEnd = function () {}; + + this._onError = function () {}; + + this.streamId = 'RNFBRS' + (0, _uuid.default)(); + var subscription = emitter.addListener(this.streamId, function (e) { + var event = e.event, + code = e.code, + detail = e.detail; + + if (_this._onData && event === 'data') { + _this._onData(detail); + + return; + } else if (_this._onEnd && event === 'end') { + _this._onEnd(detail); + } else { + var err = new Error(detail); + err.code = code || 'EUNSPECIFIED'; + if (_this._onError) _this._onError(err);else throw err; + } + + if (event === 'error' || event === 'end') { + subscription.remove(); + _this.closed = true; + } + }); + } + + (0, _createClass2.default)(RNFetchBlobReadStream, [{ + key: "open", + value: function open() { + if (!this.closed) RNFetchBlob.readStream(this.path, this.encoding, this.bufferSize || 10240, this.tick || -1, this.streamId);else throw new Error('Stream closed'); + } + }, { + key: "onData", + value: function onData(fn) { + this._onData = fn; + } + }, { + key: "onError", + value: function onError(fn) { + this._onError = fn; + } + }, { + key: "onEnd", + value: function onEnd(fn) { + this._onEnd = fn; + } + }]); + return RNFetchBlobReadStream; + }(); + + exports.default = RNFetchBlobReadStream; +},492,[5,7,8,28,493]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = getUUID; + + function getUUID() { + return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); + } +},493,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + var emitter = _reactNative.DeviceEventEmitter; + + var RNFetchBlobFile = function RNFetchBlobFile() { + (0, _classCallCheck2.default)(this, RNFetchBlobFile); + }; + + exports.default = RNFetchBlobFile; +},494,[5,7,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _Blob = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _File = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _XMLHttpRequest = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _ProgressEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _Event = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _FileReader = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Fetch = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _default = { + Blob: _Blob.default, + File: _File.default, + XMLHttpRequest: _XMLHttpRequest.default, + ProgressEvent: _ProgressEvent.default, + Event: _Event.default, + FileReader: _FileReader.default, + Fetch: _Fetch.default + }; + exports.default = _default; +},495,[5,496,499,500,502,503,504,505]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _index = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _fs = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _uuid = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _EventTarget2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var log = new _log.default('Blob'); + var blobCacheDir = _fs.default.dirs.DocumentDir + '/RNFetchBlob-blobs/'; + log.disable(); + + var Blob = function (_EventTarget) { + (0, _inherits2.default)(Blob, _EventTarget); + + var _super = _createSuper(Blob); + + function Blob(data, cType, defer) { + var _this; + + (0, _classCallCheck2.default)(this, Blob); + _this = _super.call(this); + _this.isRNFetchBlobPolyfill = true; + _this.multipartBoundary = null; + _this._ref = null; + _this._blobCreated = false; + _this._onCreated = []; + _this._closed = false; + cType = cType || {}; + _this.cacheName = getBlobName(); + _this.isRNFetchBlobPolyfill = true; + _this.isDerived = defer; + _this.type = cType.type || 'text/plain'; + log.verbose('Blob constructor called', 'mime', _this.type, 'type', typeof data, 'length', data ? data.length : 0); + _this._ref = blobCacheDir + _this.cacheName; + var p = null; + if (!data) data = ''; + + if (data.isRNFetchBlobPolyfill) { + log.verbose('create Blob cache file from Blob object'); + var size = 0; + _this._ref = String(data.getRNFetchBlobRef()); + var orgPath = _this._ref; + p = _fs.default.exists(orgPath).then(function (exist) { + if (exist) return _fs.default.writeFile(orgPath, data, 'uri').then(function (size) { + return Promise.resolve(size); + }).catch(function (err) { + throw "RNFetchBlob Blob file creation error, " + err; + });else throw "could not create Blob from path " + orgPath + ", file not exists"; + }); + } else if (data instanceof FormData) { + log.verbose('create Blob cache file from FormData', data); + var boundary = "RNFetchBlob-" + _this.cacheName + "-" + Date.now(); + _this.multipartBoundary = boundary; + var parts = data.getParts(); + var formArray = []; + + if (!parts) { + p = _fs.default.writeFile(_this._ref, '', 'utf8'); + } else { + for (var i in parts) { + formArray.push('\r\n--' + boundary + '\r\n'); + var part = parts[i]; + + for (var j in part.headers) { + formArray.push(j + ': ' + part.headers[j] + '\r\n'); + } + + formArray.push('\r\n'); + if (part.isRNFetchBlobPolyfill) formArray.push(part);else formArray.push(part.string); + } + + log.verbose('FormData array', formArray); + formArray.push('\r\n--' + boundary + '--\r\n'); + p = createMixedBlobData(_this._ref, formArray); + } + } else if (typeof data === 'string' && data.startsWith('RNFetchBlob-file://')) { + log.verbose('create Blob cache file from file path', data); + _this._isReference = true; + _this._ref = String(data).replace('RNFetchBlob-file://', ''); + var _orgPath = _this._ref; + if (defer) return (0, _possibleConstructorReturn2.default)(_this);else { + p = _fs.default.stat(_orgPath).then(function (stat) { + return Promise.resolve(stat.size); + }); + } + } else if (typeof data === 'string') { + var encoding = 'utf8'; + var mime = String(_this.type); + if (/(application\/octet|\;base64)/i.test(mime)) encoding = 'base64';else data = data.toString(); + _this.type = String(_this.type).replace(/;base64/ig, ''); + log.verbose('create Blob cache file from string', 'encode', encoding); + p = _fs.default.writeFile(_this._ref, data, encoding).then(function (size) { + return Promise.resolve(size); + }); + } else if (Array.isArray(data)) { + log.verbose('create Blob cache file from mixed array', data); + p = createMixedBlobData(_this._ref, data); + } else { + data = data.toString(); + p = _fs.default.writeFile(_this._ref, data, 'utf8').then(function (size) { + return Promise.resolve(size); + }); + } + + p && p.then(function (size) { + _this.size = size; + + _this._invokeOnCreateEvent(); + }).catch(function (err) { + log.error('RNFetchBlob could not create Blob : ' + _this._ref, err); + }); + return _this; + } + + (0, _createClass2.default)(Blob, [{ + key: "blobPath", + get: function get() { + return this._ref; + } + }, { + key: "onCreated", + value: function onCreated(fn) { + log.verbose('#register blob onCreated', this._blobCreated); + if (!this._blobCreated) this._onCreated.push(fn);else { + fn(this); + } + return this; + } + }, { + key: "markAsDerived", + value: function markAsDerived() { + this._isDerived = true; + } + }, { + key: "isDerived", + get: function get() { + return this._isDerived || false; + } + }, { + key: "getRNFetchBlobRef", + value: function getRNFetchBlobRef() { + return this._ref; + } + }, { + key: "slice", + value: function slice(start, end) { + var _this2 = this; + + var contentType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + if (this._closed) throw 'Blob has been released.'; + log.verbose('slice called', start, end, contentType); + var resPath = blobCacheDir + getBlobName(); + var pass = false; + log.debug('fs.slice new blob will at', resPath); + var result = new Blob(_index.default.wrap(resPath), { + type: contentType + }, true); + + _fs.default.exists(blobCacheDir).then(function (exist) { + if (exist) return Promise.resolve(); + return _fs.default.mkdir(blobCacheDir); + }).then(function () { + return _fs.default.slice(_this2._ref, resPath, start, end); + }).then(function (dest) { + log.debug('fs.slice done', dest); + + result._invokeOnCreateEvent(); + + pass = true; + }).catch(function (err) { + console.warn('Blob.slice failed:', err); + pass = true; + }); + + log.debug('slice returning new Blob'); + return result; + } + }, { + key: "readBlob", + value: function readBlob(encoding) { + if (this._closed) throw 'Blob has been released.'; + return _fs.default.readFile(this._ref, encoding || 'utf8'); + } + }, { + key: "close", + value: function close() { + if (this._closed) return Promise.reject('Blob has been released.'); + this._closed = true; + return _fs.default.unlink(this._ref).catch(function (err) { + console.warn(err); + }); + } + }, { + key: "safeClose", + value: function safeClose() { + if (this._closed) return Promise.reject('Blob has been released.'); + this._closed = true; + + if (!this._isReference) { + return _fs.default.unlink(this._ref).catch(function (err) { + console.warn(err); + }); + } else { + return Promise.resolve(); + } + } + }, { + key: "_invokeOnCreateEvent", + value: function _invokeOnCreateEvent() { + log.verbose('invoke create event', this._onCreated); + this._blobCreated = true; + var fns = this._onCreated; + + for (var i in fns) { + if (typeof fns[i] === 'function') { + fns[i](this); + } + } + + delete this._onCreated; + } + }], [{ + key: "clearCache", + value: function clearCache() { + return _fs.default.unlink(blobCacheDir).then(function () { + return _fs.default.mkdir(blobCacheDir); + }); + } + }, { + key: "build", + value: function build(data, cType) { + return new Promise(function (resolve, reject) { + new Blob(data, cType).onCreated(resolve); + }); + } + }, { + key: "setLog", + value: function setLog(level) { + if (level === -1) log.disable();else log.level(level); + } + }]); + return Blob; + }(_EventTarget2.default); + + exports.default = Blob; + + function getBlobName() { + return 'blob-' + (0, _uuid.default)(); + } + + function createMixedBlobData(ref, dataArray) { + var p = _fs.default.writeFile(ref, ''); + + var args = []; + var size = 0; + + for (var i in dataArray) { + var part = dataArray[i]; + if (!part) continue; + + if (part.isRNFetchBlobPolyfill) { + args.push([ref, part._ref, 'uri']); + } else if (typeof part === 'string') args.push([ref, part, 'utf8']);else if (Array.isArray(part)) args.push([ref, part, 'ascii']); + } + + var _loop = function _loop(_i) { + p = p.then(function (written) { + var arg = this; + if (written) size += written; + log.verbose('mixed blob write', args[_i], written); + return _fs.default.appendFile.apply(_fs.default, (0, _toConsumableArray2.default)(arg)); + }.bind(args[_i])); + }; + + for (var _i in args) { + _loop(_i); + } + + return p.then(function () { + return Promise.resolve(size); + }); + } +},496,[5,21,7,8,12,14,16,487,489,493,497,498]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var Log = function () { + function Log(name) { + (0, _classCallCheck2.default)(this, Log); + this._isEnable = true; + this._level = 0; + this._name = name; + } + + (0, _createClass2.default)(Log, [{ + key: "level", + value: function level(val) { + this._isEnable = true; + this._level = val; + } + }, { + key: "enable", + value: function enable() { + this._isEnable = true; + } + }, { + key: "disable", + value: function disable() { + this._isEnable = false; + } + }, { + key: "verbose", + value: function verbose() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + this._isEnable && this._level > 2 && undefined; + } + }, { + key: "debug", + value: function debug() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + this._isEnable && this._level > 1 && undefined; + } + }, { + key: "info", + value: function info() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + this._isEnable && this._level > 0 && undefined; + } + }, { + key: "error", + value: function error() { + var _console; + + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + this._isEnable && this._level > -1 && (_console = console).warn.apply(_console, [this._name, 'error:'].concat(args)); + } + }]); + return Log; + }(); + + exports.default = Log; +},497,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var log = new _log.default('EventTarget'); + log.disable(); + + var EventTarget = function () { + function EventTarget() { + (0, _classCallCheck2.default)(this, EventTarget); + log.info('constructor called'); + this.listeners = {}; + } + + (0, _createClass2.default)(EventTarget, [{ + key: "addEventListener", + value: function addEventListener(type, cb) { + log.info('add event listener', type, cb); + + if (!(type in this.listeners)) { + this.listeners[type] = []; + } + + this.listeners[type].push(cb); + } + }, { + key: "removeEventListener", + value: function removeEventListener(type, cb) { + log.info('remove event listener', type, cb); + if (!(type in this.listeners)) return; + var handlers = this.listeners[type]; + + for (var i in handlers) { + if (cb === handlers[i]) { + handlers.splice(i, 1); + return this.removeEventListener(type, cb); + } + } + } + }, { + key: "dispatchEvent", + value: function dispatchEvent(type, event) { + log.info('dispatch event', event); + if (!(type in this.listeners)) return; + var handlers = this.listeners[type]; + + for (var i in handlers) { + handlers[i].call(this, event); + } + } + }, { + key: "clearEventListeners", + value: function clearEventListeners() { + for (var i in this.listeners) { + delete this.listeners[i]; + } + } + }]); + return EventTarget; + }(); + + exports.default = EventTarget; +},498,[5,7,8,497]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Blob2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var File = function (_Blob) { + (0, _inherits2.default)(File, _Blob); + + var _super = _createSuper(File); + + function File(data, cType) { + var _this; + + (0, _classCallCheck2.default)(this, File); + _this = _super.call(this, data, cType); + _this.name = ''; + return _this; + } + + (0, _createClass2.default)(File, null, [{ + key: "build", + value: function build(name, data, cType) { + return new Promise(function (resolve, reject) { + if (data === undefined) { + reject(new TypeError('data is undefined')); + } + + new File(data, cType).onCreated(function (f) { + f.name = name; + resolve(f); + }); + }); + } + }]); + return File; + }(_Blob2.default); + + exports.default = File; +},499,[5,7,8,12,14,16,496]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _index = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _XMLHttpRequestEventTarget = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Blob = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _ProgressEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _uri = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var log = new _log.default('XMLHttpRequest'); + log.disable(); + var UNSENT = 0; + var OPENED = 1; + var HEADERS_RECEIVED = 2; + var LOADING = 3; + var DONE = 4; + + var XMLHttpRequest = function (_XMLHttpRequestEventT) { + (0, _inherits2.default)(XMLHttpRequest, _XMLHttpRequestEventT); + + var _super = _createSuper(XMLHttpRequest); + + function XMLHttpRequest() { + var _this; + + (0, _classCallCheck2.default)(this, XMLHttpRequest); + log.verbose('XMLHttpRequest constructor called'); + _this = _super.call(this); + _this.upload = new _XMLHttpRequestEventTarget.default(); + _this._readyState = UNSENT; + _this._uriType = 'net'; + _this._response = ''; + _this._responseText = ''; + _this._responseHeaders = {}; + _this._responseType = ''; + _this._responseURL = ''; + _this._responseXML = ''; + _this._status = 0; + _this._statusText = ''; + _this._timeout = 60000; + _this._sendFlag = false; + _this._uploadStarted = false; + _this._increment = false; + _this._config = {}; + _this._headers = { + 'Content-Type': 'text/plain' + }; + _this._cleanUp = null; + + _this._headerReceived = function (e) { + log.debug('header received ', _this._task.taskId, e); + _this.responseURL = _this._url; + + if (e.state === "2" && e.taskId === _this._task.taskId) { + _this._responseHeaders = e.headers; + _this._statusText = e.status; + _this._status = Math.floor(e.status); + + _this._dispatchReadStateChange(XMLHttpRequest.HEADERS_RECEIVED); + } + }; + + _this._uploadProgressEvent = function (send, total) { + if (!_this._uploadStarted) { + _this.upload.dispatchEvent('loadstart'); + + _this._uploadStarted = true; + } + + if (send >= total) _this.upload.dispatchEvent('load'); + + _this.upload.dispatchEvent('progress', new _ProgressEvent.default(true, send, total)); + }; + + _this._progressEvent = function (send, total, chunk) { + log.verbose(_this.readyState); + if (_this._readyState === XMLHttpRequest.HEADERS_RECEIVED) _this._dispatchReadStateChange(XMLHttpRequest.LOADING); + var lengthComputable = false; + if (total && total >= 0) lengthComputable = true; + var e = new _ProgressEvent.default(lengthComputable, send, total); + + if (_this._increment) { + _this._responseText += chunk; + } + + _this.dispatchEvent('progress', e); + }; + + _this._onError = function (err) { + var statusCode = Math.floor(_this.status); + + if (statusCode >= 100 && statusCode !== 408) { + return; + } + + log.debug('XMLHttpRequest error', err); + _this._statusText = err; + _this._status = String(err).match(/\d+/); + _this._status = _this._status ? Math.floor(_this.status) : 404; + + _this._dispatchReadStateChange(XMLHttpRequest.DONE); + + if (err && String(err.message).match(/(timed\sout|timedout)/) || _this._status == 408) { + _this.dispatchEvent('timeout'); + } + + _this.dispatchEvent('loadend'); + + _this.dispatchEvent('error', { + type: 'error', + detail: err + }); + + _this.clearEventListeners(); + }; + + _this._onDone = function (resp) { + log.debug('XMLHttpRequest done', _this._url, resp, (0, _assertThisInitialized2.default)(_this)); + _this._statusText = _this._status; + + var responseDataReady = function responseDataReady() { + log.debug('request done state = 4'); + + _this.dispatchEvent('load'); + + _this.dispatchEvent('loadend'); + + _this._dispatchReadStateChange(XMLHttpRequest.DONE); + + _this.clearEventListeners(); + }; + + if (resp) { + var info = resp.respInfo || {}; + log.debug(_this._url, info, info.respType); + + switch (_this._responseType) { + case 'blob': + resp.blob().then(function (b) { + _this._responseText = resp.text(); + _this._response = b; + responseDataReady(); + }); + break; + + case 'arraybuffer': + break; + + case 'json': + _this._response = resp.json(); + _this._responseText = resp.text(); + break; + + default: + _this._responseText = resp.text(); + _this._response = _this.responseText; + responseDataReady(); + break; + } + } + }; + + return _this; + } + + (0, _createClass2.default)(XMLHttpRequest, [{ + key: "UNSENT", + get: function get() { + return UNSENT; + } + }, { + key: "OPENED", + get: function get() { + return OPENED; + } + }, { + key: "HEADERS_RECEIVED", + get: function get() { + return HEADERS_RECEIVED; + } + }, { + key: "LOADING", + get: function get() { + return LOADING; + } + }, { + key: "DONE", + get: function get() { + return DONE; + } + }, { + key: "open", + value: function open(method, url, async, user, password) { + log.verbose('XMLHttpRequest open ', method, url, async, user, password); + this._method = method; + this._url = url; + this._headers = {}; + this._increment = _uri.default.isJSONStreamURI(this._url); + this._url = this._url.replace(/^JSONStream\:\/\//, ''); + + this._dispatchReadStateChange(XMLHttpRequest.OPENED); + } + }, { + key: "send", + value: function send(body) { + var _this2 = this; + + this._body = body; + if (this._readyState !== XMLHttpRequest.OPENED) throw 'InvalidStateError : XMLHttpRequest is not opened yet.'; + var promise = Promise.resolve(); + this._sendFlag = true; + log.verbose('XMLHttpRequest send ', body); + var _method = this._method, + _url = this._url, + _headers = this._headers; + log.verbose('sending request with args', _method, _url, _headers, body); + log.verbose(typeof body, body instanceof FormData); + + if (body instanceof _Blob.default) { + log.debug('sending blob body', body._blobCreated); + promise = new Promise(function (resolve, reject) { + body.onCreated(function (blob) { + if (blob.isDerived) { + _this2._cleanUp = function () { + blob.close(); + }; + } + + log.debug('body created send request'); + body = _index.default.wrap(blob.getRNFetchBlobRef()); + resolve(); + }); + }); + } else if (typeof body === 'object') { + body = JSON.stringify(body); + promise = Promise.resolve(); + } else { + body = body ? body.toString() : body; + promise = Promise.resolve(); + } + + promise.then(function () { + log.debug('send request invoke', body); + + for (var h in _headers) { + _headers[h] = _headers[h].toString(); + } + + _this2._task = _index.default.config({ + auto: true, + timeout: _this2._timeout, + increment: _this2._increment, + binaryContentTypes: XMLHttpRequest.binaryContentTypes + }).fetch(_method, _url, _headers, body); + + _this2._task.stateChange(_this2._headerReceived).uploadProgress(_this2._uploadProgressEvent).progress(_this2._progressEvent).catch(_this2._onError).then(_this2._onDone); + }); + } + }, { + key: "overrideMimeType", + value: function overrideMimeType(mime) { + log.verbose('XMLHttpRequest overrideMimeType', mime); + this._headers['Content-Type'] = mime; + } + }, { + key: "setRequestHeader", + value: function setRequestHeader(name, value) { + log.verbose('XMLHttpRequest set header', name, value); + + if (this._readyState !== OPENED || this._sendFlag) { + throw "InvalidStateError : Calling setRequestHeader in wrong state " + this._readyState; + } + + if (typeof name !== 'string' || /[^\u0000-\u00ff]/.test(name)) { + throw 'TypeError : header field name should be a string'; + } + + var invalidPatterns = [/[\(\)\>\<\@\,\:\\\/\[\]\?\=\}\{\s\ \u007f\;\t\0\v\r]/, /tt/]; + + for (var _i = 0, _invalidPatterns = invalidPatterns; _i < _invalidPatterns.length; _i++) { + var pattern = _invalidPatterns[_i]; + + if (pattern.test(name) || typeof name !== 'string') { + throw "SyntaxError : Invalid header field name " + name; + } + } + + this._headers[name] = value; + } + }, { + key: "abort", + value: function abort() { + var _this3 = this; + + log.verbose('XMLHttpRequest abort '); + if (!this._task) return; + + this._task.cancel(function (err) { + var e = { + timeStamp: Date.now() + }; + if (_this3.onabort) _this3.onabort(); + + if (err) { + e.detail = err; + e.type = 'error'; + + _this3.dispatchEvent('error', e); + } else { + e.type = 'abort'; + + _this3.dispatchEvent('abort', e); + } + }); + } + }, { + key: "getResponseHeader", + value: function getResponseHeader(field) { + log.verbose('XMLHttpRequest get header', field, this._responseHeaders); + if (!this._responseHeaders) return null; + return this._responseHeaders[field] || this._responseHeaders[field.toLowerCase()] || null; + } + }, { + key: "getAllResponseHeaders", + value: function getAllResponseHeaders() { + log.verbose('XMLHttpRequest get all headers', this._responseHeaders); + if (!this._responseHeaders) return ''; + var result = ''; + var respHeaders = this.responseHeaders; + + for (var i in respHeaders) { + result += i + ": " + respHeaders[i] + String.fromCharCode(0x0D, 0x0A); + } + + return result.substr(0, result.length - 2); + } + }, { + key: "_dispatchReadStateChange", + value: function _dispatchReadStateChange(state) { + this._readyState = state; + if (typeof this._onreadystatechange === 'function') this._onreadystatechange(); + } + }, { + key: "onreadystatechange", + get: function get() { + return this._onreadystatechange; + }, + set: function set(fn) { + log.verbose('XMLHttpRequest set onreadystatechange', fn); + this._onreadystatechange = fn; + } + }, { + key: "readyState", + get: function get() { + log.verbose('get readyState', this._readyState); + return this._readyState; + } + }, { + key: "status", + get: function get() { + log.verbose('get status', this._status); + return this._status; + } + }, { + key: "statusText", + get: function get() { + log.verbose('get statusText', this._statusText); + return this._statusText; + } + }, { + key: "response", + get: function get() { + log.verbose('get response', this._response); + return this._response; + } + }, { + key: "responseText", + get: function get() { + log.verbose('get responseText', this._responseText); + return this._responseText; + } + }, { + key: "responseURL", + get: function get() { + log.verbose('get responseURL', this._responseURL); + return this._responseURL; + } + }, { + key: "responseHeaders", + get: function get() { + log.verbose('get responseHeaders', this._responseHeaders); + return this._responseHeaders; + } + }, { + key: "timeout", + get: function get() { + log.verbose('get timeout', this._timeout); + return this._timeout; + }, + set: function set(val) { + this._timeout = val * 1000; + log.verbose('set timeout', this._timeout); + } + }, { + key: "responseType", + get: function get() { + log.verbose('get response type', this._responseType); + return this._responseType; + }, + set: function set(val) { + log.verbose('set response type', this._responseType); + this._responseType = val; + } + }], [{ + key: "UNSENT", + get: function get() { + return UNSENT; + } + }, { + key: "OPENED", + get: function get() { + return OPENED; + } + }, { + key: "HEADERS_RECEIVED", + get: function get() { + return HEADERS_RECEIVED; + } + }, { + key: "LOADING", + get: function get() { + return LOADING; + } + }, { + key: "DONE", + get: function get() { + return DONE; + } + }, { + key: "setLog", + value: function setLog(level) { + if (level === -1) log.disable();else log.level(level); + } + }, { + key: "addBinaryContentType", + value: function addBinaryContentType(substr) { + for (var i in XMLHttpRequest.binaryContentTypes) { + if (new RegExp(substr, 'i').test(XMLHttpRequest.binaryContentTypes[i])) { + return; + } + } + + XMLHttpRequest.binaryContentTypes.push(substr); + } + }, { + key: "removeBinaryContentType", + value: function removeBinaryContentType(val) { + for (var i in XMLHttpRequest.binaryContentTypes) { + if (new RegExp(substr, 'i').test(XMLHttpRequest.binaryContentTypes[i])) { + XMLHttpRequest.binaryContentTypes.splice(i, 1); + return; + } + } + } + }, { + key: "isRNFBPolyfill", + get: function get() { + return true; + } + }]); + return XMLHttpRequest; + }(_XMLHttpRequestEventTarget.default); + + exports.default = XMLHttpRequest; + XMLHttpRequest.binaryContentTypes = ['image/', 'video/', 'audio/']; +},500,[5,7,8,15,12,14,16,487,501,497,496,502,488]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _EventTarget2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var log = new _log.default('XMLHttpRequestEventTarget'); + log.disable(); + + var XMLHttpRequestEventTarget = function (_EventTarget) { + (0, _inherits2.default)(XMLHttpRequestEventTarget, _EventTarget); + + var _super = _createSuper(XMLHttpRequestEventTarget); + + function XMLHttpRequestEventTarget() { + var _this; + + (0, _classCallCheck2.default)(this, XMLHttpRequestEventTarget); + _this = _super.call(this); + + _this._onabort = function () {}; + + _this._onerror = function () {}; + + _this._onload = function () {}; + + _this._onloadstart = function () {}; + + _this._onprogress = function () {}; + + _this._ontimeout = function () {}; + + _this._onloadend = function () {}; + + log.info('constructor called'); + return _this; + } + + (0, _createClass2.default)(XMLHttpRequestEventTarget, [{ + key: "dispatchEvent", + value: function dispatchEvent(event, e) { + log.debug('dispatch event', event, e); + (0, _get2.default)((0, _getPrototypeOf2.default)(XMLHttpRequestEventTarget.prototype), "dispatchEvent", this).call(this, event, e); + + switch (event) { + case 'abort': + this._onabort(e); + + break; + + case 'error': + this._onerror(e); + + break; + + case 'load': + this._onload(e); + + break; + + case 'loadstart': + this._onloadstart(e); + + break; + + case 'loadend': + this._onloadend(e); + + break; + + case 'progress': + this._onprogress(e); + + break; + + case 'timeout': + this._ontimeout(e); + + break; + } + } + }, { + key: "onabort", + get: function get() { + return this._onabort; + }, + set: function set(fn) { + log.info('set onabort'); + this._onabort = fn; + } + }, { + key: "onerror", + get: function get() { + return this._onerror; + }, + set: function set(fn) { + log.info('set onerror'); + this._onerror = fn; + } + }, { + key: "onload", + get: function get() { + return this._onload; + }, + set: function set(fn) { + log.info('set onload', fn); + this._onload = fn; + } + }, { + key: "onloadstart", + get: function get() { + return this._onloadstart; + }, + set: function set(fn) { + log.info('set onloadstart'); + this._onloadstart = fn; + } + }, { + key: "onprogress", + get: function get() { + return this._onprogress; + }, + set: function set(fn) { + log.info('set onprogress'); + this._onprogress = fn; + } + }, { + key: "ontimeout", + get: function get() { + return this._ontimeout; + }, + set: function set(fn) { + log.info('set ontimeout'); + this._ontimeout = fn; + } + }, { + key: "onloadend", + get: function get() { + return this._onloadend; + }, + set: function set(fn) { + log.info('set onloadend'); + this._onloadend = fn; + } + }]); + return XMLHttpRequestEventTarget; + }(_EventTarget2.default); + + exports.default = XMLHttpRequestEventTarget; +},501,[5,7,8,90,12,14,16,498,497]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Event2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ProgressEvent = function (_Event) { + (0, _inherits2.default)(ProgressEvent, _Event); + + var _super = _createSuper(ProgressEvent); + + function ProgressEvent(lengthComputable, loaded, total) { + var _this; + + (0, _classCallCheck2.default)(this, ProgressEvent); + _this = _super.call(this); + _this._lengthComputable = false; + _this._loaded = -1; + _this._total = -1; + _this._lengthComputable = lengthComputable; + _this._loaded = loaded; + _this._total = total; + return _this; + } + + (0, _createClass2.default)(ProgressEvent, [{ + key: "lengthComputable", + get: function get() { + return this._lengthComputable; + } + }, { + key: "loaded", + get: function get() { + return this._loaded; + } + }, { + key: "total", + get: function get() { + return this._total; + } + }]); + return ProgressEvent; + }(_Event2.default); + + exports.default = ProgressEvent; +},502,[5,7,8,12,14,16,503]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var Event = function Event() { + (0, _classCallCheck2.default)(this, Event); + }; + + exports.default = Event; +},503,[5,7]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _ProgressEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _EventTarget2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Blob = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _fs = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var log = new _log.default('FileReader'); + log.level(3); + + var FileReader = function (_EventTarget) { + (0, _inherits2.default)(FileReader, _EventTarget); + + var _super = _createSuper(FileReader); + + function FileReader() { + var _this; + + (0, _classCallCheck2.default)(this, FileReader); + _this = _super.call(this); + _this._readState = 0; + log.verbose('file reader const'); + _this._result = null; + return _this; + } + + (0, _createClass2.default)(FileReader, [{ + key: "isRNFBPolyFill", + get: function get() { + return true; + } + }, { + key: "abort", + value: function abort() { + log.verbose('abort'); + } + }, { + key: "readAsArrayBuffer", + value: function readAsArrayBuffer(b) { + log.verbose('readAsArrayBuffer', b); + } + }, { + key: "readAsBinaryString", + value: function readAsBinaryString(b) { + log.verbose('readAsBinaryString', b); + } + }, { + key: "readAsText", + value: function readAsText(b, label) { + log.verbose('readAsText', b, label); + } + }, { + key: "readAsDataURL", + value: function readAsDataURL(b) { + log.verbose('readAsDataURL', b); + } + }, { + key: "dispatchEvent", + value: function dispatchEvent(event, e) { + log.verbose('dispatch event', event, e); + (0, _get2.default)((0, _getPrototypeOf2.default)(FileReader.prototype), "dispatchEvent", this).call(this, event, e); + + if (typeof this["on" + event] === 'function') { + this["on" + event](e); + } + } + }, { + key: "readyState", + get: function get() { + return this._readyState; + } + }, { + key: "result", + get: function get() { + return this._result; + } + }], [{ + key: "EMPTY", + get: function get() { + return 0; + } + }, { + key: "LOADING", + get: function get() { + return 1; + } + }, { + key: "DONE", + get: function get() { + return 2; + } + }]); + return FileReader; + }(_EventTarget2.default); + + exports.default = FileReader; +},504,[5,7,8,90,12,14,16,502,498,496,497,489]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _index = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _fs = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _unicode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Blob = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var log = new _log.default('FetchPolyfill'); + log.disable(); + + var Fetch = function Fetch(config) { + (0, _classCallCheck2.default)(this, Fetch); + (0, _extends2.default)(this, new RNFetchBlobFetchPolyfill(config)); + }; + + exports.default = Fetch; + + var RNFetchBlobFetchPolyfill = function RNFetchBlobFetchPolyfill(config) { + (0, _classCallCheck2.default)(this, RNFetchBlobFetchPolyfill); + + this.build = function () { + return function (url) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var body = options.body; + var promise = Promise.resolve(); + var blobCache = null; + options.headers = options.headers || {}; + var ctype = options['Content-Type'] || options['content-type']; + var ctypeH = options.headers['Content-Type'] || options.headers['content-type']; + options.headers['Content-Type'] = ctype || ctypeH; + options.headers['content-type'] = ctype || ctypeH; + options.method = options.method || 'GET'; + + if (body) { + if (body instanceof FormData) { + log.verbose('convert FormData to blob body'); + promise = _Blob.default.build(body).then(function (b) { + blobCache = b; + options.headers['Content-Type'] = 'multipart/form-data;boundary=' + b.multipartBoundary; + return Promise.resolve(_index.default.wrap(b._ref)); + }); + } else if (body.isRNFetchBlobPolyfill) promise = Promise.resolve(_index.default.wrap(body.blobPath));else if (typeof body !== 'object' && options.headers['Content-Type'] !== 'application/json') promise = Promise.resolve(JSON.stringify(body));else if (typeof body !== 'string') promise = Promise.resolve(body.toString());else promise = Promise.resolve(body); + } + + var progressHandler, uploadHandler, cancelHandler; + var statefulPromise = promise.then(function (body) { + var task = _index.default.config(config).fetch(options.method, url, options.headers, body); + + if (progressHandler) task.progress(progressHandler); + if (uploadHandler) task.uploadProgress(uploadHandler); + if (cancelHandler) task.cancel(); + return task.then(function (resp) { + log.verbose('response', resp); + if (blobCache !== null && blobCache instanceof _Blob.default) blobCache.close(); + return Promise.resolve(new RNFetchBlobFetchResponse(resp)); + }); + }); + + statefulPromise.progress = function (fn) { + progressHandler = fn; + }; + + statefulPromise.uploadProgress = function (fn) { + uploadHandler = fn; + }; + + statefulPromise.cancel = function () { + cancelHandler = true; + if (task.cancel) task.cancel(); + }; + + return statefulPromise; + }; + }; + }; + + var RNFetchBlobFetchResponse = function () { + function RNFetchBlobFetchResponse(resp) { + (0, _classCallCheck2.default)(this, RNFetchBlobFetchResponse); + var info = resp.info(); + this.headers = info.headers; + this.ok = info.status >= 200 && info.status <= 299, this.status = info.status; + this.type = 'basic'; + this.bodyUsed = false; + this.resp = resp; + this.rnfbRespInfo = info; + this.rnfbResp = resp; + } + + (0, _createClass2.default)(RNFetchBlobFetchResponse, [{ + key: "rawResp", + value: function rawResp() { + return Promise.resolve(this.rnfbResp); + } + }, { + key: "arrayBuffer", + value: function arrayBuffer() { + log.verbose('to arrayBuffer', this.rnfbRespInfo); + this.bodyUsed = true; + return readArrayBuffer(this.rnfbResp, this.rnfbRespInfo); + } + }, { + key: "text", + value: function text() { + log.verbose('to text', this.rnfbResp, this.rnfbRespInfo); + this.bodyUsed = true; + return readText(this.rnfbResp, this.rnfbRespInfo); + } + }, { + key: "json", + value: function json() { + log.verbose('to json', this.rnfbResp, this.rnfbRespInfo); + this.bodyUsed = true; + return readJSON(this.rnfbResp, this.rnfbRespInfo); + } + }, { + key: "blob", + value: function blob() { + log.verbose('to blob', this.rnfbResp, this.rnfbRespInfo); + this.bodyUsed = true; + return readBlob(this.rnfbResp, this.rnfbRespInfo); + } + }]); + return RNFetchBlobFetchResponse; + }(); + + function readArrayBuffer(resp, info) { + switch (info.rnfbEncode) { + case 'path': + return resp.readFile('ascii'); + break; + + default: + var buffer = []; + var str = resp.text(); + + for (var i in str) { + buffer[i] = str.charCodeAt(i); + } + + return Promise.resolve(buffer); + break; + } + } + + function readText(resp, info) { + switch (info.rnfbEncode) { + case 'base64': + return Promise.resolve(resp.text()); + break; + + case 'path': + return resp.text(); + break; + + default: + return Promise.resolve(resp.text()); + break; + } + } + + function readBlob(resp, info) { + log.verbose('readBlob', resp, info); + return resp.blob(); + } + + function readJSON(resp, info) { + log.verbose('readJSON', resp, info); + + switch (info.rnfbEncode) { + case 'base64': + return Promise.resolve(resp.json()); + + case 'path': + return resp.json(); + + default: + return Promise.resolve(resp.json()); + } + } +},505,[5,8,6,7,487,497,489,506,496]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = _default; + + function _default(x) { + var r = /\\u([\d\w]{4})/gi; + x = x.replace(r, function (match, grp) { + return String.fromCharCode(parseInt(grp, 16)); + }); + return unescape(x); + } +},506,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + ; + (function () { + var undefined; + var VERSION = '4.17.21'; + var LARGE_ARRAY_SIZE = 200; + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', + FUNC_ERROR_TEXT = 'Expected a function', + INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + var MAX_MEMOIZE_SIZE = 500; + var PLACEHOLDER = '__lodash_placeholder__'; + var CLONE_DEEP_FLAG = 1, + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + var WRAP_BIND_FLAG = 1, + WRAP_BIND_KEY_FLAG = 2, + WRAP_CURRY_BOUND_FLAG = 4, + WRAP_CURRY_FLAG = 8, + WRAP_CURRY_RIGHT_FLAG = 16, + WRAP_PARTIAL_FLAG = 32, + WRAP_PARTIAL_RIGHT_FLAG = 64, + WRAP_ARY_FLAG = 128, + WRAP_REARG_FLAG = 256, + WRAP_FLIP_FLAG = 512; + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; + var HOT_COUNT = 800, + HOT_SPAN = 16; + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = 4294967294, + HALF_MAX_ARRAY_LENGTH = 2147483647; + var wrapFlags = [['ary', WRAP_ARY_FLAG], ['bind', WRAP_BIND_FLAG], ['bindKey', WRAP_BIND_KEY_FLAG], ['curry', WRAP_CURRY_FLAG], ['curryRight', WRAP_CURRY_RIGHT_FLAG], ['flip', WRAP_FLIP_FLAG], ['partial', WRAP_PARTIAL_FLAG], ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], ['rearg', WRAP_REARG_FLAG]]; + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + domExcTag = '[object DOMException]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); + var reTrimStart = /^\s+/; + var reWhitespace = /\s/; + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; + var reEscapeChar = /\\(\\)?/g; + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; + var reFlags = /\w*$/; + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; + var reIsBinary = /^0b[01]+$/i; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsOctal = /^0o[0-7]+$/i; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var reNoMatch = /($^)/; + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; + var rsAstralRange = "\\ud800-\\udfff", + rsComboMarksRange = "\\u0300-\\u036f", + reComboHalfMarksRange = "\\ufe20-\\ufe2f", + rsComboSymbolsRange = "\\u20d0-\\u20ff", + rsComboRange = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", + rsDingbatRange = "\\u2700-\\u27bf", + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsPunctuationRange = "\\u2000-\\u206f", + rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = "\\ufe0e\\ufe0f", + rsBreakRange = "\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"; + var rsApos = "['\u2019]", + rsAstral = "[\\ud800-\\udfff]", + rsBreak = "[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]", + rsCombo = "[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", + rsDigits = '\\d+', + rsDingbat = "[\\u2700-\\u27bf]", + rsLower = "[a-z\\xdf-\\xf6\\xf8-\\xff]", + rsMisc = "[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]", + rsFitz = "\\ud83c[\\udffb-\\udfff]", + rsModifier = "(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])", + rsNonAstral = "[^\\ud800-\\udfff]", + rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", + rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", + rsUpper = "[A-Z\\xc0-\\xd6\\xd8-\\xde]", + rsZWJ = "\\u200d"; + var rsMiscLower = "(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])", + rsMiscUpper = "(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])", + rsOptContrLower = "(?:['\u2019](?:d|ll|m|re|s|t|ve))?", + rsOptContrUpper = "(?:['\u2019](?:D|LL|M|RE|S|T|VE))?", + reOptMod = "(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?", + rsOptVar = "[\\ufe0e\\ufe0f]?", + rsOptJoin = "(?:\\u200d(?:" + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', + rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', + rsSeq = "[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?" + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + ["[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?", rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; + var reApos = RegExp(rsApos, 'g'); + var reComboMark = RegExp(rsCombo, 'g'); + var reUnicode = RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|" + rsSymbol + rsSeq, 'g'); + var reUnicodeWord = RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=" + [rsBreak, rsUpper, '$'].join('|') + ')', "(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=" + [rsBreak, "[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])", '$'].join('|') + ')', "[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?", "[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?", rsOrdUpper, rsOrdLower, rsDigits, rsEmoji].join('|'), 'g'); + var reHasUnicode = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"); + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var contextProps = ['Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout']; + var templateCounter = -1; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; + var deburredLetters = { + '\xc0': 'A', + '\xc1': 'A', + '\xc2': 'A', + '\xc3': 'A', + '\xc4': 'A', + '\xc5': 'A', + '\xe0': 'a', + '\xe1': 'a', + '\xe2': 'a', + '\xe3': 'a', + '\xe4': 'a', + '\xe5': 'a', + '\xc7': 'C', + '\xe7': 'c', + '\xd0': 'D', + '\xf0': 'd', + '\xc8': 'E', + '\xc9': 'E', + '\xca': 'E', + '\xcb': 'E', + '\xe8': 'e', + '\xe9': 'e', + '\xea': 'e', + '\xeb': 'e', + '\xcc': 'I', + '\xcd': 'I', + '\xce': 'I', + '\xcf': 'I', + '\xec': 'i', + '\xed': 'i', + '\xee': 'i', + '\xef': 'i', + '\xd1': 'N', + '\xf1': 'n', + '\xd2': 'O', + '\xd3': 'O', + '\xd4': 'O', + '\xd5': 'O', + '\xd6': 'O', + '\xd8': 'O', + '\xf2': 'o', + '\xf3': 'o', + '\xf4': 'o', + '\xf5': 'o', + '\xf6': 'o', + '\xf8': 'o', + '\xd9': 'U', + '\xda': 'U', + '\xdb': 'U', + '\xdc': 'U', + '\xf9': 'u', + '\xfa': 'u', + '\xfb': 'u', + '\xfc': 'u', + '\xdd': 'Y', + '\xfd': 'y', + '\xff': 'y', + '\xc6': 'Ae', + '\xe6': 'ae', + '\xde': 'Th', + '\xfe': 'th', + '\xdf': 'ss', + "\u0100": 'A', + "\u0102": 'A', + "\u0104": 'A', + "\u0101": 'a', + "\u0103": 'a', + "\u0105": 'a', + "\u0106": 'C', + "\u0108": 'C', + "\u010A": 'C', + "\u010C": 'C', + "\u0107": 'c', + "\u0109": 'c', + "\u010B": 'c', + "\u010D": 'c', + "\u010E": 'D', + "\u0110": 'D', + "\u010F": 'd', + "\u0111": 'd', + "\u0112": 'E', + "\u0114": 'E', + "\u0116": 'E', + "\u0118": 'E', + "\u011A": 'E', + "\u0113": 'e', + "\u0115": 'e', + "\u0117": 'e', + "\u0119": 'e', + "\u011B": 'e', + "\u011C": 'G', + "\u011E": 'G', + "\u0120": 'G', + "\u0122": 'G', + "\u011D": 'g', + "\u011F": 'g', + "\u0121": 'g', + "\u0123": 'g', + "\u0124": 'H', + "\u0126": 'H', + "\u0125": 'h', + "\u0127": 'h', + "\u0128": 'I', + "\u012A": 'I', + "\u012C": 'I', + "\u012E": 'I', + "\u0130": 'I', + "\u0129": 'i', + "\u012B": 'i', + "\u012D": 'i', + "\u012F": 'i', + "\u0131": 'i', + "\u0134": 'J', + "\u0135": 'j', + "\u0136": 'K', + "\u0137": 'k', + "\u0138": 'k', + "\u0139": 'L', + "\u013B": 'L', + "\u013D": 'L', + "\u013F": 'L', + "\u0141": 'L', + "\u013A": 'l', + "\u013C": 'l', + "\u013E": 'l', + "\u0140": 'l', + "\u0142": 'l', + "\u0143": 'N', + "\u0145": 'N', + "\u0147": 'N', + "\u014A": 'N', + "\u0144": 'n', + "\u0146": 'n', + "\u0148": 'n', + "\u014B": 'n', + "\u014C": 'O', + "\u014E": 'O', + "\u0150": 'O', + "\u014D": 'o', + "\u014F": 'o', + "\u0151": 'o', + "\u0154": 'R', + "\u0156": 'R', + "\u0158": 'R', + "\u0155": 'r', + "\u0157": 'r', + "\u0159": 'r', + "\u015A": 'S', + "\u015C": 'S', + "\u015E": 'S', + "\u0160": 'S', + "\u015B": 's', + "\u015D": 's', + "\u015F": 's', + "\u0161": 's', + "\u0162": 'T', + "\u0164": 'T', + "\u0166": 'T', + "\u0163": 't', + "\u0165": 't', + "\u0167": 't', + "\u0168": 'U', + "\u016A": 'U', + "\u016C": 'U', + "\u016E": 'U', + "\u0170": 'U', + "\u0172": 'U', + "\u0169": 'u', + "\u016B": 'u', + "\u016D": 'u', + "\u016F": 'u', + "\u0171": 'u', + "\u0173": 'u', + "\u0174": 'W', + "\u0175": 'w', + "\u0176": 'Y', + "\u0177": 'y', + "\u0178": 'Y', + "\u0179": 'Z', + "\u017B": 'Z', + "\u017D": 'Z', + "\u017A": 'z', + "\u017C": 'z', + "\u017E": 'z', + "\u0132": 'IJ', + "\u0133": 'ij', + "\u0152": 'Oe', + "\u0153": 'oe', + "\u0149": "'n", + "\u017F": 's' + }; + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'" + }; + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + "\u2028": 'u2028', + "\u2029": 'u2029' + }; + var freeParseFloat = parseFloat, + freeParseInt = parseInt; + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function('return this')(); + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + + var nodeUtil = function () { + try { + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }(); + + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + + case 1: + return func.call(thisArg, args[0]); + + case 2: + return func.call(thisArg, args[0], args[1]); + + case 3: + return func.call(thisArg, args[0], args[1], args[2]); + } + + return func.apply(thisArg, args); + } + + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + + return accumulator; + } + + function arrayEach(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + + return array; + } + + function arrayEachRight(array, iteratee) { + var length = array == null ? 0 : array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + + return array; + } + + function arrayEvery(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + + return true; + } + + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + + return result; + } + + function arrayIncludes(array, value) { + var length = array == null ? 0 : array.length; + return !!length && baseIndexOf(array, value, 0) > -1; + } + + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + + return false; + } + + function arrayMap(array, iteratee) { + var index = -1, + length = array == null ? 0 : array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + + return result; + } + + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + + return array; + } + + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + + return accumulator; + } + + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array == null ? 0 : array.length; + + if (initAccum && length) { + accumulator = array[--length]; + } + + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + + return accumulator; + } + + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + + return false; + } + + var asciiSize = baseProperty('length'); + + function asciiToArray(string) { + return string.split(''); + } + + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + + function baseFindKey(collection, predicate, eachFunc) { + var result; + eachFunc(collection, function (value, key, collection) { + if (predicate(value, key, collection)) { + result = key; + return false; + } + }); + return result; + } + + function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while (fromRight ? index-- : ++index < length) { + if (predicate(array[index], index, array)) { + return index; + } + } + + return -1; + } + + function baseIndexOf(array, value, fromIndex) { + return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); + } + + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + + return -1; + } + + function baseIsNaN(value) { + return value !== value; + } + + function baseMean(array, iteratee) { + var length = array == null ? 0 : array.length; + return length ? baseSum(array, iteratee) / length : NAN; + } + + function baseProperty(key) { + return function (object) { + return object == null ? undefined : object[key]; + }; + } + + function basePropertyOf(object) { + return function (key) { + return object == null ? undefined : object[key]; + }; + } + + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function (value, index, collection) { + accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + function baseSortBy(array, comparer) { + var length = array.length; + array.sort(comparer); + + while (length--) { + array[length] = array[length].value; + } + + return array; + } + + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + + if (current !== undefined) { + result = result === undefined ? current : result + current; + } + } + + return result; + } + + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + + return result; + } + + function baseToPairs(object, props) { + return arrayMap(props, function (key) { + return [key, object[key]]; + }); + } + + function baseTrim(string) { + return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') : string; + } + + function baseUnary(func) { + return function (value) { + return func(value); + }; + } + + function baseValues(object, props) { + return arrayMap(props, function (key) { + return object[key]; + }); + } + + function cacheHas(cache, key) { + return cache.has(key); + } + + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + + return index; + } + + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + + return index; + } + + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + ++result; + } + } + + return result; + } + + var deburrLetter = basePropertyOf(deburredLetters); + var escapeHtmlChar = basePropertyOf(htmlEscapes); + + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + function hasUnicode(string) { + return reHasUnicode.test(string); + } + + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); + } + + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + + return result; + } + + function mapToArray(map) { + var index = -1, + result = Array(map.size); + map.forEach(function (value, key) { + result[++index] = [key, value]; + }); + return result; + } + + function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; + } + + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + + return result; + } + + function setToArray(set) { + var index = -1, + result = Array(set.size); + set.forEach(function (value) { + result[++index] = value; + }); + return result; + } + + function setToPairs(set) { + var index = -1, + result = Array(set.size); + set.forEach(function (value) { + result[++index] = [value, value]; + }); + return result; + } + + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + + return -1; + } + + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + + while (index--) { + if (array[index] === value) { + return index; + } + } + + return index; + } + + function stringSize(string) { + return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); + } + + function stringToArray(string) { + return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); + } + + function trimmedEndIndex(string) { + var index = string.length; + + while (index-- && reWhitespace.test(string.charAt(index))) {} + + return index; + } + + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + + while (reUnicode.test(string)) { + ++result; + } + + return result; + } + + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; + } + + var runInContext = function runInContext(context) { + context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); + var Array = context.Array, + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + var coreJsData = context['__core-js_shared__']; + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var idCounter = 0; + + var maskSrcKey = function () { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? 'Symbol(src)_1.' + uid : ''; + }(); + + var nativeObjectToString = objectProto.toString; + var objectCtorString = funcToString.call(Object); + var oldDash = root._; + var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + var Buffer = moduleExports ? context.Buffer : undefined, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, + symIterator = Symbol ? Symbol.iterator : undefined, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = function () { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }(); + + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + var metaMap = WeakMap && new WeakMap(); + var realNames = {}; + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + + return new LodashWrapper(value); + } + + var baseCreate = function () { + function object() {} + + return function (proto) { + if (!isObject(proto)) { + return {}; + } + + if (objectCreate) { + return objectCreate(proto); + } + + object.prototype = proto; + var result = new object(); + object.prototype = undefined; + return result; + }; + }(); + + function baseLodash() {} + + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + lodash.templateSettings = { + 'escape': reEscape, + 'evaluate': reEvaluate, + 'interpolate': reInterpolate, + 'variable': '', + 'imports': { + '_': lodash + } + }; + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + + return result; + } + + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : start - 1, + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || !isRight && arrLength == length && takeCount == length) { + return baseWrapperValue(array, this.__actions__); + } + + var result = []; + + outer: while (length-- && resIndex < takeCount) { + index += dir; + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + + result[resIndex++] = value; + } + + return result; + } + + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + this.clear(); + + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + function hashGet(key) { + var data = this.__data__; + + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); + } + + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; + return this; + } + + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + this.clear(); + + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + + var lastIndex = data.length - 1; + + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + + --this.size; + return true; + } + + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + return index < 0 ? undefined : data[index][1]; + } + + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + + return this; + } + + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + this.clear(); + + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash(), + 'map': new (Map || ListCache)(), + 'string': new Hash() + }; + } + + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + this.__data__ = new MapCache(); + + while (++index < length) { + this.add(values[index]); + } + } + + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + + return this; + } + + function setCacheHas(value) { + return this.__data__.has(value); + } + + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + function stackClear() { + this.__data__ = new ListCache(); + this.size = 0; + } + + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + this.size = data.size; + return result; + } + + function stackGet(key) { + return this.__data__.get(key); + } + + function stackHas(key) { + return this.__data__.has(key); + } + + function stackSet(key, value) { + var data = this.__data__; + + if (data instanceof ListCache) { + var pairs = data.__data__; + + if (!Map || pairs.length < 199) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + + data = this.__data__ = new MapCache(pairs); + } + + data.set(key, value); + this.size = data.size; + return this; + } + + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isBuff && (key == 'offset' || key == 'parent') || isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || isIndex(key, length)))) { + result.push(key); + } + } + + return result; + } + + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + + function assignMergeValue(object, key, value) { + if (value !== undefined && !eq(object[key], value) || value === undefined && !(key in object)) { + baseAssignValue(object, key, value); + } + } + + function assignValue(object, key, value) { + var objValue = object[key]; + + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined && !(key in object)) { + baseAssignValue(object, key, value); + } + } + + function assocIndexOf(array, key) { + var length = array.length; + + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + + return -1; + } + + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function (value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + function baseAssignIn(object, source) { + return object && copyObject(source, keysIn(source), object); + } + + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + function baseAt(object, paths) { + var index = -1, + length = paths.length, + result = Array(length), + skip = object == null; + + while (++index < length) { + result[index] = skip ? undefined : get(object, paths[index]); + } + + return result; + } + + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + + return number; + } + + function baseClone(value, bitmask, customizer, key, object, stack) { + var result, + isDeep = bitmask & CLONE_DEEP_FLAG, + isFlat = bitmask & CLONE_FLAT_FLAG, + isFull = bitmask & CLONE_SYMBOLS_FLAG; + + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + + if (result !== undefined) { + return result; + } + + if (!isObject(value)) { + return value; + } + + var isArr = isArray(value); + + if (isArr) { + result = initCloneArray(value); + + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + + if (tag == objectTag || tag == argsTag || isFunc && !object) { + result = isFlat || isFunc ? {} : initCloneObject(value); + + if (!isDeep) { + return isFlat ? copySymbolsIn(value, baseAssignIn(result, value)) : copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + + result = initCloneByTag(value, tag, isDeep); + } + } + + stack || (stack = new Stack()); + var stacked = stack.get(value); + + if (stacked) { + return stacked; + } + + stack.set(value, result); + + if (isSet(value)) { + value.forEach(function (subValue) { + result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); + }); + } else if (isMap(value)) { + value.forEach(function (subValue, key) { + result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + } + + var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; + var props = isArr ? undefined : keysFunc(value); + arrayEach(props || value, function (subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + + assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); + }); + return result; + } + + function baseConforms(source) { + var props = keys(source); + return function (object) { + return baseConformsTo(object, source, props); + }; + } + + function baseConformsTo(object, source, props) { + var length = props.length; + + if (object == null) { + return !length; + } + + object = Object(object); + + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if (value === undefined && !(key in object) || !predicate(value)) { + return false; + } + } + + return true; + } + + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + return setTimeout(function () { + func.apply(undefined, args); + }, wait); + } + + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + + outer: while (++index < length) { + var value = array[index], + computed = iteratee == null ? value : iteratee(value); + value = comparator || value !== 0 ? value : 0; + + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + + result.push(value); + } else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + + return result; + } + + var baseEach = createBaseEach(baseForOwn); + var baseEachRight = createBaseEach(baseForOwnRight, true); + + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function (value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined ? current === current && !isSymbol(current) : comparator(current, computed))) { + var computed = current, + result = value; + } + } + + return result; + } + + function baseFill(array, value, start, end) { + var length = array.length; + start = toInteger(start); + + if (start < 0) { + start = -start > length ? 0 : length + start; + } + + end = end === undefined || end > length ? length : toInteger(end); + + if (end < 0) { + end += length; + } + + end = start > end ? 0 : toLength(end); + + while (start < end) { + array[start++] = value; + } + + return array; + } + + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function (value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + + if (depth > 0 && predicate(value)) { + if (depth > 1) { + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + + return result; + } + + var baseFor = createBaseFor(); + var baseForRight = createBaseFor(true); + + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + function baseFunctions(object, props) { + return arrayFilter(props, function (key) { + return isFunction(object[key]); + }); + } + + function baseGet(object, path) { + path = castPath(path, object); + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[toKey(path[index++])]; + } + + return index && index == length ? object : undefined; + } + + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + + function baseGt(value, other) { + return value > other; + } + + function baseHas(object, key) { + return object != null && hasOwnProperty.call(object, key); + } + + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined; + } + + array = arrays[0]; + var index = -1, + seen = caches[0]; + + outer: while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + value = comparator || value !== 0 ? value : 0; + + if (!(seen ? cacheHas(seen, computed) : includes(result, computed, comparator))) { + othIndex = othLength; + + while (--othIndex) { + var cache = caches[othIndex]; + + if (!(cache ? cacheHas(cache, computed) : includes(arrays[othIndex], computed, comparator))) { + continue outer; + } + } + + if (seen) { + seen.push(computed); + } + + result.push(value); + } + } + + return result; + } + + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function (value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + function baseInvoke(object, path, args) { + path = castPath(path, object); + object = parent(object, path); + var func = object == null ? object : object[toKey(last(path))]; + return func == null ? undefined : apply(func, object, args); + } + + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + function baseIsArrayBuffer(value) { + return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; + } + + function baseIsDate(value) { + return isObjectLike(value) && baseGetTag(value) == dateTag; + } + + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + + if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { + return value !== value && other !== other; + } + + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + + objIsArr = true; + objIsObj = false; + } + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack()); + return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack()); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + + if (!isSameTag) { + return false; + } + + stack || (stack = new Stack()); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + + object = Object(object); + + while (index--) { + var data = matchData[index]; + + if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { + return false; + } + } + + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack(); + + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + + if (!(result === undefined ? baseIsEqual(srcValue, objValue, 3, customizer, stack) : result)) { + return false; + } + } + } + + return true; + } + + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + function baseIsRegExp(value) { + return isObjectLike(value) && baseGetTag(value) == regexpTag; + } + + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + function baseIteratee(value) { + if (typeof value == 'function') { + return value; + } + + if (value == null) { + return identity; + } + + if (typeof value == 'object') { + return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); + } + + return property(value); + } + + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + + var result = []; + + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + + return result; + } + + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + + return result; + } + + function baseLt(value, other) { + return value < other; + } + + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + baseEach(collection, function (value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + function baseMatches(source) { + var matchData = getMatchData(source); + + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + + return function (object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + + return function (object) { + var objValue = get(object, path); + return objValue === undefined && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, 3); + }; + } + + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + + baseFor(source, function (srcValue, key) { + stack || (stack = new Stack()); + + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } else { + var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + '', object, source, stack) : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + + var newValue = customizer ? customizer(objValue, srcValue, key + '', object, source, stack) : undefined; + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + newValue = srcValue; + + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } else { + newValue = []; + } + } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } else { + isCommon = false; + } + } + + if (isCommon) { + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + + assignMergeValue(object, key, newValue); + } + + function baseNth(array, n) { + var length = array.length; + + if (!length) { + return; + } + + n += n < 0 ? length : 0; + return isIndex(n, length) ? array[n] : undefined; + } + + function baseOrderBy(collection, iteratees, orders) { + if (iteratees.length) { + iteratees = arrayMap(iteratees, function (iteratee) { + if (isArray(iteratee)) { + return function (value) { + return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); + }; + } + + return iteratee; + }); + } else { + iteratees = [identity]; + } + + var index = -1; + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + var result = baseMap(collection, function (value, key, collection) { + var criteria = arrayMap(iteratees, function (iteratee) { + return iteratee(value); + }); + return { + 'criteria': criteria, + 'index': ++index, + 'value': value + }; + }); + return baseSortBy(result, function (object, other) { + return compareMultiple(object, other, orders); + }); + } + + function basePick(object, paths) { + return basePickBy(object, paths, function (value, path) { + return hasIn(object, path); + }); + } + + function basePickBy(object, paths, predicate) { + var index = -1, + length = paths.length, + result = {}; + + while (++index < length) { + var path = paths[index], + value = baseGet(object, path); + + if (predicate(value, path)) { + baseSet(result, castPath(path, object), value); + } + } + + return result; + } + + function basePropertyDeep(path) { + return function (object) { + return baseGet(object, path); + }; + } + + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (array === values) { + values = copyArray(values); + } + + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + + splice.call(array, fromIndex, 1); + } + } + + return array; + } + + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + + if (length == lastIndex || index !== previous) { + var previous = index; + + if (isIndex(index)) { + splice.call(array, index, 1); + } else { + baseUnset(array, index); + } + } + } + + return array; + } + + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + + return result; + } + + function baseRepeat(string, n) { + var result = ''; + + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + + do { + if (n % 2) { + result += string; + } + + n = nativeFloor(n / 2); + + if (n) { + string += string; + } + } while (n); + + return result; + } + + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + function baseSample(collection) { + return arraySample(values(collection)); + } + + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); + } + + function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } + + path = castPath(path, object); + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = toKey(path[index]), + newValue = value; + + if (key === '__proto__' || key === 'constructor' || key === 'prototype') { + return object; + } + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + + if (newValue === undefined) { + newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {}; + } + } + + assignValue(nested, key, newValue); + nested = nested[key]; + } + + return object; + } + + var baseSetData = !metaMap ? identity : function (func, data) { + metaMap.set(func, data); + return func; + }; + var baseSetToString = !defineProperty ? identity : function (func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : length + start; + } + + end = end > length ? length : end; + + if (end < 0) { + end += length; + } + + length = start > end ? 0 : end - start >>> 0; + start >>>= 0; + var result = Array(length); + + while (++index < length) { + result[index] = array[index + start]; + } + + return result; + } + + function baseSome(collection, predicate) { + var result; + baseEach(collection, function (value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array == null ? low : array.length; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = low + high >>> 1, + computed = array[mid]; + + if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) { + low = mid + 1; + } else { + high = mid; + } + } + + return high; + } + + return baseSortedIndexBy(array, value, identity, retHighest); + } + + function baseSortedIndexBy(array, value, iteratee, retHighest) { + var low = 0, + high = array == null ? 0 : array.length; + + if (high === 0) { + return 0; + } + + value = iteratee(value); + var valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); + + if (valIsNaN) { + var setLow = retHighest || othIsReflexive; + } else if (valIsUndefined) { + setLow = othIsReflexive && (retHighest || othIsDefined); + } else if (valIsNull) { + setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); + } else if (valIsSymbol) { + setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); + } else if (othIsNull || othIsSymbol) { + setLow = false; + } else { + setLow = retHighest ? computed <= value : computed < value; + } + + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + + return nativeMin(high, MAX_ARRAY_INDEX); + } + + function baseSortedUniq(array, iteratee) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!index || !eq(computed, seen)) { + var seen = computed; + result[resIndex++] = value === 0 ? 0 : value; + } + } + + return result; + } + + function baseToNumber(value) { + if (typeof value == 'number') { + return value; + } + + if (isSymbol(value)) { + return NAN; + } + + return +value; + } + + function baseToString(value) { + if (typeof value == 'string') { + return value; + } + + if (isArray(value)) { + return arrayMap(value, baseToString) + ''; + } + + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + + var result = value + ''; + return result == '0' && 1 / value == -(1 / 0) ? '-0' : result; + } + + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + + if (set) { + return setToArray(set); + } + + isCommon = false; + includes = cacheHas; + seen = new SetCache(); + } else { + seen = iteratee ? [] : result; + } + + outer: while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + value = comparator || value !== 0 ? value : 0; + + if (isCommon && computed === computed) { + var seenIndex = seen.length; + + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + + if (iteratee) { + seen.push(computed); + } + + result.push(value); + } else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + + result.push(value); + } + } + + return result; + } + + function baseUnset(object, path) { + path = castPath(path, object); + object = parent(object, path); + return object == null || delete object[toKey(last(path))]; + } + + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {} + + return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index); + } + + function baseWrapperValue(value, actions) { + var result = value; + + if (result instanceof LazyWrapper) { + result = result.value(); + } + + return arrayReduce(actions, function (result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + function baseXor(arrays, iteratee, comparator) { + var length = arrays.length; + + if (length < 2) { + return length ? baseUniq(arrays[0]) : []; + } + + var index = -1, + result = Array(length); + + while (++index < length) { + var array = arrays[index], + othIndex = -1; + + while (++othIndex < length) { + if (othIndex != index) { + result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); + } + } + } + + return baseUniq(baseFlatten(result, 1), iteratee, comparator); + } + + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + + return result; + } + + function castArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + function castFunction(value) { + return typeof value == 'function' ? value : identity; + } + + function castPath(value, object) { + if (isArray(value)) { + return value; + } + + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + + var castRest = baseRest; + + function castSlice(array, start, end) { + var length = array.length; + end = end === undefined ? length : end; + return !start && end >= length ? array : baseSlice(array, start, end); + } + + var clearTimeout = ctxClearTimeout || function (id) { + return root.clearTimeout(id); + }; + + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result); + return result; + } + + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + function compareAscending(value, other) { + if (value !== other) { + var valIsDefined = value !== undefined, + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); + var othIsDefined = other !== undefined, + othIsNull = other === null, + othIsReflexive = other === other, + othIsSymbol = isSymbol(other); + + if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { + return 1; + } + + if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { + return -1; + } + } + + return 0; + } + + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + + if (result) { + if (index >= ordersLength) { + return result; + } + + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + + return object.index - other.index; + } + + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + + return result; + } + + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + + var offset = argsIndex; + + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + + return result; + } + + function copyArray(source, array) { + var index = -1, + length = source.length; + array || (array = Array(length)); + + while (++index < length) { + array[index] = source[index]; + } + + return array; + } + + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + + return object; + } + + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + function copySymbolsIn(source, object) { + return copyObject(source, getSymbolsIn(source), object); + } + + function createAggregator(setter, initializer) { + return function (collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + return func(collection, setter, getIteratee(iteratee, 2), accumulator); + }; + } + + function createAssigner(assigner) { + return baseRest(function (object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + customizer = assigner.length > 3 && typeof customizer == 'function' ? (length--, customizer) : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + + object = Object(object); + + while (++index < length) { + var source = sources[index]; + + if (source) { + assigner(object, source, index, customizer); + } + } + + return object; + }); + } + + function createBaseEach(eachFunc, fromRight) { + return function (collection, iteratee) { + if (collection == null) { + return collection; + } + + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while (fromRight ? index-- : ++index < length) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + + return collection; + }; + } + + function createBaseFor(fromRight) { + return function (object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + + return object; + }; + } + + function createBind(func, bitmask, thisArg) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var fn = this && this !== root && this instanceof wrapper ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + + return wrapper; + } + + function createCaseFirst(methodName) { + return function (string) { + string = toString(string); + var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; + var chr = strSymbols ? strSymbols[0] : string.charAt(0); + var trailing = strSymbols ? castSlice(strSymbols, 1).join('') : string.slice(1); + return chr[methodName]() + trailing; + }; + } + + function createCompounder(callback) { + return function (string) { + return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); + }; + } + + function createCtor(Ctor) { + return function () { + var args = arguments; + + switch (args.length) { + case 0: + return new Ctor(); + + case 1: + return new Ctor(args[0]); + + case 2: + return new Ctor(args[0], args[1]); + + case 3: + return new Ctor(args[0], args[1], args[2]); + + case 4: + return new Ctor(args[0], args[1], args[2], args[3]); + + case 5: + return new Ctor(args[0], args[1], args[2], args[3], args[4]); + + case 6: + return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + + case 7: + return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + return isObject(result) ? result : thisBinding; + }; + } + + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getHolder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + + var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder); + length -= holders.length; + + if (length < arity) { + return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); + } + + var fn = this && this !== root && this instanceof wrapper ? Ctor : func; + return apply(fn, this, args); + } + + return wrapper; + } + + function createFind(findIndexFunc) { + return function (collection, predicate, fromIndex) { + var iterable = Object(collection); + + if (!isArrayLike(collection)) { + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + + predicate = function predicate(key) { + return iteratee(iterable[key], key, iterable); + }; + } + + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + function createFlow(fromRight) { + return flatRest(function (funcs) { + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + + while (index--) { + var func = funcs[index]; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + + index = wrapper ? index : length; + + while (++index < length) { + func = funcs[index]; + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && data[1] == 424 && !data[4].length && data[9] == 1) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func); + } + } + + return function () { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && isArray(value)) { + return wrapper.plant(value).value(); + } + + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + + return result; + }; + }); + } + + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & WRAP_ARY_FLAG, + isBind = bitmask & WRAP_BIND_FLAG, + isBindKey = bitmask & WRAP_BIND_KEY_FLAG, + isCurried = bitmask & 24, + isFlip = bitmask & WRAP_FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtor(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length; + + while (index--) { + args[index] = arguments[index]; + } + + if (isCurried) { + var placeholder = getHolder(wrapper), + holdersCount = countHolders(args, placeholder); + } + + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + + length -= holdersCount; + + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurry(func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length); + } + + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + length = args.length; + + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + + if (isAry && ary < length) { + args.length = ary; + } + + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtor(fn); + } + + return fn.apply(thisBinding, args); + } + + return wrapper; + } + + function createInverter(setter, toIteratee) { + return function (object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + function createMathOperation(operator, defaultValue) { + return function (value, other) { + var result; + + if (value === undefined && other === undefined) { + return defaultValue; + } + + if (value !== undefined) { + result = value; + } + + if (other !== undefined) { + if (result === undefined) { + return other; + } + + if (typeof value == 'string' || typeof other == 'string') { + value = baseToString(value); + other = baseToString(other); + } else { + value = baseToNumber(value); + other = baseToNumber(other); + } + + result = operator(value, other); + } + + return result; + }; + } + + function createOver(arrayFunc) { + return flatRest(function (iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); + return baseRest(function (args) { + var thisArg = this; + return arrayFunc(iteratees, function (iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : baseToString(chars); + var charsLength = chars.length; + + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); + } + + function createPartial(func, bitmask, thisArg, partials) { + var isBind = bitmask & WRAP_BIND_FLAG, + Ctor = createCtor(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = this && this !== root && this instanceof wrapper ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + + return apply(fn, isBind ? thisArg : this, args); + } + + return wrapper; + } + + function createRange(fromRight) { + return function (start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + + start = toFinite(start); + + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + + step = step === undefined ? start < end ? 1 : -1 : toFinite(step); + return baseRange(start, end, step, fromRight); + }; + } + + function createRelationalOperation(operator) { + return function (value, other) { + if (!(typeof value == 'string' && typeof other == 'string')) { + value = toNumber(value); + other = toNumber(other); + } + + return operator(value, other); + }; + } + + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & WRAP_CURRY_FLAG, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG; + bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); + + if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { + bitmask &= -4; + } + + var newData = [func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, newHoldersRight, argPos, ary, arity]; + var result = wrapFunc.apply(undefined, newData); + + if (isLaziable(func)) { + setData(result, newData); + } + + result.placeholder = placeholder; + return setWrapToString(result, func, bitmask); + } + + function createRound(methodName) { + var func = Math[methodName]; + return function (number, precision) { + number = toNumber(number); + precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); + + if (precision && nativeIsFinite(number)) { + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + + return func(number); + }; + } + + var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function (values) { + return new Set(values); + }; + + function createToPairs(keysFunc) { + return function (object) { + var tag = getTag(object); + + if (tag == mapTag) { + return mapToArray(object); + } + + if (tag == setTag) { + return setToPairs(object); + } + + return baseToPairs(object, keysFunc(object)); + }; + } + + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; + + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + var length = partials ? partials.length : 0; + + if (!length) { + bitmask &= -97; + partials = holders = undefined; + } + + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + partials = holders = undefined; + } + + var data = isBindKey ? undefined : getData(func); + var newData = [func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity]; + + if (data) { + mergeData(newData, data); + } + + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] === undefined ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & 24) { + bitmask &= -25; + } + + if (!bitmask || bitmask == WRAP_BIND_FLAG) { + var result = createBind(func, bitmask, thisArg); + } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { + result = createCurry(func, bitmask, arity); + } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == 33) && !holders.length) { + result = createPartial(func, bitmask, thisArg, partials); + } else { + result = createHybrid.apply(undefined, newData); + } + + var setter = data ? baseSetData : setData; + return setWrapToString(setter(result, newData), func, bitmask); + } + + function customDefaultsAssignIn(objValue, srcValue, key, object) { + if (objValue === undefined || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) { + return srcValue; + } + + return objValue; + } + + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + + return objValue; + } + + function customOmitClone(value) { + return isPlainObject(value) ? undefined : value; + } + + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + + var arrStacked = stack.get(array); + var othStacked = stack.get(other); + + if (arrStacked && othStacked) { + return arrStacked == other && othStacked == array; + } + + var index = -1, + result = true, + seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined; + stack.set(array, other); + stack.set(other, array); + + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); + } + + if (compared !== undefined) { + if (compared) { + continue; + } + + result = false; + break; + } + + if (seen) { + if (!arraySome(other, function (othValue, othIndex) { + if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + result = false; + break; + } + } + + stack['delete'](array); + stack['delete'](other); + return result; + } + + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + + return true; + + case boolTag: + case dateTag: + case numberTag: + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + return object == other + ''; + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + + var stacked = stack.get(object); + + if (stacked) { + return stacked == other; + } + + bitmask |= COMPARE_UNORDERED_FLAG; + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + + } + + return false; + } + + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + + var index = objLength; + + while (index--) { + var key = objProps[index]; + + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + + var objStacked = stack.get(object); + var othStacked = stack.get(other); + + if (objStacked && othStacked) { + return objStacked == other && othStacked == object; + } + + var result = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + } + + if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { + result = false; + break; + } + + skipCtor || (skipCtor = key == 'constructor'); + } + + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + + stack['delete'](object); + stack['delete'](other); + return result; + } + + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + var getData = !metaMap ? noop : function (func) { + return metaMap.get(func); + }; + + function getFuncName(func) { + var result = func.name + '', + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + + return result; + } + + function getHolder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; + } + + function getMatchData(object) { + var result = keys(object), + length = result.length; + + while (length--) { + var key = result[length], + value = object[key]; + result[length] = [key, value, isStrictComparable(value)]; + } + + return result; + } + + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + var getSymbols = !nativeGetSymbols ? stubArray : function (object) { + if (object == null) { + return []; + } + + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function (symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) { + var result = []; + + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + + return result; + }; + var getTag = baseGetTag; + + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) { + getTag = function getTag(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + + case mapCtorString: + return mapTag; + + case promiseCtorString: + return promiseTag; + + case setCtorString: + return setTag; + + case weakMapCtorString: + return weakMapTag; + } + } + + return result; + }; + } + + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': + start += size; + break; + + case 'dropRight': + end -= size; + break; + + case 'take': + end = nativeMin(end, start + size); + break; + + case 'takeRight': + start = nativeMax(start, end - size); + break; + } + } + + return { + 'start': start, + 'end': end + }; + } + + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + + function hasPath(object, path, hasFunc) { + path = castPath(path, object); + var index = -1, + length = path.length, + result = false; + + while (++index < length) { + var key = toKey(path[index]); + + if (!(result = object != null && hasFunc(object, key))) { + break; + } + + object = object[key]; + } + + if (result || ++index != length) { + return result; + } + + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); + } + + function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + + return result; + } + + function initCloneObject(object) { + return typeof object.constructor == 'function' && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; + } + + function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: + case float64Tag: + case int8Tag: + case int16Tag: + case int32Tag: + case uint8Tag: + case uint8ClampedTag: + case uint16Tag: + case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return new Ctor(); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return new Ctor(); + + case symbolTag: + return cloneSymbol(object); + } + } + + function insertWrapDetails(source, details) { + var length = details.length; + + if (!length) { + return source; + } + + var lastIndex = length - 1; + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); + } + + function isFlattenable(value) { + return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); + } + + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (type == 'number' || type != 'symbol' && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; + } + + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + + var type = typeof index; + + if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) { + return eq(object[index], value); + } + + return false; + } + + function isKey(value, object) { + if (isArray(value)) { + return false; + } + + var type = typeof value; + + if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { + return true; + } + + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); + } + + function isKeyable(value) { + var type = typeof value; + return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null; + } + + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + + if (func === other) { + return true; + } + + var data = getData(other); + return !!data && func === data[0]; + } + + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + + var isMaskable = coreJsData ? isFunction : stubFalse; + + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; + return value === proto; + } + + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + function matchesStrictComparable(key, srcValue) { + return function (object) { + if (object == null) { + return false; + } + + return object[key] === srcValue && (srcValue !== undefined || key in Object(object)); + }; + } + + function memoizeCapped(func) { + var result = memoize(func, function (key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + + return key; + }); + var cache = result.cache; + return result; + } + + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < 131; + var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == 384 && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; + + if (!(isCommon || isCombo)) { + return data; + } + + if (srcBitmask & WRAP_BIND_FLAG) { + data[2] = source[2]; + newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; + } + + var value = source[3]; + + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : value; + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; + } + + value = source[5]; + + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; + } + + value = source[7]; + + if (value) { + data[7] = value; + } + + if (srcBitmask & WRAP_ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + + if (data[9] == null) { + data[9] = source[9]; + } + + data[0] = source[0]; + data[1] = newBitmask; + return data; + } + + function nativeKeysIn(object) { + var result = []; + + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + + return result; + } + + function objectToString(value) { + return nativeObjectToString.call(value); + } + + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? func.length - 1 : start, 0); + return function () { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + + index = -1; + var otherArgs = Array(start + 1); + + while (++index < start) { + otherArgs[index] = args[index]; + } + + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + function parent(object, path) { + return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + + return array; + } + + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + var setData = shortOut(baseSetData); + + var setTimeout = ctxSetTimeout || function (func, wait) { + return root.setTimeout(func, wait); + }; + + var setToString = shortOut(baseSetToString); + + function setWrapToString(wrapper, reference, bitmask) { + var source = reference + ''; + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + function shortOut(func) { + var count = 0, + lastCalled = 0; + return function () { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + lastCalled = stamp; + + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + + return func.apply(undefined, arguments); + }; + } + + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + size = size === undefined ? length : size; + + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + array[rand] = array[index]; + array[index] = value; + } + + array.length = size; + return array; + } + + var stringToPath = memoizeCapped(function (string) { + var result = []; + + if (string.charCodeAt(0) === 46) { + result.push(''); + } + + string.replace(rePropName, function (match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, '$1') : number || match); + }); + return result; + }); + + function toKey(value) { + if (typeof value == 'string' || isSymbol(value)) { + return value; + } + + var result = value + ''; + return result == '0' && 1 / value == -(1 / 0) ? '-0' : result; + } + + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + + try { + return func + ''; + } catch (e) {} + } + + return ''; + } + + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function (pair) { + var value = '_.' + pair[0]; + + if (bitmask & pair[1] && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + function chunk(array, size, guard) { + if (guard ? isIterateeCall(array, size, guard) : size === undefined) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + + var length = array == null ? 0 : array.length; + + if (!length || size < 1) { + return []; + } + + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, index += size); + } + + return result; + } + + function compact(array) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (value) { + result[resIndex++] = value; + } + } + + return result; + } + + function concat() { + var length = arguments.length; + + if (!length) { + return []; + } + + var args = Array(length - 1), + array = arguments[0], + index = length; + + while (index--) { + args[index - 1] = arguments[index]; + } + + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); + } + + var difference = baseRest(function (array, values) { + return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; + }); + var differenceBy = baseRest(function (array, values) { + var iteratee = last(values); + + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + + return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; + }); + var differenceWith = baseRest(function (array, values) { + var comparator = last(values); + + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + + return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) : []; + }); + + function drop(array, n, guard) { + var length = array == null ? 0 : array.length; + + if (!length) { + return []; + } + + n = guard || n === undefined ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + function dropRight(array, n, guard) { + var length = array == null ? 0 : array.length; + + if (!length) { + return []; + } + + n = guard || n === undefined ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + function dropRightWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; + } + + function dropWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : []; + } + + function fill(array, value, start, end) { + var length = array == null ? 0 : array.length; + + if (!length) { + return []; + } + + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + + return baseFill(array, value, start, end); + } + + function findIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + + if (!length) { + return -1; + } + + var index = fromIndex == null ? 0 : toInteger(fromIndex); + + if (index < 0) { + index = nativeMax(length + index, 0); + } + + return baseFindIndex(array, getIteratee(predicate, 3), index); + } + + function findLastIndex(array, predicate, fromIndex) { + var length = array == null ? 0 : array.length; + + if (!length) { + return -1; + } + + var index = length - 1; + + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + + return baseFindIndex(array, getIteratee(predicate, 3), index, true); + } + + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + + function flattenDeep(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, INFINITY) : []; + } + + function flattenDepth(array, depth) { + var length = array == null ? 0 : array.length; + + if (!length) { + return []; + } + + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + function fromPairs(pairs) { + var index = -1, + length = pairs == null ? 0 : pairs.length, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + + return result; + } + + function head(array) { + return array && array.length ? array[0] : undefined; + } + + function indexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + + if (!length) { + return -1; + } + + var index = fromIndex == null ? 0 : toInteger(fromIndex); + + if (index < 0) { + index = nativeMax(length + index, 0); + } + + return baseIndexOf(array, value, index); + } + + function initial(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 0, -1) : []; + } + + var intersection = baseRest(function (arrays) { + var mapped = arrayMap(arrays, castArrayLikeObject); + return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; + }); + var intersectionBy = baseRest(function (arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + + return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; + }); + var intersectionWith = baseRest(function (arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, castArrayLikeObject); + comparator = typeof comparator == 'function' ? comparator : undefined; + + if (comparator) { + mapped.pop(); + } + + return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined, comparator) : []; + }); + + function join(array, separator) { + return array == null ? '' : nativeJoin.call(array, separator); + } + + function last(array) { + var length = array == null ? 0 : array.length; + return length ? array[length - 1] : undefined; + } + + function lastIndexOf(array, value, fromIndex) { + var length = array == null ? 0 : array.length; + + if (!length) { + return -1; + } + + var index = length; + + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); + } + + return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); + } + + function nth(array, n) { + return array && array.length ? baseNth(array, toInteger(n)) : undefined; + } + + var pull = baseRest(pullAll); + + function pullAll(array, values) { + return array && array.length && values && values.length ? basePullAll(array, values) : array; + } + + function pullAllBy(array, values, iteratee) { + return array && array.length && values && values.length ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; + } + + function pullAllWith(array, values, comparator) { + return array && array.length && values && values.length ? basePullAll(array, values, undefined, comparator) : array; + } + + var pullAt = flatRest(function (array, indexes) { + var length = array == null ? 0 : array.length, + result = baseAt(array, indexes); + basePullAt(array, arrayMap(indexes, function (index) { + return isIndex(index, length) ? +index : index; + }).sort(compareAscending)); + return result; + }); + + function remove(array, predicate) { + var result = []; + + if (!(array && array.length)) { + return result; + } + + var index = -1, + indexes = [], + length = array.length; + predicate = getIteratee(predicate, 3); + + while (++index < length) { + var value = array[index]; + + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + + basePullAt(array, indexes); + return result; + } + + function reverse(array) { + return array == null ? array : nativeReverse.call(array); + } + + function slice(array, start, end) { + var length = array == null ? 0 : array.length; + + if (!length) { + return []; + } + + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + + return baseSlice(array, start, end); + } + + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); + } + + function sortedIndexOf(array, value) { + var length = array == null ? 0 : array.length; + + if (length) { + var index = baseSortedIndex(array, value); + + if (index < length && eq(array[index], value)) { + return index; + } + } + + return -1; + } + + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); + } + + function sortedLastIndexOf(array, value) { + var length = array == null ? 0 : array.length; + + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + + if (eq(array[index], value)) { + return index; + } + } + + return -1; + } + + function sortedUniq(array) { + return array && array.length ? baseSortedUniq(array) : []; + } + + function sortedUniqBy(array, iteratee) { + return array && array.length ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; + } + + function tail(array) { + var length = array == null ? 0 : array.length; + return length ? baseSlice(array, 1, length) : []; + } + + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + + n = guard || n === undefined ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + function takeRight(array, n, guard) { + var length = array == null ? 0 : array.length; + + if (!length) { + return []; + } + + n = guard || n === undefined ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + function takeRightWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; + } + + function takeWhile(array, predicate) { + return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : []; + } + + var union = baseRest(function (arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + var unionBy = baseRest(function (arrays) { + var iteratee = last(arrays); + + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); + }); + var unionWith = baseRest(function (arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + function uniq(array) { + return array && array.length ? baseUniq(array) : []; + } + + function uniqBy(array, iteratee) { + return array && array.length ? baseUniq(array, getIteratee(iteratee, 2)) : []; + } + + function uniqWith(array, comparator) { + comparator = typeof comparator == 'function' ? comparator : undefined; + return array && array.length ? baseUniq(array, undefined, comparator) : []; + } + + function unzip(array) { + if (!(array && array.length)) { + return []; + } + + var length = 0; + array = arrayFilter(array, function (group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function (index) { + return arrayMap(array, baseProperty(index)); + }); + } + + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + + var result = unzip(array); + + if (iteratee == null) { + return result; + } + + return arrayMap(result, function (group) { + return apply(iteratee, undefined, group); + }); + } + + var without = baseRest(function (array, values) { + return isArrayLikeObject(array) ? baseDifference(array, values) : []; + }); + var xor = baseRest(function (arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + var xorBy = baseRest(function (arrays) { + var iteratee = last(arrays); + + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); + }); + var xorWith = baseRest(function (arrays) { + var comparator = last(arrays); + comparator = typeof comparator == 'function' ? comparator : undefined; + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + var zip = baseRest(unzip); + + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + var zipWith = baseRest(function (arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + function tap(value, interceptor) { + interceptor(value); + return value; + } + + function thru(value, interceptor) { + return interceptor(value); + } + + var wrapperAt = flatRest(function (paths) { + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function interceptor(object) { + return baseAt(object, paths); + }; + + if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + + value = value.slice(start, +start + (length ? 1 : 0)); + + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + + return new LodashWrapper(value, this.__chain__).thru(function (array) { + if (length && !array.length) { + array.push(undefined); + } + + return array; + }); + }); + + function wrapperChain() { + return chain(this); + } + + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + return { + 'done': done, + 'value': value + }; + } + + function wrapperToIterator() { + return this; + } + + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + + var previous = clone; + parent = parent.__wrapped__; + } + + previous.__wrapped__ = value; + return result; + } + + function wrapperReverse() { + var value = this.__wrapped__; + + if (value instanceof LazyWrapper) { + var wrapped = value; + + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + + wrapped = wrapped.reverse(); + + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + + return new LodashWrapper(wrapped, this.__chain__); + } + + return this.thru(reverse); + } + + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + var countBy = createAggregator(function (result, value, key) { + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } + }); + + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + + return func(collection, getIteratee(predicate, 3)); + } + + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + var find = createFind(findIndex); + var findLast = createFind(findLastIndex); + + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + function forEach(collection, iteratee) { + var func = isArray(collection) ? arrayEach : baseEach; + return func(collection, getIteratee(iteratee, 3)); + } + + function forEachRight(collection, iteratee) { + var func = isArray(collection) ? arrayEachRight : baseEachRight; + return func(collection, getIteratee(iteratee, 3)); + } + + var groupBy = createAggregator(function (result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + baseAssignValue(result, key, [value]); + } + }); + + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; + var length = collection.length; + + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + + return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; + } + + var invokeMap = baseRest(function (collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; + baseEach(collection, function (value) { + result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + var keyBy = createAggregator(function (result, value, key) { + baseAssignValue(result, key, value); + }); + + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + + orders = guard ? undefined : orders; + + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + + return baseOrderBy(collection, iteratees, orders); + } + + var partition = createAggregator(function (result, value, key) { + result[key ? 0 : 1].push(value); + }, function () { + return [[], []]; + }); + + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, negate(getIteratee(predicate, 3))); + } + + function sample(collection) { + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); + } + + function sampleSize(collection, n, guard) { + if (guard ? isIterateeCall(collection, n, guard) : n === undefined) { + n = 1; + } else { + n = toInteger(n); + } + + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); + } + + function shuffle(collection) { + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); + } + + function size(collection) { + if (collection == null) { + return 0; + } + + if (isArrayLike(collection)) { + return isString(collection) ? stringSize(collection) : collection.length; + } + + var tag = getTag(collection); + + if (tag == mapTag || tag == setTag) { + return collection.size; + } + + return baseKeys(collection).length; + } + + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + + return func(collection, getIteratee(predicate, 3)); + } + + var sortBy = baseRest(function (collection, iteratees) { + if (collection == null) { + return []; + } + + var length = iteratees.length; + + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees = [iteratees[0]]; + } + + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + var now = ctxNow || function () { + return root.Date.now(); + }; + + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + n = toInteger(n); + return function () { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + function ary(func, n, guard) { + n = guard ? undefined : n; + n = func && n == null ? func.length : n; + return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + function before(n, func) { + var result; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + n = toInteger(n); + return function () { + if (--n > 0) { + result = func.apply(this, arguments); + } + + if (n <= 1) { + func = undefined; + } + + return result; + }; + } + + var bind = baseRest(function (func, thisArg, partials) { + var bitmask = WRAP_BIND_FLAG; + + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bind)); + bitmask |= WRAP_PARTIAL_FLAG; + } + + return createWrap(func, bitmask, thisArg, partials, holders); + }); + var bindKey = baseRest(function (object, key, partials) { + var bitmask = 3; + + if (partials.length) { + var holders = replaceHolders(partials, getHolder(bindKey)); + bitmask |= WRAP_PARTIAL_FLAG; + } + + return createWrap(key, bitmask, object, partials, holders); + }); + + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + function debounce(func, wait, options) { + var lastArgs, + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + wait = toNumber(wait) || 0; + + if (isObject(options)) { + leading = !!options.leading; + maxing = 'maxWait' in options; + maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + lastInvokeTime = time; + timerId = setTimeout(timerExpired, wait); + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; + return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; + } + + function timerExpired() { + var time = now(); + + if (shouldInvoke(time)) { + return trailingEdge(time); + } + + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + timerId = undefined; + + if (trailing && lastArgs) { + return invokeFunc(time); + } + + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + + lastInvokeTime = 0; + lastArgs = lastCallTime = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + + if (maxing) { + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + } + + if (timerId === undefined) { + timerId = setTimeout(timerExpired, wait); + } + + return result; + } + + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + var defer = baseRest(function (func, args) { + return baseDelay(func, 1, args); + }); + var delay = baseRest(function (func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + function flip(func) { + return createWrap(func, WRAP_FLIP_FLAG); + } + + function memoize(func, resolver) { + if (typeof func != 'function' || resolver != null && typeof resolver != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + var memoized = function memoized() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; + } + + memoize.Cache = MapCache; + + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + return function () { + var args = arguments; + + switch (args.length) { + case 0: + return !predicate.call(this); + + case 1: + return !predicate.call(this, args[0]); + + case 2: + return !predicate.call(this, args[0], args[1]); + + case 3: + return !predicate.call(this, args[0], args[1], args[2]); + } + + return !predicate.apply(this, args); + }; + } + + function once(func) { + return before(2, func); + } + + var overArgs = castRest(function (func, transforms) { + transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); + var funcsLength = transforms.length; + return baseRest(function (args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + + return apply(func, this, args); + }); + }); + var partial = baseRest(function (func, partials) { + var holders = replaceHolders(partials, getHolder(partial)); + return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); + }); + var partialRight = baseRest(function (func, partials) { + var holders = replaceHolders(partials, getHolder(partialRight)); + return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + var rearg = flatRest(function (func, indexes) { + return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); + }); + + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); + } + + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + start = start == null ? 0 : nativeMax(toInteger(start), 0); + return baseRest(function (args) { + var array = args[start], + otherArgs = castSlice(args, 0, start); + + if (array) { + arrayPush(otherArgs, array); + } + + return apply(func, this, otherArgs); + }); + } + + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + function unary(func) { + return ary(func, 1); + } + + function wrap(value, wrapper) { + return partial(castFunction(wrapper), value); + } + + function castArray() { + if (!arguments.length) { + return []; + } + + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + function clone(value) { + return baseClone(value, CLONE_SYMBOLS_FLAG); + } + + function cloneWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); + } + + function cloneDeep(value) { + return baseClone(value, 5); + } + + function cloneDeepWith(value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseClone(value, 5, customizer); + } + + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + + function eq(value, other) { + return value === other || value !== value && other !== other; + } + + var gt = createRelationalOperation(baseGt); + var gte = createRelationalOperation(function (value, other) { + return value >= other; + }); + var isArguments = baseIsArguments(function () { + return arguments; + }()) ? baseIsArguments : function (value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); + }; + var isArray = Array.isArray; + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; + + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + function isBoolean(value) { + return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag; + } + + var isBuffer = nativeIsBuffer || stubFalse; + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; + + function isElement(value) { + return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); + } + + function isEmpty(value) { + if (value == null) { + return true; + } + + if (isArrayLike(value) && (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || isBuffer(value) || isTypedArray(value) || isArguments(value))) { + return !value.length; + } + + var tag = getTag(value); + + if (tag == mapTag || tag == setTag) { + return !value.size; + } + + if (isPrototype(value)) { + return !baseKeys(value).length; + } + + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + + return true; + } + + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + + var tag = baseGetTag(value); + return tag == errorTag || tag == domExcTag || typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value); + } + + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + function isFunction(value) { + if (!isObject(value)) { + return false; + } + + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; + + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + function isNaN(value) { + return isNumber(value) && value != +value; + } + + function isNative(value) { + if (isMaskable(value)) { + throw new Error(CORE_ERROR_TEXT); + } + + return baseIsNative(value); + } + + function isNull(value) { + return value === null; + } + + function isNil(value) { + return value == null; + } + + function isNumber(value) { + return typeof value == 'number' || isObjectLike(value) && baseGetTag(value) == numberTag; + } + + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + + var proto = getPrototype(value); + + if (proto === null) { + return true; + } + + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; + } + + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; + + function isSafeInteger(value) { + return isInteger(value) && value >= -9007199254740991 && value <= MAX_SAFE_INTEGER; + } + + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; + + function isString(value) { + return typeof value == 'string' || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag; + } + + function isSymbol(value) { + return typeof value == 'symbol' || isObjectLike(value) && baseGetTag(value) == symbolTag; + } + + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + function isUndefined(value) { + return value === undefined; + } + + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + function isWeakSet(value) { + return isObjectLike(value) && baseGetTag(value) == weakSetTag; + } + + var lt = createRelationalOperation(baseLt); + var lte = createRelationalOperation(function (value, other) { + return value <= other; + }); + + function toArray(value) { + if (!value) { + return []; + } + + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + + if (symIterator && value[symIterator]) { + return iteratorToArray(value[symIterator]()); + } + + var tag = getTag(value), + func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values; + return func(value); + } + + function toFinite(value) { + if (!value) { + return value === 0 ? value : 0; + } + + value = toNumber(value); + + if (value === INFINITY || value === -(1 / 0)) { + var sign = value < 0 ? -1 : 1; + return sign * MAX_INTEGER; + } + + return value === value ? value : 0; + } + + function toInteger(value) { + var result = toFinite(value), + remainder = result % 1; + return result === result ? remainder ? result - remainder : result : 0; + } + + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + + if (isSymbol(value)) { + return NAN; + } + + if (isObject(value)) { + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; + value = isObject(other) ? other + '' : other; + } + + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + + value = baseTrim(value); + var isBinary = reIsBinary.test(value); + return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; + } + + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + function toSafeInteger(value) { + return value ? baseClamp(toInteger(value), -9007199254740991, MAX_SAFE_INTEGER) : value === 0 ? value : 0; + } + + function toString(value) { + return value == null ? '' : baseToString(value); + } + + var assign = createAssigner(function (object, source) { + if (isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + var assignIn = createAssigner(function (object, source) { + copyObject(source, keysIn(source), object); + }); + var assignInWith = createAssigner(function (object, source, srcIndex, customizer) { + copyObject(source, keysIn(source), object, customizer); + }); + var assignWith = createAssigner(function (object, source, srcIndex, customizer) { + copyObject(source, keys(source), object, customizer); + }); + var at = flatRest(baseAt); + + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties == null ? result : baseAssign(result, properties); + } + + var defaults = baseRest(function (object, sources) { + object = Object(object); + var index = -1; + var length = sources.length; + var guard = length > 2 ? sources[2] : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + length = 1; + } + + while (++index < length) { + var source = sources[index]; + var props = keysIn(source); + var propsIndex = -1; + var propsLength = props.length; + + while (++propsIndex < propsLength) { + var key = props[propsIndex]; + var value = object[key]; + + if (value === undefined || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) { + object[key] = source[key]; + } + } + } + + return object; + }); + var defaultsDeep = baseRest(function (args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + function findKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); + } + + function findLastKey(object, predicate) { + return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); + } + + function forIn(object, iteratee) { + return object == null ? object : baseFor(object, getIteratee(iteratee, 3), keysIn); + } + + function forInRight(object, iteratee) { + return object == null ? object : baseForRight(object, getIteratee(iteratee, 3), keysIn); + } + + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee, 3)); + } + + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee, 3)); + } + + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + var invert = createInverter(function (result, value, key) { + if (value != null && typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + result[value] = key; + }, constant(identity)); + var invertBy = createInverter(function (result, value, key) { + if (value != null && typeof value.toString != 'function') { + value = nativeObjectToString.call(value); + } + + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + var invoke = baseRest(baseInvoke); + + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + baseForOwn(object, function (value, key, object) { + baseAssignValue(result, iteratee(value, key, object), value); + }); + return result; + } + + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + baseForOwn(object, function (value, key, object) { + baseAssignValue(result, key, iteratee(value, key, object)); + }); + return result; + } + + var merge = createAssigner(function (object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + var mergeWith = createAssigner(function (object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + var omit = flatRest(function (object, paths) { + var result = {}; + + if (object == null) { + return result; + } + + var isDeep = false; + paths = arrayMap(paths, function (path) { + path = castPath(path, object); + isDeep || (isDeep = path.length > 1); + return path; + }); + copyObject(object, getAllKeysIn(object), result); + + if (isDeep) { + result = baseClone(result, 7, customOmitClone); + } + + var length = paths.length; + + while (length--) { + baseUnset(result, paths[length]); + } + + return result; + }); + + function omitBy(object, predicate) { + return pickBy(object, negate(getIteratee(predicate))); + } + + var pick = flatRest(function (object, paths) { + return object == null ? {} : basePick(object, paths); + }); + + function pickBy(object, predicate) { + if (object == null) { + return {}; + } + + var props = arrayMap(getAllKeysIn(object), function (prop) { + return [prop]; + }); + predicate = getIteratee(predicate); + return basePickBy(object, props, function (value, path) { + return predicate(value, path[0]); + }); + } + + function result(object, path, defaultValue) { + path = castPath(path, object); + var index = -1, + length = path.length; + + if (!length) { + length = 1; + object = undefined; + } + + while (++index < length) { + var value = object == null ? undefined : object[toKey(path[index])]; + + if (value === undefined) { + index = length; + value = defaultValue; + } + + object = isFunction(value) ? value.call(object) : value; + } + + return object; + } + + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + var toPairs = createToPairs(keys); + var toPairsIn = createToPairs(keysIn); + + function transform(object, iteratee, accumulator) { + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + iteratee = getIteratee(iteratee, 4); + + if (accumulator == null) { + var Ctor = object && object.constructor; + + if (isArrLike) { + accumulator = isArr ? new Ctor() : []; + } else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } else { + accumulator = {}; + } + } + + (isArrLike ? arrayEach : baseForOwn)(object, function (value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, castFunction(updater)); + } + + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); + } + + function values(object) { + return object == null ? [] : baseValues(object, keys(object)); + } + + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + + return baseClamp(toNumber(number), lower, upper); + } + + function inRange(number, start, end) { + start = toFinite(start); + + if (end === undefined) { + end = start; + start = 0; + } else { + end = toFinite(end); + } + + number = toNumber(number); + return baseInRange(number, start, end); + } + + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } else { + lower = toFinite(lower); + + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toFinite(upper); + } + } + + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1))), upper); + } + + return baseRandom(lower, upper); + } + + var camelCase = createCompounder(function (result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } + + function endsWith(string, target, position) { + string = toString(string); + target = baseToString(target); + var length = string.length; + position = position === undefined ? length : baseClamp(toInteger(position), 0, length); + var end = position; + position -= target.length; + return position >= 0 && string.slice(position, end) == target; + } + + function escape(string) { + string = toString(string); + return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; + } + + function escapeRegExp(string) { + string = toString(string); + return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, '\\$&') : string; + } + + var kebabCase = createCompounder(function (result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + var lowerCase = createCompounder(function (result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + var lowerFirst = createCaseFirst('toLowerCase'); + + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + var strLength = length ? stringSize(string) : 0; + + if (!length || strLength >= length) { + return string; + } + + var mid = (length - strLength) / 2; + return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars); + } + + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + var strLength = length ? stringSize(string) : 0; + return length && strLength < length ? string + createPadding(length - strLength, chars) : string; + } + + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + var strLength = length ? stringSize(string) : 0; + return length && strLength < length ? createPadding(length - strLength, chars) + string : string; + } + + function parseInt(string, radix, guard) { + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); + } + + function repeat(string, n, guard) { + if (guard ? isIterateeCall(string, n, guard) : n === undefined) { + n = 1; + } else { + n = toInteger(n); + } + + return baseRepeat(toString(string), n); + } + + function replace() { + var args = arguments, + string = toString(args[0]); + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + var snakeCase = createCompounder(function (result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + function split(string, separator, limit) { + if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { + separator = limit = undefined; + } + + limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; + + if (!limit) { + return []; + } + + string = toString(string); + + if (string && (typeof separator == 'string' || separator != null && !isRegExp(separator))) { + separator = baseToString(separator); + + if (!separator && hasUnicode(string)) { + return castSlice(stringToArray(string), 0, limit); + } + } + + return string.split(separator, limit); + } + + var startCase = createCompounder(function (result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + function startsWith(string, target, position) { + string = toString(string); + position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); + target = baseToString(target); + return string.slice(position, position + target.length) == target; + } + + function template(string, options, guard) { + var settings = lodash.templateSettings; + + if (guard && isIterateeCall(string, options, guard)) { + options = undefined; + } + + string = toString(string); + options = assignInWith({}, options, settings, customDefaultsAssignIn); + var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), + importsKeys = keys(imports), + importsValues = baseValues(imports, importsKeys); + var isEscaping, + isEvaluating, + index = 0, + interpolate = options.interpolate || reNoMatch, + source = "__p += '"; + var reDelimiters = RegExp((options.escape || reNoMatch).source + '|' + interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$', 'g'); + var sourceURL = '//# sourceURL=' + (hasOwnProperty.call(options, 'sourceURL') ? (options.sourceURL + '').replace(/\s/g, ' ') : 'lodash.templateSources[' + ++templateCounter + ']') + '\n'; + string.replace(reDelimiters, function (match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { + interpolateValue || (interpolateValue = esTemplateValue); + source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); + + if (escapeValue) { + isEscaping = true; + source += "' +\n__e(" + escapeValue + ") +\n'"; + } + + if (evaluateValue) { + isEvaluating = true; + source += "';\n" + evaluateValue + ";\n__p += '"; + } + + if (interpolateValue) { + source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; + } + + index = offset + match.length; + return match; + }); + source += "';\n"; + var variable = hasOwnProperty.call(options, 'variable') && options.variable; + + if (!variable) { + source = 'with (obj) {\n' + source + '\n}\n'; + } else if (reForbiddenIdentifierChars.test(variable)) { + throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); + } + + source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source).replace(reEmptyStringMiddle, '$1').replace(reEmptyStringTrailing, '$1;'); + source = 'function(' + (variable || 'obj') + ') {\n' + (variable ? '' : 'obj || (obj = {});\n') + "var __t, __p = ''" + (isEscaping ? ', __e = _.escape' : '') + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ';\n') + source + 'return __p\n}'; + var result = attempt(function () { + return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues); + }); + result.source = source; + + if (isError(result)) { + throw result; + } + + return result; + } + + function toLower(value) { + return toString(value).toLowerCase(); + } + + function toUpper(value) { + return toString(value).toUpperCase(); + } + + function trim(string, chars, guard) { + string = toString(string); + + if (string && (guard || chars === undefined)) { + return baseTrim(string); + } + + if (!string || !(chars = baseToString(chars))) { + return string; + } + + var strSymbols = stringToArray(string), + chrSymbols = stringToArray(chars), + start = charsStartIndex(strSymbols, chrSymbols), + end = charsEndIndex(strSymbols, chrSymbols) + 1; + return castSlice(strSymbols, start, end).join(''); + } + + function trimEnd(string, chars, guard) { + string = toString(string); + + if (string && (guard || chars === undefined)) { + return string.slice(0, trimmedEndIndex(string) + 1); + } + + if (!string || !(chars = baseToString(chars))) { + return string; + } + + var strSymbols = stringToArray(string), + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + return castSlice(strSymbols, 0, end).join(''); + } + + function trimStart(string, chars, guard) { + string = toString(string); + + if (string && (guard || chars === undefined)) { + return string.replace(reTrimStart, ''); + } + + if (!string || !(chars = baseToString(chars))) { + return string; + } + + var strSymbols = stringToArray(string), + start = charsStartIndex(strSymbols, stringToArray(chars)); + return castSlice(strSymbols, start).join(''); + } + + function truncate(string, options) { + var length = DEFAULT_TRUNC_LENGTH, + omission = DEFAULT_TRUNC_OMISSION; + + if (isObject(options)) { + var separator = 'separator' in options ? options.separator : separator; + length = 'length' in options ? toInteger(options.length) : length; + omission = 'omission' in options ? baseToString(options.omission) : omission; + } + + string = toString(string); + var strLength = string.length; + + if (hasUnicode(string)) { + var strSymbols = stringToArray(string); + strLength = strSymbols.length; + } + + if (length >= strLength) { + return string; + } + + var end = length - stringSize(omission); + + if (end < 1) { + return omission; + } + + var result = strSymbols ? castSlice(strSymbols, 0, end).join('') : string.slice(0, end); + + if (separator === undefined) { + return result + omission; + } + + if (strSymbols) { + end += result.length - end; + } + + if (isRegExp(separator)) { + if (string.slice(end).search(separator)) { + var match, + substring = result; + + if (!separator.global) { + separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); + } + + separator.lastIndex = 0; + + while (match = separator.exec(substring)) { + var newEnd = match.index; + } + + result = result.slice(0, newEnd === undefined ? end : newEnd); + } + } else if (string.indexOf(baseToString(separator), end) != end) { + var index = result.lastIndexOf(separator); + + if (index > -1) { + result = result.slice(0, index); + } + } + + return result + omission; + } + + function unescape(string) { + string = toString(string); + return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; + } + + var upperCase = createCompounder(function (result, word, index) { + return result + (index ? ' ' : '') + word.toUpperCase(); + }); + var upperFirst = createCaseFirst('toUpperCase'); + + function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? undefined : pattern; + + if (pattern === undefined) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); + } + + return string.match(pattern) || []; + } + + var attempt = baseRest(function (func, args) { + try { + return apply(func, undefined, args); + } catch (e) { + return isError(e) ? e : new Error(e); + } + }); + var bindAll = flatRest(function (object, methodNames) { + arrayEach(methodNames, function (key) { + key = toKey(key); + baseAssignValue(object, key, bind(object[key], object)); + }); + return object; + }); + + function cond(pairs) { + var length = pairs == null ? 0 : pairs.length, + toIteratee = getIteratee(); + pairs = !length ? [] : arrayMap(pairs, function (pair) { + if (typeof pair[1] != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + + return [toIteratee(pair[0]), pair[1]]; + }); + return baseRest(function (args) { + var index = -1; + + while (++index < length) { + var pair = pairs[index]; + + if (apply(pair[0], this, args)) { + return apply(pair[1], this, args); + } + } + }); + } + + function conforms(source) { + return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); + } + + function constant(value) { + return function () { + return value; + }; + } + + function defaultTo(value, defaultValue) { + return value == null || value !== value ? defaultValue : value; + } + + var flow = createFlow(); + var flowRight = createFlow(true); + + function identity(value) { + return value; + } + + function iteratee(func) { + return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); + } + + function matches(source) { + return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); + } + + function matchesProperty(path, srcValue) { + return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); + } + + var method = baseRest(function (path, args) { + return function (object) { + return baseInvoke(object, path, args); + }; + }); + var methodOf = baseRest(function (object, args) { + return function (path) { + return baseInvoke(object, path, args); + }; + }); + + function mixin(object, source, options) { + var props = keys(source), + methodNames = baseFunctions(source, props); + + if (options == null && !(isObject(source) && (methodNames.length || !props.length))) { + options = source; + source = object; + object = this; + methodNames = baseFunctions(source, keys(source)); + } + + var chain = !(isObject(options) && 'chain' in options) || !!options.chain, + isFunc = isFunction(object); + arrayEach(methodNames, function (methodName) { + var func = source[methodName]; + object[methodName] = func; + + if (isFunc) { + object.prototype[methodName] = function () { + var chainAll = this.__chain__; + + if (chain || chainAll) { + var result = object(this.__wrapped__), + actions = result.__actions__ = copyArray(this.__actions__); + actions.push({ + 'func': func, + 'args': arguments, + 'thisArg': object + }); + result.__chain__ = chainAll; + return result; + } + + return func.apply(object, arrayPush([this.value()], arguments)); + }; + } + }); + return object; + } + + function noConflict() { + if (root._ === this) { + root._ = oldDash; + } + + return this; + } + + function noop() {} + + function nthArg(n) { + n = toInteger(n); + return baseRest(function (args) { + return baseNth(args, n); + }); + } + + var over = createOver(arrayMap); + var overEvery = createOver(arrayEvery); + var overSome = createOver(arraySome); + + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + } + + function propertyOf(object) { + return function (path) { + return object == null ? undefined : baseGet(object, path); + }; + } + + var range = createRange(); + var rangeRight = createRange(true); + + function stubArray() { + return []; + } + + function stubFalse() { + return false; + } + + function stubObject() { + return {}; + } + + function stubString() { + return ''; + } + + function stubTrue() { + return true; + } + + function times(n, iteratee) { + n = toInteger(n); + + if (n < 1 || n > MAX_SAFE_INTEGER) { + return []; + } + + var index = MAX_ARRAY_LENGTH, + length = nativeMin(n, MAX_ARRAY_LENGTH); + iteratee = getIteratee(iteratee); + n -= MAX_ARRAY_LENGTH; + var result = baseTimes(length, iteratee); + + while (++index < n) { + iteratee(index); + } + + return result; + } + + function toPath(value) { + if (isArray(value)) { + return arrayMap(value, toKey); + } + + return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); + } + + function uniqueId(prefix) { + var id = ++idCounter; + return toString(prefix) + id; + } + + var add = createMathOperation(function (augend, addend) { + return augend + addend; + }, 0); + var ceil = createRound('ceil'); + var divide = createMathOperation(function (dividend, divisor) { + return dividend / divisor; + }, 1); + var floor = createRound('floor'); + + function max(array) { + return array && array.length ? baseExtremum(array, identity, baseGt) : undefined; + } + + function maxBy(array, iteratee) { + return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined; + } + + function mean(array) { + return baseMean(array, identity); + } + + function meanBy(array, iteratee) { + return baseMean(array, getIteratee(iteratee, 2)); + } + + function min(array) { + return array && array.length ? baseExtremum(array, identity, baseLt) : undefined; + } + + function minBy(array, iteratee) { + return array && array.length ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined; + } + + var multiply = createMathOperation(function (multiplier, multiplicand) { + return multiplier * multiplicand; + }, 1); + var round = createRound('round'); + var subtract = createMathOperation(function (minuend, subtrahend) { + return minuend - subtrahend; + }, 0); + + function sum(array) { + return array && array.length ? baseSum(array, identity) : 0; + } + + function sumBy(array, iteratee) { + return array && array.length ? baseSum(array, getIteratee(iteratee, 2)) : 0; + } + + lodash.after = after; + lodash.ary = ary; + lodash.assign = assign; + lodash.assignIn = assignIn; + lodash.assignInWith = assignInWith; + lodash.assignWith = assignWith; + lodash.at = at; + lodash.before = before; + lodash.bind = bind; + lodash.bindAll = bindAll; + lodash.bindKey = bindKey; + lodash.castArray = castArray; + lodash.chain = chain; + lodash.chunk = chunk; + lodash.compact = compact; + lodash.concat = concat; + lodash.cond = cond; + lodash.conforms = conforms; + lodash.constant = constant; + lodash.countBy = countBy; + lodash.create = create; + lodash.curry = curry; + lodash.curryRight = curryRight; + lodash.debounce = debounce; + lodash.defaults = defaults; + lodash.defaultsDeep = defaultsDeep; + lodash.defer = defer; + lodash.delay = delay; + lodash.difference = difference; + lodash.differenceBy = differenceBy; + lodash.differenceWith = differenceWith; + lodash.drop = drop; + lodash.dropRight = dropRight; + lodash.dropRightWhile = dropRightWhile; + lodash.dropWhile = dropWhile; + lodash.fill = fill; + lodash.filter = filter; + lodash.flatMap = flatMap; + lodash.flatMapDeep = flatMapDeep; + lodash.flatMapDepth = flatMapDepth; + lodash.flatten = flatten; + lodash.flattenDeep = flattenDeep; + lodash.flattenDepth = flattenDepth; + lodash.flip = flip; + lodash.flow = flow; + lodash.flowRight = flowRight; + lodash.fromPairs = fromPairs; + lodash.functions = functions; + lodash.functionsIn = functionsIn; + lodash.groupBy = groupBy; + lodash.initial = initial; + lodash.intersection = intersection; + lodash.intersectionBy = intersectionBy; + lodash.intersectionWith = intersectionWith; + lodash.invert = invert; + lodash.invertBy = invertBy; + lodash.invokeMap = invokeMap; + lodash.iteratee = iteratee; + lodash.keyBy = keyBy; + lodash.keys = keys; + lodash.keysIn = keysIn; + lodash.map = map; + lodash.mapKeys = mapKeys; + lodash.mapValues = mapValues; + lodash.matches = matches; + lodash.matchesProperty = matchesProperty; + lodash.memoize = memoize; + lodash.merge = merge; + lodash.mergeWith = mergeWith; + lodash.method = method; + lodash.methodOf = methodOf; + lodash.mixin = mixin; + lodash.negate = negate; + lodash.nthArg = nthArg; + lodash.omit = omit; + lodash.omitBy = omitBy; + lodash.once = once; + lodash.orderBy = orderBy; + lodash.over = over; + lodash.overArgs = overArgs; + lodash.overEvery = overEvery; + lodash.overSome = overSome; + lodash.partial = partial; + lodash.partialRight = partialRight; + lodash.partition = partition; + lodash.pick = pick; + lodash.pickBy = pickBy; + lodash.property = property; + lodash.propertyOf = propertyOf; + lodash.pull = pull; + lodash.pullAll = pullAll; + lodash.pullAllBy = pullAllBy; + lodash.pullAllWith = pullAllWith; + lodash.pullAt = pullAt; + lodash.range = range; + lodash.rangeRight = rangeRight; + lodash.rearg = rearg; + lodash.reject = reject; + lodash.remove = remove; + lodash.rest = rest; + lodash.reverse = reverse; + lodash.sampleSize = sampleSize; + lodash.set = set; + lodash.setWith = setWith; + lodash.shuffle = shuffle; + lodash.slice = slice; + lodash.sortBy = sortBy; + lodash.sortedUniq = sortedUniq; + lodash.sortedUniqBy = sortedUniqBy; + lodash.split = split; + lodash.spread = spread; + lodash.tail = tail; + lodash.take = take; + lodash.takeRight = takeRight; + lodash.takeRightWhile = takeRightWhile; + lodash.takeWhile = takeWhile; + lodash.tap = tap; + lodash.throttle = throttle; + lodash.thru = thru; + lodash.toArray = toArray; + lodash.toPairs = toPairs; + lodash.toPairsIn = toPairsIn; + lodash.toPath = toPath; + lodash.toPlainObject = toPlainObject; + lodash.transform = transform; + lodash.unary = unary; + lodash.union = union; + lodash.unionBy = unionBy; + lodash.unionWith = unionWith; + lodash.uniq = uniq; + lodash.uniqBy = uniqBy; + lodash.uniqWith = uniqWith; + lodash.unset = unset; + lodash.unzip = unzip; + lodash.unzipWith = unzipWith; + lodash.update = update; + lodash.updateWith = updateWith; + lodash.values = values; + lodash.valuesIn = valuesIn; + lodash.without = without; + lodash.words = words; + lodash.wrap = wrap; + lodash.xor = xor; + lodash.xorBy = xorBy; + lodash.xorWith = xorWith; + lodash.zip = zip; + lodash.zipObject = zipObject; + lodash.zipObjectDeep = zipObjectDeep; + lodash.zipWith = zipWith; + lodash.entries = toPairs; + lodash.entriesIn = toPairsIn; + lodash.extend = assignIn; + lodash.extendWith = assignInWith; + mixin(lodash, lodash); + lodash.add = add; + lodash.attempt = attempt; + lodash.camelCase = camelCase; + lodash.capitalize = capitalize; + lodash.ceil = ceil; + lodash.clamp = clamp; + lodash.clone = clone; + lodash.cloneDeep = cloneDeep; + lodash.cloneDeepWith = cloneDeepWith; + lodash.cloneWith = cloneWith; + lodash.conformsTo = conformsTo; + lodash.deburr = deburr; + lodash.defaultTo = defaultTo; + lodash.divide = divide; + lodash.endsWith = endsWith; + lodash.eq = eq; + lodash.escape = escape; + lodash.escapeRegExp = escapeRegExp; + lodash.every = every; + lodash.find = find; + lodash.findIndex = findIndex; + lodash.findKey = findKey; + lodash.findLast = findLast; + lodash.findLastIndex = findLastIndex; + lodash.findLastKey = findLastKey; + lodash.floor = floor; + lodash.forEach = forEach; + lodash.forEachRight = forEachRight; + lodash.forIn = forIn; + lodash.forInRight = forInRight; + lodash.forOwn = forOwn; + lodash.forOwnRight = forOwnRight; + lodash.get = get; + lodash.gt = gt; + lodash.gte = gte; + lodash.has = has; + lodash.hasIn = hasIn; + lodash.head = head; + lodash.identity = identity; + lodash.includes = includes; + lodash.indexOf = indexOf; + lodash.inRange = inRange; + lodash.invoke = invoke; + lodash.isArguments = isArguments; + lodash.isArray = isArray; + lodash.isArrayBuffer = isArrayBuffer; + lodash.isArrayLike = isArrayLike; + lodash.isArrayLikeObject = isArrayLikeObject; + lodash.isBoolean = isBoolean; + lodash.isBuffer = isBuffer; + lodash.isDate = isDate; + lodash.isElement = isElement; + lodash.isEmpty = isEmpty; + lodash.isEqual = isEqual; + lodash.isEqualWith = isEqualWith; + lodash.isError = isError; + lodash.isFinite = isFinite; + lodash.isFunction = isFunction; + lodash.isInteger = isInteger; + lodash.isLength = isLength; + lodash.isMap = isMap; + lodash.isMatch = isMatch; + lodash.isMatchWith = isMatchWith; + lodash.isNaN = isNaN; + lodash.isNative = isNative; + lodash.isNil = isNil; + lodash.isNull = isNull; + lodash.isNumber = isNumber; + lodash.isObject = isObject; + lodash.isObjectLike = isObjectLike; + lodash.isPlainObject = isPlainObject; + lodash.isRegExp = isRegExp; + lodash.isSafeInteger = isSafeInteger; + lodash.isSet = isSet; + lodash.isString = isString; + lodash.isSymbol = isSymbol; + lodash.isTypedArray = isTypedArray; + lodash.isUndefined = isUndefined; + lodash.isWeakMap = isWeakMap; + lodash.isWeakSet = isWeakSet; + lodash.join = join; + lodash.kebabCase = kebabCase; + lodash.last = last; + lodash.lastIndexOf = lastIndexOf; + lodash.lowerCase = lowerCase; + lodash.lowerFirst = lowerFirst; + lodash.lt = lt; + lodash.lte = lte; + lodash.max = max; + lodash.maxBy = maxBy; + lodash.mean = mean; + lodash.meanBy = meanBy; + lodash.min = min; + lodash.minBy = minBy; + lodash.stubArray = stubArray; + lodash.stubFalse = stubFalse; + lodash.stubObject = stubObject; + lodash.stubString = stubString; + lodash.stubTrue = stubTrue; + lodash.multiply = multiply; + lodash.nth = nth; + lodash.noConflict = noConflict; + lodash.noop = noop; + lodash.now = now; + lodash.pad = pad; + lodash.padEnd = padEnd; + lodash.padStart = padStart; + lodash.parseInt = parseInt; + lodash.random = random; + lodash.reduce = reduce; + lodash.reduceRight = reduceRight; + lodash.repeat = repeat; + lodash.replace = replace; + lodash.result = result; + lodash.round = round; + lodash.runInContext = runInContext; + lodash.sample = sample; + lodash.size = size; + lodash.snakeCase = snakeCase; + lodash.some = some; + lodash.sortedIndex = sortedIndex; + lodash.sortedIndexBy = sortedIndexBy; + lodash.sortedIndexOf = sortedIndexOf; + lodash.sortedLastIndex = sortedLastIndex; + lodash.sortedLastIndexBy = sortedLastIndexBy; + lodash.sortedLastIndexOf = sortedLastIndexOf; + lodash.startCase = startCase; + lodash.startsWith = startsWith; + lodash.subtract = subtract; + lodash.sum = sum; + lodash.sumBy = sumBy; + lodash.template = template; + lodash.times = times; + lodash.toFinite = toFinite; + lodash.toInteger = toInteger; + lodash.toLength = toLength; + lodash.toLower = toLower; + lodash.toNumber = toNumber; + lodash.toSafeInteger = toSafeInteger; + lodash.toString = toString; + lodash.toUpper = toUpper; + lodash.trim = trim; + lodash.trimEnd = trimEnd; + lodash.trimStart = trimStart; + lodash.truncate = truncate; + lodash.unescape = unescape; + lodash.uniqueId = uniqueId; + lodash.upperCase = upperCase; + lodash.upperFirst = upperFirst; + lodash.each = forEach; + lodash.eachRight = forEachRight; + lodash.first = head; + mixin(lodash, function () { + var source = {}; + baseForOwn(lodash, function (func, methodName) { + if (!hasOwnProperty.call(lodash.prototype, methodName)) { + source[methodName] = func; + } + }); + return source; + }(), { + 'chain': false + }); + lodash.VERSION = VERSION; + arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function (methodName) { + lodash[methodName].placeholder = lodash; + }); + arrayEach(['drop', 'take'], function (methodName, index) { + LazyWrapper.prototype[methodName] = function (n) { + n = n === undefined ? 1 : nativeMax(toInteger(n), 0); + var result = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone(); + + if (result.__filtered__) { + result.__takeCount__ = nativeMin(n, result.__takeCount__); + } else { + result.__views__.push({ + 'size': nativeMin(n, MAX_ARRAY_LENGTH), + 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') + }); + } + + return result; + }; + + LazyWrapper.prototype[methodName + 'Right'] = function (n) { + return this.reverse()[methodName](n).reverse(); + }; + }); + arrayEach(['filter', 'map', 'takeWhile'], function (methodName, index) { + var type = index + 1, + isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; + + LazyWrapper.prototype[methodName] = function (iteratee) { + var result = this.clone(); + + result.__iteratees__.push({ + 'iteratee': getIteratee(iteratee, 3), + 'type': type + }); + + result.__filtered__ = result.__filtered__ || isFilter; + return result; + }; + }); + arrayEach(['head', 'last'], function (methodName, index) { + var takeName = 'take' + (index ? 'Right' : ''); + + LazyWrapper.prototype[methodName] = function () { + return this[takeName](1).value()[0]; + }; + }); + arrayEach(['initial', 'tail'], function (methodName, index) { + var dropName = 'drop' + (index ? '' : 'Right'); + + LazyWrapper.prototype[methodName] = function () { + return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); + }; + }); + + LazyWrapper.prototype.compact = function () { + return this.filter(identity); + }; + + LazyWrapper.prototype.find = function (predicate) { + return this.filter(predicate).head(); + }; + + LazyWrapper.prototype.findLast = function (predicate) { + return this.reverse().find(predicate); + }; + + LazyWrapper.prototype.invokeMap = baseRest(function (path, args) { + if (typeof path == 'function') { + return new LazyWrapper(this); + } + + return this.map(function (value) { + return baseInvoke(value, path, args); + }); + }); + + LazyWrapper.prototype.reject = function (predicate) { + return this.filter(negate(getIteratee(predicate))); + }; + + LazyWrapper.prototype.slice = function (start, end) { + start = toInteger(start); + var result = this; + + if (result.__filtered__ && (start > 0 || end < 0)) { + return new LazyWrapper(result); + } + + if (start < 0) { + result = result.takeRight(-start); + } else if (start) { + result = result.drop(start); + } + + if (end !== undefined) { + end = toInteger(end); + result = end < 0 ? result.dropRight(-end) : result.take(end - start); + } + + return result; + }; + + LazyWrapper.prototype.takeRightWhile = function (predicate) { + return this.reverse().takeWhile(predicate).reverse(); + }; + + LazyWrapper.prototype.toArray = function () { + return this.take(MAX_ARRAY_LENGTH); + }; + + baseForOwn(LazyWrapper.prototype, function (func, methodName) { + var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), + isTaker = /^(?:head|last)$/.test(methodName), + lodashFunc = lodash[isTaker ? 'take' + (methodName == 'last' ? 'Right' : '') : methodName], + retUnwrapped = isTaker || /^find/.test(methodName); + + if (!lodashFunc) { + return; + } + + lodash.prototype[methodName] = function () { + var value = this.__wrapped__, + args = isTaker ? [1] : arguments, + isLazy = value instanceof LazyWrapper, + iteratee = args[0], + useLazy = isLazy || isArray(value); + + var interceptor = function interceptor(value) { + var result = lodashFunc.apply(lodash, arrayPush([value], args)); + return isTaker && chainAll ? result[0] : result; + }; + + if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { + isLazy = useLazy = false; + } + + var chainAll = this.__chain__, + isHybrid = !!this.__actions__.length, + isUnwrapped = retUnwrapped && !chainAll, + onlyLazy = isLazy && !isHybrid; + + if (!retUnwrapped && useLazy) { + value = onlyLazy ? value : new LazyWrapper(this); + var result = func.apply(value, args); + + result.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + + return new LodashWrapper(result, chainAll); + } + + if (isUnwrapped && onlyLazy) { + return func.apply(this, args); + } + + result = this.thru(interceptor); + return isUnwrapped ? isTaker ? result.value()[0] : result.value() : result; + }; + }); + arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function (methodName) { + var func = arrayProto[methodName], + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|shift)$/.test(methodName); + + lodash.prototype[methodName] = function () { + var args = arguments; + + if (retUnwrapped && !this.__chain__) { + var value = this.value(); + return func.apply(isArray(value) ? value : [], args); + } + + return this[chainName](function (value) { + return func.apply(isArray(value) ? value : [], args); + }); + }; + }); + baseForOwn(LazyWrapper.prototype, function (func, methodName) { + var lodashFunc = lodash[methodName]; + + if (lodashFunc) { + var key = lodashFunc.name + ''; + + if (!hasOwnProperty.call(realNames, key)) { + realNames[key] = []; + } + + realNames[key].push({ + 'name': methodName, + 'func': lodashFunc + }); + } + }); + realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ + 'name': 'wrapper', + 'func': undefined + }]; + LazyWrapper.prototype.clone = lazyClone; + LazyWrapper.prototype.reverse = lazyReverse; + LazyWrapper.prototype.value = lazyValue; + lodash.prototype.at = wrapperAt; + lodash.prototype.chain = wrapperChain; + lodash.prototype.commit = wrapperCommit; + lodash.prototype.next = wrapperNext; + lodash.prototype.plant = wrapperPlant; + lodash.prototype.reverse = wrapperReverse; + lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + lodash.prototype.first = lodash.prototype.head; + + if (symIterator) { + lodash.prototype[symIterator] = wrapperToIterator; + } + + return lodash; + }; + + var _ = runInContext(); + + if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + root._ = _; + define(function () { + return _; + }); + } else if (freeModule) { + (freeModule.exports = _)._ = _; + freeExports._ = _; + } else { + root._ = _; + } + }).call(this); +},507,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + + function actionViewIntent(path) { + var mime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'text/plain'; + if (_reactNative.Platform.OS === 'android') return RNFetchBlob.actionViewIntent(path, mime);else return Promise.reject('RNFetchBlob.android.actionViewIntent only supports Android.'); + } + + function getContentIntent(mime) { + if (_reactNative.Platform.OS === 'android') return RNFetchBlob.getContentIntent(mime);else return Promise.reject('RNFetchBlob.android.getContentIntent only supports Android.'); + } + + function addCompleteDownload(config) { + if (_reactNative.Platform.OS === 'android') return RNFetchBlob.addCompleteDownload(config);else return Promise.reject('RNFetchBlob.android.addCompleteDownload only supports Android.'); + } + + function getSDCardDir() { + if (_reactNative.Platform.OS === 'android') return RNFetchBlob.getSDCardDir();else return Promise.reject('RNFetchBlob.android.getSDCardDir only supports Android.'); + } + + function getSDCardApplicationDir() { + if (_reactNative.Platform.OS === 'android') return RNFetchBlob.getSDCardApplicationDir();else return Promise.reject('RNFetchBlob.android.getSDCardApplicationDir only supports Android.'); + } + + var _default = { + actionViewIntent: actionViewIntent, + getContentIntent: getContentIntent, + addCompleteDownload: addCompleteDownload, + getSDCardDir: getSDCardDir, + getSDCardApplicationDir: getSDCardApplicationDir + }; + exports.default = _default; +},508,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNFetchBlob = _reactNative.NativeModules.RNFetchBlob; + + function previewDocument(path, scheme) { + if (_reactNative.Platform.OS === 'ios') return RNFetchBlob.previewDocument('file://' + path, scheme);else return Promise.reject('RNFetchBlob.openDocument only supports IOS.'); + } + + function openDocument(path, scheme) { + if (_reactNative.Platform.OS === 'ios') return RNFetchBlob.openDocument('file://' + path, scheme);else return Promise.reject('RNFetchBlob.previewDocument only supports IOS.'); + } + + function excludeFromBackupKey(path) { + return RNFetchBlob.excludeFromBackupKey('file://' + path); + } + + var _default = { + openDocument: openDocument, + previewDocument: previewDocument, + excludeFromBackupKey: excludeFromBackupKey + }; + exports.default = _default; +},509,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _oboeBrowserMin = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _XMLHttpRequest = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _uri = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var OboeExtended = function OboeExtended(arg) { + window.location = ''; + + if (!window.XMLHttpRequest.isRNFBPolyfill) { + window.XMLHttpRequest = _XMLHttpRequest.default; + console.warn("Use JSONStream will automatically replace window.XMLHttpRequest with RNFetchBlob.polyfill.XMLHttpRequest. You are seeing this warning because you did not replace it manually."); + } + + if (typeof arg === 'string') { + if (_uri.default.isFileURI(arg)) { + arg = { + url: 'JSONStream://' + arg, + headers: { + noCache: true + } + }; + } else arg = 'JSONStream://' + arg; + } else if (typeof arg === 'object') { + var headers = arg.headers || {}; + + if (_uri.default.isFileURI(arg.url)) { + headers.noCache = true; + } + + arg = (0, _extends2.default)(arg, { + url: 'JSONStream://' + arg.url, + headers: headers + }); + } + + return (0, _oboeBrowserMin.default)(arg); + }; + + var _default = OboeExtended; + exports.default = _default; +},510,[5,6,511,500,488]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + !function (a, b, c, d, e, f) { + function g(a, b) { + return function () { + return a.call(this, b.apply(this, arguments)); + }; + } + + function h(a) { + return function (b) { + return b[a]; + }; + } + + function i(a, b) { + return b.apply(f, a); + } + + function j(a) { + var b = a.length - 1, + d = c.prototype.slice; + if (0 == b) return function () { + return a.call(this, d.call(arguments)); + }; + if (1 == b) return function () { + return a.call(this, arguments[0], d.call(arguments, 1)); + }; + var e = c(a.length); + return function () { + for (var c = 0; b > c; c++) { + e[c] = arguments[c]; + } + + return e[b] = d.call(arguments, b), a.apply(this, e); + }; + } + + function k(a) { + return function (b, c) { + return a(c, b); + }; + } + + function l(a, b) { + return function (c) { + return a(c) && b(c); + }; + } + + function m() {} + + function n() { + return true; + } + + function o(a) { + return function () { + return a; + }; + } + + function p(a, b) { + return b && b.constructor === a; + } + + function q(a) { + return a !== f; + } + + function r(a, c) { + return c instanceof b && y(function (a) { + return a in c; + }, a); + } + + function s(a, b) { + return [a, b]; + } + + function t(a) { + return A(a.reduce(k(s), X)); + } + + function u(a) { + return w(function (a, b) { + return a.unshift(b), a; + }, [], a); + } + + function v(a, b) { + return b ? s(a(Y(b)), v(a, Z(b))) : X; + } + + function w(a, b, c) { + return c ? a(w(a, b, Z(c)), Y(c)) : b; + } + + function x(a, b, c) { + function d(a, c) { + return a ? b(Y(a)) ? (c(Y(a)), Z(a)) : s(Y(a), d(Z(a), c)) : X; + } + + return d(a, c || m); + } + + function y(a, b) { + return !b || a(Y(b)) && y(a, Z(b)); + } + + function z(a, b) { + a && (Y(a).apply(null, b), z(Z(a), b)); + } + + function A(a) { + function b(a, c) { + return a ? b(Z(a), s(Y(a), c)) : c; + } + + return b(a, X); + } + + function B(a, b) { + return b && (a(Y(b)) ? Y(b) : B(a, Z(b))); + } + + function C(a) { + "use strict"; + + function b() { + var a = 0; + P.length > p && (c("Max buffer length exceeded: textNode"), a = Math.max(a, P.length)), Q.length > p && (c("Max buffer length exceeded: numberNode"), a = Math.max(a, Q.length)), O = p - a + Y; + } + + function c(a) { + P && (m(P), n(), P = ""), i = d(a + "\nLn: " + $ + "\nCol: " + Z + "\nChr: " + j), o(N(f, f, i)); + } + + function e() { + return T == s ? (m({}), n(), void (S = true)) : ((T !== t || 0 !== X) && c("Unexpected end"), P && (m(P), n(), P = ""), void (S = true)); + } + + function g(a) { + return "\r" == a || "\n" == a || " " == a || " " == a; + } + + function h(a) { + if (!i) { + if (S) return c("Cannot write after close"); + var d = 0; + + for (j = a[0]; j && (k = j, j = a[d++]);) { + switch (Y++, "\n" == j ? ($++, Z = 0) : Z++, T) { + case s: + if ("{" === j) T = u;else if ("[" === j) T = w;else if (!g(j)) return c("Non-whitespace before {[."); + continue; + + case z: + case u: + if (g(j)) continue; + if (T === z) U.push(A);else { + if ("}" === j) { + m({}), n(), T = U.pop() || t; + continue; + } + + U.push(v); + } + if ('"' !== j) return c('Malformed object key should start with " '); + T = y; + continue; + + case A: + case v: + if (g(j)) continue; + if (":" === j) T === v ? (U.push(v), P && (m({}), l(P), P = ""), X++) : P && (l(P), P = ""), T = t;else if ("}" === j) P && (m(P), n(), P = ""), n(), X--, T = U.pop() || t;else { + if ("," !== j) return c("Bad object"); + T === v && U.push(v), P && (m(P), n(), P = ""), T = z; + } + continue; + + case w: + case t: + if (g(j)) continue; + + if (T === w) { + if (m([]), X++, T = t, "]" === j) { + n(), X--, T = U.pop() || t; + continue; + } + + U.push(x); + } + + if ('"' === j) T = y;else if ("{" === j) T = u;else if ("[" === j) T = w;else if ("t" === j) T = B;else if ("f" === j) T = E;else if ("n" === j) T = I;else if ("-" === j) Q += j;else if ("0" === j) Q += j, T = M;else { + if (-1 === "123456789".indexOf(j)) return c("Bad value"); + Q += j, T = M; + } + continue; + + case x: + if ("," === j) U.push(x), P && (m(P), n(), P = ""), T = t;else { + if ("]" !== j) { + if (g(j)) continue; + return c("Bad array"); + } + + P && (m(P), n(), P = ""), n(), X--, T = U.pop() || t; + } + continue; + + case y: + var e = d - 1; + + a: for (;;) { + for (; W > 0;) { + if (V += j, j = a.charAt(d++), 4 === W ? (P += String.fromCharCode(parseInt(V, 16)), W = 0, e = d - 1) : W++, !j) break a; + } + + if ('"' === j && !R) { + T = U.pop() || t, P += a.substring(e, d - 1), P || (m(""), n()); + break; + } + + if ("\\" === j && !R && (R = true, P += a.substring(e, d - 1), j = a.charAt(d++), !j)) break; + + if (R) { + if (R = false, "n" === j ? P += "\n" : "r" === j ? P += "\r" : "t" === j ? P += " " : "f" === j ? P += "\f" : "b" === j ? P += "\b" : "u" === j ? (W = 1, V = "") : P += j, j = a.charAt(d++), e = d - 1, j) continue; + break; + } + + q.lastIndex = d; + var f = q.exec(a); + + if (!f) { + d = a.length + 1, P += a.substring(e, d - 1); + break; + } + + if (d = f.index + 1, j = a.charAt(f.index), !j) { + P += a.substring(e, d - 1); + break; + } + } + + continue; + + case B: + if (!j) continue; + if ("r" !== j) return c("Invalid true started with t" + j); + T = C; + continue; + + case C: + if (!j) continue; + if ("u" !== j) return c("Invalid true started with tr" + j); + T = D; + continue; + + case D: + if (!j) continue; + if ("e" !== j) return c("Invalid true started with tru" + j); + m(true), n(), T = U.pop() || t; + continue; + + case E: + if (!j) continue; + if ("a" !== j) return c("Invalid false started with f" + j); + T = F; + continue; + + case F: + if (!j) continue; + if ("l" !== j) return c("Invalid false started with fa" + j); + T = G; + continue; + + case G: + if (!j) continue; + if ("s" !== j) return c("Invalid false started with fal" + j); + T = H; + continue; + + case H: + if (!j) continue; + if ("e" !== j) return c("Invalid false started with fals" + j); + m(false), n(), T = U.pop() || t; + continue; + + case I: + if (!j) continue; + if ("u" !== j) return c("Invalid null started with n" + j); + T = J; + continue; + + case J: + if (!j) continue; + if ("l" !== j) return c("Invalid null started with nu" + j); + T = K; + continue; + + case K: + if (!j) continue; + if ("l" !== j) return c("Invalid null started with nul" + j); + m(null), n(), T = U.pop() || t; + continue; + + case L: + if ("." !== j) return c("Leading zero not followed by ."); + Q += j, T = M; + continue; + + case M: + if (-1 !== "0123456789".indexOf(j)) Q += j;else if ("." === j) { + if (-1 !== Q.indexOf(".")) return c("Invalid number has two dots"); + Q += j; + } else if ("e" === j || "E" === j) { + if (-1 !== Q.indexOf("e") || -1 !== Q.indexOf("E")) return c("Invalid number has two exponential"); + Q += j; + } else if ("+" === j || "-" === j) { + if ("e" !== k && "E" !== k) return c("Invalid symbol in number"); + Q += j; + } else Q && (m(parseFloat(Q)), n(), Q = ""), d--, T = U.pop() || t; + continue; + + default: + return c("Unknown state: " + T); + } + } + + Y >= O && b(); + } + } + + var i, + j, + k, + l = a(qb).emit, + m = a(rb).emit, + n = a(sb).emit, + o = a(jb).emit, + p = 65536, + q = /[\\"\n]/g, + r = 0, + s = r++, + t = r++, + u = r++, + v = r++, + w = r++, + x = r++, + y = r++, + z = r++, + A = r++, + B = r++, + C = r++, + D = r++, + E = r++, + F = r++, + G = r++, + H = r++, + I = r++, + J = r++, + K = r++, + L = r++, + M = r, + O = p, + P = "", + Q = "", + R = false, + S = false, + T = s, + U = [], + V = null, + W = 0, + X = 0, + Y = 0, + Z = 0, + $ = 1; + a(nb).on(h), a(ob).on(e); + } + + function D(a, b) { + "use strict"; + + function c(a) { + return function (b) { + d = a(d, b); + }; + } + + var d, + e = {}; + + for (var f in b) { + a(f).on(c(b[f]), e); + } + + a(hb).on(function (a) { + var b, + c = Y(d), + e = ab(c), + f = Z(d); + f && (b = bb(Y(f)), b[e] = a); + }), a(ib).on(function () { + var a, + b = Y(d), + c = ab(b), + e = Z(d); + e && (a = bb(Y(e)), delete a[c]); + }), a(pb).on(function () { + for (var c in b) { + a(c).un(e); + } + }); + } + + function E(a) { + var b = {}; + return a && a.split("\r\n").forEach(function (a) { + var c = a.indexOf(": "); + b[a.substring(0, c)] = a.substring(c + 2); + }), b; + } + + function F(a, b) { + function c(a) { + return { + "http:": 80, + "https:": 443 + }[a]; + } + + function d(b) { + return b.port || c(b.protocol || a.protocol); + } + + return !!(b.protocol && b.protocol != a.protocol || b.host && b.host != a.host || b.host && d(b) != d(a)); + } + + function G(a) { + var b = /(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/, + c = b.exec(a) || []; + return { + protocol: c[1] || "", + host: c[2] || "", + port: c[3] || "" + }; + } + + function H() { + return new XMLHttpRequest(); + } + + function I(b, c, d, e, g, h, i) { + "use strict"; + + function j() { + var a = c.responseText, + b = a.substr(m); + b && k(b), m = V(a); + } + + var k = b(nb).emit, + l = b(jb).emit, + m = 0, + n = true; + b(pb).on(function () { + c.onreadystatechange = null, c.abort(); + }), "onprogress" in c && (c.onprogress = j), c.onreadystatechange = function () { + function a() { + try { + n && b(mb).emit(c.status, E(c.getAllResponseHeaders())), n = false; + } catch (a) {} + } + + switch (c.readyState) { + case 2: + case 3: + return a(); + + case 4: + a(); + var d = 2 == String(c.status)[0]; + d ? (j(), b(ob).emit()) : l(N(c.status, c.responseText)); + } + }; + + try { + c.open(d, e, true); + + for (var o in h) { + c.setRequestHeader(o, h[o]); + } + + F(a.location, G(e)) || c.setRequestHeader("X-Requested-With", "XMLHttpRequest"), c.withCredentials = i, c.send(g); + } catch (p) { + a.setTimeout(T(l, N(f, f, p)), 0); + } + } + + function J(a, b) { + return { + key: a, + node: b + }; + } + + function K(a) { + function b(a, b) { + var d = bb(Y(a)); + return p(c, d) ? f(a, V(d), b) : a; + } + + function d(a, c) { + if (!a) return j(c), f(a, cb, c); + var d = b(a, c), + g = Z(d), + h = ab(Y(d)); + return e(g, h, c), s(J(h, c), g); + } + + function e(a, b, c) { + bb(Y(a))[b] = c; + } + + function f(a, b, c) { + a && e(a, b, c); + var d = s(J(b, c), a); + return h(d), d; + } + + function g(a) { + return i(a), Z(a) || k(bb(Y(a))); + } + + var h = a(fb).emit, + i = a(gb).emit, + j = a(lb).emit, + k = a(kb).emit, + l = {}; + return l[rb] = d, l[sb] = g, l[qb] = f, l; + } + + function L(a, b, c) { + function d(a) { + return function (b) { + return b.id == a; + }; + } + + var e, f; + return { + on: function on(c, d) { + var g = { + listener: c, + id: d || c + }; + return b && b.emit(a, c, g.id), e = s(g, e), f = s(c, f), this; + }, + emit: function emit() { + z(f, arguments); + }, + un: function un(b) { + var g; + e = x(e, d(b), function (a) { + g = a; + }), g && (f = x(f, function (a) { + return a == g.listener; + }), c && c.emit(a, g.listener, g.id)); + }, + listeners: function listeners() { + return f; + }, + hasListener: function hasListener(a) { + var b = a ? d(a) : n; + return q(B(b, e)); + } + }; + } + + function M() { + function a(a) { + return c[a] = L(a, d, e); + } + + function b(b) { + return c[b] || a(b); + } + + var c = {}, + d = a("newListener"), + e = a("removeListener"); + return ["emit", "on", "un"].forEach(function (a) { + b[a] = j(function (c, d) { + i(d, b(c)[a]); + }); + }), b; + } + + function N(a, b, c) { + try { + var d = e.parse(b); + } catch (f) {} + + return { + statusCode: a, + body: b, + jsonBody: d, + thrown: c + }; + } + + function O(a, b) { + function c(a, b, c) { + var d = A(c); + a(b, u(Z(v(ab, d))), u(v(bb, d))); + } + + function d(b, d, e) { + var f = a(b).emit; + d.on(function (a) { + var b = e(a); + b !== false && c(f, bb(b), a); + }, b), a("removeListener").on(function (c) { + c == b && (a(c).listeners() || d.un(b)); + }); + } + + var e = { + node: a(gb), + path: a(fb) + }; + a("newListener").on(function (a) { + var c = /(node|path):(.*)/.exec(a); + + if (c) { + var f = e[c[1]]; + f.hasListener(a) || d(a, f, b(c[2])); + } + }); + } + + function P(a, b) { + function c(b, c) { + return a(b).on(e(c), c), p; + } + + function d(a, b, c) { + c = c || b; + var d = e(b); + return a.on(function () { + var b = false; + p.forget = function () { + b = true; + }, i(arguments, d), delete p.forget, b && a.un(c); + }, c), p; + } + + function e(b) { + return function () { + try { + return b.apply(p, arguments); + } catch (c) { + a(jb).emit(N(f, f, c)); + } + }; + } + + function g(b, c) { + return a(b + ":" + c); + } + + function h(a) { + return function () { + var b = a.apply(this, arguments); + q(b) && (b == S.drop ? t() : u(b)); + }; + } + + function k(a, b, c) { + var e; + e = "node" == a ? h(c) : c, d(g(a, b), e, c); + } + + function l(a, b) { + for (var c in b) { + k(a, c, b[c]); + } + } + + function n(a, b, c) { + return W(b) ? k(a, b, c) : l(a, b), p; + } + + var p, + r = /^(node|path):./, + s = a(kb), + t = a(ib).emit, + u = a(hb).emit, + v = j(function (b, c) { + if (p[b]) i(c, p[b]);else { + var e = a(b), + f = c[0]; + r.test(b) ? d(e, f) : e.on(f); + } + return p; + }), + w = function w(b, c, d) { + if ("done" == b) s.un(c);else if ("node" == b || "path" == b) a.un(b + ":" + c, d);else { + var e = c; + a(b).un(e); + } + return p; + }; + + return a(lb).on(function (a) { + p.root = o(a); + }), a(mb).on(function (a, b) { + p.header = function (a) { + return a ? b[a] : b; + }; + }), p = { + on: v, + addListener: v, + removeListener: w, + emit: a.emit, + node: T(n, "node"), + path: T(n, "path"), + done: T(d, s), + start: T(c, mb), + fail: a(jb).on, + abort: a(pb).emit, + header: m, + root: m, + source: b + }; + } + + function Q(a, b, c, d, e) { + var f = M(); + return b && I(f, H(), a, b, c, d, e), C(f), D(f, K(f)), O(f, db), P(f, b); + } + + function R(a, b, c, d, f, g, h) { + function i(a, b) { + return b === false && (a += -1 == a.indexOf("?") ? "?" : "&", a += "_=" + new Date().getTime()), a; + } + + return f = f ? e.parse(e.stringify(f)) : {}, d ? W(d) || (d = e.stringify(d), f["Content-Type"] = f["Content-Type"] || "application/json") : d = null, a(c || "GET", i(b, h), d, f, g || false); + } + + function S(a) { + var b = $("resume", "pause", "pipe"), + c = T(r, b); + return a ? c(a) || W(a) ? R(Q, a) : R(Q, a.url, a.method, a.body, a.headers, a.withCredentials, a.cached) : Q(); + } + + var T = j(function (a, b) { + var c = b.length; + return j(function (d) { + for (var e = 0; e < d.length; e++) { + b[c + e] = d[e]; + } + + return b.length = c + d.length, a.apply(this, b); + }); + }), + U = (j(function (a) { + function b(a, b) { + return [i(a, b)]; + } + + var c = t(a); + return j(function (a) { + return w(b, a, c)[0]; + }); + }), j(function (a) { + return j(function (b) { + for (var c, d = 0; d < V(a); d++) { + if (c = i(b, a[d])) return c; + } + }); + })), + V = h("length"), + W = T(p, String), + X = null, + Y = h(0), + Z = h(1), + $ = j(t), + _ = function () { + var a = function a(_a) { + return _a.exec.bind(_a); + }, + b = j(function (b) { + return b.unshift(/^/), a(RegExp(b.map(h("source")).join(""))); + }), + c = /(\$?)/, + d = /([\w-_]+|\*)/, + e = /()/, + f = /\["([^"]+)"\]/, + g = /\[(\d+|\*)\]/, + i = /{([\w ]*?)}/, + k = /(?:{([\w ]*?)})?/, + l = b(c, d, k), + m = b(c, f, k), + n = b(c, g, k), + o = b(c, e, i), + p = b(/\.\./), + q = b(/\./), + r = b(c, /!/), + s = b(/$/); + + return function (a) { + return a(U(l, m, n, o), p, q, r, s); + }; + }(), + ab = h("key"), + bb = h("node"), + cb = {}, + db = _(function (a, b, c, e, f) { + function h(a, b) { + var c = b[z], + d = c && "*" != c ? function (a) { + return B(a) == c; + } : n; + return l(d, a); + } + + function i(a, b) { + var c = b[A]; + if (!c) return a; + var d = T(r, t(c.split(/\W+/))), + e = g(d, C); + return l(e, a); + } + + function j(a, b) { + var c = !!b[y]; + return c ? l(a, Y) : a; + } + + function k(a) { + function b(a) { + return B(a) != cb; + } + + return a == n ? n : l(b, g(a, Z)); + } + + function m(a) { + if (a == n) return n; + var b = o(), + c = a, + d = k(function (a) { + return e(a); + }), + e = U(b, c, d); + return e; + } + + function o() { + return function (a) { + return B(a) == cb; + }; + } + + function p(a) { + return function (b) { + var c = a(b); + return c === true ? Y(b) : c; + }; + } + + function q(a, b, c) { + return w(function (a, b) { + return b(a, c); + }, b, a); + } + + function s(a, b, c, d, e) { + var f = a(c); + + if (f) { + var g = q(b, d, f), + h = c.substr(V(f[0])); + return e(h, g); + } + } + + function u(a, b) { + return T(s, a, b); + } + + function v(a, b) { + return b; + } + + function x(a, b) { + var c = a ? x : v; + return D(a, b, c); + } + + var y = 1, + z = 2, + A = 3, + B = g(ab, Y), + C = g(bb, Y), + D = U(u(a, $(j, i, h, k)), u(b, $(m)), u(c, $()), u(e, $(j, o)), u(f, $(p)), function (a) { + throw d('"' + a + '" could not be tokenised'); + }); + return function (a) { + try { + return x(a, n); + } catch (b) { + throw d('Could not compile "' + a + '" because ' + b.message); + } + }; + }), + eb = 1, + fb = eb++, + gb = eb++, + hb = eb++, + ib = eb++, + jb = "fail", + kb = eb++, + lb = eb++, + mb = "start", + nb = "data", + ob = "end", + pb = eb++, + qb = eb++, + rb = eb++, + sb = eb++; + + S.drop = function () { + return S.drop; + }, "function" == typeof define && define.amd ? define("oboe", [], function () { + return S; + }) : "object" == typeof exports ? module.exports = S : a.oboe = S; + }(function () { + try { + return window; + } catch (a) { + return self; + } + }(), Object, Array, Error, JSON); +},511,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.NativeModules.RNPrint; + exports.default = _default; +},512,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.ImageFormat = exports.TextBackgroundType = exports.Position = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var resolveAssetSource = _reactNative.Image.resolveAssetSource; + var LINKING_ERROR = "The package 'react-native-image-marker' doesn't seem to be linked. Make sure: \n\n" + _reactNative.Platform.select({ + ios: "- You have run 'pod install'\n", + default: '' + }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n'; + var Position; + exports.Position = Position; + + (function (Position) { + Position["topLeft"] = "topLeft"; + Position["topCenter"] = "topCenter"; + Position["topRight"] = "topRight"; + Position["bottomLeft"] = "bottomLeft"; + Position["bottomCenter"] = "bottomCenter"; + Position["bottomRight"] = "bottomRight"; + Position["center"] = "center"; + })(Position || (exports.Position = Position = {})); + + var TextBackgroundType; + exports.TextBackgroundType = TextBackgroundType; + + (function (TextBackgroundType) { + TextBackgroundType["stretchX"] = "stretchX"; + TextBackgroundType["stretchY"] = "stretchY"; + TextBackgroundType["none"] = ""; + })(TextBackgroundType || (exports.TextBackgroundType = TextBackgroundType = {})); + + var ImageFormat; + exports.ImageFormat = ImageFormat; + + (function (ImageFormat) { + ImageFormat["png"] = "png"; + ImageFormat["jpg"] = "jpg"; + ImageFormat["base64"] = "base64"; + })(ImageFormat || (exports.ImageFormat = ImageFormat = {})); + + var ImageMarker = _reactNative.NativeModules.ImageMarker ? _reactNative.NativeModules.ImageMarker : new Proxy({}, { + get: function get() { + throw new Error(LINKING_ERROR); + } + }); + + var Marker = function () { + function Marker() { + (0, _classCallCheck2.default)(this, Marker); + } + + (0, _createClass2.default)(Marker, null, [{ + key: "markText", + value: function markText(options) { + var src = options.src, + position = options.position; + + if (!src) { + throw new Error('please set image!'); + } + + var srcObj = resolveAssetSource(src); + + if (!srcObj) { + srcObj = { + uri: src, + __packager_asset: false + }; + } + + options.src = srcObj; + options.maxSize = options.maxSize || 2048; + + if (!position) { + return ImageMarker.addText(options); + } else { + return ImageMarker.addTextByPosition(options); + } + } + }, { + key: "markImage", + value: function markImage(options) { + var src = options.src, + markerSrc = options.markerSrc, + position = options.position; + + if (!src) { + throw new Error('please set image!'); + } + + if (!markerSrc) { + throw new Error('please set mark image!'); + } + + var srcObj = resolveAssetSource(src); + + if (!srcObj) { + srcObj = { + uri: src, + __packager_asset: false + }; + } + + var markerObj = resolveAssetSource(markerSrc); + + if (!markerObj) { + markerObj = { + uri: markerSrc, + __packager_asset: false + }; + } + + options.markerSrc = markerObj; + options.src = srcObj; + options.maxSize = options.maxSize || 2048; + + if (!position) { + return ImageMarker.markWithImage(options); + } else { + return ImageMarker.markWithImageByPosition(options); + } + } + }]); + return Marker; + }(); + + exports.default = Marker; +},513,[5,7,8,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _defineProperty2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends3 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _md = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNativeTextSize = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _colorUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _jsUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var StringUtils = function () { + function StringUtils() { + (0, _classCallCheck2.default)(this, StringUtils); + } + + (0, _createClass2.default)(StringUtils, null, [{ + key: "isOpenUrl", + value: function isOpenUrl(str) { + return !!str.match(StringUtils.REGEX_OPEN_URL); + } + }, { + key: "isFeedId", + value: function isFeedId(str) { + return !!str.match(StringUtils.REGEX_FEED_ID); + } + }, { + key: "isMD5", + value: function isMD5(str) { + return !!str.match(StringUtils.REGEX_MD5); + } + }, { + key: "isUrl", + value: function isUrl(url) { + return url ? !!url.match(StringUtils.REGEX_URL) : false; + } + }, { + key: "getHexOfAsciiOfLong", + value: function getHexOfAsciiOfLong(value) { + var result = ""; + + try { + var ascii = value.toString(); + + for (var i = 0; i < ascii.length; i++) { + result += ascii.charCodeAt(i).toString(16); + } + } catch (e) {} + + return result; + } + }, { + key: "getMd5", + value: function getMd5(str) { + return (0, _md.default)(str); + } + }, { + key: "sizeToString", + value: function sizeToString(size) { + var result = "0 Kb"; + + if (size) { + if (size / StringUtils.GIGA > 1) { + result = (size / StringUtils.GIGA).toFixed(1) + " GB"; + } else if (size / StringUtils.MEGA > 1) { + result = (size / StringUtils.MEGA).toFixed(1) + " MB"; + } else if (size / StringUtils.KILO > 1) { + result = (size / StringUtils.KILO).toFixed(1) + " kB"; + } else { + result = size + " B"; + } + } + + return result; + } + }, { + key: "getFilenameFromHeader", + value: function getFilenameFromHeader(header) { + if (header) { + var regex = /.*filename="(.*)"/; + var m = regex.exec(header); + + if (m) { + return m[1]; + } + } + + return ""; + } + }, { + key: "getUrlInfo", + value: function getUrlInfo(url) { + if (url) { + var regex = /^(?:([a-z]*):\/\/)?([^\/?#]*)\/?([^?#]*\/?)?[?]?([^#]*)?[#]?(.*)?/g; + var m = regex.exec(url); + + if (m) { + var protocol = m[1] || ""; + var domain = m[2] || ""; + var gets = m[4] || ""; + var anchor = m[5] || ""; + var path = m[3] || ""; + var file = ""; + + if (path) { + var lastPathSegment = StringUtils.getLastPathSegment(path); + + if (lastPathSegment && lastPathSegment.match(/.+\..+/g)) { + file = lastPathSegment; + } + } + + return { + protocol: protocol, + domain: domain, + path: path, + file: file, + gets: gets, + anchor: anchor + }; + } + } + + return { + protocol: "", + domain: "", + path: "", + file: "", + gets: "" + }; + } + }, { + key: "isDomainValid", + value: function isDomainValid(url) { + var _StringUtils$getUrlIn = StringUtils.getUrlInfo(url), + domain = _StringUtils$getUrlIn.domain, + protocol = _StringUtils$getUrlIn.protocol; + + if (domain && protocol.includes("http")) { + var regex = /(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/g; + var m = regex.exec(domain); + return m !== undefined && m !== null; + } + + return true; + } + }, { + key: "splitParam", + value: function splitParam(param) { + if (param) { + var regex = /([^=]+)(?:=(.*))?/g; + var m = regex.exec(param); + + if (m) { + return { + name: m[1] || "", + value: m[2] || "" + }; + } + } + + return null; + } + }, { + key: "getLastPathSegment", + value: function getLastPathSegment(url) { + var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "/"; + return url.substring(url.lastIndexOf(separator) + 1); + } + }, { + key: "getParentPath", + value: function getParentPath(path) { + if (path) { + return path.substring(0, path.lastIndexOf("/")); + } + + return ""; + } + }, { + key: "removeLastSlash", + value: function removeLastSlash(url) { + return url.replace(/\/$/, ""); + } + }, { + key: "segmentUrl", + value: function segmentUrl(url) { + var info = StringUtils.getUrlInfo(url); + var baseUrl = info.protocol + "://" + info.domain; + + if (info.path) { + baseUrl += "/" + info.path; + } + + var result = { + baseUrl: baseUrl, + protocol: info.protocol, + domain: info.domain, + path: info.path, + file: info.file, + getParams: {}, + anchor: info.anchor, + anchorParams: {} + }; + result.getParams = StringUtils.parseQuerystring(info.gets); + result.anchorParams = StringUtils.parseQuerystring(info.anchor); + return result; + } + }, { + key: "parseQuerystring", + value: function parseQuerystring(querystring) { + var skipDecoding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var getParams = {}; + + if (querystring) { + var params = querystring.split("&"); + params.forEach(function (param) { + var splitted = StringUtils.splitParam(param); + + if (splitted) { + if (skipDecoding) { + getParams[splitted.name] = splitted.value; + } else { + getParams[splitted.name] = StringUtils.decodeURIComponent(splitted.value); + } + } + }); + } + + return getParams; + } + }, { + key: "getQuerystring", + value: function getQuerystring(params) { + var query = Object.entries(params).filter(function (e) { + return e[1] !== null && e[1] !== undefined; + }).map(function (e) { + e[1] = encodeURIComponent(e[1]); + return e.join("="); + }).join("&"); + return query; + } + }, { + key: "removeTilde", + value: function removeTilde(str) { + if (str) { + str = str.replace("~", ""); + } + + return str; + } + }, { + key: "getRandomHash", + value: function getRandomHash() { + return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); + } + }, { + key: "getRandomIdentifier", + value: function getRandomIdentifier() { + return Math.floor(Math.random() * Math.pow(2, 32)).toString(); + } + }, { + key: "decodeURIComponent", + value: function (_decodeURIComponent) { + function decodeURIComponent(_x) { + return _decodeURIComponent.apply(this, arguments); + } + + decodeURIComponent.toString = function () { + return _decodeURIComponent.toString(); + }; + + return decodeURIComponent; + }(function (text) { + try { + return decodeURIComponent(text); + } catch (e) { + return text; + } + }) + }, { + key: "decodeHTML", + value: function decodeHTML(text) { + try { + return _$$_REQUIRE(_dependencyMap[10]).AllHtmlEntities.decode(text); + } catch (e) { + return text; + } + } + }, { + key: "fileNameFromPath", + value: function fileNameFromPath(path) { + return path ? path.split("/").pop() : ""; + } + }, { + key: "pad", + value: function pad(n, width) { + var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "0"; + n += ""; + return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; + } + }, { + key: "extractLinkAndTextFromFooterTag", + value: function extractLinkAndTextFromFooterTag(tag) { + var result = {}; + + if (tag) { + var groups = StringUtils.REGEX_ARTICLE_FOOTER_TAG.exec(tag); + + if (groups) { + result.matched = groups[0]; + result.url = groups[1]; + result.text = groups[2]; + } + + return result; + } + + return undefined; + } + }, { + key: "parseNotificationEmail", + value: function parseNotificationEmail(notificationEmail) { + var pSetup; + var server; + var parts = notificationEmail.split("@"); + + if (parts.length > 1) { + if (parts[0].length > 0 && parts[1].length > 0 && StringUtils.isTecnaviaDomain(parts[1])) { + pSetup = parts[0]; + server = parts[1]; + } + } + + return { + pSetup: pSetup, + server: server + }; + } + }, { + key: "validateNotificationEmail", + value: function validateNotificationEmail(notificationEmail) { + var _StringUtils$parseNot = StringUtils.parseNotificationEmail(notificationEmail), + pSetup = _StringUtils$parseNot.pSetup, + server = _StringUtils$parseNot.server; + + return !!pSetup && !!server; + } + }, { + key: "isTecnaviaDomain", + value: function isTecnaviaDomain(domain) { + var info = StringUtils.getUrlInfo(global.server); + return domain.endsWith(".newsmemory.com") || domain.endsWith(".eedition.net") || domain === info.domain; + } + }, { + key: "convertNewsmemoryDomainToHTTPS", + value: function convertNewsmemoryDomainToHTTPS(url) { + var newUrl = url; + + if (url.indexOf(".newsmemory.com") !== -1 && url.indexOf("https://") !== 0) { + newUrl = url.replace("http://", ""); + var firstPart = newUrl.split(".newsmemory.com")[0]; + newUrl = newUrl.replace(firstPart, firstPart.replace(/\./g, "-")); + newUrl = "https://" + newUrl; + } + + return newUrl; + } + }, { + key: "removeProtocolFromURL", + value: function removeProtocolFromURL(url) { + return url.replace(/^http[s]?:\/\//, ""); + } + }, { + key: "domainContainsProtocol", + value: function domainContainsProtocol(domain) { + return domain.indexOf("https://") === 0 || domain.indexOf("http://") === 0; + } + }, { + key: "isTecnaviaHTTPDomain", + value: function isTecnaviaHTTPDomain(domain) { + if (domain.indexOf(".newsmemory.com") !== -1 && domain.indexOf("https://") !== 0) { + if (domain.indexOf("http://") === 0) { + return true; + } + + return domain.match(/(\w+)(\.)([a-zA-Z]+)(\.)([a-zA-Z0-9.]*)newsmemory.com/); + } + + return false; + } + }, { + key: "getTecnaviaDomainSeparator", + value: function getTecnaviaDomainSeparator(domain) { + return StringUtils.isTecnaviaHTTPDomain(domain) ? "." : "-"; + } + }, { + key: "getTecnaviaDomainParts", + value: function getTecnaviaDomainParts(domain) { + var paper = ""; + var state = ""; + var type = ""; + var trailer = ""; + + if (StringUtils.isTecnaviaDomain(domain)) { + var separator = StringUtils.getTecnaviaDomainSeparator(domain); + var regex = new RegExp("http[s]?://(.*)\\" + separator + "([a-zA-Z]{2,3})\\" + separator + "(.*).(newsmemory.com|eedition.net)"); + var result = regex.exec(domain); + + if (result && result.length >= 5) { + paper = result[1]; + state = result[2]; + type = result[3]; + trailer = result[4]; + } + } + + return { + paper: paper, + state: state, + type: type, + trailer: trailer + }; + } + }, { + key: "getTecnaviaDomainState", + value: function getTecnaviaDomainState() { + var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getAppServer(); + + var _StringUtils$getTecna = StringUtils.getTecnaviaDomainParts(domain), + state = _StringUtils$getTecna.state; + + return state; + } + }, { + key: "isUSTecnaviaDomain", + value: function isUSTecnaviaDomain() { + var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getAppServer(); + var state = StringUtils.getTecnaviaDomainState(domain); + return state && state.length === 2; + } + }, { + key: "appendParams", + value: function appendParams(url) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var newUrl = url; + + if (Object.keys(params).length > 0) { + var _StringUtils$segmentU = StringUtils.segmentUrl(newUrl), + baseUrl = _StringUtils$segmentU.baseUrl, + path = _StringUtils$segmentU.path, + file = _StringUtils$segmentU.file, + getParams = _StringUtils$segmentU.getParams, + anchor = _StringUtils$segmentU.anchor; + + newUrl = baseUrl; + + if (!newUrl.includes("?")) { + if (!file && !path.endsWith("/")) { + newUrl += "/"; + } + + newUrl += "?"; + } else { + newUrl += "&"; + } + + newUrl += StringUtils.getQuerystring((0, _extends3.default)({}, getParams, params)); + + if (anchor) { + newUrl += "#" + anchor; + } + } + + return newUrl; + } + }, { + key: "removeParams", + value: function removeParams(url) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (params.length > 0) { + var _StringUtils$segmentU2 = StringUtils.segmentUrl(url), + baseUrl = _StringUtils$segmentU2.baseUrl, + getParams = _StringUtils$segmentU2.getParams, + anchor = _StringUtils$segmentU2.anchor; + + var newUrl = baseUrl; + + if (!_jsUtils.default.isEmpty(getParams)) { + var newGetParams = Object.keys(getParams).filter(function (key) { + return !params.includes(key); + }).reduce(function (cur, key) { + return (0, _extends3.default)(cur, (0, _defineProperty2.default)({}, key, getParams[key])); + }, {}); + + if (!_jsUtils.default.isEmpty(newGetParams)) { + newUrl += "?" + StringUtils.getQuerystring(newGetParams); + } + } + + if (anchor) { + newUrl += "#" + anchor; + } + + return newUrl; + } + + return url; + } + }, { + key: "analyzeRGBAColor", + value: function analyzeRGBAColor(color) { + var red = 0; + var green = 0; + var blue = 0; + var alpha = 1; + + if (color && color.length) { + var hexMatcher = StringUtils.REGEX_HEX.exec(color); + var hexShortMatcher = StringUtils.REGEX_HEX_SHORT.exec(color); + + if (hexMatcher || hexShortMatcher) { + return _colorUtils.default.hexToRGBAComponents(color); + } + + var rgbMatcher = StringUtils.REGEX_RGBA.exec(color); + + if (rgbMatcher) { + red = parseInt(rgbMatcher[1], 10); + green = parseInt(rgbMatcher[2], 10); + blue = parseInt(rgbMatcher[3], 10); + alpha = parseFloat(rgbMatcher[5] || "1"); + } + } + + return { + red: red, + green: green, + blue: blue, + alpha: alpha + }; + } + }, { + key: "parseColor", + value: function parseColor(color, defaultColor) { + if (!color || !color.length) { + return defaultColor; + } + + var rgbMatcher = StringUtils.REGEX_RGBA.exec(color); + + if (rgbMatcher) { + var red = rgbMatcher[1]; + var green = rgbMatcher[2]; + var blue = rgbMatcher[3]; + var alpha = rgbMatcher[5] || ""; + + if (!isNaN(alpha)) { + if (alpha.indexOf(".") === -1 && alpha !== "0" && alpha !== "1") { + alpha = parseInt(alpha, 10) / 255; + } + + return "rgba(" + red + "," + green + "," + blue + "," + alpha + ")"; + } + + return "rgba(" + red + "," + green + "," + blue + ",1)"; + } + + var hexMatcher = StringUtils.REGEX_HEX.exec(color); + + if (hexMatcher) { + return color; + } + + var hexShortMatcher = StringUtils.REGEX_HEX_SHORT.exec(color); + + if (hexShortMatcher) { + return color; + } + + return defaultColor; + } + }, { + key: "textSize", + value: function textSize(text, width) { + var options, + size, + _args = arguments; + return _regenerator.default.async(function textSize$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + options = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_reactNativeTextSize.default.measure((0, _extends3.default)({ + text: text, + width: width + }, options))); + + case 4: + size = _context.sent; + return _context.abrupt("return", size); + + case 8: + _context.prev = 8; + _context.t0 = _context["catch"](1); + + case 10: + return _context.abrupt("return", undefined); + + case 11: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 8]], Promise); + } + }, { + key: "getKeyFromText", + value: function getKeyFromText(text) { + if (typeof text === "string") { + return text.replace(/[\W_]+/g, "").toLowerCase(); + } + + return text; + } + }, { + key: "getMorseLikeCode", + value: function getMorseLikeCode(dec) { + if (dec !== undefined) { + var string = (parseInt(dec, 10) >>> 0).toString(2); + string = string.replace(/1/g, ".").replace(/0/g, " "); + return "." + string + "."; + } + + return ""; + } + }, { + key: "getMorseLikeCodeAlt", + value: function getMorseLikeCodeAlt(dec) { + if (dec !== undefined) { + var string = (parseInt(dec, 10) >>> 0).toString(2); + string = string.replace(/1/g, ".").replace(/0/g, "-"); + return "." + string + "."; + } + + return ""; + } + }, { + key: "parseFromString", + value: function parseFromString(str, type) { + var parser = new (_$$_REQUIRE(_dependencyMap[11]).DOMParser)({ + errorHandler: function errorHandler(error) {} + }); + + if (parser !== undefined) { + if (type !== undefined) { + return parser.parseFromString(str, type); + } + + return parser.parseFromString(str); + } + + return str; + } + }, { + key: "serializeHtml", + value: function serializeHtml(html) { + try { + var parser = StringUtils.parseFromString(html); + return new (_$$_REQUIRE(_dependencyMap[11]).XMLSerializer)().serializeToString(parser); + } catch (e) { + return html; + } + } + }, { + key: "isBase64", + value: function isBase64(string) { + try { + global.atob(string); + } catch (e) { + return false; + } + + return true; + } + }, { + key: "isImageBase64", + value: function isImageBase64(string) { + return StringUtils.isBase64(string.replace(/data:image\/(jpeg|png);base64,/, "")); + } + }, { + key: "getGroupFromStrByRegex", + value: function getGroupFromStrByRegex(str, regex, index) { + if (str && regex) { + var matcher = str.match(regex); + + if (matcher && matcher[index]) { + return matcher[index]; + } + } + + return undefined; + } + }, { + key: "isLocalURL", + value: function isLocalURL(url) { + return url && url.startsWith("file://"); + } + }, { + key: "getReadingTime", + value: function getReadingTime(text) { + return (0, _$$_REQUIRE(_dependencyMap[12]).readingTime)(text); + } + }]); + return StringUtils; + }(); + + exports.default = StringUtils; + StringUtils.BULLET = "\u2022"; + StringUtils.TILDE = "~"; + StringUtils.KILO = 1000; + StringUtils.MEGA = StringUtils.KILO * 1000; + StringUtils.GIGA = StringUtils.MEGA * 1000; + StringUtils.REGEX_ARTICLE_FOOTER_TAG = /(.*)<\/a>/gm; + StringUtils.REGEX_CHECK_OPTION_PAGE_TAB = "\\/[a-zA-Z_a-zA-Z]*\\.php\\?"; + StringUtils.REGEX_MD5 = "[a-fA-F0-9]{32}"; + StringUtils.REGEX_FEED_ID = "^(([0-9]+)_)?([a-fA-F0-9]{32}){1}$"; + StringUtils.REGEX_OPEN_URL = "^openUrl:.*$"; + StringUtils.REGEX_URL = /^((https?|ftp):\/\/|(www|ftp)\.)[a-z0-9-]+(\.[a-z0-9-]+)+([\/?].*)?$/gim; + StringUtils.REGEX_ARTICLE_URL = "((ht|f)tp(s?):\\/\\/|www\\.)(([\\w\\-]+\\.){1,}?([\\w\\-.~]+\\/?)*)"; + StringUtils.REGEX_ARTICLE_IGNORE_URL = "(.*(.bmp|.png|.jpg|.gif|.jpeg|.js|.css|.php|.html|.htm))"; + StringUtils.REGEX_PSETUP_SS = ".*-xp-(.*_se|_ss)"; + StringUtils.REGEX_REPLACE_0_IN_PAGE_NAME = "[a-zA-Z]*([0]*)[1-9]*+[0]*"; + StringUtils.REGEX_RGBA = /([0-9]{1,3}),([0-9]{1,3}),([0-9]{1,3})(,([0-9\\.]+))?/; + StringUtils.REGEX_HEX = /#([0-9|A-F|a-f]{2})([0-9|A-F|a-f]{2})([0-9|A-F|a-f]{2})([0-9|A-F|a-f]{2})?/; + StringUtils.REGEX_HEX_SHORT = /#([0-9|A-F|a-f]{1})([0-9|A-F|a-f]{1})([0-9|A-F|a-f]{1})/; +},514,[5,80,27,6,7,8,515,519,463,520,521,526,530]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (function () { + var crypt = _$$_REQUIRE(_dependencyMap[0]), + utf8 = _$$_REQUIRE(_dependencyMap[1]).utf8, + isBuffer = _$$_REQUIRE(_dependencyMap[2]), + bin = _$$_REQUIRE(_dependencyMap[1]).bin, + md5 = function md5(message, options) { + if (message.constructor == String) { + if (options && options.encoding === 'binary') message = bin.stringToBytes(message);else message = utf8.stringToBytes(message); + } else if (isBuffer(message)) message = Array.prototype.slice.call(message, 0);else if (!Array.isArray(message) && message.constructor !== Uint8Array) message = message.toString(); + var m = crypt.bytesToWords(message), + l = message.length * 8, + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878; + + for (var i = 0; i < m.length; i++) { + m[i] = (m[i] << 8 | m[i] >>> 24) & 0x00FF00FF | (m[i] << 24 | m[i] >>> 8) & 0xFF00FF00; + } + + m[l >>> 5] |= 0x80 << l % 32; + m[(l + 64 >>> 9 << 4) + 14] = l; + var FF = md5._ff, + GG = md5._gg, + HH = md5._hh, + II = md5._ii; + + for (var i = 0; i < m.length; i += 16) { + var aa = a, + bb = b, + cc = c, + dd = d; + a = FF(a, b, c, d, m[i + 0], 7, -680876936); + d = FF(d, a, b, c, m[i + 1], 12, -389564586); + c = FF(c, d, a, b, m[i + 2], 17, 606105819); + b = FF(b, c, d, a, m[i + 3], 22, -1044525330); + a = FF(a, b, c, d, m[i + 4], 7, -176418897); + d = FF(d, a, b, c, m[i + 5], 12, 1200080426); + c = FF(c, d, a, b, m[i + 6], 17, -1473231341); + b = FF(b, c, d, a, m[i + 7], 22, -45705983); + a = FF(a, b, c, d, m[i + 8], 7, 1770035416); + d = FF(d, a, b, c, m[i + 9], 12, -1958414417); + c = FF(c, d, a, b, m[i + 10], 17, -42063); + b = FF(b, c, d, a, m[i + 11], 22, -1990404162); + a = FF(a, b, c, d, m[i + 12], 7, 1804603682); + d = FF(d, a, b, c, m[i + 13], 12, -40341101); + c = FF(c, d, a, b, m[i + 14], 17, -1502002290); + b = FF(b, c, d, a, m[i + 15], 22, 1236535329); + a = GG(a, b, c, d, m[i + 1], 5, -165796510); + d = GG(d, a, b, c, m[i + 6], 9, -1069501632); + c = GG(c, d, a, b, m[i + 11], 14, 643717713); + b = GG(b, c, d, a, m[i + 0], 20, -373897302); + a = GG(a, b, c, d, m[i + 5], 5, -701558691); + d = GG(d, a, b, c, m[i + 10], 9, 38016083); + c = GG(c, d, a, b, m[i + 15], 14, -660478335); + b = GG(b, c, d, a, m[i + 4], 20, -405537848); + a = GG(a, b, c, d, m[i + 9], 5, 568446438); + d = GG(d, a, b, c, m[i + 14], 9, -1019803690); + c = GG(c, d, a, b, m[i + 3], 14, -187363961); + b = GG(b, c, d, a, m[i + 8], 20, 1163531501); + a = GG(a, b, c, d, m[i + 13], 5, -1444681467); + d = GG(d, a, b, c, m[i + 2], 9, -51403784); + c = GG(c, d, a, b, m[i + 7], 14, 1735328473); + b = GG(b, c, d, a, m[i + 12], 20, -1926607734); + a = HH(a, b, c, d, m[i + 5], 4, -378558); + d = HH(d, a, b, c, m[i + 8], 11, -2022574463); + c = HH(c, d, a, b, m[i + 11], 16, 1839030562); + b = HH(b, c, d, a, m[i + 14], 23, -35309556); + a = HH(a, b, c, d, m[i + 1], 4, -1530992060); + d = HH(d, a, b, c, m[i + 4], 11, 1272893353); + c = HH(c, d, a, b, m[i + 7], 16, -155497632); + b = HH(b, c, d, a, m[i + 10], 23, -1094730640); + a = HH(a, b, c, d, m[i + 13], 4, 681279174); + d = HH(d, a, b, c, m[i + 0], 11, -358537222); + c = HH(c, d, a, b, m[i + 3], 16, -722521979); + b = HH(b, c, d, a, m[i + 6], 23, 76029189); + a = HH(a, b, c, d, m[i + 9], 4, -640364487); + d = HH(d, a, b, c, m[i + 12], 11, -421815835); + c = HH(c, d, a, b, m[i + 15], 16, 530742520); + b = HH(b, c, d, a, m[i + 2], 23, -995338651); + a = II(a, b, c, d, m[i + 0], 6, -198630844); + d = II(d, a, b, c, m[i + 7], 10, 1126891415); + c = II(c, d, a, b, m[i + 14], 15, -1416354905); + b = II(b, c, d, a, m[i + 5], 21, -57434055); + a = II(a, b, c, d, m[i + 12], 6, 1700485571); + d = II(d, a, b, c, m[i + 3], 10, -1894986606); + c = II(c, d, a, b, m[i + 10], 15, -1051523); + b = II(b, c, d, a, m[i + 1], 21, -2054922799); + a = II(a, b, c, d, m[i + 8], 6, 1873313359); + d = II(d, a, b, c, m[i + 15], 10, -30611744); + c = II(c, d, a, b, m[i + 6], 15, -1560198380); + b = II(b, c, d, a, m[i + 13], 21, 1309151649); + a = II(a, b, c, d, m[i + 4], 6, -145523070); + d = II(d, a, b, c, m[i + 11], 10, -1120210379); + c = II(c, d, a, b, m[i + 2], 15, 718787259); + b = II(b, c, d, a, m[i + 9], 21, -343485551); + a = a + aa >>> 0; + b = b + bb >>> 0; + c = c + cc >>> 0; + d = d + dd >>> 0; + } + + return crypt.endian([a, b, c, d]); + }; + + md5._ff = function (a, b, c, d, x, s, t) { + var n = a + (b & c | ~b & d) + (x >>> 0) + t; + return (n << s | n >>> 32 - s) + b; + }; + + md5._gg = function (a, b, c, d, x, s, t) { + var n = a + (b & d | c & ~d) + (x >>> 0) + t; + return (n << s | n >>> 32 - s) + b; + }; + + md5._hh = function (a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + (x >>> 0) + t; + return (n << s | n >>> 32 - s) + b; + }; + + md5._ii = function (a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + (x >>> 0) + t; + return (n << s | n >>> 32 - s) + b; + }; + + md5._blocksize = 16; + md5._digestsize = 16; + + module.exports = function (message, options) { + if (message === undefined || message === null) throw new Error('Illegal argument ' + message); + var digestbytes = crypt.wordsToBytes(md5(message, options)); + return options && options.asBytes ? digestbytes : options && options.asString ? bin.bytesToString(digestbytes) : crypt.bytesToHex(digestbytes); + }; + })(); +},515,[516,517,518]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (function () { + var base64map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', + crypt = { + rotl: function rotl(n, b) { + return n << b | n >>> 32 - b; + }, + rotr: function rotr(n, b) { + return n << 32 - b | n >>> b; + }, + endian: function endian(n) { + if (n.constructor == Number) { + return crypt.rotl(n, 8) & 0x00FF00FF | crypt.rotl(n, 24) & 0xFF00FF00; + } + + for (var i = 0; i < n.length; i++) { + n[i] = crypt.endian(n[i]); + } + + return n; + }, + randomBytes: function randomBytes(n) { + for (var bytes = []; n > 0; n--) { + bytes.push(Math.floor(Math.random() * 256)); + } + + return bytes; + }, + bytesToWords: function bytesToWords(bytes) { + for (var words = [], i = 0, b = 0; i < bytes.length; i++, b += 8) { + words[b >>> 5] |= bytes[i] << 24 - b % 32; + } + + return words; + }, + wordsToBytes: function wordsToBytes(words) { + for (var bytes = [], b = 0; b < words.length * 32; b += 8) { + bytes.push(words[b >>> 5] >>> 24 - b % 32 & 0xFF); + } + + return bytes; + }, + bytesToHex: function bytesToHex(bytes) { + for (var hex = [], i = 0; i < bytes.length; i++) { + hex.push((bytes[i] >>> 4).toString(16)); + hex.push((bytes[i] & 0xF).toString(16)); + } + + return hex.join(''); + }, + hexToBytes: function hexToBytes(hex) { + for (var bytes = [], c = 0; c < hex.length; c += 2) { + bytes.push(parseInt(hex.substr(c, 2), 16)); + } + + return bytes; + }, + bytesToBase64: function bytesToBase64(bytes) { + for (var base64 = [], i = 0; i < bytes.length; i += 3) { + var triplet = bytes[i] << 16 | bytes[i + 1] << 8 | bytes[i + 2]; + + for (var j = 0; j < 4; j++) { + if (i * 8 + j * 6 <= bytes.length * 8) base64.push(base64map.charAt(triplet >>> 6 * (3 - j) & 0x3F));else base64.push('='); + } + } + + return base64.join(''); + }, + base64ToBytes: function base64ToBytes(base64) { + base64 = base64.replace(/[^A-Z0-9+\/]/ig, ''); + + for (var bytes = [], i = 0, imod4 = 0; i < base64.length; imod4 = ++i % 4) { + if (imod4 == 0) continue; + bytes.push((base64map.indexOf(base64.charAt(i - 1)) & Math.pow(2, -2 * imod4 + 8) - 1) << imod4 * 2 | base64map.indexOf(base64.charAt(i)) >>> 6 - imod4 * 2); + } + + return bytes; + } + }; + module.exports = crypt; + })(); +},516,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var charenc = { + utf8: { + stringToBytes: function stringToBytes(str) { + return charenc.bin.stringToBytes(unescape(encodeURIComponent(str))); + }, + bytesToString: function bytesToString(bytes) { + return decodeURIComponent(escape(charenc.bin.bytesToString(bytes))); + } + }, + bin: { + stringToBytes: function stringToBytes(str) { + for (var bytes = [], i = 0; i < str.length; i++) { + bytes.push(str.charCodeAt(i) & 0xFF); + } + + return bytes; + }, + bytesToString: function bytesToString(bytes) { + for (var str = [], i = 0; i < bytes.length; i++) { + str.push(String.fromCharCode(bytes[i])); + } + + return str.join(''); + } + } + }; + module.exports = charenc; +},517,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + module.exports = function (obj) { + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer); + }; + + function isBuffer(obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj); + } + + function isSlowBuffer(obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)); + } +},518,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.NativeModules.RNTextSize; + exports.default = _default; +},519,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PromiseTimeout = PromiseTimeout; + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + function PromiseTimeout(promiseCall) { + var promiseTimeout, + _len, + params, + _key, + _args = arguments; + + return _regenerator.default.async(function PromiseTimeout$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + promiseTimeout = _args.length > 1 && _args[1] !== undefined ? _args[1] : 2000; + + for (_len = _args.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + params[_key - 2] = _args[_key]; + } + + return _context.abrupt("return", new Promise(function (resolve, reject) { + var inTimeout = false; + setTimeout(function () { + inTimeout = true; + reject(new Error("promise timeout")); + }, promiseTimeout); + promiseCall.apply(undefined, params).then(function (data) { + if (!inTimeout && typeof resolve === "function") { + resolve(data); + } + }).catch(function (error) { + if (!inTimeout && typeof reject === "function") { + reject(error); + } + }); + })); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + var JSUtils = function () { + function JSUtils() { + (0, _classCallCheck2.default)(this, JSUtils); + } + + (0, _createClass2.default)(JSUtils, null, [{ + key: "generateId", + value: function generateId() { + return "" + Math.random().toString(36).substr(2, 9); + } + }, { + key: "equals", + value: function equals(a, b) { + var resultA; + var resultB; + + try { + resultA = JSON.stringify(a); + } catch (e) { + return false; + } + + try { + resultB = JSON.stringify(b); + } catch (e) { + return false; + } + + return resultA === resultB; + } + }, { + key: "isValidObject", + value: function isValidObject(obj) { + return typeof obj === "object" && !JSUtils.isNull(obj); + } + }, { + key: "areEqualDeep", + value: function areEqualDeep(a, b) { + var _a, _b; + + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + a = (_a = a) != null ? _a : {}; + b = (_b = b) != null ? _b : {}; + var _options$print = options.print, + print = _options$print === undefined ? false : _options$print, + _options$skipKeys = options.skipKeys, + skipKeys = _options$skipKeys === undefined ? [] : _options$skipKeys; + var aDifferentFromB = Object.keys(a).find(function (key) { + if (typeof a[key] === "function" || skipKeys.includes(key)) { + return false; + } + + if (!JSUtils.hasProperty(b, key)) { + return true; + } + + if (JSUtils.isValidObject(a[key]) && JSUtils.isValidObject(b[key])) { + return !JSUtils.areEqualDeep(a[key], b[key], options); + } + + return a[key] !== b[key]; + }); + var bDifferentFromA = Object.keys(b).find(function (key) { + if (typeof b[key] === "function" || skipKeys.includes(key)) { + return false; + } + + return !JSUtils.hasProperty(a, key); + }); + var areEqual = !aDifferentFromB && !bDifferentFromA; + + if (print && !areEqual) { + if (aDifferentFromB !== undefined) {} + + if (bDifferentFromA !== undefined) {} + } + + return areEqual; + } + }, { + key: "areEqualShallow", + value: function areEqualShallow() { + var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var _options$print2 = options.print, + print = _options$print2 === undefined ? false : _options$print2, + _options$skipKeys2 = options.skipKeys, + skipKeys = _options$skipKeys2 === undefined ? [] : _options$skipKeys2; + var aDifferentFromB = Object.keys(a).find(function (key) { + if (typeof a[key] === "function" || typeof a[key] === "object" || skipKeys.includes(key)) { + return false; + } + + if (!JSUtils.hasProperty(b, key)) { + return true; + } + + return a[key] !== b[key]; + }); + var bDifferentFromA = Object.keys(b).find(function (key) { + if (typeof b[key] === "function" || typeof b[key] === "object" || skipKeys.includes(key)) { + return false; + } + + return !JSUtils.hasProperty(a, key); + }); + var areEqual = !aDifferentFromB && !bDifferentFromA; + + if (print && !areEqual) { + if (aDifferentFromB !== undefined) {} + + if (bDifferentFromA !== undefined) {} + } + + return areEqual; + } + }, { + key: "isValidRect", + value: function isValidRect(rect) { + return rect && JSUtils.isNumber(rect.start) && JSUtils.isNumber(rect.top) && JSUtils.isNumber(rect.width) && JSUtils.isNumber(rect.height) && rect.width > 0 && rect.height > 0; + } + }, { + key: "intersectRect", + value: function intersectRect(r1, r2) { + return !(r2.start > r1.start + r1.width || r2.start + r2.width < r1.start || r2.top > r1.top + r1.height || r2.top + r2.height < r1.top); + } + }, { + key: "intersectAreaRect", + value: function intersectAreaRect(r1, r2) { + var intersectionX1 = Math.max(r1.start, r2.start); + var intersectionX2 = Math.min(r1.start + r1.width, r2.start + r2.width); + + if (intersectionX2 < intersectionX1) { + return { + start: 0, + top: 0, + width: 0, + height: 0 + }; + } + + var intersectionY1 = Math.max(r1.top, r2.top); + var intersectionY2 = Math.min(r1.top + r1.height, r2.top + r2.height); + + if (intersectionY2 < intersectionY1) { + return { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + + return { + start: intersectionX1, + top: intersectionY1, + width: intersectionX2 - intersectionX1, + height: intersectionY2 - intersectionY1 + }; + } + }, { + key: "intersectArea", + value: function intersectArea(r1, r2) { + var _JSUtils$intersectAre = JSUtils.intersectAreaRect(r1, r2), + width = _JSUtils$intersectAre.width, + height = _JSUtils$intersectAre.height; + + return width * height; + } + }, { + key: "rectContainsPoint", + value: function rectContainsPoint(r, p) { + return r.start < p.x && r.start + r.width > p.x && r.top < p.y && r.top + r.height > p.y; + } + }, { + key: "inInterval", + value: function inInterval(n, lower, upper) { + return n >= lower && n <= upper; + } + }, { + key: "shouldUpdatePureComponent", + value: function shouldUpdatePureComponent(currentProps, nextProps, currentState, nextState) { + var ret = false; + var prevPropsKeys = Object.keys(currentProps); + var nextPropsKeys = Object.keys(nextProps); + + if (prevPropsKeys.length !== nextPropsKeys.length) { + ret = true; + } + + var prevStateKeys = Object.keys(currentState || {}); + var nextStateKeys = Object.keys(nextState || {}); + + if (prevStateKeys.length !== nextStateKeys.length) { + ret = true; + } + + for (var key in currentProps) { + if (currentProps[key] !== nextProps[key]) { + ret = true; + } + } + + for (var _key2 in currentState) { + if (currentState[_key2] !== (nextState || {})[_key2]) { + ret = true; + } + } + + return ret; + } + }, { + key: "getViewByRef", + value: function getViewByRef(ref) { + if (!ref) { + throw new Error("ref.current is null"); + } + + if (typeof ref === "object" && ref.current) { + ref = ref.current; + } + + if (typeof ref !== "number") { + var node = (0, _reactNative.findNodeHandle)(ref); + + if (!node) { + throw new Error("findNodeHandle failed to resolve view=" + String(ref)); + } + + ref = node; + } + + return ref; + } + }, { + key: "isNull", + value: function isNull(a) { + return a === undefined || a === null; + } + }, { + key: "isEmpty", + value: function isEmpty(a) { + if (!JSUtils.isNull(a)) { + if (typeof a === "string") { + return a.length === 0; + } + + if (Array.isArray(a)) { + return a.length === 0; + } + + if (typeof a === "object") { + return Object.keys(a).length === 0; + } + } + + return true; + } + }, { + key: "hasProperty", + value: function hasProperty() { + var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + return Object.prototype.hasOwnProperty.call(obj, property); + } + }, { + key: "isNumber", + value: function isNumber(value) { + try { + return !(typeof value !== "number" || Number.isNaN(value)); + } catch (e) { + return false; + } + } + }, { + key: "max", + value: function max() { + for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { + args[_key3] = arguments[_key3]; + } + + return Math.max.apply(Math, (0, _toConsumableArray2.default)(args.filter(function (arg) { + return JSUtils.isNumber(arg); + }))); + } + }, { + key: "min", + value: function min() { + for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) { + args[_key4] = arguments[_key4]; + } + + return Math.min.apply(Math, (0, _toConsumableArray2.default)(args.filter(function (arg) { + return JSUtils.isNumber(arg); + }))); + } + }, { + key: "mergeObjects", + value: function mergeObjects() { + var obj1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var obj2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var mergedObj = (0, _extends2.default)({}, obj1); + Object.keys(obj2).forEach(function (key) { + if (obj2[key] !== undefined) { + if (Array.isArray(obj2[key]) && Array.isArray(obj1[key])) { + mergedObj[key] = obj2[key]; + } else if (typeof obj2[key] === "object" && typeof obj1[key] === "object") { + mergedObj[key] = JSUtils.mergeObjects(obj1[key], obj2[key]); + } else { + mergedObj[key] = obj2[key]; + } + } + }); + return mergedObj; + } + }, { + key: "flattenObject", + value: function flattenObject(json) { + var namespace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + return Object.keys(json).reduce(function (prev, current) { + var value = json[current]; + + if (typeof value === "object") { + return (0, _extends2.default)({}, prev, JSUtils.flattenObject(value, current)); + } + + var key = namespace ? namespace + "." + current : current; + prev[key] = value; + return prev; + }, {}); + } + }]); + return JSUtils; + }(); + + exports.default = JSUtils; +},520,[5,6,21,7,8,80,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.XmlEntities = _$$_REQUIRE(_dependencyMap[0]).XmlEntities; + exports.Html4Entities = _$$_REQUIRE(_dependencyMap[1]).Html4Entities; + exports.Html5Entities = _$$_REQUIRE(_dependencyMap[2]).Html5Entities; + exports.AllHtmlEntities = _$$_REQUIRE(_dependencyMap[2]).Html5Entities; +},521,[522,524,525]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var ALPHA_INDEX = { + '<': '<', + '>': '>', + '"': '"', + '&apos': '\'', + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': '\'', + '&': '&' + }; + var CHAR_INDEX = { + 60: 'lt', + 62: 'gt', + 34: 'quot', + 39: 'apos', + 38: 'amp' + }; + var CHAR_S_INDEX = { + '<': '<', + '>': '>', + '"': '"', + '\'': ''', + '&': '&' + }; + + var XmlEntities = function () { + function XmlEntities() {} + + XmlEntities.prototype.encode = function (str) { + if (!str || !str.length) { + return ''; + } + + return str.replace(/[<>"'&]/g, function (s) { + return CHAR_S_INDEX[s]; + }); + }; + + XmlEntities.encode = function (str) { + return new XmlEntities().encode(str); + }; + + XmlEntities.prototype.decode = function (str) { + if (!str || !str.length) { + return ''; + } + + return str.replace(/&#?[0-9a-zA-Z]+;?/g, function (s) { + if (s.charAt(1) === '#') { + var code = s.charAt(2).toLowerCase() === 'x' ? parseInt(s.substr(3), 16) : parseInt(s.substr(2)); + + if (!isNaN(code) || code >= -32768) { + if (code <= 65535) { + return String.fromCharCode(code); + } else { + return _$$_REQUIRE(_dependencyMap[0]).fromCodePoint(code); + } + } + + return ''; + } + + return ALPHA_INDEX[s] || s; + }); + }; + + XmlEntities.decode = function (str) { + return new XmlEntities().decode(str); + }; + + XmlEntities.prototype.encodeNonUTF = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var c = str.charCodeAt(i); + var alpha = CHAR_INDEX[c]; + + if (alpha) { + result += "&" + alpha + ";"; + i++; + continue; + } + + if (c < 32 || c > 126) { + if (c >= _$$_REQUIRE(_dependencyMap[0]).highSurrogateFrom && c <= _$$_REQUIRE(_dependencyMap[0]).highSurrogateTo) { + result += '&#' + _$$_REQUIRE(_dependencyMap[0]).getCodePoint(str, i) + ';'; + i++; + } else { + result += '&#' + c + ';'; + } + } else { + result += str.charAt(i); + } + + i++; + } + + return result; + }; + + XmlEntities.encodeNonUTF = function (str) { + return new XmlEntities().encodeNonUTF(str); + }; + + XmlEntities.prototype.encodeNonASCII = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var c = str.charCodeAt(i); + + if (c <= 255) { + result += str[i++]; + continue; + } + + if (c >= _$$_REQUIRE(_dependencyMap[0]).highSurrogateFrom && c <= _$$_REQUIRE(_dependencyMap[0]).highSurrogateTo) { + result += '&#' + _$$_REQUIRE(_dependencyMap[0]).getCodePoint(str, i) + ';'; + i++; + } else { + result += '&#' + c + ';'; + } + + i++; + } + + return result; + }; + + XmlEntities.encodeNonASCII = function (str) { + return new XmlEntities().encodeNonASCII(str); + }; + + return XmlEntities; + }(); + + exports.XmlEntities = XmlEntities; +},522,[523]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.fromCodePoint = String.fromCodePoint || function (astralCodePoint) { + return String.fromCharCode(Math.floor((astralCodePoint - 0x10000) / 0x400) + 0xD800, (astralCodePoint - 0x10000) % 0x400 + 0xDC00); + }; + + exports.getCodePoint = String.prototype.codePointAt ? function (input, position) { + return input.codePointAt(position); + } : function (input, position) { + return (input.charCodeAt(position) - 0xD800) * 0x400 + input.charCodeAt(position + 1) - 0xDC00 + 0x10000; + }; + exports.highSurrogateFrom = 0xD800; + exports.highSurrogateTo = 0xDBFF; +},523,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var HTML_ALPHA = ['apos', 'nbsp', 'iexcl', 'cent', 'pound', 'curren', 'yen', 'brvbar', 'sect', 'uml', 'copy', 'ordf', 'laquo', 'not', 'shy', 'reg', 'macr', 'deg', 'plusmn', 'sup2', 'sup3', 'acute', 'micro', 'para', 'middot', 'cedil', 'sup1', 'ordm', 'raquo', 'frac14', 'frac12', 'frac34', 'iquest', 'Agrave', 'Aacute', 'Acirc', 'Atilde', 'Auml', 'Aring', 'AElig', 'Ccedil', 'Egrave', 'Eacute', 'Ecirc', 'Euml', 'Igrave', 'Iacute', 'Icirc', 'Iuml', 'ETH', 'Ntilde', 'Ograve', 'Oacute', 'Ocirc', 'Otilde', 'Ouml', 'times', 'Oslash', 'Ugrave', 'Uacute', 'Ucirc', 'Uuml', 'Yacute', 'THORN', 'szlig', 'agrave', 'aacute', 'acirc', 'atilde', 'auml', 'aring', 'aelig', 'ccedil', 'egrave', 'eacute', 'ecirc', 'euml', 'igrave', 'iacute', 'icirc', 'iuml', 'eth', 'ntilde', 'ograve', 'oacute', 'ocirc', 'otilde', 'ouml', 'divide', 'oslash', 'ugrave', 'uacute', 'ucirc', 'uuml', 'yacute', 'thorn', 'yuml', 'quot', 'amp', 'lt', 'gt', 'OElig', 'oelig', 'Scaron', 'scaron', 'Yuml', 'circ', 'tilde', 'ensp', 'emsp', 'thinsp', 'zwnj', 'zwj', 'lrm', 'rlm', 'ndash', 'mdash', 'lsquo', 'rsquo', 'sbquo', 'ldquo', 'rdquo', 'bdquo', 'dagger', 'Dagger', 'permil', 'lsaquo', 'rsaquo', 'euro', 'fnof', 'Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta', 'Eta', 'Theta', 'Iota', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Xi', 'Omicron', 'Pi', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'Phi', 'Chi', 'Psi', 'Omega', 'alpha', 'beta', 'gamma', 'delta', 'epsilon', 'zeta', 'eta', 'theta', 'iota', 'kappa', 'lambda', 'mu', 'nu', 'xi', 'omicron', 'pi', 'rho', 'sigmaf', 'sigma', 'tau', 'upsilon', 'phi', 'chi', 'psi', 'omega', 'thetasym', 'upsih', 'piv', 'bull', 'hellip', 'prime', 'Prime', 'oline', 'frasl', 'weierp', 'image', 'real', 'trade', 'alefsym', 'larr', 'uarr', 'rarr', 'darr', 'harr', 'crarr', 'lArr', 'uArr', 'rArr', 'dArr', 'hArr', 'forall', 'part', 'exist', 'empty', 'nabla', 'isin', 'notin', 'ni', 'prod', 'sum', 'minus', 'lowast', 'radic', 'prop', 'infin', 'ang', 'and', 'or', 'cap', 'cup', 'int', 'there4', 'sim', 'cong', 'asymp', 'ne', 'equiv', 'le', 'ge', 'sub', 'sup', 'nsub', 'sube', 'supe', 'oplus', 'otimes', 'perp', 'sdot', 'lceil', 'rceil', 'lfloor', 'rfloor', 'lang', 'rang', 'loz', 'spades', 'clubs', 'hearts', 'diams']; + var HTML_CODES = [39, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 34, 38, 60, 62, 338, 339, 352, 353, 376, 710, 732, 8194, 8195, 8201, 8204, 8205, 8206, 8207, 8211, 8212, 8216, 8217, 8218, 8220, 8221, 8222, 8224, 8225, 8240, 8249, 8250, 8364, 402, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 977, 978, 982, 8226, 8230, 8242, 8243, 8254, 8260, 8472, 8465, 8476, 8482, 8501, 8592, 8593, 8594, 8595, 8596, 8629, 8656, 8657, 8658, 8659, 8660, 8704, 8706, 8707, 8709, 8711, 8712, 8713, 8715, 8719, 8721, 8722, 8727, 8730, 8733, 8734, 8736, 8743, 8744, 8745, 8746, 8747, 8756, 8764, 8773, 8776, 8800, 8801, 8804, 8805, 8834, 8835, 8836, 8838, 8839, 8853, 8855, 8869, 8901, 8968, 8969, 8970, 8971, 9001, 9002, 9674, 9824, 9827, 9829, 9830]; + var alphaIndex = {}; + var numIndex = {}; + + (function () { + var i = 0; + var length = HTML_ALPHA.length; + + while (i < length) { + var a = HTML_ALPHA[i]; + var c = HTML_CODES[i]; + alphaIndex[a] = String.fromCharCode(c); + numIndex[c] = a; + i++; + } + })(); + + var Html4Entities = function () { + function Html4Entities() {} + + Html4Entities.prototype.decode = function (str) { + if (!str || !str.length) { + return ''; + } + + return str.replace(/&(#?[\w\d]+);?/g, function (s, entity) { + var chr; + + if (entity.charAt(0) === "#") { + var code = entity.charAt(1).toLowerCase() === 'x' ? parseInt(entity.substr(2), 16) : parseInt(entity.substr(1)); + + if (!isNaN(code) || code >= -32768) { + if (code <= 65535) { + chr = String.fromCharCode(code); + } else { + chr = _$$_REQUIRE(_dependencyMap[0]).fromCodePoint(code); + } + } + } else { + chr = alphaIndex[entity]; + } + + return chr || s; + }); + }; + + Html4Entities.decode = function (str) { + return new Html4Entities().decode(str); + }; + + Html4Entities.prototype.encode = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var alpha = numIndex[str.charCodeAt(i)]; + result += alpha ? "&" + alpha + ";" : str.charAt(i); + i++; + } + + return result; + }; + + Html4Entities.encode = function (str) { + return new Html4Entities().encode(str); + }; + + Html4Entities.prototype.encodeNonUTF = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var cc = str.charCodeAt(i); + var alpha = numIndex[cc]; + + if (alpha) { + result += "&" + alpha + ";"; + } else if (cc < 32 || cc > 126) { + if (cc >= _$$_REQUIRE(_dependencyMap[0]).highSurrogateFrom && cc <= _$$_REQUIRE(_dependencyMap[0]).highSurrogateTo) { + result += '&#' + _$$_REQUIRE(_dependencyMap[0]).getCodePoint(str, i) + ';'; + i++; + } else { + result += '&#' + cc + ';'; + } + } else { + result += str.charAt(i); + } + + i++; + } + + return result; + }; + + Html4Entities.encodeNonUTF = function (str) { + return new Html4Entities().encodeNonUTF(str); + }; + + Html4Entities.prototype.encodeNonASCII = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var c = str.charCodeAt(i); + + if (c <= 255) { + result += str[i++]; + continue; + } + + if (c >= _$$_REQUIRE(_dependencyMap[0]).highSurrogateFrom && c <= _$$_REQUIRE(_dependencyMap[0]).highSurrogateTo) { + result += '&#' + _$$_REQUIRE(_dependencyMap[0]).getCodePoint(str, i) + ';'; + i++; + } else { + result += '&#' + c + ';'; + } + + i++; + } + + return result; + }; + + Html4Entities.encodeNonASCII = function (str) { + return new Html4Entities().encodeNonASCII(str); + }; + + return Html4Entities; + }(); + + exports.Html4Entities = Html4Entities; +},524,[523]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + var ENTITIES = [['Aacute', [193]], ['aacute', [225]], ['Abreve', [258]], ['abreve', [259]], ['ac', [8766]], ['acd', [8767]], ['acE', [8766, 819]], ['Acirc', [194]], ['acirc', [226]], ['acute', [180]], ['Acy', [1040]], ['acy', [1072]], ['AElig', [198]], ['aelig', [230]], ['af', [8289]], ['Afr', [120068]], ['afr', [120094]], ['Agrave', [192]], ['agrave', [224]], ['alefsym', [8501]], ['aleph', [8501]], ['Alpha', [913]], ['alpha', [945]], ['Amacr', [256]], ['amacr', [257]], ['amalg', [10815]], ['amp', [38]], ['AMP', [38]], ['andand', [10837]], ['And', [10835]], ['and', [8743]], ['andd', [10844]], ['andslope', [10840]], ['andv', [10842]], ['ang', [8736]], ['ange', [10660]], ['angle', [8736]], ['angmsdaa', [10664]], ['angmsdab', [10665]], ['angmsdac', [10666]], ['angmsdad', [10667]], ['angmsdae', [10668]], ['angmsdaf', [10669]], ['angmsdag', [10670]], ['angmsdah', [10671]], ['angmsd', [8737]], ['angrt', [8735]], ['angrtvb', [8894]], ['angrtvbd', [10653]], ['angsph', [8738]], ['angst', [197]], ['angzarr', [9084]], ['Aogon', [260]], ['aogon', [261]], ['Aopf', [120120]], ['aopf', [120146]], ['apacir', [10863]], ['ap', [8776]], ['apE', [10864]], ['ape', [8778]], ['apid', [8779]], ['apos', [39]], ['ApplyFunction', [8289]], ['approx', [8776]], ['approxeq', [8778]], ['Aring', [197]], ['aring', [229]], ['Ascr', [119964]], ['ascr', [119990]], ['Assign', [8788]], ['ast', [42]], ['asymp', [8776]], ['asympeq', [8781]], ['Atilde', [195]], ['atilde', [227]], ['Auml', [196]], ['auml', [228]], ['awconint', [8755]], ['awint', [10769]], ['backcong', [8780]], ['backepsilon', [1014]], ['backprime', [8245]], ['backsim', [8765]], ['backsimeq', [8909]], ['Backslash', [8726]], ['Barv', [10983]], ['barvee', [8893]], ['barwed', [8965]], ['Barwed', [8966]], ['barwedge', [8965]], ['bbrk', [9141]], ['bbrktbrk', [9142]], ['bcong', [8780]], ['Bcy', [1041]], ['bcy', [1073]], ['bdquo', [8222]], ['becaus', [8757]], ['because', [8757]], ['Because', [8757]], ['bemptyv', [10672]], ['bepsi', [1014]], ['bernou', [8492]], ['Bernoullis', [8492]], ['Beta', [914]], ['beta', [946]], ['beth', [8502]], ['between', [8812]], ['Bfr', [120069]], ['bfr', [120095]], ['bigcap', [8898]], ['bigcirc', [9711]], ['bigcup', [8899]], ['bigodot', [10752]], ['bigoplus', [10753]], ['bigotimes', [10754]], ['bigsqcup', [10758]], ['bigstar', [9733]], ['bigtriangledown', [9661]], ['bigtriangleup', [9651]], ['biguplus', [10756]], ['bigvee', [8897]], ['bigwedge', [8896]], ['bkarow', [10509]], ['blacklozenge', [10731]], ['blacksquare', [9642]], ['blacktriangle', [9652]], ['blacktriangledown', [9662]], ['blacktriangleleft', [9666]], ['blacktriangleright', [9656]], ['blank', [9251]], ['blk12', [9618]], ['blk14', [9617]], ['blk34', [9619]], ['block', [9608]], ['bne', [61, 8421]], ['bnequiv', [8801, 8421]], ['bNot', [10989]], ['bnot', [8976]], ['Bopf', [120121]], ['bopf', [120147]], ['bot', [8869]], ['bottom', [8869]], ['bowtie', [8904]], ['boxbox', [10697]], ['boxdl', [9488]], ['boxdL', [9557]], ['boxDl', [9558]], ['boxDL', [9559]], ['boxdr', [9484]], ['boxdR', [9554]], ['boxDr', [9555]], ['boxDR', [9556]], ['boxh', [9472]], ['boxH', [9552]], ['boxhd', [9516]], ['boxHd', [9572]], ['boxhD', [9573]], ['boxHD', [9574]], ['boxhu', [9524]], ['boxHu', [9575]], ['boxhU', [9576]], ['boxHU', [9577]], ['boxminus', [8863]], ['boxplus', [8862]], ['boxtimes', [8864]], ['boxul', [9496]], ['boxuL', [9563]], ['boxUl', [9564]], ['boxUL', [9565]], ['boxur', [9492]], ['boxuR', [9560]], ['boxUr', [9561]], ['boxUR', [9562]], ['boxv', [9474]], ['boxV', [9553]], ['boxvh', [9532]], ['boxvH', [9578]], ['boxVh', [9579]], ['boxVH', [9580]], ['boxvl', [9508]], ['boxvL', [9569]], ['boxVl', [9570]], ['boxVL', [9571]], ['boxvr', [9500]], ['boxvR', [9566]], ['boxVr', [9567]], ['boxVR', [9568]], ['bprime', [8245]], ['breve', [728]], ['Breve', [728]], ['brvbar', [166]], ['bscr', [119991]], ['Bscr', [8492]], ['bsemi', [8271]], ['bsim', [8765]], ['bsime', [8909]], ['bsolb', [10693]], ['bsol', [92]], ['bsolhsub', [10184]], ['bull', [8226]], ['bullet', [8226]], ['bump', [8782]], ['bumpE', [10926]], ['bumpe', [8783]], ['Bumpeq', [8782]], ['bumpeq', [8783]], ['Cacute', [262]], ['cacute', [263]], ['capand', [10820]], ['capbrcup', [10825]], ['capcap', [10827]], ['cap', [8745]], ['Cap', [8914]], ['capcup', [10823]], ['capdot', [10816]], ['CapitalDifferentialD', [8517]], ['caps', [8745, 65024]], ['caret', [8257]], ['caron', [711]], ['Cayleys', [8493]], ['ccaps', [10829]], ['Ccaron', [268]], ['ccaron', [269]], ['Ccedil', [199]], ['ccedil', [231]], ['Ccirc', [264]], ['ccirc', [265]], ['Cconint', [8752]], ['ccups', [10828]], ['ccupssm', [10832]], ['Cdot', [266]], ['cdot', [267]], ['cedil', [184]], ['Cedilla', [184]], ['cemptyv', [10674]], ['cent', [162]], ['centerdot', [183]], ['CenterDot', [183]], ['cfr', [120096]], ['Cfr', [8493]], ['CHcy', [1063]], ['chcy', [1095]], ['check', [10003]], ['checkmark', [10003]], ['Chi', [935]], ['chi', [967]], ['circ', [710]], ['circeq', [8791]], ['circlearrowleft', [8634]], ['circlearrowright', [8635]], ['circledast', [8859]], ['circledcirc', [8858]], ['circleddash', [8861]], ['CircleDot', [8857]], ['circledR', [174]], ['circledS', [9416]], ['CircleMinus', [8854]], ['CirclePlus', [8853]], ['CircleTimes', [8855]], ['cir', [9675]], ['cirE', [10691]], ['cire', [8791]], ['cirfnint', [10768]], ['cirmid', [10991]], ['cirscir', [10690]], ['ClockwiseContourIntegral', [8754]], ['clubs', [9827]], ['clubsuit', [9827]], ['colon', [58]], ['Colon', [8759]], ['Colone', [10868]], ['colone', [8788]], ['coloneq', [8788]], ['comma', [44]], ['commat', [64]], ['comp', [8705]], ['compfn', [8728]], ['complement', [8705]], ['complexes', [8450]], ['cong', [8773]], ['congdot', [10861]], ['Congruent', [8801]], ['conint', [8750]], ['Conint', [8751]], ['ContourIntegral', [8750]], ['copf', [120148]], ['Copf', [8450]], ['coprod', [8720]], ['Coproduct', [8720]], ['copy', [169]], ['COPY', [169]], ['copysr', [8471]], ['CounterClockwiseContourIntegral', [8755]], ['crarr', [8629]], ['cross', [10007]], ['Cross', [10799]], ['Cscr', [119966]], ['cscr', [119992]], ['csub', [10959]], ['csube', [10961]], ['csup', [10960]], ['csupe', [10962]], ['ctdot', [8943]], ['cudarrl', [10552]], ['cudarrr', [10549]], ['cuepr', [8926]], ['cuesc', [8927]], ['cularr', [8630]], ['cularrp', [10557]], ['cupbrcap', [10824]], ['cupcap', [10822]], ['CupCap', [8781]], ['cup', [8746]], ['Cup', [8915]], ['cupcup', [10826]], ['cupdot', [8845]], ['cupor', [10821]], ['cups', [8746, 65024]], ['curarr', [8631]], ['curarrm', [10556]], ['curlyeqprec', [8926]], ['curlyeqsucc', [8927]], ['curlyvee', [8910]], ['curlywedge', [8911]], ['curren', [164]], ['curvearrowleft', [8630]], ['curvearrowright', [8631]], ['cuvee', [8910]], ['cuwed', [8911]], ['cwconint', [8754]], ['cwint', [8753]], ['cylcty', [9005]], ['dagger', [8224]], ['Dagger', [8225]], ['daleth', [8504]], ['darr', [8595]], ['Darr', [8609]], ['dArr', [8659]], ['dash', [8208]], ['Dashv', [10980]], ['dashv', [8867]], ['dbkarow', [10511]], ['dblac', [733]], ['Dcaron', [270]], ['dcaron', [271]], ['Dcy', [1044]], ['dcy', [1076]], ['ddagger', [8225]], ['ddarr', [8650]], ['DD', [8517]], ['dd', [8518]], ['DDotrahd', [10513]], ['ddotseq', [10871]], ['deg', [176]], ['Del', [8711]], ['Delta', [916]], ['delta', [948]], ['demptyv', [10673]], ['dfisht', [10623]], ['Dfr', [120071]], ['dfr', [120097]], ['dHar', [10597]], ['dharl', [8643]], ['dharr', [8642]], ['DiacriticalAcute', [180]], ['DiacriticalDot', [729]], ['DiacriticalDoubleAcute', [733]], ['DiacriticalGrave', [96]], ['DiacriticalTilde', [732]], ['diam', [8900]], ['diamond', [8900]], ['Diamond', [8900]], ['diamondsuit', [9830]], ['diams', [9830]], ['die', [168]], ['DifferentialD', [8518]], ['digamma', [989]], ['disin', [8946]], ['div', [247]], ['divide', [247]], ['divideontimes', [8903]], ['divonx', [8903]], ['DJcy', [1026]], ['djcy', [1106]], ['dlcorn', [8990]], ['dlcrop', [8973]], ['dollar', [36]], ['Dopf', [120123]], ['dopf', [120149]], ['Dot', [168]], ['dot', [729]], ['DotDot', [8412]], ['doteq', [8784]], ['doteqdot', [8785]], ['DotEqual', [8784]], ['dotminus', [8760]], ['dotplus', [8724]], ['dotsquare', [8865]], ['doublebarwedge', [8966]], ['DoubleContourIntegral', [8751]], ['DoubleDot', [168]], ['DoubleDownArrow', [8659]], ['DoubleLeftArrow', [8656]], ['DoubleLeftRightArrow', [8660]], ['DoubleLeftTee', [10980]], ['DoubleLongLeftArrow', [10232]], ['DoubleLongLeftRightArrow', [10234]], ['DoubleLongRightArrow', [10233]], ['DoubleRightArrow', [8658]], ['DoubleRightTee', [8872]], ['DoubleUpArrow', [8657]], ['DoubleUpDownArrow', [8661]], ['DoubleVerticalBar', [8741]], ['DownArrowBar', [10515]], ['downarrow', [8595]], ['DownArrow', [8595]], ['Downarrow', [8659]], ['DownArrowUpArrow', [8693]], ['DownBreve', [785]], ['downdownarrows', [8650]], ['downharpoonleft', [8643]], ['downharpoonright', [8642]], ['DownLeftRightVector', [10576]], ['DownLeftTeeVector', [10590]], ['DownLeftVectorBar', [10582]], ['DownLeftVector', [8637]], ['DownRightTeeVector', [10591]], ['DownRightVectorBar', [10583]], ['DownRightVector', [8641]], ['DownTeeArrow', [8615]], ['DownTee', [8868]], ['drbkarow', [10512]], ['drcorn', [8991]], ['drcrop', [8972]], ['Dscr', [119967]], ['dscr', [119993]], ['DScy', [1029]], ['dscy', [1109]], ['dsol', [10742]], ['Dstrok', [272]], ['dstrok', [273]], ['dtdot', [8945]], ['dtri', [9663]], ['dtrif', [9662]], ['duarr', [8693]], ['duhar', [10607]], ['dwangle', [10662]], ['DZcy', [1039]], ['dzcy', [1119]], ['dzigrarr', [10239]], ['Eacute', [201]], ['eacute', [233]], ['easter', [10862]], ['Ecaron', [282]], ['ecaron', [283]], ['Ecirc', [202]], ['ecirc', [234]], ['ecir', [8790]], ['ecolon', [8789]], ['Ecy', [1069]], ['ecy', [1101]], ['eDDot', [10871]], ['Edot', [278]], ['edot', [279]], ['eDot', [8785]], ['ee', [8519]], ['efDot', [8786]], ['Efr', [120072]], ['efr', [120098]], ['eg', [10906]], ['Egrave', [200]], ['egrave', [232]], ['egs', [10902]], ['egsdot', [10904]], ['el', [10905]], ['Element', [8712]], ['elinters', [9191]], ['ell', [8467]], ['els', [10901]], ['elsdot', [10903]], ['Emacr', [274]], ['emacr', [275]], ['empty', [8709]], ['emptyset', [8709]], ['EmptySmallSquare', [9723]], ['emptyv', [8709]], ['EmptyVerySmallSquare', [9643]], ['emsp13', [8196]], ['emsp14', [8197]], ['emsp', [8195]], ['ENG', [330]], ['eng', [331]], ['ensp', [8194]], ['Eogon', [280]], ['eogon', [281]], ['Eopf', [120124]], ['eopf', [120150]], ['epar', [8917]], ['eparsl', [10723]], ['eplus', [10865]], ['epsi', [949]], ['Epsilon', [917]], ['epsilon', [949]], ['epsiv', [1013]], ['eqcirc', [8790]], ['eqcolon', [8789]], ['eqsim', [8770]], ['eqslantgtr', [10902]], ['eqslantless', [10901]], ['Equal', [10869]], ['equals', [61]], ['EqualTilde', [8770]], ['equest', [8799]], ['Equilibrium', [8652]], ['equiv', [8801]], ['equivDD', [10872]], ['eqvparsl', [10725]], ['erarr', [10609]], ['erDot', [8787]], ['escr', [8495]], ['Escr', [8496]], ['esdot', [8784]], ['Esim', [10867]], ['esim', [8770]], ['Eta', [919]], ['eta', [951]], ['ETH', [208]], ['eth', [240]], ['Euml', [203]], ['euml', [235]], ['euro', [8364]], ['excl', [33]], ['exist', [8707]], ['Exists', [8707]], ['expectation', [8496]], ['exponentiale', [8519]], ['ExponentialE', [8519]], ['fallingdotseq', [8786]], ['Fcy', [1060]], ['fcy', [1092]], ['female', [9792]], ['ffilig', [64259]], ['fflig', [64256]], ['ffllig', [64260]], ['Ffr', [120073]], ['ffr', [120099]], ['filig', [64257]], ['FilledSmallSquare', [9724]], ['FilledVerySmallSquare', [9642]], ['fjlig', [102, 106]], ['flat', [9837]], ['fllig', [64258]], ['fltns', [9649]], ['fnof', [402]], ['Fopf', [120125]], ['fopf', [120151]], ['forall', [8704]], ['ForAll', [8704]], ['fork', [8916]], ['forkv', [10969]], ['Fouriertrf', [8497]], ['fpartint', [10765]], ['frac12', [189]], ['frac13', [8531]], ['frac14', [188]], ['frac15', [8533]], ['frac16', [8537]], ['frac18', [8539]], ['frac23', [8532]], ['frac25', [8534]], ['frac34', [190]], ['frac35', [8535]], ['frac38', [8540]], ['frac45', [8536]], ['frac56', [8538]], ['frac58', [8541]], ['frac78', [8542]], ['frasl', [8260]], ['frown', [8994]], ['fscr', [119995]], ['Fscr', [8497]], ['gacute', [501]], ['Gamma', [915]], ['gamma', [947]], ['Gammad', [988]], ['gammad', [989]], ['gap', [10886]], ['Gbreve', [286]], ['gbreve', [287]], ['Gcedil', [290]], ['Gcirc', [284]], ['gcirc', [285]], ['Gcy', [1043]], ['gcy', [1075]], ['Gdot', [288]], ['gdot', [289]], ['ge', [8805]], ['gE', [8807]], ['gEl', [10892]], ['gel', [8923]], ['geq', [8805]], ['geqq', [8807]], ['geqslant', [10878]], ['gescc', [10921]], ['ges', [10878]], ['gesdot', [10880]], ['gesdoto', [10882]], ['gesdotol', [10884]], ['gesl', [8923, 65024]], ['gesles', [10900]], ['Gfr', [120074]], ['gfr', [120100]], ['gg', [8811]], ['Gg', [8921]], ['ggg', [8921]], ['gimel', [8503]], ['GJcy', [1027]], ['gjcy', [1107]], ['gla', [10917]], ['gl', [8823]], ['glE', [10898]], ['glj', [10916]], ['gnap', [10890]], ['gnapprox', [10890]], ['gne', [10888]], ['gnE', [8809]], ['gneq', [10888]], ['gneqq', [8809]], ['gnsim', [8935]], ['Gopf', [120126]], ['gopf', [120152]], ['grave', [96]], ['GreaterEqual', [8805]], ['GreaterEqualLess', [8923]], ['GreaterFullEqual', [8807]], ['GreaterGreater', [10914]], ['GreaterLess', [8823]], ['GreaterSlantEqual', [10878]], ['GreaterTilde', [8819]], ['Gscr', [119970]], ['gscr', [8458]], ['gsim', [8819]], ['gsime', [10894]], ['gsiml', [10896]], ['gtcc', [10919]], ['gtcir', [10874]], ['gt', [62]], ['GT', [62]], ['Gt', [8811]], ['gtdot', [8919]], ['gtlPar', [10645]], ['gtquest', [10876]], ['gtrapprox', [10886]], ['gtrarr', [10616]], ['gtrdot', [8919]], ['gtreqless', [8923]], ['gtreqqless', [10892]], ['gtrless', [8823]], ['gtrsim', [8819]], ['gvertneqq', [8809, 65024]], ['gvnE', [8809, 65024]], ['Hacek', [711]], ['hairsp', [8202]], ['half', [189]], ['hamilt', [8459]], ['HARDcy', [1066]], ['hardcy', [1098]], ['harrcir', [10568]], ['harr', [8596]], ['hArr', [8660]], ['harrw', [8621]], ['Hat', [94]], ['hbar', [8463]], ['Hcirc', [292]], ['hcirc', [293]], ['hearts', [9829]], ['heartsuit', [9829]], ['hellip', [8230]], ['hercon', [8889]], ['hfr', [120101]], ['Hfr', [8460]], ['HilbertSpace', [8459]], ['hksearow', [10533]], ['hkswarow', [10534]], ['hoarr', [8703]], ['homtht', [8763]], ['hookleftarrow', [8617]], ['hookrightarrow', [8618]], ['hopf', [120153]], ['Hopf', [8461]], ['horbar', [8213]], ['HorizontalLine', [9472]], ['hscr', [119997]], ['Hscr', [8459]], ['hslash', [8463]], ['Hstrok', [294]], ['hstrok', [295]], ['HumpDownHump', [8782]], ['HumpEqual', [8783]], ['hybull', [8259]], ['hyphen', [8208]], ['Iacute', [205]], ['iacute', [237]], ['ic', [8291]], ['Icirc', [206]], ['icirc', [238]], ['Icy', [1048]], ['icy', [1080]], ['Idot', [304]], ['IEcy', [1045]], ['iecy', [1077]], ['iexcl', [161]], ['iff', [8660]], ['ifr', [120102]], ['Ifr', [8465]], ['Igrave', [204]], ['igrave', [236]], ['ii', [8520]], ['iiiint', [10764]], ['iiint', [8749]], ['iinfin', [10716]], ['iiota', [8489]], ['IJlig', [306]], ['ijlig', [307]], ['Imacr', [298]], ['imacr', [299]], ['image', [8465]], ['ImaginaryI', [8520]], ['imagline', [8464]], ['imagpart', [8465]], ['imath', [305]], ['Im', [8465]], ['imof', [8887]], ['imped', [437]], ['Implies', [8658]], ['incare', [8453]], ['in', [8712]], ['infin', [8734]], ['infintie', [10717]], ['inodot', [305]], ['intcal', [8890]], ['int', [8747]], ['Int', [8748]], ['integers', [8484]], ['Integral', [8747]], ['intercal', [8890]], ['Intersection', [8898]], ['intlarhk', [10775]], ['intprod', [10812]], ['InvisibleComma', [8291]], ['InvisibleTimes', [8290]], ['IOcy', [1025]], ['iocy', [1105]], ['Iogon', [302]], ['iogon', [303]], ['Iopf', [120128]], ['iopf', [120154]], ['Iota', [921]], ['iota', [953]], ['iprod', [10812]], ['iquest', [191]], ['iscr', [119998]], ['Iscr', [8464]], ['isin', [8712]], ['isindot', [8949]], ['isinE', [8953]], ['isins', [8948]], ['isinsv', [8947]], ['isinv', [8712]], ['it', [8290]], ['Itilde', [296]], ['itilde', [297]], ['Iukcy', [1030]], ['iukcy', [1110]], ['Iuml', [207]], ['iuml', [239]], ['Jcirc', [308]], ['jcirc', [309]], ['Jcy', [1049]], ['jcy', [1081]], ['Jfr', [120077]], ['jfr', [120103]], ['jmath', [567]], ['Jopf', [120129]], ['jopf', [120155]], ['Jscr', [119973]], ['jscr', [119999]], ['Jsercy', [1032]], ['jsercy', [1112]], ['Jukcy', [1028]], ['jukcy', [1108]], ['Kappa', [922]], ['kappa', [954]], ['kappav', [1008]], ['Kcedil', [310]], ['kcedil', [311]], ['Kcy', [1050]], ['kcy', [1082]], ['Kfr', [120078]], ['kfr', [120104]], ['kgreen', [312]], ['KHcy', [1061]], ['khcy', [1093]], ['KJcy', [1036]], ['kjcy', [1116]], ['Kopf', [120130]], ['kopf', [120156]], ['Kscr', [119974]], ['kscr', [120000]], ['lAarr', [8666]], ['Lacute', [313]], ['lacute', [314]], ['laemptyv', [10676]], ['lagran', [8466]], ['Lambda', [923]], ['lambda', [955]], ['lang', [10216]], ['Lang', [10218]], ['langd', [10641]], ['langle', [10216]], ['lap', [10885]], ['Laplacetrf', [8466]], ['laquo', [171]], ['larrb', [8676]], ['larrbfs', [10527]], ['larr', [8592]], ['Larr', [8606]], ['lArr', [8656]], ['larrfs', [10525]], ['larrhk', [8617]], ['larrlp', [8619]], ['larrpl', [10553]], ['larrsim', [10611]], ['larrtl', [8610]], ['latail', [10521]], ['lAtail', [10523]], ['lat', [10923]], ['late', [10925]], ['lates', [10925, 65024]], ['lbarr', [10508]], ['lBarr', [10510]], ['lbbrk', [10098]], ['lbrace', [123]], ['lbrack', [91]], ['lbrke', [10635]], ['lbrksld', [10639]], ['lbrkslu', [10637]], ['Lcaron', [317]], ['lcaron', [318]], ['Lcedil', [315]], ['lcedil', [316]], ['lceil', [8968]], ['lcub', [123]], ['Lcy', [1051]], ['lcy', [1083]], ['ldca', [10550]], ['ldquo', [8220]], ['ldquor', [8222]], ['ldrdhar', [10599]], ['ldrushar', [10571]], ['ldsh', [8626]], ['le', [8804]], ['lE', [8806]], ['LeftAngleBracket', [10216]], ['LeftArrowBar', [8676]], ['leftarrow', [8592]], ['LeftArrow', [8592]], ['Leftarrow', [8656]], ['LeftArrowRightArrow', [8646]], ['leftarrowtail', [8610]], ['LeftCeiling', [8968]], ['LeftDoubleBracket', [10214]], ['LeftDownTeeVector', [10593]], ['LeftDownVectorBar', [10585]], ['LeftDownVector', [8643]], ['LeftFloor', [8970]], ['leftharpoondown', [8637]], ['leftharpoonup', [8636]], ['leftleftarrows', [8647]], ['leftrightarrow', [8596]], ['LeftRightArrow', [8596]], ['Leftrightarrow', [8660]], ['leftrightarrows', [8646]], ['leftrightharpoons', [8651]], ['leftrightsquigarrow', [8621]], ['LeftRightVector', [10574]], ['LeftTeeArrow', [8612]], ['LeftTee', [8867]], ['LeftTeeVector', [10586]], ['leftthreetimes', [8907]], ['LeftTriangleBar', [10703]], ['LeftTriangle', [8882]], ['LeftTriangleEqual', [8884]], ['LeftUpDownVector', [10577]], ['LeftUpTeeVector', [10592]], ['LeftUpVectorBar', [10584]], ['LeftUpVector', [8639]], ['LeftVectorBar', [10578]], ['LeftVector', [8636]], ['lEg', [10891]], ['leg', [8922]], ['leq', [8804]], ['leqq', [8806]], ['leqslant', [10877]], ['lescc', [10920]], ['les', [10877]], ['lesdot', [10879]], ['lesdoto', [10881]], ['lesdotor', [10883]], ['lesg', [8922, 65024]], ['lesges', [10899]], ['lessapprox', [10885]], ['lessdot', [8918]], ['lesseqgtr', [8922]], ['lesseqqgtr', [10891]], ['LessEqualGreater', [8922]], ['LessFullEqual', [8806]], ['LessGreater', [8822]], ['lessgtr', [8822]], ['LessLess', [10913]], ['lesssim', [8818]], ['LessSlantEqual', [10877]], ['LessTilde', [8818]], ['lfisht', [10620]], ['lfloor', [8970]], ['Lfr', [120079]], ['lfr', [120105]], ['lg', [8822]], ['lgE', [10897]], ['lHar', [10594]], ['lhard', [8637]], ['lharu', [8636]], ['lharul', [10602]], ['lhblk', [9604]], ['LJcy', [1033]], ['ljcy', [1113]], ['llarr', [8647]], ['ll', [8810]], ['Ll', [8920]], ['llcorner', [8990]], ['Lleftarrow', [8666]], ['llhard', [10603]], ['lltri', [9722]], ['Lmidot', [319]], ['lmidot', [320]], ['lmoustache', [9136]], ['lmoust', [9136]], ['lnap', [10889]], ['lnapprox', [10889]], ['lne', [10887]], ['lnE', [8808]], ['lneq', [10887]], ['lneqq', [8808]], ['lnsim', [8934]], ['loang', [10220]], ['loarr', [8701]], ['lobrk', [10214]], ['longleftarrow', [10229]], ['LongLeftArrow', [10229]], ['Longleftarrow', [10232]], ['longleftrightarrow', [10231]], ['LongLeftRightArrow', [10231]], ['Longleftrightarrow', [10234]], ['longmapsto', [10236]], ['longrightarrow', [10230]], ['LongRightArrow', [10230]], ['Longrightarrow', [10233]], ['looparrowleft', [8619]], ['looparrowright', [8620]], ['lopar', [10629]], ['Lopf', [120131]], ['lopf', [120157]], ['loplus', [10797]], ['lotimes', [10804]], ['lowast', [8727]], ['lowbar', [95]], ['LowerLeftArrow', [8601]], ['LowerRightArrow', [8600]], ['loz', [9674]], ['lozenge', [9674]], ['lozf', [10731]], ['lpar', [40]], ['lparlt', [10643]], ['lrarr', [8646]], ['lrcorner', [8991]], ['lrhar', [8651]], ['lrhard', [10605]], ['lrm', [8206]], ['lrtri', [8895]], ['lsaquo', [8249]], ['lscr', [120001]], ['Lscr', [8466]], ['lsh', [8624]], ['Lsh', [8624]], ['lsim', [8818]], ['lsime', [10893]], ['lsimg', [10895]], ['lsqb', [91]], ['lsquo', [8216]], ['lsquor', [8218]], ['Lstrok', [321]], ['lstrok', [322]], ['ltcc', [10918]], ['ltcir', [10873]], ['lt', [60]], ['LT', [60]], ['Lt', [8810]], ['ltdot', [8918]], ['lthree', [8907]], ['ltimes', [8905]], ['ltlarr', [10614]], ['ltquest', [10875]], ['ltri', [9667]], ['ltrie', [8884]], ['ltrif', [9666]], ['ltrPar', [10646]], ['lurdshar', [10570]], ['luruhar', [10598]], ['lvertneqq', [8808, 65024]], ['lvnE', [8808, 65024]], ['macr', [175]], ['male', [9794]], ['malt', [10016]], ['maltese', [10016]], ['Map', [10501]], ['map', [8614]], ['mapsto', [8614]], ['mapstodown', [8615]], ['mapstoleft', [8612]], ['mapstoup', [8613]], ['marker', [9646]], ['mcomma', [10793]], ['Mcy', [1052]], ['mcy', [1084]], ['mdash', [8212]], ['mDDot', [8762]], ['measuredangle', [8737]], ['MediumSpace', [8287]], ['Mellintrf', [8499]], ['Mfr', [120080]], ['mfr', [120106]], ['mho', [8487]], ['micro', [181]], ['midast', [42]], ['midcir', [10992]], ['mid', [8739]], ['middot', [183]], ['minusb', [8863]], ['minus', [8722]], ['minusd', [8760]], ['minusdu', [10794]], ['MinusPlus', [8723]], ['mlcp', [10971]], ['mldr', [8230]], ['mnplus', [8723]], ['models', [8871]], ['Mopf', [120132]], ['mopf', [120158]], ['mp', [8723]], ['mscr', [120002]], ['Mscr', [8499]], ['mstpos', [8766]], ['Mu', [924]], ['mu', [956]], ['multimap', [8888]], ['mumap', [8888]], ['nabla', [8711]], ['Nacute', [323]], ['nacute', [324]], ['nang', [8736, 8402]], ['nap', [8777]], ['napE', [10864, 824]], ['napid', [8779, 824]], ['napos', [329]], ['napprox', [8777]], ['natural', [9838]], ['naturals', [8469]], ['natur', [9838]], ['nbsp', [160]], ['nbump', [8782, 824]], ['nbumpe', [8783, 824]], ['ncap', [10819]], ['Ncaron', [327]], ['ncaron', [328]], ['Ncedil', [325]], ['ncedil', [326]], ['ncong', [8775]], ['ncongdot', [10861, 824]], ['ncup', [10818]], ['Ncy', [1053]], ['ncy', [1085]], ['ndash', [8211]], ['nearhk', [10532]], ['nearr', [8599]], ['neArr', [8663]], ['nearrow', [8599]], ['ne', [8800]], ['nedot', [8784, 824]], ['NegativeMediumSpace', [8203]], ['NegativeThickSpace', [8203]], ['NegativeThinSpace', [8203]], ['NegativeVeryThinSpace', [8203]], ['nequiv', [8802]], ['nesear', [10536]], ['nesim', [8770, 824]], ['NestedGreaterGreater', [8811]], ['NestedLessLess', [8810]], ['nexist', [8708]], ['nexists', [8708]], ['Nfr', [120081]], ['nfr', [120107]], ['ngE', [8807, 824]], ['nge', [8817]], ['ngeq', [8817]], ['ngeqq', [8807, 824]], ['ngeqslant', [10878, 824]], ['nges', [10878, 824]], ['nGg', [8921, 824]], ['ngsim', [8821]], ['nGt', [8811, 8402]], ['ngt', [8815]], ['ngtr', [8815]], ['nGtv', [8811, 824]], ['nharr', [8622]], ['nhArr', [8654]], ['nhpar', [10994]], ['ni', [8715]], ['nis', [8956]], ['nisd', [8954]], ['niv', [8715]], ['NJcy', [1034]], ['njcy', [1114]], ['nlarr', [8602]], ['nlArr', [8653]], ['nldr', [8229]], ['nlE', [8806, 824]], ['nle', [8816]], ['nleftarrow', [8602]], ['nLeftarrow', [8653]], ['nleftrightarrow', [8622]], ['nLeftrightarrow', [8654]], ['nleq', [8816]], ['nleqq', [8806, 824]], ['nleqslant', [10877, 824]], ['nles', [10877, 824]], ['nless', [8814]], ['nLl', [8920, 824]], ['nlsim', [8820]], ['nLt', [8810, 8402]], ['nlt', [8814]], ['nltri', [8938]], ['nltrie', [8940]], ['nLtv', [8810, 824]], ['nmid', [8740]], ['NoBreak', [8288]], ['NonBreakingSpace', [160]], ['nopf', [120159]], ['Nopf', [8469]], ['Not', [10988]], ['not', [172]], ['NotCongruent', [8802]], ['NotCupCap', [8813]], ['NotDoubleVerticalBar', [8742]], ['NotElement', [8713]], ['NotEqual', [8800]], ['NotEqualTilde', [8770, 824]], ['NotExists', [8708]], ['NotGreater', [8815]], ['NotGreaterEqual', [8817]], ['NotGreaterFullEqual', [8807, 824]], ['NotGreaterGreater', [8811, 824]], ['NotGreaterLess', [8825]], ['NotGreaterSlantEqual', [10878, 824]], ['NotGreaterTilde', [8821]], ['NotHumpDownHump', [8782, 824]], ['NotHumpEqual', [8783, 824]], ['notin', [8713]], ['notindot', [8949, 824]], ['notinE', [8953, 824]], ['notinva', [8713]], ['notinvb', [8951]], ['notinvc', [8950]], ['NotLeftTriangleBar', [10703, 824]], ['NotLeftTriangle', [8938]], ['NotLeftTriangleEqual', [8940]], ['NotLess', [8814]], ['NotLessEqual', [8816]], ['NotLessGreater', [8824]], ['NotLessLess', [8810, 824]], ['NotLessSlantEqual', [10877, 824]], ['NotLessTilde', [8820]], ['NotNestedGreaterGreater', [10914, 824]], ['NotNestedLessLess', [10913, 824]], ['notni', [8716]], ['notniva', [8716]], ['notnivb', [8958]], ['notnivc', [8957]], ['NotPrecedes', [8832]], ['NotPrecedesEqual', [10927, 824]], ['NotPrecedesSlantEqual', [8928]], ['NotReverseElement', [8716]], ['NotRightTriangleBar', [10704, 824]], ['NotRightTriangle', [8939]], ['NotRightTriangleEqual', [8941]], ['NotSquareSubset', [8847, 824]], ['NotSquareSubsetEqual', [8930]], ['NotSquareSuperset', [8848, 824]], ['NotSquareSupersetEqual', [8931]], ['NotSubset', [8834, 8402]], ['NotSubsetEqual', [8840]], ['NotSucceeds', [8833]], ['NotSucceedsEqual', [10928, 824]], ['NotSucceedsSlantEqual', [8929]], ['NotSucceedsTilde', [8831, 824]], ['NotSuperset', [8835, 8402]], ['NotSupersetEqual', [8841]], ['NotTilde', [8769]], ['NotTildeEqual', [8772]], ['NotTildeFullEqual', [8775]], ['NotTildeTilde', [8777]], ['NotVerticalBar', [8740]], ['nparallel', [8742]], ['npar', [8742]], ['nparsl', [11005, 8421]], ['npart', [8706, 824]], ['npolint', [10772]], ['npr', [8832]], ['nprcue', [8928]], ['nprec', [8832]], ['npreceq', [10927, 824]], ['npre', [10927, 824]], ['nrarrc', [10547, 824]], ['nrarr', [8603]], ['nrArr', [8655]], ['nrarrw', [8605, 824]], ['nrightarrow', [8603]], ['nRightarrow', [8655]], ['nrtri', [8939]], ['nrtrie', [8941]], ['nsc', [8833]], ['nsccue', [8929]], ['nsce', [10928, 824]], ['Nscr', [119977]], ['nscr', [120003]], ['nshortmid', [8740]], ['nshortparallel', [8742]], ['nsim', [8769]], ['nsime', [8772]], ['nsimeq', [8772]], ['nsmid', [8740]], ['nspar', [8742]], ['nsqsube', [8930]], ['nsqsupe', [8931]], ['nsub', [8836]], ['nsubE', [10949, 824]], ['nsube', [8840]], ['nsubset', [8834, 8402]], ['nsubseteq', [8840]], ['nsubseteqq', [10949, 824]], ['nsucc', [8833]], ['nsucceq', [10928, 824]], ['nsup', [8837]], ['nsupE', [10950, 824]], ['nsupe', [8841]], ['nsupset', [8835, 8402]], ['nsupseteq', [8841]], ['nsupseteqq', [10950, 824]], ['ntgl', [8825]], ['Ntilde', [209]], ['ntilde', [241]], ['ntlg', [8824]], ['ntriangleleft', [8938]], ['ntrianglelefteq', [8940]], ['ntriangleright', [8939]], ['ntrianglerighteq', [8941]], ['Nu', [925]], ['nu', [957]], ['num', [35]], ['numero', [8470]], ['numsp', [8199]], ['nvap', [8781, 8402]], ['nvdash', [8876]], ['nvDash', [8877]], ['nVdash', [8878]], ['nVDash', [8879]], ['nvge', [8805, 8402]], ['nvgt', [62, 8402]], ['nvHarr', [10500]], ['nvinfin', [10718]], ['nvlArr', [10498]], ['nvle', [8804, 8402]], ['nvlt', [60, 8402]], ['nvltrie', [8884, 8402]], ['nvrArr', [10499]], ['nvrtrie', [8885, 8402]], ['nvsim', [8764, 8402]], ['nwarhk', [10531]], ['nwarr', [8598]], ['nwArr', [8662]], ['nwarrow', [8598]], ['nwnear', [10535]], ['Oacute', [211]], ['oacute', [243]], ['oast', [8859]], ['Ocirc', [212]], ['ocirc', [244]], ['ocir', [8858]], ['Ocy', [1054]], ['ocy', [1086]], ['odash', [8861]], ['Odblac', [336]], ['odblac', [337]], ['odiv', [10808]], ['odot', [8857]], ['odsold', [10684]], ['OElig', [338]], ['oelig', [339]], ['ofcir', [10687]], ['Ofr', [120082]], ['ofr', [120108]], ['ogon', [731]], ['Ograve', [210]], ['ograve', [242]], ['ogt', [10689]], ['ohbar', [10677]], ['ohm', [937]], ['oint', [8750]], ['olarr', [8634]], ['olcir', [10686]], ['olcross', [10683]], ['oline', [8254]], ['olt', [10688]], ['Omacr', [332]], ['omacr', [333]], ['Omega', [937]], ['omega', [969]], ['Omicron', [927]], ['omicron', [959]], ['omid', [10678]], ['ominus', [8854]], ['Oopf', [120134]], ['oopf', [120160]], ['opar', [10679]], ['OpenCurlyDoubleQuote', [8220]], ['OpenCurlyQuote', [8216]], ['operp', [10681]], ['oplus', [8853]], ['orarr', [8635]], ['Or', [10836]], ['or', [8744]], ['ord', [10845]], ['order', [8500]], ['orderof', [8500]], ['ordf', [170]], ['ordm', [186]], ['origof', [8886]], ['oror', [10838]], ['orslope', [10839]], ['orv', [10843]], ['oS', [9416]], ['Oscr', [119978]], ['oscr', [8500]], ['Oslash', [216]], ['oslash', [248]], ['osol', [8856]], ['Otilde', [213]], ['otilde', [245]], ['otimesas', [10806]], ['Otimes', [10807]], ['otimes', [8855]], ['Ouml', [214]], ['ouml', [246]], ['ovbar', [9021]], ['OverBar', [8254]], ['OverBrace', [9182]], ['OverBracket', [9140]], ['OverParenthesis', [9180]], ['para', [182]], ['parallel', [8741]], ['par', [8741]], ['parsim', [10995]], ['parsl', [11005]], ['part', [8706]], ['PartialD', [8706]], ['Pcy', [1055]], ['pcy', [1087]], ['percnt', [37]], ['period', [46]], ['permil', [8240]], ['perp', [8869]], ['pertenk', [8241]], ['Pfr', [120083]], ['pfr', [120109]], ['Phi', [934]], ['phi', [966]], ['phiv', [981]], ['phmmat', [8499]], ['phone', [9742]], ['Pi', [928]], ['pi', [960]], ['pitchfork', [8916]], ['piv', [982]], ['planck', [8463]], ['planckh', [8462]], ['plankv', [8463]], ['plusacir', [10787]], ['plusb', [8862]], ['pluscir', [10786]], ['plus', [43]], ['plusdo', [8724]], ['plusdu', [10789]], ['pluse', [10866]], ['PlusMinus', [177]], ['plusmn', [177]], ['plussim', [10790]], ['plustwo', [10791]], ['pm', [177]], ['Poincareplane', [8460]], ['pointint', [10773]], ['popf', [120161]], ['Popf', [8473]], ['pound', [163]], ['prap', [10935]], ['Pr', [10939]], ['pr', [8826]], ['prcue', [8828]], ['precapprox', [10935]], ['prec', [8826]], ['preccurlyeq', [8828]], ['Precedes', [8826]], ['PrecedesEqual', [10927]], ['PrecedesSlantEqual', [8828]], ['PrecedesTilde', [8830]], ['preceq', [10927]], ['precnapprox', [10937]], ['precneqq', [10933]], ['precnsim', [8936]], ['pre', [10927]], ['prE', [10931]], ['precsim', [8830]], ['prime', [8242]], ['Prime', [8243]], ['primes', [8473]], ['prnap', [10937]], ['prnE', [10933]], ['prnsim', [8936]], ['prod', [8719]], ['Product', [8719]], ['profalar', [9006]], ['profline', [8978]], ['profsurf', [8979]], ['prop', [8733]], ['Proportional', [8733]], ['Proportion', [8759]], ['propto', [8733]], ['prsim', [8830]], ['prurel', [8880]], ['Pscr', [119979]], ['pscr', [120005]], ['Psi', [936]], ['psi', [968]], ['puncsp', [8200]], ['Qfr', [120084]], ['qfr', [120110]], ['qint', [10764]], ['qopf', [120162]], ['Qopf', [8474]], ['qprime', [8279]], ['Qscr', [119980]], ['qscr', [120006]], ['quaternions', [8461]], ['quatint', [10774]], ['quest', [63]], ['questeq', [8799]], ['quot', [34]], ['QUOT', [34]], ['rAarr', [8667]], ['race', [8765, 817]], ['Racute', [340]], ['racute', [341]], ['radic', [8730]], ['raemptyv', [10675]], ['rang', [10217]], ['Rang', [10219]], ['rangd', [10642]], ['range', [10661]], ['rangle', [10217]], ['raquo', [187]], ['rarrap', [10613]], ['rarrb', [8677]], ['rarrbfs', [10528]], ['rarrc', [10547]], ['rarr', [8594]], ['Rarr', [8608]], ['rArr', [8658]], ['rarrfs', [10526]], ['rarrhk', [8618]], ['rarrlp', [8620]], ['rarrpl', [10565]], ['rarrsim', [10612]], ['Rarrtl', [10518]], ['rarrtl', [8611]], ['rarrw', [8605]], ['ratail', [10522]], ['rAtail', [10524]], ['ratio', [8758]], ['rationals', [8474]], ['rbarr', [10509]], ['rBarr', [10511]], ['RBarr', [10512]], ['rbbrk', [10099]], ['rbrace', [125]], ['rbrack', [93]], ['rbrke', [10636]], ['rbrksld', [10638]], ['rbrkslu', [10640]], ['Rcaron', [344]], ['rcaron', [345]], ['Rcedil', [342]], ['rcedil', [343]], ['rceil', [8969]], ['rcub', [125]], ['Rcy', [1056]], ['rcy', [1088]], ['rdca', [10551]], ['rdldhar', [10601]], ['rdquo', [8221]], ['rdquor', [8221]], ['CloseCurlyDoubleQuote', [8221]], ['rdsh', [8627]], ['real', [8476]], ['realine', [8475]], ['realpart', [8476]], ['reals', [8477]], ['Re', [8476]], ['rect', [9645]], ['reg', [174]], ['REG', [174]], ['ReverseElement', [8715]], ['ReverseEquilibrium', [8651]], ['ReverseUpEquilibrium', [10607]], ['rfisht', [10621]], ['rfloor', [8971]], ['rfr', [120111]], ['Rfr', [8476]], ['rHar', [10596]], ['rhard', [8641]], ['rharu', [8640]], ['rharul', [10604]], ['Rho', [929]], ['rho', [961]], ['rhov', [1009]], ['RightAngleBracket', [10217]], ['RightArrowBar', [8677]], ['rightarrow', [8594]], ['RightArrow', [8594]], ['Rightarrow', [8658]], ['RightArrowLeftArrow', [8644]], ['rightarrowtail', [8611]], ['RightCeiling', [8969]], ['RightDoubleBracket', [10215]], ['RightDownTeeVector', [10589]], ['RightDownVectorBar', [10581]], ['RightDownVector', [8642]], ['RightFloor', [8971]], ['rightharpoondown', [8641]], ['rightharpoonup', [8640]], ['rightleftarrows', [8644]], ['rightleftharpoons', [8652]], ['rightrightarrows', [8649]], ['rightsquigarrow', [8605]], ['RightTeeArrow', [8614]], ['RightTee', [8866]], ['RightTeeVector', [10587]], ['rightthreetimes', [8908]], ['RightTriangleBar', [10704]], ['RightTriangle', [8883]], ['RightTriangleEqual', [8885]], ['RightUpDownVector', [10575]], ['RightUpTeeVector', [10588]], ['RightUpVectorBar', [10580]], ['RightUpVector', [8638]], ['RightVectorBar', [10579]], ['RightVector', [8640]], ['ring', [730]], ['risingdotseq', [8787]], ['rlarr', [8644]], ['rlhar', [8652]], ['rlm', [8207]], ['rmoustache', [9137]], ['rmoust', [9137]], ['rnmid', [10990]], ['roang', [10221]], ['roarr', [8702]], ['robrk', [10215]], ['ropar', [10630]], ['ropf', [120163]], ['Ropf', [8477]], ['roplus', [10798]], ['rotimes', [10805]], ['RoundImplies', [10608]], ['rpar', [41]], ['rpargt', [10644]], ['rppolint', [10770]], ['rrarr', [8649]], ['Rrightarrow', [8667]], ['rsaquo', [8250]], ['rscr', [120007]], ['Rscr', [8475]], ['rsh', [8625]], ['Rsh', [8625]], ['rsqb', [93]], ['rsquo', [8217]], ['rsquor', [8217]], ['CloseCurlyQuote', [8217]], ['rthree', [8908]], ['rtimes', [8906]], ['rtri', [9657]], ['rtrie', [8885]], ['rtrif', [9656]], ['rtriltri', [10702]], ['RuleDelayed', [10740]], ['ruluhar', [10600]], ['rx', [8478]], ['Sacute', [346]], ['sacute', [347]], ['sbquo', [8218]], ['scap', [10936]], ['Scaron', [352]], ['scaron', [353]], ['Sc', [10940]], ['sc', [8827]], ['sccue', [8829]], ['sce', [10928]], ['scE', [10932]], ['Scedil', [350]], ['scedil', [351]], ['Scirc', [348]], ['scirc', [349]], ['scnap', [10938]], ['scnE', [10934]], ['scnsim', [8937]], ['scpolint', [10771]], ['scsim', [8831]], ['Scy', [1057]], ['scy', [1089]], ['sdotb', [8865]], ['sdot', [8901]], ['sdote', [10854]], ['searhk', [10533]], ['searr', [8600]], ['seArr', [8664]], ['searrow', [8600]], ['sect', [167]], ['semi', [59]], ['seswar', [10537]], ['setminus', [8726]], ['setmn', [8726]], ['sext', [10038]], ['Sfr', [120086]], ['sfr', [120112]], ['sfrown', [8994]], ['sharp', [9839]], ['SHCHcy', [1065]], ['shchcy', [1097]], ['SHcy', [1064]], ['shcy', [1096]], ['ShortDownArrow', [8595]], ['ShortLeftArrow', [8592]], ['shortmid', [8739]], ['shortparallel', [8741]], ['ShortRightArrow', [8594]], ['ShortUpArrow', [8593]], ['shy', [173]], ['Sigma', [931]], ['sigma', [963]], ['sigmaf', [962]], ['sigmav', [962]], ['sim', [8764]], ['simdot', [10858]], ['sime', [8771]], ['simeq', [8771]], ['simg', [10910]], ['simgE', [10912]], ['siml', [10909]], ['simlE', [10911]], ['simne', [8774]], ['simplus', [10788]], ['simrarr', [10610]], ['slarr', [8592]], ['SmallCircle', [8728]], ['smallsetminus', [8726]], ['smashp', [10803]], ['smeparsl', [10724]], ['smid', [8739]], ['smile', [8995]], ['smt', [10922]], ['smte', [10924]], ['smtes', [10924, 65024]], ['SOFTcy', [1068]], ['softcy', [1100]], ['solbar', [9023]], ['solb', [10692]], ['sol', [47]], ['Sopf', [120138]], ['sopf', [120164]], ['spades', [9824]], ['spadesuit', [9824]], ['spar', [8741]], ['sqcap', [8851]], ['sqcaps', [8851, 65024]], ['sqcup', [8852]], ['sqcups', [8852, 65024]], ['Sqrt', [8730]], ['sqsub', [8847]], ['sqsube', [8849]], ['sqsubset', [8847]], ['sqsubseteq', [8849]], ['sqsup', [8848]], ['sqsupe', [8850]], ['sqsupset', [8848]], ['sqsupseteq', [8850]], ['square', [9633]], ['Square', [9633]], ['SquareIntersection', [8851]], ['SquareSubset', [8847]], ['SquareSubsetEqual', [8849]], ['SquareSuperset', [8848]], ['SquareSupersetEqual', [8850]], ['SquareUnion', [8852]], ['squarf', [9642]], ['squ', [9633]], ['squf', [9642]], ['srarr', [8594]], ['Sscr', [119982]], ['sscr', [120008]], ['ssetmn', [8726]], ['ssmile', [8995]], ['sstarf', [8902]], ['Star', [8902]], ['star', [9734]], ['starf', [9733]], ['straightepsilon', [1013]], ['straightphi', [981]], ['strns', [175]], ['sub', [8834]], ['Sub', [8912]], ['subdot', [10941]], ['subE', [10949]], ['sube', [8838]], ['subedot', [10947]], ['submult', [10945]], ['subnE', [10955]], ['subne', [8842]], ['subplus', [10943]], ['subrarr', [10617]], ['subset', [8834]], ['Subset', [8912]], ['subseteq', [8838]], ['subseteqq', [10949]], ['SubsetEqual', [8838]], ['subsetneq', [8842]], ['subsetneqq', [10955]], ['subsim', [10951]], ['subsub', [10965]], ['subsup', [10963]], ['succapprox', [10936]], ['succ', [8827]], ['succcurlyeq', [8829]], ['Succeeds', [8827]], ['SucceedsEqual', [10928]], ['SucceedsSlantEqual', [8829]], ['SucceedsTilde', [8831]], ['succeq', [10928]], ['succnapprox', [10938]], ['succneqq', [10934]], ['succnsim', [8937]], ['succsim', [8831]], ['SuchThat', [8715]], ['sum', [8721]], ['Sum', [8721]], ['sung', [9834]], ['sup1', [185]], ['sup2', [178]], ['sup3', [179]], ['sup', [8835]], ['Sup', [8913]], ['supdot', [10942]], ['supdsub', [10968]], ['supE', [10950]], ['supe', [8839]], ['supedot', [10948]], ['Superset', [8835]], ['SupersetEqual', [8839]], ['suphsol', [10185]], ['suphsub', [10967]], ['suplarr', [10619]], ['supmult', [10946]], ['supnE', [10956]], ['supne', [8843]], ['supplus', [10944]], ['supset', [8835]], ['Supset', [8913]], ['supseteq', [8839]], ['supseteqq', [10950]], ['supsetneq', [8843]], ['supsetneqq', [10956]], ['supsim', [10952]], ['supsub', [10964]], ['supsup', [10966]], ['swarhk', [10534]], ['swarr', [8601]], ['swArr', [8665]], ['swarrow', [8601]], ['swnwar', [10538]], ['szlig', [223]], ['Tab', [9]], ['target', [8982]], ['Tau', [932]], ['tau', [964]], ['tbrk', [9140]], ['Tcaron', [356]], ['tcaron', [357]], ['Tcedil', [354]], ['tcedil', [355]], ['Tcy', [1058]], ['tcy', [1090]], ['tdot', [8411]], ['telrec', [8981]], ['Tfr', [120087]], ['tfr', [120113]], ['there4', [8756]], ['therefore', [8756]], ['Therefore', [8756]], ['Theta', [920]], ['theta', [952]], ['thetasym', [977]], ['thetav', [977]], ['thickapprox', [8776]], ['thicksim', [8764]], ['ThickSpace', [8287, 8202]], ['ThinSpace', [8201]], ['thinsp', [8201]], ['thkap', [8776]], ['thksim', [8764]], ['THORN', [222]], ['thorn', [254]], ['tilde', [732]], ['Tilde', [8764]], ['TildeEqual', [8771]], ['TildeFullEqual', [8773]], ['TildeTilde', [8776]], ['timesbar', [10801]], ['timesb', [8864]], ['times', [215]], ['timesd', [10800]], ['tint', [8749]], ['toea', [10536]], ['topbot', [9014]], ['topcir', [10993]], ['top', [8868]], ['Topf', [120139]], ['topf', [120165]], ['topfork', [10970]], ['tosa', [10537]], ['tprime', [8244]], ['trade', [8482]], ['TRADE', [8482]], ['triangle', [9653]], ['triangledown', [9663]], ['triangleleft', [9667]], ['trianglelefteq', [8884]], ['triangleq', [8796]], ['triangleright', [9657]], ['trianglerighteq', [8885]], ['tridot', [9708]], ['trie', [8796]], ['triminus', [10810]], ['TripleDot', [8411]], ['triplus', [10809]], ['trisb', [10701]], ['tritime', [10811]], ['trpezium', [9186]], ['Tscr', [119983]], ['tscr', [120009]], ['TScy', [1062]], ['tscy', [1094]], ['TSHcy', [1035]], ['tshcy', [1115]], ['Tstrok', [358]], ['tstrok', [359]], ['twixt', [8812]], ['twoheadleftarrow', [8606]], ['twoheadrightarrow', [8608]], ['Uacute', [218]], ['uacute', [250]], ['uarr', [8593]], ['Uarr', [8607]], ['uArr', [8657]], ['Uarrocir', [10569]], ['Ubrcy', [1038]], ['ubrcy', [1118]], ['Ubreve', [364]], ['ubreve', [365]], ['Ucirc', [219]], ['ucirc', [251]], ['Ucy', [1059]], ['ucy', [1091]], ['udarr', [8645]], ['Udblac', [368]], ['udblac', [369]], ['udhar', [10606]], ['ufisht', [10622]], ['Ufr', [120088]], ['ufr', [120114]], ['Ugrave', [217]], ['ugrave', [249]], ['uHar', [10595]], ['uharl', [8639]], ['uharr', [8638]], ['uhblk', [9600]], ['ulcorn', [8988]], ['ulcorner', [8988]], ['ulcrop', [8975]], ['ultri', [9720]], ['Umacr', [362]], ['umacr', [363]], ['uml', [168]], ['UnderBar', [95]], ['UnderBrace', [9183]], ['UnderBracket', [9141]], ['UnderParenthesis', [9181]], ['Union', [8899]], ['UnionPlus', [8846]], ['Uogon', [370]], ['uogon', [371]], ['Uopf', [120140]], ['uopf', [120166]], ['UpArrowBar', [10514]], ['uparrow', [8593]], ['UpArrow', [8593]], ['Uparrow', [8657]], ['UpArrowDownArrow', [8645]], ['updownarrow', [8597]], ['UpDownArrow', [8597]], ['Updownarrow', [8661]], ['UpEquilibrium', [10606]], ['upharpoonleft', [8639]], ['upharpoonright', [8638]], ['uplus', [8846]], ['UpperLeftArrow', [8598]], ['UpperRightArrow', [8599]], ['upsi', [965]], ['Upsi', [978]], ['upsih', [978]], ['Upsilon', [933]], ['upsilon', [965]], ['UpTeeArrow', [8613]], ['UpTee', [8869]], ['upuparrows', [8648]], ['urcorn', [8989]], ['urcorner', [8989]], ['urcrop', [8974]], ['Uring', [366]], ['uring', [367]], ['urtri', [9721]], ['Uscr', [119984]], ['uscr', [120010]], ['utdot', [8944]], ['Utilde', [360]], ['utilde', [361]], ['utri', [9653]], ['utrif', [9652]], ['uuarr', [8648]], ['Uuml', [220]], ['uuml', [252]], ['uwangle', [10663]], ['vangrt', [10652]], ['varepsilon', [1013]], ['varkappa', [1008]], ['varnothing', [8709]], ['varphi', [981]], ['varpi', [982]], ['varpropto', [8733]], ['varr', [8597]], ['vArr', [8661]], ['varrho', [1009]], ['varsigma', [962]], ['varsubsetneq', [8842, 65024]], ['varsubsetneqq', [10955, 65024]], ['varsupsetneq', [8843, 65024]], ['varsupsetneqq', [10956, 65024]], ['vartheta', [977]], ['vartriangleleft', [8882]], ['vartriangleright', [8883]], ['vBar', [10984]], ['Vbar', [10987]], ['vBarv', [10985]], ['Vcy', [1042]], ['vcy', [1074]], ['vdash', [8866]], ['vDash', [8872]], ['Vdash', [8873]], ['VDash', [8875]], ['Vdashl', [10982]], ['veebar', [8891]], ['vee', [8744]], ['Vee', [8897]], ['veeeq', [8794]], ['vellip', [8942]], ['verbar', [124]], ['Verbar', [8214]], ['vert', [124]], ['Vert', [8214]], ['VerticalBar', [8739]], ['VerticalLine', [124]], ['VerticalSeparator', [10072]], ['VerticalTilde', [8768]], ['VeryThinSpace', [8202]], ['Vfr', [120089]], ['vfr', [120115]], ['vltri', [8882]], ['vnsub', [8834, 8402]], ['vnsup', [8835, 8402]], ['Vopf', [120141]], ['vopf', [120167]], ['vprop', [8733]], ['vrtri', [8883]], ['Vscr', [119985]], ['vscr', [120011]], ['vsubnE', [10955, 65024]], ['vsubne', [8842, 65024]], ['vsupnE', [10956, 65024]], ['vsupne', [8843, 65024]], ['Vvdash', [8874]], ['vzigzag', [10650]], ['Wcirc', [372]], ['wcirc', [373]], ['wedbar', [10847]], ['wedge', [8743]], ['Wedge', [8896]], ['wedgeq', [8793]], ['weierp', [8472]], ['Wfr', [120090]], ['wfr', [120116]], ['Wopf', [120142]], ['wopf', [120168]], ['wp', [8472]], ['wr', [8768]], ['wreath', [8768]], ['Wscr', [119986]], ['wscr', [120012]], ['xcap', [8898]], ['xcirc', [9711]], ['xcup', [8899]], ['xdtri', [9661]], ['Xfr', [120091]], ['xfr', [120117]], ['xharr', [10231]], ['xhArr', [10234]], ['Xi', [926]], ['xi', [958]], ['xlarr', [10229]], ['xlArr', [10232]], ['xmap', [10236]], ['xnis', [8955]], ['xodot', [10752]], ['Xopf', [120143]], ['xopf', [120169]], ['xoplus', [10753]], ['xotime', [10754]], ['xrarr', [10230]], ['xrArr', [10233]], ['Xscr', [119987]], ['xscr', [120013]], ['xsqcup', [10758]], ['xuplus', [10756]], ['xutri', [9651]], ['xvee', [8897]], ['xwedge', [8896]], ['Yacute', [221]], ['yacute', [253]], ['YAcy', [1071]], ['yacy', [1103]], ['Ycirc', [374]], ['ycirc', [375]], ['Ycy', [1067]], ['ycy', [1099]], ['yen', [165]], ['Yfr', [120092]], ['yfr', [120118]], ['YIcy', [1031]], ['yicy', [1111]], ['Yopf', [120144]], ['yopf', [120170]], ['Yscr', [119988]], ['yscr', [120014]], ['YUcy', [1070]], ['yucy', [1102]], ['yuml', [255]], ['Yuml', [376]], ['Zacute', [377]], ['zacute', [378]], ['Zcaron', [381]], ['zcaron', [382]], ['Zcy', [1047]], ['zcy', [1079]], ['Zdot', [379]], ['zdot', [380]], ['zeetrf', [8488]], ['ZeroWidthSpace', [8203]], ['Zeta', [918]], ['zeta', [950]], ['zfr', [120119]], ['Zfr', [8488]], ['ZHcy', [1046]], ['zhcy', [1078]], ['zigrarr', [8669]], ['zopf', [120171]], ['Zopf', [8484]], ['Zscr', [119989]], ['zscr', [120015]], ['zwj', [8205]], ['zwnj', [8204]]]; + var DECODE_ONLY_ENTITIES = [['NewLine', [10]]]; + var alphaIndex = {}; + var charIndex = {}; + createIndexes(alphaIndex, charIndex); + + var Html5Entities = function () { + function Html5Entities() {} + + Html5Entities.prototype.decode = function (str) { + if (!str || !str.length) { + return ''; + } + + return str.replace(/&(#?[\w\d]+);?/g, function (s, entity) { + var chr; + + if (entity.charAt(0) === "#") { + var code = entity.charAt(1) === 'x' ? parseInt(entity.substr(2).toLowerCase(), 16) : parseInt(entity.substr(1)); + + if (!isNaN(code) || code >= -32768) { + if (code <= 65535) { + chr = String.fromCharCode(code); + } else { + chr = _$$_REQUIRE(_dependencyMap[0]).fromCodePoint(code); + } + } + } else { + chr = alphaIndex[entity]; + } + + return chr || s; + }); + }; + + Html5Entities.decode = function (str) { + return new Html5Entities().decode(str); + }; + + Html5Entities.prototype.encode = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var charInfo = charIndex[str.charCodeAt(i)]; + + if (charInfo) { + var alpha = charInfo[str.charCodeAt(i + 1)]; + + if (alpha) { + i++; + } else { + alpha = charInfo['']; + } + + if (alpha) { + result += "&" + alpha + ";"; + i++; + continue; + } + } + + result += str.charAt(i); + i++; + } + + return result; + }; + + Html5Entities.encode = function (str) { + return new Html5Entities().encode(str); + }; + + Html5Entities.prototype.encodeNonUTF = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var c = str.charCodeAt(i); + var charInfo = charIndex[c]; + + if (charInfo) { + var alpha = charInfo[str.charCodeAt(i + 1)]; + + if (alpha) { + i++; + } else { + alpha = charInfo['']; + } + + if (alpha) { + result += "&" + alpha + ";"; + i++; + continue; + } + } + + if (c < 32 || c > 126) { + if (c >= _$$_REQUIRE(_dependencyMap[0]).highSurrogateFrom && c <= _$$_REQUIRE(_dependencyMap[0]).highSurrogateTo) { + result += '&#' + _$$_REQUIRE(_dependencyMap[0]).getCodePoint(str, i) + ';'; + i++; + } else { + result += '&#' + c + ';'; + } + } else { + result += str.charAt(i); + } + + i++; + } + + return result; + }; + + Html5Entities.encodeNonUTF = function (str) { + return new Html5Entities().encodeNonUTF(str); + }; + + Html5Entities.prototype.encodeNonASCII = function (str) { + if (!str || !str.length) { + return ''; + } + + var strLength = str.length; + var result = ''; + var i = 0; + + while (i < strLength) { + var c = str.charCodeAt(i); + + if (c <= 255) { + result += str[i++]; + continue; + } + + if (c >= _$$_REQUIRE(_dependencyMap[0]).highSurrogateFrom && c <= _$$_REQUIRE(_dependencyMap[0]).highSurrogateTo) { + result += '&#' + _$$_REQUIRE(_dependencyMap[0]).getCodePoint(str, i) + ';'; + i += 2; + } else { + result += '&#' + c + ';'; + i++; + } + } + + return result; + }; + + Html5Entities.encodeNonASCII = function (str) { + return new Html5Entities().encodeNonASCII(str); + }; + + return Html5Entities; + }(); + + exports.Html5Entities = Html5Entities; + + function createIndexes(alphaIndex, charIndex) { + var i = ENTITIES.length; + + while (i--) { + var _a = ENTITIES[i], + alpha = _a[0], + _b = _a[1], + chr = _b[0], + chr2 = _b[1]; + var addChar = chr < 32 || chr > 126 || chr === 62 || chr === 60 || chr === 38 || chr === 34 || chr === 39; + var charInfo = undefined; + + if (addChar) { + charInfo = charIndex[chr] = charIndex[chr] || {}; + } + + if (chr2) { + alphaIndex[alpha] = String.fromCharCode(chr) + String.fromCharCode(chr2); + addChar && (charInfo[chr2] = alpha); + } else { + alphaIndex[alpha] = String.fromCharCode(chr); + addChar && (charInfo[''] = alpha); + } + } + + i = DECODE_ONLY_ENTITIES.length; + + while (i--) { + var _c = DECODE_ONLY_ENTITIES[i], + alpha = _c[0], + _d = _c[1], + chr = _d[0], + chr2 = _d[1]; + alphaIndex[alpha] = String.fromCharCode(chr) + (chr2 ? String.fromCharCode(chr2) : ''); + } + } +},525,[523]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function DOMParser(options) { + this.options = options || { + locator: {} + }; + } + + DOMParser.prototype.parseFromString = function (source, mimeType) { + var options = this.options; + var sax = new XMLReader(); + var domBuilder = options.domBuilder || new DOMHandler(); + var errorHandler = options.errorHandler; + var locator = options.locator; + var defaultNSMap = options.xmlns || {}; + + if (typeof _$$_REQUIRE == 'function') { + var entityMap = _$$_REQUIRE(_dependencyMap[0]).EntityMap; + } + + if (locator) { + domBuilder.setDocumentLocator(locator); + } + + sax.errorHandler = buildErrorHandler(errorHandler, domBuilder, locator); + sax.domBuilder = options.domBuilder || domBuilder; + + if (/\/x?html?$/.test(mimeType)) { + entityMap.nbsp = '\xa0'; + entityMap.copy = '\xa9'; + defaultNSMap[''] = 'http://www.w3.org/1999/xhtml'; + } + + defaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace'; + + if (source) { + sax.parse(source, defaultNSMap, entityMap); + } else { + sax.errorHandler.error("invalid document source"); + } + + return domBuilder.document; + }; + + function buildErrorHandler(errorImpl, domBuilder, locator) { + if (!errorImpl) { + if (domBuilder instanceof DOMHandler) { + return domBuilder; + } + + errorImpl = domBuilder; + } + + var errorHandler = {}; + var isCallback = errorImpl instanceof Function; + locator = locator || {}; + + function build(key) { + var fn = errorImpl[key]; + + if (!fn && isCallback) { + fn = errorImpl.length == 2 ? function (msg) { + errorImpl(key, msg); + } : errorImpl; + } + + errorHandler[key] = fn && function (msg) { + fn('[xmldom ' + key + ']\t' + msg + _locator(locator)); + } || function () {}; + } + + build('warning'); + build('error'); + build('fatalError'); + return errorHandler; + } + + function DOMHandler() { + this.cdata = false; + } + + function position(locator, node) { + node.lineNumber = locator.lineNumber; + node.columnNumber = locator.columnNumber; + } + + DOMHandler.prototype = { + startDocument: function startDocument() { + this.document = new DOMImplementation().createDocument(null, null, null); + + if (this.locator) { + this.document.documentURI = this.locator.systemId; + } + }, + startElement: function startElement(namespaceURI, localName, qName, attrs) { + var doc = this.document; + var el = doc.createElementNS(namespaceURI, qName || localName); + var len = attrs.length; + appendElement(this, el); + this.currentElement = el; + this.locator && position(this.locator, el); + + for (var i = 0; i < len; i++) { + var namespaceURI = attrs.getURI(i); + var value = attrs.getValue(i); + var qName = attrs.getQName(i); + var attr = doc.createAttributeNS(namespaceURI, qName); + + if (attr.getOffset) { + position(attr.getOffset(1), attr); + } + + attr.value = attr.nodeValue = value; + el.setAttributeNode(attr); + } + }, + endElement: function endElement(namespaceURI, localName, qName) { + var current = this.currentElement; + var tagName = current.tagName; + this.currentElement = current.parentNode; + }, + startPrefixMapping: function startPrefixMapping(prefix, uri) {}, + endPrefixMapping: function endPrefixMapping(prefix) {}, + processingInstruction: function processingInstruction(target, data) { + var ins = this.document.createProcessingInstruction(target, data); + this.locator && position(this.locator, ins); + appendElement(this, ins); + }, + ignorableWhitespace: function ignorableWhitespace(ch, start, length) {}, + characters: function characters(chars, start, length) { + chars = _toString.apply(this, arguments); + + if (this.currentElement && chars) { + if (this.cdata) { + var charNode = this.document.createCDATASection(chars); + this.currentElement.appendChild(charNode); + } else { + var charNode = this.document.createTextNode(chars); + this.currentElement.appendChild(charNode); + } + + this.locator && position(this.locator, charNode); + } + }, + skippedEntity: function skippedEntity(name) {}, + endDocument: function endDocument() { + this.document.normalize(); + }, + setDocumentLocator: function setDocumentLocator(locator) { + if (this.locator = locator) { + locator.lineNumber = 0; + } + }, + comment: function comment(chars, start, length) { + chars = _toString.apply(this, arguments); + var comm = this.document.createComment(chars); + this.locator && position(this.locator, comm); + appendElement(this, comm); + }, + startCDATA: function startCDATA() { + this.cdata = true; + }, + endCDATA: function endCDATA() { + this.cdata = false; + }, + startDTD: function startDTD(name, publicId, systemId) { + var impl = this.document.implementation; + + if (impl && impl.createDocumentType) { + var dt = impl.createDocumentType(name, publicId, systemId); + this.locator && position(this.locator, dt); + appendElement(this, dt); + } + }, + warning: function warning(error) { + console.warn('[xmldom warning]\t' + error, _locator(this.locator)); + }, + error: function error(_error) { + console.error('[xmldom error]\t' + _error, _locator(this.locator)); + }, + fatalError: function fatalError(error) { + console.error('[xmldom fatalError]\t' + error, _locator(this.locator)); + throw error; + } + }; + + function _locator(l) { + if (l) { + return '\n@' + (l.systemId || '') + '#[line:' + l.lineNumber + ',col:' + l.columnNumber + ']'; + } + } + + function _toString(chars, start, length) { + if (typeof chars == 'string') { + return chars.substr(start, length); + } else { + if (chars.length >= start + length || start) { + return new java.lang.String(chars, start, length) + ''; + } + + return chars; + } + } + + "endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g, function (key) { + DOMHandler.prototype[key] = function () { + return null; + }; + }); + + function appendElement(hander, node) { + if (!hander.currentElement) { + hander.document.appendChild(node); + } else { + hander.currentElement.appendChild(node); + } + } + + if (typeof _$$_REQUIRE == 'function') { + var XMLReader = _$$_REQUIRE(_dependencyMap[1]).XMLReader; + + var DOMImplementation = exports.DOMImplementation = _$$_REQUIRE(_dependencyMap[2]).DOMImplementation; + + exports.XMLSerializer = _$$_REQUIRE(_dependencyMap[2]).XMLSerializer; + exports.DOMParser = DOMParser; + } +},526,[527,528,529]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var EntityMap = { + 'lt': '<', + 'gt': '>', + 'amp': '&', + 'quot': '"', + 'apos': "'", + 'laquo': '«', + 'raquo': '»', + 'forall': "\u2200", + 'part': "\u2202", + 'exists': "\u2203", + 'empty': "\u2205", + 'nabla': "\u2207", + 'isin': "\u2208", + 'notin': "\u2209", + 'ni': "\u220B", + 'prod': "\u220F", + 'sum': "\u2211", + 'minus': "\u2212", + 'lowast': "\u2217", + 'radic': "\u221A", + 'prop': "\u221D", + 'infin': "\u221E", + 'ang': "\u2220", + 'and': "\u2227", + 'or': "\u2228", + 'cap': "\u2229", + 'cup': "\u222A", + 'int': "\u222B", + 'there4': "\u2234", + 'sim': "\u223C", + 'cong': "\u2245", + 'asymp': "\u2248", + 'ne': "\u2260", + 'equiv': "\u2261", + 'le': "\u2264", + 'ge': "\u2265", + 'sub': "\u2282", + 'sup': "\u2283", + 'nsub': "\u2284", + 'sube': "\u2286", + 'supe': "\u2287", + 'oplus': "\u2295", + 'otimes': "\u2297", + 'perp': "\u22A5", + 'sdot': "\u22C5", + 'Alpha': "\u0391", + 'Beta': "\u0392", + 'Gamma': "\u0393", + 'Delta': "\u0394", + 'Epsilon': "\u0395", + 'Zeta': "\u0396", + 'Eta': "\u0397", + 'Theta': "\u0398", + 'Iota': "\u0399", + 'Kappa': "\u039A", + 'Lambda': "\u039B", + 'Mu': "\u039C", + 'Nu': "\u039D", + 'Xi': "\u039E", + 'Omicron': "\u039F", + 'Pi': "\u03A0", + 'Rho': "\u03A1", + 'Sigma': "\u03A3", + 'Tau': "\u03A4", + 'Upsilon': "\u03A5", + 'Phi': "\u03A6", + 'Chi': "\u03A7", + 'Psi': "\u03A8", + 'Omega': "\u03A9", + 'alpha': "\u03B1", + 'beta': "\u03B2", + 'gamma': "\u03B3", + 'delta': "\u03B4", + 'epsilon': "\u03B5", + 'zeta': "\u03B6", + 'eta': "\u03B7", + 'theta': "\u03B8", + 'iota': "\u03B9", + 'kappa': "\u03BA", + 'lambda': "\u03BB", + 'mu': "\u03BC", + 'nu': "\u03BD", + 'xi': "\u03BE", + 'omicron': "\u03BF", + 'pi': "\u03C0", + 'rho': "\u03C1", + 'sigmaf': "\u03C2", + 'sigma': "\u03C3", + 'tau': "\u03C4", + 'upsilon': "\u03C5", + 'phi': "\u03C6", + 'chi': "\u03C7", + 'psi': "\u03C8", + 'omega': "\u03C9", + 'thetasym': "\u03D1", + 'upsih': "\u03D2", + 'piv': "\u03D6", + 'OElig': "\u0152", + 'oelig': "\u0153", + 'Scaron': "\u0160", + 'scaron': "\u0161", + 'Yuml': "\u0178", + 'fnof': "\u0192", + 'circ': "\u02C6", + 'tilde': "\u02DC", + 'ensp': "\u2002", + 'emsp': "\u2003", + 'thinsp': "\u2009", + 'zwnj': "\u200C", + 'zwj': "\u200D", + 'lrm': "\u200E", + 'rlm': "\u200F", + 'ndash': "\u2013", + 'mdash': "\u2014", + 'lsquo': "\u2018", + 'rsquo': "\u2019", + 'sbquo': "\u201A", + 'ldquo': "\u201C", + 'rdquo': "\u201D", + 'bdquo': "\u201E", + 'dagger': "\u2020", + 'Dagger': "\u2021", + 'bull': "\u2022", + 'hellip': "\u2026", + 'permil': "\u2030", + 'prime': "\u2032", + 'Prime': "\u2033", + 'lsaquo': "\u2039", + 'rsaquo': "\u203A", + 'oline': "\u203E", + 'euro': "\u20AC", + 'trade': "\u2122", + 'larr': "\u2190", + 'uarr': "\u2191", + 'rarr': "\u2192", + 'darr': "\u2193", + 'harr': "\u2194", + 'crarr': "\u21B5", + 'lceil': "\u2308", + 'rceil': "\u2309", + 'lfloor': "\u230A", + 'rfloor': "\u230B", + 'loz': "\u25CA", + 'spades': "\u2660", + 'clubs': "\u2663", + 'hearts': "\u2665", + 'diams': "\u2666", + 'laquo': "\xAB", + 'raquo': "\xBB" + }; + + if (typeof _$$_REQUIRE == 'function') { + exports.EntityMap = EntityMap; + } +},527,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var nameStartChar = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/; + var nameChar = new RegExp("[\\-\\.0-9" + nameStartChar.source.slice(1, -1) + "\xB7\u0300-\u036F\\u203F-\u2040]"); + var tagNamePattern = new RegExp('^' + nameStartChar.source + nameChar.source + '*(?:\:' + nameStartChar.source + nameChar.source + '*)?$'); + var S_TAG = 0; + var S_ATTR = 1; + var S_ATTR_S = 2; + var S_EQ = 3; + var S_V = 4; + var S_E = 5; + var S_S = 6; + var S_C = 7; + + function XMLReader() {} + + XMLReader.prototype = { + parse: function parse(source, defaultNSMap, entityMap) { + var domBuilder = this.domBuilder; + domBuilder.startDocument(); + + _copy(defaultNSMap, defaultNSMap = {}); + + _parse(source, defaultNSMap, entityMap, domBuilder, this.errorHandler); + + domBuilder.endDocument(); + } + }; + + function _parse(source, defaultNSMapCopy, entityMap, domBuilder, errorHandler) { + function fixedFromCharCode(code) { + if (code > 0xffff) { + code -= 0x10000; + var surrogate1 = 0xd800 + (code >> 10), + surrogate2 = 0xdc00 + (code & 0x3ff); + return String.fromCharCode(surrogate1, surrogate2); + } else { + return String.fromCharCode(code); + } + } + + function entityReplacer(a) { + var k = a.slice(1, -1); + + if (k in entityMap) { + return entityMap[k]; + } else if (k.charAt(0) === '#') { + return fixedFromCharCode(parseInt(k.substr(1).replace('x', '0x'))); + } else { + errorHandler.error('entity not found:' + a); + return a; + } + } + + function appendText(end) { + if (end > start) { + var xt = source.substring(start, end).replace(/&#?\w+;/g, entityReplacer); + locator && position(start); + domBuilder.characters(xt, 0, end - start); + start = end; + } + } + + function position(p, m) { + while (p >= lineEnd && (m = linePattern.exec(source))) { + lineStart = m.index; + lineEnd = lineStart + m[0].length; + locator.lineNumber++; + } + + locator.columnNumber = p - lineStart + 1; + } + + var lineStart = 0; + var lineEnd = 0; + var linePattern = /.+(?:\r\n?|\n)|.*$/g; + var locator = domBuilder.locator; + var parseStack = [{ + currentNSMap: defaultNSMapCopy + }]; + var closeMap = {}; + var start = 0; + + while (true) { + try { + var tagStart = source.indexOf('<', start); + + if (tagStart < 0) { + if (!source.substr(start).match(/^\s*$/)) { + var doc = domBuilder.document; + var text = doc.createTextNode(source.substr(start)); + doc.appendChild(text); + domBuilder.currentElement = text; + } + + return; + } + + if (tagStart > start) { + appendText(tagStart); + } + + switch (source.charAt(tagStart + 1)) { + case '/': + var end = source.indexOf('>', tagStart + 3); + var tagName = source.substring(tagStart + 2, end); + var config = parseStack.pop(); + var localNSMap = config.localNSMap; + + if (config.tagName != tagName) { + errorHandler.fatalError("end tag name: " + tagName + ' is not match the current start tagName:' + config.tagName); + } + + domBuilder.endElement(config.uri, config.localName, tagName); + + if (localNSMap) { + for (var prefix in localNSMap) { + domBuilder.endPrefixMapping(prefix); + } + } + + end++; + break; + + case '?': + locator && position(tagStart); + end = parseInstruction(source, tagStart, domBuilder); + break; + + case '!': + locator && position(tagStart); + end = parseDCC(source, tagStart, domBuilder, errorHandler); + break; + + default: + locator && position(tagStart); + var el = new ElementAttributes(); + var end = parseElementStartPart(source, tagStart, el, entityReplacer, errorHandler); + var len = el.length; + + if (locator) { + if (len) { + for (var i = 0; i < len; i++) { + var a = el[i]; + position(a.offset); + a.offset = copyLocator(locator, {}); + } + } + + position(end); + } + + if (!el.closed && fixSelfClosed(source, end, el.tagName, closeMap)) { + el.closed = true; + + if (!entityMap.nbsp) { + errorHandler.warning('unclosed xml attribute'); + } + } + + appendElement(el, domBuilder, parseStack); + + if (el.uri === 'http://www.w3.org/1999/xhtml' && !el.closed) { + end = parseHtmlSpecialContent(source, end, el.tagName, entityReplacer, domBuilder); + } else { + end++; + } + + } + } catch (e) { + errorHandler.error('element parse error: ' + e); + end = -1; + } + + if (end > start) { + start = end; + } else { + appendText(Math.max(tagStart, start) + 1); + } + } + } + + function copyLocator(f, t) { + t.lineNumber = f.lineNumber; + t.columnNumber = f.columnNumber; + return t; + } + + function parseElementStartPart(source, start, el, entityReplacer, errorHandler) { + var attrName; + var value; + var p = ++start; + var s = S_TAG; + + while (true) { + var c = source.charAt(p); + + switch (c) { + case '=': + if (s === S_ATTR) { + attrName = source.slice(start, p); + s = S_EQ; + } else if (s === S_ATTR_S) { + s = S_EQ; + } else { + throw new Error('attribute equal must after attrName'); + } + + break; + + case '\'': + case '"': + if (s === S_EQ) { + start = p + 1; + p = source.indexOf(c, start); + + if (p > 0) { + value = source.slice(start, p).replace(/&#?\w+;/g, entityReplacer); + el.add(attrName, value, start - 1); + s = S_E; + } else { + throw new Error('attribute value no end \'' + c + '\' match'); + } + } else if (s == S_V) { + value = source.slice(start, p).replace(/&#?\w+;/g, entityReplacer); + el.add(attrName, value, start); + errorHandler.warning('attribute "' + attrName + '" missed start quot(' + c + ')!!'); + start = p + 1; + s = S_E; + } else { + throw new Error('attribute value must after "="'); + } + + break; + + case '/': + switch (s) { + case S_TAG: + el.setTagName(source.slice(start, p)); + + case S_E: + case S_S: + case S_C: + s = S_C; + el.closed = true; + + case S_V: + case S_ATTR: + case S_ATTR_S: + break; + + default: + throw new Error("attribute invalid close char('/')"); + } + + break; + + case '': + errorHandler.error('unexpected end of input'); + + case '>': + switch (s) { + case S_TAG: + el.setTagName(source.slice(start, p)); + + case S_E: + case S_S: + case S_C: + break; + + case S_V: + case S_ATTR: + value = source.slice(start, p); + + if (value.slice(-1) === '/') { + el.closed = true; + value = value.slice(0, -1); + } + + case S_ATTR_S: + if (s === S_ATTR_S) { + value = attrName; + } + + if (s == S_V) { + errorHandler.warning('attribute "' + value + '" missed quot(")!!'); + el.add(attrName, value.replace(/&#?\w+;/g, entityReplacer), start); + } else { + errorHandler.warning('attribute "' + value + '" missed value!! "' + value + '" instead!!'); + el.add(value, value, start); + } + + break; + + case S_EQ: + throw new Error('attribute value missed!!'); + } + + return p; + + case "\x80": + c = ' '; + + default: + if (c <= ' ') { + switch (s) { + case S_TAG: + el.setTagName(source.slice(start, p)); + s = S_S; + break; + + case S_ATTR: + attrName = source.slice(start, p); + s = S_ATTR_S; + break; + + case S_V: + var value = source.slice(start, p).replace(/&#?\w+;/g, entityReplacer); + errorHandler.warning('attribute "' + value + '" missed quot(")!!'); + el.add(attrName, value, start); + + case S_E: + s = S_S; + break; + } + } else { + switch (s) { + case S_ATTR_S: + errorHandler.warning('attribute "' + attrName + '" missed value!! "' + attrName + '" instead!!'); + el.add(attrName, attrName, start); + start = p; + s = S_ATTR; + break; + + case S_E: + errorHandler.warning('attribute space is required"' + attrName + '"!!'); + + case S_S: + s = S_ATTR; + start = p; + break; + + case S_EQ: + s = S_V; + start = p; + break; + + case S_C: + throw new Error("elements closed character '/' and '>' must be connected to"); + } + } + + } + + p++; + } + } + + function appendElement(el, domBuilder, parseStack) { + var tagName = el.tagName; + var localNSMap = null; + var currentNSMap = parseStack[parseStack.length - 1].currentNSMap; + var i = el.length; + + while (i--) { + var a = el[i]; + var qName = a.qName; + var value = a.value; + var nsp = qName.indexOf(':'); + + if (nsp > 0) { + var prefix = a.prefix = qName.slice(0, nsp); + var localName = qName.slice(nsp + 1); + var nsPrefix = prefix === 'xmlns' && localName; + } else { + localName = qName; + prefix = null; + nsPrefix = qName === 'xmlns' && ''; + } + + a.localName = localName; + + if (nsPrefix !== false) { + if (localNSMap == null) { + localNSMap = {}; + + _copy(currentNSMap, currentNSMap = {}); + } + + currentNSMap[nsPrefix] = localNSMap[nsPrefix] = value; + a.uri = 'http://www.w3.org/2000/xmlns/'; + domBuilder.startPrefixMapping(nsPrefix, value); + } + } + + var i = el.length; + + while (i--) { + a = el[i]; + var prefix = a.prefix; + + if (prefix) { + if (prefix === 'xml') { + a.uri = 'http://www.w3.org/XML/1998/namespace'; + } + + if (prefix !== 'xmlns') { + a.uri = currentNSMap[prefix]; + } + } + } + + var nsp = tagName.indexOf(':'); + + if (nsp > 0) { + prefix = el.prefix = tagName.slice(0, nsp); + localName = el.localName = tagName.slice(nsp + 1); + } else { + prefix = null; + localName = el.localName = tagName; + } + + var ns = el.uri = currentNSMap[prefix || '']; + domBuilder.startElement(ns, localName, tagName, el); + + if (el.closed) { + domBuilder.endElement(ns, localName, tagName); + + if (localNSMap) { + for (prefix in localNSMap) { + domBuilder.endPrefixMapping(prefix); + } + } + } else { + el.currentNSMap = currentNSMap; + el.localNSMap = localNSMap; + parseStack.push(el); + } + } + + function parseHtmlSpecialContent(source, elStartEnd, tagName, entityReplacer, domBuilder) { + if (/^(?:script|textarea)$/i.test(tagName)) { + var elEndStart = source.indexOf('', elStartEnd); + var text = source.substring(elStartEnd + 1, elEndStart); + + if (/[&<]/.test(text)) { + if (/^script$/i.test(tagName)) { + domBuilder.characters(text, 0, text.length); + return elEndStart; + } + + text = text.replace(/&#?\w+;/g, entityReplacer); + domBuilder.characters(text, 0, text.length); + return elEndStart; + } + } + + return elStartEnd + 1; + } + + function fixSelfClosed(source, elStartEnd, tagName, closeMap) { + var pos = closeMap[tagName]; + + if (pos == null) { + pos = closeMap[tagName] = source.lastIndexOf(''); + } + + return pos < elStartEnd; + } + + function _copy(source, target) { + for (var n in source) { + target[n] = source[n]; + } + } + + function parseDCC(source, start, domBuilder, errorHandler) { + var next = source.charAt(start + 2); + + switch (next) { + case '-': + if (source.charAt(start + 3) === '-') { + var end = source.indexOf('-->', start + 4); + + if (end > start) { + domBuilder.comment(source, start + 4, end - start - 4); + return end + 3; + } else { + errorHandler.error("Unclosed comment"); + return -1; + } + } else { + return -1; + } + + default: + if (source.substr(start + 3, 6) == 'CDATA[') { + var end = source.indexOf(']]>', start + 9); + domBuilder.startCDATA(); + domBuilder.characters(source, start + 9, end - start - 9); + domBuilder.endCDATA(); + return end + 3; + } + + var matchs = split(source, start); + var len = matchs.length; + + if (len > 1 && /!doctype/i.test(matchs[0][0])) { + var name = matchs[1][0]; + var pubid = len > 3 && /^public$/i.test(matchs[2][0]) && matchs[3][0]; + var sysid = len > 4 && matchs[4][0]; + var lastMatch = matchs[len - 1]; + domBuilder.startDTD(name, pubid && pubid.replace(/^(['"])(.*?)\1$/, '$2'), sysid && sysid.replace(/^(['"])(.*?)\1$/, '$2')); + domBuilder.endDTD(); + return lastMatch.index + lastMatch[0].length; + } + + } + + return -1; + } + + function parseInstruction(source, start, domBuilder) { + var end = source.indexOf('?>', start); + + if (end) { + var match = source.substring(start, end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/); + + if (match) { + var len = match[0].length; + domBuilder.processingInstruction(match[1], match[2]); + return end + 2; + } else { + return -1; + } + } + + return -1; + } + + function ElementAttributes(source) {} + + ElementAttributes.prototype = { + setTagName: function setTagName(tagName) { + if (!tagNamePattern.test(tagName)) { + throw new Error('invalid tagName:' + tagName); + } + + this.tagName = tagName; + }, + add: function add(qName, value, offset) { + if (!tagNamePattern.test(qName)) { + throw new Error('invalid attribute:' + qName); + } + + this[this.length++] = { + qName: qName, + value: value, + offset: offset + }; + }, + length: 0, + getLocalName: function getLocalName(i) { + return this[i].localName; + }, + getOffset: function getOffset(i) { + return this[i].offset; + }, + getQName: function getQName(i) { + return this[i].qName; + }, + getURI: function getURI(i) { + return this[i].uri; + }, + getValue: function getValue(i) { + return this[i].value; + } + }; + + function _set_proto_(thiz, parent) { + thiz.__proto__ = parent; + return thiz; + } + + if (!(_set_proto_({}, _set_proto_.prototype) instanceof _set_proto_)) { + _set_proto_ = function _set_proto_(thiz, parent) { + function p() {} + + ; + p.prototype = parent; + p = new p(); + + for (parent in thiz) { + p[parent] = thiz[parent]; + } + + return p; + }; + } + + function split(source, start) { + var match; + var buf = []; + var reg = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g; + reg.lastIndex = start; + reg.exec(source); + + while (match = reg.exec(source)) { + buf.push(match); + if (match[1]) return buf; + } + } + + if (typeof _$$_REQUIRE == 'function') { + exports.XMLReader = XMLReader; + } +},528,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function copy(src, dest) { + for (var p in src) { + dest[p] = src[p]; + } + } + + function _extends(Class, Super) { + var pt = Class.prototype; + + if (Object.create) { + var ppt = Object.create(Super.prototype); + pt.__proto__ = ppt; + } + + if (!(pt instanceof Super)) { + function t() {} + + ; + t.prototype = Super.prototype; + t = new t(); + copy(pt, t); + Class.prototype = pt = t; + } + + if (pt.constructor != Class) { + if (typeof Class != 'function') { + console.error("unknow Class:" + Class); + } + + pt.constructor = Class; + } + } + + var htmlns = 'http://www.w3.org/1999/xhtml'; + var NodeType = {}; + var ELEMENT_NODE = NodeType.ELEMENT_NODE = 1; + var ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2; + var TEXT_NODE = NodeType.TEXT_NODE = 3; + var CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4; + var ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5; + var ENTITY_NODE = NodeType.ENTITY_NODE = 6; + var PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7; + var COMMENT_NODE = NodeType.COMMENT_NODE = 8; + var DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9; + var DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10; + var DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11; + var NOTATION_NODE = NodeType.NOTATION_NODE = 12; + var ExceptionCode = {}; + var ExceptionMessage = {}; + var INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = (ExceptionMessage[1] = "Index size error", 1); + var DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = (ExceptionMessage[2] = "DOMString size error", 2); + var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = (ExceptionMessage[3] = "Hierarchy request error", 3); + var WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = (ExceptionMessage[4] = "Wrong document", 4); + var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = (ExceptionMessage[5] = "Invalid character", 5); + var NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = (ExceptionMessage[6] = "No data allowed", 6); + var NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = (ExceptionMessage[7] = "No modification allowed", 7); + var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = (ExceptionMessage[8] = "Not found", 8); + var NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = (ExceptionMessage[9] = "Not supported", 9); + var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = (ExceptionMessage[10] = "Attribute in use", 10); + var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = (ExceptionMessage[11] = "Invalid state", 11); + var SYNTAX_ERR = ExceptionCode.SYNTAX_ERR = (ExceptionMessage[12] = "Syntax error", 12); + var INVALID_MODIFICATION_ERR = ExceptionCode.INVALID_MODIFICATION_ERR = (ExceptionMessage[13] = "Invalid modification", 13); + var NAMESPACE_ERR = ExceptionCode.NAMESPACE_ERR = (ExceptionMessage[14] = "Invalid namespace", 14); + var INVALID_ACCESS_ERR = ExceptionCode.INVALID_ACCESS_ERR = (ExceptionMessage[15] = "Invalid access", 15); + + function DOMException(code, message) { + if (message instanceof Error) { + var error = message; + } else { + error = this; + Error.call(this, ExceptionMessage[code]); + this.message = ExceptionMessage[code]; + if (Error.captureStackTrace) Error.captureStackTrace(this, DOMException); + } + + error.code = code; + if (message) this.message = this.message + ": " + message; + return error; + } + + ; + DOMException.prototype = Error.prototype; + copy(ExceptionCode, DOMException); + + function NodeList() {} + + ; + NodeList.prototype = { + length: 0, + item: function item(index) { + return this[index] || null; + }, + toString: function toString() { + for (var buf = [], i = 0; i < this.length; i++) { + serializeToString(this[i], buf); + } + + return buf.join(''); + } + }; + + function LiveNodeList(node, refresh) { + this._node = node; + this._refresh = refresh; + + _updateLiveList(this); + } + + function _updateLiveList(list) { + var inc = list._node._inc || list._node.ownerDocument._inc; + + if (list._inc != inc) { + var ls = list._refresh(list._node); + + __set__(list, 'length', ls.length); + + copy(ls, list); + list._inc = inc; + } + } + + LiveNodeList.prototype.item = function (i) { + _updateLiveList(this); + + return this[i]; + }; + + _extends(LiveNodeList, NodeList); + + function NamedNodeMap() {} + + ; + + function _findNodeIndex(list, node) { + var i = list.length; + + while (i--) { + if (list[i] === node) { + return i; + } + } + } + + function _addNamedNode(el, list, newAttr, oldAttr) { + if (oldAttr) { + list[_findNodeIndex(list, oldAttr)] = newAttr; + } else { + list[list.length++] = newAttr; + } + + if (el) { + newAttr.ownerElement = el; + var doc = el.ownerDocument; + + if (doc) { + oldAttr && _onRemoveAttribute(doc, el, oldAttr); + + _onAddAttribute(doc, el, newAttr); + } + } + } + + function _removeNamedNode(el, list, attr) { + var i = _findNodeIndex(list, attr); + + if (i >= 0) { + var lastIndex = list.length - 1; + + while (i < lastIndex) { + list[i] = list[++i]; + } + + list.length = lastIndex; + + if (el) { + var doc = el.ownerDocument; + + if (doc) { + _onRemoveAttribute(doc, el, attr); + + attr.ownerElement = null; + } + } + } else { + throw DOMException(NOT_FOUND_ERR, new Error()); + } + } + + NamedNodeMap.prototype = { + length: 0, + item: NodeList.prototype.item, + getNamedItem: function getNamedItem(key) { + var i = this.length; + + while (i--) { + var attr = this[i]; + + if (attr.nodeName == key) { + return attr; + } + } + }, + setNamedItem: function setNamedItem(attr) { + var el = attr.ownerElement; + + if (el && el != this._ownerElement) { + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + + var oldAttr = this.getNamedItem(attr.nodeName); + + _addNamedNode(this._ownerElement, this, attr, oldAttr); + + return oldAttr; + }, + setNamedItemNS: function setNamedItemNS(attr) { + var el = attr.ownerElement, + oldAttr; + + if (el && el != this._ownerElement) { + throw new DOMException(INUSE_ATTRIBUTE_ERR); + } + + oldAttr = this.getNamedItemNS(attr.namespaceURI, attr.localName); + + _addNamedNode(this._ownerElement, this, attr, oldAttr); + + return oldAttr; + }, + removeNamedItem: function removeNamedItem(key) { + var attr = this.getNamedItem(key); + + _removeNamedNode(this._ownerElement, this, attr); + + return attr; + }, + removeNamedItemNS: function removeNamedItemNS(namespaceURI, localName) { + var attr = this.getNamedItemNS(namespaceURI, localName); + + _removeNamedNode(this._ownerElement, this, attr); + + return attr; + }, + getNamedItemNS: function getNamedItemNS(namespaceURI, localName) { + var i = this.length; + + while (i--) { + var node = this[i]; + + if (node.localName == localName && node.namespaceURI == namespaceURI) { + return node; + } + } + + return null; + } + }; + + function DOMImplementation(features) { + this._features = {}; + + if (features) { + for (var feature in features) { + this._features = features[feature]; + } + } + } + + ; + DOMImplementation.prototype = { + hasFeature: function hasFeature(feature, version) { + var versions = this._features[feature.toLowerCase()]; + + if (versions && (!version || version in versions)) { + return true; + } else { + return false; + } + }, + createDocument: function createDocument(namespaceURI, qualifiedName, doctype) { + var doc = new Document(); + doc.implementation = this; + doc.childNodes = new NodeList(); + doc.doctype = doctype; + + if (doctype) { + doc.appendChild(doctype); + } + + if (qualifiedName) { + var root = doc.createElementNS(namespaceURI, qualifiedName); + doc.appendChild(root); + } + + return doc; + }, + createDocumentType: function createDocumentType(qualifiedName, publicId, systemId) { + var node = new DocumentType(); + node.name = qualifiedName; + node.nodeName = qualifiedName; + node.publicId = publicId; + node.systemId = systemId; + return node; + } + }; + + function Node() {} + + ; + Node.prototype = { + firstChild: null, + lastChild: null, + previousSibling: null, + nextSibling: null, + attributes: null, + parentNode: null, + childNodes: null, + ownerDocument: null, + nodeValue: null, + namespaceURI: null, + prefix: null, + localName: null, + insertBefore: function insertBefore(newChild, refChild) { + return _insertBefore(this, newChild, refChild); + }, + replaceChild: function replaceChild(newChild, oldChild) { + this.insertBefore(newChild, oldChild); + + if (oldChild) { + this.removeChild(oldChild); + } + }, + removeChild: function removeChild(oldChild) { + return _removeChild(this, oldChild); + }, + appendChild: function appendChild(newChild) { + return this.insertBefore(newChild, null); + }, + hasChildNodes: function hasChildNodes() { + return this.firstChild != null; + }, + cloneNode: function cloneNode(deep) { + return _cloneNode(this.ownerDocument || this, this, deep); + }, + normalize: function normalize() { + var child = this.firstChild; + + while (child) { + var next = child.nextSibling; + + if (next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE) { + this.removeChild(next); + child.appendData(next.data); + } else { + child.normalize(); + child = next; + } + } + }, + isSupported: function isSupported(feature, version) { + return this.ownerDocument.implementation.hasFeature(feature, version); + }, + hasAttributes: function hasAttributes() { + return this.attributes.length > 0; + }, + lookupPrefix: function lookupPrefix(namespaceURI) { + var el = this; + + while (el) { + var map = el._nsMap; + + if (map) { + for (var n in map) { + if (map[n] == namespaceURI) { + return n; + } + } + } + + el = el.nodeType == 2 ? el.ownerDocument : el.parentNode; + } + + return null; + }, + lookupNamespaceURI: function lookupNamespaceURI(prefix) { + var el = this; + + while (el) { + var map = el._nsMap; + + if (map) { + if (prefix in map) { + return map[prefix]; + } + } + + el = el.nodeType == 2 ? el.ownerDocument : el.parentNode; + } + + return null; + }, + isDefaultNamespace: function isDefaultNamespace(namespaceURI) { + var prefix = this.lookupPrefix(namespaceURI); + return prefix == null; + } + }; + + function _xmlEncoder(c) { + return c == '<' && '<' || c == '>' && '>' || c == '&' && '&' || c == '"' && '"' || '&#' + c.charCodeAt() + ';'; + } + + copy(NodeType, Node); + copy(NodeType, Node.prototype); + + function _visitNode(node, callback) { + if (callback(node)) { + return true; + } + + if (node = node.firstChild) { + do { + if (_visitNode(node, callback)) { + return true; + } + } while (node = node.nextSibling); + } + } + + function Document() {} + + function _onAddAttribute(doc, el, newAttr) { + doc && doc._inc++; + var ns = newAttr.namespaceURI; + + if (ns == 'http://www.w3.org/2000/xmlns/') { + el._nsMap[newAttr.prefix ? newAttr.localName : ''] = newAttr.value; + } + } + + function _onRemoveAttribute(doc, el, newAttr, remove) { + doc && doc._inc++; + var ns = newAttr.namespaceURI; + + if (ns == 'http://www.w3.org/2000/xmlns/') { + delete el._nsMap[newAttr.prefix ? newAttr.localName : '']; + } + } + + function _onUpdateChild(doc, el, newChild) { + if (doc && doc._inc) { + doc._inc++; + var cs = el.childNodes; + + if (newChild) { + cs[cs.length++] = newChild; + } else { + var child = el.firstChild; + var i = 0; + + while (child) { + cs[i++] = child; + child = child.nextSibling; + } + + cs.length = i; + } + } + } + + function _removeChild(parentNode, child) { + var previous = child.previousSibling; + var next = child.nextSibling; + + if (previous) { + previous.nextSibling = next; + } else { + parentNode.firstChild = next; + } + + if (next) { + next.previousSibling = previous; + } else { + parentNode.lastChild = previous; + } + + _onUpdateChild(parentNode.ownerDocument, parentNode); + + return child; + } + + function _insertBefore(parentNode, newChild, nextChild) { + var cp = newChild.parentNode; + + if (cp) { + cp.removeChild(newChild); + } + + if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) { + var newFirst = newChild.firstChild; + + if (newFirst == null) { + return newChild; + } + + var newLast = newChild.lastChild; + } else { + newFirst = newLast = newChild; + } + + var pre = nextChild ? nextChild.previousSibling : parentNode.lastChild; + newFirst.previousSibling = pre; + newLast.nextSibling = nextChild; + + if (pre) { + pre.nextSibling = newFirst; + } else { + parentNode.firstChild = newFirst; + } + + if (nextChild == null) { + parentNode.lastChild = newLast; + } else { + nextChild.previousSibling = newLast; + } + + do { + newFirst.parentNode = parentNode; + } while (newFirst !== newLast && (newFirst = newFirst.nextSibling)); + + _onUpdateChild(parentNode.ownerDocument || parentNode, parentNode); + + if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) { + newChild.firstChild = newChild.lastChild = null; + } + + return newChild; + } + + function _appendSingleChild(parentNode, newChild) { + var cp = newChild.parentNode; + + if (cp) { + var pre = parentNode.lastChild; + cp.removeChild(newChild); + var pre = parentNode.lastChild; + } + + var pre = parentNode.lastChild; + newChild.parentNode = parentNode; + newChild.previousSibling = pre; + newChild.nextSibling = null; + + if (pre) { + pre.nextSibling = newChild; + } else { + parentNode.firstChild = newChild; + } + + parentNode.lastChild = newChild; + + _onUpdateChild(parentNode.ownerDocument, parentNode, newChild); + + return newChild; + } + + Document.prototype = { + nodeName: '#document', + nodeType: DOCUMENT_NODE, + doctype: null, + documentElement: null, + _inc: 1, + insertBefore: function insertBefore(newChild, refChild) { + if (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) { + var child = newChild.firstChild; + + while (child) { + var next = child.nextSibling; + this.insertBefore(child, refChild); + child = next; + } + + return newChild; + } + + if (this.documentElement == null && newChild.nodeType == 1) { + this.documentElement = newChild; + } + + return _insertBefore(this, newChild, refChild), newChild.ownerDocument = this, newChild; + }, + removeChild: function removeChild(oldChild) { + if (this.documentElement == oldChild) { + this.documentElement = null; + } + + return _removeChild(this, oldChild); + }, + importNode: function importNode(importedNode, deep) { + return _importNode(this, importedNode, deep); + }, + getElementById: function getElementById(id) { + var rtv = null; + + _visitNode(this.documentElement, function (node) { + if (node.nodeType == 1) { + if (node.getAttribute('id') == id) { + rtv = node; + return true; + } + } + }); + + return rtv; + }, + getElementByClassName: function getElementByClassName(className) { + var rtv = null; + + _visitNode(this.documentElement, function (node) { + if (node.nodeType == 1) { + if (node.hasAttribute('class') && node.getAttribute('class') == className) { + rtv = node; + return true; + } + } + }); + + return rtv; + }, + getElementByAttribute: function getElementByAttribute(attribute, selector, undefine) { + var rtv = null; + + if (selector == undefine) { + _visitNode(this.documentElement, function (node) { + if (node.nodeType == 1) { + if (node.hasAttribute('attribute')) { + rtv = node; + return true; + } + } + }); + } else { + _visitNode(this.documentElement, function (node) { + if (node.nodeType == 1) { + if (node.hasAttribute('attribute') && node.getAttribute('attribute') == selector) { + rtv = node; + return true; + } + } + }); + } + + return rtv; + }, + createElement: function createElement(tagName) { + var node = new Element(); + node.ownerDocument = this; + node.nodeName = tagName; + node.tagName = tagName; + node.childNodes = new NodeList(); + var attrs = node.attributes = new NamedNodeMap(); + attrs._ownerElement = node; + return node; + }, + createDocumentFragment: function createDocumentFragment() { + var node = new DocumentFragment(); + node.ownerDocument = this; + node.childNodes = new NodeList(); + return node; + }, + createTextNode: function createTextNode(data) { + var node = new Text(); + node.ownerDocument = this; + node.appendData(data); + return node; + }, + createComment: function createComment(data) { + var node = new Comment(); + node.ownerDocument = this; + node.appendData(data); + return node; + }, + createCDATASection: function createCDATASection(data) { + var node = new CDATASection(); + node.ownerDocument = this; + node.appendData(data); + return node; + }, + createProcessingInstruction: function createProcessingInstruction(target, data) { + var node = new ProcessingInstruction(); + node.ownerDocument = this; + node.tagName = node.target = target; + node.nodeValue = node.data = data; + return node; + }, + createAttribute: function createAttribute(name) { + var node = new Attr(); + node.ownerDocument = this; + node.name = name; + node.nodeName = name; + node.localName = name; + node.specified = true; + return node; + }, + createEntityReference: function createEntityReference(name) { + var node = new EntityReference(); + node.ownerDocument = this; + node.nodeName = name; + return node; + }, + createElementNS: function createElementNS(namespaceURI, qualifiedName) { + var node = new Element(); + var pl = qualifiedName.split(':'); + var attrs = node.attributes = new NamedNodeMap(); + node.childNodes = new NodeList(); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.tagName = qualifiedName; + node.namespaceURI = namespaceURI; + + if (pl.length == 2) { + node.prefix = pl[0]; + node.localName = pl[1]; + } else { + node.localName = qualifiedName; + } + + attrs._ownerElement = node; + return node; + }, + createAttributeNS: function createAttributeNS(namespaceURI, qualifiedName) { + var node = new Attr(); + var pl = qualifiedName.split(':'); + node.ownerDocument = this; + node.nodeName = qualifiedName; + node.name = qualifiedName; + node.namespaceURI = namespaceURI; + node.specified = true; + + if (pl.length == 2) { + node.prefix = pl[0]; + node.localName = pl[1]; + } else { + node.localName = qualifiedName; + } + + return node; + } + }; + + _extends(Document, Node); + + function Element() { + this._nsMap = {}; + } + + ; + Element.prototype = { + nodeType: ELEMENT_NODE, + hasAttribute: function hasAttribute(name) { + return this.getAttributeNode(name) != null; + }, + getAttribute: function getAttribute(name) { + var attr = this.getAttributeNode(name); + return attr && attr.value || ''; + }, + getAttributeNode: function getAttributeNode(name) { + return this.attributes.getNamedItem(name); + }, + setAttribute: function setAttribute(name, value) { + var attr = this.ownerDocument.createAttribute(name); + attr.value = attr.nodeValue = "" + value; + this.setAttributeNode(attr); + }, + removeAttribute: function removeAttribute(name) { + var attr = this.getAttributeNode(name); + attr && this.removeAttributeNode(attr); + }, + appendChild: function appendChild(newChild) { + if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) { + return this.insertBefore(newChild, null); + } else { + return _appendSingleChild(this, newChild); + } + }, + setAttributeNode: function setAttributeNode(newAttr) { + return this.attributes.setNamedItem(newAttr); + }, + setAttributeNodeNS: function setAttributeNodeNS(newAttr) { + return this.attributes.setNamedItemNS(newAttr); + }, + removeAttributeNode: function removeAttributeNode(oldAttr) { + return this.attributes.removeNamedItem(oldAttr.nodeName); + }, + removeAttributeNS: function removeAttributeNS(namespaceURI, localName) { + var old = this.getAttributeNodeNS(namespaceURI, localName); + old && this.removeAttributeNode(old); + }, + hasAttributeNS: function hasAttributeNS(namespaceURI, localName) { + return this.getAttributeNodeNS(namespaceURI, localName) != null; + }, + getAttributeNS: function getAttributeNS(namespaceURI, localName) { + var attr = this.getAttributeNodeNS(namespaceURI, localName); + return attr && attr.value || ''; + }, + setAttributeNS: function setAttributeNS(namespaceURI, qualifiedName, value) { + var attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName); + attr.value = attr.nodeValue = "" + value; + this.setAttributeNode(attr); + }, + getAttributeNodeNS: function getAttributeNodeNS(namespaceURI, localName) { + return this.attributes.getNamedItemNS(namespaceURI, localName); + }, + getElementsByTagName: function getElementsByTagName(tagName) { + return new LiveNodeList(this, function (base) { + var ls = []; + + _visitNode(base, function (node) { + if (node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)) { + ls.push(node); + } + }); + + return ls; + }); + }, + getElementsByClassName: function getElementsByClassName(className) { + return new LiveNodeList(this, function (base) { + var ls = []; + + _visitNode(base, function (node) { + if (node !== base && node.nodeType == ELEMENT_NODE && node.hasAttribute('class') && node.getAttribute('class') == className) { + ls.push(node); + } + }); + + return ls; + }); + }, + getElementsByTagNameNS: function getElementsByTagNameNS(namespaceURI, localName) { + return new LiveNodeList(this, function (base) { + var ls = []; + + _visitNode(base, function (node) { + if (node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)) { + ls.push(node); + } + }); + + return ls; + }); + }, + getElementsByAttribute: function getElementsByAttribute(attribute, selector, undefine) { + if (selector == undefine) { + return new LiveNodeList(this, function (base) { + var ls = []; + + _visitNode(base, function (node) { + if (node !== base && node.nodeType == ELEMENT_NODE && node.hasAttribute(attribute)) { + ls.push(node); + } + }); + + return ls; + }); + } else { + return new LiveNodeList(this, function (base) { + var ls = []; + + _visitNode(base, function (node) { + if (node !== base && node.nodeType == ELEMENT_NODE && node.hasAttribute(attribute) && node.getAttribute(attribute) == selector) { + ls.push(node); + } + }); + + return ls; + }); + } + }, + getElementsBySelector: function getElementsBySelector(selector) { + var queryArray = selectorToQueryArray(selector); + return new LiveNodeList(this, function (base) { + var ls = []; + + _visitNode(base, function (node) { + if (node.nodeType == 1) { + var checkQuery = 0; + queryArray.forEach(function (query, index, queryArray) { + switch (query[0]) { + case '.': + if (node.hasAttribute('class') && node.getAttribute('class') == query.substring(1, query.length)) { + checkQuery += 1; + } + + break; + + case '#': + if (node.getAttribute('id') == query.substring(1, query.length)) { + checkQuery += 1; + } + + break; + + case '[': + var attribute = query.substring(1, query.length - 1).split('='); + attribute[1] = attribute[1].substring(1, attribute[1].length - 1); + + if (node.hasAttribute(attribute[0]) && node.getAttribute(attribute[0]) == attribute[1]) { + checkQuery += 1; + } + + break; + + default: + if (node.nodeType == ELEMENT_NODE && node.tagName == query) { + checkQuery += 1; + } + + break; + } + }); + + if (checkQuery == queryArray.length) { + ls.push(node); + } + } + }); + + return ls; + }); + }, + querySelect: function querySelect(querys) { + var queryArray = []; + querys.split(' ').forEach(function (ele, index, arr) { + if (ele != '') { + queryArray.push(ele); + } + }); + var elementQueue = [this]; + + for (var index = 0; index < queryArray.length; index++) { + var gotElementConcatArray = []; + + while (elementQueue.length != 0) { + elem = elementQueue.pop(); + var arrayedElem = Array.prototype.slice.call(elem.getElementsBySelector(queryArray[index])); + gotElementConcatArray = gotElementConcatArray.concat(arrayedElem); + } + + elementQueue = elementQueue.concat(gotElementConcatArray); + } + + return elementQueue; + } + }; + Document.prototype.getElementsByTagName = Element.prototype.getElementsByTagName; + Document.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS; + Document.prototype.getElementsByClassName = Element.prototype.getElementsByClassName; + Document.prototype.getElementsByAttribute = Element.prototype.getElementsByAttribute; + Document.prototype.getElementsBySelector = Element.prototype.getElementsBySelector; + Document.prototype.querySelect = Element.prototype.querySelect; + + function selectorToQueryArray(selector) { + var queryArray = []; + var testElem = /\[[a-z,A-Z]+\=((\'[a-z,A-Z]+\')|(\"[a-z,A-Z]+\"))]/.exec(selector); + + if (/\#[a-z,A-Z]+/.exec(selector)) { + queryArray.push(/#[a-z,A-Z]+/.exec(selector)[0]); + } + + if (/\.[a-z,A-Z]+/.exec(selector)) { + queryArray.push(/\.[a-z,A-Z]+/.exec(selector)[0]); + } + + if (/^[a-z,A-Z]+/.exec(selector)) { + queryArray.push(/^[a-z,A-Z]+/.exec(selector)[0]); + } + + if (/\[[a-z,A-Z]+\=((\'[a-z,A-Z]+\')|(\"[a-z,A-Z]+\"))]/.exec(selector)) { + queryArray.push(/\[[a-z,A-Z]+\=((\'[a-z,A-Z]+\')|(\"[a-z,A-Z]+\"))]/.exec(selector)[0]); + } + + queryArray.sort(function (a, b) { + return a.index - b.index; + }); + return queryArray; + } + + _extends(Element, Node); + + function Attr() {} + + ; + Attr.prototype.nodeType = ATTRIBUTE_NODE; + + _extends(Attr, Node); + + function CharacterData() {} + + ; + CharacterData.prototype = { + data: '', + substringData: function substringData(offset, count) { + return this.data.substring(offset, offset + count); + }, + appendData: function appendData(text) { + text = this.data + text; + this.nodeValue = this.data = text; + this.length = text.length; + }, + insertData: function insertData(offset, text) { + this.replaceData(offset, 0, text); + }, + appendChild: function appendChild(newChild) { + throw new Error(ExceptionMessage[3]); + return Node.prototype.appendChild.apply(this, arguments); + }, + deleteData: function deleteData(offset, count) { + this.replaceData(offset, count, ""); + }, + replaceData: function replaceData(offset, count, text) { + var start = this.data.substring(0, offset); + var end = this.data.substring(offset + count); + text = start + text + end; + this.nodeValue = this.data = text; + this.length = text.length; + } + }; + + _extends(CharacterData, Node); + + function Text() {} + + ; + Text.prototype = { + nodeName: "#text", + nodeType: TEXT_NODE, + splitText: function splitText(offset) { + var text = this.data; + var newText = text.substring(offset); + text = text.substring(0, offset); + this.data = this.nodeValue = text; + this.length = text.length; + var newNode = this.ownerDocument.createTextNode(newText); + + if (this.parentNode) { + this.parentNode.insertBefore(newNode, this.nextSibling); + } + + return newNode; + } + }; + + _extends(Text, CharacterData); + + function Comment() {} + + ; + Comment.prototype = { + nodeName: "#comment", + nodeType: COMMENT_NODE + }; + + _extends(Comment, CharacterData); + + function CDATASection() {} + + ; + CDATASection.prototype = { + nodeName: "#cdata-section", + nodeType: CDATA_SECTION_NODE + }; + + _extends(CDATASection, CharacterData); + + function DocumentType() {} + + ; + DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE; + + _extends(DocumentType, Node); + + function Notation() {} + + ; + Notation.prototype.nodeType = NOTATION_NODE; + + _extends(Notation, Node); + + function Entity() {} + + ; + Entity.prototype.nodeType = ENTITY_NODE; + + _extends(Entity, Node); + + function EntityReference() {} + + ; + EntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE; + + _extends(EntityReference, Node); + + function DocumentFragment() {} + + ; + DocumentFragment.prototype.nodeName = "#document-fragment"; + DocumentFragment.prototype.nodeType = DOCUMENT_FRAGMENT_NODE; + + _extends(DocumentFragment, Node); + + function ProcessingInstruction() {} + + ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE; + + _extends(ProcessingInstruction, Node); + + function XMLSerializer() {} + + XMLSerializer.prototype.serializeToString = function (node, attributeSorter) { + return node.toString(attributeSorter); + }; + + Node.prototype.toString = function (attributeSorter) { + var buf = []; + serializeToString(this, buf, attributeSorter); + return buf.join(''); + }; + + function serializeToString(node, buf, attributeSorter, isHTML) { + switch (node.nodeType) { + case ELEMENT_NODE: + var attrs = node.attributes; + var len = attrs.length; + var child = node.firstChild; + var nodeName = node.tagName; + isHTML = htmlns === node.namespaceURI || isHTML; + buf.push('<', nodeName); + + if (attributeSorter) { + buf.sort.apply(attrs, attributeSorter); + } + + for (var i = 0; i < len; i++) { + serializeToString(attrs.item(i), buf, attributeSorter, isHTML); + } + + if (child || isHTML && !/^(?:meta|link|img|br|hr|input|button)$/i.test(nodeName)) { + buf.push('>'); + + if (isHTML && /^script$/i.test(nodeName)) { + if (child) { + buf.push(child.data); + } + } else { + while (child) { + serializeToString(child, buf, attributeSorter, isHTML); + child = child.nextSibling; + } + } + + buf.push(''); + } else { + buf.push('/>'); + } + + return; + + case DOCUMENT_NODE: + case DOCUMENT_FRAGMENT_NODE: + var child = node.firstChild; + + while (child) { + serializeToString(child, buf, attributeSorter, isHTML); + child = child.nextSibling; + } + + return; + + case ATTRIBUTE_NODE: + return buf.push(' ', node.name, '="', node.value.replace(/[<&"]/g, _xmlEncoder), '"'); + + case TEXT_NODE: + return buf.push(node.data.replace(/[<&]/g, _xmlEncoder)); + + case CDATA_SECTION_NODE: + return buf.push(''); + + case COMMENT_NODE: + return buf.push(""); + + case DOCUMENT_TYPE_NODE: + var pubid = node.publicId; + var sysid = node.systemId; + buf.push(''); + } else if (sysid && sysid != '.') { + buf.push(' SYSTEM "', sysid, '">'); + } else { + var sub = node.internalSubset; + + if (sub) { + buf.push(" [", sub, "]"); + } + + buf.push(">"); + } + + return; + + case PROCESSING_INSTRUCTION_NODE: + return buf.push(""); + + case ENTITY_REFERENCE_NODE: + return buf.push('&', node.nodeName, ';'); + + default: + buf.push('??', node.nodeName); + } + } + + function _importNode(doc, node, deep) { + var node2; + + switch (node.nodeType) { + case ELEMENT_NODE: + node2 = node.cloneNode(false); + node2.ownerDocument = doc; + + case DOCUMENT_FRAGMENT_NODE: + break; + + case ATTRIBUTE_NODE: + deep = true; + break; + } + + if (!node2) { + node2 = node.cloneNode(false); + } + + node2.ownerDocument = doc; + node2.parentNode = null; + + if (deep) { + var child = node.firstChild; + + while (child) { + node2.appendChild(_importNode(doc, child, deep)); + child = child.nextSibling; + } + } + + return node2; + } + + function _cloneNode(doc, node, deep) { + var node2 = new node.constructor(); + + for (var n in node) { + var v = node[n]; + + if (typeof v != 'object') { + if (v != node2[n]) { + node2[n] = v; + } + } + } + + if (node.childNodes) { + node2.childNodes = new NodeList(); + } + + node2.ownerDocument = doc; + + switch (node2.nodeType) { + case ELEMENT_NODE: + var attrs = node.attributes; + var attrs2 = node2.attributes = new NamedNodeMap(); + var len = attrs.length; + attrs2._ownerElement = node2; + + for (var i = 0; i < len; i++) { + node2.setAttributeNode(_cloneNode(doc, attrs.item(i), true)); + } + + break; + ; + + case ATTRIBUTE_NODE: + deep = true; + } + + if (deep) { + var child = node.firstChild; + + while (child) { + node2.appendChild(_cloneNode(doc, child, deep)); + child = child.nextSibling; + } + } + + return node2; + } + + function __set__(object, key, value) { + object[key] = value; + } + + try { + if (Object.defineProperty) { + Object.defineProperty(LiveNodeList.prototype, 'length', { + get: function get() { + _updateLiveList(this); + + return this.$$length; + } + }); + Object.defineProperty(Node.prototype, 'textContent', { + get: function get() { + return getTextContent(this); + }, + set: function set(data) { + switch (this.nodeType) { + case 1: + case 11: + while (this.firstChild) { + this.removeChild(this.firstChild); + } + + if (data || String(data)) { + this.appendChild(this.ownerDocument.createTextNode(data)); + } + + break; + + default: + this.data = data; + this.value = value; + this.nodeValue = data; + } + } + }); + + function getTextContent(node) { + switch (node.nodeType) { + case 1: + case 11: + var buf = []; + node = node.firstChild; + + while (node) { + if (node.nodeType !== 7 && node.nodeType !== 8) { + buf.push(getTextContent(node)); + } + + node = node.nextSibling; + } + + return buf.join(''); + + default: + return node.nodeValue; + } + } + + __set__ = function __set__(object, key, value) { + object['$$' + key] = value; + }; + } + } catch (e) {} + + if (typeof _$$_REQUIRE == 'function') { + exports.DOMImplementation = DOMImplementation; + exports.XMLSerializer = XMLSerializer; + } +},529,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.readingTime = readingTime; + + function convertTimeMinutesText(time) { + if (time < 0.5) { + return "less than a min"; + } + + if (time >= 0.5 && time < 1.5) { + return "1 min read"; + } + + return Math.ceil(time) + " min read"; + } + + function convertTimeToMinutes(time) { + if (time < 0.5) { + return 0.5; + } + + if (time >= 0.5 && time < 1.5) { + return 1; + } + + return Math.ceil(time); + } + + var WORDS_PER_MIN = 200; + var CHINESE_KOREAN_READ_TIME = 500; + + function countWords(text) { + var pattern = "\\w+"; + var reg = new RegExp(pattern, "g"); + return (text.match(reg) || []).length; + } + + function readOtherLanguages(text) { + var pattern = "[\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uF900-\uFAFF\uFF66-\uFF9F]"; + var reg = new RegExp(pattern, "g"); + var count = (text.match(reg) || []).length; + var time = count / CHINESE_KOREAN_READ_TIME; + var formattedText = text.replace(reg, ""); + return { + count: count, + time: time, + formattedText: formattedText + }; + } + + function readWords(text) { + var wordsPerMin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : WORDS_PER_MIN; + + var _readOtherLanguages = readOtherLanguages(text), + characters = _readOtherLanguages.count, + otherLanguageTime = _readOtherLanguages.time, + formattedText = _readOtherLanguages.formattedText; + + var words = countWords(formattedText); + var time = words / wordsPerMin; + return { + characters: characters, + otherLanguageTime: otherLanguageTime, + words: words, + time: time + }; + } + + function stripTags(text) { + var pattern = "<\\w+(\\s+(\"[^\"]*\"|\\'[^\\']*'|[^>])+)?>|<\\/\\w+>"; + var reg = new RegExp(pattern, "gi"); + return text.replace(reg, ""); + } + + function stripWhitespace(text) { + return text.replace(/^\s+/, "").replace(/\s+$/, ""); + } + + function readingTime(text) { + var strippedString = stripTags(stripWhitespace(text)); + + var _readWords = readWords(strippedString), + time = _readWords.time, + words = _readWords.words; + + return { + text: convertTimeMinutesText(time), + words: words, + time: time * 60 * 1000, + minutes: convertTimeToMinutes(time) + }; + } +},530,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _reactNativeDeviceInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNativeUuidGenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNativeNavigationBarColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _colorUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var TaUtils = _reactNative.NativeModules.TaUtils; + + var PlatformUtils = function () { + function PlatformUtils() { + (0, _classCallCheck2.default)(this, PlatformUtils); + } + + (0, _createClass2.default)(PlatformUtils, null, [{ + key: "initPlatformInfo", + value: function initPlatformInfo() { + var isTablet, isEmulator, userAgent, fontScale, apiLevel, supported64BitAbis, supported32BitAbis, systemAccessibilityEnabled; + return _regenerator.default.async(function initPlatformInfo$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + isTablet = _reactNativeDeviceInfo.default.isTablet(); + isEmulator = false; + _context.prev = 2; + _context.next = 5; + return _regenerator.default.awrap(_reactNativeDeviceInfo.default.isEmulator()); + + case 5: + isEmulator = _context.sent; + _context.next = 10; + break; + + case 8: + _context.prev = 8; + _context.t0 = _context["catch"](2); + + case 10: + userAgent = "n/a"; + _context.prev = 11; + _context.next = 14; + return _regenerator.default.awrap(_reactNativeDeviceInfo.default.getUserAgent()); + + case 14: + userAgent = _context.sent; + _context.next = 19; + break; + + case 17: + _context.prev = 17; + _context.t1 = _context["catch"](11); + + case 19: + fontScale = 1; + _context.prev = 20; + _context.next = 23; + return _regenerator.default.awrap(_reactNativeDeviceInfo.default.getFontScale()); + + case 23: + fontScale = _context.sent; + _context.next = 28; + break; + + case 26: + _context.prev = 26; + _context.t2 = _context["catch"](20); + + case 28: + apiLevel = 30; + _context.prev = 29; + _context.next = 32; + return _regenerator.default.awrap(_reactNativeDeviceInfo.default.getApiLevel()); + + case 32: + apiLevel = _context.sent; + _context.next = 37; + break; + + case 35: + _context.prev = 35; + _context.t3 = _context["catch"](29); + + case 37: + supported64BitAbis = []; + _context.prev = 38; + _context.next = 41; + return _regenerator.default.awrap(_reactNativeDeviceInfo.default.supported64BitAbis()); + + case 41: + supported64BitAbis = _context.sent; + _context.next = 46; + break; + + case 44: + _context.prev = 44; + _context.t4 = _context["catch"](38); + + case 46: + supported32BitAbis = []; + _context.prev = 47; + _context.next = 50; + return _regenerator.default.awrap(_reactNativeDeviceInfo.default.supported32BitAbis()); + + case 50: + supported32BitAbis = _context.sent; + _context.next = 55; + break; + + case 53: + _context.prev = 53; + _context.t5 = _context["catch"](47); + + case 55: + systemAccessibilityEnabled = false; + _context.prev = 56; + _context.next = 59; + return _regenerator.default.awrap(_reactNative.AccessibilityInfo.isScreenReaderEnabled()); + + case 59: + systemAccessibilityEnabled = _context.sent; + _context.next = 64; + break; + + case 62: + _context.prev = 62; + _context.t6 = _context["catch"](56); + + case 64: + _context.t7 = _reactNativeDeviceInfo.default.getModel(); + _context.t8 = _reactNativeDeviceInfo.default.getDeviceId(); + _context.t9 = _reactNativeDeviceInfo.default.getDeviceType(); + _context.t10 = _reactNativeDeviceInfo.default.getApplicationName(); + _context.t11 = _reactNativeDeviceInfo.default.getBrand(); + _context.t12 = _reactNativeDeviceInfo.default.getVersion(); + _context.t13 = _reactNativeDeviceInfo.default.getSystemName(); + _context.t14 = _reactNativeDeviceInfo.default.getSystemVersion(); + _context.t15 = _reactNativeDeviceInfo.default.getUniqueId(); + _context.t16 = _reactNativeDeviceInfo.default.getBundleId(); + _context.t17 = userAgent; + _context.t18 = fontScale; + _context.t19 = _reactNative.PixelRatio.get(); + _context.t20 = apiLevel; + _context.t21 = supported64BitAbis; + _context.t22 = supported32BitAbis; + + if (!PlatformUtils.isAndroid()) { + _context.next = 86; + break; + } + + _context.next = 83; + return _regenerator.default.awrap(TaUtils.isEInk()); + + case 83: + _context.t23 = _context.sent; + _context.next = 87; + break; + + case 86: + _context.t23 = false; + + case 87: + _context.t24 = _context.t23; + _context.t25 = isTablet; + _context.t26 = isTablet; + _context.t27 = isEmulator; + _context.t28 = systemAccessibilityEnabled; + PlatformUtils.info = { + model: _context.t7, + deviceId: _context.t8, + deviceType: _context.t9, + appName: _context.t10, + brand: _context.t11, + version: _context.t12, + system: _context.t13, + systemVersion: _context.t14, + uniqueId: _context.t15, + bundleId: _context.t16, + userAgent: _context.t17, + fontScale: _context.t18, + pixelRatio: _context.t19, + apiLevel: _context.t20, + supported64BitAbis: _context.t21, + supported32BitAbis: _context.t22, + isEInk: _context.t24, + isTablet: _context.t25, + isTabletTenInches: _context.t26, + isEmulator: _context.t27, + systemAccessibilityEnabled: _context.t28 + }; + + case 93: + case "end": + return _context.stop(); + } + } + }, null, null, [[2, 8], [11, 17], [20, 26], [29, 35], [38, 44], [47, 53], [56, 62]], Promise); + } + }, { + key: "model", + value: function model() { + return PlatformUtils.info.model; + } + }, { + key: "getDeviceId", + value: function getDeviceId() { + return PlatformUtils.info.deviceId; + } + }, { + key: "getDeviceType", + value: function getDeviceType() { + return PlatformUtils.info.deviceType; + } + }, { + key: "getScreenInches", + value: function getScreenInches() { + return PlatformUtils.info.inches; + } + }, { + key: "appName", + value: function appName() { + return PlatformUtils.info.appName; + } + }, { + key: "getBrand", + value: function getBrand() { + return PlatformUtils.info.brand; + } + }, { + key: "getSystemName", + value: function getSystemName() { + return PlatformUtils.info.system; + } + }, { + key: "getSystemVersion", + value: function getSystemVersion() { + return PlatformUtils.info.systemVersion; + } + }, { + key: "getMajorSystemVersion", + value: function getMajorSystemVersion() { + return parseInt(PlatformUtils.info.systemVersion, 10); + } + }, { + key: "getSystemSDK", + value: function getSystemSDK() { + return PlatformUtils.info.apiLevel; + } + }, { + key: "hasTLS12", + value: function hasTLS12() { + return !(PlatformUtils.isAndroid() && PlatformUtils.info.apiLevel < 22); + } + }, { + key: "is64bits", + value: function is64bits() { + return PlatformUtils.isIOS() || PlatformUtils.info.supported64BitAbis.length > 0; + } + }, { + key: "getDeviceUniqueId", + value: function getDeviceUniqueId() { + return PlatformUtils.info.uniqueId; + } + }, { + key: "getRandomUUID", + value: function getRandomUUID() { + return _regenerator.default.async(function getRandomUUID$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", _reactNativeUuidGenerator.default.getRandomUUID()); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getPackagedId", + value: function getPackagedId() { + return PlatformUtils.info.bundleId; + } + }, { + key: "getUserAgent", + value: function getUserAgent() { + return PlatformUtils.info.userAgent; + } + }, { + key: "isIOS", + value: function isIOS() { + return _reactNative.Platform.OS === "ios"; + } + }, { + key: "isAndroid", + value: function isAndroid() { + return _reactNative.Platform.OS === "android"; + } + }, { + key: "isEInk", + value: function isEInk() { + return PlatformUtils.info.isEInk; + } + }, { + key: "isPreviousLollipop", + value: function isPreviousLollipop() { + return PlatformUtils.isAndroid() && PlatformUtils.info.apiLevel < 21; + } + }, { + key: "isPreviousMarshmallow", + value: function isPreviousMarshmallow() { + return PlatformUtils.isAndroid() && PlatformUtils.info.apiLevel < 23; + } + }, { + key: "isPreviousNougat", + value: function isPreviousNougat() { + return PlatformUtils.isAndroid() && PlatformUtils.info.apiLevel < 25; + } + }, { + key: "isTablet", + value: function isTablet() { + var _PlatformUtils$info$i; + + return ((_PlatformUtils$info$i = PlatformUtils.info.isTablet) != null ? _PlatformUtils$info$i : _reactNativeDeviceInfo.default.isTablet()) || PlatformUtils.isMac(); + } + }, { + key: "isTabletTenInches", + value: function isTabletTenInches() { + return PlatformUtils.info.isTabletTenInches || PlatformUtils.isMac(); + } + }, { + key: "isiPad", + value: function isiPad() { + return PlatformUtils.isIOS() && PlatformUtils.isTablet(); + } + }, { + key: "isiPhone", + value: function isiPhone() { + return PlatformUtils.isIOS() && !PlatformUtils.isTablet(); + } + }, { + key: "isiPadRegular", + value: function isiPadRegular() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPad() && (dimen.height === 1024 || dimen.width === 1024); + } + }, { + key: "isiPadPro12dot9", + value: function isiPadPro12dot9() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPad() && (dimen.height === 1366 || dimen.width === 1366); + } + }, { + key: "isiPadPro11", + value: function isiPadPro11() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPad() && (dimen.height === 1194 || dimen.width === 1194); + } + }, { + key: "isiPadPro10dot5", + value: function isiPadPro10dot5() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPad() && (dimen.height === 1112 || dimen.width === 1112); + } + }, { + key: "isiPadMini8dot3", + value: function isiPadMini8dot3(deviceDpi) { + if (PlatformUtils.isiPadPro11()) { + if (deviceDpi) { + return deviceDpi === 326; + } + + var deviceId = PlatformUtils.getDeviceId(); + + if (deviceId) { + return deviceId === "iPad14,1" || deviceId === "iPad14,2"; + } + } + + return false; + } + }, { + key: "isiPhoneSE", + value: function isiPhoneSE() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPhone() && (dimen.height === 568 || dimen.width === 568); + } + }, { + key: "isiPhoneRegular", + value: function isiPhoneRegular() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPhone() && (dimen.height === 667 || dimen.width === 667); + } + }, { + key: "isiPhonePlus", + value: function isiPhonePlus() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPhone() && (dimen.height === 736 || dimen.width === 736); + } + }, { + key: "isiPhoneX", + value: function isiPhoneX() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPhone() && (dimen.height === 812 || dimen.width === 812); + } + }, { + key: "isiPhoneXr", + value: function isiPhoneXr() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPhone() && (dimen.height === 896 || dimen.width === 896); + } + }, { + key: "isiPhoneXSMax", + value: function isiPhoneXSMax() { + var dimen = _reactNative.Dimensions.get("window"); + + return PlatformUtils.isiPhone() && (dimen.height === 896 || dimen.width === 896) && PlatformUtils.info.pixelRatio === 3; + } + }, { + key: "isMac", + value: function isMac() { + return PlatformUtils.isIOS() && PlatformUtils.info.deviceType === "Desktop"; + } + }, { + key: "isEmulator", + value: function isEmulator() { + return PlatformUtils.info.isEmulator; + } + }, { + key: "hasLandscapeSplashImage", + value: function hasLandscapeSplashImage() { + return !PlatformUtils.isiPhoneRegular() && !PlatformUtils.isiPhoneSE(); + } + }, { + key: "requestPermission", + value: function requestPermission(_ref) { + var title, message, permission, granted; + return _regenerator.default.async(function requestPermission$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + title = _ref.title, message = _ref.message, permission = _ref.permission; + + if (!PlatformUtils.isAndroid()) { + _context3.next = 14; + break; + } + + _context3.prev = 2; + _context3.next = 5; + return _regenerator.default.awrap(_reactNative.PermissionsAndroid.request(permission, { + title: title, + message: message, + buttonNeutral: global.strings("btn_ask_later"), + buttonNegative: global.strings("btn_cancel"), + buttonPositive: global.strings("btn_ok") + })); + + case 5: + granted = _context3.sent; + + if (!(granted === _reactNative.PermissionsAndroid.RESULTS.GRANTED)) { + _context3.next = 8; + break; + } + + return _context3.abrupt("return", true); + + case 8: + return _context3.abrupt("return", false); + + case 11: + _context3.prev = 11; + _context3.t0 = _context3["catch"](2); + return _context3.abrupt("return", false); + + case 14: + return _context3.abrupt("return", true); + + case 15: + case "end": + return _context3.stop(); + } + } + }, null, null, [[2, 11]], Promise); + } + }, { + key: "isSystemAccessibilityEnabled", + value: function isSystemAccessibilityEnabled() { + return PlatformUtils.info.systemAccessibilityEnabled; + } + }, { + key: "setSystemAccessibilityMode", + value: function setSystemAccessibilityMode(systemAccessibilityEnabled) { + PlatformUtils.info.systemAccessibilityEnabled = systemAccessibilityEnabled; + } + }, { + key: "dpiToPixel", + value: function dpiToPixel() { + var dpi = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + if (PlatformUtils.info) { + return dpi * (PlatformUtils.info.pixelRatio || 1); + } + + return dpi; + } + }, { + key: "setInchesBySizeAndDPI", + value: function setInchesBySizeAndDPI(dpi, screenDimensions) { + if (PlatformUtils.isAndroid()) { + var width = screenDimensions.width, + height = screenDimensions.height; + var pixelRatio = PlatformUtils.info.pixelRatio; + var pixelWidth = width * pixelRatio; + var pixelHeight = height * pixelRatio; + var inchesWidth = pixelWidth / dpi; + var inchesHeight = pixelHeight / dpi; + var inches = Math.floor(Math.sqrt(Math.pow(inchesWidth, 2) + Math.pow(inchesHeight, 2)) * 10) / 10; + PlatformUtils.info.inches = inches; + PlatformUtils.info.isTablet = inches > 6.5; + PlatformUtils.info.isTabletTenInches = inches > 8; + } else { + var isTablet = _reactNativeDeviceInfo.default.isTablet(); + + PlatformUtils.info.isTablet = isTablet; + PlatformUtils.info.isTabletTenInches = isTablet; + } + } + }, { + key: "getStartupOrientation", + value: function getStartupOrientation() { + var _Dimensions$get = _reactNative.Dimensions.get("screen"), + width = _Dimensions$get.width, + height = _Dimensions$get.height; + + if (height > width) { + return PlatformUtils.PORTRAIT; + } + + return PlatformUtils.LANDSCAPE; + } + }, { + key: "isRTL", + value: function isRTL() { + return _reactNative.I18nManager.isRTL; + } + }, { + key: "getAppleWebKitVersion", + value: function getAppleWebKitVersion() { + if (PlatformUtils.isIOS()) { + try { + var userAgentParts = PlatformUtils.info.userAgent.split("AppleWebKit/"); + + if (userAgentParts.length > 1) { + return userAgentParts[1].split(" ")[0]; + } + } catch (e) {} + } + + return ""; + } + }, { + key: "getResolution", + value: function getResolution() { + var size = _reactNative.Dimensions.get("window"); + + return _reactNative.PixelRatio.getPixelSizeForLayoutSize(size.width) + "x" + _reactNative.PixelRatio.getPixelSizeForLayoutSize(size.height); + } + }, { + key: "getPixelSizeForLayoutSize", + value: function getPixelSizeForLayoutSize(size) { + return _reactNative.PixelRatio.getPixelSizeForLayoutSize(size); + } + }, { + key: "colorTopBar", + value: function colorTopBar(topBarColor) { + if (topBarColor) { + PlatformUtils.topBarColor = topBarColor; + + var isTopClear = _colorUtils.default.isClearColor(topBarColor); + + var contentStyle = isTopClear ? "dark-content" : "light-content"; + + if (PlatformUtils.isAndroid()) { + if (isTopClear && PlatformUtils.isPreviousMarshmallow()) { + contentStyle = "light-content"; + topBarColor = "black"; + } + + _reactNative.StatusBar.setBackgroundColor(topBarColor, true); + } + + _reactNative.StatusBar.setBarStyle(contentStyle, true); + } + } + }, { + key: "hideStatusBar", + value: function hideStatusBar() { + PlatformUtils.setStatusBarHidden(true); + } + }, { + key: "showStatusBar", + value: function showStatusBar() { + PlatformUtils.setStatusBarHidden(false); + } + }, { + key: "setStatusBarHidden", + value: function setStatusBarHidden(hide) { + _reactNative.StatusBar.setHidden(hide); + } + }, { + key: "colorBottomBar", + value: function colorBottomBar(bottomBarColor) { + var newBottomBarColor, isBottomClear; + return _regenerator.default.async(function colorBottomBar$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!(bottomBarColor && PlatformUtils.isAndroid())) { + _context4.next = 11; + break; + } + + newBottomBarColor = _colorUtils.default.rgbTOrrggbb(bottomBarColor) || _colorUtils.colors.black; + isBottomClear = _colorUtils.default.isClearColor(newBottomBarColor); + _context4.prev = 3; + _context4.next = 6; + return _regenerator.default.awrap((0, _reactNativeNavigationBarColor.default)(newBottomBarColor, isBottomClear, true)); + + case 6: + _context4.next = 11; + break; + + case 8: + _context4.prev = 8; + _context4.t0 = _context4["catch"](3); + console.warn(_context4.t0.message); + + case 11: + case "end": + return _context4.stop(); + } + } + }, null, null, [[3, 8]], Promise); + } + }, { + key: "colorBars", + value: function colorBars() { + var topBarColor, + bottomBarColor, + _args5 = arguments; + return _regenerator.default.async(function colorBars$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + topBarColor = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : _colorUtils.colors.black; + bottomBarColor = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : _colorUtils.colors.black; + PlatformUtils.colorTopBar(topBarColor); + _context5.next = 5; + return _regenerator.default.awrap(PlatformUtils.colorBottomBar(bottomBarColor)); + + case 5: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "isPortrait", + value: function isPortrait(orientation) { + return orientation === PlatformUtils.PORTRAIT || orientation === PlatformUtils.PORTRAIT_UP_SIDE_DOWN; + } + }, { + key: "isLandscapeLeft", + value: function isLandscapeLeft(orientation) { + return orientation && orientation === PlatformUtils.LANDSCAPE_LEFT; + } + }, { + key: "isLandscapeRight", + value: function isLandscapeRight(orientation) { + return orientation && orientation === PlatformUtils.LANDSCAPE_RIGHT; + } + }, { + key: "isPortraitUpsideDown", + value: function isPortraitUpsideDown(orientation) { + return orientation && orientation === PlatformUtils.PORTRAIT_UP_SIDE_DOWN; + } + }, { + key: "hasNotDefaultFontScale", + value: function hasNotDefaultFontScale() { + return Math.abs(PlatformUtils.info.fontScale - 1) >= PlatformUtils.FONT_SIZE_MIN_VARIATION; + } + }, { + key: "updateFontScale", + value: function updateFontScale() { + var fontScale, changed; + return _regenerator.default.async(function updateFontScale$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + fontScale = 1; + _context6.prev = 1; + _context6.next = 4; + return _regenerator.default.awrap(_reactNativeDeviceInfo.default.getFontScale()); + + case 4: + fontScale = _context6.sent; + _context6.next = 9; + break; + + case 7: + _context6.prev = 7; + _context6.t0 = _context6["catch"](1); + + case 9: + changed = PlatformUtils.info.fontScale !== fontScale; + + if (changed) { + PlatformUtils.info.fontScale = fontScale; + } + + return _context6.abrupt("return", changed); + + case 12: + case "end": + return _context6.stop(); + } + } + }, null, null, [[1, 7]], Promise); + } + }]); + return PlatformUtils; + }(); + + exports.default = PlatformUtils; + PlatformUtils.LANDSCAPE = "LANDSCAPE"; + PlatformUtils.LANDSCAPE_LEFT = "LANDSCAPELEFT"; + PlatformUtils.LANDSCAPE_RIGHT = "LANDSCAPERIGHT"; + PlatformUtils.PORTRAIT = "PORTRAIT"; + PlatformUtils.PORTRAIT_UP_SIDE_DOWN = "PORTRAITUPSIDEDOWN"; + PlatformUtils.FONT_SIZE_MIN_VARIATION = 0.12; + PlatformUtils.defaultDpi = 160; + PlatformUtils.printDefaultDpi = 300; + PlatformUtils.info = {}; + PlatformUtils.topBarColor = undefined; +},531,[5,80,7,8,28,532,538,539,463]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.syncUniqueId = syncUniqueId; + exports.getMacAddress = getMacAddress; + exports.getMacAddressSync = getMacAddressSync; + exports.getReadableVersion = getReadableVersion; + exports.hasNotch = hasNotch; + exports.getTotalDiskCapacityOld = getTotalDiskCapacityOld; + exports.getTotalDiskCapacityOldSync = getTotalDiskCapacityOldSync; + exports.getFreeDiskStorageOld = getFreeDiskStorageOld; + exports.getFreeDiskStorageOldSync = getFreeDiskStorageOldSync; + exports.isLandscape = isLandscape; + exports.isLandscapeSync = isLandscapeSync; + exports.hasSystemFeature = hasSystemFeature; + exports.hasSystemFeatureSync = hasSystemFeatureSync; + exports.isLowBatteryLevel = isLowBatteryLevel; + exports.getDeviceToken = getDeviceToken; + exports.useBatteryLevel = useBatteryLevel; + exports.useBatteryLevelIsLow = useBatteryLevelIsLow; + exports.usePowerState = usePowerState; + exports.useIsHeadphonesConnected = useIsHeadphonesConnected; + exports.useFirstInstallTime = useFirstInstallTime; + exports.useDeviceName = useDeviceName; + exports.useHasSystemFeature = useHasSystemFeature; + exports.useIsEmulator = useIsEmulator; + exports.useManufacturer = useManufacturer; + exports.useBrightness = useBrightness; + exports.getDeviceType = exports.isAirplaneModeSync = exports.isAirplaneMode = exports.isBatteryChargingSync = exports.isBatteryCharging = exports.getPowerStateSync = exports.getPowerState = exports.getBatteryLevelSync = exports.getBatteryLevel = exports.getFreeDiskStorageSync = exports.getFreeDiskStorage = exports.getTotalDiskCapacitySync = exports.getTotalDiskCapacity = exports.getMaxMemorySync = exports.getMaxMemory = exports.getTotalMemorySync = exports.getTotalMemory = exports.getCarrierSync = exports.getCarrier = exports.getPhoneNumberSync = exports.getPhoneNumber = exports.getLastUpdateTimeSync = exports.getLastUpdateTime = exports.getInstallReferrerSync = exports.getInstallReferrer = exports.getFirstInstallTimeSync = exports.getFirstInstallTime = exports.hasHmsSync = exports.hasHms = exports.hasGmsSync = exports.hasGms = exports.isPinOrFingerprintSetSync = exports.isPinOrFingerprintSet = exports.isTablet = exports.isEmulatorSync = exports.isEmulator = exports.getIncrementalSync = exports.getIncremental = exports.getCodenameSync = exports.getCodename = exports.getSecurityPatchSync = exports.getSecurityPatch = exports.getPreviewSdkIntSync = exports.getPreviewSdkInt = exports.getBaseOsSync = exports.getBaseOs = exports.getTypeSync = exports.getType = exports.getTagsSync = exports.getTags = exports.getProductSync = exports.getProduct = exports.getHostSync = exports.getHost = exports.getHardwareSync = exports.getHardware = exports.getFingerprintSync = exports.getFingerprint = exports.getDisplaySync = exports.getDisplay = exports.getDeviceSync = exports.getDevice = exports.getBootloaderSync = exports.getBootloader = exports.getFontScaleSync = exports.getFontScale = exports.getUserAgentSync = exports.getUserAgent = exports.getUsedMemorySync = exports.getUsedMemory = exports.getDeviceNameSync = exports.getDeviceName = exports.getVersion = exports.getBuildNumber = exports.getApplicationName = exports.getInstallerPackageNameSync = exports.getInstallerPackageName = exports.getBundleId = exports.getApiLevelSync = exports.getApiLevel = exports.getBuildIdSync = exports.getBuildId = exports.getSystemVersion = exports.getSystemName = exports.getBrand = exports.getModel = exports.getManufacturerSync = exports.getManufacturer = exports.getDeviceId = exports.isCameraPresentSync = exports.isCameraPresent = exports.getIpAddressSync = exports.getIpAddress = exports.getAndroidIdSync = exports.getAndroidId = exports.getSerialNumberSync = exports.getSerialNumber = exports.getInstanceIdSync = exports.getInstanceId = exports.getUniqueId = undefined; + exports.default = exports.getBrightnessSync = exports.getBrightness = exports.getAvailableLocationProvidersSync = exports.getAvailableLocationProviders = exports.isTabletMode = exports.isKeyboardConnectedSync = exports.isKeyboardConnected = exports.isMouseConnectedSync = exports.isMouseConnected = exports.isHeadphonesConnectedSync = exports.isHeadphonesConnected = exports.isLocationEnabledSync = exports.isLocationEnabled = exports.getSystemAvailableFeaturesSync = exports.getSystemAvailableFeatures = exports.supported64BitAbisSync = exports.supported64BitAbis = exports.supported32BitAbisSync = exports.supported32BitAbis = exports.supportedAbisSync = exports.supportedAbis = exports.getDeviceTypeSync = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[3]); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _devicesWithNotch = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _nativeInterface = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var getUniqueId = function getUniqueId() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + defaultValue: 'unknown', + memoKey: 'uniqueId', + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.uniqueId; + } + }); + }; + + exports.getUniqueId = getUniqueId; + var uniqueId; + + function syncUniqueId() { + return _regenerator.default.async(function syncUniqueId$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!(_reactNative.Platform.OS === 'ios')) { + _context.next = 6; + break; + } + + _context.next = 3; + return _regenerator.default.awrap(_nativeInterface.default.syncUniqueId()); + + case 3: + uniqueId = _context.sent; + _context.next = 7; + break; + + case 6: + uniqueId = getUniqueId(); + + case 7: + return _context.abrupt("return", uniqueId); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + var _getSupportedPlatform = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'instanceId', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getInstanceId(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getInstanceIdSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform2 = (0, _slicedToArray2.default)(_getSupportedPlatform, 2), + getInstanceId = _getSupportedPlatform2[0], + getInstanceIdSync = _getSupportedPlatform2[1]; + + exports.getInstanceIdSync = getInstanceIdSync; + exports.getInstanceId = getInstanceId; + + var _getSupportedPlatform3 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'serialNumber', + supportedPlatforms: ['android', 'windows'], + getter: function getter() { + return _nativeInterface.default.getSerialNumber(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getSerialNumberSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform4 = (0, _slicedToArray2.default)(_getSupportedPlatform3, 2), + getSerialNumber = _getSupportedPlatform4[0], + getSerialNumberSync = _getSupportedPlatform4[1]; + + exports.getSerialNumberSync = getSerialNumberSync; + exports.getSerialNumber = getSerialNumber; + + var _getSupportedPlatform5 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'androidId', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getAndroidId(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getAndroidIdSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform6 = (0, _slicedToArray2.default)(_getSupportedPlatform5, 2), + getAndroidId = _getSupportedPlatform6[0], + getAndroidIdSync = _getSupportedPlatform6[1]; + + exports.getAndroidIdSync = getAndroidIdSync; + exports.getAndroidId = getAndroidId; + + var _getSupportedPlatform7 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.getIpAddress(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getIpAddressSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform8 = (0, _slicedToArray2.default)(_getSupportedPlatform7, 2), + getIpAddress = _getSupportedPlatform8[0], + getIpAddressSync = _getSupportedPlatform8[1]; + + exports.getIpAddressSync = getIpAddressSync; + exports.getIpAddress = getIpAddress; + + var _getSupportedPlatform9 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.isCameraPresent(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isCameraPresentSync(); + }, + defaultValue: false + }), + _getSupportedPlatform10 = (0, _slicedToArray2.default)(_getSupportedPlatform9, 2), + isCameraPresent = _getSupportedPlatform10[0], + isCameraPresentSync = _getSupportedPlatform10[1]; + + exports.isCameraPresentSync = isCameraPresentSync; + exports.isCameraPresent = isCameraPresent; + + function getMacAddress() { + return _regenerator.default.async(function getMacAddress$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!(_reactNative.Platform.OS === 'android')) { + _context2.next = 4; + break; + } + + return _context2.abrupt("return", _nativeInterface.default.getMacAddress()); + + case 4: + if (!(_reactNative.Platform.OS === 'ios')) { + _context2.next = 6; + break; + } + + return _context2.abrupt("return", '02:00:00:00:00:00'); + + case 6: + return _context2.abrupt("return", 'unknown'); + + case 7: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + + function getMacAddressSync() { + if (_reactNative.Platform.OS === 'android') { + return _nativeInterface.default.getMacAddressSync(); + } else if (_reactNative.Platform.OS === 'ios') { + return '02:00:00:00:00:00'; + } + + return 'unknown'; + } + + var getDeviceId = function getDeviceId() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + defaultValue: 'unknown', + memoKey: 'deviceId', + getter: function getter() { + return _nativeInterface.default.deviceId; + }, + supportedPlatforms: ['android', 'ios', 'windows'] + }); + }; + + exports.getDeviceId = getDeviceId; + + var _getSupportedPlatform11 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'manufacturer', + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _reactNative.Platform.OS == 'ios' ? Promise.resolve('Apple') : _nativeInterface.default.getSystemManufacturer(); + }, + syncGetter: function syncGetter() { + return _reactNative.Platform.OS == 'ios' ? 'Apple' : _nativeInterface.default.getSystemManufacturerSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform12 = (0, _slicedToArray2.default)(_getSupportedPlatform11, 2), + getManufacturer = _getSupportedPlatform12[0], + getManufacturerSync = _getSupportedPlatform12[1]; + + exports.getManufacturerSync = getManufacturerSync; + exports.getManufacturer = getManufacturer; + + var getModel = function getModel() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'model', + defaultValue: 'unknown', + supportedPlatforms: ['ios', 'android', 'windows'], + getter: function getter() { + return _nativeInterface.default.model; + } + }); + }; + + exports.getModel = getModel; + + var getBrand = function getBrand() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'brand', + supportedPlatforms: ['android', 'ios', 'windows'], + defaultValue: 'unknown', + getter: function getter() { + return _nativeInterface.default.brand; + } + }); + }; + + exports.getBrand = getBrand; + + var getSystemName = function getSystemName() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + defaultValue: 'unknown', + supportedPlatforms: ['ios', 'android', 'windows'], + memoKey: 'systemName', + getter: function getter() { + return _reactNative.Platform.select({ + ios: _nativeInterface.default.systemName, + android: 'Android', + windows: 'Windows', + default: 'unknown' + }); + } + }); + }; + + exports.getSystemName = getSystemName; + + var getSystemVersion = function getSystemVersion() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + defaultValue: 'unknown', + getter: function getter() { + return _nativeInterface.default.systemVersion; + }, + supportedPlatforms: ['android', 'ios', 'windows'], + memoKey: 'systemVersion' + }); + }; + + exports.getSystemVersion = getSystemVersion; + + var _getSupportedPlatform13 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'buildId', + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.getBuildId(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getBuildIdSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform14 = (0, _slicedToArray2.default)(_getSupportedPlatform13, 2), + getBuildId = _getSupportedPlatform14[0], + getBuildIdSync = _getSupportedPlatform14[1]; + + exports.getBuildIdSync = getBuildIdSync; + exports.getBuildId = getBuildId; + + var _getSupportedPlatform15 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'apiLevel', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getApiLevel(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getApiLevelSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform16 = (0, _slicedToArray2.default)(_getSupportedPlatform15, 2), + getApiLevel = _getSupportedPlatform16[0], + getApiLevelSync = _getSupportedPlatform16[1]; + + exports.getApiLevelSync = getApiLevelSync; + exports.getApiLevel = getApiLevel; + + var getBundleId = function getBundleId() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'bundleId', + supportedPlatforms: ['android', 'ios', 'windows'], + defaultValue: 'unknown', + getter: function getter() { + return _nativeInterface.default.bundleId; + } + }); + }; + + exports.getBundleId = getBundleId; + + var _getSupportedPlatform17 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'installerPackageName', + supportedPlatforms: ['android', 'windows', 'ios'], + getter: function getter() { + return _nativeInterface.default.getInstallerPackageName(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getInstallerPackageNameSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform18 = (0, _slicedToArray2.default)(_getSupportedPlatform17, 2), + getInstallerPackageName = _getSupportedPlatform18[0], + getInstallerPackageNameSync = _getSupportedPlatform18[1]; + + exports.getInstallerPackageNameSync = getInstallerPackageNameSync; + exports.getInstallerPackageName = getInstallerPackageName; + + var getApplicationName = function getApplicationName() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'appName', + defaultValue: 'unknown', + getter: function getter() { + return _nativeInterface.default.appName; + }, + supportedPlatforms: ['android', 'ios', 'windows'] + }); + }; + + exports.getApplicationName = getApplicationName; + + var getBuildNumber = function getBuildNumber() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'buildNumber', + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.buildNumber; + }, + defaultValue: 'unknown' + }); + }; + + exports.getBuildNumber = getBuildNumber; + + var getVersion = function getVersion() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'version', + defaultValue: 'unknown', + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.appVersion; + } + }); + }; + + exports.getVersion = getVersion; + + function getReadableVersion() { + return getVersion() + '.' + getBuildNumber(); + } + + var _getSupportedPlatform19 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.getDeviceName(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getDeviceNameSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform20 = (0, _slicedToArray2.default)(_getSupportedPlatform19, 2), + getDeviceName = _getSupportedPlatform20[0], + getDeviceNameSync = _getSupportedPlatform20[1]; + + exports.getDeviceNameSync = getDeviceNameSync; + exports.getDeviceName = getDeviceName; + + var _getSupportedPlatform21 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getUsedMemory(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getUsedMemorySync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform22 = (0, _slicedToArray2.default)(_getSupportedPlatform21, 2), + getUsedMemory = _getSupportedPlatform22[0], + getUsedMemorySync = _getSupportedPlatform22[1]; + + exports.getUsedMemorySync = getUsedMemorySync; + exports.getUsedMemory = getUsedMemory; + + var getUserAgent = function getUserAgent() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoAsync)({ + memoKey: 'userAgent', + defaultValue: 'unknown', + supportedPlatforms: ['android', 'ios', 'web'], + getter: function getter() { + return _nativeInterface.default.getUserAgent(); + } + }); + }; + + exports.getUserAgent = getUserAgent; + + var getUserAgentSync = function getUserAgentSync() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'userAgent', + defaultValue: 'unknown', + supportedPlatforms: ['android', 'web'], + getter: function getter() { + return _nativeInterface.default.getUserAgentSync(); + } + }); + }; + + exports.getUserAgentSync = getUserAgentSync; + + var _getSupportedPlatform23 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.getFontScale(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getFontScaleSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform24 = (0, _slicedToArray2.default)(_getSupportedPlatform23, 2), + getFontScale = _getSupportedPlatform24[0], + getFontScaleSync = _getSupportedPlatform24[1]; + + exports.getFontScaleSync = getFontScaleSync; + exports.getFontScale = getFontScale; + + var _getSupportedPlatform25 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'bootloader', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getBootloader(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getBootloaderSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform26 = (0, _slicedToArray2.default)(_getSupportedPlatform25, 2), + getBootloader = _getSupportedPlatform26[0], + getBootloaderSync = _getSupportedPlatform26[1]; + + exports.getBootloaderSync = getBootloaderSync; + exports.getBootloader = getBootloader; + + var _getSupportedPlatform27 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + getter: function getter() { + return _nativeInterface.default.getDevice(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getDeviceSync(); + }, + defaultValue: 'unknown', + memoKey: 'device', + supportedPlatforms: ['android'] + }), + _getSupportedPlatform28 = (0, _slicedToArray2.default)(_getSupportedPlatform27, 2), + getDevice = _getSupportedPlatform28[0], + getDeviceSync = _getSupportedPlatform28[1]; + + exports.getDeviceSync = getDeviceSync; + exports.getDevice = getDevice; + + var _getSupportedPlatform29 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'display', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getDisplay(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getDisplaySync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform30 = (0, _slicedToArray2.default)(_getSupportedPlatform29, 2), + getDisplay = _getSupportedPlatform30[0], + getDisplaySync = _getSupportedPlatform30[1]; + + exports.getDisplaySync = getDisplaySync; + exports.getDisplay = getDisplay; + + var _getSupportedPlatform31 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'fingerprint', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getFingerprint(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getFingerprintSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform32 = (0, _slicedToArray2.default)(_getSupportedPlatform31, 2), + getFingerprint = _getSupportedPlatform32[0], + getFingerprintSync = _getSupportedPlatform32[1]; + + exports.getFingerprintSync = getFingerprintSync; + exports.getFingerprint = getFingerprint; + + var _getSupportedPlatform33 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'hardware', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getHardware(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getHardwareSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform34 = (0, _slicedToArray2.default)(_getSupportedPlatform33, 2), + getHardware = _getSupportedPlatform34[0], + getHardwareSync = _getSupportedPlatform34[1]; + + exports.getHardwareSync = getHardwareSync; + exports.getHardware = getHardware; + + var _getSupportedPlatform35 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'host', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getHost(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getHostSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform36 = (0, _slicedToArray2.default)(_getSupportedPlatform35, 2), + getHost = _getSupportedPlatform36[0], + getHostSync = _getSupportedPlatform36[1]; + + exports.getHostSync = getHostSync; + exports.getHost = getHost; + + var _getSupportedPlatform37 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'product', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getProduct(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getProductSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform38 = (0, _slicedToArray2.default)(_getSupportedPlatform37, 2), + getProduct = _getSupportedPlatform38[0], + getProductSync = _getSupportedPlatform38[1]; + + exports.getProductSync = getProductSync; + exports.getProduct = getProduct; + + var _getSupportedPlatform39 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'tags', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getTags(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getTagsSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform40 = (0, _slicedToArray2.default)(_getSupportedPlatform39, 2), + getTags = _getSupportedPlatform40[0], + getTagsSync = _getSupportedPlatform40[1]; + + exports.getTagsSync = getTagsSync; + exports.getTags = getTags; + + var _getSupportedPlatform41 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'type', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getType(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getTypeSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform42 = (0, _slicedToArray2.default)(_getSupportedPlatform41, 2), + getType = _getSupportedPlatform42[0], + getTypeSync = _getSupportedPlatform42[1]; + + exports.getTypeSync = getTypeSync; + exports.getType = getType; + + var _getSupportedPlatform43 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'baseOs', + supportedPlatforms: ['android', 'web', 'windows'], + getter: function getter() { + return _nativeInterface.default.getBaseOs(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getBaseOsSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform44 = (0, _slicedToArray2.default)(_getSupportedPlatform43, 2), + getBaseOs = _getSupportedPlatform44[0], + getBaseOsSync = _getSupportedPlatform44[1]; + + exports.getBaseOsSync = getBaseOsSync; + exports.getBaseOs = getBaseOs; + + var _getSupportedPlatform45 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'previewSdkInt', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getPreviewSdkInt(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getPreviewSdkIntSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform46 = (0, _slicedToArray2.default)(_getSupportedPlatform45, 2), + getPreviewSdkInt = _getSupportedPlatform46[0], + getPreviewSdkIntSync = _getSupportedPlatform46[1]; + + exports.getPreviewSdkIntSync = getPreviewSdkIntSync; + exports.getPreviewSdkInt = getPreviewSdkInt; + + var _getSupportedPlatform47 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'securityPatch', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getSecurityPatch(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getSecurityPatchSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform48 = (0, _slicedToArray2.default)(_getSupportedPlatform47, 2), + getSecurityPatch = _getSupportedPlatform48[0], + getSecurityPatchSync = _getSupportedPlatform48[1]; + + exports.getSecurityPatchSync = getSecurityPatchSync; + exports.getSecurityPatch = getSecurityPatch; + + var _getSupportedPlatform49 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'codeName', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getCodename(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getCodenameSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform50 = (0, _slicedToArray2.default)(_getSupportedPlatform49, 2), + getCodename = _getSupportedPlatform50[0], + getCodenameSync = _getSupportedPlatform50[1]; + + exports.getCodenameSync = getCodenameSync; + exports.getCodename = getCodename; + + var _getSupportedPlatform51 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'incremental', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getIncremental(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getIncrementalSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform52 = (0, _slicedToArray2.default)(_getSupportedPlatform51, 2), + getIncremental = _getSupportedPlatform52[0], + getIncrementalSync = _getSupportedPlatform52[1]; + + exports.getIncrementalSync = getIncrementalSync; + exports.getIncremental = getIncremental; + + var _getSupportedPlatform53 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'emulator', + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.isEmulator(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isEmulatorSync(); + }, + defaultValue: false + }), + _getSupportedPlatform54 = (0, _slicedToArray2.default)(_getSupportedPlatform53, 2), + isEmulator = _getSupportedPlatform54[0], + isEmulatorSync = _getSupportedPlatform54[1]; + + exports.isEmulatorSync = isEmulatorSync; + exports.isEmulator = isEmulator; + + var isTablet = function isTablet() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + defaultValue: false, + supportedPlatforms: ['android', 'ios', 'windows'], + memoKey: 'tablet', + getter: function getter() { + return _nativeInterface.default.isTablet; + } + }); + }; + + exports.isTablet = isTablet; + + var _getSupportedPlatform55 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.isPinOrFingerprintSet(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isPinOrFingerprintSetSync(); + }, + defaultValue: false + }), + _getSupportedPlatform56 = (0, _slicedToArray2.default)(_getSupportedPlatform55, 2), + isPinOrFingerprintSet = _getSupportedPlatform56[0], + isPinOrFingerprintSetSync = _getSupportedPlatform56[1]; + + exports.isPinOrFingerprintSetSync = isPinOrFingerprintSetSync; + exports.isPinOrFingerprintSet = isPinOrFingerprintSet; + var notch; + + function hasNotch() { + if (notch === undefined) { + var _brand = getBrand(); + + var _model = getModel(); + + notch = _devicesWithNotch.default.findIndex(function (item) { + return item.brand.toLowerCase() === _brand.toLowerCase() && item.model.toLowerCase() === _model.toLowerCase(); + }) !== -1; + } + + return notch; + } + + var _getSupportedPlatform57 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.hasGms(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.hasGmsSync(); + }, + defaultValue: false + }), + _getSupportedPlatform58 = (0, _slicedToArray2.default)(_getSupportedPlatform57, 2), + hasGms = _getSupportedPlatform58[0], + hasGmsSync = _getSupportedPlatform58[1]; + + exports.hasGmsSync = hasGmsSync; + exports.hasGms = hasGms; + + var _getSupportedPlatform59 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.hasHms(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.hasHmsSync(); + }, + defaultValue: false + }), + _getSupportedPlatform60 = (0, _slicedToArray2.default)(_getSupportedPlatform59, 2), + hasHms = _getSupportedPlatform60[0], + hasHmsSync = _getSupportedPlatform60[1]; + + exports.hasHmsSync = hasHmsSync; + exports.hasHms = hasHms; + + var _getSupportedPlatform61 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'firstInstallTime', + supportedPlatforms: ['android', 'windows'], + getter: function getter() { + return _nativeInterface.default.getFirstInstallTime(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getFirstInstallTimeSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform62 = (0, _slicedToArray2.default)(_getSupportedPlatform61, 2), + getFirstInstallTime = _getSupportedPlatform62[0], + getFirstInstallTimeSync = _getSupportedPlatform62[1]; + + exports.getFirstInstallTimeSync = getFirstInstallTimeSync; + exports.getFirstInstallTime = getFirstInstallTime; + + var _getSupportedPlatform63 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'installReferrer', + supportedPlatforms: ['android', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getInstallReferrer(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getInstallReferrerSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform64 = (0, _slicedToArray2.default)(_getSupportedPlatform63, 2), + getInstallReferrer = _getSupportedPlatform64[0], + getInstallReferrerSync = _getSupportedPlatform64[1]; + + exports.getInstallReferrerSync = getInstallReferrerSync; + exports.getInstallReferrer = getInstallReferrer; + + var _getSupportedPlatform65 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'lastUpdateTime', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getLastUpdateTime(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getLastUpdateTimeSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform66 = (0, _slicedToArray2.default)(_getSupportedPlatform65, 2), + getLastUpdateTime = _getSupportedPlatform66[0], + getLastUpdateTimeSync = _getSupportedPlatform66[1]; + + exports.getLastUpdateTimeSync = getLastUpdateTimeSync; + exports.getLastUpdateTime = getLastUpdateTime; + + var _getSupportedPlatform67 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getPhoneNumber(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getPhoneNumberSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform68 = (0, _slicedToArray2.default)(_getSupportedPlatform67, 2), + getPhoneNumber = _getSupportedPlatform68[0], + getPhoneNumberSync = _getSupportedPlatform68[1]; + + exports.getPhoneNumberSync = getPhoneNumberSync; + exports.getPhoneNumber = getPhoneNumber; + + var _getSupportedPlatform69 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios'], + getter: function getter() { + return _nativeInterface.default.getCarrier(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getCarrierSync(); + }, + defaultValue: 'unknown' + }), + _getSupportedPlatform70 = (0, _slicedToArray2.default)(_getSupportedPlatform69, 2), + getCarrier = _getSupportedPlatform70[0], + getCarrierSync = _getSupportedPlatform70[1]; + + exports.getCarrierSync = getCarrierSync; + exports.getCarrier = getCarrier; + + var _getSupportedPlatform71 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'totalMemory', + supportedPlatforms: ['android', 'ios', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getTotalMemory(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getTotalMemorySync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform72 = (0, _slicedToArray2.default)(_getSupportedPlatform71, 2), + getTotalMemory = _getSupportedPlatform72[0], + getTotalMemorySync = _getSupportedPlatform72[1]; + + exports.getTotalMemorySync = getTotalMemorySync; + exports.getTotalMemory = getTotalMemory; + + var _getSupportedPlatform73 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: 'maxMemory', + supportedPlatforms: ['android', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getMaxMemory(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getMaxMemorySync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform74 = (0, _slicedToArray2.default)(_getSupportedPlatform73, 2), + getMaxMemory = _getSupportedPlatform74[0], + getMaxMemorySync = _getSupportedPlatform74[1]; + + exports.getMaxMemorySync = getMaxMemorySync; + exports.getMaxMemory = getMaxMemory; + + var _getSupportedPlatform75 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getTotalDiskCapacity(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getTotalDiskCapacitySync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform76 = (0, _slicedToArray2.default)(_getSupportedPlatform75, 2), + getTotalDiskCapacity = _getSupportedPlatform76[0], + getTotalDiskCapacitySync = _getSupportedPlatform76[1]; + + exports.getTotalDiskCapacitySync = getTotalDiskCapacitySync; + exports.getTotalDiskCapacity = getTotalDiskCapacity; + + function getTotalDiskCapacityOld() { + return _regenerator.default.async(function getTotalDiskCapacityOld$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!(_reactNative.Platform.OS === 'android')) { + _context3.next = 2; + break; + } + + return _context3.abrupt("return", _nativeInterface.default.getTotalDiskCapacityOld()); + + case 2: + if (!(_reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'windows' || _reactNative.Platform.OS === 'web')) { + _context3.next = 4; + break; + } + + return _context3.abrupt("return", getTotalDiskCapacity()); + + case 4: + return _context3.abrupt("return", -1); + + case 5: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + + function getTotalDiskCapacityOldSync() { + if (_reactNative.Platform.OS === 'android') { + return _nativeInterface.default.getTotalDiskCapacityOldSync(); + } + + if (_reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'windows' || _reactNative.Platform.OS === 'web') { + return getTotalDiskCapacitySync(); + } + + return -1; + } + + var _getSupportedPlatform77 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getFreeDiskStorage(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getFreeDiskStorageSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform78 = (0, _slicedToArray2.default)(_getSupportedPlatform77, 2), + getFreeDiskStorage = _getSupportedPlatform78[0], + getFreeDiskStorageSync = _getSupportedPlatform78[1]; + + exports.getFreeDiskStorageSync = getFreeDiskStorageSync; + exports.getFreeDiskStorage = getFreeDiskStorage; + + function getFreeDiskStorageOld() { + return _regenerator.default.async(function getFreeDiskStorageOld$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!(_reactNative.Platform.OS === 'android')) { + _context4.next = 2; + break; + } + + return _context4.abrupt("return", _nativeInterface.default.getFreeDiskStorageOld()); + + case 2: + if (!(_reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'windows' || _reactNative.Platform.OS === 'web')) { + _context4.next = 4; + break; + } + + return _context4.abrupt("return", getFreeDiskStorage()); + + case 4: + return _context4.abrupt("return", -1); + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + + function getFreeDiskStorageOldSync() { + if (_reactNative.Platform.OS === 'android') { + return _nativeInterface.default.getFreeDiskStorageOldSync(); + } + + if (_reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'windows' || _reactNative.Platform.OS === 'web') { + return getFreeDiskStorageSync(); + } + + return -1; + } + + var _getSupportedPlatform79 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getBatteryLevel(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getBatteryLevelSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform80 = (0, _slicedToArray2.default)(_getSupportedPlatform79, 2), + getBatteryLevel = _getSupportedPlatform80[0], + getBatteryLevelSync = _getSupportedPlatform80[1]; + + exports.getBatteryLevelSync = getBatteryLevelSync; + exports.getBatteryLevel = getBatteryLevel; + + var _getSupportedPlatform81 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['ios', 'android', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.getPowerState(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getPowerStateSync(); + }, + defaultValue: {} + }), + _getSupportedPlatform82 = (0, _slicedToArray2.default)(_getSupportedPlatform81, 2), + getPowerState = _getSupportedPlatform82[0], + getPowerStateSync = _getSupportedPlatform82[1]; + + exports.getPowerStateSync = getPowerStateSync; + exports.getPowerState = getPowerState; + + var _getSupportedPlatform83 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'windows', 'web'], + getter: function getter() { + return _nativeInterface.default.isBatteryCharging(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isBatteryChargingSync(); + }, + defaultValue: false + }), + _getSupportedPlatform84 = (0, _slicedToArray2.default)(_getSupportedPlatform83, 2), + isBatteryCharging = _getSupportedPlatform84[0], + isBatteryChargingSync = _getSupportedPlatform84[1]; + + exports.isBatteryChargingSync = isBatteryChargingSync; + exports.isBatteryCharging = isBatteryCharging; + + function isLandscape() { + return _regenerator.default.async(function isLandscape$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", Promise.resolve(isLandscapeSync())); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + + function isLandscapeSync() { + var _Dimensions$get = _reactNative.Dimensions.get('window'), + height = _Dimensions$get.height, + width = _Dimensions$get.width; + + return width >= height; + } + + var _getSupportedPlatform85 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'web'], + getter: function getter() { + return _nativeInterface.default.isAirplaneMode(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isAirplaneModeSync(); + }, + defaultValue: false + }), + _getSupportedPlatform86 = (0, _slicedToArray2.default)(_getSupportedPlatform85, 2), + isAirplaneMode = _getSupportedPlatform86[0], + isAirplaneModeSync = _getSupportedPlatform86[1]; + + exports.isAirplaneModeSync = isAirplaneModeSync; + exports.isAirplaneMode = isAirplaneMode; + + var getDeviceType = function getDeviceType() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'deviceType', + supportedPlatforms: ['android', 'ios', 'windows'], + defaultValue: 'unknown', + getter: function getter() { + return _nativeInterface.default.deviceType; + } + }); + }; + + exports.getDeviceType = getDeviceType; + + var getDeviceTypeSync = function getDeviceTypeSync() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoSync)({ + memoKey: 'deviceType', + supportedPlatforms: ['android', 'ios', 'windows'], + defaultValue: 'unknown', + getter: function getter() { + return _nativeInterface.default.deviceType; + } + }); + }; + + exports.getDeviceTypeSync = getDeviceTypeSync; + + var _getSupportedPlatform87 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: '_supportedAbis', + supportedPlatforms: ['android', 'ios', 'windows'], + getter: function getter() { + return _nativeInterface.default.getSupportedAbis(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getSupportedAbisSync(); + }, + defaultValue: [] + }), + _getSupportedPlatform88 = (0, _slicedToArray2.default)(_getSupportedPlatform87, 2), + supportedAbis = _getSupportedPlatform88[0], + supportedAbisSync = _getSupportedPlatform88[1]; + + exports.supportedAbisSync = supportedAbisSync; + exports.supportedAbis = supportedAbis; + + var _getSupportedPlatform89 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: '_supported32BitAbis', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getSupported32BitAbis(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getSupported32BitAbisSync(); + }, + defaultValue: [] + }), + _getSupportedPlatform90 = (0, _slicedToArray2.default)(_getSupportedPlatform89, 2), + supported32BitAbis = _getSupportedPlatform90[0], + supported32BitAbisSync = _getSupportedPlatform90[1]; + + exports.supported32BitAbisSync = supported32BitAbisSync; + exports.supported32BitAbis = supported32BitAbis; + + var _getSupportedPlatform91 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + memoKey: '_supported64BitAbis', + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getSupported64BitAbis(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getSupported64BitAbisSync(); + }, + defaultValue: [] + }), + _getSupportedPlatform92 = (0, _slicedToArray2.default)(_getSupportedPlatform91, 2), + supported64BitAbis = _getSupportedPlatform92[0], + supported64BitAbisSync = _getSupportedPlatform92[1]; + + exports.supported64BitAbisSync = supported64BitAbisSync; + exports.supported64BitAbis = supported64BitAbis; + + function hasSystemFeature(feature) { + return _regenerator.default.async(function hasSystemFeature$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + if (!(_reactNative.Platform.OS === 'android')) { + _context6.next = 2; + break; + } + + return _context6.abrupt("return", _nativeInterface.default.hasSystemFeature(feature)); + + case 2: + return _context6.abrupt("return", false); + + case 3: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + + function hasSystemFeatureSync(feature) { + if (_reactNative.Platform.OS === 'android') { + return _nativeInterface.default.hasSystemFeatureSync(feature); + } + + return false; + } + + function isLowBatteryLevel(level) { + if (_reactNative.Platform.OS === 'android') { + return level < 0.15; + } + + return level < 0.2; + } + + var _getSupportedPlatform93 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android'], + getter: function getter() { + return _nativeInterface.default.getSystemAvailableFeatures(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getSystemAvailableFeaturesSync(); + }, + defaultValue: [] + }), + _getSupportedPlatform94 = (0, _slicedToArray2.default)(_getSupportedPlatform93, 2), + getSystemAvailableFeatures = _getSupportedPlatform94[0], + getSystemAvailableFeaturesSync = _getSupportedPlatform94[1]; + + exports.getSystemAvailableFeaturesSync = getSystemAvailableFeaturesSync; + exports.getSystemAvailableFeatures = getSystemAvailableFeatures; + + var _getSupportedPlatform95 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios', 'web'], + getter: function getter() { + return _nativeInterface.default.isLocationEnabled(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isLocationEnabledSync(); + }, + defaultValue: false + }), + _getSupportedPlatform96 = (0, _slicedToArray2.default)(_getSupportedPlatform95, 2), + isLocationEnabled = _getSupportedPlatform96[0], + isLocationEnabledSync = _getSupportedPlatform96[1]; + + exports.isLocationEnabledSync = isLocationEnabledSync; + exports.isLocationEnabled = isLocationEnabled; + + var _getSupportedPlatform97 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios'], + getter: function getter() { + return _nativeInterface.default.isHeadphonesConnected(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isHeadphonesConnectedSync(); + }, + defaultValue: false + }), + _getSupportedPlatform98 = (0, _slicedToArray2.default)(_getSupportedPlatform97, 2), + isHeadphonesConnected = _getSupportedPlatform98[0], + isHeadphonesConnectedSync = _getSupportedPlatform98[1]; + + exports.isHeadphonesConnectedSync = isHeadphonesConnectedSync; + exports.isHeadphonesConnected = isHeadphonesConnected; + + var _getSupportedPlatform99 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['windows'], + getter: function getter() { + return _nativeInterface.default.isMouseConnected(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isMouseConnectedSync(); + }, + defaultValue: false + }), + _getSupportedPlatform100 = (0, _slicedToArray2.default)(_getSupportedPlatform99, 2), + isMouseConnected = _getSupportedPlatform100[0], + isMouseConnectedSync = _getSupportedPlatform100[1]; + + exports.isMouseConnectedSync = isMouseConnectedSync; + exports.isMouseConnected = isMouseConnected; + + var _getSupportedPlatform101 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['windows'], + getter: function getter() { + return _nativeInterface.default.isKeyboardConnected(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.isKeyboardConnectedSync(); + }, + defaultValue: false + }), + _getSupportedPlatform102 = (0, _slicedToArray2.default)(_getSupportedPlatform101, 2), + isKeyboardConnected = _getSupportedPlatform102[0], + isKeyboardConnectedSync = _getSupportedPlatform102[1]; + + exports.isKeyboardConnectedSync = isKeyboardConnectedSync; + exports.isKeyboardConnected = isKeyboardConnected; + + var isTabletMode = function isTabletMode() { + return (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoAsync)({ + supportedPlatforms: ['windows'], + getter: function getter() { + return _nativeInterface.default.isTabletMode(); + }, + defaultValue: false + }); + }; + + exports.isTabletMode = isTabletMode; + + var _getSupportedPlatform103 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['android', 'ios'], + getter: function getter() { + return _nativeInterface.default.getAvailableLocationProviders(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getAvailableLocationProvidersSync(); + }, + defaultValue: {} + }), + _getSupportedPlatform104 = (0, _slicedToArray2.default)(_getSupportedPlatform103, 2), + getAvailableLocationProviders = _getSupportedPlatform104[0], + getAvailableLocationProvidersSync = _getSupportedPlatform104[1]; + + exports.getAvailableLocationProvidersSync = getAvailableLocationProvidersSync; + exports.getAvailableLocationProviders = getAvailableLocationProviders; + + var _getSupportedPlatform105 = (0, _$$_REQUIRE(_dependencyMap[7]).getSupportedPlatformInfoFunctions)({ + supportedPlatforms: ['ios'], + getter: function getter() { + return _nativeInterface.default.getBrightness(); + }, + syncGetter: function syncGetter() { + return _nativeInterface.default.getBrightnessSync(); + }, + defaultValue: -1 + }), + _getSupportedPlatform106 = (0, _slicedToArray2.default)(_getSupportedPlatform105, 2), + getBrightness = _getSupportedPlatform106[0], + getBrightnessSync = _getSupportedPlatform106[1]; + + exports.getBrightnessSync = getBrightnessSync; + exports.getBrightness = getBrightness; + + function getDeviceToken() { + return _regenerator.default.async(function getDeviceToken$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + if (!(_reactNative.Platform.OS === 'ios')) { + _context7.next = 2; + break; + } + + return _context7.abrupt("return", _nativeInterface.default.getDeviceToken()); + + case 2: + return _context7.abrupt("return", 'unknown'); + + case 3: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + } + + var deviceInfoEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.RNDeviceInfo); + + function useBatteryLevel() { + var _useState = (0, _react.useState)(null), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + batteryLevel = _useState2[0], + setBatteryLevel = _useState2[1]; + + (0, _react.useEffect)(function () { + var setInitialValue = function _callee() { + var initialValue; + return _regenerator.default.async(function _callee$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + _context8.next = 2; + return _regenerator.default.awrap(getBatteryLevel()); + + case 2: + initialValue = _context8.sent; + setBatteryLevel(initialValue); + + case 4: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + }; + + var onChange = function onChange(level) { + setBatteryLevel(level); + }; + + setInitialValue(); + var subscription = deviceInfoEmitter.addListener('RNDeviceInfo_batteryLevelDidChange', onChange); + return function () { + return subscription.remove(); + }; + }, []); + return batteryLevel; + } + + function useBatteryLevelIsLow() { + var _useState3 = (0, _react.useState)(null), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + batteryLevelIsLow = _useState4[0], + setBatteryLevelIsLow = _useState4[1]; + + (0, _react.useEffect)(function () { + var setInitialValue = function _callee2() { + var initialValue; + return _regenerator.default.async(function _callee2$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + _context9.next = 2; + return _regenerator.default.awrap(getBatteryLevel()); + + case 2: + initialValue = _context9.sent; + isLowBatteryLevel(initialValue) && setBatteryLevelIsLow(initialValue); + + case 4: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + }; + + setInitialValue(); + + var onChange = function onChange(level) { + setBatteryLevelIsLow(level); + }; + + var subscription = deviceInfoEmitter.addListener('RNDeviceInfo_batteryLevelIsLow', onChange); + return function () { + return subscription.remove(); + }; + }, []); + return batteryLevelIsLow; + } + + function usePowerState() { + var _useState5 = (0, _react.useState)({}), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + powerState = _useState6[0], + setPowerState = _useState6[1]; + + (0, _react.useEffect)(function () { + var setInitialValue = function _callee3() { + var initialValue; + return _regenerator.default.async(function _callee3$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.next = 2; + return _regenerator.default.awrap(getPowerState()); + + case 2: + initialValue = _context10.sent; + setPowerState(initialValue); + + case 4: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + }; + + var onChange = function onChange(state) { + setPowerState(state); + }; + + setInitialValue(); + var subscription = deviceInfoEmitter.addListener('RNDeviceInfo_powerStateDidChange', onChange); + return function () { + return subscription.remove(); + }; + }, []); + return powerState; + } + + function useIsHeadphonesConnected() { + return (0, _$$_REQUIRE(_dependencyMap[8]).useOnEvent)('RNDeviceInfo_headphoneConnectionDidChange', isHeadphonesConnected, false); + } + + function useFirstInstallTime() { + return (0, _$$_REQUIRE(_dependencyMap[8]).useOnMount)(getFirstInstallTime, -1); + } + + function useDeviceName() { + return (0, _$$_REQUIRE(_dependencyMap[8]).useOnMount)(getDeviceName, 'unknown'); + } + + function useHasSystemFeature(feature) { + var asyncGetter = (0, _react.useCallback)(function () { + return hasSystemFeature(feature); + }, [feature]); + return (0, _$$_REQUIRE(_dependencyMap[8]).useOnMount)(asyncGetter, false); + } + + function useIsEmulator() { + return (0, _$$_REQUIRE(_dependencyMap[8]).useOnMount)(isEmulator, false); + } + + function useManufacturer() { + return (0, _$$_REQUIRE(_dependencyMap[8]).useOnMount)(getManufacturer, 'unknown'); + } + + function useBrightness() { + var _useState7 = (0, _react.useState)(null), + _useState8 = (0, _slicedToArray2.default)(_useState7, 2), + brightness = _useState8[0], + setBrightness = _useState8[1]; + + (0, _react.useEffect)(function () { + var setInitialValue = function _callee4() { + var initialValue; + return _regenerator.default.async(function _callee4$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + _context11.next = 2; + return _regenerator.default.awrap(getBrightness()); + + case 2: + initialValue = _context11.sent; + setBrightness(initialValue); + + case 4: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + }; + + var onChange = function onChange(value) { + setBrightness(value); + }; + + setInitialValue(); + var subscription = deviceInfoEmitter.addListener('RNDeviceInfo_brightnessDidChange', onChange); + return function () { + return subscription.remove(); + }; + }, []); + return brightness; + } + + var deviceInfoModule = { + getAndroidId: getAndroidId, + getAndroidIdSync: getAndroidIdSync, + getApiLevel: getApiLevel, + getApiLevelSync: getApiLevelSync, + getApplicationName: getApplicationName, + getAvailableLocationProviders: getAvailableLocationProviders, + getAvailableLocationProvidersSync: getAvailableLocationProvidersSync, + getBaseOs: getBaseOs, + getBaseOsSync: getBaseOsSync, + getBatteryLevel: getBatteryLevel, + getBatteryLevelSync: getBatteryLevelSync, + getBootloader: getBootloader, + getBootloaderSync: getBootloaderSync, + getBrand: getBrand, + getBuildId: getBuildId, + getBuildIdSync: getBuildIdSync, + getBuildNumber: getBuildNumber, + getBundleId: getBundleId, + getCarrier: getCarrier, + getCarrierSync: getCarrierSync, + getCodename: getCodename, + getCodenameSync: getCodenameSync, + getDevice: getDevice, + getDeviceId: getDeviceId, + getDeviceName: getDeviceName, + getDeviceNameSync: getDeviceNameSync, + getDeviceSync: getDeviceSync, + getDeviceToken: getDeviceToken, + getDeviceType: getDeviceType, + getDisplay: getDisplay, + getDisplaySync: getDisplaySync, + getFingerprint: getFingerprint, + getFingerprintSync: getFingerprintSync, + getFirstInstallTime: getFirstInstallTime, + getFirstInstallTimeSync: getFirstInstallTimeSync, + getFontScale: getFontScale, + getFontScaleSync: getFontScaleSync, + getFreeDiskStorage: getFreeDiskStorage, + getFreeDiskStorageOld: getFreeDiskStorageOld, + getFreeDiskStorageSync: getFreeDiskStorageSync, + getFreeDiskStorageOldSync: getFreeDiskStorageOldSync, + getHardware: getHardware, + getHardwareSync: getHardwareSync, + getHost: getHost, + getHostSync: getHostSync, + getIncremental: getIncremental, + getIncrementalSync: getIncrementalSync, + getInstallerPackageName: getInstallerPackageName, + getInstallerPackageNameSync: getInstallerPackageNameSync, + getInstallReferrer: getInstallReferrer, + getInstallReferrerSync: getInstallReferrerSync, + getInstanceId: getInstanceId, + getInstanceIdSync: getInstanceIdSync, + getIpAddress: getIpAddress, + getIpAddressSync: getIpAddressSync, + getLastUpdateTime: getLastUpdateTime, + getLastUpdateTimeSync: getLastUpdateTimeSync, + getMacAddress: getMacAddress, + getMacAddressSync: getMacAddressSync, + getManufacturer: getManufacturer, + getManufacturerSync: getManufacturerSync, + getMaxMemory: getMaxMemory, + getMaxMemorySync: getMaxMemorySync, + getModel: getModel, + getPhoneNumber: getPhoneNumber, + getPhoneNumberSync: getPhoneNumberSync, + getPowerState: getPowerState, + getPowerStateSync: getPowerStateSync, + getPreviewSdkInt: getPreviewSdkInt, + getPreviewSdkIntSync: getPreviewSdkIntSync, + getProduct: getProduct, + getProductSync: getProductSync, + getReadableVersion: getReadableVersion, + getSecurityPatch: getSecurityPatch, + getSecurityPatchSync: getSecurityPatchSync, + getSerialNumber: getSerialNumber, + getSerialNumberSync: getSerialNumberSync, + getSystemAvailableFeatures: getSystemAvailableFeatures, + getSystemAvailableFeaturesSync: getSystemAvailableFeaturesSync, + getSystemName: getSystemName, + getSystemVersion: getSystemVersion, + getTags: getTags, + getTagsSync: getTagsSync, + getTotalDiskCapacity: getTotalDiskCapacity, + getTotalDiskCapacityOld: getTotalDiskCapacityOld, + getTotalDiskCapacitySync: getTotalDiskCapacitySync, + getTotalDiskCapacityOldSync: getTotalDiskCapacityOldSync, + getTotalMemory: getTotalMemory, + getTotalMemorySync: getTotalMemorySync, + getType: getType, + getTypeSync: getTypeSync, + getUniqueId: getUniqueId, + getUsedMemory: getUsedMemory, + getUsedMemorySync: getUsedMemorySync, + getUserAgent: getUserAgent, + getUserAgentSync: getUserAgentSync, + getVersion: getVersion, + getBrightness: getBrightness, + getBrightnessSync: getBrightnessSync, + hasGms: hasGms, + hasGmsSync: hasGmsSync, + hasHms: hasHms, + hasHmsSync: hasHmsSync, + hasNotch: hasNotch, + hasSystemFeature: hasSystemFeature, + hasSystemFeatureSync: hasSystemFeatureSync, + isAirplaneMode: isAirplaneMode, + isAirplaneModeSync: isAirplaneModeSync, + isBatteryCharging: isBatteryCharging, + isBatteryChargingSync: isBatteryChargingSync, + isCameraPresent: isCameraPresent, + isCameraPresentSync: isCameraPresentSync, + isEmulator: isEmulator, + isEmulatorSync: isEmulatorSync, + isHeadphonesConnected: isHeadphonesConnected, + isHeadphonesConnectedSync: isHeadphonesConnectedSync, + isLandscape: isLandscape, + isLandscapeSync: isLandscapeSync, + isLocationEnabled: isLocationEnabled, + isLocationEnabledSync: isLocationEnabledSync, + isPinOrFingerprintSet: isPinOrFingerprintSet, + isPinOrFingerprintSetSync: isPinOrFingerprintSetSync, + isMouseConnected: isMouseConnected, + isMouseConnectedSync: isMouseConnectedSync, + isKeyboardConnected: isKeyboardConnected, + isKeyboardConnectedSync: isKeyboardConnectedSync, + isTabletMode: isTabletMode, + isTablet: isTablet, + supported32BitAbis: supported32BitAbis, + supported32BitAbisSync: supported32BitAbisSync, + supported64BitAbis: supported64BitAbis, + supported64BitAbisSync: supported64BitAbisSync, + supportedAbis: supportedAbis, + supportedAbisSync: supportedAbisSync, + syncUniqueId: syncUniqueId, + useBatteryLevel: useBatteryLevel, + useBatteryLevelIsLow: useBatteryLevelIsLow, + useDeviceName: useDeviceName, + useFirstInstallTime: useFirstInstallTime, + useHasSystemFeature: useHasSystemFeature, + useIsEmulator: useIsEmulator, + usePowerState: usePowerState, + useManufacturer: useManufacturer, + useIsHeadphonesConnected: useIsHeadphonesConnected, + useBrightness: useBrightness + }; + var _default = deviceInfoModule; + exports.default = _default; +},532,[5,41,80,17,28,533,534,536,537]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var devicesWithNotch = [{ + brand: 'Apple', + model: 'iPhone 13 mini' + }, { + brand: 'Apple', + model: 'iPhone 13' + }, { + brand: 'Apple', + model: 'iPhone 13 Pro' + }, { + brand: 'Apple', + model: 'iPhone 13 Pro Max' + }, { + brand: 'Apple', + model: 'iPhone 12 mini' + }, { + brand: 'Apple', + model: 'iPhone 12' + }, { + brand: 'Apple', + model: 'iPhone 12 Pro' + }, { + brand: 'Apple', + model: 'iPhone 12 Pro Max' + }, { + brand: 'Apple', + model: 'iPhone 11' + }, { + brand: 'Apple', + model: 'iPhone 11 Pro' + }, { + brand: 'Apple', + model: 'iPhone 11 Pro Max' + }, { + brand: 'Apple', + model: 'iPhone X' + }, { + brand: 'Apple', + model: 'iPhone XS' + }, { + brand: 'Apple', + model: 'iPhone XS Max' + }, { + brand: 'Apple', + model: 'iPhone XR' + }, { + brand: 'Asus', + model: 'ZenFone 5' + }, { + brand: 'Asus', + model: 'ZenFone 5z' + }, { + brand: 'google', + model: 'Pixel 3 XL' + }, { + brand: 'google', + model: 'Pixel 4a' + }, { + brand: 'Huawei', + model: 'P20' + }, { + brand: 'Huawei', + model: 'P20 Plus' + }, { + brand: 'Huawei', + model: 'P20 Lite' + }, { + brand: 'Huawei', + model: 'ANE-LX1' + }, { + brand: 'Huawei', + model: 'INE-LX1' + }, { + brand: 'Huawei', + model: 'POT-LX1' + }, { + brand: 'Huawei', + model: 'Honor Play' + }, { + brand: 'Huawei', + model: 'Honor 10' + }, { + brand: 'Huawei', + model: 'Mate 20 Lite' + }, { + brand: 'Huawei', + model: 'Mate 20 Pro' + }, { + brand: 'Huawei', + model: 'ELE-L29' + }, { + brand: 'Huawei', + model: 'P30 Lite' + }, { + brand: 'Huawei', + model: 'P30 Pro' + }, { + brand: 'Huawei', + model: 'JNY-LX1' + }, { + brand: 'Huawei', + model: 'Nova 3' + }, { + brand: 'Huawei', + model: 'Nova 3i' + }, { + brand: 'Leagoo', + model: 'S9' + }, { + brand: 'LG', + model: 'G7' + }, { + brand: 'LG', + model: 'G7 ThinQ' + }, { + brand: 'LG', + model: 'G7+ ThinQ' + }, { + brand: 'LG', + model: 'LM-Q910' + }, { + brand: 'LG', + model: 'LM-G710' + }, { + brand: 'LG', + model: 'LM-V405' + }, { + brand: 'Motorola', + model: 'Moto g7 Play' + }, { + brand: 'Motorola', + model: 'Moto g7 Power' + }, { + brand: 'Motorola', + model: 'One' + }, { + brand: 'Motorola', + model: 'Motorola One Vision' + }, { + brand: 'Nokia', + model: '5.1 Plus' + }, { + brand: 'Nokia', + model: 'Nokia 6.1 Plus' + }, { + brand: 'Nokia', + model: '7.1' + }, { + brand: 'Nokia', + model: '8.1' + }, { + brand: 'OnePlus', + model: '6' + }, { + brand: 'OnePlus', + model: 'A6003' + }, { + brand: 'ONEPLUS', + model: 'A6000' + }, { + brand: 'OnePlus', + model: 'OnePlus A6003' + }, { + brand: 'OnePlus', + model: 'ONEPLUS A6010' + }, { + brand: 'OnePlus', + model: 'ONEPLUS A6013' + }, { + brand: 'OnePlus', + model: 'ONEPLUS A6000' + }, { + brand: 'Oppo', + model: 'R15' + }, { + brand: 'Oppo', + model: 'R15 Pro' + }, { + brand: 'Oppo', + model: 'F7' + }, { + brand: 'Oukitel', + model: 'U18' + }, { + brand: 'Redmi', + model: 'M2004J19C' + }, { + brand: 'Sharp', + model: 'Aquos S3' + }, { + brand: 'Vivo', + model: 'V9' + }, { + brand: 'Vivo', + model: 'X21' + }, { + brand: 'Vivo', + model: 'X21 UD' + }, { + brand: 'xiaomi', + model: 'MI 8' + }, { + brand: 'xiaomi', + model: 'MI 8 Explorer Edition' + }, { + brand: 'xiaomi', + model: 'MI 8 SE' + }, { + brand: 'xiaomi', + model: 'MI 8 UD' + }, { + brand: 'xiaomi', + model: 'MI 8 Lite' + }, { + brand: 'xiaomi', + model: 'Mi 9' + }, { + brand: 'xiaomi', + model: 'POCO F1' + }, { + brand: 'xiaomi', + model: 'POCOPHONE F1' + }, { + brand: 'xiaomi', + model: 'Redmi 6 Pro' + }, { + brand: 'xiaomi', + model: 'Redmi Note 7' + }, { + brand: 'xiaomi', + model: 'Redmi 7' + }, { + brand: 'xiaomi', + model: 'Redmi Note 8' + }, { + brand: 'xiaomi', + model: 'Redmi Note 8 Pro' + }, { + brand: 'xiaomi', + model: 'Mi A2 Lite' + }, { + brand: 'Blackview', + model: 'A30' + }, { + brand: 'Samsung', + model: 'SM-A217F' + }, { + brand: 'Samsung', + model: 'SM-A715F' + }]; + var _default = devicesWithNotch; + exports.default = _default; +},533,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNDeviceInfo = _reactNative.NativeModules.RNDeviceInfo; + + if (_reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'dom') { + RNDeviceInfo = _$$_REQUIRE(_dependencyMap[1]); + } + + if (!RNDeviceInfo) { + if (_reactNative.Platform.OS === 'android' || _reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'dom') { + throw new Error("react-native-device-info: NativeModule.RNDeviceInfo is null. To fix this issue try these steps:\n \u2022 For react-native <= 0.59: Run `react-native link react-native-device-info` in the project root.\n \u2022 Rebuild and re-run the app.\n \u2022 If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\n If none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-device-info/react-native-device-info"); + } + } + + var _default = RNDeviceInfo; + exports.default = _default; +},534,[28,535]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getPowerStateSync = exports.getPowerState = exports.getTotalMemory = exports.getUsedMemory = exports.getMaxMemory = exports.getFreeDiskStorageSync = exports.getFreeDiskStorage = exports.getTotalDiskCapacitySync = exports.getTotalDiskCapacity = exports.getBaseOs = exports.isAirplaneMode = exports.isLocationEnabled = exports.getBatteryLevelSync = exports.getBatteryLevel = exports.isCameraPresentSync = exports.isCameraPresent = exports.isBatteryChargingSync = exports.isBatteryCharging = exports.getUserAgent = exports.getInstallReferrer = exports.getUsedMemorySync = exports.getTotalMemorySync = exports.isLocationEnabledSync = exports.getUserAgentSync = exports.isAirplaneModeSync = exports.getInstallReferrerSync = exports.getMaxMemorySync = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var deviceInfoEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.RNDeviceInfo); + var batteryCharging = false, + batteryLevel = -1, + powerState = {}; + + var _readPowerState = function _readPowerState(battery) { + var level = battery.level, + charging = battery.charging, + chargingtime = battery.chargingtime, + dischargingtime = battery.dischargingtime; + return { + batteryLevel: level, + lowPowerMode: false, + batteryState: level === 1 ? 'full' : charging ? 'charging' : 'unplugged', + chargingtime: chargingtime, + dischargingtime: dischargingtime + }; + }; + + var getMaxMemorySync = function getMaxMemorySync() { + if (window.performance && window.performance.memory) { + return window.performance.memory.jsHeapSizeLimit; + } + + return -1; + }; + + exports.getMaxMemorySync = getMaxMemorySync; + + var getInstallReferrerSync = function getInstallReferrerSync() { + return document.referrer; + }; + + exports.getInstallReferrerSync = getInstallReferrerSync; + + var isAirplaneModeSync = function isAirplaneModeSync() { + return !!navigator.onLine; + }; + + exports.isAirplaneModeSync = isAirplaneModeSync; + + var getUserAgentSync = function getUserAgentSync() { + return window.navigator.userAgent; + }; + + exports.getUserAgentSync = getUserAgentSync; + + var isLocationEnabledSync = function isLocationEnabledSync() { + return !!navigator.geolocation; + }; + + exports.isLocationEnabledSync = isLocationEnabledSync; + + var getTotalMemorySync = function getTotalMemorySync() { + if (navigator.deviceMemory) { + return navigator.deviceMemory * 1000000000; + } + + return -1; + }; + + exports.getTotalMemorySync = getTotalMemorySync; + + var getUsedMemorySync = function getUsedMemorySync() { + if (window.performance && window.performance.memory) { + return window.performance.memory.usedJSHeapSize; + } + + return -1; + }; + + exports.getUsedMemorySync = getUsedMemorySync; + + var init = function _callee() { + var battery; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!(typeof navigator !== 'undefined' && navigator.getBattery)) { + _context.next = 7; + break; + } + + _context.next = 3; + return _regenerator.default.awrap(navigator.getBattery()); + + case 3: + battery = _context.sent; + batteryCharging = battery.charging; + battery.addEventListener('chargingchange', function () { + var charging = battery.charging; + batteryCharging = charging; + powerState = _readPowerState(battery); + deviceInfoEmitter.emit('RNDeviceInfo_powerStateDidChange', powerState); + }); + battery.addEventListener('levelchange', function () { + var level = battery.level; + batteryLevel = level; + powerState = _readPowerState(battery); + deviceInfoEmitter.emit('RNDeviceInfo_batteryLevelDidChange', level); + + if (level < 0.2) { + deviceInfoEmitter.emit('RNDeviceInfo_batteryLevelIsLow', level); + } + }); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + var getBaseOsSync = function getBaseOsSync() { + var userAgent = window.navigator.userAgent, + platform = window.navigator.platform, + macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'], + windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE'], + iosPlatforms = ['iPhone', 'iPad', 'iPod']; + var os = platform; + + if (macosPlatforms.indexOf(platform) !== -1) { + os = 'Mac OS'; + } else if (iosPlatforms.indexOf(platform) !== -1) { + os = 'iOS'; + } else if (windowsPlatforms.indexOf(platform) !== -1) { + os = 'Windows'; + } else if (/Android/.test(userAgent)) { + os = 'Android'; + } else if (!os && /Linux/.test(platform)) { + os = 'Linux'; + } + + return os; + }; + + init(); + + var getInstallReferrer = function _callee2() { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", getInstallReferrerSync()); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getInstallReferrer = getInstallReferrer; + + var getUserAgent = function _callee3() { + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", getUserAgentSync()); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getUserAgent = getUserAgent; + + var isBatteryCharging = function _callee4() { + var battery; + return _regenerator.default.async(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!navigator.getBattery) { + _context4.next = 5; + break; + } + + _context4.next = 3; + return _regenerator.default.awrap(navigator.getBattery()); + + case 3: + battery = _context4.sent; + return _context4.abrupt("return", battery.level); + + case 5: + return _context4.abrupt("return", false); + + case 6: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.isBatteryCharging = isBatteryCharging; + + var isBatteryChargingSync = function isBatteryChargingSync() { + return batteryCharging; + }; + + exports.isBatteryChargingSync = isBatteryChargingSync; + + var isCameraPresent = function _callee5() { + var devices; + return _regenerator.default.async(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + if (!navigator.getBattery) { + _context5.next = 5; + break; + } + + _context5.next = 3; + return _regenerator.default.awrap(navigator.mediaDevices.enumerateDevices()); + + case 3: + devices = _context5.sent; + return _context5.abrupt("return", !!devices.find(function (d) { + return d.kind === 'videoinput'; + })); + + case 5: + return _context5.abrupt("return", false); + + case 6: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.isCameraPresent = isCameraPresent; + + var isCameraPresentSync = function isCameraPresentSync() { + return false; + }; + + exports.isCameraPresentSync = isCameraPresentSync; + + var getBatteryLevel = function _callee6() { + var battery; + return _regenerator.default.async(function _callee6$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + if (!navigator.getBattery) { + _context6.next = 5; + break; + } + + _context6.next = 3; + return _regenerator.default.awrap(navigator.getBattery()); + + case 3: + battery = _context6.sent; + return _context6.abrupt("return", battery.level); + + case 5: + return _context6.abrupt("return", -1); + + case 6: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getBatteryLevel = getBatteryLevel; + + var getBatteryLevelSync = function getBatteryLevelSync() { + return batteryLevel; + }; + + exports.getBatteryLevelSync = getBatteryLevelSync; + + var isLocationEnabled = function _callee7() { + return _regenerator.default.async(function _callee7$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", isLocationEnabledSync()); + + case 1: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.isLocationEnabled = isLocationEnabled; + + var isAirplaneMode = function _callee8() { + return _regenerator.default.async(function _callee8$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + return _context8.abrupt("return", isAirplaneModeSync()); + + case 1: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.isAirplaneMode = isAirplaneMode; + + var getBaseOs = function _callee9() { + return _regenerator.default.async(function _callee9$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + return _context9.abrupt("return", getBaseOsSync()); + + case 1: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getBaseOs = getBaseOs; + + var getTotalDiskCapacity = function _callee10() { + var _await$navigator$stor, quota; + + return _regenerator.default.async(function _callee10$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + if (!(navigator.storage && navigator.storage.estimate)) { + _context10.next = 6; + break; + } + + _context10.next = 3; + return _regenerator.default.awrap(navigator.storage.estimate()); + + case 3: + _await$navigator$stor = _context10.sent; + quota = _await$navigator$stor.quota; + return _context10.abrupt("return", quota); + + case 6: + return _context10.abrupt("return", -1); + + case 7: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getTotalDiskCapacity = getTotalDiskCapacity; + + var getTotalDiskCapacitySync = function getTotalDiskCapacitySync() { + return -1; + }; + + exports.getTotalDiskCapacitySync = getTotalDiskCapacitySync; + + var getFreeDiskStorage = function _callee11() { + var _await$navigator$stor2, quota, usage; + + return _regenerator.default.async(function _callee11$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + if (!(navigator.storage && navigator.storage.estimate)) { + _context11.next = 7; + break; + } + + _context11.next = 3; + return _regenerator.default.awrap(navigator.storage.estimate()); + + case 3: + _await$navigator$stor2 = _context11.sent; + quota = _await$navigator$stor2.quota; + usage = _await$navigator$stor2.usage; + return _context11.abrupt("return", quota - usage); + + case 7: + return _context11.abrupt("return", -1); + + case 8: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getFreeDiskStorage = getFreeDiskStorage; + + var getFreeDiskStorageSync = function getFreeDiskStorageSync() { + return -1; + }; + + exports.getFreeDiskStorageSync = getFreeDiskStorageSync; + + var getMaxMemory = function _callee12() { + return _regenerator.default.async(function _callee12$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + return _context12.abrupt("return", getMaxMemorySync()); + + case 1: + case "end": + return _context12.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getMaxMemory = getMaxMemory; + + var getUsedMemory = function _callee13() { + return _regenerator.default.async(function _callee13$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + return _context13.abrupt("return", getUsedMemorySync()); + + case 1: + case "end": + return _context13.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getUsedMemory = getUsedMemory; + + var getTotalMemory = function _callee14() { + return _regenerator.default.async(function _callee14$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + return _context14.abrupt("return", getTotalMemorySync()); + + case 1: + case "end": + return _context14.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getTotalMemory = getTotalMemory; + + var getPowerState = function _callee15() { + var battery; + return _regenerator.default.async(function _callee15$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + if (!navigator.getBattery) { + _context15.next = 5; + break; + } + + _context15.next = 3; + return _regenerator.default.awrap(navigator.getBattery()); + + case 3: + battery = _context15.sent; + return _context15.abrupt("return", _readPowerState(battery)); + + case 5: + return _context15.abrupt("return", {}); + + case 6: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getPowerState = getPowerState; + + var getPowerStateSync = function getPowerStateSync() { + return powerState; + }; + + exports.getPowerStateSync = getPowerStateSync; +},535,[5,80,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.clearMemo = clearMemo; + exports.getSupportedPlatformInfoSync = getSupportedPlatformInfoSync; + exports.getSupportedPlatformInfoAsync = getSupportedPlatformInfoAsync; + exports.getSupportedPlatformInfoFunctions = getSupportedPlatformInfoFunctions; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var memo = {}; + + function clearMemo() { + memo = {}; + } + + function getSupportedFunction(supportedPlatforms, getter, defaultGetter) { + var supportedMap = {}; + supportedPlatforms.filter(function (key) { + return _reactNative.Platform.OS == key; + }).forEach(function (key) { + return supportedMap[key] = getter; + }); + return _reactNative.Platform.select((0, _extends2.default)({}, supportedMap, { + default: defaultGetter + })); + } + + function getSupportedPlatformInfoSync(_ref) { + var getter = _ref.getter, + supportedPlatforms = _ref.supportedPlatforms, + defaultValue = _ref.defaultValue, + memoKey = _ref.memoKey; + + if (memoKey && memo[memoKey] != undefined) { + return memo[memoKey]; + } else { + var output = getSupportedFunction(supportedPlatforms, getter, function () { + return defaultValue; + })(); + + if (memoKey) { + memo[memoKey] = output; + } + + return output; + } + } + + function getSupportedPlatformInfoAsync(_ref2) { + var getter, supportedPlatforms, defaultValue, memoKey, output; + return _regenerator.default.async(function getSupportedPlatformInfoAsync$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + getter = _ref2.getter, supportedPlatforms = _ref2.supportedPlatforms, defaultValue = _ref2.defaultValue, memoKey = _ref2.memoKey; + + if (!(memoKey && memo[memoKey] != undefined)) { + _context.next = 5; + break; + } + + return _context.abrupt("return", memo[memoKey]); + + case 5: + _context.next = 7; + return _regenerator.default.awrap(getSupportedFunction(supportedPlatforms, getter, function () { + return Promise.resolve(defaultValue); + })()); + + case 7: + output = _context.sent; + + if (memoKey) { + memo[memoKey] = output; + } + + return _context.abrupt("return", output); + + case 10: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + function getSupportedPlatformInfoFunctions(_ref3) { + var syncGetter = _ref3.syncGetter, + asyncParams = (0, _objectWithoutProperties2.default)(_ref3, ["syncGetter"]); + return [function () { + return getSupportedPlatformInfoAsync(asyncParams); + }, function () { + return getSupportedPlatformInfoSync((0, _extends2.default)({}, asyncParams, { + getter: syncGetter + })); + }]; + } +},536,[5,80,108,6,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useOnMount = useOnMount; + exports.useOnEvent = useOnEvent; + exports.deviceInfoEmitter = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[3]); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + function useOnMount(asyncGetter, initialResult) { + var _useState = (0, _react.useState)({ + loading: true, + result: initialResult + }), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + response = _useState2[0], + setResponse = _useState2[1]; + + (0, _react.useEffect)(function () { + var getAsync = function _callee() { + var result; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(asyncGetter()); + + case 2: + result = _context.sent; + setResponse({ + loading: false, + result: result + }); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + getAsync(); + }, [asyncGetter]); + return response; + } + + var deviceInfoEmitter = new _reactNative.NativeEventEmitter(_reactNative.NativeModules.RNDeviceInfo); + exports.deviceInfoEmitter = deviceInfoEmitter; + + function useOnEvent(eventName, initialValueAsyncGetter, defaultValue) { + var _useOnMount = useOnMount(initialValueAsyncGetter, defaultValue), + loading = _useOnMount.loading, + initialResult = _useOnMount.result; + + var _useState3 = (0, _react.useState)(defaultValue), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + result = _useState4[0], + setResult = _useState4[1]; + + (0, _react.useEffect)(function () { + setResult(initialResult); + }, [initialResult]); + (0, _react.useEffect)(function () { + var subscription = deviceInfoEmitter.addListener(eventName, setResult); + return function () { + return subscription.remove(); + }; + }, [eventName]); + return { + loading: loading, + result: result + }; + } +},537,[5,80,41,17,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNUUIDGenerator = _reactNative.NativeModules.RNUUIDGenerator; + var _default = { + getRandomUUID: function getRandomUUID(callback) { + if (callback) { + RNUUIDGenerator.getRandomUUID(callback); + } else { + return new Promise(function (resolve, reject) { + RNUUIDGenerator.getRandomUUID(resolve); + }); + } + } + }; + exports.default = _default; +},538,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "hideNavigationBar", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).hideNavigationBar; + } + }); + Object.defineProperty(exports, "showNavigationBar", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).showNavigationBar; + } + }); + exports.default = undefined; + exports.default = _$$_REQUIRE(_dependencyMap[0]).changeNavigationBarColor; +},539,[540]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.showNavigationBar = exports.hideNavigationBar = exports.changeNavigationBarColor = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var NavigationBarColor = _reactNative.NativeModules.NavigationBarColor; + + var changeNavigationBarColor = function _callee() { + var color, + light, + animated, + LightNav, + _args = arguments; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + color = _args.length > 0 && _args[0] !== undefined ? _args[0] : String; + light = _args.length > 1 && _args[1] !== undefined ? _args[1] : false; + animated = _args.length > 2 && _args[2] !== undefined ? _args[2] : true; + + if (!(_reactNative.Platform.OS === "android")) { + _context.next = 6; + break; + } + + LightNav = light ? true : false; + return _context.abrupt("return", NavigationBarColor.changeNavigationBarColor(color, LightNav, animated)); + + case 6: + return _context.abrupt("return", Promise.reject(new Error("unsupported platform"))); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.changeNavigationBarColor = changeNavigationBarColor; + + var hideNavigationBar = function _callee2() { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!(_reactNative.Platform.OS === "android")) { + _context2.next = 2; + break; + } + + return _context2.abrupt("return", NavigationBarColor.hideNavigationBar()); + + case 2: + return _context2.abrupt("return", Promise.reject(new Error("unsupported platform"))); + + case 3: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.hideNavigationBar = hideNavigationBar; + + var showNavigationBar = function _callee3() { + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!(_reactNative.Platform.OS === "android")) { + _context3.next = 2; + break; + } + + return _context3.abrupt("return", NavigationBarColor.showNavigationBar()); + + case 2: + return _context3.abrupt("return", Promise.reject(new Error("unsupported platform"))); + + case 3: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.showNavigationBar = showNavigationBar; +},540,[5,80,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.subscribe = exports.zipEntryToBase64 = exports.unzipAssets = exports.zipFiles = exports.zip = exports.zipWithPassword = exports.unzipWithPassword = exports.isPasswordProtected = exports.unzip = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var DeviceEventEmitter = _reactNative.default.DeviceEventEmitter, + NativeAppEventEmitter = _reactNative.default.NativeAppEventEmitter, + Platform = _reactNative.default.Platform, + NativeModules = _reactNative.default.NativeModules; + var RNZipArchive = NativeModules.RNZipArchive; + + var unzip = function unzip(source, target) { + var charset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "UTF-8"; + return RNZipArchive.unzip(source, target, charset); + }; + + exports.unzip = unzip; + + var isPasswordProtected = function isPasswordProtected(source) { + return RNZipArchive.isPasswordProtected(source).then(function (isEncrypted) { + return !!isEncrypted; + }); + }; + + exports.isPasswordProtected = isPasswordProtected; + + var unzipWithPassword = function unzipWithPassword(source, target, password) { + return RNZipArchive.unzipWithPassword(source, target, password); + }; + + exports.unzipWithPassword = unzipWithPassword; + + var zipWithPassword = function zipWithPassword(source, target, password) { + var encryptionMethod = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ""; + return RNZipArchive.zipWithPassword(source, target, password, encryptionMethod); + }; + + exports.zipWithPassword = zipWithPassword; + + var zip = function zip(source, target) { + return RNZipArchive.zip(source, target); + }; + + exports.zip = zip; + + var zipFiles = function zipFiles(files, target) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return RNZipArchive.zipFiles(files, target, options); + }; + + exports.zipFiles = zipFiles; + + var unzipAssets = function unzipAssets(source, target) { + if (!RNZipArchive.unzipAssets) { + throw new Error("unzipAssets not supported on this platform"); + } + + return RNZipArchive.unzipAssets(source, target); + }; + + exports.unzipAssets = unzipAssets; + + var zipEntryToBase64 = function _callee(archiveName, fileName) { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", RNZipArchive.zipEntryToBase64({ + archiveName: archiveName, + fileName: fileName + })); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.zipEntryToBase64 = zipEntryToBase64; + + var subscribe = function subscribe(callback) { + var emitter = NativeAppEventEmitter; + return emitter.addListener("zipArchiveProgressEvent", callback); + }; + + exports.subscribe = subscribe; +},541,[5,80,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _fileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _platformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _stringUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var FontUtils = function () { + function FontUtils() { + (0, _classCallCheck2.default)(this, FontUtils); + } + + (0, _createClass2.default)(FontUtils, null, [{ + key: "fontFormat", + value: function fontFormat(fileName) { + var format = ""; + var mime = ""; + var extension = fileName.split(".").pop(); + + switch (extension) { + case "otf": + format = "woff"; + mime = "application/x-font-woff"; + break; + + case "ttf": + default: + format = "truetype"; + mime = "font/truetype"; + break; + } + + return { + format: format, + mime: mime + }; + } + }, { + key: "getDefaultFonts", + value: function getDefaultFonts() { + if (_platformUtils.default.isIOS()) { + return FontUtils.defaultFonts.ios; + } + + return FontUtils.defaultFonts.android; + } + }, { + key: "fontMappingForApp", + value: function fontMappingForApp() { + var config, + type, + find, + splittedConfig, + font, + fontWeb, + fileName, + findDefault, + src, + _FontUtils$fontFormat, + format, + mime, + filePath, + fontBase64, + _args = arguments; + + return _regenerator.default.async(function fontMappingForApp$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + config = _args.length > 0 && _args[0] !== undefined ? _args[0] : ""; + type = _args.length > 1 && _args[1] !== undefined ? _args[1] : "regular"; + find = ""; + splittedConfig = null; + + if (typeof config === "string") { + splittedConfig = config.split(","); + find = splittedConfig.find(function (fontName) { + return ["DroidKufi-Regular", "DroidKufi-Bold", "Merriweather-Regular", "Merriweather-Light", "Merriweather-Bold", "OpenSans-Bold", "OpenSans-Light", "OpenSans-Regular"].includes(fontName); + }); + } + + font = ""; + fontWeb = find; + fileName = ""; + _context.t0 = find; + _context.next = _context.t0 === "DroidKufi-Regular" ? 11 : _context.t0 === "DroidKufi-Bold" ? 14 : _context.t0 === "Merriweather-Regular" ? 17 : _context.t0 === "Merriweather-Light" ? 20 : _context.t0 === "Merriweather-Bold" ? 23 : _context.t0 === "OpenSans-Bold" ? 26 : _context.t0 === "OpenSans-Light" ? 29 : _context.t0 === "OpenSans-Regular" ? 32 : 35; + break; + + case 11: + font = _reactNative.Platform.select({ + android: "DroidKufi-Regular", + ios: "DroidArabicKufi" + }); + fileName = "DroidKufi-Regular.ttf"; + return _context.abrupt("break", 38); + + case 14: + font = _reactNative.Platform.select({ + android: "DroidKufi-Bold", + ios: "DroidArabicKufi-Bold" + }); + fileName = "DroidKufi-Bold.ttf"; + return _context.abrupt("break", 38); + + case 17: + font = _reactNative.Platform.select({ + android: "Merriweather-Regular", + ios: "Merriweather" + }); + fileName = "Merriweather-Regular.otf"; + return _context.abrupt("break", 38); + + case 20: + font = _reactNative.Platform.select({ + android: "Merriweather-Light", + ios: "Merriweather" + }); + fileName = "Merriweather-Light.otf"; + return _context.abrupt("break", 38); + + case 23: + font = "Merriweather-Bold"; + fileName = "Merriweather-Bold.otf"; + return _context.abrupt("break", 38); + + case 26: + font = "OpenSans-Bold"; + fileName = "OpenSans-Bold.ttf"; + return _context.abrupt("break", 38); + + case 29: + font = _reactNative.Platform.select({ + android: "OpenSans-Light", + ios: "OpenSans" + }); + fileName = "OpenSans-Light.ttf"; + return _context.abrupt("break", 38); + + case 32: + font = _reactNative.Platform.select({ + android: "OpenSans-Regular", + ios: "OpenSans" + }); + fileName = "OpenSans-Regular.ttf"; + return _context.abrupt("break", 38); + + case 35: + findDefault = ""; + + if (splittedConfig) { + findDefault = splittedConfig.find(function (fontName) { + return FontUtils.getDefaultFonts().includes(fontName); + }); + } + + if (findDefault) { + font = findDefault; + fontWeb = findDefault; + } else { + if (type === "regular") { + font = "Nunito-Light"; + fileName = "Nunito-Light.ttf"; + } else if (type === "medium") { + font = "Nunito-Regular"; + fileName = "Nunito-Regular.ttf"; + } else { + font = "Nunito-Bold"; + fileName = "Nunito-Bold.ttf"; + } + + fontWeb = "Nunito"; + } + + case 38: + src = ""; + + if (!fileName) { + _context.next = 56; + break; + } + + if (!_platformUtils.default.isIOS()) { + _context.next = 55; + break; + } + + _FontUtils$fontFormat = FontUtils.fontFormat(fileName), format = _FontUtils$fontFormat.format, mime = _FontUtils$fontFormat.mime; + filePath = _fileUtils.default.assetPath(fileName); + fontBase64 = ""; + _context.prev = 44; + _context.next = 47; + return _regenerator.default.awrap(_fileUtils.default.readFileBase64(filePath)); + + case 47: + fontBase64 = _context.sent; + _context.next = 52; + break; + + case 50: + _context.prev = 50; + _context.t1 = _context["catch"](44); + + case 52: + src = "url(data:" + mime + ";charset=utf-8;base64," + fontBase64 + ") format('" + format + "')"; + _context.next = 56; + break; + + case 55: + src = "url('file:///android_asset/fonts/" + fileName + "')"; + + case 56: + return _context.abrupt("return", { + font: font, + fontWeb: fontWeb, + fileName: fileName, + src: src + }); + + case 57: + case "end": + return _context.stop(); + } + } + }, null, null, [[44, 50]], Promise); + } + }, { + key: "dynamicFontMappingForApp", + value: function dynamicFontMappingForApp(_ref) { + var name, + fontName, + family, + weight, + localPath, + type, + font, + fontWeb, + fileName, + filePath, + _FontUtils$fontFormat2, + format, + mime, + fontBase64, + src, + _args2 = arguments; + + return _regenerator.default.async(function dynamicFontMappingForApp$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + name = _ref.name, fontName = _ref.fontName, family = _ref.family, weight = _ref.weight, localPath = _ref.localPath; + type = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : "regular"; + font = ""; + fontWeb = ""; + fileName = ""; + filePath = ""; + + if (fontName) { + font = fontName; + fontWeb = name; + fileName = _fileUtils.default.getFilename(localPath); + filePath = localPath; + } else { + if (type === "regular") { + font = "Nunito-Light"; + fileName = "Nunito-Light.ttf"; + } else if (type === "medium") { + font = "Nunito-Regular"; + fileName = "Nunito-Regular.ttf"; + } else { + font = "Nunito-Bold"; + fileName = "Nunito-Bold.ttf"; + } + + fontWeb = "Nunito"; + filePath = _fileUtils.default.assetPath(fileName); + } + + _FontUtils$fontFormat2 = FontUtils.fontFormat(fileName), format = _FontUtils$fontFormat2.format, mime = _FontUtils$fontFormat2.mime; + fontBase64 = ""; + _context2.prev = 9; + _context2.next = 12; + return _regenerator.default.awrap(_fileUtils.default.readFileBase64(filePath)); + + case 12: + fontBase64 = _context2.sent; + _context2.next = 17; + break; + + case 15: + _context2.prev = 15; + _context2.t0 = _context2["catch"](9); + + case 17: + if (_platformUtils.default.isIOS()) { + src = "url(data:" + mime + ";charset=utf-8;base64," + fontBase64 + ") format('" + format + "')"; + } else { + src = "url(\"file://" + localPath + "\");"; + } + + return _context2.abrupt("return", { + font: font, + fontWeb: fontWeb, + fileName: fileName, + src: src, + fontFamily: family, + fontWeight: weight + }); + + case 19: + case "end": + return _context2.stop(); + } + } + }, null, null, [[9, 15]], Promise); + } + }, { + key: "getSystemFontScaleFactor", + value: function getSystemFontScaleFactor(allowFontScaling, fontScale) { + if (allowFontScaling) { + return Math.min(Math.max(fontScale, FontUtils.fontMinScale), FontUtils.fontMaxScale); + } + + return 1.0; + } + }, { + key: "getDynamicFonts", + value: function getDynamicFonts(fonts, fontsDirectory) { + var dynamicFonts, i, _fonts$i, name, path, family, weight, fileName, localPath, response, downloadPath, fontName; + + return _regenerator.default.async(function getDynamicFonts$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + dynamicFonts = []; + + if (!fonts) { + _context3.next = 37; + break; + } + + i = 0; + + case 3: + if (!(i < fonts.length)) { + _context3.next = 37; + break; + } + + _fonts$i = fonts[i], name = _fonts$i.name, path = _fonts$i.path, family = _fonts$i.family, weight = _fonts$i.weight; + + if (!(name && path)) { + _context3.next = 34; + break; + } + + fileName = _stringUtils.default.fileNameFromPath(path); + localPath = fontsDirectory + fileName; + _context3.next = 10; + return _regenerator.default.awrap(_fileUtils.default.exists(localPath)); + + case 10: + if (_context3.sent) { + _context3.next = 22; + break; + } + + _context3.prev = 11; + _context3.next = 14; + return _regenerator.default.awrap(_fileUtils.default.fetch(path)); + + case 14: + response = _context3.sent; + downloadPath = response.path(); + _context3.next = 18; + return _regenerator.default.awrap(_fileUtils.default.moveFile(downloadPath, localPath)); + + case 18: + _context3.next = 22; + break; + + case 20: + _context3.prev = 20; + _context3.t0 = _context3["catch"](11); + + case 22: + _context3.next = 24; + return _regenerator.default.awrap(_fileUtils.default.exists(localPath)); + + case 24: + if (!_context3.sent) { + _context3.next = 34; + break; + } + + _context3.prev = 25; + _context3.next = 28; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[10]).loadFontFromFile)(name, localPath)); + + case 28: + fontName = _context3.sent; + dynamicFonts.push({ + name: name, + fontName: fontName, + localPath: localPath, + family: family, + weight: weight + }); + _context3.next = 34; + break; + + case 32: + _context3.prev = 32; + _context3.t1 = _context3["catch"](25); + + case 34: + i++; + _context3.next = 3; + break; + + case 37: + return _context3.abrupt("return", dynamicFonts); + + case 38: + case "end": + return _context3.stop(); + } + } + }, null, null, [[11, 20], [25, 32]], Promise); + } + }, { + key: "mergeFontsJSONs", + value: function mergeFontsJSONs() { + var jsonA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var jsonB = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var aFontsRaw = jsonA.fonts, + aRegular = jsonA.regular, + aMedium = jsonA.medium, + aBold = jsonA.bold; + var bFontsRaw = jsonB.fonts, + bRegular = jsonB.regular, + bMedium = jsonB.medium, + bBold = jsonB.bold; + var mergeFonts = []; + + try { + mergeFonts = JSON.parse(aFontsRaw || "[]"); + } catch (e) {} + + var bFonts = []; + + try { + bFonts = JSON.parse(bFontsRaw || "[]"); + } catch (e) {} + + if (bFonts) { + var _mergeFonts; + + mergeFonts = mergeFonts.filter(function () { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + aName = _ref2.name; + + return aName && !bFonts.find(function () { + var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + bName = _ref3.name; + + return bName && bName === aName; + }); + }); + + (_mergeFonts = mergeFonts).push.apply(_mergeFonts, (0, _toConsumableArray2.default)(bFonts)); + } + + return { + regular: bRegular || aRegular, + medium: bMedium || aMedium, + bold: bBold || aBold, + fonts: JSON.stringify(mergeFonts) + }; + } + }]); + return FontUtils; + }(); + + exports.default = FontUtils; + FontUtils.fontMinScale = 0.7; + FontUtils.fontMaxScale = 1.3; + FontUtils.defaultFonts = { + ios: ["San Francisco", "Academy Engraved LET", "AcademyEngravedLetPlain", "Al Nile", "AlNile-Bold", "American Typewriter", "AmericanTypewriter-Bold", "AmericanTypewriter-Condensed", "AmericanTypewriter-CondensedBold", "AmericanTypewriter-CondensedLight", "AmericanTypewriter-Light", "Apple Color Emoji", "Apple SD Gothic Neo", "AppleColorEmoji", "AppleSDGothicNeo-Bold", "AppleSDGothicNeo-Light", "AppleSDGothicNeo-Medium", "AppleSDGothicNeo-Regular", "AppleSDGothicNeo-SemiBold", "AppleSDGothicNeo-Thin", "AppleSDGothicNeo-UltraLight", "Arial", "Arial Hebrew", "Arial Rounded MT Bold", "Arial-BoldItalicMT", "Arial-BoldMT", "Arial-ItalicMT", "ArialHebrew", "ArialHebrew-Bold", "ArialHebrew-Light", "ArialMT", "ArialRoundedMTBold", "Avenir", "Avenir Next", "Avenir Next Condensed", "Avenir-Black", "Avenir-BlackOblique", "Avenir-Book", "Avenir-BookOblique", "Avenir-Heavy", "Avenir-HeavyOblique", "Avenir-Light", "Avenir-LightOblique", "Avenir-Medium", "Avenir-MediumOblique", "Avenir-Oblique", "Avenir-Roman", "AvenirNext-Bold", "AvenirNext-BoldItalic", "AvenirNext-DemiBold", "AvenirNext-DemiBoldItalic", "AvenirNext-Heavy", "AvenirNext-HeavyItalic", "AvenirNext-Italic", "AvenirNext-Medium", "AvenirNext-MediumItalic", "AvenirNext-Regular", "AvenirNext-UltraLight", "AvenirNext-UltraLightItalic", "AvenirNextCondensed-Bold", "AvenirNextCondensed-BoldItalic", "AvenirNextCondensed-DemiBold", "AvenirNextCondensed-DemiBoldItalic", "AvenirNextCondensed-Heavy", "AvenirNextCondensed-HeavyItalic", "AvenirNextCondensed-Italic", "AvenirNextCondensed-Medium", "AvenirNextCondensed-MediumItalic", "AvenirNextCondensed-Regular", "AvenirNextCondensed-UltraLight", "AvenirNextCondensed-UltraLightItalic", "Bangla Sangam MN", "Baskerville", "Baskerville-Bold", "Baskerville-BoldItalic", "Baskerville-Italic", "Baskerville-SemiBold", "Baskerville-SemiBoldItalic", "Bodoni 72", "Bodoni 72 Oldstyle", "Bodoni 72 Smallcaps", "Bodoni Ornaments", "BodoniOrnamentsITCTT", "BodoniSvtyTwoITCTT-Bold", "BodoniSvtyTwoITCTT-Book", "BodoniSvtyTwoITCTT-BookIta", "BodoniSvtyTwoOSITCTT-Bold", "BodoniSvtyTwoOSITCTT-Book", "BodoniSvtyTwoSCITCTT-Book", "Bradley Hand", "BradleyHandITCTT-Bold", "Chalkboard SE", "ChalkboardSE-Bold", "ChalkboardSE-Light", "ChalkboardSE-Regular", "Chalkduster", "Chalkduster", "Cochin", "Cochin-Bold", "Cochin-BoldItalic", "Cochin-Italic", "Copperplate", "Copperplate-Bold", "Copperplate-Light", "Courier", "Courier New", "Courier-Bold", "Courier-BoldOblique", "Courier-Oblique", "CourierNewPS-BoldItalicMT", "CourierNewPS-BoldMT", "CourierNewPS-ItalicMT", "CourierNewPSMT", "Damascus", "DamascusBold", "DamascusLight", "DamascusMedium", "DamascusSemiBold", "Devanagari Sangam MN", "DevanagariSangamMN", "DevanagariSangamMN-Bold", "Didot", "Didot-Bold", "Didot-Italic", "DiwanMishafi", "Euphemia UCAS", "EuphemiaUCAS-Bold", "EuphemiaUCAS-Italic", "Farah", "Futura", "Futura-CondensedExtraBold", "Futura-CondensedMedium", "Futura-Medium", "Futura-MediumItalic", "Geeza Pro", "GeezaPro-Bold", "Georgia", "Georgia-Bold", "Georgia-BoldItalic", "Georgia-Italic", "Gill Sans", "GillSans-Bold", "GillSans-BoldItalic", "GillSans-Italic", "GillSans-Light", "GillSans-LightItalic", "GillSans-SemiBold", "GillSans-SemiBoldItalic", "GillSans-UltraBold", "Gujarati Sangam MN", "GujaratiSangamMN", "GujaratiSangamMN-Bold", "Gurmukhi MN", "GurmukhiMN-Bold", "Heiti SC", "Heiti TC", "Helvetica", "Helvetica Neue", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Light", "Helvetica-LightOblique", "Helvetica-Oblique", "HelveticaNeue-Bold", "HelveticaNeue-BoldItalic", "HelveticaNeue-CondensedBlack", "HelveticaNeue-CondensedBold", "HelveticaNeue-Italic", "HelveticaNeue-Light", "HelveticaNeue-LightItalic", "HelveticaNeue-Medium", "HelveticaNeue-MediumItalic", "HelveticaNeue-Thin", "HelveticaNeue-ThinItalic", "HelveticaNeue-UltraLight", "HelveticaNeue-UltraLightItalic", "Hiragino Mincho ProN", "Hiragino Sans", "HiraginoSans-W3", "HiraginoSans-W6", "HiraMinProN-W3", "HiraMinProN-W6", "Hoefler Text", "HoeflerText-Black", "HoeflerText-BlackItalic", "HoeflerText-Italic", "HoeflerText-Regular", "Iowan Old Style", "IowanOldStyle-Bold", "IowanOldStyle-BoldItalic", "IowanOldStyle-Italic", "IowanOldStyle-Roman", "Kailasa", "Kailasa-Bold", "Kannada Sangam MN", "KannadaSangamMN", "KannadaSangamMN-Bold", "Khmer Sangam MN", "Kohinoor Bangla", "Kohinoor Devanagari", "Kohinoor Telugu", "KohinoorBangla-Light", "KohinoorBangla-Regular", "KohinoorBangla-Semibold", "KohinoorDevanagari-Light", "KohinoorDevanagari-Regular", "KohinoorDevanagari-Semibold", "KohinoorTelugu-Light", "KohinoorTelugu-Medium", "KohinoorTelugu-Regular", "Lao Sangam MN", "Malayalam Sangam MN", "MalayalamSangamMN", "MalayalamSangamMN-Bold", "Marker Felt", "MarkerFelt-Thin", "MarkerFelt-Wide", "Menlo", "Menlo-Bold", "Menlo-BoldItalic", "Menlo-Italic", "Menlo-Regular", "Mishafi", "Noteworthy", "Noteworthy-Bold", "Noteworthy-Light", "Optima", "Optima-Bold", "Optima-BoldItalic", "Optima-ExtraBlack", "Optima-Italic", "Optima-Regular", "Oriya Sangam MN", "OriyaSangamMN", "OriyaSangamMN-Bold", "Palatino", "Palatino-Bold", "Palatino-BoldItalic", "Palatino-Italic", "Palatino-Roman", "Papyrus", "Papyrus-Condensed", "Party LET", "PartyLetPlain", "PingFang HK", "PingFang SC", "PingFang TC", "PingFangHK-Light", "PingFangHK-Medium", "PingFangHK-Regular", "PingFangHK-Semibold", "PingFangHK-Thin", "PingFangHK-Ultralight", "PingFangSC-Light", "PingFangSC-Medium", "PingFangSC-Regular", "PingFangSC-Semibold", "PingFangSC-Thin", "PingFangSC-Ultralight", "PingFangTC-Light", "PingFangTC-Medium", "PingFangTC-Regular", "PingFangTC-Semibold", "PingFangTC-Thin", "PingFangTC-Ultralight", "Savoye LET", "SavoyeLetPlain", "Sinhala Sangam MN", "SinhalaSangamMN", "SinhalaSangamMN-Bold", "Snell Roundhand", "SnellRoundhand-Black", "SnellRoundhand-Bold", "Symbol", "Tamil Sangam MN", "TamilSangamMN-Bold", "Telugu Sangam MN", "Thonburi", "Thonburi-Bold", "Thonburi-Light", "Times New Roman", "TimesNewRomanPS-BoldItalicMT", "TimesNewRomanPS-BoldMT", "TimesNewRomanPS-ItalicMT", "TimesNewRomanPSMT", "Trebuchet MS", "Trebuchet-BoldItalic", "TrebuchetMS-Bold", "TrebuchetMS-Italic", "Verdana", "Verdana-Bold", "Verdana-BoldItalic", "Verdana-Italic", "Zapf Dingbats", "ZapfDingbatsITC", "Zapfino"], + android: ["normal", "notoserif", "sans-serif", "sans-serif-light", "sans-serif-thin", "sans-serif-condensed", "sans-serif-medium", "serif", "Roboto", "monospace"] + }; +},542,[5,80,21,7,8,28,543,483,531,514,544]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.LOG_BASE_PATH = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _fileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _dateUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _platformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var LOG_BASE_PATH = _fileUtils.default.cacheDirectory + "/logs"; + exports.LOG_BASE_PATH = LOG_BASE_PATH; + + var Logger = function () { + function Logger() { + (0, _classCallCheck2.default)(this, Logger); + } + + (0, _createClass2.default)(Logger, null, [{ + key: "initFileName", + value: function initFileName(deviceModel) { + var date = new Date(); + var year = date.getUTCFullYear(); + var month = ("0" + (date.getUTCMonth() + 1)).slice(-2); + var day = ("0" + date.getUTCDate()).slice(-2); + var hours = ("0" + date.getUTCHours()).slice(-2); + var minutes = ("0" + date.getUTCMinutes()).slice(-2); + var seconds = ("0" + date.getUTCSeconds()).slice(-2); + var mills = ("00" + date.getUTCMilliseconds()).slice(-3); + var deviceName = deviceModel.replace(/ /g, "_").replace(/\./g, "_"); + Logger.logSessionFileName = "rn_" + year + month + day + "_" + hours + minutes + seconds + "_" + mills + "_" + deviceName + ".txt"; + } + }, { + key: "areLogsStored", + value: function areLogsStored() { + return _regenerator.default.async(function areLogsStored$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", new Promise(function (resolve) { + var intervalId = setInterval(function () { + if (!Logger.insertQueue || !Logger.insertQueue.length) { + clearInterval(intervalId); + intervalId = undefined; + resolve(); + } else {} + }, 1000); + })); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "deleteLogFile", + value: function deleteLogFile() { + return _regenerator.default.async(function deleteLogFile$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + Logger.initializedLogSession = false; + _context2.prev = 1; + _context2.next = 4; + return _regenerator.default.awrap(_fileUtils.default.unlink(LOG_BASE_PATH)); + + case 4: + _context2.next = 8; + break; + + case 6: + _context2.prev = 6; + _context2.t0 = _context2["catch"](1); + + case 8: + case "end": + return _context2.stop(); + } + } + }, null, null, [[1, 6]], Promise); + } + }, { + key: "createLogsFolderIfNotExist", + value: function createLogsFolderIfNotExist() { + return _regenerator.default.async(function createLogsFolderIfNotExist$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + _context3.next = 3; + return _regenerator.default.awrap(_fileUtils.default.mkdir(LOG_BASE_PATH)); + + case 3: + _context3.next = 7; + break; + + case 5: + _context3.prev = 5; + _context3.t0 = _context3["catch"](0); + + case 7: + case "end": + return _context3.stop(); + } + } + }, null, null, [[0, 5]], Promise); + } + }, { + key: "createNewSessionLog", + value: function createNewSessionLog() { + var deviceModel; + return _regenerator.default.async(function createNewSessionLog$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _context4.prev = 0; + + if (_platformUtils.default.model()) { + deviceModel = "" + _platformUtils.default.model().replace(/ /g, "_"); + } + + if (Logger.initializedLogSession) { + _context4.next = 8; + break; + } + + _context4.next = 5; + return _regenerator.default.awrap(Logger.deleteLogFile()); + + case 5: + _context4.next = 7; + return _regenerator.default.awrap(Logger.createLogsFolderIfNotExist()); + + case 7: + Logger.initFileName(deviceModel); + + case 8: + Logger.initializedLogSession = true; + _context4.next = 14; + break; + + case 11: + _context4.prev = 11; + _context4.t0 = _context4["catch"](0); + Logger.initializedLogSession = false; + + case 14: + return _context4.abrupt("return", Logger.initializedLogSession); + + case 15: + case "end": + return _context4.stop(); + } + } + }, null, null, [[0, 11]], Promise); + } + }, { + key: "appendLogToFile", + value: function appendLogToFile(message) { + return _regenerator.default.async(function appendLogToFile$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _context5.prev = 0; + _context5.next = 3; + return _regenerator.default.awrap(Logger.createNewSessionLog()); + + case 3: + if (!_context5.sent) { + _context5.next = 7; + break; + } + + if (Logger.insertTimeoutId) { + clearTimeout(Logger.insertTimeoutId); + Logger.insertTimeoutId = undefined; + } + + Logger.insertQueue.push(message); + Logger.insertTimeoutId = setTimeout(function () { + _fileUtils.default.appendFile(LOG_BASE_PATH + "/" + Logger.logSessionFileName, Logger.insertQueue.join("\n")); + + Logger.insertTimeoutId = undefined; + Logger.insertQueue = []; + }, Logger.BULK_TIMEOUT); + + case 7: + _context5.next = 11; + break; + + case 9: + _context5.prev = 9; + _context5.t0 = _context5["catch"](0); + + case 11: + case "end": + return _context5.stop(); + } + } + }, null, null, [[0, 9]], Promise); + } + }, { + key: "log", + value: function log(type, message) { + switch (type) { + case "D": + break; + + case "W": + console.warn(message); + break; + + case "E": + console.error(message); + break; + } + + Logger.appendLogToFile(_dateUtils.default.logTimestamp() + " " + message); + } + }, { + key: "argsToMessage", + value: function argsToMessage() { + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return args.reduce(function (result, arg) { + if (typeof arg === "string" || typeof arg === "number") { + return result + " " + arg; + } + + try { + return result + " " + JSON.stringify(arg); + } catch (e) { + return result; + } + }, ""); + } + }, { + key: "debug", + value: function debug() { + if (Logger.enableLog) { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (Logger.enableLogCaller) { + args.push(new Error().stack); + } + + Logger.log("D", Logger.argsToMessage(args)); + } + } + }, { + key: "warn", + value: function warn() { + if (Logger.enableLog) { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (Logger.enableLogCaller) { + args.push(new Error().stack); + } + + Logger.log("W", Logger.argsToMessage(args)); + } + } + }, { + key: "error", + value: function error() { + if (Logger.enableLog) { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + Logger.log("E", Logger.argsToMessage(args)); + } + } + }]); + return Logger; + }(); + + exports.default = Logger; + Logger.enableLog = false; + Logger.enableLogCaller = false; + Logger.initializedLogSession = false; + Logger.BULK_TIMEOUT = 5000; + Logger.insertQueue = []; +},543,[5,80,7,8,483,466,531]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _require = _$$_REQUIRE(_dependencyMap[0]), + NativeModules = _require.NativeModules; + + var DynamicFonts = NativeModules.DynamicFonts; + var loadedFonts = {}; + + function loadFont(name, data, type, forceLoad) { + if (!forceLoad && loadedFonts[name]) return Promise.resolve(loadedFonts[name]); + if (!name) throw new Error('Name is a required argument'); + if (!data) throw new Error('Data is a required argument'); + return new Promise(function (resolve, reject) { + DynamicFonts.loadFont({ + name: name, + data: data, + type: type + }, function (err, givenName) { + if (err) { + reject(err); + return; + } + + loadedFonts[name] = givenName; + resolve(givenName); + }); + }); + } + + function loadFontFromFile(name, filePath) { + if (!name) throw new Error('name is a required argument'); + if (!filePath) throw new Error('filePath is a required argument'); + return new Promise(function (resolve, reject) { + DynamicFonts.loadFontFromFile({ + name: name, + filePath: filePath + }, function (err, givenName) { + if (err) { + reject(err); + return; + } + + resolve(givenName); + }); + }); + } + + function loadFonts(_fontList, forceLoad) { + var fontList = _fontList; + if (!fontList) return Promise.resolve([]); + if (!(fontList instanceof Array)) fontList = [fontList]; + return Promise.all(fontList.filter(function (font) { + return font; + }).map(function (font) { + return loadFont(font.name, font.data, font.type, forceLoad); + })); + } + + module.exports = { + loadFont: loadFont, + loadFonts: loadFonts, + loadFontFromFile: loadFontFromFile + }; +},544,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNativeGeolocation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var Location = function () { + function Location() { + (0, _classCallCheck2.default)(this, Location); + } + + (0, _createClass2.default)(Location, null, [{ + key: "init", + value: function init() { + _reactNativeGeolocation.default.setRNConfiguration({ + skipPermissionRequests: false + }); + } + }]); + return Location; + }(); + + var LocationMgr = function LocationMgr() { + var _this = this; + + (0, _classCallCheck2.default)(this, LocationMgr); + + this.currentPosition = function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", new Promise(function (resolve, reject) { + _reactNativeGeolocation.default.getCurrentPosition(function (location) { + resolve(location); + }, function (error) { + reject(error); + }, { + timeout: 0, + enableHighAccuracy: false, + maximumAge: 1800000 + }); + })); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + this.watchPosition = function (onLocationChange) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + useSignificantChanges: true + }; + _this.watcherId = _reactNativeGeolocation.default.getCurrentPosition(function (location) { + if (onLocationChange) { + onLocationChange(location); + } + }, function (error) {}, config); + }; + + this.isWatching = function () { + return _this.watcherId !== -1; + }; + + this.unWatch = function () { + _reactNativeGeolocation.default.clearWatch(_this.watcherId); + }; + + this.stopAll = function () { + _reactNativeGeolocation.default.stopObserving(); + }; + + this.watcherId = -1; + Location.init(); + }; + + exports.default = LocationMgr; +},545,[5,80,7,8,546,543]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _implementation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + module.exports = _implementation.default; +},546,[5,547]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var subscriptions = []; + var updatesEnabled = false; + var Geolocation = { + setRNConfiguration: function setRNConfiguration(config) { + if (_$$_REQUIRE(_dependencyMap[2]).RNCGeolocation.setConfiguration) { + _$$_REQUIRE(_dependencyMap[2]).RNCGeolocation.setConfiguration(config); + } + }, + requestAuthorization: function requestAuthorization() { + _$$_REQUIRE(_dependencyMap[2]).RNCGeolocation.requestAuthorization(); + }, + getCurrentPosition: function getCurrentPosition(geoSuccess, geoError, geoOptions) { + return function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!(typeof geoSuccess !== "function")) { + _context.next = 2; + break; + } + + throw new Error("Must provide a valid geo_success callback."); + + case 2: + _$$_REQUIRE(_dependencyMap[2]).RNCGeolocation.getCurrentPosition(geoOptions || {}, geoSuccess, geoError || _$$_REQUIRE(_dependencyMap[3]).logError); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }(); + }, + watchPosition: function watchPosition(success, error, options) { + if (!updatesEnabled) { + _$$_REQUIRE(_dependencyMap[2]).RNCGeolocation.startObserving(options || {}); + + updatesEnabled = true; + } + + var watchID = subscriptions.length; + subscriptions.push([_$$_REQUIRE(_dependencyMap[2]).GeolocationEventEmitter.addListener("geolocationDidChange", success), error ? _$$_REQUIRE(_dependencyMap[2]).GeolocationEventEmitter.addListener("geolocationError", error) : null]); + return watchID; + }, + clearWatch: function clearWatch(watchID) { + var sub = subscriptions[watchID]; + + if (!sub) { + return; + } + + sub[0].remove(); + var sub1 = sub[1]; + + if (sub1) { + sub1.remove(); + } + + subscriptions[watchID] = undefined; + var noWatchers = true; + + for (var ii = 0; ii < subscriptions.length; ii++) { + if (subscriptions[ii]) { + noWatchers = false; + } + } + + if (noWatchers) { + Geolocation.stopObserving(); + } + }, + stopObserving: function stopObserving() { + if (updatesEnabled) { + _$$_REQUIRE(_dependencyMap[2]).RNCGeolocation.stopObserving(); + + updatesEnabled = false; + + for (var ii = 0; ii < subscriptions.length; ii++) { + var sub = subscriptions[ii]; + + if (sub) { + (0, _$$_REQUIRE(_dependencyMap[3]).warning)(false, "Called stopObserving with existing subscriptions."); + sub[0].remove(); + var sub1 = sub[1]; + + if (sub1) { + sub1.remove(); + } + } + } + + subscriptions = []; + } + } + }; + module.exports = Geolocation; +},547,[5,80,548,549]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNCGeolocation = _reactNative.NativeModules.RNCGeolocation; + + if (!RNCGeolocation) { + throw new Error("@react-native-community/geolocation: NativeModule.RNCGeolocation is null. To fix this issue try these steps:\n\u2022 Run `react-native link @react-native-community/geolocation` in the project root.\n\u2022 Rebuild and re-run the app.\n\u2022 If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\nIf none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-geolocation"); + } + + var nativeEventEmitter = null; + module.exports = { + RNCGeolocation: RNCGeolocation, + + get GeolocationEventEmitter() { + if (!nativeEventEmitter) { + nativeEventEmitter = new _reactNative.NativeEventEmitter(RNCGeolocation); + } + + return nativeEventEmitter; + } + + }; +},548,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var logError = function logError() { + if (arguments.length === 1 && (arguments.length <= 0 ? undefined : arguments[0]) instanceof Error) { + var err = arguments.length <= 0 ? undefined : arguments[0]; + console.error("Error: \"" + err.message + "\". Stack:\n" + err.stack); + } else { + var _console; + + (_console = console).error.apply(_console, arguments); + } + }; + + var warning = function () {}; + + module.exports = { + logError: logError, + warning: warning + }; +},549,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _jsUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var LongTimer = function () { + function LongTimer(mills, onFinish) { + (0, _classCallCheck2.default)(this, LongTimer); + this._id = _jsUtils.default.generateId(); + this._mills = mills; + this._onFinish = onFinish; + this._running = false; + this._currentTimerId = undefined; + this._currentPromiseResolve = undefined; + } + + (0, _createClass2.default)(LongTimer, [{ + key: "start", + value: function start() { + this._log("start"); + + if (this._running) { + this.stop(); + } + + this._execution(); + + return this; + } + }, { + key: "stop", + value: function stop() { + this._log("stop"); + + this._running = false; + + this._resetTimer(); + } + }, { + key: "_execution", + value: function _execution() { + var times, rest, i; + return _regenerator.default.async(function _execution$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + this._running = true; + times = this._mills / LongTimer._THRESHOLD; + rest = this._mills % LongTimer._THRESHOLD; + + this._log("execution " + this._mills + ", iteration " + times + ", rest " + rest); + + i = 0; + + case 6: + if (!(i < times && this._running)) { + _context.next = 12; + break; + } + + _context.next = 9; + return _regenerator.default.awrap(this._runTimeout(LongTimer._THRESHOLD, i)); + + case 9: + i++; + _context.next = 6; + break; + + case 12: + if (!(rest && this._running)) { + _context.next = 15; + break; + } + + _context.next = 15; + return _regenerator.default.awrap(this._runTimeout(rest, i)); + + case 15: + if (this._running && typeof this._onFinish === "function") { + this._onFinish(); + } + + this._log("finish"); + + _context.next = 22; + break; + + case 19: + _context.prev = 19; + _context.t0 = _context["catch"](0); + + this._log(_context.t0.message); + + case 22: + this._running = false; + + case 23: + case "end": + return _context.stop(); + } + } + }, null, this, [[0, 19]], Promise); + } + }, { + key: "_runTimeout", + value: function _runTimeout(duration, tick) { + var _this = this; + + return _regenerator.default.async(function _runTimeout$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", new Promise(function (resolve) { + _this._log("step " + tick + " start"); + + _this._resetTimer(); + + _this._currentPromiseResolve = resolve; + _this._currentTimerId = setTimeout(function () { + _this._log("step " + tick + " complete"); + + _this._currentPromiseResolve(); + + _this._currentTimerId = undefined; + _this._currentPromiseResolve = undefined; + }, duration); + })); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_resetTimer", + value: function _resetTimer() { + if (typeof this._currentPromiseResolve === "function") { + this._currentPromiseResolve(); + + this._currentPromiseResolve = undefined; + } + + if (this._currentTimerId) { + this._log("reset " + this._currentTimerId); + + clearTimeout(this._currentTimerId); + this._currentTimerId = undefined; + } + } + }, { + key: "_log", + value: function _log(message) {} + }]); + return LongTimer; + }(); + + exports.default = LongTimer; + LongTimer._THRESHOLD = 60000; +},550,[5,80,7,8,520]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.HTTPS_DOMAIN_SEPARATOR = exports.HTTP_DOMAIN_SEPARATOR = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _netinfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var HTTP_DOMAIN_SEPARATOR = "."; + exports.HTTP_DOMAIN_SEPARATOR = HTTP_DOMAIN_SEPARATOR; + var HTTPS_DOMAIN_SEPARATOR = "-"; + exports.HTTPS_DOMAIN_SEPARATOR = HTTPS_DOMAIN_SEPARATOR; + + var NetworkUtils = function () { + function NetworkUtils() { + (0, _classCallCheck2.default)(this, NetworkUtils); + } + + (0, _createClass2.default)(NetworkUtils, null, [{ + key: "addDefaultProtocol", + value: function addDefaultProtocol(url) { + var newUrl = url; + var result = NetworkUtils.DEFAULT_PROTOCOLS.find(function (protocol) { + return url.toLowerCase().startsWith(protocol); + }); + + if (!result) { + var protocol = NetworkUtils.isHTTPS ? "https" : "http"; + newUrl = protocol + ":"; + + if (!url.startsWith("//")) { + newUrl += "//"; + } + + newUrl += url; + } + + return newUrl; + } + }, { + key: "addConnectionChangeEventListener", + value: function addConnectionChangeEventListener(callback) { + if (callback) { + NetworkUtils.eventListener = _netinfo.default.addEventListener(function (state) { + NetworkUtils.connectionInfo = NetworkUtils.returnConnectionInfo(state); + callback(NetworkUtils.connectionInfo); + }); + } + } + }, { + key: "removeConnectionChangeEventListener", + value: function removeConnectionChangeEventListener() { + if (NetworkUtils.eventListener) { + NetworkUtils.eventListener(); + } + } + }, { + key: "returnConnectionInfo", + value: function returnConnectionInfo(state) { + var type = state.type, + details = state.details, + isInternetReachable = state.isInternetReachable; + var effectiveType = "unknown"; + + if (details && details.cellularGeneration) { + effectiveType = details.cellularGeneration; + } + + return { + type: type, + effectiveType: effectiveType, + isInternetReachable: isInternetReachable + }; + } + }, { + key: "getConnectionInfo", + value: function getConnectionInfo() { + var state; + return _regenerator.default.async(function getConnectionInfo$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(_netinfo.default.fetch()); + + case 3: + state = _context.sent; + NetworkUtils.connectionInfo = NetworkUtils.returnConnectionInfo(state); + return _context.abrupt("return", NetworkUtils.connectionInfo); + + case 8: + _context.prev = 8; + _context.t0 = _context["catch"](0); + + case 10: + return _context.abrupt("return", { + type: "unknown", + effectiveType: "unknown", + isInternetReachable: null + }); + + case 11: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + }, { + key: "isOnline", + value: function isOnline() { + if (NetworkUtils.connectionInfo) { + var _NetworkUtils$connect = NetworkUtils.connectionInfo, + type = _NetworkUtils$connect.type, + isInternetReachable = _NetworkUtils$connect.isInternetReachable; + return type !== "none" && type !== "unknown" && isInternetReachable !== false; + } + + return false; + } + }, { + key: "isInternetReachable", + value: function isInternetReachable() { + if (NetworkUtils.connectionInfo) { + return NetworkUtils.connectionInfo.isInternetReachable !== false; + } + + return false; + } + }, { + key: "isWiFi", + value: function isWiFi() { + if (NetworkUtils.connectionInfo) { + return NetworkUtils.connectionInfo.type === "wifi"; + } + + return false; + } + }, { + key: "isCellular", + value: function isCellular() { + if (NetworkUtils.connectionInfo) { + return NetworkUtils.connectionInfo.type === "cellular"; + } + + return false; + } + }, { + key: "isHighSpeedNetwork", + value: function isHighSpeedNetwork() { + return NetworkUtils.isWiFi() || NetworkUtils.is4G(); + } + }, { + key: "is2G", + value: function is2G() { + return NetworkUtils.isCellularOnBand("2g"); + } + }, { + key: "is3G", + value: function is3G() { + return NetworkUtils.isCellularOnBand("3g"); + } + }, { + key: "is4G", + value: function is4G() { + return NetworkUtils.isCellularOnBand("4g"); + } + }, { + key: "isCellularOnBand", + value: function isCellularOnBand(band) { + if (NetworkUtils.connectionInfo) { + return NetworkUtils.connectionInfo.type === "cellular" && NetworkUtils.connectionInfo.effectiveType === band; + } + + return false; + } + }, { + key: "getIP", + value: function getIP() { + return NetworkUtils.IP; + } + }, { + key: "setIP", + value: function setIP(ip) { + NetworkUtils.IP = ip; + } + }, { + key: "isTecnaviaIP", + value: function isTecnaviaIP() { + return NetworkUtils.IP.startsWith("82.220.5") || NetworkUtils.IP.startsWith("50.77.50.2") || NetworkUtils.IP === "18.159.47.195" || NetworkUtils.IP === "159.203.159.221"; + } + }]); + return NetworkUtils; + }(); + + exports.default = NetworkUtils; + NetworkUtils.DEFAULT_PROTOCOLS = ["http", "https"]; + NetworkUtils.isHTTPS = true; + NetworkUtils.connectionInfo = { + type: "unknown", + effectiveType: "unknown" + }; + NetworkUtils.IP = "n/a"; +},551,[5,80,7,8,552]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _exportNames = { + configure: true, + fetch: true, + addEventListener: true, + useNetInfo: true + }; + exports.configure = configure; + exports.fetch = fetch; + exports.addEventListener = addEventListener; + exports.useNetInfo = useNetInfo; + exports.default = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[3]); + + var _defaultConfiguration = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _state2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var Types = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + Object.keys(Types).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === Types[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return Types[key]; + } + }); + }); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _configuration = _defaultConfiguration.default; + var _state = null; + + var createState = function createState() { + return new _state2.default(_configuration); + }; + + function configure(configuration) { + _configuration = (0, _extends2.default)({}, _defaultConfiguration.default, configuration); + + if (_state) { + _state.tearDown(); + + _state = createState(); + } + } + + function fetch(requestedInterface) { + if (!_state) { + _state = createState(); + } + + return _state.latest(requestedInterface); + } + + function addEventListener(listener) { + if (!_state) { + _state = createState(); + } + + _state.add(listener); + + return function () { + _state && _state.remove(listener); + }; + } + + function useNetInfo(configuration) { + if (configuration) { + configure(configuration); + } + + var _useState = (0, _react.useState)({ + type: Types.NetInfoStateType.unknown, + isConnected: false, + isInternetReachable: false, + details: null + }), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + netInfo = _useState2[0], + setNetInfo = _useState2[1]; + + (0, _react.useEffect)(function () { + return addEventListener(setNetInfo); + }, []); + return netInfo; + } + + var _default = { + configure: configure, + fetch: fetch, + addEventListener: addEventListener, + useNetInfo: useNetInfo + }; + exports.default = _default; +},552,[5,41,6,17,553,554,559]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var _default = { + reachabilityUrl: 'https://clients3.google.com/generate_204', + reachabilityTest: function reachabilityTest(response) { + return Promise.resolve(response.status === 204); + }, + reachabilityShortTimeout: 5000, + reachabilityLongTimeout: 60000, + reachabilityRequestTimeout: 15000 + }; + exports.default = _default; +},553,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _nativeInterface = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _internetReachability = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var PrivateTypes = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var State = function State(configuration) { + var _this = this; + + (0, _classCallCheck2.default)(this, State); + this._nativeEventSubscription = null; + this._subscriptions = new Set(); + this._latestState = null; + + this._handleNativeStateUpdate = function (state) { + _this._internetReachability.update(state); + + var convertedState = _this._convertState(state); + + _this._latestState = convertedState; + + _this._subscriptions.forEach(function (handler) { + return handler(convertedState); + }); + }; + + this._handleInternetReachabilityUpdate = function (isInternetReachable) { + if (!_this._latestState) { + return; + } + + var nextState = (0, _extends2.default)({}, _this._latestState, { + isInternetReachable: isInternetReachable + }); + _this._latestState = nextState; + + _this._subscriptions.forEach(function (handler) { + return handler(nextState); + }); + }; + + this._fetchCurrentState = function _callee(requestedInterface) { + var state, convertedState; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(_nativeInterface.default.getCurrentState(requestedInterface)); + + case 2: + state = _context.sent; + + _this._internetReachability.update(state); + + convertedState = _this._convertState(state); + + if (!requestedInterface) { + _this._latestState = convertedState; + } + + return _context.abrupt("return", convertedState); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + this._convertState = function (input) { + if (typeof input.isInternetReachable === 'boolean') { + return input; + } else { + return (0, _extends2.default)({}, input, { + isInternetReachable: _this._internetReachability.currentState() + }); + } + }; + + this.latest = function (requestedInterface) { + if (requestedInterface) { + return _this._fetchCurrentState(requestedInterface); + } else if (_this._latestState) { + return Promise.resolve(_this._latestState); + } else { + return _this._fetchCurrentState(); + } + }; + + this.add = function (handler) { + _this._subscriptions.add(handler); + + if (_this._latestState) { + handler(_this._latestState); + } else { + _this.latest().then(handler); + } + }; + + this.remove = function (handler) { + _this._subscriptions.delete(handler); + }; + + this.tearDown = function () { + if (_this._internetReachability) { + _this._internetReachability.tearDown(); + } + + if (_this._nativeEventSubscription) { + _this._nativeEventSubscription.remove(); + } + + _this._subscriptions.clear(); + }; + + this._internetReachability = new _internetReachability.default(configuration, this._handleInternetReachabilityUpdate); + this._nativeEventSubscription = _nativeInterface.default.eventEmitter.addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, this._handleNativeStateUpdate); + + this._fetchCurrentState(); + }; + + exports.default = State; +},554,[5,80,6,7,555,557,558]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _nativeModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + if (!_nativeModule.default) { + throw new Error("@react-native-community/netinfo: NativeModule.RNCNetInfo is null. To fix this issue try these steps:\n\n\u2022 Run `react-native link @react-native-community/netinfo` in the project root.\n\u2022 Rebuild and re-run the app.\n\u2022 If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.\n\u2022 Check that the library was linked correctly when you used the link command by running through the manual installation instructions in the README.\n* If you are getting this error while unit testing you need to mock the native module. Follow the guide in the README.\n\nIf none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-community/react-native-netinfo"); + } + + var nativeEventEmitter = null; + + var _default = (0, _extends2.default)({}, _nativeModule.default, { + get eventEmitter() { + if (!nativeEventEmitter) { + nativeEventEmitter = new _reactNative.NativeEventEmitter(_nativeModule.default); + } + + return nativeEventEmitter; + } + + }); + + exports.default = _default; +},555,[5,6,28,556]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNCNetInfo = _reactNative.NativeModules.RNCNetInfo; + var _default = RNCNetInfo; + exports.default = _default; +},556,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var InternetReachability = function InternetReachability(configuration, listener) { + var _this = this; + + (0, _classCallCheck2.default)(this, InternetReachability); + this._isInternetReachable = undefined; + this._currentInternetReachabilityCheckHandler = null; + this._currentTimeoutHandle = null; + + this._setIsInternetReachable = function (isInternetReachable) { + if (_this._isInternetReachable === isInternetReachable) { + return; + } + + _this._isInternetReachable = isInternetReachable; + + _this._listener(_this._isInternetReachable); + }; + + this._setExpectsConnection = function (expectsConnection) { + if (_this._currentInternetReachabilityCheckHandler !== null) { + _this._currentInternetReachabilityCheckHandler.cancel(); + + _this._currentInternetReachabilityCheckHandler = null; + } + + if (_this._currentTimeoutHandle !== null) { + clearTimeout(_this._currentTimeoutHandle); + _this._currentTimeoutHandle = null; + } + + if (expectsConnection) { + if (!_this._isInternetReachable) { + _this._setIsInternetReachable(null); + } + + _this._currentInternetReachabilityCheckHandler = _this._checkInternetReachability(); + } else { + _this._setIsInternetReachable(false); + } + }; + + this._checkInternetReachability = function () { + var responsePromise = fetch(_this._configuration.reachabilityUrl, { + method: 'HEAD', + cache: 'no-cache' + }); + var timeoutHandle; + var timeoutPromise = new Promise(function (_, reject) { + timeoutHandle = setTimeout(function () { + return reject('timedout'); + }, _this._configuration.reachabilityRequestTimeout); + }); + + var cancel = function cancel() {}; + + var cancelPromise = new Promise(function (_, reject) { + cancel = function cancel() { + return reject('canceled'); + }; + }); + var promise = Promise.race([responsePromise, timeoutPromise, cancelPromise]).then(function (response) { + return _this._configuration.reachabilityTest(response); + }).then(function (result) { + _this._setIsInternetReachable(result); + + var nextTimeoutInterval = _this._isInternetReachable ? _this._configuration.reachabilityLongTimeout : _this._configuration.reachabilityShortTimeout; + _this._currentTimeoutHandle = setTimeout(_this._checkInternetReachability, nextTimeoutInterval); + }).catch(function (error) { + if (error !== 'canceled') { + _this._setIsInternetReachable(false); + + _this._currentTimeoutHandle = setTimeout(_this._checkInternetReachability, _this._configuration.reachabilityShortTimeout); + } + }).then(function () { + clearTimeout(timeoutHandle); + }, function (error) { + clearTimeout(timeoutHandle); + throw error; + }); + return { + promise: promise, + cancel: cancel + }; + }; + + this.update = function (state) { + if (typeof state.isInternetReachable === 'boolean') { + _this._setIsInternetReachable(state.isInternetReachable); + } else { + _this._setExpectsConnection(state.isConnected); + } + }; + + this.currentState = function () { + return _this._isInternetReachable; + }; + + this.tearDown = function () { + if (_this._currentInternetReachabilityCheckHandler !== null) { + _this._currentInternetReachabilityCheckHandler.cancel(); + + _this._currentInternetReachabilityCheckHandler = null; + } + + if (_this._currentTimeoutHandle !== null) { + clearTimeout(_this._currentTimeoutHandle); + _this._currentTimeoutHandle = null; + } + }; + + this._configuration = configuration; + this._listener = listener; + }; + + exports.default = InternetReachability; +},557,[5,7]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DEVICE_CONNECTIVITY_EVENT = undefined; + var DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'; + exports.DEVICE_CONNECTIVITY_EVENT = DEVICE_CONNECTIVITY_EVENT; +},558,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NetInfoCellularGeneration = exports.NetInfoStateType = undefined; + var NetInfoStateType; + exports.NetInfoStateType = NetInfoStateType; + + (function (NetInfoStateType) { + NetInfoStateType["unknown"] = "unknown"; + NetInfoStateType["none"] = "none"; + NetInfoStateType["cellular"] = "cellular"; + NetInfoStateType["wifi"] = "wifi"; + NetInfoStateType["bluetooth"] = "bluetooth"; + NetInfoStateType["ethernet"] = "ethernet"; + NetInfoStateType["wimax"] = "wimax"; + NetInfoStateType["vpn"] = "vpn"; + NetInfoStateType["other"] = "other"; + })(NetInfoStateType || (exports.NetInfoStateType = NetInfoStateType = {})); + + var NetInfoCellularGeneration; + exports.NetInfoCellularGeneration = NetInfoCellularGeneration; + + (function (NetInfoCellularGeneration) { + NetInfoCellularGeneration["2g"] = "2g"; + NetInfoCellularGeneration["3g"] = "3g"; + NetInfoCellularGeneration["4g"] = "4g"; + })(NetInfoCellularGeneration || (exports.NetInfoCellularGeneration = NetInfoCellularGeneration = {})); +},559,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _asyncStorage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _promiseQueue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNativeDefaultPreference = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var StorageUtils = function () { + function StorageUtils() { + (0, _classCallCheck2.default)(this, StorageUtils); + } + + (0, _createClass2.default)(StorageUtils, null, [{ + key: "setItemInDefaultPreferences", + value: function setItemInDefaultPreferences(name, key, value) { + return _regenerator.default.async(function setItemInDefaultPreferences$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", StorageUtils.queue.add(function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.setName(name)); + + case 3: + _context.next = 5; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.set(key, value)); + + case 5: + _context.next = 9; + break; + + case 7: + _context.prev = 7; + _context.t0 = _context["catch"](0); + + case 9: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 7]], Promise); + })); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getItemFromDefaultPreferences", + value: function getItemFromDefaultPreferences(name, key) { + return _regenerator.default.async(function getItemFromDefaultPreferences$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + return _context4.abrupt("return", StorageUtils.queue.add(function _callee2() { + var result; + return _regenerator.default.async(function _callee2$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + result = ""; + _context3.prev = 1; + + if (!key) { + _context3.next = 8; + break; + } + + _context3.next = 5; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.setName(name)); + + case 5: + _context3.next = 7; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.get(key)); + + case 7: + result = _context3.sent; + + case 8: + _context3.next = 12; + break; + + case 10: + _context3.prev = 10; + _context3.t0 = _context3["catch"](1); + + case 12: + return _context3.abrupt("return", result); + + case 13: + case "end": + return _context3.stop(); + } + } + }, null, null, [[1, 10]], Promise); + })); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "clearItemFromDefaultPreferences", + value: function clearItemFromDefaultPreferences(name, key) { + return _regenerator.default.async(function clearItemFromDefaultPreferences$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", StorageUtils.queue.add(function _callee3() { + return _regenerator.default.async(function _callee3$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _context5.prev = 0; + _context5.next = 3; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.setName(name)); + + case 3: + _context5.next = 5; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.clear(key)); + + case 5: + _context5.next = 9; + break; + + case 7: + _context5.prev = 7; + _context5.t0 = _context5["catch"](0); + + case 9: + case "end": + return _context5.stop(); + } + } + }, null, null, [[0, 7]], Promise); + })); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "clearAllFromDefaultPreferences", + value: function clearAllFromDefaultPreferences(name) { + return _regenerator.default.async(function clearAllFromDefaultPreferences$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + return _context8.abrupt("return", StorageUtils.queue.add(function _callee4() { + return _regenerator.default.async(function _callee4$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + _context7.prev = 0; + _context7.next = 3; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.setName(name)); + + case 3: + _context7.next = 5; + return _regenerator.default.awrap(_reactNativeDefaultPreference.default.clearAll()); + + case 5: + _context7.next = 9; + break; + + case 7: + _context7.prev = 7; + _context7.t0 = _context7["catch"](0); + + case 9: + case "end": + return _context7.stop(); + } + } + }, null, null, [[0, 7]], Promise); + })); + + case 1: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "appendNameToKey", + value: function appendNameToKey(name, key) { + return "@" + name + ":" + key; + } + }, { + key: "formatValue", + value: function formatValue(value) { + if (typeof value === "object" || Array.isArray(value)) { + return JSON.stringify(value); + } + + return "" + value; + } + }, { + key: "setItem", + value: function setItem(name, key, value) { + var namedKey; + return _regenerator.default.async(function setItem$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + _context9.prev = 0; + namedKey = StorageUtils.appendNameToKey(name, key); + _context9.next = 4; + return _regenerator.default.awrap(_asyncStorage.default.setItem(namedKey, StorageUtils.formatValue(value))); + + case 4: + _context9.next = 8; + break; + + case 6: + _context9.prev = 6; + _context9.t0 = _context9["catch"](0); + + case 8: + case "end": + return _context9.stop(); + } + } + }, null, null, [[0, 6]], Promise); + } + }, { + key: "multiSet", + value: function multiSet(name, data) { + var toSet; + return _regenerator.default.async(function multiSet$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.prev = 0; + toSet = Object.keys(data).map(function (key) { + var namedKey = StorageUtils.appendNameToKey(name, key); + return [namedKey, StorageUtils.formatValue(data[key])]; + }); + _context10.next = 4; + return _regenerator.default.awrap(_asyncStorage.default.multiSet(toSet)); + + case 4: + _context10.next = 8; + break; + + case 6: + _context10.prev = 6; + _context10.t0 = _context10["catch"](0); + + case 8: + case "end": + return _context10.stop(); + } + } + }, null, null, [[0, 6]], Promise); + } + }, { + key: "multiGet", + value: function multiGet(name, editCallback) { + var result, keys; + return _regenerator.default.async(function multiGet$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + result = {}; + _context11.prev = 1; + _context11.next = 4; + return _regenerator.default.awrap(_asyncStorage.default.getAllKeys()); + + case 4: + keys = _context11.sent.filter(function (key) { + return key.includes("@" + name + ":"); + }); + _context11.next = 7; + return _regenerator.default.awrap(_asyncStorage.default.multiGet(keys)); + + case 7: + result = _context11.sent.reduce(function (multiGet, item) { + multiGet[item[0].replace("@" + name + ":", "")] = editCallback ? editCallback(item[1]) : item[1]; + return multiGet; + }, {}); + _context11.next = 12; + break; + + case 10: + _context11.prev = 10; + _context11.t0 = _context11["catch"](1); + + case 12: + return _context11.abrupt("return", result); + + case 13: + case "end": + return _context11.stop(); + } + } + }, null, null, [[1, 10]], Promise); + } + }, { + key: "getItem", + value: function getItem(name, key) { + var result, namedKey; + return _regenerator.default.async(function getItem$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + result = ""; + _context12.prev = 1; + + if (!key) { + _context12.next = 7; + break; + } + + namedKey = StorageUtils.appendNameToKey(name, key); + _context12.next = 6; + return _regenerator.default.awrap(_asyncStorage.default.getItem(namedKey)); + + case 6: + result = _context12.sent; + + case 7: + _context12.next = 11; + break; + + case 9: + _context12.prev = 9; + _context12.t0 = _context12["catch"](1); + + case 11: + return _context12.abrupt("return", result); + + case 12: + case "end": + return _context12.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }, { + key: "clear", + value: function clear(name, key) { + return _regenerator.default.async(function clear$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + _context13.prev = 0; + _context13.next = 3; + return _regenerator.default.awrap(_asyncStorage.default.removeItem(StorageUtils.appendNameToKey(name, key))); + + case 3: + _context13.next = 7; + break; + + case 5: + _context13.prev = 5; + _context13.t0 = _context13["catch"](0); + + case 7: + case "end": + return _context13.stop(); + } + } + }, null, null, [[0, 5]], Promise); + } + }, { + key: "clearAll", + value: function clearAll(name) { + var keys; + return _regenerator.default.async(function clearAll$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + _context14.prev = 0; + _context14.next = 3; + return _regenerator.default.awrap(_asyncStorage.default.getAllKeys()); + + case 3: + keys = _context14.sent.filter(function (key) { + return key.includes("@" + name + ":"); + }); + _context14.next = 6; + return _regenerator.default.awrap(_asyncStorage.default.multiRemove(keys)); + + case 6: + _context14.next = 10; + break; + + case 8: + _context14.prev = 8; + _context14.t0 = _context14["catch"](0); + + case 10: + case "end": + return _context14.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + }, { + key: "clearAllByKeys", + value: function clearAllByKeys(name, keys) { + var namedkeys; + return _regenerator.default.async(function clearAllByKeys$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + _context15.prev = 0; + namedkeys = keys.map(function (key) { + return "@" + name + ":" + key; + }); + _context15.next = 4; + return _regenerator.default.awrap(_asyncStorage.default.multiRemove(namedkeys)); + + case 4: + _context15.next = 8; + break; + + case 6: + _context15.prev = 6; + _context15.t0 = _context15["catch"](0); + + case 8: + case "end": + return _context15.stop(); + } + } + }, null, null, [[0, 6]], Promise); + } + }, { + key: "clearAllByRegExp", + value: function clearAllByRegExp(name) { + var keys; + return _regenerator.default.async(function clearAllByRegExp$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + _context16.prev = 0; + _context16.next = 3; + return _regenerator.default.awrap(_asyncStorage.default.getAllKeys()); + + case 3: + keys = _context16.sent.filter(function (key) { + return !!key.match("@" + name + ":"); + }); + _context16.next = 6; + return _regenerator.default.awrap(_asyncStorage.default.multiRemove(keys)); + + case 6: + _context16.next = 10; + break; + + case 8: + _context16.prev = 8; + _context16.t0 = _context16["catch"](0); + + case 10: + case "end": + return _context16.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + }]); + return StorageUtils; + }(); + + exports.default = StorageUtils; + StorageUtils.queue = new _promiseQueue.default(1, Infinity); +},560,[5,80,7,8,561,567,570,543]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "useAsyncStorage", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).useAsyncStorage; + } + }); + exports.default = undefined; + + var _AsyncStorage = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _default = _AsyncStorage.default; + exports.default = _default; +},561,[562,5,563]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useAsyncStorage = useAsyncStorage; + + var _AsyncStorage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function useAsyncStorage(key) { + return { + getItem: function getItem() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _AsyncStorage.default.getItem.apply(_AsyncStorage.default, [key].concat(args)); + }, + setItem: function setItem() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return _AsyncStorage.default.setItem.apply(_AsyncStorage.default, [key].concat(args)); + }, + mergeItem: function mergeItem() { + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + return _AsyncStorage.default.mergeItem.apply(_AsyncStorage.default, [key].concat(args)); + }, + removeItem: function removeItem() { + for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { + args[_key4] = arguments[_key4]; + } + + return _AsyncStorage.default.removeItem.apply(_AsyncStorage.default, [key].concat(args)); + } + }; + } +},562,[5,563]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _RCTAsyncStorage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + if (!_RCTAsyncStorage.default) { + throw new Error("[@RNC/AsyncStorage]: NativeModule: AsyncStorage is null.\n\nTo fix this issue try these steps:\n\n \u2022 Rebuild and restart the app.\n\n \u2022 Run the packager with `--reset-cache` flag.\n\n \u2022 If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app.\n\n \u2022 If this happens while testing with Jest, check out docs how to integrate AsyncStorage with it: https://react-native-async-storage.github.io/async-storage/docs/advanced/jest\n\nIf none of these fix the issue, please open an issue on the Github repository: https://github.com/react-native-async-storage/async-storage/issues\n"); + } + + var AsyncStorage = function () { + var _getRequests = []; + var _getKeys = []; + var _immediate = null; + return { + getItem: function getItem(key, callback) { + return new Promise(function (resolve, reject) { + (0, _$$_REQUIRE(_dependencyMap[3]).checkValidInput)(key); + + _RCTAsyncStorage.default.multiGet([key], function (errors, result) { + var _result$; + + var value = result != null && (_result$ = result[0]) != null && _result$[1] ? result[0][1] : null; + var errs = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + callback == null ? undefined : callback(errs == null ? undefined : errs[0], value); + + if (errs) { + reject(errs[0]); + } else { + resolve(value); + } + }); + }); + }, + setItem: function setItem(key, value, callback) { + return new Promise(function (resolve, reject) { + (0, _$$_REQUIRE(_dependencyMap[3]).checkValidInput)(key, value); + + _RCTAsyncStorage.default.multiSet([[key, value]], function (errors) { + var errs = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + callback == null ? undefined : callback(errs == null ? undefined : errs[0]); + + if (errs) { + reject(errs[0]); + } else { + resolve(); + } + }); + }); + }, + removeItem: function removeItem(key, callback) { + return new Promise(function (resolve, reject) { + (0, _$$_REQUIRE(_dependencyMap[3]).checkValidInput)(key); + + _RCTAsyncStorage.default.multiRemove([key], function (errors) { + var errs = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + callback == null ? undefined : callback(errs == null ? undefined : errs[0]); + + if (errs) { + reject(errs[0]); + } else { + resolve(); + } + }); + }); + }, + mergeItem: function mergeItem(key, value, callback) { + return new Promise(function (resolve, reject) { + (0, _$$_REQUIRE(_dependencyMap[3]).checkValidInput)(key, value); + + _RCTAsyncStorage.default.multiMerge([[key, value]], function (errors) { + var errs = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + callback == null ? undefined : callback(errs == null ? undefined : errs[0]); + + if (errs) { + reject(errs[0]); + } else { + resolve(); + } + }); + }); + }, + clear: function clear(callback) { + return new Promise(function (resolve, reject) { + _RCTAsyncStorage.default.clear(function (error) { + var err = (0, _$$_REQUIRE(_dependencyMap[3]).convertError)(error); + callback == null ? undefined : callback(err); + + if (err) { + reject(err); + } else { + resolve(); + } + }); + }); + }, + getAllKeys: function getAllKeys(callback) { + return new Promise(function (resolve, reject) { + _RCTAsyncStorage.default.getAllKeys(function (error, keys) { + var err = (0, _$$_REQUIRE(_dependencyMap[3]).convertError)(error); + callback == null ? undefined : callback(err, keys); + + if (keys) { + resolve(keys); + } else { + reject(err); + } + }); + }); + }, + flushGetRequests: function flushGetRequests() { + var getRequests = _getRequests; + var getKeys = _getKeys; + _getRequests = []; + _getKeys = []; + + _RCTAsyncStorage.default.multiGet(getKeys, function (errors, result) { + var map = {}; + result == null ? undefined : result.forEach(function (_ref) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 2), + key = _ref2[0], + value = _ref2[1]; + + map[key] = value; + return value; + }); + var reqLength = getRequests.length; + var errorList = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + var error = errorList != null && errorList.length ? errorList[0] : null; + + for (var i = 0; i < reqLength; i++) { + var request = getRequests[i]; + + if (error) { + request.callback == null ? undefined : request.callback(errorList); + request.reject == null ? undefined : request.reject(error); + continue; + } + + var requestResult = request.keys.map(function (key) { + return [key, map[key]]; + }); + request.callback == null ? undefined : request.callback(null, requestResult); + request.resolve == null ? undefined : request.resolve(requestResult); + } + }); + }, + multiGet: function multiGet(keys, callback) { + if (!_immediate) { + _immediate = setImmediate(function () { + _immediate = null; + AsyncStorage.flushGetRequests(); + }); + } + + var getRequest = { + keys: keys, + callback: callback, + keyIndex: _getKeys.length, + resolve: null, + reject: null + }; + var promiseResult = new Promise(function (resolve, reject) { + getRequest.resolve = resolve; + getRequest.reject = reject; + }); + + _getRequests.push(getRequest); + + keys.forEach(function (key) { + if (_getKeys.indexOf(key) === -1) { + _getKeys.push(key); + } + }); + return promiseResult; + }, + multiSet: function multiSet(keyValuePairs, callback) { + (0, _$$_REQUIRE(_dependencyMap[3]).checkValidArgs)(keyValuePairs, callback); + return new Promise(function (resolve, reject) { + keyValuePairs.forEach(function (_ref3) { + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), + key = _ref4[0], + value = _ref4[1]; + + (0, _$$_REQUIRE(_dependencyMap[3]).checkValidInput)(key, value); + }); + + _RCTAsyncStorage.default.multiSet(keyValuePairs, function (errors) { + var error = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + callback == null ? undefined : callback(error); + + if (error) { + reject(error); + } else { + resolve(); + } + }); + }); + }, + multiRemove: function multiRemove(keys, callback) { + return new Promise(function (resolve, reject) { + keys.forEach(function (key) { + return (0, _$$_REQUIRE(_dependencyMap[3]).checkValidInput)(key); + }); + + _RCTAsyncStorage.default.multiRemove(keys, function (errors) { + var error = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + callback == null ? undefined : callback(error); + + if (error) { + reject(error); + } else { + resolve(); + } + }); + }); + }, + multiMerge: function multiMerge(keyValuePairs, callback) { + return new Promise(function (resolve, reject) { + _RCTAsyncStorage.default.multiMerge(keyValuePairs, function (errors) { + var error = (0, _$$_REQUIRE(_dependencyMap[3]).convertErrors)(errors); + callback == null ? undefined : callback(error); + + if (error) { + reject(error); + } else { + resolve(); + } + }); + }); + } + }; + }(); + + var _default = AsyncStorage; + exports.default = _default; +},563,[5,41,564,566]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RCTAsyncStorage = _reactNative.NativeModules['PlatformLocalStorage'] || _reactNative.NativeModules['RNC_AsyncSQLiteDBStorage'] || _reactNative.NativeModules['RNCAsyncStorage']; + + if (!RCTAsyncStorage && (0, _$$_REQUIRE(_dependencyMap[1]).shouldFallbackToLegacyNativeModule)()) { + if (_reactNative.TurboModuleRegistry) { + RCTAsyncStorage = _reactNative.TurboModuleRegistry.get('AsyncSQLiteDBStorage') || _reactNative.TurboModuleRegistry.get('AsyncLocalStorage'); + } else { + RCTAsyncStorage = _reactNative.NativeModules['AsyncSQLiteDBStorage'] || _reactNative.NativeModules['AsyncLocalStorage']; + } + } + + var _default = RCTAsyncStorage; + exports.default = _default; +},564,[28,565]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shouldFallbackToLegacyNativeModule = shouldFallbackToLegacyNativeModule; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + function shouldFallbackToLegacyNativeModule() { + var _NativeModules$Native, _NativeModules$Native2; + + var expoConstants = (_NativeModules$Native = _reactNative.NativeModules['NativeUnimoduleProxy']) == null ? undefined : (_NativeModules$Native2 = _NativeModules$Native.modulesConstants) == null ? undefined : _NativeModules$Native2.ExponentConstants; + + if (expoConstants) { + var isLegacySdkVersion = expoConstants.appOwnership && !expoConstants.executionEnvironment; + + if (isLegacySdkVersion || ['storeClient', 'standalone'].includes(expoConstants.executionEnvironment)) { + return true; + } + } + + return false; + } +},565,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.checkValidArgs = checkValidArgs; + exports.checkValidInput = checkValidInput; + exports.convertError = convertError; + exports.convertErrors = convertErrors; + + function checkValidArgs(keyValuePairs, callback) { + if (!Array.isArray(keyValuePairs) || keyValuePairs.length === 0 || !Array.isArray(keyValuePairs[0])) { + throw new Error('[AsyncStorage] Expected array of key-value pairs as first argument to multiSet'); + } + + if (callback && typeof callback !== 'function') { + if (Array.isArray(callback)) { + throw new Error('[AsyncStorage] Expected function as second argument to multiSet. Did you forget to wrap key-value pairs in an array for the first argument?'); + } + + throw new Error('[AsyncStorage] Expected function as second argument to multiSet'); + } + } + + function checkValidInput() { + for (var _len = arguments.length, input = new Array(_len), _key = 0; _key < _len; _key++) { + input[_key] = arguments[_key]; + } + + var key = input[0], + value = input[1]; + + if (typeof key !== 'string') { + console.warn("[AsyncStorage] Using " + typeof key + " type for key is not supported. This can lead to unexpected behavior/errors. Use string instead.\nKey passed: " + key + "\n"); + } + + if (input.length > 1 && typeof value !== 'string') { + if (value == null) { + throw new Error("[AsyncStorage] Passing null/undefined as value is not supported. If you want to remove value, Use .removeItem method instead.\nPassed value: " + value + "\nPassed key: " + key + "\n"); + } else { + console.warn("[AsyncStorage] The value for key \"" + key + "\" is not a string. This can lead to unexpected behavior/errors. Consider stringifying it.\nPassed value: " + value + "\nPassed key: " + key + "\n"); + } + } + } + + function convertError(error) { + if (!error) { + return null; + } + + var out = new Error(error.message); + out.key = error.key; + return out; + } + + function convertErrors(errs) { + var errors = ensureArray(errs); + return errors ? errors.map(function (e) { + return convertError(e); + }) : null; + } + + function ensureArray(e) { + if (Array.isArray(e)) { + return e.length === 0 ? null : e; + } else if (e) { + return [e]; + } else { + return null; + } + } +},566,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = process.env.PROMISE_QUEUE_COVERAGE ? _$$_REQUIRE(_dependencyMap[0]) : _$$_REQUIRE(_dependencyMap[1]); +},567,[568,569]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {},568,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (function (root, factory) { + 'use strict'; + + if (typeof module === 'object' && module.exports && typeof _$$_REQUIRE === 'function') { + module.exports = factory(); + } else if (typeof define === 'function' && typeof define.amd === 'object') { + define(factory); + } else { + root.Queue = factory(); + } + })(this, function () { + 'use strict'; + + var LocalPromise = typeof Promise !== 'undefined' ? Promise : function () { + return { + then: function then() { + throw new Error('Queue.configure() before use Queue'); + } + }; + }; + + var noop = function noop() {}; + + var resolveWith = function resolveWith(value) { + if (value && typeof value.then === 'function') { + return value; + } + + return new LocalPromise(function (resolve) { + resolve(value); + }); + }; + + function Queue(maxPendingPromises, maxQueuedPromises, options) { + this.options = options = options || {}; + this.pendingPromises = 0; + this.maxPendingPromises = typeof maxPendingPromises !== 'undefined' ? maxPendingPromises : Infinity; + this.maxQueuedPromises = typeof maxQueuedPromises !== 'undefined' ? maxQueuedPromises : Infinity; + this.queue = []; + } + + Queue.configure = function (GlobalPromise) { + LocalPromise = GlobalPromise; + }; + + Queue.prototype.add = function (promiseGenerator) { + var self = this; + return new LocalPromise(function (resolve, reject, notify) { + if (self.queue.length >= self.maxQueuedPromises) { + reject(new Error('Queue limit reached')); + return; + } + + self.queue.push({ + promiseGenerator: promiseGenerator, + resolve: resolve, + reject: reject, + notify: notify || noop + }); + + self._dequeue(); + }); + }; + + Queue.prototype.getPendingLength = function () { + return this.pendingPromises; + }; + + Queue.prototype.getQueueLength = function () { + return this.queue.length; + }; + + Queue.prototype._dequeue = function () { + var self = this; + + if (this.pendingPromises >= this.maxPendingPromises) { + return false; + } + + var item = this.queue.shift(); + + if (!item) { + if (this.options.onEmpty) { + this.options.onEmpty(); + } + + return false; + } + + try { + this.pendingPromises++; + resolveWith(item.promiseGenerator()).then(function (value) { + self.pendingPromises--; + item.resolve(value); + + self._dequeue(); + }, function (err) { + self.pendingPromises--; + item.reject(err); + + self._dequeue(); + }, function (message) { + item.notify(message); + }); + } catch (err) { + self.pendingPromises--; + item.reject(err); + + self._dequeue(); + } + + return true; + }; + + return Queue; + }); +},569,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _main = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = _main.default; + exports.default = _default; +},570,[5,571]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNDefaultPreference = _reactNative.NativeModules.RNDefaultPreference; + var _default = RNDefaultPreference; + exports.default = _default; +},571,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventRegister = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _typeDetect = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var EventRegister = function () { + function EventRegister() { + (0, _classCallCheck2.default)(this, EventRegister); + } + + (0, _createClass2.default)(EventRegister, null, [{ + key: "addEventListener", + value: function addEventListener(eventName, callback) { + if ((0, _typeDetect.default)(eventName) === "string" && (0, _typeDetect.default)(callback) === "function") { + EventRegister._Listeners.count += 1; + var eventId = "l" + EventRegister._Listeners.count; + EventRegister._Listeners.refs[eventId] = { + name: eventName, + callback: callback + }; + return eventId; + } + + return false; + } + }, { + key: "removeEventListener", + value: function removeEventListener(id) { + if ((0, _typeDetect.default)(id) === "string") { + EventRegister.log("EventsManager removing listener with id: " + id); + return delete EventRegister._Listeners.refs[id]; + } + + return false; + } + }, { + key: "removeAllListeners", + value: function removeAllListeners() { + var removeError = false; + EventRegister.log("EventsManager remove all listener"); + Object.keys(EventRegister._Listeners.refs).forEach(function (_id) { + var removed = delete EventRegister._Listeners.refs[_id]; + removeError = !removeError ? !removed : removeError; + }); + return !removeError; + } + }, { + key: "emitEvent", + value: function emitEvent(eventName, data) { + EventRegister.log("EventsManager trying to emit event: " + eventName); + Object.keys(EventRegister._Listeners.refs).forEach(function (_id) { + if (EventRegister._Listeners.refs[_id] && eventName === EventRegister._Listeners.refs[_id].name) { + EventRegister.log("EventsManager emit event: " + eventName + ", listener: " + _id + ", callback: " + (EventRegister._Listeners.refs[_id].callback.name || "anonymous")); + + EventRegister._Listeners.refs[_id].callback(data); + } + }); + } + }, { + key: "log", + value: function log(message) { + if (EventRegister.debug) {} + } + }, { + key: "on", + value: function on(eventName, callback) { + return EventRegister.addEventListener(eventName, callback); + } + }, { + key: "rm", + value: function rm(eventName) { + return EventRegister.removeEventListener(eventName); + } + }, { + key: "rmAll", + value: function rmAll() { + return EventRegister.removeAllListeners(); + } + }, { + key: "emit", + value: function emit(eventName, data) { + EventRegister.emitEvent(eventName, data); + } + }]); + return EventRegister; + }(); + + exports.EventRegister = EventRegister; + EventRegister.debug = false; + EventRegister._Listeners = { + count: 0, + refs: {} + }; +},572,[5,7,8,573]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : global.typeDetect = factory(); + })(this, function () { + 'use strict'; + + var promiseExists = typeof Promise === 'function'; + var globalObject = typeof self === 'object' ? self : global; + var symbolExists = typeof Symbol !== 'undefined'; + var mapExists = typeof Map !== 'undefined'; + var setExists = typeof Set !== 'undefined'; + var weakMapExists = typeof WeakMap !== 'undefined'; + var weakSetExists = typeof WeakSet !== 'undefined'; + var dataViewExists = typeof DataView !== 'undefined'; + var symbolIteratorExists = symbolExists && typeof Symbol.iterator !== 'undefined'; + var symbolToStringTagExists = symbolExists && typeof Symbol.toStringTag !== 'undefined'; + var setEntriesExists = setExists && typeof Set.prototype.entries === 'function'; + var mapEntriesExists = mapExists && typeof Map.prototype.entries === 'function'; + var setIteratorPrototype = setEntriesExists && Object.getPrototypeOf(new Set().entries()); + var mapIteratorPrototype = mapEntriesExists && Object.getPrototypeOf(new Map().entries()); + var arrayIteratorExists = symbolIteratorExists && typeof Array.prototype[Symbol.iterator] === 'function'; + var arrayIteratorPrototype = arrayIteratorExists && Object.getPrototypeOf([][Symbol.iterator]()); + var stringIteratorExists = symbolIteratorExists && typeof String.prototype[Symbol.iterator] === 'function'; + var stringIteratorPrototype = stringIteratorExists && Object.getPrototypeOf(''[Symbol.iterator]()); + var toStringLeftSliceLength = 8; + var toStringRightSliceLength = -1; + + function typeDetect(obj) { + var typeofObj = typeof obj; + + if (typeofObj !== 'object') { + return typeofObj; + } + + if (obj === null) { + return 'null'; + } + + if (obj === globalObject) { + return 'global'; + } + + if (Array.isArray(obj) && (symbolToStringTagExists === false || !(Symbol.toStringTag in obj))) { + return 'Array'; + } + + if (typeof window === 'object' && window !== null) { + if (typeof window.location === 'object' && obj === window.location) { + return 'Location'; + } + + if (typeof window.document === 'object' && obj === window.document) { + return 'Document'; + } + + if (typeof window.navigator === 'object') { + if (typeof window.navigator.mimeTypes === 'object' && obj === window.navigator.mimeTypes) { + return 'MimeTypeArray'; + } + + if (typeof window.navigator.plugins === 'object' && obj === window.navigator.plugins) { + return 'PluginArray'; + } + } + + if ((typeof window.HTMLElement === 'function' || typeof window.HTMLElement === 'object') && obj instanceof window.HTMLElement) { + if (obj.tagName === 'BLOCKQUOTE') { + return 'HTMLQuoteElement'; + } + + if (obj.tagName === 'TD') { + return 'HTMLTableDataCellElement'; + } + + if (obj.tagName === 'TH') { + return 'HTMLTableHeaderCellElement'; + } + } + } + + var stringTag = symbolToStringTagExists && obj[Symbol.toStringTag]; + + if (typeof stringTag === 'string') { + return stringTag; + } + + var objPrototype = Object.getPrototypeOf(obj); + + if (objPrototype === RegExp.prototype) { + return 'RegExp'; + } + + if (objPrototype === Date.prototype) { + return 'Date'; + } + + if (promiseExists && objPrototype === Promise.prototype) { + return 'Promise'; + } + + if (setExists && objPrototype === Set.prototype) { + return 'Set'; + } + + if (mapExists && objPrototype === Map.prototype) { + return 'Map'; + } + + if (weakSetExists && objPrototype === WeakSet.prototype) { + return 'WeakSet'; + } + + if (weakMapExists && objPrototype === WeakMap.prototype) { + return 'WeakMap'; + } + + if (dataViewExists && objPrototype === DataView.prototype) { + return 'DataView'; + } + + if (mapExists && objPrototype === mapIteratorPrototype) { + return 'Map Iterator'; + } + + if (setExists && objPrototype === setIteratorPrototype) { + return 'Set Iterator'; + } + + if (arrayIteratorExists && objPrototype === arrayIteratorPrototype) { + return 'Array Iterator'; + } + + if (stringIteratorExists && objPrototype === stringIteratorPrototype) { + return 'String Iterator'; + } + + if (objPrototype === null) { + return 'Object'; + } + + return Object.prototype.toString.call(obj).slice(toStringLeftSliceLength, toStringRightSliceLength); + } + + return typeDetect; + }); +},573,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.DEBUG_DIRECTORY = exports.DOWNLOADED_PDF_DIRECTORY = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _reactNativeShare = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MAIN_DIRECTORY = "newsmemvol"; + var APPLICATION_DIRECTORY = "application"; + var FONTS_DIRECTORY = "fonts"; + var BUNDLE_DIRECTORY = "bundles"; + var DOWNLOADED_PDF_DIRECTORY = "downloaded_pdf"; + exports.DOWNLOADED_PDF_DIRECTORY = DOWNLOADED_PDF_DIRECTORY; + var DEBUG_DIRECTORY = "debug_files"; + exports.DEBUG_DIRECTORY = DEBUG_DIRECTORY; + var IOS_XCODE_VERSION_FILENAME = "xcodeversion.txt"; + + var TecnaviaFileUtils = function (_FileUtils) { + (0, _inherits2.default)(TecnaviaFileUtils, _FileUtils); + + var _super = _createSuper(TecnaviaFileUtils); + + function TecnaviaFileUtils() { + (0, _classCallCheck2.default)(this, TecnaviaFileUtils); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(TecnaviaFileUtils, null, [{ + key: "getDownloadedPdfDirectory", + value: function getDownloadedPdfDirectory() { + return TecnaviaFileUtils.getCacheDirectory() + "/" + DOWNLOADED_PDF_DIRECTORY; + } + }, { + key: "getDebugDirectory", + value: function getDebugDirectory() { + return TecnaviaFileUtils.getCacheDirectory() + "/" + DEBUG_DIRECTORY + "/"; + } + }, { + key: "getNewsmemoryBaseDirectory", + value: function getNewsmemoryBaseDirectory() { + return (_$$_REQUIRE(_dependencyMap[10]).PlatformUtils.isIOS() ? TecnaviaFileUtils.cacheDirectory : TecnaviaFileUtils.documentDirectory) + "/"; + } + }, { + key: "getNewspaperBaseDirectory", + value: function getNewspaperBaseDirectory() { + return TecnaviaFileUtils.getNewsmemoryBaseDirectory() + MAIN_DIRECTORY + "/"; + } + }, { + key: "getApplicationBaseDirectory", + value: function getApplicationBaseDirectory() { + return TecnaviaFileUtils.getNewsmemoryBaseDirectory() + APPLICATION_DIRECTORY + "/"; + } + }, { + key: "getFontsDirectory", + value: function getFontsDirectory() { + return TecnaviaFileUtils.getNewsmemoryBaseDirectory() + FONTS_DIRECTORY + "/"; + } + }, { + key: "getBundlesDirectory", + value: function getBundlesDirectory() { + return TecnaviaFileUtils.getNewsmemoryBaseDirectory() + BUNDLE_DIRECTORY + "/"; + } + }, { + key: "getBundleAppVersionName", + value: function getBundleAppVersionName() { + return _deviceUtils.default.getAppVersion().replace(/\./g, "_"); + } + }, { + key: "getBundleDirectory", + value: function getBundleDirectory() { + return "" + TecnaviaFileUtils.getBundlesDirectory() + TecnaviaFileUtils.getBundleAppVersionName() + "/"; + } + }, { + key: "assetsCopy", + value: function assetsCopy(assetsFolderName, destination) { + return _regenerator.default.async(function assetsCopy$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _$$_REQUIRE(_dependencyMap[11]).OurBridge.assetsCopy(assetsFolderName, destination)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getXCodeVersionFilename", + value: function getXCodeVersionFilename() { + if (_$$_REQUIRE(_dependencyMap[10]).PlatformUtils.isIOS()) { + return TecnaviaFileUtils.getNewsmemoryBaseDirectory() + IOS_XCODE_VERSION_FILENAME; + } + + return ""; + } + }, { + key: "xCodeVersionFileExists", + value: function xCodeVersionFileExists() { + var xcodeVersionFile, fileExists; + return _regenerator.default.async(function xCodeVersionFileExists$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!_$$_REQUIRE(_dependencyMap[10]).PlatformUtils.isIOS()) { + _context2.next = 11; + break; + } + + xcodeVersionFile = TecnaviaFileUtils.getXCodeVersionFilename(); + _context2.prev = 2; + _context2.next = 5; + return _regenerator.default.awrap(TecnaviaFileUtils.exists(xcodeVersionFile)); + + case 5: + fileExists = _context2.sent; + return _context2.abrupt("return", fileExists); + + case 9: + _context2.prev = 9; + _context2.t0 = _context2["catch"](2); + + case 11: + return _context2.abrupt("return", false); + + case 12: + case "end": + return _context2.stop(); + } + } + }, null, null, [[2, 9]], Promise); + } + }, { + key: "clearOldVersionFiles", + value: function clearOldVersionFiles() { + var xcodeVersionFile; + return _regenerator.default.async(function clearOldVersionFiles$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!_$$_REQUIRE(_dependencyMap[10]).PlatformUtils.isIOS()) { + _context3.next = 9; + break; + } + + xcodeVersionFile = TecnaviaFileUtils.getXCodeVersionFilename(); + _context3.prev = 2; + _context3.next = 5; + return _regenerator.default.awrap(TecnaviaFileUtils.unlink(xcodeVersionFile)); + + case 5: + _context3.next = 9; + break; + + case 7: + _context3.prev = 7; + _context3.t0 = _context3["catch"](2); + + case 9: + case "end": + return _context3.stop(); + } + } + }, null, null, [[2, 7]], Promise); + } + }, { + key: "zipAndCopyNewspaperBaseDirectory", + value: function zipAndCopyNewspaperBaseDirectory() { + var isIOS, zipFile, options, _options; + + return _regenerator.default.async(function zipAndCopyNewspaperBaseDirectory$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + isIOS = _$$_REQUIRE(_dependencyMap[10]).PlatformUtils.isIOS(); + zipFile = (isIOS ? TecnaviaFileUtils.getNewsmemoryBaseDirectory() : TecnaviaFileUtils.getDebugDirectory()) + "newsmemvol.zip"; + _context4.prev = 2; + + if (isIOS) { + _context4.next = 18; + break; + } + + _context4.prev = 4; + _context4.next = 7; + return _regenerator.default.awrap(TecnaviaFileUtils.mkdir(TecnaviaFileUtils.getDebugDirectory())); + + case 7: + _context4.next = 11; + break; + + case 9: + _context4.prev = 9; + _context4.t0 = _context4["catch"](4); + + case 11: + _context4.prev = 11; + _context4.next = 14; + return _regenerator.default.awrap(TecnaviaFileUtils.unlink(zipFile)); + + case 14: + _context4.next = 18; + break; + + case 16: + _context4.prev = 16; + _context4.t1 = _context4["catch"](11); + + case 18: + _context4.next = 20; + return _regenerator.default.awrap(TecnaviaFileUtils.zip(TecnaviaFileUtils.getNewspaperBaseDirectory(), zipFile)); + + case 20: + _context4.next = 22; + return _regenerator.default.awrap(TecnaviaFileUtils.exists(zipFile)); + + case 22: + if (!_context4.sent) { + _context4.next = 36; + break; + } + + if (!isIOS) { + _context4.next = 33; + break; + } + + options = { + type: "application/zip", + url: zipFile, + saveToFiles: true + }; + _context4.next = 27; + return _regenerator.default.awrap(_reactNativeShare.default.open(options)); + + case 27: + _context4.next = 29; + return _regenerator.default.awrap(_reactNative.Linking.openURL("shareddocuments://")); + + case 29: + _context4.next = 31; + return _regenerator.default.awrap(TecnaviaFileUtils.unlink(zipFile)); + + case 31: + _context4.next = 36; + break; + + case 33: + _options = { + url: "file://" + zipFile + }; + _context4.next = 36; + return _regenerator.default.awrap(_reactNativeShare.default.open(_options)); + + case 36: + _context4.next = 40; + break; + + case 38: + _context4.prev = 38; + _context4.t2 = _context4["catch"](2); + + case 40: + case "end": + return _context4.stop(); + } + } + }, null, null, [[2, 38], [4, 9], [11, 16]], Promise); + } + }]); + return TecnaviaFileUtils; + }(_$$_REQUIRE(_dependencyMap[10]).FileUtils); + + exports.default = TecnaviaFileUtils; +},574,[5,80,7,8,12,14,16,28,575,458,462,582]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "Overlay", { + enumerable: true, + get: function get() { + return _Overlay.default; + } + }); + Object.defineProperty(exports, "Sheet", { + enumerable: true, + get: function get() { + return _Sheet.default; + } + }); + Object.defineProperty(exports, "Button", { + enumerable: true, + get: function get() { + return _Button.default; + } + }); + Object.defineProperty(exports, "ShareSheet", { + enumerable: true, + get: function get() { + return _ShareSheet.default; + } + }); + Object.defineProperty(exports, "Social", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).Social; + } + }); + Object.defineProperty(exports, "ShareAsset", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).ShareAsset; + } + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[1]); + + var _Overlay = _$$_REQUIRE(_dependencyMap[2])(_$$_REQUIRE(_dependencyMap[3])); + + var _Sheet = _$$_REQUIRE(_dependencyMap[2])(_$$_REQUIRE(_dependencyMap[4])); + + var _Button = _$$_REQUIRE(_dependencyMap[2])(_$$_REQUIRE(_dependencyMap[5])); + + var _ShareSheet = _$$_REQUIRE(_dependencyMap[2])(_$$_REQUIRE(_dependencyMap[6])); + + var _requireAndAskPermissions = _$$_REQUIRE(_dependencyMap[2])(_$$_REQUIRE(_dependencyMap[7])); + + var RNShare = { + Button: _Button.default, + ShareSheet: _ShareSheet.default, + Overlay: _Overlay.default, + Sheet: _Sheet.default, + Social: { + FACEBOOK: _reactNative.NativeModules.RNShare.FACEBOOK || _$$_REQUIRE(_dependencyMap[0]).Social.Facebook, + FACEBOOK_STORIES: _reactNative.NativeModules.RNShare.FACEBOOKSTORIES || _$$_REQUIRE(_dependencyMap[0]).Social.FacebookStories, + PAGESMANAGER: _reactNative.NativeModules.RNShare.PAGESMANAGER || _$$_REQUIRE(_dependencyMap[0]).Social.Pagesmanager, + TWITTER: _reactNative.NativeModules.RNShare.TWITTER || _$$_REQUIRE(_dependencyMap[0]).Social.Twitter, + WHATSAPP: _reactNative.NativeModules.RNShare.WHATSAPP || _$$_REQUIRE(_dependencyMap[0]).Social.Whatsapp, + WHATSAPPBUSINESS: _reactNative.NativeModules.RNShare.WHATSAPPBUSINESS || _$$_REQUIRE(_dependencyMap[0]).Social.Whatsappbusiness, + INSTAGRAM: _reactNative.NativeModules.RNShare.INSTAGRAM || _$$_REQUIRE(_dependencyMap[0]).Social.Instagram, + INSTAGRAM_STORIES: _reactNative.NativeModules.RNShare.INSTAGRAMSTORIES || _$$_REQUIRE(_dependencyMap[0]).Social.InstagramStories, + GOOGLEPLUS: _reactNative.NativeModules.RNShare.GOOGLEPLUS || _$$_REQUIRE(_dependencyMap[0]).Social.Googleplus, + EMAIL: _reactNative.NativeModules.RNShare.EMAIL || _$$_REQUIRE(_dependencyMap[0]).Social.Email, + PINTEREST: _reactNative.NativeModules.RNShare.PINTEREST || _$$_REQUIRE(_dependencyMap[0]).Social.Pinterest, + LINKEDIN: _reactNative.NativeModules.RNShare.LINKEDIN || _$$_REQUIRE(_dependencyMap[0]).Social.Linkedin, + SMS: _reactNative.NativeModules.RNShare.SMS || _$$_REQUIRE(_dependencyMap[0]).Social.Sms, + TELEGRAM: _reactNative.NativeModules.RNShare.TELEGRAM || _$$_REQUIRE(_dependencyMap[0]).Social.Telegram, + MESSENGER: _reactNative.NativeModules.RNShare.MESSENGER || _$$_REQUIRE(_dependencyMap[0]).Social.Messenger, + SNAPCHAT: _reactNative.NativeModules.RNShare.SNAPCHAT || _$$_REQUIRE(_dependencyMap[0]).Social.Snapchat, + VIBER: _reactNative.NativeModules.RNShare.VIBER || _$$_REQUIRE(_dependencyMap[0]).Social.Viber + }, + open: function open(options) { + return new Promise(function (resolve, reject) { + (0, _requireAndAskPermissions.default)(options).then(function () { + if (_reactNative.Platform.OS === 'ios' && options.url && !options.urls) { + var url = options.url; + delete options.url; + options.urls = [url]; + + if (options.filename && !options.filenames) { + options.filenames = [options.filename]; + delete options.filename; + } + } + + _reactNative.NativeModules.RNShare.open(options, function (error) { + return reject({ + error: error + }); + }, function (success, message) { + if (success) { + return resolve({ + success: success, + message: message + }); + } else if (options.failOnCancel === false) { + return resolve({ + dismissedAction: true, + success: success, + message: message + }); + } else { + reject(new Error('User did not share')); + } + }); + }).catch(function (e) { + return reject(e); + }); + }); + }, + shareSingle: function shareSingle(options) { + if (_reactNative.Platform.OS === 'ios' || _reactNative.Platform.OS === 'android') { + return new Promise(function (resolve, reject) { + (0, _requireAndAskPermissions.default)(options).then(function () { + if (options.url) { + options.urls = [options.url]; + } + + _reactNative.NativeModules.RNShare.shareSingle(options, function (error) { + return reject({ + error: error + }); + }, function (success, message) { + return resolve({ + success: Boolean(success), + message: message + }); + }); + }).catch(function (e) { + return reject(e); + }); + }); + } else { + throw new Error('Not implemented'); + } + }, + isPackageInstalled: function isPackageInstalled(packageName) { + if (_reactNative.Platform.OS === 'android') { + return new Promise(function (resolve, reject) { + _reactNative.NativeModules.RNShare.isPackageInstalled(packageName, function (error) { + return reject({ + error: error + }); + }, function (isInstalled) { + return resolve({ + isInstalled: isInstalled, + message: 'Package is Installed' + }); + }); + }); + } else { + throw new Error('Not implemented'); + } + } + }; + var _default = RNShare; + exports.default = _default; +},575,[576,28,5,577,578,579,580,581]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ShareAsset = exports.Social = undefined; + var Social; + exports.Social = Social; + + (function (Social) { + Social["Facebook"] = "facebook"; + Social["FacebookStories"] = "facebookstories"; + Social["Pagesmanager"] = "pagesmanager"; + Social["Twitter"] = "twitter"; + Social["Whatsapp"] = "whatsapp"; + Social["Whatsappbusiness"] = "whatsappbusiness"; + Social["Instagram"] = "instagram"; + Social["InstagramStories"] = "instagramstories"; + Social["Googleplus"] = "googleplus"; + Social["Email"] = "email"; + Social["Pinterest"] = "pinterest"; + Social["Linkedin"] = "linkedin"; + Social["Sms"] = "sms"; + Social["Telegram"] = "telegram"; + Social["Snapchat"] = "snapchat"; + Social["Messenger"] = "messenger"; + Social["Viber"] = "viber"; + })(Social || (exports.Social = Social = {})); + + var ShareAsset; + exports.ShareAsset = ShareAsset; + + (function (ShareAsset) { + ShareAsset["BackgroundImage"] = "shareBackgroundImage"; + ShareAsset["BackgroundVideo"] = "shareBackgroundVideo"; + ShareAsset["StickerImage"] = "shareStickerImage"; + ShareAsset["BackgroundAndStickerImage"] = "shareBackgroundAndStickerImage"; + })(ShareAsset || (exports.ShareAsset = ShareAsset = {})); +},576,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DEFAULT_ANIMATE_TIME = 300; + + var styles = _reactNative.StyleSheet.create({ + emptyOverlay: { + backgroundColor: 'transparent', + height: 0, + position: 'absolute', + width: 0 + }, + fullOverlay: { + backgroundColor: 'transparent', + bottom: 0, + left: 0, + position: 'absolute', + right: 0, + top: 0 + } + }); + + var Overlay = function (_React$Component) { + (0, _inherits2.default)(Overlay, _React$Component); + + var _super = _createSuper(Overlay); + + function Overlay() { + var _this; + + (0, _classCallCheck2.default)(this, Overlay); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + fadeAnim: new _reactNative.Animated.Value(0), + overlayStyle: styles.emptyOverlay + }; + return _this; + } + + (0, _createClass2.default)(Overlay, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + if (newProps.visible) { + this.setState({ + overlayStyle: styles.fullOverlay + }); + } + + return _reactNative.Animated.timing(this.state.fadeAnim, { + toValue: newProps.visible ? 1 : 0, + duration: DEFAULT_ANIMATE_TIME, + useNativeDriver: false + }).start(this.onAnimatedEnd.bind(this)); + } + }, { + key: "onAnimatedEnd", + value: function onAnimatedEnd() { + if (!this.props.visible) { + this.setState({ + overlayStyle: styles.emptyOverlay + }); + } + } + }, { + key: "render", + value: function render() { + return React.createElement(_reactNative.Animated.View, { + style: [this.state.overlayStyle, { + opacity: this.state.fadeAnim + }] + }, this.props.children); + } + }]); + return Overlay; + }(React.Component); + + var _default = Overlay; + exports.default = _default; +},577,[5,7,8,12,14,16,17,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DEFAULT_BOTTOM = -300; + var DEFAULT_ANIMATE_TIME = 300; + + var Sheet = function (_React$Component) { + (0, _inherits2.default)(Sheet, _React$Component); + + var _super = _createSuper(Sheet); + + function Sheet() { + var _this; + + (0, _classCallCheck2.default)(this, Sheet); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + bottom: new _reactNative.Animated.Value(DEFAULT_BOTTOM) + }; + return _this; + } + + (0, _createClass2.default)(Sheet, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + return _reactNative.Animated.timing(this.state.bottom, { + toValue: newProps.visible ? 0 : DEFAULT_BOTTOM, + duration: DEFAULT_ANIMATE_TIME, + useNativeDriver: false + }).start(); + } + }, { + key: "render", + value: function render() { + return React.createElement(_reactNative.Animated.View, { + style: { + bottom: this.state.bottom + } + }, this.props.children); + } + }]); + return Sheet; + }(React.Component); + + var _default = Sheet; + exports.default = _default; +},578,[5,7,8,12,14,16,17,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[1]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Button = function Button(_ref) { + var buttonStyle = _ref.buttonStyle, + onPress = _ref.onPress, + iconSrc = _ref.iconSrc, + textStyle = _ref.textStyle, + children = _ref.children; + return React.createElement(_reactNative.TouchableOpacity, { + activeOpacity: 0.5, + style: [styles.button, buttonStyle], + onPress: onPress + }, React.createElement(_reactNative.Image, { + style: styles.icon, + source: iconSrc + }), React.createElement(_reactNative.Text, { + style: [styles.buttonText, textStyle] + }, children)); + }; + + var _default = Button; + exports.default = _default; + + var styles = _reactNative.StyleSheet.create({ + button: { + backgroundColor: 'white', + flexDirection: 'row', + height: 50, + padding: 10 + }, + buttonText: { + color: '#2c2c2c', + fontSize: 16, + fontWeight: 'bold', + textAlign: 'left', + textAlignVertical: 'center' + }, + icon: { + height: 28, + marginLeft: 10, + marginRight: 30, + width: 28 + } + }); +},579,[17,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _Overlay = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Sheet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ShareSheet = function (_React$Component) { + (0, _inherits2.default)(ShareSheet, _React$Component); + + var _super = _createSuper(ShareSheet); + + function ShareSheet() { + (0, _classCallCheck2.default)(this, ShareSheet); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(ShareSheet, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.backButtonHandler = this.backButtonHandler.bind(this); + + _reactNative.BackHandler.addEventListener('hardwareBackPress', this.backButtonHandler); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _reactNative.BackHandler.removeEventListener('hardwareBackPress', this.backButtonHandler); + } + }, { + key: "backButtonHandler", + value: function backButtonHandler() { + if (this.props.visible) { + this.props.onCancel(); + return true; + } + + return false; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + _this$props$style = _this$props.style, + style = _this$props$style === undefined ? {} : _this$props$style, + _this$props$overlaySt = _this$props.overlayStyle, + overlayStyle = _this$props$overlaySt === undefined ? {} : _this$props$overlaySt, + props = (0, _objectWithoutProperties2.default)(_this$props, ["style", "overlayStyle"]); + return React.createElement(_Overlay.default, props, React.createElement(_reactNative.View, { + style: [styles.actionSheetContainer, overlayStyle] + }, React.createElement(_reactNative.TouchableOpacity, { + style: styles.button, + onPress: this.props.onCancel + }), React.createElement(_Sheet.default, { + visible: this.props.visible + }, React.createElement(_reactNative.View, { + style: [styles.buttonContainer, style] + }, this.props.children)))); + } + }]); + return ShareSheet; + }(React.Component); + + var _default = ShareSheet; + exports.default = _default; + + var styles = _reactNative.StyleSheet.create({ + actionSheetContainer: { + backgroundColor: 'rgba(0, 0, 0, 0.5)', + flex: 1, + justifyContent: 'flex-end', + paddingBottom: 0, + paddingTop: 10 + }, + buttonContainer: { + backgroundColor: 'white', + overflow: 'hidden', + paddingBottom: 5, + paddingTop: 5 + }, + button: { + flex: 1 + } + }); +},580,[5,108,7,8,12,14,16,17,28,577,578]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var ANDROID_KIT_KAT_SDK_VERSION = 19; + var androidPermissionRequestRequired = (typeof _reactNative.Platform.Version === 'string' ? parseInt(_reactNative.Platform.Version, 10) : _reactNative.Platform.Version) < ANDROID_KIT_KAT_SDK_VERSION; + + var requireAndAskPermissions = function _callee(options) { + var urls, resultArr, requirePermission, hasPermission, result; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!((options.url || options.urls) && _reactNative.Platform.OS === 'android')) { + _context.next = 26; + break; + } + + urls = options.urls || (options.url ? [options.url] : []); + _context.prev = 2; + _context.next = 5; + return _regenerator.default.awrap(Promise.all(urls.map(function (url) { + return new Promise(function (resolve, reject) { + _reactNative.NativeModules.RNShare.isBase64File(url, function (error) { + reject(error); + }, function (isBase64) { + resolve(isBase64); + }); + }); + }))); + + case 5: + resultArr = _context.sent; + requirePermission = resultArr.includes(true); + + if (requirePermission) { + _context.next = 9; + break; + } + + return _context.abrupt("return", Promise.resolve(true)); + + case 9: + _context.next = 11; + return _regenerator.default.awrap(_reactNative.PermissionsAndroid.check(_reactNative.PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE)); + + case 11: + hasPermission = _context.sent; + + if (!hasPermission) { + _context.next = 14; + break; + } + + return _context.abrupt("return", Promise.resolve(true)); + + case 14: + if (!androidPermissionRequestRequired) { + _context.next = 21; + break; + } + + _context.next = 17; + return _regenerator.default.awrap(_reactNative.PermissionsAndroid.request(_reactNative.PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE)); + + case 17: + result = _context.sent; + + if (!(result === _reactNative.PermissionsAndroid.RESULTS.GRANTED)) { + _context.next = 20; + break; + } + + return _context.abrupt("return", Promise.resolve(true)); + + case 20: + throw new Error('Write Permission not available'); + + case 21: + _context.next = 26; + break; + + case 23: + _context.prev = 23; + _context.t0 = _context["catch"](2); + return _context.abrupt("return", Promise.reject(_context.t0)); + + case 26: + return _context.abrupt("return", Promise.resolve(true)); + + case 27: + case "end": + return _context.stop(); + } + } + }, null, null, [[2, 23]], Promise); + }; + + var _default = requireAndAskPermissions; + exports.default = _default; +},581,[5,80,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "Notification", { + enumerable: true, + get: function get() { + return _Notifications.default; + } + }); + Object.defineProperty(exports, "OurBridge", { + enumerable: true, + get: function get() { + return _OurNativeBridge.default; + } + }); + Object.defineProperty(exports, "RNEventEmitter", { + enumerable: true, + get: function get() { + return _RNEventEmitter.default; + } + }); + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _Notifications = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _OurNativeBridge = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + var _RNEventEmitter = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); +},582,[28,5,583,584,585]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var ActivityStarter = _reactNative.NativeModules.ActivityStarter, + Notifications = _reactNative.NativeModules.Notifications; + + var Notification = function () { + function Notification() { + (0, _classCallCheck2.default)(this, Notification); + } + + (0, _createClass2.default)(Notification, null, [{ + key: "isAndroid", + value: function isAndroid() { + return _reactNative.Platform.OS === "android"; + } + }, { + key: "setBadge", + value: function setBadge(number) { + return _regenerator.default.async(function setBadge$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (Notification.isAndroid()) { + _context.next = 2; + break; + } + + return _context.abrupt("return", ActivityStarter.setBadge(number)); + + case 2: + return _context.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getBadge", + value: function getBadge() { + return _regenerator.default.async(function getBadge$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (Notification.isAndroid()) { + _context2.next = 2; + break; + } + + return _context2.abrupt("return", ActivityStarter.getBadge()); + + case 2: + return _context2.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "displayNotification", + value: function displayNotification(notification) { + var title, body, data, message_id, pushNotificationIOS; + return _regenerator.default.async(function displayNotification$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!Notification.isAndroid()) { + _context3.next = 2; + break; + } + + return _context3.abrupt("return", Notifications.displayNotification(notification)); + + case 2: + title = notification.title, body = notification.body, data = notification.data, message_id = notification.message_id; + + try { + pushNotificationIOS = undefined; + + if (pushNotificationIOS && pushNotificationIOS.default) { + pushNotificationIOS.default.addNotificationRequest({ + id: message_id || _$$_REQUIRE(_dependencyMap[5]).StringUtils.getRandomIdentifier(), + title: title, + body: body, + badge: 1, + userInfo: data + }); + } + } catch (e) { + console.warn(e.message); + } + + return _context3.abrupt("return", Promise.resolve()); + + case 5: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "createChannel", + value: function createChannel(channel) { + return _regenerator.default.async(function createChannel$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!Notification.isAndroid()) { + _context4.next = 2; + break; + } + + return _context4.abrupt("return", Notifications.createChannel(channel)); + + case 2: + return _context4.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "removeDeliveredNotification", + value: function removeDeliveredNotification(id) { + return _regenerator.default.async(function removeDeliveredNotification$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + if (!Notification.isAndroid()) { + _context5.next = 2; + break; + } + + return _context5.abrupt("return", Notifications.removeDeliveredNotification(id)); + + case 2: + return _context5.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return Notification; + }(); + + exports.default = Notification; +},583,[5,80,7,8,28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.DescendantFocusability = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var ActivityStarter = _reactNative.NativeModules.ActivityStarter; + var DescendantFocusability = { + block: "blockDescendants", + before: "beforeDescendants", + after: "afterDescendants" + }; + exports.DescendantFocusability = DescendantFocusability; + + var OurBridge = function () { + function OurBridge() { + (0, _classCallCheck2.default)(this, OurBridge); + } + + (0, _createClass2.default)(OurBridge, null, [{ + key: "setCustomNativeProps", + value: function setCustomNativeProps(ref) { + var customProps, + _args = arguments; + return _regenerator.default.async(function setCustomNativeProps$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + customProps = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + + if (!OurBridge.isAndroid()) { + _context.next = 9; + break; + } + + _context.prev = 2; + _context.next = 5; + return _regenerator.default.awrap(ActivityStarter.setCustomNativeProps((0, _extends2.default)({}, customProps, { + tag: _$$_REQUIRE(_dependencyMap[7]).JSUtils.getViewByRef(ref) + }))); + + case 5: + _context.next = 9; + break; + + case 7: + _context.prev = 7; + _context.t0 = _context["catch"](2); + + case 9: + case "end": + return _context.stop(); + } + } + }, null, null, [[2, 7]], Promise); + } + }, { + key: "setCustomOnTouch", + value: function setCustomOnTouch(ref) { + var params, + _args2 = arguments; + return _regenerator.default.async(function setCustomOnTouch$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + params = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {}; + + if (!OurBridge.isAndroid()) { + _context2.next = 9; + break; + } + + _context2.prev = 2; + _context2.next = 5; + return _regenerator.default.awrap(ActivityStarter.setCustomOnTouch((0, _extends2.default)({}, params, { + tag: _$$_REQUIRE(_dependencyMap[7]).JSUtils.getViewByRef(ref) + }))); + + case 5: + _context2.next = 9; + break; + + case 7: + _context2.prev = 7; + _context2.t0 = _context2["catch"](2); + + case 9: + case "end": + return _context2.stop(); + } + } + }, null, null, [[2, 7]], Promise); + } + }, { + key: "isAndroid", + value: function isAndroid() { + return _reactNative.Platform.OS === "android"; + } + }, { + key: "saveBundleName", + value: function saveBundleName(bundleName, bundleAppVersion) { + return _regenerator.default.async(function saveBundleName$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", ActivityStarter.saveBundleName(bundleName, bundleAppVersion)); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "resetBundleName", + value: function resetBundleName() { + return _regenerator.default.async(function resetBundleName$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + return _context4.abrupt("return", ActivityStarter.saveBundleName("", "")); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getBundleName", + value: function getBundleName() { + return _regenerator.default.async(function getBundleName$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", ActivityStarter.getBundleName()); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "restartReactContext", + value: function restartReactContext() { + return _regenerator.default.async(function restartReactContext$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", ActivityStarter.restartReactContext()); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "isActionModeVisible", + value: function isActionModeVisible() { + var _await$ActivityStarte, result; + + return _regenerator.default.async(function isActionModeVisible$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context7.next = 11; + break; + } + + _context7.prev = 1; + _context7.next = 4; + return _regenerator.default.awrap(ActivityStarter.isActionModeVisible()); + + case 4: + _await$ActivityStarte = _context7.sent; + result = _await$ActivityStarte.result; + return _context7.abrupt("return", result); + + case 9: + _context7.prev = 9; + _context7.t0 = _context7["catch"](1); + + case 11: + return _context7.abrupt("return", false); + + case 12: + case "end": + return _context7.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }, { + key: "initializeGlobals", + value: function initializeGlobals() { + if (OurBridge.isAndroid()) { + return ActivityStarter.initializeGlobals(); + } + + return Promise.resolve(); + } + }, { + key: "assetsCopy", + value: function assetsCopy(src, destination) { + return _regenerator.default.async(function assetsCopy$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context8.next = 2; + break; + } + + return _context8.abrupt("return", ActivityStarter.assetsCopy(src, destination)); + + case 2: + return _context8.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getBase64FromRes", + value: function getBase64FromRes(name) { + return _regenerator.default.async(function getBase64FromRes$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context9.next = 2; + break; + } + + return _context9.abrupt("return", ActivityStarter.getBase64FromRes(name)); + + case 2: + return _context9.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getStatusBarOrientation", + value: function getStatusBarOrientation() { + return _regenerator.default.async(function getStatusBarOrientation$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + if (OurBridge.isAndroid()) { + _context10.next = 2; + break; + } + + return _context10.abrupt("return", ActivityStarter.getStatusBarOrientation()); + + case 2: + return _context10.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "isOrientationLocked", + value: function isOrientationLocked() { + return _regenerator.default.async(function isOrientationLocked$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context11.next = 2; + break; + } + + return _context11.abrupt("return", ActivityStarter.isOrientationLocked()); + + case 2: + return _context11.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "dispatchTap", + value: function dispatchTap(tag, x, y) { + return _regenerator.default.async(function dispatchTap$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context12.next = 2; + break; + } + + return _context12.abrupt("return", ActivityStarter.dispatchTap(tag, x, y)); + + case 2: + return _context12.abrupt("return", Promise.resolve()); + + case 3: + case "end": + return _context12.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "onClose", + value: function onClose() { + return _regenerator.default.async(function onClose$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context13.next = 2; + break; + } + + return _context13.abrupt("return", ActivityStarter.onClose()); + + case 2: + return _context13.abrupt("return", Promise.resolve(false)); + + case 3: + case "end": + return _context13.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "onTrackAction", + value: function onTrackAction(data) { + return _regenerator.default.async(function onTrackAction$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context14.next = 2; + break; + } + + return _context14.abrupt("return", ActivityStarter.onTrackAction(data)); + + case 2: + return _context14.abrupt("return", Promise.resolve(false)); + + case 3: + case "end": + return _context14.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "willOpenURL", + value: function willOpenURL(url) { + return _regenerator.default.async(function willOpenURL$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + if (!OurBridge.isAndroid()) { + _context15.next = 2; + break; + } + + return _context15.abrupt("return", ActivityStarter.willOpenURL(url)); + + case 2: + return _context15.abrupt("return", Promise.resolve(false)); + + case 3: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return OurBridge; + }(); + + exports.default = OurBridge; + OurBridge.customPropTypes = { + descendantFocusability: _propTypes.default.oneOf([DescendantFocusability.block, DescendantFocusability.before, DescendantFocusability.after]), + focusableInTouchMode: _propTypes.default.bool, + focus: _propTypes.default.bool + }; + OurBridge.customDefaultProps = { + focusableInTouchMode: true, + focusable: true + }; +},584,[5,80,6,7,8,28,201,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var RNEventEmitter = function () { + function RNEventEmitter() { + (0, _classCallCheck2.default)(this, RNEventEmitter); + } + + (0, _createClass2.default)(RNEventEmitter, null, [{ + key: "isIOS", + value: function isIOS() { + return _reactNative.Platform.OS === "ios"; + } + }, { + key: "addListener", + value: function addListener(event, callback) { + var listener; + + if (RNEventEmitter.isIOS()) { + var BridgeEmitter = _reactNative.NativeModules.BridgeEmitter; + var eventEmitter = new _reactNative.NativeEventEmitter(BridgeEmitter); + listener = eventEmitter.addListener(event, function (params) { + if (callback) { + callback(params); + } + }); + } else { + listener = _reactNative.DeviceEventEmitter.addListener(event, function (params) { + if (callback) { + callback(params); + } + }); + } + + return listener; + } + }]); + return RNEventEmitter; + }(); + + exports.default = RNEventEmitter; + RNEventEmitter.NEW_INTENT = "onNewIntent"; + RNEventEmitter.ON_KEY_DOWN = "onKeyDown"; + RNEventEmitter.ON_KEY_UP = "onKeyUp"; +},585,[5,7,8,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.DownloadError = exports.MAX_PNG_GENERATION_ATTEMPTS = exports.MAX_DOWNLOAD_ATTEMPTS = exports.DOWNLOAD_WARNING_CODES = exports.DOWNLOAD_ERROR_CODES = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _wrapNativeSuper2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Api = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DOWNLOAD_ERROR_CODES = { + TIMEOUT: 0, + NO_GRANTS: 1, + INVALID_ZIP: 2, + NO_ZIP: 3, + GENERIC_ERROR: 4, + NO_GRANTS_ALLOWED_IP: 5, + SERVICE_ERROR: 6 + }; + exports.DOWNLOAD_ERROR_CODES = DOWNLOAD_ERROR_CODES; + var DOWNLOAD_WARNING_CODES = { + VALIDATION_WARNING: 1, + SUBSCRIPTION_WARNING: 2 + }; + exports.DOWNLOAD_WARNING_CODES = DOWNLOAD_WARNING_CODES; + var MAX_DOWNLOAD_ATTEMPTS = 3; + exports.MAX_DOWNLOAD_ATTEMPTS = MAX_DOWNLOAD_ATTEMPTS; + var MAX_PNG_GENERATION_ATTEMPTS = 2; + exports.MAX_PNG_GENERATION_ATTEMPTS = MAX_PNG_GENERATION_ATTEMPTS; + var SECRET_PDF_FILENAME = "secret.pdf"; + + var DownloadError = function (_Error) { + (0, _inherits2.default)(DownloadError, _Error); + + var _super = _createSuper(DownloadError); + + function DownloadError(code, message) { + var _this; + + (0, _classCallCheck2.default)(this, DownloadError); + _this = _super.call(this); + _this.code = code; + _this.message = message; + _this.params = {}; + return _this; + } + + (0, _createClass2.default)(DownloadError, [{ + key: "getCode", + value: function getCode() { + return this.code; + } + }, { + key: "getMessage", + value: function getMessage() { + return this.message; + } + }, { + key: "setParams", + value: function setParams(params) { + this.params = params; + } + }, { + key: "getParams", + value: function getParams() { + return this.params; + } + }]); + return DownloadError; + }((0, _wrapNativeSuper2.default)(Error)); + + exports.DownloadError = DownloadError; + + var DownloadUtils = function () { + function DownloadUtils() { + (0, _classCallCheck2.default)(this, DownloadUtils); + } + + (0, _createClass2.default)(DownloadUtils, null, [{ + key: "getDatabase", + value: function getDatabase(dbURL, dbDestinationFolder) { + var config, + filename, + i, + _args = arguments; + return _regenerator.default.async(function getDatabase$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + config = _args.length > 2 && _args[2] !== undefined ? _args[2] : {}; + filename = null; + i = 0; + + case 3: + if (!(i < MAX_DOWNLOAD_ATTEMPTS && !filename)) { + _context.next = 19; + break; + } + + _context.prev = 4; + _context.next = 7; + return _regenerator.default.awrap(DownloadUtils.getDBFromApiResponse(dbURL, dbDestinationFolder, config)); + + case 7: + filename = _context.sent; + _context.next = 16; + break; + + case 10: + _context.prev = 10; + _context.t0 = _context["catch"](4); + + if (!(_context.t0 instanceof DownloadError)) { + _context.next = 16; + break; + } + + throw _context.t0; + + case 16: + i++; + _context.next = 3; + break; + + case 19: + if (!filename) { + _context.next = 21; + break; + } + + return _context.abrupt("return", filename); + + case 21: + throw new Error("Failed to download db -> " + dbURL); + + case 22: + case "end": + return _context.stop(); + } + } + }, null, null, [[4, 10]], Promise); + } + }, { + key: "scanPageFolderForImages", + value: function scanPageFolderForImages(folder, filters) { + var enhancedImages, LOW, GRAPH, GIF, PDF, HR, images, _loop, x; + + return _regenerator.default.async(function scanPageFolderForImages$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + enhancedImages = []; + LOW = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.LOW, GRAPH = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.GRAPH, GIF = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.GIF, PDF = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.PDF, HR = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.HR; + _context3.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readDir(folder)); + + case 4: + images = _context3.sent; + + _loop = function _callee(x) { + var _images$x, path, name, _await$getImageSize, width, height; + + return _regenerator.default.async(function _callee$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _images$x = images[x], path = _images$x.path, name = _images$x.name; + + if (!(!filters || filters.length === 0 || filters.find(function (filter) { + return name.search(filter) > -1; + }))) { + _context2.next = 17; + break; + } + + if (!(name === LOW || name === GRAPH || name === GIF || name.search(HR) > -1)) { + _context2.next = 16; + break; + } + + _context2.next = 5; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[11]).getImageSize)("file://" + path)); + + case 5: + _await$getImageSize = _context2.sent; + width = _await$getImageSize.width; + height = _await$getImageSize.height; + + if (!(width > 0 && height > 0)) { + _context2.next = 12; + break; + } + + enhancedImages.push({ + path: path, + name: name, + width: width, + height: height + }); + _context2.next = 14; + break; + + case 12: + _context2.next = 14; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[12]).FileUtils.unlink(path)); + + case 14: + _context2.next = 17; + break; + + case 16: + if (name === PDF) { + enhancedImages.push({ + path: path, + name: name, + width: 100, + height: 100 + }); + } + + case 17: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }; + + x = 0; + + case 7: + if (!(x < images.length)) { + _context3.next = 13; + break; + } + + _context3.next = 10; + return _regenerator.default.awrap(_loop(x)); + + case 10: + x++; + _context3.next = 7; + break; + + case 13: + return _context3.abrupt("return", enhancedImages); + + case 14: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getEditionDatabaseAndPages", + value: function getEditionDatabaseAndPages(dbURL, zipDbFilename, destinationFolder) { + var config, + filenames, + responseHeaders, + retryCallback, + i, + files, + _await$DownloadUtils$, + _files, + db, + pages, + secret, + enhancedPages, + j, + _pages$j, + pageFolderPath, + pageName, + _LOW, + _GRAPH, + _GIF, + _PDF, + _enhancedImages, + TIMEOUT, + SERVICE_ERROR, + errorCode, + _args4 = arguments; + + return _regenerator.default.async(function getEditionDatabaseAndPages$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + config = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : {}; + filenames = {}; + responseHeaders = {}; + retryCallback = config.retryCallback; + i = 0; + + case 5: + if (!(i < MAX_DOWNLOAD_ATTEMPTS && !filenames.db)) { + _context4.next = 45; + break; + } + + _context4.prev = 6; + + if (i > 0) { + if (retryCallback && typeof retryCallback === "function") { + retryCallback(i + 1, MAX_DOWNLOAD_ATTEMPTS); + } + } + + files = undefined; + _context4.next = 11; + return _regenerator.default.awrap(DownloadUtils.getEditionDBAndPagesFromApiResponse(dbURL, zipDbFilename, destinationFolder, config)); + + case 11: + _await$DownloadUtils$ = _context4.sent; + files = _await$DownloadUtils$.files; + responseHeaders = _await$DownloadUtils$.responseHeaders; + _files = files, db = _files.db, pages = _files.pages, secret = _files.secret; + + if (!db) { + _context4.next = 31; + break; + } + + filenames.db = db; + filenames.secret = secret; + enhancedPages = []; + j = 0; + + case 20: + if (!(j < pages.length)) { + _context4.next = 30; + break; + } + + _pages$j = pages[j], pageFolderPath = _pages$j.path, pageName = _pages$j.name; + _LOW = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.LOW, _GRAPH = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.GRAPH, _GIF = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.GIF, _PDF = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.PDF; + _context4.next = 25; + return _regenerator.default.awrap(DownloadUtils.scanPageFolderForImages(pageFolderPath, [_LOW, _GRAPH, _GIF, _PDF])); + + case 25: + _enhancedImages = _context4.sent; + + if (_enhancedImages.length > 0) { + enhancedPages.push({ + path: pageFolderPath, + name: pageName, + images: _enhancedImages + }); + } + + case 27: + j++; + _context4.next = 20; + break; + + case 30: + if (enhancedPages.length > 0) { + filenames.pages = enhancedPages; + } + + case 31: + _context4.next = 42; + break; + + case 33: + _context4.prev = 33; + _context4.t0 = _context4["catch"](6); + + if (!(_context4.t0 instanceof DownloadError)) { + _context4.next = 42; + break; + } + + TIMEOUT = DOWNLOAD_ERROR_CODES.TIMEOUT, SERVICE_ERROR = DOWNLOAD_ERROR_CODES.SERVICE_ERROR; + errorCode = _context4.t0.getCode(); + + if (!(errorCode !== TIMEOUT && errorCode !== SERVICE_ERROR)) { + _context4.next = 40; + break; + } + + throw _context4.t0; + + case 40: + _context4.next = 42; + break; + + case 42: + i++; + _context4.next = 5; + break; + + case 45: + return _context4.abrupt("return", { + filenames: filenames, + responseHeaders: responseHeaders + }); + + case 46: + case "end": + return _context4.stop(); + } + } + }, null, null, [[6, 33]], Promise); + } + }, { + key: "downloadResource", + value: function downloadResource(resourceURL) { + var config, + response, + TIMEOUT, + NO_GRANTS, + INVALID_ZIP, + NO_ZIP, + GENERIC_ERROR, + SERVICE_ERROR, + PARTIAL_CONTENT, + INTERNAL_SERVER_ERROR, + BAD_GATEWAY, + SERVICE_UNAVAILABLE, + GATEWAY_TIMEOUT, + progressCallback, + completionCallback, + requestHeaders, + startTime, + kBitsDownloaded, + duration, + speed, + error, + _response, + respInfo, + path, + status, + headers, + message, + _error, + _message, + _error2, + errorCode, + _message2, + params, + invalid, + _error3, + resource, + _error4, + _args5 = arguments; + + return _regenerator.default.async(function downloadResource$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + config = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {}; + response = null; + TIMEOUT = DOWNLOAD_ERROR_CODES.TIMEOUT, NO_GRANTS = DOWNLOAD_ERROR_CODES.NO_GRANTS, INVALID_ZIP = DOWNLOAD_ERROR_CODES.INVALID_ZIP, NO_ZIP = DOWNLOAD_ERROR_CODES.NO_ZIP, GENERIC_ERROR = DOWNLOAD_ERROR_CODES.GENERIC_ERROR, SERVICE_ERROR = DOWNLOAD_ERROR_CODES.SERVICE_ERROR; + PARTIAL_CONTENT = _Api.HTTP_CODES.PARTIAL_CONTENT, INTERNAL_SERVER_ERROR = _Api.HTTP_CODES.INTERNAL_SERVER_ERROR, BAD_GATEWAY = _Api.HTTP_CODES.BAD_GATEWAY, SERVICE_UNAVAILABLE = _Api.HTTP_CODES.SERVICE_UNAVAILABLE, GATEWAY_TIMEOUT = _Api.HTTP_CODES.GATEWAY_TIMEOUT; + _context5.prev = 4; + progressCallback = config.progressCallback, completionCallback = config.completionCallback, requestHeaders = config.requestHeaders; + startTime = Date.now(); + kBitsDownloaded = 0; + _context5.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.fetch(resourceURL, { + timeout: _Api.default.timeout, + startCallBack: function startCallBack(contentLength) { + startTime = Date.now(); + + if (contentLength > 0) { + kBitsDownloaded = contentLength * 8 / 1024; + } + }, + progressCallback: progressCallback, + requestHeaders: requestHeaders + })); + + case 10: + response = _context5.sent; + + if (completionCallback) { + duration = (Date.now() - startTime) / 1000; + speed = kBitsDownloaded / duration; + completionCallback({ + speed: speed + }); + } + + _context5.next = 18; + break; + + case 14: + _context5.prev = 14; + _context5.t0 = _context5["catch"](4); + error = new DownloadError(TIMEOUT, _context5.t0.message); + throw error; + + case 18: + if (!response) { + _context5.next = 58; + break; + } + + _response = response, respInfo = _response.respInfo, path = _response.path; + status = respInfo.status, headers = respInfo.headers; + + if (!(status === INTERNAL_SERVER_ERROR)) { + _context5.next = 27; + break; + } + + message = "Internal server error"; + _error = new DownloadError(GENERIC_ERROR, message); + throw _error; + + case 27: + if (!(status === BAD_GATEWAY || status === SERVICE_UNAVAILABLE || status === GATEWAY_TIMEOUT)) { + _context5.next = 33; + break; + } + + _message = "Server service/gateway error"; + _error2 = new DownloadError(SERVICE_ERROR, _message); + throw _error2; + + case 33: + if (!(status === PARTIAL_CONTENT)) { + _context5.next = 54; + break; + } + + params = {}; + + if (headers && headers["Ta-Validation-Error"]) { + try { + params = JSON.parse(headers["Ta-Validation-Error"]); + } catch (e) {} + } + + invalid = parseInt(params.invalid || "1", 10); + _context5.t1 = invalid; + _context5.next = _context5.t1 === 2 ? 40 : _context5.t1 === 3 ? 43 : _context5.t1 === 1 ? 46 : 46; + break; + + case 40: + errorCode = INVALID_ZIP; + _message2 = "The zip is not valid"; + return _context5.abrupt("break", 49); + + case 43: + errorCode = NO_ZIP; + _message2 = "No zip present"; + return _context5.abrupt("break", 49); + + case 46: + errorCode = NO_GRANTS; + _message2 = "No grants"; + return _context5.abrupt("break", 49); + + case 49: + _error3 = new DownloadError(errorCode, _message2); + + _error3.setParams(params); + + throw _error3; + + case 54: + resource = path(); + return _context5.abrupt("return", { + responseHeaders: headers, + resource: resource + }); + + case 56: + _context5.next = 60; + break; + + case 58: + _error4 = "No response from download URL: " + resourceURL; + throw new Error(_error4); + + case 60: + case "end": + return _context5.stop(); + } + } + }, null, null, [[4, 14]], Promise); + } + }, { + key: "downloadResourceInFolder", + value: function downloadResourceInFolder(resourceURL, destinationFolder, filename) { + var config, + _await$DownloadUtils$2, + responseHeaders, + tmpFile, + filenameToUse, + destinationFile, + _args6 = arguments; + + return _regenerator.default.async(function downloadResourceInFolder$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + config = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : {}; + _context6.next = 3; + return _regenerator.default.awrap(DownloadUtils.downloadResource(resourceURL, config)); + + case 3: + _await$DownloadUtils$2 = _context6.sent; + responseHeaders = _await$DownloadUtils$2.responseHeaders; + tmpFile = _await$DownloadUtils$2.resource; + _context6.t0 = tmpFile; + + if (!_context6.t0) { + _context6.next = 11; + break; + } + + _context6.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(tmpFile)); + + case 10: + _context6.t0 = _context6.sent; + + case 11: + if (!_context6.t0) { + _context6.next = 33; + break; + } + + _context6.next = 14; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(destinationFolder)); + + case 14: + if (filename) { + if (filename === _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.PDF && responseHeaders["Content-Type"] === "image/gif") { + filenameToUse = _$$_REQUIRE(_dependencyMap[10]).EPaperImageName.GIF; + } else { + filenameToUse = filename; + } + } else { + filenameToUse = _tecnaviaFileUtils.default.getFilename(tmpFile); + } + + destinationFile = destinationFolder + filenameToUse; + _context6.prev = 16; + _context6.next = 19; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.moveFile(tmpFile, destinationFile)); + + case 19: + _context6.next = 32; + break; + + case 21: + _context6.prev = 21; + _context6.t1 = _context6["catch"](16); + _context6.prev = 23; + _context6.next = 26; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(destinationFile)); + + case 26: + _context6.next = 30; + break; + + case 28: + _context6.prev = 28; + _context6.t2 = _context6["catch"](23); + + case 30: + _context6.next = 32; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.moveFile(tmpFile, destinationFile)); + + case 32: + return _context6.abrupt("return", destinationFile); + + case 33: + throw new Error("Unable to download " + resourceURL + " and move to " + destinationFolder); + + case 34: + case "end": + return _context6.stop(); + } + } + }, null, null, [[16, 21], [23, 28]], Promise); + } + }, { + key: "downloadResourceAndUnzipInFolder", + value: function downloadResourceAndUnzipInFolder(resourceURL, destinationFolder) { + var config, + _await$DownloadUtils$3, + tmpFile, + responseHeaders, + files, + _args7 = arguments; + + return _regenerator.default.async(function downloadResourceAndUnzipInFolder$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + config = _args7.length > 2 && _args7[2] !== undefined ? _args7[2] : {}; + _context7.next = 3; + return _regenerator.default.awrap(DownloadUtils.downloadResource(resourceURL, config)); + + case 3: + _await$DownloadUtils$3 = _context7.sent; + tmpFile = _await$DownloadUtils$3.resource; + responseHeaders = _await$DownloadUtils$3.responseHeaders; + _context7.t0 = tmpFile; + + if (!_context7.t0) { + _context7.next = 11; + break; + } + + _context7.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(tmpFile)); + + case 10: + _context7.t0 = _context7.sent; + + case 11: + if (!_context7.t0) { + _context7.next = 26; + break; + } + + _context7.next = 14; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(destinationFolder)); + + case 14: + _context7.prev = 14; + _context7.next = 17; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unzip(tmpFile, destinationFolder)); + + case 17: + files = _context7.sent; + + _tecnaviaFileUtils.default.clearUnusedDownloadedFiles(tmpFile); + + return _context7.abrupt("return", { + files: files, + responseHeaders: responseHeaders + }); + + case 22: + _context7.prev = 22; + _context7.t1 = _context7["catch"](14); + + _tecnaviaFileUtils.default.clearUnusedDownloadedFiles(tmpFile); + + throw _context7.t1; + + case 26: + throw new Error("Unable to download " + resourceURL + " and move to " + destinationFolder); + + case 27: + case "end": + return _context7.stop(); + } + } + }, null, null, [[14, 22]], Promise); + } + }, { + key: "getEditionDBAndPagesFromApiResponse", + value: function getEditionDBAndPagesFromApiResponse(dbURL, zipDbFilename, destinationFolder) { + var config, + filenames, + unzippedFiles, + responseHeaders, + _await$DownloadUtils$4, + zipDb, + db, + i, + filename, + files, + _i, + _files$_i, + path, + name, + isDirectory, + callbackAfterUnzip, + _args9 = arguments; + + return _regenerator.default.async(function getEditionDBAndPagesFromApiResponse$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + config = _args9.length > 3 && _args9[3] !== undefined ? _args9[3] : {}; + filenames = {}; + responseHeaders = {}; + _context9.prev = 3; + _context9.next = 6; + return _regenerator.default.awrap(DownloadUtils.downloadResourceAndUnzipInFolder(dbURL, destinationFolder, config)); + + case 6: + _await$DownloadUtils$4 = _context9.sent; + unzippedFiles = _await$DownloadUtils$4.files; + responseHeaders = _await$DownloadUtils$4.responseHeaders; + _context9.prev = 9; + zipDb = destinationFolder + zipDbFilename; + db = destinationFolder + DownloadUtils.getDatabaseName(zipDb); + _context9.next = 14; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(zipDb)); + + case 14: + if (!_context9.sent) { + _context9.next = 25; + break; + } + + _context9.prev = 15; + _context9.next = 18; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unzip(zipDb, destinationFolder)); + + case 18: + _tecnaviaFileUtils.default.clearUnusedDownloadedFiles(zipDb); + + _context9.next = 25; + break; + + case 21: + _context9.prev = 21; + _context9.t0 = _context9["catch"](15); + + _tecnaviaFileUtils.default.clearUnusedDownloadedFiles(zipDb); + + throw _context9.t0; + + case 25: + _context9.next = 27; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(db)); + + case 27: + if (!_context9.sent) { + _context9.next = 73; + break; + } + + filenames.db = db; + _context9.prev = 29; + filenames.pages = []; + + if (!Array.isArray(unzippedFiles)) { + _context9.next = 49; + break; + } + + i = 0; + + case 33: + if (!(i < unzippedFiles.length)) { + _context9.next = 47; + break; + } + + filename = unzippedFiles[i]; + + if (!(filename === SECRET_PDF_FILENAME)) { + _context9.next = 41; + break; + } + + _context9.next = 38; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFile(destinationFolder + filename)); + + case 38: + filenames.secret = _context9.sent; + _context9.next = 44; + break; + + case 41: + if (!(filename !== zipDbFilename)) { + _context9.next = 44; + break; + } + + _context9.next = 44; + return _regenerator.default.awrap(function _callee2() { + var pageFolder, path, _await$TecnaviaFileUt, isDirectory; + + return _regenerator.default.async(function _callee2$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + pageFolder = _$$_REQUIRE(_dependencyMap[12]).StringUtils.getParentPath(filename); + + if (filenames.pages.find(function (_ref) { + var name = _ref.name; + return name === pageFolder; + })) { + _context8.next = 8; + break; + } + + path = destinationFolder + pageFolder; + _context8.next = 5; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.stat(path)); + + case 5: + _await$TecnaviaFileUt = _context8.sent; + isDirectory = _await$TecnaviaFileUt.isDirectory; + + if (isDirectory()) { + filenames.pages.push({ + path: path, + name: pageFolder + }); + } + + case 8: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + }()); + + case 44: + i++; + _context9.next = 33; + break; + + case 47: + _context9.next = 66; + break; + + case 49: + _context9.next = 51; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readDir(destinationFolder)); + + case 51: + files = _context9.sent; + _i = 0; + + case 53: + if (!(_i < files.length)) { + _context9.next = 66; + break; + } + + _files$_i = files[_i], path = _files$_i.path, name = _files$_i.name, isDirectory = _files$_i.isDirectory; + + if (!isDirectory()) { + _context9.next = 59; + break; + } + + filenames.pages.push({ + path: path, + name: name + }); + _context9.next = 63; + break; + + case 59: + if (!(name === SECRET_PDF_FILENAME)) { + _context9.next = 63; + break; + } + + _context9.next = 62; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFile(path)); + + case 62: + filenames.secret = _context9.sent; + + case 63: + _i++; + _context9.next = 53; + break; + + case 66: + _context9.next = 71; + break; + + case 68: + _context9.prev = 68; + _context9.t1 = _context9["catch"](29); + throw _context9.t1; + + case 71: + _context9.next = 74; + break; + + case 73: + throw new Error("Editions database not found after unzip"); + + case 74: + callbackAfterUnzip = config.callbackAfterUnzip; + + if (!callbackAfterUnzip) { + _context9.next = 83; + break; + } + + _context9.prev = 76; + _context9.next = 79; + return _regenerator.default.awrap(callbackAfterUnzip()); + + case 79: + _context9.next = 83; + break; + + case 81: + _context9.prev = 81; + _context9.t2 = _context9["catch"](76); + + case 83: + _context9.next = 88; + break; + + case 85: + _context9.prev = 85; + _context9.t3 = _context9["catch"](9); + throw _context9.t3; + + case 88: + _context9.next = 93; + break; + + case 90: + _context9.prev = 90; + _context9.t4 = _context9["catch"](3); + throw _context9.t4; + + case 93: + return _context9.abrupt("return", { + files: filenames, + responseHeaders: responseHeaders + }); + + case 94: + case "end": + return _context9.stop(); + } + } + }, null, null, [[3, 90], [9, 85], [15, 21], [29, 68], [76, 81]], Promise); + } + }, { + key: "getDBFromApiResponse", + value: function getDBFromApiResponse(dbURL, destinationFolder) { + var config, + filename, + unzippedFiles, + _await$DownloadUtils$5, + dbFiles, + db, + callbackAfterUnzip, + _args10 = arguments; + + return _regenerator.default.async(function getDBFromApiResponse$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + config = _args10.length > 2 && _args10[2] !== undefined ? _args10[2] : {}; + filename = null; + _context10.prev = 2; + _context10.next = 5; + return _regenerator.default.awrap(DownloadUtils.downloadResourceAndUnzipInFolder(dbURL, destinationFolder, config)); + + case 5: + _await$DownloadUtils$5 = _context10.sent; + unzippedFiles = _await$DownloadUtils$5.files; + _context10.prev = 7; + + if (!(unzippedFiles.length > 0)) { + _context10.next = 25; + break; + } + + dbFiles = unzippedFiles.filter(function (file) { + return file.endsWith(".db"); + }); + + if (!(dbFiles.length > 0)) { + _context10.next = 25; + break; + } + + db = destinationFolder + dbFiles[0]; + _context10.next = 14; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(db)); + + case 14: + if (!_context10.sent) { + _context10.next = 25; + break; + } + + filename = db; + callbackAfterUnzip = config.callbackAfterUnzip; + + if (!(typeof callbackAfterUnzip === "function")) { + _context10.next = 25; + break; + } + + _context10.prev = 18; + _context10.next = 21; + return _regenerator.default.awrap(callbackAfterUnzip(filename)); + + case 21: + _context10.next = 25; + break; + + case 23: + _context10.prev = 23; + _context10.t0 = _context10["catch"](18); + + case 25: + _context10.next = 30; + break; + + case 27: + _context10.prev = 27; + _context10.t1 = _context10["catch"](7); + throw _context10.t1; + + case 30: + _context10.next = 35; + break; + + case 32: + _context10.prev = 32; + _context10.t2 = _context10["catch"](2); + throw _context10.t2; + + case 35: + return _context10.abrupt("return", filename); + + case 36: + case "end": + return _context10.stop(); + } + } + }, null, null, [[2, 32], [7, 27], [18, 23]], Promise); + } + }, { + key: "getDatabaseName", + value: function getDatabaseName(url) { + return _tecnaviaFileUtils.default.getFilename(url).replace(".zip", ".db"); + } + }]); + return DownloadUtils; + }(); + + exports.default = DownloadUtils; +},586,[5,80,7,8,12,14,16,63,574,431,587,588,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.EPaperImageName = exports.EPaperImageType = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var EPaperImageType = { + LOW: "LL", + GRAPH: "LG", + TEXT: "LT", + HR: "HR", + HR_ZIP: "HR_ZIP", + PNG: "PNG" + }; + exports.EPaperImageType = EPaperImageType; + var EPaperImageName = { + LOW: "low.jpg", + GRAPH: "graph.jpg", + GIF: "text.gif", + PDF: "pagetext.pdf", + PNG: "pagetext.png", + PNG_FALLBACK: "text.png", + HR: "pag_[0-9]+_[0-9]+.(jpg|gif)", + HR_ZIP: "archive.zipgraph" + }; + exports.EPaperImageName = EPaperImageName; + + var EPaperImage = function () { + function EPaperImage() { + (0, _classCallCheck2.default)(this, EPaperImage); + } + + (0, _createClass2.default)(EPaperImage, [{ + key: "setPageId", + value: function setPageId(pageId) { + this.pageId = pageId; + } + }, { + key: "getPageId", + value: function getPageId() { + return this.pageId; + } + }, { + key: "setType", + value: function setType(type) { + this.type = type; + } + }, { + key: "getType", + value: function getType() { + return this.type; + } + }, { + key: "setTypeByName", + value: function setTypeByName(name) { + var LOW = EPaperImageName.LOW, + GRAPH = EPaperImageName.GRAPH, + PNG = EPaperImageName.PNG, + PNG_FALLBACK = EPaperImageName.PNG_FALLBACK, + GIF = EPaperImageName.GIF, + PDF = EPaperImageName.PDF, + HR = EPaperImageName.HR, + HR_ZIP = EPaperImageName.HR_ZIP; + var type = null; + + switch (name) { + case LOW: + type = EPaperImageType.LOW; + break; + + case GRAPH: + type = EPaperImageType.GRAPH; + break; + + case PNG: + case PNG_FALLBACK: + type = EPaperImageType.PNG; + break; + + case GIF: + case PDF: + type = EPaperImageType.TEXT; + break; + + case HR_ZIP: + type = EPaperImageType.HR_ZIP; + break; + + default: + if (name.search(HR) > -1) { + type = EPaperImageType.HR + "_" + name; + } + + break; + } + + this.setType(type); + } + }, { + key: "setName", + value: function setName(name) { + this.name = name; + } + }, { + key: "getName", + value: function getName(dataSaveMode) { + var name = ""; + var LOW = EPaperImageType.LOW, + GRAPH = EPaperImageType.GRAPH, + TEXT = EPaperImageType.TEXT, + PNG = EPaperImageType.PNG, + HR_ZIP = EPaperImageType.HR_ZIP; + + switch (this.type) { + case LOW: + name = EPaperImageName.LOW; + break; + + case GRAPH: + name = EPaperImageName.GRAPH; + break; + + case TEXT: + if (dataSaveMode) { + name = EPaperImageName.GIF; + } else { + name = EPaperImageName.PDF; + } + + break; + + case PNG: + name = EPaperImageName.PNG; + break; + + case HR_ZIP: + name = EPaperImageName.HR_ZIP; + break; + + default: + name = this.name; + break; + } + + return name; + } + }, { + key: "setBase64", + value: function setBase64(base64) { + this.base64 = base64; + } + }, { + key: "getBase64", + value: function getBase64() { + return this.base64; + } + }, { + key: "setWidth", + value: function setWidth(sizeX) { + this.width = sizeX; + } + }, { + key: "getWidth", + value: function getWidth() { + return this.width; + } + }, { + key: "setHeight", + value: function setHeight(sizeY) { + this.height = sizeY; + } + }, { + key: "getHeight", + value: function getHeight() { + return this.height; + } + }, { + key: "isLow", + value: function isLow() { + return this.type === EPaperImageType.LOW; + } + }, { + key: "isGraph", + value: function isGraph() { + return this.type === EPaperImageType.GRAPH; + } + }, { + key: "isText", + value: function isText() { + return this.type === EPaperImageType.TEXT; + } + }, { + key: "isHighRes", + value: function isHighRes() { + return this.type.includes(EPaperImageType.HR); + } + }, { + key: "isHighResZip", + value: function isHighResZip() { + return this.type === EPaperImageType.HR_ZIP; + } + }, { + key: "isTextPNG", + value: function isTextPNG() { + return this.type === EPaperImageType.PNG; + } + }, { + key: "isTextGIF", + value: function isTextGIF() { + if (this.name) { + return this.name === EPaperImageName.GIF; + } + + return this.base64.endsWith(EPaperImageName.GIF); + } + }, { + key: "isTextPDF", + value: function isTextPDF() { + if (this.name) { + return this.name === EPaperImageName.PDF; + } + + return this.base64.endsWith(EPaperImageName.PDF); + } + }]); + return EPaperImage; + }(); + + exports.default = EPaperImage; +},587,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.prefetch = exports.cropImage = exports.getSizeAsync = exports.getSize = exports.getImageSize = exports.queryCache = exports.getImageBase64String = exports.imageBase64 = exports.FILTER = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _imageEditor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNativeImageProgress = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNativeFastImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNativePhotoViewEx = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var FILTER = { + GRAYSCALE: "grayscale" + }; + exports.FILTER = FILTER; + + var imageBase64 = function _callee(props) { + var source, isLocalResource, uri, _Image$resolveAssetSo, base64, isIOS, path; + + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + source = props.source; + _context.prev = 1; + isLocalResource = typeof source === "number"; + + if (isLocalResource) { + _Image$resolveAssetSo = _reactNative.Image.resolveAssetSource(source); + uri = _Image$resolveAssetSo.uri; + } else { + uri = source.uri; + } + + isIOS = _$$_REQUIRE(_dependencyMap[13]).PlatformUtils.isIOS(); + + if (!(isIOS || global.__DEV__ || !isLocalResource)) { + _context.next = 26; + break; + } + + if (!(isIOS && _$$_REQUIRE(_dependencyMap[13]).StringUtils.isLocalURL(uri))) { + _context.next = 21; + break; + } + + path = uri.replace("file://", ""); + _context.prev = 8; + _context.next = 11; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFileBase64(path)); + + case 11: + base64 = _context.sent; + _context.next = 19; + break; + + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](8); + _context.next = 18; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.fetchBase64(uri)); + + case 18: + base64 = _context.sent; + + case 19: + _context.next = 24; + break; + + case 21: + _context.next = 23; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.fetchBase64(uri)); + + case 23: + base64 = _context.sent; + + case 24: + _context.next = 29; + break; + + case 26: + _context.next = 28; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[14]).OurBridge.getBase64FromRes(uri)); + + case 28: + base64 = _context.sent; + + case 29: + return _context.abrupt("return", "data:image/jpeg;base64," + base64); + + case 32: + _context.prev = 32; + _context.t1 = _context["catch"](1); + + case 34: + return _context.abrupt("return", undefined); + + case 35: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 32], [8, 14]], Promise); + }; + + exports.imageBase64 = imageBase64; + + var getImageBase64String = function getImageBase64String(base64) { + var dataType = _$$_REQUIRE(_dependencyMap[13]).PlatformUtils.isAndroid() ? "image/png" : "image/jpeg"; + return "data:" + dataType + ";base64," + base64; + }; + + exports.getImageBase64String = getImageBase64String; + + var queryCache = function queryCache() { + var urls = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return _reactNative.Image.queryCache(urls); + }; + + exports.queryCache = queryCache; + + var getImageSize = function _callee2(resource) { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", new Promise(function (resolve, reject) { + if (typeof resource === "string") { + _reactNative.Image.getSize(resource, function (w, h) { + resolve({ + width: w, + height: h + }); + }, function (error) { + resolve({ + width: 0, + height: 0 + }); + }); + } else if (typeof resource === "number") { + try { + resolve(_reactNative.Image.resolveAssetSource(resource)); + } catch (e) { + resolve({ + width: 0, + height: 0 + }); + } + } else { + resolve({ + width: 0, + height: 0 + }); + } + })); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getImageSize = getImageSize; + + var getSize = function _callee3(resource) { + var callback, + error, + _await$getImageSize, + width, + height, + _args3 = arguments; + + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + callback = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : function () {}; + error = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : function () {}; + _context3.prev = 2; + _context3.next = 5; + return _regenerator.default.awrap(getImageSize(resource)); + + case 5: + _await$getImageSize = _context3.sent; + width = _await$getImageSize.width; + height = _await$getImageSize.height; + callback(width, height); + _context3.next = 14; + break; + + case 11: + _context3.prev = 11; + _context3.t0 = _context3["catch"](2); + error(_context3.t0); + + case 14: + case "end": + return _context3.stop(); + } + } + }, null, null, [[2, 11]], Promise); + }; + + exports.getSize = getSize; + + var getSizeAsync = function _callee4(url) { + return _regenerator.default.async(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + return _context4.abrupt("return", new Promise(function (resolve, reject) { + _reactNative.Image.getSize(url, function (width, height) { + resolve({ + width: width, + height: height + }); + }, function (error) { + reject(error); + }); + })); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.getSizeAsync = getSizeAsync; + + var cropImage = function _callee5(url) { + var params, + _args5 = arguments; + return _regenerator.default.async(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + params = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {}; + return _context5.abrupt("return", _imageEditor.default.cropImage(url, params)); + + case 2: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.cropImage = cropImage; + + var prefetch = function _callee6(url) { + return _regenerator.default.async(function _callee6$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", _reactNative.Image.prefetch(url)); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.prefetch = prefetch; + + var isSourceValid = function isSourceValid(source) { + if (source === undefined || source === null) { + return false; + } + + if (typeof source === "object") { + if (source.uri && !source.uri.length) { + return false; + } + + if (!_$$_REQUIRE(_dependencyMap[13]).StringUtils.isDomainValid(source.uri)) { + return false; + } + } + + return true; + }; + + var getStyleProps = function getStyleProps(style) { + var props = {}; + + if (style) { + var tintColor = _$$_REQUIRE(_dependencyMap[13]).CssUtils.getTintColorAttributeStyle(style); + + if (tintColor) { + props.tintColor = tintColor; + } + } + + return (0, _extends2.default)({}, props, { + style: _$$_REQUIRE(_dependencyMap[13]).CssUtils.deleteKeysFromStyle(style, ["fontSize"]) + }); + }; + + function TecnaviaGrayscale(props) { + var filter = props.filter, + grayscaleStyle = props.grayscaleStyle, + children = props.children; + + if (children && filter === FILTER.GRAYSCALE) { + var value = _$$_REQUIRE(_dependencyMap[13]).CssUtils.grayscaleValue(grayscaleStyle) || 0; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Grayscale, { + amount: value, + style: grayscaleStyle + }, children); + } + + return children; + } + + function RNImage(props) { + var source = props.source, + error = props.error, + animated = props.animated, + _onError = props.onError, + style = props.style, + tintColor = props.tintColor, + rest = (0, _objectWithoutProperties2.default)(props, ["source", "error", "animated", "onError", "style", "tintColor"]); + + if (error) { + return null; + } + + var offlineCache = _$$_REQUIRE(_dependencyMap[13]).PlatformUtils.isIOS() && !_$$_REQUIRE(_dependencyMap[13]).NetworkUtils.isOnline() && source && source.uri && !_$$_REQUIRE(_dependencyMap[13]).StringUtils.isLocalURL(source.uri) && !error; + + if (offlineCache) { + source.cache = "only-if-cached"; + } else if (source && source.cache === "web") { + source.cache = "reload"; + } + + var imageStyle = []; + + if (tintColor) { + imageStyle.push({ + tintColor: tintColor + }); + } + + imageStyle.push(style); + var ComponentImage = animated ? _reactNative.Animated.Image : _reactNative.Image; + return _react.default.createElement(ComponentImage, (0, _extends2.default)({ + onError: function onError(_ref) { + var nativeEvent = _ref.nativeEvent; + + if (typeof _onError === "function") { + _onError(); + } + }, + source: source, + style: imageStyle + }, rest)); + } + + function FSImage(props) { + var source = props.source, + error = props.error, + _onError2 = props.onError, + rest = (0, _objectWithoutProperties2.default)(props, ["source", "error", "onError"]); + + if (error) { + return null; + } + + if (source && source.cache === "reload") { + source.cache = "web"; + } + + return _react.default.createElement(_reactNativeFastImage.default, (0, _extends2.default)({ + onError: function onError(_ref2) { + var nativeEvent = _ref2.nativeEvent; + + if (typeof _onError2 === "function") { + _onError2(); + } + }, + source: source + }, rest)); + } + + var skipUpdate = function skipUpdate(props, nextProps) { + return _$$_REQUIRE(_dependencyMap[13]).JSUtils.equals(props, nextProps); + }; + + var TecnaviaImage = _react.default.memo(function (props) { + var _useState = (0, _react.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + rnImageError = _useState2[0], + setRNImageError = _useState2[1]; + + var _useState3 = (0, _react.useState)(false), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + fsImageError = _useState4[0], + setFSImageError = _useState4[1]; + + var onErrorCallback = function onErrorCallback(event) { + var onError = props.onError; + + if (typeof onError === "function") { + onError(event); + } + }; + + var onRNImageError = function onRNImageError(event) { + onErrorCallback(event); + setRNImageError(true); + }; + + var onFSImageError = function onFSImageError(event) { + onErrorCallback(event); + setFSImageError(true); + }; + + var source = props.source, + forceRNComponent = props.forceRNComponent, + forceFastComponent = props.forceFastComponent, + progress = props.progress, + forceProgressComponent = props.forceProgressComponent, + forceZoomComponent = props.forceZoomComponent, + rest = (0, _objectWithoutProperties2.default)(props, ["source", "forceRNComponent", "forceFastComponent", "progress", "forceProgressComponent", "forceZoomComponent"]); + + var isAndroid = _$$_REQUIRE(_dependencyMap[13]).PlatformUtils.isAndroid(); + + var isRecentAndroid = isAndroid && !_$$_REQUIRE(_dependencyMap[13]).PlatformUtils.isPreviousMarshmallow(); + var isIOS = !isAndroid; + var useRNImage = forceRNComponent || rest.animated || isAndroid && !isRecentAndroid || !forceFastComponent && (isIOS || isRecentAndroid && !rnImageError); + var useFSImage = !fsImageError; + + if (!isSourceValid(source)) { + return null; + } + + var styleProps = getStyleProps(rest.style); + var Component = null; + + if (forceProgressComponent || progress) { + Component = _react.default.createElement(_reactNativeImageProgress.default, (0, _extends2.default)({}, rest, styleProps, { + source: source + })); + } else if (forceZoomComponent) { + Component = _react.default.createElement(_reactNativePhotoViewEx.default, (0, _extends2.default)({}, rest, styleProps, { + source: source + })); + } else if (useRNImage) { + Component = _react.default.createElement(RNImage, (0, _extends2.default)({}, rest, styleProps, { + source: source, + error: rnImageError, + onError: onRNImageError + })); + } else if (useFSImage) { + Component = _react.default.createElement(FSImage, (0, _extends2.default)({}, rest, styleProps, { + source: source, + error: fsImageError, + onError: onFSImageError + })); + } + + return _react.default.createElement(TecnaviaGrayscale, (0, _extends2.default)({}, rest, styleProps), Component); + }, skipUpdate); + + TecnaviaImage.propTypes = { + animated: _propTypes.default.bool, + progress: _propTypes.default.bool, + forceProgressComponent: _propTypes.default.bool, + forceRNComponent: _propTypes.default.bool, + forceFastComponent: _propTypes.default.bool, + forceZoomComponent: _propTypes.default.bool, + filter: _propTypes.default.string, + source: _propTypes.default.oneOfType([_propTypes.default.shape({ + uri: _propTypes.default.string + }), _propTypes.default.number]), + onError: _propTypes.default.func + }; + TecnaviaImage.defaultProps = { + animated: false, + progress: false, + forceProgressComponent: false, + forceRNComponent: false, + forceFastComponent: false, + forceZoomComponent: false + }; + var _default = TecnaviaImage; + exports.default = _default; +},588,[5,41,108,6,80,17,201,28,589,590,591,592,574,462,582,594]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var RNCImageEditor = _reactNative.NativeModules.RNCImageEditor; + + var ImageEditor = function () { + function ImageEditor() { + (0, _classCallCheck2.default)(this, ImageEditor); + } + + (0, _createClass2.default)(ImageEditor, null, [{ + key: "cropImage", + value: function cropImage(uri, cropData) { + return RNCImageEditor.cropImage(uri, cropData); + } + }]); + return ImageEditor; + }(); + + var _default = ImageEditor; + exports.default = _default; +},589,[5,7,8,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.createImageProgress = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var styles = _reactNative.StyleSheet.create({ + centered: (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject, { + alignItems: 'center', + justifyContent: 'center' + }) + }); + + var DefaultIndicator = _reactNative.ActivityIndicator; + + var getSourceKey = function getSourceKey(source) { + return source && source.uri || String(source); + }; + + var createImageProgress = function createImageProgress(ImageComponent) { + var _class; + + return _class = function (_Component) { + (0, _inherits2.default)(ImageProgress, _Component); + + var _super = _createSuper(ImageProgress); + + function ImageProgress(props) { + var _this; + + (0, _classCallCheck2.default)(this, ImageProgress); + _this = _super.call(this, props); + _this.ref = null; + + _this.handleRef = function (ref) { + _this.ref = ref; + }; + + _this.handleLoadStart = function () { + if (!_this.state.loading && _this.state.progress !== 1) { + _this.setState({ + error: null, + loading: true, + progress: 0 + }); + } + + _this.bubbleEvent('onLoadStart'); + }; + + _this.handleProgress = function (event) { + var progress = event.nativeEvent.loaded / event.nativeEvent.total; + + if (progress !== _this.state.progress && _this.state.progress !== 1) { + _this.setState({ + loading: progress < 1, + progress: progress + }); + } + + _this.bubbleEvent('onProgress', event); + }; + + _this.handleError = function (event) { + _this.setState({ + loading: false, + error: event.nativeEvent + }); + + _this.bubbleEvent('onError', event); + }; + + _this.handleLoad = function (event) { + if (_this.state.progress !== 1) { + _this.setState({ + error: null, + loading: false, + progress: 1 + }); + } + + _this.bubbleEvent('onLoad', event); + }; + + _this.handleLoadEnd = function (event) { + _this.setState({ + loading: false, + progress: 1 + }); + + _this.bubbleEvent('onLoadEnd', event); + }; + + _this.state = { + sourceKey: getSourceKey(props.source), + error: null, + loading: false, + progress: 0, + thresholdReached: !props.threshold + }; + return _this; + } + + (0, _createClass2.default)(ImageProgress, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + if (this.props.threshold) { + this.thresholdTimer = setTimeout(function () { + _this2.setState({ + thresholdReached: true + }); + + _this2.thresholdTimer = null; + }, this.props.threshold); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.thresholdTimer) { + clearTimeout(this.thresholdTimer); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(nativeProps) { + if (this.ref) { + this.ref.setNativeProps(nativeProps); + } + } + }, { + key: "measure", + value: function measure(cb) { + if (this.ref) { + this.ref.measure(cb); + } + } + }, { + key: "bubbleEvent", + value: function bubbleEvent(propertyName, event) { + if (typeof this.props[propertyName] === 'function') { + this.props[propertyName](event); + } + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + children = _this$props.children, + errorContainerStyle = _this$props.errorContainerStyle, + indicator = _this$props.indicator, + indicatorContainerStyle = _this$props.indicatorContainerStyle, + indicatorProps = _this$props.indicatorProps, + renderError = _this$props.renderError, + renderIndicator = _this$props.renderIndicator, + source = _this$props.source, + style = _this$props.style, + threshold = _this$props.threshold, + imageStyle = _this$props.imageStyle, + props = (0, _objectWithoutProperties2.default)(_this$props, ["children", "errorContainerStyle", "indicator", "indicatorContainerStyle", "indicatorProps", "renderError", "renderIndicator", "source", "style", "threshold", "imageStyle"]); + + if (!source || !source.uri) { + return _react.default.createElement(_reactNative.View, { + style: style, + ref: this.handleRef + }, _react.default.createElement(ImageComponent, (0, _extends2.default)({}, props, { + source: source, + style: [_reactNative.StyleSheet.absoluteFill, imageStyle] + })), children); + } + + var _this$state = this.state, + progress = _this$state.progress, + sourceKey = _this$state.sourceKey, + thresholdReached = _this$state.thresholdReached, + loading = _this$state.loading, + error = _this$state.error; + var indicatorElement; + + if (error) { + if (renderError) { + indicatorElement = _react.default.createElement(_reactNative.View, { + style: errorContainerStyle + }, renderError(error)); + } + } else if ((loading || progress < 1) && thresholdReached) { + if (renderIndicator) { + indicatorElement = renderIndicator(progress, !loading || !progress); + } else { + var IndicatorComponent = typeof indicator === 'function' ? indicator : DefaultIndicator; + indicatorElement = _react.default.createElement(IndicatorComponent, (0, _extends2.default)({ + progress: progress, + indeterminate: !loading || !progress + }, indicatorProps)); + } + + indicatorElement = _react.default.createElement(_reactNative.View, { + style: indicatorContainerStyle + }, indicatorElement); + } + + return _react.default.createElement(_reactNative.View, { + style: style, + ref: this.handleRef + }, _react.default.createElement(ImageComponent, (0, _extends2.default)({}, props, { + key: sourceKey, + onLoadStart: this.handleLoadStart, + onProgress: this.handleProgress, + onError: this.handleError, + onLoad: this.handleLoad, + onLoadEnd: this.handleLoadEnd, + source: source, + style: [_reactNative.StyleSheet.absoluteFill, imageStyle] + })), indicatorElement, children); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + var sourceKey = getSourceKey(props.source); + + if (sourceKey !== state.sourceKey) { + return { + sourceKey: sourceKey, + error: null, + loading: false, + progress: 0 + }; + } + + return null; + } + }]); + return ImageProgress; + }(_react.Component), _class.propTypes = { + children: _propTypes.default.node, + errorContainerStyle: _propTypes.default.any, + indicator: _propTypes.default.func, + indicatorContainerStyle: _propTypes.default.any, + indicatorProps: _propTypes.default.object, + renderIndicator: _propTypes.default.func, + renderError: _propTypes.default.func, + source: _propTypes.default.any, + style: _propTypes.default.any, + imageStyle: _propTypes.default.object, + threshold: _propTypes.default.number + }, _class.defaultProps = { + indicatorContainerStyle: styles.centered, + errorContainerStyle: styles.centered, + threshold: 50 + }, _class.prefetch = _reactNative.Image.prefetch, _class.getSize = _reactNative.Image.getSize, _class; + }; + + exports.createImageProgress = createImageProgress; + + var _default = createImageProgress(_reactNative.Image); + + exports.default = _default; +},590,[5,108,7,8,12,14,16,6,17,201,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var React = _$$_REQUIRE(_dependencyMap[0]); + + var reactNative = _$$_REQUIRE(_dependencyMap[1]); + + function _interopDefaultLegacy(e) { + return e && typeof e === 'object' && 'default' in e ? e : { + 'default': e + }; + } + + var _extends__default = _interopDefaultLegacy(_$$_REQUIRE(_dependencyMap[2])); + + var React__default = _interopDefaultLegacy(React); + + var FastImageViewNativeModule = reactNative.NativeModules.FastImageView; + var resizeMode = { + contain: 'contain', + cover: 'cover', + stretch: 'stretch', + center: 'center' + }; + var priority = { + low: 'low', + normal: 'normal', + high: 'high' + }; + var cacheControl = { + immutable: 'immutable', + web: 'web', + cacheOnly: 'cacheOnly' + }; + + function FastImageBase(_ref) { + var source = _ref.source, + tintColor = _ref.tintColor, + onLoadStart = _ref.onLoadStart, + onProgress = _ref.onProgress, + onLoad = _ref.onLoad, + onError = _ref.onError, + onLoadEnd = _ref.onLoadEnd, + style = _ref.style, + fallback = _ref.fallback, + children = _ref.children, + _ref$resizeMode = _ref.resizeMode, + resizeMode = _ref$resizeMode === undefined ? 'cover' : _ref$resizeMode, + forwardedRef = _ref.forwardedRef, + props = _$$_REQUIRE(_dependencyMap[3])(_ref, ["source", "tintColor", "onLoadStart", "onProgress", "onLoad", "onError", "onLoadEnd", "style", "fallback", "children", "resizeMode", "forwardedRef"]); + + if (fallback) { + var cleanedSource = _$$_REQUIRE(_dependencyMap[2])({}, source); + + delete cleanedSource.cache; + + var _resolvedSource = reactNative.Image.resolveAssetSource(cleanedSource); + + return React__default['default'].createElement(reactNative.View, { + style: [styles.imageContainer, style], + ref: forwardedRef + }, React__default['default'].createElement(reactNative.Image, _extends__default['default']({}, props, { + style: reactNative.StyleSheet.absoluteFill, + source: _resolvedSource, + onLoadStart: onLoadStart, + onProgress: onProgress, + onLoad: onLoad, + onError: onError, + onLoadEnd: onLoadEnd, + resizeMode: resizeMode + })), children); + } + + var resolvedSource = reactNative.Image.resolveAssetSource(source); + return React__default['default'].createElement(reactNative.View, { + style: [styles.imageContainer, style], + ref: forwardedRef + }, React__default['default'].createElement(FastImageView, _extends__default['default']({}, props, { + tintColor: tintColor, + style: reactNative.StyleSheet.absoluteFill, + source: resolvedSource, + onFastImageLoadStart: onLoadStart, + onFastImageProgress: onProgress, + onFastImageLoad: onLoad, + onFastImageError: onError, + onFastImageLoadEnd: onLoadEnd, + resizeMode: resizeMode + })), children); + } + + var FastImageMemo = React.memo(FastImageBase); + var FastImageComponent = React.forwardRef(function (props, ref) { + return React__default['default'].createElement(FastImageMemo, _extends__default['default']({ + forwardedRef: ref + }, props)); + }); + FastImageComponent.displayName = 'FastImage'; + var FastImage = FastImageComponent; + FastImage.resizeMode = resizeMode; + FastImage.cacheControl = cacheControl; + FastImage.priority = priority; + + FastImage.preload = function (sources) { + return FastImageViewNativeModule.preload(sources); + }; + + FastImage.clearMemoryCache = function () { + return FastImageViewNativeModule.clearMemoryCache(); + }; + + FastImage.clearDiskCache = function () { + return FastImageViewNativeModule.clearDiskCache(); + }; + + var styles = reactNative.StyleSheet.create({ + imageContainer: { + overflow: 'hidden' + } + }); + var FastImageView = reactNative.requireNativeComponent('FastImageView', FastImage, { + nativeOnly: { + onFastImageLoadStart: true, + onFastImageProgress: true, + onFastImageLoad: true, + onFastImageError: true, + onFastImageLoadEnd: true + } + }); + module.exports = FastImage; +},591,[17,28,6,108]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _PhotoView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = _PhotoView.default; + exports.default = _default; +},592,[5,593]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PhotoView = function (_React$PureComponent) { + (0, _inherits2.default)(PhotoView, _React$PureComponent); + + var _super = _createSuper(PhotoView); + + function PhotoView() { + (0, _classCallCheck2.default)(this, PhotoView); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(PhotoView, [{ + key: "render", + value: function render() { + var _this$props = this.props, + onError = _this$props.onError, + onLoad = _this$props.onLoad, + onLoadEnd = _this$props.onLoadEnd, + onLoadStart = _this$props.onLoadStart, + onProgress = _this$props.onProgress, + onScale = _this$props.onScale, + onTap = _this$props.onTap, + onViewTap = _this$props.onViewTap, + _source = _this$props.source, + _loadingIndicatorSource = _this$props.loadingIndicatorSource, + _style = _this$props.style, + props = (0, _objectWithoutProperties2.default)(_this$props, ["onError", "onLoad", "onLoadEnd", "onLoadStart", "onProgress", "onScale", "onTap", "onViewTap", "source", "loadingIndicatorSource", "style"]); + + var source = _reactNative.Image.resolveAssetSource(_source); + + var loadingIndicatorSource = _reactNative.Image.resolveAssetSource(_loadingIndicatorSource); + + if (source && source.uri === '') { + console.warn('source.uri should not be an empty string'); + } + + if (props.src) { + console.warn('The component requires a `source` property rather than `src`.'); + } + + if (source && source.uri) { + var width = source.width, + height = source.height, + src = (0, _objectWithoutProperties2.default)(source, ["width", "height"]); + + var style = _reactNative.StyleSheet.flatten([{ + width: width, + height: height + }, _style]); + + var nativeProps = (0, _extends2.default)({ + onPhotoViewerError: onError, + onPhotoViewerLoad: onLoad, + onPhotoViewerLoadEnd: onLoadEnd, + onPhotoViewerLoadStart: onLoadStart, + onPhotoViewerProgress: onProgress, + onPhotoViewerScale: onScale, + onPhotoViewerTap: onTap, + onPhotoViewerViewTap: onViewTap + }, props, { + style: style, + src: src, + loadingIndicatorSrc: loadingIndicatorSource && loadingIndicatorSource.uri || null + }); + return _react.default.createElement(RNPhotoView, nativeProps); + } + + return null; + } + }]); + return PhotoView; + }(_react.default.PureComponent); + + exports.default = PhotoView; + PhotoView.propTypes = (0, _extends2.default)({ + source: _propTypes.default.oneOfType([_propTypes.default.shape({ + uri: _propTypes.default.string + }), _propTypes.default.number]).isRequired, + loadingIndicatorSource: _propTypes.default.oneOfType([_propTypes.default.shape({ + uri: _propTypes.default.string + }), _propTypes.default.number]), + fadeDuration: _propTypes.default.number, + minimumZoomScale: _propTypes.default.number, + maximumZoomScale: _propTypes.default.number, + resizeMode: _propTypes.default.string, + scale: _propTypes.default.number, + onLoad: _propTypes.default.func, + onLoadEnd: _propTypes.default.func, + onLoadStart: _propTypes.default.func, + onProgress: _propTypes.default.func, + onScale: _propTypes.default.func, + onTap: _propTypes.default.func, + onViewTap: _propTypes.default.func, + showsHorizontalScrollIndicator: _propTypes.default.bool, + showsVerticalScrollIndicator: _propTypes.default.bool + }, _reactNative.ViewPropTypes); + var cfg = { + nativeOnly: { + onPhotoViewerError: true, + onPhotoViewerLoad: true, + onPhotoViewerLoadEnd: true, + onPhotoViewerLoadStart: true, + onPhotoViewerProgress: true, + onPhotoViewerScale: true, + onPhotoViewerTap: true, + onPhotoViewerViewTap: true, + src: true, + loadingIndicatorSrc: true + } + }; + var RNPhotoView = (0, _reactNative.requireNativeComponent)('RNPhotoView', PhotoView, cfg); +},593,[5,6,108,7,8,12,14,16,17,201,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _colorMatrixFilter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _rnColorMatrices = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + module.exports = (0, _extends2.default)({}, _colorMatrixFilter.default, _rnColorMatrices.default, { + concatColorMatrices: _$$_REQUIRE(_dependencyMap[4]).concatColorMatrices + }); +},594,[5,6,595,596,598]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _rnColorMatrices = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var ColorMatrixFilter = _react.default.forwardRef(function (_ref, ref) { + var matrix = _ref.matrix, + parentMatrix = _ref.parentMatrix, + children = _ref.children, + restProps = (0, _objectWithoutProperties2.default)(_ref, ["matrix", "parentMatrix", "children"]); + var mat = Array.isArray(matrix[0]) ? (0, _$$_REQUIRE(_dependencyMap[6]).concatColorMatrices)(matrix) : matrix; + var concatedMatrix = parentMatrix ? (0, _$$_REQUIRE(_dependencyMap[6]).concatTwoColorMatrices)(mat, parentMatrix) : mat; + + var child = _react.default.Children.only(children); + + return child && child.type && child.type.isColorMatrixFilter ? _react.default.cloneElement(child, (0, _extends2.default)({}, child.props, { + ref: ref, + parentMatrix: concatedMatrix + })) : _react.default.createElement(_$$_REQUIRE(_dependencyMap[7]).NativeFilter, (0, _extends2.default)({ + matrix: concatedMatrix, + ref: ref + }, restProps), children); + }); + + ColorMatrixFilter.isColorMatrixFilter = true; + ColorMatrixFilter.displayName = 'ColorMatrix'; + + var filterName = function filterName(name) { + var _name$split = name.split(''), + _name$split2 = (0, _toArray2.default)(_name$split), + first = _name$split2[0], + rest = _name$split2.slice(1); + + return name === 'rgba' ? 'RGBA' : first.toUpperCase() + rest.join(''); + }; + + var filterMap = { + ColorTone: function ColorTone(filter) { + return _react.default.forwardRef(function (_ref2, ref) { + var desaturation = _ref2.desaturation, + toned = _ref2.toned, + lightColor = _ref2.lightColor, + darkColor = _ref2.darkColor, + restProps = (0, _objectWithoutProperties2.default)(_ref2, ["desaturation", "toned", "lightColor", "darkColor"]); + return _react.default.createElement(ColorMatrixFilter, (0, _extends2.default)({ + matrix: filter(desaturation, toned, lightColor, darkColor), + ref: ref + }, restProps)); + }); + }, + RGBA: function RGBA(filter) { + return _react.default.forwardRef(function (_ref3, ref) { + var red = _ref3.red, + green = _ref3.green, + blue = _ref3.blue, + alpha = _ref3.alpha, + restProps = (0, _objectWithoutProperties2.default)(_ref3, ["red", "green", "blue", "alpha"]); + return _react.default.createElement(ColorMatrixFilter, (0, _extends2.default)({ + matrix: filter(red, green, blue, alpha), + ref: ref + }, restProps)); + }); + }, + DuoTone: function DuoTone(filter) { + return _react.default.forwardRef(function (_ref4, ref) { + var firstColor = _ref4.firstColor, + secondColor = _ref4.secondColor, + restProps = (0, _objectWithoutProperties2.default)(_ref4, ["firstColor", "secondColor"]); + return _react.default.createElement(ColorMatrixFilter, (0, _extends2.default)({ + matrix: filter(firstColor, secondColor), + ref: ref + }, restProps)); + }); + } + }; + + var createFilter = function createFilter(key) { + return filterMap[key] || function (filter) { + return _react.default.forwardRef(function (_ref5, ref) { + var amount = _ref5.amount, + restProps = (0, _objectWithoutProperties2.default)(_ref5, ["amount"]); + return _react.default.createElement(ColorMatrixFilter, (0, _extends2.default)({ + matrix: filter(amount), + ref: ref + }, restProps)); + }); + }; + }; + + var _default = Object.keys(_rnColorMatrices.default).reduce(function (acc, name) { + var key = filterName(name); + acc[key] = createFilter(key)(_rnColorMatrices.default[name]); + acc[key].displayName = key; + acc[key].isColorMatrixFilter = true; + return acc; + }, { + ColorMatrix: ColorMatrixFilter + }); + + exports.default = _default; +},595,[5,464,6,108,17,596,598,599]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _clamp = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var bias = _reactNative.Platform.OS === 'ios' ? 1 : 255; + var biasRev = _reactNative.Platform.OS === 'ios' ? 255 : 1; + + var colorToRGB = function colorToRGB(color) { + return [(color >> 16 & 0xFF) / 255, (color >> 8 & 0xFF) / 255, (color & 0xFF) / 255]; + }; + + var staticFilters = { + normal: [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0], + luminanceToAlpha: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2125, 0.7154, 0.0721, 0, 0], + invert: [-1, 0, 0, 0, bias, 0, -1, 0, 0, bias, 0, 0, -1, 0, bias, 0, 0, 0, 1, 0], + nightvision: [0.1, 0.4, 0, 0, 0, 0.3, 1, 0.3, 0, 0, 0, 0.4, 0.1, 0, 0, 0, 0, 0, 1, 0], + warm: [1.06, 0, 0, 0, 0, 0, 1.01, 0, 0, 0, 0, 0, 0.93, 0, 0, 0, 0, 0, 1, 0], + cool: [0.99, 0, 0, 0, 0, 0, 0.93, 0, 0, 0, 0, 0, 1.08, 0, 0, 0, 0, 0, 1, 0], + technicolor: [1.9125277891456083, -0.8545344976951645, -0.09155508482755585, 0, 11.793603434377337 / biasRev, -0.3087833385928097, 1.7658908555458428, -0.10601743074722245, 0, -70.35205161461398 / biasRev, -0.231103377548616, -0.7501899197440212, 1.847597816108189, 0, 30.950940869491138 / biasRev, 0, 0, 0, 1, 0], + polaroid: [1.438, -0.062, -0.062, 0, 0, -0.122, 1.378, -0.122, 0, 0, -0.016, -0.016, 1.483, 0, 0, 0, 0, 0, 1, 0], + toBGR: [0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0], + kodachrome: [1.1285582396593525, -0.3967382283601348, -0.03992559172921793, 0, 63.72958762196502 / biasRev, -0.16404339962244616, 1.0835251566291304, -0.05498805115633132, 0, 24.732407896706203 / biasRev, -0.16786010706155763, -0.5603416277695248, 1.6014850761964943, 0, 35.62982807460946 / biasRev, 0, 0, 0, 1, 0], + browni: [0.5997023498159715, 0.34553243048391263, -0.2708298674538042, 0, 47.43192855600873 / biasRev, -0.037703249837783157, 0.8609577587992641, 0.15059552388459913, 0, -36.96841498319127 / biasRev, 0.24113635128153335, -0.07441037908422492, 0.44972182064877153, 0, -7.562075277591283 / biasRev, 0, 0, 0, 1, 0], + vintage: [0.6279345635605994, 0.3202183420819367, -0.03965408211312453, 0, 9.651285835294123 / biasRev, 0.02578397704808868, 0.6441188644374771, 0.03259127616149294, 0, 7.462829176470591 / biasRev, 0.0466055556782719, -0.0851232987247891, 0.5241648018700465, 0, 5.159190588235296 / biasRev, 0, 0, 0, 1, 0], + lsd: [2, -0.4, 0.5, 0, 0, -0.5, 2, -0.4, 0, 0, -0.4, -0.5, 3, 0, 0, 0, 0, 0, 1, 0], + protanomaly: [0.817, 0.183, 0, 0, 0, 0.333, 0.667, 0, 0, 0, 0, 0.125, 0.875, 0, 0, 0, 0, 0, 1, 0], + deuteranomaly: [0.8, 0.2, 0, 0, 0, 0.258, 0.742, 0, 0, 0, 0, 0.142, 0.858, 0, 0, 0, 0, 0, 1, 0], + tritanomaly: [0.967, 0.033, 0, 0, 0, 0, 0.733, 0.267, 0, 0, 0, 0.183, 0.817, 0, 0, 0, 0, 0, 1, 0], + protanopia: [0.567, 0.433, 0, 0, 0, 0.558, 0.442, 0, 0, 0, 0, 0.242, 0.758, 0, 0, 0, 0, 0, 1, 0], + deuteranopia: [0.625, 0.375, 0, 0, 0, 0.7, 0.3, 0, 0, 0, 0, 0.3, 0.7, 0, 0, 0, 0, 0, 1, 0], + tritanopia: [0.95, 0.05, 0, 0, 0, 0, 0.433, 0.567, 0, 0, 0, 0.475, 0.525, 0, 0, 0, 0, 0, 1, 0], + achromatopsia: [0.299, 0.587, 0.114, 0, 0, 0.299, 0.587, 0.114, 0, 0, 0.299, 0.587, 0.114, 0, 0, 0, 0, 0, 1, 0], + achromatomaly: [0.618, 0.320, 0.062, 0, 0, 0.163, 0.775, 0.062, 0, 0, 0.163, 0.320, 0.516, 0, 0, 0, 0, 0, 1, 0] + }; + var _default = { + normal: function normal() { + return staticFilters.normal; + }, + rgba: function rgba() { + var r = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var g = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + var b = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1; + var a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + return [r, 0, 0, 0, 0, 0, g, 0, 0, 0, 0, 0, b, 0, 0, 0, 0, 0, a, 0]; + }, + saturate: function saturate() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + return [0.213 + 0.787 * v, 0.715 - 0.715 * v, 0.072 - 0.072 * v, 0, 0, 0.213 - 0.213 * v, 0.715 + 0.285 * v, 0.072 - 0.072 * v, 0, 0, 0.213 - 0.213 * v, 0.715 - 0.715 * v, 0.072 + 0.928 * v, 0, 0, 0, 0, 0, 1, 0]; + }, + hueRotate: function hueRotate() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var cos = Math.cos(v); + var sin = Math.sin(v); + var a00 = 0.213 + cos * 0.787 - sin * 0.213; + var a01 = 0.715 - cos * 0.715 - sin * 0.715; + var a02 = 0.072 - cos * 0.072 + sin * 0.928; + var a10 = 0.213 - cos * 0.213 + sin * 0.143; + var a11 = 0.715 + cos * 0.285 + sin * 0.140; + var a12 = 0.072 - cos * 0.072 - sin * 0.283; + var a20 = 0.213 - cos * 0.213 - sin * 0.787; + var a21 = 0.715 - cos * 0.715 + sin * 0.715; + var a22 = 0.072 + cos * 0.928 + sin * 0.072; + return [a00, a01, a02, 0, 0, a10, a11, a12, 0, 0, a20, a21, a22, 0, 0, 0, 0, 0, 1, 0]; + }, + luminanceToAlpha: function luminanceToAlpha() { + return staticFilters.luminanceToAlpha; + }, + invert: function invert() { + return staticFilters.invert; + }, + grayscale: function grayscale() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var cv = (0, _clamp.default)(1 - v, 0, 1); + return [0.2126 + 0.7874 * cv, 0.7152 - 0.7152 * cv, 0.0722 - 0.0722 * cv, 0, 0, 0.2126 - 0.2126 * cv, 0.7152 + 0.2848 * cv, 0.0722 - 0.0722 * cv, 0, 0, 0.2126 - 0.2126 * cv, 0.7152 - 0.7152 * cv, 0.0722 + 0.9278 * cv, 0, 0, 0, 0, 0, 1, 0]; + }, + sepia: function sepia() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var cv = (0, _clamp.default)(1 - v, 0, 1); + return [0.393 + 0.607 * cv, 0.769 - 0.769 * cv, 0.189 - 0.189 * cv, 0, 0, 0.349 - 0.349 * cv, 0.686 + 0.314 * cv, 0.168 - 0.168 * cv, 0, 0, 0.272 - 0.272 * cv, 0.534 - 0.534 * cv, 0.131 + 0.869 * cv, 0, 0, 0, 0, 0, 1, 0]; + }, + nightvision: function nightvision() { + return staticFilters.nightvision; + }, + warm: function warm() { + return staticFilters.warm; + }, + cool: function cool() { + return staticFilters.cool; + }, + brightness: function brightness() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + return [v, 0, 0, 0, 0, 0, v, 0, 0, 0, 0, 0, v, 0, 0, 0, 0, 0, 1, 0]; + }, + contrast: function contrast() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var n = 0.5 * (1 - v); + return [v, 0, 0, 0, bias * n, 0, v, 0, 0, bias * n, 0, 0, v, 0, bias * n, 0, 0, 0, 1, 0]; + }, + temperature: function temperature() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + return [1 + v, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 - v, 0, 0, 0, 0, 0, 1, 0]; + }, + tint: function tint() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + return [1 + v, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 + v, 0, 0, 0, 0, 0, 1, 0]; + }, + threshold: function threshold() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var rLum = 0.03086; + var gLum = 0.06094; + var bLum = 0.00820; + var r = 7.8693; + var g = 15.5397; + var b = 2.091; + return [r, g, b, 0, -bias * v, r, g, b, 0, -bias * v, r, g, b, 0, -bias * v, 0, 0, 0, 1, 0]; + }, + technicolor: function technicolor() { + return staticFilters.technicolor; + }, + polaroid: function polaroid() { + return staticFilters.polaroid; + }, + toBGR: function toBGR() { + return staticFilters.toBGR; + }, + kodachrome: function kodachrome() { + return staticFilters.kodachrome; + }, + browni: function browni() { + return staticFilters.browni; + }, + vintage: function vintage() { + return staticFilters.vintage; + }, + night: function night() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.1; + return [v * -2, -v, 0, 0, 0, -v, 0, v, 0, 0, 0, v, v * 2.0, 0, 0, 0, 0, 0, 1, 0]; + }, + predator: function predator() { + var v = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + return [11.224130630493164 * v, -4.794486999511719 * v, -2.8746118545532227 * v, 0 * v, 0.40342438220977783 * v / biasRev, -3.6330697536468506 * v, 9.193157196044922 * v, -2.951810836791992 * v, 0 * v, -1.316135048866272 * v / biasRev, -3.2184197902679443 * v, -4.2375030517578125 * v, 7.476448059082031 * v, 0 * v, 0.8044459223747253 * v / biasRev, 0, 0, 0, 1, 0]; + }, + lsd: function lsd() { + return staticFilters.lsd; + }, + colorTone: function colorTone(desaturation, toned, lightColor, darkColor) { + var _colorToRGB = colorToRGB(lightColor === undefined ? 0xFFE580 : (0, _reactNative.processColor)(lightColor)), + _colorToRGB2 = (0, _slicedToArray2.default)(_colorToRGB, 3), + lR = _colorToRGB2[0], + lG = _colorToRGB2[1], + lB = _colorToRGB2[2]; + + var _colorToRGB3 = colorToRGB(darkColor === undefined ? 0x338000 : (0, _reactNative.processColor)(darkColor)), + _colorToRGB4 = (0, _slicedToArray2.default)(_colorToRGB3, 3), + dR = _colorToRGB4[0], + dG = _colorToRGB4[1], + dB = _colorToRGB4[2]; + + return [0.3, 0.59, 0.11, 0, 0, lR, lG, lB, desaturation === undefined ? 0.2 : desaturation, 0, dR, dG, dB, toned === undefined ? 0.15 : toned, 0, lR - dR, lG - dG, lB - dB, 0, 0]; + }, + duoTone: function duoTone(first, second) { + var _colorToRGB5 = colorToRGB(first === undefined ? 0xFFE580 : (0, _reactNative.processColor)(first)), + _colorToRGB6 = (0, _slicedToArray2.default)(_colorToRGB5, 3), + fR = _colorToRGB6[0], + fG = _colorToRGB6[1], + fB = _colorToRGB6[2]; + + var _colorToRGB7 = colorToRGB(second === undefined ? 0x338000 : (0, _reactNative.processColor)(second)), + _colorToRGB8 = (0, _slicedToArray2.default)(_colorToRGB7, 3), + sR = _colorToRGB8[0], + sG = _colorToRGB8[1], + sB = _colorToRGB8[2]; + + return [fR - sR, 0, 0, 0, sR * bias, fG - sG, 0, 0, 0, sG * bias, fB - sB, 0, 0, 0, sB * bias, 0, 0, 0, 1, 0]; + }, + protanomaly: function protanomaly() { + return staticFilters.protanomaly; + }, + deuteranomaly: function deuteranomaly() { + return staticFilters.deuteranomaly; + }, + tritanomaly: function tritanomaly() { + return staticFilters.tritanomaly; + }, + protanopia: function protanopia() { + return staticFilters.protanopia; + }, + deuteranopia: function deuteranopia() { + return staticFilters.deuteranopia; + }, + tritanopia: function tritanopia() { + return staticFilters.tritanopia; + }, + achromatopsia: function achromatopsia() { + return staticFilters.achromatopsia; + }, + achromatomaly: function achromatomaly() { + return staticFilters.achromatomaly; + } + }; + exports.default = _default; +},596,[5,41,28,597]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = clamp; + + function clamp(value, min, max) { + return min < max ? value < min ? min : value > max ? max : value : value < max ? max : value > min ? min : value; + } +},597,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.concatColorMatrices = exports.concatTwoColorMatrices = undefined; + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var concatTwoColorMatrices = function concatTwoColorMatrices(matB, matA) { + (0, _invariant.default)(Array.isArray(matB) && matB.length === 20, "Color matrix matB should be an array with 20 elements."); + (0, _invariant.default)(Array.isArray(matA) && matA.length === 20, "Color matrix matA should be an array with 20 elements."); + var tmp = Array(20); + var index = 0; + + for (var j = 0; j < 20; j += 5) { + for (var i = 0; i < 4; i++) { + tmp[index++] = matA[j + 0] * matB[i + 0] + matA[j + 1] * matB[i + 5] + matA[j + 2] * matB[i + 10] + matA[j + 3] * matB[i + 15]; + } + + tmp[index++] = matA[j + 0] * matB[4] + matA[j + 1] * matB[9] + matA[j + 2] * matB[14] + matA[j + 3] * matB[19] + matA[j + 4]; + } + + return tmp; + }; + + exports.concatTwoColorMatrices = concatTwoColorMatrices; + + var concatColorMatrices = function concatColorMatrices(matrices) { + (0, _invariant.default)(Array.isArray(matrices) && matrices.length > 0, "Matrices should be an array of non zero length."); + return matrices.reduce(concatTwoColorMatrices); + }; + + exports.concatColorMatrices = concatColorMatrices; +},598,[5,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NativeFilter = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var ColorMatrixImageFilter = (0, _reactNative.requireNativeComponent)('CMIFColorMatrixImageFilter'); + + var NativeFilter = _react.default.forwardRef(function (_ref, ref) { + var style = _ref.style, + restProps = (0, _objectWithoutProperties2.default)(_ref, ["style"]); + (0, _$$_REQUIRE(_dependencyMap[5]).checkStyle)(style); + return _react.default.createElement(ColorMatrixImageFilter, (0, _extends2.default)({ + style: [_$$_REQUIRE(_dependencyMap[5]).defaultStyle.container, style], + ref: ref + }, restProps)); + }); + + exports.NativeFilter = NativeFilter; +},599,[5,6,108,17,28,600]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.checkStyle = exports.defaultStyle = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _invariant = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var defaultStyle = _reactNative.StyleSheet.create({ + container: { + backgroundColor: '#fff0' + } + }); + + exports.defaultStyle = defaultStyle; + + var checkStyle = function checkStyle(style) { + if (style) { + var _StyleSheet$flatten = _reactNative.StyleSheet.flatten(style), + backgroundColor = _StyleSheet$flatten.backgroundColor; + + (0, _invariant.default)((0, _reactNative.processColor)(backgroundColor) !== 0, "ImageFilter: Can't use '" + backgroundColor + "' backgroundColor," + ' consider using \'#fff0\' instead.'); + } + }; + + exports.checkStyle = checkStyle; +},600,[28,5,601]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var validateFormat = function (format) { + if (format === undefined) { + throw new Error('invariant(...): Second argument must be a string.'); + } + }; + + function invariant(condition, format) { + for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = arguments[_key]; + } + + validateFormat(format); + + if (!condition) { + var error; + + if (format === undefined) { + error = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."); + } else { + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return String(args[argIndex++]); + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; + throw error; + } + } + + module.exports = invariant; +},601,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var MAIN_DIRECTORY = "application"; + + var ApplicationManager = function () { + function ApplicationManager() { + (0, _classCallCheck2.default)(this, ApplicationManager); + } + + (0, _createClass2.default)(ApplicationManager, null, [{ + key: "getMainBundleLocation", + value: function getMainBundleLocation() { + return _tecnaviaFileUtils.default.getMainBundleDirectory() + "/" + MAIN_DIRECTORY; + } + }, { + key: "getDirectory", + value: function getDirectory() { + return _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory() + MAIN_DIRECTORY; + } + }, { + key: "getDefaultIconsDirectory", + value: function getDefaultIconsDirectory() { + return "file://" + ApplicationManager.getDirectory() + "/code/icons/"; + } + }, { + key: "getDefaultArticleTextBanner", + value: function getDefaultArticleTextBanner() { + return "file://" + ApplicationManager.getDirectory() + "/code/images/article-banner.png"; + } + }, { + key: "getHybridDirectory", + value: function getHybridDirectory() { + return ApplicationManager.getDirectory() + "/hybrid"; + } + }, { + key: "getEditionArticleTextBanner", + value: function getEditionArticleTextBanner(edition) { + if (edition && edition.length) { + return "file://" + ApplicationManager.getHybridDirectory() + "/header/logo_" + edition + ".gif"; + } + + throw new Error("missing edition"); + } + }, { + key: "getLogoPath", + value: function getLogoPath(edition) { + var customPath; + return _regenerator.default.async(function getLogoPath$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + + if (!edition) { + _context.next = 10; + break; + } + + edition = edition.replace(/ /g, ""); + edition = edition.replace(/ü/g, "u"); + edition = edition.replace(/\\-/, ""); + customPath = ApplicationManager.getEditionArticleTextBanner(edition.toLowerCase()); + _context.next = 8; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(customPath)); + + case 8: + if (!_context.sent) { + _context.next = 10; + break; + } + + return _context.abrupt("return", customPath); + + case 10: + _context.next = 14; + break; + + case 12: + _context.prev = 12; + _context.t0 = _context["catch"](0); + + case 14: + return _context.abrupt("return", ApplicationManager.getDefaultArticleTextBanner()); + + case 15: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 12]], Promise); + } + }, { + key: "getHybridVersionFilePath", + value: function getHybridVersionFilePath() { + return ApplicationManager.getHybridDirectory() + "/version.txt"; + } + }, { + key: "getHybridVersion", + value: function getHybridVersion() { + var hybridVersionFilePath, hybridVersion; + return _regenerator.default.async(function getHybridVersion$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + hybridVersionFilePath = ApplicationManager.getHybridVersionFilePath(); + _context2.next = 3; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(hybridVersionFilePath)); + + case 3: + if (!_context2.sent) { + _context2.next = 8; + break; + } + + _context2.next = 6; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFile(hybridVersionFilePath)); + + case 6: + hybridVersion = _context2.sent; + return _context2.abrupt("return", hybridVersion); + + case 8: + return _context2.abrupt("return", "-1"); + + case 9: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "updateHybridVersion", + value: function updateHybridVersion(version) { + var hybridDirectory, hybridVersionFilePath; + return _regenerator.default.async(function updateHybridVersion$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + hybridDirectory = ApplicationManager.getHybridDirectory(); + hybridVersionFilePath = ApplicationManager.getHybridVersionFilePath(); + _context3.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(hybridDirectory)); + + case 4: + if (_context3.sent) { + _context3.next = 7; + break; + } + + _context3.next = 7; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(hybridDirectory)); + + case 7: + _context3.next = 9; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.write(hybridVersionFilePath, version)); + + case 9: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "copyApplicationFolder", + value: function copyApplicationFolder() { + var applicationBaseFolder, applicationFolder, applicationBundleFolder; + return _regenerator.default.async(function copyApplicationFolder$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + applicationBaseFolder = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(); + applicationFolder = ApplicationManager.getDirectory(); + _context4.prev = 2; + _context4.next = 5; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(applicationFolder)); + + case 5: + if (_context4.sent) { + _context4.next = 14; + break; + } + + if (!_$$_REQUIRE(_dependencyMap[5]).PlatformUtils.isIOS()) { + _context4.next = 12; + break; + } + + applicationBundleFolder = ApplicationManager.getMainBundleLocation(); + _context4.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.copyFile(applicationBundleFolder, applicationFolder)); + + case 10: + _context4.next = 14; + break; + + case 12: + _context4.next = 14; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.assetsCopy(MAIN_DIRECTORY, applicationBaseFolder)); + + case 14: + _context4.next = 19; + break; + + case 16: + _context4.prev = 16; + _context4.t0 = _context4["catch"](2); + return _context4.abrupt("return", false); + + case 19: + return _context4.abrupt("return", true); + + case 20: + case "end": + return _context4.stop(); + } + } + }, null, null, [[2, 16]], Promise); + } + }, { + key: "deleteApplicationFolder", + value: function deleteApplicationFolder() { + var applicationFolder; + return _regenerator.default.async(function deleteApplicationFolder$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + applicationFolder = ApplicationManager.getDirectory(); + _context5.prev = 1; + _context5.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(applicationFolder)); + + case 4: + _context5.next = 9; + break; + + case 6: + _context5.prev = 6; + _context5.t0 = _context5["catch"](1); + return _context5.abrupt("return", false); + + case 9: + return _context5.abrupt("return", true); + + case 10: + case "end": + return _context5.stop(); + } + } + }, null, null, [[1, 6]], Promise); + } + }]); + return ApplicationManager; + }(); + + exports.default = ApplicationManager; +},602,[5,80,7,8,574,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.IndexLayout = exports.DownloadType = exports.ARCHIVE_ZIP_TEXT_FILENAME = exports.ARCHIVE_ZIP_GRAPH_FILENAME = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _cryptoJs = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _aes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _sha = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _Box = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _BoxesInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ARCHIVE_ZIP_GRAPH_FILENAME = "archive.zipgraph"; + exports.ARCHIVE_ZIP_GRAPH_FILENAME = ARCHIVE_ZIP_GRAPH_FILENAME; + var ARCHIVE_ZIP_TEXT_FILENAME = "archive.ziptext"; + exports.ARCHIVE_ZIP_TEXT_FILENAME = ARCHIVE_ZIP_TEXT_FILENAME; + + var DownloadType = function DownloadType() { + (0, _classCallCheck2.default)(this, DownloadType); + }; + + exports.DownloadType = DownloadType; + DownloadType.LOW_ONLY = "0"; + DownloadType.MID_AND_LOW = "1"; + DownloadType.FULL = "2"; + var IndexLayout = { + ALL_ART: 0, + LIST: 1, + LIST_WITH_THUMBNAIL: 2, + TABS: 3 + }; + exports.IndexLayout = IndexLayout; + + var NewsmemoryUtils = function () { + function NewsmemoryUtils() { + (0, _classCallCheck2.default)(this, NewsmemoryUtils); + } + + (0, _createClass2.default)(NewsmemoryUtils, null, [{ + key: "normalizePaperName", + value: function normalizePaperName(paperName) { + var paperNameNormalized = paperName.replace(/[^a-z0-9]/gi, ""); + return paperNameNormalized; + } + }, { + key: "normalizeEdition", + value: function normalizeEdition(edition) { + var editionNormalized = edition.replace(/(&#[a-zA-Z0-9]+;)/g, ""); + return editionNormalized.toLowerCase().replace(/[^a-z0-9]/gi, ""); + } + }, { + key: "parsePageInfo", + value: function parsePageInfo(page) { + var letters = ""; + var numbers = ""; + + if (page) { + for (var i = 0; i < page.length; i++) { + if (page.charAt(i).match(/[a-z]/i)) { + if (numbers.length === 0 || letters.length === 0) { + letters += page.charAt(i); + } + } else if (page.charAt(i).match(/[0-9]/i)) { + numbers += page.charAt(i); + } else { + break; + } + } + } + + return { + section: letters, + number: parseInt(numbers, 10) + }; + } + }, { + key: "getImageFromPage", + value: function getImageFromPage(page, type) { + try { + return page.getImages().find(function (image) { + return image.getType() === type; + }); + } catch (e) { + return null; + } + } + }, { + key: "getHighlightStyle", + value: function getHighlightStyle(box, info, size, fitWidth) { + var highResMatrix = [0, info.getPageWidth() * info.getPercentile() - (info.getBboxLeft() + info.getBboxRight()) * info.getScaleX(), 0, info.getPageHeight() * info.getPercentile() - (info.getBboxTop() + info.getBboxBottom()) * info.getScaleY()]; + var boxWidth = box.getWidth() * info.getScaleX(); + var boxHeight = box.getHeight() * info.getScaleY(); + var boxLeft = (box.getLeft() + info.getBboxLeft() - info.getTotalOffsetX()) * info.getScaleX() - info.getBboxLeft() * info.getScaleX(); + var boxTop = (box.getTop() + info.getBboxTop() - info.getTotalOffsetY()) * info.getScaleY() - info.getBboxTop() * info.getScaleY(); + var scale = fitWidth ? size.width / highResMatrix[1] : size.height / highResMatrix[3]; + var scaled = { + top: boxTop * scale, + start: boxLeft * scale, + width: boxWidth * scale, + height: boxHeight * scale + }; + return scaled; + } + }, { + key: "getHrScale", + value: function getHrScale(info, size, fitWidth) { + var pageWidth = Math.floor(info.getPageWidth() * info.getPercentile()) - Math.floor((info.getBboxLeft() + info.getBboxRight()) * info.getScaleX()); + var pageHeight = Math.floor(info.getPageHeight() * info.getPercentile()) - Math.floor((info.getBboxTop() + info.getBboxBottom()) * info.getScaleY()); + var highResMatrix = [0, pageWidth, 0, pageHeight]; + return fitWidth ? size.width / highResMatrix[1] : size.height / highResMatrix[3]; + } + }, { + key: "getHrStyle", + value: function getHrStyle(box, info) { + var size = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var fitWidth = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var boxWidth = Math.floor((box.getWidth() + info.getWidthOffsetC()) * info.getScaleX()); + var boxHeight = Math.floor((box.getHeight() + info.getHeightOffsetC()) * info.getScaleY()); + var boxLeft = Math.floor((box.getLeft() + info.getBboxLeft() - info.getTotalOffsetX()) * info.getScaleX()) - Math.floor(info.getBboxLeft() * info.getScaleX()); + var boxTop = Math.floor((box.getTop() + info.getBboxTop() - info.getTotalOffsetY()) * info.getScaleY()) - Math.floor(info.getBboxTop() * info.getScaleY()); + var temporaryLeft = box.getLeft() + info.getBboxLeft() - info.getTotalOffsetX(); + + if (temporaryLeft < 0) { + boxWidth = Math.floor((box.getWidth() + info.getXOffsetC()) * info.getScaleX()); + boxLeft = 0; + } + + var temporaryTop = box.getTop() + info.getBboxTop() - info.getTotalOffsetY(); + + if (temporaryTop < 0) { + boxHeight = Math.floor((box.getHeight() + info.getYOffsetC()) * info.getScaleY()); + boxTop = 0; + } + + var temporaryRight = box.getLeft() + box.getWidth() + info.getWidthOffsetC() + info.getBboxLeft() + info.getBboxRight() - info.getTotalOffsetX(); + + if (temporaryRight > info.getPageWidthMedium()) { + boxWidth = Math.floor((box.getWidth() + info.getXOffsetC()) * info.getScaleX()); + } + + var temporaryBottom = box.getTop() + box.getHeight() + info.getHeightOffsetC() + info.getBboxTop() + info.getBboxBottom() - info.getTotalOffsetY(); + + if (temporaryBottom > info.getPageHeightMedium()) { + boxHeight = Math.floor((box.getHeight() + info.getYOffsetC()) * info.getScaleY()); + } + + var scale = _$$_REQUIRE(_dependencyMap[19]).JSUtils.isEmpty(size) ? 1 : NewsmemoryUtils.getHrScale(info, size, fitWidth); + var scaled = { + top: boxTop * scale, + start: boxLeft * scale, + width: boxWidth * scale, + height: boxHeight * scale + }; + + if (global.isLayoutDebug) { + try {} catch (e) {} + } + + return scaled; + } + }, { + key: "isBorderBoxToFix", + value: function isBorderBoxToFix(box, info) { + return box.getLeft() + box.getWidth() - info.getXOffset() === info.getPageWidthMedium() || box.getTop() + box.getHeight() - info.getYOffset() === info.getPageHeightMedium(); + } + }, { + key: "getHrImageByBox", + value: function getHrImageByBox(page, boxName) { + return page.getImages().find(function (image) { + return image.isHighRes() && image.getBase64().includes(boxName); + }); + } + }, { + key: "getHrImageName", + value: function getHrImageName(xmlId, boxId, graph) { + var type = graph ? "jpg" : "gif"; + return "pag_" + xmlId + "_" + boxId + "." + type; + } + }, { + key: "getHrGraphImageName", + value: function getHrGraphImageName(xmlId, boxId) { + return NewsmemoryUtils.getHrImageName(xmlId, boxId, true); + } + }, { + key: "getHrTextImageName", + value: function getHrTextImageName(xmlId, boxId) { + return NewsmemoryUtils.getHrImageName(xmlId, boxId, false); + } + }, { + key: "allPageArticlesHrImages", + value: function allPageArticlesHrImages(page) { + var showAll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + if (page) { + return page.getArticles().map(function (article) { + if (showAll || !article.isAd() && !article.isLayout()) { + return NewsmemoryUtils.allPageArticleHrImages(page, article); + } + + return undefined; + }).filter(function (item) { + return !!item; + }); + } + + return []; + } + }, { + key: "allPageArticleHrImages", + value: function allPageArticleHrImages(page, article) { + var xmlId = article.getXmlId(); + var obj = { + xmlId: xmlId, + boxesInfo: article.getBoxesInfo(), + boxes: [] + }; + article.getBoxes().forEach(function (box) { + var imageNameGraph = NewsmemoryUtils.getHrGraphImageName(xmlId, box.getId()); + var imageNameText = NewsmemoryUtils.getHrTextImageName(xmlId, box.getId()); + var hrImageGraph = NewsmemoryUtils.getHrImageByBox(page, imageNameGraph); + var hrImageText = NewsmemoryUtils.getHrImageByBox(page, imageNameText); + + if (box.getHeight() > 0 && box.getWidth() > 0) { + obj.boxes.push({ + box: box, + graph: hrImageGraph, + text: hrImageText + }); + } + }); + return obj; + } + }, { + key: "isModeLow", + value: function isModeLow() { + var network = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getNewsmemoryConfig().network; + return network === DownloadType.LOW_ONLY; + } + }, { + key: "isModeMid", + value: function isModeMid() { + var network = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getNewsmemoryConfig().network; + return network === DownloadType.MID_AND_LOW; + } + }, { + key: "isModeFull", + value: function isModeFull() { + var network = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getNewsmemoryConfig().network; + return network === DownloadType.FULL; + } + }, { + key: "getFormattedIssue", + value: function getFormattedIssue(issue) { + var _global$getActivePSet = global.getActivePSetup(), + dateFormat = _global$getActivePSet.dateFormat, + showWeekAfterDate = _global$getActivePSet.showWeekAfterDate; + + var dateFormatted = _$$_REQUIRE(_dependencyMap[19]).DateUtils.formatDate(issue, _$$_REQUIRE(_dependencyMap[19]).DateUtils.getPatternByDateFormat(_$$_REQUIRE(_dependencyMap[19]).DateUtils.getSeparator(), dateFormat, showWeekAfterDate)); + + if (dateFormat === "98") { + dateFormatted = "Numero " + dateFormatted; + } + + return dateFormatted.charAt(0).toUpperCase() + dateFormatted.substring(1); + } + }, { + key: "getPageViewSize", + value: function getPageViewSize(page, size, fitHorizontally, numberOfShowedPages) { + var isFirstPage = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + + if (page) { + var _global$getActivePSet2 = global.getActivePSetup(), + maxZoom = _global$getActivePSet2.maxZoom; + + var ratio = isFirstPage && page.isDoubleTruck() ? 2 : 1; + var pageScaleX = page.getFrameWidth() * numberOfShowedPages / ratio / size.width; + var pageScaleY = page.getFrameHeight() / size.height; + var scale = Math.max(pageScaleX, pageScaleY); + + if (fitHorizontally) { + scale = pageScaleX; + + if (pageScaleX < 1) { + maxZoom *= pageScaleX; + } + } else { + maxZoom *= scale; + } + + var scaledWidth = page.getFrameWidth() / ratio / scale; + var scaledHeight = page.getFrameHeight() / scale; + return { + scaledWidth: scaledWidth, + scaledHeight: scaledHeight, + maxZoom: maxZoom + }; + } + + return undefined; + } + }, { + key: "getZoomingFactor", + value: function getZoomingFactor() { + var _global$getActivePSet3 = global.getActivePSetup(), + zoomingFactor = _global$getActivePSet3.zoomingFactor; + + var zf = global.getNewsmemoryConfig().getGraphSize() / 100 * (zoomingFactor / 100); + return zf; + } + }, { + key: "getHorizontalPageDips", + value: function getHorizontalPageDips(page) { + var dips = 1; + + if (page) { + var divider = page.isDoubleTruck() ? 2 : 1; + var width = Math.max(page.getWidth(), page.getFrameWidth()); + dips = width / divider / 72 * _deviceUtils.default.getReferenceDpi(); + } + + return dips; + } + }, { + key: "getVerticalPageDips", + value: function getVerticalPageDips(page) { + var dips = 1; + + if (page) { + var height = Math.max(page.getHeight(), page.getFrameHeight()); + dips = height / 72 * _deviceUtils.default.getReferenceDpi(); + } + + return dips; + } + }, { + key: "isCDNEnabled", + value: function isCDNEnabled() { + var _global$getNewsmemory = global.getNewsmemoryConfig(), + cdnEnabled = _global$getNewsmemory.cdnEnabled, + cdnServer = _global$getNewsmemory.cdnServer; + + return cdnEnabled && !!cdnServer; + } + }, { + key: "dosHexTimestamp2Unix", + value: function dosHexTimestamp2Unix(dosHex) { + return NewsmemoryUtils.dosTimestamp2Unix(parseInt(dosHex, 16)); + } + }, { + key: "dosTimestamp2Unix", + value: function dosTimestamp2Unix(dosTimestamp) { + var unixTime = new Date(); + unixTime.setUTCFullYear(1980 + (dosTimestamp >> 25 & 0xff)); + unixTime.setUTCMonth((dosTimestamp >> 21 & 0xf) - 1); + unixTime.setUTCDate(dosTimestamp >> 16 & 0x1f); + unixTime.setUTCHours(dosTimestamp >> 11 & 0x1f); + unixTime.setUTCMinutes(dosTimestamp >> 5 & 0x3f); + unixTime.setUTCSeconds((dosTimestamp & 0x1f) << 1); + return unixTime.getTime(); + } + }, { + key: "mtime2Unix", + value: function mtime2Unix(mtime) { + if (mtime.length === 8) { + return Math.floor(NewsmemoryUtils.dosHexTimestamp2Unix(mtime) / 1000) & -2; + } + + var biSeconds = parseInt(mtime, 10) & -2; + return _$$_REQUIRE(_dependencyMap[19]).StringUtils.pad(biSeconds, 6); + } + }, { + key: "getCDNChecksum", + value: function getCDNChecksum(filetimes) { + var checksum; + + if (NewsmemoryUtils.isCDNEnabled()) { + var fileTimestamp = filetimes.reduce(function (result, filetime) { + var unixTimestamp = NewsmemoryUtils.mtime2Unix(filetime); + return result + "," + unixTimestamp; + }, ""); + checksum = _$$_REQUIRE(_dependencyMap[19]).StringUtils.getMd5(fileTimestamp); + } + + return checksum; + } + }, { + key: "encryptFilenames", + value: function encryptFilenames(filenames, secret) { + var encryptedFilename = filenames.join(","); + + var _secret$split = secret.split("|"), + _secret$split2 = (0, _slicedToArray2.default)(_secret$split, 2), + key = _secret$split2[0], + iv = _secret$split2[1]; + + if (key && iv) { + try { + key = _cryptoJs.default.enc.Utf8.parse((0, _sha.default)(key).toString().substring(0, 32)); + iv = _cryptoJs.default.enc.Utf8.parse((0, _sha.default)(iv).toString().substring(0, 16)); + encryptedFilename = _aes.default.encrypt(encryptedFilename, key, { + iv: iv, + mode: _cryptoJs.default.mode.CBC + }).toString(); + encryptedFilename = _cryptoJs.default.enc.Base64.stringify(_cryptoJs.default.enc.Utf8.parse(encryptedFilename)); + } catch (e) {} + } + + return encryptedFilename; + } + }, { + key: "getSpinnerColor", + value: function getSpinnerColor() { + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + var spinnerColor; + + if (supportColor && !_$$_REQUIRE(_dependencyMap[19]).ColorUtils.isClearColor(supportColor)) { + spinnerColor = supportColor; + } else if (global.loadingColor && !_$$_REQUIRE(_dependencyMap[19]).ColorUtils.isClearColor(global.loadingColor)) { + spinnerColor = global.loadingColor; + } else if (global.splashBgColor && !_$$_REQUIRE(_dependencyMap[19]).ColorUtils.isClearColor(global.splashBgColor)) { + spinnerColor = global.splashBgColor; + } else { + spinnerColor = _$$_REQUIRE(_dependencyMap[19]).colors.black; + } + + return spinnerColor; + } + }, { + key: "getAllArticles", + value: function getAllArticles(edition) { + var allArticles = []; + + if (edition) { + var pages = edition.getPages(); + pages.forEach(function (page) { + if (page) { + allArticles = allArticles.concat(page.getArticles()); + } + }); + } + + return allArticles; + } + }, { + key: "getPageSize", + value: function getPageSize(edition, page) { + var lowImage = page.getLowImage(); + var graphImage = page.getGraphImage(); + var pageWidth = page.getFrameWidth(edition.isFirstPageDoubleTruck()); + var pageHeight = page.getFrameHeight(); + + if (graphImage) { + pageWidth = graphImage.getWidth(); + pageHeight = graphImage.getHeight(); + } else if (lowImage && lowImage.getWidth() > 0) { + pageHeight = lowImage.getHeight() / lowImage.getWidth() * page.getFrameWidth(); + } + + return { + pageWidth: pageWidth, + pageHeight: pageHeight + }; + } + }, { + key: "getPageSizeFixed", + value: function getPageSizeFixed(edition, page) { + if (edition && page && page.isDoubleTruck() && !page.getGraphImage()) { + var firstPage = edition.getFirstPage(); + + if (firstPage) { + var size = NewsmemoryUtils.getPageSize(edition, firstPage); + + if (firstPage.isDoubleTruck()) { + return size; + } + + size.pageWidth *= 2; + return size; + } + } + + return NewsmemoryUtils.getPageSize(edition, page); + } + }, { + key: "isCustomIndexDisabled", + value: function isCustomIndexDisabled(indexHTML) { + return indexHTML.indexOf('') !== -1; + } + }, { + key: "getPagesToRenderByIndex", + value: function getPagesToRenderByIndex(pages, pageId, pagesVisible, isRtl) { + var numberOfDTBeforePage = 0; + var numberOfDT = 0; + var index = 0; + var found = false; + + for (var i = 0; i < pages.length; i++) { + var page = pages[i]; + + if (page.getPageId() === pageId && !found) { + found = true; + index = i; + } + + if (page.isDoubleTruck()) { + numberOfDT += 1; + + if (!found) { + numberOfDTBeforePage += 1; + } + } + } + + var totalPages = pages.length + numberOfDT; + index += numberOfDTBeforePage; + index = (0, _$$_REQUIRE(_dependencyMap[20]).adaptIndexForRTL)(index, totalPages); + index = (0, _$$_REQUIRE(_dependencyMap[20]).fixStartupIndex)(index, totalPages, pagesVisible, isRtl); + + if (isRtl) { + index += numberOfDT - numberOfDTBeforePage; + } else { + index -= numberOfDTBeforePage; + } + + return pages[(0, _$$_REQUIRE(_dependencyMap[20]).adaptIndexForRTL)(index, totalPages)]; + } + }, { + key: "getStatusFromStartupParams", + value: function getStatusFromStartupParams(params) { + var statusParams = { + lastIssue: params.selDate || params.date || params.issue, + lastEdition: params.editionStart || params.edition, + lastPageNumber: params.goTo, + lastArticleId: params.artid + }; + return statusParams; + } + }, { + key: "showDownloadDBErrorDialog", + value: function showDownloadDBErrorDialog(issue, edition, onRetry, onCancel, onReset) { + var buttons = []; + buttons.push({ + text: global.strings("btn_cancel"), + onPress: onCancel + }, { + text: global.strings("retry"), + onPress: onRetry + }); + + if (onReset && typeof onReset === "function") { + buttons.push({ + text: global.strings("btn_reset"), + onPress: onReset + }); + } + + _reactNative.Alert.alert("", global.strings("err_download_edition_db"), buttons, { + cancelable: false + }); + } + }, { + key: "isLite", + value: function isLite(currentNewspaperManager) { + var _global$getActivePSet4 = global.getActivePSetup(), + isLite = _global$getActivePSet4.isLite; + + try { + var editionIsLite = false; + + if (currentNewspaperManager && currentNewspaperManager.getCurrentNewspaper() && currentNewspaperManager.getCurrentNewspaper().getEditionModel()) { + editionIsLite = currentNewspaperManager.getCurrentNewspaper().getEditionModel().isLite; + } + + return isLite || editionIsLite; + } catch (e) { + return false; + } + } + }, { + key: "canEnableReadMode", + value: function canEnableReadMode(currentNewspaperManager) { + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + twoFingersTapToArticle = _global$getNewsmemory2.twoFingersTapToArticle; + + return twoFingersTapToArticle && !NewsmemoryUtils.isLite(currentNewspaperManager) && _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isTablet() && !_$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isSystemAccessibilityEnabled(); + } + }, { + key: "parseXpSetup", + value: function parseXpSetup(pSetup) { + var mainpSetup = pSetup; + var xpSetup; + + if (pSetup.indexOf("-xp-") !== -1) { + var pSetupArray = pSetup.split("-xp-"); + + if (pSetupArray.length > 1) { + mainpSetup = pSetupArray[0]; + xpSetup = pSetupArray[1]; + } + } + + return { + mainpSetup: mainpSetup, + xpSetup: xpSetup + }; + } + }, { + key: "isXPaperActive", + value: function isXPaperActive() { + var _global$getActivePSet5 = global.getActivePSetup(), + pSetup = _global$getActivePSet5.pSetup; + + var _NewsmemoryUtils$pars = NewsmemoryUtils.parseXpSetup(pSetup), + xpSetup = _NewsmemoryUtils$pars.xpSetup; + + return !!xpSetup; + } + }, { + key: "isTrialModeEnabled", + value: function isTrialModeEnabled(newspaper) { + if (newspaper) { + return NewsmemoryUtils.numberOfPagesInTrialMode(newspaper.getIssue(), newspaper.getEdition()) > -1; + } + + return false; + } + }, { + key: "numberOfPagesInTrialMode", + value: function numberOfPagesInTrialMode(issue, edition) { + var _global$getActivePSet6 = global.getActivePSetup(), + pageSeeNewspaperPreview = _global$getActivePSet6.pageSeeNewspaperPreview, + seeNewspaperPreview = _global$getActivePSet6.seeNewspaperPreview, + loginStatus = _global$getActivePSet6.loginStatus, + lastIssue = _global$getActivePSet6.lastIssue, + lastEdition = _global$getActivePSet6.lastEdition; + + if (!seeNewspaperPreview) { + return -1; + } + + var oneTimeToken = loginStatus.oneTimeToken; + + if (seeNewspaperPreview === 3 && !oneTimeToken) { + return -1; + } + + if (seeNewspaperPreview === 4 && !loginStatus.isLoggedIn()) { + return -1; + } + + if (seeNewspaperPreview === 5 || seeNewspaperPreview === 6) { + if (issue === lastIssue && edition === lastEdition) { + if (seeNewspaperPreview === 6 && !loginStatus.isLoggedIn()) { + return -1; + } + } else { + return -1; + } + } + + var hasAccess = loginStatus.userHasAccess(issue, edition); + + if (hasAccess) { + return -1; + } + + return pageSeeNewspaperPreview; + } + }, { + key: "getChildArtPrintImageInfo", + value: function getChildArtPrintImageInfo(childArt) { + var maxY = 0; + var maxX = 0; + var offsetX; + var offsetY; + var boxes = childArt.getBoxes().map(function (box) { + maxX = Math.max(box.getLeft() + box.getWidth(), maxX); + maxY = Math.max(box.getTop() + box.getHeight(), maxY); + offsetX = offsetX ? Math.min(offsetX, box.getLeft()) : box.getLeft(); + offsetY = offsetY ? Math.min(offsetY, box.getTop()) : box.getTop(); + return "pag_" + childArt.getXmlId() + "_" + box.getId() + "," + box.getLeft() + "," + box.getTop() + "," + box.getWidth() + "," + box.getHeight() + "0-0"; + }); + var boxesInfo = childArt.getBoxesInfo(); + maxX = parseInt((maxX - offsetX) * boxesInfo.getZoomX(), 10); + maxY = parseInt((maxY - offsetY) * boxesInfo.getZoomY(), 10); + return { + boxesString: boxes.join(" "), + maxX: maxX, + maxY: maxY, + medDpi: Math.ceil(boxesInfo.getMedDpi()) + }; + } + }, { + key: "getFullEditionNameWithArticle", + value: function getFullEditionNameWithArticle(edition) { + var prependPreposition = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var article = ""; + + var _global$getActivePSet7 = global.getActivePSetup(), + language = _global$getActivePSet7.language; + + switch (language) { + case "0": + if (!edition.toLowerCase().startsWith("the ")) { + article = "the "; + } + + break; + + case "1": + if (prependPreposition) { + if (edition.toLowerCase().startsWith("il ") || edition.toLowerCase().startsWith("lo ") || edition.toLowerCase().startsWith("la") || edition.toLowerCase().startsWith("il ") || edition.toLowerCase().startsWith("gli ") || edition.toLowerCase().startsWith("le ") || edition.toLowerCase().startsWith("l'")) { + article = "de "; + } else if (!edition.toLowerCase().startsWith("di ")) { + article = "di "; + } + } + + break; + } + + return "" + article + edition; + } + }, { + key: "getArticleId", + value: function getArticleId(artid) { + var articleId = -1; + + if (artid) { + articleId = artid.replace(/art_/g, ""); + articleId = articleId.replace(/\.xml/g, ""); + } + + return articleId; + } + }, { + key: "getTOCStyle", + value: function getTOCStyle(edition) { + var _global$getActivePSet8 = global.getActivePSetup(), + tocStyle = _global$getActivePSet8.tocStyle, + tocStylePreview = _global$getActivePSet8.tocStylePreview; + + if (edition && NewsmemoryUtils.numberOfPagesInTrialMode(edition.getIssue(), edition.getEdition()) > -1) { + return tocStylePreview; + } + + return tocStyle; + } + }, { + key: "oneLevelIndex", + value: function oneLevelIndex(edition) { + var tocStyle = NewsmemoryUtils.getTOCStyle(edition); + return tocStyle === "all_art"; + } + }, { + key: "getIndexLayout", + value: function getIndexLayout(edition) { + var accessibilityEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var _global$getNewsmemory3 = global.getNewsmemoryConfig(), + enableTabIndexMode = _global$getNewsmemory3.enableTabIndexMode; + + if (enableTabIndexMode && !accessibilityEnabled) { + return IndexLayout.TABS; + } + + var tocStyle = NewsmemoryUtils.getTOCStyle(edition); + + if (tocStyle === "all_art") { + return IndexLayout.ALL_ART; + } + + if (tocStyle === "list_main_thumbs" && !accessibilityEnabled) { + return IndexLayout.LIST_WITH_THUMBNAIL; + } + + return IndexLayout.LIST; + } + }, { + key: "replaceWatermarkPlaceholders", + value: function replaceWatermarkPlaceholders(value) { + var newValue = value; + + var _global$getActivePSet9 = global.getActivePSetup(), + paperName = _global$getActivePSet9.paperName, + loginStatus = _global$getActivePSet9.loginStatus, + copyright = _global$getActivePSet9.copyright; + + var m; + var regExp = new RegExp(/\$([a-zA-Z0-9]+)/g); + + while ((m = regExp.exec(value)) !== null) { + if (m.length > 1) { + var _paramValue; + + var placeholder = m[0]; + var name = m[1]; + var paramValue = undefined; + + switch (name) { + case "device": + paramValue = _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.model(); + break; + + case "platform": + paramValue = _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isAndroid() ? "Android" : "iOS"; + break; + + case "os": + paramValue = _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.getSystemName() + " " + _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.getSystemVersion(); + break; + + case "appVersion": + paramValue = _deviceUtils.default.getAppVersion(); + break; + + case "appName": + paramValue = _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.appName(); + break; + + case "paperName": + paramValue = paperName; + break; + + case "extId": + if (loginStatus) { + var extid = loginStatus.extid; + + if (!_$$_REQUIRE(_dependencyMap[19]).JSUtils.isNull(extid)) { + paramValue = extid; + } + } + + break; + + case "TAUID": + if (loginStatus) { + var TAUID = loginStatus.TAUID; + + if (TAUID > -1) { + paramValue = TAUID; + } + } + + break; + + case "machineId": + var _global = global, + machineId = _global.machineId; + + if (machineId) { + paramValue = machineId.substring(machineId.length - 6); + } + + break; + + case "copyright": + if (copyright) { + paramValue = copyright; + } + + break; + } + + paramValue = (_paramValue = paramValue) != null ? _paramValue : ""; + newValue = newValue.replace(placeholder, paramValue); + } + } + + return newValue; + } + }, { + key: "addWatermarkToPageComponent", + value: function addWatermarkToPageComponent(path) { + var options, + _global$getActivePSet10, + loginStatus, + watermarkText, + text, + _global2, + machineId, + _global$getFontsConfi, + fontRegular, + fontName, + _options$cssClasses, + cssClasses, + otherOptions, + customStyles, + _args = arguments; + + return _regenerator.default.async(function addWatermarkToPageComponent$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + _global$getActivePSet10 = global.getActivePSetup(), loginStatus = _global$getActivePSet10.loginStatus, watermarkText = _global$getActivePSet10.watermarkText; + text = NewsmemoryUtils.replaceWatermarkPlaceholders(watermarkText); + + if (!text) { + _global2 = global, machineId = _global2.machineId; + + if (machineId) { + text = machineId.substring(machineId.length - 6); + + if (loginStatus && !_$$_REQUIRE(_dependencyMap[19]).JSUtils.isNull(loginStatus.extid)) { + text = loginStatus.extid; + } + } + } + + if (!text) { + _context.next = 13; + break; + } + + text = text.replace("TAUID_", "T"); + text = text.replace("MACID_", "M"); + _global$getFontsConfi = global.getFontsConfig(), fontRegular = _global$getFontsConfi.fontRegular; + fontName = "Nunito-Light"; + + if (fontRegular) { + fontName = fontRegular.font; + } + + _options$cssClasses = options.cssClasses, cssClasses = _options$cssClasses === undefined ? [] : _options$cssClasses, otherOptions = (0, _objectWithoutProperties2.default)(options, ["cssClasses"]); + customStyles = _$$_REQUIRE(_dependencyMap[21]).Css.getStyleObjByCssClasses(["newsmemory-watermark"].concat((0, _toConsumableArray2.default)(cssClasses))); + return _context.abrupt("return", _$$_REQUIRE(_dependencyMap[19]).FileUtils.addTextWatermarkToImage((0, _extends2.default)({ + position: "center", + quality: 90, + fontSize: 40, + fontName: fontName, + color: _$$_REQUIRE(_dependencyMap[19]).colors.white_transparent_135, + shadowStyle: { + color: _$$_REQUIRE(_dependencyMap[19]).colors.black, + dx: 0, + dy: 0, + radius: 1 + } + }, otherOptions, customStyles, { + src: "file://" + path, + text: text + }))); + + case 13: + throw new Error("Unable to set a watermark text!"); + + case 14: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return NewsmemoryUtils; + }(); + + exports.default = NewsmemoryUtils; +},603,[5,80,6,21,108,41,8,7,28,604,633,612,638,587,641,642,640,458,644,462,645,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), _$$_REQUIRE(_dependencyMap[4]), _$$_REQUIRE(_dependencyMap[5]), _$$_REQUIRE(_dependencyMap[6]), _$$_REQUIRE(_dependencyMap[7]), _$$_REQUIRE(_dependencyMap[8]), _$$_REQUIRE(_dependencyMap[9]), _$$_REQUIRE(_dependencyMap[10]), _$$_REQUIRE(_dependencyMap[11]), _$$_REQUIRE(_dependencyMap[12]), _$$_REQUIRE(_dependencyMap[13]), _$$_REQUIRE(_dependencyMap[14]), _$$_REQUIRE(_dependencyMap[15]), _$$_REQUIRE(_dependencyMap[16]), _$$_REQUIRE(_dependencyMap[17]), _$$_REQUIRE(_dependencyMap[18]), _$$_REQUIRE(_dependencyMap[19]), _$$_REQUIRE(_dependencyMap[20]), _$$_REQUIRE(_dependencyMap[21]), _$$_REQUIRE(_dependencyMap[22]), _$$_REQUIRE(_dependencyMap[23]), _$$_REQUIRE(_dependencyMap[24]), _$$_REQUIRE(_dependencyMap[25]), _$$_REQUIRE(_dependencyMap[26]), _$$_REQUIRE(_dependencyMap[27]), _$$_REQUIRE(_dependencyMap[28]), _$$_REQUIRE(_dependencyMap[29]), _$$_REQUIRE(_dependencyMap[30]), _$$_REQUIRE(_dependencyMap[31]), _$$_REQUIRE(_dependencyMap[32])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy"], factory); + } else { + root.CryptoJS = factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + return CryptoJS; + }); +},604,[605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(); + } else if (typeof define === "function" && define.amd) { + define([], factory); + } else { + root.CryptoJS = factory(); + } + })(this, function () { + var CryptoJS = CryptoJS || function (Math, undefined) { + var create = Object.create || function () { + function F() {} + + ; + return function (obj) { + var subtype; + F.prototype = obj; + subtype = new F(); + F.prototype = null; + return subtype; + }; + }(); + + var C = {}; + var C_lib = C.lib = {}; + + var Base = C_lib.Base = function () { + return { + extend: function extend(overrides) { + var subtype = create(this); + + if (overrides) { + subtype.mixIn(overrides); + } + + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + subtype.init.prototype = subtype; + subtype.$super = this; + return subtype; + }, + create: function create() { + var instance = this.extend(); + instance.init.apply(instance, arguments); + return instance; + }, + init: function init() {}, + mixIn: function mixIn(properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + clone: function clone() { + return this.init.prototype.extend(this); + } + }; + }(); + + var WordArray = C_lib.WordArray = Base.extend({ + init: function init(words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + toString: function toString(encoder) { + return (encoder || Hex).stringify(this); + }, + concat: function concat(wordArray) { + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + this.clamp(); + + if (thisSigBytes % 4) { + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff; + thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8; + } + } else { + for (var i = 0; i < thatSigBytes; i += 4) { + thisWords[thisSigBytes + i >>> 2] = thatWords[i >>> 2]; + } + } + + this.sigBytes += thatSigBytes; + return this; + }, + clamp: function clamp() { + var words = this.words; + var sigBytes = this.sigBytes; + words[sigBytes >>> 2] &= 0xffffffff << 32 - sigBytes % 4 * 8; + words.length = Math.ceil(sigBytes / 4); + }, + clone: function clone() { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + return clone; + }, + random: function random(nBytes) { + var words = []; + + var r = function r(m_w) { + var m_w = m_w; + var m_z = 0x3ade68b1; + var mask = 0xffffffff; + return function () { + m_z = 0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10) & mask; + m_w = 0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10) & mask; + var result = (m_z << 0x10) + m_w & mask; + result /= 0x100000000; + result += 0.5; + return result * (Math.random() > .5 ? 1 : -1); + }; + }; + + for (var i = 0, rcache; i < nBytes; i += 4) { + var _r = r((rcache || Math.random()) * 0x100000000); + + rcache = _r() * 0x3ade67b7; + words.push(_r() * 0x100000000 | 0); + } + + return new WordArray.init(words, nBytes); + } + }); + var C_enc = C.enc = {}; + var Hex = C_enc.Hex = { + stringify: function stringify(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var hexChars = []; + + for (var i = 0; i < sigBytes; i++) { + var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + parse: function parse(hexStr) { + var hexStrLength = hexStr.length; + var words = []; + + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4; + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + var Latin1 = C_enc.Latin1 = { + stringify: function stringify(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var latin1Chars = []; + + for (var i = 0; i < sigBytes; i++) { + var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + parse: function parse(latin1Str) { + var latin1StrLength = latin1Str.length; + var words = []; + + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << 24 - i % 4 * 8; + } + + return new WordArray.init(words, latin1StrLength); + } + }; + var Utf8 = C_enc.Utf8 = { + stringify: function stringify(wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + parse: function parse(utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + reset: function reset() { + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + _append: function _append(data) { + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + this._data.concat(data); + + this._nDataBytes += data.sigBytes; + }, + _process: function _process(doFlush) { + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + var nBlocksReady = dataSigBytes / blockSizeBytes; + + if (doFlush) { + nBlocksReady = Math.ceil(nBlocksReady); + } else { + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + var nWordsReady = nBlocksReady * blockSize; + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + this._doProcessBlock(dataWords, offset); + } + + var processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + return new WordArray.init(processedWords, nBytesReady); + }, + clone: function clone() { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + return clone; + }, + _minBufferSize: 0 + }); + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + cfg: Base.extend(), + init: function init(cfg) { + this.cfg = this.cfg.extend(cfg); + this.reset(); + }, + reset: function reset() { + BufferedBlockAlgorithm.reset.call(this); + + this._doReset(); + }, + update: function update(messageUpdate) { + this._append(messageUpdate); + + this._process(); + + return this; + }, + finalize: function finalize(messageUpdate) { + if (messageUpdate) { + this._append(messageUpdate); + } + + var hash = this._doFinalize(); + + return hash; + }, + blockSize: 16, + _createHelper: function _createHelper(hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + _createHmacHelper: function _createHmacHelper(hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + var C_algo = C.algo = {}; + return C; + }(Math); + + return CryptoJS; + }); +},605,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function (undefined) { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var X32WordArray = C_lib.WordArray; + var C_x64 = C.x64 = {}; + var X64Word = C_x64.Word = Base.extend({ + init: function init(high, low) { + this.high = high; + this.low = low; + } + }); + var X64WordArray = C_x64.WordArray = Base.extend({ + init: function init(words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 8; + } + }, + toX32: function toX32() { + var x64Words = this.words; + var x64WordsLength = x64Words.length; + var x32Words = []; + + for (var i = 0; i < x64WordsLength; i++) { + var x64Word = x64Words[i]; + x32Words.push(x64Word.high); + x32Words.push(x64Word.low); + } + + return X32WordArray.create(x32Words, this.sigBytes); + }, + clone: function clone() { + var clone = Base.clone.call(this); + var words = clone.words = this.words.slice(0); + var wordsLength = words.length; + + for (var i = 0; i < wordsLength; i++) { + words[i] = words[i].clone(); + } + + return clone; + } + }); + })(); + + return CryptoJS; + }); +},606,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + if (typeof ArrayBuffer != 'function') { + return; + } + + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var superInit = WordArray.init; + + var subInit = WordArray.init = function (typedArray) { + if (typedArray instanceof ArrayBuffer) { + typedArray = new Uint8Array(typedArray); + } + + if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) { + typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength); + } + + if (typedArray instanceof Uint8Array) { + var typedArrayByteLength = typedArray.byteLength; + var words = []; + + for (var i = 0; i < typedArrayByteLength; i++) { + words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8; + } + + superInit.call(this, words, typedArrayByteLength); + } else { + superInit.apply(this, arguments); + } + }; + + subInit.prototype = WordArray; + })(); + + return CryptoJS.lib.WordArray; + }); +},607,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = { + stringify: function stringify(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var utf16Chars = []; + + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff; + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + parse: function parse(utf16Str) { + var utf16StrLength = utf16Str.length; + var words = []; + + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16; + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + C_enc.Utf16LE = { + stringify: function stringify(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var utf16Chars = []; + + for (var i = 0; i < sigBytes; i += 2) { + var codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 0xffff); + utf16Chars.push(String.fromCharCode(codePoint)); + } + + return utf16Chars.join(''); + }, + parse: function parse(utf16Str) { + var utf16StrLength = utf16Str.length; + var words = []; + + for (var i = 0; i < utf16StrLength; i++) { + words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16); + } + + return WordArray.create(words, utf16StrLength * 2); + } + }; + + function swapEndian(word) { + return word << 8 & 0xff00ff00 | word >>> 8 & 0x00ff00ff; + } + })(); + + return CryptoJS.enc.Utf16; + }); +},608,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_enc = C.enc; + var Base64 = C_enc.Base64 = { + stringify: function stringify(wordArray) { + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + var map = this._map; + wordArray.clamp(); + var base64Chars = []; + + for (var i = 0; i < sigBytes; i += 3) { + var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff; + var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 0xff; + var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 0xff; + var triplet = byte1 << 16 | byte2 << 8 | byte3; + + for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) { + base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 0x3f)); + } + } + + var paddingChar = map.charAt(64); + + if (paddingChar) { + while (base64Chars.length % 4) { + base64Chars.push(paddingChar); + } + } + + return base64Chars.join(''); + }, + parse: function parse(base64Str) { + var base64StrLength = base64Str.length; + var map = this._map; + var reverseMap = this._reverseMap; + + if (!reverseMap) { + reverseMap = this._reverseMap = []; + + for (var j = 0; j < map.length; j++) { + reverseMap[map.charCodeAt(j)] = j; + } + } + + var paddingChar = map.charAt(64); + + if (paddingChar) { + var paddingIndex = base64Str.indexOf(paddingChar); + + if (paddingIndex !== -1) { + base64StrLength = paddingIndex; + } + } + + return parseLoop(base64Str, base64StrLength, reverseMap); + }, + _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=' + }; + + function parseLoop(base64Str, base64StrLength, reverseMap) { + var words = []; + var nBytes = 0; + + for (var i = 0; i < base64StrLength; i++) { + if (i % 4) { + var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2; + var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2; + words[nBytes >>> 2] |= (bits1 | bits2) << 24 - nBytes % 4 * 8; + nBytes++; + } + } + + return WordArray.create(words, nBytes); + } + })(); + + return CryptoJS.enc.Base64; + }); +},609,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function (Math) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + var T = []; + + (function () { + for (var i = 0; i < 64; i++) { + T[i] = Math.abs(Math.sin(i + 1)) * 0x100000000 | 0; + } + })(); + + var MD5 = C_algo.MD5 = Hasher.extend({ + _doReset: function _doReset() { + this._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]); + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + for (var i = 0; i < 16; i++) { + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00; + } + + var H = this._hash.words; + var M_offset_0 = M[offset + 0]; + var M_offset_1 = M[offset + 1]; + var M_offset_2 = M[offset + 2]; + var M_offset_3 = M[offset + 3]; + var M_offset_4 = M[offset + 4]; + var M_offset_5 = M[offset + 5]; + var M_offset_6 = M[offset + 6]; + var M_offset_7 = M[offset + 7]; + var M_offset_8 = M[offset + 8]; + var M_offset_9 = M[offset + 9]; + var M_offset_10 = M[offset + 10]; + var M_offset_11 = M[offset + 11]; + var M_offset_12 = M[offset + 12]; + var M_offset_13 = M[offset + 13]; + var M_offset_14 = M[offset + 14]; + var M_offset_15 = M[offset + 15]; + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + a = FF(a, b, c, d, M_offset_0, 7, T[0]); + d = FF(d, a, b, c, M_offset_1, 12, T[1]); + c = FF(c, d, a, b, M_offset_2, 17, T[2]); + b = FF(b, c, d, a, M_offset_3, 22, T[3]); + a = FF(a, b, c, d, M_offset_4, 7, T[4]); + d = FF(d, a, b, c, M_offset_5, 12, T[5]); + c = FF(c, d, a, b, M_offset_6, 17, T[6]); + b = FF(b, c, d, a, M_offset_7, 22, T[7]); + a = FF(a, b, c, d, M_offset_8, 7, T[8]); + d = FF(d, a, b, c, M_offset_9, 12, T[9]); + c = FF(c, d, a, b, M_offset_10, 17, T[10]); + b = FF(b, c, d, a, M_offset_11, 22, T[11]); + a = FF(a, b, c, d, M_offset_12, 7, T[12]); + d = FF(d, a, b, c, M_offset_13, 12, T[13]); + c = FF(c, d, a, b, M_offset_14, 17, T[14]); + b = FF(b, c, d, a, M_offset_15, 22, T[15]); + a = GG(a, b, c, d, M_offset_1, 5, T[16]); + d = GG(d, a, b, c, M_offset_6, 9, T[17]); + c = GG(c, d, a, b, M_offset_11, 14, T[18]); + b = GG(b, c, d, a, M_offset_0, 20, T[19]); + a = GG(a, b, c, d, M_offset_5, 5, T[20]); + d = GG(d, a, b, c, M_offset_10, 9, T[21]); + c = GG(c, d, a, b, M_offset_15, 14, T[22]); + b = GG(b, c, d, a, M_offset_4, 20, T[23]); + a = GG(a, b, c, d, M_offset_9, 5, T[24]); + d = GG(d, a, b, c, M_offset_14, 9, T[25]); + c = GG(c, d, a, b, M_offset_3, 14, T[26]); + b = GG(b, c, d, a, M_offset_8, 20, T[27]); + a = GG(a, b, c, d, M_offset_13, 5, T[28]); + d = GG(d, a, b, c, M_offset_2, 9, T[29]); + c = GG(c, d, a, b, M_offset_7, 14, T[30]); + b = GG(b, c, d, a, M_offset_12, 20, T[31]); + a = HH(a, b, c, d, M_offset_5, 4, T[32]); + d = HH(d, a, b, c, M_offset_8, 11, T[33]); + c = HH(c, d, a, b, M_offset_11, 16, T[34]); + b = HH(b, c, d, a, M_offset_14, 23, T[35]); + a = HH(a, b, c, d, M_offset_1, 4, T[36]); + d = HH(d, a, b, c, M_offset_4, 11, T[37]); + c = HH(c, d, a, b, M_offset_7, 16, T[38]); + b = HH(b, c, d, a, M_offset_10, 23, T[39]); + a = HH(a, b, c, d, M_offset_13, 4, T[40]); + d = HH(d, a, b, c, M_offset_0, 11, T[41]); + c = HH(c, d, a, b, M_offset_3, 16, T[42]); + b = HH(b, c, d, a, M_offset_6, 23, T[43]); + a = HH(a, b, c, d, M_offset_9, 4, T[44]); + d = HH(d, a, b, c, M_offset_12, 11, T[45]); + c = HH(c, d, a, b, M_offset_15, 16, T[46]); + b = HH(b, c, d, a, M_offset_2, 23, T[47]); + a = II(a, b, c, d, M_offset_0, 6, T[48]); + d = II(d, a, b, c, M_offset_7, 10, T[49]); + c = II(c, d, a, b, M_offset_14, 15, T[50]); + b = II(b, c, d, a, M_offset_5, 21, T[51]); + a = II(a, b, c, d, M_offset_12, 6, T[52]); + d = II(d, a, b, c, M_offset_3, 10, T[53]); + c = II(c, d, a, b, M_offset_10, 15, T[54]); + b = II(b, c, d, a, M_offset_1, 21, T[55]); + a = II(a, b, c, d, M_offset_8, 6, T[56]); + d = II(d, a, b, c, M_offset_15, 10, T[57]); + c = II(c, d, a, b, M_offset_6, 15, T[58]); + b = II(b, c, d, a, M_offset_13, 21, T[59]); + a = II(a, b, c, d, M_offset_4, 6, T[60]); + d = II(d, a, b, c, M_offset_11, 10, T[61]); + c = II(c, d, a, b, M_offset_2, 15, T[62]); + b = II(b, c, d, a, M_offset_9, 21, T[63]); + H[0] = H[0] + a | 0; + H[1] = H[1] + b | 0; + H[2] = H[2] + c | 0; + H[3] = H[3] + d | 0; + }, + _doFinalize: function _doFinalize() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32; + var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000); + var nBitsTotalL = nBitsTotal; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 0x00ff00ff | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 0xff00ff00; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 0x00ff00ff | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 0xff00ff00; + data.sigBytes = (dataWords.length + 1) * 4; + + this._process(); + + var hash = this._hash; + var H = hash.words; + + for (var i = 0; i < 4; i++) { + var H_i = H[i]; + H[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00; + } + + return hash; + }, + clone: function clone() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + + function FF(a, b, c, d, x, s, t) { + var n = a + (b & c | ~b & d) + x + t; + return (n << s | n >>> 32 - s) + b; + } + + function GG(a, b, c, d, x, s, t) { + var n = a + (b & d | c & ~d) + x + t; + return (n << s | n >>> 32 - s) + b; + } + + function HH(a, b, c, d, x, s, t) { + var n = a + (b ^ c ^ d) + x + t; + return (n << s | n >>> 32 - s) + b; + } + + function II(a, b, c, d, x, s, t) { + var n = a + (c ^ (b | ~d)) + x + t; + return (n << s | n >>> 32 - s) + b; + } + + C.MD5 = Hasher._createHelper(MD5); + C.HmacMD5 = Hasher._createHmacHelper(MD5); + })(Math); + + return CryptoJS.MD5; + }); +},610,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + var W = []; + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function _doReset() { + this._hash = new WordArray.init([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]); + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + var H = this._hash.words; + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = n << 1 | n >>> 31; + } + + var t = (a << 5 | a >>> 27) + e + W[i]; + + if (i < 20) { + t += (b & c | ~b & d) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += (b & c | b & d | c & d) - 0x70e44324; + } else { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = b << 30 | b >>> 2; + b = a; + a = t; + } + + H[0] = H[0] + a | 0; + H[1] = H[1] + b | 0; + H[2] = H[2] + c | 0; + H[3] = H[3] + d | 0; + H[4] = H[4] + e | 0; + }, + _doFinalize: function _doFinalize() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + this._process(); + + return this._hash; + }, + clone: function clone() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + C.SHA1 = Hasher._createHelper(SHA1); + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + })(); + + return CryptoJS.SHA1; + }); +},611,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function (Math) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + var H = []; + var K = []; + + (function () { + function isPrime(n) { + var sqrtN = Math.sqrt(n); + + for (var factor = 2; factor <= sqrtN; factor++) { + if (!(n % factor)) { + return false; + } + } + + return true; + } + + function getFractionalBits(n) { + return (n - (n | 0)) * 0x100000000 | 0; + } + + var n = 2; + var nPrime = 0; + + while (nPrime < 64) { + if (isPrime(n)) { + if (nPrime < 8) { + H[nPrime] = getFractionalBits(Math.pow(n, 0.5)); + } + + K[nPrime] = getFractionalBits(Math.pow(n, 0.3333333333333333)); + nPrime++; + } + + n++; + } + })(); + + var W = []; + var SHA256 = C_algo.SHA256 = Hasher.extend({ + _doReset: function _doReset() { + this._hash = new WordArray.init(H.slice(0)); + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + var H = this._hash.words; + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + var f = H[5]; + var g = H[6]; + var h = H[7]; + + for (var i = 0; i < 64; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3; + var gamma1x = W[i - 2]; + var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10; + W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]; + } + + var ch = e & f ^ ~e & g; + var maj = a & b ^ a & c ^ b & c; + var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22); + var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25); + var t1 = h + sigma1 + ch + K[i] + W[i]; + var t2 = sigma0 + maj; + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + + H[0] = H[0] + a | 0; + H[1] = H[1] + b | 0; + H[2] = H[2] + c | 0; + H[3] = H[3] + d | 0; + H[4] = H[4] + e | 0; + H[5] = H[5] + f | 0; + H[6] = H[6] + g | 0; + H[7] = H[7] + h | 0; + }, + _doFinalize: function _doFinalize() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + this._process(); + + return this._hash; + }, + clone: function clone() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + C.SHA256 = Hasher._createHelper(SHA256); + C.HmacSHA256 = Hasher._createHmacHelper(SHA256); + })(Math); + + return CryptoJS.SHA256; + }); +},612,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./sha256"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA256 = C_algo.SHA256; + var SHA224 = C_algo.SHA224 = SHA256.extend({ + _doReset: function _doReset() { + this._hash = new WordArray.init([0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4]); + }, + _doFinalize: function _doFinalize() { + var hash = SHA256._doFinalize.call(this); + + hash.sigBytes -= 4; + return hash; + } + }); + C.SHA224 = SHA256._createHelper(SHA224); + C.HmacSHA224 = SHA256._createHmacHelper(SHA224); + })(); + + return CryptoJS.SHA224; + }); +},613,[605,612]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + + function X64Word_create() { + return X64Word.create.apply(X64Word, arguments); + } + + var K = [X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd), X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc), X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019), X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118), X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe), X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2), X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1), X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694), X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3), X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65), X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483), X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5), X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210), X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4), X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725), X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70), X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926), X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df), X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8), X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b), X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001), X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30), X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910), X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8), X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53), X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8), X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb), X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3), X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60), X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec), X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9), X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b), X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207), X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178), X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6), X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b), X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493), X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c), X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a), X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)]; + var W = []; + + (function () { + for (var i = 0; i < 80; i++) { + W[i] = X64Word_create(); + } + })(); + + var SHA512 = C_algo.SHA512 = Hasher.extend({ + _doReset: function _doReset() { + this._hash = new X64WordArray.init([new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b), new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1), new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f), new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)]); + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + var H = this._hash.words; + var H0 = H[0]; + var H1 = H[1]; + var H2 = H[2]; + var H3 = H[3]; + var H4 = H[4]; + var H5 = H[5]; + var H6 = H[6]; + var H7 = H[7]; + var H0h = H0.high; + var H0l = H0.low; + var H1h = H1.high; + var H1l = H1.low; + var H2h = H2.high; + var H2l = H2.low; + var H3h = H3.high; + var H3l = H3.low; + var H4h = H4.high; + var H4l = H4.low; + var H5h = H5.high; + var H5l = H5.low; + var H6h = H6.high; + var H6l = H6.low; + var H7h = H7.high; + var H7l = H7.low; + var ah = H0h; + var al = H0l; + var bh = H1h; + var bl = H1l; + var ch = H2h; + var cl = H2l; + var dh = H3h; + var dl = H3l; + var eh = H4h; + var el = H4l; + var fh = H5h; + var fl = H5l; + var gh = H6h; + var gl = H6l; + var hh = H7h; + var hl = H7l; + + for (var i = 0; i < 80; i++) { + var Wi = W[i]; + + if (i < 16) { + var Wih = Wi.high = M[offset + i * 2] | 0; + var Wil = Wi.low = M[offset + i * 2 + 1] | 0; + } else { + var gamma0x = W[i - 15]; + var gamma0xh = gamma0x.high; + var gamma0xl = gamma0x.low; + var gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7; + var gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25); + var gamma1x = W[i - 2]; + var gamma1xh = gamma1x.high; + var gamma1xl = gamma1x.low; + var gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6; + var gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26); + var Wi7 = W[i - 7]; + var Wi7h = Wi7.high; + var Wi7l = Wi7.low; + var Wi16 = W[i - 16]; + var Wi16h = Wi16.high; + var Wi16l = Wi16.low; + var Wil = gamma0l + Wi7l; + var Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0); + var Wil = Wil + gamma1l; + var Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0); + var Wil = Wil + Wi16l; + var Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0); + Wi.high = Wih; + Wi.low = Wil; + } + + var chh = eh & fh ^ ~eh & gh; + var chl = el & fl ^ ~el & gl; + var majh = ah & bh ^ ah & ch ^ bh & ch; + var majl = al & bl ^ al & cl ^ bl & cl; + var sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7); + var sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7); + var sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9); + var sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9); + var Ki = K[i]; + var Kih = Ki.high; + var Kil = Ki.low; + var t1l = hl + sigma1l; + var t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0); + var t1l = t1l + chl; + var t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0); + var t1l = t1l + Kil; + var t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0); + var t1l = t1l + Wil; + var t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0); + var t2l = sigma0l + majl; + var t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0); + hh = gh; + hl = gl; + gh = fh; + gl = fl; + fh = eh; + fl = el; + el = dl + t1l | 0; + eh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; + dh = ch; + dl = cl; + ch = bh; + cl = bl; + bh = ah; + bl = al; + al = t1l + t2l | 0; + ah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0; + } + + H0l = H0.low = H0l + al; + H0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0); + H1l = H1.low = H1l + bl; + H1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0); + H2l = H2.low = H2l + cl; + H2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0); + H3l = H3.low = H3l + dl; + H3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0); + H4l = H4.low = H4l + el; + H4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0); + H5l = H5.low = H5l + fl; + H5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0); + H6l = H6.low = H6l + gl; + H6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0); + H7l = H7.low = H7l + hl; + H7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0); + }, + _doFinalize: function _doFinalize() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + this._process(); + + var hash = this._hash.toX32(); + + return hash; + }, + clone: function clone() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + }, + blockSize: 32 + }); + C.SHA512 = Hasher._createHelper(SHA512); + C.HmacSHA512 = Hasher._createHmacHelper(SHA512); + })(); + + return CryptoJS.SHA512; + }); +},614,[605,606]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core", "./sha512"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var X64WordArray = C_x64.WordArray; + var C_algo = C.algo; + var SHA512 = C_algo.SHA512; + var SHA384 = C_algo.SHA384 = SHA512.extend({ + _doReset: function _doReset() { + this._hash = new X64WordArray.init([new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507), new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939), new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511), new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)]); + }, + _doFinalize: function _doFinalize() { + var hash = SHA512._doFinalize.call(this); + + hash.sigBytes -= 16; + return hash; + } + }); + C.SHA384 = SHA512._createHelper(SHA384); + C.HmacSHA384 = SHA512._createHmacHelper(SHA384); + })(); + + return CryptoJS.SHA384; + }); +},615,[605,606,614]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./x64-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function (Math) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_x64 = C.x64; + var X64Word = C_x64.Word; + var C_algo = C.algo; + var RHO_OFFSETS = []; + var PI_INDEXES = []; + var ROUND_CONSTANTS = []; + + (function () { + var x = 1, + y = 0; + + for (var t = 0; t < 24; t++) { + RHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64; + var newX = y % 5; + var newY = (2 * x + 3 * y) % 5; + x = newX; + y = newY; + } + + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + PI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5; + } + } + + var LFSR = 0x01; + + for (var i = 0; i < 24; i++) { + var roundConstantMsw = 0; + var roundConstantLsw = 0; + + for (var j = 0; j < 7; j++) { + if (LFSR & 0x01) { + var bitPosition = (1 << j) - 1; + + if (bitPosition < 32) { + roundConstantLsw ^= 1 << bitPosition; + } else { + roundConstantMsw ^= 1 << bitPosition - 32; + } + } + + if (LFSR & 0x80) { + LFSR = LFSR << 1 ^ 0x71; + } else { + LFSR <<= 1; + } + } + + ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw); + } + })(); + + var T = []; + + (function () { + for (var i = 0; i < 25; i++) { + T[i] = X64Word.create(); + } + })(); + + var SHA3 = C_algo.SHA3 = Hasher.extend({ + cfg: Hasher.cfg.extend({ + outputLength: 512 + }), + _doReset: function _doReset() { + var state = this._state = []; + + for (var i = 0; i < 25; i++) { + state[i] = new X64Word.init(); + } + + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32; + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + var state = this._state; + var nBlockSizeLanes = this.blockSize / 2; + + for (var i = 0; i < nBlockSizeLanes; i++) { + var M2i = M[offset + 2 * i]; + var M2i1 = M[offset + 2 * i + 1]; + M2i = (M2i << 8 | M2i >>> 24) & 0x00ff00ff | (M2i << 24 | M2i >>> 8) & 0xff00ff00; + M2i1 = (M2i1 << 8 | M2i1 >>> 24) & 0x00ff00ff | (M2i1 << 24 | M2i1 >>> 8) & 0xff00ff00; + var lane = state[i]; + lane.high ^= M2i1; + lane.low ^= M2i; + } + + for (var round = 0; round < 24; round++) { + for (var x = 0; x < 5; x++) { + var tMsw = 0, + tLsw = 0; + + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + tMsw ^= lane.high; + tLsw ^= lane.low; + } + + var Tx = T[x]; + Tx.high = tMsw; + Tx.low = tLsw; + } + + for (var x = 0; x < 5; x++) { + var Tx4 = T[(x + 4) % 5]; + var Tx1 = T[(x + 1) % 5]; + var Tx1Msw = Tx1.high; + var Tx1Lsw = Tx1.low; + var tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31); + var tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31); + + for (var y = 0; y < 5; y++) { + var lane = state[x + 5 * y]; + lane.high ^= tMsw; + lane.low ^= tLsw; + } + } + + for (var laneIndex = 1; laneIndex < 25; laneIndex++) { + var lane = state[laneIndex]; + var laneMsw = lane.high; + var laneLsw = lane.low; + var rhoOffset = RHO_OFFSETS[laneIndex]; + + if (rhoOffset < 32) { + var tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset; + var tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset; + } else { + var tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset; + var tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset; + } + + var TPiLane = T[PI_INDEXES[laneIndex]]; + TPiLane.high = tMsw; + TPiLane.low = tLsw; + } + + var T0 = T[0]; + var state0 = state[0]; + T0.high = state0.high; + T0.low = state0.low; + + for (var x = 0; x < 5; x++) { + for (var y = 0; y < 5; y++) { + var laneIndex = x + 5 * y; + var lane = state[laneIndex]; + var TLane = T[laneIndex]; + var Tx1Lane = T[(x + 1) % 5 + 5 * y]; + var Tx2Lane = T[(x + 2) % 5 + 5 * y]; + lane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high; + lane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low; + } + } + + var lane = state[0]; + var roundConstant = ROUND_CONSTANTS[round]; + lane.high ^= roundConstant.high; + lane.low ^= roundConstant.low; + ; + } + }, + _doFinalize: function _doFinalize() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + var blockSizeBits = this.blockSize * 32; + dataWords[nBitsLeft >>> 5] |= 0x1 << 24 - nBitsLeft % 32; + dataWords[(Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 0x80; + data.sigBytes = dataWords.length * 4; + + this._process(); + + var state = this._state; + var outputLengthBytes = this.cfg.outputLength / 8; + var outputLengthLanes = outputLengthBytes / 8; + var hashWords = []; + + for (var i = 0; i < outputLengthLanes; i++) { + var lane = state[i]; + var laneMsw = lane.high; + var laneLsw = lane.low; + laneMsw = (laneMsw << 8 | laneMsw >>> 24) & 0x00ff00ff | (laneMsw << 24 | laneMsw >>> 8) & 0xff00ff00; + laneLsw = (laneLsw << 8 | laneLsw >>> 24) & 0x00ff00ff | (laneLsw << 24 | laneLsw >>> 8) & 0xff00ff00; + hashWords.push(laneLsw); + hashWords.push(laneMsw); + } + + return new WordArray.init(hashWords, outputLengthBytes); + }, + clone: function clone() { + var clone = Hasher.clone.call(this); + + var state = clone._state = this._state.slice(0); + + for (var i = 0; i < 25; i++) { + state[i] = state[i].clone(); + } + + return clone; + } + }); + C.SHA3 = Hasher._createHelper(SHA3); + C.HmacSHA3 = Hasher._createHmacHelper(SHA3); + })(Math); + + return CryptoJS.SHA3; + }); +},616,[605,606]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + /** @preserve + (c) 2012 by Cédric Mesnil. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + (function (Math) { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + var _zl = WordArray.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]); + + var _zr = WordArray.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]); + + var _sl = WordArray.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]); + + var _sr = WordArray.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]); + + var _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]); + + var _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]); + + var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({ + _doReset: function _doReset() { + this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]); + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + for (var i = 0; i < 16; i++) { + var offset_i = offset + i; + var M_offset_i = M[offset_i]; + M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 0x00ff00ff | (M_offset_i << 24 | M_offset_i >>> 8) & 0xff00ff00; + } + + var H = this._hash.words; + var hl = _hl.words; + var hr = _hr.words; + var zl = _zl.words; + var zr = _zr.words; + var sl = _sl.words; + var sr = _sr.words; + var al, bl, cl, dl, el; + var ar, br, cr, dr, er; + ar = al = H[0]; + br = bl = H[1]; + cr = cl = H[2]; + dr = dl = H[3]; + er = el = H[4]; + var t; + + for (var i = 0; i < 80; i += 1) { + t = al + M[offset + zl[i]] | 0; + + if (i < 16) { + t += f1(bl, cl, dl) + hl[0]; + } else if (i < 32) { + t += f2(bl, cl, dl) + hl[1]; + } else if (i < 48) { + t += f3(bl, cl, dl) + hl[2]; + } else if (i < 64) { + t += f4(bl, cl, dl) + hl[3]; + } else { + t += f5(bl, cl, dl) + hl[4]; + } + + t = t | 0; + t = rotl(t, sl[i]); + t = t + el | 0; + al = el; + el = dl; + dl = rotl(cl, 10); + cl = bl; + bl = t; + t = ar + M[offset + zr[i]] | 0; + + if (i < 16) { + t += f5(br, cr, dr) + hr[0]; + } else if (i < 32) { + t += f4(br, cr, dr) + hr[1]; + } else if (i < 48) { + t += f3(br, cr, dr) + hr[2]; + } else if (i < 64) { + t += f2(br, cr, dr) + hr[3]; + } else { + t += f1(br, cr, dr) + hr[4]; + } + + t = t | 0; + t = rotl(t, sr[i]); + t = t + er | 0; + ar = er; + er = dr; + dr = rotl(cr, 10); + cr = br; + br = t; + } + + t = H[1] + cl + dr | 0; + H[1] = H[2] + dl + er | 0; + H[2] = H[3] + el + ar | 0; + H[3] = H[4] + al + br | 0; + H[4] = H[0] + bl + cr | 0; + H[0] = t; + }, + _doFinalize: function _doFinalize() { + var data = this._data; + var dataWords = data.words; + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + dataWords[nBitsLeft >>> 5] |= 0x80 << 24 - nBitsLeft % 32; + dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 0x00ff00ff | (nBitsTotal << 24 | nBitsTotal >>> 8) & 0xff00ff00; + data.sigBytes = (dataWords.length + 1) * 4; + + this._process(); + + var hash = this._hash; + var H = hash.words; + + for (var i = 0; i < 5; i++) { + var H_i = H[i]; + H[i] = (H_i << 8 | H_i >>> 24) & 0x00ff00ff | (H_i << 24 | H_i >>> 8) & 0xff00ff00; + } + + return hash; + }, + clone: function clone() { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + return clone; + } + }); + + function f1(x, y, z) { + return x ^ y ^ z; + } + + function f2(x, y, z) { + return x & y | ~x & z; + } + + function f3(x, y, z) { + return (x | ~y) ^ z; + } + + function f4(x, y, z) { + return x & z | y & ~z; + } + + function f5(x, y, z) { + return x ^ (y | ~z); + } + + function rotl(x, n) { + return x << n | x >>> 32 - n; + } + + C.RIPEMD160 = Hasher._createHelper(RIPEMD160); + C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160); + })(Math); + + return CryptoJS.RIPEMD160; + }); +},617,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0])); + } else if (typeof define === "function" && define.amd) { + define(["./core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + var HMAC = C_algo.HMAC = Base.extend({ + init: function init(hasher, key) { + hasher = this._hasher = new hasher.init(); + + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + key.clamp(); + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + this.reset(); + }, + reset: function reset() { + var hasher = this._hasher; + hasher.reset(); + hasher.update(this._iKey); + }, + update: function update(messageUpdate) { + this._hasher.update(messageUpdate); + + return this; + }, + finalize: function finalize(messageUpdate) { + var hasher = this._hasher; + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + return hmac; + } + }); + })(); + }); +},618,[605]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./sha1", "./hmac"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var SHA1 = C_algo.SHA1; + var HMAC = C_algo.HMAC; + var PBKDF2 = C_algo.PBKDF2 = Base.extend({ + cfg: Base.extend({ + keySize: 4, + hasher: SHA1, + iterations: 1 + }), + init: function init(cfg) { + this.cfg = this.cfg.extend(cfg); + }, + compute: function compute(password, salt) { + var cfg = this.cfg; + var hmac = HMAC.create(cfg.hasher, password); + var derivedKey = WordArray.create(); + var blockIndex = WordArray.create([0x00000001]); + var derivedKeyWords = derivedKey.words; + var blockIndexWords = blockIndex.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + while (derivedKeyWords.length < keySize) { + var block = hmac.update(salt).finalize(blockIndex); + hmac.reset(); + var blockWords = block.words; + var blockWordsLength = blockWords.length; + var intermediate = block; + + for (var i = 1; i < iterations; i++) { + intermediate = hmac.finalize(intermediate); + hmac.reset(); + var intermediateWords = intermediate.words; + + for (var j = 0; j < blockWordsLength; j++) { + blockWords[j] ^= intermediateWords[j]; + } + } + + derivedKey.concat(block); + blockIndexWords[0]++; + } + + derivedKey.sigBytes = keySize * 4; + return derivedKey; + } + }); + + C.PBKDF2 = function (password, salt, cfg) { + return PBKDF2.create(cfg).compute(password, salt); + }; + })(); + + return CryptoJS.PBKDF2; + }); +},619,[605,611,618]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./sha1", "./hmac"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var C_algo = C.algo; + var MD5 = C_algo.MD5; + var EvpKDF = C_algo.EvpKDF = Base.extend({ + cfg: Base.extend({ + keySize: 4, + hasher: MD5, + iterations: 1 + }), + init: function init(cfg) { + this.cfg = this.cfg.extend(cfg); + }, + compute: function compute(password, salt) { + var cfg = this.cfg; + var hasher = cfg.hasher.create(); + var derivedKey = WordArray.create(); + var derivedKeyWords = derivedKey.words; + var keySize = cfg.keySize; + var iterations = cfg.iterations; + + while (derivedKeyWords.length < keySize) { + if (block) { + hasher.update(block); + } + + var block = hasher.update(password).finalize(salt); + hasher.reset(); + + for (var i = 1; i < iterations; i++) { + block = hasher.finalize(block); + hasher.reset(); + } + + derivedKey.concat(block); + } + + derivedKey.sigBytes = keySize * 4; + return derivedKey; + } + }); + + C.EvpKDF = function (password, salt, cfg) { + return EvpKDF.create(cfg).compute(password, salt); + }; + })(); + + return CryptoJS.EvpKDF; + }); +},620,[605,611,618]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./evpkdf"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.lib.Cipher || function (undefined) { + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var WordArray = C_lib.WordArray; + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var Base64 = C_enc.Base64; + var C_algo = C.algo; + var EvpKDF = C_algo.EvpKDF; + var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({ + cfg: Base.extend(), + createEncryptor: function createEncryptor(key, cfg) { + return this.create(this._ENC_XFORM_MODE, key, cfg); + }, + createDecryptor: function createDecryptor(key, cfg) { + return this.create(this._DEC_XFORM_MODE, key, cfg); + }, + init: function init(xformMode, key, cfg) { + this.cfg = this.cfg.extend(cfg); + this._xformMode = xformMode; + this._key = key; + this.reset(); + }, + reset: function reset() { + BufferedBlockAlgorithm.reset.call(this); + + this._doReset(); + }, + process: function process(dataUpdate) { + this._append(dataUpdate); + + return this._process(); + }, + finalize: function finalize(dataUpdate) { + if (dataUpdate) { + this._append(dataUpdate); + } + + var finalProcessedData = this._doFinalize(); + + return finalProcessedData; + }, + keySize: 4, + ivSize: 4, + _ENC_XFORM_MODE: 1, + _DEC_XFORM_MODE: 2, + _createHelper: function () { + function selectCipherStrategy(key) { + if (typeof key == 'string') { + return PasswordBasedCipher; + } else { + return SerializableCipher; + } + } + + return function (cipher) { + return { + encrypt: function encrypt(message, key, cfg) { + return selectCipherStrategy(key).encrypt(cipher, message, key, cfg); + }, + decrypt: function decrypt(ciphertext, key, cfg) { + return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg); + } + }; + }; + }() + }); + var StreamCipher = C_lib.StreamCipher = Cipher.extend({ + _doFinalize: function _doFinalize() { + var finalProcessedBlocks = this._process(true); + + return finalProcessedBlocks; + }, + blockSize: 1 + }); + var C_mode = C.mode = {}; + var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({ + createEncryptor: function createEncryptor(cipher, iv) { + return this.Encryptor.create(cipher, iv); + }, + createDecryptor: function createDecryptor(cipher, iv) { + return this.Decryptor.create(cipher, iv); + }, + init: function init(cipher, iv) { + this._cipher = cipher; + this._iv = iv; + } + }); + + var CBC = C_mode.CBC = function () { + var CBC = BlockCipherMode.extend(); + CBC.Encryptor = CBC.extend({ + processBlock: function processBlock(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + xorBlock.call(this, words, offset, blockSize); + cipher.encryptBlock(words, offset); + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + CBC.Decryptor = CBC.extend({ + processBlock: function processBlock(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var thisBlock = words.slice(offset, offset + blockSize); + cipher.decryptBlock(words, offset); + xorBlock.call(this, words, offset, blockSize); + this._prevBlock = thisBlock; + } + }); + + function xorBlock(words, offset, blockSize) { + var iv = this._iv; + + if (iv) { + var block = iv; + this._iv = undefined; + } else { + var block = this._prevBlock; + } + + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= block[i]; + } + } + + return CBC; + }(); + + var C_pad = C.pad = {}; + var Pkcs7 = C_pad.Pkcs7 = { + pad: function pad(data, blockSize) { + var blockSizeBytes = blockSize * 4; + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + var paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes; + var paddingWords = []; + + for (var i = 0; i < nPaddingBytes; i += 4) { + paddingWords.push(paddingWord); + } + + var padding = WordArray.create(paddingWords, nPaddingBytes); + data.concat(padding); + }, + unpad: function unpad(data) { + var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff; + data.sigBytes -= nPaddingBytes; + } + }; + var BlockCipher = C_lib.BlockCipher = Cipher.extend({ + cfg: Cipher.cfg.extend({ + mode: CBC, + padding: Pkcs7 + }), + reset: function reset() { + Cipher.reset.call(this); + var cfg = this.cfg; + var iv = cfg.iv; + var mode = cfg.mode; + + if (this._xformMode == this._ENC_XFORM_MODE) { + var modeCreator = mode.createEncryptor; + } else { + var modeCreator = mode.createDecryptor; + this._minBufferSize = 1; + } + + if (this._mode && this._mode.__creator == modeCreator) { + this._mode.init(this, iv && iv.words); + } else { + this._mode = modeCreator.call(mode, this, iv && iv.words); + this._mode.__creator = modeCreator; + } + }, + _doProcessBlock: function _doProcessBlock(words, offset) { + this._mode.processBlock(words, offset); + }, + _doFinalize: function _doFinalize() { + var padding = this.cfg.padding; + + if (this._xformMode == this._ENC_XFORM_MODE) { + padding.pad(this._data, this.blockSize); + + var finalProcessedBlocks = this._process(true); + } else { + var finalProcessedBlocks = this._process(true); + + padding.unpad(finalProcessedBlocks); + } + + return finalProcessedBlocks; + }, + blockSize: 4 + }); + var CipherParams = C_lib.CipherParams = Base.extend({ + init: function init(cipherParams) { + this.mixIn(cipherParams); + }, + toString: function toString(formatter) { + return (formatter || this.formatter).stringify(this); + } + }); + var C_format = C.format = {}; + var OpenSSLFormatter = C_format.OpenSSL = { + stringify: function stringify(cipherParams) { + var ciphertext = cipherParams.ciphertext; + var salt = cipherParams.salt; + + if (salt) { + var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext); + } else { + var wordArray = ciphertext; + } + + return wordArray.toString(Base64); + }, + parse: function parse(openSSLStr) { + var ciphertext = Base64.parse(openSSLStr); + var ciphertextWords = ciphertext.words; + + if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) { + var salt = WordArray.create(ciphertextWords.slice(2, 4)); + ciphertextWords.splice(0, 4); + ciphertext.sigBytes -= 16; + } + + return CipherParams.create({ + ciphertext: ciphertext, + salt: salt + }); + } + }; + var SerializableCipher = C_lib.SerializableCipher = Base.extend({ + cfg: Base.extend({ + format: OpenSSLFormatter + }), + encrypt: function encrypt(cipher, message, key, cfg) { + cfg = this.cfg.extend(cfg); + var encryptor = cipher.createEncryptor(key, cfg); + var ciphertext = encryptor.finalize(message); + var cipherCfg = encryptor.cfg; + return CipherParams.create({ + ciphertext: ciphertext, + key: key, + iv: cipherCfg.iv, + algorithm: cipher, + mode: cipherCfg.mode, + padding: cipherCfg.padding, + blockSize: cipher.blockSize, + formatter: cfg.format + }); + }, + decrypt: function decrypt(cipher, ciphertext, key, cfg) { + cfg = this.cfg.extend(cfg); + ciphertext = this._parse(ciphertext, cfg.format); + var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext); + return plaintext; + }, + _parse: function _parse(ciphertext, format) { + if (typeof ciphertext == 'string') { + return format.parse(ciphertext, this); + } else { + return ciphertext; + } + } + }); + var C_kdf = C.kdf = {}; + var OpenSSLKdf = C_kdf.OpenSSL = { + execute: function execute(password, keySize, ivSize, salt) { + if (!salt) { + salt = WordArray.random(8); + } + + var key = EvpKDF.create({ + keySize: keySize + ivSize + }).compute(password, salt); + var iv = WordArray.create(key.words.slice(keySize), ivSize * 4); + key.sigBytes = keySize * 4; + return CipherParams.create({ + key: key, + iv: iv, + salt: salt + }); + } + }; + var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({ + cfg: SerializableCipher.cfg.extend({ + kdf: OpenSSLKdf + }), + encrypt: function encrypt(cipher, message, password, cfg) { + cfg = this.cfg.extend(cfg); + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize); + cfg.iv = derivedParams.iv; + var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg); + ciphertext.mixIn(derivedParams); + return ciphertext; + }, + decrypt: function decrypt(cipher, ciphertext, password, cfg) { + cfg = this.cfg.extend(cfg); + ciphertext = this._parse(ciphertext, cfg.format); + var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt); + cfg.iv = derivedParams.iv; + var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg); + return plaintext; + } + }); + }(); + }); +},621,[605,620]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.mode.CFB = function () { + var CFB = CryptoJS.lib.BlockCipherMode.extend(); + CFB.Encryptor = CFB.extend({ + processBlock: function processBlock(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + this._prevBlock = words.slice(offset, offset + blockSize); + } + }); + CFB.Decryptor = CFB.extend({ + processBlock: function processBlock(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var thisBlock = words.slice(offset, offset + blockSize); + generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher); + this._prevBlock = thisBlock; + } + }); + + function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) { + var iv = this._iv; + + if (iv) { + var keystream = iv.slice(0); + this._iv = undefined; + } else { + var keystream = this._prevBlock; + } + + cipher.encryptBlock(keystream, 0); + + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + + return CFB; + }(); + + return CryptoJS.mode.CFB; + }); +},622,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.mode.CTR = function () { + var CTR = CryptoJS.lib.BlockCipherMode.extend(); + var Encryptor = CTR.Encryptor = CTR.extend({ + processBlock: function processBlock(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + if (iv) { + counter = this._counter = iv.slice(0); + this._iv = undefined; + } + + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0; + + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + CTR.Decryptor = Encryptor; + return CTR; + }(); + + return CryptoJS.mode.CTR; + }); +},623,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + /** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ + CryptoJS.mode.CTRGladman = function () { + var CTRGladman = CryptoJS.lib.BlockCipherMode.extend(); + + function incWord(word) { + if ((word >> 24 & 0xff) === 0xff) { + var b1 = word >> 16 & 0xff; + var b2 = word >> 8 & 0xff; + var b3 = word & 0xff; + + if (b1 === 0xff) { + b1 = 0; + + if (b2 === 0xff) { + b2 = 0; + + if (b3 === 0xff) { + b3 = 0; + } else { + ++b3; + } + } else { + ++b2; + } + } else { + ++b1; + } + + word = 0; + word += b1 << 16; + word += b2 << 8; + word += b3; + } else { + word += 16777216; + } + + return word; + } + + function incCounter(counter) { + if ((counter[0] = incWord(counter[0])) === 0) { + counter[1] = incWord(counter[1]); + } + + return counter; + } + + var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({ + processBlock: function processBlock(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var iv = this._iv; + var counter = this._counter; + + if (iv) { + counter = this._counter = iv.slice(0); + this._iv = undefined; + } + + incCounter(counter); + var keystream = counter.slice(0); + cipher.encryptBlock(keystream, 0); + + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + CTRGladman.Decryptor = Encryptor; + return CTRGladman; + }(); + + return CryptoJS.mode.CTRGladman; + }); +},624,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.mode.OFB = function () { + var OFB = CryptoJS.lib.BlockCipherMode.extend(); + var Encryptor = OFB.Encryptor = OFB.extend({ + processBlock: function processBlock(words, offset) { + var cipher = this._cipher; + var blockSize = cipher.blockSize; + var iv = this._iv; + var keystream = this._keystream; + + if (iv) { + keystream = this._keystream = iv.slice(0); + this._iv = undefined; + } + + cipher.encryptBlock(keystream, 0); + + for (var i = 0; i < blockSize; i++) { + words[offset + i] ^= keystream[i]; + } + } + }); + OFB.Decryptor = Encryptor; + return OFB; + }(); + + return CryptoJS.mode.OFB; + }); +},625,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.mode.ECB = function () { + var ECB = CryptoJS.lib.BlockCipherMode.extend(); + ECB.Encryptor = ECB.extend({ + processBlock: function processBlock(words, offset) { + this._cipher.encryptBlock(words, offset); + } + }); + ECB.Decryptor = ECB.extend({ + processBlock: function processBlock(words, offset) { + this._cipher.decryptBlock(words, offset); + } + }); + return ECB; + }(); + + return CryptoJS.mode.ECB; + }); +},626,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.pad.AnsiX923 = { + pad: function pad(data, blockSize) { + var dataSigBytes = data.sigBytes; + var blockSizeBytes = blockSize * 4; + var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes; + var lastBytePos = dataSigBytes + nPaddingBytes - 1; + data.clamp(); + data.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8; + data.sigBytes += nPaddingBytes; + }, + unpad: function unpad(data) { + var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff; + data.sigBytes -= nPaddingBytes; + } + }; + return CryptoJS.pad.Ansix923; + }); +},627,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.pad.Iso10126 = { + pad: function pad(data, blockSize) { + var blockSizeBytes = blockSize * 4; + var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes; + data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1)); + }, + unpad: function unpad(data) { + var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 0xff; + data.sigBytes -= nPaddingBytes; + } + }; + return CryptoJS.pad.Iso10126; + }); +},628,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.pad.Iso97971 = { + pad: function pad(data, blockSize) { + data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1)); + CryptoJS.pad.ZeroPadding.pad(data, blockSize); + }, + unpad: function unpad(data) { + CryptoJS.pad.ZeroPadding.unpad(data); + data.sigBytes--; + } + }; + return CryptoJS.pad.Iso97971; + }); +},629,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.pad.ZeroPadding = { + pad: function pad(data, blockSize) { + var blockSizeBytes = blockSize * 4; + data.clamp(); + data.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes); + }, + unpad: function unpad(data) { + var dataWords = data.words; + var i = data.sigBytes - 1; + + while (!(dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 0xff)) { + i--; + } + + data.sigBytes = i + 1; + } + }; + return CryptoJS.pad.ZeroPadding; + }); +},630,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + CryptoJS.pad.NoPadding = { + pad: function pad() {}, + unpad: function unpad() {} + }; + return CryptoJS.pad.NoPadding; + }); +},631,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function (undefined) { + var C = CryptoJS; + var C_lib = C.lib; + var CipherParams = C_lib.CipherParams; + var C_enc = C.enc; + var Hex = C_enc.Hex; + var C_format = C.format; + var HexFormatter = C_format.Hex = { + stringify: function stringify(cipherParams) { + return cipherParams.ciphertext.toString(Hex); + }, + parse: function parse(input) { + var ciphertext = Hex.parse(input); + return CipherParams.create({ + ciphertext: ciphertext + }); + } + }; + })(); + + return CryptoJS.format.Hex; + }); +},632,[605,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), _$$_REQUIRE(_dependencyMap[4])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + var SBOX = []; + var INV_SBOX = []; + var SUB_MIX_0 = []; + var SUB_MIX_1 = []; + var SUB_MIX_2 = []; + var SUB_MIX_3 = []; + var INV_SUB_MIX_0 = []; + var INV_SUB_MIX_1 = []; + var INV_SUB_MIX_2 = []; + var INV_SUB_MIX_3 = []; + + (function () { + var d = []; + + for (var i = 0; i < 256; i++) { + if (i < 128) { + d[i] = i << 1; + } else { + d[i] = i << 1 ^ 0x11b; + } + } + + var x = 0; + var xi = 0; + + for (var i = 0; i < 256; i++) { + var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4; + sx = sx >>> 8 ^ sx & 0xff ^ 0x63; + SBOX[x] = sx; + INV_SBOX[sx] = x; + var x2 = d[x]; + var x4 = d[x2]; + var x8 = d[x4]; + var t = d[sx] * 0x101 ^ sx * 0x1010100; + SUB_MIX_0[x] = t << 24 | t >>> 8; + SUB_MIX_1[x] = t << 16 | t >>> 16; + SUB_MIX_2[x] = t << 8 | t >>> 24; + SUB_MIX_3[x] = t; + var t = x8 * 0x1010101 ^ x4 * 0x10001 ^ x2 * 0x101 ^ x * 0x1010100; + INV_SUB_MIX_0[sx] = t << 24 | t >>> 8; + INV_SUB_MIX_1[sx] = t << 16 | t >>> 16; + INV_SUB_MIX_2[sx] = t << 8 | t >>> 24; + INV_SUB_MIX_3[sx] = t; + + if (!x) { + x = xi = 1; + } else { + x = x2 ^ d[d[d[x8 ^ x2]]]; + xi ^= d[d[xi]]; + } + } + })(); + + var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36]; + var AES = C_algo.AES = BlockCipher.extend({ + _doReset: function _doReset() { + if (this._nRounds && this._keyPriorReset === this._key) { + return; + } + + var key = this._keyPriorReset = this._key; + var keyWords = key.words; + var keySize = key.sigBytes / 4; + var nRounds = this._nRounds = keySize + 6; + var ksRows = (nRounds + 1) * 4; + var keySchedule = this._keySchedule = []; + + for (var ksRow = 0; ksRow < ksRows; ksRow++) { + if (ksRow < keySize) { + keySchedule[ksRow] = keyWords[ksRow]; + } else { + var t = keySchedule[ksRow - 1]; + + if (!(ksRow % keySize)) { + t = t << 8 | t >>> 24; + t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff]; + t ^= RCON[ksRow / keySize | 0] << 24; + } else if (keySize > 6 && ksRow % keySize == 4) { + t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 0xff] << 16 | SBOX[t >>> 8 & 0xff] << 8 | SBOX[t & 0xff]; + } + + keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t; + } + } + + var invKeySchedule = this._invKeySchedule = []; + + for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) { + var ksRow = ksRows - invKsRow; + + if (invKsRow % 4) { + var t = keySchedule[ksRow]; + } else { + var t = keySchedule[ksRow - 4]; + } + + if (invKsRow < 4 || ksRow <= 4) { + invKeySchedule[invKsRow] = t; + } else { + invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 0xff]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]]; + } + } + }, + encryptBlock: function encryptBlock(M, offset) { + this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX); + }, + decryptBlock: function decryptBlock(M, offset) { + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + + this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX); + + var t = M[offset + 1]; + M[offset + 1] = M[offset + 3]; + M[offset + 3] = t; + }, + _doCryptBlock: function _doCryptBlock(M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) { + var nRounds = this._nRounds; + var s0 = M[offset] ^ keySchedule[0]; + var s1 = M[offset + 1] ^ keySchedule[1]; + var s2 = M[offset + 2] ^ keySchedule[2]; + var s3 = M[offset + 3] ^ keySchedule[3]; + var ksRow = 4; + + for (var round = 1; round < nRounds; round++) { + var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[s1 >>> 16 & 0xff] ^ SUB_MIX_2[s2 >>> 8 & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++]; + var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[s2 >>> 16 & 0xff] ^ SUB_MIX_2[s3 >>> 8 & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++]; + var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[s3 >>> 16 & 0xff] ^ SUB_MIX_2[s0 >>> 8 & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++]; + var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[s0 >>> 16 & 0xff] ^ SUB_MIX_2[s1 >>> 8 & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++]; + s0 = t0; + s1 = t1; + s2 = t2; + s3 = t3; + } + + var t0 = (SBOX[s0 >>> 24] << 24 | SBOX[s1 >>> 16 & 0xff] << 16 | SBOX[s2 >>> 8 & 0xff] << 8 | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++]; + var t1 = (SBOX[s1 >>> 24] << 24 | SBOX[s2 >>> 16 & 0xff] << 16 | SBOX[s3 >>> 8 & 0xff] << 8 | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++]; + var t2 = (SBOX[s2 >>> 24] << 24 | SBOX[s3 >>> 16 & 0xff] << 16 | SBOX[s0 >>> 8 & 0xff] << 8 | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++]; + var t3 = (SBOX[s3 >>> 24] << 24 | SBOX[s0 >>> 16 & 0xff] << 16 | SBOX[s1 >>> 8 & 0xff] << 8 | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++]; + M[offset] = t0; + M[offset + 1] = t1; + M[offset + 2] = t2; + M[offset + 3] = t3; + }, + keySize: 8 + }); + C.AES = BlockCipher._createHelper(AES); + })(); + + return CryptoJS.AES; + }); +},633,[605,609,610,620,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), _$$_REQUIRE(_dependencyMap[4])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var BlockCipher = C_lib.BlockCipher; + var C_algo = C.algo; + var PC1 = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4]; + var PC2 = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32]; + var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28]; + var SBOX_P = [{ + 0x0: 0x808200, + 0x10000000: 0x8000, + 0x20000000: 0x808002, + 0x30000000: 0x2, + 0x40000000: 0x200, + 0x50000000: 0x808202, + 0x60000000: 0x800202, + 0x70000000: 0x800000, + 0x80000000: 0x202, + 0x90000000: 0x800200, + 0xa0000000: 0x8200, + 0xb0000000: 0x808000, + 0xc0000000: 0x8002, + 0xd0000000: 0x800002, + 0xe0000000: 0x0, + 0xf0000000: 0x8202, + 0x8000000: 0x0, + 0x18000000: 0x808202, + 0x28000000: 0x8202, + 0x38000000: 0x8000, + 0x48000000: 0x808200, + 0x58000000: 0x200, + 0x68000000: 0x808002, + 0x78000000: 0x2, + 0x88000000: 0x800200, + 0x98000000: 0x8200, + 0xa8000000: 0x808000, + 0xb8000000: 0x800202, + 0xc8000000: 0x800002, + 0xd8000000: 0x8002, + 0xe8000000: 0x202, + 0xf8000000: 0x800000, + 0x1: 0x8000, + 0x10000001: 0x2, + 0x20000001: 0x808200, + 0x30000001: 0x800000, + 0x40000001: 0x808002, + 0x50000001: 0x8200, + 0x60000001: 0x200, + 0x70000001: 0x800202, + 0x80000001: 0x808202, + 0x90000001: 0x808000, + 0xa0000001: 0x800002, + 0xb0000001: 0x8202, + 0xc0000001: 0x202, + 0xd0000001: 0x800200, + 0xe0000001: 0x8002, + 0xf0000001: 0x0, + 0x8000001: 0x808202, + 0x18000001: 0x808000, + 0x28000001: 0x800000, + 0x38000001: 0x200, + 0x48000001: 0x8000, + 0x58000001: 0x800002, + 0x68000001: 0x2, + 0x78000001: 0x8202, + 0x88000001: 0x8002, + 0x98000001: 0x800202, + 0xa8000001: 0x202, + 0xb8000001: 0x808200, + 0xc8000001: 0x800200, + 0xd8000001: 0x0, + 0xe8000001: 0x8200, + 0xf8000001: 0x808002 + }, { + 0x0: 0x40084010, + 0x1000000: 0x4000, + 0x2000000: 0x80000, + 0x3000000: 0x40080010, + 0x4000000: 0x40000010, + 0x5000000: 0x40084000, + 0x6000000: 0x40004000, + 0x7000000: 0x10, + 0x8000000: 0x84000, + 0x9000000: 0x40004010, + 0xa000000: 0x40000000, + 0xb000000: 0x84010, + 0xc000000: 0x80010, + 0xd000000: 0x0, + 0xe000000: 0x4010, + 0xf000000: 0x40080000, + 0x800000: 0x40004000, + 0x1800000: 0x84010, + 0x2800000: 0x10, + 0x3800000: 0x40004010, + 0x4800000: 0x40084010, + 0x5800000: 0x40000000, + 0x6800000: 0x80000, + 0x7800000: 0x40080010, + 0x8800000: 0x80010, + 0x9800000: 0x0, + 0xa800000: 0x4000, + 0xb800000: 0x40080000, + 0xc800000: 0x40000010, + 0xd800000: 0x84000, + 0xe800000: 0x40084000, + 0xf800000: 0x4010, + 0x10000000: 0x0, + 0x11000000: 0x40080010, + 0x12000000: 0x40004010, + 0x13000000: 0x40084000, + 0x14000000: 0x40080000, + 0x15000000: 0x10, + 0x16000000: 0x84010, + 0x17000000: 0x4000, + 0x18000000: 0x4010, + 0x19000000: 0x80000, + 0x1a000000: 0x80010, + 0x1b000000: 0x40000010, + 0x1c000000: 0x84000, + 0x1d000000: 0x40004000, + 0x1e000000: 0x40000000, + 0x1f000000: 0x40084010, + 0x10800000: 0x84010, + 0x11800000: 0x80000, + 0x12800000: 0x40080000, + 0x13800000: 0x4000, + 0x14800000: 0x40004000, + 0x15800000: 0x40084010, + 0x16800000: 0x10, + 0x17800000: 0x40000000, + 0x18800000: 0x40084000, + 0x19800000: 0x40000010, + 0x1a800000: 0x40004010, + 0x1b800000: 0x80010, + 0x1c800000: 0x0, + 0x1d800000: 0x4010, + 0x1e800000: 0x40080010, + 0x1f800000: 0x84000 + }, { + 0x0: 0x104, + 0x100000: 0x0, + 0x200000: 0x4000100, + 0x300000: 0x10104, + 0x400000: 0x10004, + 0x500000: 0x4000004, + 0x600000: 0x4010104, + 0x700000: 0x4010000, + 0x800000: 0x4000000, + 0x900000: 0x4010100, + 0xa00000: 0x10100, + 0xb00000: 0x4010004, + 0xc00000: 0x4000104, + 0xd00000: 0x10000, + 0xe00000: 0x4, + 0xf00000: 0x100, + 0x80000: 0x4010100, + 0x180000: 0x4010004, + 0x280000: 0x0, + 0x380000: 0x4000100, + 0x480000: 0x4000004, + 0x580000: 0x10000, + 0x680000: 0x10004, + 0x780000: 0x104, + 0x880000: 0x4, + 0x980000: 0x100, + 0xa80000: 0x4010000, + 0xb80000: 0x10104, + 0xc80000: 0x10100, + 0xd80000: 0x4000104, + 0xe80000: 0x4010104, + 0xf80000: 0x4000000, + 0x1000000: 0x4010100, + 0x1100000: 0x10004, + 0x1200000: 0x10000, + 0x1300000: 0x4000100, + 0x1400000: 0x100, + 0x1500000: 0x4010104, + 0x1600000: 0x4000004, + 0x1700000: 0x0, + 0x1800000: 0x4000104, + 0x1900000: 0x4000000, + 0x1a00000: 0x4, + 0x1b00000: 0x10100, + 0x1c00000: 0x4010000, + 0x1d00000: 0x104, + 0x1e00000: 0x10104, + 0x1f00000: 0x4010004, + 0x1080000: 0x4000000, + 0x1180000: 0x104, + 0x1280000: 0x4010100, + 0x1380000: 0x0, + 0x1480000: 0x10004, + 0x1580000: 0x4000100, + 0x1680000: 0x100, + 0x1780000: 0x4010004, + 0x1880000: 0x10000, + 0x1980000: 0x4010104, + 0x1a80000: 0x10104, + 0x1b80000: 0x4000004, + 0x1c80000: 0x4000104, + 0x1d80000: 0x4010000, + 0x1e80000: 0x4, + 0x1f80000: 0x10100 + }, { + 0x0: 0x80401000, + 0x10000: 0x80001040, + 0x20000: 0x401040, + 0x30000: 0x80400000, + 0x40000: 0x0, + 0x50000: 0x401000, + 0x60000: 0x80000040, + 0x70000: 0x400040, + 0x80000: 0x80000000, + 0x90000: 0x400000, + 0xa0000: 0x40, + 0xb0000: 0x80001000, + 0xc0000: 0x80400040, + 0xd0000: 0x1040, + 0xe0000: 0x1000, + 0xf0000: 0x80401040, + 0x8000: 0x80001040, + 0x18000: 0x40, + 0x28000: 0x80400040, + 0x38000: 0x80001000, + 0x48000: 0x401000, + 0x58000: 0x80401040, + 0x68000: 0x0, + 0x78000: 0x80400000, + 0x88000: 0x1000, + 0x98000: 0x80401000, + 0xa8000: 0x400000, + 0xb8000: 0x1040, + 0xc8000: 0x80000000, + 0xd8000: 0x400040, + 0xe8000: 0x401040, + 0xf8000: 0x80000040, + 0x100000: 0x400040, + 0x110000: 0x401000, + 0x120000: 0x80000040, + 0x130000: 0x0, + 0x140000: 0x1040, + 0x150000: 0x80400040, + 0x160000: 0x80401000, + 0x170000: 0x80001040, + 0x180000: 0x80401040, + 0x190000: 0x80000000, + 0x1a0000: 0x80400000, + 0x1b0000: 0x401040, + 0x1c0000: 0x80001000, + 0x1d0000: 0x400000, + 0x1e0000: 0x40, + 0x1f0000: 0x1000, + 0x108000: 0x80400000, + 0x118000: 0x80401040, + 0x128000: 0x0, + 0x138000: 0x401000, + 0x148000: 0x400040, + 0x158000: 0x80000000, + 0x168000: 0x80001040, + 0x178000: 0x40, + 0x188000: 0x80000040, + 0x198000: 0x1000, + 0x1a8000: 0x80001000, + 0x1b8000: 0x80400040, + 0x1c8000: 0x1040, + 0x1d8000: 0x80401000, + 0x1e8000: 0x400000, + 0x1f8000: 0x401040 + }, { + 0x0: 0x80, + 0x1000: 0x1040000, + 0x2000: 0x40000, + 0x3000: 0x20000000, + 0x4000: 0x20040080, + 0x5000: 0x1000080, + 0x6000: 0x21000080, + 0x7000: 0x40080, + 0x8000: 0x1000000, + 0x9000: 0x20040000, + 0xa000: 0x20000080, + 0xb000: 0x21040080, + 0xc000: 0x21040000, + 0xd000: 0x0, + 0xe000: 0x1040080, + 0xf000: 0x21000000, + 0x800: 0x1040080, + 0x1800: 0x21000080, + 0x2800: 0x80, + 0x3800: 0x1040000, + 0x4800: 0x40000, + 0x5800: 0x20040080, + 0x6800: 0x21040000, + 0x7800: 0x20000000, + 0x8800: 0x20040000, + 0x9800: 0x0, + 0xa800: 0x21040080, + 0xb800: 0x1000080, + 0xc800: 0x20000080, + 0xd800: 0x21000000, + 0xe800: 0x1000000, + 0xf800: 0x40080, + 0x10000: 0x40000, + 0x11000: 0x80, + 0x12000: 0x20000000, + 0x13000: 0x21000080, + 0x14000: 0x1000080, + 0x15000: 0x21040000, + 0x16000: 0x20040080, + 0x17000: 0x1000000, + 0x18000: 0x21040080, + 0x19000: 0x21000000, + 0x1a000: 0x1040000, + 0x1b000: 0x20040000, + 0x1c000: 0x40080, + 0x1d000: 0x20000080, + 0x1e000: 0x0, + 0x1f000: 0x1040080, + 0x10800: 0x21000080, + 0x11800: 0x1000000, + 0x12800: 0x1040000, + 0x13800: 0x20040080, + 0x14800: 0x20000000, + 0x15800: 0x1040080, + 0x16800: 0x80, + 0x17800: 0x21040000, + 0x18800: 0x40080, + 0x19800: 0x21040080, + 0x1a800: 0x0, + 0x1b800: 0x21000000, + 0x1c800: 0x1000080, + 0x1d800: 0x40000, + 0x1e800: 0x20040000, + 0x1f800: 0x20000080 + }, { + 0x0: 0x10000008, + 0x100: 0x2000, + 0x200: 0x10200000, + 0x300: 0x10202008, + 0x400: 0x10002000, + 0x500: 0x200000, + 0x600: 0x200008, + 0x700: 0x10000000, + 0x800: 0x0, + 0x900: 0x10002008, + 0xa00: 0x202000, + 0xb00: 0x8, + 0xc00: 0x10200008, + 0xd00: 0x202008, + 0xe00: 0x2008, + 0xf00: 0x10202000, + 0x80: 0x10200000, + 0x180: 0x10202008, + 0x280: 0x8, + 0x380: 0x200000, + 0x480: 0x202008, + 0x580: 0x10000008, + 0x680: 0x10002000, + 0x780: 0x2008, + 0x880: 0x200008, + 0x980: 0x2000, + 0xa80: 0x10002008, + 0xb80: 0x10200008, + 0xc80: 0x0, + 0xd80: 0x10202000, + 0xe80: 0x202000, + 0xf80: 0x10000000, + 0x1000: 0x10002000, + 0x1100: 0x10200008, + 0x1200: 0x10202008, + 0x1300: 0x2008, + 0x1400: 0x200000, + 0x1500: 0x10000000, + 0x1600: 0x10000008, + 0x1700: 0x202000, + 0x1800: 0x202008, + 0x1900: 0x0, + 0x1a00: 0x8, + 0x1b00: 0x10200000, + 0x1c00: 0x2000, + 0x1d00: 0x10002008, + 0x1e00: 0x10202000, + 0x1f00: 0x200008, + 0x1080: 0x8, + 0x1180: 0x202000, + 0x1280: 0x200000, + 0x1380: 0x10000008, + 0x1480: 0x10002000, + 0x1580: 0x2008, + 0x1680: 0x10202008, + 0x1780: 0x10200000, + 0x1880: 0x10202000, + 0x1980: 0x10200008, + 0x1a80: 0x2000, + 0x1b80: 0x202008, + 0x1c80: 0x200008, + 0x1d80: 0x0, + 0x1e80: 0x10000000, + 0x1f80: 0x10002008 + }, { + 0x0: 0x100000, + 0x10: 0x2000401, + 0x20: 0x400, + 0x30: 0x100401, + 0x40: 0x2100401, + 0x50: 0x0, + 0x60: 0x1, + 0x70: 0x2100001, + 0x80: 0x2000400, + 0x90: 0x100001, + 0xa0: 0x2000001, + 0xb0: 0x2100400, + 0xc0: 0x2100000, + 0xd0: 0x401, + 0xe0: 0x100400, + 0xf0: 0x2000000, + 0x8: 0x2100001, + 0x18: 0x0, + 0x28: 0x2000401, + 0x38: 0x2100400, + 0x48: 0x100000, + 0x58: 0x2000001, + 0x68: 0x2000000, + 0x78: 0x401, + 0x88: 0x100401, + 0x98: 0x2000400, + 0xa8: 0x2100000, + 0xb8: 0x100001, + 0xc8: 0x400, + 0xd8: 0x2100401, + 0xe8: 0x1, + 0xf8: 0x100400, + 0x100: 0x2000000, + 0x110: 0x100000, + 0x120: 0x2000401, + 0x130: 0x2100001, + 0x140: 0x100001, + 0x150: 0x2000400, + 0x160: 0x2100400, + 0x170: 0x100401, + 0x180: 0x401, + 0x190: 0x2100401, + 0x1a0: 0x100400, + 0x1b0: 0x1, + 0x1c0: 0x0, + 0x1d0: 0x2100000, + 0x1e0: 0x2000001, + 0x1f0: 0x400, + 0x108: 0x100400, + 0x118: 0x2000401, + 0x128: 0x2100001, + 0x138: 0x1, + 0x148: 0x2000000, + 0x158: 0x100000, + 0x168: 0x401, + 0x178: 0x2100400, + 0x188: 0x2000001, + 0x198: 0x2100000, + 0x1a8: 0x0, + 0x1b8: 0x2100401, + 0x1c8: 0x100401, + 0x1d8: 0x400, + 0x1e8: 0x2000400, + 0x1f8: 0x100001 + }, { + 0x0: 0x8000820, + 0x1: 0x20000, + 0x2: 0x8000000, + 0x3: 0x20, + 0x4: 0x20020, + 0x5: 0x8020820, + 0x6: 0x8020800, + 0x7: 0x800, + 0x8: 0x8020000, + 0x9: 0x8000800, + 0xa: 0x20800, + 0xb: 0x8020020, + 0xc: 0x820, + 0xd: 0x0, + 0xe: 0x8000020, + 0xf: 0x20820, + 0x80000000: 0x800, + 0x80000001: 0x8020820, + 0x80000002: 0x8000820, + 0x80000003: 0x8000000, + 0x80000004: 0x8020000, + 0x80000005: 0x20800, + 0x80000006: 0x20820, + 0x80000007: 0x20, + 0x80000008: 0x8000020, + 0x80000009: 0x820, + 0x8000000a: 0x20020, + 0x8000000b: 0x8020800, + 0x8000000c: 0x0, + 0x8000000d: 0x8020020, + 0x8000000e: 0x8000800, + 0x8000000f: 0x20000, + 0x10: 0x20820, + 0x11: 0x8020800, + 0x12: 0x20, + 0x13: 0x800, + 0x14: 0x8000800, + 0x15: 0x8000020, + 0x16: 0x8020020, + 0x17: 0x20000, + 0x18: 0x0, + 0x19: 0x20020, + 0x1a: 0x8020000, + 0x1b: 0x8000820, + 0x1c: 0x8020820, + 0x1d: 0x20800, + 0x1e: 0x820, + 0x1f: 0x8000000, + 0x80000010: 0x20000, + 0x80000011: 0x800, + 0x80000012: 0x8020020, + 0x80000013: 0x20820, + 0x80000014: 0x20, + 0x80000015: 0x8020000, + 0x80000016: 0x8000000, + 0x80000017: 0x8000820, + 0x80000018: 0x8020820, + 0x80000019: 0x8000020, + 0x8000001a: 0x8000800, + 0x8000001b: 0x0, + 0x8000001c: 0x20800, + 0x8000001d: 0x820, + 0x8000001e: 0x20020, + 0x8000001f: 0x8020800 + }]; + var SBOX_MASK = [0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000, 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f]; + var DES = C_algo.DES = BlockCipher.extend({ + _doReset: function _doReset() { + var key = this._key; + var keyWords = key.words; + var keyBits = []; + + for (var i = 0; i < 56; i++) { + var keyBitPos = PC1[i] - 1; + keyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1; + } + + var subKeys = this._subKeys = []; + + for (var nSubKey = 0; nSubKey < 16; nSubKey++) { + var subKey = subKeys[nSubKey] = []; + var bitShift = BIT_SHIFTS[nSubKey]; + + for (var i = 0; i < 24; i++) { + subKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6; + subKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6; + } + + subKey[0] = subKey[0] << 1 | subKey[0] >>> 31; + + for (var i = 1; i < 7; i++) { + subKey[i] = subKey[i] >>> (i - 1) * 4 + 3; + } + + subKey[7] = subKey[7] << 5 | subKey[7] >>> 27; + } + + var invSubKeys = this._invSubKeys = []; + + for (var i = 0; i < 16; i++) { + invSubKeys[i] = subKeys[15 - i]; + } + }, + encryptBlock: function encryptBlock(M, offset) { + this._doCryptBlock(M, offset, this._subKeys); + }, + decryptBlock: function decryptBlock(M, offset) { + this._doCryptBlock(M, offset, this._invSubKeys); + }, + _doCryptBlock: function _doCryptBlock(M, offset, subKeys) { + this._lBlock = M[offset]; + this._rBlock = M[offset + 1]; + exchangeLR.call(this, 4, 0x0f0f0f0f); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeRL.call(this, 2, 0x33333333); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeLR.call(this, 1, 0x55555555); + + for (var round = 0; round < 16; round++) { + var subKey = subKeys[round]; + var lBlock = this._lBlock; + var rBlock = this._rBlock; + var f = 0; + + for (var i = 0; i < 8; i++) { + f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0]; + } + + this._lBlock = rBlock; + this._rBlock = lBlock ^ f; + } + + var t = this._lBlock; + this._lBlock = this._rBlock; + this._rBlock = t; + exchangeLR.call(this, 1, 0x55555555); + exchangeRL.call(this, 8, 0x00ff00ff); + exchangeRL.call(this, 2, 0x33333333); + exchangeLR.call(this, 16, 0x0000ffff); + exchangeLR.call(this, 4, 0x0f0f0f0f); + M[offset] = this._lBlock; + M[offset + 1] = this._rBlock; + }, + keySize: 2, + ivSize: 2, + blockSize: 2 + }); + + function exchangeLR(offset, mask) { + var t = (this._lBlock >>> offset ^ this._rBlock) & mask; + this._rBlock ^= t; + this._lBlock ^= t << offset; + } + + function exchangeRL(offset, mask) { + var t = (this._rBlock >>> offset ^ this._lBlock) & mask; + this._lBlock ^= t; + this._rBlock ^= t << offset; + } + + C.DES = BlockCipher._createHelper(DES); + var TripleDES = C_algo.TripleDES = BlockCipher.extend({ + _doReset: function _doReset() { + var key = this._key; + var keyWords = key.words; + this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2))); + this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4))); + this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6))); + }, + encryptBlock: function encryptBlock(M, offset) { + this._des1.encryptBlock(M, offset); + + this._des2.decryptBlock(M, offset); + + this._des3.encryptBlock(M, offset); + }, + decryptBlock: function decryptBlock(M, offset) { + this._des3.decryptBlock(M, offset); + + this._des2.encryptBlock(M, offset); + + this._des1.decryptBlock(M, offset); + }, + keySize: 6, + ivSize: 2, + blockSize: 2 + }); + C.TripleDES = BlockCipher._createHelper(TripleDES); + })(); + + return CryptoJS.TripleDES; + }); +},634,[605,609,610,620,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), _$$_REQUIRE(_dependencyMap[4])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + var RC4 = C_algo.RC4 = StreamCipher.extend({ + _doReset: function _doReset() { + var key = this._key; + var keyWords = key.words; + var keySigBytes = key.sigBytes; + var S = this._S = []; + + for (var i = 0; i < 256; i++) { + S[i] = i; + } + + for (var i = 0, j = 0; i < 256; i++) { + var keyByteIndex = i % keySigBytes; + var keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 0xff; + j = (j + S[i] + keyByte) % 256; + var t = S[i]; + S[i] = S[j]; + S[j] = t; + } + + this._i = this._j = 0; + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + M[offset] ^= generateKeystreamWord.call(this); + }, + keySize: 8, + ivSize: 0 + }); + + function generateKeystreamWord() { + var S = this._S; + var i = this._i; + var j = this._j; + var keystreamWord = 0; + + for (var n = 0; n < 4; n++) { + i = (i + 1) % 256; + j = (j + S[i]) % 256; + var t = S[i]; + S[i] = S[j]; + S[j] = t; + keystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8; + } + + this._i = i; + this._j = j; + return keystreamWord; + } + + C.RC4 = StreamCipher._createHelper(RC4); + var RC4Drop = C_algo.RC4Drop = RC4.extend({ + cfg: RC4.cfg.extend({ + drop: 192 + }), + _doReset: function _doReset() { + RC4._doReset.call(this); + + for (var i = this.cfg.drop; i > 0; i--) { + generateKeystreamWord.call(this); + } + } + }); + C.RC4Drop = StreamCipher._createHelper(RC4Drop); + })(); + + return CryptoJS.RC4; + }); +},635,[605,609,610,620,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), _$$_REQUIRE(_dependencyMap[4])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + var S = []; + var C_ = []; + var G = []; + var Rabbit = C_algo.Rabbit = StreamCipher.extend({ + _doReset: function _doReset() { + var K = this._key.words; + var iv = this.cfg.iv; + + for (var i = 0; i < 4; i++) { + K[i] = (K[i] << 8 | K[i] >>> 24) & 0x00ff00ff | (K[i] << 24 | K[i] >>> 8) & 0xff00ff00; + } + + var X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16]; + var C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff]; + this._b = 0; + + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + for (var i = 0; i < 8; i++) { + C[i] ^= X[i + 4 & 7]; + } + + if (iv) { + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + var i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00; + var i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00; + var i1 = i0 >>> 16 | i2 & 0xffff0000; + var i3 = i2 << 16 | i0 & 0x0000ffff; + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + var X = this._X; + nextState.call(this); + S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16; + S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16; + S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16; + S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16; + + for (var i = 0; i < 4; i++) { + S[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00; + M[offset + i] ^= S[i]; + } + }, + blockSize: 4, + ivSize: 2 + }); + + function nextState() { + var X = this._X; + var C = this._C; + + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + C[0] = C[0] + 0x4d34d34d + this._b | 0; + C[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0; + C[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0; + C[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0; + C[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0; + C[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0; + C[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0; + C[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0; + this._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0; + + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + var ga = gx & 0xffff; + var gb = gx >>> 16; + var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb; + var gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0); + G[i] = gh ^ gl; + } + + X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0; + X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0; + X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0; + X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0; + X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0; + X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0; + X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0; + X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0; + } + + C.Rabbit = StreamCipher._createHelper(Rabbit); + })(); + + return CryptoJS.Rabbit; + }); +},636,[605,609,610,620,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + ; + + (function (root, factory, undef) { + if (typeof exports === "object") { + module.exports = exports = factory(_$$_REQUIRE(_dependencyMap[0]), _$$_REQUIRE(_dependencyMap[1]), _$$_REQUIRE(_dependencyMap[2]), _$$_REQUIRE(_dependencyMap[3]), _$$_REQUIRE(_dependencyMap[4])); + } else if (typeof define === "function" && define.amd) { + define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory); + } else { + factory(root.CryptoJS); + } + })(this, function (CryptoJS) { + (function () { + var C = CryptoJS; + var C_lib = C.lib; + var StreamCipher = C_lib.StreamCipher; + var C_algo = C.algo; + var S = []; + var C_ = []; + var G = []; + var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({ + _doReset: function _doReset() { + var K = this._key.words; + var iv = this.cfg.iv; + var X = this._X = [K[0], K[3] << 16 | K[2] >>> 16, K[1], K[0] << 16 | K[3] >>> 16, K[2], K[1] << 16 | K[0] >>> 16, K[3], K[2] << 16 | K[1] >>> 16]; + var C = this._C = [K[2] << 16 | K[2] >>> 16, K[0] & 0xffff0000 | K[1] & 0x0000ffff, K[3] << 16 | K[3] >>> 16, K[1] & 0xffff0000 | K[2] & 0x0000ffff, K[0] << 16 | K[0] >>> 16, K[2] & 0xffff0000 | K[3] & 0x0000ffff, K[1] << 16 | K[1] >>> 16, K[3] & 0xffff0000 | K[0] & 0x0000ffff]; + this._b = 0; + + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + + for (var i = 0; i < 8; i++) { + C[i] ^= X[i + 4 & 7]; + } + + if (iv) { + var IV = iv.words; + var IV_0 = IV[0]; + var IV_1 = IV[1]; + var i0 = (IV_0 << 8 | IV_0 >>> 24) & 0x00ff00ff | (IV_0 << 24 | IV_0 >>> 8) & 0xff00ff00; + var i2 = (IV_1 << 8 | IV_1 >>> 24) & 0x00ff00ff | (IV_1 << 24 | IV_1 >>> 8) & 0xff00ff00; + var i1 = i0 >>> 16 | i2 & 0xffff0000; + var i3 = i2 << 16 | i0 & 0x0000ffff; + C[0] ^= i0; + C[1] ^= i1; + C[2] ^= i2; + C[3] ^= i3; + C[4] ^= i0; + C[5] ^= i1; + C[6] ^= i2; + C[7] ^= i3; + + for (var i = 0; i < 4; i++) { + nextState.call(this); + } + } + }, + _doProcessBlock: function _doProcessBlock(M, offset) { + var X = this._X; + nextState.call(this); + S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16; + S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16; + S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16; + S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16; + + for (var i = 0; i < 4; i++) { + S[i] = (S[i] << 8 | S[i] >>> 24) & 0x00ff00ff | (S[i] << 24 | S[i] >>> 8) & 0xff00ff00; + M[offset + i] ^= S[i]; + } + }, + blockSize: 4, + ivSize: 2 + }); + + function nextState() { + var X = this._X; + var C = this._C; + + for (var i = 0; i < 8; i++) { + C_[i] = C[i]; + } + + C[0] = C[0] + 0x4d34d34d + this._b | 0; + C[1] = C[1] + 0xd34d34d3 + (C[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0; + C[2] = C[2] + 0x34d34d34 + (C[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0; + C[3] = C[3] + 0x4d34d34d + (C[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0; + C[4] = C[4] + 0xd34d34d3 + (C[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0; + C[5] = C[5] + 0x34d34d34 + (C[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0; + C[6] = C[6] + 0x4d34d34d + (C[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0; + C[7] = C[7] + 0xd34d34d3 + (C[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0; + this._b = C[7] >>> 0 < C_[7] >>> 0 ? 1 : 0; + + for (var i = 0; i < 8; i++) { + var gx = X[i] + C[i]; + var ga = gx & 0xffff; + var gb = gx >>> 16; + var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb; + var gl = ((gx & 0xffff0000) * gx | 0) + ((gx & 0x0000ffff) * gx | 0); + G[i] = gh ^ gl; + } + + X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0; + X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0; + X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0; + X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0; + X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0; + X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0; + X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0; + X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0; + } + + C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy); + })(); + + return CryptoJS.RabbitLegacy; + }); +},637,[605,609,610,620,621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PageType = exports.SYMBOL_PAGE_STOP = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _ExtraLinks = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _EPaperImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _BoxesInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var SYMBOL_PAGE_STOP = "."; + exports.SYMBOL_PAGE_STOP = SYMBOL_PAGE_STOP; + var PageType = { + BROADSHEET: 0, + DOUBLE_TRUCK: 1, + TABLOID: 2, + TABLOID_DOUBLE_TRUCK: 3 + }; + exports.PageType = PageType; + + var Page = function () { + function Page() { + (0, _classCallCheck2.default)(this, Page); + } + + (0, _createClass2.default)(Page, [{ + key: "getIssueId", + value: function getIssueId() { + return this.issueId; + } + }, { + key: "setIssueId", + value: function setIssueId(issueId) { + this.issueId = issueId; + } + }, { + key: "getPageId", + value: function getPageId() { + return this.pageId; + } + }, { + key: "setPageId", + value: function setPageId(pageId) { + this.pageId = pageId; + } + }, { + key: "getPage", + value: function getPage() { + return this.page; + } + }, { + key: "setPage", + value: function setPage(page) { + this.page = page; + } + }, { + key: "getShownPage", + value: function getShownPage() { + return this.shownPage; + } + }, { + key: "setShownPage", + value: function setShownPage(shownPage) { + this.shownPage = shownPage; + } + }, { + key: "getFilename", + value: function getFilename() { + return this.filename; + } + }, { + key: "setFilename", + value: function setFilename(filename) { + this.filename = filename; + } + }, { + key: "getSection", + value: function getSection() { + return this.section; + } + }, { + key: "setSection", + value: function setSection(section) { + this.section = section; + } + }, { + key: "getType", + value: function getType() { + return this.type; + } + }, { + key: "setType", + value: function setType(type) { + this.type = type; + } + }, { + key: "getModifyTime", + value: function getModifyTime() { + return this.modifyTime; + } + }, { + key: "setModifyTime", + value: function setModifyTime(modifyTime) { + this.modifyTime = modifyTime; + } + }, { + key: "getExtralinks", + value: function getExtralinks() { + return this.extralinks; + } + }, { + key: "setExtralinks", + value: function setExtralinks(extralinks) { + this.extralinks = extralinks; + } + }, { + key: "getExtraMd5", + value: function getExtraMd5() { + return this.extraMd5; + } + }, { + key: "setExtraMd5", + value: function setExtraMd5(extraMd5) { + this.extraMd5 = extraMd5; + } + }, { + key: "getBoxesInfo", + value: function getBoxesInfo() { + var article = this.getArticles()[0]; + + if (article) { + return article.getBoxesInfo(); + } + + return undefined; + } + }, { + key: "getDpi", + value: function getDpi() { + var boxesInfo = this.getBoxesInfo(); + + if (boxesInfo) { + return boxesInfo.getDpi(); + } + + return _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.defaultDpi; + } + }, { + key: "getWidth", + value: function getWidth() { + var boxesInfo = this.getBoxesInfo(); + + if (boxesInfo) { + return boxesInfo.getPageWidth(); + } + + return this.frameWidth; + } + }, { + key: "getHeight", + value: function getHeight() { + var boxesInfo = this.getBoxesInfo(); + + if (boxesInfo) { + return boxesInfo.getPageHeight(); + } + + return this.frameHeight; + } + }, { + key: "getTotalOffset", + value: function getTotalOffset() { + var offsetX = 0; + var offsetY = 0; + var boxesInfo = this.getBoxesInfo(); + + if (boxesInfo) { + offsetX = boxesInfo.getTotalOffsetX(); + offsetY = boxesInfo.getTotalOffsetY(); + } + + return { + offsetX: offsetX, + offsetY: offsetY + }; + } + }, { + key: "getFrameWidth", + value: function getFrameWidth(hasDoubleTruckSize) { + if (!this.isDoubleTruck() && hasDoubleTruckSize) { + return this.frameWidth / 2; + } + + return this.frameWidth; + } + }, { + key: "setFrameWidth", + value: function setFrameWidth(frameWidth) { + this.frameWidth = frameWidth; + } + }, { + key: "getFrameHeight", + value: function getFrameHeight() { + return this.frameHeight; + } + }, { + key: "setFrameHeight", + value: function setFrameHeight(frameHeight) { + this.frameHeight = frameHeight; + } + }, { + key: "setEdition", + value: function setEdition(edition) { + this.edition = edition; + } + }, { + key: "getEdition", + value: function getEdition() { + return this.edition; + } + }, { + key: "setArticles", + value: function setArticles(articles) { + this.articles = articles; + } + }, { + key: "getArticles", + value: function getArticles() { + if (this.articles) { + return this.articles.filter(function (article) { + return article && !article.isEmpty(); + }); + } + + return this.articles; + } + }, { + key: "setImages", + value: function setImages(images) { + this.images = images; + } + }, { + key: "getImages", + value: function getImages() { + return this.images; + } + }, { + key: "getImageByType", + value: function getImageByType(type) { + return this.images.find(function (element) { + return element.getType() === type; + }); + } + }, { + key: "addImage", + value: function addImage(image) { + if (image) { + var index = this.images.findIndex(function (element) { + return element.getType() === image.getType(); + }); + + if (index >= 0) { + this.images[index] = image; + } else { + this.images.push(image); + } + } + } + }, { + key: "removeImage", + value: function removeImage(image) { + this.images = this.images.filter(function (element) { + return element.getType() !== image.getType(); + }); + } + }, { + key: "removeImageByType", + value: function removeImageByType(type) { + this.images = this.images.filter(function (element) { + return element.getType() !== type; + }); + } + }, { + key: "isDoubleTruck", + value: function isDoubleTruck() { + return this.isBroadSheetDoubleTruck() || this.isTabloidDoubleTruck(); + } + }, { + key: "isTabloid", + value: function isTabloid() { + return this.type === PageType.TABLOID; + } + }, { + key: "isBroadSheetDoubleTruck", + value: function isBroadSheetDoubleTruck() { + return this.type === PageType.DOUBLE_TRUCK; + } + }, { + key: "isTabloidDoubleTruck", + value: function isTabloidDoubleTruck() { + return this.type === PageType.TABLOID_DOUBLE_TRUCK; + } + }, { + key: "isBroadSheet", + value: function isBroadSheet() { + return this.type === PageType.BROADSHEET; + } + }, { + key: "getLowImage", + value: function getLowImage() { + return this.images ? this.images.find(function (image) { + return image.isLow(); + }) : undefined; + } + }, { + key: "getGraphImage", + value: function getGraphImage() { + return this.images ? this.images.find(function (image) { + return image.isGraph(); + }) : undefined; + } + }, { + key: "getTextImage", + value: function getTextImage() { + return this.images ? this.images.find(function (image) { + return image.isText(); + }) : undefined; + } + }, { + key: "getGifImage", + value: function getGifImage() { + return this.images ? this.images.find(function (image) { + return image.isTextGIF(); + }) : undefined; + } + }, { + key: "getPNGImage", + value: function getPNGImage() { + return this.images ? this.images.find(function (image) { + return image.isTextPNG(); + }) : undefined; + } + }, { + key: "getHrZip", + value: function getHrZip() { + return this.images ? this.images.find(function (image) { + return image.isHighResZip(); + }) : undefined; + } + }, { + key: "setVisible", + value: function setVisible(visible) { + this.visible = visible; + } + }, { + key: "isVisible", + value: function isVisible() { + return this.visible; + } + }, { + key: "setProtected", + value: function setProtected(prot) { + this.protected = prot; + } + }, { + key: "isProtected", + value: function isProtected() { + return this.protected; + } + }]); + return Page; + }(); + + exports.default = Page; +},638,[5,7,8,639,640,587,642,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PageExtraType = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var PageExtraType = { + MAIL: "mailto:", + URL: "url", + OPEN_APP: "openApp", + OPEN_ISSUE: "openIssue", + OPEN_ARTICLE: "openArticle", + BRIGHT_COVE: "brightcove", + EXTERNAL_URL: "externalurl", + PAGE: "page", + YOUTUBE: "youtube", + VIDEO: "video", + GALLERY: "gallery", + POINTER: "pointer", + ADDON: "addon", + VIDEO_WEB: "videoweb", + PHONE: "phone" + }; + exports.PageExtraType = PageExtraType; + + var ExtraLink = function () { + function ExtraLink(type, content, imageURL, coordinates, size, pdfSize) { + (0, _classCallCheck2.default)(this, ExtraLink); + this.type = type; + this.content = content; + this.imageURL = imageURL; + this.coordinates = coordinates; + this.size = size; + this.pdfSize = pdfSize; + } + + (0, _createClass2.default)(ExtraLink, [{ + key: "getType", + value: function getType() { + if (this.content && (this.type === PageExtraType.URL || this.type === PageExtraType.EXTERNAL_URL)) { + var _StringUtils$segmentU = _$$_REQUIRE(_dependencyMap[3]).StringUtils.segmentUrl(_$$_REQUIRE(_dependencyMap[3]).StringUtils.decodeURIComponent(this.content)), + getParams = _StringUtils$segmentU.getParams; + + if (_$$_REQUIRE(_dependencyMap[3]).JSUtils.hasProperty(getParams, "openIssue")) { + return PageExtraType.OPEN_ISSUE; + } + + if (_$$_REQUIRE(_dependencyMap[3]).JSUtils.hasProperty(getParams, "openArticle")) { + return PageExtraType.OPEN_ARTICLE; + } + } + + return this.type; + } + }, { + key: "setType", + value: function setType(type) { + this.type = type; + } + }, { + key: "getContent", + value: function getContent() { + return this.content; + } + }, { + key: "setContent", + value: function setContent(content) { + this.content = content; + } + }, { + key: "getImageURL", + value: function getImageURL() { + return this.imageURL; + } + }, { + key: "setImageURL", + value: function setImageURL(imageURL) { + this.imageURL = imageURL; + } + }, { + key: "getLeft", + value: function getLeft() { + return this.left; + } + }, { + key: "getCoordinates", + value: function getCoordinates() { + return this.coordinates; + } + }, { + key: "setCoordinates", + value: function setCoordinates(left, top) { + this.coordinates = { + left: left, + top: top + }; + } + }, { + key: "getSize", + value: function getSize() { + return this.size; + } + }, { + key: "setSize", + value: function setSize(width, height) { + this.size = { + width: width, + height: height + }; + } + }, { + key: "getPdfSize", + value: function getPdfSize() { + return this.pdfSize; + } + }, { + key: "setPdfSize", + value: function setPdfSize(width, height) { + this.pdfSize = { + width: width, + height: height + }; + } + }, { + key: "toString", + value: function toString() { + return this.type.concat(",").concat(this.coordinates.left).concat(",").concat(this.coordinates.top).concat(",").concat(this.size.width).concat(",").concat(this.size.height).concat(",").concat(this.pdfSize.width).concat(",").concat(this.pdfSize.height).concat(",").concat(this.content).concat(",").concat(this.imageURL); + } + }]); + return ExtraLink; + }(); + + exports.default = ExtraLink; +},639,[5,7,8,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.EPaperArticleType = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Box = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _BoxesInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _PageJump = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var EPaperArticleType = { + GRAPHIC: "Graphic", + EDITORIAL: "Editorial", + ADVERTISEMENT: "Advertisement", + LEGENDA: "Legenda", + TABLE: "Table", + PAGE_LAYOUT: "Page Layout" + }; + exports.EPaperArticleType = EPaperArticleType; + + var EPaperArticle = function () { + function EPaperArticle() { + (0, _classCallCheck2.default)(this, EPaperArticle); + } + + (0, _createClass2.default)(EPaperArticle, [{ + key: "setPageId", + value: function setPageId(pageId) { + this.pageId = pageId; + } + }, { + key: "getPageId", + value: function getPageId() { + return this.pageId; + } + }, { + key: "setXmlId", + value: function setXmlId(xmlId) { + this.xmlId = xmlId; + } + }, { + key: "getXmlId", + value: function getXmlId() { + return this.xmlId; + } + }, { + key: "setType", + value: function setType(type) { + this.type = type; + } + }, { + key: "getType", + value: function getType() { + return this.type; + } + }, { + key: "setSubType", + value: function setSubType(subType) { + this.subType = subType; + } + }, { + key: "getSubType", + value: function getSubType() { + return this.subType; + } + }, { + key: "setTitle", + value: function setTitle(title) { + this.title = title; + } + }, { + key: "getTitle", + value: function getTitle() { + return this.title; + } + }, { + key: "setHtml", + value: function setHtml(html) { + this.html = html; + } + }, { + key: "getHtml", + value: function getHtml() { + return this.html; + } + }, { + key: "setBoxes", + value: function setBoxes(boxes) { + this.boxes = boxes; + } + }, { + key: "getLeftCoordinate", + value: function getLeftCoordinate() { + var boxes = this.getBoxes(); + var found; + + if (boxes && boxes.length) { + found = boxes[0]; + + for (var i = 1; i < boxes.length; i++) { + var box = boxes[i]; + + if (found.left > box.left) { + found = box; + } + } + } + + return found; + } + }, { + key: "getTopCoordinate", + value: function getTopCoordinate() { + var boxes = this.getBoxes(); + var found; + + if (boxes && boxes.length) { + found = boxes[0]; + + for (var i = 1; i < boxes.length; i++) { + var box = boxes[i]; + + if (found.top > box.top) { + found = box; + } + } + } + + return found; + } + }, { + key: "getBoxes", + value: function getBoxes() { + return this.boxes; + } + }, { + key: "setBoxesInfo", + value: function setBoxesInfo(info) { + this.boxesInfo = info; + } + }, { + key: "getBoxesInfo", + value: function getBoxesInfo() { + return this.boxesInfo; + } + }, { + key: "setInc", + value: function setInc(inc) { + this.inc = inc; + } + }, { + key: "getInc", + value: function getInc() { + return this.inc; + } + }, { + key: "setChildart", + value: function setChildart(childart) { + this.childart = childart; + } + }, { + key: "getChildart", + value: function getChildart() { + return this.childart; + } + }, { + key: "setPageJumps", + value: function setPageJumps(pageJumps) { + this.pageJumps = pageJumps; + } + }, { + key: "getPageJumps", + value: function getPageJumps() { + return this.pageJumps; + } + }, { + key: "isText", + value: function isText() { + return this.getType() === EPaperArticleType.EDITORIAL; + } + }, { + key: "isAd", + value: function isAd() { + return this.getType() === EPaperArticleType.ADVERTISEMENT; + } + }, { + key: "isLayout", + value: function isLayout() { + return this.getType() === EPaperArticleType.PAGE_LAYOUT; + } + }, { + key: "isEmpty", + value: function isEmpty() { + if (this.getBoxes()) { + return _$$_REQUIRE(_dependencyMap[6]).JSUtils.isEmpty(this.getBoxes().filter(function (box) { + return box && !box.isEmpty(); + })); + } + + return true; + } + }, { + key: "equals", + value: function equals(article) { + if (!article) { + return false; + } + + if (this.getPageId() !== article.getPageId()) { + return false; + } + + if (this.getXmlId() !== article.getXmlId()) { + return false; + } + + return true; + } + }, { + key: "titleToPrint", + value: function titleToPrint() { + var title = this.getTitle(); + var printName = "article_" + this.getPageId() + "_" + this.getXmlId() + "_"; + + if (title !== undefined) { + printName += title.toLowerCase().replace(/ /g, "_"); + } + + return printName; + } + }, { + key: "isHidden", + value: function isHidden() { + return this.getSubType() === "hidden"; + } + }, { + key: "isParent", + value: function isParent() { + if (this.pageJumps) { + return this.pageJumps.find(function (pj) { + return pj.hasTo() && pj.isParent(); + }); + } + + return false; + } + }, { + key: "isSlug", + value: function isSlug() { + if (this.pageJumps) { + return this.pageJumps.find(function (pj) { + return pj.isSlug(); + }); + } + + return false; + } + }, { + key: "hasFrom", + value: function hasFrom() { + if (this.pageJumps) { + return this.pageJumps.find(function (pj) { + return pj.hasFrom(); + }); + } + + return false; + } + }]); + return EPaperArticle; + }(); + + exports.default = EPaperArticle; +},640,[5,7,8,641,642,643,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var Box = function () { + function Box(id, top, left, width, height) { + (0, _classCallCheck2.default)(this, Box); + this.id = id; + this.top = top; + this.left = left; + this.width = width; + this.height = height; + } + + (0, _createClass2.default)(Box, [{ + key: "getId", + value: function getId() { + return this.id; + } + }, { + key: "getTop", + value: function getTop() { + return this.top; + } + }, { + key: "getLeft", + value: function getLeft() { + return this.left; + } + }, { + key: "getWidth", + value: function getWidth() { + return this.width; + } + }, { + key: "getHeight", + value: function getHeight() { + return this.height; + } + }, { + key: "isEmpty", + value: function isEmpty() { + return this.width === 0 && this.height === 0; + } + }, { + key: "toString", + value: function toString() { + return "".concat(this.id).concat(",").concat(this.left).concat(",").concat(this.top).concat(",").concat(this.width).concat(",").concat(this.height); + } + }, { + key: "contains", + value: function contains(x, y) { + return this.getLeft() < x && this.getLeft() + this.getWidth() > x && this.getTop() < y && this.getTop() + this.getHeight() > y; + } + }]); + return Box; + }(); + + exports.default = Box; +},641,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var BoxesInfo = function () { + function BoxesInfo(infos) { + (0, _classCallCheck2.default)(this, BoxesInfo); + this.infos = infos; + } + + (0, _createClass2.default)(BoxesInfo, [{ + key: "getPDFPageWidth", + value: function getPDFPageWidth() { + return parseInt(this.infos[0], 10); + } + }, { + key: "getPDFPageHeight", + value: function getPDFPageHeight() { + return parseInt(this.infos[1], 10); + } + }, { + key: "getPageWidthMedium", + value: function getPageWidthMedium() { + return parseInt(this.infos[2], 10); + } + }, { + key: "getPageHeightMedium", + value: function getPageHeightMedium() { + return parseInt(this.infos[3], 10); + } + }, { + key: "getDpi", + value: function getDpi() { + return parseInt(this.infos[4], 10); + } + }, { + key: "getCustomXOffset", + value: function getCustomXOffset() { + return parseInt(this.infos[5], 10); + } + }, { + key: "getCustomYOffset", + value: function getCustomYOffset() { + return parseInt(this.infos[6], 10); + } + }, { + key: "getXOffset", + value: function getXOffset() { + return parseInt(this.infos[7], 10); + } + }, { + key: "getYOffset", + value: function getYOffset() { + return parseInt(this.infos[8], 10); + } + }, { + key: "getXOffsetC", + value: function getXOffsetC() { + return parseInt(this.infos[11], 10); + } + }, { + key: "getYOffsetC", + value: function getYOffsetC() { + return parseInt(this.infos[12], 10); + } + }, { + key: "getWidthOffsetC", + value: function getWidthOffsetC() { + return parseInt(this.infos[13], 10); + } + }, { + key: "getHeightOffsetC", + value: function getHeightOffsetC() { + return parseInt(this.infos[14], 10); + } + }, { + key: "getBboxLeft", + value: function getBboxLeft() { + return parseInt(this.infos[15], 10); + } + }, { + key: "getBboxTop", + value: function getBboxTop() { + return parseInt(this.infos[16], 10); + } + }, { + key: "getBboxRight", + value: function getBboxRight() { + return parseInt(this.infos[17], 10); + } + }, { + key: "getBboxBottom", + value: function getBboxBottom() { + return parseInt(this.infos[18], 10); + } + }, { + key: "getOriginalPDFPageWidth", + value: function getOriginalPDFPageWidth() { + return this.infos[19] ? parseFloat(this.infos[19]) : 0; + } + }, { + key: "getOriginalPDFPageHeight", + value: function getOriginalPDFPageHeight() { + return this.infos[20] ? parseFloat(this.infos[20]) : 0; + } + }, { + key: "getPageWidth", + value: function getPageWidth() { + return this.getOriginalPDFPageWidth() || this.getPDFPageWidth(); + } + }, { + key: "getPageHeight", + value: function getPageHeight() { + return this.getOriginalPDFPageHeight() || this.getPDFPageHeight(); + } + }, { + key: "toString", + value: function toString() { + return this.infos.join(","); + } + }, { + key: "getTotalOffsetX", + value: function getTotalOffsetX() { + return this.getXOffset() + this.getXOffsetC() + this.getCustomXOffset(); + } + }, { + key: "getTotalOffsetY", + value: function getTotalOffsetY() { + return this.getYOffset() + this.getYOffsetC() + this.getCustomYOffset(); + } + }, { + key: "getPercentile", + value: function getPercentile() { + return Math.floor(this.getDpi() / 72 * 100) / 100; + } + }, { + key: "getZoomX", + value: function getZoomX() { + return Math.ceil(this.getPageWidth() * this.getPercentile()) / this.getPageWidthMedium(); + } + }, { + key: "getZoomY", + value: function getZoomY() { + return Math.ceil(this.getPageHeight() * this.getPercentile()) / this.getPageHeightMedium(); + } + }, { + key: "getMedDpi", + value: function getMedDpi() { + return this.getPageWidth() / this.getPageWidthMedium() * this.getDpi(); + } + }, { + key: "getOriginalPageMediumWidth", + value: function getOriginalPageMediumWidth() { + return this.getPageWidthMedium() + this.getBboxLeft() + this.getBboxRight(); + } + }, { + key: "getOriginalPageMediumHeight", + value: function getOriginalPageMediumHeight() { + return this.getPageHeightMedium() + this.getBboxTop() + this.getBboxBottom(); + } + }, { + key: "getScaleX", + value: function getScaleX() { + return Math.ceil(this.getPageWidth() * this.getPercentile()) / this.getOriginalPageMediumWidth(); + } + }, { + key: "getScaleY", + value: function getScaleY() { + return Math.ceil(this.getPageHeight() * this.getPercentile()) / this.getOriginalPageMediumHeight(); + } + }]); + return BoxesInfo; + }(); + + exports.default = BoxesInfo; +},642,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PageJumpType = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var PageJumpType = { + HIDDEN_SLUG: "hiddenSlug", + PARENT: "parent", + SLUG: "slug" + }; + exports.PageJumpType = PageJumpType; + + var PageJump = function () { + function PageJump() { + var slug = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + var to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; + var type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ""; + var articleId = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : -1; + var articleFrom = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : -1; + (0, _classCallCheck2.default)(this, PageJump); + this.slug = slug; + this.from = from; + this.to = to; + this.type = type; + this.articleId = articleId; + this.articleFrom = articleFrom; + } + + (0, _createClass2.default)(PageJump, [{ + key: "getSlug", + value: function getSlug() { + return this.slug; + } + }, { + key: "getFrom", + value: function getFrom() { + return this.from; + } + }, { + key: "getTo", + value: function getTo() { + return this.to; + } + }, { + key: "hasTo", + value: function hasTo() { + return this.to !== ""; + } + }, { + key: "hasFrom", + value: function hasFrom() { + return this.from !== ""; + } + }, { + key: "getArticleId", + value: function getArticleId() { + return this.articleId; + } + }, { + key: "getArticleFrom", + value: function getArticleFrom() { + if (this.articleFrom === -1 && !this.hasTo()) { + return this.articleId; + } + + return this.articleFrom; + } + }, { + key: "setSlug", + value: function setSlug(slug) { + this.slug = slug; + } + }, { + key: "setFrom", + value: function setFrom(from) { + this.from = from; + } + }, { + key: "setTo", + value: function setTo(to) { + this.to = to; + } + }, { + key: "setType", + value: function setType(type) { + this.type = type; + } + }, { + key: "setArticleId", + value: function setArticleId(articleId) { + this.articleId = articleId; + } + }, { + key: "isHiddenSlug", + value: function isHiddenSlug() { + return this.type === PageJumpType.HIDDEN_SLUG; + } + }, { + key: "isParent", + value: function isParent() { + return this.type === PageJumpType.PARENT; + } + }, { + key: "isSlug", + value: function isSlug() { + return this.type === PageJumpType.SLUG; + } + }, { + key: "toString", + value: function toString() { + var string = "\"" + this.slug + "\":"; + string += "{"; + + if (this.from) { + string += "\"from\":\"" + this.from + "\","; + } + + if (this.to) { + string += "\"to\":\"" + this.to + "\","; + } + + if (this.type) { + string += "\"type\":\"" + this.type + "\","; + } + + if (this.articleId > -1) { + string += "\"artid\":\"art_" + this.articleId + ".xml\""; + } + + if (this.articleFrom > -1) { + string += "\"articlefrom\":\"art_" + this.articleFrom + ".xml\""; + } + + string += "}"; + return string; + } + }]); + return PageJump; + }(); + + exports.default = PageJump; +},643,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _PageJump = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var Edition = function () { + function Edition(issue, edition) { + (0, _classCallCheck2.default)(this, Edition); + this.issue = issue; + this.edition = edition; + this.pages = []; + this.hasSpecialSections = false; + } + + (0, _createClass2.default)(Edition, [{ + key: "getIssue", + value: function getIssue() { + return this.issue; + } + }, { + key: "setIssue", + value: function setIssue(issue) { + this.issue = issue; + } + }, { + key: "getIssueId", + value: function getIssueId() { + return this.issueId; + } + }, { + key: "setIssueId", + value: function setIssueId(issueId) { + this.issueId = issueId; + } + }, { + key: "getEdition", + value: function getEdition() { + return this.edition; + } + }, { + key: "setEdition", + value: function setEdition(edition) { + this.edition = edition; + } + }, { + key: "getPages", + value: function getPages() { + var forceShowAll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (forceShowAll) { + return this.pages; + } + + return this.pages.filter(function (page) { + return page.isVisible(); + }); + } + }, { + key: "setPages", + value: function setPages(pages) { + this.pages = pages; + } + }, { + key: "getFirstPage", + value: function getFirstPage() { + if (this.pages) { + return this.pages[0]; + } + + return null; + } + }, { + key: "getPageById", + value: function getPageById(pageId) { + if (this.pages && pageId !== undefined) { + return this.pages.find(function (page) { + return page.getPageId() === pageId; + }); + } + + return undefined; + } + }, { + key: "getPageByArticle", + value: function getPageByArticle(article) { + if (this.pages && article !== undefined) { + return this.pages.find(function (page) { + return page.getPageId() === article.getPageId(); + }); + } + + return undefined; + } + }, { + key: "updatePage", + value: function updatePage(page) { + var index = this.pages.findIndex(function (_ref) { + var pageId = _ref.pageId, + issueId = _ref.issueId; + return pageId === page.pageId && issueId === page.issueId; + }); + + if (index >= 0) { + this.pages[index] = page; + } else { + this.pages.push(page); + this.pages.sort(function (a, b) { + if (a.page < b.page) { + return -1; + } + + if (a.page > b.page) { + return 1; + } + + return 0; + }); + } + } + }, { + key: "removePage", + value: function removePage(page) { + var index = this.pages.findIndex(function (_ref2) { + var pageId = _ref2.pageId, + issueId = _ref2.issueId; + return pageId === page.pageId && issueId === page.issueId; + }); + + if (index >= 0) { + this.pages.splice(index, 1); + } + } + }, { + key: "isEmpty", + value: function isEmpty() { + return !this.pages || this.pages.length === 0; + } + }, { + key: "setIsLite", + value: function setIsLite(isLite) { + this.isLite = isLite; + } + }, { + key: "setIsInvalid", + value: function setIsInvalid(isInvalid) { + this.isInvalid = isInvalid; + } + }, { + key: "isUseShownPage", + value: function isUseShownPage() { + return this.useShownPage; + } + }, { + key: "setUseShownPage", + value: function setUseShownPage(useShownPage) { + this.useShownPage = useShownPage; + } + }, { + key: "useArticleInc", + value: function useArticleInc() { + return this.useArticleInc; + } + }, { + key: "setUseArticleInc", + value: function setUseArticleInc(useArticleInc) { + this.useArticleInc = useArticleInc; + } + }, { + key: "setHasSpecialSections", + value: function setHasSpecialSections(hasSpecialSections) { + this.hasSpecialSections = hasSpecialSections; + } + }, { + key: "setHasPhotoGalleries", + value: function setHasPhotoGalleries(hasPhotoGalleries) { + this.hasPhotoGalleries = hasPhotoGalleries; + } + }, { + key: "getDownloadTime", + value: function getDownloadTime() { + return this.downloadTime; + } + }, { + key: "setDownloadTime", + value: function setDownloadTime(downloadTime) { + this.downloadTime = downloadTime; + } + }, { + key: "setUpdated", + value: function setUpdated(updated) { + this.updated = updated; + } + }, { + key: "isUpdated", + value: function isUpdated() { + return this.updated; + } + }, { + key: "setPaper", + value: function setPaper(paper) { + this.paper = paper; + } + }, { + key: "getPaper", + value: function getPaper() { + return this.paper; + } + }, { + key: "setModifyTime", + value: function setModifyTime(modifyTime) { + this.modifyTime = modifyTime; + } + }, { + key: "getModifyTime", + value: function getModifyTime() { + return this.modifyTime; + } + }, { + key: "setCustomIndexModifyTime", + value: function setCustomIndexModifyTime(modifyTime) { + this.customIndexModifyTime = modifyTime; + } + }, { + key: "getCustomIndexModifyTime", + value: function getCustomIndexModifyTime() { + return this.customIndexModifyTime; + } + }, { + key: "setCustomIndexHtml", + value: function setCustomIndexHtml(html) { + this.customIndexHtml = html; + } + }, { + key: "getCustomIndexHtml", + value: function getCustomIndexHtml() { + return this.customIndexHtml; + } + }, { + key: "getFirstArticleInChain", + value: function getFirstArticleInChain(article) { + var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + var firstArticle = article; + var currentArticleIndex = index; + + if (article) { + var from = article.getPageJumps().find(function (pageJump) { + return pageJump.hasFrom(); + }); + + if (from) { + var newFirstArticle = this.getArticleFromPageJump(from.getFrom(), from.getArticleFrom()); + + if (newFirstArticle) { + var _this$getFirstArticle = this.getFirstArticleInChain(newFirstArticle, currentArticleIndex + 1); + + firstArticle = _this$getFirstArticle.firstArticle; + currentArticleIndex = _this$getFirstArticle.currentArticleIndex; + } + } + } + + return { + firstArticle: firstArticle, + currentArticleIndex: currentArticleIndex + }; + } + }, { + key: "getChainOfArticle", + value: function getChainOfArticle(article) { + var _this = this; + + var chains = []; + + if (article) { + var _this$getFirstArticle2 = this.getFirstArticleInChain(article), + nextArticle = _this$getFirstArticle2.firstArticle; + + do { + chains.push(nextArticle); + var to = nextArticle.getPageJumps().find(function (pageJump) { + return pageJump.hasTo(); + }); + nextArticle = undefined; + + if (to) { + (function () { + var newArticle = _this.getArticleFromPageJump(to.getTo(), to.getArticleId()); + + if (chains.find(function (chainArticle) { + return chainArticle.getPageId() === newArticle.getPageId() && chainArticle.getXmlId() === newArticle.getXmlId(); + }) === undefined) { + nextArticle = newArticle; + } + })(); + } + } while (nextArticle); + } + + return chains; + } + }, { + key: "getNextArticleInChain", + value: function getNextArticleInChain(article) { + var to = article.getPageJumps().find(function (pageJump) { + return pageJump.hasTo(); + }); + + if (to) { + return this.getArticleFromPageJump(to.getTo(), to.getArticleId()); + } + + return undefined; + } + }, { + key: "getChildArts", + value: function getChildArts(article) { + var page; + var articles = []; + + if (article) { + page = this.getPages(true).find(function (item) { + return item.getPageId() === article.getPageId(); + }); + + if (page) { + articles = page.getArticles().filter(function (child) { + return child.getChildart() === article.getXmlId(); + }); + } + } + + return { + page: page, + articles: articles + }; + } + }, { + key: "getArticleFromPageJump", + value: function getArticleFromPageJump(page, artId) { + try { + var found = this.getPages(true).find(function (item) { + return item.getPage() === page; + }); + + if (found) { + return found.getArticles().find(function (article) { + return article.getXmlId() == artId; + }); + } + } catch (e) {} + + return undefined; + } + }, { + key: "isFirstPageDoubleTruck", + value: function isFirstPageDoubleTruck() { + var firstPage = this.getFirstPage(); + return firstPage ? firstPage.isDoubleTruck() : false; + } + }]); + return Edition; + }(); + + exports.default = Edition; +},644,[5,7,8,640,638,643]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.adaptIndexForRTL = adaptIndexForRTL; + exports.fixStartupIndex = fixStartupIndex; + exports.runTiming = runTiming; + exports.pagesVisibleArea = pagesVisibleArea; + + var _reactNativeReanimated = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var TIMING_DURATION = 300; + var set = _reactNativeReanimated.default.set, + cond = _reactNativeReanimated.default.cond, + Value = _reactNativeReanimated.default.Value, + clockRunning = _reactNativeReanimated.default.clockRunning, + stopClock = _reactNativeReanimated.default.stopClock, + startClock = _reactNativeReanimated.default.startClock, + timing = _reactNativeReanimated.default.timing; + + function adaptIndexForRTL(index, nPages) { + var toReturn; + + if (!_$$_REQUIRE(_dependencyMap[1]).PlatformUtils.isRTL()) { + toReturn = index; + } else { + toReturn = Math.min(Math.max(0, nPages - 1 - index), nPages - 1); + } + + return toReturn; + } + + function fixStartupIndex(index, nPages, pagesVisible, isRtl) { + var toReturn; + + if (pagesVisible === 1) { + toReturn = index; + } else if (index === 0) { + toReturn = index; + } else if (index === nPages - 1) { + toReturn = index - 1; + } else if (isRtl && nPages % 2 === 1) { + if (index % 2 === 0) { + toReturn = index; + } else { + toReturn = index - 1; + } + } else if (isRtl && index % 2 === 0) { + toReturn = index - 1; + } else if (index % 2 === 1) { + toReturn = index; + } else { + toReturn = index - 1; + } + + return toReturn; + } + + function runTiming(clock, value, dest) { + var params = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var _params$onEnd = params.onEnd, + onEnd = _params$onEnd === undefined ? [] : _params$onEnd, + _params$startStopCloc = params.startStopClock, + startStopClock = _params$startStopCloc === undefined ? true : _params$startStopCloc, + _params$duration = params.duration, + duration = _params$duration === undefined ? TIMING_DURATION : _params$duration, + _params$easing = params.easing, + easing = _params$easing === undefined ? _reactNativeReanimated.Easing.linear : _params$easing; + var state = { + finished: new Value(0), + position: new Value(0), + frameTime: new Value(0), + time: new Value(0) + }; + var config = { + toValue: new Value(0), + duration: duration, + easing: easing + }; + return [cond(clockRunning(clock), 0, [set(state.finished, 0), set(state.frameTime, 0), set(state.time, 0), set(state.position, value), set(config.toValue, dest), startStopClock && startClock(clock)]), timing(clock, state, config), cond(state.finished, [onEnd, startStopClock && stopClock(clock)]), state.position]; + } + + function pagesVisibleArea(notAnimatedStatus) { + var _panX = notAnimatedStatus._panX, + _panY = notAnimatedStatus._panY, + _limits = notAnimatedStatus._limits, + _top = notAnimatedStatus._top, + _left = notAnimatedStatus._left, + _horizontalMargin = notAnimatedStatus._horizontalMargin, + _pageWidth = notAnimatedStatus._width, + _viewWidth = notAnimatedStatus._viewWidth, + _viewHeight = notAnimatedStatus._viewHeight, + _pagesVisible = notAnimatedStatus._pagesVisible, + _scale = notAnimatedStatus._scale; + var pages = []; + var numVisiblePages = _limits.length - 1; + var scalePageWidth = _pageWidth * _scale; + + var visibleContentOverflow = _horizontalMargin - Math.max(0, (_viewWidth - scalePageWidth * _pagesVisible) / 2); + + var whiteAreaSize = (_horizontalMargin - visibleContentOverflow) * 2; + var y = (_top - _panY) / _scale; + var absoluteX = -1 * _left + _panX; + + for (var i = 0; i < numVisiblePages; i++) { + var limit = _limits[i]; + var x = i === 0 ? (limit - absoluteX - visibleContentOverflow) / _scale : 0; + var index = Math.round(Math.abs(limit) / scalePageWidth); + var viewWidth = _viewWidth / _scale; + var viewHeight = _viewHeight / _scale; + + if (numVisiblePages > 1) { + if (i === 0) { + viewWidth = Math.abs(_pageWidth - x); + } else if (_limits[i] > absoluteX - _viewWidth) { + if (_limits[i] - scalePageWidth > absoluteX - _viewWidth + whiteAreaSize) { + viewWidth = _pageWidth; + } else { + viewWidth = Math.abs(absoluteX - _viewWidth + whiteAreaSize - _limits[i]) / _scale; + } + } + } + + if (viewWidth >= 1) { + pages.push({ + x: x, + y: y, + width: viewWidth || 0, + height: viewHeight, + index: index + }); + } + } + + return pages; + } +},645,[646,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _exportNames = { + decay: true, + timing: true, + spring: true, + Easing: true, + Clock: true, + Value: true, + Node: true, + Transition: true, + Transitioning: true, + createTransitioningComponent: true, + SpringUtils: true, + useValue: true + }; + Object.defineProperty(exports, "Easing", { + enumerable: true, + get: function get() { + return _Easing.default; + } + }); + Object.defineProperty(exports, "Clock", { + enumerable: true, + get: function get() { + return _AnimatedClock.default; + } + }); + Object.defineProperty(exports, "Value", { + enumerable: true, + get: function get() { + return _AnimatedValue.default; + } + }); + Object.defineProperty(exports, "Node", { + enumerable: true, + get: function get() { + return _AnimatedNode.default; + } + }); + Object.defineProperty(exports, "Transition", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).Transition; + } + }); + Object.defineProperty(exports, "Transitioning", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).Transitioning; + } + }); + Object.defineProperty(exports, "createTransitioningComponent", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).createTransitioningComponent; + } + }); + Object.defineProperty(exports, "SpringUtils", { + enumerable: true, + get: function get() { + return _SpringUtils.default; + } + }); + Object.defineProperty(exports, "useValue", { + enumerable: true, + get: function get() { + return _useValue.default; + } + }); + exports.spring = exports.timing = exports.decay = exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _Easing = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); + + var _AnimatedClock = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedValue = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[7])); + + var _AnimatedCode = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[8])); + + var base = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + Object.keys(base).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === base[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return base[key]; + } + }); + }); + + var derived = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + Object.keys(derived).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === derived[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return derived[key]; + } + }); + }); + + var _createAnimatedComponent = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[11])); + + var _decay = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[12])); + + var _timing = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[13])); + + var _spring = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[14])); + + var _Animation = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[15])); + + var _backwardCompatibleAnimWrapper = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[16])); + + var _SpringUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[17])); + + var _useValue = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[18])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var decayWrapper = (0, _backwardCompatibleAnimWrapper.default)(_decay.default, _Animation.default.decayDefaultState); + exports.decay = decayWrapper; + var timingWrapper = (0, _backwardCompatibleAnimWrapper.default)(_timing.default, _Animation.default.timingDefaultState); + exports.timing = timingWrapper; + var springWrapper = (0, _backwardCompatibleAnimWrapper.default)(_spring.default, _Animation.default.springDefaultState); + exports.spring = springWrapper; + var Animated = (0, _extends2.default)({ + View: (0, _createAnimatedComponent.default)(_reactNative.View), + Text: (0, _createAnimatedComponent.default)(_reactNative.Text), + Image: (0, _createAnimatedComponent.default)(_reactNative.Image), + ScrollView: (0, _createAnimatedComponent.default)(_reactNative.ScrollView), + Code: _AnimatedCode.default, + createAnimatedComponent: _createAnimatedComponent.default, + Clock: _AnimatedClock.default, + Value: _AnimatedValue.default, + Node: _AnimatedNode.default + }, base, derived, { + decay: decayWrapper, + timing: timingWrapper, + spring: springWrapper, + SpringUtils: _SpringUtils.default, + addWhitelistedNativeProps: _$$_REQUIRE(_dependencyMap[19]).addWhitelistedNativeProps, + addWhitelistedUIProps: _$$_REQUIRE(_dependencyMap[19]).addWhitelistedUIProps, + useValue: _useValue.default + }); + var _default = Animated; + exports.default = _default; +},646,[647,5,6,28,649,659,667,651,677,653,679,686,691,692,693,694,695,696,697,698]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createTransitioningComponent = createTransitioningComponent; + exports.Transition = exports.Transitioning = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _ReanimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TransitioningContext = _react.default.createContext(); + + function configFromProps(type, props) { + var config = { + type: type + }; + + if ('durationMs' in props) { + config.durationMs = props.durationMs; + } + + if ('interpolation' in props) { + config.interpolation = props.interpolation; + } + + if ('type' in props) { + config.animation = props.type; + } + + if ('delayMs' in props) { + config.delayMs = props.delayMs; + } + + if ('propagation' in props) { + config.propagation = props.propagation; + } + + return config; + } + + function wrapTransitioningContext(Comp) { + return function (props) { + return _react.default.createElement(TransitioningContext.Consumer, null, function (context) { + return _react.default.createElement(Comp, (0, _extends2.default)({ + context: context + }, props)); + }); + }; + } + + var In = function (_React$Component) { + (0, _inherits2.default)(In, _React$Component); + + var _super = _createSuper(In); + + function In() { + (0, _classCallCheck2.default)(this, In); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(In, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.props.context.push(configFromProps('in', this.props)); + } + }, { + key: "render", + value: function render() { + return this.props.children || null; + } + }]); + return In; + }(_react.default.Component); + + var Change = function (_React$Component2) { + (0, _inherits2.default)(Change, _React$Component2); + + var _super2 = _createSuper(Change); + + function Change() { + (0, _classCallCheck2.default)(this, Change); + return _super2.apply(this, arguments); + } + + (0, _createClass2.default)(Change, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.props.context.push(configFromProps('change', this.props)); + } + }, { + key: "render", + value: function render() { + return this.props.children || null; + } + }]); + return Change; + }(_react.default.Component); + + var Out = function (_React$Component3) { + (0, _inherits2.default)(Out, _React$Component3); + + var _super3 = _createSuper(Out); + + function Out() { + (0, _classCallCheck2.default)(this, Out); + return _super3.apply(this, arguments); + } + + (0, _createClass2.default)(Out, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.props.context.push(configFromProps('out', this.props)); + } + }, { + key: "render", + value: function render() { + return this.props.children || null; + } + }]); + return Out; + }(_react.default.Component); + + var Together = function (_React$Component4) { + (0, _inherits2.default)(Together, _React$Component4); + + var _super4 = _createSuper(Together); + + function Together() { + var _this; + + (0, _classCallCheck2.default)(this, Together); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super4.call.apply(_super4, [this].concat(args)); + _this.transitions = []; + return _this; + } + + (0, _createClass2.default)(Together, [{ + key: "componentDidMount", + value: function componentDidMount() { + var config = configFromProps('group', this.props); + config.transitions = this.transitions; + this.props.context.push(config); + } + }, { + key: "render", + value: function render() { + return _react.default.createElement(TransitioningContext.Provider, { + value: this.transitions + }, this.props.children); + } + }]); + return Together; + }(_react.default.Component); + + var Sequence = function (_React$Component5) { + (0, _inherits2.default)(Sequence, _React$Component5); + + var _super5 = _createSuper(Sequence); + + function Sequence() { + var _this2; + + (0, _classCallCheck2.default)(this, Sequence); + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this2 = _super5.call.apply(_super5, [this].concat(args)); + _this2.transitions = []; + return _this2; + } + + (0, _createClass2.default)(Sequence, [{ + key: "componentDidMount", + value: function componentDidMount() { + var config = configFromProps('group', this.props); + config.sequence = true; + config.transitions = this.transitions; + this.props.context.push(config); + } + }, { + key: "render", + value: function render() { + return _react.default.createElement(TransitioningContext.Provider, { + value: this.transitions + }, this.props.children); + } + }]); + return Sequence; + }(_react.default.Component); + + function createTransitioningComponent(Component) { + var Wrapped = function (_React$Component6) { + (0, _inherits2.default)(Wrapped, _React$Component6); + + var _super6 = _createSuper(Wrapped); + + function Wrapped() { + var _this3; + + (0, _classCallCheck2.default)(this, Wrapped); + + for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { + args[_key3] = arguments[_key3]; + } + + _this3 = _super6.call.apply(_super6, [this].concat(args)); + _this3.propTypes = Component.propTypes; + _this3.transitions = []; + _this3.viewRef = _react.default.createRef(); + return _this3; + } + + (0, _createClass2.default)(Wrapped, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (this.props.animateMount) { + this.animateNextTransition(); + } + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + this.viewRef.current.setNativeProps(props); + } + }, { + key: "animateNextTransition", + value: function animateNextTransition() { + var viewTag = (0, _reactNative.findNodeHandle)(this.viewRef.current); + + _ReanimatedModule.default.animateNextTransition(viewTag, { + transitions: this.transitions + }); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + transition = _this$props.transition, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["transition"]); + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(TransitioningContext.Provider, { + value: this.transitions + }, transition), _react.default.createElement(Component, (0, _extends2.default)({}, rest, { + ref: this.viewRef, + collapsable: false + }))); + } + }]); + return Wrapped; + }(_react.default.Component); + + return Wrapped; + } + + var Transitioning = { + View: createTransitioningComponent(_reactNative.View) + }; + exports.Transitioning = Transitioning; + var Transition = { + Sequence: wrapTransitioningContext(Sequence), + Together: wrapTransitioningContext(Together), + In: wrapTransitioningContext(In), + Out: wrapTransitioningContext(Out), + Change: wrapTransitioningContext(Change) + }; + exports.Transition = Transition; +},647,[5,108,7,8,12,14,16,6,17,28,648]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var ReanimatedModule = _reactNative.NativeModules.ReanimatedModule; + var _default = ReanimatedModule; + exports.default = _default; +},648,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _AnimatedBezier = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var Easing = function () { + function Easing() { + (0, _classCallCheck2.default)(this, Easing); + } + + (0, _createClass2.default)(Easing, null, [{ + key: "linear", + value: function linear(t) { + return t; + } + }, { + key: "ease", + value: function ease(t) { + return new _AnimatedBezier.default(t, 0.42, 0, 1, 1); + } + }, { + key: "quad", + value: function quad(t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, t); + } + }, { + key: "cubic", + value: function cubic(t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, t, t); + } + }, { + key: "poly", + value: function poly(n) { + return function (t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).pow)(t, n); + }; + } + }, { + key: "sin", + value: function sin(t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, (0, _$$_REQUIRE(_dependencyMap[4]).cos)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, Math.PI, 0.5))); + } + }, { + key: "circle", + value: function circle(t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, (0, _$$_REQUIRE(_dependencyMap[4]).sqrt)((0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, t)))); + } + }, { + key: "exp", + value: function exp(t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).pow)(2, (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(10, (0, _$$_REQUIRE(_dependencyMap[4]).sub)(t, 1))); + } + }, { + key: "elastic", + value: function elastic() { + var bounciness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var p = bounciness * Math.PI; + return function (t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, (0, _$$_REQUIRE(_dependencyMap[4]).multiply)((0, _$$_REQUIRE(_dependencyMap[4]).pow)((0, _$$_REQUIRE(_dependencyMap[4]).cos)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, Math.PI, 0.5)), 3), (0, _$$_REQUIRE(_dependencyMap[4]).cos)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, p)))); + }; + } + }, { + key: "back", + value: function back(s) { + if (s === undefined) { + s = 1.70158; + } + + return function (t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, t, (0, _$$_REQUIRE(_dependencyMap[4]).sub)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)((0, _$$_REQUIRE(_dependencyMap[4]).add)(s, 1), t), s)); + }; + } + }, { + key: "bounce", + value: function bounce(t) { + var sq = function sq(v) { + return (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(7.5625, v, v); + }; + + return (0, _$$_REQUIRE(_dependencyMap[4]).cond)((0, _$$_REQUIRE(_dependencyMap[4]).lessThan)(t, 0.36363636363636365), sq(t), (0, _$$_REQUIRE(_dependencyMap[4]).cond)((0, _$$_REQUIRE(_dependencyMap[4]).lessThan)(t, 0.7272727272727273), (0, _$$_REQUIRE(_dependencyMap[4]).add)(0.75, sq((0, _$$_REQUIRE(_dependencyMap[4]).sub)(t, 0.5454545454545454))), (0, _$$_REQUIRE(_dependencyMap[4]).cond)((0, _$$_REQUIRE(_dependencyMap[4]).lessThan)(t, 0.9057971014492754), (0, _$$_REQUIRE(_dependencyMap[4]).add)(0.9375, sq((0, _$$_REQUIRE(_dependencyMap[4]).sub)(t, 0.8181818181818182))), (0, _$$_REQUIRE(_dependencyMap[4]).add)(0.984375, sq((0, _$$_REQUIRE(_dependencyMap[4]).sub)(t, 0.9545454545454546)))))); + } + }, { + key: "bezier", + value: function bezier(x1, y1, x2, y2) { + return function (t) { + return new _AnimatedBezier.default(t, x1, y1, x2, y2); + }; + } + }, { + key: "in", + value: function _in(easing) { + return easing; + } + }, { + key: "out", + value: function out(easing) { + return function (t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, easing((0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, t))); + }; + } + }, { + key: "inOut", + value: function inOut(easing) { + return function (t) { + return (0, _$$_REQUIRE(_dependencyMap[4]).cond)((0, _$$_REQUIRE(_dependencyMap[4]).lessThan)(t, 0.5), (0, _$$_REQUIRE(_dependencyMap[4]).divide)(easing((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, 2)), 2), (0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, (0, _$$_REQUIRE(_dependencyMap[4]).divide)(easing((0, _$$_REQUIRE(_dependencyMap[4]).multiply)((0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, t), 2)), 2))); + }; + } + }]); + return Easing; + }(); + + exports.default = Easing; +},649,[5,7,8,650,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NEWTON_ITERATIONS = 4; + var NEWTON_MIN_SLOPE = 0.001; + var SUBDIVISION_PRECISION = 0.0000001; + var SUBDIVISION_MAX_ITERATIONS = 10; + var kSplineTableSize = 11; + var kSampleStepSize = 0.1; + var float32ArraySupported = typeof Float32Array === 'function'; + + function A(aA1, aA2) { + return 1.0 - 3.0 * aA2 + 3.0 * aA1; + } + + function B(aA1, aA2) { + return 3.0 * aA2 - 6.0 * aA1; + } + + function C(aA1) { + return 3.0 * aA1; + } + + function calcBezier(aT, aA1, aA2) { + return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT; + } + + function getSlope(aT, aA1, aA2) { + return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1); + } + + function binarySubdivide(aX, aA, aB, mX1, mX2) { + var currentX = 0; + var currentT = 0; + var i = 0; + + do { + currentT = aA + (aB - aA) / 2.0; + currentX = calcBezier(currentT, mX1, mX2) - aX; + + if (currentX > 0.0) { + aB = currentT; + } else { + aA = currentT; + } + } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS); + + return currentT; + } + + function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) { + for (var i = 0; i < NEWTON_ITERATIONS; ++i) { + var currentSlope = getSlope(aGuessT, mX1, mX2); + + if (currentSlope === 0.0) { + return aGuessT; + } + + var currentX = calcBezier(aGuessT, mX1, mX2) - aX; + aGuessT -= currentX / currentSlope; + } + + return aGuessT; + } + + function bezier(mX1, mY1, mX2, mY2) { + var sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize); + + if (mX1 !== mY1 || mX2 !== mY2) { + for (var i = 0; i < kSplineTableSize; ++i) { + sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2); + } + } + + function getTForX(aX) { + var intervalStart = 0.0; + var currentSample = 1; + var lastSample = 10; + + for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) { + intervalStart += kSampleStepSize; + } + + --currentSample; + var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]); + var guessForT = intervalStart + dist * kSampleStepSize; + var initialSlope = getSlope(guessForT, mX1, mX2); + + if (initialSlope >= NEWTON_MIN_SLOPE) { + return newtonRaphsonIterate(aX, guessForT, mX1, mX2); + } else if (initialSlope === 0.0) { + return guessForT; + } else { + return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2); + } + } + + return function BezierEasing(x) { + if (mX1 === mY1 && mX2 === mY2) { + return x; + } + + if (x === 0) { + return 0; + } + + if (x === 1) { + return 1; + } + + return calcBezier(getTForX(x), mY1, mY2); + }; + } + + var AnimatedBezier = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedBezier, _AnimatedNode); + + var _super = _createSuper(AnimatedBezier); + + function AnimatedBezier(value, mX1, mY1, mX2, mY2) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedBezier); + (0, _invariant.default)(value instanceof _AnimatedNode2.default, "Reanimated: Bezier node argument should be of type AnimatedNode but got " + value); + _this = _super.call(this, { + type: 'bezier', + mX1: mX1, + mY1: mY1, + mX2: mX2, + mY2: mY2, + input: value + }, [value]); + _this._value = value; + _this._bezier = bezier(mX1, mY1, mX2, mY2); + return _this; + } + + (0, _createClass2.default)(AnimatedBezier, [{ + key: "toString", + value: function toString() { + return "AnimatedBezier, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + return this._bezier((0, _$$_REQUIRE(_dependencyMap[8]).val)(this._value)); + } + }]); + return AnimatedBezier; + }(_AnimatedNode2.default); + + exports.default = AnimatedBezier; +},650,[5,7,8,12,14,16,651,601,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getCallID = getCallID; + exports.setCallID = setCallID; + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _ReanimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var UPDATED_NODES = []; + var loopID = 1; + var propUpdatesEnqueued = null; + var nodeCount = 0; + var callID = ""; + + function getCallID() { + return callID; + } + + function setCallID(nextCallID) { + callID = nextCallID; + } + + function sanitizeConfig(config) { + if (_reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'windows' || _reactNative.Platform.OS === 'macos' || ['undefined', 'string', 'function', 'boolean', 'number'].includes(typeof config)) { + return config; + } else if (Array.isArray(config)) { + return config.map(sanitizeConfig); + } else if (config instanceof AnimatedNode) { + return config.__nodeID; + } else if (typeof config === 'object') { + var output = {}; + + for (var property in config) { + if (property in config) { + output[property] = sanitizeConfig(config[property]); + } + } + + return output; + } + + return config; + } + + function runPropUpdates() { + var visitedNodes = new Set(); + + var findAndUpdateNodes = function findAndUpdateNodes(node) { + if (!node) { + console.warn('findAndUpdateNodes was passed a nullish node'); + return; + } + + if (visitedNodes.has(node)) { + return; + } else { + visitedNodes.add(node); + } + + if (typeof node.update === 'function') { + node.update(); + } else { + var nodes = node.__getChildren(); + + if (nodes) { + for (var i = 0, l = nodes.length; i < l; i++) { + findAndUpdateNodes(nodes[i]); + } + } + } + }; + + for (var i = 0; i < UPDATED_NODES.length; i++) { + var node = UPDATED_NODES[i]; + findAndUpdateNodes(node); + } + + UPDATED_NODES.length = 0; + propUpdatesEnqueued = null; + loopID += 1; + } + + var scheduleUpdates = _reactNative.Platform.OS === 'web' ? requestAnimationFrame : setImmediate; + + var AnimatedNode = function () { + function AnimatedNode(nodeConfig, inputNodes) { + (0, _classCallCheck2.default)(this, AnimatedNode); + this.__lastLoopID = { + "": -1 + }; + this.__memoizedValue = { + "": null + }; + this.__children = []; + this.__nodeID = ++nodeCount; + this.__nodeConfig = sanitizeConfig(nodeConfig); + this.__initialized = false; + this.__inputNodes = inputNodes && inputNodes.filter(function (node) { + return node instanceof AnimatedNode; + }); + } + + (0, _createClass2.default)(AnimatedNode, [{ + key: "toString", + value: function toString() { + return "AnimatedNode, id: " + this.__nodeID; + } + }, { + key: "__attach", + value: function __attach() { + this.__nativeInitialize(); + + var nodes = this.__inputNodes; + + if (nodes) { + for (var i = 0, l = nodes.length; i < l; i++) { + nodes[i].__addChild(this); + } + } + } + }, { + key: "__detach", + value: function __detach() { + var nodes = this.__inputNodes; + + if (nodes) { + for (var i = 0, l = nodes.length; i < l; i++) { + nodes[i].__removeChild(this); + } + } + + this.__nativeTearDown(); + } + }, { + key: "__getValue", + value: function __getValue() { + if (!(callID in this.__lastLoopID) || this.__lastLoopID[callID] < loopID) { + this.__lastLoopID[callID] = loopID; + + var result = this.__onEvaluate(); + + this.__memoizedValue[callID] = result; + return result; + } + + return this.__memoizedValue[callID]; + } + }, { + key: "__forceUpdateCache", + value: function __forceUpdateCache(newValue) { + this.__memoizedValue[callID] = newValue; + + this.__markUpdated(); + } + }, { + key: "__dangerouslyRescheduleEvaluate", + value: function __dangerouslyRescheduleEvaluate() { + this.__lastLoopID[callID] = -1; + + this.__markUpdated(); + } + }, { + key: "__markUpdated", + value: function __markUpdated() { + UPDATED_NODES.push(this); + + if (!propUpdatesEnqueued) { + propUpdatesEnqueued = scheduleUpdates(runPropUpdates); + } + } + }, { + key: "__nativeInitialize", + value: function __nativeInitialize() { + if (!this.__initialized) { + _ReanimatedModule.default.createNode(this.__nodeID, (0, _extends2.default)({}, this.__nodeConfig)); + + this.__initialized = true; + } + } + }, { + key: "__nativeTearDown", + value: function __nativeTearDown() { + if (this.__initialized) { + _ReanimatedModule.default.dropNode(this.__nodeID); + + this.__initialized = false; + } + } + }, { + key: "isNativelyInitialized", + value: function isNativelyInitialized() { + return this.__initialized; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + throw new Error('Missing implementation of onEvaluate'); + } + }, { + key: "__getProps", + value: function __getProps() { + return this.__getValue(); + } + }, { + key: "__getChildren", + value: function __getChildren() { + return this.__children; + } + }, { + key: "__addChild", + value: function __addChild(child) { + if (this.__children.length === 0) { + this.__attach(); + } + + this.__children.push(child); + + child.__nativeInitialize(); + + if (_ReanimatedModule.default.connectNodes) { + _ReanimatedModule.default.connectNodes(this.__nodeID, child.__nodeID); + } else { + child.__dangerouslyRescheduleEvaluate(); + } + } + }, { + key: "__removeChild", + value: function __removeChild(child) { + var index = this.__children.indexOf(child); + + if (index === -1) { + console.warn("Trying to remove a child that doesn't exist"); + return; + } + + if (_ReanimatedModule.default.disconnectNodes) { + _ReanimatedModule.default.disconnectNodes(this.__nodeID, child.__nodeID); + } + + this.__children.splice(index, 1); + + if (this.__children.length === 0) { + this.__detach(); + } + } + }, { + key: "_connectAnimatedView", + value: function _connectAnimatedView(nativeViewTag) { + if (_ReanimatedModule.default.connectNodeToView) { + _ReanimatedModule.default.connectNodeToView(this.__nodeID, nativeViewTag); + } else { + this.__dangerouslyRescheduleEvaluate(); + } + } + }, { + key: "_disconnectAnimatedView", + value: function _disconnectAnimatedView(nativeViewTag) { + _ReanimatedModule.default.disconnectNodeFromView(this.__nodeID, nativeViewTag); + } + }]); + return AnimatedNode; + }(); + + exports.default = AnimatedNode; +},651,[5,6,7,8,648,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.val = val; + + function val(v) { + return v && v.__getValue ? v.__getValue() : v || 0; + } +},652,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _exportNames = { + cond: true, + set: true, + startClock: true, + stopClock: true, + clockRunning: true, + debug: true, + call: true, + event: true, + always: true, + concat: true, + block: true, + adapt: true, + proc: true + }; + Object.defineProperty(exports, "cond", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).createAnimatedCond; + } + }); + Object.defineProperty(exports, "set", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).createAnimatedSet; + } + }); + Object.defineProperty(exports, "startClock", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).createAnimatedStartClock; + } + }); + Object.defineProperty(exports, "stopClock", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).createAnimatedStopClock; + } + }); + Object.defineProperty(exports, "clockRunning", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[4]).createAnimatedClockTest; + } + }); + Object.defineProperty(exports, "debug", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[5]).createAnimatedDebug; + } + }); + Object.defineProperty(exports, "call", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[6]).createAnimatedCall; + } + }); + Object.defineProperty(exports, "event", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[7]).createAnimatedEvent; + } + }); + Object.defineProperty(exports, "always", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[8]).createAnimatedAlways; + } + }); + Object.defineProperty(exports, "concat", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[9]).createAnimatedConcat; + } + }); + Object.defineProperty(exports, "block", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[10]).createAnimatedBlock; + } + }); + Object.defineProperty(exports, "adapt", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[10]).adapt; + } + }); + Object.defineProperty(exports, "proc", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[11]).createAnimatedFunction; + } + }); + Object.keys(_$$_REQUIRE(_dependencyMap[12])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[12])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[12])[key]; + } + }); + }); +},653,[654,657,658,661,662,663,664,666,674,676,655,669,671]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedCond = createAnimatedCond; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedCond = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedCond, _AnimatedNode); + + var _super = _createSuper(AnimatedCond); + + function AnimatedCond(condition, ifBlock, elseBlock) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedCond); + (0, _invariant.default)(condition instanceof _AnimatedNode2.default, "Reanimated: Animated.cond node first argument should be of type AnimatedNode but got " + condition); + (0, _invariant.default)(ifBlock instanceof _AnimatedNode2.default, "Reanimated: Animated.cond node second argument should be of type AnimatedNode but got " + ifBlock); + (0, _invariant.default)(elseBlock instanceof _AnimatedNode2.default || elseBlock === undefined, "Reanimated: Animated.cond node third argument should be of type AnimatedNode or should be undefined but got " + elseBlock); + _this = _super.call(this, { + type: 'cond', + cond: condition, + ifBlock: ifBlock, + elseBlock: elseBlock + }, [condition, ifBlock, elseBlock]); + _this._condition = condition; + _this._ifBlock = ifBlock; + _this._elseBlock = elseBlock; + return _this; + } + + (0, _createClass2.default)(AnimatedCond, [{ + key: "toString", + value: function toString() { + return "AnimatedCond, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + if ((0, _$$_REQUIRE(_dependencyMap[8]).val)(this._condition)) { + return (0, _$$_REQUIRE(_dependencyMap[8]).val)(this._ifBlock); + } else { + return this._elseBlock !== undefined ? (0, _$$_REQUIRE(_dependencyMap[8]).val)(this._elseBlock) : undefined; + } + } + }]); + return AnimatedCond; + }(_AnimatedNode2.default); + + function createAnimatedCond(cond, ifBlock, elseBlock) { + return new AnimatedCond((0, _$$_REQUIRE(_dependencyMap[9]).adapt)(cond), (0, _$$_REQUIRE(_dependencyMap[9]).adapt)(ifBlock), elseBlock === undefined ? undefined : (0, _$$_REQUIRE(_dependencyMap[9]).adapt)(elseBlock)); + } +},654,[5,7,8,12,14,16,601,651,652,655]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedBlock = createAnimatedBlock; + exports.adapt = adapt; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedBlock = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedBlock, _AnimatedNode); + + var _super = _createSuper(AnimatedBlock); + + function AnimatedBlock(array) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedBlock); + (0, _invariant.default)(array.every(function (el) { + return el instanceof _AnimatedNode2.default; + }), "Reanimated: Animated.block node argument should be an array with elements of type AnimatedNode. One or more of them are not AnimatedNodes"); + _this = _super.call(this, { + type: 'block', + block: array + }, array); + _this._array = array; + return _this; + } + + (0, _createClass2.default)(AnimatedBlock, [{ + key: "toString", + value: function toString() { + return "AnimatedBlock, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + var result; + + this._array.forEach(function (node) { + result = (0, _$$_REQUIRE(_dependencyMap[9]).val)(node); + }); + + return result; + } + }]); + return AnimatedBlock; + }(_AnimatedNode2.default); + + function createAnimatedBlock(items) { + return adapt(items); + } + + function nodify(v) { + if (typeof v === 'object' && v != null && v.__isProxy) { + if (!v.__val) { + v.__val = new _InternalAnimatedValue.default(0); + } + + return v.__val; + } + + return v instanceof _AnimatedNode2.default ? v : _InternalAnimatedValue.default.valueForConstant(v); + } + + function adapt(v) { + return Array.isArray(v) ? new AnimatedBlock(v.map(function (node) { + return adapt(node); + })) : nodify(v); + } +},655,[5,7,8,12,14,16,601,651,656,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _ReanimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function sanitizeValue(value) { + return value === null || value === undefined || typeof value === 'string' ? value : Number(value); + } + + var CONSTANT_VALUES = new Map(); + + function initializeConstantValues() { + if (CONSTANT_VALUES.size !== 0) { + return; + } + + [0, -1, 1, -2, 2].forEach(function (v) { + return CONSTANT_VALUES.set(v, new InternalAnimatedValue(v, true)); + }); + } + + var InternalAnimatedValue = function (_AnimatedNode) { + (0, _inherits2.default)(InternalAnimatedValue, _AnimatedNode); + + var _super = _createSuper(InternalAnimatedValue); + + function InternalAnimatedValue(value) { + var _this; + + var constant = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + (0, _classCallCheck2.default)(this, InternalAnimatedValue); + (0, _invariant.default)(value !== null, 'Animated.Value cannot be set to the null'); + _this = _super.call(this, { + type: 'value', + value: sanitizeValue(value) + }); + _this._startingValue = _this._value = value; + _this._animation = null; + _this._constant = constant; + return _this; + } + + (0, _createClass2.default)(InternalAnimatedValue, [{ + key: "__detach", + value: function __detach() { + var _this2 = this; + + if (!this._constant) { + if (_ReanimatedModule.default.getValue) { + _ReanimatedModule.default.getValue(this.__nodeID, function (val) { + return _this2.__nodeConfig.value = val; + }); + } else { + this.__nodeConfig.value = this.__getValue(); + } + } + + this.__detachAnimation(this._animation); + + (0, _get2.default)((0, _getPrototypeOf2.default)(InternalAnimatedValue.prototype), "__detach", this).call(this); + } + }, { + key: "__detachAnimation", + value: function __detachAnimation(animation) { + animation && animation.__detach(); + + if (this._animation === animation) { + this._animation = null; + } + } + }, { + key: "__attachAnimation", + value: function __attachAnimation(animation) { + this.__detachAnimation(this._animation); + + this._animation = animation; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + if (this.__inputNodes && this.__inputNodes.length) { + this.__inputNodes.forEach(_$$_REQUIRE(_dependencyMap[10]).val); + } + + return this._value; + } + }, { + key: "setValue", + value: function setValue(value) { + this.__detachAnimation(this._animation); + + this._updateValue(value); + } + }, { + key: "_updateValue", + value: function _updateValue(value) { + this._value = value; + + this.__forceUpdateCache(value); + } + }], [{ + key: "valueForConstant", + value: function valueForConstant(number) { + initializeConstantValues(); + return CONSTANT_VALUES.get(number) || new InternalAnimatedValue(number, true); + } + }]); + return InternalAnimatedValue; + }(_AnimatedNode2.default); + + exports.default = InternalAnimatedValue; +},656,[5,7,8,90,12,14,16,651,648,601,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedSet = createAnimatedSet; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedSet = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedSet, _AnimatedNode); + + var _super = _createSuper(AnimatedSet); + + function AnimatedSet(what, value) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedSet); + (0, _invariant.default)(what instanceof _AnimatedNode2.default, "Reanimated: Animated.set first argument should be of type AnimatedNode but got " + what); + (0, _invariant.default)(value instanceof _AnimatedNode2.default, "Reanimated: Animated.set second argument should be of type AnimatedNode, String or Number but got " + value); + _this = _super.call(this, { + type: 'set', + what: what, + value: value + }, [value]); + (0, _invariant.default)(!what._constant, 'Value to be set cannot be constant'); + _this._what = what; + _this._value = value; + return _this; + } + + (0, _createClass2.default)(AnimatedSet, [{ + key: "toString", + value: function toString() { + return "AnimatedSet, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + var newValue = (0, _$$_REQUIRE(_dependencyMap[8]).val)(this._value); + + this._what.setValue(newValue); + + return newValue; + } + }]); + return AnimatedSet; + }(_AnimatedNode2.default); + + function createAnimatedSet(what, value) { + return new AnimatedSet(what, (0, _$$_REQUIRE(_dependencyMap[9]).adapt)(value)); + } +},657,[5,7,8,12,14,16,651,601,652,655]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedStartClock = createAnimatedStartClock; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedClock = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedStartClock = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedStartClock, _AnimatedNode); + + var _super = _createSuper(AnimatedStartClock); + + function AnimatedStartClock(clockNode) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedStartClock); + (0, _invariant.default)(clockNode instanceof _AnimatedClock.default || clockNode instanceof _$$_REQUIRE(_dependencyMap[9]).AnimatedParam, "Reanimated: Animated.startClock argument should be of type AnimatedClock but got " + clockNode); + _this = _super.call(this, { + type: 'clockStart', + clock: clockNode + }); + _this._clockNode = clockNode; + return _this; + } + + (0, _createClass2.default)(AnimatedStartClock, [{ + key: "toString", + value: function toString() { + return "AnimatedStartClock, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + this._clockNode.start(); + + return 0; + } + }]); + return AnimatedStartClock; + }(_AnimatedNode2.default); + + function createAnimatedStartClock(clock) { + return new AnimatedStartClock(clock); + } +},658,[5,7,8,12,14,16,651,659,601,660]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedMainClock = function (_InternalAnimatedValu) { + (0, _inherits2.default)(AnimatedMainClock, _InternalAnimatedValu); + + var _super = _createSuper(AnimatedMainClock); + + function AnimatedMainClock() { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedMainClock); + _this = _super.call(this, { + type: 'MAIN_CLOCK' + }); + + _this._runFrame = function () { + _this._updateValue(0); + + if (_this.__children.length > 0) { + _this._frameCallback = requestAnimationFrame(_this._runFrame); + } + }; + + return _this; + } + + (0, _createClass2.default)(AnimatedMainClock, [{ + key: "__onEvaluate", + value: function __onEvaluate() { + return +new Date(); + } + }, { + key: "__attach", + value: function __attach() { + (0, _get2.default)((0, _getPrototypeOf2.default)(AnimatedMainClock.prototype), "__attach", this).call(this); + + if (!this._frameCallback) { + this._frameCallback = requestAnimationFrame(this._runFrame); + } + } + }, { + key: "__detach", + value: function __detach() { + if (this._frameCallback) { + cancelAnimationFrame(this._frameCallback); + this._frameCallback = null; + } + + (0, _get2.default)((0, _getPrototypeOf2.default)(AnimatedMainClock.prototype), "__detach", this).call(this); + } + }]); + return AnimatedMainClock; + }(_InternalAnimatedValue.default); + + var mainClock = new AnimatedMainClock(); + + var AnimatedClock = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedClock, _AnimatedNode); + + var _super2 = _createSuper(AnimatedClock); + + function AnimatedClock() { + (0, _classCallCheck2.default)(this, AnimatedClock); + return _super2.call(this, { + type: 'clock' + }); + } + + (0, _createClass2.default)(AnimatedClock, [{ + key: "toString", + value: function toString() { + return "AnimatedClock, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + return (0, _$$_REQUIRE(_dependencyMap[9]).val)(mainClock); + } + }, { + key: "__attach", + value: function __attach() { + (0, _get2.default)((0, _getPrototypeOf2.default)(AnimatedClock.prototype), "__attach", this).call(this); + + if (this._started && !this._attached) { + mainClock.__addChild(this); + } + + this._attached = true; + } + }, { + key: "__detach", + value: function __detach() { + if (this._started && this._attached) { + mainClock.__removeChild(this); + } + + this._attached = false; + (0, _get2.default)((0, _getPrototypeOf2.default)(AnimatedClock.prototype), "__detach", this).call(this); + } + }, { + key: "start", + value: function start() { + if (!this._started && this._attached) { + mainClock.__addChild(this); + } + + this._started = true; + } + }, { + key: "stop", + value: function stop() { + if (this._started && this._attached) { + mainClock.__removeChild(this); + } + + this._started = false; + } + }, { + key: "isStarted", + value: function isStarted() { + return this._started; + } + }]); + return AnimatedClock; + }(_AnimatedNode2.default); + + exports.default = AnimatedClock; +},659,[5,7,8,90,12,14,16,656,651,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedParam = createAnimatedParam; + exports.AnimatedParam = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _AnimatedClock = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedParam = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedParam, _AnimatedNode); + + var _super = _createSuper(AnimatedParam); + + function AnimatedParam() { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedParam); + _this = _super.call(this, { + type: 'param' + }, []); + _this.argsStack = []; + + _this.__attach(); + + return _this; + } + + (0, _createClass2.default)(AnimatedParam, [{ + key: "beginContext", + value: function beginContext(ref, prevCallID) { + this._prevCallID = prevCallID; + this.argsStack.push(ref); + } + }, { + key: "endContext", + value: function endContext() { + this.argsStack.pop(); + } + }, { + key: "_getTopNode", + value: function _getTopNode() { + if (this.argsStack.length === 0) throw new Error("param: Invocation failed because argsStack is empty"); + var top = this.argsStack[this.argsStack.length - 1]; + return top; + } + }, { + key: "setValue", + value: function setValue(value) { + var top = this._getTopNode(); + + if (top.setValue) { + var callID = (0, _AnimatedNode2.getCallID)(); + (0, _AnimatedNode2.setCallID)(this._prevCallID); + top.setValue(value); + (0, _AnimatedNode2.setCallID)(callID); + } else { + throw new Error("param: setValue(" + value + ") failed because the top element has no known method for updating it's current value."); + } + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + var callID = (0, _AnimatedNode2.getCallID)(); + (0, _AnimatedNode2.setCallID)(this._prevCallID); + + var top = this._getTopNode(); + + var value = (0, _$$_REQUIRE(_dependencyMap[9]).val)(top); + (0, _AnimatedNode2.setCallID)(callID); + return value; + } + }, { + key: "start", + value: function start() { + var node = this._getTopNode(); + + (0, _invariant.default)(node instanceof _AnimatedClock.default || node instanceof AnimatedParam, "param: top node should be of type AnimatedClock but got " + node); + node.start(); + } + }, { + key: "stop", + value: function stop() { + var node = this._getTopNode(); + + (0, _invariant.default)(node instanceof _AnimatedClock.default || node instanceof AnimatedParam, "param: top node should be of type AnimatedClock but got " + node); + node.stop(); + } + }, { + key: "isRunning", + value: function isRunning() { + var node = this._getTopNode(); + + if (node instanceof AnimatedParam) { + return node.isRunning(); + } + + (0, _invariant.default)(node instanceof _AnimatedClock.default, "param: top node should be of type AnimatedClock but got " + node); + return node.isStarted(); + } + }]); + return AnimatedParam; + }(_AnimatedNode2.default); + + exports.AnimatedParam = AnimatedParam; + + function createAnimatedParam() { + return new AnimatedParam(); + } +},660,[5,7,8,12,14,16,601,651,659,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedStopClock = createAnimatedStopClock; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedClock = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedStopClock = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedStopClock, _AnimatedNode); + + var _super = _createSuper(AnimatedStopClock); + + function AnimatedStopClock(clockNode) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedStopClock); + (0, _invariant.default)(clockNode instanceof _AnimatedClock.default || clockNode instanceof _$$_REQUIRE(_dependencyMap[9]).AnimatedParam, "Reanimated: Animated.stopClock argument should be of type AnimatedClock but got " + clockNode); + _this = _super.call(this, { + type: 'clockStop', + clock: clockNode + }); + _this._clockNode = clockNode; + return _this; + } + + (0, _createClass2.default)(AnimatedStopClock, [{ + key: "toString", + value: function toString() { + return "AnimatedStopClock, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + this._clockNode.stop(); + + return 0; + } + }]); + return AnimatedStopClock; + }(_AnimatedNode2.default); + + function createAnimatedStopClock(clock) { + return new AnimatedStopClock(clock); + } +},661,[5,7,8,12,14,16,651,659,601,660]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedClockTest = createAnimatedClockTest; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedClockTest = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedClockTest, _AnimatedNode); + + var _super = _createSuper(AnimatedClockTest); + + function AnimatedClockTest(clockNode) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedClockTest); + _this = _super.call(this, { + type: 'clockTest', + clock: clockNode + }); + _this._clockNode = clockNode; + return _this; + } + + (0, _createClass2.default)(AnimatedClockTest, [{ + key: "toString", + value: function toString() { + return "AnimatedClockTest, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + return this._clockNode.isStarted() ? 1 : 0; + } + }]); + return AnimatedClockTest; + }(_AnimatedNode2.default); + + function createAnimatedClockTest(clock) { + return new AnimatedClockTest(clock); + } +},662,[5,7,8,12,14,16,651]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedDebug = createAnimatedDebug; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedDebug = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedDebug, _AnimatedNode); + + var _super = _createSuper(AnimatedDebug); + + function AnimatedDebug(message, value) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedDebug); + (0, _invariant.default)(typeof message === 'string', "Reanimated: Animated.debug node first argument should be of type string but got " + message); + (0, _invariant.default)(value instanceof _AnimatedNode2.default, "Reanimated: Animated.debug node second argument should be of type AnimatedNode but got " + value); + _this = _super.call(this, { + type: 'debug', + message: message, + value: value + }, [value]); + _this._message = message; + _this._value = value; + return _this; + } + + (0, _createClass2.default)(AnimatedDebug, [{ + key: "toString", + value: function toString() { + return "AnimatedDebug, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + var value = (0, _$$_REQUIRE(_dependencyMap[10]).val)(this._value); + return value; + } + }]); + return AnimatedDebug; + }(_AnimatedNode2.default); + + function createAnimatedDebug(message, value) { + return value; + } +},663,[5,41,7,8,12,14,16,601,28,651,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedCall = createAnimatedCall; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _ReanimatedEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NODE_MAPPING = new Map(); + + function listener(data) { + var node = NODE_MAPPING.get(data.id); + node && node._callback(data.args); + } + + var AnimatedCall = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedCall, _AnimatedNode); + + var _super = _createSuper(AnimatedCall); + + function AnimatedCall(args, jsFunction) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedCall); + (0, _invariant.default)(args.every(function (el) { + return el instanceof _AnimatedNode2.default; + }), "Reanimated: Animated.call node args should be an array with elements of type AnimatedNode. One or more of them are not AnimatedNodes"); + _this = _super.call(this, { + type: 'call', + input: args + }, args); + _this._callback = jsFunction; + _this._args = args; + return _this; + } + + (0, _createClass2.default)(AnimatedCall, [{ + key: "toString", + value: function toString() { + return "AnimatedCall, id: " + this.__nodeID; + } + }, { + key: "__attach", + value: function __attach() { + (0, _get2.default)((0, _getPrototypeOf2.default)(AnimatedCall.prototype), "__attach", this).call(this); + NODE_MAPPING.set(this.__nodeID, this); + + if (NODE_MAPPING.size === 1) { + _ReanimatedEventEmitter.default.addListener('onReanimatedCall', listener); + } + } + }, { + key: "__detach", + value: function __detach() { + NODE_MAPPING.delete(this.__nodeID); + + if (NODE_MAPPING.size === 0) { + _ReanimatedEventEmitter.default.removeAllListeners('onReanimatedCall'); + } + + (0, _get2.default)((0, _getPrototypeOf2.default)(AnimatedCall.prototype), "__detach", this).call(this); + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + this._callback(this._args.map(_$$_REQUIRE(_dependencyMap[10]).val)); + + return 0; + } + }]); + return AnimatedCall; + }(_AnimatedNode2.default); + + function createAnimatedCall(args, func) { + return new AnimatedCall(args, func); + } +},664,[5,7,8,90,12,14,16,601,665,651,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _ReanimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _default = new _reactNative.NativeEventEmitter(_ReanimatedModule.default); + + exports.default = _default; +},665,[5,648,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedEvent = createAnimatedEvent; + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + var _ReanimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _AnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _createEventObjectProxyPolyfill = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function sanitizeArgMapping(argMapping) { + var eventMappings = []; + var alwaysNodes = []; + + var getNode = function getNode(node) { + if (_reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'windows' || _reactNative.Platform.OS === 'macos') { + return node; + } + + return node.__nodeID; + }; + + var traverse = function traverse(value, path) { + if (value instanceof _AnimatedValue.default) { + eventMappings.push(path.concat(getNode(value))); + } else if (typeof value === 'object' && value.__val) { + eventMappings.push(path.concat(getNode(value.__val))); + } else if (typeof value === 'function') { + var node = new _AnimatedValue.default(0); + alwaysNodes.push((0, _$$_REQUIRE(_dependencyMap[12]).createAnimatedAlways)(value(node))); + eventMappings.push(path.concat(getNode(node))); + } else if (typeof value === 'object') { + for (var key in value) { + traverse(value[key], path.concat(key)); + } + } + }; + + (0, _invariant.default)(argMapping[0] && argMapping[0].nativeEvent, 'Native driven events only support animated values contained inside `nativeEvent`.'); + var ev = argMapping[0].nativeEvent; + + if (typeof ev === 'object') { + traverse(ev, []); + } else if (typeof ev === 'function') { + var proxyHandler = { + get: function get(target, name) { + if (name === '__isProxy') { + return true; + } + + if (!target[name] && name !== '__val') { + target[name] = new Proxy({}, proxyHandler); + } + + return target[name]; + }, + set: function set(target, prop, value) { + if (prop === '__val') { + target[prop] = value; + return true; + } + + return false; + } + }; + var proxy = typeof Proxy === 'function' ? new Proxy({}, proxyHandler) : (0, _createEventObjectProxyPolyfill.default)(); + alwaysNodes.push((0, _$$_REQUIRE(_dependencyMap[12]).createAnimatedAlways)(ev(proxy))); + traverse(proxy, []); + } + + return { + eventMappings: eventMappings, + alwaysNodes: alwaysNodes + }; + } + + var AnimatedEvent = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedEvent, _AnimatedNode); + + var _super = _createSuper(AnimatedEvent); + + function AnimatedEvent(argMapping) { + var _this; + + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + (0, _classCallCheck2.default)(this, AnimatedEvent); + + var _sanitizeArgMapping = sanitizeArgMapping(argMapping), + eventMappings = _sanitizeArgMapping.eventMappings, + alwaysNodes = _sanitizeArgMapping.alwaysNodes; + + _this = _super.call(this, { + type: 'event', + argMapping: eventMappings + }); + _this.__isNative = true; + _this._alwaysNodes = alwaysNodes; + return _this; + } + + (0, _createClass2.default)(AnimatedEvent, [{ + key: "toString", + value: function toString() { + return "AnimatedEvent, id: " + this.__nodeID; + } + }, { + key: "attachEvent", + value: function attachEvent(viewRef, eventName) { + for (var i = 0; i < this._alwaysNodes.length; i++) { + this._alwaysNodes[i].__attach(); + } + + this.__attach(); + + var viewTag = (0, _reactNative.findNodeHandle)(viewRef); + + _ReanimatedModule.default.attachEvent(viewTag, eventName, this.__nodeID); + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + return 0; + } + }, { + key: "detachEvent", + value: function detachEvent(viewRef, eventName) { + for (var i = 0; i < this._alwaysNodes.length; i++) { + this._alwaysNodes[i].isNativelyInitialized() && this._alwaysNodes[i].__detach(); + } + + var viewTag = (0, _reactNative.findNodeHandle)(viewRef); + + _ReanimatedModule.default.detachEvent(viewTag, eventName, this.__nodeID); + + this.__detach(); + } + }]); + return AnimatedEvent; + }(_AnimatedNode2.default); + + exports.default = AnimatedEvent; + + function createAnimatedEvent(argMapping, config) { + return new AnimatedEvent(argMapping, config); + } +},666,[5,7,8,12,14,16,28,648,651,667,601,675,674]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _interpolate2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _ReanimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedValue = function (_InternalAnimatedValu) { + (0, _inherits2.default)(AnimatedValue, _InternalAnimatedValu); + + var _super = _createSuper(AnimatedValue); + + function AnimatedValue() { + (0, _classCallCheck2.default)(this, AnimatedValue); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(AnimatedValue, [{ + key: "setValue", + value: function setValue(value) { + this.__detachAnimation(this._animation); + + if (_reactNative.Platform.OS === 'web' || _reactNative.Platform.OS === 'windows' || _reactNative.Platform.OS === 'macos') { + this._updateValue((0, _$$_REQUIRE(_dependencyMap[10]).val)(value)); + } else { + if (_ReanimatedModule.default.setValue && typeof value === 'number') { + _ReanimatedModule.default.setValue(this.__nodeID, value); + } else { + (0, _$$_REQUIRE(_dependencyMap[11]).evaluateOnce)((0, _$$_REQUIRE(_dependencyMap[12]).createAnimatedSet)(this, value), this); + } + } + } + }, { + key: "toString", + value: function toString() { + return "AnimatedValue, id: " + this.__nodeID; + } + }, { + key: "interpolate", + value: function interpolate(config) { + return (0, _interpolate2.default)(this, config); + } + }]); + return AnimatedValue; + }(_InternalAnimatedValue.default); + + exports.default = AnimatedValue; +},667,[5,7,8,12,14,16,668,656,28,648,652,673,657]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = interpolate; + exports.Extrapolate = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _AnimatedNode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + var interpolateInternalSingleProc = (0, _$$_REQUIRE(_dependencyMap[4]).createAnimatedFunction)(function (value, inS, inE, outS, outE) { + var progress = (0, _$$_REQUIRE(_dependencyMap[5]).divide)((0, _$$_REQUIRE(_dependencyMap[5]).sub)(value, inS), (0, _$$_REQUIRE(_dependencyMap[5]).sub)(inE, inS)); + var resultForNonZeroRange = (0, _$$_REQUIRE(_dependencyMap[5]).add)(outS, (0, _$$_REQUIRE(_dependencyMap[5]).multiply)(progress, (0, _$$_REQUIRE(_dependencyMap[5]).sub)(outE, outS))); + var result = (0, _$$_REQUIRE(_dependencyMap[6]).createAnimatedCond)((0, _$$_REQUIRE(_dependencyMap[5]).eq)(inS, inE), (0, _$$_REQUIRE(_dependencyMap[6]).createAnimatedCond)((0, _$$_REQUIRE(_dependencyMap[5]).lessOrEq)(value, inS), outS, outE), resultForNonZeroRange); + return result; + }); + + function interpolateInternalSingle(value, inputRange, outputRange, offset) { + var inS = inputRange[offset]; + var inE = inputRange[offset + 1]; + var outS = outputRange[offset]; + var outE = outputRange[offset + 1]; + return interpolateInternalSingleProc(value, inS, inE, outS, outE); + } + + function interpolateInternal(value, inputRange, outputRange) { + var offset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + + if (inputRange.length - offset === 2) { + return interpolateInternalSingle(value, inputRange, outputRange, offset); + } + + return (0, _$$_REQUIRE(_dependencyMap[6]).createAnimatedCond)((0, _$$_REQUIRE(_dependencyMap[5]).lessThan)(value, inputRange[offset + 1]), interpolateInternalSingle(value, inputRange, outputRange, offset), interpolateInternal(value, inputRange, outputRange, offset + 1)); + } + + var Extrapolate = { + EXTEND: 'extend', + CLAMP: 'clamp', + IDENTITY: 'identity' + }; + exports.Extrapolate = Extrapolate; + + function checkNonDecreasing(name, arr) { + for (var i = 1; i < arr.length; ++i) { + if (arr[i] instanceof _AnimatedNode.default || arr[i - 1] instanceof _AnimatedNode.default) continue; + (0, _invariant.default)(arr[i] >= arr[i - 1], '%s must be monotonically non-decreasing. (%s)', name, arr); + } + } + + function checkMinElements(name, arr) { + (0, _invariant.default)(arr.length >= 2, '%s must have at least 2 elements. (%s)', name, arr); + } + + function checkValidNumbers(name, arr) { + for (var i = 0; i < arr.length; i++) { + if (arr[i] instanceof _AnimatedNode.default || typeof arr[i] !== 'number') continue; + (0, _invariant.default)(Number.isFinite(arr[i]), '%s cannot include %s. (%s)', name, arr[i], arr); + } + } + + function convertToRadians(outputRange) { + for (var _iterator = _createForOfIteratorHelperLoose(outputRange.entries()), _step; !(_step = _iterator()).done;) { + var _ref = _step.value; + + var _ref2 = (0, _slicedToArray2.default)(_ref, 2); + + var i = _ref2[0]; + var value = _ref2[1]; + + if (typeof value === 'string' && value.endsWith('deg')) { + outputRange[i] = parseFloat(value) * (Math.PI / 180); + } else if (typeof value === 'string' && value.endsWith('rad')) { + outputRange[i] = parseFloat(value); + } + } + } + + function interpolate(value, config) { + var inputRange = config.inputRange, + outputRange = config.outputRange, + _config$extrapolate = config.extrapolate, + extrapolate = _config$extrapolate === undefined ? Extrapolate.EXTEND : _config$extrapolate, + extrapolateLeft = config.extrapolateLeft, + extrapolateRight = config.extrapolateRight; + checkMinElements('inputRange', inputRange); + checkValidNumbers('inputRange', inputRange); + checkMinElements('outputRange', outputRange); + checkValidNumbers('outputRange', outputRange); + checkNonDecreasing('inputRange', inputRange); + (0, _invariant.default)(inputRange.length === outputRange.length, 'inputRange and outputRange must be the same length.'); + convertToRadians(outputRange); + var left = extrapolateLeft || extrapolate; + var right = extrapolateRight || extrapolate; + var output = interpolateInternal(value, inputRange, outputRange); + + if (left === Extrapolate.EXTEND) {} else if (left === Extrapolate.CLAMP) { + output = (0, _$$_REQUIRE(_dependencyMap[6]).createAnimatedCond)((0, _$$_REQUIRE(_dependencyMap[5]).lessThan)(value, inputRange[0]), outputRange[0], output); + } else if (left === Extrapolate.IDENTITY) { + output = (0, _$$_REQUIRE(_dependencyMap[6]).createAnimatedCond)((0, _$$_REQUIRE(_dependencyMap[5]).lessThan)(value, inputRange[0]), value, output); + } + + if (right === Extrapolate.EXTEND) {} else if (right === Extrapolate.CLAMP) { + output = (0, _$$_REQUIRE(_dependencyMap[6]).createAnimatedCond)((0, _$$_REQUIRE(_dependencyMap[5]).greaterThan)(value, inputRange[inputRange.length - 1]), outputRange[outputRange.length - 1], output); + } else if (right === Extrapolate.IDENTITY) { + output = (0, _$$_REQUIRE(_dependencyMap[6]).createAnimatedCond)((0, _$$_REQUIRE(_dependencyMap[5]).greaterThan)(value, inputRange[inputRange.length - 1]), value, output); + } + + return output; + } +},668,[5,41,601,651,669,671,654]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedFunction = createAnimatedFunction; + + var _construct2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedFunction = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedFunction, _AnimatedNode); + + var _super = _createSuper(AnimatedFunction); + + function AnimatedFunction(what) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedFunction); + (0, _invariant.default)(what instanceof _AnimatedNode2.default, "Reanimated: AnimatedCallFunc 'what' argument should be of type AnimatedNode but got " + what); + + for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + params[_key - 1] = arguments[_key]; + } + + _this = _super.call(this, { + type: 'func', + what: what + }, [what].concat(params)); + _this._what = what; + + _this.__attach(); + + return _this; + } + + (0, _createClass2.default)(AnimatedFunction, [{ + key: "__onEvaluate", + value: function __onEvaluate() { + return (0, _$$_REQUIRE(_dependencyMap[9]).val)(this._what); + } + }, { + key: "toString", + value: function toString() { + return "AnimatedFunction, id: " + this.__nodeID; + } + }]); + return AnimatedFunction; + }(_AnimatedNode2.default); + + function createAnimatedFunction(cb) { + var params = new Array(cb.length); + + for (var i = 0; i < params.length; i++) { + params[i] = (0, _$$_REQUIRE(_dependencyMap[10]).createAnimatedParam)(); + } + + var what = cb.apply(undefined, params); + var func = (0, _construct2.default)(AnimatedFunction, [what].concat(params)); + return function () { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (args.length !== params.length) { + throw new Error('Parameter mismatch when calling reanimated function. Expected ' + params.length + ' parameters, got ' + args.length + '.'); + } + + return (0, _$$_REQUIRE(_dependencyMap[11]).createAnimatedCallFunc)(func, args, params); + }; + } +},669,[5,65,7,8,12,14,16,651,601,652,660,670]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedCallFunc = createAnimatedCallFunc; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedCallFunc = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedCallFunc, _AnimatedNode); + + var _super = _createSuper(AnimatedCallFunc); + + function AnimatedCallFunc(what, args, params) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedCallFunc); + (0, _invariant.default)(what instanceof _AnimatedNode2.default, "Reanimated: AnimatedCallFunc 'what' argument should be of type AnimatedNode but got " + what); + (0, _invariant.default)(args.every(function (el) { + return el instanceof _AnimatedNode2.default; + }), "Reanimated: every AnimatedCallFunc 'args' argument should be of type AnimatedNode but got " + args); + (0, _invariant.default)(params.every(function (el) { + return el instanceof _AnimatedNode2.default; + }), "Reanimated: every AnimatedCallFunc 'params' argument should be of type AnimatedNode but got " + params); + _this = _super.call(this, { + type: 'callfunc', + what: what, + args: args, + params: params + }, (0, _toConsumableArray2.default)(args)); + _this._what = what; + _this._args = args; + _this._params = params; + return _this; + } + + (0, _createClass2.default)(AnimatedCallFunc, [{ + key: "toString", + value: function toString() { + return "AnimatedCallFunc, id: " + this.__nodeID; + } + }, { + key: "beginContext", + value: function beginContext() { + var _this2 = this; + + this._previousCallID = (0, _AnimatedNode2.getCallID)(); + (0, _AnimatedNode2.setCallID)((0, _AnimatedNode2.getCallID)() + '/' + this.__nodeID); + + this._params.forEach(function (param, index) { + param.beginContext(_this2._args[index], _this2._previousCallID); + }); + } + }, { + key: "endContext", + value: function endContext() { + this._params.forEach(function (param, index) { + param.endContext(); + }); + + (0, _AnimatedNode2.setCallID)(this._previousCallID); + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + this.beginContext(); + var value = (0, _$$_REQUIRE(_dependencyMap[9]).val)(this._what); + this.endContext(); + return value; + } + }]); + return AnimatedCallFunc; + }(_AnimatedNode2.default); + + function createAnimatedCallFunc(proc, args, params) { + return new AnimatedCallFunc(proc, args.map(function (p) { + return (0, _$$_REQUIRE(_dependencyMap[10]).adapt)(p); + }), params); + } +},670,[5,21,7,8,12,14,16,651,601,652,655]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.min = exports.max = exports.floor = exports.ceil = exports.abs = exports.atan = exports.asin = exports.acos = exports.tan = exports.not = exports.defined = exports.or = exports.and = exports.neq = exports.greaterOrEq = exports.lessOrEq = exports.greaterThan = exports.eq = exports.lessThan = exports.round = exports.exp = exports.cos = exports.sin = exports.log = exports.sqrt = exports.modulo = exports.pow = exports.divide = exports.multiply = exports.sub = exports.add = undefined; + + var add = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('add'); + + exports.add = add; + + var sub = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('sub'); + + exports.sub = sub; + + var multiply = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('multiply'); + + exports.multiply = multiply; + + var divide = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('divide'); + + exports.divide = divide; + + var pow = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('pow'); + + exports.pow = pow; + + var modulo = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('modulo'); + + exports.modulo = modulo; + + var sqrt = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('sqrt'); + + exports.sqrt = sqrt; + + var log = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('log'); + + exports.log = log; + + var sin = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('sin'); + + exports.sin = sin; + + var cos = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('cos'); + + exports.cos = cos; + + var exp = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('exp'); + + exports.exp = exp; + + var round = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('round'); + + exports.round = round; + + var lessThan = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('lessThan'); + + exports.lessThan = lessThan; + + var eq = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('eq'); + + exports.eq = eq; + + var greaterThan = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('greaterThan'); + + exports.greaterThan = greaterThan; + + var lessOrEq = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('lessOrEq'); + + exports.lessOrEq = lessOrEq; + + var greaterOrEq = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('greaterOrEq'); + + exports.greaterOrEq = greaterOrEq; + + var neq = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('neq'); + + exports.neq = neq; + + var and = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('and'); + + exports.and = and; + + var or = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('or'); + + exports.or = or; + + var defined = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('defined'); + + exports.defined = defined; + + var not = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('not'); + + exports.not = not; + + var tan = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('tan'); + + exports.tan = tan; + + var acos = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('acos'); + + exports.acos = acos; + + var asin = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('asin'); + + exports.asin = asin; + + var atan = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('atan'); + + exports.atan = atan; + + var abs = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('abs'); + + exports.abs = abs; + + var ceil = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('ceil'); + + exports.ceil = ceil; + + var floor = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('floor'); + + exports.floor = floor; + + var max = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('max'); + + exports.max = max; + + var min = _$$_REQUIRE(_dependencyMap[0]).createAnimatedOperator('min'); + + exports.min = min; +},671,[672]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedOperator = createAnimatedOperator; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function reduce(fn) { + return function (input) { + return input.reduce(function (a, b) { + return fn((0, _$$_REQUIRE(_dependencyMap[8]).val)(a), (0, _$$_REQUIRE(_dependencyMap[8]).val)(b)); + }); + }; + } + + function reduceFrom(fn, initialValue) { + return function (input) { + return input.reduce(function (a, b) { + return fn((0, _$$_REQUIRE(_dependencyMap[8]).val)(a), (0, _$$_REQUIRE(_dependencyMap[8]).val)(b)); + }, initialValue); + }; + } + + function infix(fn) { + return function (input) { + return fn((0, _$$_REQUIRE(_dependencyMap[8]).val)(input[0]), (0, _$$_REQUIRE(_dependencyMap[8]).val)(input[1])); + }; + } + + function single(fn) { + return function (input) { + return fn((0, _$$_REQUIRE(_dependencyMap[8]).val)(input[0])); + }; + } + + var OPERATIONS = { + add: reduce(function (a, b) { + return a + b; + }), + sub: reduce(function (a, b) { + return a - b; + }), + multiply: reduce(function (a, b) { + return a * b; + }), + divide: reduce(function (a, b) { + return a / b; + }), + pow: reduce(function (a, b) { + return Math.pow(a, b); + }), + modulo: reduce(function (a, b) { + return (a % b + b) % b; + }), + sqrt: single(function (a) { + return Math.sqrt(a); + }), + log: single(function (a) { + return Math.log(a); + }), + sin: single(function (a) { + return Math.sin(a); + }), + cos: single(function (a) { + return Math.cos(a); + }), + tan: single(function (a) { + return Math.tan(a); + }), + acos: single(function (a) { + return Math.acos(a); + }), + asin: single(function (a) { + return Math.asin(a); + }), + atan: single(function (a) { + return Math.atan(a); + }), + exp: single(function (a) { + return Math.exp(a); + }), + round: single(function (a) { + return Math.round(a); + }), + abs: single(function (a) { + return Math.abs(a); + }), + ceil: single(function (a) { + return Math.ceil(a); + }), + floor: single(function (a) { + return Math.floor(a); + }), + max: reduce(function (a, b) { + return Math.max(a, b); + }), + min: reduce(function (a, b) { + return Math.min(a, b); + }), + and: reduceFrom(function (a, b) { + return a && b; + }, true), + or: reduceFrom(function (a, b) { + return a || b; + }, false), + not: single(function (a) { + return !a; + }), + defined: single(function (a) { + return a !== null && a !== undefined && !isNaN(a); + }), + lessThan: infix(function (a, b) { + return a < b; + }), + eq: infix(function (a, b) { + return a == b; + }), + greaterThan: infix(function (a, b) { + return a > b; + }), + lessOrEq: infix(function (a, b) { + return a <= b; + }), + greaterOrEq: infix(function (a, b) { + return a >= b; + }), + neq: infix(function (a, b) { + return a != b; + }) + }; + + var AnimatedOperator = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedOperator, _AnimatedNode); + + var _super = _createSuper(AnimatedOperator); + + function AnimatedOperator(operator, input) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedOperator); + (0, _invariant.default)(typeof operator === 'string', "Reanimated: Animated.operator node first argument should be of type String, but got: " + operator); + (0, _invariant.default)(input.every(function (el) { + return el instanceof _AnimatedNode2.default || typeof el === 'string' || typeof el === 'number'; + }), "Reanimated: Animated.operator node second argument should be one or more of type AnimatedNode, String or Number but got " + input); + _this = _super.call(this, { + type: 'op', + op: operator, + input: input + }, input); + _this._op = operator; + _this._input = input; + return _this; + } + + (0, _createClass2.default)(AnimatedOperator, [{ + key: "toString", + value: function toString() { + return "AnimatedOperator, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + if (!this._operation) { + this._operation = OPERATIONS[this._op]; + (0, _invariant.default)(this._operation, "Illegal operator '%s'", this._op); + } + + return this._operation(this._input); + } + }]); + return AnimatedOperator; + }(_AnimatedNode2.default); + + function createAnimatedOperator(name) { + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return new AnimatedOperator(name, args.map(_$$_REQUIRE(_dependencyMap[9]).adapt)); + }; + } +},672,[5,7,8,12,14,16,651,601,652,655]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.evaluateOnce = evaluateOnce; + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function evaluateOnce(node) { + var input = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var callback = arguments.length > 2 ? arguments[2] : undefined; + + if (!Array.isArray(input)) { + input = [input]; + } + + var done = new _InternalAnimatedValue.default(0); + var evalNode = (0, _$$_REQUIRE(_dependencyMap[2]).createAnimatedCond)(done, 0, (0, _$$_REQUIRE(_dependencyMap[3]).createAnimatedCall)([node, (0, _$$_REQUIRE(_dependencyMap[4]).createAnimatedSet)(done, 1)], function () { + callback && callback(); + + for (var i = 0; i < input.length; i++) { + input[i].__removeChild(alwaysNode); + + alwaysNode.__detach(); + } + })); + var alwaysNode = (0, _$$_REQUIRE(_dependencyMap[5]).createAnimatedAlways)(evalNode); + + for (var i = 0; i < input.length; i++) { + input[i].__addChild(alwaysNode); + + alwaysNode.__attach(); + } + } +},673,[5,656,654,664,657,674]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedAlways = createAnimatedAlways; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedAlways = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedAlways, _AnimatedNode); + + var _super = _createSuper(AnimatedAlways); + + function AnimatedAlways(what) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedAlways); + (0, _invariant.default)(what instanceof _AnimatedNode2.default, "Reanimated: Animated.always node argument should be of type AnimatedNode but got " + what); + _this = _super.call(this, { + type: 'always', + what: what + }, [what]); + _this._what = what; + return _this; + } + + (0, _createClass2.default)(AnimatedAlways, [{ + key: "toString", + value: function toString() { + return "AnimatedAlways, id: " + this.__nodeID; + } + }, { + key: "update", + value: function update() { + this.__getValue(); + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + (0, _$$_REQUIRE(_dependencyMap[8]).val)(this._what); + return 0; + } + }]); + return AnimatedAlways; + }(_AnimatedNode2.default); + + function createAnimatedAlways(item) { + return new AnimatedAlways(item); + } +},674,[5,7,8,12,14,16,651,601,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createEventObjectProxyPolyfill; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function createEventObjectProxyPolyfill() { + var nodesMap = { + translationX: {}, + translationY: {}, + state: {}, + oldState: {}, + absoluteX: {}, + absoluteY: {}, + x: {}, + y: {}, + velocityX: {}, + velocityY: {}, + scale: {}, + focalX: {}, + focalY: {}, + rotation: {}, + anchorX: {}, + anchorY: {}, + velocity: {}, + numberOfPointers: {}, + layout: { + x: {}, + y: {}, + width: {}, + height: {} + }, + contentOffset: { + y: {}, + x: {} + }, + layoutMeasurement: { + width: {}, + height: {} + }, + contentSize: { + width: {}, + height: {} + }, + zoomScale: {}, + contentInset: { + right: {}, + top: {}, + left: {}, + bottom: {} + } + }; + + var traverse = function traverse(obj) { + for (var key in obj) { + traverse(obj[key]); + (0, _extends2.default)(obj[key], { + __isProxy: true + }); + } + }; + + traverse(nodesMap); + return nodesMap; + } +},675,[5,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createAnimatedConcat = createAnimatedConcat; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AnimatedConcat = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedConcat, _AnimatedNode); + + var _super = _createSuper(AnimatedConcat); + + function AnimatedConcat(input) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedConcat); + (0, _invariant.default)(input.every(function (el) { + return el instanceof _AnimatedNode2.default || typeof el === 'number' || typeof el === 'string'; + }), "Reanimated: Animated.concat node arguments should be of type AnimatedNode or String or Number. One or more of them are not of that type. Node: " + input); + _this = _super.call(this, { + type: 'concat', + input: input + }, input); + _this._input = input; + return _this; + } + + (0, _createClass2.default)(AnimatedConcat, [{ + key: "__onEvaluate", + value: function __onEvaluate() { + return this._input.reduce(function (prev, current) { + return prev + (0, _$$_REQUIRE(_dependencyMap[8]).val)(current); + }, ''); + } + }, { + key: "toString", + value: function toString() { + return "AnimatedConcat, id: " + this.__nodeID; + } + }]); + return AnimatedConcat; + }(_AnimatedNode2.default); + + function createAnimatedConcat() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return new AnimatedConcat(args.map(_$$_REQUIRE(_dependencyMap[9]).adapt)); + } +},676,[5,7,8,12,14,16,601,651,652,655]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _useCode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _AnimatedNode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + function assertNodesNotNull(code, children, exec) { + if (!code) { + var error = !children ? "Got \"" + typeof children + "\" type passed to children" : "Got \"" + typeof exec + "\" type passed to exec"; + throw new Error(" expects the 'exec' prop or children to be an animated node or a function returning an animated node. " + error); + } + } + + function Code(_ref) { + var exec = _ref.exec, + children = _ref.children, + dependencies = _ref.dependencies; + var nodes = children || exec; + var code = null; + + if (nodes instanceof _AnimatedNode.default) { + code = function code() { + return nodes; + }; + } else if (typeof nodes === 'function') { + code = nodes; + } + + assertNodesNotNull(code, children, exec); + (0, _useCode.default)(code, dependencies); + return null; + } + + var _default = Code; + exports.default = _default; +},677,[5,678,651]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useCode; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function useCode(nodeFactory, dependencies) { + if (!(_react.default.useEffect instanceof Function)) return; + + _react.default.useEffect(function () { + if (!(nodeFactory instanceof Function)) { + console.warn('useCode() first argument should be a function that returns an animation node.'); + var _node = nodeFactory; + + nodeFactory = function nodeFactory() { + return _node; + }; + } + + var node = nodeFactory(); + + if (node) { + if (node instanceof Array) node = (0, _$$_REQUIRE(_dependencyMap[2]).block)(node); + var animatedAlways = (0, _$$_REQUIRE(_dependencyMap[2]).always)(node); + + animatedAlways.__attach(); + + return function () { + return animatedAlways.__detach(); + }; + } + }, dependencies); + } +},678,[5,17,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "acc", { + enumerable: true, + get: function get() { + return _acc.default; + } + }); + Object.defineProperty(exports, "color", { + enumerable: true, + get: function get() { + return _color.default; + } + }); + Object.defineProperty(exports, "diff", { + enumerable: true, + get: function get() { + return _diff.default; + } + }); + Object.defineProperty(exports, "diffClamp", { + enumerable: true, + get: function get() { + return _diffClamp.default; + } + }); + Object.defineProperty(exports, "interpolate", { + enumerable: true, + get: function get() { + return _interpolate.default; + } + }); + Object.defineProperty(exports, "Extrapolate", { + enumerable: true, + get: function get() { + return _interpolate.Extrapolate; + } + }); + Object.defineProperty(exports, "interpolateColors", { + enumerable: true, + get: function get() { + return _interpolateColors.default; + } + }); + Object.defineProperty(exports, "onChange", { + enumerable: true, + get: function get() { + return _onChange.default; + } + }); + Object.defineProperty(exports, "useCode", { + enumerable: true, + get: function get() { + return _useCode.default; + } + }); + + var _acc = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _color = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _diff = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _diffClamp = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _interpolate = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _interpolateColors = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _onChange = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _useCode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } +},679,[5,680,681,682,683,668,684,685,678]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = acc; + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var procAcc = (0, _$$_REQUIRE(_dependencyMap[2]).proc)(function (v, acc) { + return (0, _$$_REQUIRE(_dependencyMap[2]).set)(acc, (0, _$$_REQUIRE(_dependencyMap[2]).add)(acc, v)); + }); + + function acc(v) { + var acc = new _InternalAnimatedValue.default(0); + return procAcc(v, acc); + } +},680,[5,656,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = color; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _AnimatedNode = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var procColor = (0, _$$_REQUIRE(_dependencyMap[3]).proc)(function (r, g, b, a) { + var color = (0, _$$_REQUIRE(_dependencyMap[3]).add)((0, _$$_REQUIRE(_dependencyMap[3]).multiply)(a, 16777216), (0, _$$_REQUIRE(_dependencyMap[3]).multiply)((0, _$$_REQUIRE(_dependencyMap[3]).round)(r), 65536), (0, _$$_REQUIRE(_dependencyMap[3]).multiply)((0, _$$_REQUIRE(_dependencyMap[3]).round)(g), 256), (0, _$$_REQUIRE(_dependencyMap[3]).round)(b)); + + if (_reactNative.Platform.OS === 'android') { + return (0, _$$_REQUIRE(_dependencyMap[3]).cond)((0, _$$_REQUIRE(_dependencyMap[3]).lessThan)(color, 2147483648), color, (0, _$$_REQUIRE(_dependencyMap[3]).sub)(color, Math.pow(2, 32))); + } + + return color; + }); + + function color(r, g, b) { + var a = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; + + if (_reactNative.Platform.OS === 'web') { + return (0, _$$_REQUIRE(_dependencyMap[3]).concat)('rgba(', r, ',', g, ',', b, ',', a, ')'); + } + + if (a instanceof _AnimatedNode.default) { + a = (0, _$$_REQUIRE(_dependencyMap[3]).round)((0, _$$_REQUIRE(_dependencyMap[3]).multiply)(a, 255)); + } else { + a = Math.round(a * 255); + } + + return procColor(r, g, b, a); + } +},681,[28,5,651,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = diff; + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var procDiff = (0, _$$_REQUIRE(_dependencyMap[2]).proc)(function (v, stash, prev) { + return (0, _$$_REQUIRE(_dependencyMap[2]).block)([(0, _$$_REQUIRE(_dependencyMap[2]).set)(stash, (0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).defined)(prev), (0, _$$_REQUIRE(_dependencyMap[2]).sub)(v, prev), 0)), (0, _$$_REQUIRE(_dependencyMap[2]).set)(prev, v), stash]); + }); + + function diff(v) { + var stash = new _InternalAnimatedValue.default(0); + var prev = new _InternalAnimatedValue.default(); + return procDiff(v, stash, prev); + } +},682,[5,656,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = diffClamp; + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _diff = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + function diffClamp(a, minVal, maxVal) { + var value = new _InternalAnimatedValue.default(); + return (0, _$$_REQUIRE(_dependencyMap[3]).set)(value, (0, _$$_REQUIRE(_dependencyMap[3]).min)((0, _$$_REQUIRE(_dependencyMap[3]).max)((0, _$$_REQUIRE(_dependencyMap[3]).add)((0, _$$_REQUIRE(_dependencyMap[3]).cond)((0, _$$_REQUIRE(_dependencyMap[3]).defined)(value), value, a), (0, _diff.default)(a)), minVal), maxVal)); + } +},683,[5,656,682,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = interpolateColors; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _color = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _interpolate = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function red(c) { + return c >> 16 & 255; + } + + function green(c) { + return c >> 8 & 255; + } + + function blue(c) { + return c & 255; + } + + function opacity(c) { + return (c >> 24 & 255) / 255; + } + + function interpolateColors(animationValue, options) { + var inputRange = options.inputRange, + outputColorRange = options.outputColorRange; + var colors = outputColorRange.map(_reactNative.processColor); + var r = (0, _$$_REQUIRE(_dependencyMap[4]).round)((0, _interpolate.default)(animationValue, { + inputRange: inputRange, + outputRange: colors.map(red), + extrapolate: _interpolate.Extrapolate.CLAMP + })); + var g = (0, _$$_REQUIRE(_dependencyMap[4]).round)((0, _interpolate.default)(animationValue, { + inputRange: inputRange, + outputRange: colors.map(green), + extrapolate: _interpolate.Extrapolate.CLAMP + })); + var b = (0, _$$_REQUIRE(_dependencyMap[4]).round)((0, _interpolate.default)(animationValue, { + inputRange: inputRange, + outputRange: colors.map(blue), + extrapolate: _interpolate.Extrapolate.CLAMP + })); + var a = (0, _interpolate.default)(animationValue, { + inputRange: inputRange, + outputRange: colors.map(opacity), + extrapolate: _interpolate.Extrapolate.CLAMP + }); + return (0, _color.default)(r, g, b, a); + } +},684,[28,5,681,668,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = onChange; + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var procOnChange = (0, _$$_REQUIRE(_dependencyMap[2]).proc)(function (value, action, prevValue) { + return (0, _$$_REQUIRE(_dependencyMap[2]).block)([(0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).not)((0, _$$_REQUIRE(_dependencyMap[2]).defined)(prevValue)), (0, _$$_REQUIRE(_dependencyMap[2]).set)(prevValue, value)), (0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).neq)(value, prevValue), [(0, _$$_REQUIRE(_dependencyMap[2]).set)(prevValue, value), action])]); + }); + + function onChange(value, action) { + var prevValue = new _InternalAnimatedValue.default(); + return procOnChange(value, action, prevValue); + } +},685,[5,656,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = createAnimatedComponent; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _ReanimatedEventEmitter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _AnimatedEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _AnimatedNode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _AnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NODE_MAPPING = new Map(); + + function listener(data) { + var component = NODE_MAPPING.get(data.viewTag); + component && component._updateFromNative(data.props); + } + + function dummyListener() {} + + function createAnimatedComponent(Component) { + (0, _invariant.default)(typeof Component !== 'function' || Component.prototype && Component.prototype.isReactComponent, "`createAnimatedComponent` does not support stateless functional components; use a class component instead."); + + var AnimatedComponent = function (_React$Component) { + (0, _inherits2.default)(AnimatedComponent, _React$Component); + + var _super = _createSuper(AnimatedComponent); + + function AnimatedComponent(props) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedComponent); + _this = _super.call(this, props); + _this._invokeAnimatedPropsCallbackOnMount = false; + + _this._animatedPropsCallback = function () { + if (_this._component == null) { + _this._invokeAnimatedPropsCallbackOnMount = true; + } else if (typeof _this._component.setNativeProps !== 'function') { + _this.forceUpdate(); + } else { + _this._component.setNativeProps(_this._propsAnimated.__getValue()); + } + }; + + _this._setComponentRef = function (c) { + if (c !== _this._component) { + _this._component = c; + } + }; + + _this._attachProps(_this.props); + + return _this; + } + + (0, _createClass2.default)(AnimatedComponent, [{ + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._detachPropUpdater(); + + this._propsAnimated && this._propsAnimated.__detach(); + + this._detachNativeEvents(); + } + }, { + key: "setNativeProps", + value: function setNativeProps(props) { + this._component.setNativeProps(props); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + if (this._invokeAnimatedPropsCallbackOnMount) { + this._invokeAnimatedPropsCallbackOnMount = false; + + this._animatedPropsCallback(); + } + + this._propsAnimated.setNativeView(this._component); + + this._attachNativeEvents(); + + this._attachPropUpdater(); + } + }, { + key: "_getEventViewRef", + value: function _getEventViewRef() { + return this._component.getScrollableNode ? this._component.getScrollableNode() : this._component; + } + }, { + key: "_attachNativeEvents", + value: function _attachNativeEvents() { + var node = this._getEventViewRef(); + + for (var key in this.props) { + var prop = this.props[key]; + + if (prop instanceof _AnimatedEvent.default) { + prop.attachEvent(node, key); + } + } + } + }, { + key: "_detachNativeEvents", + value: function _detachNativeEvents() { + var node = this._getEventViewRef(); + + for (var key in this.props) { + var prop = this.props[key]; + + if (prop instanceof _AnimatedEvent.default) { + prop.detachEvent(node, key); + } + } + } + }, { + key: "_reattachNativeEvents", + value: function _reattachNativeEvents(prevProps) { + var node = this._getEventViewRef(); + + var attached = new Set(); + var nextEvts = new Set(); + + for (var key in this.props) { + var prop = this.props[key]; + + if (prop instanceof _AnimatedEvent.default) { + nextEvts.add(prop.__nodeID); + } + } + + for (var _key in prevProps) { + var _prop = this.props[_key]; + + if (_prop instanceof _AnimatedEvent.default) { + if (!nextEvts.has(_prop.__nodeID)) { + _prop.detachEvent(node, _key); + } else { + attached.add(_prop.__nodeID); + } + } + } + + for (var _key2 in this.props) { + var _prop2 = this.props[_key2]; + + if (_prop2 instanceof _AnimatedEvent.default && !attached.has(_prop2.__nodeID)) { + _prop2.attachEvent(node, _key2); + } + } + } + }, { + key: "_attachProps", + value: function _attachProps(nextProps) { + var oldPropsAnimated = this._propsAnimated; + this._propsAnimated = (0, _$$_REQUIRE(_dependencyMap[14]).createOrReusePropsNode)(nextProps, this._animatedPropsCallback, oldPropsAnimated); + + if (oldPropsAnimated !== this._propsAnimated) { + oldPropsAnimated && oldPropsAnimated.__detach(); + } + } + }, { + key: "_updateFromNative", + value: function _updateFromNative(props) { + this._component.setNativeProps(props); + } + }, { + key: "_attachPropUpdater", + value: function _attachPropUpdater() { + var viewTag = (0, _reactNative.findNodeHandle)(this); + NODE_MAPPING.set(viewTag, this); + + if (NODE_MAPPING.size === 1) { + _ReanimatedEventEmitter.default.addListener('onReanimatedPropsChange', listener); + } + } + }, { + key: "_detachPropUpdater", + value: function _detachPropUpdater() { + var viewTag = (0, _reactNative.findNodeHandle)(this); + NODE_MAPPING.delete(viewTag); + + if (NODE_MAPPING.size === 0) { + _ReanimatedEventEmitter.default.removeAllListeners('onReanimatedPropsChange'); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + this._attachProps(this.props); + + this._reattachNativeEvents(prevProps); + + this._propsAnimated.setNativeView(this._component); + } + }, { + key: "_filterNonAnimatedStyle", + value: function _filterNonAnimatedStyle(inputStyle) { + var style = {}; + + for (var key in inputStyle) { + var value = inputStyle[key]; + + if (key !== 'transform') { + if (value instanceof _AnimatedValue.default) { + style[key] = value._startingValue; + } else if (!(value instanceof _AnimatedNode.default)) { + style[key] = value; + } + } + } + + return style; + } + }, { + key: "_filterNonAnimatedProps", + value: function _filterNonAnimatedProps(inputProps) { + var props = {}; + + for (var key in inputProps) { + var value = inputProps[key]; + + if (key === 'style') { + props[key] = this._filterNonAnimatedStyle(_reactNative.StyleSheet.flatten(value)); + } else if (value instanceof _AnimatedEvent.default) { + props[key] = dummyListener; + } else if (value instanceof _AnimatedValue.default) { + props[key] = value._startingValue; + } else if (!(value instanceof _AnimatedNode.default)) { + props[key] = value; + } + } + + return props; + } + }, { + key: "render", + value: function render() { + var props = this._filterNonAnimatedProps(this.props); + + var platformProps = _reactNative.Platform.select({ + web: {}, + default: { + collapsable: false + } + }); + + return _react.default.createElement(Component, (0, _extends2.default)({}, props, { + ref: this._setComponentRef + }, platformProps)); + } + }, { + key: "getNode", + value: function getNode() { + return this._component; + } + }]); + return AnimatedComponent; + }(_react.default.Component); + + AnimatedComponent.displayName = "AnimatedComponent(" + (Component.displayName || Component.name || 'Component') + ")"; + return AnimatedComponent; + } +},686,[5,6,7,8,12,14,16,17,28,665,666,651,667,601,687]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createOrReusePropsNode = createOrReusePropsNode; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _AnimatedEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _areEqual = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function sanitizeProps(inputProps) { + var props = {}; + + for (var key in inputProps) { + var value = inputProps[key]; + + if (value instanceof _AnimatedNode2.default && !(value instanceof _AnimatedEvent.default)) { + props[key] = value.__nodeID; + } + } + + return props; + } + + function createOrReusePropsNode(props, callback, oldNode) { + if (props.style) { + props = (0, _extends2.default)({}, props, { + style: (0, _$$_REQUIRE(_dependencyMap[13]).createOrReuseStyleNode)(props.style, oldNode && oldNode._props.style) + }); + } + + var config = sanitizeProps(props); + + if (oldNode && (0, _areEqual.default)(config, oldNode._config)) { + return oldNode; + } + + return new AnimatedProps(props, config, callback); + } + + var AnimatedProps = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedProps, _AnimatedNode); + + var _super = _createSuper(AnimatedProps); + + function AnimatedProps(props, config, callback) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedProps); + _this = _super.call(this, { + type: 'props', + props: config + }, Object.values(props).filter(function (n) { + return !(n instanceof _AnimatedEvent.default); + })); + _this._config = config; + _this._props = props; + _this._callback = callback; + + _this.__attach(); + + return _this; + } + + (0, _createClass2.default)(AnimatedProps, [{ + key: "toString", + value: function toString() { + return "AnimatedProps, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + var props = {}; + + for (var key in this._props) { + var value = this._props[key]; + + if (value instanceof _AnimatedNode2.default) { + props[key] = value.__getValue(); + } + } + + return props; + } + }, { + key: "__detach", + value: function __detach() { + var nativeViewTag = (0, _reactNative.findNodeHandle)(this._animatedView); + (0, _invariant.default)(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + + this._disconnectAnimatedView(nativeViewTag); + + (0, _get2.default)((0, _getPrototypeOf2.default)(AnimatedProps.prototype), "__detach", this).call(this); + } + }, { + key: "update", + value: function update() { + this._callback(); + + if (!this._animatedView) { + return; + } + + (0, _$$_REQUIRE(_dependencyMap[14]).val)(this); + } + }, { + key: "setNativeView", + value: function setNativeView(animatedView) { + if (this._animatedView === animatedView) { + return; + } + + this._animatedView = animatedView; + var nativeViewTag = (0, _reactNative.findNodeHandle)(this._animatedView); + (0, _invariant.default)(nativeViewTag != null, 'Unable to locate attached view in the native tree'); + + this._connectAnimatedView(nativeViewTag); + } + }]); + return AnimatedProps; + }(_AnimatedNode2.default); +},687,[5,7,8,90,12,14,16,6,28,651,666,601,688,689,652]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + var aStackPool = []; + var bStackPool = []; + /** + * Checks if two values are equal. Values may be primitives, arrays, or objects. + * Returns true if both arguments have the same keys and values. + * + * @see http://underscorejs.org + * @copyright 2009-2013 Jeremy Ashkenas, DocumentCloud Inc. + * @license MIT + */ + + function areEqual(a, b) { + var aStack = aStackPool.length ? aStackPool.pop() : []; + var bStack = bStackPool.length ? bStackPool.pop() : []; + var result = eq(a, b, aStack, bStack); + aStack.length = 0; + bStack.length = 0; + aStackPool.push(aStack); + bStackPool.push(bStack); + return result; + } + + function eq(a, b, aStack, bStack) { + if (a === b) { + return a !== 0 || 1 / a == 1 / b; + } + + if (a == null || b == null) { + return false; + } + + if (typeof a != 'object' || typeof b != 'object') { + return false; + } + + var objToStr = Object.prototype.toString; + var className = objToStr.call(a); + + if (className != objToStr.call(b)) { + return false; + } + + switch (className) { + case '[object String]': + return a == String(b); + + case '[object Number]': + return isNaN(a) || isNaN(b) ? false : a == Number(b); + + case '[object Date]': + case '[object Boolean]': + return +a == +b; + + case '[object RegExp]': + return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase; + } + + var length = aStack.length; + + while (length--) { + if (aStack[length] == a) { + return bStack[length] == b; + } + } + + aStack.push(a); + bStack.push(b); + var size = 0; + + if (className === '[object Array]') { + size = a.length; + + if (size !== b.length) { + return false; + } + + while (size--) { + if (!eq(a[size], b[size], aStack, bStack)) { + return false; + } + } + } else { + if (a.constructor !== b.constructor) { + return false; + } + + if (a.hasOwnProperty('valueOf') && b.hasOwnProperty('valueOf')) { + return a.valueOf() == b.valueOf(); + } + + var keys = Object.keys(a); + + if (keys.length != Object.keys(b).length) { + return false; + } + + for (var i = 0; i < keys.length; i++) { + if (!eq(a[keys[i]], b[keys[i]], aStack, bStack)) { + return false; + } + } + } + + aStack.pop(); + bStack.pop(); + return true; + } + + module.exports = areEqual; +},688,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createOrReuseStyleNode = createOrReuseStyleNode; + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _areEqual = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function sanitizeStyle(inputStyle) { + var style = {}; + + for (var key in inputStyle) { + var value = inputStyle[key]; + + if (value instanceof _AnimatedNode2.default) { + style[key] = value.__nodeID; + } + } + + return style; + } + + function createOrReuseStyleNode(style, oldNode) { + style = _reactNative.StyleSheet.flatten(style) || {}; + + if (style.transform) { + style = (0, _extends2.default)({}, style, { + transform: (0, _$$_REQUIRE(_dependencyMap[10]).createOrReuseTransformNode)(style.transform, oldNode && oldNode._style.transform) + }); + } + + var config = sanitizeStyle(style); + + if (oldNode && (0, _areEqual.default)(config, oldNode._config)) { + return oldNode; + } + + return new AnimatedStyle(style, config); + } + + var AnimatedStyle = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedStyle, _AnimatedNode); + + var _super = _createSuper(AnimatedStyle); + + function AnimatedStyle(style, config) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedStyle); + _this = _super.call(this, { + type: 'style', + style: config + }, Object.values(style)); + _this._config = config; + _this._style = style; + return _this; + } + + (0, _createClass2.default)(AnimatedStyle, [{ + key: "toString", + value: function toString() { + return "AnimatedStyle, id: " + this.__nodeID; + } + }, { + key: "_walkStyleAndGetAnimatedValues", + value: function _walkStyleAndGetAnimatedValues(style) { + var updatedStyle = {}; + + for (var key in style) { + var value = style[key]; + + if (value instanceof _AnimatedNode2.default) { + updatedStyle[key] = value.__getValue(); + } else if (value && !Array.isArray(value) && typeof value === 'object') { + updatedStyle[key] = this._walkStyleAndGetAnimatedValues(value); + } + } + + return updatedStyle; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + return this._walkStyleAndGetAnimatedValues(this._style); + } + }]); + return AnimatedStyle; + }(_AnimatedNode2.default); + + exports.default = AnimatedStyle; +},689,[5,7,8,12,14,16,6,28,651,688,690]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createOrReuseTransformNode = createOrReuseTransformNode; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _AnimatedNode2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _areEqual = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function sanitizeTransform(inputTransform) { + var outputTransform = []; + inputTransform.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _AnimatedNode2.default) { + outputTransform.push({ + property: key, + nodeID: value.__nodeID + }); + } else { + outputTransform.push({ + property: key, + value: value + }); + } + } + }); + return outputTransform; + } + + function extractAnimatedParentNodes(transform) { + var parents = []; + transform.forEach(function (transform) { + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _AnimatedNode2.default) { + parents.push(value); + } + } + }); + return parents; + } + + function createOrReuseTransformNode(transform, oldNode) { + var config = sanitizeTransform(transform); + + if (oldNode && (0, _areEqual.default)(config, oldNode._config)) { + return oldNode; + } + + return new AnimatedTransform(transform, config); + } + + var AnimatedTransform = function (_AnimatedNode) { + (0, _inherits2.default)(AnimatedTransform, _AnimatedNode); + + var _super = _createSuper(AnimatedTransform); + + function AnimatedTransform(transform, config) { + var _this; + + (0, _classCallCheck2.default)(this, AnimatedTransform); + _this = _super.call(this, { + type: 'transform', + transform: config + }, extractAnimatedParentNodes(transform)); + _this._config = config; + _this._transform = transform; + return _this; + } + + (0, _createClass2.default)(AnimatedTransform, [{ + key: "toString", + value: function toString() { + return "AnimatedTransform, id: " + this.__nodeID; + } + }, { + key: "__onEvaluate", + value: function __onEvaluate() { + return this._transform.map(function (transform) { + var result = {}; + + for (var key in transform) { + var value = transform[key]; + + if (value instanceof _AnimatedNode2.default) { + result[key] = value.__getValue(); + } + } + + return result; + }); + } + }]); + return AnimatedTransform; + }(_AnimatedNode2.default); +},690,[5,7,8,12,14,16,651,688]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var VELOCITY_EPS = 5; + + function decay(clock, state, config) { + var lastTime = (0, _$$_REQUIRE(_dependencyMap[0]).cond)(state.time, state.time, clock); + var deltaTime = (0, _$$_REQUIRE(_dependencyMap[0]).sub)(clock, lastTime); + var kv = (0, _$$_REQUIRE(_dependencyMap[0]).pow)(config.deceleration, deltaTime); + var kx = (0, _$$_REQUIRE(_dependencyMap[0]).divide)((0, _$$_REQUIRE(_dependencyMap[0]).multiply)(config.deceleration, (0, _$$_REQUIRE(_dependencyMap[0]).sub)(1, kv)), (0, _$$_REQUIRE(_dependencyMap[0]).sub)(1, config.deceleration)); + var v0 = (0, _$$_REQUIRE(_dependencyMap[0]).divide)(state.velocity, 1000); + var v = (0, _$$_REQUIRE(_dependencyMap[0]).multiply)(v0, kv, 1000); + var x = (0, _$$_REQUIRE(_dependencyMap[0]).add)(state.position, (0, _$$_REQUIRE(_dependencyMap[0]).multiply)(v0, kx)); + return (0, _$$_REQUIRE(_dependencyMap[0]).block)([(0, _$$_REQUIRE(_dependencyMap[0]).set)(state.position, x), (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.velocity, v), (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.time, clock), (0, _$$_REQUIRE(_dependencyMap[0]).cond)((0, _$$_REQUIRE(_dependencyMap[0]).lessThan)((0, _$$_REQUIRE(_dependencyMap[0]).abs)(v), VELOCITY_EPS), (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.finished, 1))]); + } + + var procDecay = (0, _$$_REQUIRE(_dependencyMap[0]).proc)(function (clock, time, velocity, position, finished, deceleration) { + return decay(clock, { + time: time, + velocity: velocity, + position: position, + finished: finished + }, { + deceleration: deceleration + }); + }); + + var _default = function _default(clock, _ref, _ref2) { + var time = _ref.time, + velocity = _ref.velocity, + position = _ref.position, + finished = _ref.finished; + var deceleration = _ref2.deceleration; + return procDecay(clock, time, velocity, position, finished, deceleration); + }; + + exports.default = _default; +},691,[653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = _default; + var internalTiming = (0, _$$_REQUIRE(_dependencyMap[0]).proc)(function (clock, time, frameTime, position, finished, toValue, duration, nextProgress, progress, newFrameTime) { + var state = { + time: time, + finished: finished, + frameTime: frameTime, + position: position + }; + var config = { + duration: duration, + toValue: toValue + }; + var distanceLeft = (0, _$$_REQUIRE(_dependencyMap[0]).sub)(config.toValue, state.position); + var fullDistance = (0, _$$_REQUIRE(_dependencyMap[0]).divide)(distanceLeft, (0, _$$_REQUIRE(_dependencyMap[0]).sub)(1, progress)); + var startPosition = (0, _$$_REQUIRE(_dependencyMap[0]).sub)(config.toValue, fullDistance); + var nextPosition = (0, _$$_REQUIRE(_dependencyMap[0]).add)(startPosition, (0, _$$_REQUIRE(_dependencyMap[0]).multiply)(fullDistance, nextProgress)); + return (0, _$$_REQUIRE(_dependencyMap[0]).block)([(0, _$$_REQUIRE(_dependencyMap[0]).cond)((0, _$$_REQUIRE(_dependencyMap[0]).greaterOrEq)(newFrameTime, config.duration), [(0, _$$_REQUIRE(_dependencyMap[0]).set)(state.position, config.toValue), (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.finished, 1)], (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.position, nextPosition)), (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.frameTime, newFrameTime), (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.time, clock)]); + }); + + function _default(clock, state, config) { + if (config.duration === 0) { + return (0, _$$_REQUIRE(_dependencyMap[0]).block)([(0, _$$_REQUIRE(_dependencyMap[0]).set)(state.position, config.toValue), (0, _$$_REQUIRE(_dependencyMap[0]).set)(state.finished, 1)]); + } + + var lastTime = (0, _$$_REQUIRE(_dependencyMap[0]).cond)(state.time, state.time, clock); + var newFrameTime = (0, _$$_REQUIRE(_dependencyMap[0]).add)(state.frameTime, (0, _$$_REQUIRE(_dependencyMap[0]).sub)(clock, lastTime)); + var nextProgress = config.easing((0, _$$_REQUIRE(_dependencyMap[0]).divide)(newFrameTime, config.duration)); + var progress = config.easing((0, _$$_REQUIRE(_dependencyMap[0]).divide)(state.frameTime, config.duration)); + return internalTiming(clock, state.time, state.frameTime, state.position, state.finished, config.toValue, config.duration, nextProgress, progress, newFrameTime); + } +},692,[653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var MAX_STEPS_MS = 64; + + function spring(clock, state, config) { + var lastTime = (0, _$$_REQUIRE(_dependencyMap[2]).cond)(state.time, state.time, clock); + var deltaTime = (0, _$$_REQUIRE(_dependencyMap[2]).min)((0, _$$_REQUIRE(_dependencyMap[2]).sub)(clock, lastTime), MAX_STEPS_MS); + var c = config.damping; + var m = config.mass; + var k = config.stiffness; + var v0 = (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(-1, state.velocity); + var x0 = (0, _$$_REQUIRE(_dependencyMap[2]).sub)(config.toValue, state.position); + var zeta = (0, _$$_REQUIRE(_dependencyMap[2]).divide)(c, (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(2, (0, _$$_REQUIRE(_dependencyMap[2]).sqrt)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(k, m)))); + var omega0 = (0, _$$_REQUIRE(_dependencyMap[2]).sqrt)((0, _$$_REQUIRE(_dependencyMap[2]).divide)(k, m)); + var omega1 = (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(omega0, (0, _$$_REQUIRE(_dependencyMap[2]).sqrt)((0, _$$_REQUIRE(_dependencyMap[2]).sub)(1, (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(zeta, zeta)))); + var t = (0, _$$_REQUIRE(_dependencyMap[2]).divide)(deltaTime, 1000); + var sin1 = (0, _$$_REQUIRE(_dependencyMap[2]).sin)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(omega1, t)); + var cos1 = (0, _$$_REQUIRE(_dependencyMap[2]).cos)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(omega1, t)); + var underDampedEnvelope = (0, _$$_REQUIRE(_dependencyMap[2]).exp)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(-1, zeta, omega0, t)); + var underDampedFrag1 = (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(underDampedEnvelope, (0, _$$_REQUIRE(_dependencyMap[2]).add)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(sin1, (0, _$$_REQUIRE(_dependencyMap[2]).divide)((0, _$$_REQUIRE(_dependencyMap[2]).add)(v0, (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(zeta, omega0, x0)), omega1)), (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(x0, cos1))); + var underDampedPosition = (0, _$$_REQUIRE(_dependencyMap[2]).sub)(config.toValue, underDampedFrag1); + var underDampedVelocity = (0, _$$_REQUIRE(_dependencyMap[2]).sub)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(zeta, omega0, underDampedFrag1), (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(underDampedEnvelope, (0, _$$_REQUIRE(_dependencyMap[2]).sub)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(cos1, (0, _$$_REQUIRE(_dependencyMap[2]).add)(v0, (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(zeta, omega0, x0))), (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(omega1, x0, sin1)))); + var criticallyDampedEnvelope = (0, _$$_REQUIRE(_dependencyMap[2]).exp)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(-1, omega0, t)); + var criticallyDampedPosition = (0, _$$_REQUIRE(_dependencyMap[2]).sub)(config.toValue, (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(criticallyDampedEnvelope, (0, _$$_REQUIRE(_dependencyMap[2]).add)(x0, (0, _$$_REQUIRE(_dependencyMap[2]).multiply)((0, _$$_REQUIRE(_dependencyMap[2]).add)(v0, (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(omega0, x0)), t)))); + var criticallyDampedVelocity = (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(criticallyDampedEnvelope, (0, _$$_REQUIRE(_dependencyMap[2]).add)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(v0, (0, _$$_REQUIRE(_dependencyMap[2]).sub)((0, _$$_REQUIRE(_dependencyMap[2]).multiply)(t, omega0), 1)), (0, _$$_REQUIRE(_dependencyMap[2]).multiply)(t, x0, omega0, omega0))); + var prevPosition = state.prevPosition ? state.prevPosition : new _InternalAnimatedValue.default(0); + var isOvershooting = (0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).and)(config.overshootClamping, (0, _$$_REQUIRE(_dependencyMap[2]).neq)(config.stiffness, 0)), (0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).lessThan)(prevPosition, config.toValue), (0, _$$_REQUIRE(_dependencyMap[2]).greaterThan)(state.position, config.toValue), (0, _$$_REQUIRE(_dependencyMap[2]).lessThan)(state.position, config.toValue))); + var isVelocity = (0, _$$_REQUIRE(_dependencyMap[2]).lessThan)((0, _$$_REQUIRE(_dependencyMap[2]).abs)(state.velocity), config.restSpeedThreshold); + var isDisplacement = (0, _$$_REQUIRE(_dependencyMap[2]).or)((0, _$$_REQUIRE(_dependencyMap[2]).eq)(config.stiffness, 0), (0, _$$_REQUIRE(_dependencyMap[2]).lessThan)((0, _$$_REQUIRE(_dependencyMap[2]).abs)((0, _$$_REQUIRE(_dependencyMap[2]).sub)(config.toValue, state.position)), config.restDisplacementThreshold)); + return (0, _$$_REQUIRE(_dependencyMap[2]).block)([(0, _$$_REQUIRE(_dependencyMap[2]).set)(prevPosition, state.position), (0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).lessThan)(zeta, 1), [(0, _$$_REQUIRE(_dependencyMap[2]).set)(state.position, underDampedPosition), (0, _$$_REQUIRE(_dependencyMap[2]).set)(state.velocity, underDampedVelocity)], [(0, _$$_REQUIRE(_dependencyMap[2]).set)(state.position, criticallyDampedPosition), (0, _$$_REQUIRE(_dependencyMap[2]).set)(state.velocity, criticallyDampedVelocity)]), (0, _$$_REQUIRE(_dependencyMap[2]).set)(state.time, clock), (0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).or)(isOvershooting, (0, _$$_REQUIRE(_dependencyMap[2]).and)(isVelocity, isDisplacement)), [(0, _$$_REQUIRE(_dependencyMap[2]).cond)((0, _$$_REQUIRE(_dependencyMap[2]).neq)(config.stiffness, 0), [(0, _$$_REQUIRE(_dependencyMap[2]).set)(state.velocity, 0), (0, _$$_REQUIRE(_dependencyMap[2]).set)(state.position, config.toValue)]), (0, _$$_REQUIRE(_dependencyMap[2]).set)(state.finished, 1)])]); + } + + var procSpring = (0, _$$_REQUIRE(_dependencyMap[2]).proc)(function (finished, velocity, position, time, prevPosition, toValue, damping, mass, stiffness, overshootClamping, restSpeedThreshold, restDisplacementThreshold, clock) { + return spring(clock, { + finished: finished, + velocity: velocity, + position: position, + time: time, + prevPosition: prevPosition + }, { + toValue: toValue, + damping: damping, + mass: mass, + stiffness: stiffness, + overshootClamping: overshootClamping, + restDisplacementThreshold: restDisplacementThreshold, + restSpeedThreshold: restSpeedThreshold + }); + }); + + var _default = function _default(clock, _ref, _ref2) { + var finished = _ref.finished, + velocity = _ref.velocity, + position = _ref.position, + time = _ref.time, + prevPosition = _ref.prevPosition; + var toValue = _ref2.toValue, + damping = _ref2.damping, + mass = _ref2.mass, + stiffness = _ref2.stiffness, + overshootClamping = _ref2.overshootClamping, + restDisplacementThreshold = _ref2.restDisplacementThreshold, + restSpeedThreshold = _ref2.restSpeedThreshold; + return procSpring(finished, velocity, position, time, prevPosition, toValue, damping, mass, stiffness, overshootClamping, restSpeedThreshold, restDisplacementThreshold, clock); + }; + + exports.default = _default; +},693,[5,656,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var Animation = function () { + function Animation() { + (0, _classCallCheck2.default)(this, Animation); + } + + (0, _createClass2.default)(Animation, null, [{ + key: "springDefaultState", + value: function springDefaultState() { + return { + position: new _InternalAnimatedValue.default(0), + finished: new _InternalAnimatedValue.default(0), + velocity: new _InternalAnimatedValue.default(0), + time: new _InternalAnimatedValue.default(0) + }; + } + }, { + key: "decayDefaultState", + value: function decayDefaultState() { + return { + position: new _InternalAnimatedValue.default(0), + finished: new _InternalAnimatedValue.default(0), + velocity: new _InternalAnimatedValue.default(0), + time: new _InternalAnimatedValue.default(0) + }; + } + }, { + key: "timingDefaultState", + value: function timingDefaultState() { + return { + position: new _InternalAnimatedValue.default(0), + finished: new _InternalAnimatedValue.default(0), + time: new _InternalAnimatedValue.default(0), + frameTime: new _InternalAnimatedValue.default(0) + }; + } + }]); + return Animation; + }(); + + var _default = Animation; + exports.default = _default; +},694,[5,7,8,656]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = backwardsCompatibleAnimWrapper; + + var _AnimatedClock = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function createOldAnimationObject(node, animationStateDefaults, value, config) { + var newClock = new _AnimatedClock.default(); + var currentState = animationStateDefaults(); + var alwaysNode; + var isStarted = false; + var isDone = false; + var wasStopped = false; + var animationCallback; + var animation = { + start: function start(currentAnimationCallback) { + animationCallback = currentAnimationCallback; + + if (isStarted) { + animationCallback && animationCallback({ + finished: false + }); + return; + } + + if (isDone) { + console.warn('Animation has been finished before'); + return; + } + + if (!value.isNativelyInitialized()) { + return; + } + + isStarted = true; + (0, _$$_REQUIRE(_dependencyMap[2]).evaluateOnce)((0, _$$_REQUIRE(_dependencyMap[3]).set)(currentState.position, value), currentState.position, function () { + alwaysNode = (0, _$$_REQUIRE(_dependencyMap[3]).always)((0, _$$_REQUIRE(_dependencyMap[3]).set)(value, (0, _$$_REQUIRE(_dependencyMap[3]).block)([(0, _$$_REQUIRE(_dependencyMap[3]).cond)((0, _$$_REQUIRE(_dependencyMap[3]).clockRunning)(newClock), 0, (0, _$$_REQUIRE(_dependencyMap[3]).startClock)(newClock)), node(newClock, currentState, config), (0, _$$_REQUIRE(_dependencyMap[3]).cond)(currentState.finished, [(0, _$$_REQUIRE(_dependencyMap[3]).call)([], function () { + isStarted = false; + + if (!wasStopped) { + isDone = true; + } + + value.__detachAnimation(animation); + + isDone = true; + + if (!wasStopped) { + wasStopped = false; + } + }), (0, _$$_REQUIRE(_dependencyMap[3]).stopClock)(newClock)]), currentState.position]))); + + value.__attachAnimation(animation); + + alwaysNode.__addChild(value); + }); + }, + __detach: function __detach() { + animationCallback && animationCallback({ + finished: isDone + }); + animationCallback = null; + value.__initialized && alwaysNode.__removeChild(value); + }, + stop: function stop() { + if (isDone) { + console.warn('Calling stop has no effect as the animation has already completed'); + return; + } + + if (!isStarted) { + console.warn("Calling stop has no effect as the animation hasn't been started"); + return; + } + + wasStopped = true; + (0, _$$_REQUIRE(_dependencyMap[2]).evaluateOnce)((0, _$$_REQUIRE(_dependencyMap[3]).set)(currentState.finished, 1), currentState.finished); + }, + __stopImmediately_testOnly: function __stopImmediately_testOnly(result) { + animation.stop(); + isDone = result; + + value.__detachAnimation(animation); + } + }; + return animation; + } + + function backwardsCompatibleAnimWrapper(node, animationStateDefaults) { + return function (clock, state, config) { + if (config !== undefined) { + return node(clock, state, config); + } + + return createOldAnimationObject(node, animationStateDefaults, clock, state); + }; + } +},695,[5,659,673,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _InternalAnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + function stiffnessFromOrigamiValue(oValue) { + return (oValue - 30) * 3.62 + 194; + } + + function dampingFromOrigamiValue(oValue) { + return (oValue - 8) * 3 + 25; + } + + function stiffnessFromOrigamiNode(oValue) { + return (0, _$$_REQUIRE(_dependencyMap[4]).add)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)((0, _$$_REQUIRE(_dependencyMap[4]).sub)(oValue, 30), 3.62), 194); + } + + function dampingFromOrigamiNode(oValue) { + return (0, _$$_REQUIRE(_dependencyMap[4]).add)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)((0, _$$_REQUIRE(_dependencyMap[4]).sub)(oValue, 8), 3), 25); + } + + function makeConfigFromOrigamiTensionAndFriction(prevConfig) { + var tension = prevConfig.tension, + friction = prevConfig.friction, + rest = (0, _objectWithoutProperties2.default)(prevConfig, ["tension", "friction"]); + return (0, _extends2.default)({}, rest, { + stiffness: typeof tension === 'number' ? stiffnessFromOrigamiValue(tension) : stiffnessFromOrigamiNode(tension), + damping: typeof friction === 'number' ? dampingFromOrigamiValue(friction) : dampingFromOrigamiNode(friction) + }); + } + + function makeConfigFromBouncinessAndSpeed(prevConfig) { + var bounciness = prevConfig.bounciness, + speed = prevConfig.speed, + rest = (0, _objectWithoutProperties2.default)(prevConfig, ["bounciness", "speed"]); + + if (typeof bounciness === 'number' && typeof speed === 'number') { + return fromBouncinessAndSpeedNumbers(bounciness, speed, rest); + } + + return fromBouncinessAndSpeedNodes(bounciness, speed, rest); + } + + function fromBouncinessAndSpeedNodes(bounciness, speed, rest) { + function normalize(value, startValue, endValue) { + return (0, _$$_REQUIRE(_dependencyMap[4]).divide)((0, _$$_REQUIRE(_dependencyMap[4]).sub)(value, startValue), (0, _$$_REQUIRE(_dependencyMap[4]).sub)(endValue, startValue)); + } + + function projectNormal(n, start, end) { + return (0, _$$_REQUIRE(_dependencyMap[4]).add)(start, (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(n, (0, _$$_REQUIRE(_dependencyMap[4]).sub)(end, start))); + } + + function linearInterpolation(t, start, end) { + return (0, _$$_REQUIRE(_dependencyMap[4]).add)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, end), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)((0, _$$_REQUIRE(_dependencyMap[4]).sub)(1, t), start)); + } + + function quadraticOutInterpolation(t, start, end) { + return linearInterpolation((0, _$$_REQUIRE(_dependencyMap[4]).sub)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(2, t), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(t, t)), start, end); + } + + function b3Friction1(x) { + return (0, _$$_REQUIRE(_dependencyMap[4]).add)((0, _$$_REQUIRE(_dependencyMap[4]).sub)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.0007, (0, _$$_REQUIRE(_dependencyMap[4]).pow)(x, 3)), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.031, (0, _$$_REQUIRE(_dependencyMap[4]).pow)(x, 2))), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.64, x), 1.28); + } + + function b3Friction2(x) { + return (0, _$$_REQUIRE(_dependencyMap[4]).add)((0, _$$_REQUIRE(_dependencyMap[4]).sub)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.000044, (0, _$$_REQUIRE(_dependencyMap[4]).pow)(x, 3)), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.006, (0, _$$_REQUIRE(_dependencyMap[4]).pow)(x, 2))), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.36, x), 2); + } + + function b3Friction3(x) { + return (0, _$$_REQUIRE(_dependencyMap[4]).add)((0, _$$_REQUIRE(_dependencyMap[4]).sub)((0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.00000045, (0, _$$_REQUIRE(_dependencyMap[4]).pow)(x, 3)), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.000332, (0, _$$_REQUIRE(_dependencyMap[4]).pow)(x, 2))), (0, _$$_REQUIRE(_dependencyMap[4]).multiply)(0.1078, x), 5.84); + } + + function b3Nobounce(tension) { + return (0, _$$_REQUIRE(_dependencyMap[4]).cond)((0, _$$_REQUIRE(_dependencyMap[4]).lessOrEq)(tension, 18), b3Friction1(tension), (0, _$$_REQUIRE(_dependencyMap[4]).cond)((0, _$$_REQUIRE(_dependencyMap[4]).and)((0, _$$_REQUIRE(_dependencyMap[4]).greaterThan)(tension, 18), (0, _$$_REQUIRE(_dependencyMap[4]).lessOrEq)(tension, 44)), b3Friction2(tension), b3Friction3(tension))); + } + + var b = normalize((0, _$$_REQUIRE(_dependencyMap[4]).divide)(bounciness, 1.7), 0, 20); + b = projectNormal(b, 0, 0.8); + var s = normalize((0, _$$_REQUIRE(_dependencyMap[4]).divide)(speed, 1.7), 0, 20); + var bouncyTension = projectNormal(s, 0.5, 200); + var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01); + return (0, _extends2.default)({}, rest, { + stiffness: stiffnessFromOrigamiNode(bouncyTension), + damping: dampingFromOrigamiNode(bouncyFriction) + }); + } + + function fromBouncinessAndSpeedNumbers(bounciness, speed, rest) { + function normalize(value, startValue, endValue) { + return (value - startValue) / (endValue - startValue); + } + + function projectNormal(n, start, end) { + return start + n * (end - start); + } + + function linearInterpolation(t, start, end) { + return t * end + (1 - t) * start; + } + + function quadraticOutInterpolation(t, start, end) { + return linearInterpolation(2 * t - t * t, start, end); + } + + function b3Friction1(x) { + return 0.0007 * Math.pow(x, 3) - 0.031 * Math.pow(x, 2) + 0.64 * x + 1.28; + } + + function b3Friction2(x) { + return 0.000044 * Math.pow(x, 3) - 0.006 * Math.pow(x, 2) + 0.36 * x + 2; + } + + function b3Friction3(x) { + return 0.00000045 * Math.pow(x, 3) - 0.000332 * Math.pow(x, 2) + 0.1078 * x + 5.84; + } + + function b3Nobounce(tension) { + if (tension <= 18) { + return b3Friction1(tension); + } else if (tension > 18 && tension <= 44) { + return b3Friction2(tension); + } else { + return b3Friction3(tension); + } + } + + var b = normalize(bounciness / 1.7, 0, 20); + b = projectNormal(b, 0, 0.8); + var s = normalize(speed / 1.7, 0, 20); + var bouncyTension = projectNormal(s, 0.5, 200); + var bouncyFriction = quadraticOutInterpolation(b, b3Nobounce(bouncyTension), 0.01); + return (0, _extends2.default)({}, rest, { + stiffness: stiffnessFromOrigamiValue(bouncyTension), + damping: dampingFromOrigamiValue(bouncyFriction) + }); + } + + function makeDefaultConfig() { + return { + stiffness: new _InternalAnimatedValue.default(100), + mass: new _InternalAnimatedValue.default(1), + damping: new _InternalAnimatedValue.default(10), + overshootClamping: false, + restSpeedThreshold: 0.001, + restDisplacementThreshold: 0.001, + toValue: new _InternalAnimatedValue.default(0) + }; + } + + var _default = { + makeDefaultConfig: makeDefaultConfig, + makeConfigFromBouncinessAndSpeed: makeConfigFromBouncinessAndSpeed, + makeConfigFromOrigamiTensionAndFriction: makeConfigFromOrigamiTensionAndFriction + }; + exports.default = _default; +},696,[5,6,108,656,653]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = useValue; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _AnimatedValue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + function useValue(initialValue) { + var ref = _react.default.useRef(null); + + if (ref.current === null) { + ref.current = new _AnimatedValue.default(initialValue); + } + + return ref.current; + } +},697,[5,17,667]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.addWhitelistedNativeProps = addWhitelistedNativeProps; + exports.addWhitelistedUIProps = addWhitelistedUIProps; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _ReanimatedModule = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var UI_THREAD_PROPS_WHITELIST = { + opacity: true, + transform: true, + backgroundColor: true, + borderRightColor: true, + borderBottomColor: true, + borderColor: true, + borderEndColor: true, + borderLeftColor: true, + borderStartColor: true, + borderTopColor: true, + shadowOpacity: true, + shadowRadius: true, + scaleX: true, + scaleY: true, + translateX: true, + translateY: true + }; + var NATIVE_THREAD_PROPS_WHITELIST = { + borderBottomWidth: true, + borderEndWidth: true, + borderLeftWidth: true, + borderRightWidth: true, + borderStartWidth: true, + borderTopWidth: true, + borderWidth: true, + bottom: true, + flex: true, + flexGrow: true, + flexShrink: true, + height: true, + left: true, + margin: true, + marginBottom: true, + marginEnd: true, + marginHorizontal: true, + marginLeft: true, + marginRight: true, + marginStart: true, + marginTop: true, + marginVertical: true, + maxHeight: true, + maxWidth: true, + minHeight: true, + minWidth: true, + padding: true, + paddingBottom: true, + paddingEnd: true, + paddingHorizontal: true, + paddingLeft: true, + paddingRight: true, + paddingStart: true, + paddingTop: true, + paddingVertical: true, + right: true, + start: true, + top: true, + width: true, + zIndex: true, + borderBottomEndRadius: true, + borderBottomLeftRadius: true, + borderBottomRightRadius: true, + borderBottomStartRadius: true, + borderRadius: true, + borderTopEndRadius: true, + borderTopLeftRadius: true, + borderTopRightRadius: true, + borderTopStartRadius: true, + opacity: true, + elevation: true, + fontSize: true, + lineHeight: true, + textShadowRadius: true, + letterSpacing: true, + display: true, + backfaceVisibility: true, + overflow: true, + resizeMode: true, + fontStyle: true, + fontWeight: true, + textAlign: true, + textDecorationLine: true, + fontFamily: true, + textAlignVertical: true, + fontVariant: true, + textDecorationStyle: true, + textTransform: true, + writingDirection: true, + color: true + }; + + function configureProps() { + _ReanimatedModule.default.configureProps(Object.keys(NATIVE_THREAD_PROPS_WHITELIST), Object.keys(UI_THREAD_PROPS_WHITELIST)); + } + + function addWhitelistedNativeProps(props) { + NATIVE_THREAD_PROPS_WHITELIST = (0, _extends2.default)({}, NATIVE_THREAD_PROPS_WHITELIST, props); + configureProps(); + } + + function addWhitelistedUIProps(props) { + UI_THREAD_PROPS_WHITELIST = (0, _extends2.default)({}, UI_THREAD_PROPS_WHITELIST, props); + configureProps(); + } + + configureProps(); +},698,[5,6,648]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Css = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var RnCss = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _RnCss$default = RnCss.default, + Consumer = _RnCss$default.Consumer, + Provider = _RnCss$default.Provider; + + var getDeviceInfo = function getDeviceInfo() { + return { + isPortrait: _deviceUtils.default.isPortrait(), + isTablet: _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.isTablet(), + isDark: _deviceUtils.default.isDark() + }; + }; + + var CssProvider = function (_React$Component) { + (0, _inherits2.default)(CssProvider, _React$Component); + + var _super = _createSuper(CssProvider); + + function CssProvider() { + (0, _classCallCheck2.default)(this, CssProvider); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(CssProvider, [{ + key: "render", + value: function render() { + return _react.default.createElement(Provider, this.props); + } + }]); + return CssProvider; + }(_react.default.Component); + + var Css = function (_React$Component2) { + (0, _inherits2.default)(Css, _React$Component2); + + var _super2 = _createSuper(Css); + + function Css() { + (0, _classCallCheck2.default)(this, Css); + return _super2.apply(this, arguments); + } + + (0, _createClass2.default)(Css, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.onSizeChangeId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.addEventListener(_events.default.ON_ORIENTATION_CHANGE, function () { + RnCss.default.set((0, _extends2.default)({}, getDeviceInfo())); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.onSizeChangeId) { + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(this.onSizeChangeId); + } + } + }, { + key: "render", + value: function render() { + return _react.default.createElement(Consumer, this.props); + } + }], [{ + key: "flatten", + value: function flatten(styles, classes) { + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return RnCss.CssHelper.flatten(styles, classes, attributes); + } + }, { + key: "getStyleByCssClasses", + value: function getStyleByCssClasses() { + var classes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return RnCss.CssHelper.getStyle(classes, attributes); + } + }, { + key: "getStyleObjByCssClasses", + value: function getStyleObjByCssClasses() { + var classes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return RnCss.CssHelper.getStyleObj(classes, attributes); + } + }, { + key: "getActiveTheme", + value: function getActiveTheme() { + return RnCss.CssHelper.getActiveThemeId(); + } + }, { + key: "getThemeInUse", + value: function getThemeInUse() { + return RnCss.CssHelper.getInUseThemeId(); + } + }, { + key: "getThemes", + value: function getThemes() { + return RnCss.CssHelper.getThemes(); + } + }, { + key: "arrayToObject", + value: function arrayToObject(styles) { + return RnCss.CssHelper.arrayToObject(styles); + } + }, { + key: "applyCustomStyles", + value: function applyCustomStyles() { + var otherStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var merged = RnCss.CssHelper.mergeRnStyles((0, _$$_REQUIRE(_dependencyMap[14]).getDefaultStyles)(), otherStyles, (0, _$$_REQUIRE(_dependencyMap[15]).getDebugStyles)()); + RnCss.default.set((0, _extends2.default)({ + rnStyles: merged + }, getDeviceInfo(), { + activeTheme: Css.getUserTheme() + })); + } + }, { + key: "updateCustomStyles", + value: function updateCustomStyles(newTheme) { + var oldTheme; + return _regenerator.default.async(function updateCustomStyles$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + oldTheme = Css.getUserTheme(); + + if (!(newTheme !== oldTheme)) { + _context.next = 6; + break; + } + + _context.next = 4; + return _regenerator.default.awrap(global.getNewsmemoryConfig().setTheme(newTheme)); + + case 4: + RnCss.default.set({ + activeTheme: newTheme + }); + return _context.abrupt("return", true); + + case 6: + return _context.abrupt("return", false); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getUserTheme", + value: function getUserTheme() { + var _global$getNewsmemory = global.getNewsmemoryConfig(), + cssTheme = _global$getNewsmemory.cssTheme; + + return cssTheme; + } + }, { + key: "getDefaultBackgroundColor", + value: function getDefaultBackgroundColor() { + return RnCss.CssHelper.isActiveThemeDark() ? _$$_REQUIRE(_dependencyMap[12]).colors.grey1010 : _$$_REQUIRE(_dependencyMap[12]).colors.white; + } + }, { + key: "getAlternateDefaultBackgroundColor", + value: function getAlternateDefaultBackgroundColor() { + return RnCss.CssHelper.isActiveThemeDark() ? _$$_REQUIRE(_dependencyMap[12]).colors.grey1200 : _$$_REQUIRE(_dependencyMap[12]).colors.grey200; + } + }, { + key: "getDefaultForegroundColor", + value: function getDefaultForegroundColor() { + return RnCss.CssHelper.isActiveThemeDark() ? _$$_REQUIRE(_dependencyMap[12]).colors.white_transparent_135 : _$$_REQUIRE(_dependencyMap[12]).colors.black; + } + }, { + key: "isDarkTheme", + value: function isDarkTheme() { + return RnCss.CssHelper.isActiveThemeDark(); + } + }]); + return Css; + }(_react.default.Component); + + exports.Css = Css; + Css.Provider = CssProvider; + Css.use = RnCss.useCss; +},699,[5,80,6,7,8,12,14,16,17,700,460,458,462,572,708,709]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "useCss", { + enumerable: true, + get: function get() { + return _context.useCss; + } + }); + exports.default = exports.CssHelper = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _context = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function Provider(props) { + return _react.default.createElement(_context.default.Provider, (0, _extends2.default)({}, props, { + decorator: function decorator(state, decorators) { + var _ref = decorators || {}, + classes = _ref.classes, + rest = (0, _objectWithoutProperties2.default)(_ref, ["classes"]); + + return _$$_REQUIRE(_dependencyMap[6]).CssManager.getStyleObj(state, classes, rest); + } + })); + } + + function Consumer(_ref2) { + var children = _ref2.children, + props = (0, _objectWithoutProperties2.default)(_ref2, ["children"]); + return _react.default.createElement(_context.default.Consumer, props, function (_ref3) { + var _ref3$decoratedState = _ref3.decoratedState, + decoratedStyle = _ref3$decoratedState === undefined ? {} : _ref3$decoratedState; + + if (!props.classes || !props.classes.length) { + return children; + } + + if (!Object.keys(decoratedStyle).length) { + return children; + } + + return _react.default.Children.map(children, function (element) { + if (element) { + var _element$props = element.props, + style = _element$props.style, + rest = (0, _objectWithoutProperties2.default)(_element$props, ["style"]); + var newStyle = []; + + if (Array.isArray(style)) { + newStyle = (0, _toConsumableArray2.default)(style); + } else if (style !== undefined) { + newStyle.push(style); + } + + newStyle.push(decoratedStyle); + return _react.default.cloneElement(element, (0, _extends2.default)({}, rest, { + style: newStyle + })); + } + + return element; + }); + }); + } + + var Css = (0, _extends2.default)({}, _context.default, { + Provider: Provider, + Consumer: Consumer + }); + var CssHelper = { + arrayToObject: function arrayToObject() { + var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return _$$_REQUIRE(_dependencyMap[6]).CssManager.arrayToObject(styles); + }, + flatten: function flatten() { + var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var classes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + return _$$_REQUIRE(_dependencyMap[6]).CssManager.flatten(Css.get().state, styles, classes, attributes); + }, + getStyle: function getStyle() { + var classes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return _$$_REQUIRE(_dependencyMap[6]).CssManager.getStyle(Css.get().state, classes, attributes); + }, + getStyleObj: function getStyleObj() { + var classes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var attributes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return _$$_REQUIRE(_dependencyMap[6]).CssManager.getStyleObj(Css.get().state, classes, attributes); + }, + getInUseThemeId: function getInUseThemeId() { + return _$$_REQUIRE(_dependencyMap[6]).CssManager.getInUseThemeId(Css.get().state); + }, + getInUseTheme: function getInUseTheme() { + return _$$_REQUIRE(_dependencyMap[6]).CssManager.getInUseTheme(Css.get().state); + }, + getActiveThemeId: function getActiveThemeId() { + return _$$_REQUIRE(_dependencyMap[6]).CssManager.getActiveThemeId(Css.get().state); + }, + getThemes: function getThemes() { + return _$$_REQUIRE(_dependencyMap[6]).CssManager.getThemes(Css.get().state); + }, + isActiveThemeDark: function isActiveThemeDark() { + return _$$_REQUIRE(_dependencyMap[6]).CssManager.isActiveThemeDark(Css.get().state); + }, + mergeRnStyles: _$$_REQUIRE(_dependencyMap[7]).CssUtils.mergeRnStyles + }; + exports.CssHelper = CssHelper; + var _default = Css; + exports.default = _default; +},700,[5,21,6,108,17,701,704,706]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useCss = useCss; + exports.default = undefined; + var CssContext = (0, _$$_REQUIRE(_dependencyMap[0]).createReactiveContext)({ + rnStyles: {} + }); + + function useCss(decorators) { + return (0, _$$_REQUIRE(_dependencyMap[0]).useReactiveContext)(CssContext, decorators); + } + + var _default = CssContext; + exports.default = _default; +},701,[702]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _interopDefault(ex) { + return ex && typeof ex === 'object' && 'default' in ex ? ex['default'] : ex; + } + + var React = _$$_REQUIRE(_dependencyMap[0]); + + var React__default = _interopDefault(React); + + var isEqual = _interopDefault(_$$_REQUIRE(_dependencyMap[1])); + + function _extends() { + _extends = Object.assign ? Object.assign.bind() : function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; + }; + return _extends.apply(this, arguments); + } + + function _objectWithoutPropertiesLoose(source, excluded) { + if (source == null) return {}; + var target = {}; + var sourceKeys = Object.keys(source); + var key, i; + + for (i = 0; i < sourceKeys.length; i++) { + key = sourceKeys[i]; + if (excluded.indexOf(key) >= 0) continue; + target[key] = source[key]; + } + + return target; + } + + var Utils; + + (function (Utils) { + function equals(a, b) { + return isEqual(a, b); + } + + Utils.equals = equals; + })(Utils || (Utils = {})); + + var _excluded = ["value", "decorator"], + _excluded2 = ["children"]; + + var _decorator; + + function _decorateState(state, decorators) { + var decoratedState; + + if (typeof _decorator === "function") { + decoratedState = _decorator(state, decorators); + } + + return { + decoratedState: decoratedState, + state: state + }; + } + + function createReactiveContext(defaultValue, defaultDecorator) { + var Context = React.createContext(defaultValue); + var _subscribers = {}; + + var _updater; + + var _currentData; + + _decorator = defaultDecorator; + + function _clearSubscribers(ids) { + if (ids === undefined) { + ids = []; + } + + for (var i = 0; i < ids.length; i++) { + delete _subscribers[ids[i]]; + } + } + + function _callSubscribers(state) { + var idsToDelete = []; + var ids = Object.keys(_subscribers); + ids.forEach(function (id) { + var subscriber = _subscribers[id]; + + if (subscriber && typeof subscriber.callback === "function") { + subscriber.callback(_decorateState(state, subscriber.decorators)); + } else { + idsToDelete.push(id); + } + }); + return idsToDelete; + } + + var Provider = function Provider(_ref) { + var propValue = _ref.value, + decoratorProp = _ref.decorator, + rest = _objectWithoutPropertiesLoose(_ref, _excluded); + + var _useState = React.useState(defaultValue), + state = _useState[0], + setState = _useState[1]; + + React.useEffect(function () { + _currentData = state; + + _clearSubscribers(_callSubscribers(state)); + + _updater = function _updater(value) { + if (value === undefined) { + value = state; + } + + var newState; + + if (typeof value === "function") { + newState = value(state); + } else if (typeof value === "object" && !Array.isArray(value)) { + newState = _extends({}, state, value); + } else { + newState = value || state; + } + + if (!Utils.equals(newState, state)) { + setState(newState); + } + }; + }, [state]); + React.useEffect(function () { + _decorator = decoratorProp; + }, [decoratorProp]); + React.useEffect(function () { + _updater(propValue); + }, [propValue]); + return React__default.createElement(Context.Provider, _$$_REQUIRE(_dependencyMap[2])({ + value: state + }, rest)); + }; + + function Consumer(props) { + var children = props.children, + decorators = _objectWithoutPropertiesLoose(props, _excluded2); + + var state = React.useContext(Context); + return React__default.createElement(React__default.Fragment, null, children(_decorateState(state, decorators))); + } + + return _extends({ + "default": Context + }, Context, { + Provider: Provider, + Consumer: Consumer, + set: function set(value) { + if (typeof _updater === "function") { + _updater(value); + } + }, + get: function get(decorators) { + return _decorateState(_currentData, decorators); + }, + subscribe: function subscribe(callback, decorators) { + var id = "" + Math.random().toString(36).substr(2, 9); + _subscribers[id] = { + callback: callback, + decorators: decorators + }; + + if (typeof callback === "function") { + callback(_decorateState(_currentData, decorators)); + } + + return function () { + delete _subscribers[id]; + }; + }, + removeAllSubscribers: function removeAllSubscribers() { + return _clearSubscribers(Object.keys(_subscribers)); + } + }); + } + + function useReactiveContext(context, decorators) { + var _state = React.useContext(context["default"]); + + return _decorateState(_state, decorators); + } + + exports.createReactiveContext = createReactiveContext; + exports.useReactiveContext = useReactiveContext; +},702,[17,703,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var LARGE_ARRAY_SIZE = 200; + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + var COMPARE_PARTIAL_FLAG = 1, + COMPARE_UNORDERED_FLAG = 2; + var MAX_SAFE_INTEGER = 9007199254740991; + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function('return this')(); + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + + var nodeUtil = function () { + try { + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }(); + + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + function arrayFilter(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + + return result; + } + + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + + return array; + } + + function arraySome(array, predicate) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + + return false; + } + + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + + return result; + } + + function baseUnary(func) { + return function (value) { + return func(value); + }; + } + + function cacheHas(cache, key) { + return cache.has(key); + } + + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + function mapToArray(map) { + var index = -1, + result = Array(map.size); + map.forEach(function (value, key) { + result[++index] = [key, value]; + }); + return result; + } + + function overArg(func, transform) { + return function (arg) { + return func(transform(arg)); + }; + } + + function setToArray(set) { + var index = -1, + result = Array(set.size); + set.forEach(function (value) { + result[++index] = value; + }); + return result; + } + + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + var coreJsData = root['__core-js_shared__']; + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + + var maskSrcKey = function () { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? 'Symbol(src)_1.' + uid : ''; + }(); + + var nativeObjectToString = objectProto.toString; + var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); + var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + this.clear(); + + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + function hashGet(key) { + var data = this.__data__; + + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); + } + + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; + return this; + } + + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + this.clear(); + + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + + var lastIndex = data.length - 1; + + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + + --this.size; + return true; + } + + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + return index < 0 ? undefined : data[index][1]; + } + + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + + return this; + } + + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + this.clear(); + + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash(), + 'map': new (Map || ListCache)(), + 'string': new Hash() + }; + } + + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + function SetCache(values) { + var index = -1, + length = values == null ? 0 : values.length; + this.__data__ = new MapCache(); + + while (++index < length) { + this.add(values[index]); + } + } + + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + + return this; + } + + function setCacheHas(value) { + return this.__data__.has(value); + } + + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + function stackClear() { + this.__data__ = new ListCache(); + this.size = 0; + } + + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + this.size = data.size; + return result; + } + + function stackGet(key) { + return this.__data__.get(key); + } + + function stackHas(key) { + return this.__data__.has(key); + } + + function stackSet(key, value) { + var data = this.__data__; + + if (data instanceof ListCache) { + var pairs = data.__data__; + + if (!Map || pairs.length < 199) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + + data = this.__data__ = new MapCache(pairs); + } + + data.set(key, value); + this.size = data.size; + return this; + } + + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == 'length' || isBuff && (key == 'offset' || key == 'parent') || isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset') || isIndex(key, length)))) { + result.push(key); + } + } + + return result; + } + + function assocIndexOf(array, key) { + var length = array.length; + + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + + return -1; + } + + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); + } + + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + function baseIsEqual(value, other, bitmask, customizer, stack) { + if (value === other) { + return true; + } + + if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { + return value !== value && other !== other; + } + + return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); + } + + function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); + objTag = objTag == argsTag ? objectTag : objTag; + othTag = othTag == argsTag ? objectTag : othTag; + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + + objIsArr = true; + objIsObj = false; + } + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack()); + return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + } + + if (!(bitmask & COMPARE_PARTIAL_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack()); + return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); + } + } + + if (!isSameTag) { + return false; + } + + stack || (stack = new Stack()); + return equalObjects(object, other, bitmask, customizer, equalFunc, stack); + } + + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + + var result = []; + + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + + return result; + } + + function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + + var stacked = stack.get(array); + + if (stacked && stack.get(other)) { + return stacked == other; + } + + var index = -1, + result = true, + seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined; + stack.set(array, other); + stack.set(other, array); + + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); + } + + if (compared !== undefined) { + if (compared) { + continue; + } + + result = false; + break; + } + + if (seen) { + if (!arraySome(other, function (othValue, othIndex) { + if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + return seen.push(othIndex); + } + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { + result = false; + break; + } + } + + stack['delete'](array); + stack['delete'](other); + return result; + } + + function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + + return true; + + case boolTag: + case dateTag: + case numberTag: + return eq(+object, +other); + + case errorTag: + return object.name == other.name && object.message == other.message; + + case regexpTag: + case stringTag: + return object == other + ''; + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & COMPARE_PARTIAL_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + + var stacked = stack.get(object); + + if (stacked) { + return stacked == other; + } + + bitmask |= COMPARE_UNORDERED_FLAG; + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); + stack['delete'](object); + return result; + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + + } + + return false; + } + + function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { + var isPartial = bitmask & COMPARE_PARTIAL_FLAG, + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + + var index = objLength; + + while (index--) { + var key = objProps[index]; + + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + + var stacked = stack.get(object); + + if (stacked && stack.get(other)) { + return stacked == other; + } + + var result = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + } + + if (!(compared === undefined ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { + result = false; + break; + } + + skipCtor || (skipCtor = key == 'constructor'); + } + + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + if (objCtor != othCtor && 'constructor' in object && 'constructor' in other && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + + stack['delete'](object); + stack['delete'](other); + return result; + } + + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; + } + + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + var getSymbols = !nativeGetSymbols ? stubArray : function (object) { + if (object == null) { + return []; + } + + object = Object(object); + return arrayFilter(nativeGetSymbols(object), function (symbol) { + return propertyIsEnumerable.call(object, symbol); + }); + }; + var getTag = baseGetTag; + + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise && getTag(Promise.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) { + getTag = function getTag(value) { + var result = baseGetTag(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : ''; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + + case mapCtorString: + return mapTag; + + case promiseCtorString: + return promiseTag; + + case setCtorString: + return setTag; + + case weakMapCtorString: + return weakMapTag; + } + } + + return result; + }; + } + + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == 'number' || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length; + } + + function isKeyable(value) { + var type = typeof value; + return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null; + } + + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = typeof Ctor == 'function' && Ctor.prototype || objectProto; + return value === proto; + } + + function objectToString(value) { + return nativeObjectToString.call(value); + } + + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + + try { + return func + ''; + } catch (e) {} + } + + return ''; + } + + function eq(value, other) { + return value === other || value !== value && other !== other; + } + + var isArguments = baseIsArguments(function () { + return arguments; + }()) ? baseIsArguments : function (value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); + }; + var isArray = Array.isArray; + + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + var isBuffer = nativeIsBuffer || stubFalse; + + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + function isFunction(value) { + if (!isObject(value)) { + return false; + } + + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + function stubArray() { + return []; + } + + function stubFalse() { + return false; + } + + module.exports = isEqual; +},703,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.CssManager = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var CssManager; + exports.CssManager = CssManager; + + (function (_CssManager) { + function maxWidthCss() { + var css = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var mw = {}; + var rest = {}; + Object.keys(css).forEach(function (key) { + if (key.match(/mw[0-9]{2,}/)) { + mw[key] = css[key]; + } else { + rest[key] = css[key]; + } + }); + return { + mw: mw, + rest: rest + }; + } + + function traverseAndFlattenMaxWidthCss(state, mw) { + var wSize = state.window; + var mwStyle = {}; + + if (wSize && wSize.width) { + var constraints = []; + var mwKeys = Object.keys(mw); + + for (var i = 0; i < mwKeys.length; i++) { + var _key = mwKeys[i]; + var constraint = parseInt(_key.replace("mw", ""), 10); + + if (wSize.width < constraint) { + constraints.push("mw" + constraint); + } + } + + constraints.forEach(function (constraint) { + var style = traverseAndFlattenCss(state, mw[constraint]); + mwStyle = (0, _extends2.default)({}, mwStyle, style); + }); + } + + return mwStyle; + } + + function traverseAndFlattenCss(state, css) { + if (css !== undefined) { + var tablet = css.tablet, + phone = css.phone, + ios = css.ios, + android = css.android, + native = css.native, + web = css.web, + windows = css.windows, + landscape = css.landscape, + portrait = css.portrait, + cssRest = (0, _objectWithoutProperties2.default)(css, ["tablet", "phone", "ios", "android", "native", "web", "windows", "landscape", "portrait"]); + + var _maxWidthCss = maxWidthCss(cssRest), + mw = _maxWidthCss.mw, + rest = _maxWidthCss.rest; + + var deviceStyle = {}; + + if (state.isTablet) { + deviceStyle = traverseAndFlattenCss(state, tablet); + } else { + deviceStyle = traverseAndFlattenCss(state, phone); + } + + var maxWidthStyle = {}; + + if ((0, _$$_REQUIRE(_dependencyMap[5]).isWeb)()) { + maxWidthStyle = traverseAndFlattenMaxWidthCss(state, mw); + } + + var nativeStyle = {}; + + if (!(0, _$$_REQUIRE(_dependencyMap[5]).isWeb)()) { + nativeStyle = traverseAndFlattenCss(state, native); + } + + var osStyle = {}; + + if ((0, _$$_REQUIRE(_dependencyMap[5]).isIOS)()) { + osStyle = traverseAndFlattenCss(state, ios); + } else if ((0, _$$_REQUIRE(_dependencyMap[5]).isAndroid)()) { + osStyle = traverseAndFlattenCss(state, android); + } else if ((0, _$$_REQUIRE(_dependencyMap[5]).isWeb)()) { + osStyle = traverseAndFlattenCss(state, web); + } else if ((0, _$$_REQUIRE(_dependencyMap[5]).isWindows)()) { + osStyle = traverseAndFlattenCss(state, windows); + } + + var orientationStyle = {}; + + if (state.isPortrait) { + orientationStyle = traverseAndFlattenCss(state, portrait); + } else { + orientationStyle = traverseAndFlattenCss(state, landscape); + } + + return (0, _extends2.default)({}, rest, deviceStyle, maxWidthStyle, nativeStyle, osStyle, orientationStyle); + } + + return {}; + } + + function stylesArrayToObject(styles) { + var style = {}; + styles.forEach(function (item) { + Object.keys(item).forEach(function (key) { + style[key] = item[key]; + }); + }); + return style; + } + + function getStyleByCssName(state, name) { + var rnStyles = state.rnStyles; + var styles = []; + + if (rnStyles && name) { + var userStyles; + var themes = rnStyles.themes, + base = rnStyles.base, + baseLight = rnStyles.baseLight, + baseDark = rnStyles.baseDark; + var themeInUse = getInUseThemeId(state); + + if (typeof themes === "object" && themeInUse !== undefined) { + userStyles = themes[themeInUse]; + } + + if (base && base.styles) { + styles.push(traverseAndFlattenCss(state, base.styles[name])); + } + + if (userStyles && userStyles.dark === 1) { + if (baseDark && baseDark.styles) { + styles.push(traverseAndFlattenCss(state, baseDark.styles[name])); + } + } else { + if (baseLight && baseLight.styles) { + styles.push(traverseAndFlattenCss(state, baseLight.styles[name])); + } + } + + if (userStyles && userStyles.styles) { + styles.push(traverseAndFlattenCss(state, userStyles.styles[name])); + } + } + + return stylesArrayToObject(styles); + } + + function applyCustomClasses(props) { + var classes = props.classes, + toggle = props.toggle, + active = props.active, + cssKey = props.cssKey; + var newClasses = []; + + if (classes && classes.length) { + newClasses.push.apply(newClasses, (0, _toConsumableArray2.default)(classes)); + + if (toggle) { + for (var i = 0; i < classes.length; i++) { + if (active) { + newClasses.push(classes[i] + "-active"); + } else { + newClasses.push(classes[i] + "-inactive"); + } + } + } + + if (cssKey) { + var length = newClasses.length; + + for (var _i = 0; _i < length; _i++) { + newClasses.push(newClasses[_i] + "-" + cssKey); + } + } + } + + return newClasses; + } + + function getStylesByCssClasses(state, classes) { + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var newClasses = applyCustomClasses((0, _extends2.default)({ + classes: classes + }, attributes)); + + if (Array.isArray(newClasses)) { + return newClasses.map(function (css) { + return getStyleByCssName(state, css); + }); + } + + return []; + } + + function flatten() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var styles = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var classes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var attributes = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + return _reactNative.StyleSheet.flatten([].concat((0, _toConsumableArray2.default)(styles), [getStyle(state, classes, attributes)])); + } + + _CssManager.flatten = flatten; + + function arrayToObject() { + var styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return stylesArrayToObject(styles); + } + + _CssManager.arrayToObject = arrayToObject; + + function getStyle() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var classes = arguments.length > 1 ? arguments[1] : undefined; + var attributes = arguments.length > 2 ? arguments[2] : undefined; + var styles = getStylesByCssClasses(state, classes, attributes); + return stylesArrayToObject(styles); + } + + _CssManager.getStyle = getStyle; + + function getStyleObj() { + var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var classes = arguments.length > 1 ? arguments[1] : undefined; + var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var styles = getStylesByCssClasses(context, classes, attributes); + return stylesArrayToObject(styles); + } + + _CssManager.getStyleObj = getStyleObj; + + function getThemes() { + var _context$rnStyles; + + var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return context != null && (_context$rnStyles = context.rnStyles) != null && _context$rnStyles.themes ? Object.keys(context.rnStyles.themes).map(function (key) { + return (0, _extends2.default)({}, context.rnStyles.themes[key], { + key: key + }); + }) : []; + } + + _CssManager.getThemes = getThemes; + + function isActiveThemeDark() { + var _getInUseTheme; + + var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return ((_getInUseTheme = getInUseTheme(context)) == null ? undefined : _getInUseTheme.dark) === 1; + } + + _CssManager.isActiveThemeDark = isActiveThemeDark; + + function getInUseTheme() { + var _context$rnStyles2; + + var context = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var id = getInUseThemeId(context); + return (_context$rnStyles2 = context.rnStyles) != null && _context$rnStyles2.themes && id ? context.rnStyles.themes[id] : undefined; + } + + _CssManager.getInUseTheme = getInUseTheme; + + function getInUseThemeId() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref$rnStyles = _ref.rnStyles, + rnStyles = _ref$rnStyles === undefined ? {} : _ref$rnStyles, + isDark = _ref.isDark, + activeTheme = _ref.activeTheme; + + var themes = rnStyles.themes; + + if (typeof themes === "object") { + var validThemesKeys = Object.keys(themes).filter(function (key) { + return typeof themes[key] === "object"; + }); + + if (validThemesKeys.length > 0) { + if (!activeTheme) { + activeTheme = validThemesKeys.find(function (key) { + var _themes$key; + + return ((_themes$key = themes[key]) == null ? undefined : _themes$key.default) === 1; + }); + } + + if (activeTheme === "automatic") { + activeTheme = validThemesKeys.filter(function (key) { + var _themes$key2; + + return key !== "automatic" && ((_themes$key2 = themes[key]) == null ? undefined : _themes$key2.automatic) === 1; + }).find(function (key) { + var _themes$key3; + + var isThemeDark = ((_themes$key3 = themes[key]) == null ? undefined : _themes$key3.dark) === 1; + return isThemeDark === isDark; + }); + } + + if (!activeTheme) { + activeTheme = validThemesKeys[0]; + } + } + } + + return activeTheme; + } + + _CssManager.getInUseThemeId = getInUseThemeId; + + function getActiveThemeId() { + var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + _ref2$rnStyles = _ref2.rnStyles, + rnStyles = _ref2$rnStyles === undefined ? {} : _ref2$rnStyles, + activeTheme = _ref2.activeTheme; + + if (activeTheme) { + return activeTheme; + } + + var themes = rnStyles.themes; + + if (typeof themes === "object") { + return Object.keys(themes).find(function (key) { + var _themes$key4; + + return typeof themes[key] === "object" && ((_themes$key4 = themes[key]) == null ? undefined : _themes$key4.default) === 1; + }); + } + + return undefined; + } + + _CssManager.getActiveThemeId = getActiveThemeId; + })(CssManager || (exports.CssManager = CssManager = {})); +},704,[5,21,108,6,28,705]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.os = os; + exports.isAndroid = isAndroid; + exports.isIOS = isIOS; + exports.isWeb = isWeb; + exports.isWindows = isWindows; + exports.dpToPx = dpToPx; + exports.fontScale = fontScale; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + function fontScale() { + return _reactNative.PixelRatio.getFontScale(); + } + + function os() { + return _reactNative.Platform.OS; + } + + function isAndroid() { + return _reactNative.Platform.OS === "android"; + } + + function isWeb() { + return _reactNative.Platform.OS === "web"; + } + + function isIOS() { + return _reactNative.Platform.OS === "ios" || _reactNative.Platform.OS === "macos"; + } + + function isWindows() { + return _reactNative.Platform.OS === "windows"; + } + + function dpToPx(size) { + return _reactNative.PixelRatio.roundToNearestPixel(size) * _reactNative.PixelRatio.get(); + } +},705,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.CssUtils = undefined; + var CssUtils; + exports.CssUtils = CssUtils; + + (function (_CssUtils) { + function filterAutomaticThemes() { + var defaultThemes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var customThemes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (!_$$_REQUIRE(_dependencyMap[0]).Utils.isEmpty(customThemes)) { + var automaticCustomThemes = Object.keys(customThemes).filter(function (theme) { + return customThemes[theme].automatic === 1; + }); + + if (!_$$_REQUIRE(_dependencyMap[0]).Utils.isEmpty(automaticCustomThemes)) { + var automaticLightTheme = automaticCustomThemes.filter(function (theme) { + return customThemes[theme].dark === 0; + }); + var automaticDarkTheme = automaticCustomThemes.filter(function (theme) { + return customThemes[theme].dark === 1; + }); + + if (!_$$_REQUIRE(_dependencyMap[0]).Utils.isEmpty(automaticLightTheme)) { + Object.keys(defaultThemes).filter(function (theme) { + return defaultThemes[theme].automatic === 1 && defaultThemes[theme].dark === 0; + }).forEach(function (theme) { + return delete defaultThemes[theme]; + }); + } + + if (!_$$_REQUIRE(_dependencyMap[0]).Utils.isEmpty(automaticDarkTheme)) { + Object.keys(defaultThemes).filter(function (theme) { + return defaultThemes[theme].automatic === 1 && defaultThemes[theme].dark === 1; + }).forEach(function (theme) { + return delete defaultThemes[theme]; + }); + } + } + + var defaultCustomTheme = Object.keys(customThemes).filter(function (theme) { + return customThemes[theme].default === 1; + }); + + if (!_$$_REQUIRE(_dependencyMap[0]).Utils.isEmpty(defaultCustomTheme)) { + Object.keys(defaultThemes).filter(function (theme) { + return defaultThemes[theme].default === 1; + }).forEach(function (theme) { + return delete defaultThemes[theme]; + }); + } + } + } + + function mergeRnStyles(defaultStyles) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + return args.reduce(function (result, arg) { + filterAutomaticThemes(defaultStyles.themes, arg.themes); + return _$$_REQUIRE(_dependencyMap[0]).Utils.mergeObjects(result, arg); + }, defaultStyles); + } + + _CssUtils.mergeRnStyles = mergeRnStyles; + })(CssUtils || (exports.CssUtils = CssUtils = {})); +},706,[707]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Utils = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var Utils; + exports.Utils = Utils; + + (function (_Utils) { + function mergeObjects() { + var obj1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var obj2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var mergedObj = (0, _extends2.default)({}, obj1); + Object.keys(obj2).forEach(function (key) { + if (obj2[key] !== undefined) { + if (Array.isArray(obj2[key]) && Array.isArray(obj1[key])) { + mergedObj[key] = obj2[key]; + } else if (typeof obj2[key] === "object" && typeof obj1[key] === "object") { + mergedObj[key] = mergeObjects(obj1[key], obj2[key]); + } else { + mergedObj[key] = obj2[key]; + } + } + }); + return mergedObj; + } + + _Utils.mergeObjects = mergeObjects; + + function isNull(a) { + return a === undefined || a === null; + } + + function isEmpty(a) { + if (!isNull(a)) { + if (typeof a === "string") { + return a.length === 0; + } + + if (Array.isArray(a)) { + return a.length === 0; + } + + if (typeof a === "object") { + return Object.keys(a).length === 0; + } + } + + return true; + } + + _Utils.isEmpty = isEmpty; + })(Utils || (exports.Utils = Utils = {})); +},707,[5,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getDefaultStyles = getDefaultStyles; + + function getDefaultStyles() { + return { + base: { + styles: { + "newsmemory-article-container-splitscreen": { + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.articleContainerBorderColor, + landscape: { + borderLeftWidth: 1 + }, + portrait: { + borderTopWidth: 1 + } + }, + "newsmemory-thumbnail-download-icon-disabled": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.md_grey_400 + }, + "drawer-item-icon-publications": { + tintColor: _$$_REQUIRE(_dependencyMap[0]).colors.black, + width: 32.5, + height: 25 + }, + "newsmemory-article-header-icon-toggleArticleExtra": { + tintColor: _$$_REQUIRE(_dependencyMap[0]).colors.white + } + } + }, + baseDark: { + styles: { + spinner: { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "hint-progress-spinner": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "hint-progress-spinner-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-article-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-article-container-splitscreen": { + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-index-item-image": { + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-article-footer-separator": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-article-header-separator": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-article-mode-sub-header": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-article-mode-sub-header-info": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-article-mode-sub-header-section": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-article-refresh-control": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-article-text": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "newsmemory-article-zoom-level-parent": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "newsmemory-article-zoom-level-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-copyright-footer": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "newsmemory-copyright-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-download-circle": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-download-circle-text": { + textShadowOffset: { + height: 0, + width: 0 + }, + textShadowRadius: 0, + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer-element-active": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer-element-inactive": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135, + tintColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer-icon": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135, + tintColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer-icon-active": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + tintColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-footer-more-icon": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135, + tintColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer-more-menu": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-footer-more-menu-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-footer-text-active": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-index-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "newsmemory-index-first-level-page": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-index-first-level-section": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-index-second-level-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-index-second-level-bullet": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-index-second-level-page": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-index-second-level-title": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-index-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-navigation-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-navigation-text-parent": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-pages-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "newsmemory-screen": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-search": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-search-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-search-header-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-search-input": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010, + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-search-list": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "newsmemory-separator": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-thumbnail-download-icon": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-thumbnails-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-thumbnails-page-text": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-thumbnails-page-text-selected": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey400, + color: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + borderWidth: 1, + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-thumbnails-pages": { + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "newsmemory-thumbnails-pages-selected": { + borderColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-thumbnails-section-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-thumbnails-section-content": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "newsmemory-thumbnails-section-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "system-newsmemory-navigation-bar": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "system-newsmemory-status-bar": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + optionspage: { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-search-close-icon": { + opacity: 0.6 + }, + "newsmemory-article-header-icon": { + opacity: 0.6, + src: "default" + }, + "newsmemory-index-header-icon": { + opacity: 0.6, + src: "default" + }, + "optionspage-specialsections-close-icon": { + opacity: 0.6 + }, + "rss-tab-item": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "rss-tab-item-text-inactive": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "rss-content-parent": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "rss-content": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "rss-footer-element": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "tile-title": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "tile-grid-image-title": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.grey300 + }, + "tile-grid-title-epaper": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.grey300 + }, + "tile-card-title-epaper": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "tile-summary": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "tile-header-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "tile-grid-image-header-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.grey300 + }, + "tile-halfbox-text": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "article-pager": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "article-container": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "article-header": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "article-top-content": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "article-header-image-date": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "article-title": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "article-body": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200, + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "article-body-parent": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "rss-drawer": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "rss-drawer-button": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "rss-search-button": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "rss-home-button": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "rss-layout-button": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "drawer-item-parent-inactive": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1010 + }, + "drawer-item-text-inactive": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "icon-gallery": { + tintColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey300 + }, + "settings-screen": { + backgroundColor: _$$_REQUIRE(_dependencyMap[0]).colors.grey1200 + }, + "newsmemory-article-caption": { + color: _$$_REQUIRE(_dependencyMap[0]).colors.white_transparent_135 + }, + "navigation-icon": { + color: "#FFFFFF87" + }, + "rss-drawer-button-icon": { + color: "#FFFFFF87" + }, + "rss-home-button-icon": { + color: "#FFFFFF87" + }, + "rss-search-button-icon": { + color: "#FFFFFF87" + }, + "rss-layout-button-icon": { + color: "#FFFFFF87" + } + } + }, + themes: { + default: { + automatic: 1, + dark: 0, + default: 1, + name: global.strings("theme_light"), + styles: {} + }, + darkTheme: { + automatic: 1, + dark: 1, + default: 0, + name: global.strings("theme_dark"), + styles: {} + }, + automatic: { + name: global.strings("theme_auto") + } + } + }; + } +},708,[462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getDebugStyles = getDebugStyles; + + function getDebugStyles() { + if (global.cssDebug) { + return { + base: { + styles: { + "rss-search-input": { + backgroundColor: "red", + color: "yellow" + }, + "search-input": { + color: "blue" + }, + "newsmemory-page-extra-icon-parent": { + width: 100, + height: 100 + }, + "newsmemory-article-header-icon": { + backgroundColor: "yellow" + }, + "newsmemory-article-header-icon-toggleGraphic": { + backgroundColor: "red" + }, + "newsmemory-article-header-icon-active-toggleGraphic": { + backgroundColor: "green" + }, + "newsmemory-article-header-icon-closeArticle": { + backgroundColor: "blue" + }, + "newsmemory-index-header-icon": { + backgroundColor: "yellow" + }, + "newsmemory-index-header-icon-toggleFullScreen": { + backgroundColor: "red" + }, + "newsmemory-index-header-icon-active-toggleFullScreen": { + backgroundColor: "green" + }, + "newsmemory-index-header-icon-closeArticle": { + backgroundColor: "blue" + }, + "tts-player-spinner": { + color: "red" + }, + "article-floating-button-favorite": {}, + "article-floating-button-share": { + color: "red" + }, + "newsmemory-footer-more-menu-item-cerca": { + backgroundColor: "red" + } + } + } + }; + } + + return {}; + } +},709,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Database = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var MAIN_DB_NAME = "database.db"; + + var NewsmemoryDatabasesManager = function () { + function NewsmemoryDatabasesManager() { + (0, _classCallCheck2.default)(this, NewsmemoryDatabasesManager); + } + + (0, _createClass2.default)(NewsmemoryDatabasesManager, null, [{ + key: "getNewspaperDirectory", + value: function getNewspaperDirectory() { + return _tecnaviaFileUtils.default.getNewspaperBaseDirectory(); + } + }, { + key: "getDatabaseFilePath", + value: function getDatabaseFilePath() { + return _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory() + MAIN_DB_NAME; + } + }, { + key: "getNewspaperIssueDirectory", + value: function getNewspaperIssueDirectory(paper, issue) { + return NewsmemoryDatabasesManager.getNewspaperDirectory() + paper + "/" + issue + "/"; + } + }, { + key: "deleteNewspaperIssueDirectory", + value: function deleteNewspaperIssueDirectory(paper, issue) { + var dirToDelete; + return _regenerator.default.async(function deleteNewspaperIssueDirectory$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + dirToDelete = NewsmemoryDatabasesManager.getNewspaperIssueDirectory(paper, issue); + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(dirToDelete)); + + case 4: + _context.next = 8; + break; + + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](1); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 6]], Promise); + } + }, { + key: "makeNewspaperDirectory", + value: function makeNewspaperDirectory() { + var newspaperDirectory; + return _regenerator.default.async(function makeNewspaperDirectory$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + newspaperDirectory = NewsmemoryDatabasesManager.getNewspaperDirectory(); + _context2.next = 3; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(newspaperDirectory)); + + case 3: + if (_context2.sent) { + _context2.next = 6; + break; + } + + _context2.next = 6; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(newspaperDirectory)); + + case 6: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "deleteNewspaperDirectory", + value: function deleteNewspaperDirectory() { + return _regenerator.default.async(function deleteNewspaperDirectory$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + _context3.next = 3; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(NewsmemoryDatabasesManager.getNewspaperDirectory())); + + case 3: + _context3.next = 7; + break; + + case 5: + _context3.prev = 5; + _context3.t0 = _context3["catch"](0); + + case 7: + case "end": + return _context3.stop(); + } + } + }, null, null, [[0, 5]], Promise); + } + }, { + key: "databaseExists", + value: function databaseExists() { + return _regenerator.default.async(function databaseExists$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!NewsmemoryDatabasesManager.database) { + _context4.next = 2; + break; + } + + return _context4.abrupt("return", NewsmemoryDatabasesManager.database.exists()); + + case 2: + return _context4.abrupt("return", false); + + case 3: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "closeDatabase", + value: function closeDatabase() { + return _regenerator.default.async(function closeDatabase$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + if (!NewsmemoryDatabasesManager.database) { + _context5.next = 2; + break; + } + + return _context5.abrupt("return", NewsmemoryDatabasesManager.database.close()); + + case 2: + return _context5.abrupt("return", false); + + case 3: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "deleteDatabase", + value: function deleteDatabase() { + return _regenerator.default.async(function deleteDatabase$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + if (!NewsmemoryDatabasesManager.database) { + _context6.next = 2; + break; + } + + return _context6.abrupt("return", NewsmemoryDatabasesManager.database.delete()); + + case 2: + return _context6.abrupt("return", false); + + case 3: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "openTransaction", + value: function openTransaction(query, params) { + return _regenerator.default.async(function openTransaction$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", NewsmemoryDatabasesManager.database.transaction(query, params)); + + case 1: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "checkIfColumnExists", + value: function checkIfColumnExists(table, column) { + return _regenerator.default.async(function checkIfColumnExists$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + return _context8.abrupt("return", NewsmemoryDatabasesManager.database.columnExists(table, column)); + + case 1: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "createDatabasesTable", + value: function createDatabasesTable() { + var query, dbStatusExists, dbNetworkExists, _global$getNewsmemory, network, dbPSetupExists, _global$getActivePSet, pSetup, dbSecretExists; + + return _regenerator.default.async(function createDatabasesTable$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + _context9.prev = 0; + query = "CREATE TABLE IF NOT EXISTS databases (db_filename VARCHAR(255), db_paper VARCHAR(50), db_issue VARCHAR(20), db_edition VARCHAR(50), db_downtime DATETIME, db_status INTEGER DEFAULT 0, db_network VARCHAR(1), UNIQUE (db_paper,db_issue,db_edition) ON CONFLICT REPLACE );"; + _context9.next = 4; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query)); + + case 4: + _context9.next = 6; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.checkIfColumnExists("databases", "db_status")); + + case 6: + dbStatusExists = _context9.sent; + + if (dbStatusExists) { + _context9.next = 11; + break; + } + + query = "ALTER TABLE databases ADD COLUMN db_status INTEGER DEFAULT 0;"; + _context9.next = 11; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query)); + + case 11: + _context9.next = 13; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.checkIfColumnExists("databases", "db_network")); + + case 13: + dbNetworkExists = _context9.sent; + + if (dbNetworkExists) { + _context9.next = 19; + break; + } + + _global$getNewsmemory = global.getNewsmemoryConfig(), network = _global$getNewsmemory.network; + query = "ALTER TABLE databases ADD COLUMN db_network VARCHAR(1) DEFAULT '" + network + "'"; + _context9.next = 19; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query)); + + case 19: + _context9.next = 21; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.checkIfColumnExists("databases", "db_pSetup")); + + case 21: + dbPSetupExists = _context9.sent; + + if (dbPSetupExists) { + _context9.next = 27; + break; + } + + _global$getActivePSet = global.getActivePSetup(), pSetup = _global$getActivePSet.pSetup; + query = "ALTER TABLE databases ADD COLUMN db_pSetup VARCHAR(255) DEFAULT '" + pSetup + "'"; + _context9.next = 27; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query)); + + case 27: + _context9.next = 29; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.checkIfColumnExists("databases", "db_secret")); + + case 29: + dbSecretExists = _context9.sent; + + if (dbSecretExists) { + _context9.next = 34; + break; + } + + query = "ALTER TABLE databases ADD COLUMN db_secret VARCHAR(255) DEFAULT ''"; + _context9.next = 34; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query)); + + case 34: + _context9.next = 39; + break; + + case 36: + _context9.prev = 36; + _context9.t0 = _context9["catch"](0); + throw _context9.t0; + + case 39: + case "end": + return _context9.stop(); + } + } + }, null, null, [[0, 36]], Promise); + } + }, { + key: "resetDatabase", + value: function resetDatabase() { + return _regenerator.default.async(function resetDatabase$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.next = 2; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.closeDatabase()); + + case 2: + _context10.next = 4; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.deleteDatabase()); + + case 4: + _context10.next = 6; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.createDatabasesTable()); + + case 6: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "updateStatus", + value: function updateStatus(paper, issue, edition, status) { + var pSetup, + query, + _args11 = arguments; + return _regenerator.default.async(function updateStatus$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + pSetup = _args11.length > 4 && _args11[4] !== undefined ? _args11[4] : global.getActivePSetup().pSetup; + query = "UPDATE databases SET db_status = ? WHERE db_paper = ? AND db_issue = ? AND db_edition = ? AND db_pSetup = ?"; + _context11.prev = 2; + _context11.next = 5; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [status, paper, issue, edition, pSetup])); + + case 5: + return _context11.abrupt("return", true); + + case 8: + _context11.prev = 8; + _context11.t0 = _context11["catch"](2); + throw _context11.t0; + + case 11: + case "end": + return _context11.stop(); + } + } + }, null, null, [[2, 8]], Promise); + } + }, { + key: "updateNetwork", + value: function updateNetwork(paper, issue, edition, network) { + var pSetup, + query, + _args12 = arguments; + return _regenerator.default.async(function updateNetwork$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + pSetup = _args12.length > 4 && _args12[4] !== undefined ? _args12[4] : global.getActivePSetup().pSetup; + query = "UPDATE databases SET db_network = ? WHERE db_paper = ? AND db_issue = ? AND db_edition = ? AND db_pSetup = ?"; + _context12.prev = 2; + _context12.next = 5; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [network, paper, issue, edition, pSetup])); + + case 5: + return _context12.abrupt("return", true); + + case 8: + _context12.prev = 8; + _context12.t0 = _context12["catch"](2); + throw _context12.t0; + + case 11: + case "end": + return _context12.stop(); + } + } + }, null, null, [[2, 8]], Promise); + } + }, { + key: "getIssueStatus", + value: function getIssueStatus(paper, issue, edition) { + var pSetup, + query, + response, + _args13 = arguments; + return _regenerator.default.async(function getIssueStatus$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + pSetup = _args13.length > 3 && _args13[3] !== undefined ? _args13[3] : global.getActivePSetup().pSetup; + query = "SELECT db_status FROM databases WHERE db_paper = ? AND db_issue = ? AND db_edition = ? AND db_pSetup = ?;"; + _context13.prev = 2; + _context13.next = 5; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [paper, issue, edition, pSetup])); + + case 5: + response = _context13.sent; + + if (!(response && response[0])) { + _context13.next = 8; + break; + } + + return _context13.abrupt("return", response[0]); + + case 8: + throw new Error("missing issue on database"); + + case 11: + _context13.prev = 11; + _context13.t0 = _context13["catch"](2); + throw _context13.t0; + + case 14: + case "end": + return _context13.stop(); + } + } + }, null, null, [[2, 11]], Promise); + } + }, { + key: "insertIssue", + value: function insertIssue(filename, paper, issue, edition) { + var secret, + pSetup, + network, + query, + downloadTime, + shortFilename, + _args14 = arguments; + return _regenerator.default.async(function insertIssue$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + secret = _args14.length > 4 && _args14[4] !== undefined ? _args14[4] : ""; + pSetup = _args14.length > 5 && _args14[5] !== undefined ? _args14[5] : global.getActivePSetup().pSetup; + network = _args14.length > 6 && _args14[6] !== undefined ? _args14[6] : global.getNewsmemoryConfig().network; + query = "INSERT INTO databases (db_filename, db_paper, db_issue, db_edition, db_downtime, db_pSetup, db_secret, db_network) VALUES (?, ?, ?, ?, ?, ?, ?, ?);"; + downloadTime = parseInt(new Date().getTime() / 1000, 10); + _context14.prev = 5; + shortFilename = filename.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), ""); + _context14.next = 9; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [shortFilename, paper, issue, edition, downloadTime, pSetup, secret, network])); + + case 9: + return _context14.abrupt("return", true); + + case 12: + _context14.prev = 12; + _context14.t0 = _context14["catch"](5); + throw _context14.t0; + + case 15: + case "end": + return _context14.stop(); + } + } + }, null, null, [[5, 12]], Promise); + } + }, { + key: "getAllIssues", + value: function getAllIssues() { + var query, result, issues; + return _regenerator.default.async(function getAllIssues$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + query = "SELECT * FROM databases ORDER BY db_issue DESC;"; + _context15.prev = 1; + _context15.next = 4; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query)); + + case 4: + result = _context15.sent; + issues = result.map(function (issue) { + return new _NewspaperIssue.default(issue); + }); + return _context15.abrupt("return", issues); + + case 9: + _context15.prev = 9; + _context15.t0 = _context15["catch"](1); + throw _context15.t0; + + case 12: + case "end": + return _context15.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }, { + key: "getIssuesByDates", + value: function getIssuesByDates() { + var dates, + query, + result, + issues, + _args16 = arguments; + return _regenerator.default.async(function getIssuesByDates$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + dates = _args16.length > 0 && _args16[0] !== undefined ? _args16[0] : []; + query = "SELECT * FROM databases WHERE db_issue IN ( " + Array(dates.length).fill("?").join(",") + ");"; + _context16.prev = 2; + _context16.next = 5; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, dates)); + + case 5: + result = _context16.sent; + issues = result.map(function (issue) { + return new _NewspaperIssue.default(issue); + }); + return _context16.abrupt("return", issues); + + case 10: + _context16.prev = 10; + _context16.t0 = _context16["catch"](2); + throw _context16.t0; + + case 13: + case "end": + return _context16.stop(); + } + } + }, null, null, [[2, 10]], Promise); + } + }, { + key: "getAllIssuesExcept", + value: function getAllIssuesExcept() { + var dates, + query, + result, + issues, + _args17 = arguments; + return _regenerator.default.async(function getAllIssuesExcept$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + dates = _args17.length > 0 && _args17[0] !== undefined ? _args17[0] : []; + query = "SELECT * FROM databases WHERE db_issue NOT IN ( " + Array(dates.length).fill("?").join(",") + ") ORDER BY db_downtime DESC;"; + _context17.prev = 2; + _context17.next = 5; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, dates)); + + case 5: + result = _context17.sent; + issues = result.map(function (issue) { + return new _NewspaperIssue.default(issue); + }); + return _context17.abrupt("return", issues); + + case 10: + _context17.prev = 10; + _context17.t0 = _context17["catch"](2); + throw _context17.t0; + + case 13: + case "end": + return _context17.stop(); + } + } + }, null, null, [[2, 10]], Promise); + } + }, { + key: "getIssue", + value: function getIssue(paper, issue, edition) { + var pSetup, + query, + result, + _args18 = arguments; + return _regenerator.default.async(function getIssue$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + pSetup = _args18.length > 3 && _args18[3] !== undefined ? _args18[3] : global.getActivePSetup().pSetup; + query = "SELECT * FROM databases WHERE db_paper = ? AND db_issue = ? AND db_edition = ? AND db_pSetup = ?;"; + _context18.prev = 2; + _context18.next = 5; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [paper, issue, edition, pSetup])); + + case 5: + result = _context18.sent; + + if (!(result && result.length)) { + _context18.next = 8; + break; + } + + return _context18.abrupt("return", new _NewspaperIssue.default(result[0])); + + case 8: + throw new Error("Issue not found"); + + case 11: + _context18.prev = 11; + _context18.t0 = _context18["catch"](2); + throw _context18.t0; + + case 14: + case "end": + return _context18.stop(); + } + } + }, null, null, [[2, 11]], Promise); + } + }, { + key: "deleteIssue", + value: function deleteIssue(paper, issue, edition) { + var pSetup, + query, + _args19 = arguments; + return _regenerator.default.async(function deleteIssue$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + pSetup = _args19.length > 3 && _args19[3] !== undefined ? _args19[3] : global.getActivePSetup().pSetup; + query = "DELETE FROM databases WHERE db_paper = ? AND db_issue = ? AND db_edition = ? AND db_pSetup = ?;"; + _context19.prev = 2; + _context19.next = 5; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [paper, issue, edition, pSetup])); + + case 5: + return _context19.abrupt("return", true); + + case 8: + _context19.prev = 8; + _context19.t0 = _context19["catch"](2); + throw _context19.t0; + + case 11: + case "end": + return _context19.stop(); + } + } + }, null, null, [[2, 8]], Promise); + } + }, { + key: "deleteIssueByFilename", + value: function deleteIssueByFilename(filename) { + var query; + return _regenerator.default.async(function deleteIssueByFilename$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + query = "DELETE FROM databases WHERE db_filename = ?;"; + _context20.prev = 1; + _context20.next = 4; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [filename])); + + case 4: + return _context20.abrupt("return", true); + + case 7: + _context20.prev = 7; + _context20.t0 = _context20["catch"](1); + throw _context20.t0; + + case 10: + case "end": + return _context20.stop(); + } + } + }, null, null, [[1, 7]], Promise); + } + }, { + key: "getIssuesByEdition", + value: function getIssuesByEdition(edition) { + var query, result, issues; + return _regenerator.default.async(function getIssuesByEdition$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + query = "SELECT * FROM databases WHERE db_edition = ?;"; + _context21.prev = 1; + _context21.next = 4; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [edition])); + + case 4: + result = _context21.sent; + issues = result.map(function (issue) { + return new _NewspaperIssue.default(issue); + }); + return _context21.abrupt("return", issues); + + case 9: + _context21.prev = 9; + _context21.t0 = _context21["catch"](1); + throw _context21.t0; + + case 12: + case "end": + return _context21.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }, { + key: "getIssuesByPaper", + value: function getIssuesByPaper(paper) { + var query, result, issues; + return _regenerator.default.async(function getIssuesByPaper$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + query = "SELECT * FROM databases WHERE db_paper = ?;"; + _context22.prev = 1; + _context22.next = 4; + return _regenerator.default.awrap(NewsmemoryDatabasesManager.openTransaction(query, [paper])); + + case 4: + result = _context22.sent; + issues = result.map(function (issue) { + return new _NewspaperIssue.default(issue); + }); + return _context22.abrupt("return", issues); + + case 9: + _context22.prev = 9; + _context22.t0 = _context22["catch"](1); + throw _context22.t0; + + case 12: + case "end": + return _context22.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }]); + return NewsmemoryDatabasesManager; + }(); + + exports.default = NewsmemoryDatabasesManager; + NewsmemoryDatabasesManager.database = new _Database.default(NewsmemoryDatabasesManager.getDatabaseFilePath()); +},710,[5,80,7,8,711,574,714]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _promiseQueue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNativeSqliteStorage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var Database = function () { + function Database(path, migrations) { + (0, _classCallCheck2.default)(this, Database); + this.path = path; + this.queue = new _promiseQueue.default(1, Infinity); + this.migrations = migrations || []; + } + + (0, _createClass2.default)(Database, [{ + key: "getPath", + value: function getPath() { + return this.path; + } + }, { + key: "delete", + value: function _delete() { + var _this = this; + + var result; + return _regenerator.default.async(function _delete$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(this.exists()); + + case 3: + if (!_context.sent) { + _context.next = 6; + break; + } + + _context.next = 6; + return _regenerator.default.awrap(new Promise(function (resolve, reject) { + _reactNativeSqliteStorage.default.deleteDatabase(_this.path, resolve, reject); + })); + + case 6: + result = true; + _context.next = 12; + break; + + case 9: + _context.prev = 9; + _context.t0 = _context["catch"](0); + result = false; + + case 12: + return _context.abrupt("return", result); + + case 13: + case "end": + return _context.stop(); + } + } + }, null, this, [[0, 9]], Promise); + } + }, { + key: "exists", + value: function exists() { + var result; + return _regenerator.default.async(function exists$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + _context2.next = 3; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(this.path)); + + case 3: + result = _context2.sent; + _context2.next = 9; + break; + + case 6: + _context2.prev = 6; + _context2.t0 = _context2["catch"](0); + result = false; + + case 9: + return _context2.abrupt("return", result); + + case 10: + case "end": + return _context2.stop(); + } + } + }, null, this, [[0, 6]], Promise); + } + }, { + key: "open", + value: function open() { + var _this2 = this; + + var result; + return _regenerator.default.async(function open$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + result = false; + _context3.prev = 1; + _context3.next = 4; + return _regenerator.default.awrap(new Promise(function (resolve, reject) { + _reactNativeSqliteStorage.default.openDatabase({ + name: _this2.path + }, resolve, reject); + })); + + case 4: + this.db = _context3.sent; + result = !!this.db; + _context3.next = 10; + break; + + case 8: + _context3.prev = 8; + _context3.t0 = _context3["catch"](1); + + case 10: + return _context3.abrupt("return", result); + + case 11: + case "end": + return _context3.stop(); + } + } + }, null, this, [[1, 8]], Promise); + } + }, { + key: "close", + value: function close() { + var _this3 = this; + + var result; + return _regenerator.default.async(function close$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + result = true; + _context4.prev = 1; + _context4.next = 4; + return _regenerator.default.awrap(new Promise(function (resolve, reject) { + _this3.db.close(resolve, reject); + })); + + case 4: + _context4.next = 9; + break; + + case 6: + _context4.prev = 6; + _context4.t0 = _context4["catch"](1); + result = false; + + case 9: + return _context4.abrupt("return", result); + + case 10: + case "end": + return _context4.stop(); + } + } + }, null, null, [[1, 6]], Promise); + } + }, { + key: "migrateDB", + value: function migrateDB() { + var dbVersion, rows, i, _this$migrations$i, version, queries, q; + + return _regenerator.default.async(function migrateDB$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + dbVersion = 0; + _context5.prev = 1; + _context5.next = 4; + return _regenerator.default.awrap(this.executeSqlNoTx("CREATE TABLE IF NOT EXISTS db_info ( key VARCHAR(255) NOT NULL, value VARCHAR(255) NOT NULL, PRIMARY KEY (key, value));")); + + case 4: + _context5.next = 6; + return _regenerator.default.awrap(this.executeSqlNoTx("SELECT value FROM db_info WHERE key LIKE 'version'")); + + case 6: + rows = _context5.sent; + + if (rows.length > 0) { + dbVersion = rows.item(0).value || 0; + } + + _context5.next = 13; + break; + + case 10: + _context5.prev = 10; + _context5.t0 = _context5["catch"](1); + dbVersion = 0; + + case 13: + _context5.prev = 13; + i = 0; + + case 15: + if (!(i < this.migrations.length)) { + _context5.next = 30; + break; + } + + _this$migrations$i = this.migrations[i], version = _this$migrations$i.version, queries = _this$migrations$i.queries; + + if (!(dbVersion < version)) { + _context5.next = 27; + break; + } + + q = 0; + + case 19: + if (!(q < queries.length)) { + _context5.next = 25; + break; + } + + _context5.next = 22; + return _regenerator.default.awrap(this.executeSqlNoTx(queries[q])); + + case 22: + q++; + _context5.next = 19; + break; + + case 25: + _context5.next = 27; + return _regenerator.default.awrap(this.executeSqlNoTx("REPLACE INTO db_info ('key', 'value') VALUES ('version', " + version + ");")); + + case 27: + i++; + _context5.next = 15; + break; + + case 30: + _context5.next = 35; + break; + + case 32: + _context5.prev = 32; + _context5.t1 = _context5["catch"](13); + throw _context5.t1; + + case 35: + case "end": + return _context5.stop(); + } + } + }, null, this, [[1, 10], [13, 32]], Promise); + } + }, { + key: "openTransaction", + value: function openTransaction() { + var _this4 = this; + + return _regenerator.default.async(function openTransaction$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", new Promise(function (resolve, reject) { + _this4.db.transaction(function (tx) { + resolve(tx); + }, function (e) { + reject(e); + }); + })); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "executeSqlNoTx", + value: function executeSqlNoTx(query, params) { + var _this5 = this; + + return _regenerator.default.async(function executeSqlNoTx$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + return _context8.abrupt("return", this.queue.add(function () { + return new Promise(function _callee(resolve, reject) { + return _regenerator.default.async(function _callee$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + _context7.next = 2; + return _regenerator.default.awrap(_this5.open()); + + case 2: + if (!_context7.sent) { + _context7.next = 6; + break; + } + + _this5.db.executeSql(query, params, function (resultSet) { + resolve(resultSet.rows); + }, function (e) { + reject(e); + }); + + _context7.next = 7; + break; + + case 6: + resolve([]); + + case 7: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + }); + })); + + case 1: + case "end": + return _context8.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "executeSql", + value: function executeSql(tx, query, params) { + return _regenerator.default.async(function executeSql$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + return _context9.abrupt("return", new Promise(function (resolve, reject) { + tx.executeSql(query, params, function (transaction, sqlResult) { + var array = []; + + for (var i = 0; i < sqlResult.rows.length; i++) { + array.push(sqlResult.rows.item(i)); + } + + resolve(array); + }, function (e) { + reject(e); + }); + })); + + case 1: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "transaction", + value: function transaction(query) { + var _this6 = this; + + var params, + _args11 = arguments; + return _regenerator.default.async(function transaction$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + params = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : []; + return _context11.abrupt("return", this.queue.add(function () { + return new Promise(function _callee2(resolve) { + var tx, result; + return _regenerator.default.async(function _callee2$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.next = 2; + return _regenerator.default.awrap(_this6.open()); + + case 2: + if (!_context10.sent) { + _context10.next = 18; + break; + } + + _context10.prev = 3; + _context10.next = 6; + return _regenerator.default.awrap(_this6.openTransaction()); + + case 6: + tx = _context10.sent; + _context10.next = 9; + return _regenerator.default.awrap(_this6.executeSql(tx, query, params)); + + case 9: + result = _context10.sent; + resolve(result); + _context10.next = 16; + break; + + case 13: + _context10.prev = 13; + _context10.t0 = _context10["catch"](3); + resolve([]); + + case 16: + _context10.next = 19; + break; + + case 18: + resolve([]); + + case 19: + case "end": + return _context10.stop(); + } + } + }, null, null, [[3, 13]], Promise); + }); + })); + + case 2: + case "end": + return _context11.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "tableExists", + value: function tableExists(table) { + var result, query, rows; + return _regenerator.default.async(function tableExists$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + result = false; + _context12.prev = 1; + query = "SELECT name FROM sqlite_master WHERE type='table' AND name='" + table + "';"; + _context12.next = 5; + return _regenerator.default.awrap(this.transaction(query, [])); + + case 5: + rows = _context12.sent; + + if (rows.length > 0) { + result = true; + } + + _context12.next = 11; + break; + + case 9: + _context12.prev = 9; + _context12.t0 = _context12["catch"](1); + + case 11: + return _context12.abrupt("return", result); + + case 12: + case "end": + return _context12.stop(); + } + } + }, null, this, [[1, 9]], Promise); + } + }, { + key: "columnExists", + value: function columnExists(table, column) { + var result, query, columns, i; + return _regenerator.default.async(function columnExists$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + result = false; + _context13.prev = 1; + query = "PRAGMA table_info(" + table + ");"; + _context13.next = 5; + return _regenerator.default.awrap(this.transaction(query, [])); + + case 5: + columns = _context13.sent; + + for (i = 0; i < columns.length; i++) { + if (columns[i].name === column) { + result = true; + } + } + + _context13.next = 11; + break; + + case 9: + _context13.prev = 9; + _context13.t0 = _context13["catch"](1); + + case 11: + return _context13.abrupt("return", result); + + case 12: + case "end": + return _context13.stop(); + } + } + }, null, this, [[1, 9]], Promise); + } + }, { + key: "deleteFrom", + value: function deleteFrom(table, whereClause) { + return _regenerator.default.async(function deleteFrom$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + return _context14.abrupt("return", this.transaction("DELETE FROM " + table + " " + (whereClause ? "WHERE " + whereClause : "") + ";")); + + case 1: + case "end": + return _context14.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "replaceInto", + value: function replaceInto(table, cols, items) { + var _this7 = this; + + var numberOfParamsInAQuery, chunksLength, chunks, startTime, promises, response; + return _regenerator.default.async(function replaceInto$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + numberOfParamsInAQuery = Math.floor(Database.MAX_INSERT_PARAMS / cols.length); + chunksLength = Math.ceil(items.length / numberOfParamsInAQuery); + chunks = Array.from({ + length: chunksLength + }, function (v, i) { + return items.slice(i * numberOfParamsInAQuery, i * numberOfParamsInAQuery + numberOfParamsInAQuery); + }); + startTime = new Date().getTime(); + promises = chunks.map(function _callee3(chunk) { + var query, params; + return _regenerator.default.async(function _callee3$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + query = "REPLACE INTO " + table + " ( " + cols.join(",") + " ) VALUES "; + query += chunk.reduce(function (result, item, index, array) { + return result.concat("(").concat(Array(cols.length).fill("?").join(",")).concat(index < array.length - 1 ? ")," : ");"); + }, ""); + params = chunk.reduce(function (result, item) { + return result.concat(item); + }, []); + return _context15.abrupt("return", _this7.transaction(query, params)); + + case 4: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + }); + _context16.prev = 5; + _context16.next = 8; + return _regenerator.default.awrap(Promise.all(promises)); + + case 8: + response = _context16.sent; + return _context16.abrupt("return", response); + + case 12: + _context16.prev = 12; + _context16.t0 = _context16["catch"](5); + throw _context16.t0; + + case 15: + case "end": + return _context16.stop(); + } + } + }, null, null, [[5, 12]], Promise); + } + }, { + key: "destroy", + value: function destroy() { + return _regenerator.default.async(function destroy$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + return _context17.abrupt("return", this.close()); + + case 1: + case "end": + return _context17.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return Database; + }(); + + exports.default = Database; + Database.MAX_INSERT_PARAMS = 500; + Database.TAG = "DATABASE"; +},711,[5,80,7,8,567,712,574]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var config = [[false, "SQLitePlugin", "transaction", false, true, true], [false, "SQLitePlugin", "readTransaction", false, true, true], [false, "SQLitePlugin", "close", false, false, true], [false, "SQLitePlugin", "executeSql", true, false, true], [false, "SQLitePlugin", "sqlBatch", false, false, true], [false, "SQLitePlugin", "attach", true, false, true], [false, "SQLitePlugin", "detach", false, false, true], [false, "SQLitePluginTransaction", "executeSql", true, false, false], [false, "SQLiteFactory", "deleteDatabase", false, false, true], [true, "SQLiteFactory", "openDatabase", false, false, true], [false, "SQLiteFactory", "echoTest", false, false, true]]; + var originalFns = {}; + config.forEach(function (entry) { + var _entry = _$$_REQUIRE(_dependencyMap[0])(entry, 3), + returnValueExpected = _entry[0], + prototype = _entry[1], + fn = _entry[2]; + + var originalFn = _$$_REQUIRE(_dependencyMap[1])[prototype].prototype[fn]; + + originalFns[prototype + "." + fn] = originalFn; + }); + + function enablePromiseRuntime(enable) { + if (enable) { + createPromiseRuntime(); + } else { + createCallbackRuntime(); + } + } + + function createCallbackRuntime() { + config.forEach(function (entry) { + var _entry2 = _$$_REQUIRE(_dependencyMap[0])(entry, 6), + returnValueExpected = _entry2[0], + prototype = _entry2[1], + fn = _entry2[2], + argsNeedPadding = _entry2[3], + reverseCallbacks = _entry2[4], + rejectOnError = _entry2[5]; + + _$$_REQUIRE(_dependencyMap[1])[prototype].prototype[fn] = originalFns[prototype + "." + fn]; + }); + } + + function createPromiseRuntime() { + config.forEach(function (entry) { + var _entry3 = _$$_REQUIRE(_dependencyMap[0])(entry, 6), + returnValueExpected = _entry3[0], + prototype = _entry3[1], + fn = _entry3[2], + argsNeedPadding = _entry3[3], + reverseCallbacks = _entry3[4], + rejectOnError = _entry3[5]; + + var originalFn = _$$_REQUIRE(_dependencyMap[1])[prototype].prototype[fn]; + + _$$_REQUIRE(_dependencyMap[1])[prototype].prototype[fn] = function () { + var _this = this; + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + if (argsNeedPadding && args.length == 1) { + args.push([]); + } + + var promise = new Promise(function (resolve, reject) { + var success = function success() { + if (!returnValueExpected) { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + return resolve(args); + } + }; + + var error = function error(err) { + if (rejectOnError) { + reject(err); + } + + return false; + }; + + var retValue = originalFn.call.apply(originalFn, [_this].concat(args, [reverseCallbacks ? error : success, reverseCallbacks ? success : error])); + + if (returnValueExpected) { + return resolve(retValue); + } + }); + return promise; + }; + }); + } + + _$$_REQUIRE(_dependencyMap[1]).SQLiteFactory.prototype.enablePromise = enablePromiseRuntime; + module.exports = new (_$$_REQUIRE(_dependencyMap[1]).SQLiteFactory)(); +},712,[41,713]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var NativeModules = _$$_REQUIRE(_dependencyMap[0]).NativeModules; + + var DB_STATE_INIT, DB_STATE_OPEN, READ_ONLY_REGEX, SQLiteFactory, SQLitePlugin, SQLitePluginTransaction, argsArray, dblocations, newSQLError, root, txLocks; + var plugin = {}; + READ_ONLY_REGEX = /^(\s|;)*(?:alter|create|delete|drop|insert|reindex|replace|update)/i; + DB_STATE_INIT = "INIT"; + DB_STATE_OPEN = "OPEN"; + txLocks = {}; + + newSQLError = function newSQLError(error, code) { + var sqlError; + sqlError = error; + + if (!code) { + code = 0; + } + + if (!sqlError) { + sqlError = new Error("a plugin had an error but provided no response"); + sqlError.code = code; + } + + if (typeof sqlError === "string") { + sqlError = new Error(error); + sqlError.code = code; + } + + if (!sqlError.code && sqlError.message) { + sqlError.code = code; + } + + if (!sqlError.code && !sqlError.message) { + sqlError = new Error("an unknown error was returned: " + JSON.stringify(sqlError)); + sqlError.code = code; + } + + return sqlError; + }; + + var nextTick = setImmediate || function (fun) { + setTimeout(fun, 0); + }; + + if (global.window) { + nextTick = window.setImmediate || function (fun) { + window.setTimeout(fun, 0); + }; + } + + argsArray = function argsArray(fun) { + return function () { + var args, i, len; + len = arguments.length; + + if (len) { + args = []; + i = -1; + + while (++i < len) { + args[i] = arguments[i]; + } + + return fun.call(this, args); + } else { + return fun.call(this, []); + } + }; + }; + + plugin.exec = function (method, options, success, error) { + if (plugin.sqlitePlugin.DEBUG) {} + + NativeModules["SQLite"][method](options, success, error); + }; + + SQLitePlugin = function SQLitePlugin(openargs, openSuccess, openError) { + var dbname; + + if (!(openargs && openargs['name'])) { + throw newSQLError("Cannot create a SQLitePlugin db instance without a db name"); + } + + dbname = openargs.name; + + if (typeof dbname !== 'string') { + throw newSQLError('sqlite plugin database name must be a string'); + } + + this.openargs = openargs; + this.dbname = dbname; + this.openSuccess = openSuccess; + this.openError = openError; + this.openSuccess || (this.openSuccess = function () {}); + this.openError || (this.openError = function (e) {}); + this.open(this.openSuccess, this.openError); + }; + + SQLitePlugin.prototype.databaseFeatures = { + isSQLitePluginDatabase: true + }; + SQLitePlugin.prototype.openDBs = {}; + + SQLitePlugin.prototype.addTransaction = function (t) { + if (!txLocks[this.dbname]) { + txLocks[this.dbname] = { + queue: [], + inProgress: false + }; + } + + txLocks[this.dbname].queue.push(t); + + if (this.dbname in this.openDBs && this.openDBs[this.dbname] !== DB_STATE_INIT) { + this.startNextTransaction(); + } else { + if (this.dbname in this.openDBs) {} else {} + } + }; + + SQLitePlugin.prototype.transaction = function (fn, error, success) { + if (!this.openDBs[this.dbname]) { + error(newSQLError('database not open')); + return; + } + + this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, true, false)); + }; + + SQLitePlugin.prototype.readTransaction = function (fn, error, success) { + if (!this.openDBs[this.dbname]) { + error(newSQLError('database not open')); + return; + } + + this.addTransaction(new SQLitePluginTransaction(this, fn, error, success, false, true)); + }; + + SQLitePlugin.prototype.startNextTransaction = function () { + var self; + self = this; + nextTick(function (_this) { + return function () { + var txLock; + + if (!(_this.dbname in _this.openDBs) || _this.openDBs[_this.dbname] !== DB_STATE_OPEN) { + return; + } + + txLock = txLocks[self.dbname]; + + if (!txLock) {} else if (txLock.queue.length > 0 && !txLock.inProgress) { + txLock.inProgress = true; + txLock.queue.shift().start(); + } + }; + }(this)); + }; + + SQLitePlugin.prototype.abortAllPendingTransactions = function () { + var j, len1, ref, tx, txLock; + txLock = txLocks[this.dbname]; + + if (!!txLock && txLock.queue.length > 0) { + ref = txLock.queue; + + for (j = 0, len1 = ref.length; j < len1; j++) { + tx = ref[j]; + tx.abortFromQ(newSQLError('Invalid database handle')); + } + + txLock.queue = []; + txLock.inProgress = false; + } + }; + + SQLitePlugin.prototype.sqlBatch = function (sqlStatements, success, error) { + var batchList, j, len1, myfn, st; + + if (!sqlStatements || sqlStatements.constructor !== Array) { + throw newSQLError('sqlBatch expects an array'); + } + + batchList = []; + + for (j = 0, len1 = sqlStatements.length; j < len1; j++) { + st = sqlStatements[j]; + + if (st.constructor === Array) { + if (st.length === 0) { + throw newSQLError('sqlBatch array element of zero (0) length'); + } + + batchList.push({ + sql: st[0], + params: st.length === 0 ? [] : st[1] + }); + } else { + batchList.push({ + sql: st, + params: [] + }); + } + } + + myfn = function myfn(tx) { + var elem, k, len2, results; + results = []; + + for (k = 0, len2 = batchList.length; k < len2; k++) { + elem = batchList[k]; + results.push(tx.addStatement(elem.sql, elem.params, null, null)); + } + + return results; + }; + + var mysuccess = function mysuccess() { + if (!!success) { + return success(); + } + }; + + var myerror = function myerror(e) { + if (!!error) { + return error(e); + } else {} + }; + + this.addTransaction(new SQLitePluginTransaction(this, myfn, myerror, mysuccess, true, false)); + }; + + SQLitePlugin.prototype.open = function (success, error) { + var openerrorcb, opensuccesscb; + + if (this.dbname in this.openDBs && this.openDBs[this.dbname] === DB_STATE_OPEN) { + nextTick(function (_this) { + return function () { + success(_this); + }; + }(this)); + } else { + opensuccesscb = function (_this) { + return function () { + var txLock; + + if (!_this.openDBs[_this.dbname]) {} + + if (_this.dbname in _this.openDBs) { + _this.openDBs[_this.dbname] = DB_STATE_OPEN; + } + + if (!!success) { + success(_this); + } + + txLock = txLocks[_this.dbname]; + + if (!!txLock && txLock.queue.length > 0 && !txLock.inProgress) { + _this.startNextTransaction(); + } + }; + }(this); + + openerrorcb = function (_this) { + return function () { + if (!!error) { + error(newSQLError('Could not open database')); + } + + delete _this.openDBs[_this.dbname]; + + _this.abortAllPendingTransactions(); + }; + }(this); + + this.openDBs[this.dbname] = DB_STATE_INIT; + plugin.exec("open", this.openargs, opensuccesscb, openerrorcb); + } + }; + + SQLitePlugin.prototype.close = function (success, error) { + if (this.dbname in this.openDBs) { + if (txLocks[this.dbname] && txLocks[this.dbname].inProgress) { + error(newSQLError('database cannot be closed while a transaction is in progress')); + return; + } + + delete this.openDBs[this.dbname]; + + if (txLocks[this.dbname]) {} else {} + + var mysuccess = function mysuccess(t, r) { + if (!!success) { + return success(r); + } + }; + + var myerror = function myerror(t, e) { + if (!!error) { + return error(e); + } else {} + }; + + plugin.exec("close", { + path: this.dbname + }, mysuccess, myerror); + } else { + var err = 'cannot close: database is not open'; + + if (error) { + nextTick(function () { + return error(err); + }); + } + } + }; + + SQLitePlugin.prototype.attach = function (dbNameToAttach, dbAlias, success, error) { + if (this.dbname in this.openDBs) { + if (txLocks[this.dbname] && txLocks[this.dbname].inProgress) { + error(newSQLError('database cannot be attached while a transaction is in progress')); + return; + } + + var mysuccess = function mysuccess(t, r) { + if (!!success) { + return success(r); + } + }; + + var myerror = function myerror(e) { + if (!!error) { + return error(e); + } else {} + }; + + plugin.exec("attach", { + path: this.dbname, + dbName: dbNameToAttach, + dbAlias: dbAlias + }, mysuccess, myerror); + } else { + var err = 'cannot attach: database is not open'; + + if (error) { + nextTick(function () { + return error(err); + }); + } + } + }; + + SQLitePlugin.prototype.detach = function (dbAlias, success, error) { + if (this.dbname in this.openDBs) { + if (txLocks[this.dbname] && txLocks[this.dbname].inProgress) { + error(newSQLError('database cannot be attached while a transaction is in progress')); + return; + } + + var mysuccess = function mysuccess(t, r) { + if (!!success) { + return success(r); + } + }; + + var myerror = function myerror(e) { + if (!!error) { + return error(e); + } else {} + }; + + this.executeSql('DETACH DATABASE ' + dbAlias, [], mysuccess, myerror); + } else { + var err = 'cannot attach: database is not open'; + + if (error) { + nextTick(function () { + return error(err); + }); + } + } + }; + + SQLitePlugin.prototype.executeSql = function (statement, params, success, error) { + var myerror, myfn, mysuccess; + + mysuccess = function mysuccess(t, r) { + if (!!success) { + return success(r); + } + }; + + myerror = function myerror(t, e) { + if (!!error) { + return error(e); + } else {} + }; + + myfn = function myfn(tx) { + tx.addStatement(statement, params, mysuccess, myerror); + }; + + this.addTransaction(new SQLitePluginTransaction(this, myfn, null, null, false, false)); + }; + + SQLitePluginTransaction = function SQLitePluginTransaction(db, fn, error, success, txlock, readOnly) { + if (typeof fn !== "function") { + var err = newSQLError("transaction expected a function"); + + if (!!error) { + return error(err); + } else { + throw err; + } + } + + this.db = db; + this.fn = fn; + this.error = error; + this.success = success; + this.txlock = txlock; + this.readOnly = readOnly; + this.executes = []; + + if (txlock) { + this.addStatement("BEGIN", [], null, function (tx, err) { + throw newSQLError("unable to begin transaction: " + err.message, err.code); + }); + } else { + this.addStatement("SELECT 1", [], null, null); + } + }; + + SQLitePluginTransaction.prototype.start = function () { + var err; + + try { + this.fn(this); + this.run(); + } catch (_error) { + err = _error; + txLocks[this.db.dbname].inProgress = false; + this.db.startNextTransaction(); + + if (this.error) { + this.error(newSQLError(err)); + } + } + }; + + SQLitePluginTransaction.prototype.executeSql = function (sql, values, success, error) { + var that = this; + + if (that.finalized) { + throw { + message: "InvalidStateError: DOM Exception 11: This transaction is already finalized. Transactions are committed after its success or failure handlers are called. If you are using a Promise to handle callbacks, be aware that implementations following the A+ standard adhere to run-to-completion semantics and so Promise resolution occurs on a subsequent tick and therefore after the transaction commits.", + code: 11 + }; + } + + if (that.readOnly && READ_ONLY_REGEX.test(sql)) { + that.handleStatementFailure(error, { + message: 'invalid sql for a read-only transaction' + }); + return; + } + + var mysuccess = function mysuccess(t, r) { + if (!!success) { + return success(t, r); + } + }; + + var myerror = function myerror(t, e) { + if (!!error) { + return error(e); + } else {} + }; + + that.addStatement(sql, values, mysuccess, myerror); + }; + + SQLitePluginTransaction.prototype.addStatement = function (sql, values, success, error) { + var j, len1, params, sqlStatement, t, v; + sqlStatement = typeof sql === 'string' ? sql : sql.toString(); + params = []; + + if (!!values && values.constructor === Array) { + for (j = 0, len1 = values.length; j < len1; j++) { + v = values[j]; + t = typeof v; + + if (v === null || v === undefined || t === 'number' || t === 'string') { + params.push(v); + } else if (t === 'boolean') { + params.push(~~v); + } else if (t !== 'function') { + params.push(v.toString()); + console.warn('addStatement - parameter of type <' + t + '> converted to string using toString()'); + } else { + var errorMsg = 'Unsupported parameter type <' + t + '> found in addStatement()'; + console.error(errorMsg); + error(newSQLError(errorMsg)); + return; + } + } + } + + this.executes.push({ + success: success, + error: error, + sql: sqlStatement, + params: params + }); + }; + + SQLitePluginTransaction.prototype.handleStatementSuccess = function (handler, response) { + var payload, rows; + + if (!handler) { + return; + } + + rows = response.rows || []; + payload = { + rows: { + item: function item(i) { + return rows[i]; + }, + raw: function raw() { + return rows.slice(); + }, + length: rows.length + }, + rowsAffected: response.rowsAffected || 0, + insertId: response.insertId || undefined + }; + handler(this, payload); + }; + + SQLitePluginTransaction.prototype.handleStatementFailure = function (handler, response) { + if (!handler) { + throw newSQLError("a statement with no error handler failed: " + response.message, response.code); + } + + if (handler(this, response) !== false) { + throw newSQLError("a statement error callback did not return false: " + response.message, response.code); + } + }; + + SQLitePluginTransaction.prototype.run = function () { + var batchExecutes, handlerFor, i, callbacks, request, tropts, tx, txFailure, waiting; + txFailure = null; + tropts = []; + batchExecutes = this.executes; + waiting = batchExecutes.length; + this.executes = []; + tx = this; + + handlerFor = function handlerFor(index, didSucceed) { + return function (response) { + if (!txFailure) { + try { + if (didSucceed) { + tx.handleStatementSuccess(batchExecutes[index].success, response); + } else { + tx.handleStatementFailure(batchExecutes[index].error, newSQLError(response)); + } + } catch (err) { + var errorMsg = JSON.stringify(err); + if (errorMsg === "{}") errorMsg = err.toString(); + } + + if (!didSucceed) { + txFailure = newSQLError(response); + } + } + + if (--waiting === 0) { + if (txFailure) { + tx.executes = []; + tx.abort(txFailure); + } else if (tx.executes.length > 0) { + tx.run(); + } else { + tx.finish(); + } + } + }; + }; + + i = 0; + callbacks = []; + + while (i < batchExecutes.length) { + request = batchExecutes[i]; + callbacks.push({ + success: handlerFor(i, true), + error: handlerFor(i, false) + }); + tropts.push({ + qid: 1111, + sql: request.sql, + params: request.params + }); + i++; + } + + var mysuccess = function mysuccess(result) { + var j, last, q, r, res, type; + + if (result.length == 0) { + return; + } + + last = result.length - 1; + + for (j = 0; j <= last; ++j) { + r = result[j]; + type = r.type; + res = r.result; + q = callbacks[j]; + + if (q) { + if (q[type]) { + q[type](res); + } + } + } + }; + + var myerror = function myerror(error) {}; + + plugin.exec("backgroundExecuteSqlBatch", { + dbargs: { + dbname: this.db.dbname + }, + executes: tropts + }, mysuccess, myerror); + }; + + SQLitePluginTransaction.prototype.abort = function (txFailure) { + var failed, succeeded, tx; + + if (this.finalized) { + return; + } + + tx = this; + + succeeded = function succeeded(tx) { + txLocks[tx.db.dbname].inProgress = false; + tx.db.startNextTransaction(); + + if (tx.error) { + tx.error(txFailure); + } + }; + + failed = function failed(tx, err) { + txLocks[tx.db.dbname].inProgress = false; + tx.db.startNextTransaction(); + + if (tx.error) { + tx.error(newSQLError("error while trying to roll back: " + err.message, err.code)); + } + }; + + this.finalized = true; + + if (this.txlock) { + this.addStatement("ROLLBACK", [], succeeded, failed); + this.run(); + } else { + succeeded(tx); + } + }; + + SQLitePluginTransaction.prototype.finish = function () { + var failed, succeeded, tx; + + if (this.finalized) { + return; + } + + tx = this; + + succeeded = function succeeded(tx) { + txLocks[tx.db.dbname].inProgress = false; + tx.db.startNextTransaction(); + + if (tx.success) { + tx.success(); + } + }; + + failed = function failed(tx, err) { + txLocks[tx.db.dbname].inProgress = false; + tx.db.startNextTransaction(); + + if (tx.error) { + tx.error(newSQLError("error while trying to commit: " + err.message, err.code)); + } + }; + + this.finalized = true; + + if (this.txlock) { + this.addStatement("COMMIT", [], succeeded, failed); + this.run(); + } else { + succeeded(tx); + } + }; + + SQLitePluginTransaction.prototype.abortFromQ = function (sqlerror) { + if (this.error) { + this.error(sqlerror); + } + }; + + dblocations = { + 'default': 'nosync', + 'Documents': 'docs', + 'Library': 'libs' + }; + + SQLiteFactory = function SQLiteFactory() {}; + + SQLiteFactory.prototype.DEBUG = function (debug) { + plugin.sqlitePlugin.DEBUG = debug; + }; + + SQLiteFactory.prototype.sqliteFeatures = function () { + return { + isSQLitePlugin: true + }; + }; + + SQLiteFactory.prototype.openDatabase = argsArray(function (args) { + var errorcb, first, okcb, openargs, readOnly; + + if (args.length < 1) { + return null; + } + + first = args[0]; + openargs = null; + + okcb = errorcb = function errorcb() {}; + + if (first.constructor === String) { + openargs = { + name: first, + dblocation: dblocations['default'] + }; + + if (args.length >= 5) { + okcb = args[4]; + + if (args.length > 5) { + errorcb = args[5]; + } + } + } else { + openargs = first; + readOnly = !!openargs.readOnly; + + if (!readOnly && (!openargs.location || openargs.location.constructor !== String || !dblocations.hasOwnProperty(openargs.location))) { + openargs.dblocation = dblocations['default']; + } else { + openargs.dblocation = dblocations[openargs.location]; + } + + if (!!openargs.createFromLocation) { + if (openargs.createFromLocation === 1) { + openargs.assetFilename = "1"; + } else if (typeof openargs.createFromLocation == 'string') { + openargs.assetFilename = openargs.createFromLocation; + } + } + + if (!!openargs.androidDatabaseImplementation && openargs.androidDatabaseImplementation === 2) { + openargs.androidOldDatabaseImplementation = 1; + } + + if (!!openargs.androidLockWorkaround && openargs.androidLockWorkaround === 1) { + openargs.androidBugWorkaround = 1; + } + + if (args.length >= 2) { + okcb = args[1]; + + if (args.length > 2) { + errorcb = args[2]; + } + } + } + + return new SQLitePlugin(openargs, okcb, errorcb); + }); + + SQLiteFactory.prototype.echoTest = function (success, error) { + var inputTestValue = 'test-string'; + + var mysuccess = function mysuccess(testValue) { + if (testValue === inputTestValue) { + return success(); + } else { + return error("Mismatch: got: " + testValue + " , expected: " + inputTestValue); + } + }; + + var myerror = function myerror(e) { + return error(e); + }; + + plugin.exec("echoStringValue", { + value: inputTestValue + }, mysuccess, myerror); + }; + + SQLiteFactory.prototype.deleteDatabase = function (first, success, error) { + var args = {}; + + if (first.constructor === String) { + args.path = first; + args.dblocation = dblocations['default']; + } else { + if (!(first && first['name'])) { + throw new Error("Please specify db name via name property"); + } + + args.path = first.name; + + if (!first.location || first.location.constructor !== String || !dblocations.hasOwnProperty(first.location)) { + args.dblocation = dblocations['default']; + } else { + args.dblocation = dblocations[first.location]; + } + } + + var mysuccess = function mysuccess(r) { + delete SQLitePlugin.prototype.openDBs[args.path]; + + if (!!success) { + return success(r); + } + }; + + var myerror = function myerror(e) { + if (!!error) { + return error(e); + } else {} + }; + + plugin.exec("delete", args, mysuccess, myerror); + }; + + plugin.sqlitePlugin = { + SQLiteFactory: SQLiteFactory, + SQLitePluginTransaction: SQLitePluginTransaction, + SQLitePlugin: SQLitePlugin + }; + module.exports = plugin.sqlitePlugin; +},713,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.DBStatus = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var DBStatus = { + DB_DOWNLOADED: 0, + LOW_MID_PDF_DOWNLOADED: 1, + PAPER_BACKGROUND_DOWNLOAD_STARTED: 2, + PAPER_BACKGROUND_DOWNLOADED: 3, + HIGH_RES_DOWNLOAD_STARTED: 4, + HIGH_RES_DOWNLOADED: 5, + GALLERY_DOWNLOAD_STARTED: 12, + GALLERY_DOWNLOADED: 13 + }; + exports.DBStatus = DBStatus; + + var NewspaperIssue = function () { + function NewspaperIssue() { + var dbRow = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + (0, _classCallCheck2.default)(this, NewspaperIssue); + this.dbDowntime = dbRow.db_downtime || 0; + this.dbFilename = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory() + dbRow.db_filename; + + var _global$getActivePSet = global.getActivePSetup(), + pSetup = _global$getActivePSet.pSetup; + + this.dbPSetup = dbRow.db_pSetup || pSetup; + this.dbPaper = dbRow.db_paper; + this.dbIssue = dbRow.db_issue; + this.dbEdition = dbRow.db_edition; + this.dbStatus = dbRow.db_status; + this.dbSecret = dbRow.db_secret; + this.dbNetwork = dbRow.db_network; + this.editionModel = null; + } + + (0, _createClass2.default)(NewspaperIssue, [{ + key: "getFilename", + value: function getFilename() { + return this.dbFilename; + } + }, { + key: "getIssue", + value: function getIssue() { + return this.dbIssue; + } + }, { + key: "getPSetup", + value: function getPSetup() { + return this.dbPSetup; + } + }, { + key: "getPaper", + value: function getPaper() { + return this.dbPaper; + } + }, { + key: "getEdition", + value: function getEdition() { + return this.dbEdition; + } + }, { + key: "setStatus", + value: function setStatus(status) { + this.dbStatus = status; + } + }, { + key: "getStatus", + value: function getStatus() { + return this.dbStatus; + } + }, { + key: "getDownloadTime", + value: function getDownloadTime() { + return this.dbDowntime; + } + }, { + key: "getSecret", + value: function getSecret() { + return this.dbSecret; + } + }, { + key: "setEditionModel", + value: function setEditionModel(editionModel) { + this.editionModel = editionModel; + } + }, { + key: "getEditionModel", + value: function getEditionModel() { + return this.editionModel; + } + }, { + key: "getPages", + value: function getPages() { + if (this.editionModel) { + return this.editionModel.getPages(); + } + + return []; + } + }, { + key: "updatePage", + value: function updatePage(page) { + this.editionModel.updatePage(page); + } + }, { + key: "isEmpty", + value: function isEmpty() { + if (this.editionModel) { + return this.editionModel.isEmpty(); + } + + return true; + } + }, { + key: "hasOnlyDatabaseDownloaded", + value: function hasOnlyDatabaseDownloaded() { + return this.dbStatus === DBStatus.DB_DOWNLOADED; + } + }, { + key: "hasMainComponentsDownloaded", + value: function hasMainComponentsDownloaded() { + return (this.dbStatus & DBStatus.LOW_MID_PDF_DOWNLOADED) === DBStatus.LOW_MID_PDF_DOWNLOADED; + } + }, { + key: "isHighResolutionDownloadStarted", + value: function isHighResolutionDownloadStarted() { + return this.dbStatus === DBStatus.HIGH_RES_DOWNLOAD_STARTED; + } + }, { + key: "hasHighResolutionDownloaded", + value: function hasHighResolutionDownloaded() { + return (this.dbStatus & DBStatus.HIGH_RES_DOWNLOADED) === DBStatus.HIGH_RES_DOWNLOADED; + } + }, { + key: "setDbNetwork", + value: function setDbNetwork(dbNetwork) { + this.dbNetwork = dbNetwork; + } + }, { + key: "getDbNetwork", + value: function getDbNetwork() { + return this.dbNetwork; + } + }, { + key: "isNewspaperCompleteForMode", + value: function isNewspaperCompleteForMode() { + if (_newsmemoryUtils.default.isModeFull()) { + return this.hasHighResolutionDownloaded(); + } + + return this.hasMainComponentsDownloaded(); + } + }, { + key: "equals", + value: function equals(other) { + return this.dbPSetup === other.dbPSetup && this.dbPaper === other.dbPaper && this.dbIssue === other.dbIssue && this.dbEdition === other.dbEdition; + } + }]); + return NewspaperIssue; + }(); + + exports.default = NewspaperIssue; +},714,[5,7,8,644,638,574,603]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PageViewPosition = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var PageViewPosition = { + LEFT: "left", + RIGHT: "right", + CENTER: "center" + }; + exports.PageViewPosition = PageViewPosition; + + var PageUtils = function () { + function PageUtils() { + (0, _classCallCheck2.default)(this, PageUtils); + } + + (0, _createClass2.default)(PageUtils, null, [{ + key: "getSectionLetterFromPage", + value: function getSectionLetterFromPage(page) { + var letters = ""; + + if (page) { + for (var i = 0; i < page.length; i++) { + if (page.charAt(i).match(/[a-z]/i)) { + letters += page.charAt(i); + } else { + break; + } + } + } + + return letters; + } + }, { + key: "getPageNumberFromPage", + value: function getPageNumberFromPage(page) { + var number = ""; + + if (page) { + for (var i = 0; i < page.length; i++) { + if (page.charAt(i).match(/[0-9]/i)) { + number += page.charAt(i); + } + } + } + + return parseInt(number, 10); + } + }, { + key: "splitLettersAndNumbersFromPageNumber", + value: function splitLettersAndNumbersFromPageNumber(pageNumber) { + var pageNumberString = ("" + pageNumber).trim(); + var j = 0; + + while (j < pageNumberString.length && isNaN(pageNumberString[j])) { + j += 1; + } + + var letters = pageNumberString.substring(0, j); + var numbers = pageNumberString.substring(j); + return { + letters: letters, + numbers: numbers + }; + } + }, { + key: "removeZerosFromPageNumber", + value: function removeZerosFromPageNumber(pageNumber) { + var _PageUtils$splitLette = PageUtils.splitLettersAndNumbersFromPageNumber(pageNumber), + letters = _PageUtils$splitLette.letters, + numbers = _PageUtils$splitLette.numbers; + + if (letters.startsWith(".")) { + letters = letters.substring(1); + } + + while (numbers.length > 0 && numbers.substring(0, 1) === "0") { + numbers = numbers.substring(1); + } + + return "" + letters + numbers; + } + }, { + key: "getNextPageNumber", + value: function getNextPageNumber(number) { + try { + var letters = ""; + var zeros = ""; + var pageNumber = ""; + + for (var i = 0; i < number.length; i++) { + var char = number.charAt(i); + + if (char.match(/[^0-9]/)) { + letters += char; + } else if (char === "0") { + zeros += char; + } else { + pageNumber += parseInt(number.substring(i), 10) + 1; + break; + } + } + + if (pageNumber.length > number.length && zeros.length > 0) { + zeros = zeros.substring(0, zeros.length - (pageNumber.length - number.length)); + } + + return letters + zeros + pageNumber; + } catch (e) { + return number; + } + } + }, { + key: "getPageByPageNumber", + value: function getPageByPageNumber(pages, pageNumber) { + if (pages.length > 0) { + var page = pages.find(function (item) { + return PageUtils.comparePageNumber(item.getPage(), pageNumber); + }); + return page; + } + + return undefined; + } + }, { + key: "comparePageNumber", + value: function comparePageNumber(pageNumberA, pageNumberB) { + return PageUtils.removeZerosFromPageNumber(pageNumberA) === PageUtils.removeZerosFromPageNumber(pageNumberB); + } + }, { + key: "comparePages", + value: function comparePages(page, anotherPage) { + return page.modifyTime === anotherPage.modifyTime && page.section === anotherPage.section && page.page === anotherPage.page && page.shownPage === anotherPage.shownPage && page.edition === anotherPage.edition && page.extraMd5 === anotherPage.extraMd5 && page.type === anotherPage.type; + } + }, { + key: "getNextPage", + value: function getNextPage(page, pages) { + var nextPageIndex = pages.findIndex(function (item) { + return PageUtils.comparePages(item, page); + }) + 1; + + if (nextPageIndex > 0 && nextPageIndex < pages.length) { + return pages[nextPageIndex]; + } + + return null; + } + }, { + key: "traverseStyleForRTL", + value: function traverseStyleForRTL(style) { + if (!_$$_REQUIRE(_dependencyMap[5]).PlatformUtils.isRTL()) { + return style; + } + + if (Array.isArray(style)) { + return style.map(function (item) { + return PageUtils.traverseStyleForRTL(item); + }); + } + + if (typeof style === "object") { + var start = style.start, + end = style.end, + left = style.left, + right = style.right, + rest = (0, _objectWithoutProperties2.default)(style, ["start", "end", "left", "right"]); + + if (start !== undefined) { + rest.end = start; + } + + if (left !== undefined) { + rest.right = left; + } + + if (end !== undefined) { + rest.start = end; + } + + if (right !== undefined) { + rest.left = right; + } + + return rest; + } + + return style; + } + }]); + return PageUtils; + }(); + + exports.default = PageUtils; +},715,[5,108,7,8,638,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Action = exports.Route = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Route = function () { + function Route(name) { + var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date().getTime(); + (0, _classCallCheck2.default)(this, Route); + this.time = time; + this.name = name; + } + + (0, _createClass2.default)(Route, [{ + key: "getName", + value: function getName() { + return this.name; + } + }, { + key: "getTime", + value: function getTime() { + return this.time; + } + }, { + key: "toString", + value: function toString() { + return "{\"time\": " + this.time + ", \"name\": \"" + this.name + "\" }"; + } + }, { + key: "equals", + value: function equals(route) { + return this.name === route.getName(); + } + }]); + return Route; + }(); + + exports.Route = Route; + + var Action = function (_Route) { + (0, _inherits2.default)(Action, _Route); + + var _super = _createSuper(Action); + + function Action(name, params) { + var _this; + + var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Date().getTime(); + (0, _classCallCheck2.default)(this, Action); + _this = _super.call(this, name, time); + _this.params = params; + return _this; + } + + (0, _createClass2.default)(Action, [{ + key: "getParams", + value: function getParams() { + return this.params || {}; + } + }, { + key: "toString", + value: function toString() { + return "{\"time\": " + this.time + ", \"name\": \"" + this.name + "\", \"params\": " + JSON.stringify(this.params) + " }"; + } + }, { + key: "equals", + value: function equals(action) { + return this.name === action.getName() && _$$_REQUIRE(_dependencyMap[10]).JSUtils.equals(this.params, action.getParams()); + } + }]); + return Action; + }(Route); + + exports.Action = Action; + + var Session = function () { + function Session() { + var actions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var routes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var time = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new Date().getTime(); + var orientation = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _deviceUtils.default.getCurrentOrientation(); + (0, _classCallCheck2.default)(this, Session); + this.startTime = time; + this.startOrientation = orientation.toLowerCase(); + this.actions = actions; + this.navigation = routes; + } + + (0, _createClass2.default)(Session, [{ + key: "filterRoute", + value: function filterRoute(newRoute, routesList) { + var lastRoute = routesList[routesList.length - 1]; + + if (!lastRoute || !lastRoute.equals(newRoute)) { + var sameRoutes = routesList.filter(function (route) { + return newRoute.getTime() - route.getTime() < 1000 && route.equals(newRoute); + }); + return sameRoutes.length > 0; + } + + return true; + } + }, { + key: "addAction", + value: function addAction(name, params) { + var newAction = new Action(name, params); + + if (!this.filterRoute(newAction, this.actions)) { + this.actions.push(newAction); + } + } + }, { + key: "addRoute", + value: function addRoute(route) { + var newRoute = new Route(route); + + if (!this.filterRoute(newRoute, this.navigation)) { + this.navigation.push(newRoute); + } + } + }, { + key: "getActions", + value: function getActions() { + return this.actions || []; + } + }, { + key: "getNavigation", + value: function getNavigation() { + return this.navigation || []; + } + }, { + key: "getDuration", + value: function getDuration() { + var lastAction = this.actions[this.actions.length - 1]; + + if (lastAction) { + return lastAction.getTime() - this.startTime; + } + + return 0; + } + }, { + key: "getActionsCounters", + value: function getActionsCounters() { + return this.actions.reduce(function (current, action) { + var name = action.getName(); + current[name] = current[name] ? current[name] + 1 : 1; + return current; + }, {}); + } + }, { + key: "getRoutesCounters", + value: function getRoutesCounters() { + var _this2 = this; + + return this.navigation.reduce(function (current, route, index) { + var prevRoute = _this2.navigation[index - 1]; + var nextRoute = _this2.navigation[index + 1]; + var endTime = new Date().getTime(); + + if (nextRoute) { + endTime = nextRoute.getTime(); + } + + var name = route.getName(); + var times = 1; + var duration = endTime - route.getTime(); + + if (current[name]) { + var _current$name = current[name], + prevTimes = _current$name.times, + prevDuration = _current$name.duration; + + if (!prevRoute || prevRoute && name !== prevRoute.getName()) { + times = prevTimes + 1; + } + + duration += prevDuration; + } + + current[name] = { + times: times, + duration: duration + }; + return current; + }, {}); + } + }, { + key: "getOrientationInfo", + value: function getOrientationInfo() { + var rotationActions = [new Action("rotate_" + this.startOrientation, {}, this.startTime)]; + rotationActions.push.apply(rotationActions, (0, _toConsumableArray2.default)(this.actions.filter(function (action) { + return action.getName().startsWith("rotate_"); + }))); + + if (rotationActions && rotationActions.length > 0) { + var orientationDurations = rotationActions.reduce(function (current, action, index) { + var nextAction = rotationActions[index + 1]; + var endTime = new Date().getTime(); + + if (nextAction) { + endTime = nextAction.getTime(); + } + + var orientation = action.getName().replace("rotate_", ""); + var duration = endTime - action.getTime(); + + if (current[orientation]) { + duration += current[orientation]; + } + + current[orientation] = duration; + return current; + }, {}); + var totalTime = Object.keys(orientationDurations).reduce(function (current, orientation) { + return current + orientationDurations[orientation]; + }, 0); + return Object.keys(orientationDurations).reduce(function (current, orientation) { + current[orientation] = totalTime ? orientationDurations[orientation] / totalTime * 100 : 0; + return current; + }, {}); + } + + return {}; + } + }, { + key: "getFullReport", + value: function getFullReport() { + var _PlatformUtils$info = _$$_REQUIRE(_dependencyMap[10]).PlatformUtils.info, + appName = _PlatformUtils$info.appName, + bundleId = _PlatformUtils$info.bundleId, + uniqueId = _PlatformUtils$info.uniqueId, + storeVersion = _PlatformUtils$info.version, + deviceInfo = (0, _objectWithoutProperties2.default)(_PlatformUtils$info, ["appName", "bundleId", "uniqueId", "version"]); + + var version = _deviceUtils.default.getAppVersion(); + + var appInfo = { + pSetup: global.getAppPSetup(), + machine: global.getAppServer(), + appName: appName, + bundleId: bundleId, + version: version + }; + + if (version !== storeVersion) { + appInfo.storeVersion = storeVersion; + } + + return { + startTime: this.startTime, + startOrientation: this.startOrientation, + duration: this.getDuration(), + actions: this.actions, + routes: this.navigation, + orientation: this.getOrientationInfo(), + deviceInfo: deviceInfo, + appInfo: appInfo + }; + } + }, { + key: "getReport", + value: function getReport() { + return (0, _extends2.default)({}, this.getFullReport(), { + actions: this.getActionsCounters(), + routes: this.getRoutesCounters() + }); + } + }, { + key: "toString", + value: function toString() { + return "{\"startTime\": " + this.startTime + ", \"startOrientation\": \"" + this.startOrientation + "\",\n \"actions\": " + JSON.stringify(this.actions.map(function (action) { + return action.toString(); + })) + ", \"navigation\": " + JSON.stringify(this.navigation.map(function (route) { + return route.toString(); + })) + "}"; + } + }]); + return Session; + }(); + + exports.default = Session; +},716,[5,6,108,21,12,14,16,7,8,458,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PaperSetupConfig = exports.FIREBASE_DEFAULT_CUSTOM_DIMENSIONS = exports.DEFAULT_CUSTOM_DIMENSIONS = exports.MAX_SHARE_CHECK_TYPES = exports.ENCRYPT_FILENAME_TYPE = exports.LATEST_AVAILABLE_EDITION_FORMAT = exports.PAGES_NAVIGATION_BUTTONS_LAYOUT = exports.SHOW_TYPES_ARTICLE = exports.NEWSMEMORY_START_MODE = exports.MERGE_ARTICLES_TYPES = exports.URL_TYPES = exports.NEWSMEMORY_SCREENS_NAME = exports.NEWSMEMORY_SCREENS = exports.BOTH_ENABLED = exports.NEWSMEMORY_ENABLED = exports.RSS_ENABLED = exports.DEFAULT = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _PaperSetupHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _webUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Payment = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DEFAULT = "0"; + exports.DEFAULT = DEFAULT; + var RSS_ENABLED = "1"; + exports.RSS_ENABLED = RSS_ENABLED; + var NEWSMEMORY_ENABLED = "2"; + exports.NEWSMEMORY_ENABLED = NEWSMEMORY_ENABLED; + var BOTH_ENABLED = "3"; + exports.BOTH_ENABLED = BOTH_ENABLED; + var NEWSMEMORY_SCREENS = { + REACT: 0, + NATIVE: 1, + HTML5: 2 + }; + exports.NEWSMEMORY_SCREENS = NEWSMEMORY_SCREENS; + var NEWSMEMORY_SCREENS_NAME = { + REACT: "NewsmemoryScreen", + NATIVE: "NewsmemoryNativeScreen", + HTML5: "NewsmemoryHTML5Screen" + }; + exports.NEWSMEMORY_SCREENS_NAME = NEWSMEMORY_SCREENS_NAME; + var URL_TYPES = { + UNDERLINE: "underline", + SQUARED: "squared", + ROUNDED: "rounded" + }; + exports.URL_TYPES = URL_TYPES; + var MERGE_ARTICLES_TYPES = { + NORMAL: 0, + MERGED: 1, + ONLY_FIRST: 2, + PAGE_REFS: 3 + }; + exports.MERGE_ARTICLES_TYPES = MERGE_ARTICLES_TYPES; + var NEWSMEMORY_START_MODE = { + READ: "read", + SWIPE: "swipe", + BROWSE: "browse" + }; + exports.NEWSMEMORY_START_MODE = NEWSMEMORY_START_MODE; + var SHOW_TYPES_ARTICLE = { + ONLY_TEXT: "0", + TEXT_AND_GRAPH: "1", + ALL: "2" + }; + exports.SHOW_TYPES_ARTICLE = SHOW_TYPES_ARTICLE; + var PAGES_NAVIGATION_BUTTONS_LAYOUT = { + HIDDEN: "0", + FIXED: "1", + ANIMATED: "2" + }; + exports.PAGES_NAVIGATION_BUTTONS_LAYOUT = PAGES_NAVIGATION_BUTTONS_LAYOUT; + var LATEST_AVAILABLE_EDITION_FORMAT = { + PLAIN_MESSAGE: "0", + ONLY_EDITION: "1", + ISSUE_AND_EDITION: "2" + }; + exports.LATEST_AVAILABLE_EDITION_FORMAT = LATEST_AVAILABLE_EDITION_FORMAT; + var ENCRYPT_FILENAME_TYPE = { + NONE: 0, + MAIN: 1, + XPAPER: 2 + }; + exports.ENCRYPT_FILENAME_TYPE = ENCRYPT_FILENAME_TYPE; + var MAX_SHARE_CHECK_TYPES = { + LOCAL: 1, + REMOTE: 2 + }; + exports.MAX_SHARE_CHECK_TYPES = MAX_SHARE_CHECK_TYPES; + var DEFAULT_CUSTOM_DIMENSIONS = "dimension1=$deviceType&dimension2=$issue&dimension3=$edition&dimension4=$page&dimension5=$articleId&dimension6=$action&dimension7=$ePaperAccess&dimension8=$title"; + exports.DEFAULT_CUSTOM_DIMENSIONS = DEFAULT_CUSTOM_DIMENSIONS; + var FIREBASE_DEFAULT_CUSTOM_DIMENSIONS = "device=$deviceType&issue=$issue&edition=$edition&page=$page&article_id=$articleId&action=$action&epaper_access=$ePaperAccess&app_mode=$appSide&title=$title&site_id=$siteId&remote_site_id=$remoteSiteId"; + exports.FIREBASE_DEFAULT_CUSTOM_DIMENSIONS = FIREBASE_DEFAULT_CUSTOM_DIMENSIONS; + var defaultCustomCSSFilename = "csscustom"; + var KEYS_REQUIRE_RESTART = ["pSetup", "paper", "layoutStyle", "layoutSubStyle", "newsmemoryToUse", "rssIsEnabled", "newsMemoryIsEnabled", "migrate", "googleAnalyticsAnonymizeIP", "clientGoogleAnalyticsAccount", "feedbackGoogleAnalyticsAccount", "tecnaviaGoogleAnalyticsAccount", "TAGoogleAnalyticsEvent", "comScoreId", "comScorePublisherSecret", "comScoreAppName", "rempAccountURL", "adobeAnalyticsEnabled", "adobeAnalyticsConfig", "matherAnalyticsEnabled", "matomoEnabled", "matomoConfig", "matomoTrackerEnabled", "matomoTrackerConfig", "facebookEnabled", "attConfig", "iubendaEnabled", "iubendaConfig", "bundleUpdateAvailable", "resetAppBundle", "isGenericApp", "rnStyles", "fixButtonsBarToBottom", "externalXPapers", "pushTags", "useNativeViewPagerIOS", "useAsymmetricCardList", "preventScreenshots", "showNativeOptionsPageFallbackUrl"]; + var KEYS_LAYOUT_UPDATE = ["checksum"]; + var KEYS_NO_UPDATE = ["json", "pSetupFileTime", "checksum", "lastIssue", "lastEdition", "demoIssue", "external"]; + var keys = _PaperSetupHelper.default.SP.keys; + + var PaperSetupConfig = function (_PaperSetupBaseConfig) { + (0, _inherits2.default)(PaperSetupConfig, _PaperSetupBaseConfig); + + var _super = _createSuper(PaperSetupConfig); + + function PaperSetupConfig() { + var _this; + + (0, _classCallCheck2.default)(this, PaperSetupConfig); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.external = false; + return _this; + } + + (0, _createClass2.default)(PaperSetupConfig, [{ + key: "init", + value: function init() { + var json, + forcedSubLayout, + userIP, + refreshesTAUIDString, + customUserAgentIsEnabled, + customUserAgent, + userAgentSuffix, + optionsPageMode, + optionsPageBaseURL, + optionsPageCoordinates, + optionsPageModal, + modeEnabled, + baseRssUpdateURL, + otherFirebaseProjectsRaw, + facebookEnabled, + otherCSSFiles, + bgDurationTemp, + bgTimerTemp, + pSetupPaymentsString, + pSetupPaymentsArray, + rnStyleRaw, + customHTTPHeadersRaw, + rawStartupParams, + _args = arguments; + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + json = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + _context.next = 3; + return _regenerator.default.awrap((0, _get2.default)((0, _getPrototypeOf2.default)(PaperSetupConfig.prototype), "init", this).call(this, json)); + + case 3: + _context.next = 5; + return _regenerator.default.awrap(this.getValue(keys.layout_style)); + + case 5: + this.layoutStyle = _context.sent; + + if (this.layoutStyle) { + _context.next = 8; + break; + } + + return _context.abrupt("return", false); + + case 8: + if (!(this.pSetup === global.getAppPSetup())) { + _context.next = 20; + break; + } + + _context.next = 11; + return _regenerator.default.awrap(global.getUserSettings().getForceLayoutSubStyle()); + + case 11: + forcedSubLayout = _context.sent; + _context.t0 = forcedSubLayout; + + if (_context.t0) { + _context.next = 17; + break; + } + + _context.next = 16; + return _regenerator.default.awrap(this.getValue(keys.layout_sub_style)); + + case 16: + _context.t0 = _context.sent; + + case 17: + this.layoutSubStyle = _context.t0; + _context.next = 23; + break; + + case 20: + _context.next = 22; + return _regenerator.default.awrap(this.getValue(keys.layout_sub_style)); + + case 22: + this.layoutSubStyle = _context.sent; + + case 23: + _context.next = 25; + return _regenerator.default.awrap(this.getValue(keys.user_ip)); + + case 25: + _context.t1 = _context.sent; + + if (_context.t1) { + _context.next = 28; + break; + } + + _context.t1 = "n/a"; + + case 28: + userIP = _context.t1; + + _$$_REQUIRE(_dependencyMap[11]).NetworkUtils.setIP(userIP); + + _context.next = 32; + return _regenerator.default.awrap(this.getValue(keys.is_allowed_ip)); + + case 32: + _context.t2 = _context.sent; + this.isAllowedIP = _context.t2 === "1"; + _context.next = 36; + return _regenerator.default.awrap(this.getValue(keys.machine)); + + case 36: + this.machine = _context.sent; + this.premiumIconURL = this.machine.concat("/eeLayout/").concat(this.layoutStyle).concat("/").concat(this.layoutSubStyle).concat("/images/webapp/tecnavia_premium_article.png"); + _context.next = 40; + return _regenerator.default.awrap(this.getValue(keys.paper)); + + case 40: + this.paper = _context.sent; + _context.next = 43; + return _regenerator.default.awrap(this.getValue(keys.xpaper)); + + case 43: + this.xpaper = _context.sent; + _context.next = 46; + return _regenerator.default.awrap(this.getValue(keys.app_mode_selection_page_enabled)); + + case 46: + _context.t3 = _context.sent; + this.appModeSelectionPageEnabled = _context.t3 === "1"; + _context.next = 50; + return _regenerator.default.awrap(this.getValue(keys.app_mode_selection_page_url)); + + case 50: + this.appModeSelectionPageURL = _context.sent; + _context.t5 = Number; + _context.next = 54; + return _regenerator.default.awrap(this.getValue(keys.app_mode_selection_page_version)); + + case 54: + _context.t6 = _context.sent; + _context.t4 = _context.t5.parseInt.call(_context.t5, _context.t6, 10); + + if (_context.t4) { + _context.next = 58; + break; + } + + _context.t4 = 0; + + case 58: + this.appModeSelectionPageVersion = _context.t4; + _context.next = 61; + return _regenerator.default.awrap(this.getValue(keys.powered_by)); + + case 61: + this.poweredBy = _context.sent; + _context.next = 64; + return _regenerator.default.awrap(this.getValue(keys.powered_by_url)); + + case 64: + this.poweredByURL = _context.sent; + _context.next = 67; + return _regenerator.default.awrap(this.getValue(keys.copyright)); + + case 67: + this.copyright = _context.sent; + _context.next = 70; + return _regenerator.default.awrap(this.getValue(keys.copyright_url)); + + case 70: + this.copyrightURL = _context.sent; + _context.next = 73; + return _regenerator.default.awrap(this.getValue(keys.add_disclaimer)); + + case 73: + this.addDisclaimer = _context.sent; + _context.next = 76; + return _regenerator.default.awrap(this.getValue(keys.paper_name)); + + case 76: + this.paperName = _context.sent; + _context.next = 79; + return _regenerator.default.awrap(this.getValue(keys.language)); + + case 79: + this.language = _context.sent; + _context.next = 82; + return _regenerator.default.awrap(this.getValue(keys.site_domain)); + + case 82: + this.siteDomain = _context.sent; + _context.next = 85; + return _regenerator.default.awrap(this.getValue(keys.is_lite)); + + case 85: + _context.t7 = _context.sent; + this.isLite = _context.t7 === "1"; + _context.next = 89; + return _regenerator.default.awrap(this.getValue(keys.init_x_paper_not_in_view)); + + case 89: + _context.t8 = _context.sent; + + if (_context.t8) { + _context.next = 92; + break; + } + + _context.t8 = ""; + + case 92: + this.initpageXpaperNotView = _context.t8; + _context.next = 95; + return _regenerator.default.awrap(this.getValue(keys.external_xpapers)); + + case 95: + _context.t9 = _context.sent; + + if (_context.t9) { + _context.next = 98; + break; + } + + _context.t9 = ""; + + case 98: + this.externalXPapers = _context.t9; + _context.next = 101; + return _regenerator.default.awrap(this.getValue(keys.special_before_index)); + + case 101: + this.specialBeforeIndex = _context.sent; + _context.next = 104; + return _regenerator.default.awrap(this.getValue(keys.special_before_index_tablet)); + + case 104: + this.specialBeforeIndexTablet = _context.sent; + _context.next = 107; + return _regenerator.default.awrap(this.getValue(keys.special_before_index_phone)); + + case 107: + this.specialBeforeIndexPhone = _context.sent; + _context.next = 110; + return _regenerator.default.awrap(this.getValue(keys.udb)); + + case 110: + this.udb = _context.sent; + this.loginStatus = new (_$$_REQUIRE(_dependencyMap[12]).LoginStatus)(); + _context.next = 114; + return _regenerator.default.awrap(this.loginStatus.init(this.udb)); + + case 114: + if (_context.sent) { + _context.next = 115; + break; + } + + case 115: + _context.t10 = this.loginStatus; + _context.next = 118; + return _regenerator.default.awrap(this.getValue(keys.preview_token)); + + case 118: + _context.t11 = _context.sent; + + _context.t10.setOneTimeToken.call(_context.t10, _context.t11); + + _context.next = 122; + return _regenerator.default.awrap(this.getValue(keys.refreshes_tauid)); + + case 122: + _context.t12 = _context.sent; + + if (_context.t12) { + _context.next = 125; + break; + } + + _context.t12 = ""; + + case 125: + refreshesTAUIDString = _context.t12; + this.refreshesTAUIDTimestamp = _$$_REQUIRE(_dependencyMap[11]).DateUtils.getUnixTimestampFromDateTimeString(refreshesTAUIDString); + _context.next = 129; + return _regenerator.default.awrap(this.getValue(keys.change_user_agent_for_oauth)); + + case 129: + _context.t13 = _context.sent; + customUserAgentIsEnabled = _context.t13 === "1"; + customUserAgent = ""; + + if (!customUserAgentIsEnabled) { + _context.next = 149; + break; + } + + if (!_$$_REQUIRE(_dependencyMap[11]).PlatformUtils.isAndroid()) { + _context.next = 142; + break; + } + + _context.next = 136; + return _regenerator.default.awrap(this.getValue(keys.custom_user_agent_for_oauth)); + + case 136: + _context.t14 = _context.sent; + + if (_context.t14) { + _context.next = 139; + break; + } + + _context.t14 = ""; + + case 139: + customUserAgent = _context.t14; + _context.next = 149; + break; + + case 142: + _context.next = 144; + return _regenerator.default.awrap(this.getValue(keys.custom_string_to_append_to_user_agent_for_oauth)); + + case 144: + _context.t15 = _context.sent; + + if (_context.t15) { + _context.next = 147; + break; + } + + _context.t15 = "Safari/{APPLE_WEBKIT_VERSION}"; + + case 147: + userAgentSuffix = _context.t15; + + if (userAgentSuffix) { + userAgentSuffix = userAgentSuffix.replace("{APPLE_WEBKIT_VERSION}", _$$_REQUIRE(_dependencyMap[11]).PlatformUtils.getAppleWebKitVersion()); + customUserAgent = _$$_REQUIRE(_dependencyMap[11]).PlatformUtils.getUserAgent() + " " + userAgentSuffix; + } + + case 149: + this.overrideNewsMemoryUserAgent = customUserAgent; + _context.t16 = parseInt; + _context.next = 153; + return _regenerator.default.awrap(this.getValue(keys.newsmemory_to_use)); + + case 153: + _context.t17 = _context.sent; + + if (_context.t17) { + _context.next = 156; + break; + } + + _context.t17 = NEWSMEMORY_SCREENS.NATIVE; + + case 156: + _context.t18 = _context.t17; + this.newsmemoryToUse = (0, _context.t16)(_context.t18, 10); + _context.next = 160; + return _regenerator.default.awrap(this.getValue(keys.newsmemory_to_use_timestamp)); + + case 160: + _context.t19 = _context.sent; + + if (_context.t19) { + _context.next = 163; + break; + } + + _context.t19 = ""; + + case 163: + this.newsmemoryToUseTimestamp = _context.t19; + _context.t20 = _$$_REQUIRE(_dependencyMap[11]).PlatformUtils.isAndroid(); + + if (!_context.t20) { + _context.next = 170; + break; + } + + _context.next = 168; + return _regenerator.default.awrap(this.getValue(keys.gallery_download_enabled)); + + case 168: + _context.t21 = _context.sent; + _context.t20 = _context.t21 === "1"; + + case 170: + this.galleryDownloadEnabled = _context.t20; + _context.next = 173; + return _regenerator.default.awrap(this.getValue(keys.gallery_thumbnail_disabled)); + + case 173: + _context.t22 = _context.sent; + this.galleryThumbnailEnabled = _context.t22 !== "1"; + _context.next = 177; + return _regenerator.default.awrap(this.getValue(keys.open_http_link_on_external_browser)); + + case 177: + _context.t23 = _context.sent; + + if (_context.t23) { + _context.next = 180; + break; + } + + _context.t23 = "1"; + + case 180: + _context.t24 = _context.t23; + this.openHttpLinkOnExternalBrowser = _context.t24 !== "0"; + _context.t25 = parseInt; + _context.next = 185; + return _regenerator.default.awrap(this.getValue(keys.file_time)); + + case 185: + _context.t26 = _context.sent; + + if (_context.t26) { + _context.next = 188; + break; + } + + _context.t26 = -1; + + case 188: + _context.t27 = _context.t26; + this.pSetupFileTime = (0, _context.t25)(_context.t27, 10); + _context.t28 = parseInt; + _context.next = 193; + return _regenerator.default.awrap(this.getValue(keys.rss_index_file_time)); + + case 193: + _context.t29 = _context.sent; + + if (_context.t29) { + _context.next = 196; + break; + } + + _context.t29 = -1; + + case 196: + _context.t30 = _context.t29; + this.rssIndexFileTime = (0, _context.t28)(_context.t30, 10); + _context.t31 = parseInt; + _context.next = 201; + return _regenerator.default.awrap(this.getValue(keys.custom_language_pack_file_time)); + + case 201: + _context.t32 = _context.sent; + + if (_context.t32) { + _context.next = 204; + break; + } + + _context.t32 = -1; + + case 204: + _context.t33 = _context.t32; + this.customLanguagePackFileTime = (0, _context.t31)(_context.t33, 10); + _context.t34 = parseInt; + _context.next = 209; + return _regenerator.default.awrap(this.getValue(keys.custom_fonts_file_time)); + + case 209: + _context.t35 = _context.sent; + + if (_context.t35) { + _context.next = 212; + break; + } + + _context.t35 = -1; + + case 212: + _context.t36 = _context.t35; + this.customFontsFileTime = (0, _context.t34)(_context.t36, 10); + _context.next = 216; + return _regenerator.default.awrap(this.getValue(keys.load_editions_url)); + + case 216: + this.loadEditionsUrl = _context.sent; + _context.t37 = parseInt; + _context.next = 220; + return _regenerator.default.awrap(this.getValue(keys.option_page_mode)); + + case 220: + _context.t38 = _context.sent; + optionsPageMode = (0, _context.t37)(_context.t38, 10); + _context.next = 224; + return _regenerator.default.awrap(this.getValue(keys.option_page_url)); + + case 224: + optionsPageBaseURL = _context.sent; + _context.next = 227; + return _regenerator.default.awrap(this.getValue(keys.option_page_coordinates)); + + case 227: + _context.t39 = _context.sent; + + if (_context.t39) { + _context.next = 230; + break; + } + + _context.t39 = ""; + + case 230: + optionsPageCoordinates = _context.t39; + _context.next = 233; + return _regenerator.default.awrap(this.getValue(keys.option_page_modal)); + + case 233: + _context.t40 = _context.sent; + optionsPageModal = _context.t40 === "1"; + this.optionspageConfig = new (_$$_REQUIRE(_dependencyMap[13]).OptionspageConfig)({ + mode: optionsPageMode, + baseURL: optionsPageBaseURL, + coordinatesString: optionsPageCoordinates, + modal: optionsPageModal + }); + _context.next = 238; + return _regenerator.default.awrap(this.getValue(keys.mode_enabled)); + + case 238: + modeEnabled = _context.sent; + _context.next = 241; + return _regenerator.default.awrap(this.checkIfRssIsEnabled()); + + case 241: + this.rssIsEnabled = _context.sent; + this.newsMemoryIsEnabled = modeEnabled === DEFAULT || modeEnabled === NEWSMEMORY_ENABLED || modeEnabled === BOTH_ENABLED; + _context.next = 245; + return _regenerator.default.awrap(this.getValue(keys.startup_mode)); + + case 245: + this.startupMode = _context.sent; + _context.next = 248; + return _regenerator.default.awrap(this.getValue(keys.startup_mode_timestamp)); + + case 248: + _context.t41 = _context.sent; + + if (_context.t41) { + _context.next = 251; + break; + } + + _context.t41 = ""; + + case 251: + this.startupModeTimestamp = _context.t41; + _context.next = 254; + return _regenerator.default.awrap(this.getValue(keys.base_rss_update_url)); + + case 254: + baseRssUpdateURL = _context.sent; + baseRssUpdateURL = _$$_REQUIRE(_dependencyMap[11]).NetworkUtils.addDefaultProtocol(baseRssUpdateURL); + baseRssUpdateURL = _webUtils.default.replaceUrlPlaceHolder(baseRssUpdateURL); + this.baseRssUpdateURL = baseRssUpdateURL; + _context.next = 260; + return _regenerator.default.awrap(this.getValue(keys.feedback.enable)); + + case 260: + _context.t42 = _context.sent; + this.feedbackEnabled = _context.t42 === "1"; + + if (!this.feedbackEnabled) { + _context.next = 266; + break; + } + + this.feedbackConfig = new (_$$_REQUIRE(_dependencyMap[14]).FeedbackConfig)(this.pSetup, this.originalMachine); + _context.next = 266; + return _regenerator.default.awrap(this.feedbackConfig.init(json)); + + case 266: + _context.next = 268; + return _regenerator.default.awrap(this.getValue(keys.disable_firebase_analytics)); + + case 268: + _context.t43 = _context.sent; + + if (_context.t43) { + _context.next = 271; + break; + } + + _context.t43 = "0"; + + case 271: + _context.t44 = _context.t43; + this.disableFirebaseAnalytics = _context.t44 === "1"; + _context.next = 275; + return _regenerator.default.awrap(this.getValue(keys.firebase_analytics_custom_dimensions)); + + case 275: + _context.t45 = _context.sent; + + if (_context.t45) { + _context.next = 278; + break; + } + + _context.t45 = FIREBASE_DEFAULT_CUSTOM_DIMENSIONS; + + case 278: + this.firebaseAnalyticsCustomDimensions = _context.t45; + this.otherFirebaseProjects = []; + _context.next = 282; + return _regenerator.default.awrap(this.getValue(keys.other_firebase_projects)); + + case 282: + otherFirebaseProjectsRaw = _context.sent; + + if (otherFirebaseProjectsRaw) { + try { + this.otherFirebaseProjects = JSON.parse(otherFirebaseProjectsRaw); + } catch (e) {} + } + + _context.next = 286; + return _regenerator.default.awrap(this.getValue(keys.firebase_analytics_send_external_id)); + + case 286: + _context.t46 = _context.sent; + + if (_context.t46) { + _context.next = 289; + break; + } + + _context.t46 = "0"; + + case 289: + _context.t47 = _context.t46; + this.firebaseAnalyticsSendExternalId = _context.t47 === "1"; + _context.next = 293; + return _regenerator.default.awrap(this.getValue(keys.disable_google_analytics_3)); + + case 293: + _context.t48 = _context.sent; + + if (_context.t48) { + _context.next = 296; + break; + } + + _context.t48 = "0"; + + case 296: + _context.t49 = _context.t48; + this.disableGoogleAnalytics3 = _context.t49 === "1"; + _context.next = 300; + return _regenerator.default.awrap(this.getValue(keys.g_analytics_anonymize_ip)); + + case 300: + _context.t50 = _context.sent; + + if (_context.t50) { + _context.next = 303; + break; + } + + _context.t50 = "1"; + + case 303: + _context.t51 = _context.t50; + this.googleAnalyticsAnonymizeIP = _context.t51 === "1"; + _context.next = 307; + return _regenerator.default.awrap(this.getValue(keys.g_analytics)); + + case 307: + this.clientGoogleAnalyticsAccount = _context.sent; + _context.next = 310; + return _regenerator.default.awrap(this.getValue(keys.g_analytics_feedback)); + + case 310: + this.feedbackGoogleAnalyticsAccount = _context.sent; + _context.next = 313; + return _regenerator.default.awrap(this.getValue(keys.g_analytics_tecnavia)); + + case 313: + this.tecnaviaGoogleAnalyticsAccount = _context.sent; + _context.next = 316; + return _regenerator.default.awrap(this.getValue(keys.ta_google_analytics_event)); + + case 316: + this.TAGoogleAnalyticsEvent = _context.sent; + _context.next = 319; + return _regenerator.default.awrap(this.getValue(keys.google_analytics_custom_dimensions)); + + case 319: + _context.t52 = _context.sent; + + if (_context.t52) { + _context.next = 322; + break; + } + + _context.t52 = DEFAULT_CUSTOM_DIMENSIONS; + + case 322: + this.googleAnalyticsCustomDimensions = _context.t52; + _context.next = 325; + return _regenerator.default.awrap(this.getValue(keys.remp_account)); + + case 325: + this.rempAccountURL = _context.sent; + _context.next = 328; + return _regenerator.default.awrap(this.getValue(keys.comscore.app_name)); + + case 328: + this.comScoreAppName = _context.sent; + _context.next = 331; + return _regenerator.default.awrap(this.getValue(keys.comscore.id)); + + case 331: + this.comScoreId = _context.sent; + _context.next = 334; + return _regenerator.default.awrap(this.getValue(keys.comscore.publisher_secret)); + + case 334: + this.comScorePublisherSecret = _context.sent; + _context.next = 337; + return _regenerator.default.awrap(this.getValue(keys.comscore.base_url)); + + case 337: + this.comScoreBaseURL = _context.sent; + _context.next = 340; + return _regenerator.default.awrap(this.getValue(keys.mather_analytics.enabled)); + + case 340: + _context.t53 = _context.sent; + + if (_context.t53) { + _context.next = 343; + break; + } + + _context.t53 = "0"; + + case 343: + _context.t54 = _context.t53; + this.matherAnalyticsEnabled = _context.t54 === "1"; + _context.next = 347; + return _regenerator.default.awrap(this.getValue(keys.mather_analytics.customer_id)); + + case 347: + _context.t55 = _context.sent; + + if (_context.t55) { + _context.next = 350; + break; + } + + _context.t55 = ""; + + case 350: + this.matherAnalyticsCustomerId = _context.t55; + _context.next = 353; + return _regenerator.default.awrap(this.getValue(keys.mather_analytics.site_id)); + + case 353: + _context.t56 = _context.sent; + + if (_context.t56) { + _context.next = 356; + break; + } + + _context.t56 = ""; + + case 356: + this.matherAnalyticsSiteId = _context.t56; + _context.next = 359; + return _regenerator.default.awrap(this.getValue(keys.mather_analytics.send_email)); + + case 359: + _context.t57 = _context.sent; + + if (_context.t57) { + _context.next = 362; + break; + } + + _context.t57 = "0"; + + case 362: + _context.t58 = _context.t57; + this.matherAnalyticsSendEmail = _context.t58 === "1"; + _context.next = 366; + return _regenerator.default.awrap(this.getValue(keys.adobe_analytics.enabled)); + + case 366: + _context.t59 = _context.sent; + + if (_context.t59) { + _context.next = 369; + break; + } + + _context.t59 = "0"; + + case 369: + _context.t60 = _context.t59; + this.adobeAnalyticsEnabled = _context.t60 === "1"; + + if (!this.adobeAnalyticsEnabled) { + _context.next = 375; + break; + } + + this.adobeAnalyticsConfig = new (_$$_REQUIRE(_dependencyMap[15]).AdobeAnalyticsConfig)(this.pSetup, this.originalMachine); + _context.next = 375; + return _regenerator.default.awrap(this.adobeAnalyticsConfig.init(json)); + + case 375: + _context.next = 377; + return _regenerator.default.awrap(this.getValue(keys.matomo.enabled)); + + case 377: + _context.t61 = _context.sent; + + if (_context.t61) { + _context.next = 380; + break; + } + + _context.t61 = "0"; + + case 380: + _context.t62 = _context.t61; + this.matomoEnabled = _context.t62 === "1"; + + if (!this.matomoEnabled) { + _context.next = 386; + break; + } + + this.matomoConfig = new (_$$_REQUIRE(_dependencyMap[16]).MatomoConfig)(this.pSetup, this.originalMachine); + _context.next = 386; + return _regenerator.default.awrap(this.matomoConfig.init(json, this.googleAnalyticsCustomDimensions)); + + case 386: + _context.next = 388; + return _regenerator.default.awrap(this.getValue(keys.matomo_tracker.enabled)); + + case 388: + _context.t63 = _context.sent; + + if (_context.t63) { + _context.next = 391; + break; + } + + _context.t63 = "0"; + + case 391: + _context.t64 = _context.t63; + this.matomoTrackerEnabled = _context.t64 === "1"; + + if (!this.matomoTrackerEnabled) { + _context.next = 397; + break; + } + + this.matomoTrackerConfig = new (_$$_REQUIRE(_dependencyMap[17]).MatomoTrackerConfig)(this.pSetup, this.originalMachine); + _context.next = 397; + return _regenerator.default.awrap(this.matomoTrackerConfig.init(json)); + + case 397: + _context.next = 399; + return _regenerator.default.awrap(this.getValue(keys.facebook_enabled)); + + case 399: + _context.t65 = _context.sent; + + if (_context.t65) { + _context.next = 402; + break; + } + + _context.t65 = ""; + + case 402: + facebookEnabled = _context.t65; + this.facebookEnabled = facebookEnabled && facebookEnabled !== "0"; + _context.next = 406; + return _regenerator.default.awrap(this.getValue(keys.default_connectivity)); + + case 406: + this.defaultConnectivity = _context.sent; + _context.next = 409; + return _regenerator.default.awrap(this.getValue(keys.default_connectivity_timestamp)); + + case 409: + _context.t66 = _context.sent; + + if (_context.t66) { + _context.next = 412; + break; + } + + _context.t66 = ""; + + case 412: + this.defaultConnectivityTimestamp = _context.t66; + _context.next = 415; + return _regenerator.default.awrap(this.getValue(keys.url_type)); + + case 415: + _context.t67 = _context.sent; + + if (_context.t67) { + _context.next = 418; + break; + } + + _context.t67 = URL_TYPES.UNDERLINE; + + case 418: + this.urlType = _context.t67; + _context.next = 421; + return _regenerator.default.awrap(this.getValue(keys.relabel_fit_page_button)); + + case 421: + _context.t68 = _context.sent; + _context.next = 424; + return _regenerator.default.awrap(this.getValue(keys.relabel_offline_button)); + + case 424: + _context.t69 = _context.sent; + _context.next = 427; + return _regenerator.default.awrap(this.getValue(keys.relabel_help_button)); + + case 427: + _context.t70 = _context.sent; + _context.next = 430; + return _regenerator.default.awrap(this.getValue(keys.relabel_setting_button)); + + case 430: + _context.t71 = _context.sent; + _context.next = 433; + return _regenerator.default.awrap(this.getValue(keys.relabel_option_button)); + + case 433: + _context.t72 = _context.sent; + _context.next = 436; + return _regenerator.default.awrap(this.getValue(keys.relabel_special_sections_button)); + + case 436: + _context.t73 = _context.sent; + _context.next = 439; + return _regenerator.default.awrap(this.getValue(keys.relabel_search_button)); + + case 439: + _context.t74 = _context.sent; + _context.next = 442; + return _regenerator.default.awrap(this.getValue(keys.relabel_ebook_button)); + + case 442: + _context.t75 = _context.sent; + _context.next = 445; + return _regenerator.default.awrap(this.getValue(keys.relabel_gbook_button)); + + case 445: + _context.t76 = _context.sent; + _context.next = 448; + return _regenerator.default.awrap(this.getValue(keys.relabel_phodir_button)); + + case 448: + _context.t77 = _context.sent; + _context.next = 451; + return _regenerator.default.awrap(this.getValue(keys.relabel_feed_button)); + + case 451: + _context.t78 = _context.sent; + this.relabel = { + fitPageButton: _context.t68, + downloadButton: _context.t69, + helpButton: _context.t70, + settingsButton: _context.t71, + editionsButton: _context.t72, + specialSectionButton: _context.t73, + searchButton: _context.t74, + indexButton: _context.t75, + gBookButton: _context.t76, + thumbnailButton: _context.t77, + feedButton: _context.t78 + }; + _context.t80 = parseInt; + _context.next = 456; + return _regenerator.default.awrap(this.getValue(keys.default_max_issues)); + + case 456: + _context.t81 = _context.sent; + _context.t79 = (0, _context.t80)(_context.t81, 10); + + if (_context.t79) { + _context.next = 460; + break; + } + + _context.t79 = 30; + + case 460: + this.defaultMaxIssues = _context.t79; + _context.next = 463; + return _regenerator.default.awrap(this.getValue(keys.date_format)); + + case 463: + this.dateFormat = _context.sent; + _context.next = 466; + return _regenerator.default.awrap(this.getValue(keys.show_week)); + + case 466: + _context.t82 = _context.sent; + this.showWeekAfterDate = _context.t82 === "1"; + _context.next = 470; + return _regenerator.default.awrap(this.getValue(keys.download_multi_zips)); + + case 470: + _context.t83 = _context.sent; + this.downloadMultiZips = _context.t83 === "1"; + _context.next = 474; + return _regenerator.default.awrap(this.getValue(keys.show_types_article)); + + case 474: + _context.t84 = _context.sent; + + if (_context.t84) { + _context.next = 477; + break; + } + + _context.t84 = SHOW_TYPES_ARTICLE.TEXT_AND_GRAPH; + + case 477: + this.showTypesArticle = _context.t84; + _context.next = 480; + return _regenerator.default.awrap(this.getValue(keys.enable_article_extra)); + + case 480: + _context.t85 = _context.sent; + + if (_context.t85) { + _context.next = 483; + break; + } + + _context.t85 = "0"; + + case 483: + _context.t86 = _context.t85; + this.enableArticleExtra = _context.t86 === "1"; + _context.t88 = parseInt; + _context.next = 488; + return _regenerator.default.awrap(this.getValue(keys.max_zips_to_download_per_request)); + + case 488: + _context.t89 = _context.sent; + _context.t87 = (0, _context.t88)(_context.t89, 10); + + if (_context.t87) { + _context.next = 492; + break; + } + + _context.t87 = 10; + + case 492: + this.maxZipsToDownloadEachRequest = _context.t87; + this.cssFilesToAdd = defaultCustomCSSFilename; + _context.next = 496; + return _regenerator.default.awrap(this.getValue(keys.css_files_to_add)); + + case 496: + otherCSSFiles = _context.sent; + + if (otherCSSFiles) { + this.cssFilesToAdd += "," + otherCSSFiles; + } + + _context.next = 500; + return _regenerator.default.awrap(this.getValue(keys.email_content)); + + case 500: + this.emailContent = _context.sent; + _context.next = 503; + return _regenerator.default.awrap(this.getValue(keys.email_subject)); + + case 503: + this.emailSubject = _context.sent; + _context.next = 506; + return _regenerator.default.awrap(this.getValue(keys.twitter_text)); + + case 506: + this.twitterText = _context.sent; + _context.t91 = parseInt; + _context.next = 510; + return _regenerator.default.awrap(this.getValue(keys.update_db_percentage)); + + case 510: + _context.t92 = _context.sent; + _context.t90 = (0, _context.t91)(_context.t92, 10); + + if (_context.t90) { + _context.next = 514; + break; + } + + _context.t90 = 50; + + case 514: + this.updateDBPercentage = _context.t90; + _context.next = 517; + return _regenerator.default.awrap(this.getValue(keys.enable_advanced_gestures_mode)); + + case 517: + _context.t93 = _context.sent; + + if (_context.t93) { + _context.next = 520; + break; + } + + _context.t93 = "1"; + + case 520: + _context.t94 = _context.t93; + this.enableAdvancedGesturesMode = _context.t94 === "1"; + + if (!this.enableAdvancedGesturesMode) { + _context.next = 543; + break; + } + + _context.next = 525; + return _regenerator.default.awrap(this.getValue(keys.two_fingers_tap_to_article)); + + case 525: + _context.t95 = _context.sent; + + if (_context.t95) { + _context.next = 528; + break; + } + + _context.t95 = "0"; + + case 528: + _context.t96 = _context.t95; + this.twoFingersTapToArticle = _context.t96 === "1"; + + if (!this.twoFingersTapToArticle) { + _context.next = 540; + break; + } + + _context.next = 533; + return _regenerator.default.awrap(this.getValue(keys.single_tap_to_zoom)); + + case 533: + _context.t97 = _context.sent; + + if (_context.t97) { + _context.next = 536; + break; + } + + _context.t97 = "1"; + + case 536: + _context.t98 = _context.t97; + this.singleTapToZoom = _context.t98 === "1"; + _context.next = 541; + break; + + case 540: + this.singleTapToZoom = false; + + case 541: + _context.next = 545; + break; + + case 543: + this.twoFingersTapToArticle = true; + this.singleTapToZoom = true; + + case 545: + _context.next = 547; + return _regenerator.default.awrap(this.getValue(keys.machine_for_hr)); + + case 547: + _context.t99 = _context.sent; + + if (_context.t99) { + _context.next = 550; + break; + } + + _context.t99 = this.machine; + + case 550: + this.machineForHR = _context.t99; + _context.next = 553; + return _regenerator.default.awrap(this.getValue(keys.translation_available)); + + case 553: + _context.t100 = _context.sent; + this.translationAvailable = _context.t100 === "1"; + _context.next = 557; + return _regenerator.default.awrap(this.getValue(keys.translation_server)); + + case 557: + _context.t101 = _context.sent; + + if (_context.t101) { + _context.next = 560; + break; + } + + _context.t101 = ""; + + case 560: + this.translationServer = _context.t101; + _context.next = 563; + return _regenerator.default.awrap(this.getValue(keys.use_native_accessibility)); + + case 563: + _context.t103 = _context.sent; + + if (_context.t103) { + _context.next = 566; + break; + } + + _context.t103 = "0"; + + case 566: + _context.t104 = _context.t103; + _context.t102 = _context.t104 === "1"; + + if (_context.t102) { + _context.next = 570; + break; + } + + _context.t102 = global.isDebug; + + case 570: + this.useNativeAccessibility = _context.t102; + _context.next = 573; + return _regenerator.default.awrap(this.getValue(keys.use_car_mode)); + + case 573: + _context.t106 = _context.sent; + + if (_context.t106) { + _context.next = 576; + break; + } + + _context.t106 = "0"; + + case 576: + _context.t107 = _context.t106; + _context.t105 = _context.t107 === "1"; + + if (_context.t105) { + _context.next = 580; + break; + } + + _context.t105 = global.isDebug; + + case 580: + this.useCarMode = _context.t105; + _context.next = 583; + return _regenerator.default.awrap(this.getValue(keys.show_native_options_page_fallback_url)); + + case 583: + this.showNativeOptionsPageFallbackUrl = _context.sent; + _context.next = 586; + return _regenerator.default.awrap(this.getValue(keys.show_native_options_page)); + + case 586: + _context.t108 = _context.sent; + + if (_context.t108) { + _context.next = 589; + break; + } + + _context.t108 = "0"; + + case 589: + _context.t109 = _context.t108; + this.showNativeOptionsPage = _context.t109 === "1"; + _context.next = 593; + return _regenerator.default.awrap(this.getValue(keys.show_native_settings_screen)); + + case 593: + _context.t111 = _context.sent; + + if (_context.t111) { + _context.next = 596; + break; + } + + _context.t111 = "0"; + + case 596: + _context.t112 = _context.t111; + _context.t110 = _context.t112 === "1"; + + if (_context.t110) { + _context.next = 600; + break; + } + + _context.t110 = global.isDebug; + + case 600: + this.showNativeSettingsScreen = _context.t110; + _context.next = 603; + return _regenerator.default.awrap(this.getValue(keys.enable_translation_customization)); + + case 603: + _context.t113 = _context.sent; + + if (_context.t113) { + _context.next = 606; + break; + } + + _context.t113 = "1"; + + case 606: + _context.t114 = _context.t113; + this.showTranslationCustomization = _context.t114 === "1"; + _context.next = 610; + return _regenerator.default.awrap(this.getValue(keys.show_themes_customization)); + + case 610: + _context.t115 = _context.sent; + + if (_context.t115) { + _context.next = 613; + break; + } + + _context.t115 = "1"; + + case 613: + _context.t116 = _context.t115; + this.showThemesCustomization = _context.t116 === "1"; + _context.next = 617; + return _regenerator.default.awrap(this.getValue(keys.enable_zoom_level_customization)); + + case 617: + _context.t117 = _context.sent; + + if (_context.t117) { + _context.next = 620; + break; + } + + _context.t117 = "1"; + + case 620: + _context.t118 = _context.t117; + this.enableZoomLevelCustomization = _context.t118 === "1"; + _context.next = 624; + return _regenerator.default.awrap(this.getValue(keys.enable_article_types_customization)); + + case 624: + _context.t119 = _context.sent; + + if (_context.t119) { + _context.next = 627; + break; + } + + _context.t119 = "1"; + + case 627: + _context.t120 = _context.t119; + this.enableArticleTypesCustomization = _context.t120 === "1"; + _context.next = 631; + return _regenerator.default.awrap(this.getValue(keys.show_article_column_view_customization)); + + case 631: + _context.t121 = _context.sent; + + if (_context.t121) { + _context.next = 634; + break; + } + + _context.t121 = "1"; + + case 634: + _context.t122 = _context.t121; + this.showArticleColumnViewCustomization = _context.t122 === "1"; + _context.next = 638; + return _regenerator.default.awrap(this.getValue(keys.show_navigation_buttons_layout_customization)); + + case 638: + _context.t123 = _context.sent; + + if (_context.t123) { + _context.next = 641; + break; + } + + _context.t123 = "1"; + + case 641: + _context.t124 = _context.t123; + this.showNavigationButtonsLayoutCustomization = _context.t124 === "1"; + _context.next = 645; + return _regenerator.default.awrap(this.getValue(keys.show_xpaper_navigation_close_button)); + + case 645: + _context.t125 = _context.sent; + + if (_context.t125) { + _context.next = 648; + break; + } + + _context.t125 = "0"; + + case 648: + _context.t126 = _context.t125; + this.showXPaperNavigationCloseButton = _context.t126 === "1"; + _context.next = 652; + return _regenerator.default.awrap(this.getValue(keys.show_highlight_behavior_customization)); + + case 652: + _context.t127 = _context.sent; + + if (_context.t127) { + _context.next = 655; + break; + } + + _context.t127 = "1"; + + case 655: + _context.t128 = _context.t127; + this.showHighlightBehaviorCustomization = _context.t128 === "1"; + _context.next = 659; + return _regenerator.default.awrap(this.getValue(keys.change_favorite_edition)); + + case 659: + _context.t129 = _context.sent; + + if (_context.t129) { + _context.next = 662; + break; + } + + _context.t129 = "0"; + + case 662: + _context.t130 = _context.t129; + this.changeFavoriteEdition = _context.t130 === "1"; + _context.next = 666; + return _regenerator.default.awrap(this.getValue(keys.favorite_edition)); + + case 666: + _context.t131 = _context.sent; + + if (_context.t131) { + _context.next = 669; + break; + } + + _context.t131 = ""; + + case 669: + this.favoriteEdition = _context.t131; + _context.next = 672; + return _regenerator.default.awrap(this.getValue(keys.enable_connectivity_options)); + + case 672: + _context.t132 = _context.sent; + + if (_context.t132) { + _context.next = 675; + break; + } + + _context.t132 = "1"; + + case 675: + _context.t133 = _context.t132; + this.enableConnectivityOptions = _context.t133 === "1"; + _context.next = 679; + return _regenerator.default.awrap(this.getValue(keys.enable_font_size_customization)); + + case 679: + _context.t134 = _context.sent; + + if (_context.t134) { + _context.next = 682; + break; + } + + _context.t134 = "1"; + + case 682: + _context.t135 = _context.t134; + this.enableFontSizeCustomization = _context.t135 === "1"; + _context.next = 686; + return _regenerator.default.awrap(this.getValue(keys.enable_graph_size_customization)); + + case 686: + _context.t136 = _context.sent; + + if (_context.t136) { + _context.next = 689; + break; + } + + _context.t136 = "1"; + + case 689: + _context.t137 = _context.t136; + this.enableGraphSizeCustomization = _context.t137 === "1"; + _context.t138 = parseInt; + _context.next = 694; + return _regenerator.default.awrap(this.getValue(keys.fit_graphic_article)); + + case 694: + _context.t139 = _context.sent; + + if (_context.t139) { + _context.next = 697; + break; + } + + _context.t139 = "1"; + + case 697: + _context.t140 = _context.t139; + this.fitGraphicArticle = (0, _context.t138)(_context.t140, 10); + _context.next = 701; + return _regenerator.default.awrap(this.getValue(keys.sub_path)); + + case 701: + this.subPath = _context.sent; + _context.next = 704; + return _regenerator.default.awrap(this.getValue(keys.extra_link_color)); + + case 704: + _context.t141 = _context.sent; + + if (_context.t141) { + _context.next = 707; + break; + } + + _context.t141 = "255,0,0,0.25"; + + case 707: + this.extraLinkColor = _context.t141; + _context.t142 = parseInt; + _context.next = 711; + return _regenerator.default.awrap(this.getValue(keys.background_duration_article_selected)); + + case 711: + _context.t143 = _context.sent; + bgDurationTemp = (0, _context.t142)(_context.t143, 10); + this.backgroundDurationArticleSelected = _$$_REQUIRE(_dependencyMap[11]).JSUtils.isNumber(bgDurationTemp) ? bgDurationTemp : _$$_REQUIRE(_dependencyMap[18]).HIDE_ANIMATION_DURATION; + _context.t144 = parseInt; + _context.next = 717; + return _regenerator.default.awrap(this.getValue(keys.background_timer_article_selected)); + + case 717: + _context.t145 = _context.sent; + bgTimerTemp = (0, _context.t144)(_context.t145, 10); + this.backgroundTimerArticleSelected = _$$_REQUIRE(_dependencyMap[11]).JSUtils.isNumber(bgTimerTemp) ? bgTimerTemp : _$$_REQUIRE(_dependencyMap[18]).HIDE_ANIMATION_TIMER; + _context.next = 722; + return _regenerator.default.awrap(this.getValue(keys.background_color_article.selected)); + + case 722: + _context.t146 = _context.sent; + + if (_context.t146) { + _context.next = 725; + break; + } + + _context.t146 = "255,0,0,0.25"; + + case 725: + this.backgroundColorArticleSelected = _context.t146; + _context.next = 728; + return _regenerator.default.awrap(this.getValue(keys.background_color_article.to_select)); + + case 728: + _context.t147 = _context.sent; + + if (_context.t147) { + _context.next = 731; + break; + } + + _context.t147 = this.backgroundColorArticleSelected; + + case 731: + this.backgroundColorArticleToSelect = _context.t147; + _context.next = 734; + return _regenerator.default.awrap(this.getValue(keys.preview_highlight_enabled)); + + case 734: + _context.t148 = _context.sent; + + if (_context.t148) { + _context.next = 737; + break; + } + + _context.t148 = "0"; + + case 737: + _context.t149 = _context.t148; + this.previewHighlightEnabled = _context.t149 === "1"; + _context.t150 = parseInt; + _context.next = 742; + return _regenerator.default.awrap(this.getValue(keys.preview_highlight_duration_seconds)); + + case 742: + _context.t151 = _context.sent; + + if (_context.t151) { + _context.next = 745; + break; + } + + _context.t151 = "2"; + + case 745: + _context.t152 = _context.t151; + this.previewHighlightDurationSeconds = (0, _context.t150)(_context.t152, 10); + _context.t153 = parseInt; + _context.next = 750; + return _regenerator.default.awrap(this.getValue(keys.zooming_factor)); + + case 750: + _context.t154 = _context.sent; + this.zoomingFactor = (0, _context.t153)(_context.t154, 10); + this.zoomingFactor = this.zoomingFactor <= 0 ? 100 : this.zoomingFactor; + _context.t155 = parseInt; + _context.next = 756; + return _regenerator.default.awrap(this.getValue(keys.max_zoom)); + + case 756: + _context.t156 = _context.sent; + + if (_context.t156) { + _context.next = 759; + break; + } + + _context.t156 = "5"; + + case 759: + _context.t157 = _context.t156; + this.maxZoom = (0, _context.t155)(_context.t157, 10); + _context.t158 = parseFloat; + _context.next = 764; + return _regenerator.default.awrap(this.getValue(keys.pdf_thumbnail_ratio)); + + case 764: + _context.t159 = _context.sent; + + if (_context.t159) { + _context.next = 767; + break; + } + + _context.t159 = "0.5"; + + case 767: + _context.t160 = _context.t159; + this.pdfThumbnailRatio = (0, _context.t158)(_context.t160); + _context.t161 = parseFloat; + _context.next = 772; + return _regenerator.default.awrap(this.getValue(keys.eink_complete_hr_factor)); + + case 772: + _context.t162 = _context.sent; + + if (_context.t162) { + _context.next = 775; + break; + } + + _context.t162 = "2.2"; + + case 775: + _context.t163 = _context.t162; + this.einkCompleteHrFactor = (0, _context.t161)(_context.t163); + _context.t164 = parseInt; + _context.next = 780; + return _regenerator.default.awrap(this.getValue(keys.hr_factor)); + + case 780: + _context.t165 = _context.sent; + + if (_context.t165) { + _context.next = 783; + break; + } + + _context.t165 = "1"; + + case 783: + _context.t166 = _context.t165; + this.hrFactor = (0, _context.t164)(_context.t166, 10); + _context.t167 = parseFloat; + _context.next = 788; + return _regenerator.default.awrap(this.getValue(keys.pdf_factor)); + + case 788: + _context.t168 = _context.sent; + + if (_context.t168) { + _context.next = 791; + break; + } + + _context.t168 = "1.2"; + + case 791: + _context.t169 = _context.t168; + this.pdfFactor = (0, _context.t167)(_context.t169); + _context.t170 = parseFloat; + _context.next = 796; + return _regenerator.default.awrap(this.getValue(keys.pdf_factor_landscape)); + + case 796: + _context.t171 = _context.sent; + + if (_context.t171) { + _context.next = 799; + break; + } + + _context.t171 = "1"; + + case 799: + _context.t172 = _context.t171; + this.pdfFactorLandscape = (0, _context.t170)(_context.t172); + _context.t173 = parseInt; + _context.next = 804; + return _regenerator.default.awrap(this.getValue(keys.low_pages_to_render)); + + case 804: + _context.t174 = _context.sent; + + if (_context.t174) { + _context.next = 807; + break; + } + + _context.t174 = "1"; + + case 807: + _context.t175 = _context.t174; + this.lowPagesToRender = (0, _context.t173)(_context.t175, 10); + _context.t176 = parseInt; + _context.next = 812; + return _regenerator.default.awrap(this.getValue(keys.mid_pages_to_render)); + + case 812: + _context.t177 = _context.sent; + + if (_context.t177) { + _context.next = 815; + break; + } + + _context.t177 = "1"; + + case 815: + _context.t178 = _context.t177; + this.midPagesToRender = (0, _context.t176)(_context.t178, 10); + _context.next = 819; + return _regenerator.default.awrap(this.getValue(keys.load_mid_res_on_scroll)); + + case 819: + _context.t179 = _context.sent; + + if (_context.t179) { + _context.next = 822; + break; + } + + _context.t179 = "1"; + + case 822: + _context.t180 = _context.t179; + this.loadMidResOnScroll = _context.t180 === "1"; + _context.next = 826; + return _regenerator.default.awrap(this.getValue(keys.enable_article_text_selection)); + + case 826: + _context.t181 = _context.sent; + this.enableArticleTextSelection = _context.t181 === "1"; + _context.next = 830; + return _regenerator.default.awrap(this.getValue(keys.show_edition_thumbs)); + + case 830: + _context.t182 = _context.sent; + this.showEditionThumbs = _context.t182 === "1"; + + if (!_$$_REQUIRE(_dependencyMap[11]).PlatformUtils.isTablet()) { + _context.next = 838; + break; + } + + _context.next = 835; + return _regenerator.default.awrap(this.getValue(keys.scroll_tiles)); + + case 835: + _context.t183 = _context.sent; + _context.next = 841; + break; + + case 838: + _context.next = 840; + return _regenerator.default.awrap(this.getValue(keys.scroll_tiles_phone)); + + case 840: + _context.t183 = _context.sent; + + case 841: + this.scrollTiles = _context.t183; + this.scrollTiles = parseInt(this.scrollTiles, 10); + _context.next = 845; + return _regenerator.default.awrap(this.getValue(keys.on_login_error_go_to)); + + case 845: + _context.t184 = _context.sent; + + if (_context.t184) { + _context.next = 848; + break; + } + + _context.t184 = _$$_REQUIRE(_dependencyMap[19]).tabs.home; + + case 848: + this.onLoginErrorGoTo = _context.t184; + _context.next = 851; + return _regenerator.default.awrap(this.getValue(keys.on_validation_error_go_to)); + + case 851: + _context.t185 = _context.sent; + + if (_context.t185) { + _context.next = 854; + break; + } + + _context.t185 = _$$_REQUIRE(_dependencyMap[19]).tabs.login; + + case 854: + this.onValidationErrorGoTo = _context.t185; + _context.t187 = parseInt; + _context.next = 858; + return _regenerator.default.awrap(this.getValue(keys.time_limit_check_edition)); + + case 858: + _context.t188 = _context.sent; + _context.t186 = (0, _context.t187)(_context.t188, 10); + + if (_context.t186) { + _context.next = 862; + break; + } + + _context.t186 = 10; + + case 862: + _context.t189 = _context.t186; + _context.t190 = _context.t189 * 60; + this.timeLimitCheckEdition = _context.t190 * 1000; + _context.t192 = parseInt; + _context.next = 868; + return _regenerator.default.awrap(this.getValue(keys.latest_edition_available_message_format)); + + case 868: + _context.t193 = _context.sent; + _context.t191 = (0, _context.t192)(_context.t193, 10); + + if (_context.t191) { + _context.next = 872; + break; + } + + _context.t191 = LATEST_AVAILABLE_EDITION_FORMAT.ISSUE_AND_EDITION; + + case 872: + this.latestEditionAvailableMessageFormat = _context.t191; + _context.t195 = parseInt; + _context.next = 876; + return _regenerator.default.awrap(this.getValue(keys.time_limit_check_login)); + + case 876: + _context.t196 = _context.sent; + _context.t194 = (0, _context.t195)(_context.t196, 10); + + if (_context.t194) { + _context.next = 880; + break; + } + + _context.t194 = 7200; + + case 880: + _context.t197 = _context.t194; + this.timeLimitCheckLogin = _context.t197 * 1000; + _context.t199 = parseInt; + _context.next = 885; + return _regenerator.default.awrap(this.getValue(keys.time_limit_forget_login)); + + case 885: + _context.t200 = _context.sent; + _context.t198 = (0, _context.t199)(_context.t200, 10); + + if (_context.t198) { + _context.next = 889; + break; + } + + _context.t198 = 120; + + case 889: + _context.t201 = _context.t198; + _context.t202 = _context.t201 * 60; + this.timeLimitForgetLogin = _context.t202 * 1000; + _context.next = 894; + return _regenerator.default.awrap(this.getValue(keys.last_pSetup)); + + case 894: + _context.t203 = _context.sent; + + if (_context.t203) { + _context.next = 897; + break; + } + + _context.t203 = this.pSetup; + + case 897: + this.lastPSetup = _context.t203; + _context.next = 900; + return _regenerator.default.awrap(this.getValue(keys.last_issue)); + + case 900: + this.lastIssue = _context.sent; + _context.next = 903; + return _regenerator.default.awrap(this.getValue(keys.last_edition)); + + case 903: + this.lastEdition = _context.sent; + _context.next = 906; + return _regenerator.default.awrap(this.getValue(keys.demo_issue)); + + case 906: + this.demoIssue = _context.sent; + _context.next = 909; + return _regenerator.default.awrap(this.getValue(keys.force_article_mode_fullscreen_portrait)); + + case 909: + _context.t204 = _context.sent; + + if (_context.t204) { + _context.next = 912; + break; + } + + _context.t204 = "0"; + + case 912: + this.articleModeDefaultFullscreenPortrait = _context.t204; + _context.next = 915; + return _regenerator.default.awrap(this.getValue(keys.force_article_mode_fullscreen_landscape)); + + case 915: + _context.t205 = _context.sent; + + if (_context.t205) { + _context.next = 918; + break; + } + + _context.t205 = "0"; + + case 918: + this.articleModeDefaultFullscreenLandscape = _context.t205; + _context.t206 = parseInt; + _context.next = 922; + return _regenerator.default.awrap(this.getValue(keys.enable_text_to_speech)); + + case 922: + _context.t207 = _context.sent; + + if (_context.t207) { + _context.next = 925; + break; + } + + _context.t207 = "1"; + + case 925: + _context.t208 = _context.t207; + _context.t209 = (0, _context.t206)(_context.t208, 10); + this.enableTextToSpeech = _context.t209 === 1; + _context.t210 = parseInt; + _context.next = 931; + return _regenerator.default.awrap(this.getValue(keys.enable_text_to_speech_player)); + + case 931: + _context.t211 = _context.sent; + + if (_context.t211) { + _context.next = 934; + break; + } + + _context.t211 = "0"; + + case 934: + _context.t212 = _context.t211; + _context.t213 = (0, _context.t210)(_context.t212, 10); + this.enableTextToSpeechPlayer = _context.t213 === 1; + _context.t215 = parseFloat; + _context.next = 940; + return _regenerator.default.awrap(this.getValue(keys.text_to_speech_rate)); + + case 940: + _context.t216 = _context.sent; + _context.t214 = (0, _context.t215)(_context.t216); + + if (_context.t214) { + _context.next = 944; + break; + } + + _context.t214 = 0; + + case 944: + this.textToSpeechRate = _context.t214; + _context.t218 = parseInt; + _context.next = 948; + return _regenerator.default.awrap(this.getValue(keys.text_to_speech_chunk_length)); + + case 948: + _context.t219 = _context.sent; + _context.t217 = (0, _context.t218)(_context.t219, 10); + + if (_context.t217) { + _context.next = 952; + break; + } + + _context.t217 = 1000; + + case 952: + this.textToSpeechChunkLength = _context.t217; + _context.t221 = parseInt; + _context.next = 956; + return _regenerator.default.awrap(this.getValue(keys.low_speed_limit)); + + case 956: + _context.t222 = _context.sent; + _context.t220 = (0, _context.t221)(_context.t222, 10); + + if (_context.t220) { + _context.next = 960; + break; + } + + _context.t220 = 250; + + case 960: + this.lowSpeedLimit = _context.t220; + _context.t223 = parseInt; + _context.next = 964; + return _regenerator.default.awrap(this.getValue(keys.disable_low_speed_limit)); + + case 964: + _context.t224 = _context.sent; + + if (_context.t224) { + _context.next = 967; + break; + } + + _context.t224 = "0"; + + case 967: + _context.t225 = _context.t224; + _context.t226 = (0, _context.t223)(_context.t225, 10); + this.disableLowSpeedLimit = _context.t226 === 1; + _context.next = 972; + return _regenerator.default.awrap(this.getValue(keys.base_iap_api_url)); + + case 972: + this.baseInAppPurchaseAPIUrl = _context.sent; + _context.next = 975; + return _regenerator.default.awrap(this.getValue(keys.all_skus)); + + case 975: + this.allAndroidSkus = _context.sent; + _context.t227 = parseInt; + _context.next = 979; + return _regenerator.default.awrap(this.getValue(keys.is_nnb)); + + case 979: + _context.t228 = _context.sent; + _context.t229 = (0, _context.t227)(_context.t228, 10); + this.isNNB = _context.t229 === 1; + _context.t230 = parseInt; + _context.next = 985; + return _regenerator.default.awrap(this.getValue(keys.enable_vmode_and_fit_orientation)); + + case 985: + _context.t231 = _context.sent; + + if (_context.t231) { + _context.next = 988; + break; + } + + _context.t231 = "1"; + + case 988: + _context.t232 = _context.t231; + _context.t233 = (0, _context.t230)(_context.t232, 10); + this.enableVmodeAndFitOrientation = _context.t233 === 1; + _context.t234 = parseInt; + _context.next = 994; + return _regenerator.default.awrap(this.getValue(keys.fit_page_type)); + + case 994: + _context.t235 = _context.sent; + + if (_context.t235) { + _context.next = 997; + break; + } + + _context.t235 = this.enableVmodeAndFitOrientation ? "7" : "6"; + + case 997: + _context.t236 = _context.t235; + this.fitPageType = (0, _context.t234)(_context.t236, 10); + _context.next = 1001; + return _regenerator.default.awrap(this.getValue(keys.start_in_index_mode)); + + case 1001: + _context.t237 = _context.sent; + + if (_context.t237) { + _context.next = 1004; + break; + } + + _context.t237 = "0"; + + case 1004: + this.startInIndexMode = _context.t237; + _context.next = 1007; + return _regenerator.default.awrap(this.getValue(keys.epaper_start_mode)); + + case 1007: + _context.t238 = _context.sent; + + if (_context.t238) { + _context.next = 1010; + break; + } + + _context.t238 = NEWSMEMORY_START_MODE.READ; + + case 1010: + this.epaperStartMode = _context.t238; + _context.next = 1013; + return _regenerator.default.awrap(this.getValue(keys.disable_epaper_mode_selection_page)); + + case 1013: + _context.t239 = _context.sent; + + if (_context.t239) { + _context.next = 1016; + break; + } + + _context.t239 = "0"; + + case 1016: + _context.t240 = _context.t239; + this.disableEPaperModeSelectionPage = _context.t240 === "1"; + _context.next = 1020; + return _regenerator.default.awrap(this.getValue(keys.cdn_enabled)); + + case 1020: + _context.t241 = _context.sent; + + if (_context.t241) { + _context.next = 1023; + break; + } + + _context.t241 = "1"; + + case 1023: + _context.t242 = _context.t241; + this.cdnEnabled = _context.t242 === "1"; + _context.next = 1027; + return _regenerator.default.awrap(this.getValue(keys.cdn_server)); + + case 1027: + this.cdnServer = _context.sent; + _context.next = 1030; + return _regenerator.default.awrap(this.getValue(keys.disable_rn_demo)); + + case 1030: + _context.t243 = _context.sent; + + if (_context.t243) { + _context.next = 1033; + break; + } + + _context.t243 = "0"; + + case 1033: + _context.t244 = _context.t243; + this.disableRnDemo = _context.t244 === "1"; + _context.next = 1037; + return _regenerator.default.awrap(this.getValue(keys.landing_page_url)); + + case 1037: + this.landingPageURL = _context.sent; + _context.t246 = parseInt; + _context.next = 1041; + return _regenerator.default.awrap(this.getValue(keys.landing_page_version)); + + case 1041: + _context.t247 = _context.sent; + _context.t245 = (0, _context.t246)(_context.t247, 10); + + if (_context.t245) { + _context.next = 1045; + break; + } + + _context.t245 = 0; + + case 1045: + this.landingPageVersion = _context.t245; + _context.next = 1048; + return _regenerator.default.awrap(this.getValue(keys.show_landing_page_once)); + + case 1048: + _context.t248 = _context.sent; + this.showLandingPageOnce = _context.t248 === "1"; + _context.next = 1052; + return _regenerator.default.awrap(this.getValue(keys.forced_shared_secret)); + + case 1052: + this.forcedSharedSecret = _context.sent; + _context.next = 1055; + return _regenerator.default.awrap(this.getValue(keys.use_ios_sandbox_receipt_validation)); + + case 1055: + _context.t249 = _context.sent; + this.useIOSSandboxReceiptValidation = _context.t249 === "1"; + _context.t250 = parseInt; + _context.next = 1060; + return _regenerator.default.awrap(this.getValue(keys.use_cc)); + + case 1060: + _context.t251 = _context.sent; + + if (_context.t251) { + _context.next = 1063; + break; + } + + _context.t251 = ENCRYPT_FILENAME_TYPE.NONE; + + case 1063: + _context.t252 = _context.t251; + this.encryptFilenames = (0, _context.t250)(_context.t252, 10); + _context.next = 1067; + return _regenerator.default.awrap(this.getValue(keys.migrate)); + + case 1067: + _context.t253 = _context.sent; + + if (_context.t253) { + _context.next = 1070; + break; + } + + _context.t253 = "0"; + + case 1070: + _context.t254 = _context.t253; + this.migrate = _context.t254 === "1"; + _context.next = 1074; + return _regenerator.default.awrap(this.getValue(keys.hybrid_version)); + + case 1074: + _context.t255 = _context.sent; + + if (_context.t255) { + _context.next = 1077; + break; + } + + _context.t255 = "0"; + + case 1077: + this.hybridVersion = _context.t255; + _context.t256 = parseInt; + _context.next = 1081; + return _regenerator.default.awrap(this.getValue(keys.append_first_pages)); + + case 1081: + _context.t257 = _context.sent; + + if (_context.t257) { + _context.next = 1084; + break; + } + + _context.t257 = "1"; + + case 1084: + _context.t258 = _context.t257; + _context.t259 = (0, _context.t256)(_context.t258, 10); + this.enableAppendFirstPages = _context.t259 === 1; + _context.t260 = parseFloat; + _context.next = 1090; + return _regenerator.default.awrap(this.getValue(keys.png_quality_factor)); + + case 1090: + _context.t261 = _context.sent; + + if (_context.t261) { + _context.next = 1093; + break; + } + + _context.t261 = "1.8"; + + case 1093: + _context.t262 = _context.t261; + this.pngQualityFactor = (0, _context.t260)(_context.t262); + _context.next = 1097; + return _regenerator.default.awrap(this.getValue(keys.generate_png_based_on_screen_dimensions)); + + case 1097: + _context.t263 = _context.sent; + + if (_context.t263) { + _context.next = 1100; + break; + } + + _context.t263 = "1"; + + case 1100: + _context.t264 = _context.t263; + this.generatePNGBasedOnScreenDimensions = _context.t264 === "1"; + _context.next = 1104; + return _regenerator.default.awrap(this.getValue(keys.consider_pixel_ratio_in_png_generation)); + + case 1104: + _context.t265 = _context.sent; + + if (_context.t265) { + _context.next = 1107; + break; + } + + _context.t265 = "1"; + + case 1107: + _context.t266 = _context.t265; + this.considerPixelRatioInPNGGeneration = _context.t266 === "1"; + _context.t267 = parseInt; + _context.next = 1112; + return _regenerator.default.awrap(this.getValue(keys.png_width_limit)); + + case 1112: + _context.t268 = _context.sent; + + if (_context.t268) { + _context.next = 1115; + break; + } + + _context.t268 = "1080"; + + case 1115: + _context.t269 = _context.t268; + this.pngWidthLimit = (0, _context.t267)(_context.t269, 10); + _context.next = 1119; + return _regenerator.default.awrap(this.getValue(keys.print_enabled)); + + case 1119: + _context.t270 = _context.sent; + + if (_context.t270) { + _context.next = 1122; + break; + } + + _context.t270 = "1"; + + case 1122: + _context.t271 = _context.t270; + this.enablePrint = _context.t271 === "1"; + _context.next = 1126; + return _regenerator.default.awrap(this.getValue(keys.print_to_letter)); + + case 1126: + _context.t272 = _context.sent; + + if (_context.t272) { + _context.next = 1129; + break; + } + + _context.t272 = "1"; + + case 1129: + _context.t273 = _context.t272; + this.printToLetter = _context.t273 === "1"; + _context.t274 = parseInt; + _context.next = 1134; + return _regenerator.default.awrap(this.getValue(keys.print_margin)); + + case 1134: + _context.t275 = _context.sent; + + if (_context.t275) { + _context.next = 1137; + break; + } + + _context.t275 = "10"; + + case 1137: + _context.t276 = _context.t275; + this.printMargin = (0, _context.t274)(_context.t276, 10); + _context.next = 1141; + return _regenerator.default.awrap(this.getValue(keys.generic_app_enabled)); + + case 1141: + _context.t277 = _context.sent; + + if (_context.t277) { + _context.next = 1144; + break; + } + + _context.t277 = "0"; + + case 1144: + _context.t278 = _context.t277; + this.isGenericApp = _context.t278 === "1"; + _context.next = 1148; + return _regenerator.default.awrap(this.getValue(keys.store_url)); + + case 1148: + _context.t279 = _context.sent; + + if (_context.t279) { + _context.next = 1151; + break; + } + + _context.t279 = ""; + + case 1151: + this.publicationsPageURL = _context.t279; + _context.next = 1154; + return _regenerator.default.awrap(this.getValue(keys.iap_active)); + + case 1154: + _context.t280 = _context.sent; + + if (_context.t280) { + _context.next = 1157; + break; + } + + _context.t280 = "0"; + + case 1157: + _context.t281 = _context.t280; + this.iapActive = _context.t281 === "1"; + _context.next = 1161; + return _regenerator.default.awrap(this.getValue(keys.payments)); + + case 1161: + _context.t282 = _context.sent; + + if (_context.t282) { + _context.next = 1164; + break; + } + + _context.t282 = "[]"; + + case 1164: + pSetupPaymentsString = _context.t282; + pSetupPaymentsArray = JSON.parse(pSetupPaymentsString); + this.payments = pSetupPaymentsArray.map(function (pSetupPayment) { + return new _Payment.default(pSetupPayment); + }); + _context.next = 1169; + return _regenerator.default.awrap(this.getValue(keys.enable_multiple_subscriptions_alert)); + + case 1169: + _context.t283 = _context.sent; + + if (_context.t283) { + _context.next = 1172; + break; + } + + _context.t283 = "1"; + + case 1172: + _context.t284 = _context.t283; + this.enableMultipleSubscriptionsAlert = _context.t284 === "1"; + _context.t285 = parseInt; + _context.next = 1177; + return _regenerator.default.awrap(this.getValue(keys.protect_site)); + + case 1177: + _context.t286 = _context.sent; + + if (_context.t286) { + _context.next = 1180; + break; + } + + _context.t286 = "0"; + + case 1180: + _context.t287 = _context.t286; + this.protectSite = (0, _context.t285)(_context.t287, 10); + _context.next = 1184; + return _regenerator.default.awrap(this.getValue(keys.pages_navigation_buttons_layout)); + + case 1184: + _context.t288 = _context.sent; + + if (_context.t288) { + _context.next = 1187; + break; + } + + _context.t288 = PAGES_NAVIGATION_BUTTONS_LAYOUT.FIXED; + + case 1187: + this.pagesNavigationButtonsLayout = _context.t288; + _context.next = 1190; + return _regenerator.default.awrap(this.getValue(keys.animate_layout_footer)); + + case 1190: + _context.t289 = _context.sent; + + if (_context.t289) { + _context.next = 1193; + break; + } + + _context.t289 = "0"; + + case 1193: + _context.t290 = _context.t289; + this.animateLayoutFooter = _context.t290 === "1"; + _context.next = 1197; + return _regenerator.default.awrap(this.getValue(keys.fix_buttons_bar_to_bottom)); + + case 1197: + _context.t292 = _context.sent; + + if (_context.t292) { + _context.next = 1200; + break; + } + + _context.t292 = "0"; + + case 1200: + _context.t293 = _context.t292; + _context.t291 = _context.t293 === "1"; + + if (!_context.t291) { + _context.next = 1204; + break; + } + + _context.t291 = _$$_REQUIRE(_dependencyMap[11]).PlatformUtils.isTablet(); + + case 1204: + this.fixButtonsBarToBottom = _context.t291; + _context.t295 = parseInt; + _context.next = 1208; + return _regenerator.default.awrap(this.getValue(keys.dfp_reload_time)); + + case 1208: + _context.t296 = _context.sent; + _context.t294 = (0, _context.t295)(_context.t296, 10); + + if (_context.t294) { + _context.next = 1212; + break; + } + + _context.t294 = 20000; + + case 1212: + this.dfpReloadTime = _context.t294; + _context.next = 1215; + return _regenerator.default.awrap(this.getValue(keys.two_fingers_tap_hint_enabled)); + + case 1215: + _context.t297 = _context.sent; + + if (_context.t297) { + _context.next = 1218; + break; + } + + _context.t297 = "1"; + + case 1218: + _context.t298 = _context.t297; + this.twoFingersTapHintEnabled = _context.t298 === "1"; + _context.t299 = parseInt; + _context.next = 1223; + return _regenerator.default.awrap(this.getValue(keys.two_fingers_tap_max_hints)); + + case 1223: + _context.t300 = _context.sent; + + if (_context.t300) { + _context.next = 1226; + break; + } + + _context.t300 = "5"; + + case 1226: + _context.t301 = _context.t300; + this.twoFingersTapMaxHints = (0, _context.t299)(_context.t301, 10); + _context.next = 1230; + return _regenerator.default.awrap(this.getValue(keys.enable_share)); + + case 1230: + _context.t302 = _context.sent; + + if (_context.t302) { + _context.next = 1233; + break; + } + + _context.t302 = "1"; + + case 1233: + _context.t303 = _context.t302; + this.enableShare = _context.t303 === "1"; + _context.t304 = parseInt; + _context.next = 1238; + return _regenerator.default.awrap(this.getValue(keys.max_shares)); + + case 1238: + _context.t305 = _context.sent; + + if (_context.t305) { + _context.next = 1241; + break; + } + + _context.t305 = "0"; + + case 1241: + _context.t306 = _context.t305; + this.maxShares = (0, _context.t304)(_context.t306, 10); + _context.t307 = parseInt; + _context.next = 1246; + return _regenerator.default.awrap(this.getValue(keys.max_shares_check_type)); + + case 1246: + _context.t308 = _context.sent; + + if (_context.t308) { + _context.next = 1249; + break; + } + + _context.t308 = "1"; + + case 1249: + _context.t309 = _context.t308; + this.maxSharesCheckType = (0, _context.t307)(_context.t309, 10); + _context.next = 1253; + return _regenerator.default.awrap(this.getValue(keys.message_max_share)); + + case 1253: + _context.t310 = _context.sent; + + if (_context.t310) { + _context.next = 1256; + break; + } + + _context.t310 = ""; + + case 1256: + this.messageMaxShare = _context.t310; + _context.next = 1259; + return _regenerator.default.awrap(this.getValue(keys.download_single_pdf)); + + case 1259: + _context.t311 = _context.sent; + + if (_context.t311) { + _context.next = 1262; + break; + } + + _context.t311 = "0"; + + case 1262: + _context.t312 = _context.t311; + this.downloadSinglePdf = _context.t312 === "1"; + _context.t313 = parseInt; + _context.next = 1267; + return _regenerator.default.awrap(this.getValue(keys.merge_articles)); + + case 1267: + _context.t314 = _context.sent; + + if (_context.t314) { + _context.next = 1270; + break; + } + + _context.t314 = MERGE_ARTICLES_TYPES.NORMAL; + + case 1270: + _context.t315 = _context.t314; + this.mergeArticles = (0, _context.t313)(_context.t315, 10); + _context.t316 = parseInt; + _context.next = 1275; + return _regenerator.default.awrap(this.getValue(keys.column_view)); + + case 1275: + _context.t317 = _context.sent; + + if (_context.t317) { + _context.next = 1278; + break; + } + + _context.t317 = "1"; + + case 1278: + _context.t318 = _context.t317; + this.columnView = (0, _context.t316)(_context.t318, 10); + _context.next = 1282; + return _regenerator.default.awrap(this.getValue(keys.enable_phone_article_layout_on_tablet_in_landscape)); + + case 1282: + _context.t319 = _context.sent; + + if (_context.t319) { + _context.next = 1285; + break; + } + + _context.t319 = "0"; + + case 1285: + _context.t320 = _context.t319; + this.enablePhoneArticleLayoutOnTabletInLandscape = _context.t320 === "1"; + _context.next = 1289; + return _regenerator.default.awrap(this.getValue(keys.enable_desktop_article_layout_on_ipad_pro_in_landscape)); + + case 1289: + _context.t321 = _context.sent; + + if (_context.t321) { + _context.next = 1292; + break; + } + + _context.t321 = "0"; + + case 1292: + _context.t322 = _context.t321; + this.enableDesktopArticleLayoutOnIPadProInLandscape = _context.t322 === "1"; + _context.next = 1296; + return _regenerator.default.awrap(this.getValue(keys.show_art_complete)); + + case 1296: + _context.t323 = _context.sent; + + if (_context.t323) { + _context.next = 1299; + break; + } + + _context.t323 = "0"; + + case 1299: + _context.t324 = _context.t323; + this.showArtComplete = _context.t324 === "1"; + _context.next = 1303; + return _regenerator.default.awrap(this.getValue(keys.calculate_mid_ads)); + + case 1303: + _context.t325 = _context.sent; + + if (_context.t325) { + _context.next = 1306; + break; + } + + _context.t325 = "0"; + + case 1306: + _context.t326 = _context.t325; + this.calculateMidAds = _context.t326 === "1"; + _context.next = 1310; + return _regenerator.default.awrap(this.getValue(keys.keep_article_position_on_rotation)); + + case 1310: + _context.t327 = _context.sent; + + if (_context.t327) { + _context.next = 1313; + break; + } + + _context.t327 = "0"; + + case 1313: + _context.t328 = _context.t327; + this.keepArticlePositionOnRotation = _context.t328 === "1"; + _context.next = 1317; + return _regenerator.default.awrap(this.getValue(keys.enable_article_image_reposition)); + + case 1317: + _context.t329 = _context.sent; + + if (_context.t329) { + _context.next = 1320; + break; + } + + _context.t329 = "0"; + + case 1320: + _context.t330 = _context.t329; + this.enableArticleImageReposition = _context.t330 === "1"; + _context.next = 1324; + return _regenerator.default.awrap(this.getValue(keys.enable_article_byline_hrs)); + + case 1324: + _context.t331 = _context.sent; + + if (_context.t331) { + _context.next = 1327; + break; + } + + _context.t331 = "1"; + + case 1327: + _context.t332 = _context.t331; + this.enableArticleBylineHRs = _context.t332 === "1"; + _context.next = 1331; + return _regenerator.default.awrap(this.getValue(keys.ads)); + + case 1331: + _context.t333 = _context.sent; + + if (_context.t333) { + _context.next = 1334; + break; + } + + _context.t333 = ""; + + case 1334: + this.ads = _context.t333; + _context.next = 1337; + return _regenerator.default.awrap(this.getValue(keys.enable_instory_ad_marker)); + + case 1337: + _context.t334 = _context.sent; + + if (_context.t334) { + _context.next = 1340; + break; + } + + _context.t334 = "0"; + + case 1340: + _context.t335 = _context.t334; + this.enableInStoryAdMarker = _context.t335 === "1"; + _context.next = 1344; + return _regenerator.default.awrap(this.getValue(keys.instory_ad_marker_text)); + + case 1344: + _context.t336 = _context.sent; + + if (_context.t336) { + _context.next = 1347; + break; + } + + _context.t336 = global.strings("str_advertisement"); + + case 1347: + this.inStoryAdMarkerText = _context.t336; + _context.next = 1350; + return _regenerator.default.awrap(this.getValue(keys.disable_rn_styles)); + + case 1350: + _context.t337 = _context.sent; + + if (_context.t337) { + _context.next = 1353; + break; + } + + _context.t337 = "0"; + + case 1353: + _context.t338 = _context.t337; + this.disableRnStyles = _context.t338 === "1"; + this.rnStyles = {}; + _context.next = 1358; + return _regenerator.default.awrap(this.getValue(keys.rn_styles)); + + case 1358: + rnStyleRaw = _context.sent; + + if (rnStyleRaw) { + try { + this.rnStyles = JSON.parse(rnStyleRaw); + } catch (e) {} + } else {} + + _context.t339 = parseInt; + _context.next = 1363; + return _regenerator.default.awrap(this.getValue(keys.rn_styles_file_time)); + + case 1363: + _context.t340 = _context.sent; + + if (_context.t340) { + _context.next = 1366; + break; + } + + _context.t340 = -1; + + case 1366: + _context.t341 = _context.t340; + this.rnStylesFileTime = (0, _context.t339)(_context.t341, 10); + _context.t342 = parseInt; + _context.next = 1371; + return _regenerator.default.awrap(this.getValue(keys.ssl_certificate_file_time)); + + case 1371: + _context.t343 = _context.sent; + + if (_context.t343) { + _context.next = 1374; + break; + } + + _context.t343 = -1; + + case 1374: + _context.t344 = _context.t343; + this.sslCertificateFileTime = (0, _context.t342)(_context.t344, 10); + _context.t345 = parseInt; + _context.next = 1379; + return _regenerator.default.awrap(this.getValue(keys.device_dpi)); + + case 1379: + _context.t346 = _context.sent; + + if (_context.t346) { + _context.next = 1382; + break; + } + + _context.t346 = 0; + + case 1382: + _context.t347 = _context.t346; + this.deviceDpi = (0, _context.t345)(_context.t347, 10); + _context.next = 1386; + return _regenerator.default.awrap(this.getValue(keys.toc_style)); + + case 1386: + _context.t348 = _context.sent; + + if (_context.t348) { + _context.next = 1389; + break; + } + + _context.t348 = "list"; + + case 1389: + this.tocStyle = _context.t348; + _context.next = 1392; + return _regenerator.default.awrap(this.getValue(keys.toc_style_preview)); + + case 1392: + _context.t349 = _context.sent; + + if (_context.t349) { + _context.next = 1395; + break; + } + + _context.t349 = "all_art"; + + case 1395: + this.tocStylePreview = _context.t349; + _context.next = 1398; + return _regenerator.default.awrap(this.getValue(keys.enable_tab_index_mode)); + + case 1398: + _context.t350 = _context.sent; + + if (_context.t350) { + _context.next = 1401; + break; + } + + _context.t350 = "0"; + + case 1401: + _context.t351 = _context.t350; + this.enableTabIndexMode = _context.t351 === "1"; + _context.next = 1405; + return _regenerator.default.awrap(this.getValue(keys.show_tab_index_mode_customization)); + + case 1405: + _context.t352 = _context.sent; + + if (_context.t352) { + _context.next = 1408; + break; + } + + _context.t352 = this.enableTabIndexMode ? "1" : "0"; + + case 1408: + _context.t353 = _context.t352; + this.showTabIndexModeCustomization = _context.t353 === "1"; + _context.next = 1412; + return _regenerator.default.awrap(this.getValue(keys.bundle_update_available)); + + case 1412: + _context.t354 = _context.sent; + + if (_context.t354) { + _context.next = 1415; + break; + } + + _context.t354 = "0"; + + case 1415: + _context.t355 = _context.t354; + this.bundleUpdateAvailable = _context.t355 === "1"; + _context.next = 1419; + return _regenerator.default.awrap(this.getValue(keys.reset_app_bundle)); + + case 1419: + _context.t356 = _context.sent; + + if (_context.t356) { + _context.next = 1422; + break; + } + + _context.t356 = "0"; + + case 1422: + _context.t357 = _context.t356; + this.resetAppBundle = _context.t357 === "1"; + _context.t358 = parseInt; + _context.next = 1427; + return _regenerator.default.awrap(this.getValue(keys.see_newspaper_preview)); + + case 1427: + _context.t359 = _context.sent; + + if (_context.t359) { + _context.next = 1430; + break; + } + + _context.t359 = "0"; + + case 1430: + _context.t360 = _context.t359; + this.seeNewspaperPreview = (0, _context.t358)(_context.t360, 10); + _context.t362 = parseInt; + _context.next = 1435; + return _regenerator.default.awrap(this.getValue(keys.page_see_newspaper_preview)); + + case 1435: + _context.t363 = _context.sent; + _context.t361 = (0, _context.t362)(_context.t363, 10); + + if (_context.t361) { + _context.next = 1439; + break; + } + + _context.t361 = 2; + + case 1439: + this.pageSeeNewspaperPreview = _context.t361; + _context.t365 = parseInt; + _context.next = 1443; + return _regenerator.default.awrap(this.getValue(keys.hours_to_send_push_registration)); + + case 1443: + _context.t366 = _context.sent; + _context.t364 = (0, _context.t365)(_context.t366, 10); + + if (_context.t364) { + _context.next = 1447; + break; + } + + _context.t364 = 6; + + case 1447: + this.hoursToSendPushRegistration = _context.t364; + _context.next = 1450; + return _regenerator.default.awrap(this.getValue(keys.webview_ios_native_player)); + + case 1450: + _context.t367 = _context.sent; + + if (_context.t367) { + _context.next = 1453; + break; + } + + _context.t367 = "0"; + + case 1453: + _context.t368 = _context.t367; + this.webviewIOSNativePlayer = _context.t368 === "1"; + _context.next = 1457; + return _regenerator.default.awrap(this.getValue(keys.webview_android_allow_fullscreen)); + + case 1457: + _context.t369 = _context.sent; + + if (_context.t369) { + _context.next = 1460; + break; + } + + _context.t369 = "1"; + + case 1460: + _context.t370 = _context.t369; + this.webviewAndroidAllowFullscreen = _context.t370 === "1"; + _context.next = 1464; + return _regenerator.default.awrap(this.getValue(keys.webview_allow_autoplay)); + + case 1464: + _context.t371 = _context.sent; + + if (_context.t371) { + _context.next = 1467; + break; + } + + _context.t371 = "0"; + + case 1467: + _context.t372 = _context.t371; + this.webviewAllowAutoplay = _context.t372 === "1"; + this.webviewCustomHTTPHeaders = {}; + _context.next = 1472; + return _regenerator.default.awrap(this.getValue(keys.webview_custom_http_headers)); + + case 1472: + customHTTPHeadersRaw = _context.sent; + + if (customHTTPHeadersRaw) { + this.webviewCustomHTTPHeaders = _$$_REQUIRE(_dependencyMap[11]).StringUtils.parseQuerystring(customHTTPHeadersRaw); + } + + this.attConfig = new (_$$_REQUIRE(_dependencyMap[20]).ATTConfig)(this.pSetup, this.originalMachine); + _context.next = 1477; + return _regenerator.default.awrap(this.attConfig.init(json)); + + case 1477: + _context.next = 1479; + return _regenerator.default.awrap(this.getValue(keys.iubenda.enabled)); + + case 1479: + _context.t373 = _context.sent; + + if (_context.t373) { + _context.next = 1482; + break; + } + + _context.t373 = "0"; + + case 1482: + _context.t374 = _context.t373; + this.iubendaEnabled = _context.t374 === "1"; + + if (!this.iubendaEnabled) { + _context.next = 1488; + break; + } + + this.iubendaConfig = new (_$$_REQUIRE(_dependencyMap[21]).IubendaConfig)(this.pSetup, this.originalMachine); + _context.next = 1488; + return _regenerator.default.awrap(this.iubendaConfig.init(json)); + + case 1488: + _context.next = 1490; + return _regenerator.default.awrap(this.getValue(keys.show_extras_in_article_graphic_mode)); + + case 1490: + _context.t375 = _context.sent; + + if (_context.t375) { + _context.next = 1493; + break; + } + + _context.t375 = "0"; + + case 1493: + _context.t376 = _context.t375; + this.showExtrasInArticleGraphicMode = _context.t376 === "1"; + _context.next = 1497; + return _regenerator.default.awrap(this.getValue(keys.show_extras_to_logged_users_only)); + + case 1497: + _context.t377 = _context.sent; + + if (_context.t377) { + _context.next = 1500; + break; + } + + _context.t377 = "0"; + + case 1500: + _context.t378 = _context.t377; + this.showExtrasToLoggedUsersOnly = _context.t378 === "1"; + _context.next = 1504; + return _regenerator.default.awrap(this.getValue(keys.morse_tauid)); + + case 1504: + _context.t379 = _context.sent; + + if (_context.t379) { + _context.next = 1507; + break; + } + + _context.t379 = "0"; + + case 1507: + _context.t380 = _context.t379; + this.morseTAUID = _context.t380 === "1"; + _context.next = 1511; + return _regenerator.default.awrap(this.getValue(keys.add_watermark)); + + case 1511: + _context.t381 = _context.sent; + + if (_context.t381) { + _context.next = 1514; + break; + } + + _context.t381 = "0"; + + case 1514: + _context.t382 = _context.t381; + this.addWatermark = _context.t382 === "1"; + _context.next = 1518; + return _regenerator.default.awrap(this.getValue(keys.watermark_text)); + + case 1518: + _context.t383 = _context.sent; + + if (_context.t383) { + _context.next = 1521; + break; + } + + _context.t383 = "$extId"; + + case 1521: + this.watermarkText = _context.t383; + _context.next = 1524; + return _regenerator.default.awrap(this.getValue(keys.disable_screen_idle_timer_delay)); + + case 1524: + _context.t384 = _context.sent; + + if (_context.t384) { + _context.next = 1527; + break; + } + + _context.t384 = "0"; + + case 1527: + _context.t385 = _context.t384; + this.disableScreenIdleTimerDelay = _context.t385 === "1"; + _context.next = 1531; + return _regenerator.default.awrap(this.getValue(keys.startup_params)); + + case 1531: + _context.t386 = _context.sent; + + if (_context.t386) { + _context.next = 1534; + break; + } + + _context.t386 = "{}"; + + case 1534: + rawStartupParams = _context.t386; + + try { + this.startupParams = JSON.parse(rawStartupParams); + } catch (e) { + this.startupParams = {}; + } + + _context.next = 1538; + return _regenerator.default.awrap(this.getValue(keys.enable_session_collection)); + + case 1538: + _context.t387 = _context.sent; + + if (_context.t387) { + _context.next = 1541; + break; + } + + _context.t387 = "0"; + + case 1541: + _context.t388 = _context.t387; + this.enableSessionCollection = _context.t388 === "1"; + _context.next = 1545; + return _regenerator.default.awrap(this.getValue(keys.enable_session_auto_upload)); + + case 1545: + _context.t389 = _context.sent; + + if (_context.t389) { + _context.next = 1548; + break; + } + + _context.t389 = "0"; + + case 1548: + _context.t390 = _context.t389; + this.enableSessionAutoUpload = _context.t390 === "1"; + _context.next = 1552; + return _regenerator.default.awrap(this.getValue(keys.session_upload_base_url)); + + case 1552: + _context.t391 = _context.sent; + + if (_context.t391) { + _context.next = 1555; + break; + } + + _context.t391 = ""; + + case 1555: + this.sessionUploadBaseURL = _context.t391; + this.disableReaderAppModal = true; + this.readerAppLearnMoreLink = ""; + + if (!_$$_REQUIRE(_dependencyMap[11]).PlatformUtils.isIOS()) { + _context.next = 1572; + break; + } + + _context.next = 1561; + return _regenerator.default.awrap(this.getValue(keys.disable_reader_app_modal)); + + case 1561: + _context.t392 = _context.sent; + + if (_context.t392) { + _context.next = 1564; + break; + } + + _context.t392 = "0"; + + case 1564: + _context.t393 = _context.t392; + this.disableReaderAppModal = _context.t393 === "1"; + _context.next = 1568; + return _regenerator.default.awrap(this.getValue(keys.reader_app_learn_more_link)); + + case 1568: + _context.t394 = _context.sent; + + if (_context.t394) { + _context.next = 1571; + break; + } + + _context.t394 = "https://apps.apple.com/story/id1614232807"; + + case 1571: + this.readerAppLearnMoreLink = _context.t394; + + case 1572: + _context.next = 1574; + return _regenerator.default.awrap(this.getValue(keys.checksum)); + + case 1574: + _context.t395 = _context.sent; + + if (_context.t395) { + _context.next = 1577; + break; + } + + _context.t395 = ""; + + case 1577: + this.checksum = _context.t395; + _context.next = 1580; + return _regenerator.default.awrap(this.getValue(keys.push_tags)); + + case 1580: + _context.t396 = _context.sent; + + if (_context.t396) { + _context.next = 1583; + break; + } + + _context.t396 = ""; + + case 1583: + this.pushTags = _context.t396; + _context.next = 1586; + return _regenerator.default.awrap(this.getValue(keys.ssl_domains)); + + case 1586: + _context.t397 = _context.sent; + + if (_context.t397) { + _context.next = 1589; + break; + } + + _context.t397 = ""; + + case 1589: + this.sslDomains = _context.t397.split(","); + _context.next = 1592; + return _regenerator.default.awrap(this.getValue(keys.use_native_view_pager_ios)); + + case 1592: + _context.t398 = _context.sent; + + if (_context.t398) { + _context.next = 1595; + break; + } + + _context.t398 = "1"; + + case 1595: + _context.t399 = _context.t398; + this.useNativeViewPagerIOS = _context.t399 === "1"; + _context.next = 1599; + return _regenerator.default.awrap(this.getValue(keys.use_asymmetric_card_list)); + + case 1599: + _context.t400 = _context.sent; + + if (_context.t400) { + _context.next = 1602; + break; + } + + _context.t400 = "1"; + + case 1602: + _context.t401 = _context.t400; + this.useAsymmetricCardList = _context.t401 === "1"; + _context.next = 1606; + return _regenerator.default.awrap(this.getValue(keys.prevent_screenshots)); + + case 1606: + _context.t402 = _context.sent; + + if (_context.t402) { + _context.next = 1609; + break; + } + + _context.t402 = "0"; + + case 1609: + _context.t403 = _context.t402; + this.preventScreenshots = _context.t403 === "1"; + return _context.abrupt("return", true); + + case 1612: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setLastIssue", + value: function setLastIssue(lastIssue) { + this.lastIssue = lastIssue; + this.setValue(keys.last_issue, lastIssue); + } + }, { + key: "setLastEdition", + value: function setLastEdition(lastEdition) { + this.lastEdition = lastEdition; + this.setValue(keys.last_edition, lastEdition); + } + }, { + key: "setLastPSetup", + value: function setLastPSetup(lastPSetup) { + this.lastPSetup = lastPSetup; + this.setValue(keys.last_pSetup, lastPSetup); + } + }, { + key: "setDemoIssue", + value: function setDemoIssue(demoIssue) { + this.demoIssue = demoIssue; + this.setValue(keys.demo_issue, demoIssue); + } + }, { + key: "setRssIndexFileTime", + value: function setRssIndexFileTime() { + var filetime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + this.rssIndexFileTime = filetime; + this.setValue(keys.rss_index_file_time, "" + filetime); + } + }, { + key: "setCustomLanguagePackFileTime", + value: function setCustomLanguagePackFileTime() { + var filetime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + this.customLanguagePackFileTime = filetime; + this.setValue(keys.custom_language_pack_file_time, "" + filetime); + } + }, { + key: "setCustomFontsFileTime", + value: function setCustomFontsFileTime() { + var filetime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + this.customFontsFileTime = filetime; + this.setValue(keys.custom_fonts_file_time, "" + filetime); + } + }, { + key: "setRNStyles", + value: function setRNStyles() { + var rnStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.rnStyles = rnStyles; + this.setValue(keys.rn_styles, JSON.stringify(rnStyles)); + } + }, { + key: "setRNStylesFileTime", + value: function setRNStylesFileTime() { + var filetime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + this.rnStylesFileTime = filetime; + this.setValue(keys.rn_styles_file_time, "" + filetime); + } + }, { + key: "setSSLCertificateFileTime", + value: function setSSLCertificateFileTime() { + var filetime = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1; + this.sslCertificateFileTime = filetime; + this.setValue(keys.ssl_certificate_file_time, "" + filetime); + } + }, { + key: "setModeEnabled", + value: function setModeEnabled(modeEnabled) { + var runtime = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + this.rssIsEnabled = modeEnabled === RSS_ENABLED || modeEnabled === BOTH_ENABLED; + this.newsMemoryIsEnabled = modeEnabled === DEFAULT || modeEnabled === NEWSMEMORY_ENABLED || modeEnabled === BOTH_ENABLED; + + if (!runtime) { + this.setValue(keys.mode_enabled, modeEnabled); + } + } + }, { + key: "checkIfRssIsEnabled", + value: function checkIfRssIsEnabled() { + var modeEnabled; + return _regenerator.default.async(function checkIfRssIsEnabled$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return _regenerator.default.awrap(this.getValue(keys.mode_enabled)); + + case 2: + modeEnabled = _context2.sent; + return _context2.abrupt("return", modeEnabled === RSS_ENABLED || modeEnabled === BOTH_ENABLED); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getPaymentByProductId", + value: function getPaymentByProductId(productId) { + if (this.payments) { + return this.payments.find(function (payment) { + return payment.checkProductId(productId); + }); + } + + return undefined; + } + }, { + key: "setExternal", + value: function setExternal(external) { + this.external = external; + } + }, { + key: "setAllowedIP", + value: function setAllowedIP(isAllowedIP) { + this.isAllowedIP = isAllowedIP; + this.setValue(keys.is_allowed_ip, isAllowedIP ? "1" : "0"); + } + }, { + key: "setCDNEnabled", + value: function setCDNEnabled(cdnEnabled) { + this.cdnEnabled = cdnEnabled; + this.setValue(keys.cdn_enabled, cdnEnabled ? "1" : "0"); + } + }, { + key: "setCDNServer", + value: function setCDNServer(cdnServer) { + this.cdnServer = cdnServer; + this.setValue(keys.cdn_server, cdnServer); + } + }, { + key: "setBundleUpdateAvailable", + value: function setBundleUpdateAvailable(bundleUpdateAvailable) { + this.bundleUpdateAvailable = bundleUpdateAvailable; + this.setValue(keys.bundle_update_available, bundleUpdateAvailable ? "1" : "0"); + } + }, { + key: "setMigrate", + value: function setMigrate(migrate) { + this.migrate = migrate; + this.setValue(keys.migrate, migrate ? "1" : "0"); + } + }, { + key: "setNativeOptionspageFallbackVersion", + value: function setNativeOptionspageFallbackVersion(nativeOptionspageFallbackVersionUrl) { + this.showNativeOptionsPageFallbackUrl = nativeOptionspageFallbackVersionUrl; + this.setValue(keys.show_native_options_page_fallback_url, nativeOptionspageFallbackVersionUrl); + } + }, { + key: "_getDifferences", + value: function _getDifferences(newConfig) { + var _this2 = this; + + var diffKeys = []; + + if (newConfig) { + try { + diffKeys = Object.keys(this).filter(function (key) { + if (typeof _this2[key] === "function") { + return false; + } + + if (typeof _this2[key] === "object") { + var options = {}; + + if (_this2[key] instanceof _$$_REQUIRE(_dependencyMap[22]).PaperSetupBaseConfig) { + options.skipKeys = ["json"]; + } + + return !_$$_REQUIRE(_dependencyMap[11]).JSUtils.areEqualDeep(_this2[key], newConfig[key], options); + } + + return _this2[key] !== newConfig[key]; + }); + + if (diffKeys.length > 0) {} + } catch (e) {} + } + + return diffKeys; + } + }, { + key: "_checkIfNeedToRestart", + value: function _checkIfNeedToRestart(diffKeys) { + var needRestart = diffKeys.find(function (key) { + return KEYS_REQUIRE_RESTART.includes(key); + }) !== undefined; + return needRestart; + } + }, { + key: "_checkIfNeedToUpdate", + value: function _checkIfNeedToUpdate(diffKeys) { + var needUpdate = diffKeys.find(function (key) { + return !KEYS_NO_UPDATE.includes(key); + }) !== undefined; + return needUpdate; + } + }, { + key: "_checkIfNeedLayoutUpdate", + value: function _checkIfNeedLayoutUpdate(diffKeys) { + var needUpdate = diffKeys.find(function (key) { + return KEYS_LAYOUT_UPDATE.includes(key); + }) !== undefined; + return needUpdate; + } + }]); + return PaperSetupConfig; + }(_$$_REQUIRE(_dependencyMap[22]).PaperSetupBaseConfig); + + exports.PaperSetupConfig = PaperSetupConfig; +},717,[5,80,7,8,90,12,14,16,718,719,720,462,721,723,724,726,727,728,729,730,1720,1721,725]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var PaperSetupHelper = function () { + function PaperSetupHelper() { + (0, _classCallCheck2.default)(this, PaperSetupHelper); + } + + (0, _createClass2.default)(PaperSetupHelper, null, [{ + key: "setItem", + value: function setItem(pSetup, key, value) { + return _regenerator.default.async(function setItem$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _$$_REQUIRE(_dependencyMap[4]).StorageUtils.setItem(pSetup, key, value)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getItem", + value: function getItem(pSetup, key) { + return _regenerator.default.async(function getItem$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", _$$_REQUIRE(_dependencyMap[4]).StorageUtils.getItem(pSetup, key)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return PaperSetupHelper; + }(); + + exports.default = PaperSetupHelper; + PaperSetupHelper.SP = { + keys: { + app_mode_selection_page_enabled: "enableAppModeSelectionPage", + app_mode_selection_page_url: "appModeSelectionPageUrl", + app_mode_selection_page_version: "appModeSelectionPageVersion", + base_rss_update_url: "baseRssUpdateUrl", + change_user_agent_for_oauth: "changeUserAgentForOAuth", + custom_string_to_append_to_user_agent_for_oauth: "customStringToAppendToUserAgentForOAuth", + custom_user_agent_for_oauth: "customUserAgentForOAuth", + adobe_analytics: { + enabled: "enableAdobeAnalytics", + props_list: "adobeAnalyticsPropsList", + actions: { + edition_load: "adobeAnalyticsEditionLoadActionName", + double_tap_to_zoom: "adobeAnalyticsDoubleTapActionName", + pinch_to_zoom: "adobeAnalyticsPinchOutActionName", + tts: "adobeAnalyticsTextToSpeechActionName", + skip_to_end: "adobeAnalyticsSkipToEndActionName", + toggle_to_print: "adobeAnalyticsToggleToPrintActionName", + toggle_to_digital: "adobeAnalyticsToggleToDigitalActionName", + share: "adobeAnalyticsShareActionName", + scroll_zoom: "adobeAnalyticsScrollZoomActionName", + link_click: "adobeAnalyticsLinkClickActionName" + }, + states: { + scrolled: "adobeAnalyticsScrolledStateName", + read: "adobeAnalyticsReadStateName", + zoomed: "adobeAnalyticsZoomedStateName", + index: "adobeAnalyticsIndexStateName", + optionspage: "adobeAnalyticsOptionspageStateName" + }, + send_only_edition_load: "adobeAnalyticsSendOnlyEditionLoad", + user_types: { + unknown: "adobeAnalyticsUserTypeUnknown", + subscriber: "adobeAnalyticsUserTypeSubscriber" + }, + media: { + print: "adobeAnalyticsPrintMedium", + digital: "adobeAnalyticsDigitalMedium", + zoomed_suffix: "adobeAnalyticsZoomedMediumSuffix" + }, + first_page_section_prefix: "adobeAnalyticsFirstPageSectionPrefix", + content_types: { + first_page: "adobeAnalyticsFirstPageContentType", + page: "adobeAnalyticsPageContentType", + index: "adobeAnalyticsIndexContentType", + article: "adobeAnalyticsArticleContentType", + optionspage: "adobeAnalyticsOptionspageContentType" + }, + edition_type: "adobeAnalyticsEditionType", + device_type: "adobeAnalyticsDeviceType" + }, + comscore: { + app_name: "comScoreAppName", + base_url: "comScoreBaseUrl", + id: "comScoreID", + publisher_secret: "comScorePublisherSecret" + }, + copyright: "copyright", + add_disclaimer: "addDisclaimer", + copyright_url: "copyrighturl", + custom_language_pack_file_time: "customLanguagePackFileTimestamp", + custom_fonts_file_time: "customFontsFileTimestamp", + default_connectivity: "defaultConnectivity", + default_connectivity_timestamp: "defaultConnectivityTimeStamp", + default_max_issues: "DEFAULT_MAX_ISSUES", + feedback: { + active_days_to_show: "feedbackActiveDaysToShow", + ask: "feedbackAskForFeedback", + email: "feedbackEmailForFeedback", + reset_timestamp: "feedbackResetTimestamp", + enable: "feedbackEnable", + lower_active_date_range: "feedbackLowerActiveDateRange", + request_title: "feedbackRequestFeedbackTitle", + request_review_title: "feedbackRequestReviewFeedbackTitle", + show_dont_show_again: "feedbackShowDontShowAgain", + total_days_to_show: "feedbackTotalDaysToShow", + upper_active_date_range: "feedbackUpperActiveDateRange", + cool_down_days: "feedbackCoolDownDays", + cool_down_days_dont_show_again: "feedbackCoolDownDaysDontShowAgain" + }, + file_time: "pSetupTime", + disable_firebase_analytics: "disableFirebaseAnalytics", + other_firebase_projects: "otherFirebaseProjects", + disable_google_analytics_3: "disableGoogleAnalytics3", + g_analytics_anonymize_ip: "googleAnalyticsAnonymizeIP", + g_analytics: "googleAnalyticsAccount", + g_analytics_feedback: "googleAnalyticsAccountFeedback", + g_analytics_tecnavia: "googleAnalyticsAccountTecnavia", + gallery_download_enabled: "galleryDownloadEnabled", + gallery_thumbnail_disabled: "galleryThumbnailDisabled", + open_http_link_on_external_browser: "openHttpLinkOnExternalBrowser", + url_type: "urltype", + is_lite: "newsmemoryLite", + language: "language", + layout_style: "layoutStyle", + layout_sub_style: "layoutSubStyle", + mather_analytics: { + enabled: "matherAnalyticsEnable", + customer_id: "matherCustomerId", + site_id: "matherSiteId", + send_email: "matherSendEmail" + }, + matomo: { + enabled: "matomoEnable", + site_id: "matomoSiteId", + rss_site_id: "matomoRssSiteId", + base_url: "matomoBaseURL", + visit_custom_dimensions: "matomoVisitCustomDimensions", + custom_dimensions: "matomoCustomDimensions", + dispatch_interval: "matomoDispatchInterval" + }, + matomo_tracker: { + enabled: "matomoTrackerEnable", + site_id: "matomoTrackerSiteId", + rss_site_id: "matomoTrackerRssSiteId", + base_url: "matomoTrackerBaseURL", + action_base_url: "matomoTrackerActionBaseURL", + edition_remapping: "matomoTrackerEditionRemapping", + titles: { + scrolled: "matomoTrackerScrolledTitle", + read: "matomoTrackerReadTitle", + rss_drawer: "matomoTrackerRssDrawerTitle", + rss_read: "matomoTrackerRssReadTitle" + }, + custom_urls: { + scrolled: "matomoTrackerScrolledURL", + read: "matomoTrackerReadURL", + rss_drawer: "matomoTrackerRssDrawerURL", + rss_read: "matomoTrackerRssReadURL" + }, + custom_dimensions: { + scrolled: "matomoTrackerScrolledCustomDimensions", + read: "matomoTrackerReadCustomDimensions", + rss_drawer: "matomoTrackerRssDrawerCustomDimensions", + rss_read: "matomoTrackerRssReadCustomDimensions" + } + }, + mode_enabled: "rssIsEnable", + option_page_coordinates: "optionpageCoordinates", + option_page_modal: "loginInModalMode", + option_page_mode: "optionPage", + option_page_url: "optionPageUrl", + load_editions_url: "loadEditionsUrl", + paper_name: "paperName", + powered_by: "poweredBy", + powered_by_url: "poweredByurl", + relabel_ebook_button: "ebook_button", + relabel_feed_button: "feed_button", + relabel_fit_page_button: "fitPageImg_button", + relabel_gbook_button: "gbook_button", + relabel_help_button: "help_button", + relabel_offline_button: "OfflineActionLabel", + relabel_option_button: "option_button", + relabel_phodir_button: "phodir_button", + relabel_search_button: "search_button", + relabel_setting_button: "setting_button", + relabel_special_sections_button: "specialSections_button", + remp_account: "rempAccount", + rss_index_file_time: "rssConfigFileTimestamp", + site_domain: "siteDomain", + special_before_index_tablet: "specialBeforeIndexTablet", + special_before_index_phone: "specialBeforeIndexPhone", + special_before_index: "specialBeforeIndex", + startup_mode: "disableRssAtStartup", + startup_mode_timestamp: "disableRssAtStartupTimestamp", + udb: "udbDatabase", + newsmemory_to_use: "newsmemoryToUse", + newsmemory_to_use_timestamp: "newsmemoryToUseTimeStamp", + paper: "paper", + xpaper: "xpaper", + date_format: "DATE_FORMAT", + show_week: "SHOW_WEEK", + init_x_paper_not_in_view: "initpageXpaperNotView", + external_xpapers: "externalXPapers", + download_multi_zips: "downloadMultiZips", + translation_available: "translationAvailable", + translation_server: "translationServer", + use_native_accessibility: "useNativeAccessibility", + use_car_mode: "useCarMode", + show_native_options_page_fallback_url: "showNativeOptionsPageFallbackUrl", + show_native_options_page: "showNativeOptionsPage", + show_native_settings_screen: "showNativeSettingsScreen", + enable_translation_customization: "enableTranslationCustomization", + show_themes_customization: "showThemesCustomization", + enable_zoom_level_customization: "enableZoomLevelCustomization", + enable_article_types_customization: "enableArticleTypesCustomization", + show_article_column_view_customization: "showArticleColumnViewCustomization", + show_navigation_buttons_layout_customization: "showNavigationButtonsLayoutCustomization", + show_xpaper_navigation_close_button: "showXPaperNavigationCloseButton", + show_highlight_behavior_customization: "showHighlightBehaviorCustomization", + show_tab_index_mode_customization: "showTabIndexModeCustomization", + change_favorite_edition: "changeFavoriteEdition", + favorite_edition: "favoriteEdition", + enable_connectivity_options: "enableConnectivityOptions", + enable_font_size_customization: "enableFontSizeCustomization", + enable_graph_size_customization: "enableGraphSizeCustomization", + show_types_article: "showTypesArticle", + enable_article_extra: "enableArticleExtra", + max_zips_to_download_per_request: "maxZipsToDownloadEachRequest", + css_files_to_add: "cssFilesToAdd", + email_content: "emailContent", + email_subject: "emailSubject", + facebook_enabled: "ipadFacebook", + twitter_text: "twitterText", + update_db_percentage: "updateDBPerc", + enable_advanced_gestures_mode: "enableAdvancedGesturesMode", + single_tap_to_zoom: "singleTapToZoom", + two_fingers_tap_to_article: "twoFingersTapToArticle", + machine_for_hr: "machineForHR", + fit_graphic_article: "fitGraphicArticle", + machine: "machine", + sub_path: "subPath", + extra_link_color: "extraLinkColor", + background_duration_article_selected: "backgroundDurationArticleSelected", + background_timer_article_selected: "backgroundTimerArticleSelected", + background_color_article: { + selected: "backgroundColorArticleSelected", + to_select: "backgroundColorArticleToSelect" + }, + preview_highlight_enabled: "highlightClickableUrlEnabled", + preview_highlight_duration_seconds: "showHighlightingBoxesForSeconds", + zooming_factor: "zoomingFactor", + max_zoom: "maxZoom", + ta_google_analytics_event: "TAGoogleAnalyticsEvent", + google_analytics_custom_dimensions: "googleAnalyticsCustomDimensions", + firebase_analytics_custom_dimensions: "firebaseAnalyticsCustomDimensions", + firebase_analytics_send_external_id: "firebaseAnalyticsSendExternalId", + enable_article_text_selection: "enableArticleTextSelection", + enable_article_byline_hrs: "enableArticleBylineHrs", + on_login_error_go_to: "onLoginErrorGoTo", + on_validation_error_go_to: "onValidationErrorGoTo", + time_limit_check_edition: "timeLimitForRestart", + time_limit_check_login: "timeLimitToCheckLoginOnRestart", + time_limit_forget_login: "timeLimitNotRememberLoginOnRestart", + last_pSetup: "lastPSetup", + last_issue: "lastIssue", + last_edition: "lastEdition", + latest_edition_available_message_format: "latestEditionAvailableMessageFormat", + demo_issue: "demoIssue", + show_edition_thumbs: "showEditionThumbs", + scroll_tiles_phone: "scrollTilesPhone", + scroll_tiles: "scrollTiles", + force_article_mode_fullscreen_portrait: "forceArticleModeFullscreenPortrait", + force_article_mode_fullscreen_landscape: "forceArticleModeFullscreenLandscape", + enable_text_to_speech: "enableTextToSpeech", + enable_text_to_speech_player: "enableTextToSpeechPlayer", + text_to_speech_rate: "textToSpeechRate", + text_to_speech_chunk_length: "textToSpeechChunkLength", + low_speed_limit: "lowSpeedLimit", + disable_low_speed_limit: "disableLowSpeedLimit", + base_iap_api_url: "baseInAppPurchaseAPIUrl", + all_skus: "allSkus", + is_nnb: "isNNB", + enable_vmode_and_fit_orientation: "enableVmodeAndFitOrientation", + fit_page_type: "xc_fitPage", + start_in_index_mode: "startInIndexMode", + epaper_start_mode: "epaperStartMode", + disable_epaper_mode_selection_page: "disableEPaperModeSelectionPage", + cdn_enabled: "cdnEnabled", + cdn_server: "cdnServer", + disable_rn_demo: "disableRnDemo", + pdf_thumbnail_ratio: "pdfThumbnailRatio", + eink_complete_hr_factor: "einkCompleteHrFactor", + hr_factor: "hrFactor", + pdf_factor: "pdfFactor", + pdf_factor_landscape: "pdfFactorLandscape", + low_pages_to_render: "lowPagesToRender", + mid_pages_to_render: "midPagesToRender", + load_mid_res_on_scroll: "loadMidResOnScroll", + show_landing_page_once: "showLandingPageOnce", + landing_page_version: "landingPageVersion", + landing_page_url: "landingPageURL", + forced_shared_secret: "sharedSecret", + use_ios_sandbox_receipt_validation: "useIOSSandboxReceiptValidation", + use_cc: "useCC", + migrate: "migrate", + hybrid_version: "hybridVersion", + append_first_pages: "appendFirstPages", + png_quality_factor: "pngQualityFactor", + generate_png_based_on_screen_dimensions: "generatePNGBasedOnScreenDimensions", + consider_pixel_ratio_in_png_generation: "considerPixelRatioInPNGGeneration", + png_width_limit: "pngWidthLimit", + print_enabled: "ipadPrint", + print_to_letter: "printToLetter", + print_margin: "printMargin", + generic_app_enabled: "storeIsEnable", + store_url: "customStoreUrl", + iap_active: "iapActive", + payments: "payments", + enable_multiple_subscriptions_alert: "enableMultipleSubscriptionsAlert", + protect_site: "protectSite", + two_fingers_tap_hint_enabled: "twoFingersTapHintEnabled", + two_fingers_tap_max_hints: "twoFingersTapMaxHints", + download_single_pdf: "downloadSinglePdf", + enable_share: "enableShare", + max_shares: "maxShares", + max_shares_check_type: "maxSharesCheckType", + message_max_share: "messageMaxShare", + merge_articles: "mergeArt", + column_view: "columnView", + show_art_complete: "showArtComplete", + calculate_mid_ads: "calculateMidAds", + pages_navigation_buttons_layout: "pagesNavigationButtonsLayout", + animate_layout_footer: "animateLayoutFooter", + fix_buttons_bar_to_bottom: "fixButtonsBarToBottom", + dfp_reload_time: "dfpReloadTime", + ads: "ads", + enable_instory_ad_marker: "enableInStoryAdMarker", + instory_ad_marker_text: "inStoryAdMarkerText", + rn_styles: "rnStyles", + disable_rn_styles: "disableRnStyles", + rn_styles_file_time: "rnStylesFileTimestamp", + ssl_certificate_file_time: "sslCertificateTimestamp", + device_dpi: "deviceDpi", + toc_style: "tocStyle", + toc_style_preview: "tocStylePreview", + enable_tab_index_mode: "enableTabIndexMode", + bundle_update_available: "bundleUpdateAvailable", + reset_app_bundle: "resetAppBundle", + see_newspaper_preview: "seeNewspaperPreview", + page_see_newspaper_preview: "pageSeeNewspaperPreview", + hours_to_send_push_registration: "hoursToSendPushRegistration", + preview_token: "previewToken", + webview_allow_autoplay: "webviewAllowAutoplay", + webview_android_allow_fullscreen: "webviewAndroidAllowFullscreen", + webview_ios_native_player: "webviewIOSNativePlayer", + webview_custom_http_headers: "webviewCustomHTTPHeaders", + app_tracking_transparency: { + force_message: "forceAppTrackingTransparencyMessage", + disable_message: "disableAppTrackingTransparencyMessage", + show_pre_message: "showPreAppTrackingTransparencyMessage", + force_pre_message_on_app_update: "forcePreAppTrackingTransparencyMessageOnAppUpdate" + }, + iubenda: { + enabled: "iubendaEnabled", + site_id: "iubendaSiteId", + cookie_policy_id: "iubendaCookiePolicyId", + lang: "iubendaLang", + reset_consent_date: "iubendaResetConsentDate", + force_consent_popup: "iubendaForceConsentPopup", + ads_require_consent: "adsRequireConsent", + google_ads_present: "googleAdsPresent", + ref_privacy_laws: "referencePrivacyLaws" + }, + show_extras_in_article_graphic_mode: "showExtrasInArticleGraphicMode", + show_extras_to_logged_users_only: "showExtrasToLoggedUsersOnly", + morse_tauid: "morseTAUID", + add_watermark: "addWatermarkArticlePag", + watermark_text: "watermarkText", + disable_screen_idle_timer_delay: "disableScreenIdleTimerDelay", + keep_article_position_on_rotation: "keepArticlePositionOnRotation", + enable_article_image_reposition: "enableArticleImageReposition", + refreshes_tauid: "refreshesTAUID", + startup_params: "startupParams", + enable_session_collection: "enableSessionCollection", + enable_session_auto_upload: "enableSessionAutoUpload", + session_upload_base_url: "sessionUploadBaseURL", + checksum: "checksum", + user_ip: "userIP", + is_allowed_ip: "isAllowedIP", + push_tags: "pushTags", + disable_reader_app_modal: "disableReaderAppModal", + reader_app_learn_more_link: "readerAppLearnMoreLink", + ssl_domains: "sslDomains", + use_asymmetric_card_list: "useAsymmetricCardList", + use_native_view_pager_ios: "useNativeViewPagerIOS", + prevent_screenshots: "preventScreenshots", + enable_phone_article_layout_on_tablet_in_landscape: "enablePhoneArticleLayoutOnTabletInLandscape", + enable_desktop_article_layout_on_ipad_pro_in_landscape: "enableDesktopArticleLayoutOnIPadProInLandscape" + } + }; +},718,[5,80,7,8,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.WEBVIEW_BASE_URL = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var UNIVERSAL_LINKS_SUPPORTED_PATHS = ["load", "start", "ul"]; + var WEBVIEW_BASE_URL = "http://localhost/"; + exports.WEBVIEW_BASE_URL = WEBVIEW_BASE_URL; + + var WebUtils = function () { + function WebUtils() { + (0, _classCallCheck2.default)(this, WebUtils); + } + + (0, _createClass2.default)(WebUtils, null, [{ + key: "isExternalUrl", + value: function isExternalUrl(url) { + var _StringUtils$segmentU = _$$_REQUIRE(_dependencyMap[4]).StringUtils.segmentUrl(url), + protocol = _StringUtils$segmentU.protocol, + getParams = _StringUtils$segmentU.getParams, + anchorParams = _StringUtils$segmentU.anchorParams; + + if (protocol && protocol.startsWith("xhttp")) { + return true; + } + + if (getParams && (_$$_REQUIRE(_dependencyMap[4]).JSUtils.hasProperty(getParams, "xhttp") || _$$_REQUIRE(_dependencyMap[4]).JSUtils.hasProperty(getParams, "xhttps"))) { + return true; + } + + if (anchorParams && (_$$_REQUIRE(_dependencyMap[4]).JSUtils.hasProperty(anchorParams, "xhttp") || _$$_REQUIRE(_dependencyMap[4]).JSUtils.hasProperty(anchorParams, "xhttps"))) { + return true; + } + + return false; + } + }, { + key: "parseUniversalLink", + value: function parseUniversalLink(url) { + var params; + + if (url) { + if (url.indexOf("?") === -1) { + for (var i = 0; i < UNIVERSAL_LINKS_SUPPORTED_PATHS.length; i++) { + if (url.indexOf("/" + UNIVERSAL_LINKS_SUPPORTED_PATHS[i] + "/") !== -1) { + url = url.replace("/" + UNIVERSAL_LINKS_SUPPORTED_PATHS[i] + "/", "/" + UNIVERSAL_LINKS_SUPPORTED_PATHS[i] + "/?"); + break; + } + } + } + + var info = _$$_REQUIRE(_dependencyMap[4]).StringUtils.segmentUrl(url); + + var domain = info.domain, + getParams = info.getParams; + var path = info.path; + + if (!path) { + path = domain; + } + + path = path.replace(/\//g, ""); + + if (UNIVERSAL_LINKS_SUPPORTED_PATHS.includes(path)) { + params = getParams || {}; + params.schemaURL = url; + params.schemaPath = path; + + if (params.machine) { + if (_$$_REQUIRE(_dependencyMap[4]).StringUtils.isTecnaviaHTTPDomain(params.machine)) { + var oldMachine = params.machine; + params.machine = _$$_REQUIRE(_dependencyMap[4]).StringUtils.convertNewsmemoryDomainToHTTPS(oldMachine); + params.schemaURL = url.replace("machine=" + oldMachine, "machine=" + params.machine); + params.schemaURL = params.schemaURL.replace("machine=" + encodeURIComponent(oldMachine), "machine=" + params.machine); + } else { + params.schemaURL = params.schemaURL.replace("machine=" + encodeURIComponent(params.machine), "machine=" + params.machine); + } + } + } + } + + return params; + } + }, { + key: "replacePlaceHolder", + value: function replacePlaceHolder(html, width, height) { + var result = html; + + if (result) { + if (result.includes("##width##")) { + result = result.replace(/##width##/g, width); + } + + if (result.includes("##height##")) { + result = result.replace(/##height##/g, height); + } + } + + return result; + } + }, { + key: "addViewportScaleStyles", + value: function addViewportScaleStyles(html, left, top, zoom, bgColor) { + var scaleStyleString = "\n body {\n position: absolute;\n margin: auto;\n display: table;\n left: " + left + "px;\n top: " + top + "px;\n transform: scale(" + zoom + ");\n background: " + bgColor + ";\n }"; + return WebUtils.addViewportStyles(html, scaleStyleString); + } + }, { + key: "prependToHead", + value: function prependToHead(html, replacement) { + var result; + + if (html.indexOf("") !== -1) { + result = html.replace("", "" + replacement); + } else { + result = html.replace("", "" + replacement + ""); + } + + return result; + } + }, { + key: "appendToHead", + value: function appendToHead(html, replacement) { + var result; + + if (html.indexOf("") !== -1) { + result = html.replace("", replacement + ""); + } else { + result = html.replace("", "" + replacement + ""); + } + + return result; + } + }, { + key: "addViewportStyles", + value: function addViewportStyles(html) { + var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + var result = html; + + if (result) { + var replacement = "\n "; + + if (style) { + replacement += "\n "; + } + + replacement += "\n "; + result = WebUtils.appendToHead(html, replacement); + } + + return result; + } + }, { + key: "getZoom", + value: function getZoom(width, height, webviewWidth, webviewHeight) { + var adWidth = width > 0 ? width : 1; + var adHeight = height > 0 ? height : 1; + var scaleX = webviewWidth / adWidth; + var scaleY = webviewHeight / adHeight; + var scale = scaleX > scaleY ? scaleY : scaleX; + return Math.round(scale * 10) / 10; + } + }, { + key: "getJSToZoomContent", + value: function getJSToZoomContent(left, top, zoom) { + var js = "\n document.body.style.position = 'absolute';\n document.body.style.left = '" + left + "px';\n document.body.style.top = '" + top + "px';\n document.body.style.transform = 'scale(" + zoom + ")'"; + return js; + } + }, { + key: "getJSToCenterContent", + value: function getJSToCenterContent(bgColor) { + var js = "\n document.body.style.margin = 'auto';\n document.body.style.display = 'table';\n document.body.style.background = '" + bgColor + "';"; + return js; + } + }, { + key: "setupHtmlForWebView", + value: function setupHtmlForWebView(html) { + var result = html; + + if (result) { + result = this.addTags(result, "body"); + result = this.addTags(result, "html"); + } + + return result; + } + }, { + key: "addTags", + value: function addTags(html, tag) { + var result = html; + + if (!result.includes("<" + tag)) { + result = "<" + tag + ">".concat(result) + " "; + } + + if (!result.includes("")) { + result = result.concat(""); + } + + return result; + } + }, { + key: "addViewport", + value: function addViewport() { + var js = "\n var meta = document.createElement('meta');\n meta.name = 'viewport';\n meta.content = 'width=device-width, initial-scale=1';\n document.getElementsByTagName('head')[0].appendChild(meta);"; + return js; + } + }, { + key: "replaceHttpWithHttps", + value: function replaceHttpWithHttps(html) { + var regExp = /http:\/\/([a-zA-Z0-9\.]+)\.newsmemory\.com/; + var matcher; + + if (html) { + do { + matcher = regExp.exec(html); + + if (matcher) { + var originalUrl = matcher[0]; + var subDomainHttp = matcher[1]; + var subDomainHttps = subDomainHttp.replace(/\./g, "-"); + var urlHttps = originalUrl.replace("http", "https").replace(subDomainHttp, subDomainHttps); + html = html.replace(originalUrl, urlHttps); + } + } while (matcher !== null); + } + + return html; + } + }, { + key: "getRonDinoViewPort", + value: function getRonDinoViewPort(width) { + return "\n var myCustomViewport = 'width=" + width + ", initial-scale=1.0, maximum-scale=1.0, user-scalable=no';\n var viewportElement = document.querySelector('meta[name=viewport]');\n if (viewportElement) {\n viewportElement.content = myCustomViewport;\n } else {\n viewportElement = document.createElement('meta');\n viewportElement.name = 'viewport';\n viewportElement.content = myCustomViewport;\n document.getElementsByTagName('head')[0].appendChild(viewportElement);\n };"; + } + }, { + key: "getImagesInsidePage", + value: function getImagesInsidePage() { + return "\n (function getImagesInsidePage() {\n const images = document.getElementsByTagName('img');\n const sources = [];\n for(let i=0; i < images.length; i++){\n sources.push(images[i].src);\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: sources, type: 'GET_RESOURCES' }));\n })();"; + } + }, { + key: "replaceResourcesInPage", + value: function replaceResourcesInPage(newSources) { + return "\n (function getImagesInsidePage(newSources) {\n const parsed = JSON.parse(newSources);\n const images = document.getElementsByTagName('img');\n for(let i=0; i < images.length; i++){\n if(parsed[images[i].src]){\n images[i].src = parsed[images[i].src];\n }\n }\n })('" + JSON.stringify(newSources) + "')"; + } + }, { + key: "addSafeAreaToWebView", + value: function addSafeAreaToWebView() { + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA.top, + bottom = _DeviceUtils$getSafeA.bottom; + + return "(function() { \n document.body.style.marginTop='" + top + "px'; \n document.body.style.marginBottom='" + bottom + "px'; \n })();"; + } + }, { + key: "replaceUrlPlaceHolder", + value: function replaceUrlPlaceHolder(url) { + var PLACEHOLDER_SUBSCRIPTION_TYPE = "##PAYWALL_SUBSCRIPTION_TYPE#"; + var PLACEHOLDER_MACHINE_ID = "##MACHINEID#"; + var PLACEHOLDER_WORDPRESS_TOKEN = "##WORDPRESS_TOKEN#"; + var subscription = ""; + + if (!url.includes("?")) { + url += "?"; + } + + if (url.includes(PLACEHOLDER_SUBSCRIPTION_TYPE)) { + url = url.replace(PLACEHOLDER_SUBSCRIPTION_TYPE, subscription); + } else { + url = url + "&subType=" + subscription; + } + + if (url.includes(PLACEHOLDER_MACHINE_ID)) { + url = url.replace(PLACEHOLDER_MACHINE_ID, global.machineId); + } else { + url = url + "&MACHINEID=" + global.machineId; + } + + if (url.includes(PLACEHOLDER_WORDPRESS_TOKEN)) { + url = url.replace(PLACEHOLDER_WORDPRESS_TOKEN, WebUtils.secretTokenForWordpress()); + } + + return url; + } + }, { + key: "secretTokenForWordpress", + value: function secretTokenForWordpress() { + var unixTimestamp = new Date().getTime(); + return _$$_REQUIRE(_dependencyMap[4]).StringUtils.getMd5(_$$_REQUIRE(_dependencyMap[4]).StringUtils.getMd5("TecnaviaSecret") + global.machineId) + "_" + _$$_REQUIRE(_dependencyMap[4]).StringUtils.getHexOfAsciiOfLong(unixTimestamp / 1000); + } + }]); + return WebUtils; + }(); + + exports.default = WebUtils; +},719,[5,7,8,458,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var Payment = function () { + function Payment() { + var pSetupLine = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + (0, _classCallCheck2.default)(this, Payment); + var splitted = pSetupLine.split(","); + this.type = splitted[0]; + this.price = splitted[1]; + this.startDate = splitted[2]; + this.periodTime = splitted[3]; + this.periodValue = splitted[4]; + this.recurringPattern = splitted[5]; + this.description = splitted[6]; + this.productId = splitted[7]; + } + + (0, _createClass2.default)(Payment, [{ + key: "getType", + value: function getType() { + return this.type; + } + }, { + key: "getPrice", + value: function getPrice() { + return this.price; + } + }, { + key: "getPriceNumber", + value: function getPriceNumber() { + return parseFloat(this.price) || -1; + } + }, { + key: "getStartDate", + value: function getStartDate() { + return this.startDate; + } + }, { + key: "getPeriodTime", + value: function getPeriodTime() { + return this.periodTime; + } + }, { + key: "isWeekly", + value: function isWeekly() { + return this.periodTime === "W"; + } + }, { + key: "isMonthly", + value: function isMonthly() { + return this.periodTime === "M"; + } + }, { + key: "isYearly", + value: function isYearly() { + return this.periodTime === "Y"; + } + }, { + key: "getPeriodValue", + value: function getPeriodValue() { + try { + return parseInt(this.periodValue, 10) || -1; + } catch (e) { + return -1; + } + } + }, { + key: "getRecurringPatter", + value: function getRecurringPatter() { + return this.recurringPattern; + } + }, { + key: "getDescription", + value: function getDescription() { + return this.description; + } + }, { + key: "getProductId", + value: function getProductId() { + return this.productId; + } + }, { + key: "isNotConsumable", + value: function isNotConsumable() { + return this.getType() === "NC"; + } + }, { + key: "isConsumable", + value: function isConsumable() { + return this.getType() === "A"; + } + }, { + key: "isSubscription", + value: function isSubscription() { + return this.getType() === "R"; + } + }, { + key: "checkProductId", + value: function checkProductId(productId) { + if (productId === this.productId) { + return true; + } + + if (this.isNotConsumable() && productId.startsWith(this.productId)) { + return true; + } + + return false; + } + }]); + return Payment; + }(); + + exports.default = Payment; +},720,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.LoginStatus = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _LoginHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var LoginStatus = function () { + function LoginStatus() { + (0, _classCallCheck2.default)(this, LoginStatus); + } + + (0, _createClass2.default)(LoginStatus, [{ + key: "init", + value: function init(udb) { + var keys, i, key; + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + this.udb = udb; + keys = Object.values(_LoginHelper.default.SP.keys); + i = 0; + + case 3: + if (!(i < keys.length)) { + _context.next = 11; + break; + } + + key = keys[i]; + _context.next = 7; + return _regenerator.default.awrap(this.getValue(key)); + + case 7: + this[key] = _context.sent; + + case 8: + i++; + _context.next = 3; + break; + + case 11: + return _context.abrupt("return", true); + + case 12: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setValue", + value: function setValue(key, value) { + this[key] = value; + + _LoginHelper.default.setItem(this.udb + "_" + key, value); + } + }, { + key: "getValue", + value: function getValue(key) { + var value; + return _regenerator.default.async(function getValue$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + value = this[key]; + + if (!_$$_REQUIRE(_dependencyMap[5]).JSUtils.isNull(value)) { + _context2.next = 6; + break; + } + + _context2.next = 4; + return _regenerator.default.awrap(_LoginHelper.default.getItem(this.udb + "_" + key)); + + case 4: + value = _context2.sent; + + if (key === _LoginHelper.default.SP.keys.has_access) { + try { + value = JSON.parse(value); + } catch (e) {} + } else if (key === _LoginHelper.default.SP.keys.allowed_ip_user) { + value = value === "1"; + } + + case 6: + return _context2.abrupt("return", value); + + case 7: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "updateValue", + value: function updateValue(key, value) { + if (value) { + this.setValue(key, value); + } else { + this.removeValue(key); + } + } + }, { + key: "removeValue", + value: function removeValue(key) { + this[key] = null; + + _LoginHelper.default.removeItem(this.udb + "_" + key); + } + }, { + key: "isAnonymousUser", + value: function isAnonymousUser() { + return this.username && global.machineId && this.username === global.machineId; + } + }, { + key: "isLoggedIn", + value: function isLoggedIn() { + return LoginStatus.isValidTAUID(this.TAUID) && !this.isAnonymousUser(); + } + }, { + key: "isAdFree", + value: function isAdFree() { + return this.adFree === "1"; + } + }, { + key: "userHasAccess", + value: function userHasAccess(issue, edition) { + if (this.hasAccess && this.hasAccess[edition]) { + return this.hasAccess[edition][issue] === "1"; + } + + return false; + } + }, { + key: "setHasAccess", + value: function setHasAccess(issue, edition, hasAccess) { + var hasAccessValue = hasAccess ? "1" : "0"; + + if (!this.hasAccess) { + this.hasAccess = {}; + } + + if (!this.hasAccess[edition]) { + this.hasAccess[edition] = {}; + } + + this.hasAccess[edition][issue] = hasAccessValue; + + _LoginHelper.default.setItem(this.udb + "_" + _LoginHelper.default.SP.keys.has_access, JSON.stringify(this.hasAccess)); + } + }, { + key: "setLastModified", + value: function setLastModified() { + this.setValue(_LoginHelper.default.SP.keys.last_login_time, new Date().getTime().toString()); + } + }, { + key: "getLastModified", + value: function getLastModified() { + return _regenerator.default.async(function getLastModified$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", this.getValue(_LoginHelper.default.SP.keys.last_login_time)); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setReceipt", + value: function setReceipt(receipt) { + this.setValue(_LoginHelper.default.SP.keys.receipt, receipt); + this.setValue(_LoginHelper.default.SP.keys.receipt_date, new Date().getTime().toString()); + } + }, { + key: "setTAUID", + value: function setTAUID(TAUID) { + if (TAUID) { + this.setValue(_LoginHelper.default.SP.keys.TAUID, TAUID); + } + } + }, { + key: "setToken", + value: function setToken(token) { + if (token) { + this.setValue(_LoginHelper.default.SP.keys.TOKEN, token); + } + } + }, { + key: "setUniversalLinkToken", + value: function setUniversalLinkToken(token) { + if (token) { + this.setValue(_LoginHelper.default.SP.keys.universal_link_token, token); + } + } + }, { + key: "setOneTimeToken", + value: function setOneTimeToken(oneTimeToken) { + if (oneTimeToken) { + this.setValue(_LoginHelper.default.SP.keys.one_time_token, oneTimeToken); + } + } + }, { + key: "setUsername", + value: function setUsername(username) { + if (username) { + this.setValue(_LoginHelper.default.SP.keys.username, username); + } + } + }, { + key: "setPassword", + value: function setPassword(password) { + if (password) { + this.setValue(_LoginHelper.default.SP.keys.password, password); + } + } + }, { + key: "setChallenge", + value: function setChallenge(challenge) { + if (challenge) { + this.setValue(_LoginHelper.default.SP.keys.challenge, challenge); + } + } + }, { + key: "setExtId", + value: function setExtId(extid) { + if (extid) { + this.setValue(_LoginHelper.default.SP.keys.extid, extid); + } + } + }, { + key: "setExtraUserInfo", + value: function setExtraUserInfo(extraUserInfo) { + if (extraUserInfo) { + var extraUserInfoString = extraUserInfo ? JSON.stringify(extraUserInfo) : ""; + this.setValue(_LoginHelper.default.SP.keys.extra_user_info, extraUserInfoString); + } + } + }, { + key: "setAdFree", + value: function setAdFree(adFree) { + var adFreeValue = adFree !== undefined ? "" + adFree : undefined; + + if (adFreeValue) { + this.setValue(_LoginHelper.default.SP.keys.ad_free, adFreeValue); + } + } + }, { + key: "updateTAUID", + value: function updateTAUID(TAUID) { + this.updateValue(_LoginHelper.default.SP.keys.TAUID, TAUID); + } + }, { + key: "updateToken", + value: function updateToken(token) { + this.updateValue(_LoginHelper.default.SP.keys.TOKEN, token); + } + }, { + key: "updateUniversalLinkToken", + value: function updateUniversalLinkToken(token) { + this.updateValue(_LoginHelper.default.SP.keys.universal_link_token, token); + } + }, { + key: "updateOneTimeToken", + value: function updateOneTimeToken(oneTimeToken) { + this.updateValue(_LoginHelper.default.SP.keys.one_time_token, oneTimeToken); + } + }, { + key: "updateUsername", + value: function updateUsername(username) { + this.updateValue(_LoginHelper.default.SP.keys.username, username); + } + }, { + key: "updatePassword", + value: function updatePassword(password) { + this.updateValue(_LoginHelper.default.SP.keys.password, password); + } + }, { + key: "updateChallenge", + value: function updateChallenge(challenge) { + this.updateValue(_LoginHelper.default.SP.keys.challenge, challenge); + } + }, { + key: "updateExtId", + value: function updateExtId(extid) { + this.updateValue(_LoginHelper.default.SP.keys.extid, extid); + } + }, { + key: "updateExtraUserInfo", + value: function updateExtraUserInfo(extraUserInfo) { + var extraUserInfoString = extraUserInfo ? JSON.stringify(extraUserInfo) : ""; + this.updateValue(_LoginHelper.default.SP.keys.extra_user_info, extraUserInfoString); + } + }, { + key: "updateAdFree", + value: function updateAdFree(adFree) { + var adFreeValue = adFree !== undefined ? "" + adFree : undefined; + this.updateValue(_LoginHelper.default.SP.keys.ad_free, adFreeValue); + } + }, { + key: "resetOneTimeToken", + value: function resetOneTimeToken() { + this.removeValue(_LoginHelper.default.SP.keys.one_time_token); + } + }, { + key: "resetLastModified", + value: function resetLastModified() { + this.removeValue(_LoginHelper.default.SP.keys.last_login_time); + } + }, { + key: "setIAPSecret", + value: function setIAPSecret(secret) { + if (secret) { + this.setValue(_LoginHelper.default.SP.keys.iap_secret, secret); + } else { + this.removeValue(_LoginHelper.default.SP.keys.iap_secret); + } + } + }, { + key: "getIAPSecret", + value: function getIAPSecret() { + return this.iapSecret; + } + }, { + key: "setIsAllowedIPUser", + value: function setIsAllowedIPUser(value) { + this.allowedIPUser = value; + + _LoginHelper.default.setItem(this.udb + "_" + _LoginHelper.default.SP.keys.allowed_ip_user, value ? "1" : "0"); + } + }, { + key: "isAllowedIPUser", + value: function isAllowedIPUser() { + return this.allowedIPUser; + } + }, { + key: "getReceiptToken", + value: function getReceiptToken() { + if (this.iapSecret) { + var unixTimestamp = new Date().getTime(); + var hexTimestamp = Math.trunc(unixTimestamp / 1000).toString(16); + var hexTauid = parseInt(this.TAUID || -1, 10).toString(16); + return _$$_REQUIRE(_dependencyMap[5]).StringUtils.getMd5(this.iapSecret + hexTimestamp + hexTauid) + "_" + hexTimestamp + "_" + hexTauid; + } + + return undefined; + } + }, { + key: "getExtraUserInfo", + value: function getExtraUserInfo() { + var rawExtraUserInfo, extraUserInfo; + return _regenerator.default.async(function getExtraUserInfo$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _context4.next = 2; + return _regenerator.default.awrap(this.getValue(_LoginHelper.default.SP.keys.extra_user_info)); + + case 2: + rawExtraUserInfo = _context4.sent; + _context4.prev = 3; + extraUserInfo = JSON.parse(rawExtraUserInfo); + return _context4.abrupt("return", extraUserInfo); + + case 8: + _context4.prev = 8; + _context4.t0 = _context4["catch"](3); + + case 10: + return _context4.abrupt("return", {}); + + case 11: + case "end": + return _context4.stop(); + } + } + }, null, this, [[3, 8]], Promise); + } + }, { + key: "clear", + value: function clear() { + var keys, i, key; + return _regenerator.default.async(function clear$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + keys = Object.values(_LoginHelper.default.SP.keys); + i = 0; + + case 2: + if (!(i < keys.length)) { + _context5.next = 9; + break; + } + + key = keys[i]; + _context5.next = 6; + return _regenerator.default.awrap(this.removeValue(key)); + + case 6: + i++; + _context5.next = 2; + break; + + case 9: + case "end": + return _context5.stop(); + } + } + }, null, this, null, Promise); + } + }], [{ + key: "isValidTAUID", + value: function isValidTAUID(TAUID) { + return TAUID && parseInt(TAUID, 10) > -1; + } + }]); + return LoginStatus; + }(); + + exports.LoginStatus = LoginStatus; +},721,[5,80,7,8,722,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var LoginHelper = function () { + function LoginHelper() { + (0, _classCallCheck2.default)(this, LoginHelper); + } + + (0, _createClass2.default)(LoginHelper, null, [{ + key: "getItem", + value: function getItem(key) { + return _regenerator.default.async(function getItem$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _$$_REQUIRE(_dependencyMap[4]).StorageUtils.getItem(LoginHelper.SP.name, key)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "setItem", + value: function setItem(key, value) { + return _regenerator.default.async(function setItem$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _$$_REQUIRE(_dependencyMap[4]).StorageUtils.setItem(LoginHelper.SP.name, key, value); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "removeItem", + value: function removeItem(key) { + return _regenerator.default.async(function removeItem$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", _$$_REQUIRE(_dependencyMap[4]).StorageUtils.clear(LoginHelper.SP.name, key)); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "updateItem", + value: function updateItem(key, value) { + return _regenerator.default.async(function updateItem$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (value) { + LoginHelper.setItem(key, value); + } else { + LoginHelper.removeItem(key); + } + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "clearAll", + value: function clearAll() { + return _regenerator.default.async(function clearAll$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", _$$_REQUIRE(_dependencyMap[4]).StorageUtils.clearAll(LoginHelper.SP.name)); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return LoginHelper; + }(); + + exports.default = LoginHelper; + LoginHelper.SP = { + name: "login", + keys: { + TAUID: "TAUID", + TOKEN: "TOKEN", + universal_link_token: "universalLinkToken", + one_time_token: "oneTimeToken", + iap_secret: "iapSecret", + has_access: "hasAccess", + receipt: "receipt", + receipt_date: "receipt_date", + challenge: "challenge", + username: "username", + password: "password", + extid: "extid", + extra_user_info: "extraUserInfo", + last_login_time: "last_login_time", + ad_free: "adFree", + allowed_ip_user: "allowedIPUser" + } + }; +},722,[5,80,7,8,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.OptionspageConfig = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var OptionspageConfig = function () { + function OptionspageConfig(_ref) { + var mode = _ref.mode, + baseURL = _ref.baseURL, + coordinatesString = _ref.coordinatesString, + modal = _ref.modal; + (0, _classCallCheck2.default)(this, OptionspageConfig); + this.mode = mode; + this.baseURL = baseURL; + this.modal = _$$_REQUIRE(_dependencyMap[4]).PlatformUtils.isTablet() && modal; + this.coordinatesString = coordinatesString; + } + + (0, _createClass2.default)(OptionspageConfig, [{ + key: "isDisabled", + value: function isDisabled() { + return this.mode === 0; + } + }, { + key: "alwaysOpenAtStartup", + value: function alwaysOpenAtStartup() { + return this.mode === 1; + } + }, { + key: "getBaseURL", + value: function getBaseURL() { + return this.baseURL; + } + }, { + key: "computeCoordinates", + value: function computeCoordinates() { + var rawCoordinates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var orientation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _deviceUtils.default.currentOrientation; + var top; + var left; + var width; + var height; + var screenWidth; + var screenHeight; + var screenIsPortrait; + + var safeArea = _deviceUtils.default.getSafeArea(); + + if (safeArea) { + screenWidth = safeArea.width; + screenHeight = safeArea.height; + screenIsPortrait = _deviceUtils.default.isPortrait(_deviceUtils.default.currentOrientation); + } else { + var _DeviceUtils$getScree = _deviceUtils.default.getScreenDimensions(orientation); + + screenWidth = _DeviceUtils$getScree.width; + screenHeight = _DeviceUtils$getScree.height; + screenIsPortrait = _DeviceUtils$getScree.isPortrait; + } + + var widthToUse = screenWidth; + var heightToUse = screenHeight; + + var isPortrait = _deviceUtils.default.isPortrait(orientation); + + if (isPortrait !== screenIsPortrait) { + widthToUse = screenHeight; + heightToUse = screenWidth; + } + + if (this.modal) { + height = isPortrait ? widthToUse : heightToUse; + width = isPortrait ? widthToUse : heightToUse; + left = isPortrait ? 0 : Math.abs(widthToUse - heightToUse) / 2; + top = isPortrait ? Math.abs(widthToUse - heightToUse) / 2 : 0; + } else { + height = heightToUse; + width = widthToUse; + left = 0; + top = 0; + } + + var coordSplit = rawCoordinates.split("&"); + + if (coordSplit.length === 8) { + var h = coordSplit[0]; + var hv = coordSplit[1]; + var w = coordSplit[2]; + var wv = coordSplit[3]; + var x = coordSplit[4]; + var xv = coordSplit[5]; + var y = coordSplit[6]; + var yv = coordSplit[7]; + + if (isPortrait) { + height = this.parseSize(hv, heightToUse); + width = this.parseSize(wv, widthToUse); + top = this.parseXY(yv, height, heightToUse); + left = this.parseXY(xv, width, widthToUse); + } else { + height = this.parseSize(h, heightToUse); + width = this.parseSize(w, widthToUse); + top = this.parseXY(y, height, heightToUse); + left = this.parseXY(x, width, widthToUse); + } + } + + if (width > screenWidth) { + left = 0; + width = screenWidth; + } else if (left + width > screenWidth) { + left = Math.max(0, (screenWidth - width) / 2); + } + + if (height > screenHeight) { + top = 0; + height = screenHeight; + } else if (top + height > screenHeight) { + top = Math.max(0, (screenHeight - height) / 2); + } + + var coordinates = { + left: left, + top: top, + width: width, + height: height + }; + return coordinates; + } + }, { + key: "parseSize", + value: function parseSize(value, dimReference) { + var result; + var percIndex = value.indexOf("%"); + + if (percIndex > 0) { + result = parseInt(value.substring(0, percIndex), 10) / 100 * dimReference; + } else { + var pxIndex = value.indexOf("px"); + + if (pxIndex > 0) { + value = value.substring(0, pxIndex); + } + + result = parseInt(value, 10); + } + + return result; + } + }, { + key: "parseXY", + value: function parseXY(value, sizeReference, dimReference) { + var result; + var pxIndex = value.indexOf("px"); + + if (pxIndex > 0) { + value = value.substring(0, pxIndex); + result = parseInt(value, 10); + } else { + if (value === "-1") { + return dimReference - sizeReference; + } + + if (value === "0") { + return (dimReference - sizeReference) / 2; + } + + if (value === "1") { + return 0; + } + + result = parseInt(value, 10); + + if (result < 0) { + result = dimReference - sizeReference + result; + } + } + + return result; + } + }, { + key: "getCoordinates", + value: function getCoordinates() { + var orientation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _deviceUtils.default.currentOrientation; + return this.computeCoordinates(this.coordinatesString, orientation); + } + }, { + key: "isModal", + value: function isModal() { + return this.modal; + } + }]); + return OptionspageConfig; + }(); + + exports.OptionspageConfig = OptionspageConfig; +},723,[5,7,8,458,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FeedbackConfig = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _PaperSetupHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FeedbackConfig = function (_PaperSetupBaseConfig) { + (0, _inherits2.default)(FeedbackConfig, _PaperSetupBaseConfig); + + var _super = _createSuper(FeedbackConfig); + + function FeedbackConfig() { + (0, _classCallCheck2.default)(this, FeedbackConfig); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(FeedbackConfig, [{ + key: "getStorageKeys", + value: function getStorageKeys() { + return _PaperSetupHelper.default.SP.keys.feedback; + } + }, { + key: "init", + value: function init() { + var json, + _this$getStorageKeys, + show_dont_show_again, + lower_active_date_range, + upper_active_date_range, + active_days_to_show, + total_days_to_show, + request_title, + request_review_title, + ask, + email, + reset_timestamp, + cool_down_days, + cool_down_days_dont_show_again, + _args = arguments; + + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + json = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + _context.next = 3; + return _regenerator.default.awrap((0, _get2.default)((0, _getPrototypeOf2.default)(FeedbackConfig.prototype), "init", this).call(this, json)); + + case 3: + _this$getStorageKeys = this.getStorageKeys(), show_dont_show_again = _this$getStorageKeys.show_dont_show_again, lower_active_date_range = _this$getStorageKeys.lower_active_date_range, upper_active_date_range = _this$getStorageKeys.upper_active_date_range, active_days_to_show = _this$getStorageKeys.active_days_to_show, total_days_to_show = _this$getStorageKeys.total_days_to_show, request_title = _this$getStorageKeys.request_title, request_review_title = _this$getStorageKeys.request_review_title, ask = _this$getStorageKeys.ask, email = _this$getStorageKeys.email, reset_timestamp = _this$getStorageKeys.reset_timestamp, cool_down_days = _this$getStorageKeys.cool_down_days, cool_down_days_dont_show_again = _this$getStorageKeys.cool_down_days_dont_show_again; + _context.next = 6; + return _regenerator.default.awrap(this.getValue(show_dont_show_again)); + + case 6: + _context.t0 = _context.sent; + this.showDontShowAgain = _context.t0 === "1"; + _context.t2 = parseInt; + _context.next = 11; + return _regenerator.default.awrap(this.getValue(lower_active_date_range)); + + case 11: + _context.t3 = _context.sent; + _context.t1 = (0, _context.t2)(_context.t3, 10); + + if (_context.t1) { + _context.next = 15; + break; + } + + _context.t1 = "1"; + + case 15: + _context.t4 = _context.t1; + _context.t5 = _$$_REQUIRE(_dependencyMap[9]).DateUtils.DAY_IN_MILLS; + this.lowerActiveDateRange = _context.t4 * _context.t5; + _context.t7 = parseInt; + _context.next = 21; + return _regenerator.default.awrap(this.getValue(upper_active_date_range)); + + case 21: + _context.t8 = _context.sent; + _context.t6 = (0, _context.t7)(_context.t8, 10); + + if (_context.t6) { + _context.next = 25; + break; + } + + _context.t6 = "3"; + + case 25: + _context.t9 = _context.t6; + _context.t10 = _$$_REQUIRE(_dependencyMap[9]).DateUtils.DAY_IN_MILLS; + this.upperActiveDateRange = _context.t9 * _context.t10; + _context.t11 = parseInt; + _context.next = 31; + return _regenerator.default.awrap(this.getValue(active_days_to_show)); + + case 31: + _context.t12 = _context.sent; + + if (_context.t12) { + _context.next = 34; + break; + } + + _context.t12 = "6"; + + case 34: + _context.t13 = _context.t12; + this.activeDaysToShow = (0, _context.t11)(_context.t13, 10); + _context.t14 = parseInt; + _context.next = 39; + return _regenerator.default.awrap(this.getValue(total_days_to_show)); + + case 39: + _context.t15 = _context.sent; + + if (_context.t15) { + _context.next = 42; + break; + } + + _context.t15 = "15"; + + case 42: + _context.t16 = _context.t15; + this.totalDaysToShow = (0, _context.t14)(_context.t16, 10); + _context.next = 46; + return _regenerator.default.awrap(this.getValue(request_title)); + + case 46: + this.requestFeedbackTitle = _context.sent; + _context.next = 49; + return _regenerator.default.awrap(this.getValue(request_review_title)); + + case 49: + this.requestReviewFeedbackTitle = _context.sent; + _context.next = 52; + return _regenerator.default.awrap(this.getValue(ask)); + + case 52: + this.askForFeedback = _context.sent; + _context.next = 55; + return _regenerator.default.awrap(this.getValue(email)); + + case 55: + this.emailForFeedback = _context.sent; + _context.next = 58; + return _regenerator.default.awrap(this.getValue(reset_timestamp)); + + case 58: + this.resetTimestamp = _context.sent; + + if (this.resetTimestamp && this.resetTimestamp.length < 14) { + this.resetTimestamp = this.resetTimestamp.padEnd(14, "0"); + } + + _context.t17 = parseInt; + _context.next = 63; + return _regenerator.default.awrap(this.getValue(cool_down_days)); + + case 63: + _context.t18 = _context.sent; + + if (_context.t18) { + _context.next = 66; + break; + } + + _context.t18 = "60"; + + case 66: + _context.t19 = _context.t18; + this.coolDownDays = (0, _context.t17)(_context.t19, 10); + _context.t20 = parseInt; + _context.next = 71; + return _regenerator.default.awrap(this.getValue(cool_down_days_dont_show_again)); + + case 71: + _context.t21 = _context.sent; + + if (_context.t21) { + _context.next = 74; + break; + } + + _context.t21 = "90"; + + case 74: + _context.t22 = _context.t21; + this.coolDownDaysDontShowAgain = (0, _context.t20)(_context.t22, 10); + return _context.abrupt("return", true); + + case 77: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return FeedbackConfig; + }(_$$_REQUIRE(_dependencyMap[10]).PaperSetupBaseConfig); + + exports.FeedbackConfig = FeedbackConfig; +},724,[5,80,7,8,90,12,14,16,718,462,725]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PaperSetupBaseConfig = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _PaperSetupHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var PaperSetupBaseConfig = function () { + function PaperSetupBaseConfig(pSetup, machine) { + (0, _classCallCheck2.default)(this, PaperSetupBaseConfig); + this.pSetup = pSetup; + this.originalMachine = machine; + this.storageKey = pSetup + "-" + machine; + } + + (0, _createClass2.default)(PaperSetupBaseConfig, [{ + key: "getStorageKeys", + value: function getStorageKeys() { + return {}; + } + }, { + key: "getJSONKeys", + value: function getJSONKeys() { + var storage = _$$_REQUIRE(_dependencyMap[5]).JSUtils.flattenObject(this.getStorageKeys()); + + return Object.values(storage); + } + }, { + key: "filterJSON", + value: function filterJSON(json) { + var jsonKeys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (jsonKeys && jsonKeys.length > 0) { + return Object.keys(json).reduce(function (prev, current) { + if (jsonKeys.includes(current)) { + prev[current] = json[current]; + } + + return prev; + }, {}); + } + + return json; + } + }, { + key: "init", + value: function init() { + var json, + _args = arguments; + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + json = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + this.json = this.filterJSON(json, this.getJSONKeys()); + return _context.abrupt("return", true); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setValue", + value: function setValue(key, value) { + return _regenerator.default.async(function setValue$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this.json[key] = value; + return _context2.abrupt("return", _PaperSetupHelper.default.setItem(this.storageKey, key, value)); + + case 2: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getValue", + value: function getValue(key) { + var value; + return _regenerator.default.async(function getValue$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!_$$_REQUIRE(_dependencyMap[5]).JSUtils.hasProperty(this.json, key)) { + _context3.next = 7; + break; + } + + value = this.json[key]; + + if (!(value === null || value === undefined)) { + _context3.next = 6; + break; + } + + _context3.next = 5; + return _regenerator.default.awrap(_PaperSetupHelper.default.getItem(this.storageKey, key)); + + case 5: + value = _context3.sent; + + case 6: + return _context3.abrupt("return", value); + + case 7: + return _context3.abrupt("return", ""); + + case 8: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return PaperSetupBaseConfig; + }(); + + exports.PaperSetupBaseConfig = PaperSetupBaseConfig; +},725,[5,80,7,8,718,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.AdobeAnalyticsConfig = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _PaperSetupHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AdobeAnalyticsConfig = function (_PaperSetupBaseConfig) { + (0, _inherits2.default)(AdobeAnalyticsConfig, _PaperSetupBaseConfig); + + var _super = _createSuper(AdobeAnalyticsConfig); + + function AdobeAnalyticsConfig() { + (0, _classCallCheck2.default)(this, AdobeAnalyticsConfig); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(AdobeAnalyticsConfig, [{ + key: "getStorageKeys", + value: function getStorageKeys() { + return _PaperSetupHelper.default.SP.keys.adobe_analytics; + } + }, { + key: "init", + value: function init() { + var json, + _this$getStorageKeys, + props_list, + send_only_edition_load, + first_page_section_prefix, + edition_type, + device_type, + user_types, + actions, + states, + media, + content_types, + _args = arguments; + + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + json = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + _context.next = 3; + return _regenerator.default.awrap((0, _get2.default)((0, _getPrototypeOf2.default)(AdobeAnalyticsConfig.prototype), "init", this).call(this, json)); + + case 3: + _this$getStorageKeys = this.getStorageKeys(), props_list = _this$getStorageKeys.props_list, send_only_edition_load = _this$getStorageKeys.send_only_edition_load, first_page_section_prefix = _this$getStorageKeys.first_page_section_prefix, edition_type = _this$getStorageKeys.edition_type, device_type = _this$getStorageKeys.device_type, user_types = _this$getStorageKeys.user_types, actions = _this$getStorageKeys.actions, states = _this$getStorageKeys.states, media = _this$getStorageKeys.media, content_types = _this$getStorageKeys.content_types; + _context.next = 6; + return _regenerator.default.awrap(this.getValue(props_list)); + + case 6: + _context.t0 = _context.sent; + + if (_context.t0) { + _context.next = 9; + break; + } + + _context.t0 = ""; + + case 9: + this.propsList = _context.t0; + _context.next = 12; + return _regenerator.default.awrap(this.getValue(send_only_edition_load)); + + case 12: + _context.t1 = _context.sent; + + if (_context.t1) { + _context.next = 15; + break; + } + + _context.t1 = "0"; + + case 15: + _context.t2 = _context.t1; + this.sendOnlyEditionLoad = _context.t2 === "1"; + _context.next = 19; + return _regenerator.default.awrap(this.getValue(user_types.unknown)); + + case 19: + _context.t3 = _context.sent; + + if (_context.t3) { + _context.next = 22; + break; + } + + _context.t3 = ""; + + case 22: + this.userTypeUnknown = _context.t3; + _context.next = 25; + return _regenerator.default.awrap(this.getValue(user_types.subscriber)); + + case 25: + _context.t4 = _context.sent; + + if (_context.t4) { + _context.next = 28; + break; + } + + _context.t4 = ""; + + case 28: + this.userTypeSubscriber = _context.t4; + _context.next = 31; + return _regenerator.default.awrap(this.getValue(actions.edition_load)); + + case 31: + _context.t5 = _context.sent; + + if (_context.t5) { + _context.next = 34; + break; + } + + _context.t5 = ""; + + case 34: + this.editionLoadActionName = _context.t5; + _context.next = 37; + return _regenerator.default.awrap(this.getValue(actions.scroll_zoom)); + + case 37: + _context.t6 = _context.sent; + + if (_context.t6) { + _context.next = 40; + break; + } + + _context.t6 = ""; + + case 40: + this.scrollZoomActionName = _context.t6; + _context.next = 43; + return _regenerator.default.awrap(this.getValue(actions.double_tap_to_zoom)); + + case 43: + _context.t7 = _context.sent; + + if (_context.t7) { + _context.next = 46; + break; + } + + _context.t7 = ""; + + case 46: + this.doubleTapActionName = _context.t7; + _context.next = 49; + return _regenerator.default.awrap(this.getValue(actions.pinch_to_zoom)); + + case 49: + _context.t8 = _context.sent; + + if (_context.t8) { + _context.next = 52; + break; + } + + _context.t8 = ""; + + case 52: + this.pinchOutActionName = _context.t8; + _context.next = 55; + return _regenerator.default.awrap(this.getValue(actions.tts)); + + case 55: + _context.t9 = _context.sent; + + if (_context.t9) { + _context.next = 58; + break; + } + + _context.t9 = ""; + + case 58: + this.textToSpeechActionName = _context.t9; + _context.next = 61; + return _regenerator.default.awrap(this.getValue(actions.skip_to_end)); + + case 61: + _context.t10 = _context.sent; + + if (_context.t10) { + _context.next = 64; + break; + } + + _context.t10 = ""; + + case 64: + this.skipToEndActionName = _context.t10; + _context.next = 67; + return _regenerator.default.awrap(this.getValue(actions.toggle_to_print)); + + case 67: + _context.t11 = _context.sent; + + if (_context.t11) { + _context.next = 70; + break; + } + + _context.t11 = ""; + + case 70: + this.toggleToPrintActionName = _context.t11; + _context.next = 73; + return _regenerator.default.awrap(this.getValue(actions.toggle_to_digital)); + + case 73: + _context.t12 = _context.sent; + + if (_context.t12) { + _context.next = 76; + break; + } + + _context.t12 = ""; + + case 76: + this.toggleToDigitalActionName = _context.t12; + _context.next = 79; + return _regenerator.default.awrap(this.getValue(actions.share)); + + case 79: + _context.t13 = _context.sent; + + if (_context.t13) { + _context.next = 82; + break; + } + + _context.t13 = ""; + + case 82: + this.shareActionName = _context.t13; + _context.next = 85; + return _regenerator.default.awrap(this.getValue(actions.link_click)); + + case 85: + _context.t14 = _context.sent; + + if (_context.t14) { + _context.next = 88; + break; + } + + _context.t14 = ""; + + case 88: + this.linkClickActionName = _context.t14; + _context.next = 91; + return _regenerator.default.awrap(this.getValue(states.scrolled)); + + case 91: + _context.t15 = _context.sent; + + if (_context.t15) { + _context.next = 94; + break; + } + + _context.t15 = ""; + + case 94: + this.scrolledStateName = _context.t15; + _context.next = 97; + return _regenerator.default.awrap(this.getValue(states.read)); + + case 97: + _context.t16 = _context.sent; + + if (_context.t16) { + _context.next = 100; + break; + } + + _context.t16 = ""; + + case 100: + this.readStateName = _context.t16; + _context.next = 103; + return _regenerator.default.awrap(this.getValue(states.zoomed)); + + case 103: + _context.t17 = _context.sent; + + if (_context.t17) { + _context.next = 106; + break; + } + + _context.t17 = ""; + + case 106: + this.zoomedStateName = _context.t17; + _context.next = 109; + return _regenerator.default.awrap(this.getValue(states.index)); + + case 109: + _context.t18 = _context.sent; + + if (_context.t18) { + _context.next = 112; + break; + } + + _context.t18 = ""; + + case 112: + this.indexStateName = _context.t18; + _context.next = 115; + return _regenerator.default.awrap(this.getValue(states.optionspage)); + + case 115: + _context.t19 = _context.sent; + + if (_context.t19) { + _context.next = 118; + break; + } + + _context.t19 = ""; + + case 118: + this.optionspageStateName = _context.t19; + _context.next = 121; + return _regenerator.default.awrap(this.getValue(media.print)); + + case 121: + _context.t20 = _context.sent; + + if (_context.t20) { + _context.next = 124; + break; + } + + _context.t20 = "print"; + + case 124: + this.printMedium = _context.t20; + _context.next = 127; + return _regenerator.default.awrap(this.getValue(media.digital)); + + case 127: + _context.t21 = _context.sent; + + if (_context.t21) { + _context.next = 130; + break; + } + + _context.t21 = "digital"; + + case 130: + this.digitalMedium = _context.t21; + _context.next = 133; + return _regenerator.default.awrap(this.getValue(media.zoomed_suffix)); + + case 133: + _context.t22 = _context.sent; + + if (_context.t22) { + _context.next = 136; + break; + } + + _context.t22 = " zoom"; + + case 136: + this.zoomedMediumSuffix = _context.t22; + _context.next = 139; + return _regenerator.default.awrap(this.getValue(first_page_section_prefix)); + + case 139: + _context.t23 = _context.sent; + + if (_context.t23) { + _context.next = 142; + break; + } + + _context.t23 = ""; + + case 142: + this.firstPageSectionPrefix = _context.t23; + _context.next = 145; + return _regenerator.default.awrap(this.getValue(content_types.page)); + + case 145: + _context.t24 = _context.sent; + + if (_context.t24) { + _context.next = 148; + break; + } + + _context.t24 = ""; + + case 148: + this.pageContentType = _context.t24; + _context.next = 151; + return _regenerator.default.awrap(this.getValue(content_types.first_page)); + + case 151: + _context.t25 = _context.sent; + + if (_context.t25) { + _context.next = 154; + break; + } + + _context.t25 = this.pageContentType; + + case 154: + this.firstPageContentType = _context.t25; + _context.next = 157; + return _regenerator.default.awrap(this.getValue(content_types.index)); + + case 157: + _context.t26 = _context.sent; + + if (_context.t26) { + _context.next = 160; + break; + } + + _context.t26 = ""; + + case 160: + this.indexContentType = _context.t26; + _context.next = 163; + return _regenerator.default.awrap(this.getValue(content_types.article)); + + case 163: + _context.t27 = _context.sent; + + if (_context.t27) { + _context.next = 166; + break; + } + + _context.t27 = ""; + + case 166: + this.articleContentType = _context.t27; + _context.next = 169; + return _regenerator.default.awrap(this.getValue(content_types.optionspage)); + + case 169: + _context.t28 = _context.sent; + + if (_context.t28) { + _context.next = 172; + break; + } + + _context.t28 = ""; + + case 172: + this.optionspageContentType = _context.t28; + _context.next = 175; + return _regenerator.default.awrap(this.getValue(edition_type)); + + case 175: + _context.t29 = _context.sent; + + if (_context.t29) { + _context.next = 178; + break; + } + + _context.t29 = "Newspaper"; + + case 178: + this.editionType = _context.t29; + _context.next = 181; + return _regenerator.default.awrap(this.getValue(device_type)); + + case 181: + _context.t30 = _context.sent; + + if (_context.t30) { + _context.next = 184; + break; + } + + _context.t30 = _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isTablet() ? "Tablet" : "Mobile Phone"; + + case 184: + this.deviceType = _context.t30; + return _context.abrupt("return", true); + + case 186: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return AdobeAnalyticsConfig; + }(_$$_REQUIRE(_dependencyMap[10]).PaperSetupBaseConfig); + + exports.AdobeAnalyticsConfig = AdobeAnalyticsConfig; +},726,[5,80,7,8,90,12,14,16,718,462,725]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.MatomoConfig = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _PaperSetupHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MatomoConfig = function (_PaperSetupBaseConfig) { + (0, _inherits2.default)(MatomoConfig, _PaperSetupBaseConfig); + + var _super = _createSuper(MatomoConfig); + + function MatomoConfig() { + (0, _classCallCheck2.default)(this, MatomoConfig); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(MatomoConfig, [{ + key: "getStorageKeys", + value: function getStorageKeys() { + return _PaperSetupHelper.default.SP.keys.matomo; + } + }, { + key: "init", + value: function init() { + var json, + defaultCustomDimensions, + _this$getStorageKeys, + site_id, + rss_site_id, + base_url, + visit_custom_dimensions, + custom_dimensions, + dispatch_interval, + _args = arguments; + + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + json = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + defaultCustomDimensions = _args.length > 1 && _args[1] !== undefined ? _args[1] : ""; + _context.next = 4; + return _regenerator.default.awrap((0, _get2.default)((0, _getPrototypeOf2.default)(MatomoConfig.prototype), "init", this).call(this, json)); + + case 4: + _this$getStorageKeys = this.getStorageKeys(), site_id = _this$getStorageKeys.site_id, rss_site_id = _this$getStorageKeys.rss_site_id, base_url = _this$getStorageKeys.base_url, visit_custom_dimensions = _this$getStorageKeys.visit_custom_dimensions, custom_dimensions = _this$getStorageKeys.custom_dimensions, dispatch_interval = _this$getStorageKeys.dispatch_interval; + _context.next = 7; + return _regenerator.default.awrap(this.getValue(site_id)); + + case 7: + _context.t0 = _context.sent; + + if (_context.t0) { + _context.next = 10; + break; + } + + _context.t0 = ""; + + case 10: + this.ePaperSiteId = _context.t0; + _context.next = 13; + return _regenerator.default.awrap(this.getValue(rss_site_id)); + + case 13: + _context.t1 = _context.sent; + + if (_context.t1) { + _context.next = 16; + break; + } + + _context.t1 = ""; + + case 16: + this.rssSiteId = _context.t1; + _context.next = 19; + return _regenerator.default.awrap(this.getValue(base_url)); + + case 19: + _context.t2 = _context.sent; + + if (_context.t2) { + _context.next = 22; + break; + } + + _context.t2 = ""; + + case 22: + this.baseURL = _context.t2; + _context.next = 25; + return _regenerator.default.awrap(this.getValue(visit_custom_dimensions)); + + case 25: + _context.t3 = _context.sent; + + if (_context.t3) { + _context.next = 28; + break; + } + + _context.t3 = ""; + + case 28: + this.visitCustomDimensions = _context.t3; + _context.next = 31; + return _regenerator.default.awrap(this.getValue(custom_dimensions)); + + case 31: + _context.t4 = _context.sent; + + if (_context.t4) { + _context.next = 34; + break; + } + + _context.t4 = defaultCustomDimensions; + + case 34: + this.customDimensions = _context.t4; + _context.t5 = parseFloat; + _context.next = 38; + return _regenerator.default.awrap(this.getValue(dispatch_interval)); + + case 38: + _context.t6 = _context.sent; + + if (_context.t6) { + _context.next = 41; + break; + } + + _context.t6 = "30.0"; + + case 41: + _context.t7 = _context.t6; + this.dispatchInterval = (0, _context.t5)(_context.t7); + return _context.abrupt("return", true); + + case 44: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return MatomoConfig; + }(_$$_REQUIRE(_dependencyMap[9]).PaperSetupBaseConfig); + + exports.MatomoConfig = MatomoConfig; +},727,[5,80,7,8,90,12,14,16,718,725]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.MatomoTrackerConfig = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _PaperSetupHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MatomoTrackerConfig = function (_PaperSetupBaseConfig) { + (0, _inherits2.default)(MatomoTrackerConfig, _PaperSetupBaseConfig); + + var _super = _createSuper(MatomoTrackerConfig); + + function MatomoTrackerConfig() { + (0, _classCallCheck2.default)(this, MatomoTrackerConfig); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(MatomoTrackerConfig, [{ + key: "getStorageKeys", + value: function getStorageKeys() { + return _PaperSetupHelper.default.SP.keys.matomo_tracker; + } + }, { + key: "init", + value: function init() { + var json, + _this$getStorageKeys, + site_id, + rss_site_id, + base_url, + action_base_url, + edition_remapping, + titles, + custom_urls, + custom_dimensions, + _args = arguments; + + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + json = _args.length > 0 && _args[0] !== undefined ? _args[0] : {}; + _context.next = 3; + return _regenerator.default.awrap((0, _get2.default)((0, _getPrototypeOf2.default)(MatomoTrackerConfig.prototype), "init", this).call(this, json)); + + case 3: + _this$getStorageKeys = this.getStorageKeys(), site_id = _this$getStorageKeys.site_id, rss_site_id = _this$getStorageKeys.rss_site_id, base_url = _this$getStorageKeys.base_url, action_base_url = _this$getStorageKeys.action_base_url, edition_remapping = _this$getStorageKeys.edition_remapping, titles = _this$getStorageKeys.titles, custom_urls = _this$getStorageKeys.custom_urls, custom_dimensions = _this$getStorageKeys.custom_dimensions; + _context.next = 6; + return _regenerator.default.awrap(this.getValue(site_id)); + + case 6: + _context.t0 = _context.sent; + + if (_context.t0) { + _context.next = 9; + break; + } + + _context.t0 = ""; + + case 9: + this.ePaperSiteId = _context.t0; + _context.next = 12; + return _regenerator.default.awrap(this.getValue(rss_site_id)); + + case 12: + _context.t1 = _context.sent; + + if (_context.t1) { + _context.next = 15; + break; + } + + _context.t1 = ""; + + case 15: + this.rssSiteId = _context.t1; + _context.next = 18; + return _regenerator.default.awrap(this.getValue(base_url)); + + case 18: + _context.t2 = _context.sent; + + if (_context.t2) { + _context.next = 21; + break; + } + + _context.t2 = ""; + + case 21: + this.baseURL = _context.t2; + _context.next = 24; + return _regenerator.default.awrap(this.getValue(action_base_url)); + + case 24: + _context.t3 = _context.sent; + + if (_context.t3) { + _context.next = 27; + break; + } + + _context.t3 = ""; + + case 27: + this.actionBaseURL = _context.t3; + _context.t4 = _$$_REQUIRE(_dependencyMap[9]).StringUtils; + _context.next = 31; + return _regenerator.default.awrap(this.getValue(edition_remapping)); + + case 31: + _context.t5 = _context.sent; + + if (_context.t5) { + _context.next = 34; + break; + } + + _context.t5 = ""; + + case 34: + _context.t6 = _context.t5; + this.editionRemapping = _context.t4.parseQuerystring.call(_context.t4, _context.t6); + _context.next = 38; + return _regenerator.default.awrap(this.getValue(titles.scrolled)); + + case 38: + _context.t7 = _context.sent; + + if (_context.t7) { + _context.next = 41; + break; + } + + _context.t7 = ""; + + case 41: + _context.t8 = _context.t7; + _context.next = 44; + return _regenerator.default.awrap(this.getValue(titles.read)); + + case 44: + _context.t9 = _context.sent; + + if (_context.t9) { + _context.next = 47; + break; + } + + _context.t9 = ""; + + case 47: + _context.t10 = _context.t9; + _context.next = 50; + return _regenerator.default.awrap(this.getValue(titles.rss_drawer)); + + case 50: + _context.t11 = _context.sent; + + if (_context.t11) { + _context.next = 53; + break; + } + + _context.t11 = ""; + + case 53: + _context.t12 = _context.t11; + _context.next = 56; + return _regenerator.default.awrap(this.getValue(titles.rss_read)); + + case 56: + _context.t13 = _context.sent; + + if (_context.t13) { + _context.next = 59; + break; + } + + _context.t13 = ""; + + case 59: + _context.t14 = _context.t13; + this.titles = { + scrolled: _context.t8, + read: _context.t10, + rss_drawer: _context.t12, + rss_read: _context.t14 + }; + _context.next = 63; + return _regenerator.default.awrap(this.getValue(custom_urls.scrolled)); + + case 63: + _context.t15 = _context.sent; + + if (_context.t15) { + _context.next = 66; + break; + } + + _context.t15 = ""; + + case 66: + _context.t16 = _context.t15; + _context.next = 69; + return _regenerator.default.awrap(this.getValue(custom_urls.read)); + + case 69: + _context.t17 = _context.sent; + + if (_context.t17) { + _context.next = 72; + break; + } + + _context.t17 = ""; + + case 72: + _context.t18 = _context.t17; + _context.next = 75; + return _regenerator.default.awrap(this.getValue(custom_urls.rss_drawer)); + + case 75: + _context.t19 = _context.sent; + + if (_context.t19) { + _context.next = 78; + break; + } + + _context.t19 = ""; + + case 78: + _context.t20 = _context.t19; + _context.next = 81; + return _regenerator.default.awrap(this.getValue(custom_urls.rss_read)); + + case 81: + _context.t21 = _context.sent; + + if (_context.t21) { + _context.next = 84; + break; + } + + _context.t21 = ""; + + case 84: + _context.t22 = _context.t21; + this.customURLs = { + scrolled: _context.t16, + read: _context.t18, + rss_drawer: _context.t20, + rss_read: _context.t22 + }; + _context.next = 88; + return _regenerator.default.awrap(this.getValue(custom_dimensions.scrolled)); + + case 88: + _context.t23 = _context.sent; + + if (_context.t23) { + _context.next = 91; + break; + } + + _context.t23 = ""; + + case 91: + _context.t24 = _context.t23; + _context.next = 94; + return _regenerator.default.awrap(this.getValue(custom_dimensions.read)); + + case 94: + _context.t25 = _context.sent; + + if (_context.t25) { + _context.next = 97; + break; + } + + _context.t25 = ""; + + case 97: + _context.t26 = _context.t25; + _context.next = 100; + return _regenerator.default.awrap(this.getValue(custom_dimensions.rss_drawer)); + + case 100: + _context.t27 = _context.sent; + + if (_context.t27) { + _context.next = 103; + break; + } + + _context.t27 = ""; + + case 103: + _context.t28 = _context.t27; + _context.next = 106; + return _regenerator.default.awrap(this.getValue(custom_dimensions.rss_read)); + + case 106: + _context.t29 = _context.sent; + + if (_context.t29) { + _context.next = 109; + break; + } + + _context.t29 = ""; + + case 109: + _context.t30 = _context.t29; + this.customDimensions = { + scrolled: _context.t24, + read: _context.t26, + rss_drawer: _context.t28, + rss_read: _context.t30 + }; + return _context.abrupt("return", true); + + case 112: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return MatomoTrackerConfig; + }(_$$_REQUIRE(_dependencyMap[10]).PaperSetupBaseConfig); + + exports.MatomoTrackerConfig = MatomoTrackerConfig; +},728,[5,80,8,90,12,14,16,7,718,462,725]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.HIDE_ANIMATION_DURATION = exports.HIDE_ANIMATION_TIMER = exports.HIDE_ANIMATION_FOOTER_TIMER = exports.FOOTER_FONT_SIZE = exports.SEARCH_COLOR = exports.SEARCH_TEXT_SIZE = exports.INFO_SIZE = exports.PAGE_SIZE = exports.TITLE_SIZE = exports.LIST_ITEM_SEPARATOR_COLOR = exports.LIST_ITEM_SEPARATOR_HEIGHT = exports.LIST_ITEM_PADDING = exports.LIST_ITEM_HEIGHT = exports.LIST_TITLE_SIZE = exports.LOGO_HEIGHT = exports.LOGO_PARENT_HEIGHT = exports.HEADER_FONT_SIZE = exports.HEADER_HR_SIZE = exports.HEADER_BUTTON_SIZE = exports.HEADER_PARENT_BUTTON_PADDING = exports.HEADER_PARENT_BUTTON_SIZE = exports.HEADER_BG_COLOR = exports.SUB_HEADER_HEIGHT = exports.HEADER_PADDING = exports.HEADER_HEIGHT = undefined; + var HEADER_HEIGHT = 50; + exports.HEADER_HEIGHT = HEADER_HEIGHT; + var HEADER_PADDING = 10; + exports.HEADER_PADDING = HEADER_PADDING; + var SUB_HEADER_HEIGHT = 40; + exports.SUB_HEADER_HEIGHT = SUB_HEADER_HEIGHT; + + var HEADER_BG_COLOR = _$$_REQUIRE(_dependencyMap[0]).colors.black; + + exports.HEADER_BG_COLOR = HEADER_BG_COLOR; + var HEADER_PARENT_BUTTON_SIZE = 45; + exports.HEADER_PARENT_BUTTON_SIZE = HEADER_PARENT_BUTTON_SIZE; + var HEADER_PARENT_BUTTON_PADDING = 7.5; + exports.HEADER_PARENT_BUTTON_PADDING = HEADER_PARENT_BUTTON_PADDING; + var HEADER_BUTTON_SIZE = 30; + exports.HEADER_BUTTON_SIZE = HEADER_BUTTON_SIZE; + var HEADER_HR_SIZE = 1; + exports.HEADER_HR_SIZE = HEADER_HR_SIZE; + var HEADER_FONT_SIZE = 18; + exports.HEADER_FONT_SIZE = HEADER_FONT_SIZE; + var LOGO_PARENT_HEIGHT = 50; + exports.LOGO_PARENT_HEIGHT = LOGO_PARENT_HEIGHT; + var LOGO_HEIGHT = "100%"; + exports.LOGO_HEIGHT = LOGO_HEIGHT; + var LIST_TITLE_SIZE = 18; + exports.LIST_TITLE_SIZE = LIST_TITLE_SIZE; + var LIST_ITEM_HEIGHT = 50; + exports.LIST_ITEM_HEIGHT = LIST_ITEM_HEIGHT; + var LIST_ITEM_PADDING = 6; + exports.LIST_ITEM_PADDING = LIST_ITEM_PADDING; + var LIST_ITEM_SEPARATOR_HEIGHT = 0.5; + exports.LIST_ITEM_SEPARATOR_HEIGHT = LIST_ITEM_SEPARATOR_HEIGHT; + + var LIST_ITEM_SEPARATOR_COLOR = _$$_REQUIRE(_dependencyMap[0]).colors.grey300; + + exports.LIST_ITEM_SEPARATOR_COLOR = LIST_ITEM_SEPARATOR_COLOR; + var TITLE_SIZE = 22; + exports.TITLE_SIZE = TITLE_SIZE; + var PAGE_SIZE = 22; + exports.PAGE_SIZE = PAGE_SIZE; + var INFO_SIZE = 16; + exports.INFO_SIZE = INFO_SIZE; + var SEARCH_TEXT_SIZE = 16; + exports.SEARCH_TEXT_SIZE = SEARCH_TEXT_SIZE; + + var SEARCH_COLOR = _$$_REQUIRE(_dependencyMap[0]).colors.md_red_400; + + exports.SEARCH_COLOR = SEARCH_COLOR; + var FOOTER_FONT_SIZE = 16; + exports.FOOTER_FONT_SIZE = FOOTER_FONT_SIZE; + var HIDE_ANIMATION_FOOTER_TIMER = 5000; + exports.HIDE_ANIMATION_FOOTER_TIMER = HIDE_ANIMATION_FOOTER_TIMER; + var HIDE_ANIMATION_TIMER = 3000; + exports.HIDE_ANIMATION_TIMER = HIDE_ANIMATION_TIMER; + var HIDE_ANIMATION_DURATION = 1000; + exports.HIDE_ANIMATION_DURATION = HIDE_ANIMATION_DURATION; +},729,[462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.closeTypes = exports.IAPErrorMessages = exports.locals = exports.tabs = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var tabs = { + access: "access", + accessibility: "accessibility", + account: "account", + archive: "archive", + carousel: "carousel", + contact: "contact", + eenotify: "eenotify", + help: "help", + home: "home", + impressum: "impressum", + login: "login", + market: "market", + purchases: "purchases", + puzzle: "puzzle", + registration: "registration", + rss: "rss", + settings: "connection", + specialsections: "specialsection", + subscribe: "subscribe", + uberabos: "uberabos", + updates: "updates", + validation: "validation", + version: "version", + generic: "generic" + }; + exports.tabs = tabs; + var locals = { + INITPAGE_SET_NEWSPAPER_AND_READ: "xc_initPage_setNewspaperAndRead", + INITPAGE_SET_EXTERNAL_NEWSPAPER: "xc_initPage_setExternalNewspaper", + LOAD_LATEST_PUBLICATION: "xc_loadLatestPublication", + GET_SAVED_ISSUES: "getSavedIssues", + DELETE_ISSUE: "deleteIssue", + RETURN_FROM_LOGIN: "returnFromLogin", + LOGOUT: "xc_initPage_logout", + STORE_USER_INFO: "storeUserInfo", + GET_USER_INFO: "getUserInfo", + BUY: "xc_buy", + RESUME_TRANSACTIONS: "resumeTransactions", + FINISH_TRANSACTION: "finishTransaction", + REQUEST_PRICE_BY_ID: "xc_requestPriceByID", + RESTORE_COMPLETED_TRANSACTIONS: "restoreCompletedTransactions", + SAVE_RECEIPT: "saveReceiptForRecurringPayment", + GET_KEY: "getFromKey", + SET_KEY: "setFromKey", + REMOVE_KEY: "removeKey", + SET_PREF_EDI: "setPrefEdi", + CLEAR_STORAGE: "clearStorage", + GET_CONFIG_DUMP: "getConfigDump", + OPEN_BROWSER: "xc_openBrowser", + OPEN_BROWSER_ALT: "openInAppBrowser", + CLOSE: "closeOptionPage", + GO_BACK: "backButtonClicked", + ALERT: "alert", + CONFIRM: "confirm", + SET_RN_DEMO: "setRnDemo", + OPEN_RSS: "xc_openRSSReader", + GET_USED_SPACE: "getIssuesUsedSpace", + CLOSE_WINDOW: "closeWindow", + GET_PUBLICATIONS_STORED: "getPublicationStored", + SET_PUBLICATION: "setPublication", + DELETE_PUBLICATION: "deletePublication", + OPEN_TAB_HOME: "openTabHome", + OPEN_TAB_LOGIN: "openTabLogin", + EXEC_JS: "xc_execJavascriptInMainApplication", + SHOW_DEBUG_INFO: "showDebugInfo", + OPEN_ACCESSIBILITY_MODE: "xc_openAccessibilityMode", + OPEN_ARCHIVE: "xc_openArchive", + RESTORE_DEFAULT_SETTINGS: "restoreDefaults", + CLOSE_ARTICLE: "art_closeTextArticle", + OPEN_OPTIONSPAGE: "openOptionPage", + SCROLL_TO_PAGE: "xc_scrollToPage", + DISPLAY_LOADER: "displayLoader", + OPEN_NATIVE_SETTINGS_SCREEN: "openNativeSettingsScreen" + }; + exports.locals = locals; + var IAPErrorMessages = { + iap_not_available: "IAP Not Available", + unknown: "Unknown Error", + cancelled: "Payment Cancelled", + user_error: "User Error", + item_unavailable: "Item Unavailable", + remote_error: "Remote Error", + network_error: "Network Error", + service_error: "Service Error", + receipt_failed: "Receipt Failed", + receipt_finished_failed: "Receipt Finished Failed", + not_prepared: "Not Prepared", + not_ended: "Not Ended", + already_owned: "Already Owned", + developer_error: "Developer Error", + billing_response_json_parse_error: "Error Parsing Billing Response JSON", + already_active_subscription: "Already have an active subscription" + }; + exports.IAPErrorMessages = IAPErrorMessages; + var closeTypes = { + close: "close", + back: "back", + none: "none" + }; + exports.closeTypes = closeTypes; + + var OptionspageUtils = function () { + function OptionspageUtils() { + (0, _classCallCheck2.default)(this, OptionspageUtils); + } + + (0, _createClass2.default)(OptionspageUtils, null, [{ + key: "getBaseURL", + value: function getBaseURL() { + var _global$getActivePSet = global.getActivePSetup(), + optionspageConfig = _global$getActivePSet.optionspageConfig; + + return _$$_REQUIRE(_dependencyMap[7]).NetworkUtils.addDefaultProtocol(optionspageConfig.baseURL); + } + }, { + key: "getTabUrl", + value: function getTabUrl(tab) { + var otherGetParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var baseURL = this.getBaseURL(); + + var _StringUtils$segmentU = _$$_REQUIRE(_dependencyMap[7]).StringUtils.segmentUrl(baseURL), + protocol = _StringUtils$segmentU.protocol, + domain = _StringUtils$segmentU.domain, + path = _StringUtils$segmentU.path, + baseGetParams = _StringUtils$segmentU.getParams; + + var params = (0, _extends2.default)({ + tab: tab + }, this.getDefaultParams(), baseGetParams, otherGetParams); + + var queryString = _$$_REQUIRE(_dependencyMap[7]).StringUtils.getQuerystring(params); + + return protocol + "://" + domain + "/" + path + "?" + queryString; + } + }, { + key: "getCustomUrl", + value: function getCustomUrl(baseURL) { + var otherGetParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var _StringUtils$segmentU2 = _$$_REQUIRE(_dependencyMap[7]).StringUtils.segmentUrl(baseURL), + protocol = _StringUtils$segmentU2.protocol, + domain = _StringUtils$segmentU2.domain, + path = _StringUtils$segmentU2.path, + baseGetParams = _StringUtils$segmentU2.getParams; + + var params = (0, _extends2.default)(this.getDefaultParams(), baseGetParams, otherGetParams); + + var queryString = _$$_REQUIRE(_dependencyMap[7]).StringUtils.getQuerystring(params); + + return protocol + "://" + domain + "/" + path + "?" + queryString; + } + }, { + key: "getDefaultParams", + value: function getDefaultParams() { + var _global$getNewsmemory = global.getNewsmemoryConfig(), + network = _global$getNewsmemory.network, + limit = _global$getNewsmemory.limit, + connectivity = _global$getNewsmemory.connectivity; + + var _global$getActivePSet2 = global.getActivePSetup(), + pSetup = _global$getActivePSet2.pSetup, + loginStatus = _global$getActivePSet2.loginStatus; + + var TAUID = loginStatus.TAUID; + var defaultParams = { + pSetup: pSetup, + MACHINEID: global.machineId, + useDB: 1, + ver: _deviceUtils.default.getAppVersion(), + isDebug: global.isDebug, + network: network, + isPhone: _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isTablet() ? 0 : 1, + isKindle: _deviceUtils.default.isKindle() ? 1 : undefined, + limit: limit, + connectivity: connectivity, + accessibilityMode: _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isSystemAccessibilityEnabled() ? "1" : "0" + }; + defaultParams[_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isAndroid() ? "isAndroid" : "isXcode"] = 1; + + if (TAUID) { + defaultParams.TAUID = TAUID; + } + + return defaultParams; + } + }, { + key: "getHomeTabUrl", + value: function getHomeTabUrl() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return this.getTabUrl(tabs.home, params); + } + }, { + key: "getLoginTabUrl", + value: function getLoginTabUrl() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return this.getTabUrl(tabs.account, params); + } + }, { + key: "getHelpTabUrl", + value: function getHelpTabUrl() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return this.getTabUrl(tabs.help, params); + } + }, { + key: "getSettingsTabUrl", + value: function getSettingsTabUrl() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return this.getTabUrl(tabs.settings, params); + } + }, { + key: "isSamePage", + value: function isSamePage(urlA, urlB) { + var ignoreParams = ["r", "edition"]; + + var newUrlA = _$$_REQUIRE(_dependencyMap[7]).StringUtils.removeParams(urlA, ignoreParams); + + var newUrlB = _$$_REQUIRE(_dependencyMap[7]).StringUtils.removeParams(urlB, ignoreParams); + + return newUrlA === newUrlB; + } + }, { + key: "optionPageVersion", + value: function optionPageVersion() { + var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getMainPSetup(); + var optionspageConfig = config.optionspageConfig; + + if (optionspageConfig && optionspageConfig.baseURL) { + var regExp = /(?:opt|optionspage)\.[a-zA-Z0-9]+\.[a-zA-Z0-9.]+/; + var result = regExp.exec(optionspageConfig.baseURL); + + if (result) { + return result[0]; + } + } + + return "n/a"; + } + }, { + key: "getIAPErrorMessage", + value: function getIAPErrorMessage(error) { + var _OptionalPackages$get = _optionalPackageUtils.default.getIapModule(), + IAPErrorCode = _OptionalPackages$get.IAPErrorCode; + + var message = IAPErrorMessages.unknown; + + if (error && IAPErrorCode) { + switch (error.code) { + case IAPErrorCode.E_IAP_NOT_AVAILABLE: + message = IAPErrorMessages.iap_not_available; + break; + + case IAPErrorCode.E_USER_CANCELLED: + message = IAPErrorMessages.cancelled; + break; + + case IAPErrorCode.E_USER_ERROR: + message = IAPErrorMessages.user_error; + break; + + case IAPErrorCode.E_ITEM_UNAVAILABLE: + message = IAPErrorMessages.item_unavailable; + break; + + case IAPErrorCode.E_REMOTE_ERROR: + message = IAPErrorMessages.remote_error; + break; + + case IAPErrorCode.E_NETWORK_ERROR: + message = IAPErrorMessages.network_error; + break; + + case IAPErrorCode.E_SERVICE_ERROR: + message = IAPErrorMessages.service_error; + break; + + case IAPErrorCode.E_RECEIPT_FAILED: + message = IAPErrorMessages.receipt_failed; + break; + + case IAPErrorCode.E_RECEIPT_FINISHED_FAILED: + message = IAPErrorMessages.receipt_finished_failed; + break; + + case IAPErrorCode.E_NOT_PREPARED: + message = IAPErrorMessages.not_prepared; + break; + + case IAPErrorCode.E_NOT_ENDED: + message = IAPErrorMessages.not_ended; + break; + + case IAPErrorCode.E_ALREADY_OWNED: + message = IAPErrorMessages.already_owned; + break; + + case IAPErrorCode.E_DEVELOPER_ERROR: + message = IAPErrorMessages.developer_error; + break; + + case IAPErrorCode.E_BILLING_RESPONSE_JSON_PARSE_ERROR: + message = IAPErrorMessages.billing_response_json_parse_error; + break; + + case IAPErrorCode.E_ACTIVE_SUBSCRIPTION: + message = IAPErrorMessages.already_active_subscription; + break; + } + + if (error.message && error.code !== IAPErrorCode.E_USER_CANCELLED) { + message = error.message; + } + } + + return message; + } + }, { + key: "getTabByURL", + value: function getTabByURL(url) { + var _StringUtils$segmentU3 = _$$_REQUIRE(_dependencyMap[7]).StringUtils.segmentUrl(url), + path = _StringUtils$segmentU3.path, + getParams = _StringUtils$segmentU3.getParams; + + var scriptName = _$$_REQUIRE(_dependencyMap[7]).StringUtils.fileNameFromPath(path); + + var tab = getParams.tab; + + switch (scriptName) { + case "initpage.php": + tab = tabs.home; + break; + + case "ipad_login.php": + tab = tabs.login; + break; + + case "ipad_access.php": + tab = tabs.access; + break; + + case "ipad_subscribe.php": + tab = tabs.subscribe; + break; + + case "ipad_registration.php": + tab = tabs.registration; + break; + + case "ipad_help.php": + tab = tabs.help; + break; + + case "ipad_uberabos.php": + tab = tabs.uberabos; + break; + + case "ipad_contact.php": + tab = tabs.contact; + break; + + case "ipad_impressum.php": + tab = tabs.impressum; + break; + + case "ipad_notify.php": + tab = tabs.eenotify; + break; + + case "ipad_archive.php": + tab = tabs.archive; + break; + + case "ipad_ss.php": + tab = tabs.specialsections; + break; + + case "ipad_puzzle.php": + tab = tabs.puzzle; + break; + + case "ipad_purchases.php": + tab = tabs.purchases; + break; + + case "ipad_updates.php": + tab = tabs.updates; + break; + + case "ipad_market.php": + tab = tabs.market; + break; + + case "ipad_version.php": + tab = tabs.version; + break; + + case "ipad_connection.php": + tab = tabs.settings; + break; + } + + return tab; + } + }, { + key: "getOptionspageGetParams", + value: function getOptionspageGetParams() { + var errorParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var getParams = {}; + + try { + var extraParams = errorParams.extraParams, + editionEncoded = errorParams.edition, + rest = (0, _objectWithoutProperties2.default)(errorParams, ["extraParams", "edition"]); + getParams = (0, _extends2.default)({}, rest, _$$_REQUIRE(_dependencyMap[7]).StringUtils.parseQuerystring(extraParams)); + + if (editionEncoded) { + getParams.edition = _$$_REQUIRE(_dependencyMap[7]).StringUtils.decodeURIComponent(editionEncoded); + } + } catch (e) {} + + return getParams; + } + }]); + return OptionspageUtils; + }(); + + exports.default = OptionspageUtils; +},730,[5,108,6,7,8,458,731,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var NativeOptionsPage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var IOSNewsmemorySDK = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var Dfp = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var RNIap = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var RNHTMLtoPDF = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var IubendaCMP = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Comscore; + var Matomo; + var MatomoTracker; + var AdobeAnalytics; + var MatherAnalytics; + var FacebookAnalytics; + var GoogleAnalytics3; + var FirebaseAnalytics; + var FirebaseCrashlytics; + var IOSClassicEPaper; + var IOSExternalLinkAccount; + var IOSTrackingTransparency; + var PushNotificationIOS; + var PushNotification; + var Push; + var OneSignal; + var Prebid; + var Nativo; + var AdMob; + var Baronweather; + var ViafouraWebView; + var DailyMotionPlayer; + var Voice; + var Maps; + var ScreenshotPrevent; + + var OptionalPackages = function () { + function OptionalPackages() { + (0, _classCallCheck2.default)(this, OptionalPackages); + } + + (0, _createClass2.default)(OptionalPackages, null, [{ + key: "getTrackingTransparency", + value: function getTrackingTransparency() { + return OptionalPackages.isTrackingTransparencyAvailable() ? { + getTrackingStatus: IOSTrackingTransparency.getTrackingStatus, + requestTrackingPermission: IOSTrackingTransparency.requestTrackingPermission + } : {}; + } + }, { + key: "getAdMob", + value: function getAdMob() { + return OptionalPackages.isAdMobAvailable() ? { + BannerAd: AdMob.BannerAd, + BannerAdSize: AdMob.BannerAdSize, + InterstitialAd: AdMob.InterstitialAd, + AdEventType: AdMob.AdEventType, + TestIds: AdMob.TestIds, + RewardedAd: AdMob.RewardedAd, + RewardedAdEventType: AdMob.RewardedAdEventType + } : {}; + } + }, { + key: "getDFP", + value: function getDFP() { + return OptionalPackages.isDFPAvailable() ? { + DFPBanner: Dfp.Banner, + Interstitial: Dfp.Interstitial + } : {}; + } + }, { + key: "getBaronWeather", + value: function getBaronWeather() { + return OptionalPackages.isBaronAvailable() ? Baronweather.default : null; + } + }, { + key: "getNativoAds", + value: function getNativoAds() { + return OptionalPackages.isNativoSDKAvailable() ? { + NativoSDK: Nativo.NativoSDK, + NativoWebContent: Nativo.NativoWebContent, + NativoAd: Nativo.NativoAd, + NativoVideo: Nativo.NativoVideo + } : {}; + } + }, { + key: "getPrebid", + value: function getPrebid() { + return OptionalPackages.isPrebidAvailable() ? { + PrebidBanner: Prebid.PrebidBanner, + PrebidInterstitial: Prebid.PrebidInterstitial + } : {}; + } + }, { + key: "getOneSignal", + value: function getOneSignal() { + return OptionalPackages.isOneSignalAvailable() ? OneSignal.default : null; + } + }, { + key: "getRNHtmlToPdf", + value: function getRNHtmlToPdf() { + return OptionalPackages.isRNHtmlToPdfAvailable() ? RNHTMLtoPDF.default : null; + } + }, { + key: "getMatherAnalytics", + value: function getMatherAnalytics() { + return OptionalPackages.isMatherAnalyticsAvailable() ? { + MatherAnalytics: MatherAnalytics.MatherAnalytics + } : {}; + } + }, { + key: "getComscore", + value: function getComscore() { + return OptionalPackages.isComScoreAvailable() ? Comscore.default : null; + } + }, { + key: "getAdobeAnalytics", + value: function getAdobeAnalytics() { + return OptionalPackages.isAdobeAnalyticsAvailable() ? { + Analytics: AdobeAnalytics.Analytics, + ADBMobileConfig: AdobeAnalytics.Config + } : {}; + } + }, { + key: "getFacebookSDK", + value: function getFacebookSDK() { + return OptionalPackages.isFacebookSDKAvailable() ? { + Settings: FacebookAnalytics.Settings, + AppEventsLogger: FacebookAnalytics.AppEventsLogger + } : {}; + } + }, { + key: "getVoice", + value: function getVoice() { + return OptionalPackages.isVoiceAvailable() ? { + Voice: Voice.default + } : {}; + } + }, { + key: "getPushLibraries", + value: function getPushLibraries() { + return OptionalPackages.isPushAvailable() ? { + CloudMessaging: Push.FirebaseCloudMessaging, + AmazonDeviceMessaging: Push.AmazonDeviceMessaging, + HcmDeviceMessaging: Push.HcmDeviceMessaging, + PushNotification: PushNotification.default, + PushNotificationIOS: PushNotificationIOS.default + } : {}; + } + }, { + key: "getMatomo", + value: function getMatomo() { + return OptionalPackages.isMatomoAvailable() ? Matomo : {}; + } + }, { + key: "getMatomoTracker", + value: function getMatomoTracker() { + return OptionalPackages.isMatomoTrackerAvailable() ? MatomoTracker.default : {}; + } + }, { + key: "getGoogleAnalytics3Tracker", + value: function getGoogleAnalytics3Tracker() { + return OptionalPackages.isGoogleAnalytics3Available() ? GoogleAnalytics3.GoogleAnalyticsTracker : {}; + } + }, { + key: "getIapModule", + value: function getIapModule() { + return OptionalPackages.isIapModuleAvailable() ? { + initConnection: RNIap.initConnection, + endConnection: RNIap.endConnection, + PurchaseError: RNIap.PurchaseError, + ProductPurchase: RNIap.ProductPurchase, + IAPErrorCode: RNIap.ErrorCode, + getProducts: RNIap.getProducts, + getSubscriptions: RNIap.getSubscriptions, + getPurchaseHistory: RNIap.getPurchaseHistory, + flushFailedPurchasesCachedAsPendingAndroid: RNIap.flushFailedPurchasesCachedAsPendingAndroid, + purchaseErrorListener: RNIap.purchaseErrorListener, + purchaseUpdatedListener: RNIap.purchaseUpdatedListener, + finishTransaction: RNIap.finishTransaction, + requestPurchase: RNIap.requestPurchase, + requestSubscription: RNIap.requestSubscription, + getAvailablePurchases: RNIap.getAvailablePurchases, + validateReceiptIos: RNIap.validateReceiptIos, + validateReceiptAmazon: RNIap.validateReceiptAmazon + } : {}; + } + }, { + key: "getNativeOptionsPage", + value: function getNativeOptionsPage() { + return OptionalPackages.isNativeOptionsPageAvailable() ? { + OptionsPage: NativeOptionsPage.default, + Methods: NativeOptionsPage.Methods, + Models: NativeOptionsPage.Models + } : {}; + } + }, { + key: "getCrashlytics", + value: function getCrashlytics() { + return OptionalPackages.isCrashlyticsAvailable() ? FirebaseCrashlytics.default : undefined; + } + }, { + key: "getMaps", + value: function getMaps() { + return OptionalPackages.isMapsAvailable() ? { + Callout: Maps.Callout, + Marker: Maps.Marker, + MapView: Maps.default + } : undefined; + } + }, { + key: "getIOSClassicEPaper", + value: function getIOSClassicEPaper() { + return OptionalPackages.isIOSClassicEPaperAvailable() ? IOSClassicEPaper.default : null; + } + }, { + key: "getIOSExternalLinkAccountAPI", + value: function getIOSExternalLinkAccountAPI() { + return OptionalPackages.isIOSExternalLinkAccountAPIAvailable() ? IOSExternalLinkAccount.default : null; + } + }, { + key: "getIOSNewsmemorySDK", + value: function getIOSNewsmemorySDK() { + return OptionalPackages.isIOSNewsmemorySDKAvailable() ? IOSNewsmemorySDK.default : null; + } + }, { + key: "getViafouraWebView", + value: function getViafouraWebView() { + return OptionalPackages.isViafouraAvailable() ? ViafouraWebView.default : null; + } + }, { + key: "getDailymotionVideoPlayer", + value: function getDailymotionVideoPlayer() { + return OptionalPackages.isDailymotionVideoPlayerAvailable() ? { + Player: DailyMotionPlayer.default, + setConsentString: DailyMotionPlayer.setConsentString + } : {}; + } + }, { + key: "getIubenda", + value: function getIubenda() { + return OptionalPackages.isIubendaCMPAvailable() ? { + Iubenda: IubendaCMP.default, + Container: IubendaCMP.Container + } : {}; + } + }, { + key: "getScreenshotPrevent", + value: function getScreenshotPrevent() { + return OptionalPackages.isScreenshotPreventAvailable() ? { + RNScreenshotPrevent: ScreenshotPrevent.default, + addListener: ScreenshotPrevent.addListener + } : {}; + } + }, { + key: "getFirebaseAnalytics", + value: function getFirebaseAnalytics() { + return OptionalPackages.isFirebaseAnalyticsAvailable() ? FirebaseAnalytics.default : undefined; + } + }, { + key: "isCrashlyticsAvailable", + value: function isCrashlyticsAvailable() { + return OptionalPackages.isModuleAvailable(FirebaseCrashlytics, "@react-native-firebase/crashlytics"); + } + }, { + key: "isFirebaseAnalyticsAvailable", + value: function isFirebaseAnalyticsAvailable() { + return OptionalPackages.isModuleAvailable(FirebaseAnalytics, "@tecnavia/react-native-firebase-analytics"); + } + }, { + key: "isTrackingTransparencyAvailable", + value: function isTrackingTransparencyAvailable() { + return OptionalPackages.isModuleAvailable(IOSTrackingTransparency, "react-native-tracking-transparency"); + } + }, { + key: "isAdMobAvailable", + value: function isAdMobAvailable() { + return OptionalPackages.isModuleAvailable(AdMob, "@tecnavia/react-native-admob"); + } + }, { + key: "isDFPAvailable", + value: function isDFPAvailable() { + return OptionalPackages.isModuleAvailable(Dfp, "@tecnavia/react-native-dfp"); + } + }, { + key: "isBaronAvailable", + value: function isBaronAvailable() { + return OptionalPackages.isModuleAvailable(Baronweather, "react-native-baronweather"); + } + }, { + key: "isPrebidAvailable", + value: function isPrebidAvailable() { + return OptionalPackages.isModuleAvailable(Prebid, "react-native-prebid"); + } + }, { + key: "isNativoSDKAvailable", + value: function isNativoSDKAvailable() { + return OptionalPackages.isModuleAvailable(Nativo, "react-native-nativo-ads"); + } + }, { + key: "isOneSignalAvailable", + value: function isOneSignalAvailable() { + return OptionalPackages.isModuleAvailable(OneSignal, "react-native-onesignal"); + } + }, { + key: "isRNHtmlToPdfAvailable", + value: function isRNHtmlToPdfAvailable() { + return OptionalPackages.isModuleAvailable(RNHTMLtoPDF, "react-native-html-to-pdf"); + } + }, { + key: "isComScoreAvailable", + value: function isComScoreAvailable() { + return OptionalPackages.isModuleAvailable(Comscore, "react-native-comscore"); + } + }, { + key: "isAdobeAnalyticsAvailable", + value: function isAdobeAnalyticsAvailable() { + return OptionalPackages.isModuleAvailable(AdobeAnalytics, "react-native-adbmobile"); + } + }, { + key: "isMatherAnalyticsAvailable", + value: function isMatherAnalyticsAvailable() { + return OptionalPackages.isModuleAvailable(MatherAnalytics, "react-native-mather-analytics"); + } + }, { + key: "isFacebookSDKAvailable", + value: function isFacebookSDKAvailable() { + return OptionalPackages.isModuleAvailable(FacebookAnalytics, "react-native-fbsdk-next"); + } + }, { + key: "isVoiceAvailable", + value: function isVoiceAvailable() { + return OptionalPackages.isModuleAvailable(Voice, "react-native-voice"); + } + }, { + key: "isPushAvailable", + value: function isPushAvailable() { + return OptionalPackages.isModuleAvailable(Push, "@tecnavia/react-native-cloud-messaging"); + } + }, { + key: "isMatomoAvailable", + value: function isMatomoAvailable() { + return OptionalPackages.isModuleAvailable(Matomo, "react-native-matomo"); + } + }, { + key: "isMatomoTrackerAvailable", + value: function isMatomoTrackerAvailable() { + return OptionalPackages.isModuleAvailable(MatomoTracker, "matomo-tracker-react-native"); + } + }, { + key: "isGoogleAnalytics3Available", + value: function isGoogleAnalytics3Available() { + return OptionalPackages.isModuleAvailable(GoogleAnalytics3, "react-native-google-analytics-bridge"); + } + }, { + key: "isIapModuleAvailable", + value: function isIapModuleAvailable() { + return OptionalPackages.isModuleAvailable(RNIap, "react-native-iap"); + } + }, { + key: "isMapsAvailable", + value: function isMapsAvailable() { + return OptionalPackages.isModuleAvailable(Maps, "react-native-maps"); + } + }, { + key: "isNativeOptionsPageAvailable", + value: function isNativeOptionsPageAvailable() { + return OptionalPackages.isModuleAvailable(NativeOptionsPage, "rn-options-page"); + } + }, { + key: "isIOSClassicEPaperAvailable", + value: function isIOSClassicEPaperAvailable() { + return _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isIOS() && OptionalPackages.isModuleAvailable(IOSClassicEPaper, "@tecnavia/react-native-ios-classic-epaper"); + } + }, { + key: "isIOSExternalLinkAccountAPIAvailable", + value: function isIOSExternalLinkAccountAPIAvailable() { + return _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isIOS() && OptionalPackages.isModuleAvailable(IOSExternalLinkAccount, "@tecnavia/react-native-external-link-account"); + } + }, { + key: "isIOSNewsmemorySDKAvailable", + value: function isIOSNewsmemorySDKAvailable() { + return _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.isIOS() && OptionalPackages.isModuleAvailable(IOSNewsmemorySDK, "@tecnavia/react-native-newsmemory-pod"); + } + }, { + key: "isViafouraAvailable", + value: function isViafouraAvailable() { + return OptionalPackages.isModuleAvailable(ViafouraWebView, "react-native-viafoura"); + } + }, { + key: "isDailymotionVideoPlayerAvailable", + value: function isDailymotionVideoPlayerAvailable() { + return OptionalPackages.isModuleAvailable(DailyMotionPlayer, "@tecnavia/react-native-dailymotion-sdk"); + } + }, { + key: "isIubendaCMPAvailable", + value: function isIubendaCMPAvailable() { + return OptionalPackages.isModuleAvailable(IubendaCMP, "@tecnavia/react-native-iubenda-web"); + } + }, { + key: "isScreenshotPreventAvailable", + value: function isScreenshotPreventAvailable() { + return OptionalPackages.isModuleAvailable(ScreenshotPrevent, "@tecnavia/react-native-screenshot-prevent"); + } + }, { + key: "isModuleAvailable", + value: function isModuleAvailable(moduleVariable, moduleName) { + try { + if (moduleVariable) { + return true; + } + } catch (e) {} + + return false; + } + }]); + return OptionalPackages; + }(); + + exports.default = OptionalPackages; +},731,[5,7,8,732,1689,1690,1693,1712,1713,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Models = exports.Methods = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + _$$_REQUIRE(_dependencyMap[3]); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + var _Container = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var Methods = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + exports.Methods = Methods; + + var Models = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + exports.Models = Models; + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _uri = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _message = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _excluded = ["onLocal", "onMessage", "onClose", "externalLinkCallbacks", "actionCallbacks", "needsCssProvider"]; + + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + + var cache = _getRequireWildcardCache(nodeInterop); + + if (cache && cache.has(obj)) { + return cache.get(obj); + } + + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + + newObj.default = obj; + + if (cache) { + cache.set(obj, newObj); + } + + return newObj; + } + + function Root(props) { + var onLocal = props.onLocal, + onMessage = props.onMessage, + onClose = props.onClose, + externalLinkCallbacks = props.externalLinkCallbacks, + actionCallbacks = props.actionCallbacks, + needsCssProvider = props.needsCssProvider, + rest = (0, _objectWithoutProperties2.default)(props, _excluded); + (0, _react.useEffect)(function () { + var onCloseId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(_events.default.ON_CLOSE, function () { + if (typeof onClose === "function") { + onClose(); + } + }); + + var onLocalId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(_events.default.WEBVIEW_ON_LOCAL, function (uri) { + if (typeof onLocal === "function") { + onLocal(uri); + } + }); + + var onMessageId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(_events.default.WEBVIEW_ON_MESSAGE, function (message) { + if (typeof onMessage === "function") { + onMessage(message); + } + }); + + var onExternalLinkClickId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(_events.default.ON_EXTERNAL_LINK_CLICK, function (_ref) { + var url = _ref.url; + + if (externalLinkCallbacks && typeof externalLinkCallbacks.onClick === "function") { + externalLinkCallbacks.onClick(url); + } else { + _reactNative.Linking.openURL(url); + } + }); + + var onActionClickId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(_events.default.ON_ACTION_CLICK, function (_ref2) { + var action = _ref2.action; + + if (actionCallbacks && typeof actionCallbacks.onClick === "function") { + actionCallbacks.onClick(action); + } + }); + + return function () { + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(onLocalId); + + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(onMessageId); + + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(onExternalLinkClickId); + + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(onCloseId); + + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(onActionClickId); + }; + }, []); + + var Component = _react.default.createElement(_Container.default, rest); + + if (needsCssProvider) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Provider, null, Component); + } + + return Component; + } + + Root.propTypes = (0, _extends2.default)({ + onClose: _propTypes.default.func.isRequired, + onLocal: _propTypes.default.func, + onMessage: _propTypes.default.func, + externalLinkCallbacks: _propTypes.default.shape({ + onClick: _propTypes.default.func + }), + actionCallbacks: _propTypes.default.shape({ + onClick: _propTypes.default.func + }), + needsCssProvider: _propTypes.default.bool + }, _Container.default.propTypes); + Root.defaultProps = { + needsCssProvider: true + }; + var _default = Root; + exports.default = _default; +},732,[5,6,108,733,17,201,28,754,1687,1688,771,763,1231,991,987]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + _$$_REQUIRE(_dependencyMap[0]); +},733,[734]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + (0, _$$_REQUIRE(_dependencyMap[0]).setupURLPolyfill)(); +},734,[735]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _exportNames = { + setupURLPolyfill: true + }; + exports.setupURLPolyfill = setupURLPolyfill; + + _$$_REQUIRE(_dependencyMap[0]); + + Object.keys(_$$_REQUIRE(_dependencyMap[1])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[1])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[2])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[2])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2])[key]; + } + }); + }); + + function setupURLPolyfill() { + global.REACT_NATIVE_URL_POLYFILL = _$$_REQUIRE(_dependencyMap[3]).name + "@" + _$$_REQUIRE(_dependencyMap[3]).version; + (0, _$$_REQUIRE(_dependencyMap[4]).polyfillGlobal)('URL', function () { + return _$$_REQUIRE(_dependencyMap[1]).URL; + }); + (0, _$$_REQUIRE(_dependencyMap[4]).polyfillGlobal)('URLSearchParams', function () { + return _$$_REQUIRE(_dependencyMap[2]).URLSearchParams; + }); + } +},735,[736,737,752,753,72]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var majorVersionIOS = parseInt(_reactNative.Platform.Version, 10); + + if (_reactNative.Platform.OS === 'ios' && majorVersionIOS === 10) { + if (Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength') == null) { + Object.defineProperty(ArrayBuffer.prototype, 'byteLength', { + configurable: true, + enumerable: false, + get: function get() { + return null; + } + }); + } + } +},736,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.URL = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var BLOB_URL_PREFIX = null; + var BlobModule = _reactNative.NativeModules.BlobModule; + + if (BlobModule && typeof BlobModule.BLOB_URI_SCHEME === 'string') { + BLOB_URL_PREFIX = BlobModule.BLOB_URI_SCHEME + ':'; + + if (typeof BlobModule.BLOB_URI_HOST === 'string') { + BLOB_URL_PREFIX += "//" + BlobModule.BLOB_URI_HOST + "/"; + } + } + + _$$_REQUIRE(_dependencyMap[1]).URL.createObjectURL = function createObjectURL(blob) { + if (BLOB_URL_PREFIX === null) { + throw new Error('Cannot create URL for blob!'); + } + + return "" + BLOB_URL_PREFIX + blob.data.blobId + "?offset=" + blob.data.offset + "&size=" + blob.size; + }; + + _$$_REQUIRE(_dependencyMap[1]).URL.revokeObjectURL = function revokeObjectURL(url) {}; + + exports.URL = _$$_REQUIRE(_dependencyMap[1]).URL; +},737,[28,738]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + var sharedGlobalObject = {}; + + _$$_REQUIRE(_dependencyMap[0]).URL.install(sharedGlobalObject); + + _$$_REQUIRE(_dependencyMap[0]).URLSearchParams.install(sharedGlobalObject); + + exports.URL = sharedGlobalObject.URL; + exports.URLSearchParams = sharedGlobalObject.URLSearchParams; + exports.parseURL = _$$_REQUIRE(_dependencyMap[1]).parseURL; + exports.basicURLParse = _$$_REQUIRE(_dependencyMap[1]).basicURLParse; + exports.serializeURL = _$$_REQUIRE(_dependencyMap[1]).serializeURL; + exports.serializeHost = _$$_REQUIRE(_dependencyMap[1]).serializeHost; + exports.serializeInteger = _$$_REQUIRE(_dependencyMap[1]).serializeInteger; + exports.serializeURLOrigin = _$$_REQUIRE(_dependencyMap[1]).serializeURLOrigin; + exports.setTheUsername = _$$_REQUIRE(_dependencyMap[1]).setTheUsername; + exports.setThePassword = _$$_REQUIRE(_dependencyMap[1]).setThePassword; + exports.cannotHaveAUsernamePasswordPort = _$$_REQUIRE(_dependencyMap[1]).cannotHaveAUsernamePasswordPort; + exports.percentDecode = _$$_REQUIRE(_dependencyMap[2]).percentDecode; +},738,[739,743,748]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + exports.URL = _$$_REQUIRE(_dependencyMap[0]); + exports.URLSearchParams = _$$_REQUIRE(_dependencyMap[1]); +},739,[740,749]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + var iface = { + _mixedIntoPredicates: [], + is: function is(obj) { + if (obj) { + if (_$$_REQUIRE(_dependencyMap[0]).hasOwn(obj, _$$_REQUIRE(_dependencyMap[0]).implSymbol) && obj[_$$_REQUIRE(_dependencyMap[0]).implSymbol] instanceof _$$_REQUIRE(_dependencyMap[1]).implementation) { + return true; + } + + for (var _iterator = _createForOfIteratorHelperLoose(module.exports._mixedIntoPredicates), _step; !(_step = _iterator()).done;) { + var isMixedInto = _step.value; + + if (isMixedInto(obj)) { + return true; + } + } + } + + return false; + }, + isImpl: function isImpl(obj) { + if (obj) { + if (obj instanceof _$$_REQUIRE(_dependencyMap[1]).implementation) { + return true; + } + + var wrapper = _$$_REQUIRE(_dependencyMap[0]).wrapperForImpl(obj); + + for (var _iterator2 = _createForOfIteratorHelperLoose(module.exports._mixedIntoPredicates), _step2; !(_step2 = _iterator2()).done;) { + var isMixedInto = _step2.value; + + if (isMixedInto(wrapper)) { + return true; + } + } + } + + return false; + }, + convert: function convert(obj) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$context = _ref.context, + context = _ref$context === undefined ? "The provided value" : _ref$context; + + if (module.exports.is(obj)) { + return _$$_REQUIRE(_dependencyMap[0]).implForWrapper(obj); + } + + throw new TypeError(context + " is not of type 'URL'."); + }, + create: function create(globalObject, constructorArgs, privateData) { + if (globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol] === undefined) { + throw new Error("Internal error: invalid global object"); + } + + var ctor = globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol]["URL"]; + + if (ctor === undefined) { + throw new Error("Internal error: constructor URL is not installed on the passed global object"); + } + + var obj = Object.create(ctor.prototype); + obj = iface.setup(obj, globalObject, constructorArgs, privateData); + return obj; + }, + createImpl: function createImpl(globalObject, constructorArgs, privateData) { + var obj = iface.create(globalObject, constructorArgs, privateData); + return _$$_REQUIRE(_dependencyMap[0]).implForWrapper(obj); + }, + _internalSetup: function _internalSetup(obj) {}, + setup: function setup(obj, globalObject) { + var constructorArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var privateData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + privateData.wrapper = obj; + + iface._internalSetup(obj); + + Object.defineProperty(obj, _$$_REQUIRE(_dependencyMap[0]).implSymbol, { + value: new (_$$_REQUIRE(_dependencyMap[1]).implementation)(globalObject, constructorArgs, privateData), + configurable: true + }); + obj[_$$_REQUIRE(_dependencyMap[0]).implSymbol][_$$_REQUIRE(_dependencyMap[0]).wrapperSymbol] = obj; + + if (_$$_REQUIRE(_dependencyMap[1]).init) { + _$$_REQUIRE(_dependencyMap[1]).init(obj[_$$_REQUIRE(_dependencyMap[0]).implSymbol], privateData); + } + + return obj; + }, + install: function install(globalObject) { + var URL = function () { + function URL(url) { + _$$_REQUIRE(_dependencyMap[2])(this, URL); + + if (arguments.length < 1) { + throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); + } + + var args = []; + { + var curArg = arguments[0]; + curArg = _$$_REQUIRE(_dependencyMap[3])["USVString"](curArg, { + context: "Failed to construct 'URL': parameter 1" + }); + args.push(curArg); + } + { + var _curArg = arguments[1]; + + if (_curArg !== undefined) { + _curArg = _$$_REQUIRE(_dependencyMap[3])["USVString"](_curArg, { + context: "Failed to construct 'URL': parameter 2" + }); + } + + args.push(_curArg); + } + return iface.setup(Object.create(this.constructor.prototype), globalObject, args); + } + + _$$_REQUIRE(_dependencyMap[4])(URL, [{ + key: "toJSON", + value: function toJSON() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol].toJSON(); + } + }, { + key: "href", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["href"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'href' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["href"] = V; + } + }, { + key: "toString", + value: function toString() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["href"]; + } + }, { + key: "origin", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["origin"]; + } + }, { + key: "protocol", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["protocol"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'protocol' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["protocol"] = V; + } + }, { + key: "username", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["username"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'username' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["username"] = V; + } + }, { + key: "password", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["password"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'password' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["password"] = V; + } + }, { + key: "host", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["host"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'host' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["host"] = V; + } + }, { + key: "hostname", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["hostname"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'hostname' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["hostname"] = V; + } + }, { + key: "port", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["port"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'port' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["port"] = V; + } + }, { + key: "pathname", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["pathname"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'pathname' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["pathname"] = V; + } + }, { + key: "search", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["search"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'search' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["search"] = V; + } + }, { + key: "searchParams", + get: function get() { + var _this = this; + + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return _$$_REQUIRE(_dependencyMap[0]).getSameObject(this, "searchParams", function () { + return _$$_REQUIRE(_dependencyMap[0]).tryWrapperForImpl(_this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["searchParams"]); + }); + } + }, { + key: "hash", + get: function get() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["hash"]; + }, + set: function set(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = _$$_REQUIRE(_dependencyMap[3])["USVString"](V, { + context: "Failed to set the 'hash' property on 'URL': The provided value" + }); + this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]["hash"] = V; + } + }]); + + return URL; + }(); + + Object.defineProperties(URL.prototype, _$$_REQUIRE(_dependencyMap[5])({ + toJSON: { + enumerable: true + }, + href: { + enumerable: true + }, + toString: { + enumerable: true + }, + origin: { + enumerable: true + }, + protocol: { + enumerable: true + }, + username: { + enumerable: true + }, + password: { + enumerable: true + }, + host: { + enumerable: true + }, + hostname: { + enumerable: true + }, + port: { + enumerable: true + }, + pathname: { + enumerable: true + }, + search: { + enumerable: true + }, + searchParams: { + enumerable: true + }, + hash: { + enumerable: true + } + }, Symbol.toStringTag, { + value: "URL", + configurable: true + })); + + if (globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol] === undefined) { + globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol] = Object.create(null); + } + + globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol]["URL"] = URL; + Object.defineProperty(globalObject, "URL", { + configurable: true, + writable: true, + value: URL + }); + } + }; + module.exports = iface; +},740,[741,742,7,751,8,27]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; + } + + function hasOwn(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + } + + var wrapperSymbol = Symbol("wrapper"); + var implSymbol = Symbol("impl"); + var sameObjectCaches = Symbol("SameObject caches"); + var ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry"); + + function getSameObject(wrapper, prop, creator) { + if (!wrapper[sameObjectCaches]) { + wrapper[sameObjectCaches] = Object.create(null); + } + + if (prop in wrapper[sameObjectCaches]) { + return wrapper[sameObjectCaches][prop]; + } + + wrapper[sameObjectCaches][prop] = creator(); + return wrapper[sameObjectCaches][prop]; + } + + function wrapperForImpl(impl) { + return impl ? impl[wrapperSymbol] : null; + } + + function implForWrapper(wrapper) { + return wrapper ? wrapper[implSymbol] : null; + } + + function tryWrapperForImpl(impl) { + var wrapper = wrapperForImpl(impl); + return wrapper ? wrapper : impl; + } + + function tryImplForWrapper(wrapper) { + var impl = implForWrapper(wrapper); + return impl ? impl : wrapper; + } + + var iterInternalSymbol = Symbol("internal"); + var IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + + function isArrayIndexPropName(P) { + if (typeof P !== "string") { + return false; + } + + var i = P >>> 0; + + if (i === Math.pow(2, 32) - 1) { + return false; + } + + var s = "" + i; + + if (P !== s) { + return false; + } + + return true; + } + + var byteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; + + function isArrayBuffer(value) { + try { + byteLengthGetter.call(value); + return true; + } catch (e) { + return false; + } + } + + var supportsPropertyIndex = Symbol("supports property index"); + var supportedPropertyIndices = Symbol("supported property indices"); + var supportsPropertyName = Symbol("supports property name"); + var supportedPropertyNames = Symbol("supported property names"); + var indexedGet = Symbol("indexed property get"); + var indexedSetNew = Symbol("indexed property set new"); + var indexedSetExisting = Symbol("indexed property set existing"); + var namedGet = Symbol("named property get"); + var namedSetNew = Symbol("named property set new"); + var namedSetExisting = Symbol("named property set existing"); + var namedDelete = Symbol("named property delete"); + module.exports = exports = { + isObject: isObject, + hasOwn: hasOwn, + wrapperSymbol: wrapperSymbol, + implSymbol: implSymbol, + getSameObject: getSameObject, + ctorRegistrySymbol: ctorRegistrySymbol, + wrapperForImpl: wrapperForImpl, + implForWrapper: implForWrapper, + tryWrapperForImpl: tryWrapperForImpl, + tryImplForWrapper: tryImplForWrapper, + iterInternalSymbol: iterInternalSymbol, + IteratorPrototype: IteratorPrototype, + isArrayBuffer: isArrayBuffer, + isArrayIndexPropName: isArrayIndexPropName, + supportsPropertyIndex: supportsPropertyIndex, + supportedPropertyIndices: supportedPropertyIndices, + supportsPropertyName: supportsPropertyName, + supportedPropertyNames: supportedPropertyNames, + indexedGet: indexedGet, + indexedSetNew: indexedSetNew, + indexedSetExisting: indexedSetExisting, + namedGet: namedGet, + namedSetNew: namedSetNew, + namedSetExisting: namedSetExisting, + namedDelete: namedDelete + }; +},741,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + exports.implementation = function () { + function URLImpl(globalObject, constructorArgs) { + _$$_REQUIRE(_dependencyMap[0])(this, URLImpl); + + var url = constructorArgs[0]; + var base = constructorArgs[1]; + var parsedBase = null; + + if (base !== undefined) { + parsedBase = _$$_REQUIRE(_dependencyMap[1]).basicURLParse(base); + + if (parsedBase === null) { + throw new TypeError("Invalid base URL: " + base); + } + } + + var parsedURL = _$$_REQUIRE(_dependencyMap[1]).basicURLParse(url, { + baseURL: parsedBase + }); + + if (parsedURL === null) { + throw new TypeError("Invalid URL: " + url); + } + + var query = parsedURL.query !== null ? parsedURL.query : ""; + this._url = parsedURL; + this._query = _$$_REQUIRE(_dependencyMap[2]).createImpl(globalObject, [query], { + doNotStripQMark: true + }); + this._query._url = this; + } + + _$$_REQUIRE(_dependencyMap[3])(URLImpl, [{ + key: "href", + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).serializeURL(this._url); + }, + set: function set(v) { + var parsedURL = _$$_REQUIRE(_dependencyMap[1]).basicURLParse(v); + + if (parsedURL === null) { + throw new TypeError("Invalid URL: " + v); + } + + this._url = parsedURL; + + this._query._list.splice(0); + + var query = parsedURL.query; + + if (query !== null) { + this._query._list = _$$_REQUIRE(_dependencyMap[4]).parseUrlencoded(query); + } + } + }, { + key: "origin", + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).serializeURLOrigin(this._url); + } + }, { + key: "protocol", + get: function get() { + return this._url.scheme + ":"; + }, + set: function set(v) { + _$$_REQUIRE(_dependencyMap[1]).basicURLParse(v + ":", { + url: this._url, + stateOverride: "scheme start" + }); + } + }, { + key: "username", + get: function get() { + return this._url.username; + }, + set: function set(v) { + if (_$$_REQUIRE(_dependencyMap[1]).cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + _$$_REQUIRE(_dependencyMap[1]).setTheUsername(this._url, v); + } + }, { + key: "password", + get: function get() { + return this._url.password; + }, + set: function set(v) { + if (_$$_REQUIRE(_dependencyMap[1]).cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + _$$_REQUIRE(_dependencyMap[1]).setThePassword(this._url, v); + } + }, { + key: "host", + get: function get() { + var url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return _$$_REQUIRE(_dependencyMap[1]).serializeHost(url.host); + } + + return _$$_REQUIRE(_dependencyMap[1]).serializeHost(url.host) + ":" + _$$_REQUIRE(_dependencyMap[1]).serializeInteger(url.port); + }, + set: function set(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + _$$_REQUIRE(_dependencyMap[1]).basicURLParse(v, { + url: this._url, + stateOverride: "host" + }); + } + }, { + key: "hostname", + get: function get() { + if (this._url.host === null) { + return ""; + } + + return _$$_REQUIRE(_dependencyMap[1]).serializeHost(this._url.host); + }, + set: function set(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + _$$_REQUIRE(_dependencyMap[1]).basicURLParse(v, { + url: this._url, + stateOverride: "hostname" + }); + } + }, { + key: "port", + get: function get() { + if (this._url.port === null) { + return ""; + } + + return _$$_REQUIRE(_dependencyMap[1]).serializeInteger(this._url.port); + }, + set: function set(v) { + if (_$$_REQUIRE(_dependencyMap[1]).cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + _$$_REQUIRE(_dependencyMap[1]).basicURLParse(v, { + url: this._url, + stateOverride: "port" + }); + } + } + }, { + key: "pathname", + get: function get() { + if (this._url.cannotBeABaseURL) { + return this._url.path[0]; + } + + if (this._url.path.length === 0) { + return ""; + } + + return "/" + this._url.path.join("/"); + }, + set: function set(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + this._url.path = []; + + _$$_REQUIRE(_dependencyMap[1]).basicURLParse(v, { + url: this._url, + stateOverride: "path start" + }); + } + }, { + key: "search", + get: function get() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return "?" + this._url.query; + }, + set: function set(v) { + var url = this._url; + + if (v === "") { + url.query = null; + this._query._list = []; + return; + } + + var input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + + _$$_REQUIRE(_dependencyMap[1]).basicURLParse(input, { + url: url, + stateOverride: "query" + }); + + this._query._list = _$$_REQUIRE(_dependencyMap[4]).parseUrlencoded(input); + } + }, { + key: "searchParams", + get: function get() { + return this._query; + } + }, { + key: "hash", + get: function get() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return "#" + this._url.fragment; + }, + set: function set(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + var input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + + _$$_REQUIRE(_dependencyMap[1]).basicURLParse(input, { + url: this._url, + stateOverride: "fragment" + }); + } + }, { + key: "toJSON", + value: function toJSON() { + return this.href; + } + }]); + + return URLImpl; + }(); +},742,[7,743,749,8,748]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + var specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 + }; + var failure = Symbol("failure"); + + function countSymbols(str) { + return _$$_REQUIRE(_dependencyMap[0]).ucs2.decode(str).length; + } + + function at(input, idx) { + var c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); + } + + function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; + } + + function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; + } + + function isWindowsDriveLetterCodePoints(cp1, cp2) { + return _$$_REQUIRE(_dependencyMap[1]).isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); + } + + function isWindowsDriveLetterString(string) { + return string.length === 2 && _$$_REQUIRE(_dependencyMap[1]).isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); + } + + function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && _$$_REQUIRE(_dependencyMap[1]).isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; + } + + function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; + } + + function containsForbiddenHostCodePointExcludingPercent(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; + } + + function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; + } + + function isSpecial(url) { + return isSpecialScheme(url.scheme); + } + + function isNotSpecial(url) { + return !isSpecialScheme(url.scheme); + } + + function defaultPort(scheme) { + return specialSchemes[scheme]; + } + + function utf8PercentEncode(c) { + var buf = _$$_REQUIRE(_dependencyMap[2]).Buffer.from(c); + + var str = ""; + + for (var i = 0; i < buf.length; ++i) { + str += _$$_REQUIRE(_dependencyMap[3]).percentEncode(buf[i]); + } + + return str; + } + + function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; + } + + var extraUserinfoPercentEncodeSet = new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); + + function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); + } + + var extraFragmentPercentEncodeSet = new Set([32, 34, 60, 62, 96]); + + function isFragmentPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); + } + + var extraPathPercentEncodeSet = new Set([35, 63, 123, 125]); + + function isPathPercentEncode(c) { + return isFragmentPercentEncode(c) || extraPathPercentEncodeSet.has(c); + } + + function percentEncodeChar(c, encodeSetPredicate) { + var cStr = String.fromCodePoint(c); + + if (encodeSetPredicate(c)) { + return utf8PercentEncode(cStr); + } + + return cStr; + } + + function parseIPv4Number(input) { + var R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + var regex = /[^0-7]/; + + if (R === 10) { + regex = /[^0-9]/; + } + + if (R === 16) { + regex = /[^0-9A-Fa-f]/; + } + + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); + } + + function parseIPv4(input) { + var parts = input.split("."); + + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return input; + } + + var numbers = []; + + for (var _iterator = _createForOfIteratorHelperLoose(parts), _step; !(_step = _iterator()).done;) { + var part = _step.value; + + if (part === "") { + return input; + } + + var n = parseIPv4Number(part); + + if (n === failure) { + return input; + } + + numbers.push(n); + } + + for (var i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + + if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { + return failure; + } + + var ipv4 = numbers.pop(); + var counter = 0; + + for (var _i = 0, _numbers = numbers; _i < _numbers.length; _i++) { + var _n = _numbers[_i]; + ipv4 += _n * Math.pow(256, 3 - counter); + ++counter; + } + + return ipv4; + } + + function serializeIPv4(address) { + var output = ""; + var n = address; + + for (var i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + + if (i !== 4) { + output = "." + output; + } + + n = Math.floor(n / 256); + } + + return output; + } + + function parseIPv6(input) { + var address = [0, 0, 0, 0, 0, 0, 0, 0]; + var pieceIndex = 0; + var compress = null; + var pointer = 0; + input = _$$_REQUIRE(_dependencyMap[0]).ucs2.decode(input); + + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === 58) { + if (compress !== null) { + return failure; + } + + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + var value = 0; + var length = 0; + + while (length < 4 && _$$_REQUIRE(_dependencyMap[1]).isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === 46) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + var numbersSeen = 0; + + while (input[pointer] !== undefined) { + var ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === 46 && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!_$$_REQUIRE(_dependencyMap[1]).isASCIIDigit(input[pointer])) { + return failure; + } + + while (_$$_REQUIRE(_dependencyMap[1]).isASCIIDigit(input[pointer])) { + var number = parseInt(at(input, pointer)); + + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + + if (ipv4Piece > 255) { + return failure; + } + + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === 58) { + ++pointer; + + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + var swaps = pieceIndex - compress; + pieceIndex = 7; + + while (pieceIndex !== 0 && swaps > 0) { + var temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; + } + + function serializeIPv6(address) { + var output = ""; + var seqResult = findLongestZeroSequence(address); + var compress = seqResult.idx; + var ignore0 = false; + + for (var pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + var separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; + } + + function parseHost(input) { + var isNotSpecialArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (isNotSpecialArg) { + return parseOpaqueHost(input); + } + + var domain = _$$_REQUIRE(_dependencyMap[3]).percentDecode(_$$_REQUIRE(_dependencyMap[2]).Buffer.from(input)).toString(); + + var asciiDomain = domainToASCII(domain); + + if (asciiDomain === failure) { + return failure; + } + + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; + } + + var ipv4Host = parseIPv4(asciiDomain); + + if (typeof ipv4Host === "number" || ipv4Host === failure) { + return ipv4Host; + } + + return asciiDomain; + } + + function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; + } + + var output = ""; + + var decoded = _$$_REQUIRE(_dependencyMap[0]).ucs2.decode(input); + + for (var i = 0; i < decoded.length; ++i) { + output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); + } + + return output; + } + + function findLongestZeroSequence(arr) { + var maxIdx = null; + var maxLen = 1; + var currStart = null; + var currLen = 0; + + for (var i = 0; i < arr.length; ++i) { + if (arr[i] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i; + } + + ++currLen; + } + } + + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + return { + idx: maxIdx, + len: maxLen + }; + } + + function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + if (host instanceof Array) { + return "[" + serializeIPv6(host) + "]"; + } + + return host; + } + + function domainToASCII(domain) { + var result = domain; + + if (result === null) { + return failure; + } + + return result; + } + + function trimControlChars(url) { + return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); + } + + function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/g, ""); + } + + function shortenPath(url) { + var path = url.path; + + if (path.length === 0) { + return; + } + + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); + } + + function includesCredentials(url) { + return url.username !== "" || url.password !== ""; + } + + function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; + } + + function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/.test(string); + } + + function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null, + cannotBeABaseURL: false + }; + + var _res = trimControlChars(this.input); + + if (_res !== this.input) { + this.parseError = true; + } + + this.input = _res; + } + + var res = trimTabAndNewline(this.input); + + if (res !== this.input) { + this.parseError = true; + } + + this.input = res; + this.state = stateOverride || "scheme start"; + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + this.input = _$$_REQUIRE(_dependencyMap[0]).ucs2.decode(this.input); + + for (; this.pointer <= this.input.length; ++this.pointer) { + var c = this.input[this.pointer]; + var cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + var ret = this["parse " + this.state](c, cStr); + + if (!ret) { + break; + } else if (ret === failure) { + this.failure = true; + break; + } + } + } + + URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (_$$_REQUIRE(_dependencyMap[1]).isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; + }; + + URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (_$$_REQUIRE(_dependencyMap[1]).isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { + this.buffer += cStr.toLowerCase(); + } else if (c === 58) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { + return false; + } + } + + this.url.scheme = this.buffer; + + if (this.stateOverride) { + if (this.url.port === defaultPort(this.url.scheme)) { + this.url.port = null; + } + + return false; + } + + this.buffer = ""; + + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { + this.parseError = true; + } + + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === 47) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.cannotBeABaseURL = true; + this.url.path.push(""); + this.state = "cannot-be-a-base-URL path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; + }; + + URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || this.base.cannotBeABaseURL && c !== 35) { + return failure; + } else if (this.base.cannotBeABaseURL && c === 35) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.url.cannotBeABaseURL = true; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === 47) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + + if (isNaN(c)) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 47) { + this.state = "relative slash"; + } else if (c === 63) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (isSpecial(this.url) && c === 92) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(0, this.base.path.length - 1); + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === 47 || c === 92)) { + if (c === 92) { + this.parseError = true; + } + + this.state = "special authority ignore slashes"; + } else if (c === 47) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== 47 && c !== 92) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; + }; + + URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === 64) { + this.parseError = true; + + if (this.atFlag) { + this.buffer = "%40" + this.buffer; + } + + this.atFlag = true; + var len = countSymbols(this.buffer); + + for (var pointer = 0; pointer < len; ++pointer) { + var codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === 58 && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + + var encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); + + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + + this.buffer = ""; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || isSpecial(this.url) && c === 92) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; + }; + + URLStateMachine.prototype["parse hostname"] = URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === 58 && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + var host = parseHost(this.buffer, isNotSpecial(this.url)); + + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + + if (this.stateOverride === "hostname") { + return false; + } + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || isSpecial(this.url) && c === 92) { + --this.pointer; + + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + var _host = parseHost(this.buffer, isNotSpecial(this.url)); + + if (_host === failure) { + return failure; + } + + this.url.host = _host; + this.buffer = ""; + this.state = "path start"; + + if (this.stateOverride) { + return false; + } + } else { + if (c === 91) { + this.arrFlag = true; + } else if (c === 93) { + this.arrFlag = false; + } + + this.buffer += cStr; + } + + return true; + }; + + URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (_$$_REQUIRE(_dependencyMap[1]).isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || isSpecial(this.url) && c === 92 || this.stateOverride) { + if (this.buffer !== "") { + var port = parseInt(this.buffer); + + if (port > Math.pow(2, 16) - 1) { + this.parseError = true; + return failure; + } + + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + + if (this.stateOverride) { + return false; + } + + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; + }; + + var fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); + + function startsWithWindowsDriveLetter(input, pointer) { + var length = input.length - pointer; + return length >= 2 && isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); + } + + URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + if (isNaN(c)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 63) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + shortenPath(this.url); + } else { + this.parseError = true; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file" && !startsWithWindowsDriveLetter(this.input, this.pointer)) { + if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } else { + this.url.host = this.base.host; + } + } + + this.state = "path"; + --this.pointer; + } + + return true; + }; + + URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { + --this.pointer; + + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + + if (this.stateOverride) { + return false; + } + + this.state = "path start"; + } else { + var host = parseHost(this.buffer, isNotSpecial(this.url)); + + if (host === failure) { + return failure; + } + + if (host === "localhost") { + host = ""; + } + + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; + }; + + URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === 92) { + this.parseError = true; + } + + this.state = "path"; + + if (c !== 47 && c !== 92) { + --this.pointer; + } + } else if (!this.stateOverride && c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + + if (c !== 47) { + --this.pointer; + } + } + + return true; + }; + + URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === 47 || isSpecial(this.url) && c === 92 || !this.stateOverride && (c === 63 || c === 35)) { + if (isSpecial(this.url) && c === 92) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + + if (c !== 47 && !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== 47 && !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + if (this.url.host !== "" && this.url.host !== null) { + this.parseError = true; + this.url.host = ""; + } + + this.buffer = this.buffer[0] + ":"; + } + + this.url.path.push(this.buffer); + } + + this.buffer = ""; + + if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { + while (this.url.path.length > 1 && this.url.path[0] === "") { + this.parseError = true; + this.url.path.shift(); + } + } + + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } + + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + if (c === 37 && (!_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 1]) || !_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += percentEncodeChar(c, isPathPercentEncode); + } + + return true; + }; + + URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (!isNaN(c) && c !== 37) { + this.parseError = true; + } + + if (c === 37 && (!_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 1]) || !_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path[0] += percentEncodeChar(c, isC0ControlPercentEncode); + } + } + + return true; + }; + + URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (isNaN(c) || !this.stateOverride && c === 35) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + var buffer = _$$_REQUIRE(_dependencyMap[2]).Buffer.from(this.buffer); + + for (var i = 0; i < buffer.length; ++i) { + if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 || buffer[i] === 0x3C || buffer[i] === 0x3E || buffer[i] === 0x27 && isSpecial(this.url)) { + this.url.query += _$$_REQUIRE(_dependencyMap[3]).percentEncode(buffer[i]); + } else { + this.url.query += String.fromCodePoint(buffer[i]); + } + } + + this.buffer = ""; + + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + if (c === 37 && (!_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 1]) || !_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; + }; + + URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (isNaN(c)) {} else if (c === 0x0) { + this.parseError = true; + } else { + if (c === 37 && (!_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 1]) || !_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += percentEncodeChar(c, isFragmentPercentEncode); + } + + return true; + }; + + function serializeURL(url, excludeFragment) { + var output = url.scheme + ":"; + + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + + if (url.password !== "") { + output += ":" + url.password; + } + + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += ":" + url.port; + } + } else if (url.host === null && url.scheme === "file") { + output += "//"; + } + + if (url.cannotBeABaseURL) { + output += url.path[0]; + } else { + for (var _iterator2 = _createForOfIteratorHelperLoose(url.path), _step2; !(_step2 = _iterator2()).done;) { + var string = _step2.value; + output += "/" + string; + } + } + + if (url.query !== null) { + output += "?" + url.query; + } + + if (!excludeFragment && url.fragment !== null) { + output += "#" + url.fragment; + } + + return output; + } + + function serializeOrigin(tuple) { + var result = tuple.scheme + "://"; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += ":" + tuple.port; + } + + return result; + } + + module.exports.serializeURL = serializeURL; + + module.exports.serializeURLOrigin = function (url) { + switch (url.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); + } catch (e) { + return "null"; + } + + case "ftp": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + + case "file": + return "null"; + + default: + return "null"; + } + }; + + module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + var usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + + if (usm.failure) { + return null; + } + + return usm.url; + }; + + module.exports.setTheUsername = function (url, username) { + url.username = ""; + + var decoded = _$$_REQUIRE(_dependencyMap[0]).ucs2.decode(username); + + for (var i = 0; i < decoded.length; ++i) { + url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } + }; + + module.exports.setThePassword = function (url, password) { + url.password = ""; + + var decoded = _$$_REQUIRE(_dependencyMap[0]).ucs2.decode(password); + + for (var i = 0; i < decoded.length; ++i) { + url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } + }; + + module.exports.serializeHost = serializeHost; + module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + + module.exports.serializeInteger = function (integer) { + return String(integer); + }; + + module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + return module.exports.basicURLParse(input, { + baseURL: options.baseURL, + encodingOverride: options.encodingOverride + }); + }; +},743,[744,745,746,748]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + var maxInt = 2147483647; + var base = 36; + var tMin = 1; + var tMax = 26; + var skew = 38; + var damp = 700; + var initialBias = 72; + var initialN = 128; + var delimiter = '-'; + var regexPunycode = /^xn--/; + var regexNonASCII = /[^\0-\x7E]/; + var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; + var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }; + var baseMinusTMin = 35; + var floor = Math.floor; + var stringFromCharCode = String.fromCharCode; + + function error(type) { + throw new RangeError(errors[type]); + } + + function map(array, fn) { + var result = []; + var length = array.length; + + while (length--) { + result[length] = fn(array[length]); + } + + return result; + } + + function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + + if (parts.length > 1) { + result = parts[0] + '@'; + string = parts[1]; + } + + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; + } + + function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + + while (counter < length) { + var value = string.charCodeAt(counter++); + + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + var extra = string.charCodeAt(counter++); + + if ((extra & 0xFC00) == 0xDC00) { + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + + return output; + } + + var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, _$$_REQUIRE(_dependencyMap[0])(array)); + }; + + var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + + return base; + }; + + var digitToBasic = function digitToBasic(digit, flag) { + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + }; + + var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + + for (; delta > 455; k += base) { + delta = floor(delta / baseMinusTMin); + } + + return floor(k + 36 * delta / (delta + skew)); + }; + + var decode = function decode(input) { + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + var basic = input.lastIndexOf(delimiter); + + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + + output.push(input.charCodeAt(j)); + } + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) { + var oldi = i; + + for (var w = 1, k = base;; k += base) { + if (index >= inputLength) { + error('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); + }; + + var encode = function encode(input) { + var output = []; + input = ucs2decode(input); + var inputLength = input.length; + var n = initialN; + var delta = 0; + var bias = initialBias; + + for (var _iterator = _createForOfIteratorHelperLoose(input), _step; !(_step = _iterator()).done;) { + var currentValue = _step.value; + + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + if (basicLength) { + output.push(delimiter); + } + + while (handledCPCount < inputLength) { + var m = maxInt; + + for (var _iterator2 = _createForOfIteratorHelperLoose(input), _step2; !(_step2 = _iterator2()).done;) { + var _currentValue = _step2.value; + + if (_currentValue >= n && _currentValue < m) { + m = _currentValue; + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (var _iterator3 = _createForOfIteratorHelperLoose(input), _step3; !(_step3 = _iterator3()).done;) { + var _currentValue2 = _step3.value; + + if (_currentValue2 < n && ++delta > maxInt) { + error('overflow'); + } + + if (_currentValue2 == n) { + var q = delta; + + for (var k = base;; k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (q < t) { + break; + } + + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + } + + return output.join(''); + }; + + var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); + }; + + var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); + }; + + var punycode = { + 'version': '2.1.0', + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + module.exports = punycode; +},744,[21]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; + } + + function isASCIIAlpha(c) { + return c >= 0x41 && c <= 0x5A || c >= 0x61 && c <= 0x7A; + } + + function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); + } + + function isASCIIHex(c) { + return isASCIIDigit(c) || c >= 0x41 && c <= 0x46 || c >= 0x61 && c <= 0x66; + } + + module.exports = { + isASCIIDigit: isASCIIDigit, + isASCIIAlpha: isASCIIAlpha, + isASCIIAlphanumeric: isASCIIAlphanumeric, + isASCIIHex: isASCIIHex + }; +},745,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + /*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + 'use strict'; + + var customInspectSymbol = typeof Symbol === 'function' && typeof Symbol['for'] === 'function' ? Symbol['for']('nodejs.util.inspect.custom') : null; + exports.Buffer = Buffer; + exports.SlowBuffer = SlowBuffer; + exports.INSPECT_MAX_BYTES = 50; + var K_MAX_LENGTH = 0x7fffffff; + exports.kMaxLength = K_MAX_LENGTH; + Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport(); + + if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { + console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."); + } + + function typedArraySupport() { + try { + var arr = new Uint8Array(1); + var proto = { + foo: function foo() { + return 42; + } + }; + Object.setPrototypeOf(proto, Uint8Array.prototype); + Object.setPrototypeOf(arr, proto); + return arr.foo() === 42; + } catch (e) { + return false; + } + } + + Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.buffer; + } + }); + Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function get() { + if (!Buffer.isBuffer(this)) return undefined; + return this.byteOffset; + } + }); + + function createBuffer(length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"'); + } + + var buf = new Uint8Array(length); + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function Buffer(arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError('The "string" argument must be of type string. Received type number'); + } + + return allocUnsafe(arg); + } + + return from(arg, encodingOrOffset, length); + } + + Buffer.poolSize = 8192; + + function from(value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset); + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value); + } + + if (value == null) { + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + + if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof SharedArrayBuffer !== 'undefined' && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length); + } + + if (typeof value === 'number') { + throw new TypeError('The "value" argument must not be of type number. Received type number'); + } + + var valueOf = value.valueOf && value.valueOf(); + + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length); + } + + var b = fromObject(value); + if (b) return b; + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length); + } + + throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value); + } + + Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length); + }; + + Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype); + Object.setPrototypeOf(Buffer, Uint8Array); + + function assertSize(size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number'); + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"'); + } + } + + function alloc(size, fill, encoding) { + assertSize(size); + + if (size <= 0) { + return createBuffer(size); + } + + if (fill !== undefined) { + return typeof encoding === 'string' ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill); + } + + return createBuffer(size); + } + + Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding); + }; + + function allocUnsafe(size) { + assertSize(size); + return createBuffer(size < 0 ? 0 : checked(size) | 0); + } + + Buffer.allocUnsafe = function (size) { + return allocUnsafe(size); + }; + + Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size); + }; + + function fromString(string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8'; + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + var length = byteLength(string, encoding) | 0; + var buf = createBuffer(length); + var actual = buf.write(string, encoding); + + if (actual !== length) { + buf = buf.slice(0, actual); + } + + return buf; + } + + function fromArrayLike(array) { + var length = array.length < 0 ? 0 : checked(array.length) | 0; + var buf = createBuffer(length); + + for (var i = 0; i < length; i += 1) { + buf[i] = array[i] & 255; + } + + return buf; + } + + function fromArrayView(arrayView) { + if (isInstance(arrayView, Uint8Array)) { + var copy = new Uint8Array(arrayView); + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength); + } + + return fromArrayLike(arrayView); + } + + function fromArrayBuffer(array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds'); + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds'); + } + + var buf; + + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array); + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset); + } else { + buf = new Uint8Array(array, byteOffset, length); + } + + Object.setPrototypeOf(buf, Buffer.prototype); + return buf; + } + + function fromObject(obj) { + if (Buffer.isBuffer(obj)) { + var len = checked(obj.length) | 0; + var buf = createBuffer(len); + + if (buf.length === 0) { + return buf; + } + + obj.copy(buf, 0, 0, len); + return buf; + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0); + } + + return fromArrayLike(obj); + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data); + } + } + + function checked(length) { + if (length >= K_MAX_LENGTH) { + throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + ' bytes'); + } + + return length | 0; + } + + function SlowBuffer(length) { + if (+length != length) { + length = 0; + } + + return Buffer.alloc(+length); + } + + Buffer.isBuffer = function isBuffer(b) { + return b != null && b._isBuffer === true && b !== Buffer.prototype; + }; + + Buffer.compare = function compare(a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength); + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength); + + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); + } + + if (a === b) return 0; + var x = a.length; + var y = b.length; + + for (var i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i]; + y = b[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + Buffer.isEncoding = function isEncoding(encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true; + + default: + return false; + } + }; + + Buffer.concat = function concat(list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } + + if (list.length === 0) { + return Buffer.alloc(0); + } + + var i; + + if (length === undefined) { + length = 0; + + for (i = 0; i < list.length; ++i) { + length += list[i].length; + } + } + + var buffer = Buffer.allocUnsafe(length); + var pos = 0; + + for (i = 0; i < list.length; ++i) { + var buf = list[i]; + + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + Buffer.from(buf).copy(buffer, pos); + } else { + Uint8Array.prototype.set.call(buffer, buf, pos); + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers'); + } else { + buf.copy(buffer, pos); + } + + pos += buf.length; + } + + return buffer; + }; + + function byteLength(string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length; + } + + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength; + } + + if (typeof string !== 'string') { + throw new TypeError("The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. Received type " + typeof string); + } + + var len = string.length; + var mustMatch = arguments.length > 2 && arguments[2] === true; + if (!mustMatch && len === 0) return 0; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len; + + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length; + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2; + + case 'hex': + return len >>> 1; + + case 'base64': + return base64ToBytes(string).length; + + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length; + } + + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.byteLength = byteLength; + + function slowToString(encoding, start, end) { + var loweredCase = false; + + if (start === undefined || start < 0) { + start = 0; + } + + if (start > this.length) { + return ''; + } + + if (end === undefined || end > this.length) { + end = this.length; + } + + if (end <= 0) { + return ''; + } + + end >>>= 0; + start >>>= 0; + + if (end <= start) { + return ''; + } + + if (!encoding) encoding = 'utf8'; + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end); + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end); + + case 'ascii': + return asciiSlice(this, start, end); + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end); + + case 'base64': + return base64Slice(this, start, end); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = (encoding + '').toLowerCase(); + loweredCase = true; + } + } + } + + Buffer.prototype._isBuffer = true; + + function swap(b, n, m) { + var i = b[n]; + b[n] = b[m]; + b[m] = i; + } + + Buffer.prototype.swap16 = function swap16() { + var len = this.length; + + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits'); + } + + for (var i = 0; i < len; i += 2) { + swap(this, i, i + 1); + } + + return this; + }; + + Buffer.prototype.swap32 = function swap32() { + var len = this.length; + + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits'); + } + + for (var i = 0; i < len; i += 4) { + swap(this, i, i + 3); + swap(this, i + 1, i + 2); + } + + return this; + }; + + Buffer.prototype.swap64 = function swap64() { + var len = this.length; + + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits'); + } + + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7); + swap(this, i + 1, i + 6); + swap(this, i + 2, i + 5); + swap(this, i + 3, i + 4); + } + + return this; + }; + + Buffer.prototype.toString = function toString() { + var length = this.length; + if (length === 0) return ''; + if (arguments.length === 0) return utf8Slice(this, 0, length); + return slowToString.apply(this, arguments); + }; + + Buffer.prototype.toLocaleString = Buffer.prototype.toString; + + Buffer.prototype.equals = function equals(b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer'); + if (this === b) return true; + return Buffer.compare(this, b) === 0; + }; + + Buffer.prototype.inspect = function inspect() { + var str = ''; + var max = exports.INSPECT_MAX_BYTES; + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim(); + if (this.length > max) str += ' ... '; + return ''; + }; + + if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect; + } + + Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength); + } + + if (!Buffer.isBuffer(target)) { + throw new TypeError("The \"target\" argument must be one of type Buffer or Uint8Array. Received type " + typeof target); + } + + if (start === undefined) { + start = 0; + } + + if (end === undefined) { + end = target ? target.length : 0; + } + + if (thisStart === undefined) { + thisStart = 0; + } + + if (thisEnd === undefined) { + thisEnd = this.length; + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index'); + } + + if (thisStart >= thisEnd && start >= end) { + return 0; + } + + if (thisStart >= thisEnd) { + return -1; + } + + if (start >= end) { + return 1; + } + + start >>>= 0; + end >>>= 0; + thisStart >>>= 0; + thisEnd >>>= 0; + if (this === target) return 0; + var x = thisEnd - thisStart; + var y = end - start; + var len = Math.min(x, y); + var thisCopy = this.slice(thisStart, thisEnd); + var targetCopy = target.slice(start, end); + + for (var i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i]; + y = targetCopy[i]; + break; + } + } + + if (x < y) return -1; + if (y < x) return 1; + return 0; + }; + + function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { + if (buffer.length === 0) return -1; + + if (typeof byteOffset === 'string') { + encoding = byteOffset; + byteOffset = 0; + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff; + } else if (byteOffset < -2147483648) { + byteOffset = -2147483648; + } + + byteOffset = +byteOffset; + + if (numberIsNaN(byteOffset)) { + byteOffset = dir ? 0 : buffer.length - 1; + } + + if (byteOffset < 0) byteOffset = buffer.length + byteOffset; + + if (byteOffset >= buffer.length) { + if (dir) return -1;else byteOffset = buffer.length - 1; + } else if (byteOffset < 0) { + if (dir) byteOffset = 0;else return -1; + } + + if (typeof val === 'string') { + val = Buffer.from(val, encoding); + } + + if (Buffer.isBuffer(val)) { + if (val.length === 0) { + return -1; + } + + return arrayIndexOf(buffer, val, byteOffset, encoding, dir); + } else if (typeof val === 'number') { + val = val & 0xFF; + + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset); + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset); + } + } + + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir); + } + + throw new TypeError('val must be string, number or Buffer'); + } + + function arrayIndexOf(arr, val, byteOffset, encoding, dir) { + var indexSize = 1; + var arrLength = arr.length; + var valLength = val.length; + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase(); + + if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1; + } + + indexSize = 2; + arrLength /= 2; + valLength /= 2; + byteOffset /= 2; + } + } + + function read(buf, i) { + if (indexSize === 1) { + return buf[i]; + } else { + return buf.readUInt16BE(i * indexSize); + } + } + + var i; + + if (dir) { + var foundIndex = -1; + + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i; + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize; + } else { + if (foundIndex !== -1) i -= i - foundIndex; + foundIndex = -1; + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength; + + for (i = byteOffset; i >= 0; i--) { + var found = true; + + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false; + break; + } + } + + if (found) return i; + } + } + + return -1; + } + + Buffer.prototype.includes = function includes(val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1; + }; + + Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true); + }; + + Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false); + }; + + function hexWrite(buf, string, offset, length) { + offset = Number(offset) || 0; + var remaining = buf.length - offset; + + if (!length) { + length = remaining; + } else { + length = Number(length); + + if (length > remaining) { + length = remaining; + } + } + + var strLen = string.length; + + if (length > strLen / 2) { + length = strLen / 2; + } + + for (var i = 0; i < length; ++i) { + var parsed = parseInt(string.substr(i * 2, 2), 16); + if (numberIsNaN(parsed)) return i; + buf[offset + i] = parsed; + } + + return i; + } + + function utf8Write(buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length); + } + + function asciiWrite(buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length); + } + + function base64Write(buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length); + } + + function ucs2Write(buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length); + } + + Buffer.prototype.write = function write(string, offset, length, encoding) { + if (offset === undefined) { + encoding = 'utf8'; + length = this.length; + offset = 0; + } else if (length === undefined && typeof offset === 'string') { + encoding = offset; + length = this.length; + offset = 0; + } else if (isFinite(offset)) { + offset = offset >>> 0; + + if (isFinite(length)) { + length = length >>> 0; + if (encoding === undefined) encoding = 'utf8'; + } else { + encoding = length; + length = undefined; + } + } else { + throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); + } + + var remaining = this.length - offset; + if (length === undefined || length > remaining) length = remaining; + + if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds'); + } + + if (!encoding) encoding = 'utf8'; + var loweredCase = false; + + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length); + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length); + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length); + + case 'base64': + return base64Write(this, string, offset, length); + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length); + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding); + encoding = ('' + encoding).toLowerCase(); + loweredCase = true; + } + } + }; + + Buffer.prototype.toJSON = function toJSON() { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + }; + }; + + function base64Slice(buf, start, end) { + if (start === 0 && end === buf.length) { + return _$$_REQUIRE(_dependencyMap[0]).fromByteArray(buf); + } else { + return _$$_REQUIRE(_dependencyMap[0]).fromByteArray(buf.slice(start, end)); + } + } + + function utf8Slice(buf, start, end) { + end = Math.min(buf.length, end); + var res = []; + var i = start; + + while (i < end) { + var firstByte = buf[i]; + var codePoint = null; + var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1; + + if (i + bytesPerSequence <= end) { + var secondByte, thirdByte, fourthByte, tempCodePoint; + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte; + } + + break; + + case 2: + secondByte = buf[i + 1]; + + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F; + + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint; + } + } + + break; + + case 3: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F; + + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint; + } + } + + break; + + case 4: + secondByte = buf[i + 1]; + thirdByte = buf[i + 2]; + fourthByte = buf[i + 3]; + + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F; + + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint; + } + } + + } + } + + if (codePoint === null) { + codePoint = 0xFFFD; + bytesPerSequence = 1; + } else if (codePoint > 0xFFFF) { + codePoint -= 0x10000; + res.push(codePoint >>> 10 & 0x3FF | 0xD800); + codePoint = 0xDC00 | codePoint & 0x3FF; + } + + res.push(codePoint); + i += bytesPerSequence; + } + + return decodeCodePointsArray(res); + } + + var MAX_ARGUMENTS_LENGTH = 0x1000; + + function decodeCodePointsArray(codePoints) { + var len = codePoints.length; + + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints); + } + + var res = ''; + var i = 0; + + while (i < len) { + res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)); + } + + return res; + } + + function asciiSlice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F); + } + + return ret; + } + + function latin1Slice(buf, start, end) { + var ret = ''; + end = Math.min(buf.length, end); + + for (var i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]); + } + + return ret; + } + + function hexSlice(buf, start, end) { + var len = buf.length; + if (!start || start < 0) start = 0; + if (!end || end < 0 || end > len) end = len; + var out = ''; + + for (var i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]]; + } + + return out; + } + + function utf16leSlice(buf, start, end) { + var bytes = buf.slice(start, end); + var res = ''; + + for (var i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256); + } + + return res; + } + + Buffer.prototype.slice = function slice(start, end) { + var len = this.length; + start = ~~start; + end = end === undefined ? len : ~~end; + + if (start < 0) { + start += len; + if (start < 0) start = 0; + } else if (start > len) { + start = len; + } + + if (end < 0) { + end += len; + if (end < 0) end = 0; + } else if (end > len) { + end = len; + } + + if (end < start) end = start; + var newBuf = this.subarray(start, end); + Object.setPrototypeOf(newBuf, Buffer.prototype); + return newBuf; + }; + + function checkOffset(offset, ext, length) { + if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); + } + + Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + return val; + }; + + Buffer.prototype.readUintBE = Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + checkOffset(offset, byteLength, this.length); + } + + var val = this[offset + --byteLength]; + var mul = 1; + + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul; + } + + return val; + }; + + Buffer.prototype.readUint8 = Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + return this[offset]; + }; + + Buffer.prototype.readUint16LE = Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] | this[offset + 1] << 8; + }; + + Buffer.prototype.readUint16BE = Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + return this[offset] << 8 | this[offset + 1]; + }; + + Buffer.prototype.readUint32LE = Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000; + }; + + Buffer.prototype.readUint32BE = Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]); + }; + + Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var val = this[offset]; + var mul = 1; + var i = 0; + + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) { + offset = offset >>> 0; + byteLength = byteLength >>> 0; + if (!noAssert) checkOffset(offset, byteLength, this.length); + var i = byteLength; + var mul = 1; + var val = this[offset + --i]; + + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul; + } + + mul *= 0x80; + if (val >= mul) val -= Math.pow(2, 8 * byteLength); + return val; + }; + + Buffer.prototype.readInt8 = function readInt8(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 1, this.length); + if (!(this[offset] & 0x80)) return this[offset]; + return (0xff - this[offset] + 1) * -1; + }; + + Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset] | this[offset + 1] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 2, this.length); + var val = this[offset + 1] | this[offset] << 8; + return val & 0x8000 ? val | 0xFFFF0000 : val; + }; + + Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24; + }; + + Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]; + }; + + Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return _$$_REQUIRE(_dependencyMap[1]).read(this, offset, true, 23, 4); + }; + + Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 4, this.length); + return _$$_REQUIRE(_dependencyMap[1]).read(this, offset, false, 23, 4); + }; + + Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return _$$_REQUIRE(_dependencyMap[1]).read(this, offset, true, 52, 8); + }; + + Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) { + offset = offset >>> 0; + if (!noAssert) checkOffset(offset, 8, this.length); + return _$$_REQUIRE(_dependencyMap[1]).read(this, offset, false, 52, 8); + }; + + function checkInt(buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance'); + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds'); + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + } + + Buffer.prototype.writeUintLE = Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var mul = 1; + var i = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUintBE = Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + byteLength = byteLength >>> 0; + + if (!noAssert) { + var maxBytes = Math.pow(2, 8 * byteLength) - 1; + checkInt(this, value, offset, byteLength, maxBytes, 0); + } + + var i = byteLength - 1; + var mul = 1; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = value / mul & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeUint8 = Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0); + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeUint16LE = Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeUint16BE = Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeUint32LE = Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset + 3] = value >>> 24; + this[offset + 2] = value >>> 16; + this[offset + 1] = value >>> 8; + this[offset] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeUint32BE = Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0); + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = 0; + var mul = 1; + var sub = 0; + this[offset] = value & 0xFF; + + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + var limit = Math.pow(2, 8 * byteLength - 1); + checkInt(this, value, offset, byteLength, limit - 1, -limit); + } + + var i = byteLength - 1; + var mul = 1; + var sub = 0; + this[offset + i] = value & 0xFF; + + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1; + } + + this[offset + i] = (value / mul >> 0) - sub & 0xFF; + } + + return offset + byteLength; + }; + + Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128); + if (value < 0) value = 0xff + value + 1; + this[offset] = value & 0xff; + return offset + 1; + }; + + Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + return offset + 2; + }; + + Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768); + this[offset] = value >>> 8; + this[offset + 1] = value & 0xff; + return offset + 2; + }; + + Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + this[offset] = value & 0xff; + this[offset + 1] = value >>> 8; + this[offset + 2] = value >>> 16; + this[offset + 3] = value >>> 24; + return offset + 4; + }; + + Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) { + value = +value; + offset = offset >>> 0; + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648); + if (value < 0) value = 0xffffffff + value + 1; + this[offset] = value >>> 24; + this[offset + 1] = value >>> 16; + this[offset + 2] = value >>> 8; + this[offset + 3] = value & 0xff; + return offset + 4; + }; + + function checkIEEE754(buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range'); + if (offset < 0) throw new RangeError('Index out of range'); + } + + function writeFloat(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38); + } + + _$$_REQUIRE(_dependencyMap[1]).write(buf, value, offset, littleEndian, 23, 4); + + return offset + 4; + } + + Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert); + }; + + function writeDouble(buf, value, offset, littleEndian, noAssert) { + value = +value; + offset = offset >>> 0; + + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157e+308); + } + + _$$_REQUIRE(_dependencyMap[1]).write(buf, value, offset, littleEndian, 52, 8); + + return offset + 8; + } + + Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert); + }; + + Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert); + }; + + Buffer.prototype.copy = function copy(target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer'); + if (!start) start = 0; + if (!end && end !== 0) end = this.length; + if (targetStart >= target.length) targetStart = target.length; + if (!targetStart) targetStart = 0; + if (end > 0 && end < start) end = start; + if (end === start) return 0; + if (target.length === 0 || this.length === 0) return 0; + + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds'); + } + + if (start < 0 || start >= this.length) throw new RangeError('Index out of range'); + if (end < 0) throw new RangeError('sourceEnd out of bounds'); + if (end > this.length) end = this.length; + + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start; + } + + var len = end - start; + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + this.copyWithin(targetStart, start, end); + } else { + Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart); + } + + return len; + }; + + Buffer.prototype.fill = function fill(val, start, end, encoding) { + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start; + start = 0; + end = this.length; + } else if (typeof end === 'string') { + encoding = end; + end = this.length; + } + + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string'); + } + + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding); + } + + if (val.length === 1) { + var code = val.charCodeAt(0); + + if (encoding === 'utf8' && code < 128 || encoding === 'latin1') { + val = code; + } + } + } else if (typeof val === 'number') { + val = val & 255; + } else if (typeof val === 'boolean') { + val = Number(val); + } + + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index'); + } + + if (end <= start) { + return this; + } + + start = start >>> 0; + end = end === undefined ? this.length : end >>> 0; + if (!val) val = 0; + var i; + + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val; + } + } else { + var bytes = Buffer.isBuffer(val) ? val : Buffer.from(val, encoding); + var len = bytes.length; + + if (len === 0) { + throw new TypeError('The value "' + val + '" is invalid for argument "value"'); + } + + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len]; + } + } + + return this; + }; + + var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g; + + function base64clean(str) { + str = str.split('=')[0]; + str = str.trim().replace(INVALID_BASE64_RE, ''); + if (str.length < 2) return ''; + + while (str.length % 4 !== 0) { + str = str + '='; + } + + return str; + } + + function utf8ToBytes(string, units) { + units = units || Infinity; + var codePoint; + var length = string.length; + var leadSurrogate = null; + var bytes = []; + + for (var i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i); + + if (codePoint > 0xD7FF && codePoint < 0xE000) { + if (!leadSurrogate) { + if (codePoint > 0xDBFF) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } else if (i + 1 === length) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + continue; + } + + leadSurrogate = codePoint; + continue; + } + + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + leadSurrogate = codePoint; + continue; + } + + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000; + } else if (leadSurrogate) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD); + } + + leadSurrogate = null; + + if (codePoint < 0x80) { + if ((units -= 1) < 0) break; + bytes.push(codePoint); + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break; + bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break; + bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break; + bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80); + } else { + throw new Error('Invalid code point'); + } + } + + return bytes; + } + + function asciiToBytes(str) { + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + byteArray.push(str.charCodeAt(i) & 0xFF); + } + + return byteArray; + } + + function utf16leToBytes(str, units) { + var c, hi, lo; + var byteArray = []; + + for (var i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break; + c = str.charCodeAt(i); + hi = c >> 8; + lo = c % 256; + byteArray.push(lo); + byteArray.push(hi); + } + + return byteArray; + } + + function base64ToBytes(str) { + return _$$_REQUIRE(_dependencyMap[0]).toByteArray(base64clean(str)); + } + + function blitBuffer(src, dst, offset, length) { + for (var i = 0; i < length; ++i) { + if (i + offset >= dst.length || i >= src.length) break; + dst[i + offset] = src[i]; + } + + return i; + } + + function isInstance(obj, type) { + return obj instanceof type || obj != null && obj.constructor != null && obj.constructor.name != null && obj.constructor.name === type.name; + } + + function numberIsNaN(obj) { + return obj !== obj; + } + + var hexSliceLookupTable = function () { + var alphabet = '0123456789abcdef'; + var table = new Array(256); + + for (var i = 0; i < 16; ++i) { + var i16 = i * 16; + + for (var j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j]; + } + } + + return table; + }(); +},746,[99,747]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var nBits = -7; + var i = isLE ? nBytes - 1 : 0; + var d = isLE ? -1 : 1; + var s = buffer[offset + i]; + i += d; + e = s & (1 << -nBits) - 1; + s >>= -nBits; + nBits += eLen; + + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & (1 << -nBits) - 1; + e >>= -nBits; + nBits += mLen; + + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias; + } else if (e === eMax) { + return m ? NaN : (s ? -1 : 1) * Infinity; + } else { + m = m + Math.pow(2, mLen); + e = e - eBias; + } + + return (s ? -1 : 1) * m * Math.pow(2, e - mLen); + }; + + exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c; + var eLen = nBytes * 8 - mLen - 1; + var eMax = (1 << eLen) - 1; + var eBias = eMax >> 1; + var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0; + var i = isLE ? 0 : nBytes - 1; + var d = isLE ? 1 : -1; + var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; + value = Math.abs(value); + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0; + e = eMax; + } else { + e = Math.floor(Math.log(value) / Math.LN2); + + if (value * (c = Math.pow(2, -e)) < 1) { + e--; + c *= 2; + } + + if (e + eBias >= 1) { + value += rt / c; + } else { + value += rt * Math.pow(2, 1 - eBias); + } + + if (value * c >= 2) { + e++; + c /= 2; + } + + if (e + eBias >= eMax) { + m = 0; + e = eMax; + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen); + e = e + eBias; + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen); + e = 0; + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = e << mLen | m; + eLen += mLen; + + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128; + }; +},747,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function strictlySplitByteSequence(buf, cp) { + var list = []; + var last = 0; + var i = buf.indexOf(cp); + + while (i >= 0) { + list.push(buf.slice(last, i)); + last = i + 1; + i = buf.indexOf(cp, last); + } + + if (last !== buf.length) { + list.push(buf.slice(last)); + } + + return list; + } + + function replaceByteInByteSequence(buf, from, to) { + var i = buf.indexOf(from); + + while (i >= 0) { + buf[i] = to; + i = buf.indexOf(from, i + 1); + } + + return buf; + } + + function percentEncode(c) { + var hex = c.toString(16).toUpperCase(); + + if (hex.length === 1) { + hex = "0" + hex; + } + + return "%" + hex; + } + + function percentDecode(input) { + var output = _$$_REQUIRE(_dependencyMap[0]).Buffer.alloc(input.byteLength); + + var ptr = 0; + + for (var i = 0; i < input.length; ++i) { + if (input[i] !== 37 || !_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(input[i + 1]) || !_$$_REQUIRE(_dependencyMap[1]).isASCIIHex(input[i + 2])) { + output[ptr++] = input[i]; + } else { + output[ptr++] = parseInt(input.slice(i + 1, i + 3).toString(), 16); + i += 2; + } + } + + return output.slice(0, ptr); + } + + function _parseUrlencoded(input) { + var sequences = strictlySplitByteSequence(input, 38); + var output = []; + + for (var _iterator = _createForOfIteratorHelperLoose(sequences), _step; !(_step = _iterator()).done;) { + var bytes = _step.value; + + if (bytes.length === 0) { + continue; + } + + var name = undefined; + var value = undefined; + var indexOfEqual = bytes.indexOf(61); + + if (indexOfEqual >= 0) { + name = bytes.slice(0, indexOfEqual); + value = bytes.slice(indexOfEqual + 1); + } else { + name = bytes; + value = _$$_REQUIRE(_dependencyMap[0]).Buffer.alloc(0); + } + + name = replaceByteInByteSequence(_$$_REQUIRE(_dependencyMap[0]).Buffer.from(name), 43, 32); + value = replaceByteInByteSequence(_$$_REQUIRE(_dependencyMap[0]).Buffer.from(value), 43, 32); + output.push([percentDecode(name).toString(), percentDecode(value).toString()]); + } + + return output; + } + + function serializeUrlencodedByte(input) { + var output = ""; + + for (var _iterator2 = _createForOfIteratorHelperLoose(input), _step2; !(_step2 = _iterator2()).done;) { + var byte = _step2.value; + + if (byte === 32) { + output += "+"; + } else if (byte === 42 || byte === 45 || byte === 46 || byte >= 48 && byte <= 57 || byte >= 65 && byte <= 90 || byte === 95 || byte >= 97 && byte <= 122) { + output += String.fromCodePoint(byte); + } else { + output += percentEncode(byte); + } + } + + return output; + } + + function serializeUrlencoded(tuples) { + var encodingOverride = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + var encoding = "utf-8"; + + if (encodingOverride !== undefined) { + encoding = encodingOverride; + } + + var output = ""; + + for (var _iterator3 = _createForOfIteratorHelperLoose(tuples.entries()), _step3; !(_step3 = _iterator3()).done;) { + var _ref = _step3.value; + + var _ref2 = _$$_REQUIRE(_dependencyMap[2])(_ref, 2); + + var i = _ref2[0]; + var tuple = _ref2[1]; + var name = serializeUrlencodedByte(_$$_REQUIRE(_dependencyMap[0]).Buffer.from(tuple[0])); + var value = tuple[1]; + + if (tuple.length > 2 && tuple[2] !== undefined) { + if (tuple[2] === "hidden" && name === "_charset_") { + value = encoding; + } else if (tuple[2] === "file") { + value = value.name; + } + } + + value = serializeUrlencodedByte(_$$_REQUIRE(_dependencyMap[0]).Buffer.from(value)); + + if (i !== 0) { + output += "&"; + } + + output += name + "=" + value; + } + + return output; + } + + module.exports = { + percentEncode: percentEncode, + percentDecode: percentDecode, + parseUrlencoded: function parseUrlencoded(input) { + return _parseUrlencoded(_$$_REQUIRE(_dependencyMap[0]).Buffer.from(input)); + }, + serializeUrlencoded: serializeUrlencoded + }; +},748,[746,745,41]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + var IteratorPrototype = Object.create(_$$_REQUIRE(_dependencyMap[0]).IteratorPrototype, _$$_REQUIRE(_dependencyMap[1])({ + next: { + value: function next() { + var internal = this[_$$_REQUIRE(_dependencyMap[0]).iterInternalSymbol]; + + var target = internal.target, + kind = internal.kind, + index = internal.index; + var values = Array.from(target[_$$_REQUIRE(_dependencyMap[0]).implSymbol]); + var len = values.length; + + if (index >= len) { + return { + value: undefined, + done: true + }; + } + + var pair = values[index]; + internal.index = index + 1; + + var _pair$map = pair.map(_$$_REQUIRE(_dependencyMap[0]).tryWrapperForImpl), + _pair$map2 = _$$_REQUIRE(_dependencyMap[2])(_pair$map, 2), + key = _pair$map2[0], + value = _pair$map2[1]; + + var result; + + switch (kind) { + case "key": + result = key; + break; + + case "value": + result = value; + break; + + case "key+value": + result = [key, value]; + break; + } + + return { + value: result, + done: false + }; + }, + writable: true, + enumerable: true, + configurable: true + } + }, Symbol.toStringTag, { + value: "URLSearchParams Iterator", + configurable: true + })); + var iface = { + _mixedIntoPredicates: [], + is: function is(obj) { + if (obj) { + if (_$$_REQUIRE(_dependencyMap[0]).hasOwn(obj, _$$_REQUIRE(_dependencyMap[0]).implSymbol) && obj[_$$_REQUIRE(_dependencyMap[0]).implSymbol] instanceof _$$_REQUIRE(_dependencyMap[3]).implementation) { + return true; + } + + for (var _iterator = _createForOfIteratorHelperLoose(module.exports._mixedIntoPredicates), _step; !(_step = _iterator()).done;) { + var isMixedInto = _step.value; + + if (isMixedInto(obj)) { + return true; + } + } + } + + return false; + }, + isImpl: function isImpl(obj) { + if (obj) { + if (obj instanceof _$$_REQUIRE(_dependencyMap[3]).implementation) { + return true; + } + + var wrapper = _$$_REQUIRE(_dependencyMap[0]).wrapperForImpl(obj); + + for (var _iterator2 = _createForOfIteratorHelperLoose(module.exports._mixedIntoPredicates), _step2; !(_step2 = _iterator2()).done;) { + var isMixedInto = _step2.value; + + if (isMixedInto(wrapper)) { + return true; + } + } + } + + return false; + }, + convert: function convert(obj) { + var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref$context = _ref.context, + context = _ref$context === undefined ? "The provided value" : _ref$context; + + if (module.exports.is(obj)) { + return _$$_REQUIRE(_dependencyMap[0]).implForWrapper(obj); + } + + throw new TypeError(context + " is not of type 'URLSearchParams'."); + }, + createDefaultIterator: function createDefaultIterator(target, kind) { + var iterator = Object.create(IteratorPrototype); + Object.defineProperty(iterator, _$$_REQUIRE(_dependencyMap[0]).iterInternalSymbol, { + value: { + target: target, + kind: kind, + index: 0 + }, + configurable: true + }); + return iterator; + }, + create: function create(globalObject, constructorArgs, privateData) { + if (globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol] === undefined) { + throw new Error("Internal error: invalid global object"); + } + + var ctor = globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol]["URLSearchParams"]; + + if (ctor === undefined) { + throw new Error("Internal error: constructor URLSearchParams is not installed on the passed global object"); + } + + var obj = Object.create(ctor.prototype); + obj = iface.setup(obj, globalObject, constructorArgs, privateData); + return obj; + }, + createImpl: function createImpl(globalObject, constructorArgs, privateData) { + var obj = iface.create(globalObject, constructorArgs, privateData); + return _$$_REQUIRE(_dependencyMap[0]).implForWrapper(obj); + }, + _internalSetup: function _internalSetup(obj) {}, + setup: function setup(obj, globalObject) { + var constructorArgs = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var privateData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + privateData.wrapper = obj; + + iface._internalSetup(obj); + + Object.defineProperty(obj, _$$_REQUIRE(_dependencyMap[0]).implSymbol, { + value: new (_$$_REQUIRE(_dependencyMap[3]).implementation)(globalObject, constructorArgs, privateData), + configurable: true + }); + obj[_$$_REQUIRE(_dependencyMap[0]).implSymbol][_$$_REQUIRE(_dependencyMap[0]).wrapperSymbol] = obj; + + if (_$$_REQUIRE(_dependencyMap[3]).init) { + _$$_REQUIRE(_dependencyMap[3]).init(obj[_$$_REQUIRE(_dependencyMap[0]).implSymbol], privateData); + } + + return obj; + }, + install: function install(globalObject) { + var _Object$definePropert; + + var URLSearchParams = function () { + function URLSearchParams() { + _$$_REQUIRE(_dependencyMap[4])(this, URLSearchParams); + + var args = []; + { + var curArg = arguments[0]; + + if (curArg !== undefined) { + if (_$$_REQUIRE(_dependencyMap[0]).isObject(curArg)) { + if (curArg[Symbol.iterator] !== undefined) { + if (!_$$_REQUIRE(_dependencyMap[0]).isObject(curArg)) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence is not an iterable object."); + } else { + var V = []; + var tmp = curArg; + + for (var _iterator3 = _createForOfIteratorHelperLoose(tmp), _step3; !(_step3 = _iterator3()).done;) { + var nextItem = _step3.value; + + if (!_$$_REQUIRE(_dependencyMap[0]).isObject(nextItem)) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element is not an iterable object."); + } else { + var _V = []; + var _tmp = nextItem; + + for (var _iterator4 = _createForOfIteratorHelperLoose(_tmp), _step4; !(_step4 = _iterator4()).done;) { + var _nextItem = _step4.value; + _nextItem = _$$_REQUIRE(_dependencyMap[5])["USVString"](_nextItem, { + context: "Failed to construct 'URLSearchParams': parameter 1 sequence's element's element" + }); + + _V.push(_nextItem); + } + + nextItem = _V; + } + + V.push(nextItem); + } + + curArg = V; + } + } else { + if (!_$$_REQUIRE(_dependencyMap[0]).isObject(curArg)) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 record is not an object."); + } else { + var result = Object.create(null); + + for (var _iterator5 = _createForOfIteratorHelperLoose(Reflect.ownKeys(curArg)), _step5; !(_step5 = _iterator5()).done;) { + var key = _step5.value; + var desc = Object.getOwnPropertyDescriptor(curArg, key); + + if (desc && desc.enumerable) { + var typedKey = key; + typedKey = _$$_REQUIRE(_dependencyMap[5])["USVString"](typedKey, { + context: "Failed to construct 'URLSearchParams': parameter 1 record's key" + }); + var typedValue = curArg[key]; + typedValue = _$$_REQUIRE(_dependencyMap[5])["USVString"](typedValue, { + context: "Failed to construct 'URLSearchParams': parameter 1 record's value" + }); + result[typedKey] = typedValue; + } + } + + curArg = result; + } + } + } else { + curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](curArg, { + context: "Failed to construct 'URLSearchParams': parameter 1" + }); + } + } else { + curArg = ""; + } + + args.push(curArg); + } + return iface.setup(Object.create(this.constructor.prototype), globalObject, args); + } + + _$$_REQUIRE(_dependencyMap[6])(URLSearchParams, [{ + key: "append", + value: function append(name, value) { + var _this$impl; + + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 2) { + throw new TypeError("Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only " + arguments.length + " present."); + } + + var args = []; + { + var curArg = arguments[0]; + curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + { + var _curArg = arguments[1]; + _curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](_curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 2" + }); + args.push(_curArg); + } + return (_this$impl = this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]).append.apply(_this$impl, args); + } + }, { + key: "delete", + value: function _delete(name) { + var _this$impl2; + + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError("Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only " + arguments.length + " present."); + } + + var args = []; + { + var curArg = arguments[0]; + curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return (_this$impl2 = this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]).delete.apply(_this$impl2, args); + } + }, { + key: "get", + value: function get(name) { + var _this$impl3; + + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError("Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only " + arguments.length + " present."); + } + + var args = []; + { + var curArg = arguments[0]; + curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](curArg, { + context: "Failed to execute 'get' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return (_this$impl3 = this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]).get.apply(_this$impl3, args); + } + }, { + key: "getAll", + value: function getAll(name) { + var _this$impl4; + + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError("Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only " + arguments.length + " present."); + } + + var args = []; + { + var curArg = arguments[0]; + curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](curArg, { + context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return _$$_REQUIRE(_dependencyMap[0]).tryWrapperForImpl((_this$impl4 = this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]).getAll.apply(_this$impl4, args)); + } + }, { + key: "has", + value: function has(name) { + var _this$impl5; + + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError("Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only " + arguments.length + " present."); + } + + var args = []; + { + var curArg = arguments[0]; + curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return (_this$impl5 = this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]).has.apply(_this$impl5, args); + } + }, { + key: "set", + value: function set(name, value) { + var _this$impl6; + + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 2) { + throw new TypeError("Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only " + arguments.length + " present."); + } + + var args = []; + { + var curArg = arguments[0]; + curArg = _$$_REQUIRE(_dependencyMap[5])["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + { + var _curArg2 = arguments[1]; + _curArg2 = _$$_REQUIRE(_dependencyMap[5])["USVString"](_curArg2, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 2" + }); + args.push(_curArg2); + } + return (_this$impl6 = this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]).set.apply(_this$impl6, args); + } + }, { + key: "sort", + value: function sort() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol].sort(); + } + }, { + key: "toString", + value: function toString() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[_$$_REQUIRE(_dependencyMap[0]).implSymbol].toString(); + } + }, { + key: "keys", + value: function keys() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return module.exports.createDefaultIterator(this, "key"); + } + }, { + key: "values", + value: function values() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return module.exports.createDefaultIterator(this, "value"); + } + }, { + key: "entries", + value: function entries() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return module.exports.createDefaultIterator(this, "key+value"); + } + }, { + key: "forEach", + value: function forEach(callback) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, but only 0 present."); + } + + if (typeof callback !== "function") { + throw new TypeError("Failed to execute 'forEach' on 'iterable': The callback provided as parameter 1 is not a function."); + } + + var thisArg = arguments[1]; + var pairs = Array.from(this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]); + var i = 0; + + while (i < pairs.length) { + var _pairs$i$map = pairs[i].map(_$$_REQUIRE(_dependencyMap[0]).tryWrapperForImpl), + _pairs$i$map2 = _$$_REQUIRE(_dependencyMap[2])(_pairs$i$map, 2), + key = _pairs$i$map2[0], + value = _pairs$i$map2[1]; + + callback.call(thisArg, value, key, this); + pairs = Array.from(this[_$$_REQUIRE(_dependencyMap[0]).implSymbol]); + i++; + } + } + }]); + + return URLSearchParams; + }(); + + Object.defineProperties(URLSearchParams.prototype, (_Object$definePropert = { + append: { + enumerable: true + }, + delete: { + enumerable: true + }, + get: { + enumerable: true + }, + getAll: { + enumerable: true + }, + has: { + enumerable: true + }, + set: { + enumerable: true + }, + sort: { + enumerable: true + }, + toString: { + enumerable: true + }, + keys: { + enumerable: true + }, + values: { + enumerable: true + }, + entries: { + enumerable: true + }, + forEach: { + enumerable: true + } + }, _$$_REQUIRE(_dependencyMap[1])(_Object$definePropert, Symbol.toStringTag, { + value: "URLSearchParams", + configurable: true + }), _$$_REQUIRE(_dependencyMap[1])(_Object$definePropert, Symbol.iterator, { + value: URLSearchParams.prototype.entries, + configurable: true, + writable: true + }), _Object$definePropert)); + + if (globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol] === undefined) { + globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol] = Object.create(null); + } + + globalObject[_$$_REQUIRE(_dependencyMap[0]).ctorRegistrySymbol]["URLSearchParams"] = URLSearchParams; + Object.defineProperty(globalObject, "URLSearchParams", { + configurable: true, + writable: true, + value: URLSearchParams + }); + } + }; + module.exports = iface; +},749,[741,27,41,750,7,751,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function stableSortBy(arr, compare) { + return arr.map(function (item, index) { + return { + item: item, + index: index + }; + }).sort(function (a, b) { + return compare(a.item, b.item) || a.index - b.index; + }).map(function (_ref) { + var item = _ref.item; + return item; + }); + } + + exports.implementation = function () { + function URLSearchParamsImpl(globalObject, constructorArgs, _ref2) { + var _ref2$doNotStripQMark = _ref2.doNotStripQMark, + doNotStripQMark = _ref2$doNotStripQMark === undefined ? false : _ref2$doNotStripQMark; + + _$$_REQUIRE(_dependencyMap[0])(this, URLSearchParamsImpl); + + var init = constructorArgs[0]; + this._list = []; + this._url = null; + + if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { + init = init.slice(1); + } + + if (Array.isArray(init)) { + for (var _iterator = _createForOfIteratorHelperLoose(init), _step; !(_step = _iterator()).done;) { + var pair = _step.value; + + if (pair.length !== 2) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not contain exactly two elements."); + } + + this._list.push([pair[0], pair[1]]); + } + } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { + for (var _i = 0, _Object$keys = Object.keys(init); _i < _Object$keys.length; _i++) { + var name = _Object$keys[_i]; + var value = init[name]; + + this._list.push([name, value]); + } + } else { + this._list = _$$_REQUIRE(_dependencyMap[1]).parseUrlencoded(init); + } + } + + _$$_REQUIRE(_dependencyMap[2])(URLSearchParamsImpl, [{ + key: "_updateSteps", + value: function _updateSteps() { + if (this._url !== null) { + var query = _$$_REQUIRE(_dependencyMap[1]).serializeUrlencoded(this._list); + + if (query === "") { + query = null; + } + + this._url._url.query = query; + } + } + }, { + key: "append", + value: function append(name, value) { + this._list.push([name, value]); + + this._updateSteps(); + } + }, { + key: "delete", + value: function _delete(name) { + var i = 0; + + while (i < this._list.length) { + if (this._list[i][0] === name) { + this._list.splice(i, 1); + } else { + i++; + } + } + + this._updateSteps(); + } + }, { + key: "get", + value: function get(name) { + for (var _iterator2 = _createForOfIteratorHelperLoose(this._list), _step2; !(_step2 = _iterator2()).done;) { + var tuple = _step2.value; + + if (tuple[0] === name) { + return tuple[1]; + } + } + + return null; + } + }, { + key: "getAll", + value: function getAll(name) { + var output = []; + + for (var _iterator3 = _createForOfIteratorHelperLoose(this._list), _step3; !(_step3 = _iterator3()).done;) { + var tuple = _step3.value; + + if (tuple[0] === name) { + output.push(tuple[1]); + } + } + + return output; + } + }, { + key: "has", + value: function has(name) { + for (var _iterator4 = _createForOfIteratorHelperLoose(this._list), _step4; !(_step4 = _iterator4()).done;) { + var tuple = _step4.value; + + if (tuple[0] === name) { + return true; + } + } + + return false; + } + }, { + key: "set", + value: function set(name, value) { + var found = false; + var i = 0; + + while (i < this._list.length) { + if (this._list[i][0] === name) { + if (found) { + this._list.splice(i, 1); + } else { + found = true; + this._list[i][1] = value; + i++; + } + } else { + i++; + } + } + + if (!found) { + this._list.push([name, value]); + } + + this._updateSteps(); + } + }, { + key: "sort", + value: function sort() { + this._list = stableSortBy(this._list, function (a, b) { + return a[0] > b[0]; + }); + + this._updateSteps(); + } + }, { + key: Symbol.iterator, + value: function value() { + return this._list[Symbol.iterator](); + } + }, { + key: "toString", + value: function toString() { + return _$$_REQUIRE(_dependencyMap[1]).serializeUrlencoded(this._list); + } + }]); + + return URLSearchParamsImpl; + }(); +},750,[7,748,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function _(message, opts) { + return (opts && opts.context ? opts.context : "Value") + " " + message + "."; + } + + function type(V) { + if (V === null) { + return "Null"; + } + + switch (typeof V) { + case "undefined": + return "Undefined"; + + case "boolean": + return "Boolean"; + + case "number": + return "Number"; + + case "string": + return "String"; + + case "symbol": + return "Symbol"; + + case "object": + case "function": + default: + return "Object"; + } + } + + function evenRound(x) { + if (x > 0 && x % 1 === 0.5 && (x & 1) === 0 || x < 0 && x % 1 === -0.5 && (x & 1) === 1) { + return censorNegativeZero(Math.floor(x)); + } + + return censorNegativeZero(Math.round(x)); + } + + function integerPart(n) { + return censorNegativeZero(Math.trunc(n)); + } + + function sign(x) { + return x < 0 ? -1 : 1; + } + + function modulo(x, y) { + var signMightNotMatch = x % y; + + if (sign(y) !== sign(signMightNotMatch)) { + return signMightNotMatch + y; + } + + return signMightNotMatch; + } + + function censorNegativeZero(x) { + return x === 0 ? 0 : x; + } + + function createIntegerConversion(bitLength, typeOpts) { + var isSigned = !typeOpts.unsigned; + var lowerBound; + var upperBound; + + if (bitLength === 64) { + upperBound = Math.pow(2, 53) - 1; + lowerBound = !isSigned ? 0 : -Math.pow(2, 53) + 1; + } else if (!isSigned) { + lowerBound = 0; + upperBound = Math.pow(2, bitLength) - 1; + } else { + lowerBound = -Math.pow(2, bitLength - 1); + upperBound = Math.pow(2, bitLength - 1) - 1; + } + + var twoToTheBitLength = Math.pow(2, bitLength); + var twoToOneLessThanTheBitLength = Math.pow(2, bitLength - 1); + return function (V, opts) { + if (opts === undefined) { + opts = {}; + } + + var x = +V; + x = censorNegativeZero(x); + + if (opts.enforceRange) { + if (!Number.isFinite(x)) { + throw new TypeError(_("is not a finite number", opts)); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw new TypeError(_("is outside the accepted range of " + lowerBound + " to " + upperBound + ", inclusive", opts)); + } + + return x; + } + + if (!Number.isNaN(x) && opts.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + + x = integerPart(x); + + if (x >= lowerBound && x <= upperBound) { + return x; + } + + x = modulo(x, twoToTheBitLength); + + if (isSigned && x >= twoToOneLessThanTheBitLength) { + return x - twoToTheBitLength; + } + + return x; + }; + } + + exports.any = function (V) { + return V; + }; + + exports.void = function () { + return undefined; + }; + + exports.boolean = function (val) { + return !!val; + }; + + exports.byte = createIntegerConversion(8, { + unsigned: false + }); + exports.octet = createIntegerConversion(8, { + unsigned: true + }); + exports.short = createIntegerConversion(16, { + unsigned: false + }); + exports["unsigned short"] = createIntegerConversion(16, { + unsigned: true + }); + exports.long = createIntegerConversion(32, { + unsigned: false + }); + exports["unsigned long"] = createIntegerConversion(32, { + unsigned: true + }); + exports["long long"] = createIntegerConversion(64, { + unsigned: false + }); + exports["unsigned long long"] = createIntegerConversion(64, { + unsigned: true + }); + + exports.double = function (V, opts) { + var x = +V; + + if (!Number.isFinite(x)) { + throw new TypeError(_("is not a finite floating-point value", opts)); + } + + return x; + }; + + exports["unrestricted double"] = function (V) { + var x = +V; + return x; + }; + + exports.float = function (V, opts) { + var x = +V; + + if (!Number.isFinite(x)) { + throw new TypeError(_("is not a finite floating-point value", opts)); + } + + if (Object.is(x, -0)) { + return x; + } + + var y = Math.fround(x); + + if (!Number.isFinite(y)) { + throw new TypeError(_("is outside the range of a single-precision floating-point value", opts)); + } + + return y; + }; + + exports["unrestricted float"] = function (V) { + var x = +V; + + if (isNaN(x)) { + return x; + } + + if (Object.is(x, -0)) { + return x; + } + + return Math.fround(x); + }; + + exports.DOMString = function (V, opts) { + if (opts === undefined) { + opts = {}; + } + + if (opts.treatNullAsEmptyString && V === null) { + return ""; + } + + if (typeof V === "symbol") { + throw new TypeError(_("is a symbol, which cannot be converted to a string", opts)); + } + + return String(V); + }; + + exports.ByteString = function (V, opts) { + var x = exports.DOMString(V, opts); + var c; + + for (var i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw new TypeError(_("is not a valid ByteString", opts)); + } + } + + return x; + }; + + exports.USVString = function (V, opts) { + var S = exports.DOMString(V, opts); + var n = S.length; + var U = []; + + for (var i = 0; i < n; ++i) { + var c = S.charCodeAt(i); + + if (c < 0xD800 || c > 0xDFFF) { + U.push(String.fromCodePoint(c)); + } else if (0xDC00 <= c && c <= 0xDFFF) { + U.push(String.fromCodePoint(0xFFFD)); + } else if (i === n - 1) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + var d = S.charCodeAt(i + 1); + + if (0xDC00 <= d && d <= 0xDFFF) { + var a = c & 0x3FF; + var b = d & 0x3FF; + U.push(String.fromCodePoint(65536 + 1024 * a + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xFFFD)); + } + } + } + + return U.join(""); + }; + + exports.object = function (V, opts) { + if (type(V) !== "Object") { + throw new TypeError(_("is not an object", opts)); + } + + return V; + }; + + function convertCallbackFunction(V, opts) { + if (typeof V !== "function") { + throw new TypeError(_("is not a function", opts)); + } + + return V; + } + + var abByteLengthGetter = Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get; + + function isArrayBuffer(V) { + try { + abByteLengthGetter.call(V); + return true; + } catch (e) { + return false; + } + } + + exports.ArrayBuffer = function (V, opts) { + if (!isArrayBuffer(V)) { + throw new TypeError(_("is not a view on an ArrayBuffer object", opts)); + } + + return V; + }; + + var dvByteLengthGetter = Object.getOwnPropertyDescriptor(DataView.prototype, "byteLength").get; + + exports.DataView = function (V, opts) { + try { + dvByteLengthGetter.call(V); + return V; + } catch (e) { + throw new TypeError(_("is not a view on an DataView object", opts)); + } + }; + + [Int8Array, Int16Array, Int32Array, Uint8Array, Uint16Array, Uint32Array, Uint8ClampedArray, Float32Array, Float64Array].forEach(function (func) { + var name = func.name; + var article = /^[AEIOU]/.test(name) ? "an" : "a"; + + exports[name] = function (V, opts) { + if (!ArrayBuffer.isView(V) || V.constructor.name !== name) { + throw new TypeError(_("is not " + article + " " + name + " object", opts)); + } + + return V; + }; + }); + + exports.ArrayBufferView = function (V, opts) { + if (!ArrayBuffer.isView(V)) { + throw new TypeError(_("is not a view on an ArrayBuffer object", opts)); + } + + return V; + }; + + exports.BufferSource = function (V, opts) { + if (!ArrayBuffer.isView(V) && !isArrayBuffer(V)) { + throw new TypeError(_("is not an ArrayBuffer object or a view on one", opts)); + } + + return V; + }; + + exports.DOMTimeStamp = exports["unsigned long long"]; + exports.Function = convertCallbackFunction; + exports.VoidFunction = convertCallbackFunction; +},751,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "URLSearchParams", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).URLSearchParams; + } + }); +},752,[738]); +__d(function(global, require, _importDefaultUnused, _importAllUnused, module, exports, _dependencyMapUnused) { + module.exports = { + "_args": [ + [ + "react-native-url-polyfill@1.3.0", + "/Users/ipaddev/sdk/firebase-ios-upgrade" + ] + ], + "_from": "react-native-url-polyfill@1.3.0", + "_id": "react-native-url-polyfill@1.3.0", + "_inBundle": false, + "_integrity": "sha512-w9JfSkvpqqlix9UjDvJjm1EjSt652zVQ6iwCIj1cVVkwXf4jQhQgTNXY6EVTwuAmUjg6BC6k9RHCBynoLFo3IQ==", + "_location": "/react-native-url-polyfill", + "_phantomChildren": {}, + "_requested": { + "type": "version", + "registry": true, + "raw": "react-native-url-polyfill@1.3.0", + "name": "react-native-url-polyfill", + "escapedName": "react-native-url-polyfill", + "rawSpec": "1.3.0", + "saveSpec": null, + "fetchSpec": "1.3.0" + }, + "_requiredBy": [ + "/rn-options-page" + ], + "_resolved": "https://registry.npmjs.org/react-native-url-polyfill/-/react-native-url-polyfill-1.3.0.tgz", + "_spec": "1.3.0", + "_where": "/Users/ipaddev/sdk/firebase-ios-upgrade", + "author": { + "name": "Nicolas Charpentier", + "email": "nicolas.charpentier079@gmail.com" + }, + "bugs": { + "url": "https://github.com/charpeni/react-native-url-polyfill/issues" + }, + "dependencies": { + "whatwg-url-without-unicode": "8.0.0-3" + }, + "description": "A lightweight and trustworthy URL polyfill for React Native", + "devDependencies": { + "@react-native-community/eslint-config": "^2.0.0", + "chalk": "^4.0.0", + "eslint": "^7.1.0", + "eslint-plugin-prettier": "^3.1.3", + "execa": "^5.0.0", + "filesize": "^6.1.0", + "husky": ">=1", + "jest": "^26.0.1", + "lint-staged": ">=8", + "metro-react-native-babel-preset": "^0.65.0", + "ora": "^5.3.0", + "prepend-file": "^1.3.1", + "prettier": "^2.0.5", + "react": "16.13.1", + "react-native": "0.63.4", + "rmfr": "^2.0.0", + "source-map-explorer": "^2.4.2", + "tmp": "^0.2.1", + "typescript": "^4.1.3", + "uuid": "^8.1.0" + }, + "homepage": "https://github.com/charpeni/react-native-url-polyfill", + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "jest": { + "preset": "react-native", + "testPathIgnorePatterns": [ + "/node_modules/", + "./detox/" + ] + }, + "keywords": [ + "URL", + "URLSearchParams", + "polyfill", + "react native", + "whatwg-url" + ], + "license": "MIT", + "lint-staged": { + "*.js": [ + "eslint --fix", + "git add" + ] + }, + "main": "index.js", + "name": "react-native-url-polyfill", + "peerDependencies": { + "react-native": "*" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/charpeni/react-native-url-polyfill.git" + }, + "scripts": { + "bundle-size": "node scripts/bundle-size", + "lint": "eslint .", + "test": "jest" + }, + "types": "index.d.ts", + "version": "1.3.0" +} +; +},753,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + exports.getVersion = getVersion; + exports.setFavoriteEdition = setFavoriteEdition; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _api = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _network = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _errorsView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _routesHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _editionsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _routeSeparator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _routeHeader = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _liveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _paperSetupConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _localeConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _userConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _Content = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _issue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _excluded = ["pSetup", "server", "pSetupOverride", "WebViewComponent", "initialRoute", "getSavedIssues", "languagePackOverride", "onPSetupError", "onLocaleError", "onUserSettingsError", "onEditionsError", "onSpecialsError", "issueCallbacks", "logCallbacks", "urlParams", "favoriteEdition"]; + + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + + var cache = _getRequireWildcardCache(nodeInterop); + + if (cache && cache.has(obj)) { + return cache.get(obj); + } + + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + + newObj.default = obj; + + if (cache) { + cache.set(obj, newObj); + } + + return newObj; + } + + var styles = _reactNative.StyleSheet.create({ + app: { + height: "100%", + flex: 1, + justifyContent: "center", + alignItems: "center", + backgroundColor: _$$_REQUIRE(_dependencyMap[24]).colors.white + }, + errors: { + position: "absolute", + bottom: 0, + left: 0, + right: 0 + } + }); + + function getVersion() { + return _$$_REQUIRE(_dependencyMap[25]).VERSION; + } + + function initAPI() { + _api.default.setServer(_liveConfig.default.getServer()); + + _api.default.setEntryPoint(_liveConfig.default.getEntryPoint()); + + _api.default.setParams((0, _extends2.default)({}, _liveConfig.default.apiParams(), { + pSetup: _liveConfig.default.getPSetupName(), + version: getVersion() + })); + + _api.default.init(); + } + + function getStateData(getSavedIssues) { + var editionsRaw, editions, savedIssues, firstIssue, aspectRatio; + return _regenerator.default.async(function getStateData$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap((0, _api.getEditions)({ + pSetup: _liveConfig.default.getMainPSetupName() + })); + + case 2: + editionsRaw = _context.sent; + + _liveConfig.default.getSettings().setEditions(editionsRaw); + + editions = _editionsHelper.default.parseEditions(_liveConfig.default.getSettings().editions); + + if (!(typeof getSavedIssues === "function")) { + _context.next = 17; + break; + } + + _context.prev = 6; + _context.next = 9; + return _regenerator.default.awrap(getSavedIssues()); + + case 9: + savedIssues = _context.sent; + + _editionsHelper.default.updateDownloadIssues(editions, savedIssues); + + _log.default.log(savedIssues); + + _context.next = 17; + break; + + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](6); + + _log.default.warn(_context.t0.message); + + case 17: + editions = _editionsHelper.default.filterEditions(editions, function (issue) { + return _network.default.isOnline() || issue.isDownloaded(); + }); + firstIssue = _editionsHelper.default.getFirstValidIssue(editions); + _context.next = 21; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[26]).getIssueAspectRatio)(firstIssue)); + + case 21: + aspectRatio = _context.sent; + return _context.abrupt("return", { + editions: editions, + aspectRatio: aspectRatio + }); + + case 23: + case "end": + return _context.stop(); + } + } + }, null, null, [[6, 14]], Promise); + } + + var setFavoriteEditionMethod; + + function setFavoriteEdition(edition) { + if (typeof setFavoriteEditionMethod === "function") { + setFavoriteEditionMethod(edition); + } + } + + function Container(props) { + var pSetup = props.pSetup, + server = props.server, + pSetupOverride = props.pSetupOverride, + WebViewComponent = props.WebViewComponent, + initialRouteName = props.initialRoute, + getSavedIssues = props.getSavedIssues, + languagePackOverride = props.languagePackOverride, + onPSetupError = props.onPSetupError, + onLocaleError = props.onLocaleError, + onUserSettingsError = props.onUserSettingsError, + onEditionsError = props.onEditionsError, + onSpecialsError = props.onSpecialsError, + issueCallbacks = props.issueCallbacks, + logCallbacks = props.logCallbacks, + urlParams = props.urlParams, + favoriteEdition = props.favoriteEdition, + rest = (0, _objectWithoutProperties2.default)(props, _excluded); + + var _useState = (0, _react.useState)(true), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + loading = _useState2[0], + setLoading = _useState2[1]; + + var _useState3 = (0, _react.useState)(), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + data = _useState4[0], + setData = _useState4[1]; + + var _useState5 = (0, _react.useState)(favoriteEdition), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + favEdi = _useState6[0], + setFavEdi = _useState6[1]; + + setFavoriteEditionMethod = setFavEdi; + + var loadConfig = function _callee() { + var startDate, mPSetup, mLocale, mUserSettings; + return _regenerator.default.async(function _callee$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + startDate = new Date().getTime(); + + _liveConfig.default.setInitialProps(props); + + _liveConfig.default.WebViewComponent = WebViewComponent; + initAPI(); + _network.default.isHTTPS = _liveConfig.default.getProtocol() === "https:"; + _context2.prev = 5; + mPSetup = new _paperSetupConfig.default(pSetup); + _context2.next = 9; + return _regenerator.default.awrap(mPSetup.download(pSetupOverride)); + + case 9: + _context2.next = 11; + return _regenerator.default.awrap(mPSetup.init()); + + case 11: + _context2.next = 16; + break; + + case 13: + _context2.prev = 13; + _context2.t0 = _context2["catch"](5); + onPSetupError(_context2.t0); + + case 16: + _context2.prev = 16; + mLocale = new _localeConfig.default(); + _context2.next = 20; + return _regenerator.default.awrap(mLocale.init(mPSetup, languagePackOverride)); + + case 20: + _context2.next = 25; + break; + + case 22: + _context2.prev = 22; + _context2.t1 = _context2["catch"](16); + onLocaleError(_context2.t1); + + case 25: + _context2.prev = 25; + mUserSettings = new _userConfig.default(); + _context2.next = 29; + return _regenerator.default.awrap(mUserSettings.init(mPSetup)); + + case 29: + _context2.next = 34; + break; + + case 31: + _context2.prev = 31; + _context2.t2 = _context2["catch"](25); + onUserSettingsError(_context2.t2); + + case 34: + _liveConfig.default.addProps({ + mPSetup: mPSetup, + mLocale: mLocale, + mUserSettings: mUserSettings + }); + + _log.default.debug("Load config in: " + (new Date().getTime() - startDate) / 1000 + "s"); + + case 36: + case "end": + return _context2.stop(); + } + } + }, null, null, [[5, 13], [16, 22], [25, 31]], Promise); + }; + + var setRoutes = function setRoutes(editions) { + var _LiveConfig$getPSetup = _liveConfig.default.getPSetup(), + tabs = _LiveConfig$getPSetup.tabs; + + var _RoutesHelper$getRout = _routesHelper.default.getRoutes(tabs), + routes = _RoutesHelper$getRout.drawerRoutes, + tabsRoutes = _RoutesHelper$getRout.tabsRoutes; + + var mainRoute = _routesHelper.default.getMainRoute(editions, tabsRoutes); + + var drawerRoutes = [mainRoute].concat((0, _toConsumableArray2.default)(routes)); + + var tabsLabel = _liveConfig.default.getLocale().strings("str_tabs"); + + if (tabsLabel) { + drawerRoutes.unshift(new _routeHeader.default(tabsLabel), new _routeSeparator.default()); + } + + var initialRoute; + + if (!initialRouteName || initialRouteName === _$$_REQUIRE(_dependencyMap[27]).TABS.HOME) { + initialRoute = mainRoute; + } else { + initialRoute = _routesHelper.default.getInitialRoute(drawerRoutes, initialRouteName); + } + + return { + initialRoute: initialRoute, + drawerRoutes: drawerRoutes + }; + }; + + var loadData = function _callee2() { + var startDate, newData, _setRoutes, initialRoute, drawerRoutes; + + return _regenerator.default.async(function _callee2$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + startDate = new Date().getTime(); + _context3.next = 3; + return _regenerator.default.awrap(getStateData(getSavedIssues)); + + case 3: + newData = _context3.sent; + _setRoutes = setRoutes(newData.editions), initialRoute = _setRoutes.initialRoute, drawerRoutes = _setRoutes.drawerRoutes; + setData((0, _extends2.default)({ + drawerRoutes: drawerRoutes + }, newData, { + initialRoute: initialRoute != null ? initialRoute : "" + })); + + _log.default.debug("Load data in: " + (new Date().getTime() - startDate) / 1000 + "s"); + + case 7: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }; + + var loadSpecials = function _callee3() { + var editions, specials; + return _regenerator.default.async(function _callee3$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _context4.prev = 0; + editions = data.editions; + _context4.t0 = _editionsHelper.default; + _context4.next = 5; + return _regenerator.default.awrap((0, _api.getSpecials)()); + + case 5: + _context4.t1 = _context4.sent; + specials = _context4.t0.parseSpecials.call(_context4.t0, _context4.t1); + setData(function (prevState) { + return (0, _extends2.default)({}, prevState, { + specials: [].concat((0, _toConsumableArray2.default)(_editionsHelper.default.getShortuctEditions(editions)), (0, _toConsumableArray2.default)(specials)) + }); + }); + _context4.next = 13; + break; + + case 10: + _context4.prev = 10; + _context4.t2 = _context4["catch"](0); + onSpecialsError(_context4.t2); + + case 13: + case "end": + return _context4.stop(); + } + } + }, null, null, [[0, 10]], Promise); + }; + + var load = function _callee4() { + return _regenerator.default.async(function _callee4$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _context5.next = 2; + return _regenerator.default.awrap(loadConfig()); + + case 2: + _context5.prev = 2; + _context5.next = 5; + return _regenerator.default.awrap(loadData()); + + case 5: + _context5.next = 10; + break; + + case 7: + _context5.prev = 7; + _context5.t0 = _context5["catch"](2); + onEditionsError(_context5.t0); + + case 10: + setLoading(false); + + case 11: + case "end": + return _context5.stop(); + } + } + }, null, null, [[2, 7]], Promise); + }; + + (0, _react.useEffect)(function () { + var onLogger = _log.default.addListeners(logCallbacks); + + if (loading) { + load(); + } else { + loadSpecials(); + } + + _network.default.addConnectionChangeEventListener(function (state) { + _log.default.debug(state); + }); + + return function () { + if (onLogger) { + onLogger.remove(); + } + + _network.default.removeConnectionChangeEventListener(); + }; + }, [loading]); + (0, _react.useEffect)(function () { + if (data) { + var editions = data.editions; + + if (editions) { + _liveConfig.default.setUrlParams(urlParams); + + var _setRoutes2 = setRoutes(editions), + initialRoute = _setRoutes2.initialRoute, + drawerRoutes = _setRoutes2.drawerRoutes; + + setData(function (prevState) { + return (0, _extends2.default)({}, prevState, { + drawerRoutes: drawerRoutes, + initialRoute: initialRoute != null ? initialRoute : "" + }); + }); + } + } + }, [urlParams]); + (0, _react.useEffect)(function () { + _liveConfig.default.getSettings().setFavoriteEdition(favEdi); + + loadData(); + }, [favEdi]); + var remappedIssueCallbacks = (0, _extends2.default)({}, issueCallbacks, { + onIssuePress: function onIssuePress(issue) { + var _LiveConfig$getPSetup2 = _liveConfig.default.getPSetup(), + xpaperUniversalLinks = _LiveConfig$getPSetup2.xpaperUniversalLinks, + remapEdition = _LiveConfig$getPSetup2.remapEdition; + + var keys = Object.keys(xpaperUniversalLinks); + var issuePSetup = issue.getPSetup(); + + if (keys.length > 0 && keys.includes(issuePSetup)) { + var link = xpaperUniversalLinks[issuePSetup]; + + if (link) { + link = link.replace(/##issue##/g, issue.getIssue()); + link = link.replace(/##edition##/g, issue.getEdition()); + link = link.replace(/##pSetup##/g, issuePSetup); + + _$$_REQUIRE(_dependencyMap[28]).EventRegister.emit(_events.default.ON_EXTERNAL_LINK_CLICK, { + url: link + }); + } else { + issueCallbacks.onIssuePress(issue); + } + } else { + Object.keys(remapEdition).forEach(function (edition) { + if (remapEdition[edition] === issue.getEdition()) { + issue.setEdition(edition); + } + }); + issueCallbacks.onIssuePress(issue); + } + } + }); + return _react.default.createElement(_reactNative.View, { + style: styles.app + }, !loading && data ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[29]).AspectRatioContext.Provider, { + value: data.aspectRatio + }, _react.default.createElement(_Content.default, (0, _extends2.default)({ + data: data, + issueCallbacks: remappedIssueCallbacks + }, rest))) : _react.default.createElement(_$$_REQUIRE(_dependencyMap[30]).CircleSnail, null), _react.default.createElement(_errorsView.default, { + style: styles.errors + })); + } + + Container.propTypes = { + apiParams: _propTypes.default.object, + urlParams: _propTypes.default.object, + pSetup: _propTypes.default.string.isRequired, + server: _propTypes.default.string.isRequired, + entryPoint: _propTypes.default.string, + initialRoute: _propTypes.default.string, + hideCloseButton: _propTypes.default.bool, + onLocaleError: _propTypes.default.func.isRequired, + onPSetupError: _propTypes.default.func.isRequired, + onUserSettingsError: _propTypes.default.func.isRequired, + onEditionsError: _propTypes.default.func.isRequired, + onSpecialsError: _propTypes.default.func.isRequired, + onRouteChange: _propTypes.default.func.isRequired, + getSavedIssues: _propTypes.default.func, + WebViewComponent: _propTypes.default.any, + customUserAgent: _propTypes.default.string, + issueCallbacks: _propTypes.default.shape({ + onIssuePress: _propTypes.default.func + }), + logCallbacks: _propTypes.default.shape({ + onLog: _propTypes.default.func, + onDebug: _propTypes.default.func, + onWarning: _propTypes.default.func, + onError: _propTypes.default.func + }), + pSetupOverride: _propTypes.default.object, + languagePackOverride: _propTypes.default.object, + favoriteEdition: _propTypes.default.string + }; + Container.defaultProps = { + apiParams: {}, + urlParams: {}, + pSetupOverride: {}, + languagePackOverride: {}, + entryPoint: "/default_native_optionspage.php", + hideCloseButton: false + }; + var _default = Container; + exports.default = _default; +},754,[5,21,41,108,80,6,17,28,201,755,759,769,770,992,1123,1125,1126,993,998,994,1111,1127,758,771,982,1659,1660,1000,991,1256,1661]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + exports.getEditions = getEditions; + exports.getEditionsPics = getEditionsPics; + exports.getGraphUrl = getGraphUrl; + exports.getLanguagePack = getLanguagePack; + exports.getLowUrl = getLowUrl; + exports.getPSetup = getPSetup; + exports.getSpecials = getSpecials; + exports.getTabRoutes = getTabRoutes; + exports.getTextUrl = getTextUrl; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _classPrivateFieldLooseBase2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _classPrivateFieldLooseKey2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _axios = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _issue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + + var cache = _getRequireWildcardCache(nodeInterop); + + if (cache && cache.has(obj)) { + return cache.get(obj); + } + + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + + newObj.default = obj; + + if (cache) { + cache.set(obj, newObj); + } + + return newObj; + } + + var _server = (0, _classPrivateFieldLooseKey2.default)("_server"); + + var _entryPoint = (0, _classPrivateFieldLooseKey2.default)("_entryPoint"); + + var _params = (0, _classPrivateFieldLooseKey2.default)("_params"); + + var _instance = (0, _classPrivateFieldLooseKey2.default)("_instance"); + + var API = function () { + function API() { + (0, _classCallCheck2.default)(this, API); + } + + (0, _createClass2.default)(API, null, [{ + key: "setServer", + value: function setServer(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _server)[_server] = value; + } + }, { + key: "getServer", + value: function getServer() { + return (0, _classPrivateFieldLooseBase2.default)(this, _server)[_server]; + } + }, { + key: "setEntryPoint", + value: function setEntryPoint(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _entryPoint)[_entryPoint] = value; + } + }, { + key: "getEntryPoint", + value: function getEntryPoint() { + var server = API.getServer(); + + if (!server.endsWith("/")) { + server += "/"; + } + + return "" + server + (0, _classPrivateFieldLooseBase2.default)(this, _entryPoint)[_entryPoint]; + } + }, { + key: "getPath", + value: function getPath() { + return (0, _classPrivateFieldLooseBase2.default)(this, _entryPoint)[_entryPoint]; + } + }, { + key: "setParams", + value: function setParams() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + (0, _classPrivateFieldLooseBase2.default)(this, _params)[_params] = params; + } + }, { + key: "getParams", + value: function getParams() { + return (0, _classPrivateFieldLooseBase2.default)(this, _params)[_params]; + } + }, { + key: "getDeviceParams", + value: function getDeviceParams() { + return { + os: (0, _$$_REQUIRE(_dependencyMap[10]).os)(), + isKindle: false + }; + } + }, { + key: "init", + value: function init() { + (0, _classPrivateFieldLooseBase2.default)(this, _instance)[_instance] = _axios.default.create(); + } + }, { + key: "getInstance", + value: function getInstance() { + return (0, _classPrivateFieldLooseBase2.default)(this, _instance)[_instance]; + } + }, { + key: "addProtocol", + value: function addProtocol() { + var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + + if (!url.startsWith("http")) { + return "https://" + url; + } + + return url; + } + }]); + return API; + }(); + + Object.defineProperty(API, _server, { + writable: true, + value: undefined + }); + Object.defineProperty(API, _entryPoint, { + writable: true, + value: undefined + }); + Object.defineProperty(API, _params, { + writable: true, + value: undefined + }); + Object.defineProperty(API, _instance, { + writable: true, + value: undefined + }); + + function getTabRoutes() { + return _regenerator.default.async(function getTabRoutes$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _$$_REQUIRE(_dependencyMap[11])); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + function getResUrl(item, type) { + var siteDomain = item.getSiteDomainCDN() || item.getSiteDomain(); + return (0, _$$_REQUIRE(_dependencyMap[12]).addParamsToURL)(API.addProtocol(siteDomain) + "/" + API.getPath(), (0, _extends2.default)({}, API.getDeviceParams(), API.getParams(), { + action: "issueImage", + type: type, + pSetup: item.getPSetup(), + issue: item.getIssue(), + crc: item.getFilename(), + edition: encodeURIComponent(item.getEdition()), + mtime: item.getLastClosed() + })); + } + + function getGraphUrl(item) { + return getResUrl(item, "graph"); + } + + function getTextUrl(item) { + return getResUrl(item, "text"); + } + + function getLowUrl(item) { + return getResUrl(item, "bblow"); + } + + function get(url, config, defaultValue) { + var response; + return _regenerator.default.async(function get$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + + _log.default.debug("GET " + url, config); + + _context2.next = 4; + return _regenerator.default.awrap(API.getInstance().get(url, config)); + + case 4: + response = _context2.sent; + return _context2.abrupt("return", response.data || defaultValue); + + case 8: + _context2.prev = 8; + _context2.t0 = _context2["catch"](0); + + _log.default.warn("GET " + url + " fails with error " + _context2.t0.message); + + case 11: + return _context2.abrupt("return", defaultValue); + + case 12: + case "end": + return _context2.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + + function getEditions() { + var params, + _args3 = arguments; + return _regenerator.default.async(function getEditions$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}; + return _context3.abrupt("return", get(API.addProtocol(API.getEntryPoint()), { + params: (0, _extends2.default)({}, API.getDeviceParams(), API.getParams(), { + action: "editionsList" + }, params) + })); + + case 2: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + + function getEditionsPics() { + var params, + _args4 = arguments; + return _regenerator.default.async(function getEditionsPics$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + params = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}; + return _context4.abrupt("return", get(API.addProtocol(API.getEntryPoint()), { + params: (0, _extends2.default)({}, API.getDeviceParams(), API.getParams(), { + action: "editionsPics" + }, params) + })); + + case 2: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + + function getSpecials() { + var params, + _args5 = arguments; + return _regenerator.default.async(function getSpecials$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + params = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}; + return _context5.abrupt("return", get(API.addProtocol(API.getEntryPoint()), { + params: (0, _extends2.default)({}, API.getDeviceParams(), API.getParams(), { + action: "editionsListMenu" + }, params) + })); + + case 2: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + + function getPSetup() { + var params, + _args6 = arguments; + return _regenerator.default.async(function getPSetup$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + params = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}; + return _context6.abrupt("return", get(API.addProtocol(API.getEntryPoint()), { + params: (0, _extends2.default)({}, API.getDeviceParams(), API.getParams(), { + action: "message", + service: "optionspage", + format: "json" + }, params) + })); + + case 2: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + + function getLanguagePack() { + var params, + _args7 = arguments; + return _regenerator.default.async(function getLanguagePack$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {}; + return _context7.abrupt("return", get(API.addProtocol(API.getEntryPoint()), { + params: (0, _extends2.default)({}, API.getDeviceParams(), API.getParams(), { + action: "locale" + }, params) + })); + + case 2: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + } + + var _default = API; + exports.default = _default; +},755,[5,80,6,7,8,756,757,432,758,759,760,761,762]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + function _classPrivateFieldBase(receiver, privateKey) { + if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { + throw new TypeError("attempted to use private field on non-instance"); + } + + return receiver; + } + + module.exports = _classPrivateFieldBase, module.exports.__esModule = true, module.exports["default"] = module.exports; +},756,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + var id = 0; + + function _classPrivateFieldKey(name) { + return "__private_" + id++ + "_" + name; + } + + module.exports = _classPrivateFieldKey, module.exports.__esModule = true, module.exports["default"] = module.exports; +},757,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classPrivateFieldLooseBase2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classPrivateFieldLooseKey2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _edition = (0, _classPrivateFieldLooseKey2.default)("_edition"); + + var _issue = (0, _classPrivateFieldLooseKey2.default)("_issue"); + + var _filename = (0, _classPrivateFieldLooseKey2.default)("_filename"); + + var _public = (0, _classPrivateFieldLooseKey2.default)("_public"); + + var _lastClosed = (0, _classPrivateFieldLooseKey2.default)("_lastClosed"); + + var _dayOfWeek = (0, _classPrivateFieldLooseKey2.default)("_dayOfWeek"); + + var _dayOfWeekComplete = (0, _classPrivateFieldLooseKey2.default)("_dayOfWeekComplete"); + + var _pSetup = (0, _classPrivateFieldLooseKey2.default)("_pSetup"); + + var _dateLabelAccessibility = (0, _classPrivateFieldLooseKey2.default)("_dateLabelAccessibility"); + + var _dateLabel = (0, _classPrivateFieldLooseKey2.default)("_dateLabel"); + + var _editionLabel = (0, _classPrivateFieldLooseKey2.default)("_editionLabel"); + + var _pathEdition = (0, _classPrivateFieldLooseKey2.default)("_pathEdition"); + + var _siteDomain = (0, _classPrivateFieldLooseKey2.default)("_siteDomain"); + + var _siteDomainCDN = (0, _classPrivateFieldLooseKey2.default)("_siteDomainCDN"); + + var _machine = (0, _classPrivateFieldLooseKey2.default)("_machine"); + + var _closed = (0, _classPrivateFieldLooseKey2.default)("_closed"); + + var _downloaded = (0, _classPrivateFieldLooseKey2.default)("_downloaded"); + + var Issue = function () { + function Issue() { + (0, _classCallCheck2.default)(this, Issue); + Object.defineProperty(this, _edition, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _issue, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _filename, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _public, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _lastClosed, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _dayOfWeek, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _dayOfWeekComplete, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _pSetup, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _dateLabelAccessibility, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _dateLabel, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _editionLabel, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _pathEdition, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _siteDomain, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _siteDomainCDN, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _machine, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _closed, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _downloaded, { + writable: true, + value: undefined + }); + (0, _classPrivateFieldLooseBase2.default)(this, _downloaded)[_downloaded] = false; + } + + (0, _createClass2.default)(Issue, [{ + key: "setEdition", + value: function setEdition(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _edition)[_edition] = value; + } + }, { + key: "getEdition", + value: function getEdition() { + return (0, _classPrivateFieldLooseBase2.default)(this, _edition)[_edition]; + } + }, { + key: "setIssue", + value: function setIssue(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _issue)[_issue] = value; + } + }, { + key: "getIssue", + value: function getIssue() { + return (0, _classPrivateFieldLooseBase2.default)(this, _issue)[_issue]; + } + }, { + key: "setFilename", + value: function setFilename(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _filename)[_filename] = value; + } + }, { + key: "getFilename", + value: function getFilename() { + return (0, _classPrivateFieldLooseBase2.default)(this, _filename)[_filename]; + } + }, { + key: "setPublic", + value: function setPublic(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _public)[_public] = value; + } + }, { + key: "getPublic", + value: function getPublic() { + return (0, _classPrivateFieldLooseBase2.default)(this, _public)[_public]; + } + }, { + key: "setLastClosed", + value: function setLastClosed(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _lastClosed)[_lastClosed] = value; + } + }, { + key: "getLastClosed", + value: function getLastClosed() { + return (0, _classPrivateFieldLooseBase2.default)(this, _lastClosed)[_lastClosed]; + } + }, { + key: "setDayOfWeek", + value: function setDayOfWeek(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _dayOfWeek)[_dayOfWeek] = value; + } + }, { + key: "getDayOfWeek", + value: function getDayOfWeek() { + return (0, _classPrivateFieldLooseBase2.default)(this, _dayOfWeek)[_dayOfWeek]; + } + }, { + key: "setDayOfWeekComplete", + value: function setDayOfWeekComplete(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _dayOfWeekComplete)[_dayOfWeekComplete] = value; + } + }, { + key: "getDayOfWeekComplete", + value: function getDayOfWeekComplete() { + return (0, _classPrivateFieldLooseBase2.default)(this, _dayOfWeekComplete)[_dayOfWeekComplete]; + } + }, { + key: "setPSetup", + value: function setPSetup(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _pSetup)[_pSetup] = value; + } + }, { + key: "getPSetup", + value: function getPSetup() { + return (0, _classPrivateFieldLooseBase2.default)(this, _pSetup)[_pSetup]; + } + }, { + key: "setDateLabelAccessibility", + value: function setDateLabelAccessibility(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _dateLabelAccessibility)[_dateLabelAccessibility] = value; + } + }, { + key: "getDateLabelAccessibility", + value: function getDateLabelAccessibility() { + return (0, _classPrivateFieldLooseBase2.default)(this, _dateLabelAccessibility)[_dateLabelAccessibility]; + } + }, { + key: "setDateLabel", + value: function setDateLabel(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _dateLabel)[_dateLabel] = value; + } + }, { + key: "getDateLabel", + value: function getDateLabel() { + return (0, _classPrivateFieldLooseBase2.default)(this, _dateLabel)[_dateLabel]; + } + }, { + key: "setEditionLabel", + value: function setEditionLabel(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _editionLabel)[_editionLabel] = value; + } + }, { + key: "getEditionLabel", + value: function getEditionLabel() { + return (0, _classPrivateFieldLooseBase2.default)(this, _editionLabel)[_editionLabel]; + } + }, { + key: "setPathEdition", + value: function setPathEdition(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _pathEdition)[_pathEdition] = value; + } + }, { + key: "getPathEdition", + value: function getPathEdition() { + return (0, _classPrivateFieldLooseBase2.default)(this, _pathEdition)[_pathEdition]; + } + }, { + key: "setSiteDomain", + value: function setSiteDomain(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _siteDomain)[_siteDomain] = value; + } + }, { + key: "getSiteDomain", + value: function getSiteDomain() { + return (0, _classPrivateFieldLooseBase2.default)(this, _siteDomain)[_siteDomain]; + } + }, { + key: "setSiteDomainCDN", + value: function setSiteDomainCDN(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _siteDomainCDN)[_siteDomainCDN] = value; + } + }, { + key: "getSiteDomainCDN", + value: function getSiteDomainCDN() { + return (0, _classPrivateFieldLooseBase2.default)(this, _siteDomainCDN)[_siteDomainCDN]; + } + }, { + key: "setMachine", + value: function setMachine(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _machine)[_machine] = value; + } + }, { + key: "getMachine", + value: function getMachine() { + return (0, _classPrivateFieldLooseBase2.default)(this, _machine)[_machine]; + } + }, { + key: "setClosed", + value: function setClosed(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _closed)[_closed] = value; + } + }, { + key: "getClosed", + value: function getClosed() { + return (0, _classPrivateFieldLooseBase2.default)(this, _closed)[_closed]; + } + }, { + key: "setDownloaded", + value: function setDownloaded(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _downloaded)[_downloaded] = value; + } + }, { + key: "isDownloaded", + value: function isDownloaded() { + return (0, _classPrivateFieldLooseBase2.default)(this, _downloaded)[_downloaded]; + } + }, { + key: "equals", + value: function equals(issue) { + if (issue) { + return issue.getIssue() === this.getIssue() && issue.getEdition() === this.getEdition(); + } + + return false; + } + }, { + key: "toJson", + value: function toJson() { + return { + edition: (0, _classPrivateFieldLooseBase2.default)(this, _edition)[_edition], + issue: (0, _classPrivateFieldLooseBase2.default)(this, _issue)[_issue], + filename: (0, _classPrivateFieldLooseBase2.default)(this, _filename)[_filename], + public: (0, _classPrivateFieldLooseBase2.default)(this, _public)[_public], + lastClosed: (0, _classPrivateFieldLooseBase2.default)(this, _lastClosed)[_lastClosed], + dayOfWeek: (0, _classPrivateFieldLooseBase2.default)(this, _dayOfWeek)[_dayOfWeek], + dayOfWeekComplete: (0, _classPrivateFieldLooseBase2.default)(this, _dayOfWeekComplete)[_dayOfWeekComplete], + pSetup: (0, _classPrivateFieldLooseBase2.default)(this, _pSetup)[_pSetup], + dateLabelAccessibility: (0, _classPrivateFieldLooseBase2.default)(this, _dateLabelAccessibility)[_dateLabelAccessibility], + dateLabel: (0, _classPrivateFieldLooseBase2.default)(this, _dateLabel)[_dateLabel], + pathEdition: (0, _classPrivateFieldLooseBase2.default)(this, _pathEdition)[_pathEdition], + siteDomain: (0, _classPrivateFieldLooseBase2.default)(this, _siteDomain)[_siteDomain], + siteDomainCDN: (0, _classPrivateFieldLooseBase2.default)(this, _siteDomainCDN)[_siteDomainCDN], + machine: (0, _classPrivateFieldLooseBase2.default)(this, _machine)[_machine], + closed: (0, _classPrivateFieldLooseBase2.default)(this, _closed)[_closed], + downloaded: (0, _classPrivateFieldLooseBase2.default)(this, _downloaded)[_downloaded] + }; + } + }]); + return Issue; + }(); + + exports.default = Issue; +},758,[5,7,8,756,757]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classPrivateFieldLooseBase2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classPrivateFieldLooseKey2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _listeners = (0, _classPrivateFieldLooseKey2.default)("_listeners"); + + var _remove = (0, _classPrivateFieldLooseKey2.default)("_remove"); + + var _callListener = (0, _classPrivateFieldLooseKey2.default)("_callListener"); + + var Logger = function () { + function Logger() { + (0, _classCallCheck2.default)(this, Logger); + } + + (0, _createClass2.default)(Logger, null, [{ + key: "addListeners", + value: function addListeners() { + var callbacks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + (0, _classPrivateFieldLooseBase2.default)(Logger, _listeners)[_listeners] = callbacks; + return { + remove: (0, _classPrivateFieldLooseBase2.default)(Logger, _remove)[_remove] + }; + } + }, { + key: "log", + value: function log(message) { + var _classPrivateFieldLoo; + + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + + (_classPrivateFieldLoo = (0, _classPrivateFieldLooseBase2.default)(Logger, _callListener))[_callListener].apply(_classPrivateFieldLoo, ["onLog", message].concat(rest)); + } + }, { + key: "debug", + value: function debug(message) { + var _classPrivateFieldLoo2; + + for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + rest[_key2 - 1] = arguments[_key2]; + } + + (_classPrivateFieldLoo2 = (0, _classPrivateFieldLooseBase2.default)(Logger, _callListener))[_callListener].apply(_classPrivateFieldLoo2, ["onDebug", message].concat(rest)); + } + }, { + key: "warn", + value: function warn(message) { + var _classPrivateFieldLoo3; + + for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + rest[_key3 - 1] = arguments[_key3]; + } + + (_classPrivateFieldLoo3 = (0, _classPrivateFieldLooseBase2.default)(Logger, _callListener))[_callListener].apply(_classPrivateFieldLoo3, ["onWarning", message].concat(rest)); + } + }, { + key: "error", + value: function error(message) { + var _classPrivateFieldLoo4; + + for (var _len4 = arguments.length, rest = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { + rest[_key4 - 1] = arguments[_key4]; + } + + (_classPrivateFieldLoo4 = (0, _classPrivateFieldLooseBase2.default)(Logger, _callListener))[_callListener].apply(_classPrivateFieldLoo4, ["onError", message].concat(rest)); + } + }]); + return Logger; + }(); + + exports.default = Logger; + + function _remove2() { + (0, _classPrivateFieldLooseBase2.default)(Logger, _listeners)[_listeners] = {}; + } + + function _callListener2(listenerKey, message) { + if (typeof (0, _classPrivateFieldLooseBase2.default)(Logger, _listeners)[_listeners][listenerKey] === "function") { + var _classPrivateFieldLoo5; + + for (var _len5 = arguments.length, rest = new Array(_len5 > 2 ? _len5 - 2 : 0), _key5 = 2; _key5 < _len5; _key5++) { + rest[_key5 - 2] = arguments[_key5]; + } + + (_classPrivateFieldLoo5 = (0, _classPrivateFieldLooseBase2.default)(Logger, _listeners)[_listeners])[listenerKey].apply(_classPrivateFieldLoo5, [message].concat(rest)); + } + } + + Object.defineProperty(Logger, _callListener, { + value: _callListener2 + }); + Object.defineProperty(Logger, _remove, { + value: _remove2 + }); + Object.defineProperty(Logger, _listeners, { + writable: true, + value: {} + }); +},759,[5,7,8,756,757]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.dpToPx = dpToPx; + exports.fontScale = fontScale; + exports.isAndroid = isAndroid; + exports.isIOS = isIOS; + exports.isWeb = isWeb; + exports.isWindows = isWindows; + exports.os = os; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + function fontScale() { + return _reactNative.PixelRatio.getFontScale(); + } + + function os() { + return _reactNative.Platform.OS; + } + + function isAndroid() { + return _reactNative.Platform.OS === "android"; + } + + function isWeb() { + return _reactNative.Platform.OS === "web"; + } + + function isIOS() { + return _reactNative.Platform.OS === "ios" || _reactNative.Platform.OS === "macos"; + } + + function isWindows() { + return _reactNative.Platform.OS === "windows"; + } + + function dpToPx(size) { + return _reactNative.PixelRatio.roundToNearestPixel(size) * _reactNative.PixelRatio.get(); + } +},760,[28]); +__d(function(global, require, _importDefaultUnused, _importAllUnused, module, exports, _dependencyMapUnused) { + module.exports = [ + { + "key": "access", + "label": "Profilo", + "url": "https://corrieredelticino-che.newsmemory.com/eebrowser/optionspage/optionspage.develop.rcolombo.cdt/php/createaccount/createaccount.php?pSetup=corrieredelticino&MACHINEID=0b608790fe0ac00d10646643de7f1293&issue=20220720&edition=Corriere%20del%20Ticino&pSetup=corrieredelticino&TAUID=-1&issue=20220720&prefEdi=false&modal=1&limit=1&maxNumberOfOldIssuesToKeep=3&timeLimitForRestart=10&readEdi=Corriere%20del%20Ticino&edition=Corriere%20del%20Ticino&MACHINEID=0b608790fe0ac00d10646643de7f1293&fromOpt=1", + "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAABgklEQVRo3u3XTU4UQRiH8R8acCHEeAmMMMQrsCEegbCGBR5FE4hkCNzCuBbQxBsYMJEtH1uMfETBMbDo7oQQpnW6aqYmpp7kv5uqet7uN+90kclkMplMXGawhj2cl9nDW7RSy9XxCBv4g+su6WAdY6ll75P/WCN+NzvDVsRmD/JV2qmlK2bUt01dO02HHv4gQgFLDfd5iMUI5wfzVe9Pv8puank4CyjgNPTwGC10nWhttAIOA9YeDEMBWwFrP0Q4P5iWYiQ2GaNTqeUr1hsUsJZa+jZj2O5BfgujqaXvK6Ktvp06iic/dPK3mcaq4k/qrMwuVgxRz2cy/wsjEfaYwCxe4Dme4WmZx+VvLvAdJ9jHN3zBJ8WdeeBM4BU+47fmX6NX5R7L5Z4DEX+j+AxuKt0tP/Aa4/2Sf4njPojfzRHmYssvKF53v+WrXGI+lvwkfg5QvsovxVAI5n0C+Srv/ib3L2P01IAmRJezn4QWEHxvDaTWMcaVMim5gEwmk8lkUnIDbus4FL0rG1oAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDctMjFUMDY6NDc6MzArMDA6MDBuyZWqAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA3LTIxVDA2OjQ3OjMwKzAwOjAwH5QtFgAAAABJRU5ErkJggg==" + }, + { + "key": "contact", + "label": "Contatti", + "url": "https://corrieredelticino-che.newsmemory.com/eebrowser/optionspage/optionspage.develop.rcolombo.cdt/php/createaccount/createaccount.php?pSetup=corrieredelticino&MACHINEID=0b608790fe0ac00d10646643de7f1293&issue=20220720&edition=Corriere%20del%20Ticino&pSetup=corrieredelticino&TAUID=-1&issue=20220720&prefEdi=false&modal=1&limit=1&maxNumberOfOldIssuesToKeep=3&timeLimitForRestart=10&readEdi=Corriere%20del%20Ticino&edition=Corriere%20del%20Ticino&MACHINEID=0b608790fe0ac00d10646643de7f1293&fromOpt=1", + "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAACVklEQVRo3u3YPWsUURTG8Z+74luMolgJUbCxDRZ+CpUgaOEHsBNL/QAWERvBKmp8b5RgwOBboWChYFD8CipopYIrFoImFjsDm8mdvTu7s5MNzAOnuXPP7P+Ze86d2UutWrVq1aq1WhOYQwvLaxwtPMSBIvDfRwA8G79wqBcDcyMAmxevsrAbAgZaGO91uSrWErbhTzrQCEzKwh/DpzWA/YqTmbGGHh5udtkkrqfx1/DL5B9mOkCz1/f0YyDVJN4OEf4DDkd4BjKQLuNp/CwR/DfOodkDT2EDC9gfmLcXd0qAX8C+nPs/KMNA7Akdxcc+wL/gRJcVznuJ9mWgW41SrMmzTdqpSfEeG8hAJ8COPgDKeAADG0jjM6YC+U2ctbIEWslYqASnknuFfuMbLiZzjuA8tpdlII157e+nrCaSa7Hrefd9id0x2DIMxJo8q1iTLuM5tvYD36+BWI2nmhRv0oHgBzWwrN2Il63cZcaTsViTPsOWDM9GXMIVbK7CQLbJp+Q3aS/w9zvmPA3MGZqBIpEHdiHHaNcSGwX4JsawC4uBnOlRMfAkB/4eXmu/LHfiTUfOEk6NgoFQzTet/EB8p/0uGMOLBP6MiKqAf2z1jtLE3cDcxaSUxnA8Bl+FgSLwabxX4H/6WjTs7UjeNeH/75UaCME3yoYfloHQbtPArUje9aLwwzBQKTzlnoc+wqYA/M1I3ozwoVtPmh8y/I1I3tVB4OEgfpRgIAQ/O2z4VBPaRxqDnP1kFYMvvNtUrW7ws6MO383AuoDPM7Bu4EMG1hV8rVqjqv87gpyy0KR0kAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wNy0yMVQwNjo1MTo1MyswMDowMFXeKTcAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDctMjFUMDY6NTE6NTMrMDA6MDAkg5GLAAAAAElFTkSuQmCC" + }, + { + "key": "connection", + "label": "Settings", + "url": "https://corrieredelticino-che.newsmemory.com/eebrowser/optionspage/optionspage.develop.rcolombo.cdt/php/createaccount/createaccount.php?pSetup=corrieredelticino&MACHINEID=0b608790fe0ac00d10646643de7f1293&issue=20220720&edition=Corriere%20del%20Ticino&pSetup=corrieredelticino&TAUID=-1&issue=20220720&prefEdi=false&modal=1&limit=1&maxNumberOfOldIssuesToKeep=3&timeLimitForRestart=10&readEdi=Corriere%20del%20Ticino&edition=Corriere%20del%20Ticino&MACHINEID=0b608790fe0ac00d10646643de7f1293&fromOpt=1", + "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABgAAAAYADwa0LPAAACaUlEQVRo3u2ZzU4UQRSFvyEEFzIMC1QMS93rGH9YDjuNmpj4DjwBiYmoCQ/gCwBbhThxz4IFLngB3IjiYgIYBxMVNxDjiIuqTkyBU7duVTM9pk9yk06q+pxz++dW9W0oUaJESqwCR55Y7bXJf2FcYD6LC6lEBxImcDmnuaeWwKWc5pYJSNGTR0iCBrALLANTQMUZrwFPgH3kL/G+PafmcFWsxrLVbMSaHwI2HfH3wCPgHHAX+BRg3I028BAYBaaBt874FnAmJoGZLuI/I4yHcM1ozZ8Hvic0qY0fwEVNAosFMJ/FQqj5OtApgPEsOsCNkATeFMC0G+scr4An4k6kUBuYBa4CZ23UMWWzHcl9W5LAJHCoFHgFVLtwV4GmkvsQuCV9hG4CLYV5yS2uKJJoWU9BGANWhAJtz5V3MQLsCblXrBcVBoA5/BVpVsH91MPZsdpJ9ms7HrErCs66h3MnhfEMBx6xYQVn1cN5ICGR3p4jz7ioPgee8ztlAl8945oPFN8531IkMAg8ByY88+4pErjvGZ+w2oMKbsB0DtbIp4zWgC9C7jUUXYxJYFsokEUT+UL2OpB723oSm9duJZqYRarblQ81H7yViN3M7WEWqWuY8jpsj58hf2yiNnPQ59tpMKvkrwKY/ntbcV1qPsNCAYxnMR9qHor1UT+uSQC6t1W0lSqUS91WAdPYeucQbmIaW2OYqrAbYfwz8ABTXqeBDWf8A5GNLTDtvRawZI/dSjCC+R4IbS0+5vjqXbEaS1azEWs+BC8DEniRSjRld3orp7mnlsDHnOb+3wmkRE9+8qVGX/9mLVGiH/EH3S0EG4PwXOAAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMDctMjFUMDY6NTI6MjcrMDA6MDBAY78+AAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTA3LTIxVDA2OjUyOjI3KzAwOjAwMT4HggAAAABJRU5ErkJggg==" + } +] +; +},761,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.addParamsToURL = addParamsToURL; + exports.decodeHTML = decodeHTML; + exports.segmentURL = segmentURL; + exports.toMD5 = toMD5; + + var _md = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _uri = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + function decodeHTML(text) { + try { + return (0, _$$_REQUIRE(_dependencyMap[4]).decode)(text); + } catch (e) { + return text; + } + } + + function toMD5(text) { + return (0, _md.default)(text); + } + + function segmentURL(url) { + var uri = new _uri.default(); + + try { + uri.parse(url); + } catch (e) { + _log.default.warn(e.message); + } + + return uri; + } + + function addParamsToURL(url) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var uri = new URL(url); + Object.keys(params).forEach(function (key) { + uri.searchParams.set(key, "" + params[key]); + }); + return uri.toString(); + } +},762,[5,515,763,759,765]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classPrivateFieldLooseBase2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classPrivateFieldLooseKey2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _jsUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _mUrl = (0, _classPrivateFieldLooseKey2.default)("_mUrl"); + + var _params = (0, _classPrivateFieldLooseKey2.default)("_params"); + + var _port = (0, _classPrivateFieldLooseKey2.default)("_port"); + + var _domain = (0, _classPrivateFieldLooseKey2.default)("_domain"); + + var _protocol = (0, _classPrivateFieldLooseKey2.default)("_protocol"); + + var URI = function () { + function URI() { + (0, _classCallCheck2.default)(this, URI); + Object.defineProperty(this, _mUrl, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _params, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _port, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _domain, { + writable: true, + value: undefined + }); + Object.defineProperty(this, _protocol, { + writable: true, + value: undefined + }); + } + + (0, _createClass2.default)(URI, [{ + key: "parse", + value: function parse(url) { + var _this = this; + + (0, _classPrivateFieldLooseBase2.default)(this, _mUrl)[_mUrl] = new URL(url); + (0, _classPrivateFieldLooseBase2.default)(this, _params)[_params] = {}; + + var iterator = (0, _classPrivateFieldLooseBase2.default)(this, _mUrl)[_mUrl].searchParams.entries(); + + _jsUtils.default.iterator(iterator, function (_ref) { + var key = _ref.key, + value = _ref.value; + (0, _classPrivateFieldLooseBase2.default)(_this, _params)[_params][key] = value; + }); + + (0, _classPrivateFieldLooseBase2.default)(this, _port)[_port] = (0, _classPrivateFieldLooseBase2.default)(this, _mUrl)[_mUrl].port; + (0, _classPrivateFieldLooseBase2.default)(this, _protocol)[_protocol] = (0, _classPrivateFieldLooseBase2.default)(this, _mUrl)[_mUrl].protocol; + (0, _classPrivateFieldLooseBase2.default)(this, _domain)[_domain] = (0, _classPrivateFieldLooseBase2.default)(this, _mUrl)[_mUrl].hostname; + } + }, { + key: "setParams", + value: function setParams() { + var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + (0, _classPrivateFieldLooseBase2.default)(this, _params)[_params] = value; + } + }, { + key: "getParams", + value: function getParams() { + return (0, _classPrivateFieldLooseBase2.default)(this, _params)[_params]; + } + }, { + key: "setPort", + value: function setPort(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _port)[_port] = value; + } + }, { + key: "getPort", + value: function getPort() { + return (0, _classPrivateFieldLooseBase2.default)(this, _port)[_port]; + } + }, { + key: "setDomain", + value: function setDomain(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _domain)[_domain] = value; + } + }, { + key: "getDomain", + value: function getDomain() { + return (0, _classPrivateFieldLooseBase2.default)(this, _domain)[_domain]; + } + }, { + key: "setProtocol", + value: function setProtocol(value) { + (0, _classPrivateFieldLooseBase2.default)(this, _protocol)[_protocol] = value; + } + }, { + key: "getProtocol", + value: function getProtocol() { + return (0, _classPrivateFieldLooseBase2.default)(this, _protocol)[_protocol]; + } + }, { + key: "getURL", + value: function getURL() { + return (0, _classPrivateFieldLooseBase2.default)(this, _mUrl)[_mUrl]; + } + }]); + return URI; + }(); + + exports.default = URI; +},763,[5,7,8,756,757,764]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PromiseTimeout = PromiseTimeout; + exports.default = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function PromiseTimeout(promiseCall) { + var promiseTimeout, + _len, + params, + _key, + _args = arguments; + + return _regenerator.default.async(function PromiseTimeout$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + promiseTimeout = _args.length > 1 && _args[1] !== undefined ? _args[1] : 2000; + + for (_len = _args.length, params = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + params[_key - 2] = _args[_key]; + } + + return _context.abrupt("return", new Promise(function (resolve, reject) { + var inTimeout = false; + setTimeout(function () { + inTimeout = true; + reject(new Error("promise timeout")); + }, promiseTimeout); + promiseCall.apply(undefined, params).then(function (data) { + if (!inTimeout && typeof resolve === "function") { + resolve(data); + } + }).catch(function (error) { + if (!inTimeout && typeof reject === "function") { + reject(error); + } + }); + })); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + var JSUtils = function () { + function JSUtils() { + (0, _classCallCheck2.default)(this, JSUtils); + } + + (0, _createClass2.default)(JSUtils, null, [{ + key: "generateId", + value: function generateId() { + return "" + Math.random().toString(36).substr(2, 9); + } + }, { + key: "equals", + value: function equals(a, b) { + var resultA; + var resultB; + + try { + resultA = JSON.stringify(a); + } catch (e) { + return false; + } + + try { + resultB = JSON.stringify(b); + } catch (e) { + return false; + } + + return resultA === resultB; + } + }, { + key: "isValidRect", + value: function isValidRect(rect) { + return rect && JSUtils.isNumber(rect.start) && JSUtils.isNumber(rect.top) && JSUtils.isNumber(rect.width) && JSUtils.isNumber(rect.height) && rect.width > 0 && rect.height > 0; + } + }, { + key: "intersectRect", + value: function intersectRect(r1, r2) { + return !(r2.start > r1.start + r1.width || r2.start + r2.width < r1.start || r2.top > r1.top + r1.height || r2.top + r2.height < r1.top); + } + }, { + key: "intersectAreaRect", + value: function intersectAreaRect(r1, r2) { + var intersectionX1 = Math.max(r1.start, r2.start); + var intersectionX2 = Math.min(r1.start + r1.width, r2.start + r2.width); + + if (intersectionX2 < intersectionX1) { + return { + start: 0, + top: 0, + width: 0, + height: 0 + }; + } + + var intersectionY1 = Math.max(r1.top, r2.top); + var intersectionY2 = Math.min(r1.top + r1.height, r2.top + r2.height); + + if (intersectionY2 < intersectionY1) { + return { + x: 0, + y: 0, + width: 0, + height: 0 + }; + } + + return { + start: intersectionX1, + top: intersectionY1, + width: intersectionX2 - intersectionX1, + height: intersectionY2 - intersectionY1 + }; + } + }, { + key: "intersectArea", + value: function intersectArea(r1, r2) { + var _JSUtils$intersectAre = JSUtils.intersectAreaRect(r1, r2), + width = _JSUtils$intersectAre.width, + height = _JSUtils$intersectAre.height; + + return width * height; + } + }, { + key: "rectContainsPoint", + value: function rectContainsPoint(r, p) { + return r.start < p.x && r.start + r.width > p.x && r.top < p.y && r.top + r.height > p.y; + } + }, { + key: "inInterval", + value: function inInterval(n, lower, upper) { + return n >= lower && n <= upper; + } + }, { + key: "areEqualShallow", + value: function areEqualShallow() { + var a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var _options$print = options.print, + print = _options$print === undefined ? false : _options$print, + _options$skipKeys = options.skipKeys, + skipKeys = _options$skipKeys === undefined ? [] : _options$skipKeys; + var aDifferentFromB = Object.keys(a).find(function (key) { + if (typeof a[key] === "function" || typeof a[key] === "object" || skipKeys.includes(key)) { + return false; + } + + if (!JSUtils.hasProperty(b, key)) { + return true; + } + + if (a[key] !== b[key]) { + return true; + } + + return false; + }); + var bDifferentFromA = Object.keys(b).find(function (key) { + if (typeof b[key] === "function" || typeof b[key] === "object" || skipKeys.includes(key)) { + return false; + } + + if (!JSUtils.hasProperty(a, key)) { + return true; + } + + return false; + }); + var areEqual = !aDifferentFromB && !bDifferentFromA; + + if (print && !areEqual) { + if (aDifferentFromB !== undefined) { + _log.default.debug("a different from b by " + aDifferentFromB); + } + + if (bDifferentFromA !== undefined) { + _log.default.debug("b different from a by " + bDifferentFromA); + } + } + + return areEqual; + } + }, { + key: "shouldUpdatePureComponent", + value: function shouldUpdatePureComponent(currentProps, nextProps, currentState, nextState) { + var ret = false; + var prevPropsKeys = Object.keys(currentProps); + var nextPropsKeys = Object.keys(nextProps); + + if (prevPropsKeys.length !== nextPropsKeys.length) { + ret = true; + } + + var prevStateKeys = Object.keys(currentState || {}); + var nextStateKeys = Object.keys(nextState || {}); + + if (prevStateKeys.length !== nextStateKeys.length) { + ret = true; + } + + for (var key in currentProps) { + if (currentProps[key] !== nextProps[key]) { + ret = true; + } + } + + for (var _key2 in currentState) { + if (currentState[_key2] !== (nextState || {})[_key2]) { + ret = true; + } + } + + return ret; + } + }, { + key: "getViewByRef", + value: function getViewByRef(ref) { + if (!ref) { + throw new Error("ref.current is null"); + } + + if (typeof ref === "object" && ref.current) { + ref = ref.current; + } + + if (typeof ref !== "number") { + var node = (0, _reactNative.findNodeHandle)(ref); + + if (!node) { + throw new Error("findNodeHandle failed to resolve view=" + String(ref)); + } + + ref = node; + } + + return ref; + } + }, { + key: "isNull", + value: function isNull(a) { + return a === undefined || a === null; + } + }, { + key: "isEmpty", + value: function isEmpty(a) { + if (!JSUtils.isNull(a)) { + if (typeof a === "string") { + return a.length === 0; + } + + if (Array.isArray(a)) { + return a.length === 0; + } + + if (typeof a === "object") { + return Object.keys(a).length === 0; + } + } + + return true; + } + }, { + key: "hasProperty", + value: function hasProperty() { + var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var property = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + return Object.prototype.hasOwnProperty.call(obj, property); + } + }, { + key: "isNumber", + value: function isNumber(value) { + try { + return !(typeof value !== "number" || Number.isNaN(value)); + } catch (e) { + return false; + } + } + }, { + key: "max", + value: function max() { + for (var _len2 = arguments.length, args = new Array(_len2), _key3 = 0; _key3 < _len2; _key3++) { + args[_key3] = arguments[_key3]; + } + + return Math.max.apply(Math, (0, _toConsumableArray2.default)(args.filter(function (arg) { + return JSUtils.isNumber(arg); + }))); + } + }, { + key: "min", + value: function min() { + for (var _len3 = arguments.length, args = new Array(_len3), _key4 = 0; _key4 < _len3; _key4++) { + args[_key4] = arguments[_key4]; + } + + return Math.min.apply(Math, (0, _toConsumableArray2.default)(args.filter(function (arg) { + return JSUtils.isNumber(arg); + }))); + } + }, { + key: "iterator", + value: function iterator(_iterator, callback) { + if (_iterator && typeof _iterator.next === "function") { + var iterate; + var index = 0; + + do { + iterate = _iterator.next(); + + if (typeof callback === "function" && iterate.value !== undefined) { + var _iterate$value = (0, _slicedToArray2.default)(iterate.value, 2), + key = _iterate$value[0], + value = _iterate$value[1]; + + callback({ + key: key, + value: value + }, index); + } + + index += 1; + } while (!iterate.done); + } + } + }]); + return JSUtils; + }(); + + exports.default = JSUtils; +},764,[5,41,21,7,8,80,28,759]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + var __assign = this && this.__assign || function () { + __assign = Object.assign || function (t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + + for (var p in s) { + if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + } + + return t; + }; + + return __assign.apply(this, arguments); + }; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var allNamedReferences = __assign(__assign({}, _$$_REQUIRE(_dependencyMap[0]).namedReferences), { + all: _$$_REQUIRE(_dependencyMap[0]).namedReferences.html5 + }); + + var encodeRegExps = { + specialChars: /[<>'"&]/g, + nonAscii: /[<>'"&\u0080-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g, + nonAsciiPrintable: /[<>'"&\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g, + nonAsciiPrintableOnly: /[\x01-\x08\x11-\x15\x17-\x1F\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g, + extensive: /[\x01-\x0c\x0e-\x1f\x21-\x2c\x2e-\x2f\x3a-\x40\x5b-\x60\x7b-\x7d\x7f-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/g + }; + var defaultEncodeOptions = { + mode: 'specialChars', + level: 'all', + numeric: 'decimal' + }; + + function encode(text, _a) { + var _b = _a === undefined ? defaultEncodeOptions : _a, + _c = _b.mode, + mode = _c === undefined ? 'specialChars' : _c, + _d = _b.numeric, + numeric = _d === undefined ? 'decimal' : _d, + _e = _b.level, + level = _e === undefined ? 'all' : _e; + + if (!text) { + return ''; + } + + var encodeRegExp = encodeRegExps[mode]; + var references = allNamedReferences[level].characters; + var isHex = numeric === 'hexadecimal'; + encodeRegExp.lastIndex = 0; + + var _b = encodeRegExp.exec(text); + + var _c; + + if (_b) { + _c = ''; + var _d = 0; + + do { + if (_d !== _b.index) { + _c += text.substring(_d, _b.index); + } + + var _e = _b[0]; + var result_1 = references[_e]; + + if (!result_1) { + var code_1 = _e.length > 1 ? _$$_REQUIRE(_dependencyMap[1]).getCodePoint(_e, 0) : _e.charCodeAt(0); + result_1 = (isHex ? '&#x' + code_1.toString(16) : '&#' + code_1) + ';'; + } + + _c += result_1; + _d = _b.index + _e.length; + } while (_b = encodeRegExp.exec(text)); + + if (_d !== text.length) { + _c += text.substring(_d); + } + } else { + _c = text; + } + + return _c; + } + + exports.encode = encode; + var defaultDecodeOptions = { + scope: 'body', + level: 'all' + }; + var strict = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g; + var attribute = /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g; + var baseDecodeRegExps = { + xml: { + strict: strict, + attribute: attribute, + body: _$$_REQUIRE(_dependencyMap[0]).bodyRegExps.xml + }, + html4: { + strict: strict, + attribute: attribute, + body: _$$_REQUIRE(_dependencyMap[0]).bodyRegExps.html4 + }, + html5: { + strict: strict, + attribute: attribute, + body: _$$_REQUIRE(_dependencyMap[0]).bodyRegExps.html5 + } + }; + + var decodeRegExps = __assign(__assign({}, baseDecodeRegExps), { + all: baseDecodeRegExps.html5 + }); + + var fromCharCode = String.fromCharCode; + var outOfBoundsChar = fromCharCode(65533); + var defaultDecodeEntityOptions = { + level: 'all' + }; + + function decodeEntity(entity, _a) { + var _b = (_a === undefined ? defaultDecodeEntityOptions : _a).level, + level = _b === undefined ? 'all' : _b; + + if (!entity) { + return ''; + } + + var _b = entity; + var decodeEntityLastChar_1 = entity[entity.length - 1]; + { + var decodeResultByReference_1 = allNamedReferences[level].entities[entity]; + + if (decodeResultByReference_1) { + _b = decodeResultByReference_1; + } else if (entity[0] === '&' && entity[1] === '#') { + var decodeSecondChar_1 = entity[2]; + var decodeCode_1 = decodeSecondChar_1 == 'x' || decodeSecondChar_1 == 'X' ? parseInt(entity.substr(3), 16) : parseInt(entity.substr(2)); + _b = decodeCode_1 >= 0x10ffff ? outOfBoundsChar : decodeCode_1 > 65535 ? _$$_REQUIRE(_dependencyMap[1]).fromCodePoint(decodeCode_1) : fromCharCode(_$$_REQUIRE(_dependencyMap[2]).numericUnicodeMap[decodeCode_1] || decodeCode_1); + } + } + return _b; + } + + exports.decodeEntity = decodeEntity; + + function decode(text, _a) { + var decodeSecondChar_1 = _a === undefined ? defaultDecodeOptions : _a, + decodeCode_1 = decodeSecondChar_1.level, + level = decodeCode_1 === undefined ? 'all' : decodeCode_1, + _b = decodeSecondChar_1.scope, + scope = _b === undefined ? level === 'xml' ? 'strict' : 'body' : _b; + + if (!text) { + return ''; + } + + var decodeRegExp = decodeRegExps[level][scope]; + var references = allNamedReferences[level].entities; + var isAttribute = scope === 'attribute'; + var isStrict = scope === 'strict'; + decodeRegExp.lastIndex = 0; + var replaceMatch_1 = decodeRegExp.exec(text); + var replaceResult_1; + + if (replaceMatch_1) { + replaceResult_1 = ''; + var replaceLastIndex_1 = 0; + + do { + if (replaceLastIndex_1 !== replaceMatch_1.index) { + replaceResult_1 += text.substring(replaceLastIndex_1, replaceMatch_1.index); + } + + var replaceInput_1 = replaceMatch_1[0]; + var decodeResult_1 = replaceInput_1; + var decodeEntityLastChar_2 = replaceInput_1[replaceInput_1.length - 1]; + + if (isAttribute && decodeEntityLastChar_2 === '=') { + decodeResult_1 = replaceInput_1; + } else if (isStrict && decodeEntityLastChar_2 !== ';') { + decodeResult_1 = replaceInput_1; + } else { + var decodeResultByReference_2 = references[replaceInput_1]; + + if (decodeResultByReference_2) { + decodeResult_1 = decodeResultByReference_2; + } else if (replaceInput_1[0] === '&' && replaceInput_1[1] === '#') { + var decodeSecondChar_2 = replaceInput_1[2]; + var decodeCode_2 = decodeSecondChar_2 == 'x' || decodeSecondChar_2 == 'X' ? parseInt(replaceInput_1.substr(3), 16) : parseInt(replaceInput_1.substr(2)); + decodeResult_1 = decodeCode_2 >= 0x10ffff ? outOfBoundsChar : decodeCode_2 > 65535 ? _$$_REQUIRE(_dependencyMap[1]).fromCodePoint(decodeCode_2) : fromCharCode(_$$_REQUIRE(_dependencyMap[2]).numericUnicodeMap[decodeCode_2] || decodeCode_2); + } + } + + replaceResult_1 += decodeResult_1; + replaceLastIndex_1 = replaceMatch_1.index + replaceInput_1.length; + } while (replaceMatch_1 = decodeRegExp.exec(text)); + + if (replaceLastIndex_1 !== text.length) { + replaceResult_1 += text.substring(replaceLastIndex_1); + } + } else { + replaceResult_1 = text; + } + + return replaceResult_1; + } + + exports.decode = decode; +},765,[766,767,768]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.bodyRegExps = { + xml: /&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g, + html4: /∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g, + html5: /·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g + }; + exports.namedReferences = { + xml: { + entities: { + "<": "<", + ">": ">", + """: '"', + "'": "'", + "&": "&" + }, + characters: { + "<": "<", + ">": ">", + '"': """, + "'": "'", + "&": "&" + } + }, + html4: { + entities: { + "'": "'", + " ": " ", + " ": " ", + "¡": "¡", + "¡": "¡", + "¢": "¢", + "¢": "¢", + "£": "£", + "£": "£", + "¤": "¤", + "¤": "¤", + "¥": "¥", + "¥": "¥", + "¦": "¦", + "¦": "¦", + "§": "§", + "§": "§", + "¨": "¨", + "¨": "¨", + "©": "©", + "©": "©", + "ª": "ª", + "ª": "ª", + "«": "«", + "«": "«", + "¬": "¬", + "¬": "¬", + "­": "­", + "­": "­", + "®": "®", + "®": "®", + "¯": "¯", + "¯": "¯", + "°": "°", + "°": "°", + "±": "±", + "±": "±", + "²": "²", + "²": "²", + "³": "³", + "³": "³", + "´": "´", + "´": "´", + "µ": "µ", + "µ": "µ", + "¶": "¶", + "¶": "¶", + "·": "·", + "·": "·", + "¸": "¸", + "¸": "¸", + "¹": "¹", + "¹": "¹", + "º": "º", + "º": "º", + "»": "»", + "»": "»", + "¼": "¼", + "¼": "¼", + "½": "½", + "½": "½", + "¾": "¾", + "¾": "¾", + "¿": "¿", + "¿": "¿", + "À": "À", + "À": "À", + "Á": "Á", + "Á": "Á", + "Â": "Â", + "Â": "Â", + "Ã": "Ã", + "Ã": "Ã", + "Ä": "Ä", + "Ä": "Ä", + "Å": "Å", + "Å": "Å", + "Æ": "Æ", + "Æ": "Æ", + "Ç": "Ç", + "Ç": "Ç", + "È": "È", + "È": "È", + "É": "É", + "É": "É", + "Ê": "Ê", + "Ê": "Ê", + "Ë": "Ë", + "Ë": "Ë", + "Ì": "Ì", + "Ì": "Ì", + "Í": "Í", + "Í": "Í", + "Î": "Î", + "Î": "Î", + "Ï": "Ï", + "Ï": "Ï", + "Ð": "Ð", + "Ð": "Ð", + "Ñ": "Ñ", + "Ñ": "Ñ", + "Ò": "Ò", + "Ò": "Ò", + "Ó": "Ó", + "Ó": "Ó", + "Ô": "Ô", + "Ô": "Ô", + "Õ": "Õ", + "Õ": "Õ", + "Ö": "Ö", + "Ö": "Ö", + "×": "×", + "×": "×", + "Ø": "Ø", + "Ø": "Ø", + "Ù": "Ù", + "Ù": "Ù", + "Ú": "Ú", + "Ú": "Ú", + "Û": "Û", + "Û": "Û", + "Ü": "Ü", + "Ü": "Ü", + "Ý": "Ý", + "Ý": "Ý", + "Þ": "Þ", + "Þ": "Þ", + "ß": "ß", + "ß": "ß", + "à": "à", + "à": "à", + "á": "á", + "á": "á", + "â": "â", + "â": "â", + "ã": "ã", + "ã": "ã", + "ä": "ä", + "ä": "ä", + "å": "å", + "å": "å", + "æ": "æ", + "æ": "æ", + "ç": "ç", + "ç": "ç", + "è": "è", + "è": "è", + "é": "é", + "é": "é", + "ê": "ê", + "ê": "ê", + "ë": "ë", + "ë": "ë", + "ì": "ì", + "ì": "ì", + "í": "í", + "í": "í", + "î": "î", + "î": "î", + "ï": "ï", + "ï": "ï", + "ð": "ð", + "ð": "ð", + "ñ": "ñ", + "ñ": "ñ", + "ò": "ò", + "ò": "ò", + "ó": "ó", + "ó": "ó", + "ô": "ô", + "ô": "ô", + "õ": "õ", + "õ": "õ", + "ö": "ö", + "ö": "ö", + "÷": "÷", + "÷": "÷", + "ø": "ø", + "ø": "ø", + "ù": "ù", + "ù": "ù", + "ú": "ú", + "ú": "ú", + "û": "û", + "û": "û", + "ü": "ü", + "ü": "ü", + "ý": "ý", + "ý": "ý", + "þ": "þ", + "þ": "þ", + "ÿ": "ÿ", + "ÿ": "ÿ", + """: '"', + """: '"', + "&": "&", + "&": "&", + "<": "<", + "<": "<", + ">": ">", + ">": ">", + "Œ": "Œ", + "œ": "œ", + "Š": "Š", + "š": "š", + "Ÿ": "Ÿ", + "ˆ": "ˆ", + "˜": "˜", + " ": " ", + " ": " ", + " ": " ", + "‌": "‌", + "‍": "‍", + "‎": "‎", + "‏": "‏", + "–": "–", + "—": "—", + "‘": "‘", + "’": "’", + "‚": "‚", + "“": "“", + "”": "”", + "„": "„", + "†": "†", + "‡": "‡", + "‰": "‰", + "‹": "‹", + "›": "›", + "€": "€", + "ƒ": "ƒ", + "Α": "Α", + "Β": "Β", + "Γ": "Γ", + "Δ": "Δ", + "Ε": "Ε", + "Ζ": "Ζ", + "Η": "Η", + "Θ": "Θ", + "Ι": "Ι", + "Κ": "Κ", + "Λ": "Λ", + "Μ": "Μ", + "Ν": "Ν", + "Ξ": "Ξ", + "Ο": "Ο", + "Π": "Π", + "Ρ": "Ρ", + "Σ": "Σ", + "Τ": "Τ", + "Υ": "Υ", + "Φ": "Φ", + "Χ": "Χ", + "Ψ": "Ψ", + "Ω": "Ω", + "α": "α", + "β": "β", + "γ": "γ", + "δ": "δ", + "ε": "ε", + "ζ": "ζ", + "η": "η", + "θ": "θ", + "ι": "ι", + "κ": "κ", + "λ": "λ", + "μ": "μ", + "ν": "ν", + "ξ": "ξ", + "ο": "ο", + "π": "π", + "ρ": "ρ", + "ς": "ς", + "σ": "σ", + "τ": "τ", + "υ": "υ", + "φ": "φ", + "χ": "χ", + "ψ": "ψ", + "ω": "ω", + "ϑ": "ϑ", + "ϒ": "ϒ", + "ϖ": "ϖ", + "•": "•", + "…": "…", + "′": "′", + "″": "″", + "‾": "‾", + "⁄": "⁄", + "℘": "℘", + "ℑ": "ℑ", + "ℜ": "ℜ", + "™": "™", + "ℵ": "ℵ", + "←": "←", + "↑": "↑", + "→": "→", + "↓": "↓", + "↔": "↔", + "↵": "↵", + "⇐": "⇐", + "⇑": "⇑", + "⇒": "⇒", + "⇓": "⇓", + "⇔": "⇔", + "∀": "∀", + "∂": "∂", + "∃": "∃", + "∅": "∅", + "∇": "∇", + "∈": "∈", + "∉": "∉", + "∋": "∋", + "∏": "∏", + "∑": "∑", + "−": "−", + "∗": "∗", + "√": "√", + "∝": "∝", + "∞": "∞", + "∠": "∠", + "∧": "∧", + "∨": "∨", + "∩": "∩", + "∪": "∪", + "∫": "∫", + "∴": "∴", + "∼": "∼", + "≅": "≅", + "≈": "≈", + "≠": "≠", + "≡": "≡", + "≤": "≤", + "≥": "≥", + "⊂": "⊂", + "⊃": "⊃", + "⊄": "⊄", + "⊆": "⊆", + "⊇": "⊇", + "⊕": "⊕", + "⊗": "⊗", + "⊥": "⊥", + "⋅": "⋅", + "⌈": "⌈", + "⌉": "⌉", + "⌊": "⌊", + "⌋": "⌋", + "⟨": "〈", + "⟩": "〉", + "◊": "◊", + "♠": "♠", + "♣": "♣", + "♥": "♥", + "♦": "♦" + }, + characters: { + "'": "'", + " ": " ", + "¡": "¡", + "¢": "¢", + "£": "£", + "¤": "¤", + "¥": "¥", + "¦": "¦", + "§": "§", + "¨": "¨", + "©": "©", + "ª": "ª", + "«": "«", + "¬": "¬", + "­": "­", + "®": "®", + "¯": "¯", + "°": "°", + "±": "±", + "²": "²", + "³": "³", + "´": "´", + "µ": "µ", + "¶": "¶", + "·": "·", + "¸": "¸", + "¹": "¹", + "º": "º", + "»": "»", + "¼": "¼", + "½": "½", + "¾": "¾", + "¿": "¿", + "À": "À", + "Á": "Á", + "Â": "Â", + "Ã": "Ã", + "Ä": "Ä", + "Å": "Å", + "Æ": "Æ", + "Ç": "Ç", + "È": "È", + "É": "É", + "Ê": "Ê", + "Ë": "Ë", + "Ì": "Ì", + "Í": "Í", + "Î": "Î", + "Ï": "Ï", + "Ð": "Ð", + "Ñ": "Ñ", + "Ò": "Ò", + "Ó": "Ó", + "Ô": "Ô", + "Õ": "Õ", + "Ö": "Ö", + "×": "×", + "Ø": "Ø", + "Ù": "Ù", + "Ú": "Ú", + "Û": "Û", + "Ü": "Ü", + "Ý": "Ý", + "Þ": "Þ", + "ß": "ß", + "à": "à", + "á": "á", + "â": "â", + "ã": "ã", + "ä": "ä", + "å": "å", + "æ": "æ", + "ç": "ç", + "è": "è", + "é": "é", + "ê": "ê", + "ë": "ë", + "ì": "ì", + "í": "í", + "î": "î", + "ï": "ï", + "ð": "ð", + "ñ": "ñ", + "ò": "ò", + "ó": "ó", + "ô": "ô", + "õ": "õ", + "ö": "ö", + "÷": "÷", + "ø": "ø", + "ù": "ù", + "ú": "ú", + "û": "û", + "ü": "ü", + "ý": "ý", + "þ": "þ", + "ÿ": "ÿ", + '"': """, + "&": "&", + "<": "<", + ">": ">", + "Œ": "Œ", + "œ": "œ", + "Š": "Š", + "š": "š", + "Ÿ": "Ÿ", + "ˆ": "ˆ", + "˜": "˜", + " ": " ", + " ": " ", + " ": " ", + "‌": "‌", + "‍": "‍", + "‎": "‎", + "‏": "‏", + "–": "–", + "—": "—", + "‘": "‘", + "’": "’", + "‚": "‚", + "“": "“", + "”": "”", + "„": "„", + "†": "†", + "‡": "‡", + "‰": "‰", + "‹": "‹", + "›": "›", + "€": "€", + "ƒ": "ƒ", + "Α": "Α", + "Β": "Β", + "Γ": "Γ", + "Δ": "Δ", + "Ε": "Ε", + "Ζ": "Ζ", + "Η": "Η", + "Θ": "Θ", + "Ι": "Ι", + "Κ": "Κ", + "Λ": "Λ", + "Μ": "Μ", + "Ν": "Ν", + "Ξ": "Ξ", + "Ο": "Ο", + "Π": "Π", + "Ρ": "Ρ", + "Σ": "Σ", + "Τ": "Τ", + "Υ": "Υ", + "Φ": "Φ", + "Χ": "Χ", + "Ψ": "Ψ", + "Ω": "Ω", + "α": "α", + "β": "β", + "γ": "γ", + "δ": "δ", + "ε": "ε", + "ζ": "ζ", + "η": "η", + "θ": "θ", + "ι": "ι", + "κ": "κ", + "λ": "λ", + "μ": "μ", + "ν": "ν", + "ξ": "ξ", + "ο": "ο", + "π": "π", + "ρ": "ρ", + "ς": "ς", + "σ": "σ", + "τ": "τ", + "υ": "υ", + "φ": "φ", + "χ": "χ", + "ψ": "ψ", + "ω": "ω", + "ϑ": "ϑ", + "ϒ": "ϒ", + "ϖ": "ϖ", + "•": "•", + "…": "…", + "′": "′", + "″": "″", + "‾": "‾", + "⁄": "⁄", + "℘": "℘", + "ℑ": "ℑ", + "ℜ": "ℜ", + "™": "™", + "ℵ": "ℵ", + "←": "←", + "↑": "↑", + "→": "→", + "↓": "↓", + "↔": "↔", + "↵": "↵", + "⇐": "⇐", + "⇑": "⇑", + "⇒": "⇒", + "⇓": "⇓", + "⇔": "⇔", + "∀": "∀", + "∂": "∂", + "∃": "∃", + "∅": "∅", + "∇": "∇", + "∈": "∈", + "∉": "∉", + "∋": "∋", + "∏": "∏", + "∑": "∑", + "−": "−", + "∗": "∗", + "√": "√", + "∝": "∝", + "∞": "∞", + "∠": "∠", + "∧": "∧", + "∨": "∨", + "∩": "∩", + "∪": "∪", + "∫": "∫", + "∴": "∴", + "∼": "∼", + "≅": "≅", + "≈": "≈", + "≠": "≠", + "≡": "≡", + "≤": "≤", + "≥": "≥", + "⊂": "⊂", + "⊃": "⊃", + "⊄": "⊄", + "⊆": "⊆", + "⊇": "⊇", + "⊕": "⊕", + "⊗": "⊗", + "⊥": "⊥", + "⋅": "⋅", + "⌈": "⌈", + "⌉": "⌉", + "⌊": "⌊", + "⌋": "⌋", + "〈": "⟨", + "〉": "⟩", + "◊": "◊", + "♠": "♠", + "♣": "♣", + "♥": "♥", + "♦": "♦" + } + }, + html5: { + entities: { + "Æ": "Æ", + "Æ": "Æ", + "&": "&", + "&": "&", + "Á": "Á", + "Á": "Á", + "Ă": "Ă", + "Â": "Â", + "Â": "Â", + "А": "А", + "𝔄": "𝔄", + "À": "À", + "À": "À", + "Α": "Α", + "Ā": "Ā", + "⩓": "⩓", + "Ą": "Ą", + "𝔸": "𝔸", + "⁡": "⁡", + "Å": "Å", + "Å": "Å", + "𝒜": "𝒜", + "≔": "≔", + "Ã": "Ã", + "Ã": "Ã", + "Ä": "Ä", + "Ä": "Ä", + "∖": "∖", + "⫧": "⫧", + "⌆": "⌆", + "Б": "Б", + "∵": "∵", + "ℬ": "ℬ", + "Β": "Β", + "𝔅": "𝔅", + "𝔹": "𝔹", + "˘": "˘", + "ℬ": "ℬ", + "≎": "≎", + "Ч": "Ч", + "©": "©", + "©": "©", + "Ć": "Ć", + "⋒": "⋒", + "ⅅ": "ⅅ", + "ℭ": "ℭ", + "Č": "Č", + "Ç": "Ç", + "Ç": "Ç", + "Ĉ": "Ĉ", + "∰": "∰", + "Ċ": "Ċ", + "¸": "¸", + "·": "·", + "ℭ": "ℭ", + "Χ": "Χ", + "⊙": "⊙", + "⊖": "⊖", + "⊕": "⊕", + "⊗": "⊗", + "∲": "∲", + "”": "”", + "’": "’", + "∷": "∷", + "⩴": "⩴", + "≡": "≡", + "∯": "∯", + "∮": "∮", + "ℂ": "ℂ", + "∐": "∐", + "∳": "∳", + "⨯": "⨯", + "𝒞": "𝒞", + "⋓": "⋓", + "≍": "≍", + "ⅅ": "ⅅ", + "⤑": "⤑", + "Ђ": "Ђ", + "Ѕ": "Ѕ", + "Џ": "Џ", + "‡": "‡", + "↡": "↡", + "⫤": "⫤", + "Ď": "Ď", + "Д": "Д", + "∇": "∇", + "Δ": "Δ", + "𝔇": "𝔇", + "´": "´", + "˙": "˙", + "˝": "˝", + "`": "`", + "˜": "˜", + "⋄": "⋄", + "ⅆ": "ⅆ", + "𝔻": "𝔻", + "¨": "¨", + "⃜": "⃜", + "≐": "≐", + "∯": "∯", + "¨": "¨", + "⇓": "⇓", + "⇐": "⇐", + "⇔": "⇔", + "⫤": "⫤", + "⟸": "⟸", + "⟺": "⟺", + "⟹": "⟹", + "⇒": "⇒", + "⊨": "⊨", + "⇑": "⇑", + "⇕": "⇕", + "∥": "∥", + "↓": "↓", + "⤓": "⤓", + "⇵": "⇵", + "̑": "̑", + "⥐": "⥐", + "⥞": "⥞", + "↽": "↽", + "⥖": "⥖", + "⥟": "⥟", + "⇁": "⇁", + "⥗": "⥗", + "⊤": "⊤", + "↧": "↧", + "⇓": "⇓", + "𝒟": "𝒟", + "Đ": "Đ", + "Ŋ": "Ŋ", + "Ð": "Ð", + "Ð": "Ð", + "É": "É", + "É": "É", + "Ě": "Ě", + "Ê": "Ê", + "Ê": "Ê", + "Э": "Э", + "Ė": "Ė", + "𝔈": "𝔈", + "È": "È", + "È": "È", + "∈": "∈", + "Ē": "Ē", + "◻": "◻", + "▫": "▫", + "Ę": "Ę", + "𝔼": "𝔼", + "Ε": "Ε", + "⩵": "⩵", + "≂": "≂", + "⇌": "⇌", + "ℰ": "ℰ", + "⩳": "⩳", + "Η": "Η", + "Ë": "Ë", + "Ë": "Ë", + "∃": "∃", + "ⅇ": "ⅇ", + "Ф": "Ф", + "𝔉": "𝔉", + "◼": "◼", + "▪": "▪", + "𝔽": "𝔽", + "∀": "∀", + "ℱ": "ℱ", + "ℱ": "ℱ", + "Ѓ": "Ѓ", + ">": ">", + ">": ">", + "Γ": "Γ", + "Ϝ": "Ϝ", + "Ğ": "Ğ", + "Ģ": "Ģ", + "Ĝ": "Ĝ", + "Г": "Г", + "Ġ": "Ġ", + "𝔊": "𝔊", + "⋙": "⋙", + "𝔾": "𝔾", + "≥": "≥", + "⋛": "⋛", + "≧": "≧", + "⪢": "⪢", + "≷": "≷", + "⩾": "⩾", + "≳": "≳", + "𝒢": "𝒢", + "≫": "≫", + "Ъ": "Ъ", + "ˇ": "ˇ", + "^": "^", + "Ĥ": "Ĥ", + "ℌ": "ℌ", + "ℋ": "ℋ", + "ℍ": "ℍ", + "─": "─", + "ℋ": "ℋ", + "Ħ": "Ħ", + "≎": "≎", + "≏": "≏", + "Е": "Е", + "IJ": "IJ", + "Ё": "Ё", + "Í": "Í", + "Í": "Í", + "Î": "Î", + "Î": "Î", + "И": "И", + "İ": "İ", + "ℑ": "ℑ", + "Ì": "Ì", + "Ì": "Ì", + "ℑ": "ℑ", + "Ī": "Ī", + "ⅈ": "ⅈ", + "⇒": "⇒", + "∬": "∬", + "∫": "∫", + "⋂": "⋂", + "⁣": "⁣", + "⁢": "⁢", + "Į": "Į", + "𝕀": "𝕀", + "Ι": "Ι", + "ℐ": "ℐ", + "Ĩ": "Ĩ", + "І": "І", + "Ï": "Ï", + "Ï": "Ï", + "Ĵ": "Ĵ", + "Й": "Й", + "𝔍": "𝔍", + "𝕁": "𝕁", + "𝒥": "𝒥", + "Ј": "Ј", + "Є": "Є", + "Х": "Х", + "Ќ": "Ќ", + "Κ": "Κ", + "Ķ": "Ķ", + "К": "К", + "𝔎": "𝔎", + "𝕂": "𝕂", + "𝒦": "𝒦", + "Љ": "Љ", + "<": "<", + "<": "<", + "Ĺ": "Ĺ", + "Λ": "Λ", + "⟪": "⟪", + "ℒ": "ℒ", + "↞": "↞", + "Ľ": "Ľ", + "Ļ": "Ļ", + "Л": "Л", + "⟨": "⟨", + "←": "←", + "⇤": "⇤", + "⇆": "⇆", + "⌈": "⌈", + "⟦": "⟦", + "⥡": "⥡", + "⇃": "⇃", + "⥙": "⥙", + "⌊": "⌊", + "↔": "↔", + "⥎": "⥎", + "⊣": "⊣", + "↤": "↤", + "⥚": "⥚", + "⊲": "⊲", + "⧏": "⧏", + "⊴": "⊴", + "⥑": "⥑", + "⥠": "⥠", + "↿": "↿", + "⥘": "⥘", + "↼": "↼", + "⥒": "⥒", + "⇐": "⇐", + "⇔": "⇔", + "⋚": "⋚", + "≦": "≦", + "≶": "≶", + "⪡": "⪡", + "⩽": "⩽", + "≲": "≲", + "𝔏": "𝔏", + "⋘": "⋘", + "⇚": "⇚", + "Ŀ": "Ŀ", + "⟵": "⟵", + "⟷": "⟷", + "⟶": "⟶", + "⟸": "⟸", + "⟺": "⟺", + "⟹": "⟹", + "𝕃": "𝕃", + "↙": "↙", + "↘": "↘", + "ℒ": "ℒ", + "↰": "↰", + "Ł": "Ł", + "≪": "≪", + "⤅": "⤅", + "М": "М", + " ": " ", + "ℳ": "ℳ", + "𝔐": "𝔐", + "∓": "∓", + "𝕄": "𝕄", + "ℳ": "ℳ", + "Μ": "Μ", + "Њ": "Њ", + "Ń": "Ń", + "Ň": "Ň", + "Ņ": "Ņ", + "Н": "Н", + "​": "​", + "​": "​", + "​": "​", + "​": "​", + "≫": "≫", + "≪": "≪", + " ": "\n", + "𝔑": "𝔑", + "⁠": "⁠", + " ": " ", + "ℕ": "ℕ", + "⫬": "⫬", + "≢": "≢", + "≭": "≭", + "∦": "∦", + "∉": "∉", + "≠": "≠", + "≂̸": "≂̸", + "∄": "∄", + "≯": "≯", + "≱": "≱", + "≧̸": "≧̸", + "≫̸": "≫̸", + "≹": "≹", + "⩾̸": "⩾̸", + "≵": "≵", + "≎̸": "≎̸", + "≏̸": "≏̸", + "⋪": "⋪", + "⧏̸": "⧏̸", + "⋬": "⋬", + "≮": "≮", + "≰": "≰", + "≸": "≸", + "≪̸": "≪̸", + "⩽̸": "⩽̸", + "≴": "≴", + "⪢̸": "⪢̸", + "⪡̸": "⪡̸", + "⊀": "⊀", + "⪯̸": "⪯̸", + "⋠": "⋠", + "∌": "∌", + "⋫": "⋫", + "⧐̸": "⧐̸", + "⋭": "⋭", + "⊏̸": "⊏̸", + "⋢": "⋢", + "⊐̸": "⊐̸", + "⋣": "⋣", + "⊂⃒": "⊂⃒", + "⊈": "⊈", + "⊁": "⊁", + "⪰̸": "⪰̸", + "⋡": "⋡", + "≿̸": "≿̸", + "⊃⃒": "⊃⃒", + "⊉": "⊉", + "≁": "≁", + "≄": "≄", + "≇": "≇", + "≉": "≉", + "∤": "∤", + "𝒩": "𝒩", + "Ñ": "Ñ", + "Ñ": "Ñ", + "Ν": "Ν", + "Œ": "Œ", + "Ó": "Ó", + "Ó": "Ó", + "Ô": "Ô", + "Ô": "Ô", + "О": "О", + "Ő": "Ő", + "𝔒": "𝔒", + "Ò": "Ò", + "Ò": "Ò", + "Ō": "Ō", + "Ω": "Ω", + "Ο": "Ο", + "𝕆": "𝕆", + "“": "“", + "‘": "‘", + "⩔": "⩔", + "𝒪": "𝒪", + "Ø": "Ø", + "Ø": "Ø", + "Õ": "Õ", + "Õ": "Õ", + "⨷": "⨷", + "Ö": "Ö", + "Ö": "Ö", + "‾": "‾", + "⏞": "⏞", + "⎴": "⎴", + "⏜": "⏜", + "∂": "∂", + "П": "П", + "𝔓": "𝔓", + "Φ": "Φ", + "Π": "Π", + "±": "±", + "ℌ": "ℌ", + "ℙ": "ℙ", + "⪻": "⪻", + "≺": "≺", + "⪯": "⪯", + "≼": "≼", + "≾": "≾", + "″": "″", + "∏": "∏", + "∷": "∷", + "∝": "∝", + "𝒫": "𝒫", + "Ψ": "Ψ", + """: '"', + """: '"', + "𝔔": "𝔔", + "ℚ": "ℚ", + "𝒬": "𝒬", + "⤐": "⤐", + "®": "®", + "®": "®", + "Ŕ": "Ŕ", + "⟫": "⟫", + "↠": "↠", + "⤖": "⤖", + "Ř": "Ř", + "Ŗ": "Ŗ", + "Р": "Р", + "ℜ": "ℜ", + "∋": "∋", + "⇋": "⇋", + "⥯": "⥯", + "ℜ": "ℜ", + "Ρ": "Ρ", + "⟩": "⟩", + "→": "→", + "⇥": "⇥", + "⇄": "⇄", + "⌉": "⌉", + "⟧": "⟧", + "⥝": "⥝", + "⇂": "⇂", + "⥕": "⥕", + "⌋": "⌋", + "⊢": "⊢", + "↦": "↦", + "⥛": "⥛", + "⊳": "⊳", + "⧐": "⧐", + "⊵": "⊵", + "⥏": "⥏", + "⥜": "⥜", + "↾": "↾", + "⥔": "⥔", + "⇀": "⇀", + "⥓": "⥓", + "⇒": "⇒", + "ℝ": "ℝ", + "⥰": "⥰", + "⇛": "⇛", + "ℛ": "ℛ", + "↱": "↱", + "⧴": "⧴", + "Щ": "Щ", + "Ш": "Ш", + "Ь": "Ь", + "Ś": "Ś", + "⪼": "⪼", + "Š": "Š", + "Ş": "Ş", + "Ŝ": "Ŝ", + "С": "С", + "𝔖": "𝔖", + "↓": "↓", + "←": "←", + "→": "→", + "↑": "↑", + "Σ": "Σ", + "∘": "∘", + "𝕊": "𝕊", + "√": "√", + "□": "□", + "⊓": "⊓", + "⊏": "⊏", + "⊑": "⊑", + "⊐": "⊐", + "⊒": "⊒", + "⊔": "⊔", + "𝒮": "𝒮", + "⋆": "⋆", + "⋐": "⋐", + "⋐": "⋐", + "⊆": "⊆", + "≻": "≻", + "⪰": "⪰", + "≽": "≽", + "≿": "≿", + "∋": "∋", + "∑": "∑", + "⋑": "⋑", + "⊃": "⊃", + "⊇": "⊇", + "⋑": "⋑", + "Þ": "Þ", + "Þ": "Þ", + "™": "™", + "Ћ": "Ћ", + "Ц": "Ц", + " ": "\t", + "Τ": "Τ", + "Ť": "Ť", + "Ţ": "Ţ", + "Т": "Т", + "𝔗": "𝔗", + "∴": "∴", + "Θ": "Θ", + "  ": "  ", + " ": " ", + "∼": "∼", + "≃": "≃", + "≅": "≅", + "≈": "≈", + "𝕋": "𝕋", + "⃛": "⃛", + "𝒯": "𝒯", + "Ŧ": "Ŧ", + "Ú": "Ú", + "Ú": "Ú", + "↟": "↟", + "⥉": "⥉", + "Ў": "Ў", + "Ŭ": "Ŭ", + "Û": "Û", + "Û": "Û", + "У": "У", + "Ű": "Ű", + "𝔘": "𝔘", + "Ù": "Ù", + "Ù": "Ù", + "Ū": "Ū", + "_": "_", + "⏟": "⏟", + "⎵": "⎵", + "⏝": "⏝", + "⋃": "⋃", + "⊎": "⊎", + "Ų": "Ų", + "𝕌": "𝕌", + "↑": "↑", + "⤒": "⤒", + "⇅": "⇅", + "↕": "↕", + "⥮": "⥮", + "⊥": "⊥", + "↥": "↥", + "⇑": "⇑", + "⇕": "⇕", + "↖": "↖", + "↗": "↗", + "ϒ": "ϒ", + "Υ": "Υ", + "Ů": "Ů", + "𝒰": "𝒰", + "Ũ": "Ũ", + "Ü": "Ü", + "Ü": "Ü", + "⊫": "⊫", + "⫫": "⫫", + "В": "В", + "⊩": "⊩", + "⫦": "⫦", + "⋁": "⋁", + "‖": "‖", + "‖": "‖", + "∣": "∣", + "|": "|", + "❘": "❘", + "≀": "≀", + " ": " ", + "𝔙": "𝔙", + "𝕍": "𝕍", + "𝒱": "𝒱", + "⊪": "⊪", + "Ŵ": "Ŵ", + "⋀": "⋀", + "𝔚": "𝔚", + "𝕎": "𝕎", + "𝒲": "𝒲", + "𝔛": "𝔛", + "Ξ": "Ξ", + "𝕏": "𝕏", + "𝒳": "𝒳", + "Я": "Я", + "Ї": "Ї", + "Ю": "Ю", + "Ý": "Ý", + "Ý": "Ý", + "Ŷ": "Ŷ", + "Ы": "Ы", + "𝔜": "𝔜", + "𝕐": "𝕐", + "𝒴": "𝒴", + "Ÿ": "Ÿ", + "Ж": "Ж", + "Ź": "Ź", + "Ž": "Ž", + "З": "З", + "Ż": "Ż", + "​": "​", + "Ζ": "Ζ", + "ℨ": "ℨ", + "ℤ": "ℤ", + "𝒵": "𝒵", + "á": "á", + "á": "á", + "ă": "ă", + "∾": "∾", + "∾̳": "∾̳", + "∿": "∿", + "â": "â", + "â": "â", + "´": "´", + "´": "´", + "а": "а", + "æ": "æ", + "æ": "æ", + "⁡": "⁡", + "𝔞": "𝔞", + "à": "à", + "à": "à", + "ℵ": "ℵ", + "ℵ": "ℵ", + "α": "α", + "ā": "ā", + "⨿": "⨿", + "&": "&", + "&": "&", + "∧": "∧", + "⩕": "⩕", + "⩜": "⩜", + "⩘": "⩘", + "⩚": "⩚", + "∠": "∠", + "⦤": "⦤", + "∠": "∠", + "∡": "∡", + "⦨": "⦨", + "⦩": "⦩", + "⦪": "⦪", + "⦫": "⦫", + "⦬": "⦬", + "⦭": "⦭", + "⦮": "⦮", + "⦯": "⦯", + "∟": "∟", + "⊾": "⊾", + "⦝": "⦝", + "∢": "∢", + "Å": "Å", + "⍼": "⍼", + "ą": "ą", + "𝕒": "𝕒", + "≈": "≈", + "⩰": "⩰", + "⩯": "⩯", + "≊": "≊", + "≋": "≋", + "'": "'", + "≈": "≈", + "≊": "≊", + "å": "å", + "å": "å", + "𝒶": "𝒶", + "*": "*", + "≈": "≈", + "≍": "≍", + "ã": "ã", + "ã": "ã", + "ä": "ä", + "ä": "ä", + "∳": "∳", + "⨑": "⨑", + "⫭": "⫭", + "≌": "≌", + "϶": "϶", + "‵": "‵", + "∽": "∽", + "⋍": "⋍", + "⊽": "⊽", + "⌅": "⌅", + "⌅": "⌅", + "⎵": "⎵", + "⎶": "⎶", + "≌": "≌", + "б": "б", + "„": "„", + "∵": "∵", + "∵": "∵", + "⦰": "⦰", + "϶": "϶", + "ℬ": "ℬ", + "β": "β", + "ℶ": "ℶ", + "≬": "≬", + "𝔟": "𝔟", + "⋂": "⋂", + "◯": "◯", + "⋃": "⋃", + "⨀": "⨀", + "⨁": "⨁", + "⨂": "⨂", + "⨆": "⨆", + "★": "★", + "▽": "▽", + "△": "△", + "⨄": "⨄", + "⋁": "⋁", + "⋀": "⋀", + "⤍": "⤍", + "⧫": "⧫", + "▪": "▪", + "▴": "▴", + "▾": "▾", + "◂": "◂", + "▸": "▸", + "␣": "␣", + "▒": "▒", + "░": "░", + "▓": "▓", + "█": "█", + "=⃥": "=⃥", + "≡⃥": "≡⃥", + "⌐": "⌐", + "𝕓": "𝕓", + "⊥": "⊥", + "⊥": "⊥", + "⋈": "⋈", + "╗": "╗", + "╔": "╔", + "╖": "╖", + "╓": "╓", + "═": "═", + "╦": "╦", + "╩": "╩", + "╤": "╤", + "╧": "╧", + "╝": "╝", + "╚": "╚", + "╜": "╜", + "╙": "╙", + "║": "║", + "╬": "╬", + "╣": "╣", + "╠": "╠", + "╫": "╫", + "╢": "╢", + "╟": "╟", + "⧉": "⧉", + "╕": "╕", + "╒": "╒", + "┐": "┐", + "┌": "┌", + "─": "─", + "╥": "╥", + "╨": "╨", + "┬": "┬", + "┴": "┴", + "⊟": "⊟", + "⊞": "⊞", + "⊠": "⊠", + "╛": "╛", + "╘": "╘", + "┘": "┘", + "└": "└", + "│": "│", + "╪": "╪", + "╡": "╡", + "╞": "╞", + "┼": "┼", + "┤": "┤", + "├": "├", + "‵": "‵", + "˘": "˘", + "¦": "¦", + "¦": "¦", + "𝒷": "𝒷", + "⁏": "⁏", + "∽": "∽", + "⋍": "⋍", + "\": "\\", + "⧅": "⧅", + "⟈": "⟈", + "•": "•", + "•": "•", + "≎": "≎", + "⪮": "⪮", + "≏": "≏", + "≏": "≏", + "ć": "ć", + "∩": "∩", + "⩄": "⩄", + "⩉": "⩉", + "⩋": "⩋", + "⩇": "⩇", + "⩀": "⩀", + "∩︀": "∩︀", + "⁁": "⁁", + "ˇ": "ˇ", + "⩍": "⩍", + "č": "č", + "ç": "ç", + "ç": "ç", + "ĉ": "ĉ", + "⩌": "⩌", + "⩐": "⩐", + "ċ": "ċ", + "¸": "¸", + "¸": "¸", + "⦲": "⦲", + "¢": "¢", + "¢": "¢", + "·": "·", + "𝔠": "𝔠", + "ч": "ч", + "✓": "✓", + "✓": "✓", + "χ": "χ", + "○": "○", + "⧃": "⧃", + "ˆ": "ˆ", + "≗": "≗", + "↺": "↺", + "↻": "↻", + "®": "®", + "Ⓢ": "Ⓢ", + "⊛": "⊛", + "⊚": "⊚", + "⊝": "⊝", + "≗": "≗", + "⨐": "⨐", + "⫯": "⫯", + "⧂": "⧂", + "♣": "♣", + "♣": "♣", + ":": ":", + "≔": "≔", + "≔": "≔", + ",": ",", + "@": "@", + "∁": "∁", + "∘": "∘", + "∁": "∁", + "ℂ": "ℂ", + "≅": "≅", + "⩭": "⩭", + "∮": "∮", + "𝕔": "𝕔", + "∐": "∐", + "©": "©", + "©": "©", + "℗": "℗", + "↵": "↵", + "✗": "✗", + "𝒸": "𝒸", + "⫏": "⫏", + "⫑": "⫑", + "⫐": "⫐", + "⫒": "⫒", + "⋯": "⋯", + "⤸": "⤸", + "⤵": "⤵", + "⋞": "⋞", + "⋟": "⋟", + "↶": "↶", + "⤽": "⤽", + "∪": "∪", + "⩈": "⩈", + "⩆": "⩆", + "⩊": "⩊", + "⊍": "⊍", + "⩅": "⩅", + "∪︀": "∪︀", + "↷": "↷", + "⤼": "⤼", + "⋞": "⋞", + "⋟": "⋟", + "⋎": "⋎", + "⋏": "⋏", + "¤": "¤", + "¤": "¤", + "↶": "↶", + "↷": "↷", + "⋎": "⋎", + "⋏": "⋏", + "∲": "∲", + "∱": "∱", + "⌭": "⌭", + "⇓": "⇓", + "⥥": "⥥", + "†": "†", + "ℸ": "ℸ", + "↓": "↓", + "‐": "‐", + "⊣": "⊣", + "⤏": "⤏", + "˝": "˝", + "ď": "ď", + "д": "д", + "ⅆ": "ⅆ", + "‡": "‡", + "⇊": "⇊", + "⩷": "⩷", + "°": "°", + "°": "°", + "δ": "δ", + "⦱": "⦱", + "⥿": "⥿", + "𝔡": "𝔡", + "⇃": "⇃", + "⇂": "⇂", + "⋄": "⋄", + "⋄": "⋄", + "♦": "♦", + "♦": "♦", + "¨": "¨", + "ϝ": "ϝ", + "⋲": "⋲", + "÷": "÷", + "÷": "÷", + "÷": "÷", + "⋇": "⋇", + "⋇": "⋇", + "ђ": "ђ", + "⌞": "⌞", + "⌍": "⌍", + "$": "$", + "𝕕": "𝕕", + "˙": "˙", + "≐": "≐", + "≑": "≑", + "∸": "∸", + "∔": "∔", + "⊡": "⊡", + "⌆": "⌆", + "↓": "↓", + "⇊": "⇊", + "⇃": "⇃", + "⇂": "⇂", + "⤐": "⤐", + "⌟": "⌟", + "⌌": "⌌", + "𝒹": "𝒹", + "ѕ": "ѕ", + "⧶": "⧶", + "đ": "đ", + "⋱": "⋱", + "▿": "▿", + "▾": "▾", + "⇵": "⇵", + "⥯": "⥯", + "⦦": "⦦", + "џ": "џ", + "⟿": "⟿", + "⩷": "⩷", + "≑": "≑", + "é": "é", + "é": "é", + "⩮": "⩮", + "ě": "ě", + "≖": "≖", + "ê": "ê", + "ê": "ê", + "≕": "≕", + "э": "э", + "ė": "ė", + "ⅇ": "ⅇ", + "≒": "≒", + "𝔢": "𝔢", + "⪚": "⪚", + "è": "è", + "è": "è", + "⪖": "⪖", + "⪘": "⪘", + "⪙": "⪙", + "⏧": "⏧", + "ℓ": "ℓ", + "⪕": "⪕", + "⪗": "⪗", + "ē": "ē", + "∅": "∅", + "∅": "∅", + "∅": "∅", + " ": " ", + " ": " ", + " ": " ", + "ŋ": "ŋ", + " ": " ", + "ę": "ę", + "𝕖": "𝕖", + "⋕": "⋕", + "⧣": "⧣", + "⩱": "⩱", + "ε": "ε", + "ε": "ε", + "ϵ": "ϵ", + "≖": "≖", + "≕": "≕", + "≂": "≂", + "⪖": "⪖", + "⪕": "⪕", + "=": "=", + "≟": "≟", + "≡": "≡", + "⩸": "⩸", + "⧥": "⧥", + "≓": "≓", + "⥱": "⥱", + "ℯ": "ℯ", + "≐": "≐", + "≂": "≂", + "η": "η", + "ð": "ð", + "ð": "ð", + "ë": "ë", + "ë": "ë", + "€": "€", + "!": "!", + "∃": "∃", + "ℰ": "ℰ", + "ⅇ": "ⅇ", + "≒": "≒", + "ф": "ф", + "♀": "♀", + "ffi": "ffi", + "ff": "ff", + "ffl": "ffl", + "𝔣": "𝔣", + "fi": "fi", + "fj": "fj", + "♭": "♭", + "fl": "fl", + "▱": "▱", + "ƒ": "ƒ", + "𝕗": "𝕗", + "∀": "∀", + "⋔": "⋔", + "⫙": "⫙", + "⨍": "⨍", + "½": "½", + "½": "½", + "⅓": "⅓", + "¼": "¼", + "¼": "¼", + "⅕": "⅕", + "⅙": "⅙", + "⅛": "⅛", + "⅔": "⅔", + "⅖": "⅖", + "¾": "¾", + "¾": "¾", + "⅗": "⅗", + "⅜": "⅜", + "⅘": "⅘", + "⅚": "⅚", + "⅝": "⅝", + "⅞": "⅞", + "⁄": "⁄", + "⌢": "⌢", + "𝒻": "𝒻", + "≧": "≧", + "⪌": "⪌", + "ǵ": "ǵ", + "γ": "γ", + "ϝ": "ϝ", + "⪆": "⪆", + "ğ": "ğ", + "ĝ": "ĝ", + "г": "г", + "ġ": "ġ", + "≥": "≥", + "⋛": "⋛", + "≥": "≥", + "≧": "≧", + "⩾": "⩾", + "⩾": "⩾", + "⪩": "⪩", + "⪀": "⪀", + "⪂": "⪂", + "⪄": "⪄", + "⋛︀": "⋛︀", + "⪔": "⪔", + "𝔤": "𝔤", + "≫": "≫", + "⋙": "⋙", + "ℷ": "ℷ", + "ѓ": "ѓ", + "≷": "≷", + "⪒": "⪒", + "⪥": "⪥", + "⪤": "⪤", + "≩": "≩", + "⪊": "⪊", + "⪊": "⪊", + "⪈": "⪈", + "⪈": "⪈", + "≩": "≩", + "⋧": "⋧", + "𝕘": "𝕘", + "`": "`", + "ℊ": "ℊ", + "≳": "≳", + "⪎": "⪎", + "⪐": "⪐", + ">": ">", + ">": ">", + "⪧": "⪧", + "⩺": "⩺", + "⋗": "⋗", + "⦕": "⦕", + "⩼": "⩼", + "⪆": "⪆", + "⥸": "⥸", + "⋗": "⋗", + "⋛": "⋛", + "⪌": "⪌", + "≷": "≷", + "≳": "≳", + "≩︀": "≩︀", + "≩︀": "≩︀", + "⇔": "⇔", + " ": " ", + "½": "½", + "ℋ": "ℋ", + "ъ": "ъ", + "↔": "↔", + "⥈": "⥈", + "↭": "↭", + "ℏ": "ℏ", + "ĥ": "ĥ", + "♥": "♥", + "♥": "♥", + "…": "…", + "⊹": "⊹", + "𝔥": "𝔥", + "⤥": "⤥", + "⤦": "⤦", + "⇿": "⇿", + "∻": "∻", + "↩": "↩", + "↪": "↪", + "𝕙": "𝕙", + "―": "―", + "𝒽": "𝒽", + "ℏ": "ℏ", + "ħ": "ħ", + "⁃": "⁃", + "‐": "‐", + "í": "í", + "í": "í", + "⁣": "⁣", + "î": "î", + "î": "î", + "и": "и", + "е": "е", + "¡": "¡", + "¡": "¡", + "⇔": "⇔", + "𝔦": "𝔦", + "ì": "ì", + "ì": "ì", + "ⅈ": "ⅈ", + "⨌": "⨌", + "∭": "∭", + "⧜": "⧜", + "℩": "℩", + "ij": "ij", + "ī": "ī", + "ℑ": "ℑ", + "ℐ": "ℐ", + "ℑ": "ℑ", + "ı": "ı", + "⊷": "⊷", + "Ƶ": "Ƶ", + "∈": "∈", + "℅": "℅", + "∞": "∞", + "⧝": "⧝", + "ı": "ı", + "∫": "∫", + "⊺": "⊺", + "ℤ": "ℤ", + "⊺": "⊺", + "⨗": "⨗", + "⨼": "⨼", + "ё": "ё", + "į": "į", + "𝕚": "𝕚", + "ι": "ι", + "⨼": "⨼", + "¿": "¿", + "¿": "¿", + "𝒾": "𝒾", + "∈": "∈", + "⋹": "⋹", + "⋵": "⋵", + "⋴": "⋴", + "⋳": "⋳", + "∈": "∈", + "⁢": "⁢", + "ĩ": "ĩ", + "і": "і", + "ï": "ï", + "ï": "ï", + "ĵ": "ĵ", + "й": "й", + "𝔧": "𝔧", + "ȷ": "ȷ", + "𝕛": "𝕛", + "𝒿": "𝒿", + "ј": "ј", + "є": "є", + "κ": "κ", + "ϰ": "ϰ", + "ķ": "ķ", + "к": "к", + "𝔨": "𝔨", + "ĸ": "ĸ", + "х": "х", + "ќ": "ќ", + "𝕜": "𝕜", + "𝓀": "𝓀", + "⇚": "⇚", + "⇐": "⇐", + "⤛": "⤛", + "⤎": "⤎", + "≦": "≦", + "⪋": "⪋", + "⥢": "⥢", + "ĺ": "ĺ", + "⦴": "⦴", + "ℒ": "ℒ", + "λ": "λ", + "⟨": "⟨", + "⦑": "⦑", + "⟨": "⟨", + "⪅": "⪅", + "«": "«", + "«": "«", + "←": "←", + "⇤": "⇤", + "⤟": "⤟", + "⤝": "⤝", + "↩": "↩", + "↫": "↫", + "⤹": "⤹", + "⥳": "⥳", + "↢": "↢", + "⪫": "⪫", + "⤙": "⤙", + "⪭": "⪭", + "⪭︀": "⪭︀", + "⤌": "⤌", + "❲": "❲", + "{": "{", + "[": "[", + "⦋": "⦋", + "⦏": "⦏", + "⦍": "⦍", + "ľ": "ľ", + "ļ": "ļ", + "⌈": "⌈", + "{": "{", + "л": "л", + "⤶": "⤶", + "“": "“", + "„": "„", + "⥧": "⥧", + "⥋": "⥋", + "↲": "↲", + "≤": "≤", + "←": "←", + "↢": "↢", + "↽": "↽", + "↼": "↼", + "⇇": "⇇", + "↔": "↔", + "⇆": "⇆", + "⇋": "⇋", + "↭": "↭", + "⋋": "⋋", + "⋚": "⋚", + "≤": "≤", + "≦": "≦", + "⩽": "⩽", + "⩽": "⩽", + "⪨": "⪨", + "⩿": "⩿", + "⪁": "⪁", + "⪃": "⪃", + "⋚︀": "⋚︀", + "⪓": "⪓", + "⪅": "⪅", + "⋖": "⋖", + "⋚": "⋚", + "⪋": "⪋", + "≶": "≶", + "≲": "≲", + "⥼": "⥼", + "⌊": "⌊", + "𝔩": "𝔩", + "≶": "≶", + "⪑": "⪑", + "↽": "↽", + "↼": "↼", + "⥪": "⥪", + "▄": "▄", + "љ": "љ", + "≪": "≪", + "⇇": "⇇", + "⌞": "⌞", + "⥫": "⥫", + "◺": "◺", + "ŀ": "ŀ", + "⎰": "⎰", + "⎰": "⎰", + "≨": "≨", + "⪉": "⪉", + "⪉": "⪉", + "⪇": "⪇", + "⪇": "⪇", + "≨": "≨", + "⋦": "⋦", + "⟬": "⟬", + "⇽": "⇽", + "⟦": "⟦", + "⟵": "⟵", + "⟷": "⟷", + "⟼": "⟼", + "⟶": "⟶", + "↫": "↫", + "↬": "↬", + "⦅": "⦅", + "𝕝": "𝕝", + "⨭": "⨭", + "⨴": "⨴", + "∗": "∗", + "_": "_", + "◊": "◊", + "◊": "◊", + "⧫": "⧫", + "(": "(", + "⦓": "⦓", + "⇆": "⇆", + "⌟": "⌟", + "⇋": "⇋", + "⥭": "⥭", + "‎": "‎", + "⊿": "⊿", + "‹": "‹", + "𝓁": "𝓁", + "↰": "↰", + "≲": "≲", + "⪍": "⪍", + "⪏": "⪏", + "[": "[", + "‘": "‘", + "‚": "‚", + "ł": "ł", + "<": "<", + "<": "<", + "⪦": "⪦", + "⩹": "⩹", + "⋖": "⋖", + "⋋": "⋋", + "⋉": "⋉", + "⥶": "⥶", + "⩻": "⩻", + "⦖": "⦖", + "◃": "◃", + "⊴": "⊴", + "◂": "◂", + "⥊": "⥊", + "⥦": "⥦", + "≨︀": "≨︀", + "≨︀": "≨︀", + "∺": "∺", + "¯": "¯", + "¯": "¯", + "♂": "♂", + "✠": "✠", + "✠": "✠", + "↦": "↦", + "↦": "↦", + "↧": "↧", + "↤": "↤", + "↥": "↥", + "▮": "▮", + "⨩": "⨩", + "м": "м", + "—": "—", + "∡": "∡", + "𝔪": "𝔪", + "℧": "℧", + "µ": "µ", + "µ": "µ", + "∣": "∣", + "*": "*", + "⫰": "⫰", + "·": "·", + "·": "·", + "−": "−", + "⊟": "⊟", + "∸": "∸", + "⨪": "⨪", + "⫛": "⫛", + "…": "…", + "∓": "∓", + "⊧": "⊧", + "𝕞": "𝕞", + "∓": "∓", + "𝓂": "𝓂", + "∾": "∾", + "μ": "μ", + "⊸": "⊸", + "⊸": "⊸", + "⋙̸": "⋙̸", + "≫⃒": "≫⃒", + "≫̸": "≫̸", + "⇍": "⇍", + "⇎": "⇎", + "⋘̸": "⋘̸", + "≪⃒": "≪⃒", + "≪̸": "≪̸", + "⇏": "⇏", + "⊯": "⊯", + "⊮": "⊮", + "∇": "∇", + "ń": "ń", + "∠⃒": "∠⃒", + "≉": "≉", + "⩰̸": "⩰̸", + "≋̸": "≋̸", + "ʼn": "ʼn", + "≉": "≉", + "♮": "♮", + "♮": "♮", + "ℕ": "ℕ", + " ": " ", + " ": " ", + "≎̸": "≎̸", + "≏̸": "≏̸", + "⩃": "⩃", + "ň": "ň", + "ņ": "ņ", + "≇": "≇", + "⩭̸": "⩭̸", + "⩂": "⩂", + "н": "н", + "–": "–", + "≠": "≠", + "⇗": "⇗", + "⤤": "⤤", + "↗": "↗", + "↗": "↗", + "≐̸": "≐̸", + "≢": "≢", + "⤨": "⤨", + "≂̸": "≂̸", + "∄": "∄", + "∄": "∄", + "𝔫": "𝔫", + "≧̸": "≧̸", + "≱": "≱", + "≱": "≱", + "≧̸": "≧̸", + "⩾̸": "⩾̸", + "⩾̸": "⩾̸", + "≵": "≵", + "≯": "≯", + "≯": "≯", + "⇎": "⇎", + "↮": "↮", + "⫲": "⫲", + "∋": "∋", + "⋼": "⋼", + "⋺": "⋺", + "∋": "∋", + "њ": "њ", + "⇍": "⇍", + "≦̸": "≦̸", + "↚": "↚", + "‥": "‥", + "≰": "≰", + "↚": "↚", + "↮": "↮", + "≰": "≰", + "≦̸": "≦̸", + "⩽̸": "⩽̸", + "⩽̸": "⩽̸", + "≮": "≮", + "≴": "≴", + "≮": "≮", + "⋪": "⋪", + "⋬": "⋬", + "∤": "∤", + "𝕟": "𝕟", + "¬": "¬", + "¬": "¬", + "∉": "∉", + "⋹̸": "⋹̸", + "⋵̸": "⋵̸", + "∉": "∉", + "⋷": "⋷", + "⋶": "⋶", + "∌": "∌", + "∌": "∌", + "⋾": "⋾", + "⋽": "⋽", + "∦": "∦", + "∦": "∦", + "⫽⃥": "⫽⃥", + "∂̸": "∂̸", + "⨔": "⨔", + "⊀": "⊀", + "⋠": "⋠", + "⪯̸": "⪯̸", + "⊀": "⊀", + "⪯̸": "⪯̸", + "⇏": "⇏", + "↛": "↛", + "⤳̸": "⤳̸", + "↝̸": "↝̸", + "↛": "↛", + "⋫": "⋫", + "⋭": "⋭", + "⊁": "⊁", + "⋡": "⋡", + "⪰̸": "⪰̸", + "𝓃": "𝓃", + "∤": "∤", + "∦": "∦", + "≁": "≁", + "≄": "≄", + "≄": "≄", + "∤": "∤", + "∦": "∦", + "⋢": "⋢", + "⋣": "⋣", + "⊄": "⊄", + "⫅̸": "⫅̸", + "⊈": "⊈", + "⊂⃒": "⊂⃒", + "⊈": "⊈", + "⫅̸": "⫅̸", + "⊁": "⊁", + "⪰̸": "⪰̸", + "⊅": "⊅", + "⫆̸": "⫆̸", + "⊉": "⊉", + "⊃⃒": "⊃⃒", + "⊉": "⊉", + "⫆̸": "⫆̸", + "≹": "≹", + "ñ": "ñ", + "ñ": "ñ", + "≸": "≸", + "⋪": "⋪", + "⋬": "⋬", + "⋫": "⋫", + "⋭": "⋭", + "ν": "ν", + "#": "#", + "№": "№", + " ": " ", + "⊭": "⊭", + "⤄": "⤄", + "≍⃒": "≍⃒", + "⊬": "⊬", + "≥⃒": "≥⃒", + ">⃒": ">⃒", + "⧞": "⧞", + "⤂": "⤂", + "≤⃒": "≤⃒", + "<⃒": "<⃒", + "⊴⃒": "⊴⃒", + "⤃": "⤃", + "⊵⃒": "⊵⃒", + "∼⃒": "∼⃒", + "⇖": "⇖", + "⤣": "⤣", + "↖": "↖", + "↖": "↖", + "⤧": "⤧", + "Ⓢ": "Ⓢ", + "ó": "ó", + "ó": "ó", + "⊛": "⊛", + "⊚": "⊚", + "ô": "ô", + "ô": "ô", + "о": "о", + "⊝": "⊝", + "ő": "ő", + "⨸": "⨸", + "⊙": "⊙", + "⦼": "⦼", + "œ": "œ", + "⦿": "⦿", + "𝔬": "𝔬", + "˛": "˛", + "ò": "ò", + "ò": "ò", + "⧁": "⧁", + "⦵": "⦵", + "Ω": "Ω", + "∮": "∮", + "↺": "↺", + "⦾": "⦾", + "⦻": "⦻", + "‾": "‾", + "⧀": "⧀", + "ō": "ō", + "ω": "ω", + "ο": "ο", + "⦶": "⦶", + "⊖": "⊖", + "𝕠": "𝕠", + "⦷": "⦷", + "⦹": "⦹", + "⊕": "⊕", + "∨": "∨", + "↻": "↻", + "⩝": "⩝", + "ℴ": "ℴ", + "ℴ": "ℴ", + "ª": "ª", + "ª": "ª", + "º": "º", + "º": "º", + "⊶": "⊶", + "⩖": "⩖", + "⩗": "⩗", + "⩛": "⩛", + "ℴ": "ℴ", + "ø": "ø", + "ø": "ø", + "⊘": "⊘", + "õ": "õ", + "õ": "õ", + "⊗": "⊗", + "⨶": "⨶", + "ö": "ö", + "ö": "ö", + "⌽": "⌽", + "∥": "∥", + "¶": "¶", + "¶": "¶", + "∥": "∥", + "⫳": "⫳", + "⫽": "⫽", + "∂": "∂", + "п": "п", + "%": "%", + ".": ".", + "‰": "‰", + "⊥": "⊥", + "‱": "‱", + "𝔭": "𝔭", + "φ": "φ", + "ϕ": "ϕ", + "ℳ": "ℳ", + "☎": "☎", + "π": "π", + "⋔": "⋔", + "ϖ": "ϖ", + "ℏ": "ℏ", + "ℎ": "ℎ", + "ℏ": "ℏ", + "+": "+", + "⨣": "⨣", + "⊞": "⊞", + "⨢": "⨢", + "∔": "∔", + "⨥": "⨥", + "⩲": "⩲", + "±": "±", + "±": "±", + "⨦": "⨦", + "⨧": "⨧", + "±": "±", + "⨕": "⨕", + "𝕡": "𝕡", + "£": "£", + "£": "£", + "≺": "≺", + "⪳": "⪳", + "⪷": "⪷", + "≼": "≼", + "⪯": "⪯", + "≺": "≺", + "⪷": "⪷", + "≼": "≼", + "⪯": "⪯", + "⪹": "⪹", + "⪵": "⪵", + "⋨": "⋨", + "≾": "≾", + "′": "′", + "ℙ": "ℙ", + "⪵": "⪵", + "⪹": "⪹", + "⋨": "⋨", + "∏": "∏", + "⌮": "⌮", + "⌒": "⌒", + "⌓": "⌓", + "∝": "∝", + "∝": "∝", + "≾": "≾", + "⊰": "⊰", + "𝓅": "𝓅", + "ψ": "ψ", + " ": " ", + "𝔮": "𝔮", + "⨌": "⨌", + "𝕢": "𝕢", + "⁗": "⁗", + "𝓆": "𝓆", + "ℍ": "ℍ", + "⨖": "⨖", + "?": "?", + "≟": "≟", + """: '"', + """: '"', + "⇛": "⇛", + "⇒": "⇒", + "⤜": "⤜", + "⤏": "⤏", + "⥤": "⥤", + "∽̱": "∽̱", + "ŕ": "ŕ", + "√": "√", + "⦳": "⦳", + "⟩": "⟩", + "⦒": "⦒", + "⦥": "⦥", + "⟩": "⟩", + "»": "»", + "»": "»", + "→": "→", + "⥵": "⥵", + "⇥": "⇥", + "⤠": "⤠", + "⤳": "⤳", + "⤞": "⤞", + "↪": "↪", + "↬": "↬", + "⥅": "⥅", + "⥴": "⥴", + "↣": "↣", + "↝": "↝", + "⤚": "⤚", + "∶": "∶", + "ℚ": "ℚ", + "⤍": "⤍", + "❳": "❳", + "}": "}", + "]": "]", + "⦌": "⦌", + "⦎": "⦎", + "⦐": "⦐", + "ř": "ř", + "ŗ": "ŗ", + "⌉": "⌉", + "}": "}", + "р": "р", + "⤷": "⤷", + "⥩": "⥩", + "”": "”", + "”": "”", + "↳": "↳", + "ℜ": "ℜ", + "ℛ": "ℛ", + "ℜ": "ℜ", + "ℝ": "ℝ", + "▭": "▭", + "®": "®", + "®": "®", + "⥽": "⥽", + "⌋": "⌋", + "𝔯": "𝔯", + "⇁": "⇁", + "⇀": "⇀", + "⥬": "⥬", + "ρ": "ρ", + "ϱ": "ϱ", + "→": "→", + "↣": "↣", + "⇁": "⇁", + "⇀": "⇀", + "⇄": "⇄", + "⇌": "⇌", + "⇉": "⇉", + "↝": "↝", + "⋌": "⋌", + "˚": "˚", + "≓": "≓", + "⇄": "⇄", + "⇌": "⇌", + "‏": "‏", + "⎱": "⎱", + "⎱": "⎱", + "⫮": "⫮", + "⟭": "⟭", + "⇾": "⇾", + "⟧": "⟧", + "⦆": "⦆", + "𝕣": "𝕣", + "⨮": "⨮", + "⨵": "⨵", + ")": ")", + "⦔": "⦔", + "⨒": "⨒", + "⇉": "⇉", + "›": "›", + "𝓇": "𝓇", + "↱": "↱", + "]": "]", + "’": "’", + "’": "’", + "⋌": "⋌", + "⋊": "⋊", + "▹": "▹", + "⊵": "⊵", + "▸": "▸", + "⧎": "⧎", + "⥨": "⥨", + "℞": "℞", + "ś": "ś", + "‚": "‚", + "≻": "≻", + "⪴": "⪴", + "⪸": "⪸", + "š": "š", + "≽": "≽", + "⪰": "⪰", + "ş": "ş", + "ŝ": "ŝ", + "⪶": "⪶", + "⪺": "⪺", + "⋩": "⋩", + "⨓": "⨓", + "≿": "≿", + "с": "с", + "⋅": "⋅", + "⊡": "⊡", + "⩦": "⩦", + "⇘": "⇘", + "⤥": "⤥", + "↘": "↘", + "↘": "↘", + "§": "§", + "§": "§", + ";": ";", + "⤩": "⤩", + "∖": "∖", + "∖": "∖", + "✶": "✶", + "𝔰": "𝔰", + "⌢": "⌢", + "♯": "♯", + "щ": "щ", + "ш": "ш", + "∣": "∣", + "∥": "∥", + "­": "­", + "­": "­", + "σ": "σ", + "ς": "ς", + "ς": "ς", + "∼": "∼", + "⩪": "⩪", + "≃": "≃", + "≃": "≃", + "⪞": "⪞", + "⪠": "⪠", + "⪝": "⪝", + "⪟": "⪟", + "≆": "≆", + "⨤": "⨤", + "⥲": "⥲", + "←": "←", + "∖": "∖", + "⨳": "⨳", + "⧤": "⧤", + "∣": "∣", + "⌣": "⌣", + "⪪": "⪪", + "⪬": "⪬", + "⪬︀": "⪬︀", + "ь": "ь", + "/": "/", + "⧄": "⧄", + "⌿": "⌿", + "𝕤": "𝕤", + "♠": "♠", + "♠": "♠", + "∥": "∥", + "⊓": "⊓", + "⊓︀": "⊓︀", + "⊔": "⊔", + "⊔︀": "⊔︀", + "⊏": "⊏", + "⊑": "⊑", + "⊏": "⊏", + "⊑": "⊑", + "⊐": "⊐", + "⊒": "⊒", + "⊐": "⊐", + "⊒": "⊒", + "□": "□", + "□": "□", + "▪": "▪", + "▪": "▪", + "→": "→", + "𝓈": "𝓈", + "∖": "∖", + "⌣": "⌣", + "⋆": "⋆", + "☆": "☆", + "★": "★", + "ϵ": "ϵ", + "ϕ": "ϕ", + "¯": "¯", + "⊂": "⊂", + "⫅": "⫅", + "⪽": "⪽", + "⊆": "⊆", + "⫃": "⫃", + "⫁": "⫁", + "⫋": "⫋", + "⊊": "⊊", + "⪿": "⪿", + "⥹": "⥹", + "⊂": "⊂", + "⊆": "⊆", + "⫅": "⫅", + "⊊": "⊊", + "⫋": "⫋", + "⫇": "⫇", + "⫕": "⫕", + "⫓": "⫓", + "≻": "≻", + "⪸": "⪸", + "≽": "≽", + "⪰": "⪰", + "⪺": "⪺", + "⪶": "⪶", + "⋩": "⋩", + "≿": "≿", + "∑": "∑", + "♪": "♪", + "¹": "¹", + "¹": "¹", + "²": "²", + "²": "²", + "³": "³", + "³": "³", + "⊃": "⊃", + "⫆": "⫆", + "⪾": "⪾", + "⫘": "⫘", + "⊇": "⊇", + "⫄": "⫄", + "⟉": "⟉", + "⫗": "⫗", + "⥻": "⥻", + "⫂": "⫂", + "⫌": "⫌", + "⊋": "⊋", + "⫀": "⫀", + "⊃": "⊃", + "⊇": "⊇", + "⫆": "⫆", + "⊋": "⊋", + "⫌": "⫌", + "⫈": "⫈", + "⫔": "⫔", + "⫖": "⫖", + "⇙": "⇙", + "⤦": "⤦", + "↙": "↙", + "↙": "↙", + "⤪": "⤪", + "ß": "ß", + "ß": "ß", + "⌖": "⌖", + "τ": "τ", + "⎴": "⎴", + "ť": "ť", + "ţ": "ţ", + "т": "т", + "⃛": "⃛", + "⌕": "⌕", + "𝔱": "𝔱", + "∴": "∴", + "∴": "∴", + "θ": "θ", + "ϑ": "ϑ", + "ϑ": "ϑ", + "≈": "≈", + "∼": "∼", + " ": " ", + "≈": "≈", + "∼": "∼", + "þ": "þ", + "þ": "þ", + "˜": "˜", + "×": "×", + "×": "×", + "⊠": "⊠", + "⨱": "⨱", + "⨰": "⨰", + "∭": "∭", + "⤨": "⤨", + "⊤": "⊤", + "⌶": "⌶", + "⫱": "⫱", + "𝕥": "𝕥", + "⫚": "⫚", + "⤩": "⤩", + "‴": "‴", + "™": "™", + "▵": "▵", + "▿": "▿", + "◃": "◃", + "⊴": "⊴", + "≜": "≜", + "▹": "▹", + "⊵": "⊵", + "◬": "◬", + "≜": "≜", + "⨺": "⨺", + "⨹": "⨹", + "⧍": "⧍", + "⨻": "⨻", + "⏢": "⏢", + "𝓉": "𝓉", + "ц": "ц", + "ћ": "ћ", + "ŧ": "ŧ", + "≬": "≬", + "↞": "↞", + "↠": "↠", + "⇑": "⇑", + "⥣": "⥣", + "ú": "ú", + "ú": "ú", + "↑": "↑", + "ў": "ў", + "ŭ": "ŭ", + "û": "û", + "û": "û", + "у": "у", + "⇅": "⇅", + "ű": "ű", + "⥮": "⥮", + "⥾": "⥾", + "𝔲": "𝔲", + "ù": "ù", + "ù": "ù", + "↿": "↿", + "↾": "↾", + "▀": "▀", + "⌜": "⌜", + "⌜": "⌜", + "⌏": "⌏", + "◸": "◸", + "ū": "ū", + "¨": "¨", + "¨": "¨", + "ų": "ų", + "𝕦": "𝕦", + "↑": "↑", + "↕": "↕", + "↿": "↿", + "↾": "↾", + "⊎": "⊎", + "υ": "υ", + "ϒ": "ϒ", + "υ": "υ", + "⇈": "⇈", + "⌝": "⌝", + "⌝": "⌝", + "⌎": "⌎", + "ů": "ů", + "◹": "◹", + "𝓊": "𝓊", + "⋰": "⋰", + "ũ": "ũ", + "▵": "▵", + "▴": "▴", + "⇈": "⇈", + "ü": "ü", + "ü": "ü", + "⦧": "⦧", + "⇕": "⇕", + "⫨": "⫨", + "⫩": "⫩", + "⊨": "⊨", + "⦜": "⦜", + "ϵ": "ϵ", + "ϰ": "ϰ", + "∅": "∅", + "ϕ": "ϕ", + "ϖ": "ϖ", + "∝": "∝", + "↕": "↕", + "ϱ": "ϱ", + "ς": "ς", + "⊊︀": "⊊︀", + "⫋︀": "⫋︀", + "⊋︀": "⊋︀", + "⫌︀": "⫌︀", + "ϑ": "ϑ", + "⊲": "⊲", + "⊳": "⊳", + "в": "в", + "⊢": "⊢", + "∨": "∨", + "⊻": "⊻", + "≚": "≚", + "⋮": "⋮", + "|": "|", + "|": "|", + "𝔳": "𝔳", + "⊲": "⊲", + "⊂⃒": "⊂⃒", + "⊃⃒": "⊃⃒", + "𝕧": "𝕧", + "∝": "∝", + "⊳": "⊳", + "𝓋": "𝓋", + "⫋︀": "⫋︀", + "⊊︀": "⊊︀", + "⫌︀": "⫌︀", + "⊋︀": "⊋︀", + "⦚": "⦚", + "ŵ": "ŵ", + "⩟": "⩟", + "∧": "∧", + "≙": "≙", + "℘": "℘", + "𝔴": "𝔴", + "𝕨": "𝕨", + "℘": "℘", + "≀": "≀", + "≀": "≀", + "𝓌": "𝓌", + "⋂": "⋂", + "◯": "◯", + "⋃": "⋃", + "▽": "▽", + "𝔵": "𝔵", + "⟺": "⟺", + "⟷": "⟷", + "ξ": "ξ", + "⟸": "⟸", + "⟵": "⟵", + "⟼": "⟼", + "⋻": "⋻", + "⨀": "⨀", + "𝕩": "𝕩", + "⨁": "⨁", + "⨂": "⨂", + "⟹": "⟹", + "⟶": "⟶", + "𝓍": "𝓍", + "⨆": "⨆", + "⨄": "⨄", + "△": "△", + "⋁": "⋁", + "⋀": "⋀", + "ý": "ý", + "ý": "ý", + "я": "я", + "ŷ": "ŷ", + "ы": "ы", + "¥": "¥", + "¥": "¥", + "𝔶": "𝔶", + "ї": "ї", + "𝕪": "𝕪", + "𝓎": "𝓎", + "ю": "ю", + "ÿ": "ÿ", + "ÿ": "ÿ", + "ź": "ź", + "ž": "ž", + "з": "з", + "ż": "ż", + "ℨ": "ℨ", + "ζ": "ζ", + "𝔷": "𝔷", + "ж": "ж", + "⇝": "⇝", + "𝕫": "𝕫", + "𝓏": "𝓏", + "‍": "‍", + "‌": "‌" + }, + characters: { + "Æ": "Æ", + "&": "&", + "Á": "Á", + "Ă": "Ă", + "Â": "Â", + "А": "А", + "𝔄": "𝔄", + "À": "À", + "Α": "Α", + "Ā": "Ā", + "⩓": "⩓", + "Ą": "Ą", + "𝔸": "𝔸", + "⁡": "⁡", + "Å": "Å", + "𝒜": "𝒜", + "≔": "≔", + "Ã": "Ã", + "Ä": "Ä", + "∖": "∖", + "⫧": "⫧", + "⌆": "⌆", + "Б": "Б", + "∵": "∵", + "ℬ": "ℬ", + "Β": "Β", + "𝔅": "𝔅", + "𝔹": "𝔹", + "˘": "˘", + "≎": "≎", + "Ч": "Ч", + "©": "©", + "Ć": "Ć", + "⋒": "⋒", + "ⅅ": "ⅅ", + "ℭ": "ℭ", + "Č": "Č", + "Ç": "Ç", + "Ĉ": "Ĉ", + "∰": "∰", + "Ċ": "Ċ", + "¸": "¸", + "·": "·", + "Χ": "Χ", + "⊙": "⊙", + "⊖": "⊖", + "⊕": "⊕", + "⊗": "⊗", + "∲": "∲", + "”": "”", + "’": "’", + "∷": "∷", + "⩴": "⩴", + "≡": "≡", + "∯": "∯", + "∮": "∮", + "ℂ": "ℂ", + "∐": "∐", + "∳": "∳", + "⨯": "⨯", + "𝒞": "𝒞", + "⋓": "⋓", + "≍": "≍", + "⤑": "⤑", + "Ђ": "Ђ", + "Ѕ": "Ѕ", + "Џ": "Џ", + "‡": "‡", + "↡": "↡", + "⫤": "⫤", + "Ď": "Ď", + "Д": "Д", + "∇": "∇", + "Δ": "Δ", + "𝔇": "𝔇", + "´": "´", + "˙": "˙", + "˝": "˝", + "`": "`", + "˜": "˜", + "⋄": "⋄", + "ⅆ": "ⅆ", + "𝔻": "𝔻", + "¨": "¨", + "⃜": "⃜", + "≐": "≐", + "⇓": "⇓", + "⇐": "⇐", + "⇔": "⇔", + "⟸": "⟸", + "⟺": "⟺", + "⟹": "⟹", + "⇒": "⇒", + "⊨": "⊨", + "⇑": "⇑", + "⇕": "⇕", + "∥": "∥", + "↓": "↓", + "⤓": "⤓", + "⇵": "⇵", + "̑": "̑", + "⥐": "⥐", + "⥞": "⥞", + "↽": "↽", + "⥖": "⥖", + "⥟": "⥟", + "⇁": "⇁", + "⥗": "⥗", + "⊤": "⊤", + "↧": "↧", + "𝒟": "𝒟", + "Đ": "Đ", + "Ŋ": "Ŋ", + "Ð": "Ð", + "É": "É", + "Ě": "Ě", + "Ê": "Ê", + "Э": "Э", + "Ė": "Ė", + "𝔈": "𝔈", + "È": "È", + "∈": "∈", + "Ē": "Ē", + "◻": "◻", + "▫": "▫", + "Ę": "Ę", + "𝔼": "𝔼", + "Ε": "Ε", + "⩵": "⩵", + "≂": "≂", + "⇌": "⇌", + "ℰ": "ℰ", + "⩳": "⩳", + "Η": "Η", + "Ë": "Ë", + "∃": "∃", + "ⅇ": "ⅇ", + "Ф": "Ф", + "𝔉": "𝔉", + "◼": "◼", + "▪": "▪", + "𝔽": "𝔽", + "∀": "∀", + "ℱ": "ℱ", + "Ѓ": "Ѓ", + ">": ">", + "Γ": "Γ", + "Ϝ": "Ϝ", + "Ğ": "Ğ", + "Ģ": "Ģ", + "Ĝ": "Ĝ", + "Г": "Г", + "Ġ": "Ġ", + "𝔊": "𝔊", + "⋙": "⋙", + "𝔾": "𝔾", + "≥": "≥", + "⋛": "⋛", + "≧": "≧", + "⪢": "⪢", + "≷": "≷", + "⩾": "⩾", + "≳": "≳", + "𝒢": "𝒢", + "≫": "≫", + "Ъ": "Ъ", + "ˇ": "ˇ", + "^": "^", + "Ĥ": "Ĥ", + "ℌ": "ℌ", + "ℋ": "ℋ", + "ℍ": "ℍ", + "─": "─", + "Ħ": "Ħ", + "≏": "≏", + "Е": "Е", + "IJ": "IJ", + "Ё": "Ё", + "Í": "Í", + "Î": "Î", + "И": "И", + "İ": "İ", + "ℑ": "ℑ", + "Ì": "Ì", + "Ī": "Ī", + "ⅈ": "ⅈ", + "∬": "∬", + "∫": "∫", + "⋂": "⋂", + "⁣": "⁣", + "⁢": "⁢", + "Į": "Į", + "𝕀": "𝕀", + "Ι": "Ι", + "ℐ": "ℐ", + "Ĩ": "Ĩ", + "І": "І", + "Ï": "Ï", + "Ĵ": "Ĵ", + "Й": "Й", + "𝔍": "𝔍", + "𝕁": "𝕁", + "𝒥": "𝒥", + "Ј": "Ј", + "Є": "Є", + "Х": "Х", + "Ќ": "Ќ", + "Κ": "Κ", + "Ķ": "Ķ", + "К": "К", + "𝔎": "𝔎", + "𝕂": "𝕂", + "𝒦": "𝒦", + "Љ": "Љ", + "<": "<", + "Ĺ": "Ĺ", + "Λ": "Λ", + "⟪": "⟪", + "ℒ": "ℒ", + "↞": "↞", + "Ľ": "Ľ", + "Ļ": "Ļ", + "Л": "Л", + "⟨": "⟨", + "←": "←", + "⇤": "⇤", + "⇆": "⇆", + "⌈": "⌈", + "⟦": "⟦", + "⥡": "⥡", + "⇃": "⇃", + "⥙": "⥙", + "⌊": "⌊", + "↔": "↔", + "⥎": "⥎", + "⊣": "⊣", + "↤": "↤", + "⥚": "⥚", + "⊲": "⊲", + "⧏": "⧏", + "⊴": "⊴", + "⥑": "⥑", + "⥠": "⥠", + "↿": "↿", + "⥘": "⥘", + "↼": "↼", + "⥒": "⥒", + "⋚": "⋚", + "≦": "≦", + "≶": "≶", + "⪡": "⪡", + "⩽": "⩽", + "≲": "≲", + "𝔏": "𝔏", + "⋘": "⋘", + "⇚": "⇚", + "Ŀ": "Ŀ", + "⟵": "⟵", + "⟷": "⟷", + "⟶": "⟶", + "𝕃": "𝕃", + "↙": "↙", + "↘": "↘", + "↰": "↰", + "Ł": "Ł", + "≪": "≪", + "⤅": "⤅", + "М": "М", + " ": " ", + "ℳ": "ℳ", + "𝔐": "𝔐", + "∓": "∓", + "𝕄": "𝕄", + "Μ": "Μ", + "Њ": "Њ", + "Ń": "Ń", + "Ň": "Ň", + "Ņ": "Ņ", + "Н": "Н", + "​": "​", + "\n": " ", + "𝔑": "𝔑", + "⁠": "⁠", + " ": " ", + "ℕ": "ℕ", + "⫬": "⫬", + "≢": "≢", + "≭": "≭", + "∦": "∦", + "∉": "∉", + "≠": "≠", + "≂̸": "≂̸", + "∄": "∄", + "≯": "≯", + "≱": "≱", + "≧̸": "≧̸", + "≫̸": "≫̸", + "≹": "≹", + "⩾̸": "⩾̸", + "≵": "≵", + "≎̸": "≎̸", + "≏̸": "≏̸", + "⋪": "⋪", + "⧏̸": "⧏̸", + "⋬": "⋬", + "≮": "≮", + "≰": "≰", + "≸": "≸", + "≪̸": "≪̸", + "⩽̸": "⩽̸", + "≴": "≴", + "⪢̸": "⪢̸", + "⪡̸": "⪡̸", + "⊀": "⊀", + "⪯̸": "⪯̸", + "⋠": "⋠", + "∌": "∌", + "⋫": "⋫", + "⧐̸": "⧐̸", + "⋭": "⋭", + "⊏̸": "⊏̸", + "⋢": "⋢", + "⊐̸": "⊐̸", + "⋣": "⋣", + "⊂⃒": "⊂⃒", + "⊈": "⊈", + "⊁": "⊁", + "⪰̸": "⪰̸", + "⋡": "⋡", + "≿̸": "≿̸", + "⊃⃒": "⊃⃒", + "⊉": "⊉", + "≁": "≁", + "≄": "≄", + "≇": "≇", + "≉": "≉", + "∤": "∤", + "𝒩": "𝒩", + "Ñ": "Ñ", + "Ν": "Ν", + "Œ": "Œ", + "Ó": "Ó", + "Ô": "Ô", + "О": "О", + "Ő": "Ő", + "𝔒": "𝔒", + "Ò": "Ò", + "Ō": "Ō", + "Ω": "Ω", + "Ο": "Ο", + "𝕆": "𝕆", + "“": "“", + "‘": "‘", + "⩔": "⩔", + "𝒪": "𝒪", + "Ø": "Ø", + "Õ": "Õ", + "⨷": "⨷", + "Ö": "Ö", + "‾": "‾", + "⏞": "⏞", + "⎴": "⎴", + "⏜": "⏜", + "∂": "∂", + "П": "П", + "𝔓": "𝔓", + "Φ": "Φ", + "Π": "Π", + "±": "±", + "ℙ": "ℙ", + "⪻": "⪻", + "≺": "≺", + "⪯": "⪯", + "≼": "≼", + "≾": "≾", + "″": "″", + "∏": "∏", + "∝": "∝", + "𝒫": "𝒫", + "Ψ": "Ψ", + '"': """, + "𝔔": "𝔔", + "ℚ": "ℚ", + "𝒬": "𝒬", + "⤐": "⤐", + "®": "®", + "Ŕ": "Ŕ", + "⟫": "⟫", + "↠": "↠", + "⤖": "⤖", + "Ř": "Ř", + "Ŗ": "Ŗ", + "Р": "Р", + "ℜ": "ℜ", + "∋": "∋", + "⇋": "⇋", + "⥯": "⥯", + "Ρ": "Ρ", + "⟩": "⟩", + "→": "→", + "⇥": "⇥", + "⇄": "⇄", + "⌉": "⌉", + "⟧": "⟧", + "⥝": "⥝", + "⇂": "⇂", + "⥕": "⥕", + "⌋": "⌋", + "⊢": "⊢", + "↦": "↦", + "⥛": "⥛", + "⊳": "⊳", + "⧐": "⧐", + "⊵": "⊵", + "⥏": "⥏", + "⥜": "⥜", + "↾": "↾", + "⥔": "⥔", + "⇀": "⇀", + "⥓": "⥓", + "ℝ": "ℝ", + "⥰": "⥰", + "⇛": "⇛", + "ℛ": "ℛ", + "↱": "↱", + "⧴": "⧴", + "Щ": "Щ", + "Ш": "Ш", + "Ь": "Ь", + "Ś": "Ś", + "⪼": "⪼", + "Š": "Š", + "Ş": "Ş", + "Ŝ": "Ŝ", + "С": "С", + "𝔖": "𝔖", + "↑": "↑", + "Σ": "Σ", + "∘": "∘", + "𝕊": "𝕊", + "√": "√", + "□": "□", + "⊓": "⊓", + "⊏": "⊏", + "⊑": "⊑", + "⊐": "⊐", + "⊒": "⊒", + "⊔": "⊔", + "𝒮": "𝒮", + "⋆": "⋆", + "⋐": "⋐", + "⊆": "⊆", + "≻": "≻", + "⪰": "⪰", + "≽": "≽", + "≿": "≿", + "∑": "∑", + "⋑": "⋑", + "⊃": "⊃", + "⊇": "⊇", + "Þ": "Þ", + "™": "™", + "Ћ": "Ћ", + "Ц": "Ц", + "\t": " ", + "Τ": "Τ", + "Ť": "Ť", + "Ţ": "Ţ", + "Т": "Т", + "𝔗": "𝔗", + "∴": "∴", + "Θ": "Θ", + "  ": "  ", + " ": " ", + "∼": "∼", + "≃": "≃", + "≅": "≅", + "≈": "≈", + "𝕋": "𝕋", + "⃛": "⃛", + "𝒯": "𝒯", + "Ŧ": "Ŧ", + "Ú": "Ú", + "↟": "↟", + "⥉": "⥉", + "Ў": "Ў", + "Ŭ": "Ŭ", + "Û": "Û", + "У": "У", + "Ű": "Ű", + "𝔘": "𝔘", + "Ù": "Ù", + "Ū": "Ū", + _: "_", + "⏟": "⏟", + "⎵": "⎵", + "⏝": "⏝", + "⋃": "⋃", + "⊎": "⊎", + "Ų": "Ų", + "𝕌": "𝕌", + "⤒": "⤒", + "⇅": "⇅", + "↕": "↕", + "⥮": "⥮", + "⊥": "⊥", + "↥": "↥", + "↖": "↖", + "↗": "↗", + "ϒ": "ϒ", + "Υ": "Υ", + "Ů": "Ů", + "𝒰": "𝒰", + "Ũ": "Ũ", + "Ü": "Ü", + "⊫": "⊫", + "⫫": "⫫", + "В": "В", + "⊩": "⊩", + "⫦": "⫦", + "⋁": "⋁", + "‖": "‖", + "∣": "∣", + "|": "|", + "❘": "❘", + "≀": "≀", + " ": " ", + "𝔙": "𝔙", + "𝕍": "𝕍", + "𝒱": "𝒱", + "⊪": "⊪", + "Ŵ": "Ŵ", + "⋀": "⋀", + "𝔚": "𝔚", + "𝕎": "𝕎", + "𝒲": "𝒲", + "𝔛": "𝔛", + "Ξ": "Ξ", + "𝕏": "𝕏", + "𝒳": "𝒳", + "Я": "Я", + "Ї": "Ї", + "Ю": "Ю", + "Ý": "Ý", + "Ŷ": "Ŷ", + "Ы": "Ы", + "𝔜": "𝔜", + "𝕐": "𝕐", + "𝒴": "𝒴", + "Ÿ": "Ÿ", + "Ж": "Ж", + "Ź": "Ź", + "Ž": "Ž", + "З": "З", + "Ż": "Ż", + "Ζ": "Ζ", + "ℨ": "ℨ", + "ℤ": "ℤ", + "𝒵": "𝒵", + "á": "á", + "ă": "ă", + "∾": "∾", + "∾̳": "∾̳", + "∿": "∿", + "â": "â", + "а": "а", + "æ": "æ", + "𝔞": "𝔞", + "à": "à", + "ℵ": "ℵ", + "α": "α", + "ā": "ā", + "⨿": "⨿", + "∧": "∧", + "⩕": "⩕", + "⩜": "⩜", + "⩘": "⩘", + "⩚": "⩚", + "∠": "∠", + "⦤": "⦤", + "∡": "∡", + "⦨": "⦨", + "⦩": "⦩", + "⦪": "⦪", + "⦫": "⦫", + "⦬": "⦬", + "⦭": "⦭", + "⦮": "⦮", + "⦯": "⦯", + "∟": "∟", + "⊾": "⊾", + "⦝": "⦝", + "∢": "∢", + "⍼": "⍼", + "ą": "ą", + "𝕒": "𝕒", + "⩰": "⩰", + "⩯": "⩯", + "≊": "≊", + "≋": "≋", + "'": "'", + "å": "å", + "𝒶": "𝒶", + "*": "*", + "ã": "ã", + "ä": "ä", + "⨑": "⨑", + "⫭": "⫭", + "≌": "≌", + "϶": "϶", + "‵": "‵", + "∽": "∽", + "⋍": "⋍", + "⊽": "⊽", + "⌅": "⌅", + "⎶": "⎶", + "б": "б", + "„": "„", + "⦰": "⦰", + "β": "β", + "ℶ": "ℶ", + "≬": "≬", + "𝔟": "𝔟", + "◯": "◯", + "⨀": "⨀", + "⨁": "⨁", + "⨂": "⨂", + "⨆": "⨆", + "★": "★", + "▽": "▽", + "△": "△", + "⨄": "⨄", + "⤍": "⤍", + "⧫": "⧫", + "▴": "▴", + "▾": "▾", + "◂": "◂", + "▸": "▸", + "␣": "␣", + "▒": "▒", + "░": "░", + "▓": "▓", + "█": "█", + "=⃥": "=⃥", + "≡⃥": "≡⃥", + "⌐": "⌐", + "𝕓": "𝕓", + "⋈": "⋈", + "╗": "╗", + "╔": "╔", + "╖": "╖", + "╓": "╓", + "═": "═", + "╦": "╦", + "╩": "╩", + "╤": "╤", + "╧": "╧", + "╝": "╝", + "╚": "╚", + "╜": "╜", + "╙": "╙", + "║": "║", + "╬": "╬", + "╣": "╣", + "╠": "╠", + "╫": "╫", + "╢": "╢", + "╟": "╟", + "⧉": "⧉", + "╕": "╕", + "╒": "╒", + "┐": "┐", + "┌": "┌", + "╥": "╥", + "╨": "╨", + "┬": "┬", + "┴": "┴", + "⊟": "⊟", + "⊞": "⊞", + "⊠": "⊠", + "╛": "╛", + "╘": "╘", + "┘": "┘", + "└": "└", + "│": "│", + "╪": "╪", + "╡": "╡", + "╞": "╞", + "┼": "┼", + "┤": "┤", + "├": "├", + "¦": "¦", + "𝒷": "𝒷", + "⁏": "⁏", + "\\": "\", + "⧅": "⧅", + "⟈": "⟈", + "•": "•", + "⪮": "⪮", + "ć": "ć", + "∩": "∩", + "⩄": "⩄", + "⩉": "⩉", + "⩋": "⩋", + "⩇": "⩇", + "⩀": "⩀", + "∩︀": "∩︀", + "⁁": "⁁", + "⩍": "⩍", + "č": "č", + "ç": "ç", + "ĉ": "ĉ", + "⩌": "⩌", + "⩐": "⩐", + "ċ": "ċ", + "⦲": "⦲", + "¢": "¢", + "𝔠": "𝔠", + "ч": "ч", + "✓": "✓", + "χ": "χ", + "○": "○", + "⧃": "⧃", + "ˆ": "ˆ", + "≗": "≗", + "↺": "↺", + "↻": "↻", + "Ⓢ": "Ⓢ", + "⊛": "⊛", + "⊚": "⊚", + "⊝": "⊝", + "⨐": "⨐", + "⫯": "⫯", + "⧂": "⧂", + "♣": "♣", + ":": ":", + ",": ",", + "@": "@", + "∁": "∁", + "⩭": "⩭", + "𝕔": "𝕔", + "℗": "℗", + "↵": "↵", + "✗": "✗", + "𝒸": "𝒸", + "⫏": "⫏", + "⫑": "⫑", + "⫐": "⫐", + "⫒": "⫒", + "⋯": "⋯", + "⤸": "⤸", + "⤵": "⤵", + "⋞": "⋞", + "⋟": "⋟", + "↶": "↶", + "⤽": "⤽", + "∪": "∪", + "⩈": "⩈", + "⩆": "⩆", + "⩊": "⩊", + "⊍": "⊍", + "⩅": "⩅", + "∪︀": "∪︀", + "↷": "↷", + "⤼": "⤼", + "⋎": "⋎", + "⋏": "⋏", + "¤": "¤", + "∱": "∱", + "⌭": "⌭", + "⥥": "⥥", + "†": "†", + "ℸ": "ℸ", + "‐": "‐", + "⤏": "⤏", + "ď": "ď", + "д": "д", + "⇊": "⇊", + "⩷": "⩷", + "°": "°", + "δ": "δ", + "⦱": "⦱", + "⥿": "⥿", + "𝔡": "𝔡", + "♦": "♦", + "ϝ": "ϝ", + "⋲": "⋲", + "÷": "÷", + "⋇": "⋇", + "ђ": "ђ", + "⌞": "⌞", + "⌍": "⌍", + $: "$", + "𝕕": "𝕕", + "≑": "≑", + "∸": "∸", + "∔": "∔", + "⊡": "⊡", + "⌟": "⌟", + "⌌": "⌌", + "𝒹": "𝒹", + "ѕ": "ѕ", + "⧶": "⧶", + "đ": "đ", + "⋱": "⋱", + "▿": "▿", + "⦦": "⦦", + "џ": "џ", + "⟿": "⟿", + "é": "é", + "⩮": "⩮", + "ě": "ě", + "≖": "≖", + "ê": "ê", + "≕": "≕", + "э": "э", + "ė": "ė", + "≒": "≒", + "𝔢": "𝔢", + "⪚": "⪚", + "è": "è", + "⪖": "⪖", + "⪘": "⪘", + "⪙": "⪙", + "⏧": "⏧", + "ℓ": "ℓ", + "⪕": "⪕", + "⪗": "⪗", + "ē": "ē", + "∅": "∅", + " ": " ", + " ": " ", + " ": " ", + "ŋ": "ŋ", + " ": " ", + "ę": "ę", + "𝕖": "𝕖", + "⋕": "⋕", + "⧣": "⧣", + "⩱": "⩱", + "ε": "ε", + "ϵ": "ϵ", + "=": "=", + "≟": "≟", + "⩸": "⩸", + "⧥": "⧥", + "≓": "≓", + "⥱": "⥱", + "ℯ": "ℯ", + "η": "η", + "ð": "ð", + "ë": "ë", + "€": "€", + "!": "!", + "ф": "ф", + "♀": "♀", + "ffi": "ffi", + "ff": "ff", + "ffl": "ffl", + "𝔣": "𝔣", + "fi": "fi", + fj: "fj", + "♭": "♭", + "fl": "fl", + "▱": "▱", + "ƒ": "ƒ", + "𝕗": "𝕗", + "⋔": "⋔", + "⫙": "⫙", + "⨍": "⨍", + "½": "½", + "⅓": "⅓", + "¼": "¼", + "⅕": "⅕", + "⅙": "⅙", + "⅛": "⅛", + "⅔": "⅔", + "⅖": "⅖", + "¾": "¾", + "⅗": "⅗", + "⅜": "⅜", + "⅘": "⅘", + "⅚": "⅚", + "⅝": "⅝", + "⅞": "⅞", + "⁄": "⁄", + "⌢": "⌢", + "𝒻": "𝒻", + "⪌": "⪌", + "ǵ": "ǵ", + "γ": "γ", + "⪆": "⪆", + "ğ": "ğ", + "ĝ": "ĝ", + "г": "г", + "ġ": "ġ", + "⪩": "⪩", + "⪀": "⪀", + "⪂": "⪂", + "⪄": "⪄", + "⋛︀": "⋛︀", + "⪔": "⪔", + "𝔤": "𝔤", + "ℷ": "ℷ", + "ѓ": "ѓ", + "⪒": "⪒", + "⪥": "⪥", + "⪤": "⪤", + "≩": "≩", + "⪊": "⪊", + "⪈": "⪈", + "⋧": "⋧", + "𝕘": "𝕘", + "ℊ": "ℊ", + "⪎": "⪎", + "⪐": "⪐", + "⪧": "⪧", + "⩺": "⩺", + "⋗": "⋗", + "⦕": "⦕", + "⩼": "⩼", + "⥸": "⥸", + "≩︀": "≩︀", + "ъ": "ъ", + "⥈": "⥈", + "↭": "↭", + "ℏ": "ℏ", + "ĥ": "ĥ", + "♥": "♥", + "…": "…", + "⊹": "⊹", + "𝔥": "𝔥", + "⤥": "⤥", + "⤦": "⤦", + "⇿": "⇿", + "∻": "∻", + "↩": "↩", + "↪": "↪", + "𝕙": "𝕙", + "―": "―", + "𝒽": "𝒽", + "ħ": "ħ", + "⁃": "⁃", + "í": "í", + "î": "î", + "и": "и", + "е": "е", + "¡": "¡", + "𝔦": "𝔦", + "ì": "ì", + "⨌": "⨌", + "∭": "∭", + "⧜": "⧜", + "℩": "℩", + "ij": "ij", + "ī": "ī", + "ı": "ı", + "⊷": "⊷", + "Ƶ": "Ƶ", + "℅": "℅", + "∞": "∞", + "⧝": "⧝", + "⊺": "⊺", + "⨗": "⨗", + "⨼": "⨼", + "ё": "ё", + "į": "į", + "𝕚": "𝕚", + "ι": "ι", + "¿": "¿", + "𝒾": "𝒾", + "⋹": "⋹", + "⋵": "⋵", + "⋴": "⋴", + "⋳": "⋳", + "ĩ": "ĩ", + "і": "і", + "ï": "ï", + "ĵ": "ĵ", + "й": "й", + "𝔧": "𝔧", + "ȷ": "ȷ", + "𝕛": "𝕛", + "𝒿": "𝒿", + "ј": "ј", + "є": "є", + "κ": "κ", + "ϰ": "ϰ", + "ķ": "ķ", + "к": "к", + "𝔨": "𝔨", + "ĸ": "ĸ", + "х": "х", + "ќ": "ќ", + "𝕜": "𝕜", + "𝓀": "𝓀", + "⤛": "⤛", + "⤎": "⤎", + "⪋": "⪋", + "⥢": "⥢", + "ĺ": "ĺ", + "⦴": "⦴", + "λ": "λ", + "⦑": "⦑", + "⪅": "⪅", + "«": "«", + "⤟": "⤟", + "⤝": "⤝", + "↫": "↫", + "⤹": "⤹", + "⥳": "⥳", + "↢": "↢", + "⪫": "⪫", + "⤙": "⤙", + "⪭": "⪭", + "⪭︀": "⪭︀", + "⤌": "⤌", + "❲": "❲", + "{": "{", + "[": "[", + "⦋": "⦋", + "⦏": "⦏", + "⦍": "⦍", + "ľ": "ľ", + "ļ": "ļ", + "л": "л", + "⤶": "⤶", + "⥧": "⥧", + "⥋": "⥋", + "↲": "↲", + "≤": "≤", + "⇇": "⇇", + "⋋": "⋋", + "⪨": "⪨", + "⩿": "⩿", + "⪁": "⪁", + "⪃": "⪃", + "⋚︀": "⋚︀", + "⪓": "⪓", + "⋖": "⋖", + "⥼": "⥼", + "𝔩": "𝔩", + "⪑": "⪑", + "⥪": "⥪", + "▄": "▄", + "љ": "љ", + "⥫": "⥫", + "◺": "◺", + "ŀ": "ŀ", + "⎰": "⎰", + "≨": "≨", + "⪉": "⪉", + "⪇": "⪇", + "⋦": "⋦", + "⟬": "⟬", + "⇽": "⇽", + "⟼": "⟼", + "↬": "↬", + "⦅": "⦅", + "𝕝": "𝕝", + "⨭": "⨭", + "⨴": "⨴", + "∗": "∗", + "◊": "◊", + "(": "(", + "⦓": "⦓", + "⥭": "⥭", + "‎": "‎", + "⊿": "⊿", + "‹": "‹", + "𝓁": "𝓁", + "⪍": "⪍", + "⪏": "⪏", + "‚": "‚", + "ł": "ł", + "⪦": "⪦", + "⩹": "⩹", + "⋉": "⋉", + "⥶": "⥶", + "⩻": "⩻", + "⦖": "⦖", + "◃": "◃", + "⥊": "⥊", + "⥦": "⥦", + "≨︀": "≨︀", + "∺": "∺", + "¯": "¯", + "♂": "♂", + "✠": "✠", + "▮": "▮", + "⨩": "⨩", + "м": "м", + "—": "—", + "𝔪": "𝔪", + "℧": "℧", + "µ": "µ", + "⫰": "⫰", + "−": "−", + "⨪": "⨪", + "⫛": "⫛", + "⊧": "⊧", + "𝕞": "𝕞", + "𝓂": "𝓂", + "μ": "μ", + "⊸": "⊸", + "⋙̸": "⋙̸", + "≫⃒": "≫⃒", + "⇍": "⇍", + "⇎": "⇎", + "⋘̸": "⋘̸", + "≪⃒": "≪⃒", + "⇏": "⇏", + "⊯": "⊯", + "⊮": "⊮", + "ń": "ń", + "∠⃒": "∠⃒", + "⩰̸": "⩰̸", + "≋̸": "≋̸", + "ʼn": "ʼn", + "♮": "♮", + "⩃": "⩃", + "ň": "ň", + "ņ": "ņ", + "⩭̸": "⩭̸", + "⩂": "⩂", + "н": "н", + "–": "–", + "⇗": "⇗", + "⤤": "⤤", + "≐̸": "≐̸", + "⤨": "⤨", + "𝔫": "𝔫", + "↮": "↮", + "⫲": "⫲", + "⋼": "⋼", + "⋺": "⋺", + "њ": "њ", + "≦̸": "≦̸", + "↚": "↚", + "‥": "‥", + "𝕟": "𝕟", + "¬": "¬", + "⋹̸": "⋹̸", + "⋵̸": "⋵̸", + "⋷": "⋷", + "⋶": "⋶", + "⋾": "⋾", + "⋽": "⋽", + "⫽⃥": "⫽⃥", + "∂̸": "∂̸", + "⨔": "⨔", + "↛": "↛", + "⤳̸": "⤳̸", + "↝̸": "↝̸", + "𝓃": "𝓃", + "⊄": "⊄", + "⫅̸": "⫅̸", + "⊅": "⊅", + "⫆̸": "⫆̸", + "ñ": "ñ", + "ν": "ν", + "#": "#", + "№": "№", + " ": " ", + "⊭": "⊭", + "⤄": "⤄", + "≍⃒": "≍⃒", + "⊬": "⊬", + "≥⃒": "≥⃒", + ">⃒": ">⃒", + "⧞": "⧞", + "⤂": "⤂", + "≤⃒": "≤⃒", + "<⃒": "<⃒", + "⊴⃒": "⊴⃒", + "⤃": "⤃", + "⊵⃒": "⊵⃒", + "∼⃒": "∼⃒", + "⇖": "⇖", + "⤣": "⤣", + "⤧": "⤧", + "ó": "ó", + "ô": "ô", + "о": "о", + "ő": "ő", + "⨸": "⨸", + "⦼": "⦼", + "œ": "œ", + "⦿": "⦿", + "𝔬": "𝔬", + "˛": "˛", + "ò": "ò", + "⧁": "⧁", + "⦵": "⦵", + "⦾": "⦾", + "⦻": "⦻", + "⧀": "⧀", + "ō": "ō", + "ω": "ω", + "ο": "ο", + "⦶": "⦶", + "𝕠": "𝕠", + "⦷": "⦷", + "⦹": "⦹", + "∨": "∨", + "⩝": "⩝", + "ℴ": "ℴ", + "ª": "ª", + "º": "º", + "⊶": "⊶", + "⩖": "⩖", + "⩗": "⩗", + "⩛": "⩛", + "ø": "ø", + "⊘": "⊘", + "õ": "õ", + "⨶": "⨶", + "ö": "ö", + "⌽": "⌽", + "¶": "¶", + "⫳": "⫳", + "⫽": "⫽", + "п": "п", + "%": "%", + ".": ".", + "‰": "‰", + "‱": "‱", + "𝔭": "𝔭", + "φ": "φ", + "ϕ": "ϕ", + "☎": "☎", + "π": "π", + "ϖ": "ϖ", + "ℎ": "ℎ", + "+": "+", + "⨣": "⨣", + "⨢": "⨢", + "⨥": "⨥", + "⩲": "⩲", + "⨦": "⨦", + "⨧": "⨧", + "⨕": "⨕", + "𝕡": "𝕡", + "£": "£", + "⪳": "⪳", + "⪷": "⪷", + "⪹": "⪹", + "⪵": "⪵", + "⋨": "⋨", + "′": "′", + "⌮": "⌮", + "⌒": "⌒", + "⌓": "⌓", + "⊰": "⊰", + "𝓅": "𝓅", + "ψ": "ψ", + " ": " ", + "𝔮": "𝔮", + "𝕢": "𝕢", + "⁗": "⁗", + "𝓆": "𝓆", + "⨖": "⨖", + "?": "?", + "⤜": "⤜", + "⥤": "⥤", + "∽̱": "∽̱", + "ŕ": "ŕ", + "⦳": "⦳", + "⦒": "⦒", + "⦥": "⦥", + "»": "»", + "⥵": "⥵", + "⤠": "⤠", + "⤳": "⤳", + "⤞": "⤞", + "⥅": "⥅", + "⥴": "⥴", + "↣": "↣", + "↝": "↝", + "⤚": "⤚", + "∶": "∶", + "❳": "❳", + "}": "}", + "]": "]", + "⦌": "⦌", + "⦎": "⦎", + "⦐": "⦐", + "ř": "ř", + "ŗ": "ŗ", + "р": "р", + "⤷": "⤷", + "⥩": "⥩", + "↳": "↳", + "▭": "▭", + "⥽": "⥽", + "𝔯": "𝔯", + "⥬": "⥬", + "ρ": "ρ", + "ϱ": "ϱ", + "⇉": "⇉", + "⋌": "⋌", + "˚": "˚", + "‏": "‏", + "⎱": "⎱", + "⫮": "⫮", + "⟭": "⟭", + "⇾": "⇾", + "⦆": "⦆", + "𝕣": "𝕣", + "⨮": "⨮", + "⨵": "⨵", + ")": ")", + "⦔": "⦔", + "⨒": "⨒", + "›": "›", + "𝓇": "𝓇", + "⋊": "⋊", + "▹": "▹", + "⧎": "⧎", + "⥨": "⥨", + "℞": "℞", + "ś": "ś", + "⪴": "⪴", + "⪸": "⪸", + "š": "š", + "ş": "ş", + "ŝ": "ŝ", + "⪶": "⪶", + "⪺": "⪺", + "⋩": "⋩", + "⨓": "⨓", + "с": "с", + "⋅": "⋅", + "⩦": "⩦", + "⇘": "⇘", + "§": "§", + ";": ";", + "⤩": "⤩", + "✶": "✶", + "𝔰": "𝔰", + "♯": "♯", + "щ": "щ", + "ш": "ш", + "­": "­", + "σ": "σ", + "ς": "ς", + "⩪": "⩪", + "⪞": "⪞", + "⪠": "⪠", + "⪝": "⪝", + "⪟": "⪟", + "≆": "≆", + "⨤": "⨤", + "⥲": "⥲", + "⨳": "⨳", + "⧤": "⧤", + "⌣": "⌣", + "⪪": "⪪", + "⪬": "⪬", + "⪬︀": "⪬︀", + "ь": "ь", + "/": "/", + "⧄": "⧄", + "⌿": "⌿", + "𝕤": "𝕤", + "♠": "♠", + "⊓︀": "⊓︀", + "⊔︀": "⊔︀", + "𝓈": "𝓈", + "☆": "☆", + "⊂": "⊂", + "⫅": "⫅", + "⪽": "⪽", + "⫃": "⫃", + "⫁": "⫁", + "⫋": "⫋", + "⊊": "⊊", + "⪿": "⪿", + "⥹": "⥹", + "⫇": "⫇", + "⫕": "⫕", + "⫓": "⫓", + "♪": "♪", + "¹": "¹", + "²": "²", + "³": "³", + "⫆": "⫆", + "⪾": "⪾", + "⫘": "⫘", + "⫄": "⫄", + "⟉": "⟉", + "⫗": "⫗", + "⥻": "⥻", + "⫂": "⫂", + "⫌": "⫌", + "⊋": "⊋", + "⫀": "⫀", + "⫈": "⫈", + "⫔": "⫔", + "⫖": "⫖", + "⇙": "⇙", + "⤪": "⤪", + "ß": "ß", + "⌖": "⌖", + "τ": "τ", + "ť": "ť", + "ţ": "ţ", + "т": "т", + "⌕": "⌕", + "𝔱": "𝔱", + "θ": "θ", + "ϑ": "ϑ", + "þ": "þ", + "×": "×", + "⨱": "⨱", + "⨰": "⨰", + "⌶": "⌶", + "⫱": "⫱", + "𝕥": "𝕥", + "⫚": "⫚", + "‴": "‴", + "▵": "▵", + "≜": "≜", + "◬": "◬", + "⨺": "⨺", + "⨹": "⨹", + "⧍": "⧍", + "⨻": "⨻", + "⏢": "⏢", + "𝓉": "𝓉", + "ц": "ц", + "ћ": "ћ", + "ŧ": "ŧ", + "⥣": "⥣", + "ú": "ú", + "ў": "ў", + "ŭ": "ŭ", + "û": "û", + "у": "у", + "ű": "ű", + "⥾": "⥾", + "𝔲": "𝔲", + "ù": "ù", + "▀": "▀", + "⌜": "⌜", + "⌏": "⌏", + "◸": "◸", + "ū": "ū", + "ų": "ų", + "𝕦": "𝕦", + "υ": "υ", + "⇈": "⇈", + "⌝": "⌝", + "⌎": "⌎", + "ů": "ů", + "◹": "◹", + "𝓊": "𝓊", + "⋰": "⋰", + "ũ": "ũ", + "ü": "ü", + "⦧": "⦧", + "⫨": "⫨", + "⫩": "⫩", + "⦜": "⦜", + "⊊︀": "⊊︀", + "⫋︀": "⫋︀", + "⊋︀": "⊋︀", + "⫌︀": "⫌︀", + "в": "в", + "⊻": "⊻", + "≚": "≚", + "⋮": "⋮", + "𝔳": "𝔳", + "𝕧": "𝕧", + "𝓋": "𝓋", + "⦚": "⦚", + "ŵ": "ŵ", + "⩟": "⩟", + "≙": "≙", + "℘": "℘", + "𝔴": "𝔴", + "𝕨": "𝕨", + "𝓌": "𝓌", + "𝔵": "𝔵", + "ξ": "ξ", + "⋻": "⋻", + "𝕩": "𝕩", + "𝓍": "𝓍", + "ý": "ý", + "я": "я", + "ŷ": "ŷ", + "ы": "ы", + "¥": "¥", + "𝔶": "𝔶", + "ї": "ї", + "𝕪": "𝕪", + "𝓎": "𝓎", + "ю": "ю", + "ÿ": "ÿ", + "ź": "ź", + "ž": "ž", + "з": "з", + "ż": "ż", + "ζ": "ζ", + "𝔷": "𝔷", + "ж": "ж", + "⇝": "⇝", + "𝕫": "𝕫", + "𝓏": "𝓏", + "‍": "‍", + "‌": "‌" + } + } + }; +},766,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.fromCodePoint = String.fromCodePoint || function (astralCodePoint) { + return String.fromCharCode(Math.floor((astralCodePoint - 65536) / 1024) + 55296, (astralCodePoint - 65536) % 1024 + 56320); + }; + + exports.getCodePoint = String.prototype.codePointAt ? function (input, position) { + return input.codePointAt(position); + } : function (input, position) { + return (input.charCodeAt(position) - 55296) * 1024 + input.charCodeAt(position + 1) - 56320 + 65536; + }; + exports.highSurrogateFrom = 55296; + exports.highSurrogateTo = 56319; +},767,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.numericUnicodeMap = { + 0: 65533, + 128: 8364, + 130: 8218, + 131: 402, + 132: 8222, + 133: 8230, + 134: 8224, + 135: 8225, + 136: 710, + 137: 8240, + 138: 352, + 139: 8249, + 140: 338, + 142: 381, + 145: 8216, + 146: 8217, + 147: 8220, + 148: 8221, + 149: 8226, + 150: 8211, + 151: 8212, + 152: 732, + 153: 8482, + 154: 353, + 155: 8250, + 156: 339, + 158: 382, + 159: 376 + }; +},768,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.HTTP_DOMAIN_SEPARATOR = exports.HTTPS_DOMAIN_SEPARATOR = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _netinfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var HTTP_DOMAIN_SEPARATOR = "."; + exports.HTTP_DOMAIN_SEPARATOR = HTTP_DOMAIN_SEPARATOR; + var HTTPS_DOMAIN_SEPARATOR = "-"; + exports.HTTPS_DOMAIN_SEPARATOR = HTTPS_DOMAIN_SEPARATOR; + + var Network = function () { + function Network() { + (0, _classCallCheck2.default)(this, Network); + } + + (0, _createClass2.default)(Network, null, [{ + key: "addDefaultProtocol", + value: function addDefaultProtocol(url) { + var newUrl = url; + var result = Network.DEFAULT_PROTOCOLS.find(function (protocol) { + return url.startsWith(protocol); + }); + + if (!result) { + var protocol = Network.isHTTPS ? "https" : "http"; + newUrl = protocol + ":"; + + if (!url.startsWith("//")) { + newUrl += "//"; + } + + newUrl += url; + } + + return newUrl; + } + }, { + key: "addConnectionChangeEventListener", + value: function addConnectionChangeEventListener(callback) { + if (callback) { + Network.removeConnectionChangeEventListener(); + Network.eventListener = _netinfo.default.addEventListener(function (state) { + Network.connectionInfo = Network.returnConnectionInfo(state); + callback(Network.connectionInfo); + }); + } + } + }, { + key: "removeConnectionChangeEventListener", + value: function removeConnectionChangeEventListener() { + if (Network.eventListener) { + Network.eventListener(); + } + } + }, { + key: "returnConnectionInfo", + value: function returnConnectionInfo(state) { + var type = state.type, + details = state.details, + isInternetReachable = state.isInternetReachable; + var effectiveType = "unknown"; + + if (details && details.cellularGeneration) { + effectiveType = details.cellularGeneration; + } + + return { + type: type, + effectiveType: effectiveType, + isInternetReachable: isInternetReachable + }; + } + }, { + key: "getConnectionInfo", + value: function getConnectionInfo() { + var state; + return _regenerator.default.async(function getConnectionInfo$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(_netinfo.default.fetch()); + + case 3: + state = _context.sent; + Network.connectionInfo = Network.returnConnectionInfo(state); + return _context.abrupt("return", Network.connectionInfo); + + case 8: + _context.prev = 8; + _context.t0 = _context["catch"](0); + + case 10: + return _context.abrupt("return", { + type: "unknown", + effectiveType: "unknown", + isInternetReachable: null + }); + + case 11: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + }, { + key: "isOnline", + value: function isOnline() { + if (Network.connectionInfo) { + var _Network$connectionIn = Network.connectionInfo, + type = _Network$connectionIn.type, + isInternetReachable = _Network$connectionIn.isInternetReachable; + return type !== "none" && type !== "unknown" && isInternetReachable !== false; + } + + return false; + } + }, { + key: "isInternetReachable", + value: function isInternetReachable() { + if (Network.connectionInfo) { + return Network.connectionInfo.isInternetReachable !== false; + } + + return false; + } + }, { + key: "isWiFi", + value: function isWiFi() { + if (Network.connectionInfo) { + return Network.connectionInfo.type === "wifi"; + } + + return false; + } + }, { + key: "isCellular", + value: function isCellular() { + if (Network.connectionInfo) { + return Network.connectionInfo.type === "cellular"; + } + + return false; + } + }, { + key: "isHighSpeedNetwork", + value: function isHighSpeedNetwork() { + return Network.isWiFi() || Network.is4G(); + } + }, { + key: "is2G", + value: function is2G() { + return Network.isCellularOnBand("2g"); + } + }, { + key: "is3G", + value: function is3G() { + return Network.isCellularOnBand("3g"); + } + }, { + key: "is4G", + value: function is4G() { + return Network.isCellularOnBand("4g"); + } + }, { + key: "isCellularOnBand", + value: function isCellularOnBand(band) { + if (Network.connectionInfo) { + return Network.connectionInfo.type === "cellular" && Network.connectionInfo.effectiveType === band; + } + + return false; + } + }, { + key: "getIP", + value: function getIP() { + return Network.IP; + } + }, { + key: "setIP", + value: function setIP(ip) { + Network.IP = ip; + } + }, { + key: "isTecnaviaIP", + value: function isTecnaviaIP() { + return Network.IP.startsWith("82.220."); + } + }]); + return Network; + }(); + + Network.DEFAULT_PROTOCOLS = ["http", "https"]; + Network.isHTTPS = true; + Network.connectionInfo = { + type: "unknown", + effectiveType: "unknown" + }; + Network.IP = "n/a"; + var _default = Network; + exports.default = _default; +},769,[5,80,7,8,552]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _errorView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _log = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + + var cache = _getRequireWildcardCache(nodeInterop); + + if (cache && cache.has(obj)) { + return cache.get(obj); + } + + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + + newObj.default = obj; + + if (cache) { + cache.set(obj, newObj); + } + + return newObj; + } + + var styles = _reactNative.StyleSheet.create({ + container: { + alignItems: "flex-end", + padding: 10 + }, + content: { + maxWidth: 500 + } + }); + + function Errors(props) { + var style = props.style; + + var _useState = (0, _react.useState)([]), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + errors = _useState2[0], + setErrors = _useState2[1]; + + (0, _react.useEffect)(function () { + var onError = _$$_REQUIRE(_dependencyMap[9]).EventRegister.on(_events.default.ON_ERROR, function (_ref) { + var error = _ref.error; + + _log.default.debug("add " + error + " to errors view"); + + setErrors([].concat((0, _toConsumableArray2.default)(errors), [error])); + }); + + return function () { + if (onError) { + _$$_REQUIRE(_dependencyMap[9]).EventRegister.rm(onError); + } + }; + }, [errors]); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["opt-errors-container"] + }, _react.default.createElement(_reactNative.View, { + style: [styles.container, style] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["opt-errors-list"] + }, _react.default.createElement(_reactNative.View, { + style: [styles.content] + }, errors.map(function (error, index) { + return _react.default.createElement(_errorView.default, { + key: "error_" + (0, _$$_REQUIRE(_dependencyMap[11]).toMD5)(error.text), + error: error, + onRemove: function onRemove() { + setErrors(function (prevErrors) { + var deletedErrors = prevErrors.splice(index, 1); + + _log.default.debug("remove " + deletedErrors + " from errros"); + + return (0, _toConsumableArray2.default)(prevErrors); + }); + } + }); + }))))); + } + + Errors.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]) + }; + var _default = Errors; + exports.default = _default; +},770,[5,21,41,17,201,28,771,772,759,991,987,762]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var Events = (0, _createClass2.default)(function Events() { + (0, _classCallCheck2.default)(this, Events); + }); + Events.JS_INJECTION = "js_injection"; + Events.ON_CLOSE = "on_close"; + Events.ON_ERROR = "on_error"; + Events.IFRAME_JS_INJECTION = "iframe_js_injection"; + Events.WEBVIEW_ON_MESSAGE = "webview_on_message"; + Events.WEBVIEW_ON_LOCAL = "webview_on_local"; + Events.ON_EXTERNAL_LINK_CLICK = "on_external_link_click"; + Events.ON_ACTION_CLICK = "on_action_click"; + var _default = Events; + exports.default = _default; +},771,[5,8,7]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _taImageIcon = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); + + var _errorIcon = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[5])); + + var _taText = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[6])); + + var _icCloseCircleOutline = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + + var cache = _getRequireWildcardCache(nodeInterop); + + if (cache && cache.has(obj)) { + return cache.get(obj); + } + + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + + newObj.default = obj; + + if (cache) { + cache.set(obj, newObj); + } + + return newObj; + } + + var styles = _reactNative.StyleSheet.create({ + container: { + width: "100%", + flexDirection: "row", + alignItems: "center", + margin: 5, + borderRadius: 5, + padding: 10, + backgroundColor: _$$_REQUIRE(_dependencyMap[8]).colors.grey900 + }, + separator: { + height: 20, + width: 1, + margin: 5, + backgroundColor: _$$_REQUIRE(_dependencyMap[8]).colors.grey300 + }, + text: { + flex: 1, + padding: 10, + color: _$$_REQUIRE(_dependencyMap[8]).colors.white + }, + touchable: { + justifyContent: "center" + } + }); + + function Error(props) { + var error = props.error, + onRemove = props.onRemove; + var animated = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current; + (0, _react.useEffect)(function () { + _reactNative.Animated.timing(animated, { + toValue: 1, + duration: _$$_REQUIRE(_dependencyMap[9]).ANIMATION_DURATION, + useNativeDriver: false + }).start(); + }, []); + + var onPress = function onPress() { + if (typeof onRemove === "function") { + _reactNative.Animated.timing(animated, { + toValue: 0, + duration: _$$_REQUIRE(_dependencyMap[9]).ANIMATION_DURATION, + useNativeDriver: false + }).start(function (_ref) { + var finished = _ref.finished; + + if (finished) { + onRemove(); + } + }); + } + }; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["opt-error-container"] + }, _react.default.createElement(_reactNative.Animated.View, { + style: [styles.container, { + opacity: animated, + transform: [{ + scale: animated + }] + }, _$$_REQUIRE(_dependencyMap[9]).commonStyles.shadow] + }, _react.default.createElement(_errorIcon.default, { + type: error.type + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["opt-error-text"] + }, _react.default.createElement(_taText.default, { + style: styles.text + }, error.text)), _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["opt-error-close-container"] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + style: styles.touchable, + onPress: onPress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["opt-error-close"] + }, _react.default.createElement(_taImageIcon.default, { + style: styles.icon, + DefaultComponent: _react.default.createElement(_icCloseCircleOutline.default, { + fill: _$$_REQUIRE(_dependencyMap[8]).colors.grey400, + width: 25, + height: 25 + }) + })))))); + } + + Error.propTypes = { + error: _propTypes.default.shape({ + text: _propTypes.default.string, + type: _propTypes.default.number + }).isRequired, + onRemove: _propTypes.default.func.isRequired + }; + var _default = Error; + exports.default = _default; +},772,[17,5,201,28,773,983,988,989,982,990,987]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.TaAnimatedImageIcon = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _fsImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _cssStyles = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _excluded = ["style", "imageStyle", "source", "tintColor"], + _excluded2 = ["Component", "DefaultComponent"]; + + function _createSuper(Derived) { + var hasNativeReflectConstruct = _isNativeReflectConstruct(); + + return function _createSuperInternal() { + var Super = (0, _getPrototypeOf2.default)(Derived), + result; + + if (hasNativeReflectConstruct) { + var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; + result = Reflect.construct(Super, arguments, NewTarget); + } else { + result = Super.apply(this, arguments); + } + + return (0, _possibleConstructorReturn2.default)(this, result); + }; + } + + function _isNativeReflectConstruct() { + if (typeof Reflect === "undefined" || !Reflect.construct) return false; + if (Reflect.construct.sham) return false; + if (typeof Proxy === "function") return true; + + try { + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); + return true; + } catch (e) { + return false; + } + } + + function mapPropsOnComponent(props) { + var style = props.style, + imageStyle = props.imageStyle, + source = props.source, + tintColor = props.tintColor, + rest = (0, _objectWithoutProperties2.default)(props, _excluded); + + var paths = _cssStyles.default.getAttributeFromStyle("paths", style, []); + + var src = _cssStyles.default.getAttributeFromStyle("src", style, ""); + + var newProps = (0, _extends2.default)({ + Component: null + }, rest); + var useSvg = paths && paths.length; + var srcStyleIsValid = src && src.length; + var srcPropIsValid = typeof source === "number" || source && source.uri || false; + + if (useSvg) { + newProps.Component = _$$_REQUIRE(_dependencyMap[13]).Svg; + newProps.style = style; + } else if (srcPropIsValid || srcStyleIsValid) { + newProps.Component = (0, _$$_REQUIRE(_dependencyMap[14]).isIOS)() ? _fsImage.default : _reactNative.Image; + newProps.style = _cssStyles.default.deleteKeysFromStyle([imageStyle, style], ["color"]); + newProps.source = source || src; + newProps.tintColor = tintColor; + } + + return newProps; + } + + var TaImageIcon = function (_React$Component) { + (0, _inherits2.default)(TaImageIcon, _React$Component); + + var _super = _createSuper(TaImageIcon); + + function TaImageIcon() { + (0, _classCallCheck2.default)(this, TaImageIcon); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(TaImageIcon, [{ + key: "render", + value: function render() { + var _mapPropsOnComponent = mapPropsOnComponent(this.props), + Component = _mapPropsOnComponent.Component, + DefaultComponent = _mapPropsOnComponent.DefaultComponent, + rest = (0, _objectWithoutProperties2.default)(_mapPropsOnComponent, _excluded2); + + if (Component) { + return _react.default.createElement(Component, rest); + } + + return DefaultComponent; + } + }]); + return TaImageIcon; + }(_react.default.Component); + + TaImageIcon.propTypes = (0, _extends2.default)({ + style: _propTypes.default.any, + imageStyle: _propTypes.default.any, + iconStyle: _propTypes.default.any, + size: _propTypes.default.number, + tintColor: _propTypes.default.string, + DefaultComponent: _propTypes.default.node + }, _reactNative.ImageProps); + TaImageIcon.defaultProps = { + DefaultComponent: null + }; + + var TaAnimatedImageIcon = _reactNative.Animated.createAnimatedComponent(TaImageIcon); + + exports.TaAnimatedImageIcon = TaAnimatedImageIcon; + var _default = TaImageIcon; + exports.default = _default; +},773,[5,7,8,12,14,16,6,108,17,28,201,774,775,776,760]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNativeFastImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _excluded = ["source", "error", "onError"]; + + function FSImage(props) { + var source = props.source, + error = props.error, + _onError = props.onError, + rest = (0, _objectWithoutProperties2.default)(props, _excluded); + + if (error) { + return null; + } + + if (source && source.cache === "reload") { + source.cache = "web"; + } + + return _react.default.createElement(_reactNativeFastImage.default, (0, _extends2.default)({ + onError: function onError(_ref) { + var nativeEvent = _ref.nativeEvent; + + if (typeof _onError === "function") { + _onError(); + } + }, + source: source + }, rest)); + } + + var _default = FSImage; + exports.default = _default; +},774,[5,6,108,17,591]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var CssStyle = function () { + function CssStyle() { + (0, _classCallCheck2.default)(this, CssStyle); + } + + (0, _createClass2.default)(CssStyle, null, [{ + key: "getAttributeFromStyle", + value: function getAttributeFromStyle(key) { + var style = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + var remove = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + + if (key) { + if (Array.isArray(style)) { + for (var i = 0; i < style.length; i++) { + var attribute = CssStyle.getAttributeFromStyle(key, style[i], undefined, remove); + + if (attribute !== undefined) { + return attribute; + } + } + } + + if (typeof style === "object") { + if (style[key] !== undefined) { + var value = style[key]; + + if (remove) { + delete style[key]; + } + + return value; + } + } + } + + return defaultValue; + } + }, { + key: "getFilterAttributeStyle", + value: function getFilterAttributeStyle() { + var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return CssStyle.getAttributeFromStyle("filter", style, defaultValue); + } + }, { + key: "getTintColorAttributeStyle", + value: function getTintColorAttributeStyle() { + var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + return CssStyle.getAttributeFromStyle("tintColor", style, defaultValue); + } + }, { + key: "deleteKeysFromStyle", + value: function deleteKeysFromStyle(style) { + var keys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + if (style === null || style === undefined) { + return style; + } + + if (Array.isArray(style)) { + return style.map(function (item) { + return CssStyle.deleteKeysFromStyle(item, keys); + }); + } + + if (typeof style === "object") { + var newStyle = {}; + Object.keys(style).forEach(function (attribute) { + if (!keys.includes(attribute)) { + newStyle[attribute] = style[attribute]; + } + }); + return newStyle; + } + + return style; + } + }, { + key: "parseFilterValue", + value: function parseFilterValue(filter, filterType) { + var regex = new RegExp(filterType + "\\(([0-9]{1,3})%\\)"); + + if (filter) { + var result = regex.exec(filter); + + if (result && result[1]) { + return parseInt(result[1], 10); + } + } + + return undefined; + } + }, { + key: "getConstraintInsideStyle", + value: function getConstraintInsideStyle(style, constraint, dpiDivider) { + var constraints = { + start: 0, + end: 0, + top: 0, + bottom: 0 + }; + Object.keys(style).forEach(function (key) { + if (key.startsWith(constraint)) { + if (key.includes("Left") || key.includes("Start")) { + constraints.start = style[key]; + } else if (key.includes("Right") || key.includes("End")) { + constraints.end = style[key]; + } else if (key.includes("Top")) { + constraints.top = style[key]; + } else if (key.includes("Bottom")) { + constraints.bottom = style[key]; + } else if (key.includes("Horizontal")) { + constraints.start = style[key] / 2; + constraints.end = style[key] / 2; + } else if (key.includes("Vertical")) { + constraints.top = style[key] / 2; + constraints.bottom = style[key] / 2; + } else if (key === constraint || key === constraint + "Width") { + constraints.start = style[key]; + constraints.end = style[key]; + constraints.top = style[key]; + constraints.bottom = style[key]; + } + } + }); + return { + start: constraints.start / dpiDivider, + end: constraints.end / dpiDivider, + top: constraints.top / dpiDivider, + bottom: constraints.bottom / dpiDivider + }; + } + }, { + key: "updateSizeByApplingStyle", + value: function updateSizeByApplingStyle(size, style) { + if (!size || !style) { + return size; + } + + var margin = CssStyle.getConstraintInsideStyle(style, "margin", 1); + var padding = CssStyle.getConstraintInsideStyle(style, "padding", 1); + var border = CssStyle.getConstraintInsideStyle(style, "border", 1); + var horizontalConstraint = margin.start + margin.end + padding.start + padding.end + border.start + border.end; + var verticalConstraint = margin.top + margin.bottom + padding.top + padding.bottom + border.top + border.bottom; + return { + width: Math.max(0, size.width - horizontalConstraint), + height: Math.max(0, size.height - verticalConstraint) + }; + } + }, { + key: "grayscaleValue", + value: function grayscaleValue(style) { + var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; + var value = CssStyle.parseFilterValue(CssStyle.getFilterAttributeStyle(style), "grayscale"); + + if (value !== undefined) { + return value; + } + + return defaultValue; + } + }, { + key: "styleToWebInnerStyle", + value: function styleToWebInnerStyle() { + var style = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return Object.keys(style).reduce(function (result, key) { + return result + " " + key + ":" + style[key] + ";"; + }, ""); + } + }]); + return CssStyle; + }(); + + var _default = CssStyle; + exports.default = _default; +},775,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Path = TaPath; + exports.Svg = TaSvg; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _reactNativeSvg = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _excluded = ["style", "children"], + _excluded2 = ["paths", "width", "height", "size", "fill", "color"]; + + function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); + } + + function _interopRequireWildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) { + return obj; + } + + if (obj === null || typeof obj !== "object" && typeof obj !== "function") { + return { + default: obj + }; + } + + var cache = _getRequireWildcardCache(nodeInterop); + + if (cache && cache.has(obj)) { + return cache.get(obj); + } + + var newObj = {}; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + + if (desc && (desc.get || desc.set)) { + Object.defineProperty(newObj, key, desc); + } else { + newObj[key] = obj[key]; + } + } + } + + newObj.default = obj; + + if (cache) { + cache.set(obj, newObj); + } + + return newObj; + } + + function TaSvg(props) { + var _ref, _ref2; + + var style = props.style, + children = props.children, + rest = (0, _objectWithoutProperties2.default)(props, _excluded); + + var _StyleSheet$flatten = _reactNative.StyleSheet.flatten(style || {}), + _StyleSheet$flatten$p = _StyleSheet$flatten.paths, + paths = _StyleSheet$flatten$p === undefined ? [] : _StyleSheet$flatten$p, + width = _StyleSheet$flatten.width, + height = _StyleSheet$flatten.height, + size = _StyleSheet$flatten.size, + fill = _StyleSheet$flatten.fill, + color = _StyleSheet$flatten.color, + otherStyle = (0, _objectWithoutProperties2.default)(_StyleSheet$flatten, _excluded2); + + return _react.default.createElement(_reactNativeSvg.default, (0, _extends2.default)({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 24 24", + fill: fill || color || _$$_REQUIRE(_dependencyMap[6]).icCommonProps.svg.fill, + width: (_ref = width != null ? width : size) != null ? _ref : _$$_REQUIRE(_dependencyMap[6]).icCommonProps.svg.width, + height: (_ref2 = height != null ? height : size) != null ? _ref2 : _$$_REQUIRE(_dependencyMap[6]).icCommonProps.svg.height, + style: otherStyle + }, rest), paths.length ? paths.map(function (path, index) { + return _react.default.createElement(_reactNativeSvg.Path, (0, _extends2.default)({ + key: "path_" + index + }, path)); + }) : children); + } + + function TaPath(props) { + return _react.default.createElement(_reactNativeSvg.Path, props); + } +},776,[5,6,108,17,28,777,981]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _exportNames = {}; + Object.defineProperty(exports, "default", { + enumerable: true, + get: function get() { + return _ReactNativeSVG.default; + } + }); + + var _ReactNativeSVG = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + Object.keys(_ReactNativeSVG).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _ReactNativeSVG[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _ReactNativeSVG[key]; + } + }); + }); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } +},777,[778]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "Shape", { + enumerable: true, + get: function get() { + return _Shape.default; + } + }); + Object.defineProperty(exports, "Rect", { + enumerable: true, + get: function get() { + return _Rect.default; + } + }); + Object.defineProperty(exports, "Circle", { + enumerable: true, + get: function get() { + return _Circle.default; + } + }); + Object.defineProperty(exports, "Ellipse", { + enumerable: true, + get: function get() { + return _Ellipse.default; + } + }); + Object.defineProperty(exports, "Polygon", { + enumerable: true, + get: function get() { + return _Polygon.default; + } + }); + Object.defineProperty(exports, "Polyline", { + enumerable: true, + get: function get() { + return _Polyline.default; + } + }); + Object.defineProperty(exports, "Line", { + enumerable: true, + get: function get() { + return _Line.default; + } + }); + Object.defineProperty(exports, "Svg", { + enumerable: true, + get: function get() { + return _Svg.default; + } + }); + Object.defineProperty(exports, "Path", { + enumerable: true, + get: function get() { + return _Path.default; + } + }); + Object.defineProperty(exports, "G", { + enumerable: true, + get: function get() { + return _G.default; + } + }); + Object.defineProperty(exports, "Text", { + enumerable: true, + get: function get() { + return _Text.default; + } + }); + Object.defineProperty(exports, "TSpan", { + enumerable: true, + get: function get() { + return _TSpan.default; + } + }); + Object.defineProperty(exports, "TextPath", { + enumerable: true, + get: function get() { + return _TextPath.default; + } + }); + Object.defineProperty(exports, "Use", { + enumerable: true, + get: function get() { + return _Use.default; + } + }); + Object.defineProperty(exports, "Image", { + enumerable: true, + get: function get() { + return _Image.default; + } + }); + Object.defineProperty(exports, "Symbol", { + enumerable: true, + get: function get() { + return _Symbol.default; + } + }); + Object.defineProperty(exports, "Defs", { + enumerable: true, + get: function get() { + return _Defs.default; + } + }); + Object.defineProperty(exports, "LinearGradient", { + enumerable: true, + get: function get() { + return _LinearGradient.default; + } + }); + Object.defineProperty(exports, "RadialGradient", { + enumerable: true, + get: function get() { + return _RadialGradient.default; + } + }); + Object.defineProperty(exports, "Stop", { + enumerable: true, + get: function get() { + return _Stop.default; + } + }); + Object.defineProperty(exports, "ClipPath", { + enumerable: true, + get: function get() { + return _ClipPath.default; + } + }); + Object.defineProperty(exports, "Pattern", { + enumerable: true, + get: function get() { + return _Pattern.default; + } + }); + Object.defineProperty(exports, "Mask", { + enumerable: true, + get: function get() { + return _Mask.default; + } + }); + Object.defineProperty(exports, "Marker", { + enumerable: true, + get: function get() { + return _Marker.default; + } + }); + Object.defineProperty(exports, "ForeignObject", { + enumerable: true, + get: function get() { + return _ForeignObject.default; + } + }); + Object.defineProperty(exports, "parse", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).parse; + } + }); + Object.defineProperty(exports, "SvgAst", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).SvgAst; + } + }); + Object.defineProperty(exports, "SvgFromUri", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).SvgFromUri; + } + }); + Object.defineProperty(exports, "SvgFromXml", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).SvgFromXml; + } + }); + Object.defineProperty(exports, "SvgUri", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).SvgUri; + } + }); + Object.defineProperty(exports, "SvgXml", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).SvgXml; + } + }); + Object.defineProperty(exports, "SvgCss", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).SvgCss; + } + }); + Object.defineProperty(exports, "SvgCssUri", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).SvgCssUri; + } + }); + Object.defineProperty(exports, "SvgWithCss", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).SvgWithCss; + } + }); + Object.defineProperty(exports, "SvgWithCssUri", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).SvgWithCssUri; + } + }); + Object.defineProperty(exports, "inlineStyles", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1]).inlineStyles; + } + }); + Object.defineProperty(exports, "LocalSvg", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).LocalSvg; + } + }); + Object.defineProperty(exports, "WithLocalSvg", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).WithLocalSvg; + } + }); + Object.defineProperty(exports, "loadLocalRawResource", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2]).loadLocalRawResource; + } + }); + Object.defineProperty(exports, "RNSVGCircle", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGCircle; + } + }); + Object.defineProperty(exports, "RNSVGClipPath", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGClipPath; + } + }); + Object.defineProperty(exports, "RNSVGDefs", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGDefs; + } + }); + Object.defineProperty(exports, "RNSVGEllipse", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGEllipse; + } + }); + Object.defineProperty(exports, "RNSVGForeignObject", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGForeignObject; + } + }); + Object.defineProperty(exports, "RNSVGGroup", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGGroup; + } + }); + Object.defineProperty(exports, "RNSVGImage", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGImage; + } + }); + Object.defineProperty(exports, "RNSVGLine", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGLine; + } + }); + Object.defineProperty(exports, "RNSVGLinearGradient", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGLinearGradient; + } + }); + Object.defineProperty(exports, "RNSVGMarker", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGMarker; + } + }); + Object.defineProperty(exports, "RNSVGMask", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGMask; + } + }); + Object.defineProperty(exports, "RNSVGPath", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGPath; + } + }); + Object.defineProperty(exports, "RNSVGPattern", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGPattern; + } + }); + Object.defineProperty(exports, "RNSVGRadialGradient", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGRadialGradient; + } + }); + Object.defineProperty(exports, "RNSVGRect", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGRect; + } + }); + Object.defineProperty(exports, "RNSVGSvg", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGSvg; + } + }); + Object.defineProperty(exports, "RNSVGSymbol", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGSymbol; + } + }); + Object.defineProperty(exports, "RNSVGText", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGText; + } + }); + Object.defineProperty(exports, "RNSVGTextPath", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGTextPath; + } + }); + Object.defineProperty(exports, "RNSVGTSpan", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGTSpan; + } + }); + Object.defineProperty(exports, "RNSVGUse", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3]).RNSVGUse; + } + }); + exports.default = undefined; + + var _Shape = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[5])); + + var _Rect = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[6])); + + var _Circle = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[7])); + + var _Ellipse = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[8])); + + var _Polygon = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[9])); + + var _Polyline = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[10])); + + var _Line = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[11])); + + var _Svg = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[12])); + + var _Path = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[13])); + + var _G = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[14])); + + var _Text = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[15])); + + var _TSpan = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[16])); + + var _TextPath = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[17])); + + var _Use = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[18])); + + var _Image = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[19])); + + var _Symbol = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[20])); + + var _Defs = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[21])); + + var _LinearGradient = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[22])); + + var _RadialGradient = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[23])); + + var _Stop = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[24])); + + var _ClipPath = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[25])); + + var _Pattern = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[26])); + + var _Mask = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[27])); + + var _Marker = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[28])); + + var _ForeignObject = _$$_REQUIRE(_dependencyMap[4])(_$$_REQUIRE(_dependencyMap[29])); + + var _default = _Svg.default; + exports.default = _default; +},778,[779,823,979,783,5,781,780,796,797,798,801,802,803,799,805,807,808,809,810,811,812,813,814,817,818,819,820,821,822,980]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SvgAst = SvgAst; + exports.SvgXml = SvgXml; + exports.fetchText = fetchText; + exports.SvgUri = SvgUri; + exports.getStyle = getStyle; + exports.astToReact = astToReact; + exports.parse = _parse; + exports.camelCase = exports.SvgFromUri = exports.SvgFromXml = exports.err = exports.tags = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _Rect = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Circle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Ellipse = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _Polygon = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Polyline = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _Line = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Svg = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _Path = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _G = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _Text = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _TSpan = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _TextPath = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _Use = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _Image = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _Symbol = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + var _Defs = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _LinearGradient = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _RadialGradient = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + var _Stop = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[28])); + + var _ClipPath = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[29])); + + var _Pattern = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[30])); + + var _Mask = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[31])); + + var _Marker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[32])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var tags = { + svg: _Svg.default, + circle: _Circle.default, + ellipse: _Ellipse.default, + g: _G.default, + text: _Text.default, + tspan: _TSpan.default, + textPath: _TextPath.default, + path: _Path.default, + polygon: _Polygon.default, + polyline: _Polyline.default, + line: _Line.default, + rect: _Rect.default, + use: _Use.default, + image: _Image.default, + symbol: _Symbol.default, + defs: _Defs.default, + linearGradient: _LinearGradient.default, + radialGradient: _RadialGradient.default, + stop: _Stop.default, + clipPath: _ClipPath.default, + pattern: _Pattern.default, + mask: _Mask.default, + marker: _Marker.default + }; + exports.tags = tags; + + function missingTag() { + return null; + } + + function SvgAst(_ref) { + var ast = _ref.ast, + override = _ref.override; + + if (!ast) { + return null; + } + + var props = ast.props, + children = ast.children; + return _react.default.createElement(_Svg.default, (0, _extends2.default)({}, props, override), children); + } + + var err = console.error.bind(console); + exports.err = err; + + function SvgXml(props) { + var _props$onError = props.onError, + onError = _props$onError === undefined ? err : _props$onError, + xml = props.xml, + override = props.override; + var ast = (0, _react.useMemo)(function () { + return xml !== null ? _parse(xml) : null; + }, [xml]); + + try { + return _react.default.createElement(SvgAst, { + ast: ast, + override: override || props + }); + } catch (error) { + onError(error); + return null; + } + } + + function fetchText(uri) { + var response; + return _regenerator.default.async(function fetchText$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(fetch(uri)); + + case 2: + response = _context.sent; + _context.next = 5; + return _regenerator.default.awrap(response.text()); + + case 5: + return _context.abrupt("return", _context.sent); + + case 6: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + function SvgUri(props) { + var _props$onError2 = props.onError, + onError = _props$onError2 === undefined ? err : _props$onError2, + uri = props.uri; + + var _useState = (0, _react.useState)(null), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + xml = _useState2[0], + setXml = _useState2[1]; + + (0, _react.useEffect)(function () { + uri ? fetchText(uri).then(setXml).catch(onError) : setXml(null); + }, [onError, uri]); + return _react.default.createElement(SvgXml, { + xml: xml, + override: props + }); + } + + var SvgFromXml = function (_Component) { + (0, _inherits2.default)(SvgFromXml, _Component); + + var _super = _createSuper(SvgFromXml); + + function SvgFromXml() { + var _this; + + (0, _classCallCheck2.default)(this, SvgFromXml); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.state = { + ast: null + }; + return _this; + } + + (0, _createClass2.default)(SvgFromXml, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.parse(this.props.xml); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var xml = this.props.xml; + + if (xml !== prevProps.xml) { + this.parse(xml); + } + } + }, { + key: "parse", + value: function parse(xml) { + try { + this.setState({ + ast: xml ? _parse(xml) : null + }); + } catch (e) { + console.error(e); + } + } + }, { + key: "render", + value: function render() { + var props = this.props, + ast = this.state.ast; + return _react.default.createElement(SvgAst, { + ast: ast, + override: props.override || props + }); + } + }]); + return SvgFromXml; + }(_react.Component); + + exports.SvgFromXml = SvgFromXml; + + var SvgFromUri = function (_Component2) { + (0, _inherits2.default)(SvgFromUri, _Component2); + + var _super2 = _createSuper(SvgFromUri); + + function SvgFromUri() { + var _this2; + + (0, _classCallCheck2.default)(this, SvgFromUri); + + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + _this2 = _super2.call.apply(_super2, [this].concat(args)); + _this2.state = { + xml: null + }; + return _this2; + } + + (0, _createClass2.default)(SvgFromUri, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.fetch(this.props.uri); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var uri = this.props.uri; + + if (uri !== prevProps.uri) { + this.fetch(uri); + } + } + }, { + key: "fetch", + value: function fetch(uri) { + return _regenerator.default.async(function fetch$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + _context2.t0 = this; + + if (!uri) { + _context2.next = 8; + break; + } + + _context2.next = 5; + return _regenerator.default.awrap(fetchText(uri)); + + case 5: + _context2.t1 = _context2.sent; + _context2.next = 9; + break; + + case 8: + _context2.t1 = null; + + case 9: + _context2.t2 = _context2.t1; + _context2.t3 = { + xml: _context2.t2 + }; + + _context2.t0.setState.call(_context2.t0, _context2.t3); + + _context2.next = 17; + break; + + case 14: + _context2.prev = 14; + _context2.t4 = _context2["catch"](0); + console.error(_context2.t4); + + case 17: + case "end": + return _context2.stop(); + } + } + }, null, this, [[0, 14]], Promise); + } + }, { + key: "render", + value: function render() { + var props = this.props, + xml = this.state.xml; + return _react.default.createElement(SvgFromXml, { + xml: xml, + override: props + }); + } + }]); + return SvgFromUri; + }(_react.Component); + + exports.SvgFromUri = SvgFromUri; + + var upperCase = function upperCase(_match, letter) { + return letter.toUpperCase(); + }; + + var camelCase = function camelCase(phrase) { + return phrase.replace(/[:-]([a-z])/g, upperCase); + }; + + exports.camelCase = camelCase; + + function getStyle(string) { + var style = {}; + var declarations = string.split(';'); + var length = declarations.length; + + for (var i = 0; i < length; i++) { + var declaration = declarations[i]; + + if (declaration.length !== 0) { + var split = declaration.split(':'); + var _property = split[0]; + var value = split[1]; + style[camelCase(_property.trim())] = value.trim(); + } + } + + return style; + } + + function astToReact(value, index) { + if (typeof value === 'object') { + var Tag = value.Tag, + props = value.props, + children = value.children; + return _react.default.createElement(Tag, (0, _extends2.default)({ + key: index + }, props), children.map(astToReact)); + } + + return value; + } + + function repeat(str, i) { + var result = ''; + + while (i--) { + result += str; + } + + return result; + } + + var toSpaces = function toSpaces(tabs) { + return repeat(' ', tabs.length); + }; + + function locate(source, i) { + var lines = source.split('\n'); + var nLines = lines.length; + var column = i; + var line = 0; + + for (; line < nLines; line++) { + var length = lines[line].length; + + if (column >= length) { + column -= length; + } else { + break; + } + } + + var before = source.slice(0, i).replace(/^\t+/, toSpaces); + var beforeExec = /(^|\n).*$/.exec(before); + var beforeLine = beforeExec && beforeExec[0] || ''; + var after = source.slice(i); + var afterExec = /.*(\n|$)/.exec(after); + var afterLine = afterExec && afterExec[0]; + var pad = repeat(' ', beforeLine.length); + var snippet = "" + beforeLine + afterLine + "\n" + pad + "^"; + return { + line: line, + column: column, + snippet: snippet + }; + } + + var validNameCharacters = /[a-zA-Z0-9:_-]/; + var whitespace = /[\s\t\r\n]/; + var quotemarks = /['"]/; + + function _parse(source, middleware) { + var length = source.length; + var currentElement = null; + var state = metadata; + var children = null; + var root; + var stack = []; + + function error(message) { + var _locate = locate(source, i), + line = _locate.line, + column = _locate.column, + snippet = _locate.snippet; + + throw new Error(message + " (" + line + ":" + column + "). If this is valid SVG, it's probably a bug. Please raise an issue\n\n" + snippet); + } + + function metadata() { + while (i + 1 < length && (source[i] !== '<' || !validNameCharacters.test(source[i + 1]))) { + i++; + } + + return neutral(); + } + + function neutral() { + var text = ''; + var char; + + while (i < length && (char = source[i]) !== '<') { + text += char; + i += 1; + } + + if (/\S/.test(text)) { + children.push(text); + } + + if (source[i] === '<') { + return openingTag; + } + + return neutral; + } + + function openingTag() { + var char = source[i]; + + if (char === '?') { + return neutral; + } + + if (char === '!') { + var start = i + 1; + + if (source.slice(start, i + 3) === '--') { + return comment; + } + + var end = i + 8; + + if (source.slice(start, end) === '[CDATA[') { + return cdata; + } + + if (/doctype/i.test(source.slice(start, end))) { + return neutral; + } + } + + if (char === '/') { + return closingTag; + } + + var tag = getName(); + var props = {}; + var element = { + tag: tag, + props: props, + children: [], + parent: currentElement, + Tag: tags[tag] || missingTag + }; + + if (currentElement) { + children.push(element); + } else { + root = element; + } + + getAttributes(props); + var style = props.style; + + if (typeof style === 'string') { + element.styles = style; + props.style = getStyle(style); + } + + var selfClosing = false; + + if (source[i] === '/') { + i += 1; + selfClosing = true; + } + + if (source[i] !== '>') { + error('Expected >'); + } + + if (!selfClosing) { + currentElement = element; + children = element.children; + stack.push(element); + } + + return neutral; + } + + function comment() { + var index = source.indexOf('-->', i); + + if (!~index) { + error('expected -->'); + } + + i = index + 2; + return neutral; + } + + function cdata() { + var index = source.indexOf(']]>', i); + + if (!~index) { + error('expected ]]>'); + } + + children.push(source.slice(i + 7, index)); + i = index + 2; + return neutral; + } + + function closingTag() { + var tag = getName(); + + if (!tag) { + error('Expected tag name'); + } + + if (currentElement && tag !== currentElement.tag) { + error("Expected closing tag to match opening tag <" + currentElement.tag + ">"); + } + + if (source[i] !== '>') { + error('Expected >'); + } + + stack.pop(); + currentElement = stack[stack.length - 1]; + + if (currentElement) { + var _currentElement = currentElement; + children = _currentElement.children; + } + + return neutral; + } + + function getName() { + var name = ''; + var char; + + while (i < length && validNameCharacters.test(char = source[i])) { + name += char; + i += 1; + } + + return name; + } + + function getAttributes(props) { + while (i < length) { + if (!whitespace.test(source[i])) { + return; + } + + allowSpaces(); + var name = getName(); + + if (!name) { + return; + } + + var value = true; + allowSpaces(); + + if (source[i] === '=') { + i += 1; + allowSpaces(); + value = getAttributeValue(); + + if (!isNaN(+value) && value.trim() !== '') { + value = +value; + } + } + + props[camelCase(name)] = value; + } + } + + function getAttributeValue() { + return quotemarks.test(source[i]) ? getQuotedAttributeValue() : getUnquotedAttributeValue(); + } + + function getUnquotedAttributeValue() { + var value = ''; + + do { + var char = source[i]; + + if (char === ' ' || char === '>' || char === '/') { + return value; + } + + value += char; + i += 1; + } while (i < length); + + return value; + } + + function getQuotedAttributeValue() { + var quotemark = source[i++]; + var value = ''; + var escaped = false; + + while (i < length) { + var char = source[i++]; + + if (char === quotemark && !escaped) { + return value; + } + + if (char === '\\' && !escaped) { + escaped = true; + } + + value += escaped ? "\\" + char : char; + escaped = false; + } + + return value; + } + + function allowSpaces() { + while (i < length && whitespace.test(source[i])) { + i += 1; + } + } + + var i = 0; + + while (i < length) { + if (!state) { + error('Unexpected character'); + } + + state = state(); + i += 1; + } + + if (state !== neutral) { + error('Unexpected end of input'); + } + + if (root) { + var xml = (middleware ? middleware(root) : root) || root; + + var _ast = xml.children.map(astToReact); + + var jsx = xml; + jsx.children = _ast; + return jsx; + } + + return null; + } +},779,[5,80,7,8,12,14,16,41,6,17,780,796,797,798,801,802,803,799,805,807,808,809,810,811,812,813,814,817,818,819,820,821,822]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Rect = function (_Shape) { + (0, _inherits2.default)(Rect, _Shape); + + var _super = _createSuper(Rect); + + function Rect() { + (0, _classCallCheck2.default)(this, Rect); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Rect, [{ + key: "render", + value: function render() { + var props = this.props; + var x = props.x, + y = props.y, + width = props.width, + height = props.height, + rx = props.rx, + ry = props.ry; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).RNSVGRect, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[10]).withoutXY)(this, props), { + x: x, + y: y, + width: width, + height: height, + rx: rx, + ry: ry + })); + } + }]); + return Rect; + }(_Shape2.default); + + exports.default = Rect; + Rect.displayName = 'Rect'; + Rect.defaultProps = { + x: 0, + y: 0, + width: 0, + height: 0 + }; +},780,[5,6,7,8,12,14,16,17,781,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.multiply_matrices = multiply_matrices; + exports.invert = invert; + exports.matrixTransform = _matrixTransform; + exports.default = exports.ownerSVGElement = exports.SVGPoint = exports.SVGMatrix = undefined; + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[7]); + + var _SvgTouchableMixin = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RNSVGRenderableManager = _reactNative.NativeModules.RNSVGRenderableManager; + + function multiply_matrices(l, r) { + var al = l.a, + bl = l.b, + cl = l.c, + dl = l.d, + el = l.e, + fl = l.f; + var ar = r.a, + br = r.b, + cr = r.c, + dr = r.d, + er = r.e, + fr = r.f; + var a = al * ar + cl * br; + var c = al * cr + cl * dr; + var e = al * er + cl * fr + el; + var b = bl * ar + dl * br; + var d = bl * cr + dl * dr; + var f = bl * er + dl * fr + fl; + return { + a: a, + c: c, + e: e, + b: b, + d: d, + f: f + }; + } + + function invert(_ref) { + var a = _ref.a, + b = _ref.b, + c = _ref.c, + d = _ref.d, + e = _ref.e, + f = _ref.f; + var n = a * d - b * c; + return { + a: d / n, + b: -b / n, + c: -c / n, + d: a / n, + e: (c * f - d * e) / n, + f: -(a * f - b * e) / n + }; + } + + var deg2rad = Math.PI / 180; + + var SVGMatrix = function () { + function SVGMatrix(matrix) { + (0, _classCallCheck2.default)(this, SVGMatrix); + + if (matrix) { + var a = matrix.a, + b = matrix.b, + c = matrix.c, + d = matrix.d, + e = matrix.e, + f = matrix.f; + this.a = a; + this.b = b; + this.c = c; + this.d = d; + this.e = e; + this.f = f; + } else { + this.a = 1; + this.b = 0; + this.c = 0; + this.d = 1; + this.e = 0; + this.f = 0; + } + } + + (0, _createClass2.default)(SVGMatrix, [{ + key: "multiply", + value: function multiply(secondMatrix) { + return new SVGMatrix(multiply_matrices(this, secondMatrix)); + } + }, { + key: "inverse", + value: function inverse() { + return new SVGMatrix(invert(this)); + } + }, { + key: "translate", + value: function translate(x, y) { + return new SVGMatrix(multiply_matrices(this, { + a: 1, + b: 0, + c: 0, + d: 1, + e: x, + f: y + })); + } + }, { + key: "scale", + value: function scale(scaleFactor) { + return new SVGMatrix(multiply_matrices(this, { + a: scaleFactor, + b: 0, + c: 0, + d: scaleFactor, + e: 0, + f: 0 + })); + } + }, { + key: "scaleNonUniform", + value: function scaleNonUniform(scaleFactorX, scaleFactorY) { + return new SVGMatrix(multiply_matrices(this, { + a: scaleFactorX, + b: 0, + c: 0, + d: scaleFactorY, + e: 0, + f: 0 + })); + } + }, { + key: "rotate", + value: function rotate(angle) { + var cos = Math.cos(deg2rad * angle); + var sin = Math.sin(deg2rad * angle); + return new SVGMatrix(multiply_matrices(this, { + a: cos, + b: sin, + c: -sin, + d: cos, + e: 0, + f: 0 + })); + } + }, { + key: "rotateFromVector", + value: function rotateFromVector(x, y) { + var angle = Math.atan2(y, x); + var cos = Math.cos(deg2rad * angle); + var sin = Math.sin(deg2rad * angle); + return new SVGMatrix(multiply_matrices(this, { + a: cos, + b: sin, + c: -sin, + d: cos, + e: 0, + f: 0 + })); + } + }, { + key: "flipX", + value: function flipX() { + return new SVGMatrix(multiply_matrices(this, { + a: -1, + b: 0, + c: 0, + d: 1, + e: 0, + f: 0 + })); + } + }, { + key: "flipY", + value: function flipY() { + return new SVGMatrix(multiply_matrices(this, { + a: 1, + b: 0, + c: 0, + d: -1, + e: 0, + f: 0 + })); + } + }, { + key: "skewX", + value: function skewX(angle) { + return new SVGMatrix(multiply_matrices(this, { + a: 1, + b: 0, + c: Math.tan(deg2rad * angle), + d: 1, + e: 0, + f: 0 + })); + } + }, { + key: "skewY", + value: function skewY(angle) { + return new SVGMatrix(multiply_matrices(this, { + a: 1, + b: Math.tan(deg2rad * angle), + c: 0, + d: 1, + e: 0, + f: 0 + })); + } + }]); + return SVGMatrix; + }(); + + exports.SVGMatrix = SVGMatrix; + + function _matrixTransform(matrix, point) { + var a = matrix.a, + b = matrix.b, + c = matrix.c, + d = matrix.d, + e = matrix.e, + f = matrix.f; + var x = point.x, + y = point.y; + return { + x: a * x + c * y + e, + y: b * x + d * y + f + }; + } + + var SVGPoint = function () { + function SVGPoint(point) { + (0, _classCallCheck2.default)(this, SVGPoint); + + if (point) { + var _x = point.x, + _y = point.y; + this.x = _x; + this.y = _y; + } else { + this.x = 0; + this.y = 0; + } + } + + (0, _createClass2.default)(SVGPoint, [{ + key: "matrixTransform", + value: function matrixTransform(matrix) { + return new SVGPoint(_matrixTransform(matrix, this)); + } + }]); + return SVGPoint; + }(); + + exports.SVGPoint = SVGPoint; + var ownerSVGElement = { + createSVGPoint: function createSVGPoint() { + return new SVGPoint(); + }, + createSVGMatrix: function createSVGMatrix() { + return new SVGMatrix(); + } + }; + exports.ownerSVGElement = ownerSVGElement; + + var Shape = function (_Component) { + (0, _inherits2.default)(Shape, _Component); + + var _super = _createSuper(Shape); + + function Shape(_props, context) { + var _this; + + (0, _classCallCheck2.default)(this, Shape); + _this = _super.call(this, _props, context); + _this.root = null; + + _this.refMethod = function (instance) { + _this.root = instance; + }; + + _this.setNativeProps = function (props) { + _this.root && _this.root.setNativeProps(props); + }; + + _this.getBBox = function (options) { + var _ref2 = options || {}, + _ref2$fill = _ref2.fill, + fill = _ref2$fill === undefined ? true : _ref2$fill, + _ref2$stroke = _ref2.stroke, + stroke = _ref2$stroke === undefined ? true : _ref2$stroke, + _ref2$markers = _ref2.markers, + markers = _ref2$markers === undefined ? true : _ref2$markers, + _ref2$clipped = _ref2.clipped, + clipped = _ref2$clipped === undefined ? true : _ref2$clipped; + + var handle = (0, _reactNative.findNodeHandle)(_this.root); + return RNSVGRenderableManager.getBBox(handle, { + fill: fill, + stroke: stroke, + markers: markers, + clipped: clipped + }); + }; + + _this.getCTM = function () { + var handle = (0, _reactNative.findNodeHandle)(_this.root); + return new SVGMatrix(RNSVGRenderableManager.getCTM(handle)); + }; + + _this.getScreenCTM = function () { + var handle = (0, _reactNative.findNodeHandle)(_this.root); + return new SVGMatrix(RNSVGRenderableManager.getScreenCTM(handle)); + }; + + _this.isPointInFill = function (options) { + var handle = (0, _reactNative.findNodeHandle)(_this.root); + return RNSVGRenderableManager.isPointInFill(handle, options); + }; + + _this.isPointInStroke = function (options) { + var handle = (0, _reactNative.findNodeHandle)(_this.root); + return RNSVGRenderableManager.isPointInStroke(handle, options); + }; + + _this.getTotalLength = function () { + var handle = (0, _reactNative.findNodeHandle)(_this.root); + return RNSVGRenderableManager.getTotalLength(handle); + }; + + _this.getPointAtLength = function (length) { + var handle = (0, _reactNative.findNodeHandle)(_this.root); + return new SVGPoint(RNSVGRenderableManager.getPointAtLength(handle, { + length: length + })); + }; + + (0, _SvgTouchableMixin.default)((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + return Shape; + }(_react.Component); + + exports.default = Shape; + Shape.prototype.ownerSVGElement = ownerSVGElement; +},781,[5,15,12,14,16,7,8,17,782,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var PRESS_RETENTION_OFFSET = { + top: 20, + left: 20, + right: 20, + bottom: 30 + }; + var Mixin = _reactNative.Touchable.Mixin; + var _touchableHandleStartShouldSetResponder = Mixin.touchableHandleStartShouldSetResponder, + _touchableHandleResponderTerminationRequest = Mixin.touchableHandleResponderTerminationRequest, + _touchableHandleResponderGrant = Mixin.touchableHandleResponderGrant, + _touchableHandleResponderMove = Mixin.touchableHandleResponderMove, + _touchableHandleResponderRelease = Mixin.touchableHandleResponderRelease, + _touchableHandleResponderTerminate = Mixin.touchableHandleResponderTerminate, + touchableGetInitialState = Mixin.touchableGetInitialState; + var SvgTouchableMixin = (0, _extends2.default)({}, Mixin, { + touchableHandleStartShouldSetResponder: function touchableHandleStartShouldSetResponder(e) { + var onStartShouldSetResponder = this.props.onStartShouldSetResponder; + + if (onStartShouldSetResponder) { + return onStartShouldSetResponder(e); + } else { + return _touchableHandleStartShouldSetResponder.call(this, e); + } + }, + touchableHandleResponderTerminationRequest: function touchableHandleResponderTerminationRequest(e) { + var onResponderTerminationRequest = this.props.onResponderTerminationRequest; + + if (onResponderTerminationRequest) { + return onResponderTerminationRequest(e); + } else { + return _touchableHandleResponderTerminationRequest.call(this, e); + } + }, + touchableHandleResponderGrant: function touchableHandleResponderGrant(e) { + var onResponderGrant = this.props.onResponderGrant; + + if (onResponderGrant) { + return onResponderGrant(e); + } else { + return _touchableHandleResponderGrant.call(this, e); + } + }, + touchableHandleResponderMove: function touchableHandleResponderMove(e) { + var onResponderMove = this.props.onResponderMove; + + if (onResponderMove) { + return onResponderMove(e); + } else { + return _touchableHandleResponderMove.call(this, e); + } + }, + touchableHandleResponderRelease: function touchableHandleResponderRelease(e) { + var onResponderRelease = this.props.onResponderRelease; + + if (onResponderRelease) { + return onResponderRelease(e); + } else { + return _touchableHandleResponderRelease.call(this, e); + } + }, + touchableHandleResponderTerminate: function touchableHandleResponderTerminate(e) { + var onResponderTerminate = this.props.onResponderTerminate; + + if (onResponderTerminate) { + return onResponderTerminate(e); + } else { + return _touchableHandleResponderTerminate.call(this, e); + } + }, + touchableHandlePress: function touchableHandlePress(e) { + var onPress = this.props.onPress; + onPress && onPress(e); + }, + touchableHandleActivePressIn: function touchableHandleActivePressIn(e) { + var onPressIn = this.props.onPressIn; + onPressIn && onPressIn(e); + }, + touchableHandleActivePressOut: function touchableHandleActivePressOut(e) { + var onPressOut = this.props.onPressOut; + onPressOut && onPressOut(e); + }, + touchableHandleLongPress: function touchableHandleLongPress(e) { + var onLongPress = this.props.onLongPress; + onLongPress && onLongPress(e); + }, + touchableGetPressRectOffset: function touchableGetPressRectOffset() { + var pressRetentionOffset = this.props.pressRetentionOffset; + return pressRetentionOffset || PRESS_RETENTION_OFFSET; + }, + touchableGetHitSlop: function touchableGetHitSlop() { + var hitSlop = this.props.hitSlop; + return hitSlop; + }, + touchableGetHighlightDelayMS: function touchableGetHighlightDelayMS() { + var delayPressIn = this.props.delayPressIn; + return delayPressIn || 0; + }, + touchableGetLongPressDelayMS: function touchableGetLongPressDelayMS() { + var delayLongPress = this.props.delayLongPress; + return delayLongPress === 0 ? 0 : delayLongPress || 500; + }, + touchableGetPressOutDelayMS: function touchableGetPressOutDelayMS() { + var delayPressOut = this.props.delayPressOut; + return delayPressOut || 0; + } + }); + var touchKeys = Object.keys(SvgTouchableMixin); + var touchVals = touchKeys.map(function (key) { + return SvgTouchableMixin[key]; + }); + var numTouchKeys = touchKeys.length; + + var _default = function _default(target) { + for (var i = 0; i < numTouchKeys; i++) { + var key = touchKeys[i]; + var val = touchVals[i]; + + if (typeof val === 'function') { + target[key] = val.bind(target); + } else { + target[key] = val; + } + } + + target.state = touchableGetInitialState(); + }; + + exports.default = _default; +},782,[5,6,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RNSVGUse = exports.RNSVGTSpan = exports.RNSVGTextPath = exports.RNSVGText = exports.RNSVGSymbol = exports.RNSVGRect = exports.RNSVGRadialGradient = exports.RNSVGPattern = exports.RNSVGPath = exports.RNSVGMask = exports.RNSVGMarker = exports.RNSVGLinearGradient = exports.RNSVGLine = exports.RNSVGImage = exports.RNSVGGroup = exports.RNSVGForeignObject = exports.RNSVGEllipse = exports.RNSVGDefs = exports.RNSVGClipPath = exports.RNSVGCircle = exports.RNSVGSvg = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNSVGSvg = (0, _reactNative.requireNativeComponent)('RNSVGSvgView'); + exports.RNSVGSvg = RNSVGSvg; + var RNSVGCircle = (0, _reactNative.requireNativeComponent)('RNSVGCircle'); + exports.RNSVGCircle = RNSVGCircle; + var RNSVGClipPath = (0, _reactNative.requireNativeComponent)('RNSVGClipPath'); + exports.RNSVGClipPath = RNSVGClipPath; + var RNSVGDefs = (0, _reactNative.requireNativeComponent)('RNSVGDefs'); + exports.RNSVGDefs = RNSVGDefs; + var RNSVGEllipse = (0, _reactNative.requireNativeComponent)('RNSVGEllipse'); + exports.RNSVGEllipse = RNSVGEllipse; + var RNSVGForeignObject = (0, _reactNative.requireNativeComponent)('RNSVGForeignObject'); + exports.RNSVGForeignObject = RNSVGForeignObject; + var RNSVGGroup = (0, _reactNative.requireNativeComponent)('RNSVGGroup'); + exports.RNSVGGroup = RNSVGGroup; + var RNSVGImage = (0, _reactNative.requireNativeComponent)('RNSVGImage'); + exports.RNSVGImage = RNSVGImage; + var RNSVGLine = (0, _reactNative.requireNativeComponent)('RNSVGLine'); + exports.RNSVGLine = RNSVGLine; + var RNSVGLinearGradient = (0, _reactNative.requireNativeComponent)('RNSVGLinearGradient'); + exports.RNSVGLinearGradient = RNSVGLinearGradient; + var RNSVGMarker = (0, _reactNative.requireNativeComponent)('RNSVGMarker'); + exports.RNSVGMarker = RNSVGMarker; + var RNSVGMask = (0, _reactNative.requireNativeComponent)('RNSVGMask'); + exports.RNSVGMask = RNSVGMask; + var RNSVGPath = (0, _reactNative.requireNativeComponent)('RNSVGPath'); + exports.RNSVGPath = RNSVGPath; + var RNSVGPattern = (0, _reactNative.requireNativeComponent)('RNSVGPattern'); + exports.RNSVGPattern = RNSVGPattern; + var RNSVGRadialGradient = (0, _reactNative.requireNativeComponent)('RNSVGRadialGradient'); + exports.RNSVGRadialGradient = RNSVGRadialGradient; + var RNSVGRect = (0, _reactNative.requireNativeComponent)('RNSVGRect'); + exports.RNSVGRect = RNSVGRect; + var RNSVGSymbol = (0, _reactNative.requireNativeComponent)('RNSVGSymbol'); + exports.RNSVGSymbol = RNSVGSymbol; + var RNSVGText = (0, _reactNative.requireNativeComponent)('RNSVGText'); + exports.RNSVGText = RNSVGText; + var RNSVGTextPath = (0, _reactNative.requireNativeComponent)('RNSVGTextPath'); + exports.RNSVGTextPath = RNSVGTextPath; + var RNSVGTSpan = (0, _reactNative.requireNativeComponent)('RNSVGTSpan'); + exports.RNSVGTSpan = RNSVGTSpan; + var RNSVGUse = (0, _reactNative.requireNativeComponent)('RNSVGUse'); + exports.RNSVGUse = RNSVGUse; +},783,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.propsAndStyles = propsAndStyles; + exports.default = extractProps; + exports.extract = extract; + exports.withoutXY = withoutXY; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extractFill = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _extractStroke = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _extractResponder = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _extractOpacity = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var clipRules = { + evenodd: 0, + nonzero: 1 + }; + + function propsAndStyles(props) { + var style = props.style; + return !style ? props : (0, _extends2.default)({}, Array.isArray(style) ? Object.assign.apply(Object, [{}].concat((0, _toConsumableArray2.default)(style))) : style, props); + } + + function getMarker(marker) { + if (!marker) { + return undefined; + } + + var matched = marker.match(_$$_REQUIRE(_dependencyMap[7]).idPattern); + return matched ? matched[1] : undefined; + } + + function extractProps(props, ref) { + var id = props.id, + opacity = props.opacity, + onLayout = props.onLayout, + clipPath = props.clipPath, + clipRule = props.clipRule, + display = props.display, + mask = props.mask, + marker = props.marker, + _props$markerStart = props.markerStart, + markerStart = _props$markerStart === undefined ? marker : _props$markerStart, + _props$markerMid = props.markerMid, + markerMid = _props$markerMid === undefined ? marker : _props$markerMid, + _props$markerEnd = props.markerEnd, + markerEnd = _props$markerEnd === undefined ? marker : _props$markerEnd, + transform = props.transform; + var extracted = {}; + var inherited = []; + (0, _extractResponder.default)(extracted, props, ref); + (0, _extractFill.default)(extracted, props, inherited); + (0, _extractStroke.default)(extracted, props, inherited); + + if (inherited.length) { + extracted.propList = inherited; + } + + var transformProps = (0, _$$_REQUIRE(_dependencyMap[8]).props2transform)(props); + var matrix = (0, _$$_REQUIRE(_dependencyMap[8]).transformToMatrix)(transformProps, transform); + + if (matrix !== null) { + extracted.matrix = matrix; + } + + if (opacity != null) { + extracted.opacity = (0, _extractOpacity.default)(opacity); + } + + if (display != null) { + extracted.display = display === 'none' ? 'none' : undefined; + } + + if (onLayout) { + extracted.onLayout = onLayout; + } + + if (markerStart) { + extracted.markerStart = getMarker(markerStart); + } + + if (markerMid) { + extracted.markerMid = getMarker(markerMid); + } + + if (markerEnd) { + extracted.markerEnd = getMarker(markerEnd); + } + + if (id) { + extracted.name = String(id); + } + + if (clipRule) { + extracted.clipRule = clipRules[clipRule] === 0 ? 0 : 1; + } + + if (clipPath) { + var matched = clipPath.match(_$$_REQUIRE(_dependencyMap[7]).idPattern); + + if (matched) { + extracted.clipPath = matched[1]; + } else { + console.warn('Invalid `clipPath` prop, expected a clipPath like "#id", but got: "' + clipPath + '"'); + } + } + + if (mask) { + var _matched = mask.match(_$$_REQUIRE(_dependencyMap[7]).idPattern); + + if (_matched) { + extracted.mask = _matched[1]; + } else { + console.warn('Invalid `mask` prop, expected a mask like "#id", but got: "' + mask + '"'); + } + } + + return extracted; + } + + function extract(instance, props) { + return extractProps(propsAndStyles(props), instance); + } + + function withoutXY(instance, props) { + return extractProps((0, _extends2.default)({}, propsAndStyles(props), { + x: null, + y: null + }), instance); + } +},784,[5,21,6,785,789,791,788,792,793]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractFill; + + var _extractBrush = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extractOpacity = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var fillRules = { + evenodd: 0, + nonzero: 1 + }; + + var defaultFill = _$$_REQUIRE(_dependencyMap[3]).colorNames.black; + + function extractFill(o, props, inherited) { + var fill = props.fill, + fillRule = props.fillRule, + fillOpacity = props.fillOpacity; + + if (fill != null) { + inherited.push('fill'); + o.fill = !fill && typeof fill !== 'number' ? defaultFill : (0, _extractBrush.default)(fill); + } + + if (fillOpacity != null) { + inherited.push('fillOpacity'); + o.fillOpacity = (0, _extractOpacity.default)(fillOpacity); + } + + if (fillRule != null) { + inherited.push('fillRule'); + o.fillRule = fillRule && fillRules[fillRule] === 0 ? 0 : 1; + } + } +},785,[5,786,788,787]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractBrush; + + var _extractColor = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var urlIdPattern = /^url\(#(.+)\)$/; + var currentColorBrush = [2]; + var contextFillBrush = [3]; + var contextStrokeBrush = [4]; + + function extractBrush(color) { + if (typeof color === 'number') { + if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) { + return (0, _extractColor.integerColor)(color); + } + } + + if (!color || color === 'none') { + return null; + } + + if (color === 'currentColor') { + return currentColorBrush; + } + + if (color === 'context-fill') { + return contextFillBrush; + } + + if (color === 'context-stroke') { + return contextStrokeBrush; + } + + var brush = typeof color === 'string' && color.match(urlIdPattern); + + if (brush) { + return [1, brush[1]]; + } + + var int32ARGBColor = (0, _extractColor.default)(color); + + if (typeof int32ARGBColor === 'number') { + return int32ARGBColor; + } + + console.warn("\"" + color + "\" is not a valid color or brush"); + return null; + } +},786,[787]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractColor; + exports.integerColor = exports.colorNames = exports.colors = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var colors = { + aliceblue: [240, 248, 255], + antiquewhite: [250, 235, 215], + aqua: [0, 255, 255], + aquamarine: [127, 255, 212], + azure: [240, 255, 255], + beige: [245, 245, 220], + bisque: [255, 228, 196], + black: [0, 0, 0], + blanchedalmond: [255, 235, 205], + blue: [0, 0, 255], + blueviolet: [138, 43, 226], + brown: [165, 42, 42], + burlywood: [222, 184, 135], + cadetblue: [95, 158, 160], + chartreuse: [127, 255, 0], + chocolate: [210, 105, 30], + coral: [255, 127, 80], + cornflowerblue: [100, 149, 237], + cornsilk: [255, 248, 220], + crimson: [220, 20, 60], + cyan: [0, 255, 255], + darkblue: [0, 0, 139], + darkcyan: [0, 139, 139], + darkgoldenrod: [184, 134, 11], + darkgray: [169, 169, 169], + darkgreen: [0, 100, 0], + darkgrey: [169, 169, 169], + darkkhaki: [189, 183, 107], + darkmagenta: [139, 0, 139], + darkolivegreen: [85, 107, 47], + darkorange: [255, 140, 0], + darkorchid: [153, 50, 204], + darkred: [139, 0, 0], + darksalmon: [233, 150, 122], + darkseagreen: [143, 188, 143], + darkslateblue: [72, 61, 139], + darkslategray: [47, 79, 79], + darkslategrey: [47, 79, 79], + darkturquoise: [0, 206, 209], + darkviolet: [148, 0, 211], + deeppink: [255, 20, 147], + deepskyblue: [0, 191, 255], + dimgray: [105, 105, 105], + dimgrey: [105, 105, 105], + dodgerblue: [30, 144, 255], + firebrick: [178, 34, 34], + floralwhite: [255, 250, 240], + forestgreen: [34, 139, 34], + fuchsia: [255, 0, 255], + gainsboro: [220, 220, 220], + ghostwhite: [248, 248, 255], + gold: [255, 215, 0], + goldenrod: [218, 165, 32], + gray: [128, 128, 128], + green: [0, 128, 0], + greenyellow: [173, 255, 47], + grey: [128, 128, 128], + honeydew: [240, 255, 240], + hotpink: [255, 105, 180], + indianred: [205, 92, 92], + indigo: [75, 0, 130], + ivory: [255, 255, 240], + khaki: [240, 230, 140], + lavender: [230, 230, 250], + lavenderblush: [255, 240, 245], + lawngreen: [124, 252, 0], + lemonchiffon: [255, 250, 205], + lightblue: [173, 216, 230], + lightcoral: [240, 128, 128], + lightcyan: [224, 255, 255], + lightgoldenrodyellow: [250, 250, 210], + lightgray: [211, 211, 211], + lightgreen: [144, 238, 144], + lightgrey: [211, 211, 211], + lightpink: [255, 182, 193], + lightsalmon: [255, 160, 122], + lightseagreen: [32, 178, 170], + lightskyblue: [135, 206, 250], + lightslategray: [119, 136, 153], + lightslategrey: [119, 136, 153], + lightsteelblue: [176, 196, 222], + lightyellow: [255, 255, 224], + lime: [0, 255, 0], + limegreen: [50, 205, 50], + linen: [250, 240, 230], + magenta: [255, 0, 255], + maroon: [128, 0, 0], + mediumaquamarine: [102, 205, 170], + mediumblue: [0, 0, 205], + mediumorchid: [186, 85, 211], + mediumpurple: [147, 112, 219], + mediumseagreen: [60, 179, 113], + mediumslateblue: [123, 104, 238], + mediumspringgreen: [0, 250, 154], + mediumturquoise: [72, 209, 204], + mediumvioletred: [199, 21, 133], + midnightblue: [25, 25, 112], + mintcream: [245, 255, 250], + mistyrose: [255, 228, 225], + moccasin: [255, 228, 181], + navajowhite: [255, 222, 173], + navy: [0, 0, 128], + oldlace: [253, 245, 230], + olive: [128, 128, 0], + olivedrab: [107, 142, 35], + orange: [255, 165, 0], + orangered: [255, 69, 0], + orchid: [218, 112, 214], + palegoldenrod: [238, 232, 170], + palegreen: [152, 251, 152], + paleturquoise: [175, 238, 238], + palevioletred: [219, 112, 147], + papayawhip: [255, 239, 213], + peachpuff: [255, 218, 185], + peru: [205, 133, 63], + pink: [255, 192, 203], + plum: [221, 160, 221], + powderblue: [176, 224, 230], + purple: [128, 0, 128], + rebeccapurple: [102, 51, 153], + red: [255, 0, 0], + rosybrown: [188, 143, 143], + royalblue: [65, 105, 225], + saddlebrown: [139, 69, 19], + salmon: [250, 128, 114], + sandybrown: [244, 164, 96], + seagreen: [46, 139, 87], + seashell: [255, 245, 238], + sienna: [160, 82, 45], + silver: [192, 192, 192], + skyblue: [135, 206, 235], + slateblue: [106, 90, 205], + slategray: [112, 128, 144], + slategrey: [112, 128, 144], + snow: [255, 250, 250], + springgreen: [0, 255, 127], + steelblue: [70, 130, 180], + tan: [210, 180, 140], + teal: [0, 128, 128], + thistle: [216, 191, 216], + tomato: [255, 99, 71], + turquoise: [64, 224, 208], + violet: [238, 130, 238], + wheat: [245, 222, 179], + white: [255, 255, 255], + whitesmoke: [245, 245, 245], + yellow: [255, 255, 0], + yellowgreen: [154, 205, 50] + }; + exports.colors = colors; + var colorNames = {}; + exports.colorNames = colorNames; + + for (var name in colors) { + if (colors.hasOwnProperty(name)) { + var color = colors[name]; + var r = color[0]; + var g = color[1]; + var b = color[2]; + colorNames[name] = (0xff000000 | r << 16 | g << 8 | b) >>> 0; + } + } + + Object.freeze(colorNames); + + function hslToRgb(_h, _s, _l, a) { + var h = _h / 360; + var s = _s / 100; + var l = _l / 100; + var t1; + var t2; + var t3; + var rgb; + var val; + + if (s === 0) { + val = l; + return [val, val, val, a]; + } + + if (l < 0.5) { + t2 = l * (1 + s); + } else { + t2 = l + s - l * s; + } + + t1 = 2 * l - t2; + rgb = [0, 0, 0, a]; + + for (var i = 0; i < 3; i++) { + t3 = h + 0.3333333333333333 * -(i - 1); + + if (t3 < 0) { + t3++; + } + + if (t3 > 1) { + t3--; + } + + if (6 * t3 < 1) { + val = t1 + (t2 - t1) * 6 * t3; + } else if (2 * t3 < 1) { + val = t2; + } else if (3 * t3 < 2) { + val = t1 + (t2 - t1) * (0.6666666666666666 - t3) * 6; + } else { + val = t1; + } + + rgb[i] = val; + } + + return rgb; + } + + function hwbToRgb(_h, _w, _b, a) { + var h = _h / 360; + var wh = _w / 100; + var bl = _b / 100; + var ratio = wh + bl; + var i; + var v; + var f; + var n; + + if (ratio > 1) { + wh /= ratio; + bl /= ratio; + } + + i = Math.floor(6 * h); + v = 1 - bl; + f = 6 * h - i; + + if ((i & 0x01) !== 0) { + f = 1 - f; + } + + n = wh + f * (v - wh); + var r; + var g; + var b; + + switch (i) { + default: + case 6: + case 0: + r = v; + g = n; + b = wh; + break; + + case 1: + r = n; + g = v; + b = wh; + break; + + case 2: + r = wh; + g = v; + b = n; + break; + + case 3: + r = wh; + g = n; + b = v; + break; + + case 4: + r = n; + g = wh; + b = v; + break; + + case 5: + r = v; + g = wh; + b = n; + break; + } + + return [r, g, b, a]; + } + + function clamp(num, min, max) { + return Math.min(Math.max(min, num), max); + } + + var abbr = /^#([a-f0-9]{3,4})$/i; + var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i; + var rgba = /^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/; + var per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/; + var keyword = /(\D+)/; + + function rgbFromString(string) { + var rgb = [0, 0, 0, 1]; + var match; + var i; + var hexAlpha; + + if (match = string.match(hex)) { + hexAlpha = match[2]; + match = match[1]; + + for (i = 0; i < 3; i++) { + var i2 = i * 2; + rgb[i] = parseInt(match.slice(i2, i2 + 2), 16) / 255; + } + + if (hexAlpha) { + rgb[3] = Math.round(parseInt(hexAlpha, 16) / 255 * 100) / 100; + } + } else if (match = string.match(abbr)) { + match = match[1]; + hexAlpha = match[3]; + + for (i = 0; i < 3; i++) { + rgb[i] = parseInt(match[i] + match[i], 16) / 255; + } + + if (hexAlpha) { + rgb[3] = Math.round(parseInt(hexAlpha + hexAlpha, 16) / 255 * 100) / 100; + } + } else if (match = string.match(rgba)) { + for (i = 0; i < 3; i++) { + rgb[i] = parseInt(match[i + 1], 0) / 255; + } + + if (match[4]) { + rgb[3] = parseFloat(match[4]); + } + } else if (match = string.match(per)) { + for (i = 0; i < 3; i++) { + rgb[i] = parseFloat(match[i + 1]) / 100; + } + + if (match[4]) { + rgb[3] = parseFloat(match[4]); + } + } else if (match = string.match(keyword)) { + if (match[1] === 'transparent') { + return [0, 0, 0, 0]; + } + + var _color = colorNames[match[1]]; + + if (!(typeof _color === 'number')) { + return null; + } + + return integerColor(_color); + } else { + return null; + } + + for (i = 0; i < 4; i++) { + rgb[i] = clamp(rgb[i], 0, 1); + } + + return rgb; + } + + var hslRegEx = /^hsla?\(\s*([+-]?(?:\d*\.)?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/; + + function rgbFromHslString(string) { + var match = string.match(hslRegEx); + + if (!match) { + return null; + } + + var alpha = parseFloat(match[4]); + var h = (parseFloat(match[1]) + 360) % 360; + var s = clamp(parseFloat(match[2]), 0, 100); + var l = clamp(parseFloat(match[3]), 0, 100); + var a = isNaN(alpha) ? 1 : clamp(alpha, 0, 1); + return hslToRgb(h, s, l, a); + } + + var hwbRegEx = /^hwb\(\s*([+-]?\d*[.]?\d+)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?[\d.]+)\s*)?\)$/; + + function rgbFromHwbString(string) { + var match = string.match(hwbRegEx); + + if (!match) { + return null; + } + + var alpha = parseFloat(match[4]); + var h = (parseFloat(match[1]) % 360 + 360) % 360; + var w = clamp(parseFloat(match[2]), 0, 100); + var b = clamp(parseFloat(match[3]), 0, 100); + var a = isNaN(alpha) ? 1 : clamp(alpha, 0, 1); + return hwbToRgb(h, w, b, a); + } + + function colorFromString(string) { + var prefix = string.substring(0, 3).toLowerCase(); + + switch (prefix) { + case 'hsl': + return rgbFromHslString(string); + + case 'hwb': + return rgbFromHwbString(string); + + default: + return rgbFromString(string); + } + } + + var identity = function identity(x) { + return x; + }; + + var toSignedInt32 = function toSignedInt32(x) { + return x | 0x0; + }; + + var integerColor = _reactNative.Platform.OS === 'android' ? toSignedInt32 : identity; + exports.integerColor = integerColor; + + function extractColor(color) { + if (typeof color === 'number') { + if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) { + return integerColor(color); + } + + return null; + } + + var parsedColor = typeof color === 'string' ? colorFromString(color) : color; + + if (!Array.isArray(parsedColor)) { + return parsedColor; + } + + var r = parsedColor[0]; + var g = parsedColor[1]; + var b = parsedColor[2]; + var a = parsedColor[3]; + var int32Color = ((a === undefined ? 0xff000000 : Math.round(a * 255) << 24) | Math.round(r * 255) << 16 | Math.round(g * 255) << 8 | Math.round(b * 255)) >>> 0; + return integerColor(int32Color); + } +},787,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractOpacity; + + function extractOpacity(opacity) { + var value = +opacity; + return isNaN(value) ? 1 : value; + } +},788,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractStroke; + + var _extractBrush = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extractOpacity = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extractLengthList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var caps = { + butt: 0, + square: 2, + round: 1 + }; + var joins = { + miter: 0, + bevel: 2, + round: 1 + }; + var vectorEffects = { + none: 0, + default: 0, + nonScalingStroke: 1, + 'non-scaling-stroke': 1, + inherit: 2, + uri: 3 + }; + + function extractStroke(o, props, inherited) { + var stroke = props.stroke, + strokeOpacity = props.strokeOpacity, + strokeLinecap = props.strokeLinecap, + strokeLinejoin = props.strokeLinejoin, + strokeDasharray = props.strokeDasharray, + strokeWidth = props.strokeWidth, + strokeDashoffset = props.strokeDashoffset, + strokeMiterlimit = props.strokeMiterlimit, + vectorEffect = props.vectorEffect; + + if (stroke != null) { + inherited.push('stroke'); + o.stroke = (0, _extractBrush.default)(stroke); + } + + if (strokeWidth != null) { + inherited.push('strokeWidth'); + o.strokeWidth = strokeWidth; + } + + if (strokeOpacity != null) { + inherited.push('strokeOpacity'); + o.strokeOpacity = (0, _extractOpacity.default)(strokeOpacity); + } + + if (strokeDasharray != null) { + inherited.push('strokeDasharray'); + var strokeDash = !strokeDasharray || strokeDasharray === 'none' ? null : (0, _extractLengthList.default)(strokeDasharray); + o.strokeDasharray = strokeDash && strokeDash.length % 2 === 1 ? strokeDash.concat(strokeDash) : strokeDash; + } + + if (strokeDashoffset != null) { + inherited.push('strokeDashoffset'); + o.strokeDashoffset = strokeDasharray && strokeDashoffset ? +strokeDashoffset || 0 : null; + } + + if (strokeLinecap != null) { + inherited.push('strokeLinecap'); + o.strokeLinecap = strokeLinecap && caps[strokeLinecap] || 0; + } + + if (strokeLinejoin != null) { + inherited.push('strokeLinejoin'); + o.strokeLinejoin = strokeLinejoin && joins[strokeLinejoin] || 0; + } + + if (strokeMiterlimit != null) { + inherited.push('strokeMiterlimit'); + o.strokeMiterlimit = (strokeMiterlimit && typeof strokeMiterlimit !== 'number' ? parseFloat(strokeMiterlimit) : strokeMiterlimit) || 4; + } + + if (vectorEffect != null) { + o.vectorEffect = vectorEffect && vectorEffects[vectorEffect] || 0; + } + } +},789,[5,786,788,790]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractLengthList; + var spaceReg = /\s+/; + var commaReg = /,/g; + + function extractLengthList(lengthList) { + if (Array.isArray(lengthList)) { + return lengthList; + } else if (typeof lengthList === 'number') { + return [lengthList]; + } else if (typeof lengthList === 'string') { + return lengthList.trim().replace(commaReg, ' ').split(spaceReg); + } else { + return []; + } + } +},790,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractResponder; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var responderKeys = Object.keys(_reactNative.PanResponder.create({}).panHandlers); + var numResponderKeys = responderKeys.length; + + function extractResponder(o, props, ref) { + var onPress = props.onPress, + disabled = props.disabled, + onPressIn = props.onPressIn, + onPressOut = props.onPressOut, + onLongPress = props.onLongPress, + delayPressIn = props.delayPressIn, + delayPressOut = props.delayPressOut, + delayLongPress = props.delayLongPress, + pointerEvents = props.pointerEvents; + var responsible = false; + + for (var i = 0; i < numResponderKeys; i++) { + var key = responderKeys[i]; + var value = props[key]; + + if (value) { + responsible = true; + o[key] = value; + } + } + + if (pointerEvents) { + o.pointerEvents = pointerEvents; + } + + var hasTouchableProperty = disabled != null || onPress || onPressIn || onPressOut || onLongPress || delayPressIn || delayPressOut || delayLongPress; + + if (hasTouchableProperty) { + responsible = true; + o.onResponderMove = ref.touchableHandleResponderMove; + o.onResponderGrant = ref.touchableHandleResponderGrant; + o.onResponderRelease = ref.touchableHandleResponderRelease; + o.onResponderTerminate = ref.touchableHandleResponderTerminate; + o.onStartShouldSetResponder = ref.touchableHandleStartShouldSetResponder; + o.onResponderTerminationRequest = ref.touchableHandleResponderTerminationRequest; + } + + if (responsible) { + o.responsible = true; + } + } +},791,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.pickNotNil = pickNotNil; + exports.idPattern = undefined; + + function pickNotNil(object) { + var result = {}; + + for (var key in object) { + if (object.hasOwnProperty(key)) { + var value = object[key]; + + if (value !== undefined && value !== null) { + result[key] = value; + } + } + } + + return result; + } + + var idPattern = /#([^)]+)\)?$/; + exports.idPattern = idPattern; +},792,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.props2transform = props2transform; + exports.transformToMatrix = transformToMatrix; + exports.default = extractTransform; + + function appendTransformProps(props) { + var x = props.x, + y = props.y, + originX = props.originX, + originY = props.originY, + scaleX = props.scaleX, + scaleY = props.scaleY, + rotation = props.rotation, + skewX = props.skewX, + skewY = props.skewY; + (0, _$$_REQUIRE(_dependencyMap[0]).appendTransform)(x + originX, y + originY, scaleX, scaleY, rotation, skewX, skewY, originX, originY); + } + + function universal2axis(universal, axisX, axisY, defaultValue) { + var x; + var y; + + if (typeof universal === 'number') { + x = y = universal; + } else if (typeof universal === 'string') { + var coords = universal.split(/\s*,\s*/); + + if (coords.length === 2) { + x = +coords[0]; + y = +coords[1]; + } else if (coords.length === 1) { + x = y = +coords[0]; + } + } else if (Array.isArray(universal)) { + if (universal.length === 2) { + x = +universal[0]; + y = +universal[1]; + } else if (universal.length === 1) { + x = y = +universal[0]; + } + } + + axisX = +axisX; + + if (!isNaN(axisX)) { + x = axisX; + } + + axisY = +axisY; + + if (!isNaN(axisY)) { + y = axisY; + } + + return [x || defaultValue || 0, y || defaultValue || 0]; + } + + function props2transform(props) { + var rotation = props.rotation, + translate = props.translate, + translateX = props.translateX, + translateY = props.translateY, + origin = props.origin, + originX = props.originX, + originY = props.originY, + scale = props.scale, + scaleX = props.scaleX, + scaleY = props.scaleY, + skew = props.skew, + skewX = props.skewX, + skewY = props.skewY, + x = props.x, + y = props.y; + + if (rotation == null && translate == null && translateX == null && translateY == null && origin == null && originX == null && originY == null && scale == null && scaleX == null && scaleY == null && skew == null && skewX == null && skewY == null && x == null && y == null) { + return null; + } + + if (Array.isArray(x) || Array.isArray(y)) { + console.warn('Passing SvgLengthList to x or y attribute where SvgLength expected'); + } + + var tr = universal2axis(translate, translateX || (Array.isArray(x) ? x[0] : x), translateY || (Array.isArray(y) ? y[0] : y)); + var or = universal2axis(origin, originX, originY); + var sc = universal2axis(scale, scaleX, scaleY, 1); + var sk = universal2axis(skew, skewX, skewY); + return { + rotation: rotation == null ? 0 : +rotation || 0, + originX: or[0], + originY: or[1], + scaleX: sc[0], + scaleY: sc[1], + skewX: sk[0], + skewY: sk[1], + x: tr[0], + y: tr[1] + }; + } + + function transformToMatrix(props, transform) { + if (!props && !transform) { + return null; + } + + (0, _$$_REQUIRE(_dependencyMap[0]).reset)(); + props && appendTransformProps(props); + + if (transform) { + if (Array.isArray(transform)) { + if (typeof transform[0] === 'number') { + (0, _$$_REQUIRE(_dependencyMap[0]).append)(transform[0], transform[1], transform[2], transform[3], transform[4], transform[5]); + } + } else if (typeof transform === 'string') { + try { + var t = (0, _$$_REQUIRE(_dependencyMap[1]).parse)(transform); + (0, _$$_REQUIRE(_dependencyMap[0]).append)(t[0], t[3], t[1], t[4], t[2], t[5]); + } catch (e) { + console.error(e); + } + } else { + var transformProps = props2transform(transform); + transformProps && appendTransformProps(transformProps); + } + } + + return (0, _$$_REQUIRE(_dependencyMap[0]).toArray)(); + } + + function extractTransform(props) { + if (Array.isArray(props)) { + return props; + } + + if (typeof props === 'string') { + try { + var t = (0, _$$_REQUIRE(_dependencyMap[1]).parse)(props); + return [t[0], t[3], t[1], t[4], t[2], t[5]]; + } catch (e) { + console.error(e); + return _$$_REQUIRE(_dependencyMap[0]).identity; + } + } + + return transformToMatrix(props2transform(props), props.transform); + } +},793,[794,795]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.reset = reset; + exports.toArray = toArray; + exports.append = append; + exports.appendTransform = appendTransform; + exports.identity = undefined; + var DEG_TO_RAD = Math.PI / 180; + var identity = [1, 0, 0, 1, 0, 0]; + exports.identity = identity; + var a = 1; + var b = 0; + var c = 0; + var d = 1; + var tx = 0; + var ty = 0; + var hasInitialState = true; + + function reset() { + if (hasInitialState) { + return; + } + + a = d = 1; + b = c = tx = ty = 0; + hasInitialState = true; + } + + function toArray() { + if (hasInitialState) { + return identity; + } + + return [a, b, c, d, tx, ty]; + } + + function append(a2, b2, c2, d2, tx2, ty2) { + var change = a2 !== 1 || b2 !== 0 || c2 !== 0 || d2 !== 1; + var translate = tx2 !== 0 || ty2 !== 0; + + if (!change && !translate) { + return; + } + + if (hasInitialState) { + hasInitialState = false; + a = a2; + b = b2; + c = c2; + d = d2; + tx = tx2; + ty = ty2; + return; + } + + var a1 = a; + var b1 = b; + var c1 = c; + var d1 = d; + + if (change) { + a = a1 * a2 + c1 * b2; + b = b1 * a2 + d1 * b2; + c = a1 * c2 + c1 * d2; + d = b1 * c2 + d1 * d2; + } + + if (translate) { + tx = a1 * tx2 + c1 * ty2 + tx; + ty = b1 * tx2 + d1 * ty2 + ty; + } + } + + function appendTransform(x, y, scaleX, scaleY, rotation, skewX, skewY, regX, regY) { + if (x === 0 && y === 0 && scaleX === 1 && scaleY === 1 && rotation === 0 && skewX === 0 && skewY === 0 && regX === 0 && regY === 0) { + return; + } + + var cos, sin; + + if (rotation % 360) { + var r = rotation * DEG_TO_RAD; + cos = Math.cos(r); + sin = Math.sin(r); + } else { + cos = 1; + sin = 0; + } + + var a2 = cos * scaleX; + var b2 = sin * scaleX; + var c2 = -sin * scaleY; + var d2 = cos * scaleY; + + if (skewX || skewY) { + var b1 = Math.tan(skewY * DEG_TO_RAD); + var c1 = Math.tan(skewX * DEG_TO_RAD); + append(a2 + c1 * b2, b1 * a2 + b2, c2 + c1 * d2, b1 * c2 + d2, x, y); + } else { + append(a2, b2, c2, d2, x, y); + } + + if (regX || regY) { + tx -= regX * a + regY * c; + ty -= regX * b + regY * d; + hasInitialState = false; + } + } +},794,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + function peg$subclass(child, parent) { + function ctor() { + this.constructor = child; + } + + ctor.prototype = parent.prototype; + child.prototype = new ctor(); + } + + function peg$SyntaxError(message, expected, found, location) { + this.message = message; + this.expected = expected; + this.found = found; + this.location = location; + this.name = "SyntaxError"; + + if (typeof Error.captureStackTrace === "function") { + Error.captureStackTrace(this, peg$SyntaxError); + } + } + + peg$subclass(peg$SyntaxError, Error); + + peg$SyntaxError.buildMessage = function (expected, found) { + var DESCRIBE_EXPECTATION_FNS = { + literal: function literal(expectation) { + return "\"" + literalEscape(expectation.text) + "\""; + }, + "class": function _class(expectation) { + var escapedParts = "", + i; + + for (i = 0; i < expectation.parts.length; i++) { + escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]); + } + + return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]"; + }, + any: function any(expectation) { + return "any character"; + }, + end: function end(expectation) { + return "end of input"; + }, + other: function other(expectation) { + return expectation.description; + } + }; + + function hex(ch) { + return ch.charCodeAt(0).toString(16).toUpperCase(); + } + + function literalEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + + function classEscape(s) { + return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) { + return '\\x0' + hex(ch); + }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { + return '\\x' + hex(ch); + }); + } + + function describeExpectation(expectation) { + return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation); + } + + function describeExpected(expected) { + var descriptions = new Array(expected.length), + i, + j; + + for (i = 0; i < expected.length; i++) { + descriptions[i] = describeExpectation(expected[i]); + } + + descriptions.sort(); + + if (descriptions.length > 0) { + for (i = 1, j = 1; i < descriptions.length; i++) { + if (descriptions[i - 1] !== descriptions[i]) { + descriptions[j] = descriptions[i]; + j++; + } + } + + descriptions.length = j; + } + + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1]; + } + } + + function describeFound(found) { + return found ? "\"" + literalEscape(found) + "\"" : "end of input"; + } + + return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found."; + }; + + function peg$parse(input, options) { + options = options !== undefined ? options : {}; + + var peg$FAILED = {}, + peg$startRuleFunctions = { + transformList: peg$parsetransformList + }, + peg$startRuleFunction = peg$parsetransformList, + peg$c0 = function peg$c0(ts) { + return ts; + }, + peg$c1 = function peg$c1(t, ts) { + return multiply_matrices(t, ts); + }, + peg$c2 = "matrix", + peg$c3 = peg$literalExpectation("matrix", false), + peg$c4 = "(", + peg$c5 = peg$literalExpectation("(", false), + peg$c6 = ")", + peg$c7 = peg$literalExpectation(")", false), + peg$c8 = function peg$c8(a, b, c, d, e, f) { + return [a, c, e, b, d, f]; + }, + peg$c9 = "translate", + peg$c10 = peg$literalExpectation("translate", false), + peg$c11 = function peg$c11(tx, ty) { + return [1, 0, tx, 0, 1, ty || 0]; + }, + peg$c12 = "scale", + peg$c13 = peg$literalExpectation("scale", false), + peg$c14 = function peg$c14(sx, sy) { + return [sx, 0, 0, 0, sy === null ? sx : sy, 0]; + }, + peg$c15 = "rotate", + peg$c16 = peg$literalExpectation("rotate", false), + peg$c17 = function peg$c17(angle, c) { + var cos = Math.cos(deg2rad * angle); + var sin = Math.sin(deg2rad * angle); + + if (c !== null) { + var x = c[0]; + var y = c[1]; + return [cos, -sin, cos * -x + -sin * -y + x, sin, cos, sin * -x + cos * -y + y]; + } + + return [cos, -sin, 0, sin, cos, 0]; + }, + peg$c18 = "skewX", + peg$c19 = peg$literalExpectation("skewX", false), + peg$c20 = function peg$c20(angle) { + return [1, Math.tan(deg2rad * angle), 0, 0, 1, 0]; + }, + peg$c21 = "skewY", + peg$c22 = peg$literalExpectation("skewY", false), + peg$c23 = function peg$c23(angle) { + return [1, 0, 0, Math.tan(deg2rad * angle), 1, 0]; + }, + peg$c24 = function peg$c24(f) { + return parseFloat(f.join("")); + }, + peg$c25 = function peg$c25(i) { + return parseInt(i.join("")); + }, + peg$c26 = function peg$c26(n) { + return n; + }, + peg$c27 = function peg$c27(n1, n2) { + return [n1, n2]; + }, + peg$c28 = ",", + peg$c29 = peg$literalExpectation(",", false), + peg$c30 = function peg$c30(ds) { + return ds.join(""); + }, + peg$c31 = function peg$c31(f) { + return f.join(""); + }, + peg$c32 = function peg$c32(d) { + return d.join(""); + }, + peg$c33 = peg$otherExpectation("fractionalConstant"), + peg$c34 = ".", + peg$c35 = peg$literalExpectation(".", false), + peg$c36 = function peg$c36(d1, d2) { + return [d1 ? d1.join("") : null, ".", d2.join("")].join(""); + }, + peg$c37 = /^[eE]/, + peg$c38 = peg$classExpectation(["e", "E"], false, false), + peg$c39 = function peg$c39(e) { + return [e[0], e[1], e[2].join("")].join(""); + }, + peg$c40 = /^[+\-]/, + peg$c41 = peg$classExpectation(["+", "-"], false, false), + peg$c42 = /^[0-9]/, + peg$c43 = peg$classExpectation([["0", "9"]], false, false), + peg$c44 = /^[ \t\r\n]/, + peg$c45 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false), + peg$currPos = 0, + peg$savedPos = 0, + peg$posDetailsCache = [{ + line: 1, + column: 1 + }], + peg$maxFailPos = 0, + peg$maxFailExpected = [], + peg$silentFails = 0, + peg$result; + + if ("startRule" in options) { + if (!(options.startRule in peg$startRuleFunctions)) { + throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); + } + + peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; + } + + function peg$literalExpectation(text, ignoreCase) { + return { + type: "literal", + text: text, + ignoreCase: ignoreCase + }; + } + + function peg$classExpectation(parts, inverted, ignoreCase) { + return { + type: "class", + parts: parts, + inverted: inverted, + ignoreCase: ignoreCase + }; + } + + function peg$endExpectation() { + return { + type: "end" + }; + } + + function peg$otherExpectation(description) { + return { + type: "other", + description: description + }; + } + + function peg$computePosDetails(pos) { + var details = peg$posDetailsCache[pos], + p; + + if (details) { + return details; + } else { + p = pos - 1; + + while (!peg$posDetailsCache[p]) { + p--; + } + + details = peg$posDetailsCache[p]; + details = { + line: details.line, + column: details.column + }; + + while (p < pos) { + if (input.charCodeAt(p) === 10) { + details.line++; + details.column = 1; + } else { + details.column++; + } + + p++; + } + + peg$posDetailsCache[pos] = details; + return details; + } + } + + function peg$computeLocation(startPos, endPos) { + var startPosDetails = peg$computePosDetails(startPos), + endPosDetails = peg$computePosDetails(endPos); + return { + start: { + offset: startPos, + line: startPosDetails.line, + column: startPosDetails.column + }, + end: { + offset: endPos, + line: endPosDetails.line, + column: endPosDetails.column + } + }; + } + + function peg$fail(expected) { + if (peg$currPos < peg$maxFailPos) { + return; + } + + if (peg$currPos > peg$maxFailPos) { + peg$maxFailPos = peg$currPos; + peg$maxFailExpected = []; + } + + peg$maxFailExpected.push(expected); + } + + function peg$buildStructuredError(expected, found, location) { + return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location); + } + + function peg$parsetransformList() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewsp(); + + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsewsp(); + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsetransforms(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsewsp(); + + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsewsp(); + } + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c0(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsetransforms() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$parsetransform(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsecommaWsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsecommaWsp(); + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsetransforms(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c1(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$parsetransform(); + } + + return s0; + } + + function peg$parsetransform() { + var s0; + s0 = peg$parsematrix(); + + if (s0 === peg$FAILED) { + s0 = peg$parsetranslate(); + + if (s0 === peg$FAILED) { + s0 = peg$parsescale(); + + if (s0 === peg$FAILED) { + s0 = peg$parserotate(); + + if (s0 === peg$FAILED) { + s0 = peg$parseskewX(); + + if (s0 === peg$FAILED) { + s0 = peg$parseskewY(); + } + } + } + } + } + + return s0; + } + + function peg$parsematrix() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c2) { + s1 = peg$c2; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c3); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsewsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsewsp(); + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c5); + } + } + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsewsp(); + + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsewsp(); + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsenumber(); + + if (s5 !== peg$FAILED) { + s6 = peg$parsecommaWsp(); + + if (s6 !== peg$FAILED) { + s7 = peg$parsenumber(); + + if (s7 !== peg$FAILED) { + s8 = peg$parsecommaWsp(); + + if (s8 !== peg$FAILED) { + s9 = peg$parsenumber(); + + if (s9 !== peg$FAILED) { + s10 = peg$parsecommaWsp(); + + if (s10 !== peg$FAILED) { + s11 = peg$parsenumber(); + + if (s11 !== peg$FAILED) { + s12 = peg$parsecommaWsp(); + + if (s12 !== peg$FAILED) { + s13 = peg$parsenumber(); + + if (s13 !== peg$FAILED) { + s14 = peg$parsecommaWsp(); + + if (s14 !== peg$FAILED) { + s15 = peg$parsenumber(); + + if (s15 !== peg$FAILED) { + s16 = []; + s17 = peg$parsewsp(); + + while (s17 !== peg$FAILED) { + s16.push(s17); + s17 = peg$parsewsp(); + } + + if (s16 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s17 = peg$c6; + peg$currPos++; + } else { + s17 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c7); + } + } + + if (s17 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c8(s5, s7, s9, s11, s13, s15); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsetranslate() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 9) === peg$c9) { + s1 = peg$c9; + peg$currPos += 9; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c10); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsewsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsewsp(); + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c5); + } + } + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsewsp(); + + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsewsp(); + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsenumber(); + + if (s5 !== peg$FAILED) { + s6 = peg$parsecommaWspNumber(); + + if (s6 === peg$FAILED) { + s6 = null; + } + + if (s6 !== peg$FAILED) { + s7 = []; + s8 = peg$parsewsp(); + + while (s8 !== peg$FAILED) { + s7.push(s8); + s8 = peg$parsewsp(); + } + + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s8 = peg$c6; + peg$currPos++; + } else { + s8 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c7); + } + } + + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c11(s5, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsescale() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c12) { + s1 = peg$c12; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c13); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsewsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsewsp(); + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c5); + } + } + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsewsp(); + + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsewsp(); + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsenumber(); + + if (s5 !== peg$FAILED) { + s6 = peg$parsecommaWspNumber(); + + if (s6 === peg$FAILED) { + s6 = null; + } + + if (s6 !== peg$FAILED) { + s7 = []; + s8 = peg$parsewsp(); + + while (s8 !== peg$FAILED) { + s7.push(s8); + s8 = peg$parsewsp(); + } + + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s8 = peg$c6; + peg$currPos++; + } else { + s8 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c7); + } + } + + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c14(s5, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parserotate() { + var s0, s1, s2, s3, s4, s5, s6, s7, s8; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 6) === peg$c15) { + s1 = peg$c15; + peg$currPos += 6; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c16); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsewsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsewsp(); + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c5); + } + } + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsewsp(); + + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsewsp(); + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsenumber(); + + if (s5 !== peg$FAILED) { + s6 = peg$parsecommaWspTwoNumbers(); + + if (s6 === peg$FAILED) { + s6 = null; + } + + if (s6 !== peg$FAILED) { + s7 = []; + s8 = peg$parsewsp(); + + while (s8 !== peg$FAILED) { + s7.push(s8); + s8 = peg$parsewsp(); + } + + if (s7 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s8 = peg$c6; + peg$currPos++; + } else { + s8 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c7); + } + } + + if (s8 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c17(s5, s6); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseskewX() { + var s0, s1, s2, s3, s4, s5, s6, s7; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c18) { + s1 = peg$c18; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c19); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsewsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsewsp(); + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c5); + } + } + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsewsp(); + + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsewsp(); + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsenumber(); + + if (s5 !== peg$FAILED) { + s6 = []; + s7 = peg$parsewsp(); + + while (s7 !== peg$FAILED) { + s6.push(s7); + s7 = peg$parsewsp(); + } + + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s7 = peg$c6; + peg$currPos++; + } else { + s7 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c7); + } + } + + if (s7 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c20(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parseskewY() { + var s0, s1, s2, s3, s4, s5, s6, s7; + s0 = peg$currPos; + + if (input.substr(peg$currPos, 5) === peg$c21) { + s1 = peg$c21; + peg$currPos += 5; + } else { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c22); + } + } + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsewsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsewsp(); + } + + if (s2 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 40) { + s3 = peg$c4; + peg$currPos++; + } else { + s3 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c5); + } + } + + if (s3 !== peg$FAILED) { + s4 = []; + s5 = peg$parsewsp(); + + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$parsewsp(); + } + + if (s4 !== peg$FAILED) { + s5 = peg$parsenumber(); + + if (s5 !== peg$FAILED) { + s6 = []; + s7 = peg$parsewsp(); + + while (s7 !== peg$FAILED) { + s6.push(s7); + s7 = peg$parsewsp(); + } + + if (s6 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 41) { + s7 = peg$c6; + peg$currPos++; + } else { + s7 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c7); + } + } + + if (s7 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c23(s5); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsenumber() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsesign(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsefloatingPointConstant(); + + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c24(s1); + } + + s0 = s1; + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsesign(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + if (s2 !== peg$FAILED) { + s3 = peg$parseintegerConstant(); + + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c25(s1); + } + + s0 = s1; + } + + return s0; + } + + function peg$parsecommaWspNumber() { + var s0, s1, s2; + s0 = peg$currPos; + s1 = peg$parsecommaWsp(); + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c26(s2); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsecommaWspTwoNumbers() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = peg$parsecommaWsp(); + + if (s1 !== peg$FAILED) { + s2 = peg$parsenumber(); + + if (s2 !== peg$FAILED) { + s3 = peg$parsecommaWsp(); + + if (s3 !== peg$FAILED) { + s4 = peg$parsenumber(); + + if (s4 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c27(s2, s4); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsecommaWsp() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = []; + s2 = peg$parsewsp(); + + if (s2 !== peg$FAILED) { + while (s2 !== peg$FAILED) { + s1.push(s2); + s2 = peg$parsewsp(); + } + } else { + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + s2 = peg$parsecomma(); + + if (s2 === peg$FAILED) { + s2 = null; + } + + if (s2 !== peg$FAILED) { + s3 = []; + s4 = peg$parsewsp(); + + while (s4 !== peg$FAILED) { + s3.push(s4); + s4 = peg$parsewsp(); + } + + if (s3 !== peg$FAILED) { + s1 = [s1, s2, s3]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsecomma(); + + if (s1 !== peg$FAILED) { + s2 = []; + s3 = peg$parsewsp(); + + while (s3 !== peg$FAILED) { + s2.push(s3); + s3 = peg$parsewsp(); + } + + if (s2 !== peg$FAILED) { + s1 = [s1, s2]; + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + return s0; + } + + function peg$parsecomma() { + var s0; + + if (input.charCodeAt(peg$currPos) === 44) { + s0 = peg$c28; + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c29); + } + } + + return s0; + } + + function peg$parseintegerConstant() { + var s0, s1; + s0 = peg$currPos; + s1 = peg$parsedigitSequence(); + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c30(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsefloatingPointConstant() { + var s0, s1, s2, s3; + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsefractionalConstant(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseexponent(); + + if (s3 === peg$FAILED) { + s3 = null; + } + + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c31(s1); + } + + s0 = s1; + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$currPos; + s2 = peg$parsedigitSequence(); + + if (s2 !== peg$FAILED) { + s3 = peg$parseexponent(); + + if (s3 !== peg$FAILED) { + s2 = [s2, s3]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c32(s1); + } + + s0 = s1; + } + + return s0; + } + + function peg$parsefractionalConstant() { + var s0, s1, s2, s3; + peg$silentFails++; + s0 = peg$currPos; + s1 = peg$parsedigitSequence(); + + if (s1 === peg$FAILED) { + s1 = null; + } + + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s2 = peg$c34; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c35); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsedigitSequence(); + + if (s3 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c36(s1, s3); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + + if (s0 === peg$FAILED) { + s0 = peg$currPos; + s1 = peg$parsedigitSequence(); + + if (s1 !== peg$FAILED) { + if (input.charCodeAt(peg$currPos) === 46) { + s2 = peg$c34; + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c35); + } + } + + if (s2 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c32(s1); + s0 = s1; + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } else { + peg$currPos = s0; + s0 = peg$FAILED; + } + } + + peg$silentFails--; + + if (s0 === peg$FAILED) { + s1 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c33); + } + } + + return s0; + } + + function peg$parseexponent() { + var s0, s1, s2, s3, s4; + s0 = peg$currPos; + s1 = peg$currPos; + + if (peg$c37.test(input.charAt(peg$currPos))) { + s2 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s2 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c38); + } + } + + if (s2 !== peg$FAILED) { + s3 = peg$parsesign(); + + if (s3 === peg$FAILED) { + s3 = null; + } + + if (s3 !== peg$FAILED) { + s4 = peg$parsedigitSequence(); + + if (s4 !== peg$FAILED) { + s2 = [s2, s3, s4]; + s1 = s2; + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + } else { + peg$currPos = s1; + s1 = peg$FAILED; + } + + if (s1 !== peg$FAILED) { + peg$savedPos = s0; + s1 = peg$c39(s1); + } + + s0 = s1; + return s0; + } + + function peg$parsesign() { + var s0; + + if (peg$c40.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c41); + } + } + + return s0; + } + + function peg$parsedigitSequence() { + var s0, s1; + s0 = []; + s1 = peg$parsedigit(); + + if (s1 !== peg$FAILED) { + while (s1 !== peg$FAILED) { + s0.push(s1); + s1 = peg$parsedigit(); + } + } else { + s0 = peg$FAILED; + } + + return s0; + } + + function peg$parsedigit() { + var s0; + + if (peg$c42.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c43); + } + } + + return s0; + } + + function peg$parsewsp() { + var s0; + + if (peg$c44.test(input.charAt(peg$currPos))) { + s0 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s0 = peg$FAILED; + + if (peg$silentFails === 0) { + peg$fail(peg$c45); + } + } + + return s0; + } + + var deg2rad = Math.PI / 180; + + function multiply_matrices(l, r) { + var al = l[0]; + var cl = l[1]; + var el = l[2]; + var bl = l[3]; + var dl = l[4]; + var fl = l[5]; + var ar = r[0]; + var cr = r[1]; + var er = r[2]; + var br = r[3]; + var dr = r[4]; + var fr = r[5]; + var a = al * ar + cl * br; + var c = al * cr + cl * dr; + var e = al * er + cl * fr + el; + var b = bl * ar + dl * br; + var d = bl * cr + dl * dr; + var f = bl * er + dl * fr + fl; + return [a, c, e, b, d, f]; + } + + peg$result = peg$startRuleFunction(); + + if (peg$result !== peg$FAILED && peg$currPos === input.length) { + return peg$result; + } else { + if (peg$result !== peg$FAILED && peg$currPos < input.length) { + peg$fail(peg$endExpectation()); + } + + throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)); + } + } + + module.exports = { + SyntaxError: peg$SyntaxError, + parse: peg$parse + }; +},795,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Circle = function (_Shape) { + (0, _inherits2.default)(Circle, _Shape); + + var _super = _createSuper(Circle); + + function Circle() { + (0, _classCallCheck2.default)(this, Circle); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Circle, [{ + key: "render", + value: function render() { + var props = this.props; + var cx = props.cx, + cy = props.cy, + r = props.r; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).RNSVGCircle, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[10]).extract)(this, props), { + cx: cx, + cy: cy, + r: r + })); + } + }]); + return Circle; + }(_Shape2.default); + + exports.default = Circle; + Circle.displayName = 'Circle'; + Circle.defaultProps = { + cx: 0, + cy: 0, + r: 0 + }; +},796,[5,6,7,8,12,14,16,17,781,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Ellipse = function (_Shape) { + (0, _inherits2.default)(Ellipse, _Shape); + + var _super = _createSuper(Ellipse); + + function Ellipse() { + (0, _classCallCheck2.default)(this, Ellipse); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Ellipse, [{ + key: "render", + value: function render() { + var props = this.props; + var cx = props.cx, + cy = props.cy, + rx = props.rx, + ry = props.ry; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).RNSVGEllipse, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[10]).extract)(this, props), { + cx: cx, + cy: cy, + rx: rx, + ry: ry + })); + } + }]); + return Ellipse; + }(_Shape2.default); + + exports.default = Ellipse; + Ellipse.displayName = 'Ellipse'; + Ellipse.defaultProps = { + cx: 0, + cy: 0, + rx: 0, + ry: 0 + }; +},797,[5,6,7,8,12,14,16,17,781,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Path = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _extractPolyPoints = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Polygon = function (_Shape) { + (0, _inherits2.default)(Polygon, _Shape); + + var _super = _createSuper(Polygon); + + function Polygon() { + var _this; + + (0, _classCallCheck2.default)(this, Polygon); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.setNativeProps = function (props) { + var points = props.points; + + if (points) { + props.d = "M" + (0, _extractPolyPoints.default)(points) + "z"; + } + + _this.root && _this.root.setNativeProps(props); + }; + + return _this; + } + + (0, _createClass2.default)(Polygon, [{ + key: "render", + value: function render() { + var props = this.props; + var points = props.points; + return _react.default.createElement(_Path.default, (0, _extends2.default)({ + ref: this.refMethod, + d: points && "M" + (0, _extractPolyPoints.default)(points) + "z" + }, props)); + } + }]); + return Polygon; + }(_Shape2.default); + + exports.default = Polygon; + Polygon.displayName = 'Polygon'; + Polygon.defaultProps = { + points: '' + }; +},798,[5,6,7,8,12,14,16,17,799,781,800]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Path = function (_Shape) { + (0, _inherits2.default)(Path, _Shape); + + var _super = _createSuper(Path); + + function Path() { + (0, _classCallCheck2.default)(this, Path); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Path, [{ + key: "render", + value: function render() { + var props = this.props; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).RNSVGPath, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[10]).extract)(this, props), { + d: props.d + })); + } + }]); + return Path; + }(_Shape2.default); + + exports.default = Path; + Path.displayName = 'Path'; +},799,[5,6,7,8,12,14,16,17,781,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractPolyPoints; + + function extractPolyPoints(points) { + var polyPoints = Array.isArray(points) ? points.join(',') : points; + return polyPoints.replace(/[^e]-/, ' -').split(/(?:\s+|\s*,\s*)/g).join(' '); + } +},800,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Path = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _extractPolyPoints = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Polyline = function (_Shape) { + (0, _inherits2.default)(Polyline, _Shape); + + var _super = _createSuper(Polyline); + + function Polyline() { + var _this; + + (0, _classCallCheck2.default)(this, Polyline); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.setNativeProps = function (props) { + var points = props.points; + + if (points) { + props.d = "M" + (0, _extractPolyPoints.default)(points); + } + + _this.root && _this.root.setNativeProps(props); + }; + + return _this; + } + + (0, _createClass2.default)(Polyline, [{ + key: "render", + value: function render() { + var props = this.props; + var points = props.points; + return _react.default.createElement(_Path.default, (0, _extends2.default)({ + ref: this.refMethod, + d: points && "M" + (0, _extractPolyPoints.default)(points) + }, props)); + } + }]); + return Polyline; + }(_Shape2.default); + + exports.default = Polyline; + Polyline.displayName = 'Polyline'; + Polyline.defaultProps = { + points: '' + }; +},801,[5,6,7,8,12,14,16,17,799,781,800]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Line = function (_Shape) { + (0, _inherits2.default)(Line, _Shape); + + var _super = _createSuper(Line); + + function Line() { + (0, _classCallCheck2.default)(this, Line); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Line, [{ + key: "render", + value: function render() { + var props = this.props; + var x1 = props.x1, + y1 = props.y1, + x2 = props.x2, + y2 = props.y2; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).RNSVGLine, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[10]).extract)(this, props), { + x1: x1, + y1: y1, + x2: x2, + y2: y2 + })); + } + }]); + return Line; + }(_Shape2.default); + + exports.default = Line; + Line.displayName = 'Line'; + Line.defaultProps = { + x1: 0, + y1: 0, + x2: 0, + y2: 0 + }; +},802,[5,6,7,8,12,14,16,17,781,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _extractResponder = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _extractViewBox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _extractColor = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _G = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RNSVGSvgViewManager = _reactNative.NativeModules.RNSVGSvgViewManager; + + var styles = _reactNative.StyleSheet.create({ + svg: { + backgroundColor: 'transparent', + borderWidth: 0 + } + }); + + var defaultStyle = styles.svg; + + var Svg = function (_Shape) { + (0, _inherits2.default)(Svg, _Shape); + + var _super = _createSuper(Svg); + + function Svg() { + var _this; + + (0, _classCallCheck2.default)(this, Svg); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.measureInWindow = function (callback) { + var _assertThisInitialize = (0, _assertThisInitialized2.default)(_this), + root = _assertThisInitialize.root; + + root && root.measureInWindow(callback); + }; + + _this.measure = function (callback) { + var _assertThisInitialize2 = (0, _assertThisInitialized2.default)(_this), + root = _assertThisInitialize2.root; + + root && root.measure(callback); + }; + + _this.measureLayout = function (relativeToNativeNode, onSuccess, onFail) { + var _assertThisInitialize3 = (0, _assertThisInitialized2.default)(_this), + root = _assertThisInitialize3.root; + + root && root.measureLayout(relativeToNativeNode, onSuccess, onFail); + }; + + _this.setNativeProps = function (props) { + var width = props.width, + height = props.height; + + if (width) { + props.bbWidth = width; + } + + if (height) { + props.bbHeight = height; + } + + var _assertThisInitialize4 = (0, _assertThisInitialized2.default)(_this), + root = _assertThisInitialize4.root; + + root && root.setNativeProps(props); + }; + + _this.toDataURL = function (callback, options) { + if (!callback) { + return; + } + + var handle = (0, _reactNative.findNodeHandle)(_this.root); + RNSVGSvgViewManager.toDataURL(handle, options, callback); + }; + + return _this; + } + + (0, _createClass2.default)(Svg, [{ + key: "render", + value: function render() { + var _this$props = this.props, + style = _this$props.style, + opacity = _this$props.opacity, + viewBox = _this$props.viewBox, + children = _this$props.children, + onLayout = _this$props.onLayout, + preserveAspectRatio = _this$props.preserveAspectRatio, + extracted = (0, _objectWithoutProperties2.default)(_this$props, ["style", "opacity", "viewBox", "children", "onLayout", "preserveAspectRatio"]); + var stylesAndProps = (0, _extends2.default)({}, Array.isArray(style) ? Object.assign.apply(Object, [{}].concat((0, _toConsumableArray2.default)(style))) : style, extracted); + var color = stylesAndProps.color, + width = stylesAndProps.width, + height = stylesAndProps.height, + focusable = stylesAndProps.focusable, + font = stylesAndProps.font, + transform = stylesAndProps.transform, + fill = stylesAndProps.fill, + fillOpacity = stylesAndProps.fillOpacity, + fillRule = stylesAndProps.fillRule, + stroke = stylesAndProps.stroke, + strokeWidth = stylesAndProps.strokeWidth, + strokeOpacity = stylesAndProps.strokeOpacity, + strokeDasharray = stylesAndProps.strokeDasharray, + strokeDashoffset = stylesAndProps.strokeDashoffset, + strokeLinecap = stylesAndProps.strokeLinecap, + strokeLinejoin = stylesAndProps.strokeLinejoin, + strokeMiterlimit = stylesAndProps.strokeMiterlimit; + + if (width === undefined && height === undefined) { + width = height = '100%'; + } + + var props = extracted; + props.focusable = Boolean(focusable) && focusable !== 'false'; + var rootStyles = [defaultStyle]; + + if (style) { + rootStyles.push(style); + } + + var override = false; + var overrideStyles = {}; + var o = opacity != null ? +opacity : NaN; + + if (!isNaN(o)) { + override = true; + overrideStyles.opacity = o; + } + + if (width && height) { + override = true; + var w = parseInt(width, 10); + var h = parseInt(height, 10); + var doNotParseWidth = isNaN(w) || width[width.length - 1] === '%'; + var doNotParseHeight = isNaN(h) || height[height.length - 1] === '%'; + overrideStyles.width = doNotParseWidth ? width : w; + overrideStyles.height = doNotParseHeight ? height : h; + overrideStyles.flex = 0; + } + + if (override) { + rootStyles.push(overrideStyles); + } + + props.style = rootStyles.length > 1 ? rootStyles : defaultStyle; + + if (width != null) { + props.bbWidth = width; + } + + if (height != null) { + props.bbHeight = height; + } + + (0, _extractResponder.default)(props, props, this); + var tint = (0, _extractColor.default)(color); + + if (tint != null) { + props.color = tint; + props.tintColor = tint; + } + + if (onLayout != null) { + props.onLayout = onLayout; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).RNSVGSvg, (0, _extends2.default)({}, props, { + ref: this.refMethod + }, (0, _extractViewBox.default)({ + viewBox: viewBox, + preserveAspectRatio: preserveAspectRatio + })), _react.default.createElement(_G.default, { + children: children, + style: style, + font: font, + transform: transform, + fill: fill, + fillOpacity: fillOpacity, + fillRule: fillRule, + stroke: stroke, + strokeWidth: strokeWidth, + strokeOpacity: strokeOpacity, + strokeDasharray: strokeDasharray, + strokeDashoffset: strokeDashoffset, + strokeLinecap: strokeLinecap, + strokeLinejoin: strokeLinejoin, + strokeMiterlimit: strokeMiterlimit + })); + } + }]); + return Svg; + }(_Shape2.default); + + exports.default = Svg; + Svg.displayName = 'Svg'; + Svg.defaultProps = { + preserveAspectRatio: 'xMidYMid meet' + }; +},803,[5,21,6,108,7,8,15,12,14,16,17,28,791,804,787,781,805,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractViewBox; + exports.alignEnum = exports.meetOrSliceTypes = undefined; + var meetOrSliceTypes = { + meet: 0, + slice: 1, + none: 2 + }; + exports.meetOrSliceTypes = meetOrSliceTypes; + var alignEnum = ['xMinYMin', 'xMidYMin', 'xMaxYMin', 'xMinYMid', 'xMidYMid', 'xMaxYMid', 'xMinYMax', 'xMidYMax', 'xMaxYMax', 'none'].reduce(function (prev, name) { + prev[name] = name; + return prev; + }, {}); + exports.alignEnum = alignEnum; + var spacesRegExp = /\s+/; + + function extractViewBox(props) { + var viewBox = props.viewBox, + preserveAspectRatio = props.preserveAspectRatio; + + if (!viewBox) { + return null; + } + + var params = (Array.isArray(viewBox) ? viewBox : viewBox.trim().split(spacesRegExp)).map(Number); + + if (params.length !== 4 || params.some(isNaN)) { + console.warn('Invalid `viewBox` prop:' + viewBox); + return null; + } + + var modes = preserveAspectRatio ? preserveAspectRatio.trim().split(spacesRegExp) : []; + var align = modes[0]; + var meetOrSlice = modes[1]; + return { + minX: params[0], + minY: params[1], + vbWidth: params[2], + vbHeight: params[3], + align: alignEnum[align] || 'xMidYMid', + meetOrSlice: meetOrSliceTypes[meetOrSlice] || 0 + }; + } +},804,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractProps = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _extractTransform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var G = function (_Shape) { + (0, _inherits2.default)(G, _Shape); + + var _super = _createSuper(G); + + function G() { + var _this; + + (0, _classCallCheck2.default)(this, G); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.setNativeProps = function (props) { + var matrix = !props.matrix && (0, _extractTransform.default)(props); + + if (matrix) { + props.matrix = matrix; + } + + _this.root && _this.root.setNativeProps(props); + }; + + return _this; + } + + (0, _createClass2.default)(G, [{ + key: "render", + value: function render() { + var props = this.props; + var prop = (0, _extractProps.propsAndStyles)(props); + var extractedProps = (0, _extractProps.default)(prop, this); + var font = (0, _$$_REQUIRE(_dependencyMap[11]).extractFont)(prop); + + if (hasProps(font)) { + extractedProps.font = font; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).RNSVGGroup, (0, _extends2.default)({ + ref: this.refMethod + }, extractedProps), props.children); + } + }]); + return G; + }(_Shape2.default); + + exports.default = G; + G.displayName = 'G'; + + var hasProps = function hasProps(obj) { + for (var _ in obj) { + return true; + } + + return false; + }; +},805,[5,6,7,8,12,14,16,17,784,793,781,806,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.extractFont = extractFont; + exports.setTSpan = setTSpan; + exports.default = extractText; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _extractLengthList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var fontRegExp = /^\s*((?:(?:normal|bold|italic)\s+)*)(?:(\d+(?:\.\d+)?(?:%|px|em|pt|pc|mm|cm|in]))*(?:\s*\/.*?)?\s+)?\s*"?([^"]*)/i; + var fontFamilyPrefix = /^[\s"']*/; + var fontFamilySuffix = /[\s"']*$/; + var commaReg = /\s*,\s*/g; + var cachedFontObjectsFromString = {}; + + function extractSingleFontFamily(fontFamilyString) { + return fontFamilyString ? fontFamilyString.split(commaReg)[0].replace(fontFamilyPrefix, '').replace(fontFamilySuffix, '') : null; + } + + function parseFontString(font) { + if (cachedFontObjectsFromString.hasOwnProperty(font)) { + return cachedFontObjectsFromString[font]; + } + + var match = fontRegExp.exec(font); + + if (!match) { + cachedFontObjectsFromString[font] = null; + return null; + } + + var isBold = /bold/.exec(match[1]); + var isItalic = /italic/.exec(match[1]); + cachedFontObjectsFromString[font] = { + fontSize: match[2] || 12, + fontWeight: isBold ? 'bold' : 'normal', + fontStyle: isItalic ? 'italic' : 'normal', + fontFamily: extractSingleFontFamily(match[3]) + }; + return cachedFontObjectsFromString[font]; + } + + function extractFont(props) { + var fontData = props.fontData, + fontStyle = props.fontStyle, + fontVariant = props.fontVariant, + fontWeight = props.fontWeight, + fontStretch = props.fontStretch, + fontSize = props.fontSize, + fontFamily = props.fontFamily, + textAnchor = props.textAnchor, + textDecoration = props.textDecoration, + letterSpacing = props.letterSpacing, + wordSpacing = props.wordSpacing, + kerning = props.kerning, + fontFeatureSettings = props.fontFeatureSettings, + fontVariantLigatures = props.fontVariantLigatures, + fontVariationSettings = props.fontVariationSettings, + font = props.font; + var ownedFont = (0, _$$_REQUIRE(_dependencyMap[4]).pickNotNil)({ + fontData: fontData, + fontStyle: fontStyle, + fontVariant: fontVariant, + fontWeight: fontWeight, + fontStretch: fontStretch, + fontSize: fontSize, + fontFamily: extractSingleFontFamily(fontFamily), + textAnchor: textAnchor, + textDecoration: textDecoration, + letterSpacing: letterSpacing, + wordSpacing: wordSpacing, + kerning: kerning, + fontFeatureSettings: fontFeatureSettings, + fontVariantLigatures: fontVariantLigatures, + fontVariationSettings: fontVariationSettings + }); + var baseFont = typeof font === 'string' ? parseFontString(font) : font; + return (0, _extends2.default)({}, baseFont, ownedFont); + } + + var TSpan; + + function setTSpan(TSpanImplementation) { + TSpan = TSpanImplementation; + } + + function getChild(child) { + if (typeof child === 'string' || typeof child === 'number') { + return _react.default.createElement(TSpan, null, String(child)); + } else { + return child; + } + } + + function extractText(props, container) { + var x = props.x, + y = props.y, + dx = props.dx, + dy = props.dy, + rotate = props.rotate, + children = props.children, + inlineSize = props.inlineSize, + baselineShift = props.baselineShift, + verticalAlign = props.verticalAlign, + alignmentBaseline = props.alignmentBaseline; + var textChildren = typeof children === 'string' || typeof children === 'number' ? container ? _react.default.createElement(TSpan, null, String(children)) : null : _react.Children.count(children) > 1 || Array.isArray(children) ? _react.Children.map(children, getChild) : children; + return { + content: textChildren === null ? String(children) : null, + children: textChildren, + inlineSize: inlineSize, + baselineShift: baselineShift, + verticalAlign: verticalAlign, + alignmentBaseline: alignmentBaseline, + font: extractFont(props), + x: (0, _extractLengthList.default)(x), + y: (0, _extractLengthList.default)(y), + dx: (0, _extractLengthList.default)(dx), + dy: (0, _extractLengthList.default)(dy), + rotate: (0, _extractLengthList.default)(rotate) + }; + } +},806,[5,6,17,790,792]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _extractProps = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _extractTransform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + _$$_REQUIRE(_dependencyMap[12]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Text = function (_Shape) { + (0, _inherits2.default)(Text, _Shape); + + var _super = _createSuper(Text); + + function Text() { + var _this; + + (0, _classCallCheck2.default)(this, Text); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.setNativeProps = function (props) { + var matrix = props && !props.matrix && (0, _extractTransform.default)(props); + + if (matrix) { + props.matrix = matrix; + } + + var prop = (0, _extractProps.propsAndStyles)(props); + (0, _extends2.default)(prop, (0, _$$_REQUIRE(_dependencyMap[13]).pickNotNil)((0, _extractText.default)(prop, true))); + _this.root && _this.root.setNativeProps(prop); + }; + + return _this; + } + + (0, _createClass2.default)(Text, [{ + key: "render", + value: function render() { + var prop = (0, _extractProps.propsAndStyles)(this.props); + var props = (0, _extractProps.default)((0, _extends2.default)({}, prop, { + x: null, + y: null + }), this); + (0, _extends2.default)(props, (0, _extractText.default)(prop, true)); + props.ref = this.refMethod; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).RNSVGText, props); + } + }]); + return Text; + }(_Shape2.default); + + exports.default = Text; + Text.displayName = 'Text'; +},807,[5,6,7,8,12,14,16,17,806,784,793,781,808,792,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractProps = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _extractTransform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _extractText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TSpan = function (_Shape) { + (0, _inherits2.default)(TSpan, _Shape); + + var _super = _createSuper(TSpan); + + function TSpan() { + var _this; + + (0, _classCallCheck2.default)(this, TSpan); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.setNativeProps = function (props) { + var matrix = !props.matrix && (0, _extractTransform.default)(props); + + if (matrix) { + props.matrix = matrix; + } + + var prop = (0, _extractProps.propsAndStyles)(props); + (0, _extends2.default)(prop, (0, _$$_REQUIRE(_dependencyMap[12]).pickNotNil)((0, _extractText.default)(prop, false))); + _this.root && _this.root.setNativeProps(prop); + }; + + return _this; + } + + (0, _createClass2.default)(TSpan, [{ + key: "render", + value: function render() { + var prop = (0, _extractProps.propsAndStyles)(this.props); + var props = (0, _extractProps.default)((0, _extends2.default)({}, prop, { + x: null, + y: null + }), this); + (0, _extends2.default)(props, (0, _extractText.default)(prop, false)); + props.ref = this.refMethod; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).RNSVGTSpan, props); + } + }]); + return TSpan; + }(_Shape2.default); + + exports.default = TSpan; + TSpan.displayName = 'TSpan'; + (0, _extractText.setTSpan)(TSpan); +},808,[5,6,7,8,12,14,16,17,784,793,806,781,792,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _extractTransform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _extractText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _TSpan = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TextPath = function (_Shape) { + (0, _inherits2.default)(TextPath, _Shape); + + var _super = _createSuper(TextPath); + + function TextPath() { + var _this; + + (0, _classCallCheck2.default)(this, TextPath); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.setNativeProps = function (props) { + var matrix = !props.matrix && (0, _extractTransform.default)(props); + + if (matrix) { + props.matrix = matrix; + } + + (0, _extends2.default)(props, (0, _$$_REQUIRE(_dependencyMap[13]).pickNotNil)((0, _extractText.default)(props, true))); + _this.root && _this.root.setNativeProps(props); + }; + + return _this; + } + + (0, _createClass2.default)(TextPath, [{ + key: "render", + value: function render() { + var _this$props = this.props, + children = _this$props.children, + xlinkHref = _this$props.xlinkHref, + _this$props$href = _this$props.href, + href = _this$props$href === undefined ? xlinkHref : _this$props$href, + _this$props$startOffs = _this$props.startOffset, + startOffset = _this$props$startOffs === undefined ? 0 : _this$props$startOffs, + method = _this$props.method, + spacing = _this$props.spacing, + side = _this$props.side, + alignmentBaseline = _this$props.alignmentBaseline, + midLine = _this$props.midLine, + prop = (0, _objectWithoutProperties2.default)(_this$props, ["children", "xlinkHref", "href", "startOffset", "method", "spacing", "side", "alignmentBaseline", "midLine"]); + var matched = href && href.match(_$$_REQUIRE(_dependencyMap[13]).idPattern); + var match = matched && matched[1]; + + if (match) { + var props = (0, _$$_REQUIRE(_dependencyMap[14]).withoutXY)(this, prop); + (0, _extends2.default)(props, (0, _extractText.default)({ + children: children + }, true), { + href: match, + startOffset: startOffset, + method: method, + spacing: spacing, + side: side, + alignmentBaseline: alignmentBaseline, + midLine: midLine + }); + props.ref = this.refMethod; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).RNSVGTextPath, props); + } + + console.warn('Invalid `href` prop for `TextPath` element, expected a href like "#id", but got: "' + href + '"'); + return _react.default.createElement(_TSpan.default, { + ref: this.refMethod + }, children); + } + }]); + return TextPath; + }(_Shape2.default); + + exports.default = TextPath; + TextPath.displayName = 'TextPath'; +},809,[5,108,6,7,8,12,14,16,17,793,806,781,808,792,784,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Use = function (_Shape) { + (0, _inherits2.default)(Use, _Shape); + + var _super = _createSuper(Use); + + function Use() { + (0, _classCallCheck2.default)(this, Use); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Use, [{ + key: "render", + value: function render() { + var props = this.props; + var children = props.children, + x = props.x, + y = props.y, + width = props.width, + height = props.height, + xlinkHref = props.xlinkHref, + _props$href = props.href, + href = _props$href === undefined ? xlinkHref : _props$href; + var matched = href && href.match(_$$_REQUIRE(_dependencyMap[9]).idPattern); + var match = matched && matched[1]; + + if (!match) { + console.warn('Invalid `href` prop for `Use` element, expected a href like "#id", but got: "' + href + '"'); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).RNSVGUse, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[11]).withoutXY)(this, props), { + href: match, + x: x, + y: y, + width: width, + height: height + }), children); + } + }]); + return Use; + }(_Shape2.default); + + exports.default = Use; + Use.displayName = 'Use'; + Use.defaultProps = { + x: 0, + y: 0, + width: 0, + height: 0 + }; +},810,[5,6,7,8,12,14,16,17,781,792,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var spacesRegExp = /\s+/; + + var SvgImage = function (_Shape) { + (0, _inherits2.default)(SvgImage, _Shape); + + var _super = _createSuper(SvgImage); + + function SvgImage() { + (0, _classCallCheck2.default)(this, SvgImage); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(SvgImage, [{ + key: "render", + value: function render() { + var props = this.props; + var preserveAspectRatio = props.preserveAspectRatio, + x = props.x, + y = props.y, + width = props.width, + height = props.height, + xlinkHref = props.xlinkHref, + _props$href = props.href, + href = _props$href === undefined ? xlinkHref : _props$href; + var modes = preserveAspectRatio ? preserveAspectRatio.trim().split(spacesRegExp) : []; + var align = modes[0]; + var meetOrSlice = modes[1]; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).RNSVGImage, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[11]).withoutXY)(this, props), { + x: x, + y: y, + width: width, + height: height, + meetOrSlice: _$$_REQUIRE(_dependencyMap[12]).meetOrSliceTypes[meetOrSlice] || 0, + align: _$$_REQUIRE(_dependencyMap[12]).alignEnum[align] || 'xMidYMid', + src: !href ? null : _reactNative.Image.resolveAssetSource(typeof href === 'string' ? { + uri: href + } : href) + })); + } + }]); + return SvgImage; + }(_Shape2.default); + + exports.default = SvgImage; + SvgImage.displayName = 'Image'; + SvgImage.defaultProps = { + x: 0, + y: 0, + width: 0, + height: 0, + preserveAspectRatio: 'xMidYMid meet' + }; +},811,[5,6,7,8,12,14,16,17,28,781,783,784,804]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractViewBox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Symbol = function (_Shape) { + (0, _inherits2.default)(Symbol, _Shape); + + var _super = _createSuper(Symbol); + + function Symbol() { + (0, _classCallCheck2.default)(this, Symbol); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Symbol, [{ + key: "render", + value: function render() { + var props = this.props; + var id = props.id, + children = props.children; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).RNSVGSymbol, (0, _extends2.default)({ + ref: this.refMethod, + name: id + }, (0, _extractViewBox.default)(props)), children); + } + }]); + return Symbol; + }(_Shape2.default); + + exports.default = Symbol; + Symbol.displayName = 'Symbol'; +},812,[5,6,7,8,12,14,16,17,804,781,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Defs = function (_Component) { + (0, _inherits2.default)(Defs, _Component); + + var _super = _createSuper(Defs); + + function Defs() { + (0, _classCallCheck2.default)(this, Defs); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Defs, [{ + key: "render", + value: function render() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[7]).RNSVGDefs, null, this.props.children); + } + }]); + return Defs; + }(_react.Component); + + exports.default = Defs; + Defs.displayName = 'Defs'; +},813,[5,7,8,12,14,16,17,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractGradient = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var LinearGradient = function (_Shape) { + (0, _inherits2.default)(LinearGradient, _Shape); + + var _super = _createSuper(LinearGradient); + + function LinearGradient() { + (0, _classCallCheck2.default)(this, LinearGradient); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(LinearGradient, [{ + key: "render", + value: function render() { + var props = this.props; + var x1 = props.x1, + y1 = props.y1, + x2 = props.x2, + y2 = props.y2; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).RNSVGLinearGradient, (0, _extends2.default)({ + ref: this.refMethod, + x1: x1, + y1: y1, + x2: x2, + y2: y2 + }, (0, _extractGradient.default)(props, this))); + } + }]); + return LinearGradient; + }(_Shape2.default); + + exports.default = LinearGradient; + LinearGradient.displayName = 'LinearGradient'; + LinearGradient.defaultProps = { + x1: '0%', + y1: '0%', + x2: '100%', + y2: '0%' + }; +},814,[5,6,7,8,12,14,16,17,815,781,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = extractGradient; + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _extractColor = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _extractOpacity = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + var _extractTransform = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); + + var _units = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var percentReg = /^([+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)(%?)$/; + + function percentToFloat(percent) { + if (typeof percent === 'number') { + return percent; + } + + if (typeof percent === 'object' && typeof percent.__getAnimatedValue === 'function') { + return percent.__getAnimatedValue(); + } + + var matched = typeof percent === 'string' && percent.match(percentReg); + + if (!matched) { + console.warn("\"" + percent + "\" is not a valid number or percentage string."); + return 0; + } + + return matched[2] ? +matched[1] / 100 : +matched[1]; + } + + var offsetComparator = function offsetComparator(object, other) { + return object[0] - other[0]; + }; + + function extractGradient(props, parent) { + var id = props.id, + children = props.children, + gradientTransform = props.gradientTransform, + transform = props.transform, + gradientUnits = props.gradientUnits; + + if (!id) { + return null; + } + + var stops = []; + var childArray = children ? _react.Children.map(children, function (child) { + return _react.default.cloneElement(child, { + parent: parent + }); + }) : []; + var l = childArray.length; + + for (var i = 0; i < l; i++) { + var _childArray$i$props = childArray[i].props, + style = _childArray$i$props.style, + _childArray$i$props$o = _childArray$i$props.offset, + offset = _childArray$i$props$o === undefined ? style && style.offset : _childArray$i$props$o, + _childArray$i$props$s = _childArray$i$props.stopColor, + stopColor = _childArray$i$props$s === undefined ? style && style.stopColor || '#000' : _childArray$i$props$s, + _childArray$i$props$s2 = _childArray$i$props.stopOpacity, + stopOpacity = _childArray$i$props$s2 === undefined ? style && style.stopOpacity : _childArray$i$props$s2; + var offsetNumber = percentToFloat(offset || 0); + var color = stopColor && (0, _extractColor.default)(stopColor); + + if (typeof color !== 'number' || isNaN(offsetNumber)) { + console.warn("\"" + stopColor + "\" is not a valid color or \"" + offset + "\" is not a valid offset"); + continue; + } + + var alpha = Math.round((0, _extractOpacity.default)(stopOpacity) * 255); + stops.push([offsetNumber, color & 0x00ffffff | alpha << 24]); + } + + stops.sort(offsetComparator); + var gradient = []; + var k = stops.length; + + for (var j = 0; j < k; j++) { + var s = stops[j]; + gradient.push(s[0], s[1]); + } + + return { + name: id, + gradient: gradient, + children: childArray, + gradientUnits: gradientUnits && _units.default[gradientUnits] || 0, + gradientTransform: (0, _extractTransform.default)(gradientTransform || transform || props) + }; + } +},815,[17,5,787,788,793,816]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.units = undefined; + var units = { + objectBoundingBox: 0, + userSpaceOnUse: 1 + }; + exports.units = units; + var _default = units; + exports.default = _default; +},816,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractGradient = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RadialGradient = function (_Shape) { + (0, _inherits2.default)(RadialGradient, _Shape); + + var _super = _createSuper(RadialGradient); + + function RadialGradient() { + (0, _classCallCheck2.default)(this, RadialGradient); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(RadialGradient, [{ + key: "render", + value: function render() { + var props = this.props; + var rx = props.rx, + ry = props.ry, + r = props.r, + cx = props.cx, + cy = props.cy, + _props$fx = props.fx, + fx = _props$fx === undefined ? cx : _props$fx, + _props$fy = props.fy, + fy = _props$fy === undefined ? cy : _props$fy; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).RNSVGRadialGradient, (0, _extends2.default)({ + ref: this.refMethod, + fx: fx, + fy: fy, + rx: rx || r, + ry: ry || r, + cx: cx, + cy: cy + }, (0, _extractGradient.default)(props, this))); + } + }]); + return RadialGradient; + }(_Shape2.default); + + exports.default = RadialGradient; + RadialGradient.displayName = 'RadialGradient'; + RadialGradient.defaultProps = { + cx: '50%', + cy: '50%', + r: '50%' + }; +},817,[5,6,7,8,12,14,16,17,815,781,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[6]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Stop = function (_Component) { + (0, _inherits2.default)(Stop, _Component); + + var _super = _createSuper(Stop); + + function Stop() { + var _this; + + (0, _classCallCheck2.default)(this, Stop); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.setNativeProps = function () { + var parent = _this.props.parent; + + if (parent) { + parent.forceUpdate(); + } + }; + + return _this; + } + + (0, _createClass2.default)(Stop, [{ + key: "render", + value: function render() { + return null; + } + }]); + return Stop; + }(_react.Component); + + exports.default = Stop; + Stop.displayName = 'Stop'; +},818,[5,7,8,12,14,16,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ClipPath = function (_Shape) { + (0, _inherits2.default)(ClipPath, _Shape); + + var _super = _createSuper(ClipPath); + + function ClipPath() { + (0, _classCallCheck2.default)(this, ClipPath); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(ClipPath, [{ + key: "render", + value: function render() { + var props = this.props; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).RNSVGClipPath, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[10]).extract)(this, props)), props.children); + } + }]); + return ClipPath; + }(_Shape2.default); + + exports.default = ClipPath; + ClipPath.displayName = 'ClipPath'; +},819,[5,6,7,8,12,14,16,17,781,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractTransform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _extractViewBox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _units = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Pattern = function (_Shape) { + (0, _inherits2.default)(Pattern, _Shape); + + var _super = _createSuper(Pattern); + + function Pattern() { + (0, _classCallCheck2.default)(this, Pattern); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Pattern, [{ + key: "render", + value: function render() { + var props = this.props; + var patternTransform = props.patternTransform, + transform = props.transform, + id = props.id, + x = props.x, + y = props.y, + width = props.width, + height = props.height, + patternUnits = props.patternUnits, + patternContentUnits = props.patternContentUnits, + children = props.children, + viewBox = props.viewBox, + preserveAspectRatio = props.preserveAspectRatio; + var matrix = (0, _extractTransform.default)(patternTransform || transform || props); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).RNSVGPattern, (0, _extends2.default)({ + ref: this.refMethod, + name: id, + x: x, + y: y, + width: width, + height: height, + matrix: matrix, + patternTransform: matrix, + patternUnits: patternUnits && _units.default[patternUnits] || 0, + patternContentUnits: patternContentUnits ? _units.default[patternContentUnits] : 1 + }, (0, _extractViewBox.default)({ + viewBox: viewBox, + preserveAspectRatio: preserveAspectRatio + })), children); + } + }]); + return Pattern; + }(_Shape2.default); + + exports.default = Pattern; + Pattern.displayName = 'Pattern'; + Pattern.defaultProps = { + x: '0%', + y: '0%', + width: '100%', + height: '100%' + }; +},820,[5,6,7,8,12,14,16,17,793,804,816,781,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractTransform = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _units = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Mask = function (_Shape) { + (0, _inherits2.default)(Mask, _Shape); + + var _super = _createSuper(Mask); + + function Mask() { + (0, _classCallCheck2.default)(this, Mask); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Mask, [{ + key: "render", + value: function render() { + var props = this.props; + var maskTransform = props.maskTransform, + transform = props.transform, + x = props.x, + y = props.y, + width = props.width, + height = props.height, + maskUnits = props.maskUnits, + maskContentUnits = props.maskContentUnits, + children = props.children; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).RNSVGMask, (0, _extends2.default)({ + ref: this.refMethod + }, (0, _$$_REQUIRE(_dependencyMap[12]).withoutXY)(this, props), { + x: x, + y: y, + width: width, + height: height, + maskTransform: (0, _extractTransform.default)(maskTransform || transform || props), + maskUnits: maskUnits !== undefined ? _units.default[maskUnits] : 0, + maskContentUnits: maskContentUnits !== undefined ? _units.default[maskContentUnits] : 1 + }), children); + } + }]); + return Mask; + }(_Shape2.default); + + exports.default = Mask; + Mask.displayName = 'Mask'; + Mask.defaultProps = { + x: '0%', + y: '0%', + width: '100%', + height: '100%' + }; +},821,[5,6,7,8,12,14,16,17,793,816,781,783,784]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extractViewBox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Shape2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Marker = function (_Shape) { + (0, _inherits2.default)(Marker, _Shape); + + var _super = _createSuper(Marker); + + function Marker() { + (0, _classCallCheck2.default)(this, Marker); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Marker, [{ + key: "render", + value: function render() { + var props = this.props; + var id = props.id, + viewBox = props.viewBox, + preserveAspectRatio = props.preserveAspectRatio, + refX = props.refX, + refY = props.refY, + markerUnits = props.markerUnits, + orient = props.orient, + markerWidth = props.markerWidth, + markerHeight = props.markerHeight, + children = props.children; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).RNSVGMarker, (0, _extends2.default)({ + ref: this.refMethod, + name: id, + refX: refX, + refY: refY, + orient: String(orient), + markerUnits: markerUnits, + markerWidth: markerWidth, + markerHeight: markerHeight + }, (0, _extractViewBox.default)({ + viewBox: viewBox, + preserveAspectRatio: preserveAspectRatio + })), children); + } + }]); + return Marker; + }(_Shape2.default); + + exports.default = Marker; + Marker.displayName = 'Marker'; + Marker.defaultProps = { + refX: 0, + refY: 0, + orient: '0', + markerWidth: 3, + markerHeight: 3, + markerUnits: 'strokeWidth' + }; +},822,[5,6,7,8,12,14,16,17,804,781,783]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SvgCss = SvgCss; + exports.SvgCssUri = SvgCssUri; + exports.SvgWithCssUri = exports.SvgWithCss = exports.inlineStyles = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _cssTree = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _cssSelect = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (it) return (it = it.call(o)).next.bind(it); if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + + function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + + function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + + function isTag(node) { + return typeof node === 'object'; + } + + function getParent(node) { + return typeof node === 'object' && node.parent || null; + } + + function getChildren(node) { + return typeof node === 'object' && node.children || []; + } + + function getName(elem) { + return elem.tag; + } + + function getText(_node) { + return ''; + } + + function getAttributeValue(elem, name) { + return elem.props[name] || null; + } + + function removeSubsets(nodes) { + var idx = nodes.length, + node, + ancestor, + replace; + + while (--idx > -1) { + node = ancestor = nodes[idx]; + delete nodes[idx]; + replace = true; + + while (ancestor) { + if (nodes.includes(ancestor)) { + replace = false; + nodes.splice(idx, 1); + break; + } + + ancestor = typeof ancestor === 'object' && ancestor.parent || null; + } + + if (replace) { + nodes[idx] = node; + } + } + + return nodes; + } + + function existsOne(predicate, elems) { + return elems.some(function (elem) { + return typeof elem === 'object' && (predicate(elem) || existsOne(predicate, elem.children)); + }); + } + + function getSiblings(node) { + var parent = typeof node === 'object' && node.parent; + return parent && parent.children || []; + } + + function hasAttrib(elem, name) { + return elem.props.hasOwnProperty(name); + } + + function findOne(predicate, elems) { + var elem; + + for (var i = 0, l = elems.length; i < l && !elem; i++) { + var node = elems[i]; + + if (typeof node === 'string') {} else if (predicate(node)) { + elem = node; + } else { + var children = node.children; + + if (children.length !== 0) { + elem = findOne(predicate, children); + } + } + } + + return elem; + } + + function findAll(predicate, nodes) { + var result = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + + for (var i = 0, j = nodes.length; i < j; i++) { + var node = nodes[i]; + + if (typeof node !== 'object') { + continue; + } + + if (predicate(node)) { + result.push(node); + } + + var children = node.children; + + if (children.length !== 0) { + findAll(predicate, children, result); + } + } + + return result; + } + + var adapter = { + removeSubsets: removeSubsets, + existsOne: existsOne, + getSiblings: getSiblings, + hasAttrib: hasAttrib, + findOne: findOne, + findAll: findAll, + isTag: isTag, + getParent: getParent, + getChildren: getChildren, + getName: getName, + getText: getText, + getAttributeValue: getAttributeValue + }; + var cssSelectOpts = { + xmlMode: true, + adapter: adapter + }; + + function querySelectorAll(query, elems) { + return (0, _cssSelect.default)(query, elems, cssSelectOpts); + } + + function flattenToSelectors(cssAst, selectors) { + _cssTree.default.walk(cssAst, { + visit: 'Rule', + enter: function enter(rule) { + var _ref = rule, + type = _ref.type, + prelude = _ref.prelude; + + if (type !== 'Rule') { + return; + } + + var atrule = this.atrule; + prelude.children.each(function (node, item) { + var _ref2 = node, + children = _ref2.children; + var pseudos = []; + selectors.push({ + item: item, + atrule: atrule, + rule: rule, + pseudos: pseudos + }); + children.each(function (_ref3, pseudoItem, list) { + var childType = _ref3.type; + + if (childType === 'PseudoClassSelector' || childType === 'PseudoElementSelector') { + pseudos.push({ + item: pseudoItem, + list: list + }); + } + }); + }); + } + }); + } + + function filterByMqs(selectors) { + return selectors.filter(function (_ref4) { + var atrule = _ref4.atrule; + + if (atrule === null) { + return true; + } + + var name = atrule.name, + prelude = atrule.prelude; + var atPrelude = prelude; + var first = atPrelude && atPrelude.children.first(); + var mq = first && first.type === 'MediaQueryList'; + var query = mq ? _cssTree.default.generate(atPrelude) : name; + return useMqs.includes(query); + }); + } + + var useMqs = ['', 'screen']; + + function filterByPseudos(selectors) { + return selectors.filter(function (_ref5) { + var pseudos = _ref5.pseudos; + return usePseudos.includes(_cssTree.default.generate({ + type: 'Selector', + children: new _cssTree.List().fromArray(pseudos.map(function (pseudo) { + return pseudo.item.data; + })) + })); + }); + } + + var usePseudos = ['']; + + function cleanPseudos(selectors) { + selectors.forEach(function (_ref6) { + var pseudos = _ref6.pseudos; + return pseudos.forEach(function (pseudo) { + return pseudo.list.remove(pseudo.item); + }); + }); + } + + function specificity(selector) { + var A = 0; + var B = 0; + var C = 0; + selector.children.each(function walk(node) { + switch (node.type) { + case 'SelectorList': + case 'Selector': + node.children.each(walk); + break; + + case 'IdSelector': + A++; + break; + + case 'ClassSelector': + case 'AttributeSelector': + B++; + break; + + case 'PseudoClassSelector': + switch (node.name.toLowerCase()) { + case 'not': + var children = node.children; + children && children.each(walk); + break; + + case 'before': + case 'after': + case 'first-line': + case 'first-letter': + C++; + break; + + default: + B++; + } + + break; + + case 'PseudoElementSelector': + C++; + break; + + case 'TypeSelector': + var name = node.name; + + if (name.charAt(name.length - 1) !== '*') { + C++; + } + + break; + } + }); + return [A, B, C]; + } + + function compareSpecificity(aSpecificity, bSpecificity) { + for (var i = 0; i < 4; i += 1) { + if (aSpecificity[i] < bSpecificity[i]) { + return -1; + } else if (aSpecificity[i] > bSpecificity[i]) { + return 1; + } + } + + return 0; + } + + function selectorWithSpecificity(selector) { + return { + selector: selector, + specificity: specificity(selector.item.data) + }; + } + + function bySelectorSpecificity(a, b) { + return compareSpecificity(a.specificity, b.specificity); + } + + function pass(arr, len, chk, result) { + var dbl = chk * 2; + var l, r, e; + var li, ri; + var i = 0; + + for (l = 0; l < len; l += dbl) { + r = l + chk; + e = r + chk; + + if (r > len) { + r = len; + } + + if (e > len) { + e = len; + } + + li = l; + ri = r; + + while (true) { + if (li < r && ri < e) { + if (bySelectorSpecificity(arr[li], arr[ri]) <= 0) { + result[i++] = arr[li++]; + } else { + result[i++] = arr[ri++]; + } + } else if (li < r) { + result[i++] = arr[li++]; + } else if (ri < e) { + result[i++] = arr[ri++]; + } else { + break; + } + } + } + } + + function exec(arr, len) { + var buffer = new Array(len); + + for (var chk = 1; chk < len; chk *= 2) { + pass(arr, len, chk, buffer); + var tmp = arr; + arr = buffer; + buffer = tmp; + } + + return arr; + } + + function sortSelectors(selectors) { + var len = selectors.length; + + if (len <= 1) { + return selectors; + } + + var specs = selectors.map(selectorWithSpecificity); + return exec(specs, len).map(function (s) { + return s.selector; + }); + } + + var declarationParseProps = { + context: 'declarationList', + parseValue: false + }; + + function CSSStyleDeclaration(ast) { + var props = ast.props, + styles = ast.styles; + + if (!props.style) { + props.style = {}; + } + + var style = props.style; + var priority = new Map(); + ast.style = style; + ast.priority = priority; + + if (!styles || styles.length === 0) { + return; + } + + try { + var declarations = _cssTree.default.parse(styles, declarationParseProps); + + declarations.children.each(function (node) { + try { + var _ref7 = node, + property = _ref7.property, + value = _ref7.value, + important = _ref7.important; + var name = property.trim(); + priority.set(name, important); + style[(0, _$$_REQUIRE(_dependencyMap[11]).camelCase)(name)] = _cssTree.default.generate(value).trim(); + } catch (styleError) { + if (styleError.message !== 'Unknown node type: undefined') { + console.warn("Warning: Parse error when parsing inline styles, style properties of this element cannot be used. The raw styles can still be get/set using .attr('style').value. Error details: " + styleError); + } + } + }); + } catch (parseError) { + console.warn("Warning: Parse error when parsing inline styles, style properties of this element cannot be used. The raw styles can still be get/set using .attr('style').value. Error details: " + parseError); + } + } + + function initStyle(selectedEl) { + if (!selectedEl.style) { + CSSStyleDeclaration(selectedEl); + } + + return selectedEl; + } + + function closestElem(node, elemName) { + var elem = node; + + while ((elem = elem.parent) && elem.tag !== elemName) {} + + return elem; + } + + var parseProps = { + parseValue: false, + parseCustomProperty: false + }; + + var inlineStyles = function inlineStyles(document) { + var styleElements = querySelectorAll('style', document); + + if (styleElements.length === 0) { + return document; + } + + var selectors = []; + + for (var _iterator = _createForOfIteratorHelperLoose(styleElements), _step; !(_step = _iterator()).done;) { + var element = _step.value; + var children = element.children; + + if (!children.length || closestElem(element, 'foreignObject')) { + continue; + } + + try { + var styleString = children.join(''); + flattenToSelectors(_cssTree.default.parse(styleString, parseProps), selectors); + } catch (parseError) { + console.warn('Warning: Parse error of styles of "; + var direction = _$$_REQUIRE(_dependencyMap[31]).PlatformUtils.isRTL() ? " dir='rtl'" : ""; + var body = ""; + var image = "
"; + var html = "" + head + body + headerHtml + image + disclaimerHtml + copyrightHtml + ""; + return html; + } + }, { + key: "_getArticleCrop", + value: function _getArticleCrop(data, contentSize, area) { + var _this4 = this; + + var _this$props2 = this.props, + index = _this$props2.index, + edition = _this$props2.edition, + page = _this$props2.page, + newspaper = _this$props2.newspaper, + isActive = _this$props2.isActive, + article = _this$props2.article, + navigation = _this$props2.navigation; + var offsetX = data.offsetX, + offsetY = data.offsetY, + boxesInfo = data.boxesInfo, + hrScale = data.hrScale; + var graphJpg = page.getGraphImage(); + var textGif = page.getGifImage(); + var textImage = page.getImageByType(_EPaperImage.EPaperImageType.TEXT); + var isPdf = textImage && textImage.isTextPDF(); + var hasTextGif = !isPdf && textGif; + var hrZip = page.getHrZip(); + var _this$pageSize2 = this.pageSize, + pageWidth = _this$pageSize2.pageWidth, + pageHeight = _this$pageSize2.pageHeight; + + var _global$getActivePSet4 = global.getActivePSetup(), + pdfThumbnailRatio = _global$getActivePSet4.pdfThumbnailRatio, + showExtrasInArticleGraphicMode = _global$getActivePSet4.showExtrasInArticleGraphicMode; + + var lowQualityRatio = pdfThumbnailRatio * 72 / 150; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + enableArticleExtras = _global$getNewsmemory.enableArticleExtras; + + return _react.default.createElement(_reactNative.View, { + ref: function ref(_ref4) { + _this4.graphRef = _ref4; + }, + style: [contentSize, this.customStyle, { + margin: 0 + }], + onLayout: function onLayout() {} + }, data.boxes.map(function (boxItem, boxIndex) { + var box = boxItem.box, + graph = boxItem.graph, + text = boxItem.text, + style = boxItem.style, + useImageDimensions = boxItem.useImageDimensions; + var start = style.start - offsetX + _this4.graphMargin; + var top = style.top - offsetY + _this4.graphMargin; + var pathGraph = graph ? graph.getBase64() : undefined; + var pathText = text ? text.getBase64() : undefined; + var item = { + boxStyle: style, + path: pathGraph, + pathText: pathText + }; + var scaledStyle = { + top: top * area.scale, + start: start * area.scale, + width: style.width * area.scale, + height: style.height * area.scale + }; + + var visible = _$$_REQUIRE(_dependencyMap[31]).JSUtils.intersectRect(area, scaledStyle); + + var commonProps = { + issue: edition.getIssue(), + edition: edition.getEdition(), + pageId: page.getPageId(), + boxId: box.getId(), + xmlId: parseInt(data.xmlId, 10), + newspaper: newspaper, + page: page, + zipGraphArchivePath: hrZip ? hrZip.getBase64() : undefined, + visible: visible + }; + var textGifProps = {}; + + if (hasTextGif) { + textGifProps = { + showAll: true, + onTextLoaded: _this4.incrementLoadedBoxes, + onTextError: _this4.incrementLoadedBoxes + }; + } + + var commonStyle = { + position: "absolute", + width: style.width, + height: style.height + }; + + var hrComponent = _react.default.createElement(_hrContainerComponent.default, (0, _extends2.default)({ + ref: _this4.onHrRef, + item: item, + style: commonStyle, + onGraphLoaded: _this4.incrementLoadedBoxes, + onGraphError: _this4.incrementLoadedBoxes, + hidden: !isActive(index), + hrScale: hrScale, + useImageDimensions: useImageDimensions + }, textGifProps, commonProps)); + + var textComponent = isPdf ? _react.default.createElement(_pdfBoxComponent.default, { + coordinates: { + origin: { + x: style.start, + y: style.top + }, + size: { + width: style.width, + height: style.height + } + }, + offset: { + x: boxesInfo.getTotalOffsetX(), + y: boxesInfo.getTotalOffsetY(), + scale: boxesInfo.getScaleX() + }, + pageId: page.getPageId(), + artId: commonProps.xmlId, + pageSize: { + width: pageWidth, + height: pageHeight + }, + scale: visible ? area.scale : lowQualityRatio, + path: _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory() + "/" + textImage.getBase64(), + style: commonStyle, + visible: _$$_REQUIRE(_dependencyMap[31]).PlatformUtils.isAndroid() || visible + }) : null; + var parentStyle = [{ + start: start, + top: top + }, commonStyle]; + parentStyle = _pageUtils.default.traverseStyleForRTL(parentStyle); + + var baseLocalPath = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(); + + return _react.default.createElement(_reactNative.View, { + key: "hr_" + boxIndex, + style: parentStyle + }, graphJpg ? _react.default.createElement(_graphBoxComponent.default, { + index: index, + coordinates: { + origin: { + x: style.start, + y: style.top + }, + size: { + width: style.width, + height: style.height + } + }, + visible: true, + style: commonStyle, + path: baseLocalPath + graphJpg.getBase64() + }) : null, hasTextGif ? _react.default.createElement(_graphBoxComponent.default, { + index: index, + coordinates: { + origin: { + x: style.start, + y: style.top + }, + size: { + width: style.width, + height: style.height + } + }, + visible: !visible, + style: commonStyle, + path: baseLocalPath + textGif.getBase64() + }) : null, hrComponent, textComponent); + }), showExtrasInArticleGraphicMode ? _react.default.createElement(_pageExtraComponent.default, { + key: "extra", + ref: function ref(_ref3) { + _this4.articleExtraRef = _ref3; + + _this4.checkArticleExtra(); + }, + navigation: navigation, + edition: newspaper.getEditionModel(), + page: page, + article: article, + size: contentSize, + pageSize: { + width: pageWidth, + height: pageHeight + }, + zoom: area.scale, + style: [{ + backgroundColor: _$$_REQUIRE(_dependencyMap[31]).colors.transparent, + position: "absolute", + top: this.graphMargin, + start: this.graphMargin, + end: this.graphMargin, + bottom: this.graphMargin + }, contentSize], + offset: { + offsetX: data.offsetX, + offsetY: data.offsetY + }, + hidden: !enableArticleExtras + }) : null); + } + }, { + key: "_getRealScale", + value: function _getRealScale() { + var page = this.props.page; + + var pageDips = _newsmemoryUtils.default.getHorizontalPageDips(page); + + if (page && page.isDoubleTruck()) { + pageDips *= 2; + } + + var realScale = pageDips / this.pageSize.pageWidth; + return realScale; + } + }, { + key: "_getDoubleTapScale", + value: function _getDoubleTapScale() { + var realScale = this._getRealScale(); + + var graphUserScaleFactor = _newsmemoryUtils.default.getZoomingFactor(); + + return realScale * graphUserScaleFactor; + } + }, { + key: "_isSingleTapToZoomEnabled", + value: function _isSingleTapToZoomEnabled() { + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + singleTapToZoom = _global$getNewsmemory2.singleTapToZoom; + + return singleTapToZoom; + } + }, { + key: "_onScaleChange", + value: function _onScaleChange(scale) { + var _this$props3 = this.props, + isActive = _this$props3.isActive, + index = _this$props3.index; + + if (this.currentScale !== scale) { + this.currentScale = scale; + + if (isActive(index)) { + var isScaleFit = this.isFitScale(); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.TOGGLE_GRAPH_UNFIT_CHANGE_BUTTON_VISIBILITY, { + visible: isScaleFit + }); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.TOGGLE_GRAPH_CHANGE_BUTTON_VISIBILITY, { + visible: !isScaleFit + }); + } + } + } + }, { + key: "_onExtraPress", + value: function _onExtraPress(event) { + var hasExtra = false; + + if (event && this.articleExtraRef) { + hasExtra = this.articleExtraRef.hasExtraForEvent((0, _extends2.default)({}, event, { + margin: this.graphMargin + })); + } + + return hasExtra; + } + }, { + key: "isFitScale", + value: function isFitScale() { + return this.currentScale === this.fitScale; + } + }, { + key: "_checkArticleExtra", + value: function _checkArticleExtra() { + var _this$props4 = this.props, + index = _this$props4.index, + isActive = _this$props4.isActive; + + if (this.articleExtraRef && isActive(index)) { + var hasExtra = this.articleExtraRef.hasExtras(); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.TOGGLE_ARTICLE_EXTRA_CHANGE_BUTTON_VISIBILITY, { + visible: hasExtra + }); + + var _global$getActivePSet5 = global.getActivePSetup(), + previewHighlightEnabled = _global$getActivePSet5.previewHighlightEnabled; + + if (hasExtra && previewHighlightEnabled) { + this.articleExtraRef.highlight(); + } + } + } + }, { + key: "toggleArticleExtra", + value: function toggleArticleExtra() { + if (this.articleExtraRef) { + var _this$props5 = this.props, + index = _this$props5.index, + isActive = _this$props5.isActive; + + var _global$getActivePSet6 = global.getActivePSetup(), + previewHighlightEnabled = _global$getActivePSet6.previewHighlightEnabled; + + this.articleExtraRef.toggle(previewHighlightEnabled && isActive(index)); + } + } + }, { + key: "renderGraph", + value: function renderGraph() { + var _this5 = this; + + var _this$props6 = this.props, + viewPagerRef = _this$props6.viewPagerRef, + article = _this$props6.article, + page = _this$props6.page, + goNext = _this$props6.goNext, + goPrev = _this$props6.goPrev, + onLongPress = _this$props6.onLongPress, + isActive = _this$props6.isActive, + index = _this$props6.index, + onGraphLoadEnd = _this$props6.onGraphLoadEnd, + onSwipeDown = _this$props6.onSwipeDown, + FooterComponent = _this$props6.FooterComponent; + var size = this.state.size; + + if (size) { + var data = {}; + + var _global$getActivePSet7 = global.getActivePSetup(), + maxZoom = _global$getActivePSet7.maxZoom; + + data = _newsmemoryUtils.default.allPageArticleHrImages(page, article); + data = this._addStyleToBoxes(data); + + if (!data.width) { + return null; + } + + data.width += this.graphMargin * 2; + data.height += this.graphMargin * 2; + var scaleFit = size.width / data.width; + this.fitScale = scaleFit; + + var graphUserScaleFactor = _newsmemoryUtils.default.getZoomingFactor(); + + var realScale = this._getRealScale(); + + var fitGraphicArticle = this._fitArticle() && realScale > scaleFit; + + var doubleTapScale = this._getDoubleTapScale(); + + var startZoom = fitGraphicArticle ? scaleFit : doubleTapScale; + + if (!this.currentScale) { + this.onScaleChange(startZoom); + } + + var contentSize = { + width: data.width, + height: data.height + }; + + if (data.boxes) { + return _react.default.createElement(_zoomGraph.default, { + key: "zoomview_" + index + "_" + size.width + "_" + size.height, + index: index, + graphId: page.getPageId() + "_" + article.getXmlId(), + ref: function ref(_ref5) { + _this5.zoomViewRef = _ref5; + }, + size: size, + contentSize: contentSize, + onLoaded: function onLoaded() { + if (typeof onGraphLoadEnd === "function") { + onGraphLoadEnd(index); + } + }, + onLongPress: onLongPress, + onSwipeDown: onSwipeDown, + onSwipeLeft: goPrev, + onSwipeRight: goNext, + onScaleChange: this.onScaleChange, + onExtraTap: this.onExtraPress, + viewPagerRef: viewPagerRef, + isActive: isActive, + minZoom: Math.min(scaleFit, doubleTapScale), + zoom: startZoom, + autoZoomValue: Math.max(scaleFit, doubleTapScale), + maxZoom: maxZoom * Math.max(graphUserScaleFactor, 1), + singleTapToZoom: this.isSingleTapToZoomEnabled, + FooterComponent: FooterComponent, + renderContent: function renderContent(zoomIndex, areaInfo) { + return _this5._getArticleCrop(data, contentSize, areaInfo); + }, + spinnerColor: _newsmemoryUtils.default.getSpinnerColor() + }); + } + } + + return null; + } + }, { + key: "_onLayout", + value: function _onLayout(_ref6) { + var nativeEvent = _ref6.nativeEvent; + this.setState({ + size: nativeEvent.layout + }); + } + }, { + key: "show", + value: function show() { + var _this$props7 = this.props, + isActive = _this$props7.isActive, + index = _this$props7.index; + var render = this.state.render; + + if (render) { + if (this.hrRefs && this.hrRefs.length > 0 && isActive(index)) { + this.hrRefs.forEach(function (hrRef) { + if (hrRef) { + hrRef.show(); + } + }); + } + } else { + this.setState({ + render: true + }); + } + } + }, { + key: "hide", + value: function hide() { + var render = this.state.render; + + if (render) { + this.setState({ + render: false + }); + } + } + }, { + key: "render", + value: function render() { + var newspaper = this.props.newspaper; + var _this$state2 = this.state, + online = _this$state2.online, + render = _this$state2.render; + return _react.default.createElement(_reactNative.View, { + style: _articleGraph.default.container + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[35]).Error, { + errors: !online && !newspaper.hasHighResolutionDownloaded() ? [global.strings("msg_offline_article_graph")] : [], + style: { + zIndex: 1000 + } + }), _react.default.createElement(_reactNative.View, { + onLayout: this.onLayout, + style: _articleGraph.default.container + }, render ? this.renderGraph() : null)); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + if (!state.render && props.renderGraphContent) { + return (0, _extends2.default)({}, state, { + render: true + }); + } + + return state; + } + }]); + return ArticleGraph; + }(_react.default.Component); + + exports.default = ArticleGraph; + ArticleGraph.propTypes = { + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }).isRequired, + index: _propTypes.default.number, + edition: _propTypes.default.instanceOf(_Edition.default).isRequired, + article: _propTypes.default.instanceOf(_EPaperArticle.default).isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + goNext: _propTypes.default.func.isRequired, + goPrev: _propTypes.default.func.isRequired, + onLongPress: _propTypes.default.func, + copyrightHtml: _propTypes.default.string, + disclaimerHtml: _propTypes.default.string, + headerHtml: _propTypes.default.string, + viewPagerRef: _propTypes.default.object, + isActive: _propTypes.default.func, + renderGraphContent: _propTypes.default.bool, + FooterComponent: _propTypes.default.node, + onSwipeDown: _propTypes.default.func, + onGraphLoadEnd: _propTypes.default.func, + css: _propTypes.default.shape({ + defaultCss: _propTypes.default.string, + customCss: _propTypes.default.string + }) + }; + ArticleGraph.defaultProps = { + renderGraphContent: false + }; +},2156,[5,80,6,7,8,15,12,14,16,17,28,201,2157,2158,603,640,638,642,587,641,2159,460,1859,2160,2161,644,714,2167,715,2169,574,462,699,572,717,2171]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PdfBoxComponent; + + var PdfBox = function (_React$PureComponent) { + (0, _inherits2.default)(PdfBox, _React$PureComponent); + + var _super = _createSuper(PdfBox); + + function PdfBox(props) { + var _this; + + (0, _classCallCheck2.default)(this, PdfBox); + _this = _super.call(this, props); + _this.previousRenderScale = 1; + _this.pdfBoxComponentName = _reactNative.Platform.select({ + android: "RCTPdfBox", + ios: "RCTPdfBoxView" + }); + + if (!PdfBoxComponent) { + PdfBoxComponent = (0, _reactNative.requireNativeComponent)(_this.pdfBoxComponentName, PdfBox, { + nativeOnly: { + path: true, + onChange: true + } + }); + } + + return _this; + } + + (0, _createClass2.default)(PdfBox, [{ + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + scale = _this$props.scale, + _onPdfError = _this$props.onPdfError, + _onBoxDrawn = _this$props.onBoxDrawn, + zoom = _this$props.zoom, + path = _this$props.path, + onRefToUpdate = _this$props.onRefToUpdate, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["scale", "onPdfError", "onBoxDrawn", "zoom", "path", "onRefToUpdate"]); + return _react.default.createElement(PdfBoxComponent, (0, _extends2.default)({ + ref: function ref(component) { + _this2._root = component; + } + }, rest, { + path: path, + scale: scale, + onPdfError: function onPdfError() { + if (typeof _onPdfError === "function") { + _onPdfError(); + } + }, + onBoxDrawn: function onBoxDrawn() { + if (typeof _onBoxDrawn === "function") { + _onBoxDrawn(); + } + } + })); + } + }]); + return PdfBox; + }(_react.default.PureComponent); + + exports.default = PdfBox; + PdfBox.propTypes = (0, _extends2.default)({}, _reactNative.ViewPropTypes, { + coordinates: _propTypes.default.shape({ + origin: _propTypes.default.shape({ + x: _propTypes.default.number, + y: _propTypes.default.number + }), + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }) + }), + pageSize: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + path: _propTypes.default.string.isRequired, + pageId: _propTypes.default.number, + artId: _propTypes.default.number, + onBoxDrawn: _propTypes.default.func, + onPdfError: _propTypes.default.func, + visible: _propTypes.default.bool, + scale: _propTypes.default.number + }); + PdfBox.defaultProps = { + pageId: 0, + artId: -1 + }; +},2157,[5,6,108,7,8,12,14,16,17,201,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GraphBoxComponent; + + var GraphBox = function (_React$Component) { + (0, _inherits2.default)(GraphBox, _React$Component); + + var _super = _createSuper(GraphBox); + + function GraphBox(props) { + var _this; + + (0, _classCallCheck2.default)(this, GraphBox); + _this = _super.call(this, props); + _this.graphBoxComponentName = _reactNative.Platform.select({ + android: "RCTGraphBox", + ios: "RCTGraphBoxView" + }); + + if (!GraphBoxComponent) { + GraphBoxComponent = (0, _reactNative.requireNativeComponent)(_this.graphBoxComponentName, GraphBox, { + nativeOnly: { + path: true, + onChange: true + } + }); + } + + return _this; + } + + (0, _createClass2.default)(GraphBox, [{ + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps) { + return !_$$_REQUIRE(_dependencyMap[10]).JSUtils.equals(nextProps, this.props); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + return _react.default.createElement(GraphBoxComponent, (0, _extends2.default)({ + ref: function ref(component) { + _this2._root = component; + } + }, this.props)); + } + }]); + return GraphBox; + }(_react.default.Component); + + exports.default = GraphBox; + GraphBox.propTypes = (0, _extends2.default)({}, _reactNative.ViewPropTypes, { + coordinates: _propTypes.default.shape({ + origin: _propTypes.default.shape({ + x: _propTypes.default.number, + y: _propTypes.default.number + }), + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }) + }), + pageSize: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + path: _propTypes.default.string.isRequired, + pageId: _propTypes.default.number, + artId: _propTypes.default.number, + visible: _propTypes.default.bool + }); + GraphBox.defaultProps = { + pageId: 0, + artId: -1 + }; +},2158,[5,6,7,8,12,14,16,17,201,28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + container: { + flex: 1 + } + }); + + exports.default = _default; +},2159,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PRINT_DPI = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var RNHTMLtoPDF = _optionalPackageUtils.default.getRNHtmlToPdf(); + + var PDF_QUALITY = 3; + var PRINT_DPI = 72; + exports.PRINT_DPI = PRINT_DPI; + + var PdfUtils = function () { + function PdfUtils() { + (0, _classCallCheck2.default)(this, PdfUtils); + } + + (0, _createClass2.default)(PdfUtils, null, [{ + key: "getPDFPageInches", + value: function getPDFPageInches() { + var _global$getActivePSet = global.getActivePSetup(), + printToLetter = _global$getActivePSet.printToLetter; + + var width = printToLetter ? 8.5 : 8.3; + var height = printToLetter ? 11 : 11.7; + return { + width: width, + height: height + }; + } + }, { + key: "getPDFPagePoints", + value: function getPDFPagePoints() { + var _PdfUtils$getPDFPageI = PdfUtils.getPDFPageInches(), + width = _PdfUtils$getPDFPageI.width, + height = _PdfUtils$getPDFPageI.height; + + return { + width: Math.round(width * PRINT_DPI), + height: Math.round(height * PRINT_DPI) + }; + } + }, { + key: "pdfToPng", + value: function pdfToPng(config) { + return _regenerator.default.async(function pdfToPng$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _reactNative.NativeModules.PdfUtility.pdfToPng(config)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "htmlToPDF", + value: function htmlToPDF(options) { + var _PdfUtils$getPDFPageP, width, height, file; + + return _regenerator.default.async(function htmlToPDF$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!RNHTMLtoPDF) { + _context2.next = 6; + break; + } + + _PdfUtils$getPDFPageP = PdfUtils.getPDFPagePoints(), width = _PdfUtils$getPDFPageP.width, height = _PdfUtils$getPDFPageP.height; + _context2.next = 4; + return _regenerator.default.awrap(RNHTMLtoPDF.convert((0, _extends2.default)({ + width: width, + height: height + }, options))); + + case 4: + file = _context2.sent; + return _context2.abrupt("return", file); + + case 6: + return _context2.abrupt("return", Promise.reject()); + + case 7: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "print", + value: function print(view, size) { + var width, height, margin, scale; + return _regenerator.default.async(function print$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + width = size.width, height = size.height, margin = size.margin, scale = size.scale; + _context3.prev = 1; + return _context3.abrupt("return", _reactNative.NativeModules.PdfUtility.print({ + target: _$$_REQUIRE(_dependencyMap[7]).JSUtils.getViewByRef(view), + size: { + width: width, + height: height, + margin: margin + }, + scale: scale, + pdfQuality: PDF_QUALITY + })); + + case 5: + _context3.prev = 5; + _context3.t0 = _context3["catch"](1); + throw _context3.t0; + + case 8: + case "end": + return _context3.stop(); + } + } + }, null, null, [[1, 5]], Promise); + } + }]); + return PdfUtils; + }(); + + exports.default = PdfUtils; +},2160,[5,80,6,7,8,28,731,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNativeReanimated = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _styles = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _tapView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _gestureTimer = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _refreshComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _zoomConstants = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var set = _reactNativeReanimated.default.set, + eq = _reactNativeReanimated.default.eq, + or = _reactNativeReanimated.default.or, + add = _reactNativeReanimated.default.add, + sub = _reactNativeReanimated.default.sub, + greaterThan = _reactNativeReanimated.default.greaterThan, + atan = _reactNativeReanimated.default.atan, + abs = _reactNativeReanimated.default.abs, + multiply = _reactNativeReanimated.default.multiply, + divide = _reactNativeReanimated.default.divide, + Value = _reactNativeReanimated.default.Value, + event = _reactNativeReanimated.default.event; + + var ZoomGraphView = function (_Component) { + (0, _inherits2.default)(ZoomGraphView, _Component); + + var _super = _createSuper(ZoomGraphView); + + function ZoomGraphView(props) { + var _this; + + (0, _classCallCheck2.default)(this, ZoomGraphView); + _this = _super.call(this, props); + _this.panRef = _react.default.createRef(); + _this.pinchRef = _react.default.createRef(); + _this.progressRef = _react.default.createRef(); + _this._disableOutOfBounds = false; + var size = props.size, + contentSize = props.contentSize; + _this._enableRefreshCustomComponent = _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isIOS(); + _this._isRtl = _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isRTL(); + _this._style = { + width: Math.max(size.width, contentSize.width), + height: Math.max(size.height, contentSize.height) + }; + _this._loaded = false; + _this._gestureEndTimer = undefined; + _this.onLongPress = _this._onLongPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSingleTap = _this._onSingleTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onDoubleTap = _this._onDoubleTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRefreshCustom = _this._onRefreshCustom.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRefreshEnableCustom = _this._onRefreshEnableCustom.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRefresh = _this._onRefresh.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScaleStart = _this._onScaleStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScaling = _this._onScaling.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScaleEnd = _this._onScaleEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanXStart = _this._onPanXStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanXEnd = _this._onPanXEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanXOutOfBounds = _this._onPanXOutOfBounds.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanYStart = _this._onPanYStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanYEnd = _this._onPanYEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTopChange = _this._onTopChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRightChange = _this._onRightChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onBottomChange = _this._onBottomChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLeftChange = _this._onLeftChange.bind((0, _assertThisInitialized2.default)(_this)); + _this._initializedStatus = { + panX: false, + panY: false, + scale: false, + ready: false + }; + _this._spinnerHeight = new Value(0); + _this._currentScale = props.zoom || props.minZoom; + + _this._setDisableOutOfBounds(false); + + _this._panX = _this._isRtl ? Math.min(0, -(contentSize.width * _this._currentScale - size.width)) : 0; + _this._panY = 0; + var panTransX = new Value(_this._panX); + var panTransY = new Value(0); + _this._zoomToState = new Value(_$$_REQUIRE(_dependencyMap[19]).State.UNDETERMINED); + _this._zoomToValue = new Value(1); + _this._zoomToDragX = new Value(0); + _this._zoomToDragY = new Value(0); + var zoomToActive = eq(_this._zoomToState, _$$_REQUIRE(_dependencyMap[19]).State.ACTIVE); + _this._minZoom = new Value(props.minZoom); + _this._maxZoom = new Value(props.maxZoom); + _this._pinchFocalX = new Value(0); + _this._pinchFocalY = new Value(0); + var pinchScale = new Value(1); + var pinchState = new Value(_$$_REQUIRE(_dependencyMap[19]).State.UNDETERMINED); + var oldPinchState = new Value(_$$_REQUIRE(_dependencyMap[19]).State.UNDETERMINED); + _this._onPinchEvent = event([{ + nativeEvent: { + oldState: oldPinchState, + scale: pinchScale, + focalX: _this._pinchFocalX, + focalY: _this._pinchFocalY, + state: pinchState + } + }]); + var scale = new Value(_this._currentScale); + var pinchActive = eq(pinchState, _$$_REQUIRE(_dependencyMap[19]).State.ACTIVE); + var pinchEnd = (0, _reactNativeReanimated.and)(eq(pinchState, _$$_REQUIRE(_dependencyMap[19]).State.END), eq(oldPinchState, _$$_REQUIRE(_dependencyMap[19]).State.ACTIVE)); + _this._focalDisplacementX = new Value(0); + _this._focalDisplacementY = new Value(0); + var relativeFocalX = sub(_this._pinchFocalX, add(panTransX, _this._focalDisplacementX)); + var relativeFocalY = sub(_this._pinchFocalY, add(panTransY, _this._focalDisplacementY)); + _this._scale = set(scale, (0, _$$_REQUIRE(_dependencyMap[20]).pinchMgr)(scale, pinchScale, pinchActive, pinchEnd, relativeFocalX, _this._focalDisplacementX, relativeFocalY, _this._focalDisplacementY, _this._minZoom, _this._maxZoom, _this._zoomToState, _this._zoomToValue, _this.onScaleStart, _this.onScaling, _this.onScaleEnd)); + var dragX = new Value(0); + var dragY = new Value(0); + var panState = new Value(_$$_REQUIRE(_dependencyMap[19]).State.UNDETERMINED); + var panOldState = new Value(_$$_REQUIRE(_dependencyMap[19]).State.UNDETERMINED); + var velocityX = new Value(0); + var velocityY = new Value(0); + _this._panLeftLimit = 0; + var panLeftLimit = (0, _$$_REQUIRE(_dependencyMap[20]).leftLimit)(_this._scale, _this._focalDisplacementX, _this._minZoom, _this.onLeftChange); + _this._panRightLimit = 0; + var panRightLimit = (0, _$$_REQUIRE(_dependencyMap[20]).rightLimit)(size, contentSize, panLeftLimit, _this._scale, _this._minZoom, _this.onRightChange); + _this._onPanEvent = event([{ + nativeEvent: { + translationX: dragX, + translationY: dragY, + oldState: panOldState, + state: panState, + velocityX: velocityX, + velocityY: velocityY + } + }]); + var dragSlope = divide(sub(0, dragY), sub(0, dragX)); + var radiansFromXAxis = abs(atan(dragSlope)); + var enableSpinner = greaterThan(radiansFromXAxis, 85 * Math.PI / 180); + _this._refreshEnabled = new Value(1); + var panActive = eq(panState, _$$_REQUIRE(_dependencyMap[19]).State.ACTIVE); + var panEnd = eq(panOldState, _$$_REQUIRE(_dependencyMap[19]).State.ACTIVE); + _this._panTransX = set(panTransX, (0, _$$_REQUIRE(_dependencyMap[20]).panXMgr)(panTransX, (0, _$$_REQUIRE(_dependencyMap[20]).dragDiff)(dragX, panActive, scale), or(panActive, pinchActive), panEnd, panRightLimit, panLeftLimit, velocityX, scale, size.width, _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isEInk(), zoomToActive, _this._zoomToDragX, _this.onPanXStart, _this.onPanXEnd, _this.onPanXOutOfBounds)); + _this._panTopLimit = 0; + var panTopLimit = (0, _$$_REQUIRE(_dependencyMap[20]).topLimit)(_this._scale, _this._focalDisplacementY, _this._minZoom, _this.onTopChange); + var panBottomLimit = (0, _$$_REQUIRE(_dependencyMap[20]).bottomLimit)(size, contentSize, panTopLimit, _this._scale, _this._minZoom, _this.onBottomChange); + _this._panTransY = set(panTransY, (0, _$$_REQUIRE(_dependencyMap[20]).panYMgr)(panTransY, dragY, (0, _$$_REQUIRE(_dependencyMap[20]).dragDiff)(dragY, panActive, scale), or(panActive, pinchActive), panEnd, panBottomLimit, panTopLimit, velocityY, scale, size.height, _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isEInk(), zoomToActive, _this._zoomToDragY, _this.onPanYStart, _this.onPanYEnd, enableSpinner, _this._spinnerHeight, _this._refreshEnabled, _this.onRefreshCustom, _this.onRefreshEnableCustom)); + _this.state = { + refreshEnabled: true, + area: _this._getAreaInfo() + }; + return _this; + } + + (0, _createClass2.default)(ZoomGraphView, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._setLoaded(); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var _this$props = this.props, + minZoom = _this$props.minZoom, + autoZoomValue = _this$props.autoZoomValue, + maxZoom = _this$props.maxZoom, + zoom = _this$props.zoom; + + if (nextProps.minZoom !== minZoom) { + this._minZoom.setValue(nextProps.minZoom); + } + + if (nextProps.maxZoom !== maxZoom) { + this._maxZoom.setValue(nextProps.maxZoom); + } + + if (nextProps.zoom !== zoom) { + this._zoomTo(nextProps.minZoom, nextProps.zoom); + } else if (nextProps.autoZoomValue !== autoZoomValue) { + this._zoomTo(nextProps.minZoom, nextProps.autoZoomValue); + } + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + if (!_$$_REQUIRE(_dependencyMap[18]).JSUtils.equals(nextState, this.state)) { + return true; + } + + var _this$props2 = this.props, + index = _this$props2.index, + size = _this$props2.size, + contentSize = _this$props2.contentSize; + + if (nextProps.index !== index || !_$$_REQUIRE(_dependencyMap[18]).JSUtils.equals(nextProps.size, size) || !_$$_REQUIRE(_dependencyMap[18]).JSUtils.equals(nextProps.contentSize, contentSize)) { + return true; + } + + this._setLoaded(); + + this._updatePanSwipeEffect(); + + return false; + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this._updatePanSwipeEffect(); + } + }, { + key: "_setDisableOutOfBounds", + value: function _setDisableOutOfBounds(state) { + var _this$props3 = this.props, + contentSize = _this$props3.contentSize, + size = _this$props3.size; + this._disableOutOfBounds = state || contentSize.width * this._currentScale < size.width && !_$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isEInk(); + } + }, { + key: "_resetInitStatus", + value: function _resetInitStatus() { + this._initializedStatus.panX = false; + this._initializedStatus.panY = false; + this._initializedStatus.scale = false; + this._initializedStatus.ready = false; + } + }, { + key: "_getAreaInfo", + value: function _getAreaInfo() { + var size = this.props.size; + var _panLeftLimit = this._panLeftLimit, + _panTopLimit = this._panTopLimit, + _panX = this._panX, + _panY = this._panY, + _currentScale = this._currentScale; + var top = _panTopLimit - _panY; + var start = _panLeftLimit - _panX; + return { + start: start, + top: top, + width: size.width, + height: size.height, + scale: _currentScale + }; + } + }, { + key: "_onLeftChange", + value: function _onLeftChange(_ref) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 1), + value = _ref2[0]; + + this._panLeftLimit = value; + } + }, { + key: "_onRightChange", + value: function _onRightChange(_ref3) { + var _ref4 = (0, _slicedToArray2.default)(_ref3, 1), + value = _ref4[0]; + + this._panRightLimit = value; + } + }, { + key: "_onTopChange", + value: function _onTopChange(_ref5) { + var _ref6 = (0, _slicedToArray2.default)(_ref5, 1), + value = _ref6[0]; + + this._panTopLimit = value; + } + }, { + key: "_onBottomChange", + value: function _onBottomChange(_ref7) { + var _ref8 = (0, _slicedToArray2.default)(_ref7, 1), + value = _ref8[0]; + } + }, { + key: "_onPanXStart", + value: function _onPanXStart(_ref9) { + var _ref10 = (0, _slicedToArray2.default)(_ref9, 3), + value = _ref10[0], + panLeftLimit = _ref10[1], + panRightLimit = _ref10[2]; + + this._initializedStatus.panX = true; + this._panX = value; + + this._checkInitialization(); + + var panIsNearLeft = this._panX + 5 >= panLeftLimit; + var panIsNearRight = this._panX - 5 <= panRightLimit; + + this._setDisableOutOfBounds(!panIsNearLeft && !panIsNearRight); + } + }, { + key: "_onPanXEnd", + value: function _onPanXEnd(_ref11) { + var _ref12 = (0, _slicedToArray2.default)(_ref11, 1), + value = _ref12[0]; + + this._panX = value; + + this._onPanEnd(); + + this._updateRefreshStatus(); + } + }, { + key: "_onPanXOutOfBounds", + value: function _onPanXOutOfBounds(_ref13) { + var _ref14 = (0, _slicedToArray2.default)(_ref13, 1), + outOfBounds = _ref14[0]; + + var _this$props4 = this.props, + onSwipeRight = _this$props4.onSwipeRight, + onSwipeLeft = _this$props4.onSwipeLeft; + + if (!this._disableOutOfBounds && this._isActive() && (this._isZoomed() || _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isEInk()) && Math.abs(outOfBounds) > _zoomConstants.default.constants.PAN_MAX_VALUE) { + var isNavigate = false; + + if (outOfBounds > 0) { + isNavigate = onSwipeRight(); + } else if (outOfBounds < 0) { + isNavigate = onSwipeLeft(); + } + + if (isNavigate) { + this.resetScale(); + } + + this._setDisableOutOfBounds(true); + } + } + }, { + key: "_onPanYStart", + value: function _onPanYStart(_ref15) { + var _ref16 = (0, _slicedToArray2.default)(_ref15, 1), + value = _ref16[0]; + + this._initializedStatus.panY = true; + this._panY = value; + + this._checkInitialization(); + } + }, { + key: "_onPanYEnd", + value: function _onPanYEnd(_ref17) { + var _ref18 = (0, _slicedToArray2.default)(_ref17, 1), + value = _ref18[0]; + + this._panY = value; + + this._onPanEnd(); + + this._updateRefreshStatus(); + } + }, { + key: "_onPanEnd", + value: function _onPanEnd() { + this._onGestureEnd(); + } + }, { + key: "_onScaleStart", + value: function _onScaleStart(_ref19) { + var _ref20 = (0, _slicedToArray2.default)(_ref19, 1), + value = _ref20[0]; + + this._initializedStatus.scale = true; + this._currentScale = value; + + this._checkInitialization(); + } + }, { + key: "_onScaling", + value: function _onScaling(_ref21) { + var _ref22 = (0, _slicedToArray2.default)(_ref21, 1), + scale = _ref22[0]; + + this._setDisableOutOfBounds(true); + + this._currentScale = scale; + + this._updatePanSwipeEffect(); + } + }, { + key: "_onScaleEnd", + value: function _onScaleEnd(_ref23) { + var _ref24 = (0, _slicedToArray2.default)(_ref23, 1), + value = _ref24[0]; + + this._currentScale = value; + + this._updatePanSwipeEffect(); + + this._onGestureEnd(); + } + }, { + key: "_checkInitialization", + value: function _checkInitialization() { + if (!this._initializedStatus.ready) { + this._initializedStatus.ready = this._initializedStatus.panX && this._initializedStatus.panY && this._initializedStatus.scale; + + if (this._initializedStatus.ready) { + this._printLog("ready"); + + this._updatePanSwipeEffect(); + + this._setLoaded(); + + this._onGestureEnd(); + } + } + } + }, { + key: "_onGestureEnd", + value: function _onGestureEnd() { + var _this2 = this; + + var graphId = this.props.graphId; + + _gestureTimer.default.resetTimer("graph_gesture_end_" + graphId); + + _gestureTimer.default.startTimer("graph_gesture_end_" + graphId, function () { + var onScaleChange = _this2.props.onScaleChange; + var area = _this2.state.area; + + var newArea = _this2._getAreaInfo(); + + if (!_$$_REQUIRE(_dependencyMap[18]).JSUtils.areEqualShallow(area, newArea)) { + if (typeof onScaleChange === "function") { + onScaleChange(newArea.scale); + } + + _this2.setState({ + area: newArea + }); + } + }, 250); + } + }, { + key: "_setLoaded", + value: function _setLoaded() { + var onLoaded = this.props.onLoaded; + + if (this._isActive() && typeof onLoaded === "function" && !this._loaded) { + this._loaded = true; + onLoaded(); + } + } + }, { + key: "_getClickedPosition", + value: function _getClickedPosition(_ref25) { + var x = _ref25.x, + y = _ref25.y; + + var _this$_getAreaInfo = this._getAreaInfo(), + start = _this$_getAreaInfo.start, + top = _this$_getAreaInfo.top, + scale = _this$_getAreaInfo.scale; + + return { + x: x + start, + y: y + top, + scale: scale + }; + } + }, { + key: "_onLongPress", + value: function _onLongPress() { + var onLongPress = this.props.onLongPress; + + if (typeof onLongPress === "function") { + onLongPress(); + } + } + }, { + key: "_onSingleTap", + value: function _onSingleTap(_ref26) { + var nativeEvent = _ref26.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[19]).State.BEGAN) { + this.event = nativeEvent; + } + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[19]).State.ACTIVE) { + var _this$props5 = this.props, + onExtraTap = _this$props5.onExtraTap, + singleTapToZoom = _this$props5.singleTapToZoom; + var eventToForward = this.event || nativeEvent; + + if (typeof onExtraTap !== "function" || !onExtraTap(this._getClickedPosition(nativeEvent))) { + if (typeof singleTapToZoom === "function" && singleTapToZoom()) { + this.autoZoom(eventToForward); + } + } + + this.event = null; + } + } + }, { + key: "_onDoubleTap", + value: function _onDoubleTap(_ref27) { + var nativeEvent = _ref27.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[19]).State.BEGAN) { + this.event = nativeEvent; + } + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[19]).State.ACTIVE) { + var eventToForward = this.event || nativeEvent; + this.autoZoom(eventToForward); + this.event = null; + } + } + }, { + key: "_zoomTo", + value: function _zoomTo(minZoom, scale) { + var coordinates = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var center = coordinates.center, + drag = coordinates.drag; + var _this$props6 = this.props, + size = _this$props6.size, + contentSize = _this$props6.contentSize; + var x = 0; + var y = 0; + + if (center) { + x = center.x || 0; + y = center.y || 0; + } else if (this._style) { + if (contentSize.width > size.width) { + x = this._style.width / 2 || 0; + } + + if (contentSize.height > size.height) { + y = this._style.height / 2 || 0; + } + } + + var dragX = 0; + var dragY = 0; + + if (drag) { + dragX = drag.x || 0; + dragY = drag.y || 0; + } + + this._zoomToState.setValue(_$$_REQUIRE(_dependencyMap[19]).State.ACTIVE); + + this._zoomToDragX.setValue(dragX); + + this._zoomToDragY.setValue(dragY); + + this._pinchFocalX.setValue(x); + + this._pinchFocalY.setValue(y); + + this._zoomToValue.setValue(scale); + } + }, { + key: "_setNativePropsToRef", + value: function _setNativePropsToRef(ref, props) { + if (ref && ref.current) { + ref.current.setNativeProps(props); + } + } + }, { + key: "_getViewPagerRef", + value: function _getViewPagerRef() { + var viewPagerRef = this.props.viewPagerRef; + + if (viewPagerRef && viewPagerRef.current) { + return viewPagerRef.current.getGestureHandlerRef(); + } + + return undefined; + } + }, { + key: "_isZoomed", + value: function _isZoomed() { + var _this$props7 = this.props, + minZoom = _this$props7.minZoom, + size = _this$props7.size, + contentSize = _this$props7.contentSize; + + if (this._currentScale > minZoom) { + return true; + } + + if (size.width < contentSize.width * this._currentScale) { + return true; + } + + if (size.height < contentSize.height * this._currentScale) { + return true; + } + + return false; + } + }, { + key: "_isActive", + value: function _isActive() { + var _this$props8 = this.props, + isActive = _this$props8.isActive, + index = _this$props8.index; + return typeof isActive !== "function" || isActive(index); + } + }, { + key: "_isScrollEnabled", + value: function _isScrollEnabled() { + var _this$props9 = this.props, + contentSize = _this$props9.contentSize, + size = _this$props9.size, + autoZoomValue = _this$props9.autoZoomValue; + var scaledWidth = parseInt((contentSize.width * this._currentScale).toFixed(0), 10); + return scaledWidth <= parseInt(size.width.toFixed(0), 10) && this._currentScale <= autoZoomValue; + } + }, { + key: "_updatePanSwipeEffect", + value: function _updatePanSwipeEffect() { + if (this._isActive()) { + if (this.progressRef && this.progressRef.current) { + this.progressRef.current.show(); + } + + this._toggleGestureState(this._isScrollEnabled()); + } else if (this.progressRef && this.progressRef.current) { + this.progressRef.current.hide(); + } + } + }, { + key: "_toggleGestureState", + value: function _toggleGestureState(enableScroll) { + this._printLog("scroll: " + enableScroll); + + this._toggleScroll(enableScroll); + + this._togglePan(enableScroll); + } + }, { + key: "_toggleScroll", + value: function _toggleScroll(enableScroll) { + var viewPagerRef = this.props.viewPagerRef; + + if (viewPagerRef && viewPagerRef.current) { + viewPagerRef.current.toggleViewPagerState({ + enabled: enableScroll, + scrollEnabled: enableScroll, + waitFor: [this.panRef, this.pinchRef] + }); + } + } + }, { + key: "_togglePan", + value: function _togglePan(enableScroll) { + var simultaneousHandlers = [this.pinchRef]; + + var handlerRef = this._getViewPagerRef(); + + if (enableScroll && handlerRef) { + simultaneousHandlers.push(handlerRef); + } + + var props = (0, _extends2.default)({ + simultaneousHandlers: simultaneousHandlers + }, this._getPanProps(enableScroll)); + + this._setNativePropsToRef(this.panRef, props); + } + }, { + key: "_getPanProps", + value: function _getPanProps() { + var enableScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + var props = {}; + + if (_$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isEInk()) { + props.minDist = 20; + } else if (_$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isAndroid()) { + if (enableScroll) { + props.minDeltaY = 20; + } else { + props.minDist = 20; + } + } else { + props.minDist = enableScroll ? 30 : 5; + } + + return props; + } + }, { + key: "_printLog", + value: function _printLog(message) { + var index = this.props.index; + } + }, { + key: "_updateRefreshStatus", + value: function _updateRefreshStatus() { + var refreshEnabled = this.state.refreshEnabled; + var newRefreshEnabled = parseInt(this._panTopLimit.toFixed(0), 10) === parseInt(this._panY.toFixed(0), 10); + + if (newRefreshEnabled !== refreshEnabled) { + this._refreshEnabled.setValue(newRefreshEnabled ? 1 : 0); + + this.setState({ + refreshEnabled: newRefreshEnabled + }); + } + } + }, { + key: "_onRefreshCustom", + value: function _onRefreshCustom() { + if (this._enableRefreshCustomComponent) { + var onSwipeDown = this.props.onSwipeDown; + + if (typeof onSwipeDown === "function") { + onSwipeDown(); + } + } + } + }, { + key: "_onRefreshEnableCustom", + value: function _onRefreshEnableCustom(_ref28) { + var _ref29 = (0, _slicedToArray2.default)(_ref28, 1), + enableScroll = _ref29[0]; + + if (this._enableRefreshCustomComponent) { + var enable = enableScroll ? true : false; + + this._toggleGestureState(enable && this._isScrollEnabled()); + } + } + }, { + key: "_onRefresh", + value: function _onRefresh() { + if (!this._enableRefreshCustomComponent) { + var onSwipeDown = this.props.onSwipeDown; + + if (typeof onSwipeDown === "function") { + onSwipeDown(); + } + } + } + }, { + key: "_adjustDrag", + value: function _adjustDrag(_ref30, scale) { + var x = _ref30.x, + y = _ref30.y; + var _this$props10 = this.props, + minZoom = _this$props10.minZoom, + contentSize = _this$props10.contentSize, + size = _this$props10.size; + var dragY = 0; + var dragX = 0; + + if (scale > minZoom) { + var height = contentSize.height * minZoom; + var absolutePanY = this._panTopLimit - this._panY; + var absoluteFocalY = absolutePanY + y; + + if (absoluteFocalY < height / 4) { + dragY = Math.max(height, size.height) / 4; + } else if (absoluteFocalY > height / 4 * 3) { + if (height < size.height) { + dragY = height - size.height; + } else { + dragY = -(height / 4); + } + } + + if (x < size.width / 4) { + dragX = 100; + } else if (x > size.width * 3 / 4) { + dragX = -100; + } + } + + return { + x: dragX, + y: dragY + }; + } + }, { + key: "autoZoom", + value: function autoZoom(coordinates) { + var _this$props11 = this.props, + minZoom = _this$props11.minZoom, + autoZoomValue = _this$props11.autoZoomValue; + + if (minZoom !== autoZoomValue) { + this._setDisableOutOfBounds(true); + + if (this._currentScale <= minZoom) { + this._zoomTo(minZoom, autoZoomValue, { + center: coordinates, + drag: this._adjustDrag(coordinates, autoZoomValue) + }); + } else { + this._zoomTo(minZoom, minZoom, { + center: coordinates + }); + } + } + } + }, { + key: "resetScale", + value: function resetScale() { + var _this$props12 = this.props, + minZoom = _this$props12.minZoom, + zoom = _this$props12.zoom; + + this._zoomTo(minZoom, zoom); + } + }, { + key: "render", + value: function render() { + var _this$props13 = this.props, + renderContent = _this$props13.renderContent, + index = _this$props13.index, + spinnerColor = _this$props13.spinnerColor, + size = _this$props13.size; + var _this$state = this.state, + refreshEnabled = _this$state.refreshEnabled, + area = _this$state.area; + var scaleTopLeftFixX = divide(multiply(this._style.width, add(this._scale, -1)), 2); + var scaleTopLeftFixY = divide(multiply(this._style.height, add(this._scale, -1)), 2); + + var ZoomGraphComponent = _react.default.createElement(_reactNative.View, { + style: _styles.default.wrapper + }, _react.default.createElement(_tapView.default, { + onLongPress: this.onLongPress, + onSingleTap: this.onSingleTap, + onDoubleTap: this.onDoubleTap, + doubleTapHandlerWaitFor: this.pinchRef + }, _react.default.createElement(_reactNative.View, { + style: this._style + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).PinchGestureHandler, { + ref: this.pinchRef, + simultaneousHandlers: this.panRef, + onGestureEvent: this._onPinchEvent, + onHandlerStateChange: this._onPinchEvent + }, _react.default.createElement(_reactNativeReanimated.default.View, { + style: this._style + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).PanGestureHandler, (0, _extends2.default)({ + ref: this.panRef, + avgTouches: true, + enableTrackpadTwoFingerGesture: true, + simultaneousHandlers: [this.pinchRef], + onGestureEvent: this._onPanEvent, + onHandlerStateChange: this._onPanEvent + }, this._getPanProps()), _react.default.createElement(_reactNativeReanimated.default.View, { + style: [this._style, { + flexDirection: this._isRtl ? "row-reverse" : "row", + transform: [{ + translateX: this._panTransX + }, { + translateY: this._panTransY + }, { + translateX: this._focalDisplacementX + }, { + translateY: this._focalDisplacementY + }, { + translateX: scaleTopLeftFixX + }, { + translateY: scaleTopLeftFixY + }, { + scale: this._scale + }] + }] + }, renderContent ? renderContent(index, area) : null))))))); + + if (!this._enableRefreshCustomComponent) { + return _react.default.createElement(_refreshComponent.default, { + style: { + flex: 1 + }, + enabled: refreshEnabled, + onRefresh: this.onRefresh, + cssClasses: ["newsmemory-article-refresh-control"] + }, ZoomGraphComponent); + } + + var cssRefresh = _$$_REQUIRE(_dependencyMap[21]).Css.getStyleObjByCssClasses(["newsmemory-article-refresh-control"]); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[18]).CssUtils.getAttributeFromStyle("backgroundColor", cssRefresh, _$$_REQUIRE(_dependencyMap[18]).colors.white); + + var spinnerMargin = _$$_REQUIRE(_dependencyMap[22]).IOS_LARGE_ACTIVITY_INDICATOR_SIZE * _zoomConstants.default.constants.REFRESH_SIZE / 2; + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, _react.default.createElement(_reactNativeReanimated.default.View, { + style: { + width: size.width, + height: this._spinnerHeight, + marginTop: -spinnerMargin, + marginBottom: spinnerMargin, + justifyContent: "center" + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).ProgressCircle, { + ref: this.progressRef, + spinnerColor: spinnerColor, + spinnerStyle: { + transform: [{ + scaleX: _zoomConstants.default.constants.REFRESH_SIZE + }, { + scaleY: _zoomConstants.default.constants.REFRESH_SIZE + }], + backgroundColor: backgroundColor + }, + hidden: !this._isActive() + })), ZoomGraphComponent); + } + }]); + return ZoomGraphView; + }(_react.Component); + + exports.default = ZoomGraphView; + ZoomGraphView.propTypes = { + index: _propTypes.default.number, + graphId: _propTypes.default.string, + isActive: _propTypes.default.func, + viewPagerRef: _propTypes.default.object, + zoom: _propTypes.default.number, + minZoom: _propTypes.default.number, + autoZoomValue: _propTypes.default.number, + singleTapToZoom: _propTypes.default.func, + maxZoom: _propTypes.default.number, + renderContent: _propTypes.default.func, + onLongPress: _propTypes.default.func, + onSwipeRight: _propTypes.default.func, + onSwipeLeft: _propTypes.default.func, + onSwipeDown: _propTypes.default.func, + onScaleChange: _propTypes.default.func, + onExtraTap: _propTypes.default.func, + onLoaded: _propTypes.default.func, + size: _propTypes.default.shape({ + width: _propTypes.default.number.isRequired, + height: _propTypes.default.number.isRequired + }).isRequired, + contentSize: _propTypes.default.shape({ + width: _propTypes.default.number.isRequired, + height: _propTypes.default.number.isRequired + }).isRequired, + spinnerColor: _propTypes.default.string + }; + ZoomGraphView.defaultProps = { + minZoom: 1, + maxZoom: 5 + }; +},2161,[5,6,41,7,8,15,12,14,16,17,28,201,646,2162,2163,2164,2099,2165,462,1,2166,699,1899,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + wrapper: { + flex: 1, + overflow: "hidden" + } + }); + + exports.default = _default; +},2162,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TapView = function (_React$Component) { + (0, _inherits2.default)(TapView, _React$Component); + + var _super = _createSuper(TapView); + + function TapView(props) { + var _this; + + (0, _classCallCheck2.default)(this, TapView); + _this = _super.call(this, props); + _this.twoFingersTapRef = _react.default.createRef(); + _this.doubleTapRef = _react.default.createRef(); + _this.singleTapRef = _react.default.createRef(); + _this.onTwoFingersHandlerStateChange = _this._onTwoFingersHandlerStateChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onHandlerStateChange = _this._onHandlerStateChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onDoubleHandlerStateChange = _this._onDoubleHandlerStateChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLongPressHandlerStateChange = _this._onLongPressHandlerStateChange.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(TapView, [{ + key: "_onTwoFingersHandlerStateChange", + value: function _onTwoFingersHandlerStateChange(_ref) { + var nativeEvent = _ref.nativeEvent; + var _this$props = this.props, + onGestureStart = _this$props.onGestureStart, + onTwoFingersTap = _this$props.onTwoFingersTap; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.BEGAN) { + if (onGestureStart && typeof onGestureStart === "function") { + onGestureStart({ + nativeEvent: nativeEvent + }); + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.ACTIVE) { + if (onTwoFingersTap && typeof onTwoFingersTap === "function") { + onTwoFingersTap({ + nativeEvent: nativeEvent + }); + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.FAILED) {} + } + }, { + key: "_onHandlerStateChange", + value: function _onHandlerStateChange(_ref2) { + var nativeEvent = _ref2.nativeEvent; + var _this$props2 = this.props, + onGestureStart = _this$props2.onGestureStart, + onSingleTap = _this$props2.onSingleTap; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.BEGAN) { + if (onGestureStart && typeof onGestureStart === "function") { + onGestureStart({ + nativeEvent: nativeEvent + }); + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.ACTIVE) { + if (onSingleTap && typeof onSingleTap === "function") { + onSingleTap({ + nativeEvent: nativeEvent + }); + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.FAILED) {} + } + }, { + key: "_onDoubleHandlerStateChange", + value: function _onDoubleHandlerStateChange(_ref3) { + var nativeEvent = _ref3.nativeEvent; + var _this$props3 = this.props, + onGestureStart = _this$props3.onGestureStart, + onDoubleTap = _this$props3.onDoubleTap, + onTwoFingersTap = _this$props3.onTwoFingersTap; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.BEGAN) { + if (onGestureStart && typeof onGestureStart === "function") { + onGestureStart({ + nativeEvent: nativeEvent + }); + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.ACTIVE) { + var numberOfPointers = nativeEvent.numberOfPointers; + + if (numberOfPointers > 1) { + if (onTwoFingersTap && typeof onTwoFingersTap === "function") { + onTwoFingersTap({ + nativeEvent: nativeEvent + }); + } + } else { + if (onDoubleTap && typeof onDoubleTap === "function") { + onDoubleTap({ + nativeEvent: nativeEvent + }); + } + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.FAILED) {} + } + }, { + key: "_onLongPressHandlerStateChange", + value: function _onLongPressHandlerStateChange(_ref4) { + var nativeEvent = _ref4.nativeEvent; + var _this$props4 = this.props, + onGestureStart = _this$props4.onGestureStart, + onLongPress = _this$props4.onLongPress; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.BEGAN) { + if (onGestureStart && typeof onGestureStart === "function") { + onGestureStart({ + nativeEvent: nativeEvent + }); + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.ACTIVE) { + if (onLongPress && typeof onLongPress === "function") { + onLongPress({ + nativeEvent: nativeEvent + }); + } + } else if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[10]).State.FAILED) {} + } + }, { + key: "render", + value: function render() { + var _this$props5 = this.props, + children = _this$props5.children, + twoFingersTapHandlerWaitFor = _this$props5.twoFingersTapHandlerWaitFor, + doubleTapHandlerWaitFor = _this$props5.doubleTapHandlerWaitFor; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).TapGestureHandler, { + ref: this.twoFingerTapRef, + minPointers: 2, + onHandlerStateChange: this.onTwoFingersHandlerStateChange, + waitFor: twoFingersTapHandlerWaitFor + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).TapGestureHandler, { + ref: this.singleTapRef, + onHandlerStateChange: this.onHandlerStateChange, + waitFor: this.doubleTapRef + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).TapGestureHandler, { + ref: this.doubleTapRef, + numberOfTaps: 2, + onHandlerStateChange: this.onDoubleHandlerStateChange, + waitFor: doubleTapHandlerWaitFor + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).LongPressGestureHandler, { + onHandlerStateChange: this.onLongPressHandlerStateChange + }, _react.default.createElement(_reactNative.View, { + collapsable: false + }, children))))); + } + }]); + return TapView; + }(_react.default.Component); + + exports.default = TapView; + TapView.propTypes = { + children: _propTypes.default.any, + onGestureStart: _propTypes.default.func, + onSingleTap: _propTypes.default.func, + onDoubleTap: _propTypes.default.func, + onTwoFingersTap: _propTypes.default.func, + onLongPress: _propTypes.default.func, + twoFingersTapHandlerWaitFor: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]), + doubleTapHandlerWaitFor: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]) + }; +},2163,[5,7,8,15,12,14,16,17,201,28,1]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var GestureTimer = function () { + function GestureTimer() { + (0, _classCallCheck2.default)(this, GestureTimer); + } + + (0, _createClass2.default)(GestureTimer, null, [{ + key: "startTimer", + value: function startTimer(timerKey, callback, timer) { + if (!GestureTimer.timers[timerKey]) { + GestureTimer.timers[timerKey] = setTimeout(function () { + callback(); + GestureTimer.timers[timerKey] = undefined; + }, timer); + } + } + }, { + key: "resetTimer", + value: function resetTimer(timerKey) { + if (GestureTimer.timers[timerKey]) { + clearTimeout(GestureTimer.timers[timerKey]); + GestureTimer.timers[timerKey] = undefined; + } + } + }]); + return GestureTimer; + }(); + + exports.default = GestureTimer; + GestureTimer.timers = {}; +},2164,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var ZoomDevice = function () { + function ZoomDevice() { + (0, _classCallCheck2.default)(this, ZoomDevice); + } + + (0, _createClass2.default)(ZoomDevice, null, [{ + key: "init", + value: function init() { + ZoomDevice.constants.PAN_ANIMATION_DEGREES_THRESHOLD = 30; + ZoomDevice.constants.ZOOM_TO_DURATION = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 1 : 300; + ZoomDevice.constants.VERTICAL_THRESHOLD = 50; + ZoomDevice.constants.SNAP_PADDING = 10; + ZoomDevice.constants.SNAP_VELOCITY = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 1 : 100; + ZoomDevice.constants.VIEW_PAGER_SWIPE_DURATION = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 1 : 200; + ZoomDevice.constants.VIEW_PAGER_VELOCITY_1PAGE = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 350 : 1000; + ZoomDevice.constants.VIEW_PAGER_VELOCITY_2PAGES = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 350 : 1000; + ZoomDevice.constants.MAGNETIC_PAN_VELOCITY_X = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 350 : 1000; + ZoomDevice.constants.MAGNETIC_PAN_X_FACTOR_1PAGE = 0.6666666666666666; + ZoomDevice.constants.MAGNETIC_PAN_X_FACTOR_2PAGES = 0.75; + ZoomDevice.constants.MAGNETIC_PAN_VELOCITY_Y = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 350 : 1000; + ZoomDevice.constants.MAGNETIC_PAN_Y_FACTOR_PORTRAIT = 0.6666666666666666; + ZoomDevice.constants.MAGNETIC_PAN_Y_FACTOR_LANDSCAPE = 0.8; + ZoomDevice.constants.PAN_ANIMATION_THRESHOLD = 50; + ZoomDevice.constants.TOGGLE_FIT_VARIATION = 0.15; + ZoomDevice.constants.PAN_TO_DIST = 150; + ZoomDevice.constants.PAN_MAX_FRICTION = 5; + ZoomDevice.constants.PAN_MAX_VALUE = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 10 : 20; + ZoomDevice.constants.ENABLE_REFRESH = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isEInk() ? 1 : 100; + ZoomDevice.constants.REFRESH_DURATION = 300; + ZoomDevice.constants.REFRESH_SIZE = 0.8; + } + }]); + return ZoomDevice; + }(); + + ZoomDevice.constants = {}; + var _default = ZoomDevice; + exports.default = _default; +},2165,[5,7,8,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.dragDiff = dragDiff; + exports.friction = friction; + exports.pinchMgr = pinchMgr; + exports.panXMgr = panXMgr; + exports.panYMgr = panYMgr; + exports.topLimit = topLimit; + exports.bottomLimit = bottomLimit; + exports.leftLimit = leftLimit; + exports.rightLimit = rightLimit; + + var _reactNativeReanimated = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _zoomConstants = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var debug = _reactNativeReanimated.default.debug, + set = _reactNativeReanimated.default.set, + cond = _reactNativeReanimated.default.cond, + eq = _reactNativeReanimated.default.eq, + or = _reactNativeReanimated.default.or, + add = _reactNativeReanimated.default.add, + sub = _reactNativeReanimated.default.sub, + min = _reactNativeReanimated.default.min, + max = _reactNativeReanimated.default.max, + abs = _reactNativeReanimated.default.abs, + greaterThan = _reactNativeReanimated.default.greaterThan, + greaterOrEq = _reactNativeReanimated.default.greaterOrEq, + multiply = _reactNativeReanimated.default.multiply, + divide = _reactNativeReanimated.default.divide, + lessThan = _reactNativeReanimated.default.lessThan, + decay = _reactNativeReanimated.default.decay, + timing = _reactNativeReanimated.default.timing, + call = _reactNativeReanimated.default.call, + diff = _reactNativeReanimated.default.diff, + not = _reactNativeReanimated.default.not, + block = _reactNativeReanimated.default.block, + startClock = _reactNativeReanimated.default.startClock, + stopClock = _reactNativeReanimated.default.stopClock, + clockRunning = _reactNativeReanimated.default.clockRunning, + Value = _reactNativeReanimated.default.Value, + Clock = _reactNativeReanimated.default.Clock, + and = _reactNativeReanimated.default.and; + + function scaleDiff(value) { + var tmp = new Value(1); + var prev = new Value(1); + return [set(tmp, divide(value, prev)), set(prev, value), tmp]; + } + + function dragDiff(value, updating, scale) { + var tmp = new Value(0); + var prev = new Value(0); + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isAndroid()) { + return cond(updating, [set(tmp, sub(value, prev)), set(prev, value), tmp], set(prev, 0)); + } + + return cond(updating, [set(tmp, multiply(scale, sub(value, prev))), set(prev, value), tmp], set(prev, 0)); + } + + function friction(value) { + return max(1, min(_zoomConstants.default.constants.PAN_MAX_FRICTION, add(1, multiply(value, (_zoomConstants.default.constants.PAN_MAX_FRICTION - 1) / _zoomConstants.default.constants.PAN_MAX_VALUE)))); + } + + function speed(value) { + var clock = new Clock(); + var dt = diff(clock); + return cond(lessThan(dt, 1), 0, multiply(1000, divide(diff(value), dt))); + } + + function scaleRest(value, minScale, maxScale) { + return cond(lessThan(value, minScale), minScale, cond(lessThan(maxScale, value), maxScale, value)); + } + + function scaleFriction(value, rest, delta) { + var MAX_FRICTION = 20; + var MAX_VALUE = 0.5; + var res = multiply(value, delta); + var howFar = abs(sub(rest, value)); + var animatedFriction = max(1, min(MAX_FRICTION, add(1, multiply(howFar, 38)))); + return cond(lessThan(0, howFar), multiply(value, add(1, divide(add(delta, -1), animatedFriction))), res); + } + + function runTiming(clock, value, dest) { + var params = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; + var _params$startStopCloc = params.startStopClock, + startStopClock = _params$startStopCloc === undefined ? true : _params$startStopCloc, + _params$duration = params.duration, + duration = _params$duration === undefined ? 300 : _params$duration, + _params$easing = params.easing, + easing = _params$easing === undefined ? _reactNativeReanimated.Easing.inOut(_reactNativeReanimated.Easing.cubic) : _params$easing; + var state = { + finished: new Value(0), + position: new Value(0), + frameTime: new Value(0), + time: new Value(0) + }; + var config = { + toValue: new Value(0), + duration: duration, + easing: easing + }; + return [cond(clockRunning(clock), 0, [set(state.finished, 0), set(state.frameTime, 0), set(state.time, 0), set(state.position, value), set(config.toValue, dest), startStopClock && startClock(clock)]), timing(clock, state, config), cond(state.finished, startStopClock && stopClock(clock)), state.position]; + } + + function runDecay(clock, value, velocity) { + var state = { + finished: new Value(0), + velocity: new Value(0), + position: new Value(0), + time: new Value(0) + }; + var config = { + deceleration: _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isAndroid() ? 0.99 : 0.9975 + }; + return [cond(clockRunning(clock), 0, [set(state.finished, 0), set(state.velocity, velocity), set(state.position, value), set(state.time, 0), startClock(clock)]), set(state.position, value), decay(clock, state, config), cond(state.finished, stopClock(clock)), state.position]; + } + + function pinchMgr(value, gesture, gestureActive, gestureEnd, focalX, displacementX, focalY, displacementY, minScale, maxScale, zoomToState, zoomToValue, callbackStart, callback, callbackEnd) { + var clock = new Clock(); + var zoomToClock = new Clock(); + var delta = scaleDiff(gesture); + var rest = scaleRest(value, minScale, maxScale); + var focalXRest = cond(lessThan(value, minScale), 0, sub(displacementX, multiply(focalX, add(-1, divide(rest, value))))); + var focalYRest = cond(lessThan(value, minScale), 0, sub(displacementY, multiply(focalY, add(-1, divide(rest, value))))); + var nextScale = new Value(1); + var zoomToActive = eq(zoomToState, _$$_REQUIRE(_dependencyMap[4]).State.ACTIVE); + return cond(zoomToActive, [stopClock(clock), set(nextScale, runTiming(zoomToClock, value, scaleRest(zoomToValue, minScale, maxScale))), set(displacementX, sub(displacementX, multiply(focalX, add(-1, divide(nextScale, value))))), set(displacementY, sub(displacementY, multiply(focalY, add(-1, divide(nextScale, value))))), cond(not(clockRunning(zoomToClock)), [debug("ZOOM TO END: ", nextScale), call([nextScale], callbackEnd), set(zoomToState, _$$_REQUIRE(_dependencyMap[4]).State.END)]), nextScale], cond(gestureEnd, [debug("PINCH END: ", rest), call([rest], callbackEnd), rest], cond([delta, gestureActive], [stopClock(clock), set(nextScale, scaleFriction(value, rest, delta)), set(nextScale, cond(lessThan(nextScale, minScale), minScale, nextScale)), set(displacementX, sub(displacementX, multiply(focalX, add(-1, divide(nextScale, value))))), set(displacementY, sub(displacementY, multiply(focalY, add(-1, divide(nextScale, value))))), call([min(max(minScale, nextScale), maxScale)], callback), nextScale], cond(or(clockRunning(clock), not(eq(rest, value))), [set(displacementX, runTiming(clock, displacementX, focalXRest, { + startStopClock: false + })), set(displacementY, runTiming(clock, displacementY, focalYRest, { + startStopClock: false + })), debug("ZOOM BOUNCY: ", value), runTiming(clock, value, rest)], [debug("ZOOM: ", value), call([value], callbackStart), value])))); + } + + function panRest(top, bottom, value) { + return cond(lessThan(value, bottom), bottom, cond(greaterThan(value, top), top, value)); + } + + function panXMgr(value, gestureDiv, gestureActive, gestureEnd, right, left, velocity, scale, viewWidth, useMagnetic, zoomToActive, zoomToDragX, callbackStart, callback, callbackOutOfBound) { + var velocityFromValue = speed(value); + var decayClock = new Clock(); + var zoomToClock = new Clock(); + var clockMagnetic = new Clock(); + var tempDragX = new Value(0); + var tempPan = new Value(0); + var rest = cond(lessThan(value, right), right, cond(lessThan(left, value), left, value)); + var nextValue = add(value, gestureDiv); + var isVariationOutOfLeftBounds = lessThan(left, nextValue); + var isVariationOutOfBounds = or(lessThan(nextValue, right), isVariationOutOfLeftBounds); + var howMuchIsOutOfBounds = sub(rest, nextValue); + var nextValueRest = panRest(left, right, nextValue); + var maxVelocityX = new Value(0); + var isLeftSwipe = greaterThan(maxVelocityX, 0); + var isMagnetic = or(clockRunning(clockMagnetic), greaterThan(abs(maxVelocityX), _zoomConstants.default.constants.MAGNETIC_PAN_VELOCITY_X)); + var absoluteVariation = multiply(viewWidth, _zoomConstants.default.constants.MAGNETIC_PAN_X_FACTOR_1PAGE); + var magneticDestination = panRest(left, right, add(rest, cond(isLeftSwipe, absoluteVariation, multiply(absoluteVariation, -1)))); + return cond(or(zoomToActive, clockRunning(zoomToClock)), [set(tempDragX, runTiming(zoomToClock, 0, zoomToDragX)), set(tempPan, panRest(left, right, add(value, dragDiff(tempDragX, zoomToActive, 1)))), call([tempPan], callback), debug("PAN X ZOOM TO: ", tempPan), tempPan], cond(isVariationOutOfBounds, [stopClock(clockMagnetic), stopClock(decayClock), call([howMuchIsOutOfBounds], callbackOutOfBound), debug("PAN X OUT OF BOUND: ", nextValueRest), nextValueRest], cond([gestureDiv, cond(useMagnetic, velocity, velocityFromValue), gestureActive], [stopClock(clockMagnetic), stopClock(decayClock), cond(greaterThan(abs(velocity), 0), set(maxVelocityX, velocity)), debug("MAX VELOCITY", maxVelocityX), nextValue], [cond(gestureEnd, cond(useMagnetic, cond(isMagnetic, [set(tempPan, runTiming(clockMagnetic, rest, magneticDestination, { + duration: _zoomConstants.default.constants.VIEW_PAGER_SWIPE_DURATION + })), debug("PAN X MAGNETIC: ", tempPan), cond(not(clockRunning(clockMagnetic)), [set(maxVelocityX, 0), call([tempPan], callback)]), tempPan], [debug("PAN X END: ", rest), call([rest], callback), set(maxVelocityX, 0), rest]), cond(or(clockRunning(decayClock), lessThan(5, abs(velocityFromValue))), [set(tempPan, panRest(left, right, runDecay(decayClock, value, velocityFromValue))), debug("PAN X DECAY: ", tempPan), cond(not(clockRunning(decayClock)), set(maxVelocityX, 0), call([tempPan], callback)), tempPan], [debug("PAN X END: ", rest), call([rest], callback), rest])), [debug("PAN X: ", rest), call([rest, left, right], callbackStart), set(maxVelocityX, 0), rest])]))); + } + + function panYMgr(value, drag, gestureDiv, gestureActive, gestureEnd, bottom, top, velocity, scale, viewHeight, useMagnetic, zoomToActive, zoomToDragY, callbackStart, callback, spinnerEnabled, spinnerHeight, refreshEnabled, callbackRefresh, callbackSpinner) { + var velocityFromValue = speed(value); + var tempDragY = new Value(0); + var tempPan = new Value(0); + var clockMagnetic = new Clock(); + var decayClock = new Clock(); + var zoomToClock = new Clock(); + var refreshClock = new Clock(); + var rest = cond(lessThan(value, bottom), bottom, cond(lessThan(top, value), top, value)); + var nextValue = add(value, gestureDiv); + var isNextValueOutOfTopBounds = lessThan(top, nextValue); + var isNextValueEnoughForRefresh = and(isNextValueOutOfTopBounds, greaterOrEq(spinnerHeight, _zoomConstants.default.constants.ENABLE_REFRESH)); + var isSpinnerVisible = greaterThan(spinnerHeight, 0); + var nextValueRest = panRest(top, bottom, nextValue); + var prevSpinnerHeight = new Value(0); + var maxVelocityY = new Value(0); + var isRefreshEnabled = eq(refreshEnabled, 1); + var isUpSwipe = greaterThan(maxVelocityY, 0); + var isMagnetic = or(clockRunning(clockMagnetic), greaterThan(abs(maxVelocityY), _zoomConstants.default.constants.MAGNETIC_PAN_VELOCITY_Y)); + var absoluteVariation = multiply(viewHeight, _zoomConstants.default.constants.MAGNETIC_PAN_Y_FACTOR_PORTRAIT); + var magneticDestination = panRest(top, bottom, add(rest, cond(isUpSwipe, absoluteVariation, multiply(absoluteVariation, -1)))); + return cond(or(zoomToActive, clockRunning(zoomToClock)), [set(tempDragY, runTiming(zoomToClock, 0, zoomToDragY)), set(tempPan, panRest(top, bottom, add(value, dragDiff(tempDragY, zoomToActive, 1)))), call([tempPan], callback), debug("PAN Y ZOOM TO: ", tempPan), tempPan], [cond(or(and(eq(prevSpinnerHeight, 0), greaterThan(spinnerHeight, 0)), and(eq(spinnerHeight, 0), greaterThan(prevSpinnerHeight, 0))), [call([eq(spinnerHeight, 0)], callbackSpinner), set(prevSpinnerHeight, spinnerHeight)]), cond(and(or(isNextValueOutOfTopBounds, isSpinnerVisible), isRefreshEnabled), [cond(isNextValueEnoughForRefresh, [call([], callbackRefresh)]), cond(or(and(gestureActive, isNextValueOutOfTopBounds, spinnerEnabled), isSpinnerVisible), [set(spinnerHeight, max(0, min(drag, _zoomConstants.default.constants.ENABLE_REFRESH)))]), cond(or(clockRunning(refreshClock), and(not(gestureActive), isSpinnerVisible)), [set(spinnerHeight, runTiming(refreshClock, spinnerHeight, 0, { + duration: _zoomConstants.default.constants.REFRESH_DURATION, + easing: _reactNativeReanimated.Easing.linear + }))]), stopClock(decayClock), stopClock(clockMagnetic), set(maxVelocityY, 0), debug("PAN Y OUT OF TOP BOUND: ", top), top], [cond([gestureDiv, cond(useMagnetic, velocity, velocityFromValue), gestureActive], [stopClock(decayClock), stopClock(clockMagnetic), cond(greaterThan(abs(velocity), 0), set(maxVelocityY, velocity)), nextValueRest], [cond(gestureEnd, cond(useMagnetic, cond(isMagnetic, [set(tempPan, runTiming(clockMagnetic, rest, magneticDestination, { + duration: _zoomConstants.default.constants.VIEW_PAGER_SWIPE_DURATION + })), debug("PAN Y MAGNETIC: ", tempPan), cond(not(clockRunning(clockMagnetic)), [set(maxVelocityY, 0), call([tempPan], callback)]), tempPan], [debug("PAN Y END: ", rest), call([rest], callback), set(maxVelocityY, 0), rest]), cond(or(clockRunning(decayClock), lessThan(5, abs(velocityFromValue))), [set(tempPan, panRest(top, bottom, runDecay(decayClock, value, velocityFromValue))), debug("PAN Y DECAY: ", tempPan), cond(not(clockRunning(decayClock)), set(maxVelocityY, 0), call([tempPan], callback)), tempPan], [debug("PAN Y END: ", rest), call([rest], callback), rest])), [(debug("PAN Y: ", rest), call([rest], callbackStart), set(maxVelocityY, 0), rest)])])])]); + } + + function topLimit(scale, focalDisplacementY, minZoom, callback) { + var limit = cond(lessThan(scale, minZoom), 0, multiply(-1, focalDisplacementY)); + return block([debug("TOP: ", limit), call([limit], callback), limit]); + } + + function bottomLimit(viewSize, contentSize, panUpY, scale, minZoom, callback) { + var limit = cond(greaterThan(contentSize.height, 0), cond(lessThan(multiply(contentSize.height, scale), viewSize.height), panUpY, add(sub(panUpY, multiply(contentSize.height, scale)), viewSize.height)), new Value(0)); + return block([debug("BOTTOM: ", limit), call([limit], callback), limit]); + } + + function leftLimit(scale, focalDisplacementX, minZoom, callback) { + var limit = cond(lessThan(scale, minZoom), 0, multiply(-1, focalDisplacementX)); + return block([debug("LEFT: ", limit), call([limit], callback), limit]); + } + + function rightLimit(viewSize, contentSize, panLeftX, scale, minZoom, callback) { + var limit = cond(lessThan(multiply(contentSize.width, scale), viewSize.width), panLeftX, add(sub(panLeftX, multiply(contentSize.width, scale)), viewSize.width)); + return block([debug("RIGHT: ", limit), call([limit], callback), limit]); + } +},2166,[646,5,2165,462,1]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _hrImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var HrContainer = function (_React$Component) { + (0, _inherits2.default)(HrContainer, _React$Component); + + var _super = _createSuper(HrContainer); + + function HrContainer(props) { + var _this; + + (0, _classCallCheck2.default)(this, HrContainer); + _this = _super.call(this, props); + var item = props.item, + showAll = props.showAll, + hidden = props.hidden; + var boxStyle = item.boxStyle; + var width = boxStyle.width, + height = boxStyle.height; + + if (showAll) { + width = 0; + height = 0; + } + + _this.graphLoaded = false; + _this.textLoaded = false; + _this.graphError = false; + _this.textError = false; + _this.onGraphLoaded = _this._onGraphLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGraphError = _this._onGraphError.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTextLoaded = _this._onTextLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTextError = _this._onTextError.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + width: width, + height: height, + hidden: hidden + }; + return _this; + } + + (0, _createClass2.default)(HrContainer, [{ + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + return !_$$_REQUIRE(_dependencyMap[15]).JSUtils.areEqualShallow(nextProps, this.props) || !_$$_REQUIRE(_dependencyMap[15]).JSUtils.areEqualShallow(nextState, this.state); + } + }, { + key: "_checkLoaded", + value: function _checkLoaded() { + var _this$props = this.props, + showAll = _this$props.showAll, + item = _this$props.item; + + if (showAll && (this.graphLoaded || this.graphError) && (this.textLoaded || this.textError)) { + var boxStyle = item.boxStyle; + var width = boxStyle.width, + height = boxStyle.height; + this.setState({ + width: width, + height: height + }); + } + } + }, { + key: "_onGraphLoaded", + value: function _onGraphLoaded() { + if (!this.graphLoaded) { + this.graphLoaded = true; + + this._checkLoaded(); + } + + var onGraphLoaded = this.props.onGraphLoaded; + + if (onGraphLoaded) { + onGraphLoaded(); + } + } + }, { + key: "_onGraphError", + value: function _onGraphError() { + if (!this.graphError) { + this.graphError = true; + + this._checkLoaded(); + } + + var onGraphError = this.props.onGraphError; + + if (onGraphError) { + onGraphError(); + } + } + }, { + key: "_onTextLoaded", + value: function _onTextLoaded() { + if (!this.textLoaded) { + this.textLoaded = true; + + this._checkLoaded(); + } + + var onTextLoaded = this.props.onTextLoaded; + + if (onTextLoaded) { + onTextLoaded(); + } + } + }, { + key: "_onTextError", + value: function _onTextError() { + if (!this.textError) { + this.textError = true; + + this._checkLoaded(); + } + + var onTextError = this.props.onTextError; + + if (onTextError) { + onTextError(); + } + } + }, { + key: "show", + value: function show() { + var hidden = this.state.hidden; + + if (hidden) { + this.setState({ + hidden: false + }); + } + } + }, { + key: "hide", + value: function hide() { + var hidden = this.state.hidden; + + if (!hidden) { + this.setState({ + hidden: true + }); + } + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + item = _this$props2.item, + style = _this$props2.style, + showAll = _this$props2.showAll, + showOnlyGraph = _this$props2.showOnlyGraph, + showOnlyText = _this$props2.showOnlyText, + hiddenProp = _this$props2.hidden, + rest = (0, _objectWithoutProperties2.default)(_this$props2, ["item", "style", "showAll", "showOnlyGraph", "showOnlyText", "hidden"]); + var _this$state = this.state, + width = _this$state.width, + height = _this$state.height, + hidden = _this$state.hidden; + + if (hidden) { + return null; + } + + var styleForHrBox = { + position: "absolute", + width: width, + height: height + }; + var containerStyle = styleForHrBox; + + if (style) { + if (typeof style[Symbol.iterator] === "function") { + containerStyle = [].concat((0, _toConsumableArray2.default)(style), [{ + width: width, + height: height + }]); + } else { + containerStyle = [style, { + width: width, + height: height + }]; + } + } + + containerStyle = _pageUtils.default.traverseStyleForRTL(containerStyle); + return _react.default.createElement(_reactNative.View, { + key: item.key + "_hrcontainer", + style: containerStyle + }, showAll || showOnlyGraph ? _react.default.createElement(_hrImageComponent.default, (0, _extends2.default)({ + key: "graph" + }, rest, { + style: styleForHrBox, + path: item.path, + onLoadEnd: this.onGraphLoaded, + onError: this.onGraphError + })) : null, showAll || showOnlyText ? _react.default.createElement(_hrImageComponent.default, (0, _extends2.default)({ + key: "text" + }, rest, { + style: styleForHrBox, + path: item.pathText, + graph: false, + onLoadEnd: this.onTextLoaded, + onError: this.onTextError + })) : null); + } + }]); + return HrContainer; + }(_react.default.Component); + + exports.default = HrContainer; + HrContainer.propTypes = { + item: _propTypes.default.object.isRequired, + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]).isRequired, + showOnlyGraph: _propTypes.default.bool, + showOnlyText: _propTypes.default.bool, + showAll: _propTypes.default.bool, + onGraphLoaded: _propTypes.default.func, + onGraphError: _propTypes.default.func, + onTextLoaded: _propTypes.default.func, + onTextError: _propTypes.default.func, + hidden: _propTypes.default.bool + }; + HrContainer.defaultProps = { + showOnlyGraph: true, + showOnlyText: false, + showAll: false, + hidden: false + }; +},2167,[5,6,21,108,7,8,15,12,14,16,17,201,28,2168,715,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.HrUtility = exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _EPaperImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _imageComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + var _newsmemoryUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[16])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var HrImageIos = function (_React$Component) { + (0, _inherits2.default)(HrImageIos, _React$Component); + + var _super = _createSuper(HrImageIos); + + function HrImageIos(props) { + var _this; + + (0, _classCallCheck2.default)(this, HrImageIos); + _this = _super.call(this, props); + _this.attempt = 0; + _this.checkZip = false; + _this.downloadCallback = _this._downloadCallback.bind((0, _assertThisInitialized2.default)(_this)); + _this.checkZipFile = _this._checkZipFile.bind((0, _assertThisInitialized2.default)(_this)); + _this.getImageFromZip = _this._getImageFromZip.bind((0, _assertThisInitialized2.default)(_this)); + _this.askResourceDownload = _this._askResourceDownload.bind((0, _assertThisInitialized2.default)(_this)); + var path = props.path, + zipGraphArchivePath = props.zipGraphArchivePath; + _this.state = { + path: path, + zipGraphArchivePath: zipGraphArchivePath, + base64: undefined, + imageStyle: _this._getImageStyleFromFile() + }; + return _this; + } + + (0, _createClass2.default)(HrImageIos, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.mounted = true; + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + var _this$props = this.props, + style = _this$props.style, + useImageDimensions = _this$props.useImageDimensions; + var _this$state = this.state, + path = _this$state.path, + zipGraphArchivePath = _this$state.zipGraphArchivePath, + base64 = _this$state.base64, + imageStyle = _this$state.imageStyle; + return style !== nextProps.style || useImageDimensions !== nextProps.useImageDimensions || path !== nextState.path || base64 !== nextState.base64 || zipGraphArchivePath !== nextState.zipGraphArchivePath || imageStyle !== nextState.imageStyle; + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.mounted = false; + + _$$_REQUIRE(_dependencyMap[21]).EventRegister.rm(this.highResQueueRestart); + } + }, { + key: "_askResourceDownload", + value: function _askResourceDownload() { + var _this2 = this; + + var _this$props2, newspaper, issue, edition, page, pageId, boxId, xmlId, graph, onError, path, imagePath, _await$getImageSize, width, height, relativePathToImage, imageName, image; + + return _regenerator.default.async(function _askResourceDownload$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _this$props2 = this.props, newspaper = _this$props2.newspaper, issue = _this$props2.issue, edition = _this$props2.edition, page = _this$props2.page, pageId = _this$props2.pageId, boxId = _this$props2.boxId, xmlId = _this$props2.xmlId, graph = _this$props2.graph, onError = _this$props2.onError; + path = this.state.path; + + if (path) { + _context2.next = 26; + break; + } + + imagePath = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(newspaper.getPaper(), issue) + page.getFilename() + "/" + _newsmemoryUtils.default.getHrImageName(xmlId, boxId, graph); + _context2.next = 6; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(imagePath)); + + case 6: + if (!_context2.sent) { + _context2.next = 25; + break; + } + + _context2.next = 9; + return _regenerator.default.awrap((0, _imageComponent.getImageSize)("file://" + imagePath)); + + case 9: + _await$getImageSize = _context2.sent; + width = _await$getImageSize.width; + height = _await$getImageSize.height; + relativePathToImage = imagePath.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + imageName = _tecnaviaFileUtils.default.getFilename(imagePath); + image = new _EPaperImage.default(); + image.setPageId(pageId); + image.setName(imageName); + image.setTypeByName(imageName); + image.setBase64(relativePathToImage); + image.setWidth(width); + image.setHeight(height); + page.addImage(image); + this.downloadCallback(image); + _context2.next = 26; + break; + + case 25: + if (_$$_REQUIRE(_dependencyMap[22]).NetworkUtils.isOnline()) { + if (!this.loading) { + this.loading = true; + + if (this.highResQueueRestart) { + _$$_REQUIRE(_dependencyMap[21]).EventRegister.rm(this.highResQueueRestart); + } + + this.highResQueueRestart = _$$_REQUIRE(_dependencyMap[21]).EventRegister.on(_events.default.NEWSMEMORY_RESTART_HIGH_RES_QUEUE, function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!_this2.loading) { + _context.next = 4; + break; + } + + _this2.loading = false; + _context.next = 4; + return _regenerator.default.awrap(_this2.askResourceDownload()); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }); + + _$$_REQUIRE(_dependencyMap[21]).EventRegister.emit(_events.default.NEWSMEMORY_REQUEST_DOWNLOAD_HR, { + issue: issue, + edition: edition, + pageId: pageId, + boxId: boxId, + xmlId: xmlId, + graph: graph, + callback: this.downloadCallback + }); + } + } else if (onError) { + onError(); + } + + case 26: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_checkZipFile", + value: function _checkZipFile() { + var path = this.state.path; + var zipGraphArchivePath = this.state.zipGraphArchivePath; + + if (path && !zipGraphArchivePath) { + zipGraphArchivePath = _$$_REQUIRE(_dependencyMap[22]).StringUtils.getParentPath(path) + "/" + _newsmemoryUtils.ARCHIVE_ZIP_GRAPH_FILENAME; + } + + this.setState({ + path: undefined, + zipGraphArchivePath: zipGraphArchivePath + }); + } + }, { + key: "_downloadCallback", + value: function _downloadCallback(image) { + var _this3 = this; + + if (this.mounted && this.loading && image) { + this.setState({ + path: image.getBase64(), + imageStyle: this._getImageStyleFromFile() + }, function () { + _this3.loading = false; + }); + } + } + }, { + key: "_getImageFromZip", + value: function _getImageFromZip() { + var _this$props3, xmlId, boxId, graph, useImageDimensions, zipGraphArchivePath, hrImageName, baseLocalPath, base64, _await$getImageSize2, width, height; + + return _regenerator.default.async(function _getImageFromZip$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _this$props3 = this.props, xmlId = _this$props3.xmlId, boxId = _this$props3.boxId, graph = _this$props3.graph, useImageDimensions = _this$props3.useImageDimensions; + zipGraphArchivePath = this.state.zipGraphArchivePath; + hrImageName = _newsmemoryUtils.default.getHrImageName(xmlId, boxId, graph); + baseLocalPath = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(); + _context3.prev = 4; + _context3.next = 7; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[22]).FileUtils.zipEntryToBase64("" + baseLocalPath + zipGraphArchivePath, hrImageName)); + + case 7: + base64 = _context3.sent; + + if (!useImageDimensions) { + _context3.next = 17; + break; + } + + _context3.next = 11; + return _regenerator.default.awrap((0, _imageComponent.getImageSize)((0, _imageComponent.getImageBase64String)(base64))); + + case 11: + _await$getImageSize2 = _context3.sent; + width = _await$getImageSize2.width; + height = _await$getImageSize2.height; + + if (width > 0 && height > 0) { + this.setState({ + base64: base64, + imageStyle: { + width: width, + height: height + } + }); + } else { + this.setState({ + base64: base64 + }); + } + + _context3.next = 18; + break; + + case 17: + this.setState({ + base64: base64 + }); + + case 18: + _context3.next = 23; + break; + + case 20: + _context3.prev = 20; + _context3.t0 = _context3["catch"](4); + this.setState({ + path: undefined, + zipGraphArchivePath: undefined + }); + + case 23: + case "end": + return _context3.stop(); + } + } + }, null, this, [[4, 20]], Promise); + } + }, { + key: "_getImageStyleFromFile", + value: function _getImageStyleFromFile() { + var _this$props4 = this.props, + useImageDimensions = _this$props4.useImageDimensions, + page = _this$props4.page, + xmlId = _this$props4.xmlId, + boxId = _this$props4.boxId, + graph = _this$props4.graph; + + if (useImageDimensions && page) { + var hrImage = _newsmemoryUtils.default.getHrImageByBox(page, _newsmemoryUtils.default.getHrImageName(xmlId, boxId, graph)); + + if (hrImage) { + return { + width: hrImage.getWidth(), + height: hrImage.getHeight() + }; + } + } + + return {}; + } + }, { + key: "_getDebugComponent", + value: function _getDebugComponent() { + var _this$props5 = this.props, + useImageDimensions = _this$props5.useImageDimensions, + style = _this$props5.style; + var imageStyle = this.state.imageStyle; + return global.isLayoutDebug && useImageDimensions ? _react.default.createElement(_reactNative.View, { + style: [{ + position: "absolute", + borderWidth: 1, + borderColor: "#F47220", + zIndex: 50 + }, (0, _extends2.default)({}, style), (0, _extends2.default)({}, imageStyle)] + }) : null; + } + }, { + key: "render", + value: function render() { + var _this$props6 = this.props, + style = _this$props6.style, + onError = _this$props6.onError, + rest = (0, _objectWithoutProperties2.default)(_this$props6, ["style", "onError"]); + var _this$state2 = this.state, + path = _this$state2.path, + zipGraphArchivePath = _this$state2.zipGraphArchivePath, + base64 = _this$state2.base64, + imageStyle = _this$state2.imageStyle; + var commonProps = { + style: [style, imageStyle], + resizeMode: "stretch", + forceFastComponent: true + }; + + if (path) { + var baseLocalPath = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(); + + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_imageComponent.default, (0, _extends2.default)({}, commonProps, { + source: { + uri: "file://" + baseLocalPath + path, + cache: "web" + }, + onError: this.checkZipFile, + accessibilityLabel: "" + baseLocalPath + path + }, rest)), this._getDebugComponent()); + } + + if (zipGraphArchivePath) { + if (base64) { + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_imageComponent.default, (0, _extends2.default)({}, commonProps, { + source: { + uri: (0, _imageComponent.getImageBase64String)(base64), + cache: "web" + }, + accessibilityLabel: base64, + onError: onError + }, rest)), this._getDebugComponent()); + } + + if (!this.checkZip) { + this.checkZip = true; + this.getImageFromZip(); + return null; + } + } + + this.askResourceDownload(); + return null; + } + }]); + return HrImageIos; + }(_react.default.Component); + + exports.default = HrImageIos; + HrImageIos.propTypes = (0, _extends2.default)({ + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + issue: _propTypes.default.string.isRequired, + edition: _propTypes.default.string.isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + pageId: _propTypes.default.number.isRequired, + boxId: _propTypes.default.number.isRequired, + xmlId: _propTypes.default.number.isRequired, + useImageDimensions: _propTypes.default.bool.isRequired, + path: _propTypes.default.string, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + graph: _propTypes.default.bool, + zipGraphArchivePath: _propTypes.default.string, + onLoaded: _propTypes.default.func, + onError: _propTypes.default.func + }, _reactNative.ImagePropsBase); + HrImageIos.defaultProps = { + graph: true + }; + + var HrUtility = function () { + function HrUtility() { + (0, _classCallCheck2.default)(this, HrUtility); + } + + (0, _createClass2.default)(HrUtility, null, [{ + key: "pauseQueue", + value: function pauseQueue() {} + }, { + key: "resumeQueue", + value: function resumeQueue() {} + }, { + key: "clearQueue", + value: function clearQueue() {} + }, { + key: "setPoolSize", + value: function setPoolSize() {} + }]); + return HrUtility; + }(); + + exports.HrUtility = HrUtility; +},2168,[5,80,108,6,7,8,15,12,14,16,17,201,28,460,587,588,603,714,638,710,574,572,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _newsmemoryExtraUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PageExtra = function (_React$PureComponent) { + (0, _inherits2.default)(PageExtra, _React$PureComponent); + + var _super = _createSuper(PageExtra); + + function PageExtra(props) { + var _this; + + (0, _classCallCheck2.default)(this, PageExtra); + _this = _super.call(this, props); + + var _global$getActivePSet = global.getActivePSetup(), + extraLinkColor = _global$getActivePSet.extraLinkColor, + urlType = _global$getActivePSet.urlType; + + var _StringUtils$analyzeR = _$$_REQUIRE(_dependencyMap[17]).StringUtils.analyzeRGBAColor(extraLinkColor), + red = _StringUtils$analyzeR.red, + green = _StringUtils$analyzeR.green, + blue = _StringUtils$analyzeR.blue, + alpha = _StringUtils$analyzeR.alpha; + + _this.backgroundColor = "rgba(" + red + "," + green + "," + blue + ",1)"; + _this.alpha = alpha; + _this.opacity = new _reactNative.Animated.Value(alpha); + _this.fadeExtra = _this._fadeExtra.bind((0, _assertThisInitialized2.default)(_this)); + _this.onExtraPress = _this._onExtraPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.highlight = _this._highlight.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggle = _this._toggle.bind((0, _assertThisInitialized2.default)(_this)); + _this.extra = []; + _this.animationFade = undefined; + _this.state = { + urlType: urlType, + hidden: props.hidden + }; + return _this; + } + + (0, _createClass2.default)(PageExtra, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var _this$props = this.props, + page = _this$props.page, + onLoaded = _this$props.onLoaded; + this.onExtraShow = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.NEWSMEMORY_SHOW_EXTRA, function (_ref) { + var eventPage = _ref.page; + + if (_pageUtils.default.comparePages(page, eventPage)) { + _this2.highlight(); + } + }); + this.onExtraHide = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.NEWSMEMORY_HIDE_EXTRA, function (_ref2) { + var eventPage = _ref2.page; + + var _global$getActivePSet2 = global.getActivePSetup(), + urlType = _global$getActivePSet2.urlType; + + var currentUrlType = _this2.state.urlType; + + if (_pageUtils.default.comparePages(page, eventPage) && currentUrlType !== _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.UNDERLINE && urlType === _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.UNDERLINE) { + _this2.setState({ + urlType: _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.UNDERLINE + }); + } + }); + + if (onLoaded) { + onLoaded(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.onExtraShow); + + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.onExtraHide); + } + }, { + key: "_onExtraPress", + value: function _onExtraPress(extraType, extraContent) { + return _newsmemoryExtraUtils.default.onExtraPress(extraType, extraContent, this.props); + } + }, { + key: "_fadeExtra", + value: function _fadeExtra() { + var _this3 = this; + + var urlType = this.state.urlType; + + if (urlType !== _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.UNDERLINE) { + var _global$getActivePSet3 = global.getActivePSetup(), + previewHighlightDurationSeconds = _global$getActivePSet3.previewHighlightDurationSeconds; + + var duration = previewHighlightDurationSeconds * 1000; + this.opacity.setValue(this.alpha); + setTimeout(function () { + _this3.animationFade = _reactNative.Animated.timing(_this3.opacity, { + toValue: 0, + useNativeDriver: true, + duration: duration + }).start(function (_ref3) { + var finished = _ref3.finished; + _this3.animationFade = undefined; + + if (finished && urlType !== _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.UNDERLINE) { + _this3.setState({ + urlType: _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.UNDERLINE + }); + } + }); + }, duration); + } + } + }, { + key: "hasExtraForEvent", + value: function hasExtraForEvent(event, defaultCallback) { + var extras = this._generateExtraViews(true); + + return _newsmemoryExtraUtils.default.hasExtraForEvent(event, extras, this.onExtraPress, defaultCallback); + } + }, { + key: "_generateExtraViews", + value: function _generateExtraViews() { + var skipView = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var urlType = this.state.urlType; + var params = (0, _extends2.default)({}, this.props, { + urlType: urlType, + skipView: skipView, + backgroundColor: this.backgroundColor, + opacity: this.opacity + }); + return _newsmemoryExtraUtils.default.generateExtraViews(params); + } + }, { + key: "show", + value: function show() { + var hidden = this.state.hidden; + + if (hidden) { + this.setState({ + hidden: false + }); + } + } + }, { + key: "hide", + value: function hide() { + var hidden = this.state.hidden; + + if (!hidden) { + this.setState({ + hidden: true + }); + } + } + }, { + key: "_highlight", + value: function _highlight(force) { + var _this$state = this.state, + urlType = _this$state.urlType, + hidden = _this$state.hidden; + + if (urlType === _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.UNDERLINE && !hidden || force) { + this.setState({ + urlType: _$$_REQUIRE(_dependencyMap[19]).URL_TYPES.SQUARED, + hidden: false + }, this.fadeExtra); + } + } + }, { + key: "_toggle", + value: function _toggle(highlight) { + if (this.animationFade) { + this.animationFade.stop(); + this.opacity.setValue(this.alpha); + } + + var hidden = this.state.hidden; + + if (hidden) { + if (highlight) { + this.highlight(true); + } else { + this.show(); + } + } else { + this.hide(); + } + } + }, { + key: "hasExtras", + value: function hasExtras() { + return this.extras.length > 0; + } + }, { + key: "render", + value: function render() { + var style = this.props.style; + this.extras = this._generateExtraViews(); + var hidden = this.state.hidden; + + if (hidden) { + return null; + } + + return _react.default.createElement(_reactNative.View, { + style: style + }, this.extras.map(function (_ref4) { + var Component = _ref4.Component; + return Component; + })); + } + }]); + return PageExtra; + }(_react.default.PureComponent); + + PageExtra.propTypes = { + edition: _propTypes.default.instanceOf(_Edition.default).isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }).isRequired, + getCurrentArticle: _propTypes.default.func.isRequired, + article: _propTypes.default.instanceOf(_EPaperArticle.default), + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + minZoom: _propTypes.default.number, + zoom: _propTypes.default.number, + offset: _propTypes.default.object, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }), + hidden: _propTypes.default.bool, + onLoaded: _propTypes.default.func + }; + PageExtra.defaultProps = { + minZoom: 1, + offset: { + offsetX: 0, + offsetY: 0 + }, + hidden: false + }; + var _default = PageExtra; + exports.default = _default; +},2169,[5,6,7,8,15,12,14,16,17,28,201,638,460,644,715,2170,640,462,572,717]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.ENRICHMENT_DEFAULT_SIZE = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + var _reactNativeMail = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _ApplicationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Box = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _ExtraLinks = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var parser = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[16])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ENRICHMENT_DEFAULT_SIZE = 50; + exports.ENRICHMENT_DEFAULT_SIZE = ENRICHMENT_DEFAULT_SIZE; + + var NewsmemoryExtraUtils = function () { + function NewsmemoryExtraUtils() { + (0, _classCallCheck2.default)(this, NewsmemoryExtraUtils); + } + + (0, _createClass2.default)(NewsmemoryExtraUtils, null, [{ + key: "getExtraIconByType", + value: function getExtraIconByType(type) { + switch (type) { + case _ExtraLinks.PageExtraType.VIDEO: + case _ExtraLinks.PageExtraType.BRIGHT_COVE: + case _ExtraLinks.PageExtraType.VIDEO_WEB: + case _ExtraLinks.PageExtraType.YOUTUBE: + return _ApplicationManager.default.getDefaultIconsDirectory() + "/cinema2.png"; + + case _ExtraLinks.PageExtraType.GALLERY: + return _ApplicationManager.default.getDefaultIconsDirectory() + "/camera.png"; + + case _ExtraLinks.PageExtraType.EXTERNAL_URL: + return _ApplicationManager.default.getDefaultIconsDirectory() + "/go.png"; + + case _ExtraLinks.PageExtraType.URL: + default: + return undefined; + } + } + }, { + key: "getExtraImageUrl", + value: function getExtraImageUrl(link) { + var type = link.getType(); + var customImageUrl = link.getImageURL(); + var imageUrl = NewsmemoryExtraUtils.getExtraIconByType(type); + + if (imageUrl && _$$_REQUIRE(_dependencyMap[22]).StringUtils.isUrl(customImageUrl)) { + imageUrl = customImageUrl; + } + + return imageUrl; + } + }, { + key: "hasExtraForEvent", + value: function hasExtraForEvent(event, extras, onExtraPress, defaultCallback) { + var x = event.x, + y = event.y, + scale = event.scale, + margin = event.margin; + var containerMargin = margin || 0; + var p = { + x: x / scale - containerMargin, + y: y / scale - containerMargin + }; + var extra = extras.find(function (_ref) { + var style = _ref.style, + link = _ref.link; + var icon = NewsmemoryExtraUtils.getExtraIconByType(link.getType()); + + if (_$$_REQUIRE(_dependencyMap[22]).PlatformUtils.isAndroid() && icon) { + style.width /= scale; + style.height /= scale; + } + + return _$$_REQUIRE(_dependencyMap[22]).JSUtils.rectContainsPoint(style, p); + }); + + if (extra) { + if (typeof onExtraPress === "function") { + var link = extra.link; + var type = link.getType(); + var handled = onExtraPress(type, link.getContent()); + + if (!handled && typeof defaultCallback === "function") { + defaultCallback(type); + } + } + + return true; + } + + return false; + } + }, { + key: "canShowExtras", + value: function canShowExtras(type) { + var _global$getActivePSet = global.getActivePSetup(), + showExtrasToLoggedUsersOnly = _global$getActivePSet.showExtrasToLoggedUsersOnly, + loginStatus = _global$getActivePSet.loginStatus; + + if (showExtrasToLoggedUsersOnly && (type === _ExtraLinks.PageExtraType.URL || type === _ExtraLinks.PageExtraType.EXTERNAL_URL || type === _ExtraLinks.PageExtraType.MAIL || type === _ExtraLinks.PageExtraType.VIDEO || type === _ExtraLinks.PageExtraType.VIDEO_WEB || type === _ExtraLinks.PageExtraType.BRIGHT_COVE || type === _ExtraLinks.PageExtraType.YOUTUBE || type === _ExtraLinks.PageExtraType.GALLERY)) { + return loginStatus && loginStatus.isLoggedIn(); + } + + return true; + } + }, { + key: "getExtrasForArticle", + value: function getExtrasForArticle(page, article) { + var extras = page.getExtralinks(); + return extras.filter(function (extra) { + var intersect = false; + + var _extra$getCoordinates = extra.getCoordinates(), + start = _extra$getCoordinates.left, + top = _extra$getCoordinates.top; + + var _extra$getSize = extra.getSize(), + width = _extra$getSize.width, + height = _extra$getSize.height; + + var _extra$getPdfSize = extra.getPdfSize(), + pdfHeight = _extra$getPdfSize.height; + + var imageUrl = NewsmemoryExtraUtils.getExtraImageUrl(extra); + + if (imageUrl || extra.getType() === _ExtraLinks.PageExtraType.OPEN_ARTICLE) { + top = pdfHeight - top; + width = ENRICHMENT_DEFAULT_SIZE; + height = ENRICHMENT_DEFAULT_SIZE; + } + + var extraRect = { + start: start, + top: top, + width: width, + height: height + }; + var boxes = article.getBoxes(); + + for (var i = 0; i < boxes.length && !intersect; i++) { + var box = boxes[i]; + + if (box) { + var intersectArea = _$$_REQUIRE(_dependencyMap[22]).JSUtils.intersectArea(extraRect, { + start: box.getLeft(), + top: box.getTop(), + width: box.getWidth(), + height: box.getHeight() + }); + + intersect = intersectArea >= width * height * 0.25; + } + } + + return intersect; + }); + } + }, { + key: "navigate", + value: function navigate(route, params) { + var props = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var navigation = props.navigation; + + if (navigation) { + navigation.navigate(route, params); + } else { + _NavigationService.default.main.navigate(route, params); + } + } + }, { + key: "onExtraPress", + value: function onExtraPress(extraType, extraContent, props) { + var handled = true; + var edition = props.edition, + page = props.page; + + var content = _$$_REQUIRE(_dependencyMap[22]).StringUtils.decodeURIComponent(extraContent); + + var type = extraType; + + if (content.includes("mailto:")) { + type = _ExtraLinks.PageExtraType.MAIL; + content = content.replace("mailto:", ""); + } else if (content.includes("tel:")) { + type = _ExtraLinks.PageExtraType.PHONE; + } + + switch (type) { + case _ExtraLinks.PageExtraType.OPEN_APP: + _tecnaviaPlatformUtils.default.openURL(_$$_REQUIRE(_dependencyMap[22]).StringUtils.decodeHTML(content)); + + break; + + case _ExtraLinks.PageExtraType.OPEN_ISSUE: + case _ExtraLinks.PageExtraType.OPEN_ARTICLE: + case _ExtraLinks.PageExtraType.URL: + var _StringUtils$segmentU = _$$_REQUIRE(_dependencyMap[22]).StringUtils.segmentUrl(content), + getParams = _StringUtils$segmentU.getParams; + + var mapped = Object.keys(getParams).reduce(function (result, key) { + if (getParams[key] !== undefined) { + result[_$$_REQUIRE(_dependencyMap[22]).StringUtils.decodeHTML(key)] = _$$_REQUIRE(_dependencyMap[22]).StringUtils.decodeHTML(getParams[key]); + } + + return result; + }, {}); + + if (_$$_REQUIRE(_dependencyMap[22]).JSUtils.hasProperty(mapped, "openIssue")) { + if (mapped.pSetup) { + mapped.machine = mapped.machine || global.getAppServer(); + } + + global.setNewsmemoryStartupParams(mapped); + + _NavigationService.default.restart(); + } else if (_$$_REQUIRE(_dependencyMap[22]).JSUtils.hasProperty(mapped, "openArticle")) { + if (!_$$_REQUIRE(_dependencyMap[22]).JSUtils.isEmpty(mapped.artid) && !_$$_REQUIRE(_dependencyMap[22]).JSUtils.isEmpty(mapped.goTo)) { + if (mapped.pSetup) { + mapped.machine = mapped.machine || global.getAppServer(); + } + + global.setNewsmemoryStartupParams(mapped); + + _NavigationService.default.restart(); + } else { + handled = false; + } + } else { + NewsmemoryExtraUtils.navigate("WebScreen", { + url: content + }, props); + (0, _$$_REQUIRE(_dependencyMap[23]).sendNewsmemoryExtraUrl)(content, edition, page); + } + + break; + + case _ExtraLinks.PageExtraType.EXTERNAL_URL: + NewsmemoryExtraUtils.navigate("WebScreen", { + url: content + }, props); + (0, _$$_REQUIRE(_dependencyMap[23]).sendNewsmemoryExtraUrl)(content, edition, page); + break; + + case _ExtraLinks.PageExtraType.MAIL: + _reactNativeMail.default.mail({ + subject: "", + recipients: [content], + body: "", + isHTML: false + }, function () {}); + + break; + + case _ExtraLinks.PageExtraType.VIDEO: + _$$_REQUIRE(_dependencyMap[24]).LoadingOverlay.show({ + id: "video" + }); + + _Api.default.head(content).then(function (_ref2) { + var request = _ref2.request; + + try { + _tecnaviaPlatformUtils.default.openURL(request.responseURL); + + (0, _$$_REQUIRE(_dependencyMap[23]).sendNewsmemoryExtraVideo)(request.responseURL, edition, page); + } catch (e) {} + + _$$_REQUIRE(_dependencyMap[24]).LoadingOverlay.hide({ + id: "video" + }); + }); + + break; + + case _ExtraLinks.PageExtraType.VIDEO_WEB: + case _ExtraLinks.PageExtraType.BRIGHT_COVE: + case _ExtraLinks.PageExtraType.YOUTUBE: + NewsmemoryExtraUtils.navigate("WebScreen", { + url: _NewsmemoryAJAX.default.getVideoURL(content), + hideLogo: true, + disableBrowserButton: true + }, props); + (0, _$$_REQUIRE(_dependencyMap[23]).sendNewsmemoryExtraYoutube)(content, edition, page); + break; + + case _ExtraLinks.PageExtraType.GALLERY: + _$$_REQUIRE(_dependencyMap[24]).LoadingOverlay.show({ + id: "gallery" + }); + + _Api.default.ajax(_$$_REQUIRE(_dependencyMap[22]).StringUtils.convertNewsmemoryDomainToHTTPS(content)).then(function (_ref3) { + var data = _ref3.data; + var parseGallery = parser.newsmemoryGallery(data); + + try { + if (parseGallery) { + var params = { + items: parseGallery, + caller: "epaper" + }; + + if (edition && page) { + params.edition = edition; + params.page = page; + } + + NewsmemoryExtraUtils.navigate("GalleryScreen", params, props); + } + } catch (e) {} + + _$$_REQUIRE(_dependencyMap[24]).LoadingOverlay.hide({ + id: "gallery" + }); + }); + + break; + + case _ExtraLinks.PageExtraType.POINTER: + case _ExtraLinks.PageExtraType.ADDON: + handled = false; + break; + + case _ExtraLinks.PageExtraType.PAGE: + _$$_REQUIRE(_dependencyMap[25]).EventRegister.emit(_events.default.NEWSMEMORY_ON_EXTRA_GO_TO_PAGE_PRESS, { + page: content + }); + + break; + + default: + _tecnaviaPlatformUtils.default.openURL(content); + + } + + return handled; + } + }, { + key: "getBoxStyle", + value: function getBoxStyle(iconParentStyle, boxStyle, size, scale) { + boxStyle.width = iconParentStyle.width || boxStyle.width * scale; + boxStyle.height = iconParentStyle.height || boxStyle.height * scale; + + if (boxStyle.start < 0) { + boxStyle.start = 0; + } else if (boxStyle.start + boxStyle.width > size.width) { + boxStyle.start = size.width - boxStyle.width; + } + + if (boxStyle.top < 0) { + boxStyle.top = 0; + } else if (boxStyle.top + boxStyle.height > size.height) { + boxStyle.top = size.height - boxStyle.height; + } + + return boxStyle; + } + }, { + key: "generateExtraViews", + value: function generateExtraViews(params) { + var page = params.page, + article = params.article, + size = params.size, + pageSize = params.pageSize, + zoom = params.zoom, + minZoom = params.minZoom, + viewOffset = params.offset, + urlType = params.urlType, + skipView = params.skipView, + backgroundColor = params.backgroundColor, + opacity = params.opacity, + getCurrentArticle = params.getCurrentArticle; + var extras = article ? NewsmemoryExtraUtils.getExtrasForArticle(page, article) : page.getExtralinks(); + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + readModeEnabled = _global$getNewsmemory.readModeEnabled; + + if (article || zoom > 1 || !readModeEnabled) { + extras = extras.filter(function (extra) { + return extra.getType() !== _ExtraLinks.PageExtraType.OPEN_ARTICLE; + }); + } + + var pdfOffset = page.getTotalOffset(); + var pdfOffsetX = pdfOffset.offsetX, + pdfOffsetY = pdfOffset.offsetY; + var offsetX = 0; + var offsetY = 0; + + if (viewOffset) { + offsetX = viewOffset.offsetX; + offsetY = viewOffset.offsetY; + } + + return extras.map(function (link, index) { + var type = link.getType(); + + var _link$getCoordinates = link.getCoordinates(), + left = _link$getCoordinates.left, + top = _link$getCoordinates.top; + + var _link$getPdfSize = link.getPdfSize(), + width = _link$getPdfSize.width, + height = _link$getPdfSize.height; + + var imageUrl = NewsmemoryExtraUtils.getExtraImageUrl(link); + var factor = page.isDoubleTruck() ? 2 : 1; + var reduceX = pageSize.width / width / factor || 1; + var reduceY = pageSize.height / height || 1; + var reduce = Math.max(reduceX, reduceY); + var component = null; + var boxStyle; + + if (imageUrl || type === _ExtraLinks.PageExtraType.OPEN_ARTICLE) { + var enrichmentStyle = { + width: ENRICHMENT_DEFAULT_SIZE, + height: ENRICHMENT_DEFAULT_SIZE + }; + boxStyle = (0, _extends2.default)({ + start: (left - offsetX - pdfOffsetX) * reduce || 0, + top: (height - top - offsetY - pdfOffsetY) * reduce || 0 + }, enrichmentStyle); + var scale = minZoom / zoom; + var translate = ENRICHMENT_DEFAULT_SIZE * (1 - zoom) / 2; + var baseParentStyle = { + position: "absolute", + justifyContent: "center", + alignItems: "center" + }; + + var parentStyle = _$$_REQUIRE(_dependencyMap[26]).Css.getStyleObjByCssClasses(["newsmemory-page-extra-icon-parent", "newsmemory-article-extra-icon-parent"]); + + var style = _$$_REQUIRE(_dependencyMap[26]).Css.getStyleObjByCssClasses(["newsmemory-page-extra-icon", "newsmemory-page-extra-icon-" + type, "newsmemory-article-extra-icon", "newsmemory-article-extra-icon-" + type]); + + var imageStyle = (0, _extends2.default)({}, enrichmentStyle, { + maxWidth: "100%", + maxHeight: "100%" + }); + var iconStyle = (0, _extends2.default)({ + fontSize: ENRICHMENT_DEFAULT_SIZE + }, enrichmentStyle); + + if (_$$_REQUIRE(_dependencyMap[22]).PlatformUtils.isAndroid()) { + boxStyle = NewsmemoryExtraUtils.getBoxStyle(parentStyle, boxStyle, size, 1); + baseParentStyle.transform = [{ + scale: scale + }, { + translateX: translate + }, { + translateY: translate + }, { + perspective: 2000 + }]; + } else { + if (parentStyle.width) { + parentStyle.width *= scale; + } + + if (parentStyle.height) { + parentStyle.height *= scale; + } + + if (parentStyle.borderWidth) { + parentStyle.borderWidth *= scale; + } + + boxStyle = NewsmemoryExtraUtils.getBoxStyle(parentStyle, boxStyle, size, scale); + + var library = _$$_REQUIRE(_dependencyMap[22]).CssUtils.getAttributeFromStyle("library", style); + + if (!library) { + if (style.width) { + style.width *= scale; + } + + if (style.height) { + style.height *= scale; + } + } + + imageStyle.width *= scale; + imageStyle.height *= scale; + iconStyle.transform = [{ + scale: scale + }, { + perspective: 2000 + }]; + } + + if (!skipView) { + var boxComponent; + + var src = _$$_REQUIRE(_dependencyMap[22]).CssUtils.getAttributeFromStyle("src", style); + + if (imageUrl || !_$$_REQUIRE(_dependencyMap[22]).JSUtils.isEmpty(src)) { + boxComponent = _react.default.createElement(_imageIconChooserComponent.default, { + key: index, + resizeMode: "contain", + resizeMethod: "resize", + source: { + uri: imageUrl + }, + style: style, + iconStyle: iconStyle, + imageStyle: imageStyle + }); + } else { + var _global$getActivePSet2 = global.getActivePSetup(), + backgroundColorArticleToSelect = _global$getActivePSet2.backgroundColorArticleToSelect; + + var selectedBackgroundColor = _$$_REQUIRE(_dependencyMap[22]).StringUtils.parseColor(backgroundColorArticleToSelect, _$$_REQUIRE(_dependencyMap[22]).colors.articleHighlight); + + boxComponent = _react.default.createElement(OpenArticleExtra, { + index: index, + page: page, + link: link, + opacity: opacity, + backgroundColor: backgroundColor, + selectedBackgroundColor: selectedBackgroundColor, + style: style, + imageStyle: imageStyle, + getCurrentArticle: getCurrentArticle + }); + } + + component = _react.default.createElement(_reactNative.Animated.View, { + key: "page_extra_item_" + index, + style: [_pageUtils.default.traverseStyleForRTL(boxStyle), baseParentStyle, parentStyle] + }, boxComponent); + } + } else { + var extraStyle = {}; + + if (urlType === _$$_REQUIRE(_dependencyMap[27]).URL_TYPES.UNDERLINE) { + extraStyle = { + borderBottomWidth: 0.5, + borderBottomColor: backgroundColor + }; + } else if (urlType === _$$_REQUIRE(_dependencyMap[27]).URL_TYPES.SQUARED) { + extraStyle = { + backgroundColor: backgroundColor, + opacity: opacity + }; + } else if (urlType === _$$_REQUIRE(_dependencyMap[27]).URL_TYPES.ROUNDED) { + extraStyle = { + backgroundColor: backgroundColor, + opacity: opacity, + borderRadius: 25 + }; + } + + var _link$getSize = link.getSize(), + linkWidth = _link$getSize.width, + linkHeight = _link$getSize.height; + + boxStyle = { + start: left * reduce - offsetX || 0, + top: top * reduce - offsetY || 0, + width: linkWidth * reduce, + height: linkHeight * reduce + }; + + if (!skipView) { + component = _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["newsmemory-page-extra", "newsmemory-page-extra-" + type, "newsmemory-article-extra", "newsmemory-article-extra-" + type], + key: "page_extra_item_" + index + }, _react.default.createElement(_reactNative.Animated.View, { + key: index, + style: [_pageUtils.default.traverseStyleForRTL(boxStyle), { + position: "absolute" + }, extraStyle] + })); + } + } + + return { + Component: component, + style: boxStyle, + link: link + }; + }).filter(function (_ref4) { + var link = _ref4.link; + return link && NewsmemoryExtraUtils.canShowExtras(link.type); + }); + } + }]); + return NewsmemoryExtraUtils; + }(); + + exports.default = NewsmemoryExtraUtils; + + function OpenArticleExtra(props) { + var link = props.link, + page = props.page, + opacity = props.opacity, + imageStyle = props.imageStyle, + style = props.style, + index = props.index, + getCurrentArticle = props.getCurrentArticle; + var notSelectedBackgroundColor = props.backgroundColor, + selectedBackgroundColor = props.selectedBackgroundColor; + + var isExtraForArticle = function isExtraForArticle(article) { + return article.getPageId() === page.getPageId() && NewsmemoryExtraUtils.getExtrasForArticle(page, article).find(function (extra) { + return extra.getType() === _ExtraLinks.PageExtraType.OPEN_ARTICLE && _$$_REQUIRE(_dependencyMap[22]).JSUtils.areEqualDeep(extra, link); + }) !== undefined; + }; + + var selectedStyle = _$$_REQUIRE(_dependencyMap[26]).Css.getStyleObjByCssClasses(["newsmemory-page-extra-icon-selected", "newsmemory-page-extra-icon-" + link.getType() + "-selected"]); + + notSelectedBackgroundColor = _$$_REQUIRE(_dependencyMap[22]).CssUtils.getAttributeFromStyle("backgroundColor", style, notSelectedBackgroundColor); + selectedBackgroundColor = _$$_REQUIRE(_dependencyMap[22]).CssUtils.getAttributeFromStyle("backgroundColor", selectedStyle, selectedBackgroundColor); + var currentArticle = getCurrentArticle(); + + var _useState = (0, _react.useState)(currentArticle && isExtraForArticle(currentArticle)), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + isSelected = _useState2[0], + setIsSelected = _useState2[1]; + + (0, _react.useEffect)(function () { + var onSelect = _$$_REQUIRE(_dependencyMap[25]).EventRegister.on(_events.default.NEWSMEMORY_ARTICLE_HIGHLIGHT, function (_ref5) { + var article = _ref5.article; + + if (isExtraForArticle(article)) { + if (!isSelected) { + setIsSelected(true); + } + } else if (isSelected) { + setIsSelected(false); + } + }); + + return function () { + _$$_REQUIRE(_dependencyMap[25]).EventRegister.rm(onSelect); + }; + }, [isSelected]); + var backgroundColor = notSelectedBackgroundColor; + var otherStyle = {}; + + if (isSelected) { + backgroundColor = selectedBackgroundColor; + otherStyle = selectedStyle; + } + + return _react.default.createElement(_reactNative.Animated.View, { + key: index, + style: [{ + opacity: opacity, + borderRadius: 25, + borderWidth: 1, + borderColor: _$$_REQUIRE(_dependencyMap[22]).ColorUtils.applyDarknessToColor(backgroundColor, -50) + }, imageStyle, style, otherStyle, { + backgroundColor: backgroundColor + }] + }); + } +},2170,[5,41,6,7,8,17,28,2152,431,602,641,640,639,638,1861,460,2052,1876,715,1970,430,1859,462,1954,1950,572,699,717]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Error = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Error = function (_React$PureComponent) { + (0, _inherits2.default)(Error, _React$PureComponent); + + var _super = _createSuper(Error); + + function Error(props) { + var _this; + + (0, _classCallCheck2.default)(this, Error); + _this = _super.call(this, props); + _this.state = { + hidden: false + }; + return _this; + } + + (0, _createClass2.default)(Error, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var _this$props = this.props, + autoHide = _this$props.autoHide, + autoHideTimer = _this$props.autoHideTimer; + + if (autoHide) { + setTimeout(function () { + _this2.setState({ + hidden: true + }); + }, autoHideTimer); + } + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + errors = _this$props2.errors, + style = _this$props2.style; + var hidden = this.state.hidden; + + if (hidden) { + return null; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["error-container"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[11]).styles.list, style] + }, errors.map(function (error) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["error-line"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[11]).styles.line + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["error-text"] + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[11]).styles.text + }, error)))); + }))); + } + }]); + return Error; + }(_react.default.PureComponent); + + exports.Error = Error; + Error.propTypes = { + errors: _propTypes.default.arrayOf(_propTypes.default.string), + style: _propTypes.default.any, + autoHide: _propTypes.default.bool, + autoHideTimer: _propTypes.default.number + }; + Error.defaultProps = { + autoHide: false, + errors: [], + autoHideTimer: 5000 + }; +},2171,[5,7,8,12,14,16,17,201,28,1879,699,2172]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + list: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.md_red_800 + }, + line: { + minHeight: 40, + flexDirection: "row", + alignItems: "center", + paddingLeft: 10, + paddingRight: 10 + }, + text: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.styles = styles; +},2172,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNativeShare = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _articleExpandImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _articleAdContainer = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _TranslationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _articleText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _loginOverlay = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + var _NewsmemoryHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ArticleText = function (_React$Component) { + (0, _inherits2.default)(ArticleText, _React$Component); + + var _super = _createSuper(ArticleText); + + function ArticleText(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleText); + _this = _super.call(this, props); + _this.lastJSHeight = undefined; + _this.scrollTop = undefined; + _this.scrollHeight = undefined; + _this.consumedScrollTop = true; + _this.checkConfig = _this._checkConfig.bind((0, _assertThisInitialized2.default)(_this)); + _this.onHeightChange = _this._onHeightChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.openGallery = _this._openGallery.bind((0, _assertThisInitialized2.default)(_this)); + _this.onAdLoaded = _this._onAdLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.onAdFailed = _this._onAdFailed.bind((0, _assertThisInitialized2.default)(_this)); + _this.onWebViewRef = _this._onWebViewRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLinkClicked = _this._onLinkClicked.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleHeaderRef = _this._onArticleHeaderRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoadEnd = _this._onLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.reloadAds = _this._reloadAds.bind((0, _assertThisInitialized2.default)(_this)); + _this.getPositionId = _this._getPositionId.bind((0, _assertThisInitialized2.default)(_this)); + _this.goToPositionId = _this._goToPositionId.bind((0, _assertThisInitialized2.default)(_this)); + _this.initializeHtml = _this._initializeHtml.bind((0, _assertThisInitialized2.default)(_this)); + _this.isTranslated = _this._isTranslated.bind((0, _assertThisInitialized2.default)(_this)); + _this.startHeightCheck = _this._startHeightCheck.bind((0, _assertThisInitialized2.default)(_this)); + _this.stopHeightCheck = _this._stopHeightCheck.bind((0, _assertThisInitialized2.default)(_this)); + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + fontSize = _global$getNewsmemory.fontSize; + + _this.fontSize = parseInt(fontSize, 10); + _this.translating = false; + _this.enableColumnizer = _this._isColumnViewEnabled(); + _this.state = { + isOnline: _$$_REQUIRE(_dependencyMap[28]).NetworkUtils.isOnline(), + translationFailed: false, + imageLoadFailed: false, + htmlBaseText: "", + manipulatedHtml: "", + lastHtmlColumn: "", + gallery: undefined, + options: {}, + accessibilityFocus: false, + innerText: undefined + }; + return _this; + } + + (0, _createClass2.default)(ArticleText, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.toggleFont = _$$_REQUIRE(_dependencyMap[29]).EventRegister.on(_events.default.TOGGLE_FULLSCREEN_FONT_SIZE, function () { + _this2._updateWebviewFontSize(); + + if (_this2._isColumnizerChanged()) { + _this2._initializeHtml(); + } + }); + this.systemFontSizeChanged = _$$_REQUIRE(_dependencyMap[29]).EventRegister.on(_events.default.SYSTEM_FONT_SIZE_CHANGED, function () { + _this2._updateWebviewFontSize(); + + if (_this2._isColumnizerChanged()) { + _this2._initializeHtml(); + } + }); + this.configChangeListener = _$$_REQUIRE(_dependencyMap[29]).EventRegister.on(_events.default.NEWSMEMORY_CONFIG_CHANGE, this.checkConfig); + this.orientationListener = _$$_REQUIRE(_dependencyMap[29]).EventRegister.on(_events.default.ON_ORIENTATION_CHANGE, function () { + _this2._getLoadedAds(); + }); + this.onConnectivityChangeListener = _$$_REQUIRE(_dependencyMap[29]).EventRegister.on(_events.default.ON_CONNECTIVITY_CHANGE, function (_ref) { + var online = _ref.online; + var isOnline = _this2.state.isOnline; + + if (isOnline !== online) { + var _global$getActivePSet = global.getActivePSetup(), + maxSharesCheckType = _global$getActivePSet.maxSharesCheckType; + + if (maxSharesCheckType === _$$_REQUIRE(_dependencyMap[30]).MAX_SHARE_CHECK_TYPES.REMOTE) { + _$$_REQUIRE(_dependencyMap[29]).EventRegister.emit(_events.default.SHARE_CHANGE_BUTTON_VISIBILITY, { + visible: online + }); + } + + _this2.setState({ + isOnline: online, + imageLoadFailed: false + }); + } + }); + + this._initializeHtml(); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(props) {} + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + var _this$state = this.state, + isOnline = _this$state.isOnline, + translationFailed = _this$state.translationFailed, + imageLoadFailed = _this$state.imageLoadFailed, + gallery = _this$state.gallery, + manipulatedHtml = _this$state.manipulatedHtml, + innerText = _this$state.innerText, + accessibilityFocus = _this$state.accessibilityFocus; + return !_$$_REQUIRE(_dependencyMap[28]).JSUtils.areEqualShallow(nextProps, this.props, { + print: true, + skipKeys: ["headerHtml"] + }) || isOnline !== nextState.isOnline || translationFailed !== nextState.translationFailed || imageLoadFailed !== nextState.imageLoadFailed || gallery !== nextState.gallery || manipulatedHtml !== nextState.manipulatedHtml || innerText !== nextState.innerText || accessibilityFocus !== nextState.accessibilityFocus; + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + if (this._isColumnizerChanged(this.props) || !_$$_REQUIRE(_dependencyMap[28]).JSUtils.areEqualShallow(this.props, prevProps)) { + this._initializeHtml(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[29]).EventRegister.rm(this.toggleFont); + + _$$_REQUIRE(_dependencyMap[29]).EventRegister.rm(this.systemFontSizeChanged); + + _$$_REQUIRE(_dependencyMap[29]).EventRegister.rm(this.configChangeListener); + + _$$_REQUIRE(_dependencyMap[29]).EventRegister.rm(this.orientationListener); + + _$$_REQUIRE(_dependencyMap[29]).EventRegister.rm(this.onConnectivityChangeListener); + } + }, { + key: "setAccessibilityFocus", + value: function setAccessibilityFocus(focus) { + var accessibilityEnabled = this.props.accessibilityEnabled; + var accessibilityFocus = this.state.accessibilityFocus; + + if (accessibilityEnabled && accessibilityFocus !== focus) { + this.setState({ + accessibilityFocus: focus + }); + } + } + }, { + key: "getContentToPrint", + value: function getContentToPrint() { + var _this$props = this.props, + copyrightHtml = _this$props.copyrightHtml, + disclaimerHtml = _this$props.disclaimerHtml, + headerHtml = _this$props.headerHtml, + css = _this$props.css; + var html = this.state.printHtml; + html = _$$_REQUIRE(_dependencyMap[28]).StringUtils.serializeHtml(html); + + if (copyrightHtml) { + html = headerHtml + html + disclaimerHtml + copyrightHtml; + } + + var options = this._getOptions(); + + options.enableColumnizer = false; + options.columnView = 0; + options.ignoreTheme = true; + html = (0, _$$_REQUIRE(_dependencyMap[31]).manipulateArticleContent)(html, css, options, 0); + return html.replace(_$$_REQUIRE(_dependencyMap[31]).REGEX_TAGS.SCRIPT, ""); + } + }, { + key: "getText", + value: function getText() { + var innerText = this.state.innerText; + return innerText || ""; + } + }, { + key: "_isTranslated", + value: function _isTranslated(language) { + var translationFailed = this.state.translationFailed; + return !this.translating && !translationFailed && this.currentTranslationLanguage === language; + } + }, { + key: "_translate", + value: function _translate() { + var _this3 = this; + + var language, + _this$props2, + newspaper, + page, + article, + translation, + _args = arguments; + + return _regenerator.default.async(function _translate$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + language = _args.length > 0 && _args[0] !== undefined ? _args[0] : global.getNewsmemoryConfig().currentTranslationLanguage; + _this$props2 = this.props, newspaper = _this$props2.newspaper, page = _this$props2.page, article = _this$props2.article; + this.currentTranslationLanguage = language; + + if (!(!language || !language.length || language === _NewsmemoryHelper.default.SP.values.translation_disabled)) { + _context.next = 5; + break; + } + + return _context.abrupt("return", { + translatedHTML: undefined, + translationFailed: false, + callback: this.reloadAds + }); + + case 5: + if (this.translating) { + _context.next = 20; + break; + } + + this.translating = true; + + _$$_REQUIRE(_dependencyMap[32]).LoadingOverlay.show({ + id: "translate", + text: global.strings("str_translating_article") + }); + + _context.prev = 8; + _context.next = 11; + return _regenerator.default.awrap(_TranslationManager.default.translate(newspaper, page, article, language)); + + case 11: + translation = _context.sent; + _context.next = 17; + break; + + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](8); + + this._warn(_context.t0.message); + + case 17: + this.translating = false; + + _$$_REQUIRE(_dependencyMap[32]).LoadingOverlay.hide({ + id: "translate" + }); + + return _context.abrupt("return", { + translatedHTML: translation, + translationFailed: !translation, + callback: function callback() { + _this3.reloadAds(); + } + }); + + case 20: + return _context.abrupt("return", {}); + + case 21: + case "end": + return _context.stop(); + } + } + }, null, this, [[8, 14]], Promise); + } + }, { + key: "_isActive", + value: function _isActive() { + var _this$props3 = this.props, + isActive = _this$props3.isActive, + index = _this$props3.index; + return typeof isActive === "function" && isActive(index); + } + }, { + key: "_isColumnizerChanged", + value: function _isColumnizerChanged() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + + var enableColumnizer = this._isColumnViewEnabled(props); + + if (this.enableColumnizer !== enableColumnizer) { + this.enableColumnizer = enableColumnizer; + return true; + } + + return false; + } + }, { + key: "_checkConfig", + value: function _checkConfig() { + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + fontSize = _global$getNewsmemory2.fontSize, + currentTranslationLanguage = _global$getNewsmemory2.currentTranslationLanguage; + + if (this.fontSize !== parseInt(fontSize, 10)) { + this._updateWebviewFontSize(); + } + + var updateHtml = this._isActive() && this.currentTranslationLanguage !== currentTranslationLanguage; + + if (updateHtml) { + _$$_REQUIRE(_dependencyMap[29]).EventRegister.emit(_events.default.TRANSLATE_CHANGE_BUTTON_BADGE); + } + + if (this._isColumnizerChanged() || updateHtml) { + this._initializeHtml(); + } + } + }, { + key: "_updateWebviewFontSize", + value: function _updateWebviewFontSize() { + var _global$getUserSettin = global.getUserSettings(), + fontSize = _global$getUserSettin.fontSize; + + this.fontSize = parseInt(fontSize, 10); + var userFontSize = global.getUserSettings().getFontSize(); + + if (this.articleWebView) { + this.articleWebView.injectJavaScript("try{ document.getElementById('content').style.fontSize = \"" + userFontSize + "%\";}catch(e){}"); + this.articleWebView.recheckContentHeight(); + } + + if (this.articleHeaderRef) { + this.articleHeaderRef.applyFontScale(userFontSize / 100); + } + } + }, { + key: "_isColumnViewEnabled", + value: function _isColumnViewEnabled() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + var deviceSupportColumnizer = props.deviceSupportColumnizer, + enableDesktopLayout = props.enableDesktopLayout; + var fontSize = global.getUserSettings().getFontSize(); + + var _global$getNewsmemory3 = global.getNewsmemoryConfig(), + columnView = _global$getNewsmemory3.columnView; + + return !enableDesktopLayout && deviceSupportColumnizer && columnView > 0 && fontSize <= 100; + } + }, { + key: "_getOptions", + value: function _getOptions() { + var _this$props4 = this.props, + searchText = _this$props4.searchText, + searchColor = _this$props4.searchColor, + newspaper = _this$props4.newspaper, + defaultWidth = _this$props4.defaultWidth, + defaultHeight = _this$props4.defaultHeight, + enableDesktopLayout = _this$props4.enableDesktopLayout; + var isOnline = this.state.isOnline; + var fontSize = global.getUserSettings().getFontSize(); + + var _global$getNewsmemory4 = global.getNewsmemoryConfig(), + columnView = _global$getNewsmemory4.columnView; + + var _global$getFontsConfi = global.getFontsConfig(), + fontRegular = _global$getFontsConfi.fontRegular, + fontBold = _global$getFontsConfi.fontBold, + mappedDynamicFonts = _global$getFontsConfi.mappedDynamicFonts; + + var _global$getActivePSet2 = global.getActivePSetup(), + mergeArticles = _global$getActivePSet2.mergeArticles, + calculateMidAds = _global$getActivePSet2.calculateMidAds, + keepArticlePositionOnRotation = _global$getActivePSet2.keepArticlePositionOnRotation, + enableArticleImageReposition = _global$getActivePSet2.enableArticleImageReposition; + + return { + truncateArticle: _newsmemoryUtils.default.isTrialModeEnabled(newspaper), + isOnline: isOnline, + searchText: searchText, + searchColor: searchColor, + fontRegular: fontRegular, + fontSize: fontSize, + fontBold: fontBold, + dynamicFonts: mappedDynamicFonts, + enableColumnizer: this.enableColumnizer, + columnView: columnView, + keepArticlePositionOnRotation: keepArticlePositionOnRotation, + mergeArticles: mergeArticles, + calculateMidAds: calculateMidAds, + allBlack: _$$_REQUIRE(_dependencyMap[28]).PlatformUtils.isEInk(), + contentWidth: defaultWidth, + containerHeight: defaultHeight, + enableArticleImageReposition: enableArticleImageReposition, + enableDesktopLayout: enableDesktopLayout + }; + } + }, { + key: "_startHeightCheck", + value: function _startHeightCheck() { + if (this.articleWebView) { + this.articleWebView.startHeightCheck(); + } + } + }, { + key: "_stopHeightCheck", + value: function _stopHeightCheck() { + if (this.articleWebView) { + this.articleWebView.stopHeightCheck(); + } + } + }, { + key: "_onHeightChange", + value: function _onHeightChange(height) { + var _this$props5, defaultHeight, defaultWidth, htmlBaseText, measuredHeight, size; + + return _regenerator.default.async(function _onHeightChange$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this.lastJSHeight = height; + _this$props5 = this.props, defaultHeight = _this$props5.defaultHeight, defaultWidth = _this$props5.defaultWidth; + htmlBaseText = this.state.htmlBaseText; + _context2.prev = 3; + + if (!this.articleHeaderRef) { + _context2.next = 12; + break; + } + + measuredHeight = height; + + if (!(measuredHeight < defaultHeight)) { + _context2.next = 11; + break; + } + + _context2.next = 9; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[28]).StringUtils.textSize(htmlBaseText, defaultWidth)); + + case 9: + size = _context2.sent; + measuredHeight = size.height; + + case 11: + this.articleHeaderRef.expandIfEnoughtSpace(Math.max(defaultHeight - Math.max(measuredHeight, height), 0)); + + case 12: + _context2.next = 16; + break; + + case 14: + _context2.prev = 14; + _context2.t0 = _context2["catch"](3); + + case 16: + this._consumeScrollTo(); + + this._getLoadedAds(); + + this._getHrsPosition(); + + case 19: + case "end": + return _context2.stop(); + } + } + }, null, this, [[3, 14]], Promise); + } + }, { + key: "_getHrsPosition", + value: function _getHrsPosition() { + if (this.articleWebView) { + this.articleWebView.injectJavaScript("if (typeof getHrsPosition === 'function') getHrsPosition();"); + } + } + }, { + key: "_getLoadedAds", + value: function _getLoadedAds() { + if (this.articleWebView) { + this.articleWebView.injectJavaScript("if (typeof getLoadedAds === 'function') getLoadedAds();"); + } + } + }, { + key: "_getPositionId", + value: function _getPositionId(x, y) { + if (this.articleWebView) { + this.articleWebView.injectJavaScript("if (typeof getPositionId === 'function') getPositionId(" + x + "," + y + ");"); + } + } + }, { + key: "_goToPositionId", + value: function _goToPositionId(positionId) { + if (this.articleWebView) { + this.articleWebView.injectJavaScript("if (typeof goToPositionId === 'function') goToPositionId('" + positionId + "');"); + } + } + }, { + key: "_setNativeAdsCallback", + value: function _setNativeAdsCallback(data) { + var _this4 = this; + + if (data && data.length) { + var article = this.props.article; + var nativeAds = data.map(function (ad) { + ad.onAdLoaded = _this4.onAdLoaded; + ad.onAdFailed = _this4.onAdFailed; + return ad; + }); + + _$$_REQUIRE(_dependencyMap[29]).EventRegister.emit(_events.default.LOAD_NATIVE_ADS, { + id: (0, _$$_REQUIRE(_dependencyMap[33]).getArticleId)(article), + nativeAds: nativeAds + }); + } + } + }, { + key: "_getNativeAds", + value: function _getNativeAds() { + var article = this.props.article; + return _react.default.createElement(_articleAdContainer.default, { + articleId: (0, _$$_REQUIRE(_dependencyMap[33]).getArticleId)(article) + }); + } + }, { + key: "_onAdLoaded", + value: function _onAdLoaded(model) { + this._log("Native ad loaded: " + model.key); + + if (this.articleWebView) { + var key = model.key; + this.articleWebView.injectJavaScript("if (typeof showNativeAd === 'function') showNativeAd(\"" + key + "\");"); + } + } + }, { + key: "_onAdFailed", + value: function _onAdFailed(model, error) { + this._warn("Native ad failed: " + error); + + if (this.articleWebView) { + var key = model.key; + this.articleWebView.injectJavaScript("if (typeof hideNativeAd === 'function') hideNativeAd(\"" + key + "\");"); + } + } + }, { + key: "_reloadAds", + value: function _reloadAds() { + this._log("reload ads"); + + var _this$props6 = this.props, + defaultHeight = _this$props6.defaultHeight, + article = _this$props6.article; + + _$$_REQUIRE(_dependencyMap[29]).EventRegister.emit(_events.default.LOAD_NATIVE_ADS, { + id: (0, _$$_REQUIRE(_dependencyMap[33]).getArticleId)(article), + nativeAds: [] + }); + + if (this.articleWebView) { + this.articleWebView.updateHeight(defaultHeight); + } + } + }, { + key: "_onMessage", + value: function _onMessage(data) { + var _this5 = this; + + var _this$props7 = this.props, + index = _this$props7.index, + onTextLoaded = _this$props7.onTextLoaded, + onLongPress = _this$props7.onLongPress, + onPositionId = _this$props7.onPositionId, + onPositionIdOffset = _this$props7.onPositionIdOffset, + onHrsPosition = _this$props7.onHrsPosition, + onArticleExtraLoaded = _this$props7.onArticleExtraLoaded, + hasAccessibilityFocus = _this$props7.hasAccessibilityFocus; + var type = data.type, + content = data.content; + + this._log("on message type: " + type); + + if (type === "ART_ADD_TOP") { + var lastHtmlColumn = this.state.lastHtmlColumn; + + if (typeof onArticleExtraLoaded === "function" && lastHtmlColumn) { + onArticleExtraLoaded(lastHtmlColumn, content); + } + } else if (type === "INNER_TEXT") { + this.setState({ + innerText: content, + accessibilityFocus: hasAccessibilityFocus() + }); + + if (typeof onTextLoaded === "function") { + onTextLoaded(index, content); + } + } else if (type === "JUMP") { + _$$_REQUIRE(_dependencyMap[29]).EventRegister.emit(_events.default.NEWSMEMORY_ARTICLE_JUMP, data); + } else if (type === "GET_NATIVE_ADS_PLACEHOLDER") { + this._setNativeAdsCallback(content); + } else if (type === "SCROLL_TO_PAGE") { + _$$_REQUIRE(_dependencyMap[29]).EventRegister.emit(_events.default.NEWSMEMORY_ARTICLE_JUMP, content); + } else if (type === "LONG_PRESS") { + if (typeof onLongPress === "function") { + onLongPress(); + } + } else if (type === "OPEN_GALLERY") { + this.openGallery(content); + } else if (type === "SHOW_IMAGE_OPTIONS") { + var link = content.link, + url = content.url; + var iconSize = 30; + var imageProps = { + type: _$$_REQUIRE(_dependencyMap[34]).TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + size: iconSize, + imageStyle: { + width: iconSize, + height: iconSize + }, + resizeMode: "contain" + }; + + _$$_REQUIRE(_dependencyMap[35]).MyBottomSheet.show({ + options: [{ + title: global.strings("label_open_browser"), + icon: _react.default.createElement(_$$_REQUIRE(_dependencyMap[36]).Css, { + classes: ["newsmemory-image-options-menu-icon", "newsmemory-image-options-menu-icon-link"] + }, _react.default.createElement(_imageIconChooserComponent.default, (0, _extends2.default)({ + name: _$$_REQUIRE(_dependencyMap[28]).PlatformUtils.isIOS() ? "apple-safari" : "google-chrome" + }, imageProps))), + onPress: function onPress() { + _tecnaviaPlatformUtils.default.openURL(link); + }, + textStyle: _$$_REQUIRE(_dependencyMap[36]).Css.getStyleObjByCssClasses(["newsmemory-image-options-menu-text", "newsmemory-image-options-menu-text-link"]), + containerStyle: _$$_REQUIRE(_dependencyMap[36]).Css.getStyleObjByCssClasses(["newsmemory-image-options-menu-item", "newsmemory-image-options-menu-item-link"]) + }, { + title: global.strings("action_share"), + icon: _react.default.createElement(_$$_REQUIRE(_dependencyMap[36]).Css, { + classes: ["newsmemory-image-options-menu-icon", "newsmemory-image-options-menu-icon-share"] + }, _react.default.createElement(_imageIconChooserComponent.default, (0, _extends2.default)({ + name: "share-variant" + }, imageProps))), + waitModalHide: true, + onPress: function onPress() { + _reactNativeShare.default.open({ + url: link + }); + }, + textStyle: _$$_REQUIRE(_dependencyMap[36]).Css.getStyleObjByCssClasses(["newsmemory-image-options-menu-text", "newsmemory-image-options-menu-text-share"]), + containerStyle: _$$_REQUIRE(_dependencyMap[36]).Css.getStyleObjByCssClasses(["newsmemory-image-options-menu-item", "newsmemory-image-options-menu-item-share"]) + }, { + title: global.strings("action_open_gallery"), + icon: _react.default.createElement(_$$_REQUIRE(_dependencyMap[36]).Css, { + classes: ["newsmemory-image-options-menu-icon", "newsmemory-image-options-menu-icon-gallery"] + }, _react.default.createElement(_imageIconChooserComponent.default, (0, _extends2.default)({ + name: "image-multiple-outline" + }, imageProps))), + onPress: function onPress() { + _this5.openGallery(url); + }, + textStyle: _$$_REQUIRE(_dependencyMap[36]).Css.getStyleObjByCssClasses(["newsmemory-image-options-menu-text", "newsmemory-image-options-menu-text-gallery"]), + containerStyle: _$$_REQUIRE(_dependencyMap[36]).Css.getStyleObjByCssClasses(["newsmemory-image-options-menu-item", "newsmemory-image-options-menu-item-gallery"]) + }] + }); + } else if (type === "SAVE_IMAGE") { + var base64 = content.base64, + paper = content.paper, + issue = content.issue, + filename = content.filename, + image = content.image; + (0, _$$_REQUIRE(_dependencyMap[33]).storeArticleImage)(base64, paper, issue, filename, image); + } else if (type === "RETRIEVE_IMAGE") { + var _this$state2 = this.state, + gallery = _this$state2.gallery, + imageLoadFailed = _this$state2.imageLoadFailed; + var imageSrc = content.imageSrc, + _paper = content.paper, + _issue = content.issue, + _filename = content.filename, + _image = content.image; + (0, _$$_REQUIRE(_dependencyMap[33]).retrieveArticleImage)(_paper, _issue, _filename, _image).then(function (base64) { + if (_this5.articleWebView) { + if (base64) { + var base64String = "data:image/jpeg;base64," + base64; + + if (gallery) { + gallery.forEach(function (galleryImage) { + if (galleryImage && galleryImage.getUrl() === imageSrc) { + galleryImage.setUrl(base64String); + galleryImage.setHrUrl(""); + } + }); + } + + _this5.articleWebView.injectJavaScript("if (typeof replaceImgSrcWithBase64 === \"function\") replaceImgSrcWithBase64(\"" + imageSrc + "\", \"" + base64String + "\");"); + } else if (!imageLoadFailed) { + _this5.setState({ + imageLoadFailed: true + }); + } + } + }).catch(function () { + if (!imageLoadFailed) { + _this5.setState({ + imageLoadFailed: true + }); + } + }); + } else if (type === "SCROLL_TOP") { + var scrollTop = data.scrollTop, + scrollHeight = data.scrollHeight; + this.scrollTop = scrollTop; + this.scrollHeight = scrollHeight; + this.consumedScrollTop = false; + + this._consumeScrollTo(); + } else if (type === "GET_POSITION_ID") { + onPositionId(content.positionId); + } else if (type === "GET_POSITION_ID_OFFSET") { + onPositionIdOffset(content.offset); + } else if (type === "HRS_POSITION") { + onHrsPosition(content); + } + } + }, { + key: "_consumeScrollTo", + value: function _consumeScrollTo() { + var heightIsValid = this.scrollHeight === this.lastJSHeight; + + var scrollTopIsValid = !this.consumedScrollTop && _$$_REQUIRE(_dependencyMap[28]).JSUtils.isNumber(this.scrollTop); + + if (heightIsValid && scrollTopIsValid) { + this.consumedScrollTop = true; + var onScrollTop = this.props.onScrollTop; + + if (typeof onScrollTop === "function") { + onScrollTop(this.scrollTop); + } + } + } + }, { + key: "_openGallery", + value: function _openGallery(imageUrl) { + var onOpenGallery = this.props.onOpenGallery; + var gallery = this.state.gallery; + + if (typeof onOpenGallery === "function" && gallery && gallery.length > 0) { + try { + var imageIndex = gallery.findIndex(function (image) { + return imageUrl === image.getUrl() || imageUrl === image.getHrUrl(); + }); + + if (imageIndex > -1) { + onOpenGallery((0, _$$_REQUIRE(_dependencyMap[37]).newsmemoryArticleGallery)(gallery), imageIndex); + } + } catch (e) { + this._warn(e.message); + } + } + } + }, { + key: "_onWebViewRef", + value: function _onWebViewRef(ref) { + this.articleWebView = ref; + } + }, { + key: "_onLinkClicked", + value: function _onLinkClicked(url) { + var _this$props8 = this.props, + edition = _this$props8.edition, + page = _this$props8.page, + article = _this$props8.article; + (0, _$$_REQUIRE(_dependencyMap[38]).sendNewsmemoryArticleClickThrough)(edition, page, article, url); + return false; + } + }, { + key: "_onArticleHeaderRef", + value: function _onArticleHeaderRef(ref) { + this.articleHeaderRef = ref; + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd() { + var onLoadEnd = this.props.onLoadEnd; + + if (onLoadEnd) { + onLoadEnd(); + } + } + }, { + key: "_customizeHtml", + value: function _customizeHtml(html, imageLimit, options) { + var _this$props9 = this.props, + edition = _this$props9.edition, + newspaper = _this$props9.newspaper, + article = _this$props9.article; + var newHtml = html; + var mergeArticles = options.mergeArticles, + calculateMidAds = options.calculateMidAds, + enableColumnizer = options.enableColumnizer, + isOnline = options.isOnline; + newHtml = _$$_REQUIRE(_dependencyMap[28]).StringUtils.serializeHtml(newHtml.replace(/\n|\t/gm, "")); + newHtml = (0, _$$_REQUIRE(_dependencyMap[33]).extractLinks)(newHtml); + newHtml = (0, _$$_REQUIRE(_dependencyMap[31]).applyMergeArtToHTML)(newHtml, mergeArticles, enableColumnizer, calculateMidAds, isOnline, edition, article, newspaper.getSecret()); + var imageMatches = newHtml.match(_$$_REQUIRE(_dependencyMap[31]).REGEX_TAGS.IMAGE); + var imagesPresent = imageMatches && imageMatches.length > imageLimit; + + if (!options.enableDesktopLayout) { + newHtml = (0, _$$_REQUIRE(_dependencyMap[33]).addInStoryAdsToHtml)(newHtml, imagesPresent, isOnline); + } + + return { + html: newHtml, + imagesPresent: imagesPresent + }; + } + }, { + key: "_initializeHtml", + value: function _initializeHtml(language) { + var _this$props10, header, carModeEnabled, accessibilityEnabled, newspaper, edition, article, css, defaultWidth, hasHeaderImage, translation, options, _translation, translatedHTML, translationFailed, callback, translationPresent, imageLimit, _global$getActivePSet3, showArtComplete, firstArticle, articleIndexInChain, result, htmlToUse, htmlBaseText, _this$_customizeHtml, html, manipulatedHtml, gallery, biggestImage, continuationFlag, firstHTMLPart, firstHtml, firstGallery, firstBiggestImage, _ref2, _ref2$html, lastHtmlColumn, _ref2$artAddIndex, artAddIndex, headerImage; + + return _regenerator.default.async(function _initializeHtml$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _this$props10 = this.props, header = _this$props10.header, carModeEnabled = _this$props10.carModeEnabled, accessibilityEnabled = _this$props10.accessibilityEnabled, newspaper = _this$props10.newspaper, edition = _this$props10.edition, article = _this$props10.article, css = _this$props10.css, defaultWidth = _this$props10.defaultWidth; + + this._log("initialize html"); + + hasHeaderImage = header && !accessibilityEnabled && !carModeEnabled; + translation = {}; + + if (!this._isActive()) { + _context3.next = 14; + break; + } + + _context3.prev = 5; + _context3.next = 8; + return _regenerator.default.awrap(this._translate(language)); + + case 8: + translation = _context3.sent; + _context3.next = 14; + break; + + case 11: + _context3.prev = 11; + _context3.t0 = _context3["catch"](5); + + this._warn(_context3.t0.message); + + case 14: + options = this._getOptions(); + _translation = translation, translatedHTML = _translation.translatedHTML, translationFailed = _translation.translationFailed, callback = _translation.callback; + translationPresent = !translationFailed && translatedHTML; + imageLimit = translationPresent ? 1 : 0; + options.imageLimit = imageLimit; + _global$getActivePSet3 = global.getActivePSetup(), showArtComplete = _global$getActivePSet3.showArtComplete; + firstArticle = article; + articleIndexInChain = 0; + + if (showArtComplete) { + result = edition.getFirstArticleInChain(article); + firstArticle = result.firstArticle; + articleIndexInChain = result.currentArticleIndex; + } + + htmlToUse = translatedHTML || firstArticle.getHtml(); + htmlBaseText = (0, _$$_REQUIRE(_dependencyMap[31]).getBaseText)(htmlToUse); + _this$_customizeHtml = this._customizeHtml(htmlToUse, imageLimit, options), html = _this$_customizeHtml.html; + manipulatedHtml = html; + gallery = (0, _$$_REQUIRE(_dependencyMap[31]).getAllImages)(manipulatedHtml, defaultWidth); + continuationFlag = "

"; + + if (htmlToUse.indexOf(continuationFlag) > -1) { + firstHTMLPart = htmlToUse.split(continuationFlag)[0]; + firstHtml = (0, _$$_REQUIRE(_dependencyMap[31]).addImageActionUrlOnArticlesChain)([firstArticle], firstArticle, firstHTMLPart, edition, newspaper.getSecret(), options.isOnline); + firstGallery = (0, _$$_REQUIRE(_dependencyMap[31]).getAllImages)(firstHtml, defaultWidth); + firstBiggestImage = (0, _$$_REQUIRE(_dependencyMap[31]).getBiggestImage)(firstGallery); + + if (firstBiggestImage) { + biggestImage = firstBiggestImage; + (0, _$$_REQUIRE(_dependencyMap[31]).addCaptionToImages)(firstHtml, [biggestImage]); + } + } + + if (!biggestImage) { + biggestImage = (0, _$$_REQUIRE(_dependencyMap[31]).getBiggestImage)(gallery); + } + + manipulatedHtml = (0, _$$_REQUIRE(_dependencyMap[31]).addCaptionToImages)(manipulatedHtml, gallery, hasHeaderImage ? 1 : 0); + _ref2 = !options.truncateArticle ? (0, _$$_REQUIRE(_dependencyMap[31]).manipulateLastColumnContent)(manipulatedHtml, css, options, firstArticle, articleIndexInChain, hasHeaderImage ? biggestImage : undefined) : {}, _ref2$html = _ref2.html, lastHtmlColumn = _ref2$html === undefined ? "" : _ref2$html, _ref2$artAddIndex = _ref2.artAddIndex, artAddIndex = _ref2$artAddIndex === undefined ? -1 : _ref2$artAddIndex; + manipulatedHtml = (0, _$$_REQUIRE(_dependencyMap[31]).manipulateArticleContent)(manipulatedHtml, css, options, articleIndexInChain, artAddIndex); + headerImage = hasHeaderImage && biggestImage; + + if (headerImage) { + manipulatedHtml = (0, _$$_REQUIRE(_dependencyMap[31]).removeTagBySrc)(manipulatedHtml, biggestImage.getUrl(), options.mergeArticles); + } + + this.setState({ + htmlBaseText: htmlBaseText, + printHtml: htmlToUse, + biggestImage: biggestImage, + manipulatedHtml: manipulatedHtml, + lastHtmlColumn: lastHtmlColumn, + gallery: gallery, + headerImage: headerImage, + options: options, + translationFailed: translationFailed + }, callback); + + case 37: + case "end": + return _context3.stop(); + } + } + }, null, this, [[5, 11]], Promise); + } + }, { + key: "_warn", + value: function _warn(message) { + var index = this.props.index; + } + }, { + key: "_log", + value: function _log(message) { + var index = this.props.index; + } + }, { + key: "render", + value: function render() { + var _this$props11 = this.props, + defaultHeight = _this$props11.defaultHeight, + onExpandedImageLayout = _this$props11.onExpandedImageLayout, + carModeEnabled = _this$props11.carModeEnabled, + accessibilityEnabled = _this$props11.accessibilityEnabled; + var fontSize = global.getUserSettings().getFontSize(); + + var _global$getActivePSet4 = global.getActivePSetup(), + loginStatus = _global$getActivePSet4.loginStatus; + + var _this$state3 = this.state, + isOnline = _this$state3.isOnline, + translationFailed = _this$state3.translationFailed, + imageLoadFailed = _this$state3.imageLoadFailed, + options = _this$state3.options, + manipulatedHtml = _this$state3.manipulatedHtml, + biggestImage = _this$state3.biggestImage, + headerImage = _this$state3.headerImage, + accessibilityFocus = _this$state3.accessibilityFocus, + innerText = _this$state3.innerText; + var HeaderComponent = null; + + if (headerImage) { + HeaderComponent = _react.default.createElement(_articleExpandImageComponent.default, { + ref: this.onArticleHeaderRef, + caption: biggestImage.getCaption(), + url: biggestImage.getUrl(), + fontScale: fontSize / 100, + onPress: this.openGallery, + onLayout: onExpandedImageLayout, + minHeight: Math.max(defaultHeight / 3, 150) + }); + } + + var errors = []; + + if (!isOnline) { + if (imageLoadFailed) { + errors.push(global.strings("err_offline")); + } + + if (translationFailed) { + errors.push(global.strings("err_translation_offline")); + } + } else { + if (translationFailed) { + errors.push(global.strings("err_translation")); + } + } + + this._log("render"); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[36]).Css, { + classes: ["newsmemory-article-text"] + }, HeaderComponent, _react.default.createElement(_$$_REQUIRE(_dependencyMap[39]).Error, { + errors: errors, + style: _articleText.default.error + }), _react.default.createElement(_reactNative.View, { + style: _articleText.default.container + }, manipulatedHtml && manipulatedHtml.length ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[40]).AutoHeightWebView, { + accessible: false, + importantForAccessibility: "no", + ref: this.onWebViewRef, + onLinkClicked: this.onLinkClicked, + defaultHeight: defaultHeight, + htmlContentId: "content", + source: { + html: manipulatedHtml + }, + onMessage: this.onMessage, + onLoadEnd: this.onLoadEnd, + onHeightChange: this.onHeightChange, + progressColor: _$$_REQUIRE(_dependencyMap[28]).colors.md_grey_500, + startInLoadingState: _$$_REQUIRE(_dependencyMap[41]).BaseWebView.LoadingStatePosition.bottom, + disableStartAutoHeightEvaluation: !this._isActive(), + progressHidden: !this._isActive(), + progressType: _$$_REQUIRE(_dependencyMap[41]).BaseWebView.ProgressTypes.bar, + focusableInTouchMode: false, + focusable: false + }) : null, !accessibilityEnabled && !carModeEnabled ? this._getNativeAds() : null, accessibilityEnabled && !carModeEnabled && innerText ? _react.default.createElement(_reactNative.View, { + style: _articleText.default.accessibility, + accessibilityLabel: innerText + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[42]).ItemAccessibilityFocused, { + touchable: true, + enablePause: true, + focused: accessibilityFocus, + style: _articleText.default.container, + accessibilityEnabled: accessibilityEnabled, + accessibilityLabel: innerText || "" + })) : null, options.truncateArticle ? _react.default.createElement(_loginOverlay.default, { + style: _articleText.default.truncateParent, + title: global.strings("msg_login_overlay_title"), + showLogin: !loginStatus.isLoggedIn() + }) : null)); + } + }]); + return ArticleText; + }(_react.default.Component); + + exports.default = ArticleText; + ArticleText.propTypes = { + index: _propTypes.default.number, + header: _propTypes.default.bool, + accessibilityEnabled: _propTypes.default.bool, + carModeEnabled: _propTypes.default.bool, + deviceSupportColumnizer: _propTypes.default.bool, + defaultHeight: _propTypes.default.number, + defaultWidth: _propTypes.default.number, + searchText: _propTypes.default.string, + searchColor: _propTypes.default.string, + edition: _propTypes.default.instanceOf(_Edition.default).isRequired, + article: _propTypes.default.instanceOf(_EPaperArticle.default).isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + css: _propTypes.default.shape({ + defaultCss: _propTypes.default.string, + customCss: _propTypes.default.string + }), + copyrightHtml: _propTypes.default.string, + disclaimerHtml: _propTypes.default.string, + headerHtml: _propTypes.default.string, + onLoadEnd: _propTypes.default.func, + onLongPress: _propTypes.default.func, + onTextLoaded: _propTypes.default.func, + onOpenGallery: _propTypes.default.func, + onScrollTop: _propTypes.default.func, + isActive: _propTypes.default.func, + onPositionId: _propTypes.default.func, + onPositionIdOffset: _propTypes.default.func, + onHrsPosition: _propTypes.default.func, + onExpandedImageLayout: _propTypes.default.func, + onArticleExtraLoaded: _propTypes.default.func, + hasAccessibilityFocus: _propTypes.default.func, + enableDesktopLayout: _propTypes.default.bool + }; + ArticleText.defaultProps = { + defaultHeight: 0, + header: false, + enableDesktopLayout: false + }; +},2173,[5,80,6,7,8,15,12,14,16,17,28,201,575,2174,460,640,638,1859,2177,644,714,2178,603,2179,2180,1860,1876,1970,462,572,717,2182,1950,2187,1806,1904,699,2052,1954,2171,1901,1894,2189]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _articleExpandImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _imageComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ArticleExpandImage = function (_React$PureComponent) { + (0, _inherits2.default)(ArticleExpandImage, _React$PureComponent); + + var _super = _createSuper(ArticleExpandImage); + + function ArticleExpandImage(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleExpandImage); + _this = _super.call(this, props); + _this.state = { + fontScale: props.fontScale, + loading: true, + expanded: false, + error: false, + imageWidth: 0, + imageHeight: 0, + viewWidth: 0, + hideToggle: false, + resizeMode: "cover" + }; + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onToggle = _this._onToggle.bind((0, _assertThisInitialized2.default)(_this)); + _this.onImagePress = _this._onImagePress.bind((0, _assertThisInitialized2.default)(_this)); + _this.parentStyle = _$$_REQUIRE(_dependencyMap[16]).Css.getStyleObjByCssClasses(["newsmemory-article-image-parent"]); + _this.minHeight = _this.parentStyle.minHeight || props.minHeight; + _this.animatedHeight = new _reactNative.Animated.Value(_this.minHeight); + return _this; + } + + (0, _createClass2.default)(ArticleExpandImage, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + var loading = this.state.loading; + + if (prevState.loading && !loading && this.recheckIfWeNeedToExpand) { + this.recheckIfWeNeedToExpand = false; + this.expandIfEnoughSpace(this.availableHeight); + } + } + }, { + key: "applyFontScale", + value: function applyFontScale(scale) { + var fontScale = this.state.fontScale; + + if (fontScale !== scale) { + this.setState({ + fontScale: scale + }); + } + } + }, { + key: "expandIfEnoughSpace", + value: function expandIfEnoughSpace(availableHeight) { + var _this$state = this.state, + expanded = _this$state.expanded, + loading = _this$state.loading; + + if (!loading) { + this.availableHeight = undefined; + + var _this$_getExpandedIma = this._getExpandedImageStyle(), + height = _this$_getExpandedIma.height; + + if (height > this.minHeight) { + if (height < availableHeight && !expanded) { + this._animate(true); + + this.setState({ + expanded: true, + hideToggle: true + }); + } + + if (height > availableHeight && expanded) { + this._animate(false); + + this.setState({ + expanded: false, + hideToggle: false + }); + } + } + } else { + this.recheckIfWeNeedToExpand = true; + this.availableHeight = availableHeight; + } + } + }, { + key: "_getExpandedImageStyle", + value: function _getExpandedImageStyle() { + var _this$state2 = this.state, + imageWidth = _this$state2.imageWidth, + imageHeight = _this$state2.imageHeight, + viewWidth = _this$state2.viewWidth; + var xScale = imageWidth / viewWidth; + var scaledHeight = imageHeight / xScale; + return { + width: viewWidth, + height: scaledHeight + }; + } + }, { + key: "_onLayout", + value: function _onLayout(event) { + var nativeEvent, _this$props, url, onLayout, _await$getSizeAsync, width, height, resizeMode, containRatio; + + return _regenerator.default.async(function _onLayout$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + event.persist(); + nativeEvent = event.nativeEvent; + _this$props = this.props, url = _this$props.url, onLayout = _this$props.onLayout; + _context.next = 6; + return _regenerator.default.awrap((0, _imageComponent.getSizeAsync)(url)); + + case 6: + _await$getSizeAsync = _context.sent; + width = _await$getSizeAsync.width; + height = _await$getSizeAsync.height; + resizeMode = "cover"; + + if (width > height) { + containRatio = nativeEvent.layout.width / width; + + if (height * containRatio < this.minHeight) { + this.minHeight = height * containRatio; + this.animatedHeight.setValue(this.minHeight); + resizeMode = "contain"; + } + } + + this.setState({ + loading: false, + imageWidth: width, + imageHeight: height, + viewWidth: nativeEvent.layout.width, + resizeMode: resizeMode + }); + + if (typeof onLayout === "function") { + onLayout(event); + } + + _context.next = 18; + break; + + case 15: + _context.prev = 15; + _context.t0 = _context["catch"](0); + this.setState({ + loading: false, + error: true + }); + + case 18: + case "end": + return _context.stop(); + } + } + }, null, this, [[0, 15]], Promise); + } + }, { + key: "_animate", + value: function _animate(expand) { + var _this$_getExpandedIma2 = this._getExpandedImageStyle(), + height = _this$_getExpandedIma2.height; + + var expandHeight = Math.max(height, this.minHeight); + + _reactNative.Animated.timing(this.animatedHeight, { + toValue: expand ? expandHeight : this.minHeight, + duration: 300, + useNativeDriver: false + }).start(); + } + }, { + key: "_onToggle", + value: function _onToggle() { + var _this$state3 = this.state, + loading = _this$state3.loading, + expanded = _this$state3.expanded; + + if (!loading) { + this._animate(!expanded); + + this.setState({ + expanded: !expanded + }); + } + } + }, { + key: "_onImagePress", + value: function _onImagePress() { + var _this$props2 = this.props, + url = _this$props2.url, + onPress = _this$props2.onPress; + + if (typeof onPress === "function") { + onPress(url); + } + } + }, { + key: "render", + value: function render() { + var _this$state4 = this.state, + expanded = _this$state4.expanded, + error = _this$state4.error, + loading = _this$state4.loading, + fontScale = _this$state4.fontScale, + hideToggle = _this$state4.hideToggle, + resizeMode = _this$state4.resizeMode; + var _this$props3 = this.props, + url = _this$props3.url, + caption = _this$props3.caption, + minHeight = _this$props3.minHeight; + var hasCaption = !!caption && caption.length > 0; + var captionProps = {}; + + if (hasCaption && !expanded) { + captionProps.numberOfLines = 2; + } + + var ToggleIcon = _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["newsmemory-article-toggle"], + toggle: true, + active: expanded + }, _react.default.createElement(_imageIconChooserComponent.default, { + style: _articleExpandImageComponent.default.image, + source: expanded ? _$$_REQUIRE(_dependencyMap[17]) : _$$_REQUIRE(_dependencyMap[18]) + })); + + if (url && url.length) { + var expandedStyle = this._getExpandedImageStyle(); + + var fontStyle = { + fontSize: 16 * fontScale + }; + var toggleButtonNoCaption = !hasCaption && !hideToggle && expandedStyle.height > minHeight ? _react.default.createElement(_reactNative.TouchableOpacity, { + style: [_articleExpandImageComponent.default.imageNoCaption, fontStyle], + onPress: this.onToggle + }, ToggleIcon) : null; + var ImageComponent = null; + + if (!loading && !error) { + ImageComponent = _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.onImagePress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["newsmemory-article-image", expanded ? "newsmemory-article-image-expanded" : ""] + }, _react.default.createElement(_imageComponent.default, { + animated: true, + forceRNComponent: true, + source: { + uri: url + }, + resizeMode: resizeMode, + style: { + height: this.animatedHeight, + width: expandedStyle.width + } + }))); + } + + return _react.default.createElement(_reactNative.View, { + style: [_articleExpandImageComponent.default.parent, this.parentStyle, { + minHeight: error ? 0 : this.minHeight + }], + onLayout: this.onLayout + }, ImageComponent, hasCaption ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["newsmemory-article-caption-parent", expanded ? "newsmemory-article-caption-parent-expandend" : ""] + }, _react.default.createElement(_reactNative.View, { + style: [!expanded && !error ? _articleExpandImageComponent.default.captionAbsolute : {}, _articleExpandImageComponent.default.captionParent] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["newsmemory-article-caption"] + }, _react.default.createElement(_fontText.default, (0, _extends2.default)({ + style: [_articleExpandImageComponent.default.caption, fontStyle] + }, captionProps), caption)), !hideToggle ? _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.onToggle + }, ToggleIcon) : null)) : null, toggleButtonNoCaption); + } + + return null; + } + }]); + return ArticleExpandImage; + }(_react.default.PureComponent); + + exports.default = ArticleExpandImage; + ArticleExpandImage.propTypes = { + fontScale: _propTypes.default.number, + minHeight: _propTypes.default.number, + caption: _propTypes.default.string, + url: _propTypes.default.string.isRequired, + onPress: _propTypes.default.func, + onLayout: _propTypes.default.func + }; + ArticleExpandImage.defaultProps = { + caption: "", + minHeight: 150, + fontScale: 1 + }; +},2174,[5,80,6,7,8,15,12,14,16,17,201,28,1879,2175,588,1970,699,1751,2176]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + parent: { + margin: 10, + minHeight: 40, + overflow: "hidden" + }, + captionAbsolute: { + position: "absolute", + bottom: 0, + start: 0, + end: 0 + }, + captionParent: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent600, + alignItems: "center", + flexDirection: "row", + minHeight: 40 + }, + caption: { + flex: 1, + paddingHorizontal: 10, + paddingVertical: 3, + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + imageNoCaption: { + position: "absolute", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent600, + paddingVertical: 3, + bottom: 0, + end: 0 + }, + image: { + width: 40, + height: 40 + } + }); + + exports.default = _default; +},2175,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/buttons-json-manager/icons", + "width": 128, + "height": 96, + "scales": [1], + "hash": "3141aa533d2953239bde8d2e10756375", + "name": "ic-down", + "type": "png" + }); +},2176,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _AdsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ArticleAdContainer = function (_React$Component) { + (0, _inherits2.default)(ArticleAdContainer, _React$Component); + + var _super = _createSuper(ArticleAdContainer); + + function ArticleAdContainer(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleAdContainer); + _this = _super.call(this, props); + _this.state = { + scrollYOffset: 0, + scrollHeight: 0, + nativeAds: [], + adsLoaded: [] + }; + return _this; + } + + (0, _createClass2.default)(ArticleAdContainer, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.articleScrollLayout = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.ARTICLE_SCROLL_LAYOUT, function (_ref) { + var id = _ref.id, + scrollHeight = _ref.scrollHeight; + var articleId = _this2.props.articleId; + + if (articleId === id) { + _this2.setState({ + scrollHeight: scrollHeight + }); + } + }); + this.articleScroll = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.ARTICLE_SCROLL, function (_ref2) { + var id = _ref2.id, + scrollYOffset = _ref2.scrollYOffset; + var articleId = _this2.props.articleId; + + if (articleId === id) { + _this2.setState({ + scrollYOffset: scrollYOffset + }); + } + }); + this.loadNativeAds = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.LOAD_NATIVE_ADS, function (_ref3) { + var id = _ref3.id, + nativeAds = _ref3.nativeAds; + var articleId = _this2.props.articleId; + + if (articleId === id) { + _this2.setState({ + nativeAds: nativeAds, + adsLoaded: [] + }); + } + }); + this.onAdLoaded = this._onAdLoaded.bind(this); + this.onAdFailed = this._onAdFailed.bind(this); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.articleScrollLayout); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.articleScroll); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.loadNativeAds); + } + }, { + key: "_getInsideBanner", + value: function _getInsideBanner(ad) { + var adModels = this.props.adModels; + var adModel; + + if (!_$$_REQUIRE(_dependencyMap[13]).JSUtils.isEmpty(adModels)) { + var index = ad.index; + adModel = adModels.find(function (model, modelIndex) { + return modelIndex === index; + }); + } + + return _AdsHelper.default.getNativeAdComponent((0, _extends2.default)({}, ad, adModel)); + } + }, { + key: "_onAdLoaded", + value: function _onAdLoaded(model) { + this._onAdCallback(model, true, "onAdLoaded"); + } + }, { + key: "_onAdFailed", + value: function _onAdFailed(model, error) { + this._onAdCallback(model, false, "onAdFailed", error); + } + }, { + key: "_onAdCallback", + value: function _onAdCallback(model, state, callbackName, error) { + var _this$state = this.state, + nativeAds = _this$state.nativeAds, + adsLoaded = _this$state.adsLoaded; + var somethingChanged = false; + + for (var i = 0; i < nativeAds.length; i++) { + if (nativeAds[i].key === model.key) { + if (adsLoaded[i] !== state) { + if (typeof nativeAds[i][callbackName] === "function") { + nativeAds[i][callbackName](nativeAds[i], error); + } + + somethingChanged = true; + adsLoaded[i] = state; + } + } + } + + if (somethingChanged) { + this.setState({ + adsLoaded: adsLoaded + }); + } + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$state2 = this.state, + nativeAds = _this$state2.nativeAds, + adsLoaded = _this$state2.adsLoaded, + scrollYOffset = _this$state2.scrollYOffset, + scrollHeight = _this$state2.scrollHeight; + var articleId = this.props.articleId; + return nativeAds.map(function (ad, index) { + if (ad.top <= scrollYOffset + scrollHeight) { + return _react.default.createElement(_reactNative.View, { + style: { + position: "absolute", + top: ad.top, + left: ad.left, + width: ad.width, + height: ad.height + }, + pointerEvents: adsLoaded[index] ? "auto" : "none", + key: ad.key + }, _this3._getInsideBanner((0, _extends2.default)({ + index: index, + articleId: articleId + }, ad, { + onAdFailed: _this3.onAdFailed, + onAdLoaded: _this3.onAdLoaded + }))); + } + + return null; + }); + } + }]); + return ArticleAdContainer; + }(_react.default.Component); + + exports.default = ArticleAdContainer; + ArticleAdContainer.propTypes = { + articleId: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + adModels: _propTypes.default.arrayOf(_propTypes.default.object) + }; + ArticleAdContainer.defaultProps = { + adModels: [] + }; +},2177,[5,6,7,8,12,14,16,17,201,28,2087,460,572,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _NewsmemoryHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var TranslationManager = function () { + function TranslationManager() { + (0, _classCallCheck2.default)(this, TranslationManager); + } + + (0, _createClass2.default)(TranslationManager, null, [{ + key: "init", + value: function init() { + TranslationManager.cache = {}; + } + }, { + key: "getEditionBasePath", + value: function getEditionBasePath(newspaper) { + var edition = newspaper.getEditionModel(); + + var baseLocalPath = _tecnaviaFileUtils.default.getNewspaperBaseDirectory(); + + return "" + baseLocalPath + edition.getPaper() + "/" + edition.getIssue(); + } + }, { + key: "getCachedTranslationFilename", + value: function getCachedTranslationFilename(language, newspaper, page, article) { + var baseEditionPath = TranslationManager.getEditionBasePath(newspaper); + var mtime = page.getModifyTime(); + var filename = page.getFilename(); + var xmlId = article.getXmlId(); + return baseEditionPath + "/" + filename + "/" + xmlId + "_" + language + "_" + mtime + ".translate"; + } + }, { + key: "checkCachedTranslation", + value: function checkCachedTranslation(language, newspaper, page, article) { + var edition, paper, issue, filename, xmlId, cachedPaper, cachedIssue, cachedPage, cachedArticle, cachedTranslation, cachedTranslationFilename; + return _regenerator.default.async(function checkCachedTranslation$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + edition = newspaper.getEditionModel(); + paper = edition.getPaper(); + issue = edition.getIssue(); + filename = page.getFilename(); + xmlId = article.getXmlId(); + cachedPaper = TranslationManager.cache[paper]; + + if (!cachedPaper) { + _context.next = 14; + break; + } + + cachedIssue = cachedPaper[issue]; + + if (!cachedIssue) { + _context.next = 14; + break; + } + + cachedPage = cachedIssue[filename]; + + if (!cachedPage) { + _context.next = 14; + break; + } + + cachedArticle = cachedPage[xmlId]; + + if (!(cachedArticle && cachedArticle[language])) { + _context.next = 14; + break; + } + + return _context.abrupt("return", cachedArticle[language]); + + case 14: + _context.prev = 14; + cachedTranslationFilename = TranslationManager.getCachedTranslationFilename(language, newspaper, page, article); + _context.next = 18; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFile(cachedTranslationFilename)); + + case 18: + cachedTranslation = _context.sent; + TranslationManager.storeTranslationRuntime(language, cachedTranslation, newspaper, page, article); + _context.next = 24; + break; + + case 22: + _context.prev = 22; + _context.t0 = _context["catch"](14); + + case 24: + return _context.abrupt("return", cachedTranslation); + + case 25: + case "end": + return _context.stop(); + } + } + }, null, null, [[14, 22]], Promise); + } + }, { + key: "storeTranslationRuntime", + value: function storeTranslationRuntime(language, translation, newspaper, page, article) { + var edition = newspaper.getEditionModel(); + var paper = edition.getPaper(); + var issue = edition.getIssue(); + var filename = page.getFilename(); + var xmlId = article.getXmlId(); + + if (!TranslationManager.cache[paper]) { + TranslationManager.cache[paper] = {}; + } + + if (!TranslationManager.cache[paper][issue]) { + TranslationManager.cache[paper][issue] = {}; + } + + if (!TranslationManager.cache[paper][issue][filename]) { + TranslationManager.cache[paper][issue][filename] = {}; + } + + if (!TranslationManager.cache[paper][issue][filename][xmlId]) { + TranslationManager.cache[paper][issue][filename][xmlId] = {}; + } + + TranslationManager.cache[paper][issue][filename][xmlId][language] = translation; + } + }, { + key: "storeTranslation", + value: function storeTranslation(language, translation, newspaper, page, article) { + TranslationManager.storeTranslationRuntime(language, translation, newspaper, page, article); + var cachedTranslationFilename = TranslationManager.getCachedTranslationFilename(language, newspaper, page, article); + + _tecnaviaFileUtils.default.write(cachedTranslationFilename, translation).catch(function (error) {}); + } + }, { + key: "translationCall", + value: function translationCall(language, newspaper, page, article) { + var edition, result; + return _regenerator.default.async(function translationCall$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!newspaper) { + _context2.next = 7; + break; + } + + edition = newspaper.getEditionModel(); + _context2.next = 4; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.translateArticle({ + target: language, + issue: edition.getIssue(), + edition: edition.getEdition(), + filename: page.getFilename(), + artid: article.getXmlId(), + filetime: page.getModifyTime(), + secret: newspaper.getSecret() + })); + + case 4: + result = _context2.sent; + + if (!(result.text && result.text.length)) { + _context2.next = 7; + break; + } + + return _context2.abrupt("return", result.text); + + case 7: + return _context2.abrupt("return", ""); + + case 8: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "translate", + value: function translate(newspaper, page, article) { + var language, + translation, + _args3 = arguments; + return _regenerator.default.async(function translate$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + language = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : global.getNewsmemoryConfig().currentTranslationLanguage; + + if (!(language && language.length > 0 && language !== _NewsmemoryHelper.default.SP.values.translation_disabled)) { + _context3.next = 17; + break; + } + + _context3.prev = 2; + (0, _$$_REQUIRE(_dependencyMap[11]).sendNewsmemoryTranslate)(language, newspaper.getEditionModel(), page, article); + _context3.next = 6; + return _regenerator.default.awrap(TranslationManager.checkCachedTranslation(language, newspaper, page, article)); + + case 6: + translation = _context3.sent; + + if (translation) { + _context3.next = 13; + break; + } + + if (!_$$_REQUIRE(_dependencyMap[12]).NetworkUtils.isOnline()) { + _context3.next = 13; + break; + } + + _context3.next = 11; + return _regenerator.default.awrap(TranslationManager.translationCall(language, newspaper, page, article)); + + case 11: + translation = _context3.sent; + + if (translation) { + TranslationManager.storeTranslation(language, translation, newspaper, page, article); + } + + case 13: + _context3.next = 17; + break; + + case 15: + _context3.prev = 15; + _context3.t0 = _context3["catch"](2); + + case 17: + return _context3.abrupt("return", translation); + + case 18: + case "end": + return _context3.stop(); + } + } + }, null, null, [[2, 15]], Promise); + } + }, { + key: "resetAllTranslations", + value: function resetAllTranslations() { + TranslationManager.cache = {}; + } + }, { + key: "resetTranslationsForIssue", + value: function resetTranslationsForIssue(newspaper) { + if (newspaper) { + var edition = newspaper.getEditionModel(); + var paper = edition.getPaper(); + var issue = edition.getIssue(); + + if (TranslationManager.cache && TranslationManager.cache[paper] && TranslationManager.cache[paper][issue]) { + TranslationManager.cache[paper][issue] = {}; + } + } + } + }, { + key: "resetTranslationsForPage", + value: function resetTranslationsForPage(newspaper, page) { + if (newspaper) { + var edition = newspaper.getEditionModel(); + var paper = edition.getPaper(); + var issue = edition.getIssue(); + var filename = page.getFilename(); + + if (TranslationManager.cache && TranslationManager.cache[paper] && TranslationManager.cache[paper][issue] && TranslationManager.cache[paper][issue][filename]) { + TranslationManager.cache[paper][issue][filename] = {}; + } + } + } + }, { + key: "getTranslationBadgeIcon", + value: function getTranslationBadgeIcon() { + var language = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : global.getNewsmemoryConfig().currentTranslationLanguage; + + if (language && _$$_REQUIRE(_dependencyMap[13]).ACTIONS.translate && language !== _NewsmemoryHelper.default.SP.values.translation_disabled) { + var iconKey = language + "Icon"; + + if (language === "en" && _$$_REQUIRE(_dependencyMap[12]).StringUtils.isUSTecnaviaDomain()) { + iconKey = "usIcon"; + } else if (language === "zh" || language === "zh-TW") { + iconKey = "cnIcon"; + } + + if (_$$_REQUIRE(_dependencyMap[13]).ACTIONS.translate[iconKey]) { + return _$$_REQUIRE(_dependencyMap[13]).ACTIONS.translate[iconKey]; + } + + return _$$_REQUIRE(_dependencyMap[13]).ACTIONS.translate.noneIcon; + } + + return undefined; + } + }]); + return TranslationManager; + }(); + + exports.default = TranslationManager; +},2178,[5,80,7,8,574,644,640,714,638,430,1860,1954,462,1725]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + container: { + flex: 1 + }, + accessibility: { + position: "absolute", + left: 0, + right: 0, + bottom: 0, + top: 0 + }, + error: { + zIndex: 1000 + }, + truncateParent: { + padding: 10 + }, + truncateTouchable: { + padding: 10, + justifyContent: "center", + flexDirection: "row", + backgroundColor: "black" + }, + truncateText: { + color: "white" + } + }); + + exports.default = _default; +},2179,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _loadingOverlay = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var LoginOverlay = function (_React$PureComponent) { + (0, _inherits2.default)(LoginOverlay, _React$PureComponent); + + var _super = _createSuper(LoginOverlay); + + function LoginOverlay(props) { + var _this; + + (0, _classCallCheck2.default)(this, LoginOverlay); + _this = _super.call(this, props); + _this.onButtonTapGestureHandler = _this._onButtonTapGestureHandler.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoginTapGestureHandler = _this._onLoginTapGestureHandler.bind((0, _assertThisInitialized2.default)(_this)); + _this.onAreaTapGestureHandler = _this._onAreaTapGestureHandler.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + containerPosition: props.containerPosition + }; + return _this; + } + + (0, _createClass2.default)(LoginOverlay, [{ + key: "_onAreaTapGestureHandler", + value: function _onAreaTapGestureHandler(_ref) { + var nativeEvent = _ref.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[13]).State.ACTIVE) {} + } + }, { + key: "_onButtonTapGestureHandler", + value: function _onButtonTapGestureHandler(_ref2) { + var nativeEvent = _ref2.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[13]).State.ACTIVE) { + _$$_REQUIRE(_dependencyMap[14]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[15]).tabs.account + }); + } + } + }, { + key: "_onLoginTapGestureHandler", + value: function _onLoginTapGestureHandler(_ref3) { + var nativeEvent = _ref3.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[13]).State.ACTIVE) { + _$$_REQUIRE(_dependencyMap[14]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[15]).tabs.account + }); + } + } + }, { + key: "changeContainerStyle", + value: function changeContainerStyle(containerPosition) { + _reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.linear); + + this.setState({ + containerPosition: containerPosition + }); + } + }, { + key: "_getContainerStyle", + value: function _getContainerStyle() { + var containerPosition = this.state.containerPosition; + var containerStyle = {}; + + if (containerPosition === _$$_REQUIRE(_dependencyMap[16]).PageViewPosition.LEFT) { + containerStyle.alignSelf = "flex-start"; + } else if (containerPosition === _$$_REQUIRE(_dependencyMap[16]).PageViewPosition.CENTER) { + containerStyle.alignSelf = "center"; + } else if (containerPosition === _$$_REQUIRE(_dependencyMap[16]).PageViewPosition.RIGHT) { + containerStyle.alignSelf = "flex-end"; + } + + return containerStyle; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + style = _this$props.style, + buttonStyle = _this$props.buttonStyle, + containerStyle = _this$props.containerStyle, + loginButtonStyle = _this$props.loginButtonStyle, + loginButtonTextStyle = _this$props.loginButtonTextStyle, + textButtonStyle = _this$props.textButtonStyle, + titleParentStyle = _this$props.titleParentStyle, + titleStyle = _this$props.titleStyle, + title = _this$props.title, + button = _this$props.button, + login = _this$props.login, + showLogin = _this$props.showLogin; + + var _global$getActivePSet = global.getActivePSetup(), + paperName = _global$getActivePSet.paperName; + + var loginParentStyle = _$$_REQUIRE(_dependencyMap[17]).Css.getStyleObjByCssClasses(["login-overlay-login-parent"]); + + var buttonParentStyle = _$$_REQUIRE(_dependencyMap[17]).Css.getStyleObjByCssClasses(["login-overlay-button-parent"]); + + var containerPositionStyle = this._getContainerStyle(); + + var buttonContainerStyle = _$$_REQUIRE(_dependencyMap[17]).Css.getStyleObjByCssClasses(["login-overlay-container"]); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[17]).Css.getDefaultBackgroundColor(); + + var foregroundColor = _$$_REQUIRE(_dependencyMap[17]).Css.getDefaultForegroundColor(); + + var textColor = _$$_REQUIRE(_dependencyMap[17]).Css.isDarkTheme() ? foregroundColor : backgroundColor; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).TapGestureHandler, { + onHandlerStateChange: this.onAreaTapGestureHandler + }, _react.default.createElement(_reactNative.View, { + style: style + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["login-overlay-background"] + }, _react.default.createElement(_reactNative.View, { + style: [_loadingOverlay.default.background, { + backgroundColor: backgroundColor + }] + })), _react.default.createElement(_reactNative.View, { + style: [style, _loadingOverlay.default.container, containerStyle, containerPositionStyle, buttonContainerStyle] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["login-overlay-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _loadingOverlay.default.parent + }, title ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["login-overlay-title-parent"] + }, _react.default.createElement(_reactNative.View, { + style: [_loadingOverlay.default.textParent, titleParentStyle] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["login-overlay-title"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: [_loadingOverlay.default.text, { + color: textColor + }, titleStyle] + }, title)))) : null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).TapGestureHandler, { + onHandlerStateChange: this.onButtonTapGestureHandler + }, _react.default.createElement(_reactNative.View, { + style: [_loadingOverlay.default.buttonParent, { + backgroundColor: backgroundColor + }, buttonStyle, buttonParentStyle], + collapsable: false + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["login-overlay-button"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: [_loadingOverlay.default.buttonText, { + color: foregroundColor + }, textButtonStyle] + }, button || global.strings("msg_continue_to_read", { + paper: paperName + }))))), showLogin ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).TapGestureHandler, { + onHandlerStateChange: this.onLoginTapGestureHandler + }, _react.default.createElement(_reactNative.View, { + style: [_loadingOverlay.default.loginParent, loginButtonStyle, loginParentStyle], + collapsable: false + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["login-overlay-login-text"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: [_loadingOverlay.default.loginText, { + color: textColor + }, loginButtonTextStyle] + }, login || global.strings("msg_already_subscriber"))))) : null))))); + } + }]); + return LoginOverlay; + }(_react.default.PureComponent); + + exports.default = LoginOverlay; + LoginOverlay.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + containerPosition: _propTypes.default.string, + containerStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + loginButtonStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + loginButtonTextStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + buttonStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + textButtonStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + titleStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + titleParentStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + title: _propTypes.default.string, + button: _propTypes.default.string, + login: _propTypes.default.string, + showLogin: _propTypes.default.bool + }; + LoginOverlay.defaultProps = { + title: undefined, + button: undefined, + login: undefined + }; +},2180,[5,7,8,15,12,14,16,17,201,28,1879,2181,460,1,572,730,715,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + background: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + opacity: 0.8 + }, + container: { + justifyContent: "center", + alignItems: "center", + flexDirection: "row" + }, + parent: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + justifyContent: "center" + }, + textParent: { + margin: 10, + padding: 10, + flexDirection: "row", + justifyContent: "center" + }, + text: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white, + fontSize: 16, + padding: 10 + }, + buttonParent: { + alignItems: "center", + padding: 10, + margin: 10, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + buttonText: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.black, + padding: 10, + fontSize: 16 + }, + loginParent: { + alignItems: "center", + padding: 10, + margin: 10 + }, + loginText: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white, + padding: 10, + fontSize: 16 + } + }); + + exports.default = _default; +},2181,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.applyDesktopLayout = applyDesktopLayout; + exports.applyMergeArtToHTML = exports.addImageActionUrlOnArticlesChain = exports.getTagsFromHTML = exports.manipulateArticleContent = exports.manipulateLastColumnContent = exports.addCaptionToImages = exports.getAllImages = exports.getBiggestImage = exports.removeTagBySrc = exports.getCaptionFromHtml = exports.getBaseText = exports.stripHTMLTags = exports.REGEX_TAGS = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _EPaperArticle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _PageJump = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _columnizerUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var REGEX_TAGS = { + GENERIC_TAG: /<[^<]*>/gm, + P: /])/gm, + P_CLOSE: /<\/p>/gm, + P_NOT_CLOSED: /^.*?(\/>|<\/p>)/gm, + P_CONTENT: /\s*])*>(.*?)<\/p>\s*/gm, + P_MAINTITLE: //gm, + P_SUBTITLE: //gm, + P_ABODY: //gm, + CLASS_ABODY: /class="abody"/gm, + ID_ADS_MID: /id="articleAds_mid"/gm, + MAINTITLE: /[\S\s]*?<\/p>/gm, + BYLINE: /[\S\s]*?<\/p>/gm, + IMAGE: //gm, + IMAGE_NEWSMEMORY: /]+\/>/gm, + IMAGE_QRCODE: /[^/, + IMAGE_CONTAINER: /

/gm, + CHILD_ART: /

/gm, + CAPTION_TEXT: //gm, + CONTINUE: //gm, + PARAGRAPH: /[\S\s]*?<\/p>/gm, + BR_HR: //gm, + HR: //gm, + QUOTE: //gm, + PAGEJUMP: /<\/pagejump>|/gm, + PAGEJUMP_SELF_CLOSE: //gm, + ADS_TOP: /|><\/p>)/gm, + ADS_MIDDLE: /|><\/p>)/gm, + ADS_BOTTOM: /|><\/p>)/gm, + NEW_LINE: /\n|\t/gm, + ONLY_TEXT: /\n|\t|<.*?>/gm, + HTML_ENTITY_GREATER: />/gm, + HTML_ENTITY_LOWER: /</gm, + MYONCLICK: /myonclick=/gm, + SCRIPT: /]*>[\S\s]*?<\/script>/gm + }; + exports.REGEX_TAGS = REGEX_TAGS; + var HR_IMAGE_MIN_ID = 50000; + var HR_IMAGE_MAX_ID = 51000; + + var fixHtml = function fixHtml(html) { + var newHtml = html; + var paragraphs = html.match(REGEX_TAGS.P); + + if (paragraphs && paragraphs.length > 0) { + var firstPiece = html.substr(0, html.indexOf(paragraphs[0])); + var lastPiece = html.substr(html.lastIndexOf(paragraphs[paragraphs.length - 1]) + paragraphs[paragraphs.length - 1].length).replace(REGEX_TAGS.P_CLOSE, ""); + paragraphs = [firstPiece].concat((0, _toConsumableArray2.default)(paragraphs), [lastPiece]); + var newParagraphs = paragraphs.map(function (paragraph) { + var newParagraph = paragraph.replace(REGEX_TAGS.NEW_LINE, ""); + + if (newParagraph.trim() === "") { + return newParagraph; + } + + if (!newParagraph.match(REGEX_TAGS.P_NOT_CLOSED)) { + return newParagraph + "

"; + } + + return newParagraph; + }); + newHtml = newParagraphs.join(""); + } + + newHtml = newHtml.replace(REGEX_TAGS.PAGEJUMP_SELF_CLOSE, ""); + return newHtml; + }; + + var stripHTMLTags = function stripHTMLTags() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + return html.replace(REGEX_TAGS.GENERIC_TAG, ""); + }; + + exports.stripHTMLTags = stripHTMLTags; + + var getBaseText = function getBaseText() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + return html.replace(REGEX_TAGS.ONLY_TEXT, ""); + }; + + exports.getBaseText = getBaseText; + + var getInBetweenIndex = function getInBetweenIndex(strDoc) { + var inBetweenHRIndex = -1; + var inBetweenImageIndex = -1; + var inBetweenChildArtIndex = -1; + var matches = strDoc.match(REGEX_TAGS.HR); + + if (matches && matches.length > 0) { + inBetweenHRIndex = strDoc.indexOf(matches[0]); + } + + matches = strDoc.match(REGEX_TAGS.IMAGE_CONTAINER); + + if (matches && matches.length > 0) { + inBetweenImageIndex = strDoc.indexOf(matches[0]); + } + + matches = strDoc.match(REGEX_TAGS.CHILD_ART); + + if (matches && matches.length > 0) { + inBetweenChildArtIndex = strDoc.indexOf(matches[0]); + } + + var inBetweenArray = [inBetweenHRIndex, inBetweenImageIndex, inBetweenChildArtIndex].filter(function (inBetween) { + return inBetween > -1; + }); + + if (inBetweenArray.length > 0) { + return Math.min.apply(Math, (0, _toConsumableArray2.default)(inBetweenArray)); + } + + return -1; + }; + + var getCaptionFromHtml = function getCaptionFromHtml() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var src = arguments.length > 1 ? arguments[1] : undefined; + var caption = ""; + var strDoc = html.replace(REGEX_TAGS.NEW_LINE, ""); + + try { + var doc = _$$_REQUIRE(_dependencyMap[10]).StringUtils.parseFromString(strDoc, "text/html"); + + var image = doc.getElementsByAttribute("src", src)[0]; + + if (image) { + strDoc = String(doc); + var strImageNode = String(image.parentNode); + var strImageIndex = strDoc.indexOf(strImageNode); + var imageTagEndPost = strImageIndex + strImageNode.length; + var inBetweenIndex = -1; + var paragraphs = doc.getElementsByClassName("paragraph"); + + if (paragraphs.length > 0) { + for (var i = 0; i < paragraphs.length; i++) { + var paragraph = paragraphs[i]; + var strParagraph = String(paragraph); + var strParagraphIndex = strDoc.indexOf(strParagraph); + + if (strImageIndex >= 0 && strParagraphIndex > strImageIndex) { + var strDocRest = strDoc.substring(imageTagEndPost, strParagraphIndex); + inBetweenIndex = getInBetweenIndex(strDocRest); + + if (inBetweenIndex === -1) { + strDoc = strDoc.replace(strParagraph, ""); + caption = paragraph.textContent; + } + + break; + } + } + } else { + inBetweenIndex = getInBetweenIndex(strDoc.substring(imageTagEndPost)); + } + + if (!caption.length) { + var secondHtmlPart = inBetweenIndex > -1 ? strDoc.substring(imageTagEndPost, imageTagEndPost + inBetweenIndex) : strDoc.substring(imageTagEndPost); + var endOfArticleWithoutContinuation = strDoc.search("

"); + var captionPart = ""; + + if (endOfArticleWithoutContinuation !== -1 && imageTagEndPost < endOfArticleWithoutContinuation) { + captionPart = strDoc.substring(imageTagEndPost, endOfArticleWithoutContinuation); + } else { + var secondHtmlPartDOM = _$$_REQUIRE(_dependencyMap[10]).StringUtils.parseFromString(secondHtmlPart, "text/html"); + + var pTags = secondHtmlPartDOM.getElementsByTagName("p"); + + if (pTags.length > 0) { + var _i = 0; + + do { + var pTag = pTags[_i]; + + if (pTag.getAttribute("class") !== "abody") { + break; + } + + _i += 1; + } while (_i < pTags.length); + + if (_i > 0) { + if (_i === pTags.length) { + captionPart = secondHtmlPart; + } else { + var _pTag = pTags[_i]; + var pNode = String(_pTag); + var endIndex = secondHtmlPart.indexOf(pNode); + captionPart = secondHtmlPart.substring(0, endIndex); + } + } + } + } + + var htmlParts = captionPart.split(REGEX_TAGS.P_CONTENT); + + for (var _i2 = 0; _i2 < htmlParts.length; _i2++) { + var htmlPart = htmlParts[_i2].replace(REGEX_TAGS.CAPTION_TEXT, "").trim(); + + if (htmlPart.length > 1 && htmlPart.length < 360 && htmlPart.search(" 0 && arguments[0] !== undefined ? arguments[0] : []; + return images.find(function (image) { + return image.isBiggestImage(); + }); + }; + + exports.getBiggestImage = getBiggestImage; + + var getAllImages = function getAllImages(html) { + var defaultWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 200; + var imagesList = []; + var maxFoundSize = 0; + var maxFoundIndex = -1; + + try { + var document = _$$_REQUIRE(_dependencyMap[10]).StringUtils.parseFromString(html); + + if (document) { + try { + var imgs = document.getElementsByTagName("img") || []; + + for (var i = 0; i < imgs.length; i++) { + try { + var img = imgs[i]; + + if (img) { + var model = new (_$$_REQUIRE(_dependencyMap[12]).EPaperArticleImage)(); + model.setUrl(img.getAttribute("src")); + model.setHrUrl(img.getAttribute("hrsrc")); + model.setWidth(parseInt(img.getAttribute("width"), 10)); + model.setHeight(parseInt(img.getAttribute("height"), 10)); + model.setChildArt(img.hasAttribute("isChildArt")); + model.setInline(img.getAttribute("class").indexOf("imgInline") !== -1); + model.setQrCode(img.hasAttribute("qrcode")); + model.setTag(String(img.parentNode)); + + if (model.isQrCode() || model.getWidth() > 40 && model.getHeight() > 40) { + imagesList.push(model); + } + + var imageArea = model.getWidth() * model.getHeight(); + + if (!model.isChildArt() && !model.isInline() && model.getWidth() > defaultWidth * 0.9 && imageArea > maxFoundSize) { + maxFoundSize = imageArea; + maxFoundIndex = imagesList.length - 1; + } + } + } catch (e) {} + } + + if (maxFoundIndex > -1) { + imagesList[maxFoundIndex].setBiggestImage(true); + } + } catch (e) {} + } + } catch (e) {} + + return imagesList; + }; + + exports.getAllImages = getAllImages; + + var addCaptionToImages = function addCaptionToImages() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var images = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var removeCaption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var newHtml = html; + + for (var i = 0; i < images.length; i++) { + var result = getCaptionFromHtml(newHtml, images[i].getUrl()); + + if (images[i].isBiggestImage() && removeCaption === 1 || removeCaption === 2) { + newHtml = result.newHtml; + } + + images[i].setCaption(result.caption); + } + + return newHtml; + }; + + exports.addCaptionToImages = addCaptionToImages; + + var replaceImageUrlWithAction = function replaceImageUrlWithAction(html, issue, edition, filename, filetime, secret, isOnline) { + var newHtml = html; + var regExp = REGEX_TAGS.IMAGE_NEWSMEMORY; + var matcher; + + if (html) { + do { + matcher = regExp.exec(html); + + if (matcher && matcher.length > 2) { + var img = matcher[0]; + var originalUrl = matcher[1]; + var paper = matcher[2]; + var imageIssue = matcher[3] || issue; + var page = matcher[4] || filename; + var image = matcher[5]; + var imgTag = img; + var isHRImage = false; + var actionUrl = originalUrl; + var galleryActionUrl = originalUrl; + + if (global.isHTTPS()) { + actionUrl = _NewsmemoryAJAX.default.getInArticleImageUrl(paper, issue, edition, image, imageIssue, page, filetime, secret); + galleryActionUrl = actionUrl; + var imageId = -1; + var matches = image.match(/[A-Za-z]+_([0-9]+)\.[A-Za-z0-9]+/); + + if (matches.length > 1) { + imageId = parseInt(matches[1], 10); + isHRImage = imageId >= HR_IMAGE_MIN_ID && imageId < HR_IMAGE_MAX_ID; + } + + if (isHRImage) { + var midImageId = imageId - HR_IMAGE_MIN_ID; + image = image.replace(/_([0-9]+)\./, "_" + midImageId + "."); + actionUrl = _NewsmemoryAJAX.default.getInArticleImageUrl(paper, issue, edition, image, imageIssue, page, filetime, secret); + } + + imgTag = imgTag.replace(originalUrl, actionUrl); + } + + var jsFunction = "saveImage"; + var attribute = "data-save"; + + if (!isOnline) { + jsFunction = "retrieveImage"; + attribute = "data-retrieve"; + } + + imgTag = imgTag.replace(/onload="[^"]*"/, attribute + "='" + jsFunction + "(this, \"" + paper + "\", \"" + issue + "\", \"" + edition + "\", \"" + page + "\", \"" + image + "\", \"" + filetime + "\")'"); + var onClickAction = "openGallery(\"" + galleryActionUrl + "\")"; + + try { + var imgDom = _$$_REQUIRE(_dependencyMap[10]).StringUtils.parseFromString(imgTag, "text/html"); + + if (imgDom) { + var imgs = imgDom.getElementsByTagName("img"); + + if (imgs && imgs[0]) { + if (imgs[0].hasAttribute("qrcode")) { + var qrCodeLink = imgs[0].getAttribute("title"); + onClickAction = "showImageOptions(\"" + qrCodeLink + "\", \"" + actionUrl + "\")"; + } + + if (isHRImage) { + imgs[0].setAttribute("hrsrc", galleryActionUrl); + imgTag = String(imgs[0]).trim(); + } + } + } + } catch (e) {} + + var modifiedImg = "

" + imgTag + "

"; + newHtml = newHtml.replace(img, modifiedImg); + } + } while (matcher !== null); + } + + return newHtml; + }; + + var skipNodeByAttrOrContent = function skipNodeByAttrOrContent(node, content) { + if (node && node.attributes && node.attributes.length) { + for (var i = 0; i < node.attributes.length; i++) { + var attribute = node.attributes[i]; + + if (attribute.nodeValue.includes("pageJump") || attribute.nodeValue.includes("scrollpageToContinue")) { + return true; + } + + var strNode = _$$_REQUIRE(_dependencyMap[10]).StringUtils.decodeHTML(String(node)); + + if (content && strNode.includes(content)) { + return true; + } + } + } + + return false; + }; + + var manipulateLastColumnContent = function manipulateLastColumnContent(html, css, options, article) { + var articleIndex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; + var biggestImage = arguments.length > 5 ? arguments[5] : undefined; + var defaultCss = css.defaultCss, + customCss = css.customCss; + + var cssTheme = _$$_REQUIRE(_dependencyMap[13]).Css.getThemeInUse(); + + var themeClass = ""; + + if (cssTheme) { + themeClass = " class='" + cssTheme + "'"; + } + + var document = _$$_REQUIRE(_dependencyMap[10]).StringUtils.parseFromString("
" + html + "
", "text/html"); + + var hrCounter = document.getElementsByTagName("hr").length; + var artAddIndex = -1; + var artADDs = []; + var isParentArticle = article ? article.isParent() : false; + + for (var i = 0; i <= hrCounter; i++) { + var artAdd = document.getElementById("ArtADD" + i); + + if (artAdd && (!isParentArticle || i > articleIndex)) { + var scrollMergeADD = artAdd.firstChild; + var nodes = scrollMergeADD.childNodes; + var removeHtmlBreakTag = false; + var j = 0; + + while (j < nodes.length) { + var node = nodes[j]; + + if (skipNodeByAttrOrContent(node, biggestImage ? biggestImage.getUrl() : undefined)) { + removeHtmlBreakTag = true; + node.parentNode.removeChild(node); + } else { + if (removeHtmlBreakTag && (node.nodeName === "br" || node.nodeName === "hr" || String(node).match(/div class="hr"/g))) { + node.parentNode.removeChild(node); + } else if (String(node).trim().length === 0) { + node.parentNode.removeChild(node); + } else { + removeHtmlBreakTag = false; + j += 1; + } + } + } + + if (scrollMergeADD.childNodes.length > 0) { + artADDs.push(artAdd); + artAddIndex = i; + } + } + } + + var content = artADDs.join(""); + + if (content && content.length) { + var fontRegular = options.fontRegular, + fontBold = options.fontBold, + dynamicFonts = options.dynamicFonts; + var fontSize = options.fontSize; + fontSize = fontSize || 100; + var newHtml = "\n \n \n \n \n \n \n
\n
\n " + content + "\n
\n
\n \n \n \n "; + newHtml = newHtml.replace(REGEX_TAGS.HTML_ENTITY_GREATER, ">"); + newHtml = newHtml.replace(REGEX_TAGS.HTML_ENTITY_LOWER, "<"); + return { + html: newHtml.replace(REGEX_TAGS.NEW_LINE, ""), + artAddIndex: artAddIndex + }; + } + + return { + html: "", + artAddIndex: -1 + }; + }; + + exports.manipulateLastColumnContent = manipulateLastColumnContent; + + function applyDesktopLayout(strHtml, options) { + var newHtml = strHtml; + + var doc = _$$_REQUIRE(_dependencyMap[10]).StringUtils.parseFromString("" + newHtml + "", "text/html"); + + var artAdd = doc.getElementById("ArtADD"); + var strDoc = String(doc); + var tagsAdsTop = strDoc.match(REGEX_TAGS.ADS_TOP) || []; + var tagsAdsMiddle = strDoc.match(REGEX_TAGS.ADS_MIDDLE) || []; + var tagsAdsBottom = strDoc.match(REGEX_TAGS.ADS_BOTTOM) || []; + var bottomAdAtLast = true; + + if (artAdd || tagsAdsTop.length > 0 || tagsAdsMiddle.length > 0 || tagsAdsBottom.length > 0) { + bottomAdAtLast = false; + var firstColumnContent = strDoc; + var strArtAdd = ""; + + if (artAdd) { + strArtAdd = String(artAdd); + firstColumnContent.replace(strArtAdd, ""); + } + + tagsAdsTop.forEach(function (tag) { + firstColumnContent = firstColumnContent.replace(tag, ""); + }); + tagsAdsMiddle.forEach(function (tag) { + firstColumnContent = firstColumnContent.replace(tag, ""); + }); + tagsAdsBottom.forEach(function (tag) { + firstColumnContent = firstColumnContent.replace(tag, ""); + }); + newHtml = "\n \n " + tagsAdsTop + "\n
\n
" + firstColumnContent + "
\n
" + tagsAdsMiddle + strArtAdd + tagsAdsBottom + "
\n
\n "; + } + + var imageLimit = options.imageLimit, + isOnline = options.isOnline; + var imageMatches = newHtml.match(REGEX_TAGS.IMAGE); + var imagesPresent = imageMatches && imageMatches.length > imageLimit; + newHtml = (0, _$$_REQUIRE(_dependencyMap[16]).addInStoryAdsToHtml)(newHtml, imagesPresent, isOnline, bottomAdAtLast); + return newHtml; + } + + var manipulateArticleContent = function manipulateArticleContent(html, css, options, articleIndexInChain, artAddIndex) { + var customCss = css.customCss; + var defaultCss = css.defaultCss; + + var cssTheme = _$$_REQUIRE(_dependencyMap[13]).Css.getThemeInUse(); + + var themeClass = ""; + + if (options.ignoreTheme) { + var _global$getActivePSet = global.getActivePSetup(), + enableArticleTextSelection = _global$getActivePSet.enableArticleTextSelection; + + var _global$getFontsConfi = global.getFontsConfig(), + _fontRegular = _global$getFontsConfi.fontRegular, + _fontBold = _global$getFontsConfi.fontBold; + + defaultCss = (0, _$$_REQUIRE(_dependencyMap[15]).DEFAULT_CSS)(_fontRegular.fontWeb, _fontBold.fontWeb, enableArticleTextSelection, true); + } else if (cssTheme) { + themeClass = " class='" + cssTheme + "'"; + } + + var fontRegular = options.fontRegular, + fontBold = options.fontBold, + dynamicFonts = options.dynamicFonts, + searchText = options.searchText, + searchColor = options.searchColor, + truncateArticle = options.truncateArticle, + enableColumnizer = options.enableColumnizer, + enableArticleImageReposition = options.enableArticleImageReposition, + enableDesktopLayout = options.enableDesktopLayout, + allBlack = options.allBlack, + columnView = options.columnView, + mergeArticles = options.mergeArticles, + keepArticlePositionOnRotation = options.keepArticlePositionOnRotation, + contentWidth = options.contentWidth, + containerHeight = options.containerHeight; + var fontSize = options.fontSize; + fontSize = fontSize || 100; + var truncateScriptStr = ""; + + if (truncateArticle) { + truncateScriptStr = _$$_REQUIRE(_dependencyMap[14]).truncateScript; + } + + truncateScriptStr += "window.ReactNativeWebView.postMessage(JSON.stringify((" + _$$_REQUIRE(_dependencyMap[14]).retrieveInnerText + ")()));"; + var libraryScripts = ""; + var columnizerScript = ""; + var columnizerCss = ""; + var moveImagesScript = ""; + var executeSaveImages = ""; + var executeMovePageJumps = ""; + var executeMoveImages = ""; + var allBlackCss = ""; + + if (enableColumnizer) { + if (columnView === 2) { + articleIndexInChain = 0; + } + + columnizerScript = "\n "; + columnizerCss = "\n \n "; + libraryScripts = ""; + } else { + executeSaveImages = "\n saveImages();"; + executeMovePageJumps = "\n movePageJumps();"; + + if (enableArticleImageReposition && !enableDesktopLayout) { + executeMoveImages = "\n moveImages();\n if (typeof getLoadedAds === 'function') { \n getLoadedAds(); \n };"; + } + } + + if (enableArticleImageReposition && !enableDesktopLayout) { + moveImagesScript = "\n "; + } + + if (allBlack) { + allBlackCss = "\n \n "; + } + + if (enableDesktopLayout) { + html = applyDesktopLayout(html, options); + } + + var positionScript = ""; + + if (keepArticlePositionOnRotation) { + positionScript = "\n "; + } + + var newHtml = "\n \n \n \n \n " + columnizerCss + "\n " + allBlackCss + "\n \n " + libraryScripts + "\n \n \n
\n
\n " + html + "\n
\n
\n \n \n \n \n \n \n \n " + moveImagesScript + "\n \n \n " + columnizerScript + "\n " + positionScript + "\n \n \n \n "; + + if (searchText) { + newHtml = newHtml.replace(new RegExp("(" + searchText + "(?![^<>]*>))", "gim"), "
" + searchText + ""); + } + + newHtml = newHtml.replace(REGEX_TAGS.HTML_ENTITY_GREATER, ">"); + newHtml = newHtml.replace(REGEX_TAGS.HTML_ENTITY_LOWER, "<"); + + try { + newHtml = newHtml.replace(REGEX_TAGS.MYONCLICK, "onclick="); + } catch (e) {} + + return newHtml.replace(REGEX_TAGS.NEW_LINE, ""); + }; + + exports.manipulateArticleContent = manipulateArticleContent; + + var replacePageJumps = function replacePageJumps(edition, articles, pjType, pjIndex) { + var replacedTags = []; + + if (articles && articles.length > 0) { + var article = articles[0]; + var page = edition.getPageByArticle(article); + + if (article && page) { + var pageJumps = article.getPageJumps(); + + if (pageJumps && pageJumps.length > 0) { + pageJumps.forEach(function (pageJump, index) { + var pageRef = ""; + + if (pageJump) { + switch (pjType) { + case _$$_REQUIRE(_dependencyMap[11]).MERGE_ARTICLES_TYPES.MERGED: + if (pageJump.isHiddenSlug() || pageJump.isSlug()) { + (function () { + var slug = pageJump.isSlug() ? pageJump.getSlug() : ""; + var slugDiv = slug ? "
" + slug + "
" : ""; + + var fromPage = _pageUtils.default.removeZerosFromPageNumber(pageJump.getFrom() || page.getPage()); + + var articleFrom = pageJump.getArticleFrom() >= 0 ? pageJump.getArticleFrom() : article.getXmlId(); + var pageJumpTo = pageJump.getTo() || page.getPage(); + var toPage = "" + _pageUtils.default.removeZerosFromPageNumber(pageJumpTo) + ""; + + if (slug) { + (function () { + var nextPageJumpsToAdd = []; + var nextPageJumpTos = []; + + var _loop = function _loop(i) { + var nextArticle = articles[i]; + + if (nextArticle) { + var nextPageJumps = nextArticle.getPageJumps(); + + if (nextPageJumps && nextPageJumps.length > 0) { + nextPageJumps.forEach(function (nextPageJump, nextIndex) { + if (nextPageJump && (nextPageJump.isHiddenSlug() || nextPageJump.isSlug()) && nextPageJump.getSlug() === slug) { + var nextPageJumpTo; + + if (nextPageJump.getTo()) { + if (nextPageJump.getTo() !== pageJumpTo) { + nextPageJumpTo = nextPageJump.getTo(); + } + } else if (nextPageJump.getArticleFrom()) { + var nextPage = edition.getPageByArticle(nextArticle); + + if (nextPage && nextPage.getPage() !== pageJumpTo) { + nextPageJumpTo = nextPage.getPage(); + } + } + + if (nextPageJumpTo && !nextPageJumpTos.includes(nextPageJumpTo)) { + nextPageJumpTos.push(nextPageJumpTo); + nextPageJumpsToAdd.push(nextPageJump); + } + } + }); + } + } + }; + + for (var i = 1; i < articles.length; i++) { + _loop(i); + } + + if (nextPageJumpTos.length > 0) { + toPage += nextPageJumpTos.reduce(function (result, nextPageJumpTo, pageJumpIndex) { + var articleId = nextPageJumpsToAdd[pageJumpIndex] ? nextPageJumpsToAdd[pageJumpIndex].getArticleId() : ""; + return result + ", " + _pageUtils.default.removeZerosFromPageNumber(nextPageJumpTo) + ""; + }, ""); + } + })(); + } + + pageRef = "\n
\n
\n " + slugDiv + "\n \n " + global.strings("pj_from_page") + "\n \n \n " + fromPage + "\n \n \n " + global.strings("pj_to_page") + " \n \n " + toPage + "\n
\n
\n
"; + })(); + } else if (pageJump.isParent()) { + var pjText = ""; + var articleId = -1; + + if (pageJump.hasTo()) { + pjText = _pageUtils.default.removeZerosFromPageNumber(pageJump.getTo()); + articleId = pageJump.getArticleId(); + } else if (pageJump.hasFrom()) { + pjText = _pageUtils.default.removeZerosFromPageNumber(pageJump.getFrom()); + articleId = pageJump.getArticleFrom(); + } + + if (pjText) { + pageRef = "\n
\n \n " + global.strings("pj_continue_to_page_parent") + "\n \n " + pjText + "\n
\n
"; + } + } + + break; + + case _$$_REQUIRE(_dependencyMap[11]).MERGE_ARTICLES_TYPES.ONLY_FIRST: + if (pageJump.hasFrom()) { + var fromPage = _pageUtils.default.removeZerosFromPageNumber(pageJump.getFrom()); + + pageRef = "\n \n " + index + "\n " + global.strings("pj_from_page") + "\n \n \n " + fromPage + "\n "; + } + + break; + + case _$$_REQUIRE(_dependencyMap[11]).MERGE_ARTICLES_TYPES.PAGE_REFS: + if (pageJump.isHiddenSlug() || pageJump.isSlug()) { + var _fromPage = _pageUtils.default.removeZerosFromPageNumber(pageJump.getFrom() || page.getPage()); + + var articleFrom = pageJump.getArticleFrom() >= 0 ? pageJump.getArticleFrom() : article.getXmlId(); + + var toPage = _pageUtils.default.removeZerosFromPageNumber(pageJump.getTo() || page.getPage()); + + var slug = pageJump.isSlug() ? pageJump.getSlug() : ""; + var slugDiv = slug ? "\n " + slug + "\n " : ""; + pageRef = "\n
\n " + slugDiv + "\n \n " + global.strings("pj_from_page") + "\n \n \n " + _fromPage + "\n \n \n " + global.strings("pj_to_page") + " \n \n \n " + toPage + "\n \n
\n
"; + } else if (pageJump.isParent()) { + var _pjText = ""; + + var _articleId = -1; + + if (pageJump.hasTo()) { + _pjText = _pageUtils.default.removeZerosFromPageNumber(pageJump.getTo()); + _articleId = pageJump.getArticleId(); + } else if (pageJump.hasFrom()) { + _pjText = _pageUtils.default.removeZerosFromPageNumber(pageJump.getFrom()); + _articleId = pageJump.getArticleFrom(); + } + + if (_pjText) { + pageRef = "\n
\n \n " + global.strings("pj_continue_to_page_parent") + "\n \n " + _pjText + "\n
\n
"; + } + } + + break; + } + + if (pageRef) { + replacedTags.push(pageRef); + } + } + }); + } + } + } + + return replacedTags; + }; + + var getDontSplitChildArt = function getDontSplitChildArt(url, width, height, paper, issue, edition, page, image, filetime, isOnline) { + var jsFunction = "saveImage"; + var attribute = "data-save"; + + if (!isOnline) { + jsFunction = "retrieveImage"; + attribute = "data-retrieve"; + } + + return "\n
\n

\n \n

\n
"; + }; + + var getDontSplitChildArtEditorial = function getDontSplitChildArtEditorial(html) { + if (!html) { + return ""; + } + + var htmlArt = html.replace(REGEX_TAGS.P_MAINTITLE, '

'); + htmlArt = htmlArt.replace(REGEX_TAGS.P_ABODY, '

'); + htmlArt = htmlArt.replace(REGEX_TAGS.P_SUBTITLE, '

'); + htmlArt = htmlArt.replace(REGEX_TAGS.ADS_TOP, ""); + htmlArt = htmlArt.replace(REGEX_TAGS.ADS_MIDDLE, ""); + htmlArt = htmlArt.replace(REGEX_TAGS.ADS_BOTTOM, ""); + return "\n

\n
" + htmlArt + "
\n
"; + }; + + var mergeImgAndCaption = function mergeImgAndCaption() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var tagsImg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var tagsParagraph = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var htmlImgAndCaption = ""; + + for (var i = 0; i < tagsImg.length; i++) { + var tagImg = tagsImg[i]; + var paragraph = ""; + + if (tagImg) { + for (var j = 0; j < tagsParagraph.length; j++) { + var tagParagraph = tagsParagraph[j]; + + if (tagParagraph) { + if (html.indexOf(tagImg + tagParagraph) > 0) { + paragraph = tagParagraph; + } else if (i === 0 && html.indexOf(tagParagraph) > 0 && html.indexOf(tagParagraph + tagImg) > 0) { + paragraph = tagParagraph; + } + } + } + } + + htmlImgAndCaption += "\n
\n " + tagImg + "\n " + paragraph + "\n
\n "; + } + + return htmlImgAndCaption; + }; + + var fixByline = function fixByline() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var tagsByline = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + var _global$getActivePSet2 = global.getActivePSetup(), + enableArticleBylineHRs = _global$getActivePSet2.enableArticleBylineHRs; + + var bylineGroupActive = false; + + for (var i = 0; i < tagsByline.length; i++) { + var tagByline = tagsByline[i]; + + if (tagByline) { + var isLastBylineOfGroup = html.indexOf(tagByline + "

") === -1; + + if (enableArticleBylineHRs) { + if (!bylineGroupActive) { + html = html.replace(tagByline, "


" + tagByline); + bylineGroupActive = true; + } + + if (isLastBylineOfGroup) { + html = html.replace(tagByline, tagByline + "
"); + bylineGroupActive = false; + } + } else if (isLastBylineOfGroup) { + html = html.replace(tagByline, tagByline.replace("

", "

")); + } + } + } + + return html; + }; + + var getChildArts = function getChildArts(edition, article, secret, isOnline) { + var _edition$getChildArts = edition.getChildArts(article), + page = _edition$getChildArts.page, + childArts = _edition$getChildArts.articles; + + var htmlChildArtGraphic = ""; + var htmlChildArtEditorial = ""; + + for (var i = 0; i < childArts.length; i++) { + var childArt = childArts[i]; + + if (childArt.getType() !== _EPaperArticle.EPaperArticleType.EDITORIAL) { + var _NewsmemoryUtils$getC = _newsmemoryUtils.default.getChildArtPrintImageInfo(childArt), + boxesString = _NewsmemoryUtils$getC.boxesString, + maxX = _NewsmemoryUtils$getC.maxX, + maxY = _NewsmemoryUtils$getC.maxY, + medDpi = _NewsmemoryUtils$getC.medDpi; + + var childArtUrl = _NewsmemoryAJAX.default.getChildArtImageUrl(edition.getIssue(), childArt.getXmlId(), boxesString, medDpi, maxX, maxY, page.getFilename(), page.getModifyTime(), secret); + + htmlChildArtGraphic += getDontSplitChildArt(childArtUrl, maxX, maxY, edition.getPaper(), edition.getIssue(), edition.getEdition(), page.getFilename(), "childart_" + childArt.getXmlId() + ".jpg", page.getModifyTime(), isOnline); + } else { + var htmlArt = fixHtml(childArt.getHtml()); + htmlArt = replaceImageUrlWithAction(htmlArt, edition.getIssue(), edition.getEdition(), page.getFilename(), page.getModifyTime(), secret, isOnline); + htmlChildArtEditorial += getDontSplitChildArtEditorial(htmlArt); + } + } + + return { + htmlChildArtGraphic: htmlChildArtGraphic, + htmlChildArtEditorial: htmlChildArtEditorial + }; + }; + + var getTagsImgFromHTML = function getTagsImgFromHTML() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var tagsImg = html.match(REGEX_TAGS.IMAGE); + return tagsImg || []; + }; + + var getTagsFromHTML = function getTagsFromHTML(html, edition, article, secret, isOnline) { + var tagsImg = getTagsImgFromHTML(html); + var tagsContinue = html.match(REGEX_TAGS.CONTINUE) || []; + var tagsParagraph = html.match(REGEX_TAGS.PARAGRAPH) || []; + var tagsAdsTop = html.match(REGEX_TAGS.ADS_TOP) || []; + var tagsAdsMiddle = html.match(REGEX_TAGS.ADS_MIDDLE) || []; + var tagsAdsBottom = html.match(REGEX_TAGS.ADS_BOTTOM) || []; + var tagsPagejump = html.match(REGEX_TAGS.PAGEJUMP) || []; + var tagsQuote = html.match(REGEX_TAGS.QUOTE) || []; + var tagsByline = html.match(REGEX_TAGS.BYLINE) || []; + var tagsMainTitle = html.match(REGEX_TAGS.MAINTITLE) || []; + html = html.replace(REGEX_TAGS.NEW_LINE, ""); + + var _getChildArts = getChildArts(edition, article, secret, isOnline), + htmlChildArtGraphic = _getChildArts.htmlChildArtGraphic, + htmlChildArtEditorial = _getChildArts.htmlChildArtEditorial; + + var htmlImgAndCaption = mergeImgAndCaption(html, tagsImg, tagsParagraph); + return { + html: html, + htmlImgAndCaption: htmlImgAndCaption, + tags: { + tagsImg: tagsImg, + tagsMainTitle: tagsMainTitle, + tagsContinue: tagsContinue, + tagsParagraph: tagsParagraph, + tagsAdsTop: tagsAdsTop, + tagsAdsMiddle: tagsAdsMiddle, + tagsPagejump: tagsPagejump, + tagsAdsBottom: tagsAdsBottom, + tagsQuote: tagsQuote, + tagsByline: tagsByline + }, + childArt: { + htmlChildArtGraphic: htmlChildArtGraphic, + htmlChildArtEditorial: htmlChildArtEditorial + } + }; + }; + + exports.getTagsFromHTML = getTagsFromHTML; + + var clearHtml = function clearHtml() { + var html = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var tagsByline = tags.tagsByline; + html = html.replace(REGEX_TAGS.IMAGE, ""); + html = html.replace(REGEX_TAGS.CONTINUE, ""); + html = html.replace(REGEX_TAGS.PARAGRAPH, ""); + html = html.replace(REGEX_TAGS.BR_HR, ""); + html = html.replace(REGEX_TAGS.PAGEJUMP, ""); + html = html.replace(REGEX_TAGS.ADS_TOP, ""); + html = html.replace(REGEX_TAGS.ADS_BOTTOM, ""); + html = html.replace(REGEX_TAGS.QUOTE, ""); + return fixByline(html, tagsByline); + }; + + function calculateMidAdsPosition(html) { + var htmlPieces = html.split(REGEX_TAGS.HR).map(function (htmlPiece) { + var midAdsStr = "
"); + } + + function moveMediaOnTop(htmlToManage, index, edition, article, pjArticle, secret, mergeArticles, enableColumnizer, isOnline) { + var result = getTagsFromHTML(htmlToManage, edition, article, secret, isOnline); + var html = result.html, + tags = result.tags, + childArt = result.childArt; + var htmlImgAndCaption = result.htmlImgAndCaption; + var tagsAdsBottom = tags.tagsAdsBottom, + tagsQuote = tags.tagsQuote; + var htmlChildArtEditorial = childArt.htmlChildArtEditorial, + htmlChildArtGraphic = childArt.htmlChildArtGraphic; + var newHtml = clearHtml(html, tags); + + if (tagsAdsBottom && tagsAdsBottom[0]) { + newHtml += tagsAdsBottom[0]; + } + + newHtml += "
"; + newHtml += "
"; + var htmlDontSplit = ""; + replacePageJumps(edition, [pjArticle], mergeArticles, index).forEach(function (tagPagejump) { + htmlDontSplit += tagPagejump; + }); + + if (tagsQuote && tagsQuote.length) { + if (htmlDontSplit) { + htmlDontSplit += "
"; + } + + tagsQuote.forEach(function (tagQuote) { + htmlDontSplit += tagQuote; + + if (htmlImgAndCaption) { + var imgsQuote = getTagsImgFromHTML(tagQuote); + + if (imgsQuote && imgsQuote.length) { + imgsQuote.forEach(function (imgQuote) { + htmlImgAndCaption = htmlImgAndCaption.replace(imgQuote, ""); + }); + } + } + }); + } + + if (htmlImgAndCaption) { + if (htmlDontSplit) { + htmlDontSplit += "
"; + } + + htmlDontSplit += htmlImgAndCaption; + } + + if (htmlChildArtGraphic) { + if (htmlDontSplit) { + htmlDontSplit += "
"; + } + + htmlDontSplit += htmlChildArtGraphic; + } + + if (htmlChildArtEditorial) { + if (htmlDontSplit) { + htmlDontSplit += "
"; + } + + htmlDontSplit += htmlChildArtEditorial; + } + + if (htmlDontSplit && enableColumnizer) { + htmlDontSplit += "
"; + } + + newHtml += htmlDontSplit; + newHtml += "
"; + newHtml += "
"; + return newHtml; + } + + var addImageActionUrlOnArticlesChain = function addImageActionUrlOnArticlesChain(chains, clickedArticle) { + var html = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; + var edition = arguments.length > 3 ? arguments[3] : undefined; + var secret = arguments.length > 4 ? arguments[4] : undefined; + var isOnline = arguments.length > 5 ? arguments[5] : undefined; + var splittedHtml = html.split(REGEX_TAGS.HR); + splittedHtml = splittedHtml.map(function (articleHTML, index) { + var article = chains[index] || clickedArticle; + + if (article) { + var page = edition.getPageByArticle(article); + + if (page) { + return replaceImageUrlWithAction(articleHTML, edition.getIssue(), edition.getEdition(), page.getFilename(), page.getModifyTime(), secret, isOnline); + } + } + + return articleHTML; + }); + return splittedHtml.join("
"); + }; + + exports.addImageActionUrlOnArticlesChain = addImageActionUrlOnArticlesChain; + + var applyMergeArtToHTML = function applyMergeArtToHTML(strHtml, mergeArticles, enableColumnizer, calculateMidAds, isOnline, edition, article, secret) { + var newStrHtml = fixHtml(strHtml); + + if (calculateMidAds) { + newStrHtml = calculateMidAdsPosition(newStrHtml); + } + + var result = getTagsFromHTML(newStrHtml, edition, article, secret, isOnline); + var tags = result.tags, + childArt = result.childArt, + fixedHtml = result.html; + var htmlImgAndCaption = result.htmlImgAndCaption; + + if (mergeArticles === _$$_REQUIRE(_dependencyMap[11]).MERGE_ARTICLES_TYPES.NORMAL) { + var chains = edition.getChainOfArticle(article); + return addImageActionUrlOnArticlesChain(chains, article, fixedHtml, edition, secret, isOnline); + } + + var htmlChildArtEditorial = childArt.htmlChildArtEditorial, + htmlChildArtGraphic = childArt.htmlChildArtGraphic; + var tagsAdsTop = tags.tagsAdsTop, + tagsAdsBottom = tags.tagsAdsBottom, + tagsImg = tags.tagsImg, + tagsContinue = tags.tagsContinue, + tagsQuote = tags.tagsQuote; + var html = fixedHtml; + + if (mergeArticles === _$$_REQUIRE(_dependencyMap[11]).MERGE_ARTICLES_TYPES.MERGED) { + var pageJumps = ""; + var chain = edition.getChainOfArticle(article); + var hrs = html.match(REGEX_TAGS.HR); + + if (hrs && hrs.length) { + var currentArticle = chain[0]; + + if (currentArticle) { + replacePageJumps(edition, chain, mergeArticles, 0).forEach(function (tagPagejump) { + pageJumps += tagPagejump; + }); + } + } + + html = clearHtml(html, tags); + + if (tagsAdsTop && tagsAdsTop[0]) { + html = tagsAdsTop[0] + html; + } + + if (tagsAdsBottom && tagsAdsBottom[0]) { + html += tagsAdsBottom[0]; + } + + if (htmlChildArtGraphic !== "" || tagsImg.length > 0 || tagsContinue.length > 0 || tagsQuote.length > 0 || pageJumps !== "") { + html += "
"; + html += "
"; + var htmlDontSplit = pageJumps; + var firstHR = false; + + if (tagsContinue && tagsContinue.length > 0) { + tagsContinue.forEach(function (tagContinue) { + htmlDontSplit += tagContinue; + }); + } + + if (tagsQuote && tagsQuote.length > 0) { + if (htmlDontSplit) { + firstHR = true; + htmlDontSplit += "
"; + } + + tagsQuote.forEach(function (tagQuote) { + htmlDontSplit += tagQuote; + + if (htmlImgAndCaption) { + var imgsQuote = getTagsImgFromHTML(tagQuote); + + if (imgsQuote && imgsQuote.length) { + imgsQuote.forEach(function (imgQuote) { + htmlImgAndCaption = htmlImgAndCaption.replace(imgQuote, ""); + }); + } + } + }); + } + + if (htmlImgAndCaption || htmlChildArtGraphic) { + if (htmlDontSplit) { + firstHR = true; + htmlDontSplit += "
"; + } + + htmlDontSplit += htmlChildArtGraphic; + htmlDontSplit += "
"; + htmlDontSplit += htmlImgAndCaption; + } + + if (htmlChildArtEditorial) { + if (htmlDontSplit) { + firstHR = true; + htmlDontSplit += "
"; + } + + htmlDontSplit += htmlChildArtEditorial; + } + + if (pageJumps && !firstHR) { + htmlDontSplit += "
"; + } + + html += htmlDontSplit; + html += "
"; + html += "
"; + } else { + html += htmlImgAndCaption; + } + + var _chains = edition.getChainOfArticle(article); + + html = addImageActionUrlOnArticlesChain(_chains, article, html, edition, secret, isOnline); + } else if (mergeArticles === _$$_REQUIRE(_dependencyMap[11]).MERGE_ARTICLES_TYPES.ONLY_FIRST) { + var _chain = edition.getChainOfArticle(article); + + var _hrs = html.match(REGEX_TAGS.HR); + + if (_hrs && _hrs.length) { + var splittedHtml = html.split(REGEX_TAGS.HR); + var htmlHR = ""; + splittedHtml.forEach(function (item, index, elements) { + htmlHR += item; + + if (index === 0) { + var _currentArticle = _chain[index]; + + if (_currentArticle) { + htmlHR = moveMediaOnTop(item, index, edition, _currentArticle, _currentArticle, secret, mergeArticles, enableColumnizer, isOnline); + htmlHR = addImageActionUrlOnArticlesChain([_currentArticle], _currentArticle, htmlHR, edition, secret, isOnline); + } + } else { + htmlHR += "\n
\n
\n
"; + } + + if (index < elements.length - 1) { + htmlHR += "
"; + } + }); + html = htmlHR; + } else { + html = addImageActionUrlOnArticlesChain([article], article, html, edition, secret, isOnline); + html += "\n
\n
\n " + htmlChildArtEditorial + "\n
"; + } + } else if (mergeArticles === _$$_REQUIRE(_dependencyMap[11]).MERGE_ARTICLES_TYPES.PAGE_REFS) { + var _chain2 = edition.getChainOfArticle(article); + + var _hrs2 = html.match(REGEX_TAGS.HR); + + if (_hrs2 && _hrs2.length) { + var _splittedHtml = html.split(REGEX_TAGS.HR); + + var _htmlHR = ""; + + _splittedHtml.forEach(function (item, index, elements) { + var currentArticle = _chain2[index]; + + if (currentArticle) { + _htmlHR += moveMediaOnTop(item, index, edition, currentArticle, _chain2[index - 1], secret, mergeArticles, enableColumnizer, isOnline); + _htmlHR = addImageActionUrlOnArticlesChain([currentArticle], currentArticle, _htmlHR, edition, secret, isOnline); + + if (index < elements.length - 1) { + _htmlHR += "
"; + } + } + }); + + if (tagsAdsTop && tagsAdsTop.length) { + _htmlHR = tagsAdsTop[0] + _htmlHR; + } + + html = _htmlHR; + } else { + html = moveMediaOnTop(html, 0, edition, article, article, secret, mergeArticles, enableColumnizer, isOnline); + html = addImageActionUrlOnArticlesChain([article], article, html, edition, secret, isOnline); + + if (tagsAdsTop && tagsAdsTop.length) { + html = tagsAdsTop[0] + html; + } + + if (tagsAdsBottom && tagsAdsBottom.length) { + html += tagsAdsBottom[0]; + } + } + } + + return html; + }; + + exports.applyMergeArtToHTML = applyMergeArtToHTML; +},2182,[5,21,640,430,643,715,638,2183,644,603,462,717,2184,699,2185,2186,2187,2188]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.columnizerBaseColumnWidth = undefined; + var columnizerBaseColumnWidth = 400; + exports.columnizerBaseColumnWidth = columnizerBaseColumnWidth; + var columnizer = "\n function setTopAdsPos(){\n $(\"#articleAds_top\").insertBefore(\"#slideArt\");\n $(\"#slideArt\").find(\"#articleAds_top\").remove();\n }\n\n function setTranslateBannerPos(){\n $(\"#image_div_translation\").insertBefore(\"#slideArt\");\n $(\"#slideArt\").find(\"#image_div_translation\").remove();\n }\n\n function setMiddleAdsPos(){\n var ads = $(\"#articleAds_mid\");\n if(ads.length > 0){\n var objMiddle = ads[0].outerHTML;\n ads.remove();\n $(objMiddle).prependTo($(\"#scrollMergeADD\"));\n }\n }\n\n function setPaddingToColumns(element, index) {\n $(\"
\").insertBefore(element);\n $(element)\n .children()\n .appendTo(\".div_padding\" + index);\n $(\".div_padding\" + index).appendTo(element);\n $(\".div_padding\" + index).css(\"padding\", \"3px\");\n }\n\n function updateTopArt(){\n var artAddObjs = $(\"div[id^='ArtADD']\");\n $(artAddObjs).each(function(i){\n var idArtAdd = $(this).attr(\"id\");\n var parentArtADD = $(\"#\"+idArtAdd).parent();\n if(typeof $($(\"#\"+idArtAdd).parent().parent()).attr(\"class\") != \"undefined\" && $($(\"#\"+idArtAdd).parent().parent()).attr(\"class\").indexOf(\"last\") > -1){\n var cloneArtADD = \"
\"+$(\"#\"+idArtAdd).html()+\"
\";\n $(\"#\"+idArtAdd).remove();\n if($(\".first.column.last\").length == 0 && $(\".first.column\").length > 0){\n $(parentArtADD).prepend(cloneArtADD);\n }else if($(\".first.last.column\").length == 1){\n $(parentArtADD).append(cloneArtADD);\n }else{\n $(parentArtADD).prepend('');\n $(parentArtADD).append(cloneArtADD);\n }\n }\n });\n }\n\n var BASE_COLUMN_WIDTH = 400;\n var VERY_SHORT_ARTICLE_LENGTH = 500;\n var SHORT_ARTICLE_LENGTH = 1500;\n\n function fixSingleColumnWidth(element) {\n var textLength = $(element).children().text().length;\n /* if single column on a very short article reduce the width of the column \n to improve the readability */ \n if ($(element+\" .column\").length === 1 && textLength <= VERY_SHORT_ARTICLE_LENGTH) {\n var containerWidth = $(\"#slideArt\").width();\n var virtualCols = Math.round(containerWidth / BASE_COLUMN_WIDTH);\n var colWidth = containerWidth/virtualCols;\n if ($(element+\" .column\").width() != colWidth) {\n $(element+\" .column\").width(colWidth);\n }\n }\n }\n\n function fixImagesAlignment(element) {\n $(\"p.imgContainer img\").each(function() {\n /* check if the image is followed by a paragraph */\n var parentNode = $(this).parent();\n var prevElement = parentNode && parentNode.prev();\n var nextElement = parentNode && parentNode.next();\n if ((!prevElement || !prevElement.hasClass(\"quote\")) && (!nextElement || !nextElement.hasClass(\"paragraph\"))) {\n /* if the image has a width less than 25% of the column align to the left */\n if ($(this).width() < $(element+\" .column\").width()*0.25) {\n $(this).css(\"margin\", 0);\n }\n }\n });\n }\n\n function moveImagesIfSingleColumn(element) {\n if ($(element+\" .column\").length === 1 && typeof moveImages === \"function\") {\n moveImages();\n }\n }\n\n function movePageJumpsColumnizer(index) {\n try {\n /* on single column move page jumps after the hr of the previous article */\n if ($(\".column\").length === $(\".first.last.column\").length) {\n $(\"div[data-pjindex]\").each(function() {\n var pjindex = parseInt($(this).data(\"pjindex\"), 10);\n if (pjindex > 0) {\n var prevHr = $(\"hr[class='hr\"+(pjindex-1)+\"']\");\n if (prevHr) {\n prevHr.after(this);\n }\n }\n });\n } else if (index > 0 && ($(\".div_padding\"+index+\" #artTopLast img\").length > 0 || $(\".div_padding\"+index+\" #artTopLast .pageJump\").length > 0)) {\n /* move the img or the pj div at the top of the last column */\n var pjImgContainer = $(\".div_padding\"+index+\" #artTopLast\");\n pjImgContainer.parent().prepend(pjImgContainer);\n }\n } catch (e) {\n console.log(e);\n }\n }\n \n function setColumns(element, index, pageJump, multipleArticles, scrollToHrIndex, isLast, moveTopArtOnTop) {\n console.log(\"columnize \" + element);\n var arabic = /[\u0600-\u06FF]/;\n var isArabic = arabic.test($($(\".maintitle\")[0]).text()) || arabic.test($($(\".uptitle\")[0]).text());\n var columnFloat = isArabic ? \"right\" : \"left\";\n console.log(\"is arabic \" + isArabic);\n var columnOptions = {\n lastNeverTallest: true,\n columnFloat: columnFloat,\n doneFunc: function () {\n console.log(\"columnized \" + element);\n setTopAdsPos();\n setTranslateBannerPos();\n setMiddleAdsPos();\n if(moveTopArtOnTop){\n updateTopArt();\n }\n\n fixSingleColumnWidth(element);\n fixImagesAlignment(element);\n moveImagesIfSingleColumn(element);\n\n saveImages();\n \n if(isLast){\n movePageJumpsColumnizer(index);\n \n /*var heads = $('[class^=article_head]');*/\n var heads = $(\"hr\");\n /*if index is related to second piece of article there is just one hr between articles so index is articleIndex -1*/\n scrollToHrIndex = scrollToHrIndex - 1;\n var top = 0;\n if(heads && heads.length >= scrollToHrIndex && scrollToHrIndex >= 0){\n top = $(heads[scrollToHrIndex]).offset().top;\n }\n console.log(\"scroll to \" + top);\n if (window.ReactNativeWebView && top > 0) {\n try{\n var content = $(\"#content\")[0];\n /*is important to set the height because article text scroll to position when set the same height of scrollview\n the height of scrollview comes from autoheight webview*/\n var height = Math.max(content.scrollHeight, content.offsetHeight, content.clientHeight);\n window.ReactNativeWebView.postMessage(JSON.stringify({ scrollTop: top, type: \"SCROLL_TOP\", scrollHeight: height }));\n } catch(e){\n console.log(\"error on post message scroll top\");\n }\n }\n }\n }\n };\n\n var images = $(element + \" img\");\n var countParagraphs = $(element).children().length * 50;\n var textLength = $(element).children().text().length;\n var countImages = images.length * 200;\n var totalLength = textLength + countParagraphs + countImages;\n console.log(\"total length \" + totalLength);\n console.log(\"short length \" + SHORT_ARTICLE_LENGTH);\n console.log(\"count paragraphs \" + countParagraphs);\n console.log(\"text length \" + textLength);\n console.log(\"very short length \" + VERY_SHORT_ARTICLE_LENGTH);\n console.log(\"count images \" + countImages);\n console.log(\"page jump \" + pageJump);\n console.log(\"multiple articles \" + multipleArticles);\n\n if (totalLength > SHORT_ARTICLE_LENGTH || ((pageJump === 1 || multipleArticles) && textLength > VERY_SHORT_ARTICLE_LENGTH)) {\n columnOptions.width = BASE_COLUMN_WIDTH;\n } else {\n columnOptions.columns = 1; \n }\n console.log(\"columnizer options\");\n console.log(columnOptions);\n setPaddingToColumns(element, index);\n $(element).columnize(columnOptions);\n }\n\n function getWidthOfSpans(element) {\n var width = 0;\n if (element) {\n $(element)\n .find(\"span\")\n .each(function () {\n width += $(this).width();\n });\n }\n return width;\n }\n\n function setColumnizerArticle(index, article, multipleArticles, scrollToHrIndex, isLast, moveTopArtOnTop) {\n console.log(\"===============================================\");\n console.log(\"set columnizer article...: \" + index);\n console.log(\"slide art width: \" + $(\"#slideArt\").width());\n var column_width = 400;\n if( $(\"#slideArt\").width() / 4 > 400 ){\n column_width = parseInt($(\"#slideArt\").width() / 4);\n }\n console.log(\"column width: \" + column_width);\n var headArticle = new Array();\n $(article).each(function(){\n if(this.className == \"abody\")return false;\n headArticle.push(this);\n });\n /*var headArticle = $(article).filter(\".abody\").first().prevAll().get().reverse();\n if($(headArticle).filter(\".byline\").length > 0){\n headArticle = $(headArticle).filter(\".byline\").first().prevAll().get().reverse();\n }*/\n var maintitle=$(headArticle).filter(\".maintitle\");\n var parentPage=$(headArticle).filter(\".parentPage\");\n /* PUT MAINTITLE AND UPPER CONTENT OUTSIDE OF ARTICLE TEXT ONLY IF ONE MAINTITLE EXSISTS AND IF MAINTITLE IS LARGER THEN COLUMN WIDTH*/\n var first_element=$(article)[0];\n $(\"
\").insertAfter($(first_element));\n $(article).appendTo(\".article_body\" + index);\n if (maintitle.length <= 1 ) {\n console.log(\"main title exists\");\n $(\"
\").insertBefore(\".article_body\" + index);\n var moveTitleOutColumns = false;\n $(headArticle).each(function(){\n if($(this).attr(\"class\") && $(this).attr(\"class\").indexOf(\"title\") > -1){\n var widthParagraph = getWidthOfSpans(this);\n console.log(\"width: \" + widthParagraph);\n if(widthParagraph > column_width){\n moveTitleOutColumns = true;\n }\n }\n });\n $(headArticle).each(function(){\n if($(this).attr(\"class\") && $(this).attr(\"class\").indexOf(\"title\") > -1){\n if(moveTitleOutColumns){\n $(this).appendTo('.article_head' + index);\n }else{\n /*$(\".article_body\" + index).prepend(this);*/\n }\n }\n });\n $(\".article_body\" + index).css(\"margin-top\",\"10px\");\n /*CREATE COLUMNS FROM ARTICLE TEXT*/\n setColumns(\".article_body\" + index, index, 0, multipleArticles, scrollToHrIndex, isLast, moveTopArtOnTop);\n }else {\n setColumns(\".article_body\" + index, index, 1, multipleArticles, scrollToHrIndex, isLast, moveTopArtOnTop);\n }\n if (index > 0 && parentPage) {\n $(parentPage).appendTo(\".article_body\" + (index - 1));\n $(\".article_body\" + index + \" .parentPage\").remove();\n }\n }\n\n function setColumnizerArticleWithPageJump(hrs, scrollToHrIndex, moveTopArtOnTop) {\n var articles = [];\n \n $(hrs).each(function (i) {\n var _this = $(this);\n _this.addClass(\"hr\" + i);\n _this.css(\"margin-top\", \"0.8em\");\n _this.css(\"margin-bottom\", \"0.8em\");\n articles.push(_this.prevUntil(\"hr\").get().reverse());\n });\n articles.push(\n $(hrs[hrs.length - 1])\n .nextUntil(\"hr\")\n .get()\n );\n /*columnize all articles separately*/\n var jArticles = $(articles);\n jArticles.each(function(index,article){\n var isLast = index === jArticles.length - 1;\n setColumnizerArticle(index, article, true, scrollToHrIndex, isLast, moveTopArtOnTop)\n });\n }\n\n function setColumnizer(scrollToHrIndex, mergeArt) {\n if ($(\".column\").length > 0) {\n /*already done*/\n return;\n }\n console.log(\"scroll to hr index: \" + scrollToHrIndex);\n console.log(\"using merge art: \" + mergeArt);\n console.log(\"merge art type: \" + (typeof mergeArt));\n var element = $(\"#slideArt\");\n if (!element) {\n console.log(\"missing slideArt\");\n return;\n }\n var moveTopArtOnTop = mergeArt > 0;\n var hrs = element.find(\"hr\");\n if (hrs && hrs.length && mergeArt !== 1) {\n console.log(\"found hr: \" + hrs.length);\n setColumnizerArticleWithPageJump(hrs, scrollToHrIndex, moveTopArtOnTop);\n } else {\n setColumnizerArticle(0, element.children(), false, scrollToHrIndex, false, moveTopArtOnTop);\n }\n }\n \n $(window).resize(function () {\n fixSingleColumnWidth(\".article_body0\");\n });\n"; + var _default = columnizer; + exports.default = _default; +},2183,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EPaperArticleImage = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var EPaperArticleImage = function () { + function EPaperArticleImage() { + (0, _classCallCheck2.default)(this, EPaperArticleImage); + this.biggestImage = false; + this.caption = ""; + this.childArt = false; + this.inline = false; + this.qrCode = false; + } + + (0, _createClass2.default)(EPaperArticleImage, [{ + key: "setUrl", + value: function setUrl(url) { + this.url = url; + } + }, { + key: "getUrl", + value: function getUrl() { + return this.url; + } + }, { + key: "setHrUrl", + value: function setHrUrl(hrUrl) { + this.hrUrl = hrUrl; + } + }, { + key: "getHrUrl", + value: function getHrUrl() { + return this.hrUrl; + } + }, { + key: "setWidth", + value: function setWidth(width) { + this.width = width; + } + }, { + key: "getWidth", + value: function getWidth() { + return this.width; + } + }, { + key: "setHeight", + value: function setHeight(height) { + this.height = height; + } + }, { + key: "getHeight", + value: function getHeight() { + return this.height; + } + }, { + key: "setBiggestImage", + value: function setBiggestImage(isBiggest) { + this.biggestImage = isBiggest; + } + }, { + key: "isBiggestImage", + value: function isBiggestImage() { + return this.biggestImage; + } + }, { + key: "setCaption", + value: function setCaption(caption) { + this.caption = caption ? caption.trim() : ""; + } + }, { + key: "getCaption", + value: function getCaption() { + return this.caption; + } + }, { + key: "setTag", + value: function setTag(tag) { + this.tag = tag; + } + }, { + key: "getTag", + value: function getTag() { + return this.tag; + } + }, { + key: "setChildArt", + value: function setChildArt(isChildArt) { + this.childArt = isChildArt; + } + }, { + key: "setQrCode", + value: function setQrCode(isQrCode) { + this.qrCode = isQrCode; + } + }, { + key: "isChildArt", + value: function isChildArt() { + return this.childArt; + } + }, { + key: "setInline", + value: function setInline(inline) { + this.inline = inline; + } + }, { + key: "isInline", + value: function isInline() { + return this.inline; + } + }, { + key: "isQrCode", + value: function isQrCode() { + return this.qrCode; + } + }]); + return EPaperArticleImage; + }(); + + exports.EPaperArticleImage = EPaperArticleImage; +},2184,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.onLoadFunctions = exports.generateAssetsFontCss = exports.removeWebAdsFromString = exports.getArticleTruncateFunctions = exports.getJumpId = exports.retrieveOffsetByPositionId = exports.retrievePositionIdAtOffset = exports.addPositionId = exports.addLongPressEvent = exports.getHrsPosition = exports.scrollpageToContinue = exports.movePageJumps = exports.moveImages = exports.replaceImgSrcWithBase64 = exports.retrieveImage = exports.saveImage = exports.saveImages = exports.showImageOptions = exports.openGallery = exports.retrieveInnerText = exports.hideNativeAd = exports.showNativeAd = exports.retrieveAdPlaceholders = exports.truncateScript = undefined; + + var _Paywall = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var truncateScript = "\n function truncateArticle(){\n try{\n const hrs = document.getElementsByTagName('hr');\n if(hrs[0]){\n let found = false;\n const parent = hrs[0].parentElement;\n let i = 0;\n while(i < parent.childNodes.length){\n if(parent.childNodes[i] === hrs[0]){\n found = true;\n } else if(!found) {\n i++;\n }\n if(found){\n try{\n console.log(parent.childNodes[i]);\n parent.removeChild(parent.childNodes[i]);\n } catch(e){\n console.log(e.message);\n }\n }\n }\n }\n } catch(e){\n console.log(e.message);\n }\n }\n truncateArticle();"; + exports.truncateScript = truncateScript; + + var retrieveAdPlaceholders = function retrieveAdPlaceholders() { + var enableInStoryAdMarker = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var adMarkerScript = ""; + + if (enableInStoryAdMarker) { + var _global$getActivePSet = global.getActivePSetup(), + inStoryAdMarkerText = _global$getActivePSet.inStoryAdMarkerText; + + adMarkerScript = "\n var nativeAdDisclaimerId = 'native_ad_' + i + '_disclaimer';\n var nativeAdDisclaimer = document.getElementById(nativeAdDisclaimerId);\n if (nativeAdDisclaimer == undefined) {\n var paragraph = document.createElement(\"p\");\n paragraph.setAttribute('id', nativeAdDisclaimerId);\n paragraph.setAttribute('class', 'advp');\n var text = document.createTextNode('" + inStoryAdMarkerText + "');\n paragraph.appendChild(text);\n placeholder.parentNode.insertBefore(paragraph, placeholder);\n }"; + } + + return "\n function getLoadedAds() {\n var ads = [];\n try {\n var nativeAdPlaceholders = document.getElementsByClassName('native_ad');\n for (var i = 0; i < nativeAdPlaceholders.length; i++) {\n var placeholder = nativeAdPlaceholders[i];\n try {\n var config = {\n key: 'native_ad_' + i,\n unitId: placeholder.getAttribute('unitId'),\n provider: placeholder.getAttribute('provider'),\n left: placeholder.getBoundingClientRect().left,\n top: placeholder.getBoundingClientRect().top,\n width: parseInt(placeholder.getAttribute('width'), 10),\n height: parseInt(placeholder.getAttribute('height'), 10)\n };\n placeholder.setAttribute('id', 'native_ad_' + i);\n if (placeholder.parentElement && placeholder.parentElement.className === 'native_ad_container') {\n placeholder.parentElement.setAttribute('id', 'native_ad_' + i + '_container');\n } else {\n " + adMarkerScript + "\n }\n \n ads.push(config);\n } catch (e) {\n console.log(e);\n }\n }\n } catch (e) {\n console.log(e);\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: ads, type: 'GET_NATIVE_ADS_PLACEHOLDER' }));\n }"; + }; + + exports.retrieveAdPlaceholders = retrieveAdPlaceholders; + var showNativeAd = "\n function showNativeAd(id) {\n var nativeAd = document.getElementById(id);\n if (nativeAd) {\n var adHeight = parseInt(nativeAd.getAttribute('height'), 10);\n nativeAd.style.height = adHeight + 'px';\n var nativeAdContainer = document.getElementById(id + '_container');\n if (nativeAdContainer) {\n nativeAdContainer.style.height = adHeight + 10 + 'px';\n var prevElement = nativeAdContainer.previousElementSibling;\n if (prevElement && prevElement.className === \"advp\") {\n prevElement.style.display = 'block';\n }\n }\n }\n }"; + exports.showNativeAd = showNativeAd; + var hideNativeAd = "\n function hideNativeAd(id) {\n var nativeAd = document.getElementById(id);\n if (nativeAd) {\n nativeAd.style.height = '0px';\n var nativeAdContainer = document.getElementById(id + '_container');\n if (nativeAdContainer) {\n nativeAdContainer.style.height = '0px';\n var prevElement = nativeAdContainer.previousElementSibling;\n if (prevElement && prevElement.className === \"advp\") {\n prevElement.style.display = 'none';\n }\n }\n }\n }"; + exports.hideNativeAd = hideNativeAd; + var retrieveInnerText = "\n function() {\n var text = '';\n try {\n text = document.body.innerText;\n } catch (e) {}\n \n return {\n content: text,\n type: 'INNER_TEXT'\n };\n }"; + exports.retrieveInnerText = retrieveInnerText; + var openGallery = "\n function openGallery(url) {\n try {\n console.log(\"open gallery:\" + url);\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: url, type: 'OPEN_GALLERY' }));\n } catch (e) {\n console.log(e);\n }\n }"; + exports.openGallery = openGallery; + var showImageOptions = "\n function showImageOptions(link, imageUrl) {\n try {\n console.log(\"show image options: \" + link + \", image url \"+imageUrl);\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: { link: link, url: imageUrl }, type: 'SHOW_IMAGE_OPTIONS' }));\n } catch (e) {\n console.log(e);\n }\n }"; + exports.showImageOptions = showImageOptions; + var saveImages = "\n function saveImages() {\n try {\n $(\"img[data-save]\").each(function() {\n $(this).one(\"load\", function() {\n eval($(this).data(\"save\"));\n });\n });\n $(\"img[data-retrieve]\").each(function() {\n eval($(this).data(\"retrieve\"));\n }).hide();\n } catch (e) {\n console.log(e);\n }\n }"; + exports.saveImages = saveImages; + var saveImage = "\n function saveImage(img, paper, issue, edition, filename, image, filetime) {\n try {\n console.log(\"save image \" + paper + \" - \" + issue + \" - \" + edition + \" - \" + filename + \" - \" + image + \" - \" + filetime);\n var newImage = new Image();\n newImage.crossOrigin = \"anonymous\";\n\n newImage.onload = function () {\n console.log(\"onload image \" + newImage.width + \" - \" + newImage.height);\n var canvas = document.createElement(\"canvas\");\n canvas.width = newImage.width;\n canvas.height = newImage.height;\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(newImage, 0, 0);\n var dataURL = canvas.toDataURL(\"image/jpeg\", 1);\n console.log(dataURL);\n var base64 = dataURL.replace(/^data:image\\/jpeg;base64,/, \"\");\n \n window.ReactNativeWebView.postMessage(JSON.stringify({ content: { base64: base64, paper: paper, issue: issue, edition: edition, filename: filename, image: image, filetime: filetime}, type: 'SAVE_IMAGE' }));\n };\n\n newImage.src = img.src;\n\n } catch (e) {\n console.log(e);\n }\n }"; + exports.saveImage = saveImage; + var retrieveImage = "\n function retrieveImage(img, paper, issue, edition, filename, image, filetime) {\n try {\n console.log(\"retrieve image \" + paper + \" - \" + issue + \" - \" + edition + \" - \" + filename + \" - \" + image + \" - \" + filetime);\n \n window.ReactNativeWebView.postMessage(JSON.stringify({ content: { imageSrc: img.src, paper: paper, issue: issue, edition: edition, filename: filename, image: image, filetime: filetime}, type: 'RETRIEVE_IMAGE' }));\n } catch (e) {\n console.log(e);\n }\n }"; + exports.retrieveImage = retrieveImage; + var replaceImgSrcWithBase64 = "\nfunction replaceImgSrcWithBase64(src, base64) {\n try { \n var imgTag = $(\"img[src='\"+src+\"']\");\n var newAction = \"javascript:openGallery('\"+base64+\"')\";\n imgTag.parent().attr(\"onclick\", newAction);\n imgTag.attr(\"src\", base64).show();\n } catch (e) {\n console.log(e);\n }\n}"; + exports.replaceImgSrcWithBase64 = replaceImgSrcWithBase64; + + var moveImages = function moveImages(height) { + return "\nfunction moveImages() {\n var imgArtObjs = $(\"div[id^='imgArt']\");\n var abodyObjs = $(\".abody\");\n if(imgArtObjs.length >= 1 && abodyObjs.length > 1){\n for(var imgArtObjIdx = 0; imgArtObjIdx < imgArtObjs.length; imgArtObjIdx++){\n var imgArtObj = $(imgArtObjs[imgArtObjIdx]);\n if (imgArtObj.children().length > 0) {\n for(var abobyObjIdx = 0; abobyObjIdx < abodyObjs.length; abobyObjIdx++){\n var abodyElem = abodyObjs[abobyObjIdx];\n var offset = $(abodyElem).offset();\n var contentHeight = " + height + ";\n if(typeof offset != \"undefined\" && offset.top > (contentHeight * (imgArtObjIdx+1))){\n console.debug(\"abody offset: \"+offset.top+\", content height: \"+contentHeight);\n imgArtObj.insertAfter(abodyElem);\n break;\n }\n }\n }\n }\n }\n}"; + }; + + exports.moveImages = moveImages; + var movePageJumps = "\nfunction movePageJumps() {\n $(\"div[data-pjindex]\").each(function() {\n var index = parseInt($(this).data(\"pjindex\"), 10);\n if (index > 0) {\n var prevHr = $(\"#ArtADD\"+(index -1)+\" + hr\");\n if (prevHr) {\n prevHr.after(this);\n }\n }\n });\n}"; + exports.movePageJumps = movePageJumps; + var scrollpageToContinue = "\n function scrollpageToContinue(pageNumber, artid) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: {page: pageNumber, xmlId: artid}, type: 'SCROLL_TO_PAGE' }));\n }"; + exports.scrollpageToContinue = scrollpageToContinue; + var getHrsPosition = "\n function getHrsPosition(){\n var positions = [];\n var hrsTag = document.getElementsByTagName(\"hr\");\n for(var i = 0; i < hrsTag.length; i++){\n positions.push(hrsTag[i].offsetTop);\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: positions, type: 'HRS_POSITION' }));\n }\n"; + exports.getHrsPosition = getHrsPosition; + var addLongPressEvent = "\n var body = document.body;\n var longPressMs = 500;\n var longPressTimeout = undefined;\n var onStart = function () {\n console.log('touch start');\n if (longPressTimeout) {\n clearTimeout(longPressTimeout);\n longPressTimeout = undefined;\n }\n longPressTimeout = setTimeout(function () {\n console.log('long touch');\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'LONG_PRESS' }));\n }, longPressMs);\n };\n var onEnd = function () {\n console.log('touch end');\n if (longPressTimeout) {\n clearTimeout(longPressTimeout);\n longPressTimeout = undefined;\n }\n };\n if (body) {\n body.addEventListener('touchstart', onStart);\n body.addEventListener('mousedown', onStart);\n body.addEventListener('touchend', onEnd);\n body.addEventListener('mouseup', onEnd);\n }"; + exports.addLongPressEvent = addLongPressEvent; + var addPositionId = "\n var positionId;\n $(\"#slideArt p\").toArray().forEach((elem, index) => {\n $(elem).attr(\"positionid\", index);\n $(elem).children().toArray().forEach((child, childIndex) => {\n $(child).attr(\"positionid\", index+\".\"+childIndex);\n });\n }\n );\n"; + exports.addPositionId = addPositionId; + var retrievePositionIdAtOffset = "\n function getPositionId(x, y) {\n try {\n var offsetX = 0;\n var width = $(\"#slideArt\").width();\n var columns = $(\".article_body0 .column\").length;\n if (columns > 0) {\n offsetX = width / (columns * 2);\n } else {\n offsetX = width/2;\n }\n var currentPositionId = document.elementFromPoint(x + offsetX, y).getAttribute(\"positionid\");\n if (currentPositionId !== null) {\n positionId = currentPositionId;\n }\n } catch (e) {\n console.log(e);\n }\n if (positionId) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: { positionId: positionId }, type: 'GET_POSITION_ID' }));\n }\n };\n"; + exports.retrievePositionIdAtOffset = retrievePositionIdAtOffset; + var retrieveOffsetByPositionId = "\n function goToPositionId(positionId) {\n var top = 0;\n var left = 0;\n try {\n var offset = $(\"[positionId='\"+positionId+\"']\").position();\n top = offset.top;\n left = offset.left;\n } catch (e) {\n console.log(e);\n }\n window.ReactNativeWebView.postMessage(JSON.stringify({ content: { offset: { left: left, top: top } }, type: 'GET_POSITION_ID_OFFSET' }));\n };\n"; + exports.retrieveOffsetByPositionId = retrieveOffsetByPositionId; + var getJumpId = "\n function art_getJumpId(page, issue, filename, xmlId) {\n try {\n if (window.ReactNativeWebView) {\n window.ReactNativeWebView.postMessage(\n JSON.stringify({\n page,\n issue,\n filename,\n xmlId,\n type: 'JUMP'\n })\n );\n }\n } catch (e) {\n console.error(e.message);\n }\n }"; + exports.getJumpId = getJumpId; + + var getArticleTruncateFunctions = function getArticleTruncateFunctions() { + if (_Paywall.default.shouldAppendPaywall()) { + return "\n var ta_truncateArticle = function ta_truncateArticle(threshold) {\n var ta_protectThreshold = ''+threshold;\n var ta_protectParentSelector = '#content';\n if (parseInt(ta_protectThreshold, 10) >= 0 && ta_protectParentSelector && document.querySelector) {\n var parentToProtect = document.querySelector(ta_protectParentSelector);\n if (parentToProtect == null) return;\n var styleTagsToAppend = [];\n var styleTags = parentToProtect.getElementsByTagName('STYLE');\n for (var i=0; i < styleTags.length; i++) {\n var styleTag = styleTags[i].cloneNode(true); \n styleTagsToAppend.push(styleTag); \n }\n \n var nodeToFill = parentToProtect.cloneNode(false);\n \n if (ta_protectThreshold.indexOf('%') > 0) {\n ta_protectThreshold = ta_protectThreshold.substr(0, ta_protectThreshold.length - 1);\n ta_protectThreshold = parseInt(ta_protectThreshold, 10);\n if (ta_protectThreshold > 100 || ta_protectThreshold < 0) {\n ta_protectThreshold = 100;\n }\n var ta_protectArticleLength = ta_articleTextCount(parentToProtect);\n ta_protectThreshold = parseInt((ta_protectThreshold / 100) * ta_protectArticleLength, 10);\n } else {\n ta_protectThreshold = parseInt(ta_protectThreshold, 10);\n }\n\n if (ta_protectThreshold > 0) {\n ta_fillThreshold(parentToProtect, nodeToFill, ta_protectThreshold);\n parentToProtect.innerHTML = nodeToFill.innerHTML;\n } else {\n parentToProtect.innerHTML = '';\n }\n for (var i=0; i < styleTagsToAppend.length; i++) {\n var styleTagToAppend = styleTagsToAppend[i]; \n parentToProtect.appendChild(styleTagToAppend);\n }\n }\n };\n\n var ta_elementThresholdExempt = function ta_elementThresholdExempt(elementNode) {\n var tagsToExclude = 'style';\n if (tagsToExclude.length > 0) {\n var tagsExcludeArray = tagsToExclude.split(',');\n for (var j = 0; j < tagsExcludeArray.length; j++) {\n if (elementNode.tagName && elementNode.tagName.toLowerCase() === tagsExcludeArray[j].trim().toLowerCase()) {\n return true;\n }\n }\n }\n if (typeof elementNode.className === 'string' && elementNode.className.length > 0) {\n var classesToExclude = '';\n if (classesToExclude.length > 0) {\n var excludeArray = classesToExclude.split(',');\n for (var j = 0; j < excludeArray.length; j++) {\n if (\n excludeArray[j].trim() !== '' &&\n elementNode.className.split(/ +/).indexOf(excludeArray[j].trim()) !== -1\n ) {\n return true;\n }\n }\n }\n }\n \n return false;\n };\n \n var ta_fillThreshold = function ta_fillThreshold(originalNode, nodeToFill, threshold, otherNodeToFill) {\n var preserveImages = false;\n if (originalNode.childNodes && originalNode.childNodes.length > 0) {\n for (var i = 0; i < originalNode.childNodes.length; i++) {\n var newNodeToFill = otherNodeToFill || null;\n if (ta_elementThresholdExempt(originalNode.childNodes[i])) { \n continue;\n } \n \n if (\n originalNode.childNodes[i].nodeType == Node.ELEMENT_NODE &&\n originalNode.childNodes[i].childNodes &&\n originalNode.childNodes[i].childNodes.length > 0\n ) {\n newNodeToFill = originalNode.childNodes[i].cloneNode(false);\n (otherNodeToFill || nodeToFill).appendChild(newNodeToFill);\n }\n var finished = ta_fillThreshold(originalNode.childNodes[i], nodeToFill, threshold, newNodeToFill) || 0;\n if (finished) return 1;\n }\n return 0;\n }\n if (originalNode.nodeType == Node.TEXT_NODE || originalNode.nodeType == Node.ELEMENT_NODE) {\n var innerHTML = '';\n if (originalNode.innerHTML) {\n innerHTML = originalNode.innerHTML.trim();\n } else if (originalNode.nodeValue) {\n innerHTML = originalNode.nodeValue.trim();\n } else if (!preserveImages && originalNode.nodeName.toLowerCase() == 'img') {\n return 0;\n }\n \n var allowedEmptyTags = ['IMG', 'HR', 'BR'];\n if (!innerHTML.length && allowedEmptyTags.indexOf(originalNode.nodeName) == -1) return 0; \n \n var nodeToFillLength = nodeToFill.innerText.length;\n if (!otherNodeToFill && originalNode.nodeType == Node.TEXT_NODE) {\n var newPNode = document.createElement('p');\n otherNodeToFill = newPNode;\n nodeToFill.appendChild(newPNode);\n }\n if (nodeToFillLength + innerHTML.length < threshold) {\n (otherNodeToFill || nodeToFill).appendChild(originalNode.cloneNode(true));\n return 0;\n }\n if (nodeToFillLength + innerHTML.length >= threshold) {\n var origIHLength = nodeToFillLength;\n var newChild = (otherNodeToFill || nodeToFill).appendChild(originalNode.cloneNode(true));\n if (innerHTML.indexOf(' ', threshold - origIHLength) !== -1) {\n innerHTML = innerHTML.substring(0, innerHTML.indexOf(' ', threshold - origIHLength));\n }\n if (innerHTML.slice(-3) != '...') {\n innerHTML += '...';\n }\n newChild.innerHTML = innerHTML;\n newChild.nodeValue = innerHTML;\n var protectArticleMessagePNode = document.createElement('p');\n protectArticleMessagePNode.innerHTML = '" + _Paywall.default.getArticlePreviewMessage() + "';\n nodeToFill.appendChild(protectArticleMessagePNode);\n return 1;\n }\n return 0;\n }\n return 0;\n };\n\n var ta_articleTextCount = function ta_articleTextCount(originalNode) {\n var currentLength = 0;\n if (originalNode.childNodes && originalNode.childNodes.length > 0) {\n for (var i = 0; i < originalNode.childNodes.length; i++) {\n if (ta_elementThresholdExempt(originalNode.childNodes[i])) continue;\n var newLength = ta_articleTextCount(originalNode.childNodes[i]) || 0;\n currentLength += newLength;\n }\n } else if (originalNode.nodeType == Node.TEXT_NODE || originalNode.nodeType == Node.ELEMENT_NODE) {\n if (originalNode.innerHTML) {\n currentLength = originalNode.innerHTML.trim().length;\n } else if (originalNode.nodeValue) {\n currentLength = originalNode.nodeValue.trim().length;\n }\n }\n return currentLength; \n };"; + } + + return ""; + }; + + exports.getArticleTruncateFunctions = getArticleTruncateFunctions; + + var removeWebAdsFromString = function removeWebAdsFromString(html) { + var regExp = new RegExp(/
([\s\S]*?)<\/div>/g); + var m; + var found = []; + + while ((m = regExp.exec(html)) !== null) { + if (m.index === regExp.lastIndex) { + regExp.lastIndex += 1; + } + + found.push(m[1]); + } + + found.forEach(function (str) { + html = html.replace(str + "
", ""); + }); + return html; + }; + + exports.removeWebAdsFromString = removeWebAdsFromString; + + var getFontFaceStringFromFont = function getFontFaceStringFromFont(font) { + var weight = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + var fontWeb = font.fontWeb, + src = font.src; + var fontFamily = font.fontFamily, + fontWeight = font.fontWeight; + fontFamily = fontFamily || fontWeb; + fontWeight = weight || fontWeight || "normal"; + var fontFace = "\n @font-face {\n font-family: '" + fontFamily + "';\n font-weight: " + fontWeight + ";\n src: " + src + ";\n }\n "; + return fontFace; + }; + + var generateAssetsFontCss = function generateAssetsFontCss(fontFamilyRegular, fontFamilyBold, dynamicFonts) { + var fontCSS = ""; + + if (fontFamilyRegular && fontFamilyRegular.src) { + fontCSS += getFontFaceStringFromFont(fontFamilyRegular, "normal"); + + if (fontFamilyBold && fontFamilyBold.src && fontFamilyBold.fontWeb !== fontFamilyRegular.fontWeb) { + fontCSS += getFontFaceStringFromFont(fontFamilyBold, "bold"); + } + } else if (fontFamilyBold && fontFamilyBold.src) { + fontCSS += getFontFaceStringFromFont(fontFamilyBold, "bold"); + } + + if (dynamicFonts) { + dynamicFonts.forEach(function (dynamicFont) { + if (dynamicFont) { + var fontWeb = dynamicFont.fontWeb; + + if (!(fontFamilyRegular && fontFamilyRegular.fontWeb === fontWeb || fontFamilyBold && fontFamilyBold.fontWeb === fontWeb)) { + fontCSS += getFontFaceStringFromFont(dynamicFont); + } + } + }); + } + + return fontCSS; + }; + + exports.generateAssetsFontCss = generateAssetsFontCss; + + var onLoadFunctions = function onLoadFunctions(hasColumnizer, enableTruncate) { + var truncate = ""; + var columnizer = ""; + + if (hasColumnizer) { + columnizer = "$('#content').columnize({ width: 400, doneFunc: getLoadedAds });"; + } + + if (_Paywall.default.needToAppendHardPaywall() || _Paywall.default.shouldAppendPaywallPopup() && enableTruncate) { + var articlePreviewLength = _Paywall.default.getArticlePreviewLength(); + + truncate = "ta_truncateArticle('" + articlePreviewLength + "');"; + } + + return "$(function(){" + truncate + columnizer + "});"; + }; + + exports.onLoadFunctions = onLoadFunctions; +},2185,[5,1862]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DEFAULT_CSS = exports.NO_ARTICLE_TEXT_SELECTION_CSS = undefined; + + var NO_ARTICLE_TEXT_SELECTION_CSS = function NO_ARTICLE_TEXT_SELECTION_CSS() { + var enableArticleTextSelection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var css = ""; + + if (!enableArticleTextSelection) { + css = "\n #slideArt, #manualIndex {\n -webkit-user-select: none;\n } "; + } + + return css; + }; + + exports.NO_ARTICLE_TEXT_SELECTION_CSS = NO_ARTICLE_TEXT_SELECTION_CSS; + + var DEFAULT_CSS = function DEFAULT_CSS(fontFamilyRegular, fontFamilyBold) { + var enableArticleTextSelection = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + var ignoreTheme = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var hrBylineStyle = ""; + + var _global$getActivePSet = global.getActivePSetup(), + enableArticleBylineHRs = _global$getActivePSet.enableArticleBylineHRs; + + if (enableArticleBylineHRs) { + hrBylineStyle = "\n hr.hrbyline {\n height: 1px;\n border-width: 0;\n }\n\n hr.hrbylinetop {\n margin-top: 20px;\n background-color: #8b8b8b36;\n }\n\n hr.hrbylinebottom {\n margin-bottom: 20px;\n background-color: #adacac36;\n }\n "; + } + + var foregroundColor = _$$_REQUIRE(_dependencyMap[0]).Css.isDarkTheme() && !ignoreTheme ? _$$_REQUIRE(_dependencyMap[0]).Css.getDefaultForegroundColor() : "#333333"; + var translateStyle = "\n #image_div_translation {\n padding: 5px 0 !important;\n }"; + + if (_$$_REQUIRE(_dependencyMap[0]).Css.isDarkTheme() && !ignoreTheme) { + translateStyle += "\n #image_div_translation {\n background-color: " + _$$_REQUIRE(_dependencyMap[0]).Css.getDefaultBackgroundColor() + " !important;\n }"; + } + + var serifFonts = fontFamilyRegular + ", Georgia, \"Times New Roman\", Times, serif !important"; + var serifBoldFonts = fontFamilyBold + ", Georgia, \"Times New Roman\", Times, serif !important"; + var sansSerifFonts = fontFamilyRegular + ", Arial, Helvetica, sans-serif, Georgia !important"; + var css = "\n * {\n font-family: " + fontFamilyRegular + " !important;\n }\n body {\n margin: 0;\n }\n #content {\n padding: 8px;\n }\n a {\n word-wrap: break-word;\n }\n img {\n max-width: 100%;\n height: auto;\n }\n #categoryType{\n font-size: 20px;\n margin-top: 15px;\n }\n .abody, .paragraph, .advp, .native_ad_container {\n padding: 0px 5px 0px 5px;\n }\n .abody {\n font-size: 1.1em;\n margin-top: 10px;\n color: " + foregroundColor + ";\n font-weight: normal;\n line-height: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n .titles {\n font-size: 20px;\n padding: 5px;\n color: #0069B1;\n font-weight: bold;\n z-index: 10;\n }\n .pagetitles.titles {\n font-size: 1.1em;\n line-height: normal;\n color: #0069B1;\n z-index: 10;\n font-weight: normal;\n font-style: normal;\n }\n * {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n }\n #slideArt{\n color: " + foregroundColor + ";\n line-height: normal;\n " + (_$$_REQUIRE(_dependencyMap[1]).PlatformUtils.isTablet() ? "padding: 0 8px;" : "") + "\n }\n #slideArt .subtitle{\n margin-left: 5px;\n margin-right: 5px;\n margin-top: 10px;\n } \n #slideArt .uptitle, #slideArt .byline, #slideArt p img, #slideArt a {\n margin: 0 5px;\n }\n\n #slideArt p.imgContainer {\n display: inline;\n }\n\n /** fix to center images when columnizer is on */\n #slideArt .column p.imgContainer {\n margin: 0 5px;\n display: block;\n } \n \n #slideArt .column p.imgContainer img {\n margin: 0 auto;\n display: block;\n }\n\n #slideArt a.pageJumpRef {\n margin: 0;\n }\n\n #textContent {\n background-color: #FFFFFF;\n font-family: " + sansSerifFonts + ";\n font-size: 14px;\n font-weight: normal;\n padding: 5px;\n overflow: hidden;\n }\n .maintitle {\n font-size: 2em;\n margin: 0 5px;\n padding: 5px 0px 5px 0px;\n color: #2A719C;\n font-weight: normal;\n line-height : 1.2;\n font-family: " + serifFonts + ";\n }\n .uptitle, .subtitle {\n font-size: 1.2em;\n font-weight: normal;\n font-family: " + serifFonts + ";\n line-height : 1.2;\n }\n .firstindexsection {\n font-size: 1.1em;\n line-height: normal;\n color: #CC0000;\n z-index: 10;\n font-weight: normal;\n font-family: " + serifFonts + ";\n }\n .firstindexarticle {\n font-size: 1.1em;\n line-height: normal;\n color: #0069B1;\n z-index: 10;\n font-weight: normal;\n font-family: " + serifFonts + ";\n }\n .pageref {\n font-size: 1.1em;\n line-height: normal;\n color: " + foregroundColor + ";\n text-decoration: none;\n z-index: 10;\n font-weight: bold;\n font-family: " + serifBoldFonts + ";\n }\n .pagerefart {\n font-size: 16px;\n line-height: 25px;\n color: " + foregroundColor + ";\n text-decoration: none;\n z-index: 10;\n font-weight: bold;\n font-family: " + serifBoldFonts + ";\n }\n .pagerefart:hover {\n text-decoration: underline;\n }\n .swipe {\n z-index: 1;\n overflow: hidden;\n width: 200%;\n visibility: hidden;\n position: relative;\n z-index: 100;\n }\n .swipe-wrap {\n z-index: 1;\n overflow: hidden;\n width: 50%;\n position: relative;\n }\n .swipe-wrap > div {\n z-index: 1;\n float: left;\n width: 50%;\n position: relative;\n }\n #poweredby a, #copyright a{\n color: #000000;\n text-decoration: none;\n }\n #poweredby{\n width: 50%;\n float: left;\n }\n #copyright {\n width: 50%;\n float: left;\n text-align: right;\n }\n div#titlesCont i {\n font-weight: normal;\n }\n div#scrollMergeADD {\n text-align: center;\n }\n .pjFromPageMergeArt3{\n color: blue;\n }\n div.pageJumpMergeArt3 {\n text-align: right;\n border-bottom: 0px;\n }\n .column div.pageJumpMergeArt3 {\n display: inline;\n text-align: center;\n }\n div.pageJumpContainer {\n display: inline-block;\n }\n div.pageJumpSlug {\n text-align: center;\n }\n .pageJumpMergeArt3 span.pjFromPage{\n font-weight: bold;\n }\n a.pageJumpRef {\n font-weight: bold;\n color: blue;\n text-decoration: none;\n }\n .column .imgArt {\n position: relative;\n text-align: center;\n margin-top: 15px;\n margin-bottom: 10px;\n }\n .img-parent {\n text-align: center;\n }\n .div-column {\n padding: 0 5px 0 0;\n margin-right: 15px;\n }\n .hr {\n border-top: 1px solid;\n padding-bottom: 3px;\n margin-top: 10px;\n margin-bottom: 10px;\n }\n .caption {\n font-style: italic;\n }\n p.maintitleChild span {\n color: #093d72; \n font-family: " + serifFonts + "; \n font-weight: bold !important;\n line-height: 1.1em;\n padding:0px 10px 0px 10px;\n }\n \n .subtitleChild {\n font-size: 1em !important;\n line-height: normal !important;\n color: #666;\n margin-top: 5px;\n font-family: " + serifFonts + "\n }\n \n .article_body::after{\n content: \"\";\n display: block;\n clear: both;\n }\n\n " + translateStyle + "\n \n " + hrBylineStyle; + css += NO_ARTICLE_TEXT_SELECTION_CSS(enableArticleTextSelection); + return css; + }; + + exports.DEFAULT_CSS = DEFAULT_CSS; +},2186,[699,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.retrieveArticleImage = exports.storeArticleImage = exports.extractLinks = exports.addInStoryAdsToHtml = exports.decodeArticleId = exports.getArticleId = exports.readCustomCss = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _InStoryAd = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var readCustomCss = function _callee() { + var filesString, + files, + basePath, + customCss, + i, + _args = arguments; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + filesString = _args.length > 0 && _args[0] !== undefined ? _args[0] : ""; + files = filesString.split(","); + basePath = _tecnaviaFileUtils.default.getApplicationBaseDirectory() + "hybrid/css"; + customCss = ""; + i = 0; + + case 5: + if (!(i < files.length)) { + _context.next = 19; + break; + } + + _context.prev = 6; + _context.t0 = customCss; + _context.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFile(basePath + "/" + files[i] + ".css")); + + case 10: + _context.t1 = _context.sent; + customCss = _context.t0.concat.call(_context.t0, _context.t1); + _context.next = 16; + break; + + case 14: + _context.prev = 14; + _context.t2 = _context["catch"](6); + + case 16: + i++; + _context.next = 5; + break; + + case 19: + return _context.abrupt("return", customCss); + + case 20: + case "end": + return _context.stop(); + } + } + }, null, null, [[6, 14]], Promise); + }; + + exports.readCustomCss = readCustomCss; + + var getArticleId = function getArticleId(article) { + var articleId = article.getPageId() * 1000 + article.getXmlId(); + return articleId; + }; + + exports.getArticleId = getArticleId; + + var decodeArticleId = function decodeArticleId(articleIdString) { + var articleId = parseInt(articleIdString, 10); + var pageId = Math.floor(articleId / 1000); + var xmlId = articleId % 1000; + return { + pageId: pageId, + xmlId: xmlId + }; + }; + + exports.decodeArticleId = decodeArticleId; + + var addInStoryAd = function addInStoryAd(html, tagId, ad, isOnline) { + var bottomAdAtLast = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true; + var modifiers = "gm"; + var endRegExp = ""; + + if (ad) { + var adType = ad.getType(); + + if (_InStoryAd.InStoryAdType.TOP.includes(adType) || _InStoryAd.InStoryAdType.MIDDLE.includes(adType) || !bottomAdAtLast) { + modifiers = "m"; + } else if (_InStoryAd.InStoryAdType.BOTTOM.includes(adType)) { + endRegExp = "*$"; + } + } + + var instoryAdRegExp = "

|>

)"; + var regExp = new RegExp("" + instoryAdRegExp + endRegExp, modifiers); + var match = html.match(regExp); + + if (ad && match) { + var newParent; + var adTag; + var marginHorizontal = 10; + var marginVertical = 5; + var modifiedHeight = parseInt(ad.getHeight(), 10) + 10; + var modifiedWidth = parseInt(ad.getWidth(), 10) + 20; + var adUrl = ad.getUrl(); + var adUnitId = ad.getUnitId(); + var alignment = ad.getAlignment(); + var alignmentStyleContainer = ""; + var alignmentStyle = "margin-top: 5"; + + switch (alignment) { + case _InStoryAd.InStoryAdAlign.LEFT: + alignmentStyleContainer = "width: " + modifiedWidth + "; float: left"; + alignmentStyle += "; float: left"; + break; + + case _InStoryAd.InStoryAdAlign.CENTER: + alignmentStyleContainer = "text-align: center"; + break; + + case _InStoryAd.InStoryAdAlign.RIGHT: + alignmentStyleContainer = "width: " + modifiedWidth + "; float: right"; + alignmentStyle += "; float: right"; + break; + + case _InStoryAd.InStoryAdAlign.UNSET: + default: + alignmentStyleContainer = "text-align: center"; + break; + } + + var adMarker = ""; + + var _global$getActivePSet = global.getActivePSetup(), + enableInStoryAdMarker = _global$getActivePSet.enableInStoryAdMarker, + inStoryAdMarkerText = _global$getActivePSet.inStoryAdMarkerText; + + if (enableInStoryAdMarker && inStoryAdMarkerText) { + adMarker = "

" + inStoryAdMarkerText + "

"; + } + + if (adUrl) { + adTag = ""; + newParent = adMarker + "

" + adTag + "

"; + } else if (adUnitId) { + var provider = ad.getProvider(); + newParent = "\n " + adMarker + "\n
\n \n
\n
"; + } + + html = html.replace(regExp, newParent); + } + + var remainingRegExp = new RegExp("" + instoryAdRegExp, "gm"); + html = html.replace(remainingRegExp, ""); + return html; + }; + + var addInStoryAdsToHtml = function addInStoryAdsToHtml(html, imagesPresent) { + var isOnline = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + var bottomAdAtLast = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; + var adsConfig = global.getAdsConfig(); + var instoryTop = adsConfig.getInStoryAdTop(); + var instoryMiddle = adsConfig.getInStoryAdMiddle(); + var instoryBottom = adsConfig.getInStoryAdBottom(); + var newHtml = addInStoryAd(html, "articleAds_top", instoryTop, isOnline); + + if (!imagesPresent) { + if (instoryMiddle) { + instoryMiddle.setType("instory_bottom"); + newHtml = addInStoryAd(newHtml, "articleAds_bot", instoryMiddle, isOnline, bottomAdAtLast); + } else { + newHtml = addInStoryAd(newHtml, "articleAds_bot", instoryBottom, isOnline, bottomAdAtLast); + } + } else { + newHtml = addInStoryAd(newHtml, "articleAds_mid", instoryMiddle, isOnline); + newHtml = addInStoryAd(newHtml, "articleAds_bot", instoryBottom, isOnline, bottomAdAtLast); + } + + return newHtml; + }; + + exports.addInStoryAdsToHtml = addInStoryAdsToHtml; + + var isLinkValid = function isLinkValid(linkFound, pretext) { + if (linkFound.search("@") > -1) { + return false; + } + + if (linkFound.charAt(0) === "/") { + return false; + } + + if (linkFound.charAt(0) === "." || linkFound.search(/\.{2,}/g) > -1) { + return false; + } + + if (linkFound.search(/newsmem.+\.jpg/g) > -1) { + return false; + } + + var idx = pretext.search(/src\s*=/g); + var idx2 = pretext.search(/alt\s*=/g); + var idx3 = pretext.search(/title\s*=/g); + var idx4 = pretext.search(/myonclick\s*=/g); + var l = pretext.length; + + if (idx > -1 && l - idx < 10 || idx2 > -1 && l - idx2 < 10 || idx3 > -1 && l - idx3 < 10 || idx4 > -1 && pretext.substring(idx4).startsWith("myonclick") || pretext.endsWith("href='") || pretext.endsWith('href="')) { + return false; + } + + return true; + }; + + var extractLinks = function extractLinks(textToShow) { + var text = textToShow; + var newText = []; + var linkFound = ""; + var startLink = 0; + var endLink = 0; + var pretext = ""; + + for (var i = 0; i < 40; i++) { + pretext = ""; + linkFound = ""; + startLink = 0; + endLink = 0; + startLink = text.search(/\.(com|eu|edu|org|net|tv|ch|it|biz|gov|mil|nl|de|at|ag|info|ca|fr|uk|ac|au|ky|be|bm|bz|cn|coop|es|eg|hk|in|int|jobs|jp|museum|mx|name|nato|nom|pro|ru|sg|store|tr|tw|travel|web|dk|us|tk|li|co|ly|am|me|cc|ie|va|no|se|fi|global|la|gl|sk|lt|ua|community|expert|restaurant|cl|ltd|ba|aero)([^a-z0-9]|$)/i); + + if (startLink === -1) { + newText.push(text); + break; + } + + for (var j = startLink; j >= 0; j--) { + if (text.charAt(j).search(/[a-z0-9.\-_/:@]/i) === -1) { + startLink = j + 1; + break; + } + + startLink = 0; + } + + newText.push(text.substring(0, startLink)); + pretext = text.substring(0, startLink); + text = text.substring(startLink); + endLink = text.search(/\.?(\ |,|\.$|\)|<|&.{0,6};|'|")/i); + + if (endLink === -1) { + endLink = text.length; + } + + linkFound = text.substring(0, endLink); + + if (isLinkValid(linkFound, pretext)) { + linkFound = linkFound.replace(/\n/g, ""); + newText.push("" + linkFound + ""); + } else { + newText.push(linkFound); + } + + text = text.substring(endLink); + } + + return newText.join(""); + }; + + exports.extractLinks = extractLinks; + + var storeArticleImage = function _callee2(base64, paper, issue, filename, imageName) { + var imagePath; + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + imagePath = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + filename + "/" + imageName; + _context2.prev = 1; + _context2.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.write(imagePath, base64, "base64")); + + case 4: + _context2.next = 8; + break; + + case 6: + _context2.prev = 6; + _context2.t0 = _context2["catch"](1); + + case 8: + case "end": + return _context2.stop(); + } + } + }, null, null, [[1, 6]], Promise); + }; + + exports.storeArticleImage = storeArticleImage; + + var retrieveArticleImage = function _callee3(paper, issue, filename, imageName) { + var image, imagePath; + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + imagePath = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + filename + "/" + imageName; + _context3.prev = 1; + _context3.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFileBase64(imagePath)); + + case 4: + image = _context3.sent; + _context3.next = 9; + break; + + case 7: + _context3.prev = 7; + _context3.t0 = _context3["catch"](1); + + case 9: + return _context3.abrupt("return", image); + + case 10: + case "end": + return _context3.stop(); + } + } + }, null, null, [[1, 7]], Promise); + }; + + exports.retrieveArticleImage = retrieveArticleImage; +},2187,[5,80,710,574,640,2017,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.columnizerBase64 = exports.letteringBase64 = exports.jQueryBase64 = undefined; + var jQueryBase64 = "LyohIGpRdWVyeSB2My41LjEgfCAoYykgSlMgRm91bmRhdGlvbiBhbmQgb3RoZXIgY29udHJpYnV0b3JzIHwganF1ZXJ5Lm9yZy9saWNlbnNlICovCiFmdW5jdGlvbihlLHQpeyJ1c2Ugc3RyaWN0Ijsib2JqZWN0Ij09dHlwZW9mIG1vZHVsZSYmIm9iamVjdCI9PXR5cGVvZiBtb2R1bGUuZXhwb3J0cz9tb2R1bGUuZXhwb3J0cz1lLmRvY3VtZW50P3QoZSwhMCk6ZnVuY3Rpb24oZSl7aWYoIWUuZG9jdW1lbnQpdGhyb3cgbmV3IEVycm9yKCJqUXVlcnkgcmVxdWlyZXMgYSB3aW5kb3cgd2l0aCBhIGRvY3VtZW50Iik7cmV0dXJuIHQoZSl9OnQoZSl9KCJ1bmRlZmluZWQiIT10eXBlb2Ygd2luZG93P3dpbmRvdzp0aGlzLGZ1bmN0aW9uKEMsZSl7InVzZSBzdHJpY3QiO3ZhciB0PVtdLHI9T2JqZWN0LmdldFByb3RvdHlwZU9mLHM9dC5zbGljZSxnPXQuZmxhdD9mdW5jdGlvbihlKXtyZXR1cm4gdC5mbGF0LmNhbGwoZSl9OmZ1bmN0aW9uKGUpe3JldHVybiB0LmNvbmNhdC5hcHBseShbXSxlKX0sdT10LnB1c2gsaT10LmluZGV4T2Ysbj17fSxvPW4udG9TdHJpbmcsdj1uLmhhc093blByb3BlcnR5LGE9di50b1N0cmluZyxsPWEuY2FsbChPYmplY3QpLHk9e30sbT1mdW5jdGlvbihlKXtyZXR1cm4iZnVuY3Rpb24iPT10eXBlb2YgZSYmIm51bWJlciIhPXR5cGVvZiBlLm5vZGVUeXBlfSx4PWZ1bmN0aW9uKGUpe3JldHVybiBudWxsIT1lJiZlPT09ZS53aW5kb3d9LEU9Qy5kb2N1bWVudCxjPXt0eXBlOiEwLHNyYzohMCxub25jZTohMCxub01vZHVsZTohMH07ZnVuY3Rpb24gYihlLHQsbil7dmFyIHIsaSxvPShuPW58fEUpLmNyZWF0ZUVsZW1lbnQoInNjcmlwdCIpO2lmKG8udGV4dD1lLHQpZm9yKHIgaW4gYykoaT10W3JdfHx0LmdldEF0dHJpYnV0ZSYmdC5nZXRBdHRyaWJ1dGUocikpJiZvLnNldEF0dHJpYnV0ZShyLGkpO24uaGVhZC5hcHBlbmRDaGlsZChvKS5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKG8pfWZ1bmN0aW9uIHcoZSl7cmV0dXJuIG51bGw9PWU/ZSsiIjoib2JqZWN0Ij09dHlwZW9mIGV8fCJmdW5jdGlvbiI9PXR5cGVvZiBlP25bby5jYWxsKGUpXXx8Im9iamVjdCI6dHlwZW9mIGV9dmFyIGY9IjMuNS4xIixTPWZ1bmN0aW9uKGUsdCl7cmV0dXJuIG5ldyBTLmZuLmluaXQoZSx0KX07ZnVuY3Rpb24gcChlKXt2YXIgdD0hIWUmJiJsZW5ndGgiaW4gZSYmZS5sZW5ndGgsbj13KGUpO3JldHVybiFtKGUpJiYheChlKSYmKCJhcnJheSI9PT1ufHwwPT09dHx8Im51bWJlciI9PXR5cGVvZiB0JiYwPHQmJnQtMSBpbiBlKX1TLmZuPVMucHJvdG90eXBlPXtqcXVlcnk6Zixjb25zdHJ1Y3RvcjpTLGxlbmd0aDowLHRvQXJyYXk6ZnVuY3Rpb24oKXtyZXR1cm4gcy5jYWxsKHRoaXMpfSxnZXQ6ZnVuY3Rpb24oZSl7cmV0dXJuIG51bGw9PWU/cy5jYWxsKHRoaXMpOmU8MD90aGlzW2UrdGhpcy5sZW5ndGhdOnRoaXNbZV19LHB1c2hTdGFjazpmdW5jdGlvbihlKXt2YXIgdD1TLm1lcmdlKHRoaXMuY29uc3RydWN0b3IoKSxlKTtyZXR1cm4gdC5wcmV2T2JqZWN0PXRoaXMsdH0sZWFjaDpmdW5jdGlvbihlKXtyZXR1cm4gUy5lYWNoKHRoaXMsZSl9LG1hcDpmdW5jdGlvbihuKXtyZXR1cm4gdGhpcy5wdXNoU3RhY2soUy5tYXAodGhpcyxmdW5jdGlvbihlLHQpe3JldHVybiBuLmNhbGwoZSx0LGUpfSkpfSxzbGljZTpmdW5jdGlvbigpe3JldHVybiB0aGlzLnB1c2hTdGFjayhzLmFwcGx5KHRoaXMsYXJndW1lbnRzKSl9LGZpcnN0OmZ1bmN0aW9uKCl7cmV0dXJuIHRoaXMuZXEoMCl9LGxhc3Q6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5lcSgtMSl9LGV2ZW46ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5wdXNoU3RhY2soUy5ncmVwKHRoaXMsZnVuY3Rpb24oZSx0KXtyZXR1cm4odCsxKSUyfSkpfSxvZGQ6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5wdXNoU3RhY2soUy5ncmVwKHRoaXMsZnVuY3Rpb24oZSx0KXtyZXR1cm4gdCUyfSkpfSxlcTpmdW5jdGlvbihlKXt2YXIgdD10aGlzLmxlbmd0aCxuPStlKyhlPDA/dDowKTtyZXR1cm4gdGhpcy5wdXNoU3RhY2soMDw9biYmbjx0P1t0aGlzW25dXTpbXSl9LGVuZDpmdW5jdGlvbigpe3JldHVybiB0aGlzLnByZXZPYmplY3R8fHRoaXMuY29uc3RydWN0b3IoKX0scHVzaDp1LHNvcnQ6dC5zb3J0LHNwbGljZTp0LnNwbGljZX0sUy5leHRlbmQ9Uy5mbi5leHRlbmQ9ZnVuY3Rpb24oKXt2YXIgZSx0LG4scixpLG8sYT1hcmd1bWVudHNbMF18fHt9LHM9MSx1PWFyZ3VtZW50cy5sZW5ndGgsbD0hMTtmb3IoImJvb2xlYW4iPT10eXBlb2YgYSYmKGw9YSxhPWFyZ3VtZW50c1tzXXx8e30scysrKSwib2JqZWN0Ij09dHlwZW9mIGF8fG0oYSl8fChhPXt9KSxzPT09dSYmKGE9dGhpcyxzLS0pO3M8dTtzKyspaWYobnVsbCE9KGU9YXJndW1lbnRzW3NdKSlmb3IodCBpbiBlKXI9ZVt0XSwiX19wcm90b19fIiE9PXQmJmEhPT1yJiYobCYmciYmKFMuaXNQbGFpbk9iamVjdChyKXx8KGk9QXJyYXkuaXNBcnJheShyKSkpPyhuPWFbdF0sbz1pJiYhQXJyYXkuaXNBcnJheShuKT9bXTppfHxTLmlzUGxhaW5PYmplY3Qobik/bjp7fSxpPSExLGFbdF09Uy5leHRlbmQobCxvLHIpKTp2b2lkIDAhPT1yJiYoYVt0XT1yKSk7cmV0dXJuIGF9LFMuZXh0ZW5kKHtleHBhbmRvOiJqUXVlcnkiKyhmK01hdGgucmFuZG9tKCkpLnJlcGxhY2UoL1xEL2csIiIpLGlzUmVhZHk6ITAsZXJyb3I6ZnVuY3Rpb24oZSl7dGhyb3cgbmV3IEVycm9yKGUpfSxub29wOmZ1bmN0aW9uKCl7fSxpc1BsYWluT2JqZWN0OmZ1bmN0aW9uKGUpe3ZhciB0LG47cmV0dXJuISghZXx8IltvYmplY3QgT2JqZWN0XSIhPT1vLmNhbGwoZSkpJiYoISh0PXIoZSkpfHwiZnVuY3Rpb24iPT10eXBlb2Yobj12LmNhbGwodCwiY29uc3RydWN0b3IiKSYmdC5jb25zdHJ1Y3RvcikmJmEuY2FsbChuKT09PWwpfSxpc0VtcHR5T2JqZWN0OmZ1bmN0aW9uKGUpe3ZhciB0O2Zvcih0IGluIGUpcmV0dXJuITE7cmV0dXJuITB9LGdsb2JhbEV2YWw6ZnVuY3Rpb24oZSx0LG4pe2IoZSx7bm9uY2U6dCYmdC5ub25jZX0sbil9LGVhY2g6ZnVuY3Rpb24oZSx0KXt2YXIgbixyPTA7aWYocChlKSl7Zm9yKG49ZS5sZW5ndGg7cjxuO3IrKylpZighMT09PXQuY2FsbChlW3JdLHIsZVtyXSkpYnJlYWt9ZWxzZSBmb3IociBpbiBlKWlmKCExPT09dC5jYWxsKGVbcl0scixlW3JdKSlicmVhaztyZXR1cm4gZX0sbWFrZUFycmF5OmZ1bmN0aW9uKGUsdCl7dmFyIG49dHx8W107cmV0dXJuIG51bGwhPWUmJihwKE9iamVjdChlKSk/Uy5tZXJnZShuLCJzdHJpbmciPT10eXBlb2YgZT9bZV06ZSk6dS5jYWxsKG4sZSkpLG59LGluQXJyYXk6ZnVuY3Rpb24oZSx0LG4pe3JldHVybiBudWxsPT10Py0xOmkuY2FsbCh0LGUsbil9LG1lcmdlOmZ1bmN0aW9uKGUsdCl7Zm9yKHZhciBuPSt0Lmxlbmd0aCxyPTAsaT1lLmxlbmd0aDtyPG47cisrKWVbaSsrXT10W3JdO3JldHVybiBlLmxlbmd0aD1pLGV9LGdyZXA6ZnVuY3Rpb24oZSx0LG4pe2Zvcih2YXIgcj1bXSxpPTAsbz1lLmxlbmd0aCxhPSFuO2k8bztpKyspIXQoZVtpXSxpKSE9PWEmJnIucHVzaChlW2ldKTtyZXR1cm4gcn0sbWFwOmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG89MCxhPVtdO2lmKHAoZSkpZm9yKHI9ZS5sZW5ndGg7bzxyO28rKyludWxsIT0oaT10KGVbb10sbyxuKSkmJmEucHVzaChpKTtlbHNlIGZvcihvIGluIGUpbnVsbCE9KGk9dChlW29dLG8sbikpJiZhLnB1c2goaSk7cmV0dXJuIGcoYSl9LGd1aWQ6MSxzdXBwb3J0Onl9KSwiZnVuY3Rpb24iPT10eXBlb2YgU3ltYm9sJiYoUy5mbltTeW1ib2wuaXRlcmF0b3JdPXRbU3ltYm9sLml0ZXJhdG9yXSksUy5lYWNoKCJCb29sZWFuIE51bWJlciBTdHJpbmcgRnVuY3Rpb24gQXJyYXkgRGF0ZSBSZWdFeHAgT2JqZWN0IEVycm9yIFN5bWJvbCIuc3BsaXQoIiAiKSxmdW5jdGlvbihlLHQpe25bIltvYmplY3QgIit0KyJdIl09dC50b0xvd2VyQ2FzZSgpfSk7dmFyIGQ9ZnVuY3Rpb24obil7dmFyIGUsZCxiLG8saSxoLGYsZyx3LHUsbCxULEMsYSxFLHYscyxjLHksUz0ic2l6emxlIisxKm5ldyBEYXRlLHA9bi5kb2N1bWVudCxrPTAscj0wLG09dWUoKSx4PXVlKCksQT11ZSgpLE49dWUoKSxEPWZ1bmN0aW9uKGUsdCl7cmV0dXJuIGU9PT10JiYobD0hMCksMH0saj17fS5oYXNPd25Qcm9wZXJ0eSx0PVtdLHE9dC5wb3AsTD10LnB1c2gsSD10LnB1c2gsTz10LnNsaWNlLFA9ZnVuY3Rpb24oZSx0KXtmb3IodmFyIG49MCxyPWUubGVuZ3RoO248cjtuKyspaWYoZVtuXT09PXQpcmV0dXJuIG47cmV0dXJuLTF9LFI9ImNoZWNrZWR8c2VsZWN0ZWR8YXN5bmN8YXV0b2ZvY3VzfGF1dG9wbGF5fGNvbnRyb2xzfGRlZmVyfGRpc2FibGVkfGhpZGRlbnxpc21hcHxsb29wfG11bHRpcGxlfG9wZW58cmVhZG9ubHl8cmVxdWlyZWR8c2NvcGVkIixNPSJbXFx4MjBcXHRcXHJcXG5cXGZdIixJPSIoPzpcXFxcW1xcZGEtZkEtRl17MSw2fSIrTSsiP3xcXFxcW15cXHJcXG5cXGZdfFtcXHctXXxbXlwwLVxceDdmXSkrIixXPSJcXFsiK00rIiooIitJKyIpKD86IitNKyIqKFsqXiR8IX5dPz0pIitNKyIqKD86JygoPzpcXFxcLnxbXlxcXFwnXSkqKSd8XCIoKD86XFxcXC58W15cXFxcXCJdKSopXCJ8KCIrSSsiKSl8KSIrTSsiKlxcXSIsRj0iOigiK0krIikoPzpcXCgoKCcoKD86XFxcXC58W15cXFxcJ10pKiknfFwiKCg/OlxcXFwufFteXFxcXFwiXSkqKVwiKXwoKD86XFxcXC58W15cXFxcKClbXFxdXXwiK1crIikqKXwuKilcXCl8KSIsQj1uZXcgUmVnRXhwKE0rIisiLCJnIiksJD1uZXcgUmVnRXhwKCJeIitNKyIrfCgoPzpefFteXFxcXF0pKD86XFxcXC4pKikiK00rIiskIiwiZyIpLF89bmV3IFJlZ0V4cCgiXiIrTSsiKiwiK00rIioiKSx6PW5ldyBSZWdFeHAoIl4iK00rIiooWz4rfl18IitNKyIpIitNKyIqIiksVT1uZXcgUmVnRXhwKE0rInw+IiksWD1uZXcgUmVnRXhwKEYpLFY9bmV3IFJlZ0V4cCgiXiIrSSsiJCIpLEc9e0lEOm5ldyBSZWdFeHAoIl4jKCIrSSsiKSIpLENMQVNTOm5ldyBSZWdFeHAoIl5cXC4oIitJKyIpIiksVEFHOm5ldyBSZWdFeHAoIl4oIitJKyJ8WypdKSIpLEFUVFI6bmV3IFJlZ0V4cCgiXiIrVyksUFNFVURPOm5ldyBSZWdFeHAoIl4iK0YpLENISUxEOm5ldyBSZWdFeHAoIl46KG9ubHl8Zmlyc3R8bGFzdHxudGh8bnRoLWxhc3QpLShjaGlsZHxvZi10eXBlKSg/OlxcKCIrTSsiKihldmVufG9kZHwoKFsrLV18KShcXGQqKW58KSIrTSsiKig/OihbKy1dfCkiK00rIiooXFxkKyl8KSkiK00rIipcXCl8KSIsImkiKSxib29sOm5ldyBSZWdFeHAoIl4oPzoiK1IrIikkIiwiaSIpLG5lZWRzQ29udGV4dDpuZXcgUmVnRXhwKCJeIitNKyIqWz4rfl18OihldmVufG9kZHxlcXxndHxsdHxudGh8Zmlyc3R8bGFzdCkoPzpcXCgiK00rIiooKD86LVxcZCk/XFxkKikiK00rIipcXCl8KSg/PVteLV18JCkiLCJpIil9LFk9L0hUTUwkL2ksUT0vXig/OmlucHV0fHNlbGVjdHx0ZXh0YXJlYXxidXR0b24pJC9pLEo9L15oXGQkL2ksSz0vXltee10rXHtccypcW25hdGl2ZSBcdy8sWj0vXig/OiMoW1x3LV0rKXwoXHcrKXxcLihbXHctXSspKSQvLGVlPS9bK35dLyx0ZT1uZXcgUmVnRXhwKCJcXFxcW1xcZGEtZkEtRl17MSw2fSIrTSsiP3xcXFxcKFteXFxyXFxuXFxmXSkiLCJnIiksbmU9ZnVuY3Rpb24oZSx0KXt2YXIgbj0iMHgiK2Uuc2xpY2UoMSktNjU1MzY7cmV0dXJuIHR8fChuPDA/U3RyaW5nLmZyb21DaGFyQ29kZShuKzY1NTM2KTpTdHJpbmcuZnJvbUNoYXJDb2RlKG4+PjEwfDU1Mjk2LDEwMjMmbnw1NjMyMCkpfSxyZT0vKFtcMC1ceDFmXHg3Zl18Xi0/XGQpfF4tJHxbXlwwLVx4MWZceDdmLVx1RkZGRlx3LV0vZyxpZT1mdW5jdGlvbihlLHQpe3JldHVybiB0PyJcMCI9PT1lPyJcdWZmZmQiOmUuc2xpY2UoMCwtMSkrIlxcIitlLmNoYXJDb2RlQXQoZS5sZW5ndGgtMSkudG9TdHJpbmcoMTYpKyIgIjoiXFwiK2V9LG9lPWZ1bmN0aW9uKCl7VCgpfSxhZT1iZShmdW5jdGlvbihlKXtyZXR1cm4hMD09PWUuZGlzYWJsZWQmJiJmaWVsZHNldCI9PT1lLm5vZGVOYW1lLnRvTG93ZXJDYXNlKCl9LHtkaXI6InBhcmVudE5vZGUiLG5leHQ6ImxlZ2VuZCJ9KTt0cnl7SC5hcHBseSh0PU8uY2FsbChwLmNoaWxkTm9kZXMpLHAuY2hpbGROb2RlcyksdFtwLmNoaWxkTm9kZXMubGVuZ3RoXS5ub2RlVHlwZX1jYXRjaChlKXtIPXthcHBseTp0Lmxlbmd0aD9mdW5jdGlvbihlLHQpe0wuYXBwbHkoZSxPLmNhbGwodCkpfTpmdW5jdGlvbihlLHQpe3ZhciBuPWUubGVuZ3RoLHI9MDt3aGlsZShlW24rK109dFtyKytdKTtlLmxlbmd0aD1uLTF9fX1mdW5jdGlvbiBzZSh0LGUsbixyKXt2YXIgaSxvLGEscyx1LGwsYyxmPWUmJmUub3duZXJEb2N1bWVudCxwPWU/ZS5ub2RlVHlwZTo5O2lmKG49bnx8W10sInN0cmluZyIhPXR5cGVvZiB0fHwhdHx8MSE9PXAmJjkhPT1wJiYxMSE9PXApcmV0dXJuIG47aWYoIXImJihUKGUpLGU9ZXx8QyxFKSl7aWYoMTEhPT1wJiYodT1aLmV4ZWModCkpKWlmKGk9dVsxXSl7aWYoOT09PXApe2lmKCEoYT1lLmdldEVsZW1lbnRCeUlkKGkpKSlyZXR1cm4gbjtpZihhLmlkPT09aSlyZXR1cm4gbi5wdXNoKGEpLG59ZWxzZSBpZihmJiYoYT1mLmdldEVsZW1lbnRCeUlkKGkpKSYmeShlLGEpJiZhLmlkPT09aSlyZXR1cm4gbi5wdXNoKGEpLG59ZWxzZXtpZih1WzJdKXJldHVybiBILmFwcGx5KG4sZS5nZXRFbGVtZW50c0J5VGFnTmFtZSh0KSksbjtpZigoaT11WzNdKSYmZC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lJiZlLmdldEVsZW1lbnRzQnlDbGFzc05hbWUpcmV0dXJuIEguYXBwbHkobixlLmdldEVsZW1lbnRzQnlDbGFzc05hbWUoaSkpLG59aWYoZC5xc2EmJiFOW3QrIiAiXSYmKCF2fHwhdi50ZXN0KHQpKSYmKDEhPT1wfHwib2JqZWN0IiE9PWUubm9kZU5hbWUudG9Mb3dlckNhc2UoKSkpe2lmKGM9dCxmPWUsMT09PXAmJihVLnRlc3QodCl8fHoudGVzdCh0KSkpeyhmPWVlLnRlc3QodCkmJnllKGUucGFyZW50Tm9kZSl8fGUpPT09ZSYmZC5zY29wZXx8KChzPWUuZ2V0QXR0cmlidXRlKCJpZCIpKT9zPXMucmVwbGFjZShyZSxpZSk6ZS5zZXRBdHRyaWJ1dGUoImlkIixzPVMpKSxvPShsPWgodCkpLmxlbmd0aDt3aGlsZShvLS0pbFtvXT0ocz8iIyIrczoiOnNjb3BlIikrIiAiK3hlKGxbb10pO2M9bC5qb2luKCIsIil9dHJ5e3JldHVybiBILmFwcGx5KG4sZi5xdWVyeVNlbGVjdG9yQWxsKGMpKSxufWNhdGNoKGUpe04odCwhMCl9ZmluYWxseXtzPT09UyYmZS5yZW1vdmVBdHRyaWJ1dGUoImlkIil9fX1yZXR1cm4gZyh0LnJlcGxhY2UoJCwiJDEiKSxlLG4scil9ZnVuY3Rpb24gdWUoKXt2YXIgcj1bXTtyZXR1cm4gZnVuY3Rpb24gZSh0LG4pe3JldHVybiByLnB1c2godCsiICIpPmIuY2FjaGVMZW5ndGgmJmRlbGV0ZSBlW3Iuc2hpZnQoKV0sZVt0KyIgIl09bn19ZnVuY3Rpb24gbGUoZSl7cmV0dXJuIGVbU109ITAsZX1mdW5jdGlvbiBjZShlKXt2YXIgdD1DLmNyZWF0ZUVsZW1lbnQoImZpZWxkc2V0Iik7dHJ5e3JldHVybiEhZSh0KX1jYXRjaChlKXtyZXR1cm4hMX1maW5hbGx5e3QucGFyZW50Tm9kZSYmdC5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKHQpLHQ9bnVsbH19ZnVuY3Rpb24gZmUoZSx0KXt2YXIgbj1lLnNwbGl0KCJ8Iikscj1uLmxlbmd0aDt3aGlsZShyLS0pYi5hdHRySGFuZGxlW25bcl1dPXR9ZnVuY3Rpb24gcGUoZSx0KXt2YXIgbj10JiZlLHI9biYmMT09PWUubm9kZVR5cGUmJjE9PT10Lm5vZGVUeXBlJiZlLnNvdXJjZUluZGV4LXQuc291cmNlSW5kZXg7aWYocilyZXR1cm4gcjtpZihuKXdoaWxlKG49bi5uZXh0U2libGluZylpZihuPT09dClyZXR1cm4tMTtyZXR1cm4gZT8xOi0xfWZ1bmN0aW9uIGRlKHQpe3JldHVybiBmdW5jdGlvbihlKXtyZXR1cm4iaW5wdXQiPT09ZS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpJiZlLnR5cGU9PT10fX1mdW5jdGlvbiBoZShuKXtyZXR1cm4gZnVuY3Rpb24oZSl7dmFyIHQ9ZS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpO3JldHVybigiaW5wdXQiPT09dHx8ImJ1dHRvbiI9PT10KSYmZS50eXBlPT09bn19ZnVuY3Rpb24gZ2UodCl7cmV0dXJuIGZ1bmN0aW9uKGUpe3JldHVybiJmb3JtImluIGU/ZS5wYXJlbnROb2RlJiYhMT09PWUuZGlzYWJsZWQ/ImxhYmVsImluIGU/ImxhYmVsImluIGUucGFyZW50Tm9kZT9lLnBhcmVudE5vZGUuZGlzYWJsZWQ9PT10OmUuZGlzYWJsZWQ9PT10OmUuaXNEaXNhYmxlZD09PXR8fGUuaXNEaXNhYmxlZCE9PSF0JiZhZShlKT09PXQ6ZS5kaXNhYmxlZD09PXQ6ImxhYmVsImluIGUmJmUuZGlzYWJsZWQ9PT10fX1mdW5jdGlvbiB2ZShhKXtyZXR1cm4gbGUoZnVuY3Rpb24obyl7cmV0dXJuIG89K28sbGUoZnVuY3Rpb24oZSx0KXt2YXIgbixyPWEoW10sZS5sZW5ndGgsbyksaT1yLmxlbmd0aDt3aGlsZShpLS0pZVtuPXJbaV1dJiYoZVtuXT0hKHRbbl09ZVtuXSkpfSl9KX1mdW5jdGlvbiB5ZShlKXtyZXR1cm4gZSYmInVuZGVmaW5lZCIhPXR5cGVvZiBlLmdldEVsZW1lbnRzQnlUYWdOYW1lJiZlfWZvcihlIGluIGQ9c2Uuc3VwcG9ydD17fSxpPXNlLmlzWE1MPWZ1bmN0aW9uKGUpe3ZhciB0PWUubmFtZXNwYWNlVVJJLG49KGUub3duZXJEb2N1bWVudHx8ZSkuZG9jdW1lbnRFbGVtZW50O3JldHVybiFZLnRlc3QodHx8biYmbi5ub2RlTmFtZXx8IkhUTUwiKX0sVD1zZS5zZXREb2N1bWVudD1mdW5jdGlvbihlKXt2YXIgdCxuLHI9ZT9lLm93bmVyRG9jdW1lbnR8fGU6cDtyZXR1cm4gciE9QyYmOT09PXIubm9kZVR5cGUmJnIuZG9jdW1lbnRFbGVtZW50JiYoYT0oQz1yKS5kb2N1bWVudEVsZW1lbnQsRT0haShDKSxwIT1DJiYobj1DLmRlZmF1bHRWaWV3KSYmbi50b3AhPT1uJiYobi5hZGRFdmVudExpc3RlbmVyP24uYWRkRXZlbnRMaXN0ZW5lcigidW5sb2FkIixvZSwhMSk6bi5hdHRhY2hFdmVudCYmbi5hdHRhY2hFdmVudCgib251bmxvYWQiLG9lKSksZC5zY29wZT1jZShmdW5jdGlvbihlKXtyZXR1cm4gYS5hcHBlbmRDaGlsZChlKS5hcHBlbmRDaGlsZChDLmNyZWF0ZUVsZW1lbnQoImRpdiIpKSwidW5kZWZpbmVkIiE9dHlwZW9mIGUucXVlcnlTZWxlY3RvckFsbCYmIWUucXVlcnlTZWxlY3RvckFsbCgiOnNjb3BlIGZpZWxkc2V0IGRpdiIpLmxlbmd0aH0pLGQuYXR0cmlidXRlcz1jZShmdW5jdGlvbihlKXtyZXR1cm4gZS5jbGFzc05hbWU9ImkiLCFlLmdldEF0dHJpYnV0ZSgiY2xhc3NOYW1lIil9KSxkLmdldEVsZW1lbnRzQnlUYWdOYW1lPWNlKGZ1bmN0aW9uKGUpe3JldHVybiBlLmFwcGVuZENoaWxkKEMuY3JlYXRlQ29tbWVudCgiIikpLCFlLmdldEVsZW1lbnRzQnlUYWdOYW1lKCIqIikubGVuZ3RofSksZC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lPUsudGVzdChDLmdldEVsZW1lbnRzQnlDbGFzc05hbWUpLGQuZ2V0QnlJZD1jZShmdW5jdGlvbihlKXtyZXR1cm4gYS5hcHBlbmRDaGlsZChlKS5pZD1TLCFDLmdldEVsZW1lbnRzQnlOYW1lfHwhQy5nZXRFbGVtZW50c0J5TmFtZShTKS5sZW5ndGh9KSxkLmdldEJ5SWQ/KGIuZmlsdGVyLklEPWZ1bmN0aW9uKGUpe3ZhciB0PWUucmVwbGFjZSh0ZSxuZSk7cmV0dXJuIGZ1bmN0aW9uKGUpe3JldHVybiBlLmdldEF0dHJpYnV0ZSgiaWQiKT09PXR9fSxiLmZpbmQuSUQ9ZnVuY3Rpb24oZSx0KXtpZigidW5kZWZpbmVkIiE9dHlwZW9mIHQuZ2V0RWxlbWVudEJ5SWQmJkUpe3ZhciBuPXQuZ2V0RWxlbWVudEJ5SWQoZSk7cmV0dXJuIG4/W25dOltdfX0pOihiLmZpbHRlci5JRD1mdW5jdGlvbihlKXt2YXIgbj1lLnJlcGxhY2UodGUsbmUpO3JldHVybiBmdW5jdGlvbihlKXt2YXIgdD0idW5kZWZpbmVkIiE9dHlwZW9mIGUuZ2V0QXR0cmlidXRlTm9kZSYmZS5nZXRBdHRyaWJ1dGVOb2RlKCJpZCIpO3JldHVybiB0JiZ0LnZhbHVlPT09bn19LGIuZmluZC5JRD1mdW5jdGlvbihlLHQpe2lmKCJ1bmRlZmluZWQiIT10eXBlb2YgdC5nZXRFbGVtZW50QnlJZCYmRSl7dmFyIG4scixpLG89dC5nZXRFbGVtZW50QnlJZChlKTtpZihvKXtpZigobj1vLmdldEF0dHJpYnV0ZU5vZGUoImlkIikpJiZuLnZhbHVlPT09ZSlyZXR1cm5bb107aT10LmdldEVsZW1lbnRzQnlOYW1lKGUpLHI9MDt3aGlsZShvPWlbcisrXSlpZigobj1vLmdldEF0dHJpYnV0ZU5vZGUoImlkIikpJiZuLnZhbHVlPT09ZSlyZXR1cm5bb119cmV0dXJuW119fSksYi5maW5kLlRBRz1kLmdldEVsZW1lbnRzQnlUYWdOYW1lP2Z1bmN0aW9uKGUsdCl7cmV0dXJuInVuZGVmaW5lZCIhPXR5cGVvZiB0LmdldEVsZW1lbnRzQnlUYWdOYW1lP3QuZ2V0RWxlbWVudHNCeVRhZ05hbWUoZSk6ZC5xc2E/dC5xdWVyeVNlbGVjdG9yQWxsKGUpOnZvaWQgMH06ZnVuY3Rpb24oZSx0KXt2YXIgbixyPVtdLGk9MCxvPXQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoZSk7aWYoIioiPT09ZSl7d2hpbGUobj1vW2krK10pMT09PW4ubm9kZVR5cGUmJnIucHVzaChuKTtyZXR1cm4gcn1yZXR1cm4gb30sYi5maW5kLkNMQVNTPWQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSYmZnVuY3Rpb24oZSx0KXtpZigidW5kZWZpbmVkIiE9dHlwZW9mIHQuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSYmRSlyZXR1cm4gdC5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKGUpfSxzPVtdLHY9W10sKGQucXNhPUsudGVzdChDLnF1ZXJ5U2VsZWN0b3JBbGwpKSYmKGNlKGZ1bmN0aW9uKGUpe3ZhciB0O2EuYXBwZW5kQ2hpbGQoZSkuaW5uZXJIVE1MPSI8YSBpZD0nIitTKyInPjwvYT48c2VsZWN0IGlkPSciK1MrIi1cclxcJyBtc2FsbG93Y2FwdHVyZT0nJz48b3B0aW9uIHNlbGVjdGVkPScnPjwvb3B0aW9uPjwvc2VsZWN0PiIsZS5xdWVyeVNlbGVjdG9yQWxsKCJbbXNhbGxvd2NhcHR1cmVePScnXSIpLmxlbmd0aCYmdi5wdXNoKCJbKl4kXT0iK00rIiooPzonJ3xcIlwiKSIpLGUucXVlcnlTZWxlY3RvckFsbCgiW3NlbGVjdGVkXSIpLmxlbmd0aHx8di5wdXNoKCJcXFsiK00rIiooPzp2YWx1ZXwiK1IrIikiKSxlLnF1ZXJ5U2VsZWN0b3JBbGwoIltpZH49IitTKyItXSIpLmxlbmd0aHx8di5wdXNoKCJ+PSIpLCh0PUMuY3JlYXRlRWxlbWVudCgiaW5wdXQiKSkuc2V0QXR0cmlidXRlKCJuYW1lIiwiIiksZS5hcHBlbmRDaGlsZCh0KSxlLnF1ZXJ5U2VsZWN0b3JBbGwoIltuYW1lPScnXSIpLmxlbmd0aHx8di5wdXNoKCJcXFsiK00rIipuYW1lIitNKyIqPSIrTSsiKig/OicnfFwiXCIpIiksZS5xdWVyeVNlbGVjdG9yQWxsKCI6Y2hlY2tlZCIpLmxlbmd0aHx8di5wdXNoKCI6Y2hlY2tlZCIpLGUucXVlcnlTZWxlY3RvckFsbCgiYSMiK1MrIisqIikubGVuZ3RofHx2LnB1c2goIi4jLitbK35dIiksZS5xdWVyeVNlbGVjdG9yQWxsKCJcXFxmIiksdi5wdXNoKCJbXFxyXFxuXFxmXSIpfSksY2UoZnVuY3Rpb24oZSl7ZS5pbm5lckhUTUw9IjxhIGhyZWY9JycgZGlzYWJsZWQ9J2Rpc2FibGVkJz48L2E+PHNlbGVjdCBkaXNhYmxlZD0nZGlzYWJsZWQnPjxvcHRpb24vPjwvc2VsZWN0PiI7dmFyIHQ9Qy5jcmVhdGVFbGVtZW50KCJpbnB1dCIpO3Quc2V0QXR0cmlidXRlKCJ0eXBlIiwiaGlkZGVuIiksZS5hcHBlbmRDaGlsZCh0KS5zZXRBdHRyaWJ1dGUoIm5hbWUiLCJEIiksZS5xdWVyeVNlbGVjdG9yQWxsKCJbbmFtZT1kXSIpLmxlbmd0aCYmdi5wdXNoKCJuYW1lIitNKyIqWypeJHwhfl0/PSIpLDIhPT1lLnF1ZXJ5U2VsZWN0b3JBbGwoIjplbmFibGVkIikubGVuZ3RoJiZ2LnB1c2goIjplbmFibGVkIiwiOmRpc2FibGVkIiksYS5hcHBlbmRDaGlsZChlKS5kaXNhYmxlZD0hMCwyIT09ZS5xdWVyeVNlbGVjdG9yQWxsKCI6ZGlzYWJsZWQiKS5sZW5ndGgmJnYucHVzaCgiOmVuYWJsZWQiLCI6ZGlzYWJsZWQiKSxlLnF1ZXJ5U2VsZWN0b3JBbGwoIiosOngiKSx2LnB1c2goIiwuKjoiKX0pKSwoZC5tYXRjaGVzU2VsZWN0b3I9Sy50ZXN0KGM9YS5tYXRjaGVzfHxhLndlYmtpdE1hdGNoZXNTZWxlY3Rvcnx8YS5tb3pNYXRjaGVzU2VsZWN0b3J8fGEub01hdGNoZXNTZWxlY3Rvcnx8YS5tc01hdGNoZXNTZWxlY3RvcikpJiZjZShmdW5jdGlvbihlKXtkLmRpc2Nvbm5lY3RlZE1hdGNoPWMuY2FsbChlLCIqIiksYy5jYWxsKGUsIltzIT0nJ106eCIpLHMucHVzaCgiIT0iLEYpfSksdj12Lmxlbmd0aCYmbmV3IFJlZ0V4cCh2LmpvaW4oInwiKSkscz1zLmxlbmd0aCYmbmV3IFJlZ0V4cChzLmpvaW4oInwiKSksdD1LLnRlc3QoYS5jb21wYXJlRG9jdW1lbnRQb3NpdGlvbikseT10fHxLLnRlc3QoYS5jb250YWlucyk/ZnVuY3Rpb24oZSx0KXt2YXIgbj05PT09ZS5ub2RlVHlwZT9lLmRvY3VtZW50RWxlbWVudDplLHI9dCYmdC5wYXJlbnROb2RlO3JldHVybiBlPT09cnx8ISghcnx8MSE9PXIubm9kZVR5cGV8fCEobi5jb250YWlucz9uLmNvbnRhaW5zKHIpOmUuY29tcGFyZURvY3VtZW50UG9zaXRpb24mJjE2JmUuY29tcGFyZURvY3VtZW50UG9zaXRpb24ocikpKX06ZnVuY3Rpb24oZSx0KXtpZih0KXdoaWxlKHQ9dC5wYXJlbnROb2RlKWlmKHQ9PT1lKXJldHVybiEwO3JldHVybiExfSxEPXQ/ZnVuY3Rpb24oZSx0KXtpZihlPT09dClyZXR1cm4gbD0hMCwwO3ZhciBuPSFlLmNvbXBhcmVEb2N1bWVudFBvc2l0aW9uLSF0LmNvbXBhcmVEb2N1bWVudFBvc2l0aW9uO3JldHVybiBufHwoMSYobj0oZS5vd25lckRvY3VtZW50fHxlKT09KHQub3duZXJEb2N1bWVudHx8dCk/ZS5jb21wYXJlRG9jdW1lbnRQb3NpdGlvbih0KToxKXx8IWQuc29ydERldGFjaGVkJiZ0LmNvbXBhcmVEb2N1bWVudFBvc2l0aW9uKGUpPT09bj9lPT1DfHxlLm93bmVyRG9jdW1lbnQ9PXAmJnkocCxlKT8tMTp0PT1DfHx0Lm93bmVyRG9jdW1lbnQ9PXAmJnkocCx0KT8xOnU/UCh1LGUpLVAodSx0KTowOjQmbj8tMToxKX06ZnVuY3Rpb24oZSx0KXtpZihlPT09dClyZXR1cm4gbD0hMCwwO3ZhciBuLHI9MCxpPWUucGFyZW50Tm9kZSxvPXQucGFyZW50Tm9kZSxhPVtlXSxzPVt0XTtpZighaXx8IW8pcmV0dXJuIGU9PUM/LTE6dD09Qz8xOmk/LTE6bz8xOnU/UCh1LGUpLVAodSx0KTowO2lmKGk9PT1vKXJldHVybiBwZShlLHQpO249ZTt3aGlsZShuPW4ucGFyZW50Tm9kZSlhLnVuc2hpZnQobik7bj10O3doaWxlKG49bi5wYXJlbnROb2RlKXMudW5zaGlmdChuKTt3aGlsZShhW3JdPT09c1tyXSlyKys7cmV0dXJuIHI/cGUoYVtyXSxzW3JdKTphW3JdPT1wPy0xOnNbcl09PXA/MTowfSksQ30sc2UubWF0Y2hlcz1mdW5jdGlvbihlLHQpe3JldHVybiBzZShlLG51bGwsbnVsbCx0KX0sc2UubWF0Y2hlc1NlbGVjdG9yPWZ1bmN0aW9uKGUsdCl7aWYoVChlKSxkLm1hdGNoZXNTZWxlY3RvciYmRSYmIU5bdCsiICJdJiYoIXN8fCFzLnRlc3QodCkpJiYoIXZ8fCF2LnRlc3QodCkpKXRyeXt2YXIgbj1jLmNhbGwoZSx0KTtpZihufHxkLmRpc2Nvbm5lY3RlZE1hdGNofHxlLmRvY3VtZW50JiYxMSE9PWUuZG9jdW1lbnQubm9kZVR5cGUpcmV0dXJuIG59Y2F0Y2goZSl7Tih0LCEwKX1yZXR1cm4gMDxzZSh0LEMsbnVsbCxbZV0pLmxlbmd0aH0sc2UuY29udGFpbnM9ZnVuY3Rpb24oZSx0KXtyZXR1cm4oZS5vd25lckRvY3VtZW50fHxlKSE9QyYmVChlKSx5KGUsdCl9LHNlLmF0dHI9ZnVuY3Rpb24oZSx0KXsoZS5vd25lckRvY3VtZW50fHxlKSE9QyYmVChlKTt2YXIgbj1iLmF0dHJIYW5kbGVbdC50b0xvd2VyQ2FzZSgpXSxyPW4mJmouY2FsbChiLmF0dHJIYW5kbGUsdC50b0xvd2VyQ2FzZSgpKT9uKGUsdCwhRSk6dm9pZCAwO3JldHVybiB2b2lkIDAhPT1yP3I6ZC5hdHRyaWJ1dGVzfHwhRT9lLmdldEF0dHJpYnV0ZSh0KToocj1lLmdldEF0dHJpYnV0ZU5vZGUodCkpJiZyLnNwZWNpZmllZD9yLnZhbHVlOm51bGx9LHNlLmVzY2FwZT1mdW5jdGlvbihlKXtyZXR1cm4oZSsiIikucmVwbGFjZShyZSxpZSl9LHNlLmVycm9yPWZ1bmN0aW9uKGUpe3Rocm93IG5ldyBFcnJvcigiU3ludGF4IGVycm9yLCB1bnJlY29nbml6ZWQgZXhwcmVzc2lvbjogIitlKX0sc2UudW5pcXVlU29ydD1mdW5jdGlvbihlKXt2YXIgdCxuPVtdLHI9MCxpPTA7aWYobD0hZC5kZXRlY3REdXBsaWNhdGVzLHU9IWQuc29ydFN0YWJsZSYmZS5zbGljZSgwKSxlLnNvcnQoRCksbCl7d2hpbGUodD1lW2krK10pdD09PWVbaV0mJihyPW4ucHVzaChpKSk7d2hpbGUoci0tKWUuc3BsaWNlKG5bcl0sMSl9cmV0dXJuIHU9bnVsbCxlfSxvPXNlLmdldFRleHQ9ZnVuY3Rpb24oZSl7dmFyIHQsbj0iIixyPTAsaT1lLm5vZGVUeXBlO2lmKGkpe2lmKDE9PT1pfHw5PT09aXx8MTE9PT1pKXtpZigic3RyaW5nIj09dHlwZW9mIGUudGV4dENvbnRlbnQpcmV0dXJuIGUudGV4dENvbnRlbnQ7Zm9yKGU9ZS5maXJzdENoaWxkO2U7ZT1lLm5leHRTaWJsaW5nKW4rPW8oZSl9ZWxzZSBpZigzPT09aXx8ND09PWkpcmV0dXJuIGUubm9kZVZhbHVlfWVsc2Ugd2hpbGUodD1lW3IrK10pbis9byh0KTtyZXR1cm4gbn0sKGI9c2Uuc2VsZWN0b3JzPXtjYWNoZUxlbmd0aDo1MCxjcmVhdGVQc2V1ZG86bGUsbWF0Y2g6RyxhdHRySGFuZGxlOnt9LGZpbmQ6e30scmVsYXRpdmU6eyI+Ijp7ZGlyOiJwYXJlbnROb2RlIixmaXJzdDohMH0sIiAiOntkaXI6InBhcmVudE5vZGUifSwiKyI6e2RpcjoicHJldmlvdXNTaWJsaW5nIixmaXJzdDohMH0sIn4iOntkaXI6InByZXZpb3VzU2libGluZyJ9fSxwcmVGaWx0ZXI6e0FUVFI6ZnVuY3Rpb24oZSl7cmV0dXJuIGVbMV09ZVsxXS5yZXBsYWNlKHRlLG5lKSxlWzNdPShlWzNdfHxlWzRdfHxlWzVdfHwiIikucmVwbGFjZSh0ZSxuZSksIn49Ij09PWVbMl0mJihlWzNdPSIgIitlWzNdKyIgIiksZS5zbGljZSgwLDQpfSxDSElMRDpmdW5jdGlvbihlKXtyZXR1cm4gZVsxXT1lWzFdLnRvTG93ZXJDYXNlKCksIm50aCI9PT1lWzFdLnNsaWNlKDAsMyk/KGVbM118fHNlLmVycm9yKGVbMF0pLGVbNF09KyhlWzRdP2VbNV0rKGVbNl18fDEpOjIqKCJldmVuIj09PWVbM118fCJvZGQiPT09ZVszXSkpLGVbNV09KyhlWzddK2VbOF18fCJvZGQiPT09ZVszXSkpOmVbM10mJnNlLmVycm9yKGVbMF0pLGV9LFBTRVVETzpmdW5jdGlvbihlKXt2YXIgdCxuPSFlWzZdJiZlWzJdO3JldHVybiBHLkNISUxELnRlc3QoZVswXSk/bnVsbDooZVszXT9lWzJdPWVbNF18fGVbNV18fCIiOm4mJlgudGVzdChuKSYmKHQ9aChuLCEwKSkmJih0PW4uaW5kZXhPZigiKSIsbi5sZW5ndGgtdCktbi5sZW5ndGgpJiYoZVswXT1lWzBdLnNsaWNlKDAsdCksZVsyXT1uLnNsaWNlKDAsdCkpLGUuc2xpY2UoMCwzKSl9fSxmaWx0ZXI6e1RBRzpmdW5jdGlvbihlKXt2YXIgdD1lLnJlcGxhY2UodGUsbmUpLnRvTG93ZXJDYXNlKCk7cmV0dXJuIioiPT09ZT9mdW5jdGlvbigpe3JldHVybiEwfTpmdW5jdGlvbihlKXtyZXR1cm4gZS5ub2RlTmFtZSYmZS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpPT09dH19LENMQVNTOmZ1bmN0aW9uKGUpe3ZhciB0PW1bZSsiICJdO3JldHVybiB0fHwodD1uZXcgUmVnRXhwKCIoXnwiK00rIikiK2UrIigiK00rInwkKSIpKSYmbShlLGZ1bmN0aW9uKGUpe3JldHVybiB0LnRlc3QoInN0cmluZyI9PXR5cGVvZiBlLmNsYXNzTmFtZSYmZS5jbGFzc05hbWV8fCJ1bmRlZmluZWQiIT10eXBlb2YgZS5nZXRBdHRyaWJ1dGUmJmUuZ2V0QXR0cmlidXRlKCJjbGFzcyIpfHwiIil9KX0sQVRUUjpmdW5jdGlvbihuLHIsaSl7cmV0dXJuIGZ1bmN0aW9uKGUpe3ZhciB0PXNlLmF0dHIoZSxuKTtyZXR1cm4gbnVsbD09dD8iIT0iPT09cjohcnx8KHQrPSIiLCI9Ij09PXI/dD09PWk6IiE9Ij09PXI/dCE9PWk6Il49Ij09PXI/aSYmMD09PXQuaW5kZXhPZihpKToiKj0iPT09cj9pJiYtMTx0LmluZGV4T2YoaSk6IiQ9Ij09PXI/aSYmdC5zbGljZSgtaS5sZW5ndGgpPT09aToifj0iPT09cj8tMTwoIiAiK3QucmVwbGFjZShCLCIgIikrIiAiKS5pbmRleE9mKGkpOiJ8PSI9PT1yJiYodD09PWl8fHQuc2xpY2UoMCxpLmxlbmd0aCsxKT09PWkrIi0iKSl9fSxDSElMRDpmdW5jdGlvbihoLGUsdCxnLHYpe3ZhciB5PSJudGgiIT09aC5zbGljZSgwLDMpLG09Imxhc3QiIT09aC5zbGljZSgtNCkseD0ib2YtdHlwZSI9PT1lO3JldHVybiAxPT09ZyYmMD09PXY/ZnVuY3Rpb24oZSl7cmV0dXJuISFlLnBhcmVudE5vZGV9OmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG8sYSxzLHUsbD15IT09bT8ibmV4dFNpYmxpbmciOiJwcmV2aW91c1NpYmxpbmciLGM9ZS5wYXJlbnROb2RlLGY9eCYmZS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpLHA9IW4mJiF4LGQ9ITE7aWYoYyl7aWYoeSl7d2hpbGUobCl7YT1lO3doaWxlKGE9YVtsXSlpZih4P2Eubm9kZU5hbWUudG9Mb3dlckNhc2UoKT09PWY6MT09PWEubm9kZVR5cGUpcmV0dXJuITE7dT1sPSJvbmx5Ij09PWgmJiF1JiYibmV4dFNpYmxpbmcifXJldHVybiEwfWlmKHU9W20/Yy5maXJzdENoaWxkOmMubGFzdENoaWxkXSxtJiZwKXtkPShzPShyPShpPShvPShhPWMpW1NdfHwoYVtTXT17fSkpW2EudW5pcXVlSURdfHwob1thLnVuaXF1ZUlEXT17fSkpW2hdfHxbXSlbMF09PT1rJiZyWzFdKSYmclsyXSxhPXMmJmMuY2hpbGROb2Rlc1tzXTt3aGlsZShhPSsrcyYmYSYmYVtsXXx8KGQ9cz0wKXx8dS5wb3AoKSlpZigxPT09YS5ub2RlVHlwZSYmKytkJiZhPT09ZSl7aVtoXT1bayxzLGRdO2JyZWFrfX1lbHNlIGlmKHAmJihkPXM9KHI9KGk9KG89KGE9ZSlbU118fChhW1NdPXt9KSlbYS51bmlxdWVJRF18fChvW2EudW5pcXVlSURdPXt9KSlbaF18fFtdKVswXT09PWsmJnJbMV0pLCExPT09ZCl3aGlsZShhPSsrcyYmYSYmYVtsXXx8KGQ9cz0wKXx8dS5wb3AoKSlpZigoeD9hLm5vZGVOYW1lLnRvTG93ZXJDYXNlKCk9PT1mOjE9PT1hLm5vZGVUeXBlKSYmKytkJiYocCYmKChpPShvPWFbU118fChhW1NdPXt9KSlbYS51bmlxdWVJRF18fChvW2EudW5pcXVlSURdPXt9KSlbaF09W2ssZF0pLGE9PT1lKSlicmVhaztyZXR1cm4oZC09dik9PT1nfHxkJWc9PTAmJjA8PWQvZ319fSxQU0VVRE86ZnVuY3Rpb24oZSxvKXt2YXIgdCxhPWIucHNldWRvc1tlXXx8Yi5zZXRGaWx0ZXJzW2UudG9Mb3dlckNhc2UoKV18fHNlLmVycm9yKCJ1bnN1cHBvcnRlZCBwc2V1ZG86ICIrZSk7cmV0dXJuIGFbU10/YShvKToxPGEubGVuZ3RoPyh0PVtlLGUsIiIsb10sYi5zZXRGaWx0ZXJzLmhhc093blByb3BlcnR5KGUudG9Mb3dlckNhc2UoKSk/bGUoZnVuY3Rpb24oZSx0KXt2YXIgbixyPWEoZSxvKSxpPXIubGVuZ3RoO3doaWxlKGktLSllW249UChlLHJbaV0pXT0hKHRbbl09cltpXSl9KTpmdW5jdGlvbihlKXtyZXR1cm4gYShlLDAsdCl9KTphfX0scHNldWRvczp7bm90OmxlKGZ1bmN0aW9uKGUpe3ZhciByPVtdLGk9W10scz1mKGUucmVwbGFjZSgkLCIkMSIpKTtyZXR1cm4gc1tTXT9sZShmdW5jdGlvbihlLHQsbixyKXt2YXIgaSxvPXMoZSxudWxsLHIsW10pLGE9ZS5sZW5ndGg7d2hpbGUoYS0tKShpPW9bYV0pJiYoZVthXT0hKHRbYV09aSkpfSk6ZnVuY3Rpb24oZSx0LG4pe3JldHVybiByWzBdPWUscyhyLG51bGwsbixpKSxyWzBdPW51bGwsIWkucG9wKCl9fSksaGFzOmxlKGZ1bmN0aW9uKHQpe3JldHVybiBmdW5jdGlvbihlKXtyZXR1cm4gMDxzZSh0LGUpLmxlbmd0aH19KSxjb250YWluczpsZShmdW5jdGlvbih0KXtyZXR1cm4gdD10LnJlcGxhY2UodGUsbmUpLGZ1bmN0aW9uKGUpe3JldHVybi0xPChlLnRleHRDb250ZW50fHxvKGUpKS5pbmRleE9mKHQpfX0pLGxhbmc6bGUoZnVuY3Rpb24obil7cmV0dXJuIFYudGVzdChufHwiIil8fHNlLmVycm9yKCJ1bnN1cHBvcnRlZCBsYW5nOiAiK24pLG49bi5yZXBsYWNlKHRlLG5lKS50b0xvd2VyQ2FzZSgpLGZ1bmN0aW9uKGUpe3ZhciB0O2Rve2lmKHQ9RT9lLmxhbmc6ZS5nZXRBdHRyaWJ1dGUoInhtbDpsYW5nIil8fGUuZ2V0QXR0cmlidXRlKCJsYW5nIikpcmV0dXJuKHQ9dC50b0xvd2VyQ2FzZSgpKT09PW58fDA9PT10LmluZGV4T2YobisiLSIpfXdoaWxlKChlPWUucGFyZW50Tm9kZSkmJjE9PT1lLm5vZGVUeXBlKTtyZXR1cm4hMX19KSx0YXJnZXQ6ZnVuY3Rpb24oZSl7dmFyIHQ9bi5sb2NhdGlvbiYmbi5sb2NhdGlvbi5oYXNoO3JldHVybiB0JiZ0LnNsaWNlKDEpPT09ZS5pZH0scm9vdDpmdW5jdGlvbihlKXtyZXR1cm4gZT09PWF9LGZvY3VzOmZ1bmN0aW9uKGUpe3JldHVybiBlPT09Qy5hY3RpdmVFbGVtZW50JiYoIUMuaGFzRm9jdXN8fEMuaGFzRm9jdXMoKSkmJiEhKGUudHlwZXx8ZS5ocmVmfHx+ZS50YWJJbmRleCl9LGVuYWJsZWQ6Z2UoITEpLGRpc2FibGVkOmdlKCEwKSxjaGVja2VkOmZ1bmN0aW9uKGUpe3ZhciB0PWUubm9kZU5hbWUudG9Mb3dlckNhc2UoKTtyZXR1cm4iaW5wdXQiPT09dCYmISFlLmNoZWNrZWR8fCJvcHRpb24iPT09dCYmISFlLnNlbGVjdGVkfSxzZWxlY3RlZDpmdW5jdGlvbihlKXtyZXR1cm4gZS5wYXJlbnROb2RlJiZlLnBhcmVudE5vZGUuc2VsZWN0ZWRJbmRleCwhMD09PWUuc2VsZWN0ZWR9LGVtcHR5OmZ1bmN0aW9uKGUpe2ZvcihlPWUuZmlyc3RDaGlsZDtlO2U9ZS5uZXh0U2libGluZylpZihlLm5vZGVUeXBlPDYpcmV0dXJuITE7cmV0dXJuITB9LHBhcmVudDpmdW5jdGlvbihlKXtyZXR1cm4hYi5wc2V1ZG9zLmVtcHR5KGUpfSxoZWFkZXI6ZnVuY3Rpb24oZSl7cmV0dXJuIEoudGVzdChlLm5vZGVOYW1lKX0saW5wdXQ6ZnVuY3Rpb24oZSl7cmV0dXJuIFEudGVzdChlLm5vZGVOYW1lKX0sYnV0dG9uOmZ1bmN0aW9uKGUpe3ZhciB0PWUubm9kZU5hbWUudG9Mb3dlckNhc2UoKTtyZXR1cm4iaW5wdXQiPT09dCYmImJ1dHRvbiI9PT1lLnR5cGV8fCJidXR0b24iPT09dH0sdGV4dDpmdW5jdGlvbihlKXt2YXIgdDtyZXR1cm4iaW5wdXQiPT09ZS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpJiYidGV4dCI9PT1lLnR5cGUmJihudWxsPT0odD1lLmdldEF0dHJpYnV0ZSgidHlwZSIpKXx8InRleHQiPT09dC50b0xvd2VyQ2FzZSgpKX0sZmlyc3Q6dmUoZnVuY3Rpb24oKXtyZXR1cm5bMF19KSxsYXN0OnZlKGZ1bmN0aW9uKGUsdCl7cmV0dXJuW3QtMV19KSxlcTp2ZShmdW5jdGlvbihlLHQsbil7cmV0dXJuW248MD9uK3Q6bl19KSxldmVuOnZlKGZ1bmN0aW9uKGUsdCl7Zm9yKHZhciBuPTA7bjx0O24rPTIpZS5wdXNoKG4pO3JldHVybiBlfSksb2RkOnZlKGZ1bmN0aW9uKGUsdCl7Zm9yKHZhciBuPTE7bjx0O24rPTIpZS5wdXNoKG4pO3JldHVybiBlfSksbHQ6dmUoZnVuY3Rpb24oZSx0LG4pe2Zvcih2YXIgcj1uPDA/bit0OnQ8bj90Om47MDw9LS1yOyllLnB1c2gocik7cmV0dXJuIGV9KSxndDp2ZShmdW5jdGlvbihlLHQsbil7Zm9yKHZhciByPW48MD9uK3Q6bjsrK3I8dDspZS5wdXNoKHIpO3JldHVybiBlfSl9fSkucHNldWRvcy5udGg9Yi5wc2V1ZG9zLmVxLHtyYWRpbzohMCxjaGVja2JveDohMCxmaWxlOiEwLHBhc3N3b3JkOiEwLGltYWdlOiEwfSliLnBzZXVkb3NbZV09ZGUoZSk7Zm9yKGUgaW57c3VibWl0OiEwLHJlc2V0OiEwfSliLnBzZXVkb3NbZV09aGUoZSk7ZnVuY3Rpb24gbWUoKXt9ZnVuY3Rpb24geGUoZSl7Zm9yKHZhciB0PTAsbj1lLmxlbmd0aCxyPSIiO3Q8bjt0Kyspcis9ZVt0XS52YWx1ZTtyZXR1cm4gcn1mdW5jdGlvbiBiZShzLGUsdCl7dmFyIHU9ZS5kaXIsbD1lLm5leHQsYz1sfHx1LGY9dCYmInBhcmVudE5vZGUiPT09YyxwPXIrKztyZXR1cm4gZS5maXJzdD9mdW5jdGlvbihlLHQsbil7d2hpbGUoZT1lW3VdKWlmKDE9PT1lLm5vZGVUeXBlfHxmKXJldHVybiBzKGUsdCxuKTtyZXR1cm4hMX06ZnVuY3Rpb24oZSx0LG4pe3ZhciByLGksbyxhPVtrLHBdO2lmKG4pe3doaWxlKGU9ZVt1XSlpZigoMT09PWUubm9kZVR5cGV8fGYpJiZzKGUsdCxuKSlyZXR1cm4hMH1lbHNlIHdoaWxlKGU9ZVt1XSlpZigxPT09ZS5ub2RlVHlwZXx8ZilpZihpPShvPWVbU118fChlW1NdPXt9KSlbZS51bmlxdWVJRF18fChvW2UudW5pcXVlSURdPXt9KSxsJiZsPT09ZS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpKWU9ZVt1XXx8ZTtlbHNle2lmKChyPWlbY10pJiZyWzBdPT09ayYmclsxXT09PXApcmV0dXJuIGFbMl09clsyXTtpZigoaVtjXT1hKVsyXT1zKGUsdCxuKSlyZXR1cm4hMH1yZXR1cm4hMX19ZnVuY3Rpb24gd2UoaSl7cmV0dXJuIDE8aS5sZW5ndGg/ZnVuY3Rpb24oZSx0LG4pe3ZhciByPWkubGVuZ3RoO3doaWxlKHItLSlpZighaVtyXShlLHQsbikpcmV0dXJuITE7cmV0dXJuITB9OmlbMF19ZnVuY3Rpb24gVGUoZSx0LG4scixpKXtmb3IodmFyIG8sYT1bXSxzPTAsdT1lLmxlbmd0aCxsPW51bGwhPXQ7czx1O3MrKykobz1lW3NdKSYmKG4mJiFuKG8scixpKXx8KGEucHVzaChvKSxsJiZ0LnB1c2gocykpKTtyZXR1cm4gYX1mdW5jdGlvbiBDZShkLGgsZyx2LHksZSl7cmV0dXJuIHYmJiF2W1NdJiYodj1DZSh2KSkseSYmIXlbU10mJih5PUNlKHksZSkpLGxlKGZ1bmN0aW9uKGUsdCxuLHIpe3ZhciBpLG8sYSxzPVtdLHU9W10sbD10Lmxlbmd0aCxjPWV8fGZ1bmN0aW9uKGUsdCxuKXtmb3IodmFyIHI9MCxpPXQubGVuZ3RoO3I8aTtyKyspc2UoZSx0W3JdLG4pO3JldHVybiBufShofHwiKiIsbi5ub2RlVHlwZT9bbl06bixbXSksZj0hZHx8IWUmJmg/YzpUZShjLHMsZCxuLHIpLHA9Zz95fHwoZT9kOmx8fHYpP1tdOnQ6ZjtpZihnJiZnKGYscCxuLHIpLHYpe2k9VGUocCx1KSx2KGksW10sbixyKSxvPWkubGVuZ3RoO3doaWxlKG8tLSkoYT1pW29dKSYmKHBbdVtvXV09IShmW3Vbb11dPWEpKX1pZihlKXtpZih5fHxkKXtpZih5KXtpPVtdLG89cC5sZW5ndGg7d2hpbGUoby0tKShhPXBbb10pJiZpLnB1c2goZltvXT1hKTt5KG51bGwscD1bXSxpLHIpfW89cC5sZW5ndGg7d2hpbGUoby0tKShhPXBbb10pJiYtMTwoaT15P1AoZSxhKTpzW29dKSYmKGVbaV09ISh0W2ldPWEpKX19ZWxzZSBwPVRlKHA9PT10P3Auc3BsaWNlKGwscC5sZW5ndGgpOnApLHk/eShudWxsLHQscCxyKTpILmFwcGx5KHQscCl9KX1mdW5jdGlvbiBFZShlKXtmb3IodmFyIGksdCxuLHI9ZS5sZW5ndGgsbz1iLnJlbGF0aXZlW2VbMF0udHlwZV0sYT1vfHxiLnJlbGF0aXZlWyIgIl0scz1vPzE6MCx1PWJlKGZ1bmN0aW9uKGUpe3JldHVybiBlPT09aX0sYSwhMCksbD1iZShmdW5jdGlvbihlKXtyZXR1cm4tMTxQKGksZSl9LGEsITApLGM9W2Z1bmN0aW9uKGUsdCxuKXt2YXIgcj0hbyYmKG58fHQhPT13KXx8KChpPXQpLm5vZGVUeXBlP3UoZSx0LG4pOmwoZSx0LG4pKTtyZXR1cm4gaT1udWxsLHJ9XTtzPHI7cysrKWlmKHQ9Yi5yZWxhdGl2ZVtlW3NdLnR5cGVdKWM9W2JlKHdlKGMpLHQpXTtlbHNle2lmKCh0PWIuZmlsdGVyW2Vbc10udHlwZV0uYXBwbHkobnVsbCxlW3NdLm1hdGNoZXMpKVtTXSl7Zm9yKG49KytzO248cjtuKyspaWYoYi5yZWxhdGl2ZVtlW25dLnR5cGVdKWJyZWFrO3JldHVybiBDZSgxPHMmJndlKGMpLDE8cyYmeGUoZS5zbGljZSgwLHMtMSkuY29uY2F0KHt2YWx1ZToiICI9PT1lW3MtMl0udHlwZT8iKiI6IiJ9KSkucmVwbGFjZSgkLCIkMSIpLHQsczxuJiZFZShlLnNsaWNlKHMsbikpLG48ciYmRWUoZT1lLnNsaWNlKG4pKSxuPHImJnhlKGUpKX1jLnB1c2godCl9cmV0dXJuIHdlKGMpfXJldHVybiBtZS5wcm90b3R5cGU9Yi5maWx0ZXJzPWIucHNldWRvcyxiLnNldEZpbHRlcnM9bmV3IG1lLGg9c2UudG9rZW5pemU9ZnVuY3Rpb24oZSx0KXt2YXIgbixyLGksbyxhLHMsdSxsPXhbZSsiICJdO2lmKGwpcmV0dXJuIHQ/MDpsLnNsaWNlKDApO2E9ZSxzPVtdLHU9Yi5wcmVGaWx0ZXI7d2hpbGUoYSl7Zm9yKG8gaW4gbiYmIShyPV8uZXhlYyhhKSl8fChyJiYoYT1hLnNsaWNlKHJbMF0ubGVuZ3RoKXx8YSkscy5wdXNoKGk9W10pKSxuPSExLChyPXouZXhlYyhhKSkmJihuPXIuc2hpZnQoKSxpLnB1c2goe3ZhbHVlOm4sdHlwZTpyWzBdLnJlcGxhY2UoJCwiICIpfSksYT1hLnNsaWNlKG4ubGVuZ3RoKSksYi5maWx0ZXIpIShyPUdbb10uZXhlYyhhKSl8fHVbb10mJiEocj11W29dKHIpKXx8KG49ci5zaGlmdCgpLGkucHVzaCh7dmFsdWU6bix0eXBlOm8sbWF0Y2hlczpyfSksYT1hLnNsaWNlKG4ubGVuZ3RoKSk7aWYoIW4pYnJlYWt9cmV0dXJuIHQ/YS5sZW5ndGg6YT9zZS5lcnJvcihlKTp4KGUscykuc2xpY2UoMCl9LGY9c2UuY29tcGlsZT1mdW5jdGlvbihlLHQpe3ZhciBuLHYseSxtLHgscixpPVtdLG89W10sYT1BW2UrIiAiXTtpZighYSl7dHx8KHQ9aChlKSksbj10Lmxlbmd0aDt3aGlsZShuLS0pKGE9RWUodFtuXSkpW1NdP2kucHVzaChhKTpvLnB1c2goYSk7KGE9QShlLCh2PW8sbT0wPCh5PWkpLmxlbmd0aCx4PTA8di5sZW5ndGgscj1mdW5jdGlvbihlLHQsbixyLGkpe3ZhciBvLGEscyx1PTAsbD0iMCIsYz1lJiZbXSxmPVtdLHA9dyxkPWV8fHgmJmIuZmluZC5UQUcoIioiLGkpLGg9ays9bnVsbD09cD8xOk1hdGgucmFuZG9tKCl8fC4xLGc9ZC5sZW5ndGg7Zm9yKGkmJih3PXQ9PUN8fHR8fGkpO2whPT1nJiZudWxsIT0obz1kW2xdKTtsKyspe2lmKHgmJm8pe2E9MCx0fHxvLm93bmVyRG9jdW1lbnQ9PUN8fChUKG8pLG49IUUpO3doaWxlKHM9dlthKytdKWlmKHMobyx0fHxDLG4pKXtyLnB1c2gobyk7YnJlYWt9aSYmKGs9aCl9bSYmKChvPSFzJiZvKSYmdS0tLGUmJmMucHVzaChvKSl9aWYodSs9bCxtJiZsIT09dSl7YT0wO3doaWxlKHM9eVthKytdKXMoYyxmLHQsbik7aWYoZSl7aWYoMDx1KXdoaWxlKGwtLSljW2xdfHxmW2xdfHwoZltsXT1xLmNhbGwocikpO2Y9VGUoZil9SC5hcHBseShyLGYpLGkmJiFlJiYwPGYubGVuZ3RoJiYxPHUreS5sZW5ndGgmJnNlLnVuaXF1ZVNvcnQocil9cmV0dXJuIGkmJihrPWgsdz1wKSxjfSxtP2xlKHIpOnIpKSkuc2VsZWN0b3I9ZX1yZXR1cm4gYX0sZz1zZS5zZWxlY3Q9ZnVuY3Rpb24oZSx0LG4scil7dmFyIGksbyxhLHMsdSxsPSJmdW5jdGlvbiI9PXR5cGVvZiBlJiZlLGM9IXImJmgoZT1sLnNlbGVjdG9yfHxlKTtpZihuPW58fFtdLDE9PT1jLmxlbmd0aCl7aWYoMjwobz1jWzBdPWNbMF0uc2xpY2UoMCkpLmxlbmd0aCYmIklEIj09PShhPW9bMF0pLnR5cGUmJjk9PT10Lm5vZGVUeXBlJiZFJiZiLnJlbGF0aXZlW29bMV0udHlwZV0pe2lmKCEodD0oYi5maW5kLklEKGEubWF0Y2hlc1swXS5yZXBsYWNlKHRlLG5lKSx0KXx8W10pWzBdKSlyZXR1cm4gbjtsJiYodD10LnBhcmVudE5vZGUpLGU9ZS5zbGljZShvLnNoaWZ0KCkudmFsdWUubGVuZ3RoKX1pPUcubmVlZHNDb250ZXh0LnRlc3QoZSk/MDpvLmxlbmd0aDt3aGlsZShpLS0pe2lmKGE9b1tpXSxiLnJlbGF0aXZlW3M9YS50eXBlXSlicmVhaztpZigodT1iLmZpbmRbc10pJiYocj11KGEubWF0Y2hlc1swXS5yZXBsYWNlKHRlLG5lKSxlZS50ZXN0KG9bMF0udHlwZSkmJnllKHQucGFyZW50Tm9kZSl8fHQpKSl7aWYoby5zcGxpY2UoaSwxKSwhKGU9ci5sZW5ndGgmJnhlKG8pKSlyZXR1cm4gSC5hcHBseShuLHIpLG47YnJlYWt9fX1yZXR1cm4obHx8ZihlLGMpKShyLHQsIUUsbiwhdHx8ZWUudGVzdChlKSYmeWUodC5wYXJlbnROb2RlKXx8dCksbn0sZC5zb3J0U3RhYmxlPVMuc3BsaXQoIiIpLnNvcnQoRCkuam9pbigiIik9PT1TLGQuZGV0ZWN0RHVwbGljYXRlcz0hIWwsVCgpLGQuc29ydERldGFjaGVkPWNlKGZ1bmN0aW9uKGUpe3JldHVybiAxJmUuY29tcGFyZURvY3VtZW50UG9zaXRpb24oQy5jcmVhdGVFbGVtZW50KCJmaWVsZHNldCIpKX0pLGNlKGZ1bmN0aW9uKGUpe3JldHVybiBlLmlubmVySFRNTD0iPGEgaHJlZj0nIyc+PC9hPiIsIiMiPT09ZS5maXJzdENoaWxkLmdldEF0dHJpYnV0ZSgiaHJlZiIpfSl8fGZlKCJ0eXBlfGhyZWZ8aGVpZ2h0fHdpZHRoIixmdW5jdGlvbihlLHQsbil7aWYoIW4pcmV0dXJuIGUuZ2V0QXR0cmlidXRlKHQsInR5cGUiPT09dC50b0xvd2VyQ2FzZSgpPzE6Mil9KSxkLmF0dHJpYnV0ZXMmJmNlKGZ1bmN0aW9uKGUpe3JldHVybiBlLmlubmVySFRNTD0iPGlucHV0Lz4iLGUuZmlyc3RDaGlsZC5zZXRBdHRyaWJ1dGUoInZhbHVlIiwiIiksIiI9PT1lLmZpcnN0Q2hpbGQuZ2V0QXR0cmlidXRlKCJ2YWx1ZSIpfSl8fGZlKCJ2YWx1ZSIsZnVuY3Rpb24oZSx0LG4pe2lmKCFuJiYiaW5wdXQiPT09ZS5ub2RlTmFtZS50b0xvd2VyQ2FzZSgpKXJldHVybiBlLmRlZmF1bHRWYWx1ZX0pLGNlKGZ1bmN0aW9uKGUpe3JldHVybiBudWxsPT1lLmdldEF0dHJpYnV0ZSgiZGlzYWJsZWQiKX0pfHxmZShSLGZ1bmN0aW9uKGUsdCxuKXt2YXIgcjtpZighbilyZXR1cm4hMD09PWVbdF0/dC50b0xvd2VyQ2FzZSgpOihyPWUuZ2V0QXR0cmlidXRlTm9kZSh0KSkmJnIuc3BlY2lmaWVkP3IudmFsdWU6bnVsbH0pLHNlfShDKTtTLmZpbmQ9ZCxTLmV4cHI9ZC5zZWxlY3RvcnMsUy5leHByWyI6Il09Uy5leHByLnBzZXVkb3MsUy51bmlxdWVTb3J0PVMudW5pcXVlPWQudW5pcXVlU29ydCxTLnRleHQ9ZC5nZXRUZXh0LFMuaXNYTUxEb2M9ZC5pc1hNTCxTLmNvbnRhaW5zPWQuY29udGFpbnMsUy5lc2NhcGVTZWxlY3Rvcj1kLmVzY2FwZTt2YXIgaD1mdW5jdGlvbihlLHQsbil7dmFyIHI9W10saT12b2lkIDAhPT1uO3doaWxlKChlPWVbdF0pJiY5IT09ZS5ub2RlVHlwZSlpZigxPT09ZS5ub2RlVHlwZSl7aWYoaSYmUyhlKS5pcyhuKSlicmVhaztyLnB1c2goZSl9cmV0dXJuIHJ9LFQ9ZnVuY3Rpb24oZSx0KXtmb3IodmFyIG49W107ZTtlPWUubmV4dFNpYmxpbmcpMT09PWUubm9kZVR5cGUmJmUhPT10JiZuLnB1c2goZSk7cmV0dXJuIG59LGs9Uy5leHByLm1hdGNoLm5lZWRzQ29udGV4dDtmdW5jdGlvbiBBKGUsdCl7cmV0dXJuIGUubm9kZU5hbWUmJmUubm9kZU5hbWUudG9Mb3dlckNhc2UoKT09PXQudG9Mb3dlckNhc2UoKX12YXIgTj0vXjwoW2Etel1bXlwvXDA+Olx4MjBcdFxyXG5cZl0qKVtceDIwXHRcclxuXGZdKlwvPz4oPzo8XC9cMT58KSQvaTtmdW5jdGlvbiBEKGUsbixyKXtyZXR1cm4gbShuKT9TLmdyZXAoZSxmdW5jdGlvbihlLHQpe3JldHVybiEhbi5jYWxsKGUsdCxlKSE9PXJ9KTpuLm5vZGVUeXBlP1MuZ3JlcChlLGZ1bmN0aW9uKGUpe3JldHVybiBlPT09biE9PXJ9KToic3RyaW5nIiE9dHlwZW9mIG4/Uy5ncmVwKGUsZnVuY3Rpb24oZSl7cmV0dXJuLTE8aS5jYWxsKG4sZSkhPT1yfSk6Uy5maWx0ZXIobixlLHIpfVMuZmlsdGVyPWZ1bmN0aW9uKGUsdCxuKXt2YXIgcj10WzBdO3JldHVybiBuJiYoZT0iOm5vdCgiK2UrIikiKSwxPT09dC5sZW5ndGgmJjE9PT1yLm5vZGVUeXBlP1MuZmluZC5tYXRjaGVzU2VsZWN0b3IocixlKT9bcl06W106Uy5maW5kLm1hdGNoZXMoZSxTLmdyZXAodCxmdW5jdGlvbihlKXtyZXR1cm4gMT09PWUubm9kZVR5cGV9KSl9LFMuZm4uZXh0ZW5kKHtmaW5kOmZ1bmN0aW9uKGUpe3ZhciB0LG4scj10aGlzLmxlbmd0aCxpPXRoaXM7aWYoInN0cmluZyIhPXR5cGVvZiBlKXJldHVybiB0aGlzLnB1c2hTdGFjayhTKGUpLmZpbHRlcihmdW5jdGlvbigpe2Zvcih0PTA7dDxyO3QrKylpZihTLmNvbnRhaW5zKGlbdF0sdGhpcykpcmV0dXJuITB9KSk7Zm9yKG49dGhpcy5wdXNoU3RhY2soW10pLHQ9MDt0PHI7dCsrKVMuZmluZChlLGlbdF0sbik7cmV0dXJuIDE8cj9TLnVuaXF1ZVNvcnQobik6bn0sZmlsdGVyOmZ1bmN0aW9uKGUpe3JldHVybiB0aGlzLnB1c2hTdGFjayhEKHRoaXMsZXx8W10sITEpKX0sbm90OmZ1bmN0aW9uKGUpe3JldHVybiB0aGlzLnB1c2hTdGFjayhEKHRoaXMsZXx8W10sITApKX0saXM6ZnVuY3Rpb24oZSl7cmV0dXJuISFEKHRoaXMsInN0cmluZyI9PXR5cGVvZiBlJiZrLnRlc3QoZSk/UyhlKTplfHxbXSwhMSkubGVuZ3RofX0pO3ZhciBqLHE9L14oPzpccyooPFtcd1xXXSs+KVtePl0qfCMoW1x3LV0rKSkkLzsoUy5mbi5pbml0PWZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpO2lmKCFlKXJldHVybiB0aGlzO2lmKG49bnx8aiwic3RyaW5nIj09dHlwZW9mIGUpe2lmKCEocj0iPCI9PT1lWzBdJiYiPiI9PT1lW2UubGVuZ3RoLTFdJiYzPD1lLmxlbmd0aD9bbnVsbCxlLG51bGxdOnEuZXhlYyhlKSl8fCFyWzFdJiZ0KXJldHVybiF0fHx0LmpxdWVyeT8odHx8bikuZmluZChlKTp0aGlzLmNvbnN0cnVjdG9yKHQpLmZpbmQoZSk7aWYoclsxXSl7aWYodD10IGluc3RhbmNlb2YgUz90WzBdOnQsUy5tZXJnZSh0aGlzLFMucGFyc2VIVE1MKHJbMV0sdCYmdC5ub2RlVHlwZT90Lm93bmVyRG9jdW1lbnR8fHQ6RSwhMCkpLE4udGVzdChyWzFdKSYmUy5pc1BsYWluT2JqZWN0KHQpKWZvcihyIGluIHQpbSh0aGlzW3JdKT90aGlzW3JdKHRbcl0pOnRoaXMuYXR0cihyLHRbcl0pO3JldHVybiB0aGlzfXJldHVybihpPUUuZ2V0RWxlbWVudEJ5SWQoclsyXSkpJiYodGhpc1swXT1pLHRoaXMubGVuZ3RoPTEpLHRoaXN9cmV0dXJuIGUubm9kZVR5cGU/KHRoaXNbMF09ZSx0aGlzLmxlbmd0aD0xLHRoaXMpOm0oZSk/dm9pZCAwIT09bi5yZWFkeT9uLnJlYWR5KGUpOmUoUyk6Uy5tYWtlQXJyYXkoZSx0aGlzKX0pLnByb3RvdHlwZT1TLmZuLGo9UyhFKTt2YXIgTD0vXig/OnBhcmVudHN8cHJldig/OlVudGlsfEFsbCkpLyxIPXtjaGlsZHJlbjohMCxjb250ZW50czohMCxuZXh0OiEwLHByZXY6ITB9O2Z1bmN0aW9uIE8oZSx0KXt3aGlsZSgoZT1lW3RdKSYmMSE9PWUubm9kZVR5cGUpO3JldHVybiBlfVMuZm4uZXh0ZW5kKHtoYXM6ZnVuY3Rpb24oZSl7dmFyIHQ9UyhlLHRoaXMpLG49dC5sZW5ndGg7cmV0dXJuIHRoaXMuZmlsdGVyKGZ1bmN0aW9uKCl7Zm9yKHZhciBlPTA7ZTxuO2UrKylpZihTLmNvbnRhaW5zKHRoaXMsdFtlXSkpcmV0dXJuITB9KX0sY2xvc2VzdDpmdW5jdGlvbihlLHQpe3ZhciBuLHI9MCxpPXRoaXMubGVuZ3RoLG89W10sYT0ic3RyaW5nIiE9dHlwZW9mIGUmJlMoZSk7aWYoIWsudGVzdChlKSlmb3IoO3I8aTtyKyspZm9yKG49dGhpc1tyXTtuJiZuIT09dDtuPW4ucGFyZW50Tm9kZSlpZihuLm5vZGVUeXBlPDExJiYoYT8tMTxhLmluZGV4KG4pOjE9PT1uLm5vZGVUeXBlJiZTLmZpbmQubWF0Y2hlc1NlbGVjdG9yKG4sZSkpKXtvLnB1c2gobik7YnJlYWt9cmV0dXJuIHRoaXMucHVzaFN0YWNrKDE8by5sZW5ndGg/Uy51bmlxdWVTb3J0KG8pOm8pfSxpbmRleDpmdW5jdGlvbihlKXtyZXR1cm4gZT8ic3RyaW5nIj09dHlwZW9mIGU/aS5jYWxsKFMoZSksdGhpc1swXSk6aS5jYWxsKHRoaXMsZS5qcXVlcnk/ZVswXTplKTp0aGlzWzBdJiZ0aGlzWzBdLnBhcmVudE5vZGU/dGhpcy5maXJzdCgpLnByZXZBbGwoKS5sZW5ndGg6LTF9LGFkZDpmdW5jdGlvbihlLHQpe3JldHVybiB0aGlzLnB1c2hTdGFjayhTLnVuaXF1ZVNvcnQoUy5tZXJnZSh0aGlzLmdldCgpLFMoZSx0KSkpKX0sYWRkQmFjazpmdW5jdGlvbihlKXtyZXR1cm4gdGhpcy5hZGQobnVsbD09ZT90aGlzLnByZXZPYmplY3Q6dGhpcy5wcmV2T2JqZWN0LmZpbHRlcihlKSl9fSksUy5lYWNoKHtwYXJlbnQ6ZnVuY3Rpb24oZSl7dmFyIHQ9ZS5wYXJlbnROb2RlO3JldHVybiB0JiYxMSE9PXQubm9kZVR5cGU/dDpudWxsfSxwYXJlbnRzOmZ1bmN0aW9uKGUpe3JldHVybiBoKGUsInBhcmVudE5vZGUiKX0scGFyZW50c1VudGlsOmZ1bmN0aW9uKGUsdCxuKXtyZXR1cm4gaChlLCJwYXJlbnROb2RlIixuKX0sbmV4dDpmdW5jdGlvbihlKXtyZXR1cm4gTyhlLCJuZXh0U2libGluZyIpfSxwcmV2OmZ1bmN0aW9uKGUpe3JldHVybiBPKGUsInByZXZpb3VzU2libGluZyIpfSxuZXh0QWxsOmZ1bmN0aW9uKGUpe3JldHVybiBoKGUsIm5leHRTaWJsaW5nIil9LHByZXZBbGw6ZnVuY3Rpb24oZSl7cmV0dXJuIGgoZSwicHJldmlvdXNTaWJsaW5nIil9LG5leHRVbnRpbDpmdW5jdGlvbihlLHQsbil7cmV0dXJuIGgoZSwibmV4dFNpYmxpbmciLG4pfSxwcmV2VW50aWw6ZnVuY3Rpb24oZSx0LG4pe3JldHVybiBoKGUsInByZXZpb3VzU2libGluZyIsbil9LHNpYmxpbmdzOmZ1bmN0aW9uKGUpe3JldHVybiBUKChlLnBhcmVudE5vZGV8fHt9KS5maXJzdENoaWxkLGUpfSxjaGlsZHJlbjpmdW5jdGlvbihlKXtyZXR1cm4gVChlLmZpcnN0Q2hpbGQpfSxjb250ZW50czpmdW5jdGlvbihlKXtyZXR1cm4gbnVsbCE9ZS5jb250ZW50RG9jdW1lbnQmJnIoZS5jb250ZW50RG9jdW1lbnQpP2UuY29udGVudERvY3VtZW50OihBKGUsInRlbXBsYXRlIikmJihlPWUuY29udGVudHx8ZSksUy5tZXJnZShbXSxlLmNoaWxkTm9kZXMpKX19LGZ1bmN0aW9uKHIsaSl7Uy5mbltyXT1mdW5jdGlvbihlLHQpe3ZhciBuPVMubWFwKHRoaXMsaSxlKTtyZXR1cm4iVW50aWwiIT09ci5zbGljZSgtNSkmJih0PWUpLHQmJiJzdHJpbmciPT10eXBlb2YgdCYmKG49Uy5maWx0ZXIodCxuKSksMTx0aGlzLmxlbmd0aCYmKEhbcl18fFMudW5pcXVlU29ydChuKSxMLnRlc3QocikmJm4ucmV2ZXJzZSgpKSx0aGlzLnB1c2hTdGFjayhuKX19KTt2YXIgUD0vW15ceDIwXHRcclxuXGZdKy9nO2Z1bmN0aW9uIFIoZSl7cmV0dXJuIGV9ZnVuY3Rpb24gTShlKXt0aHJvdyBlfWZ1bmN0aW9uIEkoZSx0LG4scil7dmFyIGk7dHJ5e2UmJm0oaT1lLnByb21pc2UpP2kuY2FsbChlKS5kb25lKHQpLmZhaWwobik6ZSYmbShpPWUudGhlbik/aS5jYWxsKGUsdCxuKTp0LmFwcGx5KHZvaWQgMCxbZV0uc2xpY2UocikpfWNhdGNoKGUpe24uYXBwbHkodm9pZCAwLFtlXSl9fVMuQ2FsbGJhY2tzPWZ1bmN0aW9uKHIpe3ZhciBlLG47cj0ic3RyaW5nIj09dHlwZW9mIHI/KGU9cixuPXt9LFMuZWFjaChlLm1hdGNoKFApfHxbXSxmdW5jdGlvbihlLHQpe25bdF09ITB9KSxuKTpTLmV4dGVuZCh7fSxyKTt2YXIgaSx0LG8sYSxzPVtdLHU9W10sbD0tMSxjPWZ1bmN0aW9uKCl7Zm9yKGE9YXx8ci5vbmNlLG89aT0hMDt1Lmxlbmd0aDtsPS0xKXt0PXUuc2hpZnQoKTt3aGlsZSgrK2w8cy5sZW5ndGgpITE9PT1zW2xdLmFwcGx5KHRbMF0sdFsxXSkmJnIuc3RvcE9uRmFsc2UmJihsPXMubGVuZ3RoLHQ9ITEpfXIubWVtb3J5fHwodD0hMSksaT0hMSxhJiYocz10P1tdOiIiKX0sZj17YWRkOmZ1bmN0aW9uKCl7cmV0dXJuIHMmJih0JiYhaSYmKGw9cy5sZW5ndGgtMSx1LnB1c2godCkpLGZ1bmN0aW9uIG4oZSl7Uy5lYWNoKGUsZnVuY3Rpb24oZSx0KXttKHQpP3IudW5pcXVlJiZmLmhhcyh0KXx8cy5wdXNoKHQpOnQmJnQubGVuZ3RoJiYic3RyaW5nIiE9PXcodCkmJm4odCl9KX0oYXJndW1lbnRzKSx0JiYhaSYmYygpKSx0aGlzfSxyZW1vdmU6ZnVuY3Rpb24oKXtyZXR1cm4gUy5lYWNoKGFyZ3VtZW50cyxmdW5jdGlvbihlLHQpe3ZhciBuO3doaWxlKC0xPChuPVMuaW5BcnJheSh0LHMsbikpKXMuc3BsaWNlKG4sMSksbjw9bCYmbC0tfSksdGhpc30saGFzOmZ1bmN0aW9uKGUpe3JldHVybiBlPy0xPFMuaW5BcnJheShlLHMpOjA8cy5sZW5ndGh9LGVtcHR5OmZ1bmN0aW9uKCl7cmV0dXJuIHMmJihzPVtdKSx0aGlzfSxkaXNhYmxlOmZ1bmN0aW9uKCl7cmV0dXJuIGE9dT1bXSxzPXQ9IiIsdGhpc30sZGlzYWJsZWQ6ZnVuY3Rpb24oKXtyZXR1cm4hc30sbG9jazpmdW5jdGlvbigpe3JldHVybiBhPXU9W10sdHx8aXx8KHM9dD0iIiksdGhpc30sbG9ja2VkOmZ1bmN0aW9uKCl7cmV0dXJuISFhfSxmaXJlV2l0aDpmdW5jdGlvbihlLHQpe3JldHVybiBhfHwodD1bZSwodD10fHxbXSkuc2xpY2U/dC5zbGljZSgpOnRdLHUucHVzaCh0KSxpfHxjKCkpLHRoaXN9LGZpcmU6ZnVuY3Rpb24oKXtyZXR1cm4gZi5maXJlV2l0aCh0aGlzLGFyZ3VtZW50cyksdGhpc30sZmlyZWQ6ZnVuY3Rpb24oKXtyZXR1cm4hIW99fTtyZXR1cm4gZn0sUy5leHRlbmQoe0RlZmVycmVkOmZ1bmN0aW9uKGUpe3ZhciBvPVtbIm5vdGlmeSIsInByb2dyZXNzIixTLkNhbGxiYWNrcygibWVtb3J5IiksUy5DYWxsYmFja3MoIm1lbW9yeSIpLDJdLFsicmVzb2x2ZSIsImRvbmUiLFMuQ2FsbGJhY2tzKCJvbmNlIG1lbW9yeSIpLFMuQ2FsbGJhY2tzKCJvbmNlIG1lbW9yeSIpLDAsInJlc29sdmVkIl0sWyJyZWplY3QiLCJmYWlsIixTLkNhbGxiYWNrcygib25jZSBtZW1vcnkiKSxTLkNhbGxiYWNrcygib25jZSBtZW1vcnkiKSwxLCJyZWplY3RlZCJdXSxpPSJwZW5kaW5nIixhPXtzdGF0ZTpmdW5jdGlvbigpe3JldHVybiBpfSxhbHdheXM6ZnVuY3Rpb24oKXtyZXR1cm4gcy5kb25lKGFyZ3VtZW50cykuZmFpbChhcmd1bWVudHMpLHRoaXN9LCJjYXRjaCI6ZnVuY3Rpb24oZSl7cmV0dXJuIGEudGhlbihudWxsLGUpfSxwaXBlOmZ1bmN0aW9uKCl7dmFyIGk9YXJndW1lbnRzO3JldHVybiBTLkRlZmVycmVkKGZ1bmN0aW9uKHIpe1MuZWFjaChvLGZ1bmN0aW9uKGUsdCl7dmFyIG49bShpW3RbNF1dKSYmaVt0WzRdXTtzW3RbMV1dKGZ1bmN0aW9uKCl7dmFyIGU9biYmbi5hcHBseSh0aGlzLGFyZ3VtZW50cyk7ZSYmbShlLnByb21pc2UpP2UucHJvbWlzZSgpLnByb2dyZXNzKHIubm90aWZ5KS5kb25lKHIucmVzb2x2ZSkuZmFpbChyLnJlamVjdCk6clt0WzBdKyJXaXRoIl0odGhpcyxuP1tlXTphcmd1bWVudHMpfSl9KSxpPW51bGx9KS5wcm9taXNlKCl9LHRoZW46ZnVuY3Rpb24odCxuLHIpe3ZhciB1PTA7ZnVuY3Rpb24gbChpLG8sYSxzKXtyZXR1cm4gZnVuY3Rpb24oKXt2YXIgbj10aGlzLHI9YXJndW1lbnRzLGU9ZnVuY3Rpb24oKXt2YXIgZSx0O2lmKCEoaTx1KSl7aWYoKGU9YS5hcHBseShuLHIpKT09PW8ucHJvbWlzZSgpKXRocm93IG5ldyBUeXBlRXJyb3IoIlRoZW5hYmxlIHNlbGYtcmVzb2x1dGlvbiIpO3Q9ZSYmKCJvYmplY3QiPT10eXBlb2YgZXx8ImZ1bmN0aW9uIj09dHlwZW9mIGUpJiZlLnRoZW4sbSh0KT9zP3QuY2FsbChlLGwodSxvLFIscyksbCh1LG8sTSxzKSk6KHUrKyx0LmNhbGwoZSxsKHUsbyxSLHMpLGwodSxvLE0scyksbCh1LG8sUixvLm5vdGlmeVdpdGgpKSk6KGEhPT1SJiYobj12b2lkIDAscj1bZV0pLChzfHxvLnJlc29sdmVXaXRoKShuLHIpKX19LHQ9cz9lOmZ1bmN0aW9uKCl7dHJ5e2UoKX1jYXRjaChlKXtTLkRlZmVycmVkLmV4Y2VwdGlvbkhvb2smJlMuRGVmZXJyZWQuZXhjZXB0aW9uSG9vayhlLHQuc3RhY2tUcmFjZSksdTw9aSsxJiYoYSE9PU0mJihuPXZvaWQgMCxyPVtlXSksby5yZWplY3RXaXRoKG4scikpfX07aT90KCk6KFMuRGVmZXJyZWQuZ2V0U3RhY2tIb29rJiYodC5zdGFja1RyYWNlPVMuRGVmZXJyZWQuZ2V0U3RhY2tIb29rKCkpLEMuc2V0VGltZW91dCh0KSl9fXJldHVybiBTLkRlZmVycmVkKGZ1bmN0aW9uKGUpe29bMF1bM10uYWRkKGwoMCxlLG0ocik/cjpSLGUubm90aWZ5V2l0aCkpLG9bMV1bM10uYWRkKGwoMCxlLG0odCk/dDpSKSksb1syXVszXS5hZGQobCgwLGUsbShuKT9uOk0pKX0pLnByb21pc2UoKX0scHJvbWlzZTpmdW5jdGlvbihlKXtyZXR1cm4gbnVsbCE9ZT9TLmV4dGVuZChlLGEpOmF9fSxzPXt9O3JldHVybiBTLmVhY2gobyxmdW5jdGlvbihlLHQpe3ZhciBuPXRbMl0scj10WzVdO2FbdFsxXV09bi5hZGQsciYmbi5hZGQoZnVuY3Rpb24oKXtpPXJ9LG9bMy1lXVsyXS5kaXNhYmxlLG9bMy1lXVszXS5kaXNhYmxlLG9bMF1bMl0ubG9jayxvWzBdWzNdLmxvY2spLG4uYWRkKHRbM10uZmlyZSksc1t0WzBdXT1mdW5jdGlvbigpe3JldHVybiBzW3RbMF0rIldpdGgiXSh0aGlzPT09cz92b2lkIDA6dGhpcyxhcmd1bWVudHMpLHRoaXN9LHNbdFswXSsiV2l0aCJdPW4uZmlyZVdpdGh9KSxhLnByb21pc2UocyksZSYmZS5jYWxsKHMscyksc30sd2hlbjpmdW5jdGlvbihlKXt2YXIgbj1hcmd1bWVudHMubGVuZ3RoLHQ9bixyPUFycmF5KHQpLGk9cy5jYWxsKGFyZ3VtZW50cyksbz1TLkRlZmVycmVkKCksYT1mdW5jdGlvbih0KXtyZXR1cm4gZnVuY3Rpb24oZSl7clt0XT10aGlzLGlbdF09MTxhcmd1bWVudHMubGVuZ3RoP3MuY2FsbChhcmd1bWVudHMpOmUsLS1ufHxvLnJlc29sdmVXaXRoKHIsaSl9fTtpZihuPD0xJiYoSShlLG8uZG9uZShhKHQpKS5yZXNvbHZlLG8ucmVqZWN0LCFuKSwicGVuZGluZyI9PT1vLnN0YXRlKCl8fG0oaVt0XSYmaVt0XS50aGVuKSkpcmV0dXJuIG8udGhlbigpO3doaWxlKHQtLSlJKGlbdF0sYSh0KSxvLnJlamVjdCk7cmV0dXJuIG8ucHJvbWlzZSgpfX0pO3ZhciBXPS9eKEV2YWx8SW50ZXJuYWx8UmFuZ2V8UmVmZXJlbmNlfFN5bnRheHxUeXBlfFVSSSlFcnJvciQvO1MuRGVmZXJyZWQuZXhjZXB0aW9uSG9vaz1mdW5jdGlvbihlLHQpe0MuY29uc29sZSYmQy5jb25zb2xlLndhcm4mJmUmJlcudGVzdChlLm5hbWUpJiZDLmNvbnNvbGUud2FybigialF1ZXJ5LkRlZmVycmVkIGV4Y2VwdGlvbjogIitlLm1lc3NhZ2UsZS5zdGFjayx0KX0sUy5yZWFkeUV4Y2VwdGlvbj1mdW5jdGlvbihlKXtDLnNldFRpbWVvdXQoZnVuY3Rpb24oKXt0aHJvdyBlfSl9O3ZhciBGPVMuRGVmZXJyZWQoKTtmdW5jdGlvbiBCKCl7RS5yZW1vdmVFdmVudExpc3RlbmVyKCJET01Db250ZW50TG9hZGVkIixCKSxDLnJlbW92ZUV2ZW50TGlzdGVuZXIoImxvYWQiLEIpLFMucmVhZHkoKX1TLmZuLnJlYWR5PWZ1bmN0aW9uKGUpe3JldHVybiBGLnRoZW4oZSlbImNhdGNoIl0oZnVuY3Rpb24oZSl7Uy5yZWFkeUV4Y2VwdGlvbihlKX0pLHRoaXN9LFMuZXh0ZW5kKHtpc1JlYWR5OiExLHJlYWR5V2FpdDoxLHJlYWR5OmZ1bmN0aW9uKGUpeyghMD09PWU/LS1TLnJlYWR5V2FpdDpTLmlzUmVhZHkpfHwoUy5pc1JlYWR5PSEwKSE9PWUmJjA8LS1TLnJlYWR5V2FpdHx8Ri5yZXNvbHZlV2l0aChFLFtTXSl9fSksUy5yZWFkeS50aGVuPUYudGhlbiwiY29tcGxldGUiPT09RS5yZWFkeVN0YXRlfHwibG9hZGluZyIhPT1FLnJlYWR5U3RhdGUmJiFFLmRvY3VtZW50RWxlbWVudC5kb1Njcm9sbD9DLnNldFRpbWVvdXQoUy5yZWFkeSk6KEUuYWRkRXZlbnRMaXN0ZW5lcigiRE9NQ29udGVudExvYWRlZCIsQiksQy5hZGRFdmVudExpc3RlbmVyKCJsb2FkIixCKSk7dmFyICQ9ZnVuY3Rpb24oZSx0LG4scixpLG8sYSl7dmFyIHM9MCx1PWUubGVuZ3RoLGw9bnVsbD09bjtpZigib2JqZWN0Ij09PXcobikpZm9yKHMgaW4gaT0hMCxuKSQoZSx0LHMsbltzXSwhMCxvLGEpO2Vsc2UgaWYodm9pZCAwIT09ciYmKGk9ITAsbShyKXx8KGE9ITApLGwmJihhPyh0LmNhbGwoZSxyKSx0PW51bGwpOihsPXQsdD1mdW5jdGlvbihlLHQsbil7cmV0dXJuIGwuY2FsbChTKGUpLG4pfSkpLHQpKWZvcig7czx1O3MrKyl0KGVbc10sbixhP3I6ci5jYWxsKGVbc10scyx0KGVbc10sbikpKTtyZXR1cm4gaT9lOmw/dC5jYWxsKGUpOnU/dChlWzBdLG4pOm99LF89L14tbXMtLyx6PS8tKFthLXpdKS9nO2Z1bmN0aW9uIFUoZSx0KXtyZXR1cm4gdC50b1VwcGVyQ2FzZSgpfWZ1bmN0aW9uIFgoZSl7cmV0dXJuIGUucmVwbGFjZShfLCJtcy0iKS5yZXBsYWNlKHosVSl9dmFyIFY9ZnVuY3Rpb24oZSl7cmV0dXJuIDE9PT1lLm5vZGVUeXBlfHw5PT09ZS5ub2RlVHlwZXx8IStlLm5vZGVUeXBlfTtmdW5jdGlvbiBHKCl7dGhpcy5leHBhbmRvPVMuZXhwYW5kbytHLnVpZCsrfUcudWlkPTEsRy5wcm90b3R5cGU9e2NhY2hlOmZ1bmN0aW9uKGUpe3ZhciB0PWVbdGhpcy5leHBhbmRvXTtyZXR1cm4gdHx8KHQ9e30sVihlKSYmKGUubm9kZVR5cGU/ZVt0aGlzLmV4cGFuZG9dPXQ6T2JqZWN0LmRlZmluZVByb3BlcnR5KGUsdGhpcy5leHBhbmRvLHt2YWx1ZTp0LGNvbmZpZ3VyYWJsZTohMH0pKSksdH0sc2V0OmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpPXRoaXMuY2FjaGUoZSk7aWYoInN0cmluZyI9PXR5cGVvZiB0KWlbWCh0KV09bjtlbHNlIGZvcihyIGluIHQpaVtYKHIpXT10W3JdO3JldHVybiBpfSxnZXQ6ZnVuY3Rpb24oZSx0KXtyZXR1cm4gdm9pZCAwPT09dD90aGlzLmNhY2hlKGUpOmVbdGhpcy5leHBhbmRvXSYmZVt0aGlzLmV4cGFuZG9dW1godCldfSxhY2Nlc3M6ZnVuY3Rpb24oZSx0LG4pe3JldHVybiB2b2lkIDA9PT10fHx0JiYic3RyaW5nIj09dHlwZW9mIHQmJnZvaWQgMD09PW4/dGhpcy5nZXQoZSx0KToodGhpcy5zZXQoZSx0LG4pLHZvaWQgMCE9PW4/bjp0KX0scmVtb3ZlOmZ1bmN0aW9uKGUsdCl7dmFyIG4scj1lW3RoaXMuZXhwYW5kb107aWYodm9pZCAwIT09cil7aWYodm9pZCAwIT09dCl7bj0odD1BcnJheS5pc0FycmF5KHQpP3QubWFwKFgpOih0PVgodCkpaW4gcj9bdF06dC5tYXRjaChQKXx8W10pLmxlbmd0aDt3aGlsZShuLS0pZGVsZXRlIHJbdFtuXV19KHZvaWQgMD09PXR8fFMuaXNFbXB0eU9iamVjdChyKSkmJihlLm5vZGVUeXBlP2VbdGhpcy5leHBhbmRvXT12b2lkIDA6ZGVsZXRlIGVbdGhpcy5leHBhbmRvXSl9fSxoYXNEYXRhOmZ1bmN0aW9uKGUpe3ZhciB0PWVbdGhpcy5leHBhbmRvXTtyZXR1cm4gdm9pZCAwIT09dCYmIVMuaXNFbXB0eU9iamVjdCh0KX19O3ZhciBZPW5ldyBHLFE9bmV3IEcsSj0vXig/Olx7W1x3XFddKlx9fFxbW1x3XFddKlxdKSQvLEs9L1tBLVpdL2c7ZnVuY3Rpb24gWihlLHQsbil7dmFyIHIsaTtpZih2b2lkIDA9PT1uJiYxPT09ZS5ub2RlVHlwZSlpZihyPSJkYXRhLSIrdC5yZXBsYWNlKEssIi0kJiIpLnRvTG93ZXJDYXNlKCksInN0cmluZyI9PXR5cGVvZihuPWUuZ2V0QXR0cmlidXRlKHIpKSl7dHJ5e249InRydWUiPT09KGk9bil8fCJmYWxzZSIhPT1pJiYoIm51bGwiPT09aT9udWxsOmk9PT0raSsiIj8raTpKLnRlc3QoaSk/SlNPTi5wYXJzZShpKTppKX1jYXRjaChlKXt9US5zZXQoZSx0LG4pfWVsc2Ugbj12b2lkIDA7cmV0dXJuIG59Uy5leHRlbmQoe2hhc0RhdGE6ZnVuY3Rpb24oZSl7cmV0dXJuIFEuaGFzRGF0YShlKXx8WS5oYXNEYXRhKGUpfSxkYXRhOmZ1bmN0aW9uKGUsdCxuKXtyZXR1cm4gUS5hY2Nlc3MoZSx0LG4pfSxyZW1vdmVEYXRhOmZ1bmN0aW9uKGUsdCl7US5yZW1vdmUoZSx0KX0sX2RhdGE6ZnVuY3Rpb24oZSx0LG4pe3JldHVybiBZLmFjY2VzcyhlLHQsbil9LF9yZW1vdmVEYXRhOmZ1bmN0aW9uKGUsdCl7WS5yZW1vdmUoZSx0KX19KSxTLmZuLmV4dGVuZCh7ZGF0YTpmdW5jdGlvbihuLGUpe3ZhciB0LHIsaSxvPXRoaXNbMF0sYT1vJiZvLmF0dHJpYnV0ZXM7aWYodm9pZCAwPT09bil7aWYodGhpcy5sZW5ndGgmJihpPVEuZ2V0KG8pLDE9PT1vLm5vZGVUeXBlJiYhWS5nZXQobywiaGFzRGF0YUF0dHJzIikpKXt0PWEubGVuZ3RoO3doaWxlKHQtLSlhW3RdJiYwPT09KHI9YVt0XS5uYW1lKS5pbmRleE9mKCJkYXRhLSIpJiYocj1YKHIuc2xpY2UoNSkpLFoobyxyLGlbcl0pKTtZLnNldChvLCJoYXNEYXRhQXR0cnMiLCEwKX1yZXR1cm4gaX1yZXR1cm4ib2JqZWN0Ij09dHlwZW9mIG4/dGhpcy5lYWNoKGZ1bmN0aW9uKCl7US5zZXQodGhpcyxuKX0pOiQodGhpcyxmdW5jdGlvbihlKXt2YXIgdDtpZihvJiZ2b2lkIDA9PT1lKXJldHVybiB2b2lkIDAhPT0odD1RLmdldChvLG4pKT90OnZvaWQgMCE9PSh0PVoobyxuKSk/dDp2b2lkIDA7dGhpcy5lYWNoKGZ1bmN0aW9uKCl7US5zZXQodGhpcyxuLGUpfSl9LG51bGwsZSwxPGFyZ3VtZW50cy5sZW5ndGgsbnVsbCwhMCl9LHJlbW92ZURhdGE6ZnVuY3Rpb24oZSl7cmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbigpe1EucmVtb3ZlKHRoaXMsZSl9KX19KSxTLmV4dGVuZCh7cXVldWU6ZnVuY3Rpb24oZSx0LG4pe3ZhciByO2lmKGUpcmV0dXJuIHQ9KHR8fCJmeCIpKyJxdWV1ZSIscj1ZLmdldChlLHQpLG4mJighcnx8QXJyYXkuaXNBcnJheShuKT9yPVkuYWNjZXNzKGUsdCxTLm1ha2VBcnJheShuKSk6ci5wdXNoKG4pKSxyfHxbXX0sZGVxdWV1ZTpmdW5jdGlvbihlLHQpe3Q9dHx8ImZ4Ijt2YXIgbj1TLnF1ZXVlKGUsdCkscj1uLmxlbmd0aCxpPW4uc2hpZnQoKSxvPVMuX3F1ZXVlSG9va3MoZSx0KTsiaW5wcm9ncmVzcyI9PT1pJiYoaT1uLnNoaWZ0KCksci0tKSxpJiYoImZ4Ij09PXQmJm4udW5zaGlmdCgiaW5wcm9ncmVzcyIpLGRlbGV0ZSBvLnN0b3AsaS5jYWxsKGUsZnVuY3Rpb24oKXtTLmRlcXVldWUoZSx0KX0sbykpLCFyJiZvJiZvLmVtcHR5LmZpcmUoKX0sX3F1ZXVlSG9va3M6ZnVuY3Rpb24oZSx0KXt2YXIgbj10KyJxdWV1ZUhvb2tzIjtyZXR1cm4gWS5nZXQoZSxuKXx8WS5hY2Nlc3MoZSxuLHtlbXB0eTpTLkNhbGxiYWNrcygib25jZSBtZW1vcnkiKS5hZGQoZnVuY3Rpb24oKXtZLnJlbW92ZShlLFt0KyJxdWV1ZSIsbl0pfSl9KX19KSxTLmZuLmV4dGVuZCh7cXVldWU6ZnVuY3Rpb24odCxuKXt2YXIgZT0yO3JldHVybiJzdHJpbmciIT10eXBlb2YgdCYmKG49dCx0PSJmeCIsZS0tKSxhcmd1bWVudHMubGVuZ3RoPGU/Uy5xdWV1ZSh0aGlzWzBdLHQpOnZvaWQgMD09PW4/dGhpczp0aGlzLmVhY2goZnVuY3Rpb24oKXt2YXIgZT1TLnF1ZXVlKHRoaXMsdCxuKTtTLl9xdWV1ZUhvb2tzKHRoaXMsdCksImZ4Ij09PXQmJiJpbnByb2dyZXNzIiE9PWVbMF0mJlMuZGVxdWV1ZSh0aGlzLHQpfSl9LGRlcXVldWU6ZnVuY3Rpb24oZSl7cmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbigpe1MuZGVxdWV1ZSh0aGlzLGUpfSl9LGNsZWFyUXVldWU6ZnVuY3Rpb24oZSl7cmV0dXJuIHRoaXMucXVldWUoZXx8ImZ4IixbXSl9LHByb21pc2U6ZnVuY3Rpb24oZSx0KXt2YXIgbixyPTEsaT1TLkRlZmVycmVkKCksbz10aGlzLGE9dGhpcy5sZW5ndGgscz1mdW5jdGlvbigpey0tcnx8aS5yZXNvbHZlV2l0aChvLFtvXSl9OyJzdHJpbmciIT10eXBlb2YgZSYmKHQ9ZSxlPXZvaWQgMCksZT1lfHwiZngiO3doaWxlKGEtLSkobj1ZLmdldChvW2FdLGUrInF1ZXVlSG9va3MiKSkmJm4uZW1wdHkmJihyKyssbi5lbXB0eS5hZGQocykpO3JldHVybiBzKCksaS5wcm9taXNlKHQpfX0pO3ZhciBlZT0vWystXT8oPzpcZCpcLnwpXGQrKD86W2VFXVsrLV0/XGQrfCkvLnNvdXJjZSx0ZT1uZXcgUmVnRXhwKCJeKD86KFsrLV0pPXwpKCIrZWUrIikoW2EteiVdKikkIiwiaSIpLG5lPVsiVG9wIiwiUmlnaHQiLCJCb3R0b20iLCJMZWZ0Il0scmU9RS5kb2N1bWVudEVsZW1lbnQsaWU9ZnVuY3Rpb24oZSl7cmV0dXJuIFMuY29udGFpbnMoZS5vd25lckRvY3VtZW50LGUpfSxvZT17Y29tcG9zZWQ6ITB9O3JlLmdldFJvb3ROb2RlJiYoaWU9ZnVuY3Rpb24oZSl7cmV0dXJuIFMuY29udGFpbnMoZS5vd25lckRvY3VtZW50LGUpfHxlLmdldFJvb3ROb2RlKG9lKT09PWUub3duZXJEb2N1bWVudH0pO3ZhciBhZT1mdW5jdGlvbihlLHQpe3JldHVybiJub25lIj09PShlPXR8fGUpLnN0eWxlLmRpc3BsYXl8fCIiPT09ZS5zdHlsZS5kaXNwbGF5JiZpZShlKSYmIm5vbmUiPT09Uy5jc3MoZSwiZGlzcGxheSIpfTtmdW5jdGlvbiBzZShlLHQsbixyKXt2YXIgaSxvLGE9MjAscz1yP2Z1bmN0aW9uKCl7cmV0dXJuIHIuY3VyKCl9OmZ1bmN0aW9uKCl7cmV0dXJuIFMuY3NzKGUsdCwiIil9LHU9cygpLGw9biYmblszXXx8KFMuY3NzTnVtYmVyW3RdPyIiOiJweCIpLGM9ZS5ub2RlVHlwZSYmKFMuY3NzTnVtYmVyW3RdfHwicHgiIT09bCYmK3UpJiZ0ZS5leGVjKFMuY3NzKGUsdCkpO2lmKGMmJmNbM10hPT1sKXt1Lz0yLGw9bHx8Y1szXSxjPSt1fHwxO3doaWxlKGEtLSlTLnN0eWxlKGUsdCxjK2wpLCgxLW8pKigxLShvPXMoKS91fHwuNSkpPD0wJiYoYT0wKSxjLz1vO2MqPTIsUy5zdHlsZShlLHQsYytsKSxuPW58fFtdfXJldHVybiBuJiYoYz0rY3x8K3V8fDAsaT1uWzFdP2MrKG5bMV0rMSkqblsyXTorblsyXSxyJiYoci51bml0PWwsci5zdGFydD1jLHIuZW5kPWkpKSxpfXZhciB1ZT17fTtmdW5jdGlvbiBsZShlLHQpe2Zvcih2YXIgbixyLGksbyxhLHMsdSxsPVtdLGM9MCxmPWUubGVuZ3RoO2M8ZjtjKyspKHI9ZVtjXSkuc3R5bGUmJihuPXIuc3R5bGUuZGlzcGxheSx0Pygibm9uZSI9PT1uJiYobFtjXT1ZLmdldChyLCJkaXNwbGF5Iil8fG51bGwsbFtjXXx8KHIuc3R5bGUuZGlzcGxheT0iIikpLCIiPT09ci5zdHlsZS5kaXNwbGF5JiZhZShyKSYmKGxbY109KHU9YT1vPXZvaWQgMCxhPShpPXIpLm93bmVyRG9jdW1lbnQscz1pLm5vZGVOYW1lLCh1PXVlW3NdKXx8KG89YS5ib2R5LmFwcGVuZENoaWxkKGEuY3JlYXRlRWxlbWVudChzKSksdT1TLmNzcyhvLCJkaXNwbGF5Iiksby5wYXJlbnROb2RlLnJlbW92ZUNoaWxkKG8pLCJub25lIj09PXUmJih1PSJibG9jayIpLHVlW3NdPXUpKSkpOiJub25lIiE9PW4mJihsW2NdPSJub25lIixZLnNldChyLCJkaXNwbGF5IixuKSkpO2ZvcihjPTA7YzxmO2MrKyludWxsIT1sW2NdJiYoZVtjXS5zdHlsZS5kaXNwbGF5PWxbY10pO3JldHVybiBlfVMuZm4uZXh0ZW5kKHtzaG93OmZ1bmN0aW9uKCl7cmV0dXJuIGxlKHRoaXMsITApfSxoaWRlOmZ1bmN0aW9uKCl7cmV0dXJuIGxlKHRoaXMpfSx0b2dnbGU6ZnVuY3Rpb24oZSl7cmV0dXJuImJvb2xlYW4iPT10eXBlb2YgZT9lP3RoaXMuc2hvdygpOnRoaXMuaGlkZSgpOnRoaXMuZWFjaChmdW5jdGlvbigpe2FlKHRoaXMpP1ModGhpcykuc2hvdygpOlModGhpcykuaGlkZSgpfSl9fSk7dmFyIGNlLGZlLHBlPS9eKD86Y2hlY2tib3h8cmFkaW8pJC9pLGRlPS88KFthLXpdW15cL1wwPlx4MjBcdFxyXG5cZl0qKS9pLGhlPS9eJHxebW9kdWxlJHxcLyg/OmphdmF8ZWNtYSlzY3JpcHQvaTtjZT1FLmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKS5hcHBlbmRDaGlsZChFLmNyZWF0ZUVsZW1lbnQoImRpdiIpKSwoZmU9RS5jcmVhdGVFbGVtZW50KCJpbnB1dCIpKS5zZXRBdHRyaWJ1dGUoInR5cGUiLCJyYWRpbyIpLGZlLnNldEF0dHJpYnV0ZSgiY2hlY2tlZCIsImNoZWNrZWQiKSxmZS5zZXRBdHRyaWJ1dGUoIm5hbWUiLCJ0IiksY2UuYXBwZW5kQ2hpbGQoZmUpLHkuY2hlY2tDbG9uZT1jZS5jbG9uZU5vZGUoITApLmNsb25lTm9kZSghMCkubGFzdENoaWxkLmNoZWNrZWQsY2UuaW5uZXJIVE1MPSI8dGV4dGFyZWE+eDwvdGV4dGFyZWE+Iix5Lm5vQ2xvbmVDaGVja2VkPSEhY2UuY2xvbmVOb2RlKCEwKS5sYXN0Q2hpbGQuZGVmYXVsdFZhbHVlLGNlLmlubmVySFRNTD0iPG9wdGlvbj48L29wdGlvbj4iLHkub3B0aW9uPSEhY2UubGFzdENoaWxkO3ZhciBnZT17dGhlYWQ6WzEsIjx0YWJsZT4iLCI8L3RhYmxlPiJdLGNvbDpbMiwiPHRhYmxlPjxjb2xncm91cD4iLCI8L2NvbGdyb3VwPjwvdGFibGU+Il0sdHI6WzIsIjx0YWJsZT48dGJvZHk+IiwiPC90Ym9keT48L3RhYmxlPiJdLHRkOlszLCI8dGFibGU+PHRib2R5Pjx0cj4iLCI8L3RyPjwvdGJvZHk+PC90YWJsZT4iXSxfZGVmYXVsdDpbMCwiIiwiIl19O2Z1bmN0aW9uIHZlKGUsdCl7dmFyIG47cmV0dXJuIG49InVuZGVmaW5lZCIhPXR5cGVvZiBlLmdldEVsZW1lbnRzQnlUYWdOYW1lP2UuZ2V0RWxlbWVudHNCeVRhZ05hbWUodHx8IioiKToidW5kZWZpbmVkIiE9dHlwZW9mIGUucXVlcnlTZWxlY3RvckFsbD9lLnF1ZXJ5U2VsZWN0b3JBbGwodHx8IioiKTpbXSx2b2lkIDA9PT10fHx0JiZBKGUsdCk/Uy5tZXJnZShbZV0sbik6bn1mdW5jdGlvbiB5ZShlLHQpe2Zvcih2YXIgbj0wLHI9ZS5sZW5ndGg7bjxyO24rKylZLnNldChlW25dLCJnbG9iYWxFdmFsIiwhdHx8WS5nZXQodFtuXSwiZ2xvYmFsRXZhbCIpKX1nZS50Ym9keT1nZS50Zm9vdD1nZS5jb2xncm91cD1nZS5jYXB0aW9uPWdlLnRoZWFkLGdlLnRoPWdlLnRkLHkub3B0aW9ufHwoZ2Uub3B0Z3JvdXA9Z2Uub3B0aW9uPVsxLCI8c2VsZWN0IG11bHRpcGxlPSdtdWx0aXBsZSc+IiwiPC9zZWxlY3Q+Il0pO3ZhciBtZT0vPHwmIz9cdys7LztmdW5jdGlvbiB4ZShlLHQsbixyLGkpe2Zvcih2YXIgbyxhLHMsdSxsLGMsZj10LmNyZWF0ZURvY3VtZW50RnJhZ21lbnQoKSxwPVtdLGQ9MCxoPWUubGVuZ3RoO2Q8aDtkKyspaWYoKG89ZVtkXSl8fDA9PT1vKWlmKCJvYmplY3QiPT09dyhvKSlTLm1lcmdlKHAsby5ub2RlVHlwZT9bb106byk7ZWxzZSBpZihtZS50ZXN0KG8pKXthPWF8fGYuYXBwZW5kQ2hpbGQodC5jcmVhdGVFbGVtZW50KCJkaXYiKSkscz0oZGUuZXhlYyhvKXx8WyIiLCIiXSlbMV0udG9Mb3dlckNhc2UoKSx1PWdlW3NdfHxnZS5fZGVmYXVsdCxhLmlubmVySFRNTD11WzFdK1MuaHRtbFByZWZpbHRlcihvKSt1WzJdLGM9dVswXTt3aGlsZShjLS0pYT1hLmxhc3RDaGlsZDtTLm1lcmdlKHAsYS5jaGlsZE5vZGVzKSwoYT1mLmZpcnN0Q2hpbGQpLnRleHRDb250ZW50PSIifWVsc2UgcC5wdXNoKHQuY3JlYXRlVGV4dE5vZGUobykpO2YudGV4dENvbnRlbnQ9IiIsZD0wO3doaWxlKG89cFtkKytdKWlmKHImJi0xPFMuaW5BcnJheShvLHIpKWkmJmkucHVzaChvKTtlbHNlIGlmKGw9aWUobyksYT12ZShmLmFwcGVuZENoaWxkKG8pLCJzY3JpcHQiKSxsJiZ5ZShhKSxuKXtjPTA7d2hpbGUobz1hW2MrK10paGUudGVzdChvLnR5cGV8fCIiKSYmbi5wdXNoKG8pfXJldHVybiBmfXZhciBiZT0vXmtleS8sd2U9L14oPzptb3VzZXxwb2ludGVyfGNvbnRleHRtZW51fGRyYWd8ZHJvcCl8Y2xpY2svLFRlPS9eKFteLl0qKSg/OlwuKC4rKXwpLztmdW5jdGlvbiBDZSgpe3JldHVybiEwfWZ1bmN0aW9uIEVlKCl7cmV0dXJuITF9ZnVuY3Rpb24gU2UoZSx0KXtyZXR1cm4gZT09PWZ1bmN0aW9uKCl7dHJ5e3JldHVybiBFLmFjdGl2ZUVsZW1lbnR9Y2F0Y2goZSl7fX0oKT09KCJmb2N1cyI9PT10KX1mdW5jdGlvbiBrZShlLHQsbixyLGksbyl7dmFyIGEscztpZigib2JqZWN0Ij09dHlwZW9mIHQpe2ZvcihzIGluInN0cmluZyIhPXR5cGVvZiBuJiYocj1yfHxuLG49dm9pZCAwKSx0KWtlKGUscyxuLHIsdFtzXSxvKTtyZXR1cm4gZX1pZihudWxsPT1yJiZudWxsPT1pPyhpPW4scj1uPXZvaWQgMCk6bnVsbD09aSYmKCJzdHJpbmciPT10eXBlb2Ygbj8oaT1yLHI9dm9pZCAwKTooaT1yLHI9bixuPXZvaWQgMCkpLCExPT09aSlpPUVlO2Vsc2UgaWYoIWkpcmV0dXJuIGU7cmV0dXJuIDE9PT1vJiYoYT1pLChpPWZ1bmN0aW9uKGUpe3JldHVybiBTKCkub2ZmKGUpLGEuYXBwbHkodGhpcyxhcmd1bWVudHMpfSkuZ3VpZD1hLmd1aWR8fChhLmd1aWQ9Uy5ndWlkKyspKSxlLmVhY2goZnVuY3Rpb24oKXtTLmV2ZW50LmFkZCh0aGlzLHQsaSxyLG4pfSl9ZnVuY3Rpb24gQWUoZSxpLG8pe28/KFkuc2V0KGUsaSwhMSksUy5ldmVudC5hZGQoZSxpLHtuYW1lc3BhY2U6ITEsaGFuZGxlcjpmdW5jdGlvbihlKXt2YXIgdCxuLHI9WS5nZXQodGhpcyxpKTtpZigxJmUuaXNUcmlnZ2VyJiZ0aGlzW2ldKXtpZihyLmxlbmd0aCkoUy5ldmVudC5zcGVjaWFsW2ldfHx7fSkuZGVsZWdhdGVUeXBlJiZlLnN0b3BQcm9wYWdhdGlvbigpO2Vsc2UgaWYocj1zLmNhbGwoYXJndW1lbnRzKSxZLnNldCh0aGlzLGksciksdD1vKHRoaXMsaSksdGhpc1tpXSgpLHIhPT0obj1ZLmdldCh0aGlzLGkpKXx8dD9ZLnNldCh0aGlzLGksITEpOm49e30sciE9PW4pcmV0dXJuIGUuc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uKCksZS5wcmV2ZW50RGVmYXVsdCgpLG4udmFsdWV9ZWxzZSByLmxlbmd0aCYmKFkuc2V0KHRoaXMsaSx7dmFsdWU6Uy5ldmVudC50cmlnZ2VyKFMuZXh0ZW5kKHJbMF0sUy5FdmVudC5wcm90b3R5cGUpLHIuc2xpY2UoMSksdGhpcyl9KSxlLnN0b3BJbW1lZGlhdGVQcm9wYWdhdGlvbigpKX19KSk6dm9pZCAwPT09WS5nZXQoZSxpKSYmUy5ldmVudC5hZGQoZSxpLENlKX1TLmV2ZW50PXtnbG9iYWw6e30sYWRkOmZ1bmN0aW9uKHQsZSxuLHIsaSl7dmFyIG8sYSxzLHUsbCxjLGYscCxkLGgsZyx2PVkuZ2V0KHQpO2lmKFYodCkpe24uaGFuZGxlciYmKG49KG89bikuaGFuZGxlcixpPW8uc2VsZWN0b3IpLGkmJlMuZmluZC5tYXRjaGVzU2VsZWN0b3IocmUsaSksbi5ndWlkfHwobi5ndWlkPVMuZ3VpZCsrKSwodT12LmV2ZW50cyl8fCh1PXYuZXZlbnRzPU9iamVjdC5jcmVhdGUobnVsbCkpLChhPXYuaGFuZGxlKXx8KGE9di5oYW5kbGU9ZnVuY3Rpb24oZSl7cmV0dXJuInVuZGVmaW5lZCIhPXR5cGVvZiBTJiZTLmV2ZW50LnRyaWdnZXJlZCE9PWUudHlwZT9TLmV2ZW50LmRpc3BhdGNoLmFwcGx5KHQsYXJndW1lbnRzKTp2b2lkIDB9KSxsPShlPShlfHwiIikubWF0Y2goUCl8fFsiIl0pLmxlbmd0aDt3aGlsZShsLS0pZD1nPShzPVRlLmV4ZWMoZVtsXSl8fFtdKVsxXSxoPShzWzJdfHwiIikuc3BsaXQoIi4iKS5zb3J0KCksZCYmKGY9Uy5ldmVudC5zcGVjaWFsW2RdfHx7fSxkPShpP2YuZGVsZWdhdGVUeXBlOmYuYmluZFR5cGUpfHxkLGY9Uy5ldmVudC5zcGVjaWFsW2RdfHx7fSxjPVMuZXh0ZW5kKHt0eXBlOmQsb3JpZ1R5cGU6ZyxkYXRhOnIsaGFuZGxlcjpuLGd1aWQ6bi5ndWlkLHNlbGVjdG9yOmksbmVlZHNDb250ZXh0OmkmJlMuZXhwci5tYXRjaC5uZWVkc0NvbnRleHQudGVzdChpKSxuYW1lc3BhY2U6aC5qb2luKCIuIil9LG8pLChwPXVbZF0pfHwoKHA9dVtkXT1bXSkuZGVsZWdhdGVDb3VudD0wLGYuc2V0dXAmJiExIT09Zi5zZXR1cC5jYWxsKHQscixoLGEpfHx0LmFkZEV2ZW50TGlzdGVuZXImJnQuYWRkRXZlbnRMaXN0ZW5lcihkLGEpKSxmLmFkZCYmKGYuYWRkLmNhbGwodCxjKSxjLmhhbmRsZXIuZ3VpZHx8KGMuaGFuZGxlci5ndWlkPW4uZ3VpZCkpLGk/cC5zcGxpY2UocC5kZWxlZ2F0ZUNvdW50KyssMCxjKTpwLnB1c2goYyksUy5ldmVudC5nbG9iYWxbZF09ITApfX0scmVtb3ZlOmZ1bmN0aW9uKGUsdCxuLHIsaSl7dmFyIG8sYSxzLHUsbCxjLGYscCxkLGgsZyx2PVkuaGFzRGF0YShlKSYmWS5nZXQoZSk7aWYodiYmKHU9di5ldmVudHMpKXtsPSh0PSh0fHwiIikubWF0Y2goUCl8fFsiIl0pLmxlbmd0aDt3aGlsZShsLS0paWYoZD1nPShzPVRlLmV4ZWModFtsXSl8fFtdKVsxXSxoPShzWzJdfHwiIikuc3BsaXQoIi4iKS5zb3J0KCksZCl7Zj1TLmV2ZW50LnNwZWNpYWxbZF18fHt9LHA9dVtkPShyP2YuZGVsZWdhdGVUeXBlOmYuYmluZFR5cGUpfHxkXXx8W10scz1zWzJdJiZuZXcgUmVnRXhwKCIoXnxcXC4pIitoLmpvaW4oIlxcLig/Oi4qXFwufCkiKSsiKFxcLnwkKSIpLGE9bz1wLmxlbmd0aDt3aGlsZShvLS0pYz1wW29dLCFpJiZnIT09Yy5vcmlnVHlwZXx8biYmbi5ndWlkIT09Yy5ndWlkfHxzJiYhcy50ZXN0KGMubmFtZXNwYWNlKXx8ciYmciE9PWMuc2VsZWN0b3ImJigiKioiIT09cnx8IWMuc2VsZWN0b3IpfHwocC5zcGxpY2UobywxKSxjLnNlbGVjdG9yJiZwLmRlbGVnYXRlQ291bnQtLSxmLnJlbW92ZSYmZi5yZW1vdmUuY2FsbChlLGMpKTthJiYhcC5sZW5ndGgmJihmLnRlYXJkb3duJiYhMSE9PWYudGVhcmRvd24uY2FsbChlLGgsdi5oYW5kbGUpfHxTLnJlbW92ZUV2ZW50KGUsZCx2LmhhbmRsZSksZGVsZXRlIHVbZF0pfWVsc2UgZm9yKGQgaW4gdSlTLmV2ZW50LnJlbW92ZShlLGQrdFtsXSxuLHIsITApO1MuaXNFbXB0eU9iamVjdCh1KSYmWS5yZW1vdmUoZSwiaGFuZGxlIGV2ZW50cyIpfX0sZGlzcGF0Y2g6ZnVuY3Rpb24oZSl7dmFyIHQsbixyLGksbyxhLHM9bmV3IEFycmF5KGFyZ3VtZW50cy5sZW5ndGgpLHU9Uy5ldmVudC5maXgoZSksbD0oWS5nZXQodGhpcywiZXZlbnRzIil8fE9iamVjdC5jcmVhdGUobnVsbCkpW3UudHlwZV18fFtdLGM9Uy5ldmVudC5zcGVjaWFsW3UudHlwZV18fHt9O2ZvcihzWzBdPXUsdD0xO3Q8YXJndW1lbnRzLmxlbmd0aDt0Kyspc1t0XT1hcmd1bWVudHNbdF07aWYodS5kZWxlZ2F0ZVRhcmdldD10aGlzLCFjLnByZURpc3BhdGNofHwhMSE9PWMucHJlRGlzcGF0Y2guY2FsbCh0aGlzLHUpKXthPVMuZXZlbnQuaGFuZGxlcnMuY2FsbCh0aGlzLHUsbCksdD0wO3doaWxlKChpPWFbdCsrXSkmJiF1LmlzUHJvcGFnYXRpb25TdG9wcGVkKCkpe3UuY3VycmVudFRhcmdldD1pLmVsZW0sbj0wO3doaWxlKChvPWkuaGFuZGxlcnNbbisrXSkmJiF1LmlzSW1tZWRpYXRlUHJvcGFnYXRpb25TdG9wcGVkKCkpdS5ybmFtZXNwYWNlJiYhMSE9PW8ubmFtZXNwYWNlJiYhdS5ybmFtZXNwYWNlLnRlc3Qoby5uYW1lc3BhY2UpfHwodS5oYW5kbGVPYmo9byx1LmRhdGE9by5kYXRhLHZvaWQgMCE9PShyPSgoUy5ldmVudC5zcGVjaWFsW28ub3JpZ1R5cGVdfHx7fSkuaGFuZGxlfHxvLmhhbmRsZXIpLmFwcGx5KGkuZWxlbSxzKSkmJiExPT09KHUucmVzdWx0PXIpJiYodS5wcmV2ZW50RGVmYXVsdCgpLHUuc3RvcFByb3BhZ2F0aW9uKCkpKX1yZXR1cm4gYy5wb3N0RGlzcGF0Y2gmJmMucG9zdERpc3BhdGNoLmNhbGwodGhpcyx1KSx1LnJlc3VsdH19LGhhbmRsZXJzOmZ1bmN0aW9uKGUsdCl7dmFyIG4scixpLG8sYSxzPVtdLHU9dC5kZWxlZ2F0ZUNvdW50LGw9ZS50YXJnZXQ7aWYodSYmbC5ub2RlVHlwZSYmISgiY2xpY2siPT09ZS50eXBlJiYxPD1lLmJ1dHRvbikpZm9yKDtsIT09dGhpcztsPWwucGFyZW50Tm9kZXx8dGhpcylpZigxPT09bC5ub2RlVHlwZSYmKCJjbGljayIhPT1lLnR5cGV8fCEwIT09bC5kaXNhYmxlZCkpe2ZvcihvPVtdLGE9e30sbj0wO248dTtuKyspdm9pZCAwPT09YVtpPShyPXRbbl0pLnNlbGVjdG9yKyIgIl0mJihhW2ldPXIubmVlZHNDb250ZXh0Py0xPFMoaSx0aGlzKS5pbmRleChsKTpTLmZpbmQoaSx0aGlzLG51bGwsW2xdKS5sZW5ndGgpLGFbaV0mJm8ucHVzaChyKTtvLmxlbmd0aCYmcy5wdXNoKHtlbGVtOmwsaGFuZGxlcnM6b30pfXJldHVybiBsPXRoaXMsdTx0Lmxlbmd0aCYmcy5wdXNoKHtlbGVtOmwsaGFuZGxlcnM6dC5zbGljZSh1KX0pLHN9LGFkZFByb3A6ZnVuY3Rpb24odCxlKXtPYmplY3QuZGVmaW5lUHJvcGVydHkoUy5FdmVudC5wcm90b3R5cGUsdCx7ZW51bWVyYWJsZTohMCxjb25maWd1cmFibGU6ITAsZ2V0Om0oZSk/ZnVuY3Rpb24oKXtpZih0aGlzLm9yaWdpbmFsRXZlbnQpcmV0dXJuIGUodGhpcy5vcmlnaW5hbEV2ZW50KX06ZnVuY3Rpb24oKXtpZih0aGlzLm9yaWdpbmFsRXZlbnQpcmV0dXJuIHRoaXMub3JpZ2luYWxFdmVudFt0XX0sc2V0OmZ1bmN0aW9uKGUpe09iamVjdC5kZWZpbmVQcm9wZXJ0eSh0aGlzLHQse2VudW1lcmFibGU6ITAsY29uZmlndXJhYmxlOiEwLHdyaXRhYmxlOiEwLHZhbHVlOmV9KX19KX0sZml4OmZ1bmN0aW9uKGUpe3JldHVybiBlW1MuZXhwYW5kb10/ZTpuZXcgUy5FdmVudChlKX0sc3BlY2lhbDp7bG9hZDp7bm9CdWJibGU6ITB9LGNsaWNrOntzZXR1cDpmdW5jdGlvbihlKXt2YXIgdD10aGlzfHxlO3JldHVybiBwZS50ZXN0KHQudHlwZSkmJnQuY2xpY2smJkEodCwiaW5wdXQiKSYmQWUodCwiY2xpY2siLENlKSwhMX0sdHJpZ2dlcjpmdW5jdGlvbihlKXt2YXIgdD10aGlzfHxlO3JldHVybiBwZS50ZXN0KHQudHlwZSkmJnQuY2xpY2smJkEodCwiaW5wdXQiKSYmQWUodCwiY2xpY2siKSwhMH0sX2RlZmF1bHQ6ZnVuY3Rpb24oZSl7dmFyIHQ9ZS50YXJnZXQ7cmV0dXJuIHBlLnRlc3QodC50eXBlKSYmdC5jbGljayYmQSh0LCJpbnB1dCIpJiZZLmdldCh0LCJjbGljayIpfHxBKHQsImEiKX19LGJlZm9yZXVubG9hZDp7cG9zdERpc3BhdGNoOmZ1bmN0aW9uKGUpe3ZvaWQgMCE9PWUucmVzdWx0JiZlLm9yaWdpbmFsRXZlbnQmJihlLm9yaWdpbmFsRXZlbnQucmV0dXJuVmFsdWU9ZS5yZXN1bHQpfX19fSxTLnJlbW92ZUV2ZW50PWZ1bmN0aW9uKGUsdCxuKXtlLnJlbW92ZUV2ZW50TGlzdGVuZXImJmUucmVtb3ZlRXZlbnRMaXN0ZW5lcih0LG4pfSxTLkV2ZW50PWZ1bmN0aW9uKGUsdCl7aWYoISh0aGlzIGluc3RhbmNlb2YgUy5FdmVudCkpcmV0dXJuIG5ldyBTLkV2ZW50KGUsdCk7ZSYmZS50eXBlPyh0aGlzLm9yaWdpbmFsRXZlbnQ9ZSx0aGlzLnR5cGU9ZS50eXBlLHRoaXMuaXNEZWZhdWx0UHJldmVudGVkPWUuZGVmYXVsdFByZXZlbnRlZHx8dm9pZCAwPT09ZS5kZWZhdWx0UHJldmVudGVkJiYhMT09PWUucmV0dXJuVmFsdWU/Q2U6RWUsdGhpcy50YXJnZXQ9ZS50YXJnZXQmJjM9PT1lLnRhcmdldC5ub2RlVHlwZT9lLnRhcmdldC5wYXJlbnROb2RlOmUudGFyZ2V0LHRoaXMuY3VycmVudFRhcmdldD1lLmN1cnJlbnRUYXJnZXQsdGhpcy5yZWxhdGVkVGFyZ2V0PWUucmVsYXRlZFRhcmdldCk6dGhpcy50eXBlPWUsdCYmUy5leHRlbmQodGhpcyx0KSx0aGlzLnRpbWVTdGFtcD1lJiZlLnRpbWVTdGFtcHx8RGF0ZS5ub3coKSx0aGlzW1MuZXhwYW5kb109ITB9LFMuRXZlbnQucHJvdG90eXBlPXtjb25zdHJ1Y3RvcjpTLkV2ZW50LGlzRGVmYXVsdFByZXZlbnRlZDpFZSxpc1Byb3BhZ2F0aW9uU3RvcHBlZDpFZSxpc0ltbWVkaWF0ZVByb3BhZ2F0aW9uU3RvcHBlZDpFZSxpc1NpbXVsYXRlZDohMSxwcmV2ZW50RGVmYXVsdDpmdW5jdGlvbigpe3ZhciBlPXRoaXMub3JpZ2luYWxFdmVudDt0aGlzLmlzRGVmYXVsdFByZXZlbnRlZD1DZSxlJiYhdGhpcy5pc1NpbXVsYXRlZCYmZS5wcmV2ZW50RGVmYXVsdCgpfSxzdG9wUHJvcGFnYXRpb246ZnVuY3Rpb24oKXt2YXIgZT10aGlzLm9yaWdpbmFsRXZlbnQ7dGhpcy5pc1Byb3BhZ2F0aW9uU3RvcHBlZD1DZSxlJiYhdGhpcy5pc1NpbXVsYXRlZCYmZS5zdG9wUHJvcGFnYXRpb24oKX0sc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uOmZ1bmN0aW9uKCl7dmFyIGU9dGhpcy5vcmlnaW5hbEV2ZW50O3RoaXMuaXNJbW1lZGlhdGVQcm9wYWdhdGlvblN0b3BwZWQ9Q2UsZSYmIXRoaXMuaXNTaW11bGF0ZWQmJmUuc3RvcEltbWVkaWF0ZVByb3BhZ2F0aW9uKCksdGhpcy5zdG9wUHJvcGFnYXRpb24oKX19LFMuZWFjaCh7YWx0S2V5OiEwLGJ1YmJsZXM6ITAsY2FuY2VsYWJsZTohMCxjaGFuZ2VkVG91Y2hlczohMCxjdHJsS2V5OiEwLGRldGFpbDohMCxldmVudFBoYXNlOiEwLG1ldGFLZXk6ITAscGFnZVg6ITAscGFnZVk6ITAsc2hpZnRLZXk6ITAsdmlldzohMCwiY2hhciI6ITAsY29kZTohMCxjaGFyQ29kZTohMCxrZXk6ITAsa2V5Q29kZTohMCxidXR0b246ITAsYnV0dG9uczohMCxjbGllbnRYOiEwLGNsaWVudFk6ITAsb2Zmc2V0WDohMCxvZmZzZXRZOiEwLHBvaW50ZXJJZDohMCxwb2ludGVyVHlwZTohMCxzY3JlZW5YOiEwLHNjcmVlblk6ITAsdGFyZ2V0VG91Y2hlczohMCx0b0VsZW1lbnQ6ITAsdG91Y2hlczohMCx3aGljaDpmdW5jdGlvbihlKXt2YXIgdD1lLmJ1dHRvbjtyZXR1cm4gbnVsbD09ZS53aGljaCYmYmUudGVzdChlLnR5cGUpP251bGwhPWUuY2hhckNvZGU/ZS5jaGFyQ29kZTplLmtleUNvZGU6IWUud2hpY2gmJnZvaWQgMCE9PXQmJndlLnRlc3QoZS50eXBlKT8xJnQ/MToyJnQ/Mzo0JnQ/MjowOmUud2hpY2h9fSxTLmV2ZW50LmFkZFByb3ApLFMuZWFjaCh7Zm9jdXM6ImZvY3VzaW4iLGJsdXI6ImZvY3Vzb3V0In0sZnVuY3Rpb24oZSx0KXtTLmV2ZW50LnNwZWNpYWxbZV09e3NldHVwOmZ1bmN0aW9uKCl7cmV0dXJuIEFlKHRoaXMsZSxTZSksITF9LHRyaWdnZXI6ZnVuY3Rpb24oKXtyZXR1cm4gQWUodGhpcyxlKSwhMH0sZGVsZWdhdGVUeXBlOnR9fSksUy5lYWNoKHttb3VzZWVudGVyOiJtb3VzZW92ZXIiLG1vdXNlbGVhdmU6Im1vdXNlb3V0Iixwb2ludGVyZW50ZXI6InBvaW50ZXJvdmVyIixwb2ludGVybGVhdmU6InBvaW50ZXJvdXQifSxmdW5jdGlvbihlLGkpe1MuZXZlbnQuc3BlY2lhbFtlXT17ZGVsZWdhdGVUeXBlOmksYmluZFR5cGU6aSxoYW5kbGU6ZnVuY3Rpb24oZSl7dmFyIHQsbj1lLnJlbGF0ZWRUYXJnZXQscj1lLmhhbmRsZU9iajtyZXR1cm4gbiYmKG49PT10aGlzfHxTLmNvbnRhaW5zKHRoaXMsbikpfHwoZS50eXBlPXIub3JpZ1R5cGUsdD1yLmhhbmRsZXIuYXBwbHkodGhpcyxhcmd1bWVudHMpLGUudHlwZT1pKSx0fX19KSxTLmZuLmV4dGVuZCh7b246ZnVuY3Rpb24oZSx0LG4scil7cmV0dXJuIGtlKHRoaXMsZSx0LG4scil9LG9uZTpmdW5jdGlvbihlLHQsbixyKXtyZXR1cm4ga2UodGhpcyxlLHQsbixyLDEpfSxvZmY6ZnVuY3Rpb24oZSx0LG4pe3ZhciByLGk7aWYoZSYmZS5wcmV2ZW50RGVmYXVsdCYmZS5oYW5kbGVPYmopcmV0dXJuIHI9ZS5oYW5kbGVPYmosUyhlLmRlbGVnYXRlVGFyZ2V0KS5vZmYoci5uYW1lc3BhY2U/ci5vcmlnVHlwZSsiLiIrci5uYW1lc3BhY2U6ci5vcmlnVHlwZSxyLnNlbGVjdG9yLHIuaGFuZGxlciksdGhpcztpZigib2JqZWN0Ij09dHlwZW9mIGUpe2ZvcihpIGluIGUpdGhpcy5vZmYoaSx0LGVbaV0pO3JldHVybiB0aGlzfXJldHVybiExIT09dCYmImZ1bmN0aW9uIiE9dHlwZW9mIHR8fChuPXQsdD12b2lkIDApLCExPT09biYmKG49RWUpLHRoaXMuZWFjaChmdW5jdGlvbigpe1MuZXZlbnQucmVtb3ZlKHRoaXMsZSxuLHQpfSl9fSk7dmFyIE5lPS88c2NyaXB0fDxzdHlsZXw8bGluay9pLERlPS9jaGVja2VkXHMqKD86W149XXw9XHMqLmNoZWNrZWQuKS9pLGplPS9eXHMqPCEoPzpcW0NEQVRBXFt8LS0pfCg/OlxdXF18LS0pPlxzKiQvZztmdW5jdGlvbiBxZShlLHQpe3JldHVybiBBKGUsInRhYmxlIikmJkEoMTEhPT10Lm5vZGVUeXBlP3Q6dC5maXJzdENoaWxkLCJ0ciIpJiZTKGUpLmNoaWxkcmVuKCJ0Ym9keSIpWzBdfHxlfWZ1bmN0aW9uIExlKGUpe3JldHVybiBlLnR5cGU9KG51bGwhPT1lLmdldEF0dHJpYnV0ZSgidHlwZSIpKSsiLyIrZS50eXBlLGV9ZnVuY3Rpb24gSGUoZSl7cmV0dXJuInRydWUvIj09PShlLnR5cGV8fCIiKS5zbGljZSgwLDUpP2UudHlwZT1lLnR5cGUuc2xpY2UoNSk6ZS5yZW1vdmVBdHRyaWJ1dGUoInR5cGUiKSxlfWZ1bmN0aW9uIE9lKGUsdCl7dmFyIG4scixpLG8sYSxzO2lmKDE9PT10Lm5vZGVUeXBlKXtpZihZLmhhc0RhdGEoZSkmJihzPVkuZ2V0KGUpLmV2ZW50cykpZm9yKGkgaW4gWS5yZW1vdmUodCwiaGFuZGxlIGV2ZW50cyIpLHMpZm9yKG49MCxyPXNbaV0ubGVuZ3RoO248cjtuKyspUy5ldmVudC5hZGQodCxpLHNbaV1bbl0pO1EuaGFzRGF0YShlKSYmKG89US5hY2Nlc3MoZSksYT1TLmV4dGVuZCh7fSxvKSxRLnNldCh0LGEpKX19ZnVuY3Rpb24gUGUobixyLGksbyl7cj1nKHIpO3ZhciBlLHQsYSxzLHUsbCxjPTAsZj1uLmxlbmd0aCxwPWYtMSxkPXJbMF0saD1tKGQpO2lmKGh8fDE8ZiYmInN0cmluZyI9PXR5cGVvZiBkJiYheS5jaGVja0Nsb25lJiZEZS50ZXN0KGQpKXJldHVybiBuLmVhY2goZnVuY3Rpb24oZSl7dmFyIHQ9bi5lcShlKTtoJiYoclswXT1kLmNhbGwodGhpcyxlLHQuaHRtbCgpKSksUGUodCxyLGksbyl9KTtpZihmJiYodD0oZT14ZShyLG5bMF0ub3duZXJEb2N1bWVudCwhMSxuLG8pKS5maXJzdENoaWxkLDE9PT1lLmNoaWxkTm9kZXMubGVuZ3RoJiYoZT10KSx0fHxvKSl7Zm9yKHM9KGE9Uy5tYXAodmUoZSwic2NyaXB0IiksTGUpKS5sZW5ndGg7YzxmO2MrKyl1PWUsYyE9PXAmJih1PVMuY2xvbmUodSwhMCwhMCkscyYmUy5tZXJnZShhLHZlKHUsInNjcmlwdCIpKSksaS5jYWxsKG5bY10sdSxjKTtpZihzKWZvcihsPWFbYS5sZW5ndGgtMV0ub3duZXJEb2N1bWVudCxTLm1hcChhLEhlKSxjPTA7YzxzO2MrKyl1PWFbY10saGUudGVzdCh1LnR5cGV8fCIiKSYmIVkuYWNjZXNzKHUsImdsb2JhbEV2YWwiKSYmUy5jb250YWlucyhsLHUpJiYodS5zcmMmJiJtb2R1bGUiIT09KHUudHlwZXx8IiIpLnRvTG93ZXJDYXNlKCk/Uy5fZXZhbFVybCYmIXUubm9Nb2R1bGUmJlMuX2V2YWxVcmwodS5zcmMse25vbmNlOnUubm9uY2V8fHUuZ2V0QXR0cmlidXRlKCJub25jZSIpfSxsKTpiKHUudGV4dENvbnRlbnQucmVwbGFjZShqZSwiIiksdSxsKSl9cmV0dXJuIG59ZnVuY3Rpb24gUmUoZSx0LG4pe2Zvcih2YXIgcixpPXQ/Uy5maWx0ZXIodCxlKTplLG89MDtudWxsIT0ocj1pW29dKTtvKyspbnx8MSE9PXIubm9kZVR5cGV8fFMuY2xlYW5EYXRhKHZlKHIpKSxyLnBhcmVudE5vZGUmJihuJiZpZShyKSYmeWUodmUociwic2NyaXB0IikpLHIucGFyZW50Tm9kZS5yZW1vdmVDaGlsZChyKSk7cmV0dXJuIGV9Uy5leHRlbmQoe2h0bWxQcmVmaWx0ZXI6ZnVuY3Rpb24oZSl7cmV0dXJuIGV9LGNsb25lOmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG8sYSxzLHUsbCxjPWUuY2xvbmVOb2RlKCEwKSxmPWllKGUpO2lmKCEoeS5ub0Nsb25lQ2hlY2tlZHx8MSE9PWUubm9kZVR5cGUmJjExIT09ZS5ub2RlVHlwZXx8Uy5pc1hNTERvYyhlKSkpZm9yKGE9dmUoYykscj0wLGk9KG89dmUoZSkpLmxlbmd0aDtyPGk7cisrKXM9b1tyXSx1PWFbcl0sdm9pZCAwLCJpbnB1dCI9PT0obD11Lm5vZGVOYW1lLnRvTG93ZXJDYXNlKCkpJiZwZS50ZXN0KHMudHlwZSk/dS5jaGVja2VkPXMuY2hlY2tlZDoiaW5wdXQiIT09bCYmInRleHRhcmVhIiE9PWx8fCh1LmRlZmF1bHRWYWx1ZT1zLmRlZmF1bHRWYWx1ZSk7aWYodClpZihuKWZvcihvPW98fHZlKGUpLGE9YXx8dmUoYykscj0wLGk9by5sZW5ndGg7cjxpO3IrKylPZShvW3JdLGFbcl0pO2Vsc2UgT2UoZSxjKTtyZXR1cm4gMDwoYT12ZShjLCJzY3JpcHQiKSkubGVuZ3RoJiZ5ZShhLCFmJiZ2ZShlLCJzY3JpcHQiKSksY30sY2xlYW5EYXRhOmZ1bmN0aW9uKGUpe2Zvcih2YXIgdCxuLHIsaT1TLmV2ZW50LnNwZWNpYWwsbz0wO3ZvaWQgMCE9PShuPWVbb10pO28rKylpZihWKG4pKXtpZih0PW5bWS5leHBhbmRvXSl7aWYodC5ldmVudHMpZm9yKHIgaW4gdC5ldmVudHMpaVtyXT9TLmV2ZW50LnJlbW92ZShuLHIpOlMucmVtb3ZlRXZlbnQobixyLHQuaGFuZGxlKTtuW1kuZXhwYW5kb109dm9pZCAwfW5bUS5leHBhbmRvXSYmKG5bUS5leHBhbmRvXT12b2lkIDApfX19KSxTLmZuLmV4dGVuZCh7ZGV0YWNoOmZ1bmN0aW9uKGUpe3JldHVybiBSZSh0aGlzLGUsITApfSxyZW1vdmU6ZnVuY3Rpb24oZSl7cmV0dXJuIFJlKHRoaXMsZSl9LHRleHQ6ZnVuY3Rpb24oZSl7cmV0dXJuICQodGhpcyxmdW5jdGlvbihlKXtyZXR1cm4gdm9pZCAwPT09ZT9TLnRleHQodGhpcyk6dGhpcy5lbXB0eSgpLmVhY2goZnVuY3Rpb24oKXsxIT09dGhpcy5ub2RlVHlwZSYmMTEhPT10aGlzLm5vZGVUeXBlJiY5IT09dGhpcy5ub2RlVHlwZXx8KHRoaXMudGV4dENvbnRlbnQ9ZSl9KX0sbnVsbCxlLGFyZ3VtZW50cy5sZW5ndGgpfSxhcHBlbmQ6ZnVuY3Rpb24oKXtyZXR1cm4gUGUodGhpcyxhcmd1bWVudHMsZnVuY3Rpb24oZSl7MSE9PXRoaXMubm9kZVR5cGUmJjExIT09dGhpcy5ub2RlVHlwZSYmOSE9PXRoaXMubm9kZVR5cGV8fHFlKHRoaXMsZSkuYXBwZW5kQ2hpbGQoZSl9KX0scHJlcGVuZDpmdW5jdGlvbigpe3JldHVybiBQZSh0aGlzLGFyZ3VtZW50cyxmdW5jdGlvbihlKXtpZigxPT09dGhpcy5ub2RlVHlwZXx8MTE9PT10aGlzLm5vZGVUeXBlfHw5PT09dGhpcy5ub2RlVHlwZSl7dmFyIHQ9cWUodGhpcyxlKTt0Lmluc2VydEJlZm9yZShlLHQuZmlyc3RDaGlsZCl9fSl9LGJlZm9yZTpmdW5jdGlvbigpe3JldHVybiBQZSh0aGlzLGFyZ3VtZW50cyxmdW5jdGlvbihlKXt0aGlzLnBhcmVudE5vZGUmJnRoaXMucGFyZW50Tm9kZS5pbnNlcnRCZWZvcmUoZSx0aGlzKX0pfSxhZnRlcjpmdW5jdGlvbigpe3JldHVybiBQZSh0aGlzLGFyZ3VtZW50cyxmdW5jdGlvbihlKXt0aGlzLnBhcmVudE5vZGUmJnRoaXMucGFyZW50Tm9kZS5pbnNlcnRCZWZvcmUoZSx0aGlzLm5leHRTaWJsaW5nKX0pfSxlbXB0eTpmdW5jdGlvbigpe2Zvcih2YXIgZSx0PTA7bnVsbCE9KGU9dGhpc1t0XSk7dCsrKTE9PT1lLm5vZGVUeXBlJiYoUy5jbGVhbkRhdGEodmUoZSwhMSkpLGUudGV4dENvbnRlbnQ9IiIpO3JldHVybiB0aGlzfSxjbG9uZTpmdW5jdGlvbihlLHQpe3JldHVybiBlPW51bGwhPWUmJmUsdD1udWxsPT10P2U6dCx0aGlzLm1hcChmdW5jdGlvbigpe3JldHVybiBTLmNsb25lKHRoaXMsZSx0KX0pfSxodG1sOmZ1bmN0aW9uKGUpe3JldHVybiAkKHRoaXMsZnVuY3Rpb24oZSl7dmFyIHQ9dGhpc1swXXx8e30sbj0wLHI9dGhpcy5sZW5ndGg7aWYodm9pZCAwPT09ZSYmMT09PXQubm9kZVR5cGUpcmV0dXJuIHQuaW5uZXJIVE1MO2lmKCJzdHJpbmciPT10eXBlb2YgZSYmIU5lLnRlc3QoZSkmJiFnZVsoZGUuZXhlYyhlKXx8WyIiLCIiXSlbMV0udG9Mb3dlckNhc2UoKV0pe2U9Uy5odG1sUHJlZmlsdGVyKGUpO3RyeXtmb3IoO248cjtuKyspMT09PSh0PXRoaXNbbl18fHt9KS5ub2RlVHlwZSYmKFMuY2xlYW5EYXRhKHZlKHQsITEpKSx0LmlubmVySFRNTD1lKTt0PTB9Y2F0Y2goZSl7fX10JiZ0aGlzLmVtcHR5KCkuYXBwZW5kKGUpfSxudWxsLGUsYXJndW1lbnRzLmxlbmd0aCl9LHJlcGxhY2VXaXRoOmZ1bmN0aW9uKCl7dmFyIG49W107cmV0dXJuIFBlKHRoaXMsYXJndW1lbnRzLGZ1bmN0aW9uKGUpe3ZhciB0PXRoaXMucGFyZW50Tm9kZTtTLmluQXJyYXkodGhpcyxuKTwwJiYoUy5jbGVhbkRhdGEodmUodGhpcykpLHQmJnQucmVwbGFjZUNoaWxkKGUsdGhpcykpfSxuKX19KSxTLmVhY2goe2FwcGVuZFRvOiJhcHBlbmQiLHByZXBlbmRUbzoicHJlcGVuZCIsaW5zZXJ0QmVmb3JlOiJiZWZvcmUiLGluc2VydEFmdGVyOiJhZnRlciIscmVwbGFjZUFsbDoicmVwbGFjZVdpdGgifSxmdW5jdGlvbihlLGEpe1MuZm5bZV09ZnVuY3Rpb24oZSl7Zm9yKHZhciB0LG49W10scj1TKGUpLGk9ci5sZW5ndGgtMSxvPTA7bzw9aTtvKyspdD1vPT09aT90aGlzOnRoaXMuY2xvbmUoITApLFMocltvXSlbYV0odCksdS5hcHBseShuLHQuZ2V0KCkpO3JldHVybiB0aGlzLnB1c2hTdGFjayhuKX19KTt2YXIgTWU9bmV3IFJlZ0V4cCgiXigiK2VlKyIpKD8hcHgpW2EteiVdKyQiLCJpIiksSWU9ZnVuY3Rpb24oZSl7dmFyIHQ9ZS5vd25lckRvY3VtZW50LmRlZmF1bHRWaWV3O3JldHVybiB0JiZ0Lm9wZW5lcnx8KHQ9QyksdC5nZXRDb21wdXRlZFN0eWxlKGUpfSxXZT1mdW5jdGlvbihlLHQsbil7dmFyIHIsaSxvPXt9O2ZvcihpIGluIHQpb1tpXT1lLnN0eWxlW2ldLGUuc3R5bGVbaV09dFtpXTtmb3IoaSBpbiByPW4uY2FsbChlKSx0KWUuc3R5bGVbaV09b1tpXTtyZXR1cm4gcn0sRmU9bmV3IFJlZ0V4cChuZS5qb2luKCJ8IiksImkiKTtmdW5jdGlvbiBCZShlLHQsbil7dmFyIHIsaSxvLGEscz1lLnN0eWxlO3JldHVybihuPW58fEllKGUpKSYmKCIiIT09KGE9bi5nZXRQcm9wZXJ0eVZhbHVlKHQpfHxuW3RdKXx8aWUoZSl8fChhPVMuc3R5bGUoZSx0KSksIXkucGl4ZWxCb3hTdHlsZXMoKSYmTWUudGVzdChhKSYmRmUudGVzdCh0KSYmKHI9cy53aWR0aCxpPXMubWluV2lkdGgsbz1zLm1heFdpZHRoLHMubWluV2lkdGg9cy5tYXhXaWR0aD1zLndpZHRoPWEsYT1uLndpZHRoLHMud2lkdGg9cixzLm1pbldpZHRoPWkscy5tYXhXaWR0aD1vKSksdm9pZCAwIT09YT9hKyIiOmF9ZnVuY3Rpb24gJGUoZSx0KXtyZXR1cm57Z2V0OmZ1bmN0aW9uKCl7aWYoIWUoKSlyZXR1cm4odGhpcy5nZXQ9dCkuYXBwbHkodGhpcyxhcmd1bWVudHMpO2RlbGV0ZSB0aGlzLmdldH19fSFmdW5jdGlvbigpe2Z1bmN0aW9uIGUoKXtpZihsKXt1LnN0eWxlLmNzc1RleHQ9InBvc2l0aW9uOmFic29sdXRlO2xlZnQ6LTExMTExcHg7d2lkdGg6NjBweDttYXJnaW4tdG9wOjFweDtwYWRkaW5nOjA7Ym9yZGVyOjAiLGwuc3R5bGUuY3NzVGV4dD0icG9zaXRpb246cmVsYXRpdmU7ZGlzcGxheTpibG9jaztib3gtc2l6aW5nOmJvcmRlci1ib3g7b3ZlcmZsb3c6c2Nyb2xsO21hcmdpbjphdXRvO2JvcmRlcjoxcHg7cGFkZGluZzoxcHg7d2lkdGg6NjAlO3RvcDoxJSIscmUuYXBwZW5kQ2hpbGQodSkuYXBwZW5kQ2hpbGQobCk7dmFyIGU9Qy5nZXRDb21wdXRlZFN0eWxlKGwpO249IjElIiE9PWUudG9wLHM9MTI9PT10KGUubWFyZ2luTGVmdCksbC5zdHlsZS5yaWdodD0iNjAlIixvPTM2PT09dChlLnJpZ2h0KSxyPTM2PT09dChlLndpZHRoKSxsLnN0eWxlLnBvc2l0aW9uPSJhYnNvbHV0ZSIsaT0xMj09PXQobC5vZmZzZXRXaWR0aC8zKSxyZS5yZW1vdmVDaGlsZCh1KSxsPW51bGx9fWZ1bmN0aW9uIHQoZSl7cmV0dXJuIE1hdGgucm91bmQocGFyc2VGbG9hdChlKSl9dmFyIG4scixpLG8sYSxzLHU9RS5jcmVhdGVFbGVtZW50KCJkaXYiKSxsPUUuY3JlYXRlRWxlbWVudCgiZGl2Iik7bC5zdHlsZSYmKGwuc3R5bGUuYmFja2dyb3VuZENsaXA9ImNvbnRlbnQtYm94IixsLmNsb25lTm9kZSghMCkuc3R5bGUuYmFja2dyb3VuZENsaXA9IiIseS5jbGVhckNsb25lU3R5bGU9ImNvbnRlbnQtYm94Ij09PWwuc3R5bGUuYmFja2dyb3VuZENsaXAsUy5leHRlbmQoeSx7Ym94U2l6aW5nUmVsaWFibGU6ZnVuY3Rpb24oKXtyZXR1cm4gZSgpLHJ9LHBpeGVsQm94U3R5bGVzOmZ1bmN0aW9uKCl7cmV0dXJuIGUoKSxvfSxwaXhlbFBvc2l0aW9uOmZ1bmN0aW9uKCl7cmV0dXJuIGUoKSxufSxyZWxpYWJsZU1hcmdpbkxlZnQ6ZnVuY3Rpb24oKXtyZXR1cm4gZSgpLHN9LHNjcm9sbGJveFNpemU6ZnVuY3Rpb24oKXtyZXR1cm4gZSgpLGl9LHJlbGlhYmxlVHJEaW1lbnNpb25zOmZ1bmN0aW9uKCl7dmFyIGUsdCxuLHI7cmV0dXJuIG51bGw9PWEmJihlPUUuY3JlYXRlRWxlbWVudCgidGFibGUiKSx0PUUuY3JlYXRlRWxlbWVudCgidHIiKSxuPUUuY3JlYXRlRWxlbWVudCgiZGl2IiksZS5zdHlsZS5jc3NUZXh0PSJwb3NpdGlvbjphYnNvbHV0ZTtsZWZ0Oi0xMTExMXB4Iix0LnN0eWxlLmhlaWdodD0iMXB4IixuLnN0eWxlLmhlaWdodD0iOXB4IixyZS5hcHBlbmRDaGlsZChlKS5hcHBlbmRDaGlsZCh0KS5hcHBlbmRDaGlsZChuKSxyPUMuZ2V0Q29tcHV0ZWRTdHlsZSh0KSxhPTM8cGFyc2VJbnQoci5oZWlnaHQpLHJlLnJlbW92ZUNoaWxkKGUpKSxhfX0pKX0oKTt2YXIgX2U9WyJXZWJraXQiLCJNb3oiLCJtcyJdLHplPUUuY3JlYXRlRWxlbWVudCgiZGl2Iikuc3R5bGUsVWU9e307ZnVuY3Rpb24gWGUoZSl7dmFyIHQ9Uy5jc3NQcm9wc1tlXXx8VWVbZV07cmV0dXJuIHR8fChlIGluIHplP2U6VWVbZV09ZnVuY3Rpb24oZSl7dmFyIHQ9ZVswXS50b1VwcGVyQ2FzZSgpK2Uuc2xpY2UoMSksbj1fZS5sZW5ndGg7d2hpbGUobi0tKWlmKChlPV9lW25dK3QpaW4gemUpcmV0dXJuIGV9KGUpfHxlKX12YXIgVmU9L14obm9uZXx0YWJsZSg/IS1jW2VhXSkuKykvLEdlPS9eLS0vLFllPXtwb3NpdGlvbjoiYWJzb2x1dGUiLHZpc2liaWxpdHk6ImhpZGRlbiIsZGlzcGxheToiYmxvY2sifSxRZT17bGV0dGVyU3BhY2luZzoiMCIsZm9udFdlaWdodDoiNDAwIn07ZnVuY3Rpb24gSmUoZSx0LG4pe3ZhciByPXRlLmV4ZWModCk7cmV0dXJuIHI/TWF0aC5tYXgoMCxyWzJdLShufHwwKSkrKHJbM118fCJweCIpOnR9ZnVuY3Rpb24gS2UoZSx0LG4scixpLG8pe3ZhciBhPSJ3aWR0aCI9PT10PzE6MCxzPTAsdT0wO2lmKG49PT0ocj8iYm9yZGVyIjoiY29udGVudCIpKXJldHVybiAwO2Zvcig7YTw0O2ErPTIpIm1hcmdpbiI9PT1uJiYodSs9Uy5jc3MoZSxuK25lW2FdLCEwLGkpKSxyPygiY29udGVudCI9PT1uJiYodS09Uy5jc3MoZSwicGFkZGluZyIrbmVbYV0sITAsaSkpLCJtYXJnaW4iIT09biYmKHUtPVMuY3NzKGUsImJvcmRlciIrbmVbYV0rIldpZHRoIiwhMCxpKSkpOih1Kz1TLmNzcyhlLCJwYWRkaW5nIituZVthXSwhMCxpKSwicGFkZGluZyIhPT1uP3UrPVMuY3NzKGUsImJvcmRlciIrbmVbYV0rIldpZHRoIiwhMCxpKTpzKz1TLmNzcyhlLCJib3JkZXIiK25lW2FdKyJXaWR0aCIsITAsaSkpO3JldHVybiFyJiYwPD1vJiYodSs9TWF0aC5tYXgoMCxNYXRoLmNlaWwoZVsib2Zmc2V0Iit0WzBdLnRvVXBwZXJDYXNlKCkrdC5zbGljZSgxKV0tby11LXMtLjUpKXx8MCksdX1mdW5jdGlvbiBaZShlLHQsbil7dmFyIHI9SWUoZSksaT0oIXkuYm94U2l6aW5nUmVsaWFibGUoKXx8bikmJiJib3JkZXItYm94Ij09PVMuY3NzKGUsImJveFNpemluZyIsITEsciksbz1pLGE9QmUoZSx0LHIpLHM9Im9mZnNldCIrdFswXS50b1VwcGVyQ2FzZSgpK3Quc2xpY2UoMSk7aWYoTWUudGVzdChhKSl7aWYoIW4pcmV0dXJuIGE7YT0iYXV0byJ9cmV0dXJuKCF5LmJveFNpemluZ1JlbGlhYmxlKCkmJml8fCF5LnJlbGlhYmxlVHJEaW1lbnNpb25zKCkmJkEoZSwidHIiKXx8ImF1dG8iPT09YXx8IXBhcnNlRmxvYXQoYSkmJiJpbmxpbmUiPT09Uy5jc3MoZSwiZGlzcGxheSIsITEscikpJiZlLmdldENsaWVudFJlY3RzKCkubGVuZ3RoJiYoaT0iYm9yZGVyLWJveCI9PT1TLmNzcyhlLCJib3hTaXppbmciLCExLHIpLChvPXMgaW4gZSkmJihhPWVbc10pKSwoYT1wYXJzZUZsb2F0KGEpfHwwKStLZShlLHQsbnx8KGk/ImJvcmRlciI6ImNvbnRlbnQiKSxvLHIsYSkrInB4In1mdW5jdGlvbiBldChlLHQsbixyLGkpe3JldHVybiBuZXcgZXQucHJvdG90eXBlLmluaXQoZSx0LG4scixpKX1TLmV4dGVuZCh7Y3NzSG9va3M6e29wYWNpdHk6e2dldDpmdW5jdGlvbihlLHQpe2lmKHQpe3ZhciBuPUJlKGUsIm9wYWNpdHkiKTtyZXR1cm4iIj09PW4/IjEiOm59fX19LGNzc051bWJlcjp7YW5pbWF0aW9uSXRlcmF0aW9uQ291bnQ6ITAsY29sdW1uQ291bnQ6ITAsZmlsbE9wYWNpdHk6ITAsZmxleEdyb3c6ITAsZmxleFNocmluazohMCxmb250V2VpZ2h0OiEwLGdyaWRBcmVhOiEwLGdyaWRDb2x1bW46ITAsZ3JpZENvbHVtbkVuZDohMCxncmlkQ29sdW1uU3RhcnQ6ITAsZ3JpZFJvdzohMCxncmlkUm93RW5kOiEwLGdyaWRSb3dTdGFydDohMCxsaW5lSGVpZ2h0OiEwLG9wYWNpdHk6ITAsb3JkZXI6ITAsb3JwaGFuczohMCx3aWRvd3M6ITAsekluZGV4OiEwLHpvb206ITB9LGNzc1Byb3BzOnt9LHN0eWxlOmZ1bmN0aW9uKGUsdCxuLHIpe2lmKGUmJjMhPT1lLm5vZGVUeXBlJiY4IT09ZS5ub2RlVHlwZSYmZS5zdHlsZSl7dmFyIGksbyxhLHM9WCh0KSx1PUdlLnRlc3QodCksbD1lLnN0eWxlO2lmKHV8fCh0PVhlKHMpKSxhPVMuY3NzSG9va3NbdF18fFMuY3NzSG9va3Nbc10sdm9pZCAwPT09bilyZXR1cm4gYSYmImdldCJpbiBhJiZ2b2lkIDAhPT0oaT1hLmdldChlLCExLHIpKT9pOmxbdF07InN0cmluZyI9PT0obz10eXBlb2YgbikmJihpPXRlLmV4ZWMobikpJiZpWzFdJiYobj1zZShlLHQsaSksbz0ibnVtYmVyIiksbnVsbCE9biYmbj09biYmKCJudW1iZXIiIT09b3x8dXx8KG4rPWkmJmlbM118fChTLmNzc051bWJlcltzXT8iIjoicHgiKSkseS5jbGVhckNsb25lU3R5bGV8fCIiIT09bnx8MCE9PXQuaW5kZXhPZigiYmFja2dyb3VuZCIpfHwobFt0XT0iaW5oZXJpdCIpLGEmJiJzZXQiaW4gYSYmdm9pZCAwPT09KG49YS5zZXQoZSxuLHIpKXx8KHU/bC5zZXRQcm9wZXJ0eSh0LG4pOmxbdF09bikpfX0sY3NzOmZ1bmN0aW9uKGUsdCxuLHIpe3ZhciBpLG8sYSxzPVgodCk7cmV0dXJuIEdlLnRlc3QodCl8fCh0PVhlKHMpKSwoYT1TLmNzc0hvb2tzW3RdfHxTLmNzc0hvb2tzW3NdKSYmImdldCJpbiBhJiYoaT1hLmdldChlLCEwLG4pKSx2b2lkIDA9PT1pJiYoaT1CZShlLHQscikpLCJub3JtYWwiPT09aSYmdCBpbiBRZSYmKGk9UWVbdF0pLCIiPT09bnx8bj8obz1wYXJzZUZsb2F0KGkpLCEwPT09bnx8aXNGaW5pdGUobyk/b3x8MDppKTppfX0pLFMuZWFjaChbImhlaWdodCIsIndpZHRoIl0sZnVuY3Rpb24oZSx1KXtTLmNzc0hvb2tzW3VdPXtnZXQ6ZnVuY3Rpb24oZSx0LG4pe2lmKHQpcmV0dXJuIVZlLnRlc3QoUy5jc3MoZSwiZGlzcGxheSIpKXx8ZS5nZXRDbGllbnRSZWN0cygpLmxlbmd0aCYmZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS53aWR0aD9aZShlLHUsbik6V2UoZSxZZSxmdW5jdGlvbigpe3JldHVybiBaZShlLHUsbil9KX0sc2V0OmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpPUllKGUpLG89IXkuc2Nyb2xsYm94U2l6ZSgpJiYiYWJzb2x1dGUiPT09aS5wb3NpdGlvbixhPShvfHxuKSYmImJvcmRlci1ib3giPT09Uy5jc3MoZSwiYm94U2l6aW5nIiwhMSxpKSxzPW4/S2UoZSx1LG4sYSxpKTowO3JldHVybiBhJiZvJiYocy09TWF0aC5jZWlsKGVbIm9mZnNldCIrdVswXS50b1VwcGVyQ2FzZSgpK3Uuc2xpY2UoMSldLXBhcnNlRmxvYXQoaVt1XSktS2UoZSx1LCJib3JkZXIiLCExLGkpLS41KSkscyYmKHI9dGUuZXhlYyh0KSkmJiJweCIhPT0oclszXXx8InB4IikmJihlLnN0eWxlW3VdPXQsdD1TLmNzcyhlLHUpKSxKZSgwLHQscyl9fX0pLFMuY3NzSG9va3MubWFyZ2luTGVmdD0kZSh5LnJlbGlhYmxlTWFyZ2luTGVmdCxmdW5jdGlvbihlLHQpe2lmKHQpcmV0dXJuKHBhcnNlRmxvYXQoQmUoZSwibWFyZ2luTGVmdCIpKXx8ZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5sZWZ0LVdlKGUse21hcmdpbkxlZnQ6MH0sZnVuY3Rpb24oKXtyZXR1cm4gZS5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKS5sZWZ0fSkpKyJweCJ9KSxTLmVhY2goe21hcmdpbjoiIixwYWRkaW5nOiIiLGJvcmRlcjoiV2lkdGgifSxmdW5jdGlvbihpLG8pe1MuY3NzSG9va3NbaStvXT17ZXhwYW5kOmZ1bmN0aW9uKGUpe2Zvcih2YXIgdD0wLG49e30scj0ic3RyaW5nIj09dHlwZW9mIGU/ZS5zcGxpdCgiICIpOltlXTt0PDQ7dCsrKW5baStuZVt0XStvXT1yW3RdfHxyW3QtMl18fHJbMF07cmV0dXJuIG59fSwibWFyZ2luIiE9PWkmJihTLmNzc0hvb2tzW2krb10uc2V0PUplKX0pLFMuZm4uZXh0ZW5kKHtjc3M6ZnVuY3Rpb24oZSx0KXtyZXR1cm4gJCh0aGlzLGZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG89e30sYT0wO2lmKEFycmF5LmlzQXJyYXkodCkpe2ZvcihyPUllKGUpLGk9dC5sZW5ndGg7YTxpO2ErKylvW3RbYV1dPVMuY3NzKGUsdFthXSwhMSxyKTtyZXR1cm4gb31yZXR1cm4gdm9pZCAwIT09bj9TLnN0eWxlKGUsdCxuKTpTLmNzcyhlLHQpfSxlLHQsMTxhcmd1bWVudHMubGVuZ3RoKX19KSwoKFMuVHdlZW49ZXQpLnByb3RvdHlwZT17Y29uc3RydWN0b3I6ZXQsaW5pdDpmdW5jdGlvbihlLHQsbixyLGksbyl7dGhpcy5lbGVtPWUsdGhpcy5wcm9wPW4sdGhpcy5lYXNpbmc9aXx8Uy5lYXNpbmcuX2RlZmF1bHQsdGhpcy5vcHRpb25zPXQsdGhpcy5zdGFydD10aGlzLm5vdz10aGlzLmN1cigpLHRoaXMuZW5kPXIsdGhpcy51bml0PW98fChTLmNzc051bWJlcltuXT8iIjoicHgiKX0sY3VyOmZ1bmN0aW9uKCl7dmFyIGU9ZXQucHJvcEhvb2tzW3RoaXMucHJvcF07cmV0dXJuIGUmJmUuZ2V0P2UuZ2V0KHRoaXMpOmV0LnByb3BIb29rcy5fZGVmYXVsdC5nZXQodGhpcyl9LHJ1bjpmdW5jdGlvbihlKXt2YXIgdCxuPWV0LnByb3BIb29rc1t0aGlzLnByb3BdO3JldHVybiB0aGlzLm9wdGlvbnMuZHVyYXRpb24/dGhpcy5wb3M9dD1TLmVhc2luZ1t0aGlzLmVhc2luZ10oZSx0aGlzLm9wdGlvbnMuZHVyYXRpb24qZSwwLDEsdGhpcy5vcHRpb25zLmR1cmF0aW9uKTp0aGlzLnBvcz10PWUsdGhpcy5ub3c9KHRoaXMuZW5kLXRoaXMuc3RhcnQpKnQrdGhpcy5zdGFydCx0aGlzLm9wdGlvbnMuc3RlcCYmdGhpcy5vcHRpb25zLnN0ZXAuY2FsbCh0aGlzLmVsZW0sdGhpcy5ub3csdGhpcyksbiYmbi5zZXQ/bi5zZXQodGhpcyk6ZXQucHJvcEhvb2tzLl9kZWZhdWx0LnNldCh0aGlzKSx0aGlzfX0pLmluaXQucHJvdG90eXBlPWV0LnByb3RvdHlwZSwoZXQucHJvcEhvb2tzPXtfZGVmYXVsdDp7Z2V0OmZ1bmN0aW9uKGUpe3ZhciB0O3JldHVybiAxIT09ZS5lbGVtLm5vZGVUeXBlfHxudWxsIT1lLmVsZW1bZS5wcm9wXSYmbnVsbD09ZS5lbGVtLnN0eWxlW2UucHJvcF0/ZS5lbGVtW2UucHJvcF06KHQ9Uy5jc3MoZS5lbGVtLGUucHJvcCwiIikpJiYiYXV0byIhPT10P3Q6MH0sc2V0OmZ1bmN0aW9uKGUpe1MuZnguc3RlcFtlLnByb3BdP1MuZnguc3RlcFtlLnByb3BdKGUpOjEhPT1lLmVsZW0ubm9kZVR5cGV8fCFTLmNzc0hvb2tzW2UucHJvcF0mJm51bGw9PWUuZWxlbS5zdHlsZVtYZShlLnByb3ApXT9lLmVsZW1bZS5wcm9wXT1lLm5vdzpTLnN0eWxlKGUuZWxlbSxlLnByb3AsZS5ub3crZS51bml0KX19fSkuc2Nyb2xsVG9wPWV0LnByb3BIb29rcy5zY3JvbGxMZWZ0PXtzZXQ6ZnVuY3Rpb24oZSl7ZS5lbGVtLm5vZGVUeXBlJiZlLmVsZW0ucGFyZW50Tm9kZSYmKGUuZWxlbVtlLnByb3BdPWUubm93KX19LFMuZWFzaW5nPXtsaW5lYXI6ZnVuY3Rpb24oZSl7cmV0dXJuIGV9LHN3aW5nOmZ1bmN0aW9uKGUpe3JldHVybi41LU1hdGguY29zKGUqTWF0aC5QSSkvMn0sX2RlZmF1bHQ6InN3aW5nIn0sUy5meD1ldC5wcm90b3R5cGUuaW5pdCxTLmZ4LnN0ZXA9e307dmFyIHR0LG50LHJ0LGl0LG90PS9eKD86dG9nZ2xlfHNob3d8aGlkZSkkLyxhdD0vcXVldWVIb29rcyQvO2Z1bmN0aW9uIHN0KCl7bnQmJighMT09PUUuaGlkZGVuJiZDLnJlcXVlc3RBbmltYXRpb25GcmFtZT9DLnJlcXVlc3RBbmltYXRpb25GcmFtZShzdCk6Qy5zZXRUaW1lb3V0KHN0LFMuZnguaW50ZXJ2YWwpLFMuZngudGljaygpKX1mdW5jdGlvbiB1dCgpe3JldHVybiBDLnNldFRpbWVvdXQoZnVuY3Rpb24oKXt0dD12b2lkIDB9KSx0dD1EYXRlLm5vdygpfWZ1bmN0aW9uIGx0KGUsdCl7dmFyIG4scj0wLGk9e2hlaWdodDplfTtmb3IodD10PzE6MDtyPDQ7cis9Mi10KWlbIm1hcmdpbiIrKG49bmVbcl0pXT1pWyJwYWRkaW5nIituXT1lO3JldHVybiB0JiYoaS5vcGFjaXR5PWkud2lkdGg9ZSksaX1mdW5jdGlvbiBjdChlLHQsbil7Zm9yKHZhciByLGk9KGZ0LnR3ZWVuZXJzW3RdfHxbXSkuY29uY2F0KGZ0LnR3ZWVuZXJzWyIqIl0pLG89MCxhPWkubGVuZ3RoO288YTtvKyspaWYocj1pW29dLmNhbGwobix0LGUpKXJldHVybiByfWZ1bmN0aW9uIGZ0KG8sZSx0KXt2YXIgbixhLHI9MCxpPWZ0LnByZWZpbHRlcnMubGVuZ3RoLHM9Uy5EZWZlcnJlZCgpLmFsd2F5cyhmdW5jdGlvbigpe2RlbGV0ZSB1LmVsZW19KSx1PWZ1bmN0aW9uKCl7aWYoYSlyZXR1cm4hMTtmb3IodmFyIGU9dHR8fHV0KCksdD1NYXRoLm1heCgwLGwuc3RhcnRUaW1lK2wuZHVyYXRpb24tZSksbj0xLSh0L2wuZHVyYXRpb258fDApLHI9MCxpPWwudHdlZW5zLmxlbmd0aDtyPGk7cisrKWwudHdlZW5zW3JdLnJ1bihuKTtyZXR1cm4gcy5ub3RpZnlXaXRoKG8sW2wsbix0XSksbjwxJiZpP3Q6KGl8fHMubm90aWZ5V2l0aChvLFtsLDEsMF0pLHMucmVzb2x2ZVdpdGgobyxbbF0pLCExKX0sbD1zLnByb21pc2Uoe2VsZW06byxwcm9wczpTLmV4dGVuZCh7fSxlKSxvcHRzOlMuZXh0ZW5kKCEwLHtzcGVjaWFsRWFzaW5nOnt9LGVhc2luZzpTLmVhc2luZy5fZGVmYXVsdH0sdCksb3JpZ2luYWxQcm9wZXJ0aWVzOmUsb3JpZ2luYWxPcHRpb25zOnQsc3RhcnRUaW1lOnR0fHx1dCgpLGR1cmF0aW9uOnQuZHVyYXRpb24sdHdlZW5zOltdLGNyZWF0ZVR3ZWVuOmZ1bmN0aW9uKGUsdCl7dmFyIG49Uy5Ud2VlbihvLGwub3B0cyxlLHQsbC5vcHRzLnNwZWNpYWxFYXNpbmdbZV18fGwub3B0cy5lYXNpbmcpO3JldHVybiBsLnR3ZWVucy5wdXNoKG4pLG59LHN0b3A6ZnVuY3Rpb24oZSl7dmFyIHQ9MCxuPWU/bC50d2VlbnMubGVuZ3RoOjA7aWYoYSlyZXR1cm4gdGhpcztmb3IoYT0hMDt0PG47dCsrKWwudHdlZW5zW3RdLnJ1bigxKTtyZXR1cm4gZT8ocy5ub3RpZnlXaXRoKG8sW2wsMSwwXSkscy5yZXNvbHZlV2l0aChvLFtsLGVdKSk6cy5yZWplY3RXaXRoKG8sW2wsZV0pLHRoaXN9fSksYz1sLnByb3BzO2ZvcighZnVuY3Rpb24oZSx0KXt2YXIgbixyLGksbyxhO2ZvcihuIGluIGUpaWYoaT10W3I9WChuKV0sbz1lW25dLEFycmF5LmlzQXJyYXkobykmJihpPW9bMV0sbz1lW25dPW9bMF0pLG4hPT1yJiYoZVtyXT1vLGRlbGV0ZSBlW25dKSwoYT1TLmNzc0hvb2tzW3JdKSYmImV4cGFuZCJpbiBhKWZvcihuIGluIG89YS5leHBhbmQobyksZGVsZXRlIGVbcl0sbyluIGluIGV8fChlW25dPW9bbl0sdFtuXT1pKTtlbHNlIHRbcl09aX0oYyxsLm9wdHMuc3BlY2lhbEVhc2luZyk7cjxpO3IrKylpZihuPWZ0LnByZWZpbHRlcnNbcl0uY2FsbChsLG8sYyxsLm9wdHMpKXJldHVybiBtKG4uc3RvcCkmJihTLl9xdWV1ZUhvb2tzKGwuZWxlbSxsLm9wdHMucXVldWUpLnN0b3A9bi5zdG9wLmJpbmQobikpLG47cmV0dXJuIFMubWFwKGMsY3QsbCksbShsLm9wdHMuc3RhcnQpJiZsLm9wdHMuc3RhcnQuY2FsbChvLGwpLGwucHJvZ3Jlc3MobC5vcHRzLnByb2dyZXNzKS5kb25lKGwub3B0cy5kb25lLGwub3B0cy5jb21wbGV0ZSkuZmFpbChsLm9wdHMuZmFpbCkuYWx3YXlzKGwub3B0cy5hbHdheXMpLFMuZngudGltZXIoUy5leHRlbmQodSx7ZWxlbTpvLGFuaW06bCxxdWV1ZTpsLm9wdHMucXVldWV9KSksbH1TLkFuaW1hdGlvbj1TLmV4dGVuZChmdCx7dHdlZW5lcnM6eyIqIjpbZnVuY3Rpb24oZSx0KXt2YXIgbj10aGlzLmNyZWF0ZVR3ZWVuKGUsdCk7cmV0dXJuIHNlKG4uZWxlbSxlLHRlLmV4ZWModCksbiksbn1dfSx0d2VlbmVyOmZ1bmN0aW9uKGUsdCl7bShlKT8odD1lLGU9WyIqIl0pOmU9ZS5tYXRjaChQKTtmb3IodmFyIG4scj0wLGk9ZS5sZW5ndGg7cjxpO3IrKyluPWVbcl0sZnQudHdlZW5lcnNbbl09ZnQudHdlZW5lcnNbbl18fFtdLGZ0LnR3ZWVuZXJzW25dLnVuc2hpZnQodCl9LHByZWZpbHRlcnM6W2Z1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG8sYSxzLHUsbCxjLGY9IndpZHRoImluIHR8fCJoZWlnaHQiaW4gdCxwPXRoaXMsZD17fSxoPWUuc3R5bGUsZz1lLm5vZGVUeXBlJiZhZShlKSx2PVkuZ2V0KGUsImZ4c2hvdyIpO2ZvcihyIGluIG4ucXVldWV8fChudWxsPT0oYT1TLl9xdWV1ZUhvb2tzKGUsImZ4IikpLnVucXVldWVkJiYoYS51bnF1ZXVlZD0wLHM9YS5lbXB0eS5maXJlLGEuZW1wdHkuZmlyZT1mdW5jdGlvbigpe2EudW5xdWV1ZWR8fHMoKX0pLGEudW5xdWV1ZWQrKyxwLmFsd2F5cyhmdW5jdGlvbigpe3AuYWx3YXlzKGZ1bmN0aW9uKCl7YS51bnF1ZXVlZC0tLFMucXVldWUoZSwiZngiKS5sZW5ndGh8fGEuZW1wdHkuZmlyZSgpfSl9KSksdClpZihpPXRbcl0sb3QudGVzdChpKSl7aWYoZGVsZXRlIHRbcl0sbz1vfHwidG9nZ2xlIj09PWksaT09PShnPyJoaWRlIjoic2hvdyIpKXtpZigic2hvdyIhPT1pfHwhdnx8dm9pZCAwPT09dltyXSljb250aW51ZTtnPSEwfWRbcl09diYmdltyXXx8Uy5zdHlsZShlLHIpfWlmKCh1PSFTLmlzRW1wdHlPYmplY3QodCkpfHwhUy5pc0VtcHR5T2JqZWN0KGQpKWZvcihyIGluIGYmJjE9PT1lLm5vZGVUeXBlJiYobi5vdmVyZmxvdz1baC5vdmVyZmxvdyxoLm92ZXJmbG93WCxoLm92ZXJmbG93WV0sbnVsbD09KGw9diYmdi5kaXNwbGF5KSYmKGw9WS5nZXQoZSwiZGlzcGxheSIpKSwibm9uZSI9PT0oYz1TLmNzcyhlLCJkaXNwbGF5IikpJiYobD9jPWw6KGxlKFtlXSwhMCksbD1lLnN0eWxlLmRpc3BsYXl8fGwsYz1TLmNzcyhlLCJkaXNwbGF5IiksbGUoW2VdKSkpLCgiaW5saW5lIj09PWN8fCJpbmxpbmUtYmxvY2siPT09YyYmbnVsbCE9bCkmJiJub25lIj09PVMuY3NzKGUsImZsb2F0IikmJih1fHwocC5kb25lKGZ1bmN0aW9uKCl7aC5kaXNwbGF5PWx9KSxudWxsPT1sJiYoYz1oLmRpc3BsYXksbD0ibm9uZSI9PT1jPyIiOmMpKSxoLmRpc3BsYXk9ImlubGluZS1ibG9jayIpKSxuLm92ZXJmbG93JiYoaC5vdmVyZmxvdz0iaGlkZGVuIixwLmFsd2F5cyhmdW5jdGlvbigpe2gub3ZlcmZsb3c9bi5vdmVyZmxvd1swXSxoLm92ZXJmbG93WD1uLm92ZXJmbG93WzFdLGgub3ZlcmZsb3dZPW4ub3ZlcmZsb3dbMl19KSksdT0hMSxkKXV8fCh2PyJoaWRkZW4iaW4gdiYmKGc9di5oaWRkZW4pOnY9WS5hY2Nlc3MoZSwiZnhzaG93Iix7ZGlzcGxheTpsfSksbyYmKHYuaGlkZGVuPSFnKSxnJiZsZShbZV0sITApLHAuZG9uZShmdW5jdGlvbigpe2ZvcihyIGluIGd8fGxlKFtlXSksWS5yZW1vdmUoZSwiZnhzaG93IiksZClTLnN0eWxlKGUscixkW3JdKX0pKSx1PWN0KGc/dltyXTowLHIscCksciBpbiB2fHwodltyXT11LnN0YXJ0LGcmJih1LmVuZD11LnN0YXJ0LHUuc3RhcnQ9MCkpfV0scHJlZmlsdGVyOmZ1bmN0aW9uKGUsdCl7dD9mdC5wcmVmaWx0ZXJzLnVuc2hpZnQoZSk6ZnQucHJlZmlsdGVycy5wdXNoKGUpfX0pLFMuc3BlZWQ9ZnVuY3Rpb24oZSx0LG4pe3ZhciByPWUmJiJvYmplY3QiPT10eXBlb2YgZT9TLmV4dGVuZCh7fSxlKTp7Y29tcGxldGU6bnx8IW4mJnR8fG0oZSkmJmUsZHVyYXRpb246ZSxlYXNpbmc6biYmdHx8dCYmIW0odCkmJnR9O3JldHVybiBTLmZ4Lm9mZj9yLmR1cmF0aW9uPTA6Im51bWJlciIhPXR5cGVvZiByLmR1cmF0aW9uJiYoci5kdXJhdGlvbiBpbiBTLmZ4LnNwZWVkcz9yLmR1cmF0aW9uPVMuZnguc3BlZWRzW3IuZHVyYXRpb25dOnIuZHVyYXRpb249Uy5meC5zcGVlZHMuX2RlZmF1bHQpLG51bGwhPXIucXVldWUmJiEwIT09ci5xdWV1ZXx8KHIucXVldWU9ImZ4Iiksci5vbGQ9ci5jb21wbGV0ZSxyLmNvbXBsZXRlPWZ1bmN0aW9uKCl7bShyLm9sZCkmJnIub2xkLmNhbGwodGhpcyksci5xdWV1ZSYmUy5kZXF1ZXVlKHRoaXMsci5xdWV1ZSl9LHJ9LFMuZm4uZXh0ZW5kKHtmYWRlVG86ZnVuY3Rpb24oZSx0LG4scil7cmV0dXJuIHRoaXMuZmlsdGVyKGFlKS5jc3MoIm9wYWNpdHkiLDApLnNob3coKS5lbmQoKS5hbmltYXRlKHtvcGFjaXR5OnR9LGUsbixyKX0sYW5pbWF0ZTpmdW5jdGlvbih0LGUsbixyKXt2YXIgaT1TLmlzRW1wdHlPYmplY3QodCksbz1TLnNwZWVkKGUsbixyKSxhPWZ1bmN0aW9uKCl7dmFyIGU9ZnQodGhpcyxTLmV4dGVuZCh7fSx0KSxvKTsoaXx8WS5nZXQodGhpcywiZmluaXNoIikpJiZlLnN0b3AoITApfTtyZXR1cm4gYS5maW5pc2g9YSxpfHwhMT09PW8ucXVldWU/dGhpcy5lYWNoKGEpOnRoaXMucXVldWUoby5xdWV1ZSxhKX0sc3RvcDpmdW5jdGlvbihpLGUsbyl7dmFyIGE9ZnVuY3Rpb24oZSl7dmFyIHQ9ZS5zdG9wO2RlbGV0ZSBlLnN0b3AsdChvKX07cmV0dXJuInN0cmluZyIhPXR5cGVvZiBpJiYobz1lLGU9aSxpPXZvaWQgMCksZSYmdGhpcy5xdWV1ZShpfHwiZngiLFtdKSx0aGlzLmVhY2goZnVuY3Rpb24oKXt2YXIgZT0hMCx0PW51bGwhPWkmJmkrInF1ZXVlSG9va3MiLG49Uy50aW1lcnMscj1ZLmdldCh0aGlzKTtpZih0KXJbdF0mJnJbdF0uc3RvcCYmYShyW3RdKTtlbHNlIGZvcih0IGluIHIpclt0XSYmclt0XS5zdG9wJiZhdC50ZXN0KHQpJiZhKHJbdF0pO2Zvcih0PW4ubGVuZ3RoO3QtLTspblt0XS5lbGVtIT09dGhpc3x8bnVsbCE9aSYmblt0XS5xdWV1ZSE9PWl8fChuW3RdLmFuaW0uc3RvcChvKSxlPSExLG4uc3BsaWNlKHQsMSkpOyFlJiZvfHxTLmRlcXVldWUodGhpcyxpKX0pfSxmaW5pc2g6ZnVuY3Rpb24oYSl7cmV0dXJuITEhPT1hJiYoYT1hfHwiZngiKSx0aGlzLmVhY2goZnVuY3Rpb24oKXt2YXIgZSx0PVkuZ2V0KHRoaXMpLG49dFthKyJxdWV1ZSJdLHI9dFthKyJxdWV1ZUhvb2tzIl0saT1TLnRpbWVycyxvPW4/bi5sZW5ndGg6MDtmb3IodC5maW5pc2g9ITAsUy5xdWV1ZSh0aGlzLGEsW10pLHImJnIuc3RvcCYmci5zdG9wLmNhbGwodGhpcywhMCksZT1pLmxlbmd0aDtlLS07KWlbZV0uZWxlbT09PXRoaXMmJmlbZV0ucXVldWU9PT1hJiYoaVtlXS5hbmltLnN0b3AoITApLGkuc3BsaWNlKGUsMSkpO2ZvcihlPTA7ZTxvO2UrKyluW2VdJiZuW2VdLmZpbmlzaCYmbltlXS5maW5pc2guY2FsbCh0aGlzKTtkZWxldGUgdC5maW5pc2h9KX19KSxTLmVhY2goWyJ0b2dnbGUiLCJzaG93IiwiaGlkZSJdLGZ1bmN0aW9uKGUscil7dmFyIGk9Uy5mbltyXTtTLmZuW3JdPWZ1bmN0aW9uKGUsdCxuKXtyZXR1cm4gbnVsbD09ZXx8ImJvb2xlYW4iPT10eXBlb2YgZT9pLmFwcGx5KHRoaXMsYXJndW1lbnRzKTp0aGlzLmFuaW1hdGUobHQociwhMCksZSx0LG4pfX0pLFMuZWFjaCh7c2xpZGVEb3duOmx0KCJzaG93Iiksc2xpZGVVcDpsdCgiaGlkZSIpLHNsaWRlVG9nZ2xlOmx0KCJ0b2dnbGUiKSxmYWRlSW46e29wYWNpdHk6InNob3cifSxmYWRlT3V0OntvcGFjaXR5OiJoaWRlIn0sZmFkZVRvZ2dsZTp7b3BhY2l0eToidG9nZ2xlIn19LGZ1bmN0aW9uKGUscil7Uy5mbltlXT1mdW5jdGlvbihlLHQsbil7cmV0dXJuIHRoaXMuYW5pbWF0ZShyLGUsdCxuKX19KSxTLnRpbWVycz1bXSxTLmZ4LnRpY2s9ZnVuY3Rpb24oKXt2YXIgZSx0PTAsbj1TLnRpbWVycztmb3IodHQ9RGF0ZS5ub3coKTt0PG4ubGVuZ3RoO3QrKykoZT1uW3RdKSgpfHxuW3RdIT09ZXx8bi5zcGxpY2UodC0tLDEpO24ubGVuZ3RofHxTLmZ4LnN0b3AoKSx0dD12b2lkIDB9LFMuZngudGltZXI9ZnVuY3Rpb24oZSl7Uy50aW1lcnMucHVzaChlKSxTLmZ4LnN0YXJ0KCl9LFMuZnguaW50ZXJ2YWw9MTMsUy5meC5zdGFydD1mdW5jdGlvbigpe250fHwobnQ9ITAsc3QoKSl9LFMuZnguc3RvcD1mdW5jdGlvbigpe250PW51bGx9LFMuZnguc3BlZWRzPXtzbG93OjYwMCxmYXN0OjIwMCxfZGVmYXVsdDo0MDB9LFMuZm4uZGVsYXk9ZnVuY3Rpb24ocixlKXtyZXR1cm4gcj1TLmZ4JiZTLmZ4LnNwZWVkc1tyXXx8cixlPWV8fCJmeCIsdGhpcy5xdWV1ZShlLGZ1bmN0aW9uKGUsdCl7dmFyIG49Qy5zZXRUaW1lb3V0KGUscik7dC5zdG9wPWZ1bmN0aW9uKCl7Qy5jbGVhclRpbWVvdXQobil9fSl9LHJ0PUUuY3JlYXRlRWxlbWVudCgiaW5wdXQiKSxpdD1FLmNyZWF0ZUVsZW1lbnQoInNlbGVjdCIpLmFwcGVuZENoaWxkKEUuY3JlYXRlRWxlbWVudCgib3B0aW9uIikpLHJ0LnR5cGU9ImNoZWNrYm94Iix5LmNoZWNrT249IiIhPT1ydC52YWx1ZSx5Lm9wdFNlbGVjdGVkPWl0LnNlbGVjdGVkLChydD1FLmNyZWF0ZUVsZW1lbnQoImlucHV0IikpLnZhbHVlPSJ0IixydC50eXBlPSJyYWRpbyIseS5yYWRpb1ZhbHVlPSJ0Ij09PXJ0LnZhbHVlO3ZhciBwdCxkdD1TLmV4cHIuYXR0ckhhbmRsZTtTLmZuLmV4dGVuZCh7YXR0cjpmdW5jdGlvbihlLHQpe3JldHVybiAkKHRoaXMsUy5hdHRyLGUsdCwxPGFyZ3VtZW50cy5sZW5ndGgpfSxyZW1vdmVBdHRyOmZ1bmN0aW9uKGUpe3JldHVybiB0aGlzLmVhY2goZnVuY3Rpb24oKXtTLnJlbW92ZUF0dHIodGhpcyxlKX0pfX0pLFMuZXh0ZW5kKHthdHRyOmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG89ZS5ub2RlVHlwZTtpZigzIT09byYmOCE9PW8mJjIhPT1vKXJldHVybiJ1bmRlZmluZWQiPT10eXBlb2YgZS5nZXRBdHRyaWJ1dGU/Uy5wcm9wKGUsdCxuKTooMT09PW8mJlMuaXNYTUxEb2MoZSl8fChpPVMuYXR0ckhvb2tzW3QudG9Mb3dlckNhc2UoKV18fChTLmV4cHIubWF0Y2guYm9vbC50ZXN0KHQpP3B0OnZvaWQgMCkpLHZvaWQgMCE9PW4/bnVsbD09PW4/dm9pZCBTLnJlbW92ZUF0dHIoZSx0KTppJiYic2V0ImluIGkmJnZvaWQgMCE9PShyPWkuc2V0KGUsbix0KSk/cjooZS5zZXRBdHRyaWJ1dGUodCxuKyIiKSxuKTppJiYiZ2V0ImluIGkmJm51bGwhPT0ocj1pLmdldChlLHQpKT9yOm51bGw9PShyPVMuZmluZC5hdHRyKGUsdCkpP3ZvaWQgMDpyKX0sYXR0ckhvb2tzOnt0eXBlOntzZXQ6ZnVuY3Rpb24oZSx0KXtpZigheS5yYWRpb1ZhbHVlJiYicmFkaW8iPT09dCYmQShlLCJpbnB1dCIpKXt2YXIgbj1lLnZhbHVlO3JldHVybiBlLnNldEF0dHJpYnV0ZSgidHlwZSIsdCksbiYmKGUudmFsdWU9biksdH19fX0scmVtb3ZlQXR0cjpmdW5jdGlvbihlLHQpe3ZhciBuLHI9MCxpPXQmJnQubWF0Y2goUCk7aWYoaSYmMT09PWUubm9kZVR5cGUpd2hpbGUobj1pW3IrK10pZS5yZW1vdmVBdHRyaWJ1dGUobil9fSkscHQ9e3NldDpmdW5jdGlvbihlLHQsbil7cmV0dXJuITE9PT10P1MucmVtb3ZlQXR0cihlLG4pOmUuc2V0QXR0cmlidXRlKG4sbiksbn19LFMuZWFjaChTLmV4cHIubWF0Y2guYm9vbC5zb3VyY2UubWF0Y2goL1x3Ky9nKSxmdW5jdGlvbihlLHQpe3ZhciBhPWR0W3RdfHxTLmZpbmQuYXR0cjtkdFt0XT1mdW5jdGlvbihlLHQsbil7dmFyIHIsaSxvPXQudG9Mb3dlckNhc2UoKTtyZXR1cm4gbnx8KGk9ZHRbb10sZHRbb109cixyPW51bGwhPWEoZSx0LG4pP286bnVsbCxkdFtvXT1pKSxyfX0pO3ZhciBodD0vXig/OmlucHV0fHNlbGVjdHx0ZXh0YXJlYXxidXR0b24pJC9pLGd0PS9eKD86YXxhcmVhKSQvaTtmdW5jdGlvbiB2dChlKXtyZXR1cm4oZS5tYXRjaChQKXx8W10pLmpvaW4oIiAiKX1mdW5jdGlvbiB5dChlKXtyZXR1cm4gZS5nZXRBdHRyaWJ1dGUmJmUuZ2V0QXR0cmlidXRlKCJjbGFzcyIpfHwiIn1mdW5jdGlvbiBtdChlKXtyZXR1cm4gQXJyYXkuaXNBcnJheShlKT9lOiJzdHJpbmciPT10eXBlb2YgZSYmZS5tYXRjaChQKXx8W119Uy5mbi5leHRlbmQoe3Byb3A6ZnVuY3Rpb24oZSx0KXtyZXR1cm4gJCh0aGlzLFMucHJvcCxlLHQsMTxhcmd1bWVudHMubGVuZ3RoKX0scmVtb3ZlUHJvcDpmdW5jdGlvbihlKXtyZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uKCl7ZGVsZXRlIHRoaXNbUy5wcm9wRml4W2VdfHxlXX0pfX0pLFMuZXh0ZW5kKHtwcm9wOmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG89ZS5ub2RlVHlwZTtpZigzIT09byYmOCE9PW8mJjIhPT1vKXJldHVybiAxPT09byYmUy5pc1hNTERvYyhlKXx8KHQ9Uy5wcm9wRml4W3RdfHx0LGk9Uy5wcm9wSG9va3NbdF0pLHZvaWQgMCE9PW4/aSYmInNldCJpbiBpJiZ2b2lkIDAhPT0ocj1pLnNldChlLG4sdCkpP3I6ZVt0XT1uOmkmJiJnZXQiaW4gaSYmbnVsbCE9PShyPWkuZ2V0KGUsdCkpP3I6ZVt0XX0scHJvcEhvb2tzOnt0YWJJbmRleDp7Z2V0OmZ1bmN0aW9uKGUpe3ZhciB0PVMuZmluZC5hdHRyKGUsInRhYmluZGV4Iik7cmV0dXJuIHQ/cGFyc2VJbnQodCwxMCk6aHQudGVzdChlLm5vZGVOYW1lKXx8Z3QudGVzdChlLm5vZGVOYW1lKSYmZS5ocmVmPzA6LTF9fX0scHJvcEZpeDp7ImZvciI6Imh0bWxGb3IiLCJjbGFzcyI6ImNsYXNzTmFtZSJ9fSkseS5vcHRTZWxlY3RlZHx8KFMucHJvcEhvb2tzLnNlbGVjdGVkPXtnZXQ6ZnVuY3Rpb24oZSl7dmFyIHQ9ZS5wYXJlbnROb2RlO3JldHVybiB0JiZ0LnBhcmVudE5vZGUmJnQucGFyZW50Tm9kZS5zZWxlY3RlZEluZGV4LG51bGx9LHNldDpmdW5jdGlvbihlKXt2YXIgdD1lLnBhcmVudE5vZGU7dCYmKHQuc2VsZWN0ZWRJbmRleCx0LnBhcmVudE5vZGUmJnQucGFyZW50Tm9kZS5zZWxlY3RlZEluZGV4KX19KSxTLmVhY2goWyJ0YWJJbmRleCIsInJlYWRPbmx5IiwibWF4TGVuZ3RoIiwiY2VsbFNwYWNpbmciLCJjZWxsUGFkZGluZyIsInJvd1NwYW4iLCJjb2xTcGFuIiwidXNlTWFwIiwiZnJhbWVCb3JkZXIiLCJjb250ZW50RWRpdGFibGUiXSxmdW5jdGlvbigpe1MucHJvcEZpeFt0aGlzLnRvTG93ZXJDYXNlKCldPXRoaXN9KSxTLmZuLmV4dGVuZCh7YWRkQ2xhc3M6ZnVuY3Rpb24odCl7dmFyIGUsbixyLGksbyxhLHMsdT0wO2lmKG0odCkpcmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbihlKXtTKHRoaXMpLmFkZENsYXNzKHQuY2FsbCh0aGlzLGUseXQodGhpcykpKX0pO2lmKChlPW10KHQpKS5sZW5ndGgpd2hpbGUobj10aGlzW3UrK10paWYoaT15dChuKSxyPTE9PT1uLm5vZGVUeXBlJiYiICIrdnQoaSkrIiAiKXthPTA7d2hpbGUobz1lW2ErK10pci5pbmRleE9mKCIgIitvKyIgIik8MCYmKHIrPW8rIiAiKTtpIT09KHM9dnQocikpJiZuLnNldEF0dHJpYnV0ZSgiY2xhc3MiLHMpfXJldHVybiB0aGlzfSxyZW1vdmVDbGFzczpmdW5jdGlvbih0KXt2YXIgZSxuLHIsaSxvLGEscyx1PTA7aWYobSh0KSlyZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uKGUpe1ModGhpcykucmVtb3ZlQ2xhc3ModC5jYWxsKHRoaXMsZSx5dCh0aGlzKSkpfSk7aWYoIWFyZ3VtZW50cy5sZW5ndGgpcmV0dXJuIHRoaXMuYXR0cigiY2xhc3MiLCIiKTtpZigoZT1tdCh0KSkubGVuZ3RoKXdoaWxlKG49dGhpc1t1KytdKWlmKGk9eXQobikscj0xPT09bi5ub2RlVHlwZSYmIiAiK3Z0KGkpKyIgIil7YT0wO3doaWxlKG89ZVthKytdKXdoaWxlKC0xPHIuaW5kZXhPZigiICIrbysiICIpKXI9ci5yZXBsYWNlKCIgIitvKyIgIiwiICIpO2khPT0ocz12dChyKSkmJm4uc2V0QXR0cmlidXRlKCJjbGFzcyIscyl9cmV0dXJuIHRoaXN9LHRvZ2dsZUNsYXNzOmZ1bmN0aW9uKGksdCl7dmFyIG89dHlwZW9mIGksYT0ic3RyaW5nIj09PW98fEFycmF5LmlzQXJyYXkoaSk7cmV0dXJuImJvb2xlYW4iPT10eXBlb2YgdCYmYT90P3RoaXMuYWRkQ2xhc3MoaSk6dGhpcy5yZW1vdmVDbGFzcyhpKTptKGkpP3RoaXMuZWFjaChmdW5jdGlvbihlKXtTKHRoaXMpLnRvZ2dsZUNsYXNzKGkuY2FsbCh0aGlzLGUseXQodGhpcyksdCksdCl9KTp0aGlzLmVhY2goZnVuY3Rpb24oKXt2YXIgZSx0LG4scjtpZihhKXt0PTAsbj1TKHRoaXMpLHI9bXQoaSk7d2hpbGUoZT1yW3QrK10pbi5oYXNDbGFzcyhlKT9uLnJlbW92ZUNsYXNzKGUpOm4uYWRkQ2xhc3MoZSl9ZWxzZSB2b2lkIDAhPT1pJiYiYm9vbGVhbiIhPT1vfHwoKGU9eXQodGhpcykpJiZZLnNldCh0aGlzLCJfX2NsYXNzTmFtZV9fIixlKSx0aGlzLnNldEF0dHJpYnV0ZSYmdGhpcy5zZXRBdHRyaWJ1dGUoImNsYXNzIixlfHwhMT09PWk/IiI6WS5nZXQodGhpcywiX19jbGFzc05hbWVfXyIpfHwiIikpfSl9LGhhc0NsYXNzOmZ1bmN0aW9uKGUpe3ZhciB0LG4scj0wO3Q9IiAiK2UrIiAiO3doaWxlKG49dGhpc1tyKytdKWlmKDE9PT1uLm5vZGVUeXBlJiYtMTwoIiAiK3Z0KHl0KG4pKSsiICIpLmluZGV4T2YodCkpcmV0dXJuITA7cmV0dXJuITF9fSk7dmFyIHh0PS9cci9nO1MuZm4uZXh0ZW5kKHt2YWw6ZnVuY3Rpb24obil7dmFyIHIsZSxpLHQ9dGhpc1swXTtyZXR1cm4gYXJndW1lbnRzLmxlbmd0aD8oaT1tKG4pLHRoaXMuZWFjaChmdW5jdGlvbihlKXt2YXIgdDsxPT09dGhpcy5ub2RlVHlwZSYmKG51bGw9PSh0PWk/bi5jYWxsKHRoaXMsZSxTKHRoaXMpLnZhbCgpKTpuKT90PSIiOiJudW1iZXIiPT10eXBlb2YgdD90Kz0iIjpBcnJheS5pc0FycmF5KHQpJiYodD1TLm1hcCh0LGZ1bmN0aW9uKGUpe3JldHVybiBudWxsPT1lPyIiOmUrIiJ9KSksKHI9Uy52YWxIb29rc1t0aGlzLnR5cGVdfHxTLnZhbEhvb2tzW3RoaXMubm9kZU5hbWUudG9Mb3dlckNhc2UoKV0pJiYic2V0ImluIHImJnZvaWQgMCE9PXIuc2V0KHRoaXMsdCwidmFsdWUiKXx8KHRoaXMudmFsdWU9dCkpfSkpOnQ/KHI9Uy52YWxIb29rc1t0LnR5cGVdfHxTLnZhbEhvb2tzW3Qubm9kZU5hbWUudG9Mb3dlckNhc2UoKV0pJiYiZ2V0ImluIHImJnZvaWQgMCE9PShlPXIuZ2V0KHQsInZhbHVlIikpP2U6InN0cmluZyI9PXR5cGVvZihlPXQudmFsdWUpP2UucmVwbGFjZSh4dCwiIik6bnVsbD09ZT8iIjplOnZvaWQgMH19KSxTLmV4dGVuZCh7dmFsSG9va3M6e29wdGlvbjp7Z2V0OmZ1bmN0aW9uKGUpe3ZhciB0PVMuZmluZC5hdHRyKGUsInZhbHVlIik7cmV0dXJuIG51bGwhPXQ/dDp2dChTLnRleHQoZSkpfX0sc2VsZWN0OntnZXQ6ZnVuY3Rpb24oZSl7dmFyIHQsbixyLGk9ZS5vcHRpb25zLG89ZS5zZWxlY3RlZEluZGV4LGE9InNlbGVjdC1vbmUiPT09ZS50eXBlLHM9YT9udWxsOltdLHU9YT9vKzE6aS5sZW5ndGg7Zm9yKHI9bzwwP3U6YT9vOjA7cjx1O3IrKylpZigoKG49aVtyXSkuc2VsZWN0ZWR8fHI9PT1vKSYmIW4uZGlzYWJsZWQmJighbi5wYXJlbnROb2RlLmRpc2FibGVkfHwhQShuLnBhcmVudE5vZGUsIm9wdGdyb3VwIikpKXtpZih0PVMobikudmFsKCksYSlyZXR1cm4gdDtzLnB1c2godCl9cmV0dXJuIHN9LHNldDpmdW5jdGlvbihlLHQpe3ZhciBuLHIsaT1lLm9wdGlvbnMsbz1TLm1ha2VBcnJheSh0KSxhPWkubGVuZ3RoO3doaWxlKGEtLSkoKHI9aVthXSkuc2VsZWN0ZWQ9LTE8Uy5pbkFycmF5KFMudmFsSG9va3Mub3B0aW9uLmdldChyKSxvKSkmJihuPSEwKTtyZXR1cm4gbnx8KGUuc2VsZWN0ZWRJbmRleD0tMSksb319fX0pLFMuZWFjaChbInJhZGlvIiwiY2hlY2tib3giXSxmdW5jdGlvbigpe1MudmFsSG9va3NbdGhpc109e3NldDpmdW5jdGlvbihlLHQpe2lmKEFycmF5LmlzQXJyYXkodCkpcmV0dXJuIGUuY2hlY2tlZD0tMTxTLmluQXJyYXkoUyhlKS52YWwoKSx0KX19LHkuY2hlY2tPbnx8KFMudmFsSG9va3NbdGhpc10uZ2V0PWZ1bmN0aW9uKGUpe3JldHVybiBudWxsPT09ZS5nZXRBdHRyaWJ1dGUoInZhbHVlIik/Im9uIjplLnZhbHVlfSl9KSx5LmZvY3VzaW49Im9uZm9jdXNpbiJpbiBDO3ZhciBidD0vXig/OmZvY3VzaW5mb2N1c3xmb2N1c291dGJsdXIpJC8sd3Q9ZnVuY3Rpb24oZSl7ZS5zdG9wUHJvcGFnYXRpb24oKX07Uy5leHRlbmQoUy5ldmVudCx7dHJpZ2dlcjpmdW5jdGlvbihlLHQsbixyKXt2YXIgaSxvLGEscyx1LGwsYyxmLHA9W258fEVdLGQ9di5jYWxsKGUsInR5cGUiKT9lLnR5cGU6ZSxoPXYuY2FsbChlLCJuYW1lc3BhY2UiKT9lLm5hbWVzcGFjZS5zcGxpdCgiLiIpOltdO2lmKG89Zj1hPW49bnx8RSwzIT09bi5ub2RlVHlwZSYmOCE9PW4ubm9kZVR5cGUmJiFidC50ZXN0KGQrUy5ldmVudC50cmlnZ2VyZWQpJiYoLTE8ZC5pbmRleE9mKCIuIikmJihkPShoPWQuc3BsaXQoIi4iKSkuc2hpZnQoKSxoLnNvcnQoKSksdT1kLmluZGV4T2YoIjoiKTwwJiYib24iK2QsKGU9ZVtTLmV4cGFuZG9dP2U6bmV3IFMuRXZlbnQoZCwib2JqZWN0Ij09dHlwZW9mIGUmJmUpKS5pc1RyaWdnZXI9cj8yOjMsZS5uYW1lc3BhY2U9aC5qb2luKCIuIiksZS5ybmFtZXNwYWNlPWUubmFtZXNwYWNlP25ldyBSZWdFeHAoIihefFxcLikiK2guam9pbigiXFwuKD86LipcXC58KSIpKyIoXFwufCQpIik6bnVsbCxlLnJlc3VsdD12b2lkIDAsZS50YXJnZXR8fChlLnRhcmdldD1uKSx0PW51bGw9PXQ/W2VdOlMubWFrZUFycmF5KHQsW2VdKSxjPVMuZXZlbnQuc3BlY2lhbFtkXXx8e30scnx8IWMudHJpZ2dlcnx8ITEhPT1jLnRyaWdnZXIuYXBwbHkobix0KSkpe2lmKCFyJiYhYy5ub0J1YmJsZSYmIXgobikpe2ZvcihzPWMuZGVsZWdhdGVUeXBlfHxkLGJ0LnRlc3QocytkKXx8KG89by5wYXJlbnROb2RlKTtvO289by5wYXJlbnROb2RlKXAucHVzaChvKSxhPW87YT09PShuLm93bmVyRG9jdW1lbnR8fEUpJiZwLnB1c2goYS5kZWZhdWx0Vmlld3x8YS5wYXJlbnRXaW5kb3d8fEMpfWk9MDt3aGlsZSgobz1wW2krK10pJiYhZS5pc1Byb3BhZ2F0aW9uU3RvcHBlZCgpKWY9byxlLnR5cGU9MTxpP3M6Yy5iaW5kVHlwZXx8ZCwobD0oWS5nZXQobywiZXZlbnRzIil8fE9iamVjdC5jcmVhdGUobnVsbCkpW2UudHlwZV0mJlkuZ2V0KG8sImhhbmRsZSIpKSYmbC5hcHBseShvLHQpLChsPXUmJm9bdV0pJiZsLmFwcGx5JiZWKG8pJiYoZS5yZXN1bHQ9bC5hcHBseShvLHQpLCExPT09ZS5yZXN1bHQmJmUucHJldmVudERlZmF1bHQoKSk7cmV0dXJuIGUudHlwZT1kLHJ8fGUuaXNEZWZhdWx0UHJldmVudGVkKCl8fGMuX2RlZmF1bHQmJiExIT09Yy5fZGVmYXVsdC5hcHBseShwLnBvcCgpLHQpfHwhVihuKXx8dSYmbShuW2RdKSYmIXgobikmJigoYT1uW3VdKSYmKG5bdV09bnVsbCksUy5ldmVudC50cmlnZ2VyZWQ9ZCxlLmlzUHJvcGFnYXRpb25TdG9wcGVkKCkmJmYuYWRkRXZlbnRMaXN0ZW5lcihkLHd0KSxuW2RdKCksZS5pc1Byb3BhZ2F0aW9uU3RvcHBlZCgpJiZmLnJlbW92ZUV2ZW50TGlzdGVuZXIoZCx3dCksUy5ldmVudC50cmlnZ2VyZWQ9dm9pZCAwLGEmJihuW3VdPWEpKSxlLnJlc3VsdH19LHNpbXVsYXRlOmZ1bmN0aW9uKGUsdCxuKXt2YXIgcj1TLmV4dGVuZChuZXcgUy5FdmVudCxuLHt0eXBlOmUsaXNTaW11bGF0ZWQ6ITB9KTtTLmV2ZW50LnRyaWdnZXIocixudWxsLHQpfX0pLFMuZm4uZXh0ZW5kKHt0cmlnZ2VyOmZ1bmN0aW9uKGUsdCl7cmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbigpe1MuZXZlbnQudHJpZ2dlcihlLHQsdGhpcyl9KX0sdHJpZ2dlckhhbmRsZXI6ZnVuY3Rpb24oZSx0KXt2YXIgbj10aGlzWzBdO2lmKG4pcmV0dXJuIFMuZXZlbnQudHJpZ2dlcihlLHQsbiwhMCl9fSkseS5mb2N1c2lufHxTLmVhY2goe2ZvY3VzOiJmb2N1c2luIixibHVyOiJmb2N1c291dCJ9LGZ1bmN0aW9uKG4scil7dmFyIGk9ZnVuY3Rpb24oZSl7Uy5ldmVudC5zaW11bGF0ZShyLGUudGFyZ2V0LFMuZXZlbnQuZml4KGUpKX07Uy5ldmVudC5zcGVjaWFsW3JdPXtzZXR1cDpmdW5jdGlvbigpe3ZhciBlPXRoaXMub3duZXJEb2N1bWVudHx8dGhpcy5kb2N1bWVudHx8dGhpcyx0PVkuYWNjZXNzKGUscik7dHx8ZS5hZGRFdmVudExpc3RlbmVyKG4saSwhMCksWS5hY2Nlc3MoZSxyLCh0fHwwKSsxKX0sdGVhcmRvd246ZnVuY3Rpb24oKXt2YXIgZT10aGlzLm93bmVyRG9jdW1lbnR8fHRoaXMuZG9jdW1lbnR8fHRoaXMsdD1ZLmFjY2VzcyhlLHIpLTE7dD9ZLmFjY2VzcyhlLHIsdCk6KGUucmVtb3ZlRXZlbnRMaXN0ZW5lcihuLGksITApLFkucmVtb3ZlKGUscikpfX19KTt2YXIgVHQ9Qy5sb2NhdGlvbixDdD17Z3VpZDpEYXRlLm5vdygpfSxFdD0vXD8vO1MucGFyc2VYTUw9ZnVuY3Rpb24oZSl7dmFyIHQ7aWYoIWV8fCJzdHJpbmciIT10eXBlb2YgZSlyZXR1cm4gbnVsbDt0cnl7dD0obmV3IEMuRE9NUGFyc2VyKS5wYXJzZUZyb21TdHJpbmcoZSwidGV4dC94bWwiKX1jYXRjaChlKXt0PXZvaWQgMH1yZXR1cm4gdCYmIXQuZ2V0RWxlbWVudHNCeVRhZ05hbWUoInBhcnNlcmVycm9yIikubGVuZ3RofHxTLmVycm9yKCJJbnZhbGlkIFhNTDogIitlKSx0fTt2YXIgU3Q9L1xbXF0kLyxrdD0vXHI/XG4vZyxBdD0vXig/OnN1Ym1pdHxidXR0b258aW1hZ2V8cmVzZXR8ZmlsZSkkL2ksTnQ9L14oPzppbnB1dHxzZWxlY3R8dGV4dGFyZWF8a2V5Z2VuKS9pO2Z1bmN0aW9uIER0KG4sZSxyLGkpe3ZhciB0O2lmKEFycmF5LmlzQXJyYXkoZSkpUy5lYWNoKGUsZnVuY3Rpb24oZSx0KXtyfHxTdC50ZXN0KG4pP2kobix0KTpEdChuKyJbIisoIm9iamVjdCI9PXR5cGVvZiB0JiZudWxsIT10P2U6IiIpKyJdIix0LHIsaSl9KTtlbHNlIGlmKHJ8fCJvYmplY3QiIT09dyhlKSlpKG4sZSk7ZWxzZSBmb3IodCBpbiBlKUR0KG4rIlsiK3QrIl0iLGVbdF0scixpKX1TLnBhcmFtPWZ1bmN0aW9uKGUsdCl7dmFyIG4scj1bXSxpPWZ1bmN0aW9uKGUsdCl7dmFyIG49bSh0KT90KCk6dDtyW3IubGVuZ3RoXT1lbmNvZGVVUklDb21wb25lbnQoZSkrIj0iK2VuY29kZVVSSUNvbXBvbmVudChudWxsPT1uPyIiOm4pfTtpZihudWxsPT1lKXJldHVybiIiO2lmKEFycmF5LmlzQXJyYXkoZSl8fGUuanF1ZXJ5JiYhUy5pc1BsYWluT2JqZWN0KGUpKVMuZWFjaChlLGZ1bmN0aW9uKCl7aSh0aGlzLm5hbWUsdGhpcy52YWx1ZSl9KTtlbHNlIGZvcihuIGluIGUpRHQobixlW25dLHQsaSk7cmV0dXJuIHIuam9pbigiJiIpfSxTLmZuLmV4dGVuZCh7c2VyaWFsaXplOmZ1bmN0aW9uKCl7cmV0dXJuIFMucGFyYW0odGhpcy5zZXJpYWxpemVBcnJheSgpKX0sc2VyaWFsaXplQXJyYXk6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5tYXAoZnVuY3Rpb24oKXt2YXIgZT1TLnByb3AodGhpcywiZWxlbWVudHMiKTtyZXR1cm4gZT9TLm1ha2VBcnJheShlKTp0aGlzfSkuZmlsdGVyKGZ1bmN0aW9uKCl7dmFyIGU9dGhpcy50eXBlO3JldHVybiB0aGlzLm5hbWUmJiFTKHRoaXMpLmlzKCI6ZGlzYWJsZWQiKSYmTnQudGVzdCh0aGlzLm5vZGVOYW1lKSYmIUF0LnRlc3QoZSkmJih0aGlzLmNoZWNrZWR8fCFwZS50ZXN0KGUpKX0pLm1hcChmdW5jdGlvbihlLHQpe3ZhciBuPVModGhpcykudmFsKCk7cmV0dXJuIG51bGw9PW4/bnVsbDpBcnJheS5pc0FycmF5KG4pP1MubWFwKG4sZnVuY3Rpb24oZSl7cmV0dXJue25hbWU6dC5uYW1lLHZhbHVlOmUucmVwbGFjZShrdCwiXHJcbiIpfX0pOntuYW1lOnQubmFtZSx2YWx1ZTpuLnJlcGxhY2Uoa3QsIlxyXG4iKX19KS5nZXQoKX19KTt2YXIganQ9LyUyMC9nLHF0PS8jLiokLyxMdD0vKFs/Jl0pXz1bXiZdKi8sSHQ9L14oLio/KTpbIFx0XSooW15cclxuXSopJC9nbSxPdD0vXig/OkdFVHxIRUFEKSQvLFB0PS9eXC9cLy8sUnQ9e30sTXQ9e30sSXQ9IiovIi5jb25jYXQoIioiKSxXdD1FLmNyZWF0ZUVsZW1lbnQoImEiKTtmdW5jdGlvbiBGdChvKXtyZXR1cm4gZnVuY3Rpb24oZSx0KXsic3RyaW5nIiE9dHlwZW9mIGUmJih0PWUsZT0iKiIpO3ZhciBuLHI9MCxpPWUudG9Mb3dlckNhc2UoKS5tYXRjaChQKXx8W107aWYobSh0KSl3aGlsZShuPWlbcisrXSkiKyI9PT1uWzBdPyhuPW4uc2xpY2UoMSl8fCIqIiwob1tuXT1vW25dfHxbXSkudW5zaGlmdCh0KSk6KG9bbl09b1tuXXx8W10pLnB1c2godCl9fWZ1bmN0aW9uIEJ0KHQsaSxvLGEpe3ZhciBzPXt9LHU9dD09PU10O2Z1bmN0aW9uIGwoZSl7dmFyIHI7cmV0dXJuIHNbZV09ITAsUy5lYWNoKHRbZV18fFtdLGZ1bmN0aW9uKGUsdCl7dmFyIG49dChpLG8sYSk7cmV0dXJuInN0cmluZyIhPXR5cGVvZiBufHx1fHxzW25dP3U/IShyPW4pOnZvaWQgMDooaS5kYXRhVHlwZXMudW5zaGlmdChuKSxsKG4pLCExKX0pLHJ9cmV0dXJuIGwoaS5kYXRhVHlwZXNbMF0pfHwhc1siKiJdJiZsKCIqIil9ZnVuY3Rpb24gJHQoZSx0KXt2YXIgbixyLGk9Uy5hamF4U2V0dGluZ3MuZmxhdE9wdGlvbnN8fHt9O2ZvcihuIGluIHQpdm9pZCAwIT09dFtuXSYmKChpW25dP2U6cnx8KHI9e30pKVtuXT10W25dKTtyZXR1cm4gciYmUy5leHRlbmQoITAsZSxyKSxlfVd0LmhyZWY9VHQuaHJlZixTLmV4dGVuZCh7YWN0aXZlOjAsbGFzdE1vZGlmaWVkOnt9LGV0YWc6e30sYWpheFNldHRpbmdzOnt1cmw6VHQuaHJlZix0eXBlOiJHRVQiLGlzTG9jYWw6L14oPzphYm91dHxhcHB8YXBwLXN0b3JhZ2V8ListZXh0ZW5zaW9ufGZpbGV8cmVzfHdpZGdldCk6JC8udGVzdChUdC5wcm90b2NvbCksZ2xvYmFsOiEwLHByb2Nlc3NEYXRhOiEwLGFzeW5jOiEwLGNvbnRlbnRUeXBlOiJhcHBsaWNhdGlvbi94LXd3dy1mb3JtLXVybGVuY29kZWQ7IGNoYXJzZXQ9VVRGLTgiLGFjY2VwdHM6eyIqIjpJdCx0ZXh0OiJ0ZXh0L3BsYWluIixodG1sOiJ0ZXh0L2h0bWwiLHhtbDoiYXBwbGljYXRpb24veG1sLCB0ZXh0L3htbCIsanNvbjoiYXBwbGljYXRpb24vanNvbiwgdGV4dC9qYXZhc2NyaXB0In0sY29udGVudHM6e3htbDovXGJ4bWxcYi8saHRtbDovXGJodG1sLyxqc29uOi9cYmpzb25cYi99LHJlc3BvbnNlRmllbGRzOnt4bWw6InJlc3BvbnNlWE1MIix0ZXh0OiJyZXNwb25zZVRleHQiLGpzb246InJlc3BvbnNlSlNPTiJ9LGNvbnZlcnRlcnM6eyIqIHRleHQiOlN0cmluZywidGV4dCBodG1sIjohMCwidGV4dCBqc29uIjpKU09OLnBhcnNlLCJ0ZXh0IHhtbCI6Uy5wYXJzZVhNTH0sZmxhdE9wdGlvbnM6e3VybDohMCxjb250ZXh0OiEwfX0sYWpheFNldHVwOmZ1bmN0aW9uKGUsdCl7cmV0dXJuIHQ/JHQoJHQoZSxTLmFqYXhTZXR0aW5ncyksdCk6JHQoUy5hamF4U2V0dGluZ3MsZSl9LGFqYXhQcmVmaWx0ZXI6RnQoUnQpLGFqYXhUcmFuc3BvcnQ6RnQoTXQpLGFqYXg6ZnVuY3Rpb24oZSx0KXsib2JqZWN0Ij09dHlwZW9mIGUmJih0PWUsZT12b2lkIDApLHQ9dHx8e307dmFyIGMsZixwLG4sZCxyLGgsZyxpLG8sdj1TLmFqYXhTZXR1cCh7fSx0KSx5PXYuY29udGV4dHx8dixtPXYuY29udGV4dCYmKHkubm9kZVR5cGV8fHkuanF1ZXJ5KT9TKHkpOlMuZXZlbnQseD1TLkRlZmVycmVkKCksYj1TLkNhbGxiYWNrcygib25jZSBtZW1vcnkiKSx3PXYuc3RhdHVzQ29kZXx8e30sYT17fSxzPXt9LHU9ImNhbmNlbGVkIixUPXtyZWFkeVN0YXRlOjAsZ2V0UmVzcG9uc2VIZWFkZXI6ZnVuY3Rpb24oZSl7dmFyIHQ7aWYoaCl7aWYoIW4pe249e307d2hpbGUodD1IdC5leGVjKHApKW5bdFsxXS50b0xvd2VyQ2FzZSgpKyIgIl09KG5bdFsxXS50b0xvd2VyQ2FzZSgpKyIgIl18fFtdKS5jb25jYXQodFsyXSl9dD1uW2UudG9Mb3dlckNhc2UoKSsiICJdfXJldHVybiBudWxsPT10P251bGw6dC5qb2luKCIsICIpfSxnZXRBbGxSZXNwb25zZUhlYWRlcnM6ZnVuY3Rpb24oKXtyZXR1cm4gaD9wOm51bGx9LHNldFJlcXVlc3RIZWFkZXI6ZnVuY3Rpb24oZSx0KXtyZXR1cm4gbnVsbD09aCYmKGU9c1tlLnRvTG93ZXJDYXNlKCldPXNbZS50b0xvd2VyQ2FzZSgpXXx8ZSxhW2VdPXQpLHRoaXN9LG92ZXJyaWRlTWltZVR5cGU6ZnVuY3Rpb24oZSl7cmV0dXJuIG51bGw9PWgmJih2Lm1pbWVUeXBlPWUpLHRoaXN9LHN0YXR1c0NvZGU6ZnVuY3Rpb24oZSl7dmFyIHQ7aWYoZSlpZihoKVQuYWx3YXlzKGVbVC5zdGF0dXNdKTtlbHNlIGZvcih0IGluIGUpd1t0XT1bd1t0XSxlW3RdXTtyZXR1cm4gdGhpc30sYWJvcnQ6ZnVuY3Rpb24oZSl7dmFyIHQ9ZXx8dTtyZXR1cm4gYyYmYy5hYm9ydCh0KSxsKDAsdCksdGhpc319O2lmKHgucHJvbWlzZShUKSx2LnVybD0oKGV8fHYudXJsfHxUdC5ocmVmKSsiIikucmVwbGFjZShQdCxUdC5wcm90b2NvbCsiLy8iKSx2LnR5cGU9dC5tZXRob2R8fHQudHlwZXx8di5tZXRob2R8fHYudHlwZSx2LmRhdGFUeXBlcz0odi5kYXRhVHlwZXx8IioiKS50b0xvd2VyQ2FzZSgpLm1hdGNoKFApfHxbIiJdLG51bGw9PXYuY3Jvc3NEb21haW4pe3I9RS5jcmVhdGVFbGVtZW50KCJhIik7dHJ5e3IuaHJlZj12LnVybCxyLmhyZWY9ci5ocmVmLHYuY3Jvc3NEb21haW49V3QucHJvdG9jb2wrIi8vIitXdC5ob3N0IT1yLnByb3RvY29sKyIvLyIrci5ob3N0fWNhdGNoKGUpe3YuY3Jvc3NEb21haW49ITB9fWlmKHYuZGF0YSYmdi5wcm9jZXNzRGF0YSYmInN0cmluZyIhPXR5cGVvZiB2LmRhdGEmJih2LmRhdGE9Uy5wYXJhbSh2LmRhdGEsdi50cmFkaXRpb25hbCkpLEJ0KFJ0LHYsdCxUKSxoKXJldHVybiBUO2ZvcihpIGluKGc9Uy5ldmVudCYmdi5nbG9iYWwpJiYwPT1TLmFjdGl2ZSsrJiZTLmV2ZW50LnRyaWdnZXIoImFqYXhTdGFydCIpLHYudHlwZT12LnR5cGUudG9VcHBlckNhc2UoKSx2Lmhhc0NvbnRlbnQ9IU90LnRlc3Qodi50eXBlKSxmPXYudXJsLnJlcGxhY2UocXQsIiIpLHYuaGFzQ29udGVudD92LmRhdGEmJnYucHJvY2Vzc0RhdGEmJjA9PT0odi5jb250ZW50VHlwZXx8IiIpLmluZGV4T2YoImFwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCIpJiYodi5kYXRhPXYuZGF0YS5yZXBsYWNlKGp0LCIrIikpOihvPXYudXJsLnNsaWNlKGYubGVuZ3RoKSx2LmRhdGEmJih2LnByb2Nlc3NEYXRhfHwic3RyaW5nIj09dHlwZW9mIHYuZGF0YSkmJihmKz0oRXQudGVzdChmKT8iJiI6Ij8iKSt2LmRhdGEsZGVsZXRlIHYuZGF0YSksITE9PT12LmNhY2hlJiYoZj1mLnJlcGxhY2UoTHQsIiQxIiksbz0oRXQudGVzdChmKT8iJiI6Ij8iKSsiXz0iK0N0Lmd1aWQrKytvKSx2LnVybD1mK28pLHYuaWZNb2RpZmllZCYmKFMubGFzdE1vZGlmaWVkW2ZdJiZULnNldFJlcXVlc3RIZWFkZXIoIklmLU1vZGlmaWVkLVNpbmNlIixTLmxhc3RNb2RpZmllZFtmXSksUy5ldGFnW2ZdJiZULnNldFJlcXVlc3RIZWFkZXIoIklmLU5vbmUtTWF0Y2giLFMuZXRhZ1tmXSkpLCh2LmRhdGEmJnYuaGFzQ29udGVudCYmITEhPT12LmNvbnRlbnRUeXBlfHx0LmNvbnRlbnRUeXBlKSYmVC5zZXRSZXF1ZXN0SGVhZGVyKCJDb250ZW50LVR5cGUiLHYuY29udGVudFR5cGUpLFQuc2V0UmVxdWVzdEhlYWRlcigiQWNjZXB0Iix2LmRhdGFUeXBlc1swXSYmdi5hY2NlcHRzW3YuZGF0YVR5cGVzWzBdXT92LmFjY2VwdHNbdi5kYXRhVHlwZXNbMF1dKygiKiIhPT12LmRhdGFUeXBlc1swXT8iLCAiK0l0KyI7IHE9MC4wMSI6IiIpOnYuYWNjZXB0c1siKiJdKSx2LmhlYWRlcnMpVC5zZXRSZXF1ZXN0SGVhZGVyKGksdi5oZWFkZXJzW2ldKTtpZih2LmJlZm9yZVNlbmQmJighMT09PXYuYmVmb3JlU2VuZC5jYWxsKHksVCx2KXx8aCkpcmV0dXJuIFQuYWJvcnQoKTtpZih1PSJhYm9ydCIsYi5hZGQodi5jb21wbGV0ZSksVC5kb25lKHYuc3VjY2VzcyksVC5mYWlsKHYuZXJyb3IpLGM9QnQoTXQsdix0LFQpKXtpZihULnJlYWR5U3RhdGU9MSxnJiZtLnRyaWdnZXIoImFqYXhTZW5kIixbVCx2XSksaClyZXR1cm4gVDt2LmFzeW5jJiYwPHYudGltZW91dCYmKGQ9Qy5zZXRUaW1lb3V0KGZ1bmN0aW9uKCl7VC5hYm9ydCgidGltZW91dCIpfSx2LnRpbWVvdXQpKTt0cnl7aD0hMSxjLnNlbmQoYSxsKX1jYXRjaChlKXtpZihoKXRocm93IGU7bCgtMSxlKX19ZWxzZSBsKC0xLCJObyBUcmFuc3BvcnQiKTtmdW5jdGlvbiBsKGUsdCxuLHIpe3ZhciBpLG8sYSxzLHUsbD10O2h8fChoPSEwLGQmJkMuY2xlYXJUaW1lb3V0KGQpLGM9dm9pZCAwLHA9cnx8IiIsVC5yZWFkeVN0YXRlPTA8ZT80OjAsaT0yMDA8PWUmJmU8MzAwfHwzMDQ9PT1lLG4mJihzPWZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG8sYSxzPWUuY29udGVudHMsdT1lLmRhdGFUeXBlczt3aGlsZSgiKiI9PT11WzBdKXUuc2hpZnQoKSx2b2lkIDA9PT1yJiYocj1lLm1pbWVUeXBlfHx0LmdldFJlc3BvbnNlSGVhZGVyKCJDb250ZW50LVR5cGUiKSk7aWYocilmb3IoaSBpbiBzKWlmKHNbaV0mJnNbaV0udGVzdChyKSl7dS51bnNoaWZ0KGkpO2JyZWFrfWlmKHVbMF1pbiBuKW89dVswXTtlbHNle2ZvcihpIGluIG4pe2lmKCF1WzBdfHxlLmNvbnZlcnRlcnNbaSsiICIrdVswXV0pe289aTticmVha31hfHwoYT1pKX1vPW98fGF9aWYobylyZXR1cm4gbyE9PXVbMF0mJnUudW5zaGlmdChvKSxuW29dfSh2LFQsbikpLCFpJiYtMTxTLmluQXJyYXkoInNjcmlwdCIsdi5kYXRhVHlwZXMpJiYodi5jb252ZXJ0ZXJzWyJ0ZXh0IHNjcmlwdCJdPWZ1bmN0aW9uKCl7fSkscz1mdW5jdGlvbihlLHQsbixyKXt2YXIgaSxvLGEscyx1LGw9e30sYz1lLmRhdGFUeXBlcy5zbGljZSgpO2lmKGNbMV0pZm9yKGEgaW4gZS5jb252ZXJ0ZXJzKWxbYS50b0xvd2VyQ2FzZSgpXT1lLmNvbnZlcnRlcnNbYV07bz1jLnNoaWZ0KCk7d2hpbGUobylpZihlLnJlc3BvbnNlRmllbGRzW29dJiYobltlLnJlc3BvbnNlRmllbGRzW29dXT10KSwhdSYmciYmZS5kYXRhRmlsdGVyJiYodD1lLmRhdGFGaWx0ZXIodCxlLmRhdGFUeXBlKSksdT1vLG89Yy5zaGlmdCgpKWlmKCIqIj09PW8pbz11O2Vsc2UgaWYoIioiIT09dSYmdSE9PW8pe2lmKCEoYT1sW3UrIiAiK29dfHxsWyIqICIrb10pKWZvcihpIGluIGwpaWYoKHM9aS5zcGxpdCgiICIpKVsxXT09PW8mJihhPWxbdSsiICIrc1swXV18fGxbIiogIitzWzBdXSkpeyEwPT09YT9hPWxbaV06ITAhPT1sW2ldJiYobz1zWzBdLGMudW5zaGlmdChzWzFdKSk7YnJlYWt9aWYoITAhPT1hKWlmKGEmJmVbInRocm93cyJdKXQ9YSh0KTtlbHNlIHRyeXt0PWEodCl9Y2F0Y2goZSl7cmV0dXJue3N0YXRlOiJwYXJzZXJlcnJvciIsZXJyb3I6YT9lOiJObyBjb252ZXJzaW9uIGZyb20gIit1KyIgdG8gIitvfX19cmV0dXJue3N0YXRlOiJzdWNjZXNzIixkYXRhOnR9fSh2LHMsVCxpKSxpPyh2LmlmTW9kaWZpZWQmJigodT1ULmdldFJlc3BvbnNlSGVhZGVyKCJMYXN0LU1vZGlmaWVkIikpJiYoUy5sYXN0TW9kaWZpZWRbZl09dSksKHU9VC5nZXRSZXNwb25zZUhlYWRlcigiZXRhZyIpKSYmKFMuZXRhZ1tmXT11KSksMjA0PT09ZXx8IkhFQUQiPT09di50eXBlP2w9Im5vY29udGVudCI6MzA0PT09ZT9sPSJub3Rtb2RpZmllZCI6KGw9cy5zdGF0ZSxvPXMuZGF0YSxpPSEoYT1zLmVycm9yKSkpOihhPWwsIWUmJmx8fChsPSJlcnJvciIsZTwwJiYoZT0wKSkpLFQuc3RhdHVzPWUsVC5zdGF0dXNUZXh0PSh0fHxsKSsiIixpP3gucmVzb2x2ZVdpdGgoeSxbbyxsLFRdKTp4LnJlamVjdFdpdGgoeSxbVCxsLGFdKSxULnN0YXR1c0NvZGUodyksdz12b2lkIDAsZyYmbS50cmlnZ2VyKGk/ImFqYXhTdWNjZXNzIjoiYWpheEVycm9yIixbVCx2LGk/bzphXSksYi5maXJlV2l0aCh5LFtULGxdKSxnJiYobS50cmlnZ2VyKCJhamF4Q29tcGxldGUiLFtULHZdKSwtLVMuYWN0aXZlfHxTLmV2ZW50LnRyaWdnZXIoImFqYXhTdG9wIikpKX1yZXR1cm4gVH0sZ2V0SlNPTjpmdW5jdGlvbihlLHQsbil7cmV0dXJuIFMuZ2V0KGUsdCxuLCJqc29uIil9LGdldFNjcmlwdDpmdW5jdGlvbihlLHQpe3JldHVybiBTLmdldChlLHZvaWQgMCx0LCJzY3JpcHQiKX19KSxTLmVhY2goWyJnZXQiLCJwb3N0Il0sZnVuY3Rpb24oZSxpKXtTW2ldPWZ1bmN0aW9uKGUsdCxuLHIpe3JldHVybiBtKHQpJiYocj1yfHxuLG49dCx0PXZvaWQgMCksUy5hamF4KFMuZXh0ZW5kKHt1cmw6ZSx0eXBlOmksZGF0YVR5cGU6cixkYXRhOnQsc3VjY2VzczpufSxTLmlzUGxhaW5PYmplY3QoZSkmJmUpKX19KSxTLmFqYXhQcmVmaWx0ZXIoZnVuY3Rpb24oZSl7dmFyIHQ7Zm9yKHQgaW4gZS5oZWFkZXJzKSJjb250ZW50LXR5cGUiPT09dC50b0xvd2VyQ2FzZSgpJiYoZS5jb250ZW50VHlwZT1lLmhlYWRlcnNbdF18fCIiKX0pLFMuX2V2YWxVcmw9ZnVuY3Rpb24oZSx0LG4pe3JldHVybiBTLmFqYXgoe3VybDplLHR5cGU6IkdFVCIsZGF0YVR5cGU6InNjcmlwdCIsY2FjaGU6ITAsYXN5bmM6ITEsZ2xvYmFsOiExLGNvbnZlcnRlcnM6eyJ0ZXh0IHNjcmlwdCI6ZnVuY3Rpb24oKXt9fSxkYXRhRmlsdGVyOmZ1bmN0aW9uKGUpe1MuZ2xvYmFsRXZhbChlLHQsbil9fSl9LFMuZm4uZXh0ZW5kKHt3cmFwQWxsOmZ1bmN0aW9uKGUpe3ZhciB0O3JldHVybiB0aGlzWzBdJiYobShlKSYmKGU9ZS5jYWxsKHRoaXNbMF0pKSx0PVMoZSx0aGlzWzBdLm93bmVyRG9jdW1lbnQpLmVxKDApLmNsb25lKCEwKSx0aGlzWzBdLnBhcmVudE5vZGUmJnQuaW5zZXJ0QmVmb3JlKHRoaXNbMF0pLHQubWFwKGZ1bmN0aW9uKCl7dmFyIGU9dGhpczt3aGlsZShlLmZpcnN0RWxlbWVudENoaWxkKWU9ZS5maXJzdEVsZW1lbnRDaGlsZDtyZXR1cm4gZX0pLmFwcGVuZCh0aGlzKSksdGhpc30sd3JhcElubmVyOmZ1bmN0aW9uKG4pe3JldHVybiBtKG4pP3RoaXMuZWFjaChmdW5jdGlvbihlKXtTKHRoaXMpLndyYXBJbm5lcihuLmNhbGwodGhpcyxlKSl9KTp0aGlzLmVhY2goZnVuY3Rpb24oKXt2YXIgZT1TKHRoaXMpLHQ9ZS5jb250ZW50cygpO3QubGVuZ3RoP3Qud3JhcEFsbChuKTplLmFwcGVuZChuKX0pfSx3cmFwOmZ1bmN0aW9uKHQpe3ZhciBuPW0odCk7cmV0dXJuIHRoaXMuZWFjaChmdW5jdGlvbihlKXtTKHRoaXMpLndyYXBBbGwobj90LmNhbGwodGhpcyxlKTp0KX0pfSx1bndyYXA6ZnVuY3Rpb24oZSl7cmV0dXJuIHRoaXMucGFyZW50KGUpLm5vdCgiYm9keSIpLmVhY2goZnVuY3Rpb24oKXtTKHRoaXMpLnJlcGxhY2VXaXRoKHRoaXMuY2hpbGROb2Rlcyl9KSx0aGlzfX0pLFMuZXhwci5wc2V1ZG9zLmhpZGRlbj1mdW5jdGlvbihlKXtyZXR1cm4hUy5leHByLnBzZXVkb3MudmlzaWJsZShlKX0sUy5leHByLnBzZXVkb3MudmlzaWJsZT1mdW5jdGlvbihlKXtyZXR1cm4hIShlLm9mZnNldFdpZHRofHxlLm9mZnNldEhlaWdodHx8ZS5nZXRDbGllbnRSZWN0cygpLmxlbmd0aCl9LFMuYWpheFNldHRpbmdzLnhocj1mdW5jdGlvbigpe3RyeXtyZXR1cm4gbmV3IEMuWE1MSHR0cFJlcXVlc3R9Y2F0Y2goZSl7fX07dmFyIF90PXswOjIwMCwxMjIzOjIwNH0senQ9Uy5hamF4U2V0dGluZ3MueGhyKCk7eS5jb3JzPSEhenQmJiJ3aXRoQ3JlZGVudGlhbHMiaW4genQseS5hamF4PXp0PSEhenQsUy5hamF4VHJhbnNwb3J0KGZ1bmN0aW9uKGkpe3ZhciBvLGE7aWYoeS5jb3JzfHx6dCYmIWkuY3Jvc3NEb21haW4pcmV0dXJue3NlbmQ6ZnVuY3Rpb24oZSx0KXt2YXIgbixyPWkueGhyKCk7aWYoci5vcGVuKGkudHlwZSxpLnVybCxpLmFzeW5jLGkudXNlcm5hbWUsaS5wYXNzd29yZCksaS54aHJGaWVsZHMpZm9yKG4gaW4gaS54aHJGaWVsZHMpcltuXT1pLnhockZpZWxkc1tuXTtmb3IobiBpbiBpLm1pbWVUeXBlJiZyLm92ZXJyaWRlTWltZVR5cGUmJnIub3ZlcnJpZGVNaW1lVHlwZShpLm1pbWVUeXBlKSxpLmNyb3NzRG9tYWlufHxlWyJYLVJlcXVlc3RlZC1XaXRoIl18fChlWyJYLVJlcXVlc3RlZC1XaXRoIl09IlhNTEh0dHBSZXF1ZXN0IiksZSlyLnNldFJlcXVlc3RIZWFkZXIobixlW25dKTtvPWZ1bmN0aW9uKGUpe3JldHVybiBmdW5jdGlvbigpe28mJihvPWE9ci5vbmxvYWQ9ci5vbmVycm9yPXIub25hYm9ydD1yLm9udGltZW91dD1yLm9ucmVhZHlzdGF0ZWNoYW5nZT1udWxsLCJhYm9ydCI9PT1lP3IuYWJvcnQoKToiZXJyb3IiPT09ZT8ibnVtYmVyIiE9dHlwZW9mIHIuc3RhdHVzP3QoMCwiZXJyb3IiKTp0KHIuc3RhdHVzLHIuc3RhdHVzVGV4dCk6dChfdFtyLnN0YXR1c118fHIuc3RhdHVzLHIuc3RhdHVzVGV4dCwidGV4dCIhPT0oci5yZXNwb25zZVR5cGV8fCJ0ZXh0Iil8fCJzdHJpbmciIT10eXBlb2Ygci5yZXNwb25zZVRleHQ/e2JpbmFyeTpyLnJlc3BvbnNlfTp7dGV4dDpyLnJlc3BvbnNlVGV4dH0sci5nZXRBbGxSZXNwb25zZUhlYWRlcnMoKSkpfX0sci5vbmxvYWQ9bygpLGE9ci5vbmVycm9yPXIub250aW1lb3V0PW8oImVycm9yIiksdm9pZCAwIT09ci5vbmFib3J0P3Iub25hYm9ydD1hOnIub25yZWFkeXN0YXRlY2hhbmdlPWZ1bmN0aW9uKCl7ND09PXIucmVhZHlTdGF0ZSYmQy5zZXRUaW1lb3V0KGZ1bmN0aW9uKCl7byYmYSgpfSl9LG89bygiYWJvcnQiKTt0cnl7ci5zZW5kKGkuaGFzQ29udGVudCYmaS5kYXRhfHxudWxsKX1jYXRjaChlKXtpZihvKXRocm93IGV9fSxhYm9ydDpmdW5jdGlvbigpe28mJm8oKX19fSksUy5hamF4UHJlZmlsdGVyKGZ1bmN0aW9uKGUpe2UuY3Jvc3NEb21haW4mJihlLmNvbnRlbnRzLnNjcmlwdD0hMSl9KSxTLmFqYXhTZXR1cCh7YWNjZXB0czp7c2NyaXB0OiJ0ZXh0L2phdmFzY3JpcHQsIGFwcGxpY2F0aW9uL2phdmFzY3JpcHQsIGFwcGxpY2F0aW9uL2VjbWFzY3JpcHQsIGFwcGxpY2F0aW9uL3gtZWNtYXNjcmlwdCJ9LGNvbnRlbnRzOntzY3JpcHQ6L1xiKD86amF2YXxlY21hKXNjcmlwdFxiL30sY29udmVydGVyczp7InRleHQgc2NyaXB0IjpmdW5jdGlvbihlKXtyZXR1cm4gUy5nbG9iYWxFdmFsKGUpLGV9fX0pLFMuYWpheFByZWZpbHRlcigic2NyaXB0IixmdW5jdGlvbihlKXt2b2lkIDA9PT1lLmNhY2hlJiYoZS5jYWNoZT0hMSksZS5jcm9zc0RvbWFpbiYmKGUudHlwZT0iR0VUIil9KSxTLmFqYXhUcmFuc3BvcnQoInNjcmlwdCIsZnVuY3Rpb24obil7dmFyIHIsaTtpZihuLmNyb3NzRG9tYWlufHxuLnNjcmlwdEF0dHJzKXJldHVybntzZW5kOmZ1bmN0aW9uKGUsdCl7cj1TKCI8c2NyaXB0PiIpLmF0dHIobi5zY3JpcHRBdHRyc3x8e30pLnByb3Aoe2NoYXJzZXQ6bi5zY3JpcHRDaGFyc2V0LHNyYzpuLnVybH0pLm9uKCJsb2FkIGVycm9yIixpPWZ1bmN0aW9uKGUpe3IucmVtb3ZlKCksaT1udWxsLGUmJnQoImVycm9yIj09PWUudHlwZT80MDQ6MjAwLGUudHlwZSl9KSxFLmhlYWQuYXBwZW5kQ2hpbGQoclswXSl9LGFib3J0OmZ1bmN0aW9uKCl7aSYmaSgpfX19KTt2YXIgVXQsWHQ9W10sVnQ9Lyg9KVw/KD89JnwkKXxcP1w/LztTLmFqYXhTZXR1cCh7anNvbnA6ImNhbGxiYWNrIixqc29ucENhbGxiYWNrOmZ1bmN0aW9uKCl7dmFyIGU9WHQucG9wKCl8fFMuZXhwYW5kbysiXyIrQ3QuZ3VpZCsrO3JldHVybiB0aGlzW2VdPSEwLGV9fSksUy5hamF4UHJlZmlsdGVyKCJqc29uIGpzb25wIixmdW5jdGlvbihlLHQsbil7dmFyIHIsaSxvLGE9ITEhPT1lLmpzb25wJiYoVnQudGVzdChlLnVybCk/InVybCI6InN0cmluZyI9PXR5cGVvZiBlLmRhdGEmJjA9PT0oZS5jb250ZW50VHlwZXx8IiIpLmluZGV4T2YoImFwcGxpY2F0aW9uL3gtd3d3LWZvcm0tdXJsZW5jb2RlZCIpJiZWdC50ZXN0KGUuZGF0YSkmJiJkYXRhIik7aWYoYXx8Impzb25wIj09PWUuZGF0YVR5cGVzWzBdKXJldHVybiByPWUuanNvbnBDYWxsYmFjaz1tKGUuanNvbnBDYWxsYmFjayk/ZS5qc29ucENhbGxiYWNrKCk6ZS5qc29ucENhbGxiYWNrLGE/ZVthXT1lW2FdLnJlcGxhY2UoVnQsIiQxIityKTohMSE9PWUuanNvbnAmJihlLnVybCs9KEV0LnRlc3QoZS51cmwpPyImIjoiPyIpK2UuanNvbnArIj0iK3IpLGUuY29udmVydGVyc1sic2NyaXB0IGpzb24iXT1mdW5jdGlvbigpe3JldHVybiBvfHxTLmVycm9yKHIrIiB3YXMgbm90IGNhbGxlZCIpLG9bMF19LGUuZGF0YVR5cGVzWzBdPSJqc29uIixpPUNbcl0sQ1tyXT1mdW5jdGlvbigpe289YXJndW1lbnRzfSxuLmFsd2F5cyhmdW5jdGlvbigpe3ZvaWQgMD09PWk/UyhDKS5yZW1vdmVQcm9wKHIpOkNbcl09aSxlW3JdJiYoZS5qc29ucENhbGxiYWNrPXQuanNvbnBDYWxsYmFjayxYdC5wdXNoKHIpKSxvJiZtKGkpJiZpKG9bMF0pLG89aT12b2lkIDB9KSwic2NyaXB0In0pLHkuY3JlYXRlSFRNTERvY3VtZW50PSgoVXQ9RS5pbXBsZW1lbnRhdGlvbi5jcmVhdGVIVE1MRG9jdW1lbnQoIiIpLmJvZHkpLmlubmVySFRNTD0iPGZvcm0+PC9mb3JtPjxmb3JtPjwvZm9ybT4iLDI9PT1VdC5jaGlsZE5vZGVzLmxlbmd0aCksUy5wYXJzZUhUTUw9ZnVuY3Rpb24oZSx0LG4pe3JldHVybiJzdHJpbmciIT10eXBlb2YgZT9bXTooImJvb2xlYW4iPT10eXBlb2YgdCYmKG49dCx0PSExKSx0fHwoeS5jcmVhdGVIVE1MRG9jdW1lbnQ/KChyPSh0PUUuaW1wbGVtZW50YXRpb24uY3JlYXRlSFRNTERvY3VtZW50KCIiKSkuY3JlYXRlRWxlbWVudCgiYmFzZSIpKS5ocmVmPUUubG9jYXRpb24uaHJlZix0LmhlYWQuYXBwZW5kQ2hpbGQocikpOnQ9RSksbz0hbiYmW10sKGk9Ti5leGVjKGUpKT9bdC5jcmVhdGVFbGVtZW50KGlbMV0pXTooaT14ZShbZV0sdCxvKSxvJiZvLmxlbmd0aCYmUyhvKS5yZW1vdmUoKSxTLm1lcmdlKFtdLGkuY2hpbGROb2RlcykpKTt2YXIgcixpLG99LFMuZm4ubG9hZD1mdW5jdGlvbihlLHQsbil7dmFyIHIsaSxvLGE9dGhpcyxzPWUuaW5kZXhPZigiICIpO3JldHVybi0xPHMmJihyPXZ0KGUuc2xpY2UocykpLGU9ZS5zbGljZSgwLHMpKSxtKHQpPyhuPXQsdD12b2lkIDApOnQmJiJvYmplY3QiPT10eXBlb2YgdCYmKGk9IlBPU1QiKSwwPGEubGVuZ3RoJiZTLmFqYXgoe3VybDplLHR5cGU6aXx8IkdFVCIsZGF0YVR5cGU6Imh0bWwiLGRhdGE6dH0pLmRvbmUoZnVuY3Rpb24oZSl7bz1hcmd1bWVudHMsYS5odG1sKHI/UygiPGRpdj4iKS5hcHBlbmQoUy5wYXJzZUhUTUwoZSkpLmZpbmQocik6ZSl9KS5hbHdheXMobiYmZnVuY3Rpb24oZSx0KXthLmVhY2goZnVuY3Rpb24oKXtuLmFwcGx5KHRoaXMsb3x8W2UucmVzcG9uc2VUZXh0LHQsZV0pfSl9KSx0aGlzfSxTLmV4cHIucHNldWRvcy5hbmltYXRlZD1mdW5jdGlvbih0KXtyZXR1cm4gUy5ncmVwKFMudGltZXJzLGZ1bmN0aW9uKGUpe3JldHVybiB0PT09ZS5lbGVtfSkubGVuZ3RofSxTLm9mZnNldD17c2V0T2Zmc2V0OmZ1bmN0aW9uKGUsdCxuKXt2YXIgcixpLG8sYSxzLHUsbD1TLmNzcyhlLCJwb3NpdGlvbiIpLGM9UyhlKSxmPXt9OyJzdGF0aWMiPT09bCYmKGUuc3R5bGUucG9zaXRpb249InJlbGF0aXZlIikscz1jLm9mZnNldCgpLG89Uy5jc3MoZSwidG9wIiksdT1TLmNzcyhlLCJsZWZ0IiksKCJhYnNvbHV0ZSI9PT1sfHwiZml4ZWQiPT09bCkmJi0xPChvK3UpLmluZGV4T2YoImF1dG8iKT8oYT0ocj1jLnBvc2l0aW9uKCkpLnRvcCxpPXIubGVmdCk6KGE9cGFyc2VGbG9hdChvKXx8MCxpPXBhcnNlRmxvYXQodSl8fDApLG0odCkmJih0PXQuY2FsbChlLG4sUy5leHRlbmQoe30scykpKSxudWxsIT10LnRvcCYmKGYudG9wPXQudG9wLXMudG9wK2EpLG51bGwhPXQubGVmdCYmKGYubGVmdD10LmxlZnQtcy5sZWZ0K2kpLCJ1c2luZyJpbiB0P3QudXNpbmcuY2FsbChlLGYpOigibnVtYmVyIj09dHlwZW9mIGYudG9wJiYoZi50b3ArPSJweCIpLCJudW1iZXIiPT10eXBlb2YgZi5sZWZ0JiYoZi5sZWZ0Kz0icHgiKSxjLmNzcyhmKSl9fSxTLmZuLmV4dGVuZCh7b2Zmc2V0OmZ1bmN0aW9uKHQpe2lmKGFyZ3VtZW50cy5sZW5ndGgpcmV0dXJuIHZvaWQgMD09PXQ/dGhpczp0aGlzLmVhY2goZnVuY3Rpb24oZSl7Uy5vZmZzZXQuc2V0T2Zmc2V0KHRoaXMsdCxlKX0pO3ZhciBlLG4scj10aGlzWzBdO3JldHVybiByP3IuZ2V0Q2xpZW50UmVjdHMoKS5sZW5ndGg/KGU9ci5nZXRCb3VuZGluZ0NsaWVudFJlY3QoKSxuPXIub3duZXJEb2N1bWVudC5kZWZhdWx0Vmlldyx7dG9wOmUudG9wK24ucGFnZVlPZmZzZXQsbGVmdDplLmxlZnQrbi5wYWdlWE9mZnNldH0pOnt0b3A6MCxsZWZ0OjB9OnZvaWQgMH0scG9zaXRpb246ZnVuY3Rpb24oKXtpZih0aGlzWzBdKXt2YXIgZSx0LG4scj10aGlzWzBdLGk9e3RvcDowLGxlZnQ6MH07aWYoImZpeGVkIj09PVMuY3NzKHIsInBvc2l0aW9uIikpdD1yLmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpO2Vsc2V7dD10aGlzLm9mZnNldCgpLG49ci5vd25lckRvY3VtZW50LGU9ci5vZmZzZXRQYXJlbnR8fG4uZG9jdW1lbnRFbGVtZW50O3doaWxlKGUmJihlPT09bi5ib2R5fHxlPT09bi5kb2N1bWVudEVsZW1lbnQpJiYic3RhdGljIj09PVMuY3NzKGUsInBvc2l0aW9uIikpZT1lLnBhcmVudE5vZGU7ZSYmZSE9PXImJjE9PT1lLm5vZGVUeXBlJiYoKGk9UyhlKS5vZmZzZXQoKSkudG9wKz1TLmNzcyhlLCJib3JkZXJUb3BXaWR0aCIsITApLGkubGVmdCs9Uy5jc3MoZSwiYm9yZGVyTGVmdFdpZHRoIiwhMCkpfXJldHVybnt0b3A6dC50b3AtaS50b3AtUy5jc3MociwibWFyZ2luVG9wIiwhMCksbGVmdDp0LmxlZnQtaS5sZWZ0LVMuY3NzKHIsIm1hcmdpbkxlZnQiLCEwKX19fSxvZmZzZXRQYXJlbnQ6ZnVuY3Rpb24oKXtyZXR1cm4gdGhpcy5tYXAoZnVuY3Rpb24oKXt2YXIgZT10aGlzLm9mZnNldFBhcmVudDt3aGlsZShlJiYic3RhdGljIj09PVMuY3NzKGUsInBvc2l0aW9uIikpZT1lLm9mZnNldFBhcmVudDtyZXR1cm4gZXx8cmV9KX19KSxTLmVhY2goe3Njcm9sbExlZnQ6InBhZ2VYT2Zmc2V0IixzY3JvbGxUb3A6InBhZ2VZT2Zmc2V0In0sZnVuY3Rpb24odCxpKXt2YXIgbz0icGFnZVlPZmZzZXQiPT09aTtTLmZuW3RdPWZ1bmN0aW9uKGUpe3JldHVybiAkKHRoaXMsZnVuY3Rpb24oZSx0LG4pe3ZhciByO2lmKHgoZSk/cj1lOjk9PT1lLm5vZGVUeXBlJiYocj1lLmRlZmF1bHRWaWV3KSx2b2lkIDA9PT1uKXJldHVybiByP3JbaV06ZVt0XTtyP3Iuc2Nyb2xsVG8obz9yLnBhZ2VYT2Zmc2V0Om4sbz9uOnIucGFnZVlPZmZzZXQpOmVbdF09bn0sdCxlLGFyZ3VtZW50cy5sZW5ndGgpfX0pLFMuZWFjaChbInRvcCIsImxlZnQiXSxmdW5jdGlvbihlLG4pe1MuY3NzSG9va3Nbbl09JGUoeS5waXhlbFBvc2l0aW9uLGZ1bmN0aW9uKGUsdCl7aWYodClyZXR1cm4gdD1CZShlLG4pLE1lLnRlc3QodCk/UyhlKS5wb3NpdGlvbigpW25dKyJweCI6dH0pfSksUy5lYWNoKHtIZWlnaHQ6ImhlaWdodCIsV2lkdGg6IndpZHRoIn0sZnVuY3Rpb24oYSxzKXtTLmVhY2goe3BhZGRpbmc6ImlubmVyIithLGNvbnRlbnQ6cywiIjoib3V0ZXIiK2F9LGZ1bmN0aW9uKHIsbyl7Uy5mbltvXT1mdW5jdGlvbihlLHQpe3ZhciBuPWFyZ3VtZW50cy5sZW5ndGgmJihyfHwiYm9vbGVhbiIhPXR5cGVvZiBlKSxpPXJ8fCghMD09PWV8fCEwPT09dD8ibWFyZ2luIjoiYm9yZGVyIik7cmV0dXJuICQodGhpcyxmdW5jdGlvbihlLHQsbil7dmFyIHI7cmV0dXJuIHgoZSk/MD09PW8uaW5kZXhPZigib3V0ZXIiKT9lWyJpbm5lciIrYV06ZS5kb2N1bWVudC5kb2N1bWVudEVsZW1lbnRbImNsaWVudCIrYV06OT09PWUubm9kZVR5cGU/KHI9ZS5kb2N1bWVudEVsZW1lbnQsTWF0aC5tYXgoZS5ib2R5WyJzY3JvbGwiK2FdLHJbInNjcm9sbCIrYV0sZS5ib2R5WyJvZmZzZXQiK2FdLHJbIm9mZnNldCIrYV0sclsiY2xpZW50IithXSkpOnZvaWQgMD09PW4/Uy5jc3MoZSx0LGkpOlMuc3R5bGUoZSx0LG4saSl9LHMsbj9lOnZvaWQgMCxuKX19KX0pLFMuZWFjaChbImFqYXhTdGFydCIsImFqYXhTdG9wIiwiYWpheENvbXBsZXRlIiwiYWpheEVycm9yIiwiYWpheFN1Y2Nlc3MiLCJhamF4U2VuZCJdLGZ1bmN0aW9uKGUsdCl7Uy5mblt0XT1mdW5jdGlvbihlKXtyZXR1cm4gdGhpcy5vbih0LGUpfX0pLFMuZm4uZXh0ZW5kKHtiaW5kOmZ1bmN0aW9uKGUsdCxuKXtyZXR1cm4gdGhpcy5vbihlLG51bGwsdCxuKX0sdW5iaW5kOmZ1bmN0aW9uKGUsdCl7cmV0dXJuIHRoaXMub2ZmKGUsbnVsbCx0KX0sZGVsZWdhdGU6ZnVuY3Rpb24oZSx0LG4scil7cmV0dXJuIHRoaXMub24odCxlLG4scil9LHVuZGVsZWdhdGU6ZnVuY3Rpb24oZSx0LG4pe3JldHVybiAxPT09YXJndW1lbnRzLmxlbmd0aD90aGlzLm9mZihlLCIqKiIpOnRoaXMub2ZmKHQsZXx8IioqIixuKX0saG92ZXI6ZnVuY3Rpb24oZSx0KXtyZXR1cm4gdGhpcy5tb3VzZWVudGVyKGUpLm1vdXNlbGVhdmUodHx8ZSl9fSksUy5lYWNoKCJibHVyIGZvY3VzIGZvY3VzaW4gZm9jdXNvdXQgcmVzaXplIHNjcm9sbCBjbGljayBkYmxjbGljayBtb3VzZWRvd24gbW91c2V1cCBtb3VzZW1vdmUgbW91c2VvdmVyIG1vdXNlb3V0IG1vdXNlZW50ZXIgbW91c2VsZWF2ZSBjaGFuZ2Ugc2VsZWN0IHN1Ym1pdCBrZXlkb3duIGtleXByZXNzIGtleXVwIGNvbnRleHRtZW51Ii5zcGxpdCgiICIpLGZ1bmN0aW9uKGUsbil7Uy5mbltuXT1mdW5jdGlvbihlLHQpe3JldHVybiAwPGFyZ3VtZW50cy5sZW5ndGg/dGhpcy5vbihuLG51bGwsZSx0KTp0aGlzLnRyaWdnZXIobil9fSk7dmFyIEd0PS9eW1xzXHVGRUZGXHhBMF0rfFtcc1x1RkVGRlx4QTBdKyQvZztTLnByb3h5PWZ1bmN0aW9uKGUsdCl7dmFyIG4scixpO2lmKCJzdHJpbmciPT10eXBlb2YgdCYmKG49ZVt0XSx0PWUsZT1uKSxtKGUpKXJldHVybiByPXMuY2FsbChhcmd1bWVudHMsMiksKGk9ZnVuY3Rpb24oKXtyZXR1cm4gZS5hcHBseSh0fHx0aGlzLHIuY29uY2F0KHMuY2FsbChhcmd1bWVudHMpKSl9KS5ndWlkPWUuZ3VpZD1lLmd1aWR8fFMuZ3VpZCsrLGl9LFMuaG9sZFJlYWR5PWZ1bmN0aW9uKGUpe2U/Uy5yZWFkeVdhaXQrKzpTLnJlYWR5KCEwKX0sUy5pc0FycmF5PUFycmF5LmlzQXJyYXksUy5wYXJzZUpTT049SlNPTi5wYXJzZSxTLm5vZGVOYW1lPUEsUy5pc0Z1bmN0aW9uPW0sUy5pc1dpbmRvdz14LFMuY2FtZWxDYXNlPVgsUy50eXBlPXcsUy5ub3c9RGF0ZS5ub3csUy5pc051bWVyaWM9ZnVuY3Rpb24oZSl7dmFyIHQ9Uy50eXBlKGUpO3JldHVybigibnVtYmVyIj09PXR8fCJzdHJpbmciPT09dCkmJiFpc05hTihlLXBhcnNlRmxvYXQoZSkpfSxTLnRyaW09ZnVuY3Rpb24oZSl7cmV0dXJuIG51bGw9PWU/IiI6KGUrIiIpLnJlcGxhY2UoR3QsIiIpfSwiZnVuY3Rpb24iPT10eXBlb2YgZGVmaW5lJiZkZWZpbmUuYW1kJiZkZWZpbmUoImpxdWVyeSIsW10sZnVuY3Rpb24oKXtyZXR1cm4gU30pO3ZhciBZdD1DLmpRdWVyeSxRdD1DLiQ7cmV0dXJuIFMubm9Db25mbGljdD1mdW5jdGlvbihlKXtyZXR1cm4gQy4kPT09UyYmKEMuJD1RdCksZSYmQy5qUXVlcnk9PT1TJiYoQy5qUXVlcnk9WXQpLFN9LCJ1bmRlZmluZWQiPT10eXBlb2YgZSYmKEMualF1ZXJ5PUMuJD1TKSxTfSk7Cg=="; + exports.jQueryBase64 = jQueryBase64; + var letteringBase64 = "KGZ1bmN0aW9uKCQpewoJZnVuY3Rpb24gaW5qZWN0b3IodCwgc3BsaXR0ZXIsIGtsYXNzLCBhZnRlcikgewoJCXZhciB0ZXh0ID0gdC50ZXh0KCkKCQksIGEgPSB0ZXh0LnNwbGl0KHNwbGl0dGVyKQoJCSwgaW5qZWN0ID0gJyc7CgkJaWYgKGEubGVuZ3RoKSB7CgkJCSQoYSkuZWFjaChmdW5jdGlvbihpLCBpdGVtKSB7CgkJCQlpbmplY3QgKz0gJzxzcGFuIGNsYXNzPSInK2tsYXNzKyhpKzEpKyciIGFyaWEtaGlkZGVuPSJ0cnVlIj4nK2l0ZW0rJzwvc3Bhbj4nK2FmdGVyOwoJCQl9KTsKCQkJdC5hdHRyKCdhcmlhLWxhYmVsJyx0ZXh0KQoJCQkuZW1wdHkoKQoJCQkuYXBwZW5kKGluamVjdCkKCgkJfQoJfQoKCgl2YXIgbWV0aG9kcyA9IHsKCQlpbml0IDogZnVuY3Rpb24oKSB7CgoJCQlyZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uKCkgewoJCQkJaW5qZWN0b3IoJCh0aGlzKSwgJycsICdjaGFyJywgJycpOwoJCQl9KTsKCgkJfSwKCgkJd29yZHMgOiBmdW5jdGlvbigpIHsKCgkJCXJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24oKSB7CgkJCQlpbmplY3RvcigkKHRoaXMpLCAnICcsICd3b3JkJywgJyAnKTsKCQkJfSk7CgoJCX0sCgoJCWxpbmVzIDogZnVuY3Rpb24oKSB7CgoJCQlyZXR1cm4gdGhpcy5lYWNoKGZ1bmN0aW9uKCkgewoJCQkJdmFyIHIgPSAiZWVmZWMzMDMwNzlhZDE3NDA1Yzg4OWUwOTJlMTA1YjAiOwoJCQkJLy8gQmVjYXVzZSBpdCdzIGhhcmQgdG8gc3BsaXQgYSA8YnIvPiB0YWcgY29uc2lzdGVudGx5IGFjcm9zcyBicm93c2VycywKCQkJCS8vICgqYWhlbSogSUUgKmFoZW0qKSwgd2UgcmVwbGFjZSBhbGwgPGJyLz4gaW5zdGFuY2VzIHdpdGggYW4gbWQ1IGhhc2gKCQkJCS8vIChvZiB0aGUgd29yZCAic3BsaXQiKS4gIElmIHlvdSdyZSB0cnlpbmcgdG8gdXNlIHRoaXMgcGx1Z2luIG9uIHRoYXQKCQkJCS8vIG1kNSBoYXNoIHN0cmluZywgaXQgd2lsbCBmYWlsIGJlY2F1c2UgeW91J3JlIGJlaW5nIHJpZGljdWxvdXMuCgkJCQlpbmplY3RvcigkKHRoaXMpLmNoaWxkcmVuKCJiciIpLnJlcGxhY2VXaXRoKHIpLmVuZCgpLCByLCAnbGluZScsICcnKTsKCQkJfSk7CgoJCX0KCX07CgoJJC5mbi5sZXR0ZXJpbmcgPSBmdW5jdGlvbiggbWV0aG9kICkgewoJCS8vIE1ldGhvZCBjYWxsaW5nIGxvZ2ljCgkJaWYgKCBtZXRob2QgJiYgbWV0aG9kc1ttZXRob2RdICkgewoJCQlyZXR1cm4gbWV0aG9kc1sgbWV0aG9kIF0uYXBwbHkoIHRoaXMsIFtdLnNsaWNlLmNhbGwoIGFyZ3VtZW50cywgMSApKTsKCQl9IGVsc2UgaWYgKCBtZXRob2QgPT09ICdsZXR0ZXJzJyB8fCAhIG1ldGhvZCApIHsKCQkJcmV0dXJuIG1ldGhvZHMuaW5pdC5hcHBseSggdGhpcywgW10uc2xpY2UuY2FsbCggYXJndW1lbnRzLCAwICkgKTsgLy8gYWx3YXlzIHBhc3MgYW4gYXJyYXkKCQl9CgkJJC5lcnJvciggJ01ldGhvZCAnICsgIG1ldGhvZCArICcgZG9lcyBub3QgZXhpc3Qgb24galF1ZXJ5LmxldHRlcmluZycgKTsKCQlyZXR1cm4gdGhpczsKCX07Cgp9KShqUXVlcnkpOw=="; + exports.letteringBase64 = letteringBase64; + var columnizerBase64 = "KGZ1bmN0aW9uKCQpeyQuZm4uY29sdW1uaXplPWZ1bmN0aW9uKG9wdGlvbnMpe3RoaXMuY29scz1bXTt0aGlzLm9mZnNldD0wO3RoaXMuYmVmb3JlPVtdO3RoaXMubGFzdE90aGVyPTA7dGhpcy5wcmV2TWF4PTA7dGhpcy5kZWJ1Zz0wO3RoaXMuc2V0Q29sdW1uU3RhcnQ9bnVsbDt0aGlzLmVsaXBzaXNUZXh0PScnO3ZhciBkZWZhdWx0cz17d2lkdGg6NDAwLGNvbHVtbnM6ZmFsc2UsYnVpbGRPbmNlOmZhbHNlLG92ZXJmbG93OmZhbHNlLGRvbmVGdW5jOmZ1bmN0aW9uKCl7fSx0YXJnZXQ6ZmFsc2UsaWdub3JlSW1hZ2VMb2FkaW5nOnRydWUsY29sdW1uRmxvYXQ6ImxlZnQiLGxhc3ROZXZlclRhbGxlc3Q6ZmFsc2UsYWNjdXJhY3k6ZmFsc2UscHJlY2lzZTpmYWxzZSxtYW51YWxCcmVha3M6ZmFsc2UsY3NzQ2xhc3NQcmVmaXg6IiIsZWxpcHNpc1RleHQ6Jy4uLicsZGVidWc6MH07b3B0aW9ucz0kLmV4dGVuZChkZWZhdWx0cyxvcHRpb25zKTtpZih0eXBlb2Yob3B0aW9ucy53aWR0aCk9PSJzdHJpbmciKXtvcHRpb25zLndpZHRoPXBhcnNlSW50KG9wdGlvbnMud2lkdGgsMTApO2lmKGlzTmFOKG9wdGlvbnMud2lkdGgpKXtvcHRpb25zLndpZHRoPWRlZmF1bHRzLndpZHRoO319CmlmKHR5cGVvZiBvcHRpb25zLnNldENvbHVtblN0YXJ0PT0nZnVuY3Rpb24nKXt0aGlzLnNldENvbHVtblN0YXJ0PW9wdGlvbnMuc2V0Q29sdW1uU3RhcnQ7fQppZih0eXBlb2Ygb3B0aW9ucy5lbGlwc2lzVGV4dD09J3N0cmluZycpe3RoaXMuZWxpcHNpc1RleHQ9b3B0aW9ucy5lbGlwc2lzVGV4dDt9CmlmKG9wdGlvbnMuZGVidWcpe3RoaXMuZGVidWc9b3B0aW9ucy5kZWJ1Zzt9CmlmKCFvcHRpb25zLnNldFdpZHRoKXtpZihvcHRpb25zLnByZWNpc2Upe29wdGlvbnMuc2V0V2lkdGg9ZnVuY3Rpb24obnVtQ29scyl7cmV0dXJuIDEwMC9udW1Db2xzO307fWVsc2V7b3B0aW9ucy5zZXRXaWR0aD1mdW5jdGlvbihudW1Db2xzKXtyZXR1cm4gTWF0aC5mbG9vcigxMDAvbnVtQ29scyk7fTt9fQpmdW5jdGlvbiBhcHBlbmRTYWZlKCR0YXJnZXQsJGVsZW0pe3RyeXskdGFyZ2V0LmFwcGVuZCgkZWxlbSk7fWNhdGNoKGUpeyR0YXJnZXRbMF0uYXBwZW5kQ2hpbGQoJGVsZW1bMF0pO319CnJldHVybiB0aGlzLmVhY2goZnVuY3Rpb24oKXt2YXIgJGluQm94PW9wdGlvbnMudGFyZ2V0PyQob3B0aW9ucy50YXJnZXQpOiQodGhpcyk7dmFyIG1heEhlaWdodD0kKHRoaXMpLmhlaWdodCgpO3ZhciAkY2FjaGU9JCgnPGRpdj48L2Rpdj4nKTt2YXIgbGFzdFdpZHRoPTA7dmFyIGNvbHVtbml6aW5nPWZhbHNlO3ZhciBtYW51YWxCcmVha3M9b3B0aW9ucy5tYW51YWxCcmVha3M7dmFyIGNzc0NsYXNzUHJlZml4PWRlZmF1bHRzLmNzc0NsYXNzUHJlZml4O2lmKHR5cGVvZihvcHRpb25zLmNzc0NsYXNzUHJlZml4KT09InN0cmluZyIpe2Nzc0NsYXNzUHJlZml4PW9wdGlvbnMuY3NzQ2xhc3NQcmVmaXg7fQp2YXIgYWRqdXN0bWVudD0wO2FwcGVuZFNhZmUoJGNhY2hlLCQodGhpcykuY29udGVudHMoKS5jbG9uZSh0cnVlKSk7aWYoIW9wdGlvbnMuaWdub3JlSW1hZ2VMb2FkaW5nJiYhb3B0aW9ucy50YXJnZXQpe2lmKCEkaW5Cb3guZGF0YSgiaW1hZ2VMb2FkZWQiKSl7JGluQm94LmRhdGEoImltYWdlTG9hZGVkIix0cnVlKTtpZigkKHRoaXMpLmZpbmQoImltZyIpLmxlbmd0aD4wKXt2YXIgZnVuYz1mdW5jdGlvbigkaW5Cb3gsJGNhY2hlKXtyZXR1cm4gZnVuY3Rpb24oKXtpZighJGluQm94LmRhdGEoImZpcnN0SW1hZ2VMb2FkZWQiKSl7JGluQm94LmRhdGEoImZpcnN0SW1hZ2VMb2FkZWQiLCJ0cnVlIik7YXBwZW5kU2FmZSgkaW5Cb3guZW1wdHkoKSwkY2FjaGUuY2hpbGRyZW4oKS5jbG9uZSh0cnVlKSk7JGluQm94LmNvbHVtbml6ZShvcHRpb25zKTt9fTt9KCQodGhpcyksJGNhY2hlKTskKHRoaXMpLmZpbmQoImltZyIpLm9uZSgibG9hZCIsZnVuYyk7JCh0aGlzKS5maW5kKCJpbWciKS5vbmUoImFib3J0IixmdW5jKTtyZXR1cm47fX19CiRpbkJveC5lbXB0eSgpO2NvbHVtbml6ZUl0KCk7aWYoIW9wdGlvbnMuYnVpbGRPbmNlKXskKHdpbmRvdykucmVzaXplKGZ1bmN0aW9uKCl7aWYoIW9wdGlvbnMuYnVpbGRPbmNlKXtpZigkaW5Cb3guZGF0YSgidGltZW91dCIpKXtjbGVhclRpbWVvdXQoJGluQm94LmRhdGEoInRpbWVvdXQiKSk7fQokaW5Cb3guZGF0YSgidGltZW91dCIsc2V0VGltZW91dChjb2x1bW5pemVJdCwyMDApKTt9fSk7fQpmdW5jdGlvbiBwcmVmaXhUaGVDbGFzc05hbWUoY2xhc3NOYW1lLHdpdGhEb3Qpe3ZhciBkb3Q9d2l0aERvdD8iLiI6IiI7aWYoY3NzQ2xhc3NQcmVmaXgubGVuZ3RoKXtyZXR1cm4gZG90K2Nzc0NsYXNzUHJlZml4KyItIitjbGFzc05hbWU7fQpyZXR1cm4gZG90K2NsYXNzTmFtZTt9CmZ1bmN0aW9uIGNvbHVtbml6ZSgkcHV0SW5IZXJlLCRwdWxsT3V0SGVyZSwkcGFyZW50Q29sdW1uLHRhcmdldEhlaWdodCl7d2hpbGUoKG1hbnVhbEJyZWFrc3x8JHBhcmVudENvbHVtbi5oZWlnaHQoKTx0YXJnZXRIZWlnaHQpJiYkcHVsbE91dEhlcmVbMF0uY2hpbGROb2Rlcy5sZW5ndGgpe3ZhciBub2RlPSRwdWxsT3V0SGVyZVswXS5jaGlsZE5vZGVzWzBdO2lmKCQobm9kZSkuZmluZChwcmVmaXhUaGVDbGFzc05hbWUoImNvbHVtbmJyZWFrIix0cnVlKSkubGVuZ3RoKXtyZXR1cm47fQppZigkKG5vZGUpLmhhc0NsYXNzKHByZWZpeFRoZUNsYXNzTmFtZSgiY29sdW1uYnJlYWsiKSkpe3JldHVybjt9CmFwcGVuZFNhZmUoJHB1dEluSGVyZSwkKG5vZGUpKTt9CmlmKCRwdXRJbkhlcmVbMF0uY2hpbGROb2Rlcy5sZW5ndGg9PT0wKXJldHVybjt2YXIga2lkcz0kcHV0SW5IZXJlWzBdLmNoaWxkTm9kZXM7dmFyIGxhc3RLaWQ9a2lkc1traWRzLmxlbmd0aC0xXTskcHV0SW5IZXJlWzBdLnJlbW92ZUNoaWxkKGxhc3RLaWQpO3ZhciAkaXRlbT0kKGxhc3RLaWQpO2lmKCRpdGVtWzBdLm5vZGVUeXBlPT0zKXt2YXIgb1RleHQ9JGl0ZW1bMF0ubm9kZVZhbHVlO3ZhciBjb3VudGVyMj1vcHRpb25zLndpZHRoLzE4O2lmKG9wdGlvbnMuYWNjdXJhY3kpCmNvdW50ZXIyPW9wdGlvbnMuYWNjdXJhY3k7dmFyIGNvbHVtblRleHQ7dmFyIGxhdGVzdFRleHROb2RlPW51bGw7d2hpbGUoJHBhcmVudENvbHVtbi5oZWlnaHQoKTx0YXJnZXRIZWlnaHQmJm9UZXh0Lmxlbmd0aCl7dmFyIGluZGV4T2ZTcGFjZT1vVGV4dC5pbmRleE9mKCcgJyxjb3VudGVyMik7aWYoaW5kZXhPZlNwYWNlIT0tMSl7Y29sdW1uVGV4dD1vVGV4dC5zdWJzdHJpbmcoMCxpbmRleE9mU3BhY2UpO31lbHNle2NvbHVtblRleHQ9b1RleHQ7fQpsYXRlc3RUZXh0Tm9kZT1kb2N1bWVudC5jcmVhdGVUZXh0Tm9kZShjb2x1bW5UZXh0KTthcHBlbmRTYWZlKCRwdXRJbkhlcmUsJChsYXRlc3RUZXh0Tm9kZSkpO2lmKG9UZXh0Lmxlbmd0aD5jb3VudGVyMiYmaW5kZXhPZlNwYWNlIT0tMSl7b1RleHQ9b1RleHQuc3Vic3RyaW5nKGluZGV4T2ZTcGFjZSk7fWVsc2V7b1RleHQ9IiI7fX0KaWYoJHBhcmVudENvbHVtbi5oZWlnaHQoKT49dGFyZ2V0SGVpZ2h0JiZsYXRlc3RUZXh0Tm9kZSE9PW51bGwpeyRwdXRJbkhlcmVbMF0ucmVtb3ZlQ2hpbGQobGF0ZXN0VGV4dE5vZGUpO29UZXh0PWxhdGVzdFRleHROb2RlLm5vZGVWYWx1ZStvVGV4dDt9CmlmKG9UZXh0Lmxlbmd0aCl7JGl0ZW1bMF0ubm9kZVZhbHVlPW9UZXh0O31lbHNle3JldHVybiBmYWxzZTt9fQppZigkcHVsbE91dEhlcmUuY29udGVudHMoKS5sZW5ndGgpeyRwdWxsT3V0SGVyZS5wcmVwZW5kKCRpdGVtKTt9ZWxzZXthcHBlbmRTYWZlKCRwdWxsT3V0SGVyZSwkaXRlbSk7fQpyZXR1cm4gJGl0ZW1bMF0ubm9kZVR5cGU9PTM7fQpmdW5jdGlvbiBzcGxpdCgkcHV0SW5IZXJlLCRwdWxsT3V0SGVyZSwkcGFyZW50Q29sdW1uLHRhcmdldEhlaWdodCl7aWYoJHB1dEluSGVyZS5jb250ZW50cygiOmxhc3QiKS5maW5kKHByZWZpeFRoZUNsYXNzTmFtZSgiY29sdW1uYnJlYWsiLHRydWUpKS5sZW5ndGgpe3JldHVybjt9CmlmKCRwdXRJbkhlcmUuY29udGVudHMoIjpsYXN0IikuaGFzQ2xhc3MocHJlZml4VGhlQ2xhc3NOYW1lKCJjb2x1bW5icmVhayIpKSl7cmV0dXJuO30KaWYoJHB1bGxPdXRIZXJlLmNvbnRlbnRzKCkubGVuZ3RoKXt2YXIgJGNsb25lTWU9JHB1bGxPdXRIZXJlLmNvbnRlbnRzKCI6Zmlyc3QiKTtpZih0eXBlb2YgJGNsb25lTWUuZ2V0KDApPT0ndW5kZWZpbmVkJ3x8JGNsb25lTWUuZ2V0KDApLm5vZGVUeXBlIT0xKXJldHVybjt2YXIgJGNsb25lPSRjbG9uZU1lLmNsb25lKHRydWUpO2lmKCRjbG9uZU1lLmhhc0NsYXNzKHByZWZpeFRoZUNsYXNzTmFtZSgiY29sdW1uYnJlYWsiKSkpe2FwcGVuZFNhZmUoJHB1dEluSGVyZSwkY2xvbmUpOyRjbG9uZU1lLnJlbW92ZSgpO31lbHNlIGlmKG1hbnVhbEJyZWFrcyl7YXBwZW5kU2FmZSgkcHV0SW5IZXJlLCRjbG9uZSk7JGNsb25lTWUucmVtb3ZlKCk7fWVsc2UgaWYoJGNsb25lLmdldCgwKS5ub2RlVHlwZT09MSYmISRjbG9uZS5oYXNDbGFzcyhwcmVmaXhUaGVDbGFzc05hbWUoImRvbnRlbmQiKSkpe2FwcGVuZFNhZmUoJHB1dEluSGVyZSwkY2xvbmUpO2lmKCRjbG9uZS5pcygiaW1nIikmJiRwYXJlbnRDb2x1bW4uaGVpZ2h0KCk8dGFyZ2V0SGVpZ2h0KzIwKXskY2xvbmVNZS5yZW1vdmUoKTt9ZWxzZSBpZigkY2xvbmVNZS5oYXNDbGFzcyhwcmVmaXhUaGVDbGFzc05hbWUoImRvbnRzcGxpdCIpKSYmJHBhcmVudENvbHVtbi5oZWlnaHQoKTx0YXJnZXRIZWlnaHQrMjApeyRjbG9uZU1lLnJlbW92ZSgpO31lbHNlIGlmKCRjbG9uZS5pcygiaW1nIil8fCRjbG9uZU1lLmhhc0NsYXNzKHByZWZpeFRoZUNsYXNzTmFtZSgiZG9udHNwbGl0IikpKXskY2xvbmUucmVtb3ZlKCk7fWVsc2V7JGNsb25lLmVtcHR5KCk7aWYoIWNvbHVtbml6ZSgkY2xvbmUsJGNsb25lTWUsJHBhcmVudENvbHVtbix0YXJnZXRIZWlnaHQpKXskY2xvbmVNZS5hZGRDbGFzcyhwcmVmaXhUaGVDbGFzc05hbWUoInNwbGl0IikpO2lmKCRjbG9uZU1lLmdldCgwKS50YWdOYW1lPT0nT0wnKXt2YXIgc3RhcnRXaXRoPSRjbG9uZS5nZXQoMCkuY2hpbGRFbGVtZW50Q291bnQrJGNsb25lLmdldCgwKS5zdGFydDskY2xvbmVNZS5hdHRyKCdzdGFydCcsc3RhcnRXaXRoKzEpO30KaWYoJGNsb25lTWUuY2hpbGRyZW4oKS5sZW5ndGgpe3NwbGl0KCRjbG9uZSwkY2xvbmVNZSwkcGFyZW50Q29sdW1uLHRhcmdldEhlaWdodCk7fX1lbHNleyRjbG9uZU1lLmFkZENsYXNzKHByZWZpeFRoZUNsYXNzTmFtZSgic3BsaXQiKSk7fQppZigkY2xvbmUuZ2V0KDApLmNoaWxkTm9kZXMubGVuZ3RoPT09MCl7JGNsb25lLnJlbW92ZSgpOyRjbG9uZU1lLnJlbW92ZUNsYXNzKHByZWZpeFRoZUNsYXNzTmFtZSgic3BsaXQiKSk7fX19fX0KZnVuY3Rpb24gc2luZ2xlQ29sdW1uaXplSXQoKXtpZigkaW5Cb3guZGF0YSgiY29sdW1uaXplZCIpJiYkaW5Cb3guY2hpbGRyZW4oKS5sZW5ndGg9PTEpe3JldHVybjt9CiRpbkJveC5kYXRhKCJjb2x1bW5pemVkIix0cnVlKTskaW5Cb3guZGF0YSgiY29sdW1uaXppbmciLHRydWUpOyRpbkJveC5lbXB0eSgpOyRpbkJveC5hcHBlbmQoJCgiPGRpdiBjbGFzcz0nIgorcHJlZml4VGhlQ2xhc3NOYW1lKCJmaXJzdCIpKyIgIgorcHJlZml4VGhlQ2xhc3NOYW1lKCJsYXN0IikrIiAiCitwcmVmaXhUaGVDbGFzc05hbWUoImNvbHVtbiIpKyIgIgorIicgc3R5bGU9J3dpZHRoOjEwMCU7IGZsb2F0OiAiK29wdGlvbnMuY29sdW1uRmxvYXQrIjsnPjwvZGl2PiIpKTskY29sPSRpbkJveC5jaGlsZHJlbigpLmVxKCRpbkJveC5jaGlsZHJlbigpLmxlbmd0aC0xKTskZGVzdHJveWFibGU9JGNhY2hlLmNsb25lKHRydWUpO2lmKG9wdGlvbnMub3ZlcmZsb3cpe3RhcmdldEhlaWdodD1vcHRpb25zLm92ZXJmbG93LmhlaWdodDtjb2x1bW5pemUoJGNvbCwkZGVzdHJveWFibGUsJGNvbCx0YXJnZXRIZWlnaHQpO2lmKCEkZGVzdHJveWFibGUuY29udGVudHMoKS5maW5kKCI6Zmlyc3QtY2hpbGQiKS5oYXNDbGFzcyhwcmVmaXhUaGVDbGFzc05hbWUoImRvbnRlbmQiKSkpe3NwbGl0KCRjb2wsJGRlc3Ryb3lhYmxlLCRjb2wsdGFyZ2V0SGVpZ2h0KTt9CndoaWxlKCRjb2wuY29udGVudHMoIjpsYXN0IikubGVuZ3RoJiZjaGVja0RvbnRFbmRDb2x1bW4oJGNvbC5jb250ZW50cygiOmxhc3QiKS5nZXQoMCkpKXt2YXIgJGxhc3RLaWQ9JGNvbC5jb250ZW50cygiOmxhc3QiKTskbGFzdEtpZC5yZW1vdmUoKTskZGVzdHJveWFibGUucHJlcGVuZCgkbGFzdEtpZCk7fQp2YXIgaHRtbD0iIjt2YXIgZGl2PWRvY3VtZW50LmNyZWF0ZUVsZW1lbnQoJ0RJVicpO3doaWxlKCRkZXN0cm95YWJsZVswXS5jaGlsZE5vZGVzLmxlbmd0aD4wKXt2YXIga2lkPSRkZXN0cm95YWJsZVswXS5jaGlsZE5vZGVzWzBdO2lmKGtpZC5hdHRyaWJ1dGVzKXtmb3IodmFyIGk9MDtpPGtpZC5hdHRyaWJ1dGVzLmxlbmd0aDtpKyspe2lmKGtpZC5hdHRyaWJ1dGVzW2ldLm5vZGVOYW1lLmluZGV4T2YoImpRdWVyeSIpPT09MCl7a2lkLnJlbW92ZUF0dHJpYnV0ZShraWQuYXR0cmlidXRlc1tpXS5ub2RlTmFtZSk7fX19CmRpdi5pbm5lckhUTUw9IiI7ZGl2LmFwcGVuZENoaWxkKCRkZXN0cm95YWJsZVswXS5jaGlsZE5vZGVzWzBdKTtodG1sKz1kaXYuaW5uZXJIVE1MO30KdmFyIG92ZXJmbG93PSQob3B0aW9ucy5vdmVyZmxvdy5pZClbMF07b3ZlcmZsb3cuaW5uZXJIVE1MPWh0bWw7fWVsc2V7YXBwZW5kU2FmZSgkY29sLCRkZXN0cm95YWJsZS5jb250ZW50cygpKTt9CiRpbkJveC5kYXRhKCJjb2x1bW5pemluZyIsZmFsc2UpO2lmKG9wdGlvbnMub3ZlcmZsb3cmJm9wdGlvbnMub3ZlcmZsb3cuZG9uZUZ1bmMpe29wdGlvbnMub3ZlcmZsb3cuZG9uZUZ1bmMoKTt9Cm9wdGlvbnMuZG9uZUZ1bmMoKTt9CmZ1bmN0aW9uIGNoZWNrRG9udEVuZENvbHVtbihkb20pe2lmKGRvbS5ub2RlVHlwZT09Myl7aWYoL15ccyskLy50ZXN0KGRvbS5ub2RlVmFsdWUpKXtpZighZG9tLnByZXZpb3VzU2libGluZylyZXR1cm4gZmFsc2U7cmV0dXJuIGNoZWNrRG9udEVuZENvbHVtbihkb20ucHJldmlvdXNTaWJsaW5nKTt9CnJldHVybiBmYWxzZTt9CmlmKGRvbS5ub2RlVHlwZSE9MSlyZXR1cm4gZmFsc2U7aWYoJChkb20pLmhhc0NsYXNzKHByZWZpeFRoZUNsYXNzTmFtZSgiZG9udGVuZCIpKSlyZXR1cm4gdHJ1ZTtpZihkb20uY2hpbGROb2Rlcy5sZW5ndGg9PT0wKXJldHVybiBmYWxzZTtyZXR1cm4gY2hlY2tEb250RW5kQ29sdW1uKGRvbS5jaGlsZE5vZGVzW2RvbS5jaGlsZE5vZGVzLmxlbmd0aC0xXSk7fQpmdW5jdGlvbiBjb2x1bW5pemVJdCgpe2FkanVzdG1lbnQ9MDtpZihsYXN0V2lkdGg9PSRpbkJveC53aWR0aCgpKXJldHVybjtsYXN0V2lkdGg9JGluQm94LndpZHRoKCk7dmFyIG51bUNvbHM9TWF0aC5yb3VuZCgkaW5Cb3gud2lkdGgoKS9vcHRpb25zLndpZHRoKTt2YXIgb3B0aW9uV2lkdGg9b3B0aW9ucy53aWR0aDt2YXIgb3B0aW9uSGVpZ2h0PW9wdGlvbnMuaGVpZ2h0O2lmKG9wdGlvbnMuY29sdW1ucyludW1Db2xzPW9wdGlvbnMuY29sdW1ucztpZihtYW51YWxCcmVha3Mpe251bUNvbHM9JGNhY2hlLmZpbmQocHJlZml4VGhlQ2xhc3NOYW1lKCJjb2x1bW5icmVhayIsdHJ1ZSkpLmxlbmd0aCsxO29wdGlvbldpZHRoPWZhbHNlO30KaWYobnVtQ29sczw9MSl7cmV0dXJuIHNpbmdsZUNvbHVtbml6ZUl0KCk7fQppZigkaW5Cb3guZGF0YSgiY29sdW1uaXppbmciKSlyZXR1cm47JGluQm94LmRhdGEoImNvbHVtbml6ZWQiLHRydWUpOyRpbkJveC5kYXRhKCJjb2x1bW5pemluZyIsdHJ1ZSk7JGluQm94LmVtcHR5KCk7JGluQm94LmFwcGVuZCgkKCI8ZGl2IHN0eWxlPSd3aWR0aDoiK29wdGlvbnMuc2V0V2lkdGgobnVtQ29scykrIiU7IGZsb2F0OiAiK29wdGlvbnMuY29sdW1uRmxvYXQrIjsnPjwvZGl2PiIpKTskY29sPSRpbkJveC5jaGlsZHJlbigiOmxhc3QiKTthcHBlbmRTYWZlKCRjb2wsJGNhY2hlLmNsb25lKCkpO21heEhlaWdodD0kY29sLmhlaWdodCgpOyRpbkJveC5lbXB0eSgpO3ZhciB0YXJnZXRIZWlnaHQ9bWF4SGVpZ2h0L251bUNvbHM7dmFyIGZpcnN0VGltZT10cnVlO3ZhciBtYXhMb29wcz0zO3ZhciBzY3JvbGxIb3Jpem9udGFsbHk9ZmFsc2U7aWYob3B0aW9ucy5vdmVyZmxvdyl7bWF4TG9vcHM9MTt0YXJnZXRIZWlnaHQ9b3B0aW9ucy5vdmVyZmxvdy5oZWlnaHQ7fWVsc2UgaWYob3B0aW9uSGVpZ2h0JiZvcHRpb25XaWR0aCl7bWF4TG9vcHM9MTt0YXJnZXRIZWlnaHQ9b3B0aW9uSGVpZ2h0O3Njcm9sbEhvcml6b250YWxseT10cnVlO30KZm9yKHZhciBsb29wQ291bnQ9MDtsb29wQ291bnQ8bWF4TG9vcHMmJmxvb3BDb3VudDwyMDtsb29wQ291bnQrKyl7JGluQm94LmVtcHR5KCk7dmFyICRkZXN0cm95YWJsZSxjbGFzc05hbWUsJGNvbCwkbGFzdEtpZDt0cnl7JGRlc3Ryb3lhYmxlPSRjYWNoZS5jbG9uZSh0cnVlKTt9Y2F0Y2goZSl7JGRlc3Ryb3lhYmxlPSRjYWNoZS5jbG9uZSgpO30KJGRlc3Ryb3lhYmxlLmNzcygidmlzaWJpbGl0eSIsImhpZGRlbiIpO2Zvcih2YXIgaT0wO2k8bnVtQ29scztpKyspe2NsYXNzTmFtZT0oaT09PTApP3ByZWZpeFRoZUNsYXNzTmFtZSgiZmlyc3QiKToiIjtjbGFzc05hbWUrPSIgIitwcmVmaXhUaGVDbGFzc05hbWUoImNvbHVtbiIpO2NsYXNzTmFtZT0oaT09bnVtQ29scy0xKT8ocHJlZml4VGhlQ2xhc3NOYW1lKCJsYXN0IikrIiAiK2NsYXNzTmFtZSk6Y2xhc3NOYW1lOyRpbkJveC5hcHBlbmQoJCgiPGRpdiBjbGFzcz0nIitjbGFzc05hbWUrIicgc3R5bGU9J3dpZHRoOiIrb3B0aW9ucy5zZXRXaWR0aChudW1Db2xzKSsiJTsgZmxvYXQ6ICIrb3B0aW9ucy5jb2x1bW5GbG9hdCsiOyc+PC9kaXY+IikpO30KaT0wO3doaWxlKGk8bnVtQ29scy0ob3B0aW9ucy5vdmVyZmxvdz8wOjEpfHxzY3JvbGxIb3Jpem9udGFsbHkmJiRkZXN0cm95YWJsZS5jb250ZW50cygpLmxlbmd0aCl7aWYoJGluQm94LmNoaWxkcmVuKCkubGVuZ3RoPD1pKXskaW5Cb3guYXBwZW5kKCQoIjxkaXYgY2xhc3M9JyIrY2xhc3NOYW1lKyInIHN0eWxlPSd3aWR0aDoiK29wdGlvbnMuc2V0V2lkdGgobnVtQ29scykrIiU7IGZsb2F0OiAiK29wdGlvbnMuY29sdW1uRmxvYXQrIjsnPjwvZGl2PiIpKTt9CiRjb2w9JGluQm94LmNoaWxkcmVuKCkuZXEoaSk7aWYoc2Nyb2xsSG9yaXpvbnRhbGx5KXskY29sLndpZHRoKG9wdGlvbldpZHRoKyJweCIpO30KY29sdW1uaXplKCRjb2wsJGRlc3Ryb3lhYmxlLCRjb2wsdGFyZ2V0SGVpZ2h0KTtzcGxpdCgkY29sLCRkZXN0cm95YWJsZSwkY29sLHRhcmdldEhlaWdodCk7d2hpbGUoJGNvbC5jb250ZW50cygiOmxhc3QiKS5sZW5ndGgmJmNoZWNrRG9udEVuZENvbHVtbigkY29sLmNvbnRlbnRzKCI6bGFzdCIpLmdldCgwKSkpeyRsYXN0S2lkPSRjb2wuY29udGVudHMoIjpsYXN0Iik7JGxhc3RLaWQucmVtb3ZlKCk7JGRlc3Ryb3lhYmxlLnByZXBlbmQoJGxhc3RLaWQpO30KaSsrO2lmKCRjb2wuY29udGVudHMoKS5sZW5ndGg9PT0wJiYkZGVzdHJveWFibGUuY29udGVudHMoKS5sZW5ndGgpeyRjb2wuYXBwZW5kKCRkZXN0cm95YWJsZS5jb250ZW50cygiOmZpcnN0IikpO31lbHNlIGlmKGk9PW51bUNvbHMtKG9wdGlvbnMub3ZlcmZsb3c/MDoxKSYmIW9wdGlvbnMub3ZlcmZsb3cpe2lmKCRkZXN0cm95YWJsZS5maW5kKHByZWZpeFRoZUNsYXNzTmFtZSgiY29sdW1uYnJlYWsiLHRydWUpKS5sZW5ndGgpe251bUNvbHMrKzt9fX0KaWYob3B0aW9ucy5vdmVyZmxvdyYmIXNjcm9sbEhvcml6b250YWxseSl7dmFyIElFNj1mYWxzZTt2YXIgSUU3PShkb2N1bWVudC5hbGwpJiYobmF2aWdhdG9yLmFwcFZlcnNpb24uaW5kZXhPZigiTVNJRSA3LiIpIT0tMSk7aWYoSUU2fHxJRTcpe3ZhciBodG1sPSIiO3ZhciBkaXY9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnRElWJyk7d2hpbGUoJGRlc3Ryb3lhYmxlWzBdLmNoaWxkTm9kZXMubGVuZ3RoPjApe3ZhciBraWQ9JGRlc3Ryb3lhYmxlWzBdLmNoaWxkTm9kZXNbMF07Zm9yKGk9MDtpPGtpZC5hdHRyaWJ1dGVzLmxlbmd0aDtpKyspe2lmKGtpZC5hdHRyaWJ1dGVzW2ldLm5vZGVOYW1lLmluZGV4T2YoImpRdWVyeSIpPT09MCl7a2lkLnJlbW92ZUF0dHJpYnV0ZShraWQuYXR0cmlidXRlc1tpXS5ub2RlTmFtZSk7fX0KZGl2LmlubmVySFRNTD0iIjtkaXYuYXBwZW5kQ2hpbGQoJGRlc3Ryb3lhYmxlWzBdLmNoaWxkTm9kZXNbMF0pO2h0bWwrPWRpdi5pbm5lckhUTUw7fQp2YXIgb3ZlcmZsb3c9JChvcHRpb25zLm92ZXJmbG93LmlkKVswXTtvdmVyZmxvdy5pbm5lckhUTUw9aHRtbDt9ZWxzZXskKG9wdGlvbnMub3ZlcmZsb3cuaWQpLmVtcHR5KCkuYXBwZW5kKCRkZXN0cm95YWJsZS5jb250ZW50cygpLmNsb25lKHRydWUpKTt9fWVsc2UgaWYoIXNjcm9sbEhvcml6b250YWxseSl7JGNvbD0kaW5Cb3guY2hpbGRyZW4oKS5lcSgkaW5Cb3guY2hpbGRyZW4oKS5sZW5ndGgtMSk7JGRlc3Ryb3lhYmxlLmNvbnRlbnRzKCkuZWFjaChmdW5jdGlvbigpeyRjb2wuYXBwZW5kKCQodGhpcykpO30pO3ZhciBhZnRlckg9JGNvbC5oZWlnaHQoKTt2YXIgZGlmZj1hZnRlckgtdGFyZ2V0SGVpZ2h0O3ZhciB0b3RhbEg9MDt2YXIgbWluPTEwMDAwMDAwO3ZhciBtYXg9MDt2YXIgbGFzdElzTWF4PWZhbHNlO3ZhciBudW1iZXJPZkNvbHVtbnNUaGF0RG9udEVuZEluQUNvbHVtbkJyZWFrPTA7JGluQm94LmNoaWxkcmVuKCkuZWFjaChmdW5jdGlvbigkaW5Cb3gpe3JldHVybiBmdW5jdGlvbigkaXRlbSl7dmFyICRjb2w9JGluQm94LmNoaWxkcmVuKCkuZXEoJGl0ZW0pO3ZhciBlbmRzSW5CcmVhaz0kY29sLmNoaWxkcmVuKCI6bGFzdCIpLmZpbmQocHJlZml4VGhlQ2xhc3NOYW1lKCJjb2x1bW5icmVhayIsdHJ1ZSkpLmxlbmd0aDtpZighZW5kc0luQnJlYWspe3ZhciBoPSRjb2wuaGVpZ2h0KCk7bGFzdElzTWF4PWZhbHNlO3RvdGFsSCs9aDtpZihoPm1heCl7bWF4PWg7bGFzdElzTWF4PXRydWU7fQppZihoPG1pbiltaW49aDtudW1iZXJPZkNvbHVtbnNUaGF0RG9udEVuZEluQUNvbHVtbkJyZWFrKys7fX07fSgkaW5Cb3gpKTt2YXIgYXZnSD10b3RhbEgvbnVtYmVyT2ZDb2x1bW5zVGhhdERvbnRFbmRJbkFDb2x1bW5CcmVhaztpZih0b3RhbEg9PT0wKXtsb29wQ291bnQ9bWF4TG9vcHM7fWVsc2UgaWYob3B0aW9ucy5sYXN0TmV2ZXJUYWxsZXN0JiZsYXN0SXNNYXgpe2FkanVzdG1lbnQrPTU7dGFyZ2V0SGVpZ2h0PXRhcmdldEhlaWdodCszMDtpZihsb29wQ291bnQ9PW1heExvb3BzLTEpbWF4TG9vcHMrKzt9ZWxzZSBpZihtYXgtbWluPjMwKXt0YXJnZXRIZWlnaHQ9YXZnSCszMDt9ZWxzZSBpZihNYXRoLmFicyhhdmdILXRhcmdldEhlaWdodCk+MjApe3RhcmdldEhlaWdodD1hdmdIO31lbHNle2xvb3BDb3VudD1tYXhMb29wczt9fWVsc2V7JGluQm94LmNoaWxkcmVuKCkuZWFjaChmdW5jdGlvbihpKXskY29sPSRpbkJveC5jaGlsZHJlbigpLmVxKGkpOyRjb2wud2lkdGgob3B0aW9uV2lkdGgrInB4Iik7aWYoaT09PTApeyRjb2wuYWRkQ2xhc3MocHJlZml4VGhlQ2xhc3NOYW1lKCJmaXJzdCIpKTt9ZWxzZSBpZihpPT0kaW5Cb3guY2hpbGRyZW4oKS5sZW5ndGgtMSl7JGNvbC5hZGRDbGFzcyhwcmVmaXhUaGVDbGFzc05hbWUoImxhc3QiKSk7fWVsc2V7JGNvbC5yZW1vdmVDbGFzcyhwcmVmaXhUaGVDbGFzc05hbWUoImZpcnN0IikpOyRjb2wucmVtb3ZlQ2xhc3MocHJlZml4VGhlQ2xhc3NOYW1lKCJsYXN0IikpO319KTskaW5Cb3gud2lkdGgoJGluQm94LmNoaWxkcmVuKCkubGVuZ3RoKm9wdGlvbldpZHRoKyJweCIpO30KJGluQm94LmFwcGVuZCgkKCI8YnIgc3R5bGU9J2NsZWFyOmJvdGg7Jz4iKSk7fQokaW5Cb3guZmluZChwcmVmaXhUaGVDbGFzc05hbWUoImNvbHVtbiIsdHJ1ZSkpLmZpbmQoIjpmaXJzdCIrcHJlZml4VGhlQ2xhc3NOYW1lKCJyZW1vdmVpZmZpcnN0Iix0cnVlKSkucmVtb3ZlKCk7JGluQm94LmZpbmQocHJlZml4VGhlQ2xhc3NOYW1lKCJjb2x1bW4iLHRydWUpKS5maW5kKCc6bGFzdCcrcHJlZml4VGhlQ2xhc3NOYW1lKCJyZW1vdmVpZmxhc3QiLHRydWUpKS5yZW1vdmUoKTskaW5Cb3guZmluZChwcmVmaXhUaGVDbGFzc05hbWUoInNwbGl0Iix0cnVlKSkuZmluZCgiOmZpcnN0IitwcmVmaXhUaGVDbGFzc05hbWUoInJlbW92ZWlmZmlyc3QiLHRydWUpKS5yZW1vdmUoKTskaW5Cb3guZmluZChwcmVmaXhUaGVDbGFzc05hbWUoInNwbGl0Iix0cnVlKSkuZmluZCgnOmxhc3QnK3ByZWZpeFRoZUNsYXNzTmFtZSgicmVtb3ZlaWZsYXN0Iix0cnVlKSkucmVtb3ZlKCk7JGluQm94LmRhdGEoImNvbHVtbml6aW5nIixmYWxzZSk7aWYob3B0aW9ucy5vdmVyZmxvdyl7b3B0aW9ucy5vdmVyZmxvdy5kb25lRnVuYygpO30Kb3B0aW9ucy5kb25lRnVuYygpO319KTt9OyQuZm4ucmVudW1iZXJCeUpTPWZ1bmN0aW9uKCRzZWFyY2hUYWcsJGNvbG5vLCR0YXJnZXRJZCwkdGFyZ2V0Q2xhc3Mpe3RoaXMuc2V0TGlzdD1mdW5jdGlvbigkY29scywkbGlzdCwkdGFnMSl7dmFyICRwYXJlbnRzPXRoaXMuYmVmb3JlLnBhcmVudHMoKTt2YXIgJHJlc3Q7JHJlc3Q9JCgkY29sc1t0aGlzLm9mZnNldC0xXSkuZmluZCgnPionKTtpZigoJHJlc3QubGFzdCgpKVswXS50YWdOYW1lIT0kdGFnMS50b1VwcGVyQ2FzZSgpKXtpZih0aGlzLmRlYnVnKXtjb25zb2xlLmRlYnVnKCJMYXN0IGl0ZW0gaW4gcHJldmlvdXMgY29sdW1uLCBpc24ndCBhIGxpc3QuLi4iKTt9CnJldHVybiAwO30KJHJlc3Q9JHJlc3QubGVuZ3RoO3ZhciAkdGludD0xO2lmKHRoaXMubGFzdE90aGVyPD0wKXskdGludD10aGlzLmJlZm9yZS5jaGlsZHJlbigpLmxlbmd0aCsxO31lbHNleyR0aW50PSQoJHBhcmVudHNbdGhpcy5sYXN0T3RoZXJdKS5jaGlsZHJlbigpLmxlbmd0aCsxO30KaWYoJCgkY29sc1t0aGlzLm9mZnNldF0pLmZpbmQoJHRhZzErJzpmaXJzdCBsaS5zcGxpdCcpLmxlbmd0aCl7dmFyICR3aGVyZUVsaXBzaXM9JCgkY29sc1t0aGlzLm9mZnNldC0xXSkuZmluZCgkdGFnMSsnOmxhc3QgbGk6bGFzdCcpO2lmKHRoaXMuZWxpcHNpc1RleHQ9PT0nJ3x8JCgkY29sc1t0aGlzLm9mZnNldC0xXSkuZmluZCgkdGFnMSsnOmxhc3QgfiBkaXYnKS5sZW5ndGh8fCQoJGNvbHNbdGhpcy5vZmZzZXQtMV0pLmZpbmQoJHRhZzErJzpsYXN0IH4gcCcpLmxlbmd0aCl7O31lbHNle2lmKCQoJHdoZXJlRWxpcHNpcykuZmluZCgndWwsIG9sLCBkbCcpLmxlbmd0aD09MCl7dmFyICR0eHQ9JHdoZXJlRWxpcHNpcy5sYXN0KCkudGV4dCgpO3ZhciAkbGVuPSR0eHQubGVuZ3RoO2lmKCR0eHQuc3Vic3RyaW5nKCRsZW4tMSk9PSc7Jyl7aWYoJHR4dC5zdWJzdHJpbmcoJGxlbi00KSE9dGhpcy5lbGlwc2lzVGV4dCsnOycpeyR0eHQ9JHR4dC5zdWJzdHJpbmcoMCwkbGVuLTEpK3RoaXMuZWxpcHNpc1RleHQrJzsnO319ZWxzZXtpZigkdHh0LnN1YnN0cmluZygkbGVuLTMpIT10aGlzLmVsaXBzaXNUZXh0KXskdHh0Kz10aGlzLmVsaXBzaXNUZXh0O319CiR3aGVyZUVsaXBzaXMubGFzdCgpLnRleHQoJHR4dCk7fX0KaWYoJCgkY29sc1t0aGlzLm9mZnNldF0pLmZpbmQoJHRhZzErJzpmaXJzdCA+bGkuc3BsaXQgPicrJHRhZzEpLmxlbmd0aD09MCl7JHRpbnQtLTt9fQppZigkcmVzdD09MSl7JHRpbnQrPXRoaXMucHJldk1heDt9CmlmKHRoaXMubmVzdD4xKXtpZih0aGlzLmRlYnVnKXtjb25zb2xlLmRlYnVnKCJTdXBwb3NlZCB0byBiZSBhIG5lc3RlZCBsaXN0Li4uZGVjciIpO30KJHRpbnQtLTt2YXIgJHR0PSQoJGNvbHNbdGhpcy5vZmZzZXQtMV0pLmZpbmQoJHRhZzErJzpmaXJzdCBsaS5zcGxpdDpmaXJzdCcpO2lmKCR0dC5sZW5ndGg+MCl7aWYodGhpcy5kZWJ1Zyl7Y29uc29sZS5kZWJ1ZygiUHJldmlvdXMgY29sdW1uIHN0YXJ0ZWQgd2l0aCBhIHNwbGl0IGl0ZW0sIHNvIHRoYXQgY291bnQgaXMgb25lIGxlc3MgdGhhbiBleHBlY3RlZCIpO30KJHRpbnQtLTt9CiR0dD0kKCRjb2xzW3RoaXMub2Zmc2V0XSkuZmluZCgkdGFnMSsnOmZpcnN0IGxpOmZpcnN0JykuY2xvbmUoKTskdHQuY2hpbGRyZW4oKS5yZW1vdmUoKTtpZigkLnRyaW0oJHR0LnRleHQoKSkubGVuZ3RoPjApe2lmKHRoaXMuZGVidWcpe2NvbnNvbGUuZGVidWcoIklmIHRoYXQgd2FzIGEgY29tcGxldGUgbGlzdCBpbiB0aGUgcHJldmlvdXMgY29sdW1uLCBkb24ndCBkZWNyLiIpO30KJHRpbnQrKztpZigkKCRjb2xzW3RoaXMub2Zmc2V0LTFdKS5maW5kKCI+IiskdGFnMSsnOmxhc3QgJykuY2hpbGRyZW4oKS5sZW5ndGg9PTApe2lmKHRoaXMuZGVidWcpe2NvbnNvbGUuZGVidWcoInVubGVzcyB0aGF0IHdhcyBlbXB0eSwgaW4gd2hpY2ggY2FzZSByZXZlcnQiKTt9CiR0aW50LS07fX19ZWxzZXt2YXIgJHR0PSQoJGNvbHNbdGhpcy5vZmZzZXRdKS5maW5kKCR0YWcxKyc6Zmlyc3QgbGk6Zmlyc3QgJyskdGFnMSsiLnNwbGl0IGxpLnNwbGl0Iik7aWYoJHR0Lmxlbmd0aD4wKXtpZih0aGlzLmRlYnVnKXtjb25zb2xlLmRlYnVnKCJbTmVzdGVkXSBDb2x1bW4gc3RhcnRlZCB3aXRoIGEgc3BsaXQgaXRlbSwgc28gdGhhdCBjb3VudCBpcyBvbmUgbGVzcyB0aGFuIGV4cGVjdGVkIik7fQokdGludC0tO319CmlmKHRoaXMuZGVidWcpe2NvbnNvbGUuZGVidWcoIlNldHRpbmcgdGhlIHN0YXJ0IHZhbHVlIHRvICIrJHRpbnQrIiAoIit0aGlzLnByZXZNYXgrIikiKTt9CmlmKCR0aW50PjApe2lmKHR5cGVvZiB0aGlzLnNldENvbHVtblN0YXJ0PT0nZnVuY3Rpb24nKXt0aGlzLnNldENvbHVtblN0YXJ0KCRsaXN0LCR0aW50KTt9ZWxzZXskbGlzdC5hdHRyKCdzdGFydCcsJHRpbnQpO319CnJldHVybiAwO30KaWYodHlwZW9mICR0YXJnZXRJZD09PSd1bmRlZmluZWQnKXskdGFyZ2V0SWQ9ZmFsc2U7fQppZih0eXBlb2YgJHRhcmdldENsYXNzPT09J3VuZGVmaW5lZCcpeyR0YXJnZXRDbGFzcz1mYWxzZTt9CmlmKCEkdGFyZ2V0SWQmJiEkdGFyZ2V0Q2xhc3Mpe3Rocm93InJlbnVtYmVyQnlKUygpOiBCYWQgcGFyYW0sIG11c3QgcGFzcyBhbiBpZCBvciBhIGNsYXNzIjt9CnZhciAkdGFyZ2V0PScnO3RoaXMucHJldk1heD0xO2lmKCR0YXJnZXRDbGFzcyl7JHRhcmdldD0iLiIrJHRhcmdldENsYXNzO31lbHNleyR0YXJnZXQ9IiMiKyR0YXJnZXRJZDt9CnZhciAkdGFnMT0kc2VhcmNoVGFnLnRvTG93ZXJDYXNlKCk7dmFyICR0YWcyPSRzZWFyY2hUYWcudG9VcHBlckNhc2UoKTt0aGlzLmNvbHM9JCgkdGFyZ2V0KTtpZih0aGlzLmRlYnVnKXtjb25zb2xlLmRlYnVnKCJUaGVyZSBhcmUgIit0aGlzLmNvbHMubGVuZ3RoKyIgaXRlbXMsIGxvb2tpbmcgZm9yICIrJHRhZzEpO30KdGhpcy5iZWZvcmU9JCh0aGlzLmNvbHNbMF0pLmZpbmQoJHRhZzErJzpsYXN0Jyk7dGhpcy5wcmV2TWF4PXRoaXMuYmVmb3JlLmNoaWxkcmVuKCkubGVuZ3RoO2Zvcih0aGlzLm9mZnNldD0xO3RoaXMub2Zmc2V0PHRoaXMuY29scy5sZW5ndGg7dGhpcy5vZmZzZXQrKyl7aWYodGhpcy5kZWJ1Zyl7Y29uc29sZS5kZWJ1ZygiaXRlcmF0aW5nICIrdGhpcy5vZmZzZXQrIi4uLltvZiAiK3RoaXMuY29scy5sZW5ndGgrIl0iKTt9CmlmKHRoaXMub2Zmc2V0JSRjb2xubz09MCl7aWYodGhpcy5kZWJ1Zyl7Y29uc29sZS5kZWJ1ZygiRmlyc3QgY29sdW1uIChpbiB0aGVvcnkuLikiKTt9CnRoaXMucHJldk1heD0xO2NvbnRpbnVlO30KdGhpcy5iZWZvcmU9JCh0aGlzLmNvbHNbdGhpcy5vZmZzZXQtMV0pLmZpbmQoJHRhZzErJzpsYXN0Jyk7aWYodGhpcy5iZWZvcmUubGVuZ3RoKXtpZih0aGlzLmRlYnVnKXtjb25zb2xlLmRlYnVnKCJIYXZlIHNvbWUgIiskc2VhcmNoVGFnKyIgZWxlbWVudHMgaW4gdGhlIHByZXZpb3VzIGNvbHVtbiIpO30KdmFyICRsaXN0PSQodGhpcy5jb2xzW3RoaXMub2Zmc2V0XSkuZmluZCgkdGFnMSsnOmZpcnN0Jyk7dmFyICRmaXJzdD0kKHRoaXMuY29sc1t0aGlzLm9mZnNldF0pLmZpbmQoJyo6Zmlyc3QnKTtpZigkZmlyc3RbMF0hPT0kbGlzdFswXSl7Y29udGludWU7fQp2YXIgJHBhcmVudHM9dGhpcy5iZWZvcmUucGFyZW50cygpO3RoaXMubGFzdE90aGVyPTA7dmFyICRmb3VuZD1mYWxzZTtmb3IoO3RoaXMubGFzdE90aGVyPCRwYXJlbnRzLmxlbmd0aDt0aGlzLmxhc3RPdGhlcisrKXtpZigkcGFyZW50c1t0aGlzLmxhc3RPdGhlcl0udGFnTmFtZSE9JHRhZzImJiRwYXJlbnRzW3RoaXMubGFzdE90aGVyXS50YWdOYW1lIT0iTEkiKXskZm91bmQ9dHJ1ZTt0aGlzLmxhc3RPdGhlci0tO2JyZWFrO319CnRoaXMubmVzdD0xO2lmKCQodGhpcy5jb2xzW3RoaXMub2Zmc2V0XSkuZmluZCgiPiIrJHRhZzErJzpmaXJzdCBsaSAnKyR0YWcxKyI6Zmlyc3QiKS5sZW5ndGgpe3RoaXMubmVzdD0yO30KdGhpcy5zZXRMaXN0KHRoaXMuY29scywkbGlzdCwkdGFnMSk7dGhpcy5sYXN0T3RoZXItLTskbGlzdD0kKHRoaXMuY29sc1t0aGlzLm9mZnNldF0pLmZpbmQoJHRhZzErJzpmaXJzdCBsaSAnKyR0YWcxKyI6Zmlyc3QiKTtpZigkbGlzdC5sZW5ndGgpe3RoaXMuYmVmb3JlPSQodGhpcy5jb2xzW3RoaXMub2Zmc2V0LTFdKS5maW5kKCI+IiskdGFnMSsnOmxhc3QgbGkgJyskdGFnMSsiOmxhc3QiKTt0aGlzLnByZXZNYXg9MDt0aGlzLm5lc3Q9MTt0aGlzLnNldExpc3QodGhpcy5jb2xzLCRsaXN0LCR0YWcxKTt9CnZhciAkcmVzZXQ9JCh0aGlzLmNvbHNbdGhpcy5vZmZzZXQtMV0pLmZpbmQoIj4iKyR0YWcxKyc6bGFzdCcpO3RoaXMucHJldk1heD0kcmVzZXQuY2hpbGRyZW4oKS5sZW5ndGg7fX0KcmV0dXJuIDA7fTt9KShqUXVlcnkpOw=="; + exports.columnizerBase64 = columnizerBase64; +},2188,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ItemListAccessibility = exports.ItemAccessibilityFocused = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _indexLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _tapView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _AudioManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var ItemListAccessibility = function ItemListAccessibility(props) { + var style = props.style, + text = props.text, + _props$classes = props.classes, + classes = _props$classes === undefined ? [] : _props$classes, + focused = props.focused; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-index-text", "newsmemory-index-accessibility-text"].concat((0, _toConsumableArray2.default)(classes)) + }, _react.default.createElement(_fontText.default, { + style: [_indexLayoutManager.default.itemListAccessibility, style, focused ? _indexLayoutManager.default.itemListAccessibilityFocused : undefined], + numberOfLines: 1, + ellipsizeMode: "tail" + }, text)); + }; + + exports.ItemListAccessibility = ItemListAccessibility; + ItemListAccessibility.propTypes = { + style: _propTypes.default.any, + text: _propTypes.default.string, + classes: _propTypes.default.array, + focused: _propTypes.default.bool + }; + + var ItemAccessibilityFocused = function ItemAccessibilityFocused(props) { + var touchable = props.touchable, + focused = props.focused, + onPress = props.onPress, + accessibilityEnabled = props.accessibilityEnabled, + accessibilityLabel = props.accessibilityLabel, + style = props.style, + children = props.children, + enablePause = props.enablePause, + rest = (0, _objectWithoutProperties2.default)(props, ["touchable", "focused", "onPress", "accessibilityEnabled", "accessibilityLabel", "style", "children", "enablePause"]); + + if (!accessibilityLabel) { + return null; + } + + var _useState = (0, _react.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + simulateAccessibility = _useState2[0], + setSimulateAccessibility = _useState2[1]; + + var accessibilityKey = _$$_REQUIRE(_dependencyMap[14]).StringUtils.getMd5(accessibilityLabel); + + var Component = _reactNative.View; + var parentProps = {}; + var componentProps = (0, _extends2.default)({ + accessibilityLabel: accessibilityLabel, + style: [style] + }, rest); + + var onSimulateAccessibility = function onSimulateAccessibility() { + if (accessibilityLabel) { + var mgr = global.getAudio(); + + if (enablePause) { + if (mgr.ttsIsPaused()) { + mgr.ttsResume(); + } else if (mgr.ttsIsSpeaking()) { + mgr.ttsPause(); + } else { + mgr.ttsStart(accessibilityLabel); + } + } else { + mgr.ttsStart(accessibilityLabel); + } + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.emit(_events.default.ON_SIMULATE_ACCESSIBILITY_CHANGE, { + key: accessibilityKey + }); + + setSimulateAccessibility(true); + } + }; + + if (accessibilityEnabled && !_$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isSystemAccessibilityEnabled()) { + Component = _tapView.default; + parentProps.onSingleTap = onSimulateAccessibility; + parentProps.onDoubleTap = onPress; + + if (simulateAccessibility) { + componentProps.style.push(_indexLayoutManager.default.itemListAccessibilitySimulated); + } + } else if (accessibilityEnabled || touchable) { + Component = _reactNative.TouchableOpacity; + parentProps.onPress = onPress; + } + + var ref = _react.default.useRef(null); + + _react.default.useEffect(function () { + var onSimulateAccessibilityChange; + + if (_$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isSystemAccessibilityEnabled()) { + if (ref.current && focused) { + var tag = (0, _reactNative.findNodeHandle)(ref.current); + + if (tag) { + _reactNative.AccessibilityInfo.setAccessibilityFocus(tag); + } + } + } else { + if (focused) { + onSimulateAccessibility(); + } + + onSimulateAccessibilityChange = _$$_REQUIRE(_dependencyMap[15]).EventRegister.on(_events.default.ON_SIMULATE_ACCESSIBILITY_CHANGE, function (_ref) { + var key = _ref.key; + + if (key !== accessibilityKey) { + setSimulateAccessibility(false); + } + }); + } + + return function () { + if (onSimulateAccessibilityChange) { + _$$_REQUIRE(_dependencyMap[15]).EventRegister.rm(onSimulateAccessibilityChange); + } + }; + }, [focused, ref.current]); + + return _react.default.createElement(Component, (0, _extends2.default)({ + ref: ref + }, parentProps, { + style: { + flex: 1 + } + }), _react.default.createElement(_reactNative.View, componentProps, children)); + }; + + exports.ItemAccessibilityFocused = ItemAccessibilityFocused; + ItemAccessibilityFocused.defaultProps = { + enablePause: false + }; + ItemAccessibilityFocused.propTypes = { + touchable: _propTypes.default.bool, + enablePause: _propTypes.default.bool, + focused: _propTypes.default.bool, + accessibilityEnabled: _propTypes.default.bool, + accessibilityLabel: _propTypes.default.string, + style: _propTypes.default.any, + onPress: _propTypes.default.func, + children: _propTypes.default.any + }; +},2189,[5,6,41,108,21,17,201,28,1879,2190,2163,460,1994,699,462,572]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.LINE_VERTICAL_PADDING = exports.LINE_HORIZONTAL_PADDING = exports.LINE_PADDING = exports.BTN_IMAGE_HEIGHT = exports.TITLE_SIZE = exports.LINE_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + exports.LINE_HEIGHT = _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_HEIGHT; + exports.TITLE_SIZE = _$$_REQUIRE(_dependencyMap[1]).LIST_TITLE_SIZE; + exports.BTN_IMAGE_HEIGHT = _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE; + exports.LINE_PADDING = _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING; + exports.LINE_HORIZONTAL_PADDING = _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING; + var LINE_VERTICAL_PADDING = _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING + 5; + exports.LINE_VERTICAL_PADDING = LINE_VERTICAL_PADDING; + + var _default = _reactNative.StyleSheet.create({ + itemListAccessibilitySimulated: { + borderColor: _$$_REQUIRE(_dependencyMap[2]).colors.md_light_green_A700, + borderWidth: 2 + }, + itemListAccessibility: { + flex: 1, + fontSize: _$$_REQUIRE(_dependencyMap[1]).LIST_TITLE_SIZE, + color: _$$_REQUIRE(_dependencyMap[2]).colors.md_blue_600 + }, + itemListAccessibilityFocused: { + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.keyboardHighlight + }, + firstLevelItem: { + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center" + }, + firstLevelItemFocused: { + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.keyboardHighlight + }, + firstLevelItemSection: { + start: 0, + flex: 8, + fontSize: _$$_REQUIRE(_dependencyMap[1]).LIST_TITLE_SIZE, + paddingHorizontal: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + paddingVertical: LINE_VERTICAL_PADDING + }, + firstLevelItemPage: { + fontSize: _$$_REQUIRE(_dependencyMap[1]).INFO_SIZE, + minWidth: 30, + textAlign: "right", + textDecorationLine: "underline", + paddingHorizontal: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + paddingVertical: LINE_VERTICAL_PADDING + }, + firstLevelItemPageAccessibility: { + textDecorationLine: "none" + }, + secondLevelHeaderParent: { + padding: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + justifyContent: "center" + }, + secondLevelHeader: { + fontSize: 18 + }, + secondLevelThumbLine: { + flexDirection: "row", + justifyContent: "flex-start" + }, + secondLevelItem: { + flex: 1, + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center", + paddingHorizontal: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + paddingVertical: LINE_VERTICAL_PADDING + }, + secondLevelItemFocused: { + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.keyboardHighlight + }, + secondLevelItemPage: { + start: 0, + fontSize: _$$_REQUIRE(_dependencyMap[1]).PAGE_SIZE, + color: _$$_REQUIRE(_dependencyMap[2]).colors.md_red_900, + textDecorationLine: "underline" + }, + secondLevelItemPageAccessibility: { + color: _$$_REQUIRE(_dependencyMap[2]).colors.black, + textDecorationLine: "none" + }, + secondLevelItemBullet: { + fontSize: _$$_REQUIRE(_dependencyMap[1]).LIST_TITLE_SIZE + }, + firstLevelItemAccessibility: { + paddingHorizontal: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + paddingVertical: LINE_VERTICAL_PADDING + }, + secondLevelItemAccessibility: {}, + secondLevelItemTitle: { + flex: 1, + fontSize: _$$_REQUIRE(_dependencyMap[1]).LIST_TITLE_SIZE + }, + secondLevelTouchable: { + paddingTop: LINE_VERTICAL_PADDING, + paddingLeft: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + marginRight: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + paddingBottom: LINE_VERTICAL_PADDING + }, + secondLevelImage: { + borderWidth: 0.5, + borderColor: _$$_REQUIRE(_dependencyMap[2]).colors.black + }, + container: { + flex: 1 + }, + centerContainer: { + flex: 7, + paddingTop: 1 + }, + specialContainer: { + flex: 3 + }, + parent: { + flexDirection: "row", + flex: 1 + } + }); + + exports.default = _default; +},2190,[28,729,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + progressContainer: { + height: 6 + }, + progressStyle: { + position: "absolute", + bottom: 0, + width: "100%" + }, + scrollViewText: { + flexGrow: 1 + }, + scrollViewTextContainer: { + flexGrow: 1, + justifyContent: "space-between" + } + }); + + exports.default = _default; +},2191,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _articleExtraComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DEFAULT_HEIGHT = 100; + var FLING_VELOCITY_UP = -100; + var FLING_VELOCITY_DOWN = 800; + var TOP_SPACE = 100; + + function Tab(props) { + var onPress = props.onPress, + expanded = props.expanded; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-extra-tab-parent"] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress, + style: _articleExtraComponent.default.tabParent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-extra-tab"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + type: _$$_REQUIRE(_dependencyMap[14]).TecnaviaIconType.MATERIAL_ICONS, + name: expanded ? "keyboard-arrow-down" : "keyboard-arrow-up", + style: _articleExtraComponent.default.tabIcon + })))); + } + + var ArticleExtra = function (_React$Component) { + (0, _inherits2.default)(ArticleExtra, _React$Component); + + var _super = _createSuper(ArticleExtra); + + function ArticleExtra(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleExtra); + _this = _super.call(this, props); + _this._scrollRef = _react.default.createRef(); + _this._panRef = _react.default.createRef(); + _this._webviewHeight = 0; + _this._animation = undefined; + _this._currentHeight = undefined; + _this._enableSwipeDown = true; + _this.state = { + content: "", + expanded: false + }; + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScroll = _this._onScroll.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPress = _this._onPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTabPress = _this._onTabPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanHandler = _this._onPanHandler.bind((0, _assertThisInitialized2.default)(_this)); + _this.onWebViewHeightChange = _this._onWebViewHeightChange.bind((0, _assertThisInitialized2.default)(_this)); + _this._height = _$$_REQUIRE(_dependencyMap[13]).Css.getStyleObjByCssClasses(["newsmemory-article-extra-container"]).height || DEFAULT_HEIGHT; + _this._currentHeight = _this._height; + _this._gradientStyle = _$$_REQUIRE(_dependencyMap[13]).Css.getStyleObjByCssClasses(["newsmemory-article-extra-gradient"]); + _this._gradientColor = _this._gradientStyle.color || "#ffffff"; + _this._gradientColors = _this._gradientStyle.colors; + _this._animatedHeight = new _reactNative.Animated.Value(_this._height); + return _this; + } + + (0, _createClass2.default)(ArticleExtra, [{ + key: "setContent", + value: function setContent(html) { + this.setState({ + content: html + }); + } + }, { + key: "hide", + value: function hide() { + this._toggleVisibility(false); + } + }, { + key: "show", + value: function show() { + this._toggleVisibility(true); + } + }, { + key: "_onMessage", + value: function _onMessage(data) { + var type = data.type, + content = data.content; + var onOpenGallery = this.props.onOpenGallery; + var expanded = this.state.expanded; + + if (type === "OPEN_GALLERY" && typeof onOpenGallery === "function" && expanded) { + onOpenGallery(content); + } + } + }, { + key: "_onPress", + value: function _onPress() { + var onPress = this.props.onPress; + + if (typeof onPress === "function") { + onPress(); + } + } + }, { + key: "_onLayout", + value: function _onLayout(e) { + var onLayout = this.props.onLayout; + + if (typeof onLayout === "function") { + onLayout(e); + } + } + }, { + key: "_onScroll", + value: function _onScroll(_ref) { + var nativeEvent = _ref.nativeEvent; + var contentOffset = nativeEvent.contentOffset; + this._enableSwipeDown = contentOffset.y < 5; + } + }, { + key: "_onPanHandler", + value: function _onPanHandler(event) { + var _event$nativeEvent = event.nativeEvent, + state = _event$nativeEvent.state, + velocityY = _event$nativeEvent.velocityY; + + if (state === _$$_REQUIRE(_dependencyMap[15]).State.ACTIVE) { + if (velocityY < FLING_VELOCITY_UP) { + this._expandCollapseAnimation(true); + } else if (velocityY > FLING_VELOCITY_DOWN && this._enableSwipeDown) { + this._expandCollapseAnimation(false); + } + } + } + }, { + key: "_onWebViewHeightChange", + value: function _onWebViewHeightChange(height) { + this._webviewHeight = height; + } + }, { + key: "_maxHeight", + value: function _maxHeight() { + var maxHeight = this.props.maxHeight; + return Math.min(this._webviewHeight + _articleExtraComponent.TAB_LINE_HEIGHT, maxHeight - TOP_SPACE); + } + }, { + key: "_onTabPress", + value: function _onTabPress() { + var expand = this._currentHeight <= this._height; + + this._updateViewsStates(expand ? this._maxHeight() : this._height, expand); + } + }, { + key: "_expandCollapseAnimation", + value: function _expandCollapseAnimation(expand) { + this._updateViewsStates(expand ? this._maxHeight() : this._height, expand); + } + }, { + key: "_toggleVisibility", + value: function _toggleVisibility(state) { + this._updateViewsStates(state ? this._height : 0, false); + } + }, { + key: "_updateViewsStates", + value: function _updateViewsStates(height, expand) { + return _regenerator.default.async(function _updateViewsStates$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!(this._currentHeight !== height)) { + _context.next = 7; + break; + } + + if (!expand) { + this._toggleScrollState(expand); + } + + _context.next = 4; + return _regenerator.default.awrap(this._animate(height)); + + case 4: + this._toggleMinDist(expand); + + if (expand) { + this._toggleScrollState(expand); + + this._triggerWebViewRender(); + } + + this.setState({ + expanded: expand + }); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_triggerWebViewRender", + value: function _triggerWebViewRender() { + if (_$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isIOS() && this._scrollRef && this._scrollRef.current) { + this._scrollRef.current.scrollTo({ + y: 1 + }); + } + } + }, { + key: "_toggleScrollState", + value: function _toggleScrollState(enableScroll) { + if (this._scrollRef && this._scrollRef.current) { + this._scrollRef.current.setNativeProps({ + scrollEnabled: enableScroll + }); + } + } + }, { + key: "_toggleMinDist", + value: function _toggleMinDist(enableScroll) { + if (this._panRef && this._panRef.current) { + var minDist = enableScroll ? 30 : 0; + + this._panRef.current.setNativeProps({ + minDist: minDist + }); + } + } + }, { + key: "_animate", + value: function _animate(destinationValue) { + var _this2 = this; + + return _regenerator.default.async(function _animate$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this._currentHeight = destinationValue; + + if (this._animation) { + this._animation.stop(); + + this._animation = undefined; + } + + this._animation = _reactNative.Animated.timing(this._animatedHeight, { + toValue: destinationValue, + duration: 300, + useNativeDriver: false + }); + return _context2.abrupt("return", new Promise(function (resolve) { + _this2._animation.start(function (_ref2) { + var finished = _ref2.finished; + + if (finished) { + _this2._animation = undefined; + resolve(); + } + }); + })); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "render", + value: function render() { + var _this$state = this.state, + content = _this$state.content, + expanded = _this$state.expanded; + + if (content) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-extra-container"] + }, _react.default.createElement(_reactNative.Animated.View, { + style: [_articleExtraComponent.default.container, { + height: this._animatedHeight + }], + onLayout: this.onLayout + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-extra-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _articleExtraComponent.default.parent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).PanGestureHandler, { + ref: this._panRef, + onHandlerStateChange: this.onPanHandler, + simultaneousHandlers: this._scrollRef + }, _react.default.createElement(_reactNative.View, { + style: _articleExtraComponent.default.view, + collapsable: false + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-extra-webview"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).TecnaviaGestureHandlerScrollview, { + ref: this._scrollRef, + simultaneousHandlers: this._panRef, + style: _articleExtraComponent.default.view, + scrollEnabled: false, + onScroll: this.onScroll + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[18]).AutoHeightWebView, { + startInLoadingState: _$$_REQUIRE(_dependencyMap[19]).BaseWebView.LoadingStatePosition.none, + source: { + html: content + }, + htmlContentId: "content", + onHeightChange: this.onWebViewHeightChange, + onMessage: this.onMessage + }))))))), _react.default.createElement(Tab, { + onPress: this.onTabPress, + expanded: expanded + }))); + } + + return null; + } + }]); + return ArticleExtra; + }(_react.default.Component); + + exports.default = ArticleExtra; + ArticleExtra.propsTypes = { + onPress: _propTypes.default.func, + onLayout: _propTypes.default.func, + onOpenGallery: _propTypes.default.func, + maxHeight: _propTypes.default.number.isRequired + }; +},2192,[5,80,7,8,15,12,14,16,17,201,28,2193,1970,699,1806,1,462,1909,1901,1894]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.TAB_LINE_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var PARENT_ELEVATION = 1; + var TAB_ELEVATION = PARENT_ELEVATION; + var TAB_HEIGHT = 20; + var TAB_LINE_HEIGHT = 1; + exports.TAB_LINE_HEIGHT = TAB_LINE_HEIGHT; + var TOP = 10; + + var _default = _reactNative.StyleSheet.create({ + flex: { + flex: 1 + }, + container: { + position: "absolute", + bottom: 0, + start: 0, + end: 0 + }, + parent: { + flex: 1, + top: TOP, + overflow: "visible", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + borderTopWidth: TAB_LINE_HEIGHT, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + elevation: PARENT_ELEVATION + }, + view: { + flex: 1 + }, + webview: { + flex: 1 + }, + overlay: { + position: "absolute", + bottom: 0, + start: 0, + end: 0, + top: 0 + }, + gradient: { + flex: 1 + }, + tabParent: { + width: 50, + height: TAB_HEIGHT, + borderRadius: 50, + position: "absolute", + top: 0.5, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + justifyContent: "center", + alignItems: "center", + alignSelf: "center", + zIndex: TAB_ELEVATION, + elevation: TAB_ELEVATION + }, + tabIcon: { + color: "white", + fontSize: 20 + }, + tab: { + width: 25, + height: TAB_LINE_HEIGHT, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.default = _default; +},2193,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _zoomConstants = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var styles = _reactNative.StyleSheet.create({ + container: { + flex: 1 + } + }); + + function ArticleFling(props) { + var children = props.children, + onSwipeUp = props.onSwipeUp, + onSwipeDown = props.onSwipeDown, + onSwipeLeft = props.onSwipeLeft, + onSwipeRight = props.onSwipeRight; + + var onGestureEvent = function onGestureEvent(_ref) { + var nativeEvent = _ref.nativeEvent; + var velocityY = nativeEvent.velocityY, + velocityX = nativeEvent.velocityX, + state = nativeEvent.state; + + if (state === _$$_REQUIRE(_dependencyMap[5]).State.ACTIVE) { + if (Math.abs(velocityY) > _zoomConstants.default.constants.VIEW_PAGER_VELOCITY_1PAGE) { + if (velocityY < 0 && typeof onSwipeDown === "function") { + onSwipeDown(); + } else if (velocityY > 0 && typeof onSwipeUp === "function") { + onSwipeUp(); + } + } else if (Math.abs(velocityX) > _zoomConstants.default.constants.VIEW_PAGER_VELOCITY_1PAGE) { + if (velocityX > 0 && typeof onSwipeLeft === "function") { + onSwipeLeft(); + } else if (velocityX < 0 && typeof onSwipeRight === "function") { + onSwipeRight(); + } + } + } + }; + + if (_$$_REQUIRE(_dependencyMap[6]).PlatformUtils.isEInk()) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).PanGestureHandler, { + minDist: 100, + avgTouches: true, + onHandlerStateChange: onGestureEvent, + onGestureEvent: onGestureEvent + }, _react.default.createElement(_reactNative.Animated.View, { + collapsable: false, + style: styles.container + }, children)); + } + + return children; + } + + ArticleFling.propTypes = { + children: _propTypes.default.any, + onSwipeDown: _propTypes.default.func, + onSwipeUp: _propTypes.default.func, + onSwipeLeft: _propTypes.default.func, + onSwipeRight: _propTypes.default.func + }; + ArticleFling.defaultProps = {}; + var _default = ArticleFling; + exports.default = _default; +},2194,[5,17,201,28,2165,1,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.footer = exports.hr = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _headerParentComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _ApplicationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var hr = function hr(style, cssClass) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["newsmemory-separator", cssClass] + }, _react.default.createElement(_reactNative.View, { + style: [_headerParentComponent.default.hr, style] + })); + }; + + exports.hr = hr; + + var footer = function footer(items, config, onRef) { + var otherProps = {}; + + if (typeof onRef === "function") { + otherProps.ref = onRef; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["newsmemory-copyright-footer"] + }, _react.default.createElement(_reactNative.View, (0, _extends2.default)({ + style: _headerParentComponent.default.footerParent + }, otherProps), hr({ + backgroundColor: config.getColor(), + height: config.getHeight() + }, "newsmemory-article-footer-separator"), items.map(function (_ref, index) { + var text = _ref.text, + url = _ref.url; + + if (text && text.trim() && url && url.trim()) { + var result = _$$_REQUIRE(_dependencyMap[18]).StringUtils.extractLinkAndTextFromFooterTag(text); + + var newUrl = url; + var newText = text; + + if (result && result.matched) { + newText = text.replace(result.matched, result.text); + newUrl = result.url; + } + + var style = [_headerParentComponent.default.footerText]; + + if (_$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isTablet()) { + style.push(_headerParentComponent.default.footerTextTablet); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["newsmemory-text", "newsmemory-copyright-text"], + key: index + }, _react.default.createElement(_fontText.default, { + accessibilityRole: "link", + style: style, + onPress: function onPress() { + _tecnaviaPlatformUtils.default.openURL(newUrl); + } + }, _$$_REQUIRE(_dependencyMap[18]).StringUtils.decodeHTML(newText))); + } + + return null; + }))); + }; + + exports.footer = footer; + + var HeaderParent = function (_React$Component) { + (0, _inherits2.default)(HeaderParent, _React$Component); + + var _super = _createSuper(HeaderParent); + + function HeaderParent() { + (0, _classCallCheck2.default)(this, HeaderParent); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(HeaderParent, [{ + key: "_getComponentHeader", + value: function _getComponentHeader() { + var _this$props = this.props, + model = _this$props.model, + edition = _this$props.edition, + onLogoPress = _this$props.onLogoPress; + return _react.default.createElement(_reactNative.View, { + style: _headerParentComponent.default.header + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css, { + classes: ["newsmemory-header-logo"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).EPaperLogo, { + logo: model.getLogo(), + getDefaultLogoUrl: function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _ApplicationManager.default.getLogoPath(edition.getEdition())); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }, + onPress: onLogoPress, + parentHeight: _headerParentComponent.LINE_HEIGHT + }))); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + onLogoPress = _this$props2.onLogoPress, + edition = _this$props2.edition, + header = _this$props2.header, + headerTopLine = _this$props2.headerTopLine, + model = _this$props2.model, + children = _this$props2.children, + rest = (0, _objectWithoutProperties2.default)(_this$props2, ["onLogoPress", "edition", "header", "headerTopLine", "model", "children"]); + + if (model) { + var config = model.getHrTop(); + return _react.default.createElement(_reactNative.View, (0, _extends2.default)({ + style: _headerParentComponent.default.container + }, rest), headerTopLine && header ? hr({ + backgroundColor: config.getColor(), + height: config.getHeight() + }, "newsmemory-article-header-logo-top-separator") : null, header ? this._getComponentHeader() : null, header ? hr({ + backgroundColor: config.getColor(), + height: config.getHeight() + }, "newsmemory-article-header-logo-bottom-separator") : null, children); + } + + return null; + } + }]); + return HeaderParent; + }(_react.default.Component); + + exports.default = HeaderParent; + HeaderParent.propTypes = { + edition: _propTypes.default.instanceOf(_Edition.default).isRequired, + model: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[20]).Header).isRequired, + header: _propTypes.default.bool, + headerTopLine: _propTypes.default.bool, + onLogoPress: _propTypes.default.func, + children: _propTypes.default.any + }; + HeaderParent.defaultProps = { + header: false + }; +},2195,[5,80,108,7,8,12,14,16,6,17,201,28,2196,1879,602,644,1876,699,462,2197,1853]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.LINE_PADDING = exports.BTN_IMAGE_HEIGHT = exports.TITLE_SIZE = exports.LINE_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + exports.LINE_HEIGHT = _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_HEIGHT; + exports.TITLE_SIZE = _$$_REQUIRE(_dependencyMap[1]).LIST_TITLE_SIZE; + exports.BTN_IMAGE_HEIGHT = _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE; + exports.LINE_PADDING = _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING; + + var _default = _reactNative.StyleSheet.create({ + container: { + flex: 1, + flexDirection: "column", + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.transparent + }, + header: { + height: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_HEIGHT, + flexDirection: "row" + }, + closeParent: { + height: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_HEIGHT, + width: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_HEIGHT, + padding: (_$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_HEIGHT - _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE) / 2 + }, + close: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE, + width: _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE + }, + hr: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_HR_SIZE + }, + footerParent: {}, + footer: { + flexDirection: "column", + justifyContent: "center" + }, + footerText: { + padding: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_PADDING, + fontSize: _$$_REQUIRE(_dependencyMap[1]).FOOTER_FONT_SIZE, + color: _$$_REQUIRE(_dependencyMap[2]).colors.md_blue_600, + marginHorizontal: 5 + }, + footerTextTablet: { + marginHorizontal: 15 + } + }); + + exports.default = _default; +},2196,[28,729,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EPaperLogo = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _alignImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _epaperLogoComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EPaperLogo = function (_React$Component) { + (0, _inherits2.default)(EPaperLogo, _React$Component); + + var _super = _createSuper(EPaperLogo); + + function EPaperLogo(props) { + var _this; + + (0, _classCallCheck2.default)(this, EPaperLogo); + _this = _super.call(this, props); + _this.state = { + ready: props.logo ? _$$_REQUIRE(_dependencyMap[12]).StringUtils.isUrl(props.logo.getUrl()) : false, + url: props.logo ? props.logo.getUrl() : "" + }; + return _this; + } + + (0, _createClass2.default)(EPaperLogo, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this$state, ready, url, getDefaultLogoUrl, toLoad, error; + + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _this$state = this.state, ready = _this$state.ready, url = _this$state.url; + getDefaultLogoUrl = this.props.getDefaultLogoUrl; + + if (ready) { + _context.next = 15; + break; + } + + toLoad = url; + error = false; + _context.prev = 5; + _context.next = 8; + return _regenerator.default.awrap(getDefaultLogoUrl()); + + case 8: + toLoad = _context.sent; + _context.next = 14; + break; + + case 11: + _context.prev = 11; + _context.t0 = _context["catch"](5); + error = true; + + case 14: + this.setState({ + ready: !error, + url: toLoad + }); + + case 15: + case "end": + return _context.stop(); + } + } + }, null, this, [[5, 11]], Promise); + } + }, { + key: "render", + value: function render() { + var logo = this.props.logo; + var _this$props = this.props, + _onPress = _this$props.onPress, + padding = _this$props.padding, + parentHeight = _this$props.parentHeight, + logoHeight = _this$props.logoHeight, + style = _this$props.style; + var _this$state2 = this.state, + ready = _this$state2.ready, + url = _this$state2.url; + + if (ready) { + var alignment = "flex-start"; + + if (logo) { + if (logo.getAlignment() === "center") { + alignment = "center"; + } else if (logo.getAlignment() === "left") { + alignment = "flex-start"; + } else { + alignment = "flex-end"; + } + } + + return _react.default.createElement(_reactNative.TouchableOpacity, { + style: [_epaperLogoComponent.default.logoParent, { + height: parentHeight, + padding: padding, + justifyContent: alignment + }, style], + onPress: function onPress() { + if (typeof _onPress === "function" && logo) { + _onPress(logo.getAction()); + } + } + }, _react.default.createElement(_alignImageComponent.default, { + style: [_epaperLogoComponent.default.logo, { + height: logoHeight + }], + source: { + uri: url + } + })); + } + + return null; + } + }]); + return EPaperLogo; + }(_react.default.Component); + + exports.EPaperLogo = EPaperLogo; + EPaperLogo.propTypes = { + logo: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[13]).Logo), + getDefaultLogoUrl: _propTypes.default.func.isRequired, + onPress: _propTypes.default.func, + padding: _propTypes.default.number, + parentHeight: _propTypes.default.number, + logoHeight: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), + style: _propTypes.default.any + }; + EPaperLogo.defaultProps = { + padding: 3, + parentHeight: _$$_REQUIRE(_dependencyMap[14]).LOGO_PARENT_HEIGHT, + logoHeight: _$$_REQUIRE(_dependencyMap[14]).LOGO_HEIGHT, + style: undefined + }; +},2197,[5,80,7,8,12,14,16,17,201,28,2198,2199,462,1854,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _imageComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AlignImage = function (_React$Component) { + (0, _inherits2.default)(AlignImage, _React$Component); + + var _super = _createSuper(AlignImage); + + function AlignImage(props) { + var _this; + + (0, _classCallCheck2.default)(this, AlignImage); + _this = _super.call(this, props); + _this.state = { + imageWidth: 0, + imageHeight: 0, + viewWidth: 0, + viewHeight: 0, + loading: true, + error: false + }; + _this.computed = false; + return _this; + } + + (0, _createClass2.default)(AlignImage, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this._mounted = true; + (0, _imageComponent.getSize)(this._getSourceForSize(), function (width, height) { + if (_this2._mounted) { + _this2.setState({ + imageWidth: width, + imageHeight: height, + loading: false + }); + } + }, function () { + _this2.setState({ + error: true + }); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._mounted = false; + } + }, { + key: "_getSourceForSize", + value: function _getSourceForSize() { + var source = this.props.source; + return typeof source === "object" ? source.uri : source; + } + }, { + key: "_getCorrectViewSize", + value: function _getCorrectViewSize() { + var _this$state = this.state, + imageWidth = _this$state.imageWidth, + imageHeight = _this$state.imageHeight, + viewWidth = _this$state.viewWidth, + viewHeight = _this$state.viewHeight; + + if (this._hasSize()) { + var scale = Math.min(viewHeight / imageHeight, viewWidth / imageWidth); + var height = Math.floor(imageHeight * scale); + var width = Math.floor(imageWidth * scale); + this.computed = true; + return { + flex: 0, + width: width, + height: height + }; + } + + return {}; + } + }, { + key: "_hasSize", + value: function _hasSize() { + var _this$state2 = this.state, + imageWidth = _this$state2.imageWidth, + imageHeight = _this$state2.imageHeight, + viewWidth = _this$state2.viewWidth, + viewHeight = _this$state2.viewHeight; + return imageWidth && imageHeight && viewWidth && viewHeight; + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$state3 = this.state, + loading = _this$state3.loading, + error = _this$state3.error; + var _this$props = this.props, + style = _this$props.style, + source = _this$props.source, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["style", "source"]); + return loading || error ? null : _react.default.createElement(_imageComponent.default, (0, _extends2.default)({}, rest, { + source: this._hasSize() ? source : {}, + onLayout: function onLayout(_ref) { + var nativeEvent = _ref.nativeEvent; + + if (_this3._mounted && !_this3.computed) { + _this3.setState({ + viewWidth: nativeEvent.layout.width, + viewHeight: nativeEvent.layout.height + }); + } + }, + style: [style, this._getCorrectViewSize()], + resizeMode: "contain" + })); + } + }]); + return AlignImage; + }(_react.default.Component); + + exports.default = AlignImage; + AlignImage.propTypes = { + style: _propTypes.default.any, + source: _propTypes.default.any + }; +},2198,[5,6,108,7,8,12,14,16,17,201,588]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + logoParent: { + flex: 1, + height: _$$_REQUIRE(_dependencyMap[1]).LOGO_PARENT_HEIGHT, + flexDirection: "row", + alignItems: "center", + padding: 6 + }, + logo: { + flex: 1, + height: _$$_REQUIRE(_dependencyMap[1]).LOGO_HEIGHT + } + }); + + exports.default = _default; +},2199,[28,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = exports.BUTTON_SIZE_IOS_PHONE = exports.BUTTON_SIZE = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var BUTTON_CONTENT = 40; + var BUTTON_CONTENT_IOS_PHONE = 30; + var BUTTON_MARGIN = 5; + var BUTTON_SIZE = 50; + exports.BUTTON_SIZE = BUTTON_SIZE; + var BUTTON_SIZE_IOS_PHONE = 40; + exports.BUTTON_SIZE_IOS_PHONE = BUTTON_SIZE_IOS_PHONE; + + var styles = _reactNative.StyleSheet.create({ + headerTitle: { + position: "absolute", + top: 0, + start: 0, + bottom: 0, + end: 0, + width: null, + height: null + }, + headerLogoParent: { + flex: 1, + flexDirection: "column", + justifyContent: "center", + alignItems: "center" + }, + placeHolder: { + marginHorizontal: BUTTON_MARGIN, + width: BUTTON_CONTENT, + height: BUTTON_CONTENT + }, + placeHolderIphone: { + width: BUTTON_CONTENT_IOS_PHONE, + height: BUTTON_CONTENT_IOS_PHONE + }, + container: { + alignItems: "flex-start", + flexDirection: "row" + }, + menuButton: { + alignItems: "center", + justifyContent: "center", + width: 60, + height: BUTTON_CONTENT, + borderRadius: 100, + marginStart: -20, + marginEnd: BUTTON_MARGIN + }, + menuButtonIphone: { + height: BUTTON_CONTENT_IOS_PHONE + }, + menuIcon: { + fontSize: 24, + marginEnd: 0, + marginStart: 10, + marginRight: 0 + }, + menuIconIphone: { + fontSize: 16 + }, + icon: { + fontSize: 24, + marginEnd: 0, + marginStart: 0, + marginRight: 0, + marginLeft: 0 + }, + iconIphone: { + fontSize: 16 + }, + button: { + alignItems: "center", + justifyContent: "center", + width: BUTTON_CONTENT, + height: BUTTON_CONTENT, + borderRadius: 20, + marginEnd: BUTTON_MARGIN, + marginStart: BUTTON_MARGIN + }, + buttonIphone: { + width: BUTTON_CONTENT_IOS_PHONE, + height: BUTTON_CONTENT_IOS_PHONE + }, + customActionBarButton: { + width: 130, + height: 35, + flexDirection: "row", + justifyContent: "space-between", + borderRadius: 25, + margin: 5, + paddingHorizontal: 10, + paddingVertical: 5 + }, + customActionBarButtonText: { + flex: 1, + alignSelf: "center", + textAlign: "right", + textTransform: "uppercase", + fontSize: 12, + fontWeight: "bold", + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.styles = styles; +},2200,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.HeaderButton = HeaderButton; + exports.LogoImage = LogoImage; + exports.DrawerButton = DrawerButton; + exports.HomeButton = HomeButton; + exports.SearchButton = SearchButton; + exports.LayoutButton = LayoutButton; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _ApplicationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _buttonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function HeaderButton(props) { + var parentStyle = props.parentStyle, + style = props.style, + cssClasses = props.cssClasses, + name = props.name, + type = props.type, + onPress = props.onPress, + accessibilityLabel = props.accessibilityLabel; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["navigation-button"], + cssKey: name + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[13]).styles.container, + key: "btn_" + name + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["navigation-button-parent"], + cssKey: name + }, _react.default.createElement(_buttonComponent.default, { + style: parentStyle, + onPress: onPress, + accessibilityLabel: accessibilityLabel + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: cssClasses + }, _react.default.createElement(_iconComponent.default, { + name: name, + style: style, + type: type + })))))); + } + + function LogoImage(props) { + var _useState = (0, _react.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + error = _useState2[0], + setError = _useState2[1]; + + var _global$getRssIndex = global.getRssIndex(), + headerLogoURL = _global$getRssIndex.headerLogoURL; + + var epaperHeaderLogoURL = _ApplicationManager.default.getDefaultArticleTextBanner(); + + var url = _LiveConfig.default.isEpaperSide() ? epaperHeaderLogoURL : headerLogoURL; + var source; + + if (url && !error) { + source = { + uri: url + }; + } else { + source = _$$_REQUIRE(_dependencyMap[14]); + } + + var onError = (0, _react.useCallback)(function () { + if (!error) { + setError(true); + } + }, []); + return _react.default.createElement(_imageComponent.default, (0, _extends2.default)({ + resizeMode: "contain", + source: source + }, props, { + onError: onError + })); + } + + function DrawerButton(props) { + var _global$getRssIndex2 = global.getRssIndex(), + buttonBackgroundColor = _global$getRssIndex2.buttonBackgroundColor, + supportColor = _global$getRssIndex2.supportColor; + + var _props$backgroundColo = props.backgroundColor, + backgroundColor = _props$backgroundColo === undefined ? buttonBackgroundColor : _props$backgroundColo, + navigation = props.navigation; + var menuButtonStyle = []; + var menuIconStyle = []; + menuButtonStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.menuButton, { + backgroundColor: backgroundColor + }); + menuIconStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.menuIcon, { + color: supportColor + }); + + if (_$$_REQUIRE(_dependencyMap[15]).PlatformUtils.isiPhone()) { + menuButtonStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.menuButtonIphone); + menuIconStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.menuIconIphone); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["rss-drawer-button"] + }, _react.default.createElement(_buttonComponent.default, { + style: menuButtonStyle, + onPress: function onPress() { + if (_LiveConfig.default.isDrawerOpen()) { + _NavigationService.default.drawer.close(navigation); + } else { + _NavigationService.default.drawer.open(navigation); + } + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["rss-drawer-button-icon"] + }, _react.default.createElement(_iconComponent.default, { + name: "menu", + style: menuIconStyle, + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS + })))); + } + + function HomeButton(props) { + var _global$getRssIndex3 = global.getRssIndex(), + buttonBackgroundColor = _global$getRssIndex3.buttonBackgroundColor, + supportColor = _global$getRssIndex3.supportColor; + + var _props$backgroundColo2 = props.backgroundColor, + backgroundColor = _props$backgroundColo2 === undefined ? buttonBackgroundColor : _props$backgroundColo2, + navigation = props.navigation; + var buttonStyle = [_$$_REQUIRE(_dependencyMap[13]).styles.button, { + backgroundColor: backgroundColor + }]; + var iconStyle = [_$$_REQUIRE(_dependencyMap[13]).styles.icon, { + color: supportColor + }]; + + if (_$$_REQUIRE(_dependencyMap[15]).PlatformUtils.isiPhone()) { + buttonStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.buttonIphone); + iconStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.iconIphone); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["rss-home-button"] + }, _react.default.createElement(_buttonComponent.default, { + style: buttonStyle, + onPress: function onPress() { + _NavigationService.default.drawer.close(navigation); + + _navigationUtils.default.navigateToHome(navigation); + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["rss-home-button-icon"] + }, _react.default.createElement(_iconComponent.default, { + name: "home", + style: iconStyle, + type: _iconComponent.TecnaviaIconType.FONT_AWESOME + })))); + } + + function SearchButton(props) { + var _global$getRssIndex4 = global.getRssIndex(), + buttonBackgroundColor = _global$getRssIndex4.buttonBackgroundColor, + supportColor = _global$getRssIndex4.supportColor; + + var _props$backgroundColo3 = props.backgroundColor, + backgroundColor = _props$backgroundColo3 === undefined ? buttonBackgroundColor : _props$backgroundColo3, + navigation = props.navigation; + var buttonStyle = [_$$_REQUIRE(_dependencyMap[13]).styles.button, { + backgroundColor: backgroundColor + }]; + var iconStyle = [_$$_REQUIRE(_dependencyMap[13]).styles.icon, { + color: supportColor + }]; + + if (_$$_REQUIRE(_dependencyMap[15]).PlatformUtils.isiPhone()) { + buttonStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.buttonIphone); + iconStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.iconIphone); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["rss-search-button"] + }, _react.default.createElement(_buttonComponent.default, { + style: buttonStyle, + onPress: function onPress() { + _NavigationService.default.drawer.close(navigation); + + navigation.navigate({ + name: "search" + }); + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["rss-search-button-icon"] + }, _react.default.createElement(_iconComponent.default, { + name: "search", + style: iconStyle, + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS + })))); + } + + function LayoutButton(props) { + var buttonLayoutStyle = [_$$_REQUIRE(_dependencyMap[13]).styles.button]; + var iconLayoutStyle = [_$$_REQUIRE(_dependencyMap[13]).styles.icon]; + + if (_$$_REQUIRE(_dependencyMap[15]).PlatformUtils.isiPhone()) { + buttonLayoutStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.buttonIphone); + iconLayoutStyle.push(_$$_REQUIRE(_dependencyMap[13]).styles.iconIphone); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ToggleLayoutIcon, (0, _extends2.default)({ + iconStyle: iconLayoutStyle, + buttonStyle: buttonLayoutStyle + }, props)); + } +},2201,[5,6,41,17,28,1872,602,2045,1861,2202,1806,588,699,2200,2203,462,2204]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = TecnaviaButton; + exports.Circle = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var styles = _reactNative.StyleSheet.create({ + btn: { + width: "100%", + height: 50, + paddingHorizontal: 10, + borderWidth: 0.3, + borderColor: _$$_REQUIRE(_dependencyMap[6]).colors.transparent200, + borderRadius: 20, + alignItems: "center", + justifyContent: "space-evenly", + flexDirection: "row" + }, + text: { + flex: 1, + textAlign: "center", + color: _$$_REQUIRE(_dependencyMap[6]).colors.black + } + }); + + function TecnaviaButton(props) { + return _react.default.createElement(_reactNative.TouchableOpacity, props); + } + + function Button(props) { + var style = props.style, + onPress = props.onPress, + rest = (0, _objectWithoutProperties2.default)(props, ["style", "onPress"]); + + var foregroundColor = _$$_REQUIRE(_dependencyMap[7]).Css.getDefaultForegroundColor(); + + if (typeof onPress === "function") { + return _react.default.createElement(_reactNative.TouchableOpacity, (0, _extends2.default)({ + style: [styles.btn, { + borderColor: foregroundColor + }, style], + onPress: onPress + }, rest)); + } + + return _react.default.createElement(_reactNative.View, (0, _extends2.default)({ + style: [styles.btn, { + borderColor: foregroundColor + }, style] + }, rest)); + } + + function Text(props) { + var style = props.style, + rest = (0, _objectWithoutProperties2.default)(props, ["style"]); + + var foregroundColor = _$$_REQUIRE(_dependencyMap[7]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_fontText.default, (0, _extends2.default)({ + style: [styles.text, { + color: foregroundColor + }, style], + numberOfLines: 1, + adjustsFontSizeToFit: true + }, rest)); + } + + var Circle = { + Button: Button, + Text: Text + }; + exports.Circle = Circle; +},2202,[5,6,108,17,28,1879,462,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/navigation/img", + "width": 600, + "height": 75, + "scales": [1], + "hash": "d8e9e1553cdb3ab0c0388552b3f3102e", + "name": "text_banner", + "type": "png" + }); +},2203,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2204,[2205]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ToggleLayoutIcon = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _buttonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ToggleLayoutIcon = function (_React$Component) { + (0, _inherits2.default)(ToggleLayoutIcon, _React$Component); + + var _super = _createSuper(ToggleLayoutIcon); + + function ToggleLayoutIcon(props) { + var _this; + + (0, _classCallCheck2.default)(this, ToggleLayoutIcon); + _this = _super.call(this, props); + _this.state = { + layout: global.getUserSettings().layout + }; + _this.onSwapLayout = _this._swapLayout.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(ToggleLayoutIcon, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.toggleLayout = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.TOGGLE_LAYOUT, function () { + _this2.setState(function () { + return { + layout: global.getUserSettings().layout + }; + }); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.toggleLayout); + } + }, { + key: "_swapLayout", + value: function _swapLayout() { + var newLayout = global.getUserSettings().toggleLayout(); + this.setState(function () { + return { + layout: newLayout + }; + }); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + backgroundColor = _this$props.backgroundColor, + iconStyle = _this$props.iconStyle, + buttonStyle = _this$props.buttonStyle; + var layout = this.state.layout; + + var _global$getRssIndex = global.getRssIndex(), + buttonBackgroundColor = _global$getRssIndex.buttonBackgroundColor, + supportColor = _global$getRssIndex.supportColor; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["rss-layout-button"] + }, _react.default.createElement(_buttonComponent.default, { + style: [buttonStyle, { + backgroundColor: backgroundColor || buttonBackgroundColor + }], + onPress: this.onSwapLayout + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["rss-layout-button-icon"] + }, _react.default.createElement(_iconComponent.default, { + name: global.getUserSettings().nextLayout(layout).icon, + style: [iconStyle, { + color: supportColor + }], + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS + })))); + } + }]); + return ToggleLayoutIcon; + }(_react.default.Component); + + exports.ToggleLayoutIcon = ToggleLayoutIcon; + ToggleLayoutIcon.propTypes = { + iconStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.array, _propTypes.default.object]), + buttonStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.array, _propTypes.default.object]), + backgroundColor: _propTypes.default.string + }; +},2205,[5,7,8,15,12,14,16,17,201,460,1806,2202,572,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.performNavigation = performNavigation; + exports.default = DrawerNavigator; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _IndexHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Paywall = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _footerBarComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _barsComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _tabNavigator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var Drawer = _NavigationService.default.navigator.createDrawer(); + + function dispatchNavigationToParent(navigation, screen) { + var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + navigation.navigate(screen, params); + } + + var navigateDirectlyToFullScreen = function _callee(navigation, settings) { + var displayName, drawerItemKey, disableAds, items; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + displayName = settings.displayName, drawerItemKey = settings.drawerItemKey, disableAds = settings.disableAds; + _context.next = 3; + return _regenerator.default.awrap(_RssContentHelper.default.getArticlesByCategory(drawerItemKey, disableAds === "1")); + + case 3: + items = _context.sent; + + if (items && items.length) { + dispatchNavigationToParent(navigation, "ArticleScreen", { + items: items, + item: items[0], + settings: settings + }); + } else { + _$$_REQUIRE(_dependencyMap[20]).Toast.show(global.strings("msg_empty_category", { + category: displayName + }), { + position: "top" + }); + } + + case 5: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + function ScreenComponent(props) { + var item = props.item; + + switch ((0, _$$_REQUIRE(_dependencyMap[21]).getDrawerAction)(item)) { + case _IndexHelper.default.SP.values.drawer.actions.show_articles: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[22]).RssContentScreen, (0, _extends2.default)({}, props, { + isLive: item.populateFeed === "0", + onItemPress: performNavigation, + getRouteKey: _$$_REQUIRE(_dependencyMap[21]).getNavigationRouteKeyByName + })); + + case _IndexHelper.default.SP.values.drawer.actions.open_my_home: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).RssMyHomeScreen, (0, _extends2.default)({}, props, { + onItemPress: performNavigation + })); + + case _IndexHelper.default.SP.values.drawer.actions.open_favorites: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).RssFavoritesScreen, (0, _extends2.default)({}, props, { + onItemPress: performNavigation + })); + + case _IndexHelper.default.SP.values.drawer.actions.open_search: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).RssSearchScreen, (0, _extends2.default)({}, props, { + onItemPress: performNavigation + })); + + default: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).EmptyScreen, (0, _extends2.default)({}, props, { + url: item.params, + onItemPress: performNavigation + })); + } + } + + function openEPaper(item) { + var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + (0, _$$_REQUIRE(_dependencyMap[27]).sendToAnalytics)((0, _extends2.default)({ + event_action: "drawer" + }, item)); + + _NavigationService.default.main.reset("NewsmemoryNavigator", (0, _extends2.default)({ + isFromRss: true + }, params)); + } + + function performNavigation(navigation, item) { + var params = item.params, + drawerItemKey = item.drawerItemKey; + var routeName = (0, _$$_REQUIRE(_dependencyMap[21]).getNavigationRouteKeyByName)(drawerItemKey); + var action = (0, _$$_REQUIRE(_dependencyMap[21]).getDrawerAction)(item); + var _IndexHelper$SP$value = _IndexHelper.default.SP.values.drawer.actions, + open_settings = _IndexHelper$SP$value.open_settings, + open_url = _IndexHelper$SP$value.open_url, + open_archive_search = _IndexHelper$SP$value.open_archive_search, + open_in_app_purchase_page = _IndexHelper$SP$value.open_in_app_purchase_page, + open_optionspage_tab_editions = _IndexHelper$SP$value.open_optionspage_tab_editions, + open_optionspage_tab_login = _IndexHelper$SP$value.open_optionspage_tab_login, + open_optionspage_tab_contact = _IndexHelper$SP$value.open_optionspage_tab_contact, + open_optionspage_tab_help = _IndexHelper$SP$value.open_optionspage_tab_help, + open_optionspage_tab_archive = _IndexHelper$SP$value.open_optionspage_tab_archive, + open_paywall_account = _IndexHelper$SP$value.open_paywall_account, + upload_image = _IndexHelper$SP$value.upload_image, + open_epaper = _IndexHelper$SP$value.open_epaper, + open_live_news = _IndexHelper$SP$value.open_live_news, + open_full_screen = _IndexHelper$SP$value.open_full_screen, + open_publications = _IndexHelper$SP$value.open_publications, + open_drawer = _IndexHelper$SP$value.open_drawer; + var _IndexHelper$SP$value2 = _IndexHelper.default.SP.values.drawer.params, + open_le_vedette = _IndexHelper$SP$value2.open_le_vedette, + open_real_estate = _IndexHelper$SP$value2.open_real_estate, + open_auto_search = _IndexHelper$SP$value2.open_auto_search, + open_monster = _IndexHelper$SP$value2.open_monster, + open_fair = _IndexHelper$SP$value2.open_fair, + open_weather = _IndexHelper$SP$value2.open_weather, + open_events = _IndexHelper$SP$value2.open_events; + + var _global$getRssIndex = global.getRssIndex(), + latitude = _global$getRssIndex.latitude, + longitude = _global$getRssIndex.longitude, + archiveSearchURL = _global$getRssIndex.archiveSearchURL; + + var parsedParams; + + if (Array.isArray(params) && params.length > 0) { + parsedParams = params[0]; + } else if (typeof params === "string") { + parsedParams = params; + } + + var skipCloseDrawer = false; + + switch (action) { + case open_settings: + (0, _$$_REQUIRE(_dependencyMap[27]).sendToAnalytics)((0, _extends2.default)({ + event_action: "drawer" + }, item)); + + if (global.getMainPSetup().showNativeSettingsScreen) { + dispatchNavigationToParent(navigation, "GeneralSettingsScreen", { + epaperLabel: (0, _$$_REQUIRE(_dependencyMap[21]).getEpaperLabel)(), + module: _$$_REQUIRE(_dependencyMap[28]).GeneralSettingsModules.RSS + }); + } else { + dispatchNavigationToParent(navigation, "SettingsScreen", { + epaperLabel: (0, _$$_REQUIRE(_dependencyMap[21]).getEpaperLabel)() + }); + } + + break; + + case open_url: + (0, _$$_REQUIRE(_dependencyMap[27]).sendToAnalytics)((0, _extends2.default)({ + event_action: "drawer" + }, item)); + + switch (parsedParams) { + case open_le_vedette: + break; + + case open_real_estate: + break; + + case open_auto_search: + break; + + case open_monster: + dispatchNavigationToParent(navigation, "JobNavigator"); + break; + + case open_events: + var extra = { + user: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "externalAPIUsername", ""), + pass: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "externalAPIPassword", ""), + portal: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "externalAPIPortal", ""), + adUnitId: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "externalAdUnitId", ""), + adFallback: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "externalAdFallback", ""), + adWidth: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "externalAdWidth", 300), + adHeight: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "externalAdHeight", 250), + apiHomeOverride: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "HomeOverride", ""), + extraSearchField: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "ExtraSearchField", "[]") + }; + navigation.dispatch(_$$_REQUIRE(_dependencyMap[29]).CommonActions.navigate("EventNavigator", { + screen: "VerticalTabNavigator", + params: extra + })); + break; + + case open_fair: + break; + + case open_weather: + if (_optionalPackageUtils.default.isBaronAvailable()) { + _optionalPackageUtils.default.getBaronWeather().openWeather({ + server: global.getAppServer(), + latitude: latitude, + longitude: longitude + }); + } else { + _$$_REQUIRE(_dependencyMap[20]).Toast.show(global.strings("err_module_unavailable", { + module: "Baron weather" + })); + } + + break; + + default: + if (parsedParams) { + var url = parsedParams; + (0, _$$_REQUIRE(_dependencyMap[27]).sendToAnalytics)({ + event_action: "open_link", + label: item.drawerItemKey + }); + var openInExternalBrowser = (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "target", "") === "_blank"; + + if (openInExternalBrowser) { + _tecnaviaPlatformUtils.default.openURL(url); + } else { + dispatchNavigationToParent(navigation, "WebScreen", { + url: url, + extra: { + ronDinoPromotionsAAK: (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "ronDinoPromotionsAAK", "") + }, + shareButtonIsEnabled: item.enableShareButton === "1" + }); + } + } + + } + + break; + + case open_archive_search: + (0, _$$_REQUIRE(_dependencyMap[27]).sendToAnalytics)((0, _extends2.default)({ + event_action: "drawer" + }, item)); + + if (archiveSearchURL) { + dispatchNavigationToParent(navigation, "WebScreen", { + url: archiveSearchURL + }); + } else {} + + break; + + case open_optionspage_tab_editions: + openEPaper(item, { + tab: _$$_REQUIRE(_dependencyMap[30]).tabs.home + }); + break; + + case open_in_app_purchase_page: + case open_optionspage_tab_login: + openEPaper(item, { + tab: _$$_REQUIRE(_dependencyMap[30]).tabs.login + }); + break; + + case open_optionspage_tab_contact: + openEPaper(item, { + tab: _$$_REQUIRE(_dependencyMap[30]).tabs.contact + }); + break; + + case open_optionspage_tab_help: + openEPaper(item, { + tab: _$$_REQUIRE(_dependencyMap[30]).tabs.help + }); + break; + + case open_optionspage_tab_archive: + openEPaper(item, { + tab: _$$_REQUIRE(_dependencyMap[30]).tabs.archive + }); + break; + + case open_epaper: + var tab = (0, _$$_REQUIRE(_dependencyMap[21]).parseExtra)(item.extra, "optionPageTab", ""); + openEPaper(item, { + tab: tab + }); + break; + + case open_paywall_account: + _Paywall.default.account(); + + break; + + case upload_image: + break; + + case open_full_screen: + navigateDirectlyToFullScreen(navigation, item); + break; + + case open_live_news: + _navigationUtils.default.navigateToHome(navigation); + + break; + + case open_drawer: + navigation.openDrawer(); + skipCloseDrawer = true; + break; + + case open_publications: + _NavigationService.default.main.navigate("PublicationsPageScreen"); + + break; + + default: + navigation.navigate(routeName); + } + + try { + if (!skipCloseDrawer) { + navigation.closeDrawer(); + } + } catch (e) {} + } + + var _getCssStyleByItem = function _getCssStyleByItem(className, item, focused) { + var cssItemKey = _$$_REQUIRE(_dependencyMap[31]).StringUtils.getKeyFromText(item.drawerItemKey); + + var attributes = { + cssKey: cssItemKey, + toggle: true, + active: focused + }; + return _$$_REQUIRE(_dependencyMap[32]).Css.getStyleObjByCssClasses([className], attributes); + }; + + function TabScreen(props) { + var _global$getRssIndex2 = global.getRssIndex(), + supportColor = _global$getRssIndex2.supportColor; + + var tabs = props.tabs, + width = props.width, + isSidebar = props.isSidebar, + numberOfColumns = props.numberOfColumns; + + if (!tabs || !tabs.length) { + return null; + } + + var top = 0; + + if (isSidebar) { + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(); + + top = _DeviceUtils$getSafeA.top; + } + + return _react.default.createElement(_tabNavigator.default, { + screenListeners: { + state: function state(e) { + var item = (0, _$$_REQUIRE(_dependencyMap[21]).getDrawerItemFromStructureAndState)(tabs, e.data.state); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.RSS_ACTIVE_SCREEN, { + item: item + }); + } + }, + style: { + marginTop: top + }, + initialRouteName: (0, _$$_REQUIRE(_dependencyMap[21]).getInitialRouteFromStructure)(tabs), + tabs: tabs.map(function (_ref) { + var item = _ref.item, + route = _ref.route; + return { + item: item, + route: route, + label: item.displayName, + icon: global.getAppServer() + item.image + }; + }), + tabStyles: { + tabBarStyle: _$$_REQUIRE(_dependencyMap[32]).Css.getStyleObjByCssClasses(["rss-tab"]), + tabBarIndicatorStyle: _$$_REQUIRE(_dependencyMap[32]).Css.getStyleObjByCssClasses(["rss-tab-indicator"]), + tabBarItemStyle: function tabBarItemStyle(item, focused) { + return _getCssStyleByItem("rss-tab-item", item, focused); + }, + tabBarIconStyle: function tabBarIconStyle(item, focused) { + return _getCssStyleByItem("rss-tab-icon", item, focused); + }, + tabBarLabelStyle: function tabBarLabelStyle(item, focused) { + return _getCssStyleByItem("rss-tab-item-text", item, focused); + } + }, + primaryColor: _$$_REQUIRE(_dependencyMap[32]).Css.getDefaultBackgroundColor(), + supportColor: supportColor, + tabScreen: function tabScreen(_ref2, navProps) { + var item = _ref2.item, + index = _ref2.index; + return _react.default.createElement(ScreenComponent, (0, _extends2.default)({}, navProps, { + item: item, + showHeader: false, + isHome: item.drawerItemKey === global.getRssIndex().homeCategory, + width: width, + numberOfColumns: numberOfColumns + })); + } + }); + } + + function DrawerHeader(props) { + var width = props.width, + rest = (0, _objectWithoutProperties2.default)(props, ["width"]); + + var _DeviceUtils$getSafeA2 = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA2.top; + + var statusBarColor = _styleUtils.default.getRssStatusBarColor() || _$$_REQUIRE(_dependencyMap[31]).colors.white; + + var showLayoutButton = global.getRssIndex().needToShowLayoutButton(); + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_reactNative.View, { + style: { + marginTop: top + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[32]).Css, { + classes: ["drawer-header-logo"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[34]).LogoImage, { + style: { + width: width, + height: _$$_REQUIRE(_dependencyMap[35]).RSS_HEADER_HEIGHT, + flex: 0 + } + })), _react.default.createElement(_reactNative.View, { + style: [{ + flexDirection: "row", + paddingBottom: 5, + borderBottomColor: _$$_REQUIRE(_dependencyMap[31]).colors.transparent1200, + borderBottomWidth: 0.5, + margin: 5, + justifyContent: "center" + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[34]).HomeButton, (0, _extends2.default)({}, rest, { + backgroundColor: _$$_REQUIRE(_dependencyMap[31]).colors.transparent + })), _react.default.createElement(_$$_REQUIRE(_dependencyMap[34]).SearchButton, (0, _extends2.default)({}, rest, { + backgroundColor: _$$_REQUIRE(_dependencyMap[31]).colors.transparent + })), showLayoutButton ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[34]).LayoutButton, (0, _extends2.default)({}, rest, { + backgroundColor: _$$_REQUIRE(_dependencyMap[31]).colors.transparent + })) : null)), _react.default.createElement(_barsComponent.default, { + edges: ["top"], + statusBarColor: statusBarColor + })); + } + + function Footer(props) { + var navigation = props.navigation, + rest = (0, _objectWithoutProperties2.default)(props, ["navigation"]); + + var _global$getRssIndex3 = global.getRssIndex(), + footerItems = _global$getRssIndex3.footerItems, + supportColor = _global$getRssIndex3.supportColor, + actionBarBackgroundColor = _global$getRssIndex3.actionBarBackgroundColor; + + var onItemClick = _react.default.useCallback(function (item) { + return performNavigation(navigation, item); + }); + + return _react.default.createElement(_footerBarComponent.default, (0, _extends2.default)({ + height: _$$_REQUIRE(_dependencyMap[35]).RSS_HEADER_HEIGHT, + items: footerItems, + backgroundColor: supportColor, + textColor: actionBarBackgroundColor, + displayTextAlways: true, + onItemClick: onItemClick + }, rest)); + } + + function DrawerNavigator(props) { + var isSidebar = props.isSidebar, + navigation = props.navigation; + var rssIndex = global.getRssIndex(); + var menuBackgroundColor = rssIndex.menuBackgroundColor, + homeCategory = rssIndex.homeCategory; + var startCategory = _LiveConfig.default.getLastRssCategory() || homeCategory; + var initialRoute = (0, _$$_REQUIRE(_dependencyMap[21]).getNavigationRouteKeyByName)(startCategory); + var routes = (0, _$$_REQUIRE(_dependencyMap[21]).getNavigationRoutes)(); + var structure = (0, _$$_REQUIRE(_dependencyMap[21]).getDrawerStructure)(routes, initialRoute); + var routesToHide = structure.filter(function (_ref3) { + var inDrawer = _ref3.inDrawer; + return !inDrawer; + }).map(function (_ref4) { + var route = _ref4.route; + return route; + }); + + var drawerStyle = _$$_REQUIRE(_dependencyMap[32]).Css.getStyleObjByCssClasses(["rss-drawer"]); + + var safeArea = _deviceUtils.default.getSafeArea(); + + var _drawerStyle$width = drawerStyle.width, + width = _drawerStyle$width === undefined ? _$$_REQUIRE(_dependencyMap[35]).DRAWER_WIDTH : _drawerStyle$width, + _drawerStyle$backgrou = drawerStyle.backgroundColor, + backgroundColor = _drawerStyle$backgrou === undefined ? (menuBackgroundColor || _$$_REQUIRE(_dependencyMap[31]).colors.white).concat("e4") : _drawerStyle$backgrou, + drawerStyleRest = (0, _objectWithoutProperties2.default)(drawerStyle, ["width", "backgroundColor"]); + var availableWidth = isSidebar ? safeArea.width - width : safeArea.width; + var numberOfColumns = (0, _$$_REQUIRE(_dependencyMap[35]).getRssNumberOfColumns)(); + var newLayout = rssIndex.is3_0(); + return _react.default.createElement(Drawer.Navigator, { + screenListeners: { + state: function state(e) { + var open = (0, _$$_REQUIRE(_dependencyMap[36]).getDrawerStatusFromState)(e.data.state); + + _LiveConfig.default.setDrawerOpen(open === "open"); + + var item = (0, _$$_REQUIRE(_dependencyMap[21]).getDrawerItemFromStructureAndState)(structure, e.data.state); + + if (!item || item && item.layout !== "tab") { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.RSS_ACTIVE_SCREEN, { + item: item + }); + } + } + }, + backBehavior: "initialRoute", + screenOptions: { + headerShown: false, + drawerPosition: _$$_REQUIRE(_dependencyMap[31]).PlatformUtils.isRTL() ? "right" : "left", + drawerStyle: (0, _extends2.default)({}, drawerStyleRest, { + width: width, + backgroundColor: backgroundColor + }), + drawerType: isSidebar ? "permanent" : "front" + }, + drawerContent: function drawerContent(navProps) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[37]).DrawerComponent, (0, _extends2.default)({}, navProps, { + drawerHeader: isSidebar && newLayout ? _react.default.createElement(DrawerHeader, { + width: width, + navigation: navigation + }) : null, + newLayout: newLayout, + structure: structure, + onItemPress: performNavigation, + skipRoutes: routesToHide + })); + }, + initialRouteName: (0, _$$_REQUIRE(_dependencyMap[21]).getInitialRouteFromStructure)(structure) + }, structure.map(function (_ref5, index) { + var item = _ref5.item, + route = _ref5.route, + tabs = _ref5.tabs; + var drawerItemKey = item.drawerItemKey; + var isHomeCategory = drawerItemKey === homeCategory; + + if (tabs) { + return _react.default.createElement(Drawer.Screen, { + key: route, + name: route, + options: { + drawerLabel: drawerItemKey + } + }, function (navProps) { + return _react.default.createElement(Footer, (0, _extends2.default)({ + Content: _react.default.createElement(TabScreen, { + isSidebar: isSidebar, + width: availableWidth, + numberOfColumns: numberOfColumns, + tabs: tabs + }) + }, navProps)); + }); + } + + return _react.default.createElement(Drawer.Screen, { + key: route, + name: route, + options: { + drawerLabel: drawerItemKey + } + }, function (navProps) { + return _react.default.createElement(Footer, (0, _extends2.default)({ + Content: _react.default.createElement(ScreenComponent, (0, _extends2.default)({}, navProps, { + item: item, + showHeader: !isHomeCategory, + considerSafeAreaTop: isSidebar, + isHome: isHomeCategory, + width: availableWidth, + numberOfColumns: numberOfColumns + })) + }, navProps)); + }); + })); + } +},2206,[5,108,6,80,17,28,1963,1862,2207,458,731,1861,1872,2084,460,2145,2147,2045,1876,2211,1889,2046,2214,2226,2259,2261,2281,2210,2232,1002,730,462,699,572,2201,2039,1139,2283]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.ORDER = exports.SORT = exports.DbDownloadPriority = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _RssContentManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var api = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _downloadUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Resource = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _hintKeys = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var DbDownloadPriority = { + HIGH: 1, + MEDIUM: 2, + LOW: 3 + }; + exports.DbDownloadPriority = DbDownloadPriority; + var SORT = { + BY_RELEVANCE: "0", + BY_DATE: "1", + BY_CATEGORIES: "2" + }; + exports.SORT = SORT; + var ORDER = { + ASC: "0", + DESC: "1" + }; + exports.ORDER = ORDER; + + var RssContentHelper = function () { + function RssContentHelper() { + (0, _classCallCheck2.default)(this, RssContentHelper); + } + + (0, _createClass2.default)(RssContentHelper, null, [{ + key: "getSortByValues", + value: function getSortByValues() { + return [{ + value: SORT.BY_RELEVANCE, + label: global.strings("str_relevance") + }, { + value: SORT.BY_DATE, + label: global.strings("str_date") + }, { + value: SORT.BY_CATEGORIES, + label: global.strings("str_categories") + }]; + } + }, { + key: "getOrderValues", + value: function getOrderValues() { + return [{ + value: ORDER.ASC, + label: global.strings("str_ascending") + }, { + value: ORDER.DESC, + label: global.strings("str_descending") + }]; + } + }, { + key: "databaseExists", + value: function databaseExists() { + return _regenerator.default.async(function databaseExists$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _RssContentManager.default.databaseExists()); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "replaceDatabase", + value: function replaceDatabase(dbURL) { + var _StringUtils$getUrlIn, domain; + + return _regenerator.default.async(function replaceDatabase$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + + _$$_REQUIRE(_dependencyMap[12]).HintOverlay.show({ + config: _hintKeys.default.rssDbDownloadProgress(), + progress: true + }); + + _context3.next = 4; + return _regenerator.default.awrap(_downloadUtils.default.getDatabase(dbURL, _RssContentManager.default.getDatabaseFolder(), { + progressCallback: function progressCallback(received, total) { + _$$_REQUIRE(_dependencyMap[13]).EventRegister.emit(_events.default.ON_RSS_DB_DOWNLOAD, { + progress: received / total, + downloading: true + }); + }, + callbackAfterUnzip: function callbackAfterUnzip(downloadedDbPath) { + return _regenerator.default.async(function callbackAfterUnzip$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + _context2.next = 3; + return _regenerator.default.awrap(_RssContentManager.default.deleteDatabase()); + + case 3: + _context2.next = 7; + break; + + case 5: + _context2.prev = 5; + _context2.t0 = _context2["catch"](0); + + case 7: + _context2.prev = 7; + _context2.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.moveFile(downloadedDbPath, _RssContentManager.default.getDatabaseFilePath())); + + case 10: + _context2.next = 14; + break; + + case 12: + _context2.prev = 12; + _context2.t1 = _context2["catch"](7); + + case 14: + _context2.prev = 14; + _context2.next = 17; + return _regenerator.default.awrap(_RssContentManager.default.migrateDB()); + + case 17: + _context2.next = 21; + break; + + case 19: + _context2.prev = 19; + _context2.t2 = _context2["catch"](14); + + case 21: + _$$_REQUIRE(_dependencyMap[13]).EventRegister.emit(_events.default.ON_RSS_DB_DOWNLOAD, { + progress: 100, + downloading: false + }); + + case 22: + case "end": + return _context2.stop(); + } + } + }, null, null, [[0, 5], [7, 12], [14, 19]], Promise); + } + })); + + case 4: + _StringUtils$getUrlIn = _$$_REQUIRE(_dependencyMap[14]).StringUtils.getUrlInfo(dbURL), domain = _StringUtils$getUrlIn.domain; + (0, _$$_REQUIRE(_dependencyMap[15]).sendToAnalytics)({ + event_action: "download_rss_db", + domain: domain + }); + _context3.next = 12; + break; + + case 8: + _context3.prev = 8; + _context3.t0 = _context3["catch"](0); + + _$$_REQUIRE(_dependencyMap[12]).HintOverlay.hide(); + + throw _context3.t0; + + case 12: + case "end": + return _context3.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + }, { + key: "download", + value: function download(categoryName) { + var forceDownload, + callbackForPush, + hideRefresh, + result, + databaseExists, + rssIndexConfig, + dbURL, + categoryIds, + newestEntry, + _await$api$getJsonDbU, + reloadAll, + newArticles, + newArticlesCount, + playlists, + resources, + resourceRels, + resourceTypes, + dbMTime, + counter, + _args4 = arguments; + + return _regenerator.default.async(function download$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + forceDownload = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : false; + callbackForPush = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : function () {}; + hideRefresh = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : function () {}; + result = {}; + _context4.prev = 4; + _context4.next = 7; + return _regenerator.default.awrap(_RssContentManager.default.databaseExists()); + + case 7: + databaseExists = _context4.sent; + rssIndexConfig = global.getRssIndex(); + dbURL = rssIndexConfig.getFullDbURL(); + + if (!(forceDownload || !databaseExists)) { + _context4.next = 20; + break; + } + + _context4.next = 13; + return _regenerator.default.awrap(RssContentHelper.replaceDatabase(dbURL)); + + case 13: + result.msg = global.strings("msg_rss_reload_database"); + result.code = this.NEW_ITEMS_AVAILABLE; + result.priority = DbDownloadPriority.HIGH; + hideRefresh(); + callbackForPush(); + _context4.next = 59; + break; + + case 20: + _context4.next = 22; + return _regenerator.default.awrap(_RssContentManager.default.getCategoryIdFromName(categoryName)); + + case 22: + categoryIds = _context4.sent; + _context4.next = 25; + return _regenerator.default.awrap(_RssContentManager.default.newestEntry(categoryIds)); + + case 25: + newestEntry = _context4.sent; + _context4.next = 28; + return _regenerator.default.awrap(api.getJsonDbUpdate(newestEntry, categoryIds)); + + case 28: + _await$api$getJsonDbU = _context4.sent; + reloadAll = _await$api$getJsonDbU.reloadAll; + newArticles = _await$api$getJsonDbU.newArticles; + newArticlesCount = _await$api$getJsonDbU.newArticlesCount; + playlists = _await$api$getJsonDbU.playlists; + resources = _await$api$getJsonDbU.resources; + resourceRels = _await$api$getJsonDbU.resourceRels; + resourceTypes = _await$api$getJsonDbU.resourceTypes; + dbMTime = _await$api$getJsonDbU.dbMTime; + hideRefresh(); + + if (dbMTime) { + rssIndexConfig.setDbMTime(dbMTime); + dbURL = rssIndexConfig.getFullDbURL(); + } + + if (!reloadAll) { + _context4.next = 48; + break; + } + + _context4.next = 42; + return _regenerator.default.awrap(RssContentHelper.replaceDatabase(dbURL)); + + case 42: + result.msg = global.strings("msg_rss_reload_database"); + result.code = this.NEW_ITEMS_AVAILABLE; + result.priority = DbDownloadPriority.HIGH; + callbackForPush(); + _context4.next = 59; + break; + + case 48: + if (!(newArticlesCount >= 0 || newArticles && newArticles.length)) { + _context4.next = 55; + break; + } + + counter = newArticlesCount !== undefined ? newArticlesCount : newArticles.length; + + if (counter === 0) { + result.msg = global.strings("msg_rss_no_new_articles_available", { + count: 0 + }); + result.code = this.NO_NEW_ITEMS_AVAILABLE; + result.priority = DbDownloadPriority.LOW; + } else { + if (counter === 1) { + result.msg = global.strings("msg_rss_one_new_article_available", { + count: counter + }); + } else { + result.msg = global.strings("msg_rss_new_articles_available", { + count: counter + }); + } + + result.code = this.NEW_ITEMS_AVAILABLE; + result.priority = DbDownloadPriority.MEDIUM; + } + + _context4.next = 53; + return _regenerator.default.awrap(_RssContentManager.default.storeUpdate(newArticles, playlists, categoryIds, resources, resourceRels, resourceTypes, callbackForPush)); + + case 53: + _context4.next = 59; + break; + + case 55: + result.msg = global.strings("msg_rss_no_new_articles_available", { + count: 0 + }); + result.code = this.NO_NEW_ITEMS_AVAILABLE; + result.priority = DbDownloadPriority.LOW; + callbackForPush(); + + case 59: + _context4.next = 68; + break; + + case 61: + _context4.prev = 61; + _context4.t0 = _context4["catch"](4); + result.error = global.strings("msg_rss_update_error"); + result.code = this.ERROR; + result.priority = DbDownloadPriority.HIGH; + hideRefresh(); + callbackForPush(); + + case 68: + return _context4.abrupt("return", result); + + case 69: + case "end": + return _context4.stop(); + } + } + }, null, this, [[4, 61]], Promise); + } + }, { + key: "deleteDatabase", + value: function deleteDatabase() { + return _regenerator.default.async(function deleteDatabase$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", _RssContentManager.default.deleteDatabase()); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "initDatabase", + value: function initDatabase() { + return _regenerator.default.async(function initDatabase$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", _RssContentManager.default.initDatabase()); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "mergeArticlesAndResources", + value: function mergeArticlesAndResources(articles, resources) { + return articles.map(function (article) { + var currentArticleResources = resources.filter(function (resource) { + return resource.getFeedId() === article.getFeedId(); + }); + article.setResources(currentArticleResources); + return article; + }); + } + }, { + key: "getArticlesBySearch", + value: function getArticlesBySearch(text, searchData) { + var articles, resources; + return _regenerator.default.async(function getArticlesBySearch$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + _context7.next = 2; + return _regenerator.default.awrap(_RssContentManager.default.searchArticles(text)); + + case 2: + articles = _context7.sent; + articles = articles.filter(function (article) { + return RssContentHelper.filterArticleByCriteria(article, searchData); + }).filter(function (item, index, items) { + return items.find(function (_item, _i) { + return _i > index && item.getFeedId() === _item.getFeedId(); + }) === undefined; + }).filter(function (item) { + return !item.isLiveStream(); + }).sort(function (itemA, itemB) { + return RssContentHelper.sortArticlesByCriteria(itemA, itemB, (0, _extends2.default)({}, searchData, { + text: text + })); + }); + _context7.next = 6; + return _regenerator.default.awrap(_RssContentManager.default.getResources(articles)); + + case 6: + resources = _context7.sent; + return _context7.abrupt("return", RssContentHelper.mergeArticlesAndResources(articles, resources)); + + case 8: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getFirstArticleByCategory", + value: function getFirstArticleByCategory(category) { + var withImage, + articles, + _args8 = arguments; + return _regenerator.default.async(function getFirstArticleByCategory$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + withImage = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : false; + _context8.next = 3; + return _regenerator.default.awrap(_RssContentManager.default.getArticlesByCategory(category, true)); + + case 3: + articles = _context8.sent; + + if (withImage) { + articles = articles.filter(function (article) { + return !!article.image; + }); + } + + return _context8.abrupt("return", articles.length > 0 ? articles[0] : undefined); + + case 6: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticlesByCategory", + value: function getArticlesByCategory(category, removeAdvertisements) { + var articles, resources; + return _regenerator.default.async(function getArticlesByCategory$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + _context9.next = 2; + return _regenerator.default.awrap(_RssContentManager.default.getArticlesByCategory(category, removeAdvertisements)); + + case 2: + articles = _context9.sent; + _context9.next = 5; + return _regenerator.default.awrap(_RssContentManager.default.getResources(articles)); + + case 5: + resources = _context9.sent; + return _context9.abrupt("return", RssContentHelper.mergeArticlesAndResources(articles, resources)); + + case 7: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticleByFeedId", + value: function getArticleByFeedId(feedId) { + var articles, resources; + return _regenerator.default.async(function getArticleByFeedId$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.next = 2; + return _regenerator.default.awrap(_RssContentManager.default.getArticleByFeedId(feedId)); + + case 2: + articles = _context10.sent; + _context10.next = 5; + return _regenerator.default.awrap(_RssContentManager.default.getResources(articles)); + + case 5: + resources = _context10.sent; + return _context10.abrupt("return", RssContentHelper.mergeArticlesAndResources(articles, resources)); + + case 7: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticleBySource", + value: function getArticleBySource(source) { + var articles, resources; + return _regenerator.default.async(function getArticleBySource$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + _context11.next = 2; + return _regenerator.default.awrap(_RssContentManager.default.getArticleBySource(source)); + + case 2: + articles = _context11.sent; + _context11.next = 5; + return _regenerator.default.awrap(_RssContentManager.default.getResources(articles)); + + case 5: + resources = _context11.sent; + return _context11.abrupt("return", RssContentHelper.mergeArticlesAndResources(articles, resources)); + + case 7: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticlesInHomeCategory", + value: function getArticlesInHomeCategory(category, removeAdvertisements) { + var articles, resources; + return _regenerator.default.async(function getArticlesInHomeCategory$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + _context12.next = 2; + return _regenerator.default.awrap(_RssContentManager.default.getArticlesInHomeCategory(category, removeAdvertisements)); + + case 2: + articles = _context12.sent; + _context12.next = 5; + return _regenerator.default.awrap(_RssContentManager.default.getResources(articles)); + + case 5: + resources = _context12.sent; + return _context12.abrupt("return", RssContentHelper.mergeArticlesAndResources(articles, resources)); + + case 7: + case "end": + return _context12.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticlesInMyHome", + value: function getArticlesInMyHome(categories) { + var articles, resources; + return _regenerator.default.async(function getArticlesInMyHome$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + _context13.next = 2; + return _regenerator.default.awrap(_RssContentManager.default.getArticlesInMyHome(categories)); + + case 2: + articles = _context13.sent; + _context13.next = 5; + return _regenerator.default.awrap(_RssContentManager.default.getResources(articles)); + + case 5: + resources = _context13.sent; + return _context13.abrupt("return", RssContentHelper.mergeArticlesAndResources(articles, resources)); + + case 7: + case "end": + return _context13.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getCategoryByArticleFeed", + value: function getCategoryByArticleFeed(feedId) { + return _regenerator.default.async(function getCategoryByArticleFeed$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + return _context14.abrupt("return", _RssContentManager.default.getCategoryFromFeedId(feedId)); + + case 1: + case "end": + return _context14.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getMyHomeCategoryContent", + value: function getMyHomeCategoryContent() { + var result, content; + return _regenerator.default.async(function getMyHomeCategoryContent$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + result = []; + _context15.next = 3; + return _regenerator.default.awrap(_RssContentManager.default.getCategoryContent()); + + case 3: + content = _context15.sent; + content.forEach(function (item) { + result.push({ + name: item.label, + count: item.count, + image: item.image.split("#").find(function (element) { + return element !== ""; + }) + }); + }); + return _context15.abrupt("return", result); + + case 6: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getCategories", + value: function getCategories() { + var result; + return _regenerator.default.async(function getCategories$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + result = []; + _context16.prev = 1; + _context16.next = 4; + return _regenerator.default.awrap(_RssContentManager.default.getCategories()); + + case 4: + _context16.sent.forEach(function (_ref) { + var ca_id = _ref.ca_id, + ca_label = _ref.ca_label; + + if (!ca_label.startsWith(_$$_REQUIRE(_dependencyMap[14]).StringUtils.TILDE)) { + result.push({ + label: ca_label, + value: ca_id + }); + } + }); + + _context16.next = 10; + break; + + case 7: + _context16.prev = 7; + _context16.t0 = _context16["catch"](1); + console.warn(_context16.t0); + + case 10: + return _context16.abrupt("return", result); + + case 11: + case "end": + return _context16.stop(); + } + } + }, null, null, [[1, 7]], Promise); + } + }, { + key: "getCategoriesForSearch", + value: function getCategoriesForSearch(categoriesNotSearchable) { + return _regenerator.default.async(function getCategoriesForSearch$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + _context17.prev = 0; + _context17.next = 3; + return _regenerator.default.awrap(RssContentHelper.getCategories()); + + case 3: + return _context17.abrupt("return", _context17.sent.filter(function (_ref2) { + var label = _ref2.label; + return !categoriesNotSearchable.includes(label); + })); + + case 6: + _context17.prev = 6; + _context17.t0 = _context17["catch"](0); + console.warn(_context17.t0); + + case 9: + return _context17.abrupt("return", []); + + case 10: + case "end": + return _context17.stop(); + } + } + }, null, null, [[0, 6]], Promise); + } + }, { + key: "getBylines", + value: function getBylines() { + var result; + return _regenerator.default.async(function getBylines$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + result = []; + _context18.prev = 1; + _context18.next = 4; + return _regenerator.default.awrap(_RssContentManager.default.getBylines()); + + case 4: + _context18.sent.forEach(function (_ref3) { + var ar_byline = _ref3.ar_byline; + result.push({ + label: ar_byline, + value: ar_byline + }); + }); + + _context18.next = 10; + break; + + case 7: + _context18.prev = 7; + _context18.t0 = _context18["catch"](1); + console.warn(_context18.t0); + + case 10: + return _context18.abrupt("return", result); + + case 11: + case "end": + return _context18.stop(); + } + } + }, null, null, [[1, 7]], Promise); + } + }, { + key: "getRangeDates", + value: function getRangeDates() { + var dates, result; + return _regenerator.default.async(function getRangeDates$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + _context19.next = 2; + return _regenerator.default.awrap(_RssContentManager.default.getDates()); + + case 2: + dates = _context19.sent; + result = []; + + if (dates) { + if (dates[0]) { + result.push(dates[0].ar_articledate * 1000); + } + + if (dates[dates.length - 1]) { + result.push(dates[dates.length - 1].ar_articledate * 1000); + } + } + + return _context19.abrupt("return", result); + + case 6: + case "end": + return _context19.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "filterArticleByCriteria", + value: function filterArticleByCriteria(article) { + var criteria = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var include = true; + + if (criteria.startDate) { + include = article.unixDate * 1000 >= _$$_REQUIRE(_dependencyMap[14]).DateUtils.toDate(criteria.startDate).getTime(); + } + + if (include && criteria.endDate) { + include = article.unixDate * 1000 <= _$$_REQUIRE(_dependencyMap[14]).DateUtils.toDate(criteria.endDate).getTime(); + } + + if (include && criteria.byline) { + include = criteria.byline.includes(article.byline); + } + + if (include && criteria.categories) { + include = criteria.categories.includes(article.categoryId); + } + + return include; + } + }, { + key: "sortArticlesByCriteria", + value: function sortArticlesByCriteria(itemA, itemB) { + var criteria = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var result = 0; + + if (criteria.sortBy === SORT.BY_CATEGORIES) { + if (itemA.category < itemB.category) { + result = -1; + } else if (itemA.category > itemB.category) { + result = 1; + } + } else if (criteria.sortBy === SORT.BY_RELEVANCE && criteria.text) { + var occurrenceInA = (itemA.title + " " + itemA.byline + " " + itemA.summary + " " + itemA.html).toLocaleLowerCase().search(criteria.text.toLocaleLowerCase()); + var occurrenceInB = (itemB.title + " " + itemB.byline + " " + itemB.summary + " " + itemB.html).toLocaleLowerCase().search(criteria.text.toLocaleLowerCase()); + result = occurrenceInB - occurrenceInA; + } else { + result = itemB.unixDate - itemA.unixDate; + } + + return criteria.order === ORDER.ASC ? result * -1 : result; + } + }]); + return RssContentHelper; + }(); + + exports.default = RssContentHelper; + RssContentHelper.ERROR = -1; + RssContentHelper.NO_NEW_ITEMS_AVAILABLE = 0; + RssContentHelper.NEW_ITEMS_AVAILABLE = 1; +},2207,[5,80,6,7,8,2208,2209,586,574,1974,460,2002,2003,572,462,2210]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Database = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var RSS_DB_NAME = "rss.db"; + + var RssContentManager = function () { + function RssContentManager() { + (0, _classCallCheck2.default)(this, RssContentManager); + } + + (0, _createClass2.default)(RssContentManager, null, [{ + key: "initDatabase", + value: function initDatabase() { + return _regenerator.default.async(function initDatabase$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + RssContentManager.database = new _Database.default(RssContentManager.getDatabaseFilePath(), RssContentManager.MIGRATIONS); + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(RssContentManager.databaseExists()); + + case 4: + if (!_context.sent) { + _context.next = 7; + break; + } + + _context.next = 7; + return _regenerator.default.awrap(RssContentManager.migrateDB()); + + case 7: + _context.next = 11; + break; + + case 9: + _context.prev = 9; + _context.t0 = _context["catch"](1); + + case 11: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }, { + key: "getDatabaseFilePath", + value: function getDatabaseFilePath() { + return "" + RssContentManager.getDatabaseFolder() + RSS_DB_NAME; + } + }, { + key: "getDatabaseFolder", + value: function getDatabaseFolder() { + if (_$$_REQUIRE(_dependencyMap[6]).PlatformUtils.isIOS()) { + return _tecnaviaFileUtils.default.libraryDirectory + "/LocalDatabase/"; + } + + return _tecnaviaFileUtils.default.documentDirectory + "/"; + } + }, { + key: "databaseExists", + value: function databaseExists() { + return _regenerator.default.async(function databaseExists$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", RssContentManager.database.exists()); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "deleteDatabase", + value: function deleteDatabase() { + return _regenerator.default.async(function deleteDatabase$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", RssContentManager.database.delete()); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "migrateDB", + value: function migrateDB() { + return _regenerator.default.async(function migrateDB$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + return _context4.abrupt("return", RssContentManager.database.migrateDB()); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "openTransaction", + value: function openTransaction(query, params) { + return _regenerator.default.async(function openTransaction$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", RssContentManager.database.transaction(query, params)); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "checkIfColumnExists", + value: function checkIfColumnExists(table, column) { + return _regenerator.default.async(function checkIfColumnExists$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", RssContentManager.database.columnExists(table, column)); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "replaceInto", + value: function replaceInto(table, items) { + return _regenerator.default.async(function replaceInto$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", RssContentManager.database.replaceInto(table, Object.keys(items[0]), items.map(function (item) { + return Object.values(item); + }))); + + case 1: + case "end": + return _context7.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "storeUpdate", + value: function storeUpdate() { + var articles, + playlists, + categoryIds, + resources, + resourceRels, + resourceTypes, + callback, + _args8 = arguments; + return _regenerator.default.async(function storeUpdate$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + articles = _args8.length > 0 && _args8[0] !== undefined ? _args8[0] : []; + playlists = _args8.length > 1 && _args8[1] !== undefined ? _args8[1] : []; + categoryIds = _args8.length > 2 && _args8[2] !== undefined ? _args8[2] : []; + resources = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : []; + resourceRels = _args8.length > 4 && _args8[4] !== undefined ? _args8[4] : []; + resourceTypes = _args8.length > 5 && _args8[5] !== undefined ? _args8[5] : []; + callback = _args8.length > 6 ? _args8[6] : undefined; + + if (!(articles.length && playlists.length)) { + _context8.next = 29; + break; + } + + articles.forEach(function (article) { + if (!article.ar_updatedate) { + article.ar_updatedate = null; + } + }); + _context8.next = 11; + return _regenerator.default.awrap(RssContentManager.replaceInto("article", articles)); + + case 11: + callback(); + + if (!resources.length) { + _context8.next = 15; + break; + } + + _context8.next = 15; + return _regenerator.default.awrap(RssContentManager.replaceInto("resource", resources)); + + case 15: + if (!resourceTypes.length) { + _context8.next = 18; + break; + } + + _context8.next = 18; + return _regenerator.default.awrap(RssContentManager.replaceInto("resource_type", resourceTypes)); + + case 18: + if (!resourceRels.length) { + _context8.next = 23; + break; + } + + _context8.next = 21; + return _regenerator.default.awrap(RssContentManager.database.deleteFrom("resource_rel", "")); + + case 21: + _context8.next = 23; + return _regenerator.default.awrap(RssContentManager.replaceInto("resource_rel", resourceRels)); + + case 23: + _context8.next = 25; + return _regenerator.default.awrap(RssContentManager.database.deleteFrom("playlist", categoryIds.length ? "pl_catListId IN ( " + categoryIds.join() + ")" : "")); + + case 25: + _context8.next = 27; + return _regenerator.default.awrap(RssContentManager.replaceInto("playlist", playlists)); + + case 27: + _context8.next = 30; + break; + + case 29: + callback(); + + case 30: + case "end": + return _context8.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getCategoryIdFromName", + value: function getCategoryIdFromName(name) { + var query, categories; + return _regenerator.default.async(function getCategoryIdFromName$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + if (!name) { + _context9.next = 6; + break; + } + + query = "SELECT ca_id FROM category AS c WHERE c.ca_label = ?;"; + _context9.next = 4; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [name])); + + case 4: + categories = _context9.sent; + return _context9.abrupt("return", categories.map(function (category) { + return category.ca_id; + })); + + case 6: + return _context9.abrupt("return", []); + + case 7: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getResources", + value: function getResources() { + var articles, + inCondition, + query, + _args10 = arguments; + return _regenerator.default.async(function getResources$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + articles = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : []; + inCondition = articles.map(function (article) { + return "'" + article.getFeedId() + "'"; + }).join(); + query = "SELECT DISTINCT * FROM resource_rel AS rl, resource AS r, resource_type AS rt WHERE rl.rr_resourceId = r.re_id AND r.re_typeId = rt.rt_id AND rl.rr_feedId IN (" + inCondition + ") ORDER BY r.re_typeId"; + _context10.t0 = _$$_REQUIRE(_dependencyMap[7]).formatResourcesToDTO; + _context10.next = 6; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [])); + + case 6: + _context10.t1 = _context10.sent; + return _context10.abrupt("return", (0, _context10.t0)(_context10.t1)); + + case 8: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticlesByCategory", + value: function getArticlesByCategory(category, removeAdvertisements) { + var query; + return _regenerator.default.async(function getArticlesByCategory$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + if (!category) { + _context11.next = 7; + break; + } + + query = "SELECT * FROM playlist AS p JOIN article AS a ON a.ar_feedId = p.pl_feedId JOIN category AS c ON c.ca_id = p.pl_catListId WHERE ( c.ca_label = ? OR c.ca_label = ? ) AND a.ar_catId != 9999 " + (removeAdvertisements ? " AND a.ar_catId != 7777 " : "") + " AND ( pl_priority NOT LIKE '%\"p\"%' OR pl_priority LIKE '%show%') ORDER BY p.pl_id ASC;"; + _context11.t0 = _$$_REQUIRE(_dependencyMap[7]).formatArticlesToDTO; + _context11.next = 5; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [category, "" + _$$_REQUIRE(_dependencyMap[6]).StringUtils.TILDE + category])); + + case 5: + _context11.t1 = _context11.sent; + return _context11.abrupt("return", (0, _context11.t0)(_context11.t1)); + + case 7: + return _context11.abrupt("return", []); + + case 8: + case "end": + return _context11.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticleByFeedId", + value: function getArticleByFeedId(feedId) { + var query; + return _regenerator.default.async(function getArticleByFeedId$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + if (!feedId) { + _context12.next = 7; + break; + } + + query = "SELECT * FROM article WHERE ar_feedId LIKE '" + feedId + "';"; + _context12.t0 = _$$_REQUIRE(_dependencyMap[7]).formatArticlesToDTO; + _context12.next = 5; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [])); + + case 5: + _context12.t1 = _context12.sent; + return _context12.abrupt("return", (0, _context12.t0)(_context12.t1)); + + case 7: + return _context12.abrupt("return", []); + + case 8: + case "end": + return _context12.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticleBySource", + value: function getArticleBySource(source) { + var updateColExists, orderStmt, query; + return _regenerator.default.async(function getArticleBySource$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + if (!source) { + _context13.next = 11; + break; + } + + _context13.next = 3; + return _regenerator.default.awrap(RssContentManager.checkIfColumnExists("article", "ar_updatedate")); + + case 3: + updateColExists = _context13.sent; + orderStmt = "" + (updateColExists ? "COALESCE( NULLIF( ar_updatedate,'' ), ar_articledate )" : "ar_articledate"); + query = "SELECT * FROM article WHERE ar_source LIKE '" + source + "' ORDER BY " + orderStmt + " DESC LIMIT 1;"; + _context13.t0 = _$$_REQUIRE(_dependencyMap[7]).formatArticlesToDTO; + _context13.next = 9; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [])); + + case 9: + _context13.t1 = _context13.sent; + return _context13.abrupt("return", (0, _context13.t0)(_context13.t1)); + + case 11: + return _context13.abrupt("return", []); + + case 12: + case "end": + return _context13.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getCategoryFromFeedId", + value: function getCategoryFromFeedId(feedId) { + var query, result; + return _regenerator.default.async(function getCategoryFromFeedId$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + if (!feedId) { + _context14.next = 12; + break; + } + + query = "SELECT ca_label AS label FROM article, category WHERE ar_feedId = ? AND ar_catId = ca_id LIMIT 1;"; + _context14.prev = 2; + _context14.next = 5; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [feedId])); + + case 5: + result = _context14.sent[0]; + return _context14.abrupt("return", result.label); + + case 9: + _context14.prev = 9; + _context14.t0 = _context14["catch"](2); + return _context14.abrupt("return", ""); + + case 12: + return _context14.abrupt("return", ""); + + case 13: + case "end": + return _context14.stop(); + } + } + }, null, null, [[2, 9]], Promise); + } + }, { + key: "getArticlesInHomeCategory", + value: function getArticlesInHomeCategory(category, removeAdvertisements) { + var query; + return _regenerator.default.async(function getArticlesInHomeCategory$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + if (!category) { + _context15.next = 7; + break; + } + + query = "SELECT a.*, p.*, c2.* FROM playlist AS p JOIN article AS a ON a.ar_feedId = p.pl_feedId JOIN category AS c ON c.ca_id = p.pl_catListId JOIN category AS c2 ON c2.ca_id = a.ar_catId WHERE c.ca_label = ?" + (removeAdvertisements ? " AND a.ar_catId != 7777" : "") + " ORDER BY p.pl_id ASC;"; + _context15.t0 = _$$_REQUIRE(_dependencyMap[7]).formatArticlesToDTO; + _context15.next = 5; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [category])); + + case 5: + _context15.t1 = _context15.sent; + return _context15.abrupt("return", (0, _context15.t0)(_context15.t1)); + + case 7: + return _context15.abrupt("return", []); + + case 8: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getArticlesInMyHome", + value: function getArticlesInMyHome(categories) { + var inCondition, query; + return _regenerator.default.async(function getArticlesInMyHome$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + if (!categories) { + _context16.next = 8; + break; + } + + inCondition = categories.map(function (category) { + return "'" + category + "'"; + }).join(); + query = "SELECT * FROM ( SELECT *, CASE ar_updatedate WHEN '' THEN NULL ELSE ar_updatedate END Date FROM playlist JOIN article ON playlist.pl_feedId = article.ar_feedId JOIN category ON category.ca_id = playlist.pl_catListId " + (" WHERE ca_label IN ( " + inCondition + " ) ") + " AND ( pl_priority NOT LIKE '%\"p\"%' OR pl_priority LIKE '%show%' ) " + " AND ar_catId != '7777' " + " GROUP BY ar_title " + "UNION ALL " + " SELECT *,CASE ar_updatedate WHEN '' THEN NULL ELSE ar_updatedate END Date " + " FROM playlist JOIN article ON playlist.pl_feedId = article.ar_feedId " + " JOIN category ON category.ca_id = playlist.pl_catListId " + (" WHERE ca_label IN ( " + inCondition + " ) ") + " AND (pl_priority NOT LIKE '%\"p\"%' OR pl_priority LIKE '%show%') " + " AND ar_catId =='7777' " + ") " + "ORDER BY COALESCE ( Date,ar_articledate ) DESC;"; + _context16.t0 = _$$_REQUIRE(_dependencyMap[7]).formatArticlesToDTO; + _context16.next = 6; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [])); + + case 6: + _context16.t1 = _context16.sent; + return _context16.abrupt("return", (0, _context16.t0)(_context16.t1)); + + case 8: + return _context16.abrupt("return", []); + + case 9: + case "end": + return _context16.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getCategoryContent", + value: function getCategoryContent() { + return _regenerator.default.async(function getCategoryContent$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + return _context17.abrupt("return", RssContentManager.openTransaction("SELECT c.ca_label AS label, COUNT(a.ar_id) AS count, GROUP_CONCAT(a.ar_image, '#') AS image \n FROM playlist AS p\n LEFT JOIN article AS a ON a.ar_feedId = p.pl_feedId\n LEFT JOIN category AS c ON a.ar_catId = c.ca_id\n WHERE c.ca_id < 7777\n GROUP BY c.ca_id\n ")); + + case 1: + case "end": + return _context17.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "searchArticles", + value: function searchArticles() { + var text, + query, + _args18 = arguments; + return _regenerator.default.async(function searchArticles$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + text = _args18.length > 0 && _args18[0] !== undefined ? _args18[0] : ""; + query = "\n SELECT *\n FROM \n article AS a\n JOIN playlist AS p ON p.pl_feedId = a.ar_feedId\n JOIN category AS c ON c.ca_id = p.pl_catListId\n WHERE a.ar_htmlbody LIKE '%" + text + "%' OR a.ar_title LIKE '%" + text + "%'\n ORDER BY p.pl_id\n "; + _context18.t0 = _$$_REQUIRE(_dependencyMap[7]).formatArticlesToDTO; + _context18.next = 5; + return _regenerator.default.awrap(RssContentManager.openTransaction(query, [])); + + case 5: + _context18.t1 = _context18.sent; + return _context18.abrupt("return", (0, _context18.t0)(_context18.t1)); + + case 7: + case "end": + return _context18.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "newestEntry", + value: function newestEntry(categoryIds) { + var updateColExists, selectColStmt, query, result; + return _regenerator.default.async(function newestEntry$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + _context19.next = 2; + return _regenerator.default.awrap(RssContentManager.checkIfColumnExists("article", "ar_updatedate")); + + case 2: + updateColExists = _context19.sent; + selectColStmt = "" + (updateColExists ? "COALESCE( NULLIF( ar_updatedate,'' ), ar_insertdate )" : "ar_insertdate"); + query = "SELECT " + selectColStmt + " as ar_insertdate " + "FROM article LEFT JOIN playlist ON ar_feedId = pl_feedId " + "WHERE ar_catId != 7777 "; + + if (categoryIds && categoryIds.length) { + query += "AND pl_catListId IN ( " + categoryIds.join() + " )"; + } + + query += " ORDER BY ar_insertdate DESC LIMIT 1"; + _context19.next = 9; + return _regenerator.default.awrap(RssContentManager.openTransaction(query)); + + case 9: + result = _context19.sent; + return _context19.abrupt("return", result && result.length ? result[0].ar_insertdate : -1); + + case 11: + case "end": + return _context19.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getBylines", + value: function getBylines() { + return _regenerator.default.async(function getBylines$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + return _context20.abrupt("return", RssContentManager.openTransaction("SELECT DISTINCT ar_byline FROM article WHERE ca_id < 7777")); + + case 1: + case "end": + return _context20.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getCategories", + value: function getCategories() { + return _regenerator.default.async(function getCategories$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + return _context21.abrupt("return", RssContentManager.openTransaction("SELECT DISTINCT ca_label, ca_id FROM category WHERE ca_id < 7777")); + + case 1: + case "end": + return _context21.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getDates", + value: function getDates() { + var updateColExists, selectColStmt; + return _regenerator.default.async(function getDates$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + _context22.next = 2; + return _regenerator.default.awrap(RssContentManager.checkIfColumnExists("article", "ar_updatedate")); + + case 2: + updateColExists = _context22.sent; + selectColStmt = "" + (updateColExists ? "COALESCE( NULLIF( ar_updatedate,'' ), ar_articledate )" : "ar_articledate"); + return _context22.abrupt("return", RssContentManager.openTransaction("SELECT DISTINCT " + selectColStmt + " as ar_articledate FROM article ORDER BY ar_articledate ASC")); + + case 5: + case "end": + return _context22.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return RssContentManager; + }(); + + exports.default = RssContentManager; + RssContentManager.MIGRATIONS = [{ + version: 29400, + queries: ["CREATE TABLE IF NOT EXISTS resource ( re_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, re_typeId INTEGER NOT NULL, re_value TEXT NOT NULL );", "CREATE TABLE IF NOT EXISTS resource_rel ( rr_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, rr_feedId INTEGER NOT NULL, rr_resourceId INTEGER NOT NULL );", "CREATE TABLE IF NOT EXISTS resource_type ( rt_id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, rt_name VARCHAR(255) );"] + }]; +},2208,[5,80,7,8,711,574,462,2051]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getJsonDbUpdate = getJsonDbUpdate; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _axios = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + function getJsonDbUpdate(newestEntry, categoryIds) { + var _global$getRSSActiveP, baseRssUpdateURL, response; + + return _regenerator.default.async(function getJsonDbUpdate$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _global$getRSSActiveP = global.getRSSActivePSetup(), baseRssUpdateURL = _global$getRSSActiveP.baseRssUpdateURL; + + if (categoryIds && categoryIds.length) { + baseRssUpdateURL += "&catIds=" + categoryIds.join(); + } + + baseRssUpdateURL += "&newestEntry=" + newestEntry; + _context.next = 5; + return _regenerator.default.awrap(_axios.default.get(baseRssUpdateURL)); + + case 5: + response = _context.sent; + return _context.abrupt("return", response.data); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } +},2209,[5,80,432]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.sendToAnalytics = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var getGalleryAnalytics = function getGalleryAnalytics(params) { + var _global$getActivePSet = global.getActivePSetup(), + xpaper = _global$getActivePSet.xpaper; + + var category = params.category || ""; + var title = params.title || ""; + var type = params.type || ""; + var gallery_id = params.gallery_id || ""; + var index = params.index, + screen_name = params.screen_name; + var screen = "/rssapp/" + (0, _$$_REQUIRE(_dependencyMap[3]).gaBreakout)() + "/" + xpaper + "/" + category + "/gallery/" + title + "/" + index + "/" + type + "/" + gallery_id; + return { + screen: screen, + firebaseEvent: { + customEvent: "live_news_gallery", + customParams: (0, _extends2.default)({}, (0, _$$_REQUIRE(_dependencyMap[3]).mapParamsToFirebaseCustomDimensions)(params), { + xpaper: xpaper, + category: category, + title: title, + index: index, + type: type, + gallery_id: gallery_id + }) + }, + firebaseScreenView: screen_name + }; + }; + + var getDrawerAnalytics = function getDrawerAnalytics(params) { + var _global$getActivePSet2 = global.getActivePSetup(), + xpaper = _global$getActivePSet2.xpaper; + + var layout = params.layout, + action = params.action, + extra = params.extra, + screen_name = params.screen_name; + var feedUrl = params.feedUrl, + drawerItemKey = params.drawerItemKey; + drawerItemKey = (0, _$$_REQUIRE(_dependencyMap[4]).parseExtra)(extra, "analyticsSectionName", drawerItemKey); + feedUrl = (0, _$$_REQUIRE(_dependencyMap[4]).parseExtra)(extra, "analyticsSectionURL", feedUrl); + var screen = "/rssapp/" + (0, _$$_REQUIRE(_dependencyMap[3]).gaBreakout)() + "/" + xpaper + "/" + drawerItemKey; + + if (layout) { + screen = screen + "/" + layout; + } + + return { + screen: screen, + params: { + action: _$$_REQUIRE(_dependencyMap[5]).analyticsScreenTypes.RSS_DRAWER, + type: "read", + apptype: "rss", + displayName: drawerItemKey, + feedUrl: feedUrl + }, + remp: drawerItemKey, + firebaseEvent: { + customEvent: "live_news_drawer", + customParams: (0, _extends2.default)({}, (0, _$$_REQUIRE(_dependencyMap[3]).mapParamsToFirebaseCustomDimensions)(params), { + xpaper: xpaper, + name: drawerItemKey, + layout: layout, + action: action + }) + }, + firebaseScreenView: screen_name + }; + }; + + var getDrawerLinkAnalytics = function getDrawerLinkAnalytics(params) { + return { + firebaseEvent: { + customEvent: "open_link", + customParams: (0, _extends2.default)({}, (0, _$$_REQUIRE(_dependencyMap[3]).mapParamsToFirebaseCustomDimensions)(params), { + label: params.label + }) + } + }; + }; + + var getDownloadRssDbAnalytics = function getDownloadRssDbAnalytics(params) { + return { + firebaseEvent: { + customEvent: "download_rss_db", + customParams: (0, _extends2.default)({}, (0, _$$_REQUIRE(_dependencyMap[3]).mapParamsToFirebaseCustomDimensions)(params), { + domain: params.domain + }) + } + }; + }; + + var getFullscreenAnalytics = function getFullscreenAnalytics(params) { + var _global$getActivePSet3 = global.getActivePSetup(), + xpaper = _global$getActivePSet3.xpaper; + + var unixDate = params.unixDate, + category = params.category, + title = params.title, + source = params.source, + screen_name = params.screen_name; + + var date = _$$_REQUIRE(_dependencyMap[6]).DateUtils.unixToString(unixDate, "YYYYMMDD_HHmm"); + + var device = (0, _$$_REQUIRE(_dependencyMap[3]).gaBreakout)(); + var screen = "/rssapp/" + device + "/" + category + "/" + date + "/" + title; + return { + screen: screen, + params: { + action: _$$_REQUIRE(_dependencyMap[5]).analyticsScreenTypes.RSS_ARTICLE_READ, + type: "read", + apptype: "rss", + date: date, + category: category, + articletitle: title, + articlesource: source, + devicetype: device + }, + remp: title, + firebaseEvent: { + customEvent: "live_news_read_article", + customParams: (0, _extends2.default)({}, (0, _$$_REQUIRE(_dependencyMap[3]).mapParamsToFirebaseCustomDimensions)(params), { + xpaper: xpaper, + category: category, + date: date, + title: title + }) + }, + firebaseScreenView: screen_name + }; + }; + + var sendToAnalytics = function sendToAnalytics() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var event_action = params.event_action, + rest = (0, _objectWithoutProperties2.default)(params, ["event_action"]); + + if (!event_action) {} else { + var result = {}; + + switch (event_action) { + case "live_news_gallery": + case "epaper_gallery": + result = getGalleryAnalytics((0, _extends2.default)({}, rest, { + action: event_action + })); + break; + + case "fullscreen": + result = getFullscreenAnalytics((0, _extends2.default)({}, rest, { + action: event_action + })); + break; + + case "drawer": + result = getDrawerAnalytics(rest); + break; + + case "open_link": + result = getDrawerLinkAnalytics((0, _extends2.default)({}, rest, { + action: event_action + })); + break; + + case "download_rss_db": + result = getDownloadRssDbAnalytics((0, _extends2.default)({}, rest, { + action: event_action + })); + break; + } + + var _result = result, + screen = _result.screen, + remp = _result.remp, + event = _result.event, + analyticsParams = _result.params, + firebaseEvent = _result.firebaseEvent, + firebaseScreenView = _result.firebaseScreenView; + + if (screen) { + (0, _$$_REQUIRE(_dependencyMap[7]).trackScreen)(screen, analyticsParams); + } + + if (remp) { + (0, _$$_REQUIRE(_dependencyMap[7]).trackRempAccount)(remp); + } + + if (event) { + (0, _$$_REQUIRE(_dependencyMap[7]).trackEvent)(event); + } + + if (firebaseEvent) { + (0, _$$_REQUIRE(_dependencyMap[7]).trackCustomFirebaseEvent)(firebaseEvent); + } + + if (firebaseScreenView) { + (0, _$$_REQUIRE(_dependencyMap[7]).trackCustomFirebaseScreen)(firebaseScreenView, screen); + } + } + }; + + exports.sendToAnalytics = sendToAnalytics; +},2210,[5,108,6,1892,2046,1893,462,1871]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.TabNavigator = TabNavigator; + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _tabBar = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var Tab = (0, _$$_REQUIRE(_dependencyMap[7]).createMaterialTopTabNavigator)(); + + function TabNavigator(_ref) { + var tabs = _ref.tabs, + tabScreen = _ref.tabScreen, + tabScreenOptions = _ref.tabScreenOptions, + tabStyles = _ref.tabStyles, + width = _ref.width, + primaryColor = _ref.primaryColor, + supportColor = _ref.supportColor, + tabProps = (0, _objectWithoutProperties2.default)(_ref, ["tabs", "tabScreen", "tabScreenOptions", "tabStyles", "width", "primaryColor", "supportColor"]); + + if (!tabs || !tabs.length) { + return null; + } + + var screenOptions = tabProps.screenOptions, + rest = (0, _objectWithoutProperties2.default)(tabProps, ["screenOptions"]); + return _react.default.createElement(Tab.Navigator, (0, _extends2.default)({ + screenOptions: (0, _extends2.default)({ + headerShown: false, + lazy: true, + lazyPreloadDistance: 1 + }, screenOptions), + backBehavior: "initialRoute", + initialLayout: { + width: width + }, + layoutDirection: _$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isRTL() ? "rtl" : "ltr", + tabBar: function tabBar(navProps) { + return _react.default.createElement(_tabBar.default, (0, _extends2.default)({ + tabs: tabs, + tabBarWidth: width, + tabStyles: tabStyles, + primaryColor: primaryColor, + supportColor: supportColor + }, navProps)); + } + }, rest), tabs.map(function (_ref2, index) { + var route = _ref2.route, + tab = (0, _objectWithoutProperties2.default)(_ref2, ["route"]); + return _react.default.createElement(Tab.Screen, { + key: route, + name: route, + options: tabScreenOptions + }, function (navProps) { + return typeof tabScreen === "function" ? tabScreen((0, _extends2.default)({ + route: route, + index: index + }, tab), navProps) : null; + }); + })); + } + + TabNavigator.propTypes = { + tabScreen: _propTypes.default.func, + tabScreenOptions: _propTypes.default.object, + tabs: _tabBar.default.propTypes.tabs, + tabStyles: _tabBar.default.propTypes.tabStyles, + width: _propTypes.default.number, + primaryColor: _tabBar.default.propTypes.primaryColor, + supportColor: _tabBar.default.propTypes.supportColor + }; + TabNavigator.defaultProps = { + tabs: [], + tabScreen: null, + tabScreenOptions: {}, + tabStyles: {}, + width: _reactNative.Dimensions.get("window").width, + primaryColor: _$$_REQUIRE(_dependencyMap[8]).colors.white, + supportColor: _$$_REQUIRE(_dependencyMap[8]).colors.black + }; + var _default = TabNavigator; + exports.default = _default; +},2211,[5,6,108,17,28,201,2212,1930,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _tabItem = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var styles = _reactNative.StyleSheet.create({ + container: { + backgroundColor: _$$_REQUIRE(_dependencyMap[8]).colors.white, + height: 50 + }, + scrollview: { + flexDirection: "row", + flex: 1 + }, + button: { + alignItems: "center", + justifyContent: "center" + }, + indicator: { + backgroundColor: _$$_REQUIRE(_dependencyMap[8]).colors.black, + bottom: 0, + height: 2, + left: 0, + position: "absolute", + right: 0, + width: 1 + }, + text: { + color: _$$_REQUIRE(_dependencyMap[8]).colors.black, + fontSize: 14, + textAlign: "center" + }, + darkShadow: (0, _extends2.default)({}, _reactNative.Platform.select({ + android: { + elevation: 1 + }, + ios: { + zIndex: 1, + shadowColor: _$$_REQUIRE(_dependencyMap[8]).colors.black, + shadowOffset: { + width: 0, + height: 2 + }, + shadowOpacity: 0.5, + shadowRadius: 5 + } + })) + }); + + function TabBar(_ref) { + var tabs = _ref.tabs, + state = _ref.state, + navigation = _ref.navigation, + position = _ref.position, + tabStyles = _ref.tabStyles, + supportColor = _ref.supportColor, + primaryColor = _ref.primaryColor, + tabBarWidth = _ref.tabBarWidth; + var tabBarStyle = tabStyles.tabBarStyle, + tabBarIndicatorStyle = tabStyles.tabBarIndicatorStyle, + tabBarItemStyle = tabStyles.tabBarItemStyle, + tabBarLabelStyle = tabStyles.tabBarLabelStyle, + tabBarIconStyle = tabStyles.tabBarIconStyle; + + var _useState = (0, _react.useState)([]), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + widths = _useState2[0], + setWidths = _useState2[1]; + + var scrollViewRef = (0, _react.useRef)(null); + var tempWidths = (0, _react.useRef)([]); + var transform = []; + var inputRange = state.routes.map(function (route, index) { + return index; + }); + var outputRangeRef = (0, _react.useRef)([]); + + var getTranslateX = function getTranslateX(xPosition, xRoutes, xWidths) { + var outputRange = xRoutes.reduce(function (result, item, index) { + if (index === 0) { + return [xWidths[0] / 2]; + } + + return [].concat((0, _toConsumableArray2.default)(result), [result[index - 1] + xWidths[index - 1] / 2 + xWidths[index] / 2]); + }, []); + outputRangeRef.current = outputRange; + var translateX = xPosition.interpolate({ + inputRange: inputRange, + outputRange: outputRange, + extrapolate: "clamp" + }); + return _reactNative.Animated.multiply(translateX, _reactNative.I18nManager.isRTL ? -1 : 1); + }; + + if (state.routes.length > 1 && widths.length === state.routes.length && !widths.includes(undefined)) { + var translateX = getTranslateX(position, state.routes, widths); + transform.push({ + translateX: translateX + }); + var outputRange = inputRange.map(function (_, i) { + return widths[i]; + }); + transform.push({ + scaleX: state.routes.length > 1 ? position.interpolate({ + inputRange: inputRange, + outputRange: outputRange, + extrapolate: "clamp" + }) : outputRange[0] + }); + } + + (0, _react.useEffect)(function () { + if (state.routes.length > 1 && widths.length === state.routes.length && !widths.includes(undefined)) { + if (state.index === 0) { + var _scrollViewRef$curren; + + (_scrollViewRef$curren = scrollViewRef.current) == null ? undefined : _scrollViewRef$curren.scrollTo({ + x: 0 + }); + } else { + var _scrollViewRef$curren2; + + (_scrollViewRef$curren2 = scrollViewRef.current) == null ? undefined : _scrollViewRef$curren2.scrollTo({ + x: outputRangeRef.current[state.index] - tabBarWidth / 2 + }); + } + } + }, [state.index, state.routes.length, widths]); + + var _onLayout = function onLayout(event, index) { + var width = event.nativeEvent.layout.width; + tempWidths.current[index] = width; + setWidths((0, _toConsumableArray2.default)(tempWidths.current)); + }; + + var labels = state.routes.map(function (route, index) { + var label = tabs[index].label; + var isFocused = state.index === index; + + var onPress = function onPress() { + var event = navigation.emit({ + type: "tabPress", + target: route.key, + canPreventDefault: true + }); + + if (!isFocused && !event.defaultPrevented) { + navigation.navigate({ + name: route.name, + merge: true + }); + } + }; + + return _react.default.createElement(_reactNative.TouchableOpacity, { + key: route.key, + activeOpacity: 0.5, + accessibilityRole: "button", + accessibilityState: isFocused ? { + selected: true + } : {}, + accessibilityLabel: label, + onPress: onPress, + style: styles.button + }, _react.default.createElement(_reactNative.View, { + onLayout: function onLayout(event) { + return _onLayout(event, index); + } + }, _react.default.createElement(_tabItem.default, (0, _extends2.default)({ + supportColor: supportColor, + style: tabBarItemStyle, + textStyle: tabBarLabelStyle, + iconStyle: tabBarIconStyle, + focused: isFocused + }, tabs[index])))); + }); + return _react.default.createElement(_reactNative.View, { + style: [styles.container, styles.darkShadow, { + backgroundColor: primaryColor + }, tabBarStyle] + }, _react.default.createElement(_reactNative.Animated.ScrollView, { + horizontal: true, + ref: scrollViewRef, + showsHorizontalScrollIndicator: false, + style: [styles.scrollview] + }, labels, _react.default.createElement(_reactNative.Animated.View, { + style: [styles.indicator, { + transform: transform, + backgroundColor: supportColor + }, tabBarIndicatorStyle] + }))); + } + + TabBar.propTypes = { + tabs: _propTypes.default.arrayOf(_propTypes.default.shape(_tabItem.default.propTypes)), + tabBarWidth: _propTypes.default.number, + tabStyles: _propTypes.default.shape({ + tabBarStyle: _propTypes.default.object, + tabBarIndicatorStyle: _propTypes.default.object, + tabBarItemStyle: _tabItem.default.propTypes.style, + tabBarLabelStyle: _tabItem.default.propTypes.textStyle, + tabBarIconStyle: _tabItem.default.propTypes.iconStyle + }), + state: _propTypes.default.object, + navigation: _propTypes.default.object, + position: _propTypes.default.object, + primaryColor: _propTypes.default.string, + supportColor: _propTypes.default.string + }; + TabBar.defaultProps = { + tabs: [], + tabBarWidth: 0 + }; + var _default = TabBar; + exports.default = _default; +},2212,[5,21,41,6,17,28,201,2213,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var styles = _reactNative.StyleSheet.create({ + container: { + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + flex: 1, + paddingHorizontal: 20, + backgroundColor: _$$_REQUIRE(_dependencyMap[6]).colors.white + }, + icon: { + marginHorizontal: 5 + }, + text: { + color: _$$_REQUIRE(_dependencyMap[6]).colors.black + } + }); + + var _getStyle = function _getStyle(style, item, focused) { + return typeof style === "function" ? style(item, focused) : {}; + }; + + function TabItem(props) { + var label = props.label, + icon = props.icon, + item = props.item, + supportColor = props.supportColor, + style = props.style, + textStyle = props.textStyle, + iconStyle = props.iconStyle, + focused = props.focused; + return _react.default.createElement(_reactNative.View, { + style: [styles.container, _getStyle(style, item, focused)] + }, icon ? _react.default.createElement(_imageIconChooserComponent.default, { + forceRNComponent: true, + style: [styles.icon, focused ? { + tintColor: supportColor + } : {}, _getStyle(iconStyle, item, focused)], + source: { + uri: icon, + cache: "reload", + width: 20, + height: 20 + }, + resizeMode: "contain" + }) : null, _react.default.createElement(_fontText.default, { + style: [styles.text, focused ? { + color: supportColor + } : {}, _getStyle(textStyle, item, focused)], + numberOfLines: 1 + }, label)); + } + + TabItem.propTypes = { + label: _propTypes.default.string.isRequired, + icon: _propTypes.default.string, + item: _propTypes.default.object, + supportColor: _propTypes.default.string, + focused: _propTypes.default.bool, + style: _propTypes.default.func, + textStyle: _propTypes.default.func, + iconStyle: _propTypes.default.func + }; + TabItem.defaultProps = { + focused: false + }; + var _default = TabItem; + exports.default = _default; +},2213,[5,17,28,201,1970,1879,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2214,[2215]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RssContentScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _DatabaseHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _RssContentHelper = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Paywall = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _PushHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _cardDailymotion = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RssContentScreen = function (_RssBaseScreen) { + (0, _inherits2.default)(RssContentScreen, _RssBaseScreen); + + var _super = _createSuper(RssContentScreen); + + function RssContentScreen(props) { + (0, _classCallCheck2.default)(this, RssContentScreen); + return _super.call(this, props, { + userAdDisabled: global.getAdsConfig().isUserAdDisabled() + }); + } + + (0, _createClass2.default)(RssContentScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(RssContentScreen.prototype), "componentDidMount", this).call(this); + + var _global$getRssIndex = global.getRssIndex(), + paywallEnabled = _global$getRssIndex.paywallEnabled; + + if (paywallEnabled && this.isFirstScreen()) { + _Paywall.default.init(); + } + + var settings = this.props.item; + var disableAds = settings.disableAds; + + if (disableAds !== "1") { + this.changeAdsVisibility = _$$_REQUIRE(_dependencyMap[21]).EventRegister.on(_events.default.CHANGE_ADS_VISIBILITY, function (_ref) { + var hideAds = _ref.hideAds; + var userAdDisabled = _this.state.userAdDisabled; + + if (hideAds && !userAdDisabled || !hideAds && userAdDisabled) { + _this._manageDatabase({ + forceUpdate: false + }); + } + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssContentScreen.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[21]).EventRegister.rm(this.changeAdsVisibility); + } + }, { + key: "forceUpdateCheck", + value: function forceUpdateCheck() { + return _LiveConfig.default.isRssStartingUp() || _LiveConfig.default.isRssDbDeleted() || this.props.isLive; + } + }, { + key: "didFocus", + value: function didFocus() { + var forceUpdate; + return _regenerator.default.async(function didFocus$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(RssContentScreen.prototype), "didFocus", this).call(this); + + if (!(_LiveConfig.default.isRssDbDeleted() && !this.isFirstScreen())) { + _context.next = 5; + break; + } + + this.props.navigation.goBack(); + _context.next = 21; + break; + + case 5: + _context.next = 7; + return _regenerator.default.awrap(this._handlePush()); + + case 7: + if (_context.sent) { + _context.next = 20; + break; + } + + forceUpdate = this.forceUpdateCheck(); + _context.t0 = this.isFirstScreen(); + + if (!_context.t0) { + _context.next = 14; + break; + } + + _context.next = 13; + return _regenerator.default.awrap(_DatabaseHelper.default.rssContentDatabaseExists()); + + case 13: + _context.t0 = _context.sent; + + case 14: + if (!_context.t0) { + _context.next = 18; + break; + } + + _LiveConfig.default.setRssStartingUp(false); + + _context.next = 18; + return _regenerator.default.awrap(this._retrieveData(this.props.item)); + + case 18: + _context.next = 20; + return _regenerator.default.awrap(this._manageDatabase({ + forceUpdate: forceUpdate + })); + + case 20: + _LiveConfig.default.setRssDbDeleted(false); + + case 21: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "onRefresh", + value: function onRefresh(toastPriority, hideRefresh) { + return _regenerator.default.async(function onRefresh$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", this._manageDatabase({ + forceUpdate: true, + toastPriority: toastPriority, + hideRefresh: hideRefresh + })); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_handleOpenUrlPush", + value: function _handleOpenUrlPush(value) { + var navigation = this.props.navigation; + navigation.dispatch(_$$_REQUIRE(_dependencyMap[22]).CommonActions.navigate({ + name: "WebScreen", + params: { + shareButtonIsEnabled: global.getRssIndex().shareButtonOnPushNotificationURLs, + url: value + } + })); + } + }, { + key: "_handleOpenCategory", + value: function _handleOpenCategory(value) { + var _this$props = this.props, + navigation = _this$props.navigation, + getRouteKey = _this$props.getRouteKey; + + if (typeof getRouteKey === "function") { + navigation.navigate(getRouteKey(value)); + } + } + }, { + key: "_handleArticlePush", + value: function _handleArticlePush(value, action) { + var items, source, hashIndex, pushItem, timeToOpenPush; + return _regenerator.default.async(function _handleArticlePush$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + items = []; + + if (!(action === "openArticleBySource")) { + _context3.next = 11; + break; + } + + source = value; + hashIndex = source.indexOf("#"); + + if (hashIndex > -1) { + source = source.substring(0, hashIndex); + } + + _context3.next = 8; + return _regenerator.default.awrap(_RssContentHelper.default.getArticleBySource(source)); + + case 8: + items = _context3.sent; + _context3.next = 14; + break; + + case 11: + _context3.next = 13; + return _regenerator.default.awrap(_RssContentHelper.default.getArticleByFeedId(value)); + + case 13: + items = _context3.sent; + + case 14: + pushItem = items[0]; + timeToOpenPush = new Date().getTime() - global.openingPushNotificationDate; + + if (pushItem) { + this._onListItemClick(items, pushItem); + } else if (action === "openArticleBySource") { + this._handleOpenUrlPush(value); + } else {} + + _context3.next = 21; + break; + + case 19: + _context3.prev = 19; + _context3.t0 = _context3["catch"](0); + + case 21: + case "end": + return _context3.stop(); + } + } + }, null, this, [[0, 19]], Promise); + } + }, { + key: "_handlePush", + value: function _handlePush() { + var _this2 = this; + + var _PushHelper$getPush, action, value; + + return _regenerator.default.async(function _handlePush$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + if (_PushHelper.default.isTherePush()) { + _context5.next = 2; + break; + } + + return _context5.abrupt("return", false); + + case 2: + if (_PushHelper.default.pushNeedFeedUpdate()) { + _context5.next = 15; + break; + } + + _PushHelper$getPush = _PushHelper.default.getPush(), action = _PushHelper$getPush.action, value = _PushHelper$getPush.value; + + _PushHelper.default.clearPush(); + + _context5.t0 = action; + _context5.next = _context5.t0 === "openCategory" ? 8 : _context5.t0 === "openUrl" ? 10 : 12; + break; + + case 8: + this._handleOpenCategory(value); + + return _context5.abrupt("break", 12); + + case 10: + this._handleOpenUrlPush(value); + + return _context5.abrupt("break", 12); + + case 12: + this._manageDatabase({ + forceUpdate: this.forceUpdateCheck() + }); + + _context5.next = 23; + break; + + case 15: + _context5.prev = 15; + _context5.next = 18; + return _regenerator.default.awrap(this._manageDatabase({ + forceUpdate: true, + callbackForPush: function callbackForPush() { + var push, _action, _value; + + return _regenerator.default.async(function callbackForPush$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + push = _PushHelper.default.getPush(); + + if (!push) { + _context4.next = 11; + break; + } + + _action = push.action, _value = push.value; + _context4.prev = 3; + _context4.next = 6; + return _regenerator.default.awrap(_this2._handleArticlePush(_value, _action)); + + case 6: + _context4.next = 10; + break; + + case 8: + _context4.prev = 8; + _context4.t0 = _context4["catch"](3); + + case 10: + _PushHelper.default.clearPush(); + + case 11: + case "end": + return _context4.stop(); + } + } + }, null, null, [[3, 8]], Promise); + } + })); + + case 18: + _context5.next = 23; + break; + + case 20: + _context5.prev = 20; + _context5.t1 = _context5["catch"](15); + + _PushHelper.default.clearPush(); + + case 23: + return _context5.abrupt("return", true); + + case 24: + case "end": + return _context5.stop(); + } + } + }, null, this, [[15, 20]], Promise); + } + }, { + key: "_manageDatabase", + value: function _manageDatabase(_ref2) { + var _ref2$forceUpdate, forceUpdate, _ref2$toastPriority, toastPriority, _ref2$callbackForPush, callbackForPush, _ref2$hideRefresh, hideRefresh, isOnline, categoryName, result; + + return _regenerator.default.async(function _manageDatabase$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _ref2$forceUpdate = _ref2.forceUpdate, forceUpdate = _ref2$forceUpdate === undefined ? false : _ref2$forceUpdate, _ref2$toastPriority = _ref2.toastPriority, toastPriority = _ref2$toastPriority === undefined ? _RssContentHelper.DbDownloadPriority.LOW : _ref2$toastPriority, _ref2$callbackForPush = _ref2.callbackForPush, callbackForPush = _ref2$callbackForPush === undefined ? function () {} : _ref2$callbackForPush, _ref2$hideRefresh = _ref2.hideRefresh, hideRefresh = _ref2$hideRefresh === undefined ? function () {} : _ref2$hideRefresh; + isOnline = _$$_REQUIRE(_dependencyMap[23]).NetworkUtils.isOnline(); + + if (isOnline) { + _context6.next = 7; + break; + } + + this._displayToast(global.strings("err_internet_connection")); + + callbackForPush(); + _context6.next = 19; + break; + + case 7: + categoryName = this.props.isLive ? this.props.item.drawerItemKey : ""; + + if (!this.state.loading && _LiveConfig.default.isRssStartingUp()) { + this.setState({ + loading: true + }); + } + + if (!forceUpdate) { + _context6.next = 18; + break; + } + + _LiveConfig.default.setRssStartingUp(false); + + _context6.next = 13; + return _regenerator.default.awrap(_DatabaseHelper.default.downloadRssContent(categoryName, global.getUserSettings().appSubLayoutChanged, callbackForPush, hideRefresh)); + + case 13: + result = _context6.sent; + + if (result && toastPriority >= result.priority) { + this._displayToast(result.msg || result.error); + } + + global.getUserSettings().storeNewSubLayout(); + _context6.next = 19; + break; + + case 18: + callbackForPush(); + + case 19: + _context6.next = 21; + return _regenerator.default.awrap(!_DatabaseHelper.default.rssContentDatabaseExists()); + + case 21: + if (!_context6.sent) { + _context6.next = 26; + break; + } + + _context6.next = 24; + return _regenerator.default.awrap(this._handleForceExit()); + + case 24: + _context6.next = 28; + break; + + case 26: + _context6.next = 28; + return _regenerator.default.awrap(this._retrieveData(this.props.item)); + + case 28: + case "end": + return _context6.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_retrieveData", + value: function _retrieveData(_ref3) { + var _this3 = this; + + var drawerItemKey, _this$props2, isHome, settings, disableAds, userAdDisabled, removeAdvertisements, orientation, state, items, liveVideoItem, liveVideoItemIndex, i, _items$i, action, image, firstArticle, _global$getRssIndex2, drawerItemsFlat, drawerItem; + + return _regenerator.default.async(function _retrieveData$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + drawerItemKey = _ref3.drawerItemKey; + _this$props2 = this.props, isHome = _this$props2.isHome, settings = _this$props2.item; + disableAds = settings.disableAds; + userAdDisabled = global.getAdsConfig().isUserAdDisabled(); + removeAdvertisements = disableAds === "1" || userAdDisabled; + orientation = _deviceUtils.default.getCurrentOrientation(); + _context7.prev = 6; + items = []; + + if (!isHome) { + _context7.next = 14; + break; + } + + _context7.next = 11; + return _regenerator.default.awrap(_RssContentHelper.default.getArticlesInHomeCategory(drawerItemKey, removeAdvertisements)); + + case 11: + items = _context7.sent; + _context7.next = 17; + break; + + case 14: + _context7.next = 16; + return _regenerator.default.awrap(_RssContentHelper.default.getArticlesByCategory(drawerItemKey, removeAdvertisements)); + + case 16: + items = _context7.sent; + + case 17: + if (!(items && items.length > 0)) { + _context7.next = 31; + break; + } + + liveVideoItemIndex = items.findIndex(function (item) { + return (0, _$$_REQUIRE(_dependencyMap[24]).itemHasLiveStreamDailymotionVideo)(item) && item.isHighlightedBox; + }); + + if (liveVideoItemIndex >= 0) { + liveVideoItem = items.splice(liveVideoItemIndex, 1)[0]; + } + + i = 0; + + case 21: + if (!(i < items.length)) { + _context7.next = 31; + break; + } + + _items$i = items[i], action = _items$i.action, image = _items$i.image; + + if (!(action.hasMainActionOpenLinkToCategory() && action.hasPropertyLatestArticleImage() && !image)) { + _context7.next = 28; + break; + } + + _context7.next = 26; + return _regenerator.default.awrap(_RssContentHelper.default.getFirstArticleByCategory(action.main.category, true)); + + case 26: + firstArticle = _context7.sent; + + if (firstArticle) { + items[i].image = firstArticle.image; + _global$getRssIndex2 = global.getRssIndex(), drawerItemsFlat = _global$getRssIndex2.drawerItemsFlat; + drawerItem = _navigationUtils.default.getDrawerItem(drawerItemsFlat, action.main.category); + + if (drawerItem) { + items[i].title = drawerItem.displayName; + } + + items[i].date = ""; + } + + case 28: + i++; + _context7.next = 21; + break; + + case 31: + state = { + items: items, + orientation: orientation, + loading: false, + userAdDisabled: userAdDisabled, + liveVideoItem: liveVideoItem + }; + _context7.next = 38; + break; + + case 34: + _context7.prev = 34; + _context7.t0 = _context7["catch"](6); + this.log(_context7.t0); + state = { + orientation: orientation, + error: true, + loading: false, + userAdDisabled: userAdDisabled + }; + + case 38: + return _context7.abrupt("return", new Promise(function (resolve) { + _this3.setState(state, resolve); + })); + + case 39: + case "end": + return _context7.stop(); + } + } + }, null, this, [[6, 34]], Promise); + } + }, { + key: "getTag", + value: function getTag() { + var item = this.props.item; + return "Live News Category (" + item.drawerItemKey + ")"; + } + }, { + key: "_getCategoryHeader", + value: function _getCategoryHeader() { + var liveVideoItem = this.state.liveVideoItem; + + if (liveVideoItem) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).Css, { + classes: ["rss-screen-category-header-dailymotion"] + }, _react.default.createElement(_cardDailymotion.default, { + item: liveVideoItem, + style: { + width: "100%", + height: (0, _$$_REQUIRE(_dependencyMap[26]).HEADER_HEIGHT)() + }, + autoplay: true + })); + } + + return (0, _get2.default)((0, _getPrototypeOf2.default)(RssContentScreen.prototype), "_getCategoryHeader", this).call(this); + } + }, { + key: "_render", + value: function _render() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).Css, { + classes: ["rss-content"] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, this._getComponent())); + } + }]); + return RssContentScreen; + }(_$$_REQUIRE(_dependencyMap[27]).RssBaseScreen); + + exports.RssContentScreen = RssContentScreen; + RssContentScreen.propTypes = (0, _extends2.default)({ + isHome: _propTypes.default.bool, + isLive: _propTypes.default.bool, + getRouteKey: _propTypes.default.func + }, _$$_REQUIRE(_dependencyMap[27]).RssBaseScreen.propTypes); + RssContentScreen.defaultProps = { + showHeader: false, + isHome: false, + isLive: false + }; +},2215,[5,80,6,7,8,90,12,14,16,17,201,28,2216,2207,1872,458,1862,2134,460,2128,2045,572,1002,462,1975,699,2217,2218]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var DatabaseHelper = function () { + function DatabaseHelper() { + (0, _classCallCheck2.default)(this, DatabaseHelper); + } + + (0, _createClass2.default)(DatabaseHelper, null, [{ + key: "rssContentDatabaseExists", + value: function rssContentDatabaseExists() { + return _regenerator.default.async(function rssContentDatabaseExists$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _RssContentHelper.default.databaseExists()); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "downloadRssContent", + value: function downloadRssContent(categoryName, forceDownload, callback, hideRefresh) { + return _regenerator.default.async(function downloadRssContent$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", _RssContentHelper.default.download(categoryName, forceDownload, callback, hideRefresh)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }]); + return DatabaseHelper; + }(); + + exports.default = DatabaseHelper; +},2216,[5,80,7,8,2207]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.HEADER_HEIGHT_BASE = exports.HEADER_HEIGHT_NO_IMAGE = exports.HEADER_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var HEADER_HEIGHT = function HEADER_HEIGHT() { + return _$$_REQUIRE(_dependencyMap[1]).PlatformUtils.isTablet() ? 600 : 300; + }; + + exports.HEADER_HEIGHT = HEADER_HEIGHT; + var HEADER_HEIGHT_NO_IMAGE = 50; + exports.HEADER_HEIGHT_NO_IMAGE = HEADER_HEIGHT_NO_IMAGE; + var HEADER_HEIGHT_BASE = _reactNative.StyleSheet.hairlineWidth; + exports.HEADER_HEIGHT_BASE = HEADER_HEIGHT_BASE; + + var _default = _reactNative.StyleSheet.create({ + backButton: { + alignItems: "center", + justifyContent: "center", + width: 40, + height: 40, + borderRadius: 20, + backgroundColor: "white", + margin: 2 + }, + backIcon: { + fontSize: 24, + marginLeft: 0, + marginRight: 0 + }, + root: { + flex: 1, + minHeight: 0, + backgroundColor: "white" + }, + body: { + flex: 1, + minHeight: 0 + }, + fixedHeaderContainer: { + flexDirection: "column", + justifyContent: "space-between", + padding: 4 + }, + bottomContent: { + flex: 1 + } + }); + + exports.default = _default; +},2217,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2218,[2219]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RssBaseScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _AdsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _emptyComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var InterstitialsKeysAndValues = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[21])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _rssVideoCardComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getNativoAds(), + NativoSDK = _OptionalPackages$get.NativoSDK; + + var RssBaseScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(RssBaseScreen, _NavigationBaseScreen); + + var _super = _createSuper(RssBaseScreen); + + function RssBaseScreen(props, state) { + var _this; + + var startLoading = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + (0, _classCallCheck2.default)(this, RssBaseScreen); + _this = _super.call(this, props, (0, _extends2.default)({}, state, { + layout: global.getUserSettings().layout, + loading: startLoading, + error: false, + refreshing: false, + footerHeight: -1, + clearViews: true + })); + _this.getHeader = _this._getHeader.bind((0, _assertThisInitialized2.default)(_this)); + _this.getEmpty = _this._getEmpty.bind((0, _assertThisInitialized2.default)(_this)); + _this.getError = _this._getError.bind((0, _assertThisInitialized2.default)(_this)); + _this.onErrorViewClick = _this._onErrorViewClick.bind((0, _assertThisInitialized2.default)(_this)); + _this.onListRefresh = _this._onListRefresh.bind((0, _assertThisInitialized2.default)(_this)); + _this.onListItemClick = _this._onListItemClick.bind((0, _assertThisInitialized2.default)(_this)); + _this.onUserScroll = _this._onUserScroll.bind((0, _assertThisInitialized2.default)(_this)); + var navigation = props.navigation, + item = props.item; + + if (item) { + navigation.setParams({ + item: item + }); + } + + if (global.isDebug && _optionalPackageUtils.default.isNativoSDKAvailable()) { + NativoSDK.enableDevLogs(); + NativoSDK.enableTestAdvertisementsWithType(NativoSDK.AdTypes.NATIVE); + } + + return _this; + } + + (0, _createClass2.default)(RssBaseScreen, [{ + key: "onRefresh", + value: function onRefresh(priority, callback) {} + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssBaseScreen.prototype), "handleBackButton", this).call(this); + var navigation = this.props.navigation; + + if (this.isFirstScreen()) { + if (_LiveConfig.default.getStartUpNavigator() === "RssNavigator") { + this.closeAlert(); + } else { + _NavigationService.default.main.reset("NewsmemoryNavigator"); + } + } else { + navigation.goBack(); + } + + return true; + } + }, { + key: "isFirstScreen", + value: function isFirstScreen() { + var isHome = this.props.isHome; + return isHome; + } + }, { + key: "trackScreen", + value: function trackScreen() {} + }, { + key: "didFocus", + value: function didFocus() { + var _this2 = this; + + this._toggleClearViews(false); + + (0, _get2.default)((0, _getPrototypeOf2.default)(RssBaseScreen.prototype), "didFocus", this).call(this); + var layout = this.state.layout; + var item = this.props.item; + (0, _$$_REQUIRE(_dependencyMap[24]).sendToAnalytics)((0, _extends2.default)({ + event_action: "drawer", + screen_name: this.getTag(), + layout: layout.id + }, item)); + + if (global.getUserSettings().layout.id !== layout.id) { + this.setState(function () { + return { + layout: global.getUserSettings().layout + }; + }); + } + + this.toggleLayout = _$$_REQUIRE(_dependencyMap[25]).EventRegister.on(_events.default.TOGGLE_LAYOUT, function () { + _this2.log("toggle layout"); + + _this2.setState(function () { + return { + layout: global.getUserSettings().layout + }; + }); + }); + this.rssDbAutoUpdate = _$$_REQUIRE(_dependencyMap[25]).EventRegister.on(_events.default.TRIGGER_RSS_DB_UPDATE, function () { + _this2.log("TRIGGER_RSS_DB_UPDATE " + new Date()); + + _this2.onRefresh(_$$_REQUIRE(_dependencyMap[26]).DbDownloadPriority.MEDIUM); + }); + + _$$_REQUIRE(_dependencyMap[25]).EventRegister.emit(_events.default.FOOTER_ITEM_CLICK, { + screen: item.drawerItemKey + }); + } + }, { + key: "willBlur", + value: function willBlur() { + this._toggleClearViews(true); + + (0, _get2.default)((0, _getPrototypeOf2.default)(RssBaseScreen.prototype), "willBlur", this).call(this); + + _$$_REQUIRE(_dependencyMap[25]).EventRegister.rm(this.toggleLayout); + + _$$_REQUIRE(_dependencyMap[25]).EventRegister.rm(this.rssDbAutoUpdate); + + _$$_REQUIRE(_dependencyMap[25]).EventRegister.emit(_events.default.ON_RSS_BASE_SCREEN_BLUR); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssBaseScreen.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[25]).EventRegister.rm(this.toggleLayout); + + _$$_REQUIRE(_dependencyMap[25]).EventRegister.rm(this.rssDbAutoUpdate); + } + }, { + key: "_isCategoryNameVisible", + value: function _isCategoryNameVisible() { + return this.props.showHeader; + } + }, { + key: "_onListRefresh", + value: function _onListRefresh() { + var _this3 = this; + + return _regenerator.default.async(function _onListRefresh$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this.setState({ + refreshing: true + }, function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(_this3.onRefresh(_$$_REQUIRE(_dependencyMap[26]).DbDownloadPriority.LOW, function () { + _this3.setState({ + refreshing: false + }); + })); + + case 3: + _context.next = 8; + break; + + case 5: + _context.prev = 5; + _context.t0 = _context["catch"](0); + + _this3.setState({ + refreshing: false + }); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 5]], Promise); + }); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onErrorViewClick", + value: function _onErrorViewClick() { + var _this4 = this; + + return _regenerator.default.async(function _onErrorViewClick$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + this.setState({ + loading: true + }, function _callee2() { + return _regenerator.default.async(function _callee2$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.next = 2; + return _regenerator.default.awrap(_this4.onRefresh(_$$_REQUIRE(_dependencyMap[26]).DbDownloadPriority.LOW)); + + case 2: + _this4.setState({ + loading: false + }); + + case 3: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }); + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_handleForceExit", + value: function _handleForceExit() { + var _this5 = this; + + _reactNative.Alert.alert("", global.strings("err_internet_connection"), [{ + text: global.strings("btn_ok"), + onPress: function onPress() { + _this5.closeApp(); + } + }], { + cancelable: false + }); + + return true; + } + }, { + key: "_getNativoAdsSection", + value: function _getNativoAdsSection() { + var settings = this.props.item; + + if (settings && settings.adUnitId) { + var configuration = { + screen: "grid", + position: "inside", + type: "native", + provider: "nativo", + caller: this.getTag() + }; + + var model = _AdsHelper.default.getModelFromConfiguration(settings.adUnitId, configuration); + + if (model) { + var unitId = model.unitId, + provider = model.provider; + + if (provider === InterstitialsKeysAndValues.values.provider.nativo) { + return unitId; + } + } + } + + return undefined; + } + }, { + key: "_getError", + value: function _getError() { + var item = this.props.item; + return this._getIconView("frown", global.strings("msg_error_category", { + category: item.displayName + })); + } + }, { + key: "_getEmpty", + value: function _getEmpty() { + var item = this.props.item; + return this._getIconView("surprise", global.strings("msg_empty_category", { + category: item.displayName + })); + } + }, { + key: "_getIconView", + value: function _getIconView(iconName, text) { + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + return _react.default.createElement(_emptyComponent.default, { + onPress: this.onErrorViewClick, + iconName: iconName, + message: text, + color: supportColor + }); + } + }, { + key: "_getHeader", + value: function _getHeader() { + var _this$props = this.props, + width = _this$props.width, + settings = _this$props.item; + var adJSON; + + if (settings) { + adJSON = settings.adUnitId; + } + + var configuration = { + screen: "grid", + position: "top", + caller: this.getTag() + }; + var backgroundColor = global.getAdsConfig().getBackgroundColor(); + + var adsComponent = _AdsHelper.default.getAdComponentFromConfiguration(adJSON, configuration); + + var categoryComponent = this._getCategoryHeader(); + + return _react.default.createElement(_reactNative.View, { + style: { + flexDirection: "column", + width: width + } + }, categoryComponent, _react.default.createElement(_reactNative.View, { + style: { + width: "100%", + alignItems: "center", + backgroundColor: backgroundColor + } + }, adsComponent)); + } + }, { + key: "_renderAbsolute", + value: function _renderAbsolute() { + return null; + } + }, { + key: "_getCategoryHeader", + value: function _getCategoryHeader() { + var settings = this.props.item; + + var _global$getRssIndex2 = global.getRssIndex(), + supportColor = _global$getRssIndex2.supportColor; + + var color = _$$_REQUIRE(_dependencyMap[27]).Css.isDarkTheme() ? _$$_REQUIRE(_dependencyMap[27]).Css.getDefaultBackgroundColor() : _$$_REQUIRE(_dependencyMap[28]).ColorUtils.determineTextColor(supportColor); + return this._isCategoryNameVisible() ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[27]).Css, { + classes: ["rss-screen-category-header"] + }, _react.default.createElement(_fontText.default, { + style: [_$$_REQUIRE(_dependencyMap[29]).styles.header, { + color: color, + backgroundColor: supportColor + }] + }, _$$_REQUIRE(_dependencyMap[28]).StringUtils.removeTilde(settings.displayName))) : null; + } + }, { + key: "_onUserScroll", + value: function _onUserScroll(status) { + _$$_REQUIRE(_dependencyMap[25]).EventRegister.emit(_events.default.LIST_VERTICAL_SCROLLING, status); + } + }, { + key: "_onListItemClick", + value: function _onListItemClick(items, item) { + var _this$props2 = this.props, + navigation = _this$props2.navigation, + settings = _this$props2.item, + onItemPress = _this$props2.onItemPress; + + if (!item.isAdvertisement) { + if (item.action && item.action.hasMainActionOpenEdition() || item.isEdition) { + var params = { + isFromRss: true + }; + var mainAction = item.getMainAction(); + + if (mainAction) { + var edition = mainAction.edition, + issue = mainAction.issue; + params.edition = edition; + params.issue = issue; + } + + _NavigationService.default.main.reset("NewsmemoryNavigator", params); + } else if (item.action && item.action.hasMainActionOpenLoadExternalUrl()) { + navigation.navigate("WebScreen", { + url: item.action.main.url + }); + } else if (item.action && item.action.hasMainActionOpenGallery()) { + navigation.navigate("GalleryScreen", { + items: item.gallery, + category: item.category, + title: item.title, + caller: "live_news" + }); + } else if (item.action && item.action.hasMainActionOpenLinkToCategory()) { + (0, _$$_REQUIRE(_dependencyMap[30]).navigateToCategory)(navigation, item.action.main.category); + } else if (item.isHalfBox || item.isLinkToCategory) { + var _global$getRssIndex3 = global.getRssIndex(), + drawerItemsFlat = _global$getRssIndex3.drawerItemsFlat; + + var drawerItem = _navigationUtils.default.getDrawerItem(drawerItemsFlat, item.title); + + if (!drawerItem) { + drawerItem = _navigationUtils.default.getDrawerItem(drawerItemsFlat, "" + _$$_REQUIRE(_dependencyMap[28]).StringUtils.TILDE + item.title); + } + + if (drawerItem) { + onItemPress(navigation, drawerItem); + } + } else if (item.priority && typeof item.priority === "string" && item.priority.indexOf("http") > 0) { + navigation.navigate("WebScreen", { + url: item.priority.url + }); + } else if (item.category === "Action Block") { + navigation.navigate("WebScreen", { + url: item.byline + }); + } else if (item.category === "Photos") { + (function () { + var body = item.html; + var url = item.source; + + if (!url) { + var regex = / 0) { + navigation.navigate("ArticleScreen", { + items: newList, + item: item, + settings: settings, + orientation: _deviceUtils.default.currentOrientation + }); + } + } + } + } + }, { + key: "_getComponent", + value: function _getComponent() { + var _this$state = this.state, + loading = _this$state.loading, + error = _this$state.error, + items = _this$state.items, + layout = _this$state.layout, + refreshing = _this$state.refreshing; + var _this$props3 = this.props, + settings = _this$props3.item, + numberOfColumns = _this$props3.numberOfColumns, + width = _this$props3.width; + var result; + + if (loading) { + result = _react.default.createElement(_$$_REQUIRE(_dependencyMap[31]).ProgressCircle, null); + } else if (error) { + result = this._getError(); + } else { + _LiveConfig.default.setLastRssCategory(settings.drawerItemKey); + + var props = { + refreshing: refreshing, + renderEmpty: this.getEmpty, + onRefresh: this.onListRefresh, + settings: settings, + items: items || [], + width: width, + renderHeader: this.getHeader, + onItemClick: this.onListItemClick, + renderError: this.getError, + orientation: _deviceUtils.default.currentOrientation, + onUserScroll: this.onUserScroll, + nativeID: this._getNativoAdsSection() ? "publisherNativoAdContainer" : "rssListContainer", + numberOfColumns: numberOfColumns + }; + var LayoutComponent = layout.Component; + + if (settings) { + var isHtml5VideoStreamList = (0, _$$_REQUIRE(_dependencyMap[30]).parseExtra)(settings.extra, "isHtml5VideoStreamList", "0") === "1"; + + if (isHtml5VideoStreamList) { + LayoutComponent = _rssVideoCardComponent.default; + } + } + + result = _react.default.createElement(LayoutComponent, props); + } + + return result; + } + }, { + key: "_displayToast", + value: function _displayToast(msg) { + if (this.hasScreenFocus()) { + _$$_REQUIRE(_dependencyMap[32]).Toast.show(msg, { + position: "top" + }); + } + } + }, { + key: "_render", + value: function _render() { + return null; + } + }, { + key: "_toggleClearViews", + value: function _toggleClearViews(state) { + var _this$props4 = this.props, + navigation = _this$props4.navigation, + route = _this$props4.route; + + var activeRoute = _navigationUtils.default.getActiveRouteFromState(navigation.getState()); + + var focused = navigation.isFocused(); + var clearViews = this.state.clearViews; + var newClearViews = state && !(route.name === activeRoute && !focused); + + if (clearViews !== newClearViews) { + this.forceState({ + clearViews: newClearViews + }); + } + } + }, { + key: "render", + value: function render() { + var considerSafeAreaTop = this.props.considerSafeAreaTop; + var clearViews = this.state.clearViews; + var marginTop = 0; + + if (considerSafeAreaTop) { + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(); + + marginTop = _DeviceUtils$getSafeA.top; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[27]).Css, { + classes: ["rss-content-parent"] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "column", + marginTop: marginTop + } + }, clearViews ? null : this._render(), clearViews ? null : this._renderAbsolute())); + } + }]); + return RssBaseScreen; + }(_$$_REQUIRE(_dependencyMap[33]).NavigationBaseScreen); + + exports.RssBaseScreen = RssBaseScreen; + RssBaseScreen.propTypes = { + showHeader: _propTypes.default.bool, + considerSafeAreaTop: _propTypes.default.bool, + item: _propTypes.default.object, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func.isRequired + }).isRequired, + onItemPress: _propTypes.default.func.isRequired + }; + RssBaseScreen.defaultProps = { + considerSafeAreaTop: false + }; + + RssBaseScreen.navigationOptions = function (_ref) { + var navigation = _ref.navigation; + var params = navigation.state.params; + return params; + }; +},2219,[5,80,6,7,8,15,90,12,14,16,17,201,28,460,1872,2087,1879,458,1861,2045,2220,1973,731,2222,2210,572,2207,699,462,2225,2046,1953,1889,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _emptyComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EmptyComponent = function (_React$Component) { + (0, _inherits2.default)(EmptyComponent, _React$Component); + + var _super = _createSuper(EmptyComponent); + + function EmptyComponent() { + (0, _classCallCheck2.default)(this, EmptyComponent); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(EmptyComponent, [{ + key: "render", + value: function render() { + var _this$props = this.props, + enableIcon = _this$props.enableIcon, + _onPress = _this$props.onPress, + iconName = _this$props.iconName, + message = _this$props.message, + color = _this$props.color, + cssClassesContainer = _this$props.cssClassesContainer, + cssClassesParent = _this$props.cssClassesParent, + cssClassesIcon = _this$props.cssClassesIcon, + cssClassesText = _this$props.cssClassesText; + var Icon = null; + + if (enableIcon) { + Icon = _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: cssClassesIcon + }, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: iconName, + size: 70, + color: color + })); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: cssClassesContainer + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + if (typeof _onPress === "function") { + _onPress(); + } + }, + style: _emptyComponent.default.message + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: cssClassesParent + }, _react.default.createElement(_reactNative.View, { + style: _emptyComponent.default.message + }, Icon, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: cssClassesText + }, _react.default.createElement(_fontText.default, { + style: [_emptyComponent.default.messageText, { + color: color + }] + }, message)))))); + } + }]); + return EmptyComponent; + }(_react.default.Component); + + exports.default = EmptyComponent; + EmptyComponent.propTypes = { + onPress: _propTypes.default.func, + iconName: _propTypes.default.string, + message: _propTypes.default.string.isRequired, + color: _propTypes.default.string, + enableIcon: _propTypes.default.bool, + cssClassesContainer: _propTypes.default.arrayOf(_propTypes.default.string), + cssClassesParent: _propTypes.default.arrayOf(_propTypes.default.string), + cssClassesIcon: _propTypes.default.arrayOf(_propTypes.default.string), + cssClassesText: _propTypes.default.arrayOf(_propTypes.default.string) + }; + EmptyComponent.defaultProps = { + color: _$$_REQUIRE(_dependencyMap[13]).colors.black, + iconName: "surprise", + enableIcon: false, + cssClassesContainer: [], + cssClassesParent: [], + cssClassesIcon: [], + cssClassesText: [] + }; +},2220,[5,7,8,12,14,16,17,201,28,1879,2221,1806,699,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + message: { + flex: 1, + justifyContent: "center", + alignItems: "center", + flexDirection: "column" + }, + messageText: { + paddingVertical: 20, + paddingHorizontal: 50, + textAlign: "center" + } + }); + + exports.default = _default; +},2221,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _rssBaseView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _refreshComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _cardMerideVideo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RssVideoCardComponent = function (_RssCardComponent) { + (0, _inherits2.default)(RssVideoCardComponent, _RssCardComponent); + + var _super = _createSuper(RssVideoCardComponent); + + function RssVideoCardComponent(props) { + var _this; + + (0, _classCallCheck2.default)(this, RssVideoCardComponent); + _this = _super.call(this, props); + _this.itemVideoRefs = []; + _this.onScrollEnd = _this._onScrollEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + layout: undefined + }; + return _this; + } + + (0, _createClass2.default)(RssVideoCardComponent, [{ + key: "_chooseActiveVideo", + value: function _chooseActiveVideo(scrollIndex) { + this.itemVideoRefs.forEach(function (itemVideoRef, index) { + if (itemVideoRef) { + itemVideoRef.setActive(index === scrollIndex); + } + }); + } + }, { + key: "_onScrollEnd", + value: function _onScrollEnd(_ref) { + var direction = _ref.direction, + start = _ref.start, + step = _ref.step, + speed = _ref.speed, + duration = _ref.duration; + var layout = this.state.layout; + + if (layout) { + var scrollIndex = Math.floor(start / Math.floor(this._getAvailableHeight())); + + this._chooseActiveVideo(scrollIndex); + } + } + }, { + key: "_useAsymmetricList", + value: function _useAsymmetricList() { + return true; + } + }, { + key: "_getPadding", + value: function _getPadding() { + return 0; + } + }, { + key: "_getNumberOfColumns", + value: function _getNumberOfColumns() { + return 1; + } + }, { + key: "_getAvailableHeight", + value: function _getAvailableHeight() { + var layout = this.state.layout; + + if (layout) { + return layout.height - _$$_REQUIRE(_dependencyMap[13]).RSS_HEADER_HEIGHT; + } + + return 0; + } + }, { + key: "_getListProps", + value: function _getListProps() { + var _this2 = this; + + return { + initialNumToRender: 1, + windowSize: 1, + numColumns: 1, + columnStyle: { + margin: 0 + }, + disableIntervalMomentum: true, + snapToInterval: this._getAvailableHeight(), + decelerationRate: "fast", + onScrollViewRef: function onScrollViewRef(ref) { + _this2.scrollView = ref; + } + }; + } + }, { + key: "_getVideoComponent", + value: function _getVideoComponent(item) { + var html = item.html; + var matches = html.match(/.*Meride.initEmbed\({ .* }\);/); + + if (matches && matches.length > 0) { + return _cardMerideVideo.default; + } + + return null; + } + }, { + key: "_renderColContent", + value: function _renderColContent(_ref2) { + var _this3 = this; + + var item = _ref2.item, + itemID = _ref2.index; + var items = this.props.items; + + var _this$_minimumItemDim = this._minimumItemDimensions(), + width = _this$_minimumItemDim.width; + + var result = null; + + if (item && (0, _$$_REQUIRE(_dependencyMap[14]).itemHasHtml5StreamAction)(item)) { + item.setHideCategory(true); + + var height = this._getAvailableHeight(); + + var CardVideo = this._getVideoComponent(item); + + if (CardVideo) { + result = _react.default.createElement(CardVideo, { + ref: function ref(_ref3) { + _this3.itemVideoRefs[itemID] = _ref3; + }, + item: item, + index: itemID, + onPress: function onPress() { + _this3._onItemClick(items, item); + }, + onVideoEnd: function onVideoEnd() { + if (_this3.scrollView) { + var nextItemID = itemID + 1; + + _this3.scrollView.scrollTo({ + y: nextItemID * height, + animated: true + }); + + if (_$$_REQUIRE(_dependencyMap[15]).PlatformUtils.isAndroid()) { + _this3._chooseActiveVideo(nextItemID); + } + } + }, + style: { + width: width, + height: height + }, + autoplay: itemID === 0 + }); + } + } + + return _react.default.createElement(_reactNative.View, { + ref: function ref(_ref4) { + _this3.itemViewRefs[itemID] = _ref4; + }, + style: { + width: width + } + }, result); + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props = this.props, + orientation = _this$props.orientation, + refreshing = _this$props.refreshing, + onRefresh = _this$props.onRefresh, + items = _this$props.items, + renderHeader = _this$props.renderHeader, + renderError = _this$props.renderError, + renderEmpty = _this$props.renderEmpty, + onUserScroll = _this$props.onUserScroll, + nativeID = _this$props.nativeID; + var layout = this.state.layout; + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + }, + onLayout: function onLayout(_ref5) { + var nativeEvent = _ref5.nativeEvent; + + _this4.setState({ + layout: nativeEvent.layout + }); + } + }, layout ? _react.default.createElement(_rssBaseView.default, (0, _extends2.default)({ + colsData: this._getColsData(items), + rowsData: this._getRowsData(items), + renderRow: this.renderRow, + renderColItem: this.renderColContent, + renderEmpty: renderEmpty, + renderHeader: renderHeader, + renderError: renderError, + orientation: orientation, + onUserScroll: onUserScroll, + onScrollEnd: this.onScrollEnd, + PlaceholderComponent: this._getPlaceholderComponent(), + refreshControl: _react.default.createElement(_refreshComponent.default, { + colors: [supportColor], + refreshing: refreshing, + onRefresh: onRefresh + }), + nativeID: nativeID + }, this._getListProps())) : null); + } + }]); + return RssVideoCardComponent; + }(_$$_REQUIRE(_dependencyMap[16]).RssCardComponent); + + var _default = function _default(props) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[17]).useNavigation)(); + return _react.default.createElement(RssVideoCardComponent, (0, _extends2.default)({}, props, { + navigation: navigation + })); + }; + + exports.default = _default; +},2222,[5,6,7,8,15,12,14,16,17,28,2080,2099,2223,2039,1975,462,2116,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var CardMerideVideo = function (_CardHtml5Video) { + (0, _inherits2.default)(CardMerideVideo, _CardHtml5Video); + + var _super = _createSuper(CardMerideVideo); + + function CardMerideVideo() { + (0, _classCallCheck2.default)(this, CardMerideVideo); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(CardMerideVideo, [{ + key: "_getVideoType", + value: function _getVideoType() { + return "meride"; + } + }, { + key: "_getPlayVideoJS", + value: function _getPlayVideoJS() { + return "\n if (videoElement) {\n console.log(\"PLAY video\");\n videoElement.play();\n } else {\n console.log(\"PLAY ERROR: no video element\")\n }"; + } + }, { + key: "_getPauseVideoJS", + value: function _getPauseVideoJS() { + return "\n if (videoElement) {\n console.log(\"PAUSE video\");\n videoElement.pause();\n } else {\n console.log(\"PAUSE ERROR: no video element\")\n }"; + } + }, { + key: "_getExitFullscreenVideoJS", + value: function _getExitFullscreenVideoJS() { + return "\n if (videoElement) {\n console.log(\"video EXIT FULLSCREEN\"); \n videoElement.webkitExitFullscreen();\n } else {\n console.log(\"EXIT FULLSCREEN ERROR: no video element\")\n }"; + } + }, { + key: "_manipulateHTML", + value: function _manipulateHTML() { + var _this$props = this.props, + item = _this$props.item, + style = _this$props.style; + var html = item.html; + + if (style) { + if (style.height) { + html = html.replace(/data-height="[0-9]*"/g, "data-height=\"" + style.height + "\""); + } + + var widthReplace = ""; + + if (_$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isTablet() && style.width) { + widthReplace = "data-width=\"" + style.width + "\""; + } + + html = html.replace(/data-width="[0-9]*"/g, widthReplace); + } + + var matches = html.match(/.*Meride.initEmbed\({ embedID: ([0-9]+), .* }\);/); + + if (matches && matches.length > 1) { + var embedID = matches[1]; + + if (embedID) { + var script = "\n var player = Meride.getPlayer({\n embedID: " + embedID + "\n });\n\n player.addEventListener(Meride.EventType.READY, function(evnt) {\n videoElement = evnt.detail.player;\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'VIDEO_READY' }));\n });\n\n player.addEventListener(Meride.EventType.PLAY, function(evnt) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'VIDEO_STARTED' }));\n });\n\n player.addEventListener(Meride.EventType.PAUSE, function(evnt) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'VIDEO_PAUSED' }));\n });\n \n player.addEventListener(Meride.EventType.ENDED, function(evnt) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'VIDEO_ENDED' }));\n });\n\n player.addEventListener(Meride.EventType.ERROR, function(evnt) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'VIDEO_ERROR', message: evnt.detail.error }));\n });\n\n player.addEventListener(Meride.EventType.ENTER_FULLSCREEN, function(evnt) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'VIDEO_ENTER_FULLSCREEN' }));\n });\n \n player.addEventListener(Meride.EventType.EXIT_FULLSCREEN, function(evnt) {\n window.ReactNativeWebView.postMessage(JSON.stringify({ type: 'VIDEO_EXIT_FULLSCREEN' }));\n });"; + var enableFullscreen = _$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isIOS() ? "true" : "false"; + return html.replace(matches[0], "Meride.initEmbed({ embedID: " + embedID + ", type: \"html5\", muted: true, enableFullscreen: " + enableFullscreen + " });\n " + script); + } + } + + return html; + } + }, { + key: "_injectedJavaScriptBeforeContentLoaded", + value: function _injectedJavaScriptBeforeContentLoaded() { + return "\n var videoElement;"; + } + }]); + return CardMerideVideo; + }(_$$_REQUIRE(_dependencyMap[9]).CardHtml5Video); + + var _default = (0, _react.forwardRef)(function (props, ref) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[10]).useNavigation)(); + return _react.default.createElement(CardMerideVideo, (0, _extends2.default)({}, props, { + ref: ref, + navigation: navigation + })); + }); + + exports.default = _default; +},2223,[5,6,7,8,12,14,16,17,462,2224,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.CardHtml5Video = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _card = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _baseTileImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _RssActionManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _tileHeader = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var CardHtml5Video = function (_React$Component) { + (0, _inherits2.default)(CardHtml5Video, _React$Component); + + var _super = _createSuper(CardHtml5Video); + + function CardHtml5Video(props) { + var _this; + + (0, _classCallCheck2.default)(this, CardHtml5Video); + _this = _super.call(this, props); + _this.fontSize = _$$_REQUIRE(_dependencyMap[17]).FONT_SIZE.TEXT(); + _this.fontSizeTitle = _$$_REQUIRE(_dependencyMap[17]).FONT_SIZE.TITLE(); + _this.webviewHeight = undefined; + _this.onLoadEnd = _this._onLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + _this.setActive = _this._setActive.bind((0, _assertThisInitialized2.default)(_this)); + _this.playVideo = _this._playVideo.bind((0, _assertThisInitialized2.default)(_this)); + _this.pauseVideo = _this._pauseVideo.bind((0, _assertThisInitialized2.default)(_this)); + _this.exitFullscreen = _this._exitFullscreen.bind((0, _assertThisInitialized2.default)(_this)); + _this.mounted = false; + _this.isActive = false; + _this.autoPaused = false; + _this.state = { + isPlaying: false + }; + return _this; + } + + (0, _createClass2.default)(CardHtml5Video, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.mounted = true; + this.blurListener = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_BACKGROUND, function () { + var isPlaying = _this2.state.isPlaying; + + if (_this2.mounted && _this2.isActive && isPlaying) { + _this2.pauseVideo(); + + _this2.autoPaused = true; + } + }); + this.focusListener = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_FOREGROUND, function () { + var isPlaying = _this2.state.isPlaying; + + if (_this2.mounted && _this2.isActive && !isPlaying && _this2.autoPaused) { + _this2.playVideo(); + + _this2.autoPaused = false; + } + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.mounted = false; + + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.blurListener); + + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.focusListener); + } + }, { + key: "_getVideoType", + value: function _getVideoType() { + return "html5"; + } + }, { + key: "_getCssKey", + value: function _getCssKey() { + return this._getVideoType() + "-video"; + } + }, { + key: "_getCategoryAndDate", + value: function _getCategoryAndDate() { + var item = this.props.item; + var isPlaying = this.state.isPlaying; + + var cssKey = this._getCssKey(); + + var parentContainer = _$$_REQUIRE(_dependencyMap[19]).Css.getStyleObjByCssClasses(["tile-card-header"], { + cssKey: cssKey + }); + + var textContainer = _$$_REQUIRE(_dependencyMap[19]).Css.getStyleObjByCssClasses(["tile-card-header-text"], { + cssKey: cssKey + }); + + var color = isPlaying ? _$$_REQUIRE(_dependencyMap[20]).colors.transparent : _$$_REQUIRE(_dependencyMap[20]).colors.white_transparent_135; + var hasLinkIcon = item.action.icons.find(function (icon) { + return (0, _$$_REQUIRE(_dependencyMap[21]).hasActionOpenLoadExternalUrl)(icon); + }); + + if (!hasLinkIcon) { + var url = item.source; + + if (_$$_REQUIRE(_dependencyMap[20]).StringUtils.isUrl(url)) { + item.action.icons.unshift({ + action: "loadExternalURL", + url: url + }); + } + } + + return _react.default.createElement(_tileHeader.default, { + parentStyle: [{ + backgroundColor: _$$_REQUIRE(_dependencyMap[20]).colors.transparent, + paddingVertical: 5 + }, parentContainer], + textStyle: [_baseTileImage.default.details, { + fontSize: this.fontSize, + color: color + }, textContainer], + iconsStyle: { + flexDirection: "column", + width: _$$_REQUIRE(_dependencyMap[22]).ICON, + height: undefined + }, + isTablet: _$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isTablet(), + iconType: "others", + availableSpace: 2, + item: item + }); + } + }, { + key: "_injectJavaScript", + value: function _injectJavaScript(jsScript) { + if (this.webview) { + this.webview.injectJavaScript("try {" + jsScript + "} catch(e) {console.log(e.message);}"); + } + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd() { + var jsStyle = "\n document.body.style.margin = 0; \n document.body.style.padding = 0;"; + + this._injectJavaScript(jsStyle); + } + }, { + key: "_setActive", + value: function _setActive(isActive) { + this.isActive = isActive; + + if (isActive) { + this.playVideo(); + } else { + this.pauseVideo(); + } + } + }, { + key: "_getPlayVideoJS", + value: function _getPlayVideoJS() { + return ""; + } + }, { + key: "_playVideo", + value: function _playVideo() { + var isPlaying = this.state.isPlaying; + + if (!isPlaying) { + this._injectJavaScript(this._getPlayVideoJS()); + } + } + }, { + key: "_getPauseVideoJS", + value: function _getPauseVideoJS() { + return ""; + } + }, { + key: "_pauseVideo", + value: function _pauseVideo() { + var isPlaying = this.state.isPlaying; + + if (isPlaying) { + this._injectJavaScript(this._getPauseVideoJS()); + } + } + }, { + key: "_getExitFullscreenVideoJS", + value: function _getExitFullscreenVideoJS() { + return ""; + } + }, { + key: "_exitFullscreen", + value: function _exitFullscreen() { + this._injectJavaScript(this._getExitFullscreenVideoJS()); + } + }, { + key: "_manipulateHTML", + value: function _manipulateHTML() { + var item = this.props.item; + var html = item.html; + return html; + } + }, { + key: "_onMessage", + value: function _onMessage(data) { + try { + var _this$props = this.props, + autoplay = _this$props.autoplay, + onVideoEnd = _this$props.onVideoEnd; + var type = data.type, + message = data.message; + + if (type) { + switch (type) { + case "VIDEO_READY": + if (autoplay) { + setTimeout(this.playVideo, 1000); + } + + break; + + case "VIDEO_STARTED": + this.setState({ + isPlaying: true + }); + break; + + case "VIDEO_PAUSED": + this.setState({ + isPlaying: false + }); + break; + + case "VIDEO_ENDED": + if (typeof onVideoEnd === "function") { + onVideoEnd(); + } + + this.exitFullscreen(); + this.setState({ + isPlaying: false + }); + break; + + case "VIDEO_ERROR": + break; + } + } + } catch (e) {} + } + }, { + key: "_injectedJavaScriptBeforeContentLoaded", + value: function _injectedJavaScriptBeforeContentLoaded() { + return ""; + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$props2 = this.props, + item = _this$props2.item, + style = _this$props2.style; + var isPlaying = this.state.isPlaying; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).Css, { + classes: ["tile", "tile-card"], + cssKey: this._getCssKey() + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).CardParent, { + style: { + marginHorizontal: 0, + marginVertical: 0 + }, + borderStyle: { + borderRadius: 0 + } + }, _react.default.createElement(_reactNative.View, { + ref: function ref(_ref) { + _this3.viewRef = _ref; + }, + style: [{ + flexDirection: "column" + }, style] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[20]).colors.grey1200 + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).BaseWebView, { + innerRef: function innerRef(ref) { + _this3.webview = ref; + }, + source: { + html: this._manipulateHTML(), + baseUrl: _$$_REQUIRE(_dependencyMap[25]).WEBVIEW_BASE_URL + }, + allowsInlineMediaPlayback: true, + onLoadEnd: this.onLoadEnd, + injectedJavaScriptBeforeContentLoaded: this._injectedJavaScriptBeforeContentLoaded(), + onMessage: this.onMessage + })), _react.default.createElement(_reactNative.View, { + style: { + position: "absolute", + bottom: 60, + width: "100%", + backgroundColor: isPlaying ? _$$_REQUIRE(_dependencyMap[20]).colors.transparent : _$$_REQUIRE(_dependencyMap[20]).colors.transparent600 + } + }, !isPlaying ? _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, _react.default.createElement(_reactNative.View, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).Css, { + classes: ["tile-title", "card-title", "tile-card-title"], + cssKey: this._getCssKey() + }, _react.default.createElement(_fontText.default, { + style: [_card.default.title, { + fontSize: this.fontSizeTitle, + color: _$$_REQUIRE(_dependencyMap[20]).colors.white_transparent_135 + }], + type: _fontText.Type.medium + }, item.title)))) : null, this._getCategoryAndDate())))); + } + }]); + return CardHtml5Video; + }(_react.default.Component); + + exports.CardHtml5Video = CardHtml5Video; + CardHtml5Video.propTypes = { + onVideoEnd: _propTypes.default.func, + item: _propTypes.default.shape({ + html: _propTypes.default.string, + title: _propTypes.default.string, + image: _propTypes.default.string, + thumbnail: _propTypes.default.string, + action: _propTypes.default.instanceOf(_RssActionManager.default), + summary: _propTypes.default.string, + source: _propTypes.default.string, + gallery: _propTypes.default.array, + isHighlightedBox: _propTypes.default.bool + }), + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + autoplay: _propTypes.default.bool + }; + + var _default = (0, _react.forwardRef)(function (props, ref) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[26]).useNavigation)(); + return _react.default.createElement(CardHtml5Video, (0, _extends2.default)({}, props, { + ref: ref, + navigation: navigation + })); + }); + + exports.default = _default; +},2224,[5,6,7,8,15,12,14,16,17,28,201,460,1879,2049,2033,1964,2092,2039,572,699,462,1968,2030,2118,1894,719,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + header: { + height: _$$_REQUIRE(_dependencyMap[1]).RSS_HEADER_HEIGHT, + fontSize: 18, + paddingHorizontal: 45, + textAlign: "center", + paddingVertical: 10 + } + }); + + exports.styles = styles; +},2225,[28,2039]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.MyHomeBadge = MyHomeBadge; + exports.MyHomeConfigButton = MyHomeConfigButton; + exports.RssMyHomeScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _DatabaseHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[17])); + + var _buttonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _hintComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _hintKeys = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function MyHomeBadge(props) { + var style = props.style; + + var _global$getUserSettin = global.getUserSettings(), + selectedMyHomeCategories = _global$getUserSettin.selectedMyHomeCategories; + + return _react.default.createElement(_fontText.default, { + numberOfLines: 1, + style: style || _$$_REQUIRE(_dependencyMap[21]).styles.badgeText + }, selectedMyHomeCategories ? selectedMyHomeCategories.length : 0); + } + + function MyHomeConfigButton(props) { + var parentStyle = props.parentStyle, + iconStyle = props.iconStyle, + badgeStyle = props.badgeStyle, + onPress = props.onPress; + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[21]).styles.buttonContainer, parentStyle] + }, _react.default.createElement(_buttonComponent.default, { + onPress: onPress + }, _react.default.createElement(_reactNative.View, null, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "cog", + style: iconStyle, + size: 24 + }), _react.default.createElement(MyHomeBadge, { + style: badgeStyle + })))); + } + + var RssMyHomeScreen = function (_RssBaseScreen) { + (0, _inherits2.default)(RssMyHomeScreen, _RssBaseScreen); + + var _super = _createSuper(RssMyHomeScreen); + + function RssMyHomeScreen(props) { + (0, _classCallCheck2.default)(this, RssMyHomeScreen); + return _super.call(this, props, { + config: false + }); + } + + (0, _createClass2.default)(RssMyHomeScreen, [{ + key: "didFocus", + value: function didFocus() { + return _regenerator.default.async(function didFocus$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(RssMyHomeScreen.prototype), "didFocus", this).call(this); + _context.next = 3; + return _regenerator.default.awrap(_DatabaseHelper.default.rssContentDatabaseExists()); + + case 3: + if (!_context.sent) { + _context.next = 6; + break; + } + + _context.next = 6; + return _regenerator.default.awrap(this._retrieveData()); + + case 6: + _context.next = 8; + return _regenerator.default.awrap(this._manageDatabase({ + forceUpdate: _LiveConfig.default.isRssStartingUp() || _LiveConfig.default.isRssDbDeleted() + })); + + case 8: + _LiveConfig.default.setRssDbDeleted(false); + + case 9: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "willBlur", + value: function willBlur() { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssMyHomeScreen.prototype), "willBlur", this).call(this); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onRssConfigListener); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + var config = this.state.config; + + var _global$getUserSettin2 = global.getUserSettings(), + selectedMyHomeCategories = _global$getUserSettin2.selectedMyHomeCategories; + + if (config && selectedMyHomeCategories && selectedMyHomeCategories.length > 0) { + this.setState({ + config: false, + loading: true + }); + + this._retrieveData(); + + return true; + } + + return (0, _get2.default)((0, _getPrototypeOf2.default)(RssMyHomeScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "onRefresh", + value: function onRefresh(toastPriority, hideRefresh) { + return _regenerator.default.async(function onRefresh$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", this._manageDatabase({ + forceUpdate: true, + hideRefresh: hideRefresh + })); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getRandomAdsPosition", + value: function getRandomAdsPosition(pattern) { + var randomOffset = Math.floor(Math.random() * pattern.offset + 1); + var sign = Math.floor(Math.random() * 2) ? 1 : -1; + var pos = pattern.after + randomOffset * sign; + return pos; + } + }, { + key: "updateAdsPositionByPattern", + value: function updateAdsPositionByPattern(items, categoriesLength) { + var item = this.props.item; + + var adsPattern = _navigationUtils.default.getAdsPatter(item); + + adsPattern.max *= categoriesLength; + + if (items && items.length) { + var adsInList = []; + var adsPosition = []; + var i = 0; + + while (i < items.length) { + if (items[i].isAdvertisement) { + var removed = items.splice(i, 1)[0]; + + if (adsInList.length < adsPattern.max) { + adsInList.push(removed); + + if (adsPosition.length > 0) { + adsPosition.push(this.getRandomAdsPosition(adsPattern)); + } else { + adsPosition.push(adsPattern.first); + } + } + } else { + i += 1; + } + } + + if (adsInList.length) { + if (adsInList.length < adsPattern.max) { + for (i = adsInList.length; i < adsPattern.max; i++) { + var adsFromAlreadyIn = Math.floor(Math.random() * adsInList.length); + adsInList.push(adsInList[adsFromAlreadyIn]); + adsPosition.push(this.getRandomAdsPosition(adsPattern)); + } + } + + var position = 0; + + for (i = 0; i < adsInList.length; i++) { + position += adsPosition[i]; + + if (items.length >= position) { + items.splice(position, 0, adsInList[i]); + position += 1; + } + } + } + } + + return items; + } + }, { + key: "_manageDatabase", + value: function _manageDatabase(_ref) { + var _ref$forceUpdate, forceUpdate, hideRefresh, item, drawerItemKey, result; + + return _regenerator.default.async(function _manageDatabase$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _ref$forceUpdate = _ref.forceUpdate, forceUpdate = _ref$forceUpdate === undefined ? false : _ref$forceUpdate, hideRefresh = _ref.hideRefresh; + item = this.props.item; + drawerItemKey = item.drawerItemKey; + + if (!forceUpdate) { + _context3.next = 10; + break; + } + + _LiveConfig.default.setRssStartingUp(false); + + _context3.next = 7; + return _regenerator.default.awrap(_DatabaseHelper.default.downloadRssContent(drawerItemKey, global.getUserSettings().appSubLayoutChanged, function () {}, hideRefresh)); + + case 7: + result = _context3.sent; + + if (result) { + this._displayToast(result.msg); + } + + global.getUserSettings().storeNewSubLayout(); + + case 10: + _context3.next = 12; + return _regenerator.default.awrap(!_DatabaseHelper.default.rssContentDatabaseExists()); + + case 12: + if (!_context3.sent) { + _context3.next = 17; + break; + } + + _context3.next = 15; + return _regenerator.default.awrap(this._handleForceExit()); + + case 15: + _context3.next = 19; + break; + + case 17: + _context3.next = 19; + return _regenerator.default.awrap(this._retrieveData()); + + case 19: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_retrieveData", + value: function _retrieveData() { + var items, myHomeCategoriesLength, _global$getUserSettin3, selectedMyHomeCategories; + + return _regenerator.default.async(function _retrieveData$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + items = []; + _context4.prev = 1; + myHomeCategoriesLength = 0; + _global$getUserSettin3 = global.getUserSettings(), selectedMyHomeCategories = _global$getUserSettin3.selectedMyHomeCategories; + + if (selectedMyHomeCategories) { + myHomeCategoriesLength = selectedMyHomeCategories.length; + } + + if (!(myHomeCategoriesLength === 0)) { + _context4.next = 9; + break; + } + + this.setState({ + loading: false, + config: true + }); + _context4.next = 16; + break; + + case 9: + _context4.t0 = this; + _context4.next = 12; + return _regenerator.default.awrap(_RssContentHelper.default.getArticlesInMyHome(selectedMyHomeCategories)); + + case 12: + _context4.t1 = _context4.sent; + _context4.t2 = myHomeCategoriesLength; + items = _context4.t0.updateAdsPositionByPattern.call(_context4.t0, _context4.t1, _context4.t2); + this.setState({ + items: items, + loading: false, + config: false + }); + + case 16: + _context4.next = 22; + break; + + case 18: + _context4.prev = 18; + _context4.t3 = _context4["catch"](1); + this.log(_context4.t3); + this.setState({ + loading: false, + error: true + }); + + case 22: + case "end": + return _context4.stop(); + } + } + }, null, this, [[1, 18]], Promise); + } + }, { + key: "_getCategoryHeader", + value: function _getCategoryHeader() { + var _this = this; + + var settings = this.props.item; + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + var displayName = settings.displayName; + + var foregroundColor = _$$_REQUIRE(_dependencyMap[23]).ColorUtils.determineTextColor(supportColor); + + if (this._isCategoryNameVisible()) { + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[21]).styles.header, { + backgroundColor: supportColor + }] + }, _react.default.createElement(_fontText.default, { + style: [_$$_REQUIRE(_dependencyMap[21]).styles.category, { + color: foregroundColor + }] + }, displayName), _react.default.createElement(MyHomeConfigButton, { + iconStyle: { + color: foregroundColor + }, + onPress: function onPress() { + _this.setState({ + config: true + }); + } + })); + } + + return null; + } + }, { + key: "getTag", + value: function getTag() { + return "Live News My Home"; + } + }, { + key: "_render", + value: function _render() { + var _this2 = this; + + var _this$props = this.props, + width = _this$props.width, + navigation = _this$props.navigation; + var _this$props$item = this.props.item, + displayName = _this$props$item.displayName, + drawerItemKey = _this$props$item.drawerItemKey; + var config = this.state.config; + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + justifyContent: "flex-end" + } + }, config ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).FooterContext.Consumer, null, function (_ref2) { + var height = _ref2.height; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).RssMyHomeConfig, { + onClose: function onClose() { + _this2.handleBackButton(); + }, + category: drawerItemKey, + style: { + paddingBottom: height, + width: width + } + }); + }) : null, config ? null : _react.default.createElement(_react.default.Fragment, null, !this._isCategoryNameVisible() ? _react.default.createElement(_hintComponent.default, { + config: _hintKeys.default.myHomeScreenConfig({ + label: displayName + }), + iconProps: { + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + name: "information" + }, + onActionPress: function onActionPress() { + if (global.getMainPSetup().showNativeSettingsScreen) { + navigation.navigate("GeneralSettingsScreen", { + epaperLabel: (0, _$$_REQUIRE(_dependencyMap[26]).getEpaperLabel)(), + module: _$$_REQUIRE(_dependencyMap[27]).GeneralSettingsModules.RSS + }); + } else { + navigation.navigate("SettingsScreen", { + epaperLabel: (0, _$$_REQUIRE(_dependencyMap[26]).getEpaperLabel)() + }); + } + } + }) : null, this._getComponent())); + } + }]); + return RssMyHomeScreen; + }(_$$_REQUIRE(_dependencyMap[28]).RssBaseScreen); + + exports.RssMyHomeScreen = RssMyHomeScreen; + RssMyHomeScreen.propTypes = (0, _extends2.default)({ + item: _propTypes.default.object + }, _$$_REQUIRE(_dependencyMap[28]).RssBaseScreen.propTypes); +},2226,[5,80,6,7,8,90,12,14,16,17,28,201,2216,2207,1872,1879,2045,1806,2202,2004,2002,2227,572,462,2084,2228,2046,2232,2218]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + header: { + height: _$$_REQUIRE(_dependencyMap[1]).RSS_HEADER_HEIGHT, + paddingHorizontal: 45, + justifyContent: "center" + }, + category: { + fontSize: 18, + textAlign: "center", + textAlignVertical: "center", + justifyContent: "center", + alignContent: "center" + }, + buttonContainer: { + height: _$$_REQUIRE(_dependencyMap[1]).RSS_HEADER_HEIGHT, + right: 0, + top: 0, + bottom: 0, + position: "absolute", + marginVertical: 4, + marginRight: 8, + justifyContent: "center" + }, + badgeText: { + color: _$$_REQUIRE(_dependencyMap[2]).colors.white, + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.red, + position: "absolute", + transform: [{ + scaleX: 0.7 + }, { + scaleY: 0.6 + }], + top: -10, + right: -10, + borderRadius: 50, + padding: 3 + } + }); + + exports.styles = styles; +},2227,[28,2039,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2228,[2229]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RssMyHomeConfig = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _defineProperty2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _rssMyHomeConfigComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _RssIndexConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _imageComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[17])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[18])); + + var _buttonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _checkboxComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _IndexHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _blurImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function mergeDbCategoriesWithDrawerItems(dbCategories, drawerItemsFlat) { + var sections, populatedSections, i; + return _regenerator.default.async(function mergeDbCategoriesWithDrawerItems$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + sections = []; + populatedSections = 0; + i = 0; + + case 3: + if (!(i < drawerItemsFlat.length)) { + _context2.next = 14; + break; + } + + _context2.prev = 4; + _context2.next = 7; + return _regenerator.default.awrap(function _callee() { + var _IndexHelper$SP$value, feed, section, drawerItem, feedElements, prevSection, parentKey, fallbackImage, fallbackImageExtra, nextDrawerItem, hasChildren, dbCat, _section, image, imageSize, newItem; + + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _IndexHelper$SP$value = _IndexHelper.default.SP.values.drawer.type, feed = _IndexHelper$SP$value.feed, section = _IndexHelper$SP$value.section; + drawerItem = drawerItemsFlat[i]; + + if (!(drawerItem.type === section)) { + _context.next = 6; + break; + } + + if (drawerItem.elements.length > 0) { + feedElements = drawerItem.elements.filter(function (element) { + var object = {}; + + if (Array.isArray(element)) { + element.forEach(function (setting) { + object[setting[0]] = setting[1]; + }); + } else { + object = (0, _extends2.default)({}, element); + + if (object.type === feed && Array.isArray(object.params) && object.params.length > 0) { + object.params = object.params[0]; + } + } + + return object.type === feed && dbCategories.find(function (x) { + return x.name === object.params; + }) || object.type === section; + }); + + if (feedElements.length > 0) { + prevSection = sections[sections.length - 1]; + + if (prevSection && prevSection.data.length) { + populatedSections += 1; + } + + if (prevSection && drawerItem.depth > 0) { + if (drawerItem.depth > prevSection.depth) { + parentKey = prevSection.title; + } else if (drawerItem.depth === prevSection.depth) { + parentKey = prevSection.parentKey; + } + } + + sections.push({ + title: drawerItem.drawerItemKey, + data: [], + depth: drawerItem.depth, + hasChildren: true, + parentKey: parentKey, + itemKey: drawerItem.drawerItemKey + }); + } + } + + _context.next = 19; + break; + + case 6: + if (!(drawerItem.type === _IndexHelper.default.SP.values.drawer.type.feed)) { + _context.next = 19; + break; + } + + fallbackImageExtra = (0, _$$_REQUIRE(_dependencyMap[24]).parseExtra)(drawerItem, "myHomeFallbackImageURL"); + + if (fallbackImageExtra && fallbackImageExtra.length > 0) { + fallbackImage = fallbackImageExtra[1]; + } + + nextDrawerItem = drawerItemsFlat[i + 1]; + hasChildren = nextDrawerItem && nextDrawerItem.type === _IndexHelper.default.SP.values.drawer.type.feed && nextDrawerItem.parent === drawerItem.drawerItemKey && nextDrawerItem.depth > drawerItem.depth; + dbCat = dbCategories.find(function (x) { + return x.name === drawerItem.drawerItemKey; + }); + _section = sections[sections.length - 1]; + image = dbCat.image || fallbackImage; + _context.next = 16; + return _regenerator.default.awrap((0, _imageComponent.getImageSize)(image)); + + case 16: + imageSize = _context.sent; + newItem = { + itemKey: dbCat.name, + parentKey: drawerItem.parent, + hasChildren: hasChildren, + isNested: _section.title !== drawerItem.parent, + articlesCount: dbCat.count, + image: image, + imageSize: imageSize, + depth: drawerItem.depth + }; + + if (drawerItem.depth > _section.depth) { + _section.data.push(newItem); + } else { + newItem.isNested = false; + newItem.depth += 1; + sections.push({ + title: drawerItem.drawerItemKey, + data: [newItem], + depth: drawerItem.depth, + hasChildren: true, + itemKey: drawerItem.drawerItemKey + }); + } + + case 19: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }()); + + case 7: + _context2.next = 11; + break; + + case 9: + _context2.prev = 9; + _context2.t0 = _context2["catch"](4); + + case 11: + i++; + _context2.next = 3; + break; + + case 14: + return _context2.abrupt("return", { + sections: sections, + populatedSections: populatedSections + }); + + case 15: + case "end": + return _context2.stop(); + } + } + }, null, null, [[4, 9]], Promise); + } + + function isSelected(itemKey) { + var result = false; + + var _global$getUserSettin = global.getUserSettings(), + selectedMyHomeCategories = _global$getUserSettin.selectedMyHomeCategories; + + if (selectedMyHomeCategories && selectedMyHomeCategories.length > 0) { + result = selectedMyHomeCategories.findIndex(function (x) { + return x === itemKey; + }) > -1; + } + + return result; + } + + function getTotalSelectedArticles(sections) { + var totalArticles = 0; + sections.forEach(function (_ref) { + var data = _ref.data; + data.forEach(function (object) { + var articlesCount = object.articlesCount, + itemKey = object.itemKey; + + if (isSelected(itemKey)) { + totalArticles += articlesCount; + } + }); + }); + return totalArticles; + } + + var RssMyHomeConfig = function (_React$Component) { + (0, _inherits2.default)(RssMyHomeConfig, _React$Component); + + var _super = _createSuper(RssMyHomeConfig); + + function RssMyHomeConfig(props) { + var _this; + + (0, _classCallCheck2.default)(this, RssMyHomeConfig); + _this = _super.call(this, props); + _this.state = { + loading: true + }; + return _this; + } + + (0, _createClass2.default)(RssMyHomeConfig, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _global$getRssIndex, drawerItemsFlat, _await$mergeDbCategor, sections, populatedSections, totalArticles; + + return _regenerator.default.async(function componentDidMount$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _global$getRssIndex = global.getRssIndex(), drawerItemsFlat = _global$getRssIndex.drawerItemsFlat; + _context3.t0 = _regenerator.default; + _context3.t1 = mergeDbCategoriesWithDrawerItems; + _context3.next = 5; + return _regenerator.default.awrap(_RssContentHelper.default.getMyHomeCategoryContent()); + + case 5: + _context3.t2 = _context3.sent; + _context3.t3 = drawerItemsFlat; + _context3.t4 = (0, _context3.t1)(_context3.t2, _context3.t3); + _context3.next = 10; + return _context3.t0.awrap.call(_context3.t0, _context3.t4); + + case 10: + _await$mergeDbCategor = _context3.sent; + sections = _await$mergeDbCategor.sections; + populatedSections = _await$mergeDbCategor.populatedSections; + totalArticles = getTotalSelectedArticles(sections); + this.setState((0, _extends2.default)({ + loading: false, + sections: sections, + populatedSections: populatedSections, + totalArticles: totalArticles + }, sections.reduce(function (prev, current) { + prev[current.itemKey] = false; + return prev; + }, {}))); + + case 15: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getText", + value: function _getText() { + var category = this.props.category; + var totalArticles = this.state.totalArticles; + var result; + + var _global$getUserSettin2 = global.getUserSettings(), + selectedMyHomeCategories = _global$getUserSettin2.selectedMyHomeCategories; + + if (selectedMyHomeCategories && selectedMyHomeCategories.length > 0) { + result = global.strings("my_home_categories_selected", { + categories: selectedMyHomeCategories.length, + articles: totalArticles + }); + } else { + result = global.strings("select_my_home_categories", { + category: (0, _$$_REQUIRE(_dependencyMap[25]).getCategoryLabel)(category) + }); + } + + return result; + } + }, { + key: "_onPress", + value: function _onPress(_ref2) { + var itemKey = _ref2.itemKey; + var sections = this.state.sections; + + if (isSelected(itemKey)) { + sections.forEach(function (_ref3) { + var data = _ref3.data; + data.forEach(function (category) { + if (itemKey === category.itemKey || itemKey === category.parentKey) { + global.getUserSettings().removeSelectedMyHomeCategory(category.itemKey); + } + }); + }); + } else { + sections.forEach(function (_ref4) { + var data = _ref4.data; + data.forEach(function (category) { + if (itemKey === category.itemKey || itemKey === category.parentKey) { + global.getUserSettings().addSelectedMyHomeCategory(category.itemKey); + } + }); + }); + } + + var totalArticles = getTotalSelectedArticles(sections); + this.setState({ + totalArticles: totalArticles + }); + } + }, { + key: "_isCollapsed", + value: function _isCollapsed(key) { + var state = this.state; + return typeof state[key] === "undefined" ? true : state[key]; + } + }, { + key: "_isParentSectionCollapsed", + value: function _isParentSectionCollapsed(section) { + return section && section.parentKey && this._isCollapsed(section.parentKey); + } + }, { + key: "_showChild", + value: function _showChild(item) { + return !this._isCollapsed(item.parentKey); + } + }, { + key: "_getListItem", + value: function _getListItem(item) { + var _this2 = this; + + var result; + + if (item.isNested) { + if (!this._isCollapsed(item.parentKey)) { + result = this._getListItemChild(item); + } + } else { + result = this._getListItemParent(item); + } + + return result ? _react.default.createElement(_reactNative.TouchableWithoutFeedback, { + onPress: function onPress() { + return _this2._onPress(item); + } + }, _react.default.createElement(_reactNative.View, null, result)) : null; + } + }, { + key: "_getChevron", + value: function _getChevron(item) { + var _this3 = this; + + if (!item.hasChildren) { + return null; + } + + var collapsed = this._isCollapsed(item.itemKey); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-chevron"] + }, _react.default.createElement(_buttonComponent.default, { + transparent: true, + bordered: false, + large: true, + style: _rssMyHomeConfigComponent.default.chevron, + onPress: function onPress() { + _this3.setState((0, _defineProperty2.default)({}, item.itemKey, !collapsed)); + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-chevron-icon"] + }, _react.default.createElement(_iconComponent.default, { + name: collapsed ? "chevron-down" : "chevron-up", + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + style: _rssMyHomeConfigComponent.default.chevronIcon + })))); + } + }, { + key: "_hasChildrenSelected", + value: function _hasChildrenSelected(item) { + var sections = this.state.sections; + + if (item.hasChildren) { + var children = []; + sections.forEach(function (_ref5) { + var data = _ref5.data; + children.push.apply(children, (0, _toConsumableArray2.default)(data.filter(function (cat) { + return cat.parentKey === item.itemKey && cat.depth > item.depth; + }))); + }); + + for (var i = 0; i < children.length; i++) { + if (isSelected(children[i].itemKey) || this._hasChildrenSelected(children[i])) { + return true; + } + } + } + + return false; + } + }, { + key: "_getListItemParent", + value: function _getListItemParent(item) { + var _this4 = this; + + var articlesCount = item.articlesCount, + itemKey = item.itemKey, + image = item.image, + imageSize = item.imageSize; + + var _global$getRssIndex2 = global.getRssIndex(), + supportColor = _global$getRssIndex2.supportColor; + + var checked = isSelected(itemKey); + var filter = !checked && !this._hasChildrenSelected(item) ? _imageComponent.FILTER.GRAYSCALE : undefined; + var defaultImageHeight = _$$_REQUIRE(_dependencyMap[27]).PlatformUtils.isTablet() ? _$$_REQUIRE(_dependencyMap[27]).PlatformUtils.isiPadPro12dot9() ? _rssMyHomeConfigComponent.IMAGE_HEIGHT_TABLET_LARGE : _rssMyHomeConfigComponent.IMAGE_HEIGHT_TABLET : _rssMyHomeConfigComponent.IMAGE_HEIGHT_PHONE; + var imageStyle = [_rssMyHomeConfigComponent.default.image, { + height: defaultImageHeight + }, _$$_REQUIRE(_dependencyMap[26]).Css.getStyleObjByCssClasses(["my-home-config-image", "my-home-config-line-parent-image"])]; + var ImageComponent; + + if (imageSize.width > imageSize.height) { + var imageHeight = _$$_REQUIRE(_dependencyMap[27]).CssUtils.getAttributeFromStyle("height", imageStyle, defaultImageHeight); + + var scale = _deviceUtils.default.getSafeAreaWidth() / (imageSize.width * imageHeight / imageSize.height); + var translateY = imageHeight * ((scale - 1) / 2 - 0.3333333333333333); + imageStyle.push({ + transform: [{ + translateY: translateY + }, { + scale: scale + }] + }); + ImageComponent = _react.default.createElement(_imageComponent.default, { + filter: filter, + style: imageStyle, + resizeMethod: "scale", + resizeMode: "contain", + source: { + uri: image + } + }); + } else { + ImageComponent = _react.default.createElement(_blurImageComponent.default, { + image: image, + style: imageStyle, + filter: filter + }); + } + + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _rssMyHomeConfigComponent.default.view + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-parent-overlay"] + }, _react.default.createElement(_reactNative.View, { + style: _rssMyHomeConfigComponent.default.overlay + })), ImageComponent, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-parent-content"] + }, _react.default.createElement(_reactNative.View, { + style: _rssMyHomeConfigComponent.default.content + }, _react.default.createElement(_reactNative.View, { + style: _rssMyHomeConfigComponent.default.text + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-parent-title"] + }, _react.default.createElement(_fontText.default, { + allowFontScaling: true, + adjustsFontSizeToFit: true, + numberOfLines: 1, + style: _rssMyHomeConfigComponent.default.category + }, (0, _$$_REQUIRE(_dependencyMap[25]).getCategoryLabel)(itemKey))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-parent-counter"] + }, _react.default.createElement(_fontText.default, { + allowFontScaling: true, + adjustsFontSizeToFit: true, + numberOfLines: 1, + style: _rssMyHomeConfigComponent.default.articles + }, global.strings("article_count", { + count: articlesCount + })))), _react.default.createElement(_checkboxComponent.default, { + style: _rssMyHomeConfigComponent.default.checkbox, + checked: checked, + checkedStyle: { + borderColor: supportColor, + backgroundColor: supportColor + }, + checkStyle: { + color: _$$_REQUIRE(_dependencyMap[27]).ColorUtils.determineTextColor(supportColor) + }, + onPress: function onPress() { + return _this4._onPress(item); + } + }))), this._getChevron(item))), this.renderSeparator()); + } + }, { + key: "_getListItemChild", + value: function _getListItemChild(item) { + var _this5 = this; + + var articlesCount = item.articlesCount, + itemKey = item.itemKey; + + var _global$getRssIndex3 = global.getRssIndex(), + menuBackgroundColor = _global$getRssIndex3.menuBackgroundColor, + supportColor = _global$getRssIndex3.supportColor; + + var checked = isSelected(itemKey); + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-child"] + }, _react.default.createElement(_reactNative.View, { + style: [_rssMyHomeConfigComponent.default.childView, { + backgroundColor: checked ? supportColor : menuBackgroundColor + }] + }, _react.default.createElement(_reactNative.View, { + style: _rssMyHomeConfigComponent.default.childContent + }, _react.default.createElement(_reactNative.View, null, _react.default.createElement(_checkboxComponent.default, { + checked: checked, + uncheckedStyle: { + backgroundColor: _$$_REQUIRE(_dependencyMap[27]).colors.transparent, + borderColor: _$$_REQUIRE(_dependencyMap[27]).colors.black + }, + checkedStyle: { + borderColor: _$$_REQUIRE(_dependencyMap[27]).colors.white, + backgroundColor: supportColor + }, + checkStyle: { + color: _$$_REQUIRE(_dependencyMap[27]).ColorUtils.determineTextColor(supportColor) + }, + onPress: function onPress() { + return _this5._onPress(item); + } + })), _react.default.createElement(_reactNative.View, { + style: _rssMyHomeConfigComponent.default.childText + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-child-text"] + }, _react.default.createElement(_fontText.default, { + allowFontScaling: true, + adjustsFontSizeToFit: true, + numberOfLines: 1, + style: [_rssMyHomeConfigComponent.default.childCategory, { + color: _$$_REQUIRE(_dependencyMap[27]).ColorUtils.determineTextColor(checked ? supportColor : menuBackgroundColor) + }] + }, (0, _$$_REQUIRE(_dependencyMap[25]).getCategoryLabel)(itemKey))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-line-child-counter"] + }, _react.default.createElement(_fontText.default, { + allowFontScaling: true, + adjustsFontSizeToFit: true, + numberOfLines: 1, + style: [_rssMyHomeConfigComponent.default.childArticles, { + color: checked ? _$$_REQUIRE(_dependencyMap[27]).colors.white : _$$_REQUIRE(_dependencyMap[27]).colors.black + }] + }, global.strings("article_count", { + count: articlesCount + }))))))), this.renderSeparator()); + } + }, { + key: "_getDarknessBackground", + value: function _getDarknessBackground(item, menuBackgroundColor) { + var darkPercentageDecrease = item.depth ? Math.min(100, item.depth * 15) : 0; + return _$$_REQUIRE(_dependencyMap[27]).ColorUtils.applyDarknessToHex(menuBackgroundColor, darkPercentageDecrease); + } + }, { + key: "renderSeparator", + value: function renderSeparator() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-separator"] + }, _react.default.createElement(_reactNative.View, { + style: _rssMyHomeConfigComponent.default.listSeparator + })); + } + }, { + key: "render", + value: function render() { + var _this6 = this; + + var _this$props = this.props, + showAlwaysOnClose = _this$props.showAlwaysOnClose, + onClose = _this$props.onClose, + closeText = _this$props.closeText, + style = _this$props.style, + listStyle = _this$props.listStyle; + var _this$state = this.state, + loading = _this$state.loading, + sections = _this$state.sections, + populatedSections = _this$state.populatedSections; + var firstLevelSections = sections ? sections.filter(function (section) { + return section.depth === 0; + }) : []; + + var _global$getRssIndex4 = global.getRssIndex(), + supportColor = _global$getRssIndex4.supportColor; + + var _global$getUserSettin3 = global.getUserSettings(), + selectedMyHomeCategories = _global$getUserSettin3.selectedMyHomeCategories; + + if (loading || !sections) { + return null; + } + + return _react.default.createElement(_reactNative.View, { + style: [_rssMyHomeConfigComponent.default.container, style] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-header"] + }, _react.default.createElement(_reactNative.View, { + style: [_rssMyHomeConfigComponent.default.line, _rssMyHomeConfigComponent.default.headerParent] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-header-text"] + }, _react.default.createElement(_fontText.default, { + style: [_rssMyHomeConfigComponent.default.lineText, _rssMyHomeConfigComponent.default.header] + }, this._getText())))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[28]).TecnaviaSectionList, { + sections: sections, + stickySectionHeadersEnabled: true, + keyExtractor: function keyExtractor(item, index) { + return "my_home_config_item_" + index; + }, + renderItem: function renderItem(_ref6) { + var item = _ref6.item, + section = _ref6.section; + + if (!_this6._isParentSectionCollapsed(section) && !_this6._isCollapsed(section.itemKey)) { + return _this6._getListItem(item); + } + + return null; + }, + renderSectionHeader: function renderSectionHeader(_ref7) { + var section = _ref7.section; + + if (populatedSections > 1 && !_this6._isParentSectionCollapsed(section) && (section.depth === 0 && firstLevelSections.length > 1 || section.depth > 0)) { + var backgroundColor = _this6._getDarknessBackground(section, supportColor); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-section"] + }, _react.default.createElement(_reactNative.View, { + style: [_rssMyHomeConfigComponent.default.line, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-section-text"] + }, _react.default.createElement(_fontText.default, { + style: [_rssMyHomeConfigComponent.default.lineText, _rssMyHomeConfigComponent.default.section, { + color: _$$_REQUIRE(_dependencyMap[27]).ColorUtils.determineTextColor(backgroundColor), + textTransform: "uppercase" + }] + }, (0, _$$_REQUIRE(_dependencyMap[25]).getCategoryLabel)(section.title))), _this6._getChevron(section))); + } + + return null; + }, + extraData: this.state, + contentContainerStyle: listStyle + }), showAlwaysOnClose || selectedMyHomeCategories && selectedMyHomeCategories.length > 0 ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-footer"] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + style: [_rssMyHomeConfigComponent.default.line, _rssMyHomeConfigComponent.default.footer, { + backgroundColor: supportColor + }], + onPress: function onPress() { + if (onClose) { + onClose(); + } + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).Css, { + classes: ["my-home-config-footer-text"] + }, _react.default.createElement(_fontText.default, { + style: [_rssMyHomeConfigComponent.default.lineText, _rssMyHomeConfigComponent.default.section, { + color: _$$_REQUIRE(_dependencyMap[27]).ColorUtils.determineTextColor(supportColor) + }] + }, closeText ? closeText : global.strings("btn_go_to_news"))))) : null); + } + }]); + return RssMyHomeConfig; + }(_react.default.Component); + + exports.RssMyHomeConfig = RssMyHomeConfig; + RssMyHomeConfig.propTypes = { + category: _propTypes.default.string, + closeText: _propTypes.default.string, + showAlwaysOnClose: _propTypes.default.bool, + onClose: _propTypes.default.func, + style: _propTypes.default.any, + listStyle: _propTypes.default.any + }; + RssMyHomeConfig.defaultProps = { + showAlwaysOnClose: false + }; +},2229,[5,80,21,27,7,8,12,14,16,6,17,201,28,1879,2230,2044,2207,588,1806,2202,2231,1963,458,2050,2046,2051,699,462,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.IMAGE_HEIGHT_PHONE = exports.IMAGE_HEIGHT_TABLET = exports.IMAGE_HEIGHT_TABLET_LARGE = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var MAIN_FONT_SIZE = 30; + var SUB_FONT_SIZE = 16; + var FONT_SIZE = 18; + var IMAGE_HEIGHT_TABLET_LARGE = 250; + exports.IMAGE_HEIGHT_TABLET_LARGE = IMAGE_HEIGHT_TABLET_LARGE; + var IMAGE_HEIGHT_TABLET = 210; + exports.IMAGE_HEIGHT_TABLET = IMAGE_HEIGHT_TABLET; + var IMAGE_HEIGHT_PHONE = 140; + exports.IMAGE_HEIGHT_PHONE = IMAGE_HEIGHT_PHONE; + + var _default = _reactNative.StyleSheet.create({ + container: { + flex: 1, + flexDirection: "column", + justifyContent: "space-evenly", + backgroundColor: "white" + }, + line: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + justifyContent: "center", + minHeight: _$$_REQUIRE(_dependencyMap[2]).RSS_HEADER_HEIGHT, + paddingHorizontal: 10, + paddingVertical: 10 + }, + lineText: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.grey400, + fontSize: SUB_FONT_SIZE + }, + section: { + fontSize: FONT_SIZE + }, + headerParent: { + alignItems: "center" + }, + header: { + textAlign: "center" + }, + footer: { + height: _$$_REQUIRE(_dependencyMap[2]).RSS_HEADER_HEIGHT, + alignItems: "center" + }, + listSeparator: { + height: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + image: { + zIndex: 0 + }, + overlay: { + position: "absolute", + left: 0, + top: 0, + bottom: 0, + right: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent1200, + zIndex: 1 + }, + content: { + flex: 1, + flexDirection: "row", + position: "absolute", + alignItems: "center", + zIndex: 2 + }, + text: { + flex: 3, + flexDirection: "column", + alignContent: "center", + justifyContent: "center" + }, + checkbox: { + start: 0, + position: "absolute", + width: 30, + height: 30 + }, + parentCategory: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white, + textAlign: "center", + fontSize: FONT_SIZE, + textShadowRadius: 5, + textShadowColor: _$$_REQUIRE(_dependencyMap[1]).colors.textShadow + }, + category: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white, + textAlign: "center", + fontSize: MAIN_FONT_SIZE, + textShadowRadius: 5, + textShadowColor: _$$_REQUIRE(_dependencyMap[1]).colors.textShadow + }, + articles: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white, + textAlign: "center", + fontSize: FONT_SIZE, + textShadowRadius: 5, + textShadowColor: _$$_REQUIRE(_dependencyMap[1]).colors.textShadow + }, + view: { + flex: 1, + justifyContent: "center", + alignContent: "center", + overflow: "hidden" + }, + childView: { + flex: 1, + justifyContent: "center", + alignContent: "center", + paddingVertical: 16, + paddingLeft: 16, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey + }, + childContent: { + flex: 1, + flexDirection: "row", + justifyContent: "space-between" + }, + childCheckBox: { + borderRadius: 10, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent + }, + childCheckBoxChecked: { + borderRadius: 10, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + childText: { + flex: 1, + flexDirection: "row", + alignItems: "center", + justifyContent: "space-between" + }, + childCategory: { + flex: 1, + color: _$$_REQUIRE(_dependencyMap[1]).colors.black, + fontSize: SUB_FONT_SIZE, + textAlign: "center" + }, + childArticles: { + flex: 1, + color: _$$_REQUIRE(_dependencyMap[1]).colors.black, + fontSize: FONT_SIZE, + textAlign: "center" + }, + chevron: { + zIndex: 5, + position: "absolute", + right: 0, + justifyContent: "center", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent, + paddingHorizontal: 0 + }, + chevronIcon: { + fontSize: 40, + color: "white" + } + }); + + exports.default = _default; +},2230,[28,462,2039]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var styles = _reactNative.StyleSheet.create({ + checkBox: { + width: 40, + height: 40, + borderRadius: 40, + borderWidth: 0.3, + margin: 5, + justifyContent: "center", + alignItems: "center", + borderColor: _$$_REQUIRE(_dependencyMap[5]).colors.black + }, + checkBoxChecked: { + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.black + }, + checkBoxUnchecked: { + borderColor: _$$_REQUIRE(_dependencyMap[5]).colors.white + }, + check: { + fontSize: 15, + color: _$$_REQUIRE(_dependencyMap[5]).colors.white + } + }); + + var TecnaviaCheckBox = function TecnaviaCheckBox(props) { + var checked = props.checked, + onPress = props.onPress, + checkClass = props.checkClass, + checkedClass = props.checkedClass, + uncheckedClass = props.uncheckedClass, + style = props.style, + checkedStyle = props.checkedStyle, + uncheckedStyle = props.uncheckedStyle, + checkStyle = props.checkStyle; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["checkbox", checked ? "checkbox-checked" : "checkbox-unchecked", checked ? checkedClass : uncheckedClass] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress, + style: [styles.checkBox, checked ? styles.checkBoxChecked : styles.checkBoxUnchecked, style, checked ? checkedStyle : uncheckedStyle] + }, checked ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["checkbox-check", checkClass] + }, _react.default.createElement(_iconComponent.default, { + style: [styles.check, checkStyle], + name: "check", + type: _iconComponent.TecnaviaIconType.FONT_AWESOME + })) : null)); + }; + + TecnaviaCheckBox.propTypes = { + checkClass: _propTypes.default.string, + checkedClass: _propTypes.default.string, + uncheckedClass: _propTypes.default.string, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + checkedStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + uncheckedStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + checkStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + checked: _propTypes.default.bool, + onPress: _propTypes.default.func + }; + TecnaviaCheckBox.defaultProps = { + checkClass: "", + checkedClass: "", + uncheckedClass: "" + }; + var _default = TecnaviaCheckBox; + exports.default = _default; +},2231,[5,17,201,28,1806,462,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GeneralSettingsScreen = exports.GeneralSettingsModules = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _settingHeader = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _rssBaseStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _settingsRssManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _settingsNewsmemoryManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _settingsManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _settingsNewsmemoryAdvanceManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _settingsOthers = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GeneralSettingsModules = { + RSS: 1, + EPAPER: 2 + }; + exports.GeneralSettingsModules = GeneralSettingsModules; + + var GeneralSettingsScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(GeneralSettingsScreen, _NavigationBaseScreen); + + var _super = _createSuper(GeneralSettingsScreen); + + function GeneralSettingsScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, GeneralSettingsScreen); + _this = _super.call(this, props); + _this.prevNewsmemoryConfig = {}; + _this.state = { + sections: [] + }; + _this.onNavigation = _this._onNavigation.bind((0, _assertThisInitialized2.default)(_this)); + var labels = { + startup: _this._getStartupLabel(), + ePaper: _this._getEpaperLabel(), + rss: _this._getRssLabel() + }; + _this.updateUI = _this._updateUI.bind((0, _assertThisInitialized2.default)(_this)); + _this.settingsMgr = new _settingsManager.default(_this.onNavigation, labels); + + _this._setMgrCollpasable(_this.settingsMgr, false); + + _this.othersMgr = new _settingsOthers.default(_this.onNavigation, labels); + + _this._setMgrCollpasable(_this.othersMgr, false, false); + + _this.rssSettingsMgr = new _settingsRssManager.default(_this.onNavigation, labels); + + _this._setMgrCollpasable(_this.rssSettingsMgr, false); + + _this.newsmemorySettingsMgr = new _settingsNewsmemoryManager.default(_this.onNavigation, labels); + + _this._setMgrCollpasable(_this.newsmemorySettingsMgr, false); + + _this.advanceNewsmemorySettingsMgr = new _settingsNewsmemoryAdvanceManager.default(_this.onNavigation, labels); + + _this._setMgrCollpasable(_this.advanceNewsmemorySettingsMgr, true); + + return _this; + } + + (0, _createClass2.default)(GeneralSettingsScreen, [{ + key: "_onNavigation", + value: function _onNavigation(route, params) { + var navigation = this.props.navigation; + + if (navigation && route) { + if (route === "back") { + navigation.goBack(); + } else { + navigation.navigate(route, params); + } + } + } + }, { + key: "_setMgrCollpasable", + value: function _setMgrCollpasable(mgr, state) { + var collapsable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + mgr.setCollapsed(state); + mgr.setCollapsable(collapsable); + mgr.setUpdateUICallback(this.updateUI); + } + }, { + key: "_updateUI", + value: function _updateUI() { + _reactNative.LayoutAnimation.configureNext(_reactNative.LayoutAnimation.Presets.easeInEaseOut); + + this.forceUpdate(); + } + }, { + key: "didFocus", + value: function didFocus() { + (0, _get2.default)((0, _getPrototypeOf2.default)(GeneralSettingsScreen.prototype), "didFocus", this).call(this); + (0, _extends2.default)(this.prevNewsmemoryConfig, global.getNewsmemoryConfig()); + } + }, { + key: "willBlur", + value: function willBlur() { + (0, _get2.default)((0, _getPrototypeOf2.default)(GeneralSettingsScreen.prototype), "willBlur", this).call(this); + + if (this.prevNewsmemoryConfig && !_$$_REQUIRE(_dependencyMap[21]).JSUtils.equals(this.prevNewsmemoryConfig, global.getNewsmemoryConfig())) { + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.NEWSMEMORY_CONFIG_CHANGE, { + previousConfig: this.prevNewsmemoryConfig + }); + } + } + }, { + key: "getTag", + value: function getTag() { + return "Settings"; + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(GeneralSettingsScreen.prototype), "handleBackButton", this).call(this); + this.props.navigation.pop(); + return true; + } + }, { + key: "_renderSeparator", + value: function _renderSeparator() { + return null; + } + }, { + key: "_renderSeparatorHeaderBottom", + value: function _renderSeparatorHeaderBottom() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).Css, { + classes: ["settings-header-separator"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[24]).styles.separator + })); + } + }, { + key: "_getRssLabel", + value: function _getRssLabel() { + return global.strings("settings_startup_rss"); + } + }, { + key: "_getEpaperLabel", + value: function _getEpaperLabel() { + var params = (0, _$$_REQUIRE(_dependencyMap[25]).getNavigationParams)(this.props); + return params.epaperLabel || global.strings("settings_startup_epaper"); + } + }, { + key: "_getStartupLabel", + value: function _getStartupLabel() { + var _global$getRSSActiveP = global.getRSSActivePSetup(), + appModeSelectionPageEnabled = _global$getRSSActiveP.appModeSelectionPageEnabled; + + var _global$getUserSettin = global.getUserSettings(), + userDefinedStartupMode = _global$getUserSettin.userDefinedStartupMode, + startInRss = _global$getUserSettin.startInRss; + + if (appModeSelectionPageEnabled && _$$_REQUIRE(_dependencyMap[21]).JSUtils.isNull(userDefinedStartupMode)) { + return global.strings("settings_startup_choose"); + } + + if (startInRss) { + return this._getRssLabel(); + } + + return this._getEpaperLabel(); + } + }, { + key: "_getSections", + value: function _getSections() { + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[25]).getNavigationParams)(this.props), + module = _getNavigationParams.module; + + var sections = []; + + if (module === GeneralSettingsModules.EPAPER) { + sections.push(this.newsmemorySettingsMgr.getSettings()); + sections.push(this.advanceNewsmemorySettingsMgr.getSettings()); + } + + if (module === GeneralSettingsModules.RSS) { + sections.push(this.rssSettingsMgr.getSettings()); + } + + sections.push(this.settingsMgr.getSettings()); + sections.push(this.othersMgr.getSettings()); + return sections.map(function (section) { + section.data.filter(function (item) { + return item !== undefined; + }); + return section; + }); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var sections = this._getSections(); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[23]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).Css, { + classes: ["settings-screen"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[24]).styles.root, { + paddingHorizontal: (0, _rssBaseStyle.getRssHorizontalpadding)() + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).Css, { + classes: ["settings-parent"] + }, _react.default.createElement(_reactNative.View, { + style: [_rssBaseStyle.default.shadow, { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[21]).PlatformUtils.isIOS() ? _$$_REQUIRE(_dependencyMap[21]).colors.transparent : backgroundColor + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).Css, { + classes: ["settings-list"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[26]).TecnaviaSectionList, { + sections: sections, + keyExtractor: function keyExtractor(item, index) { + return "_item_" + index; + }, + stickySectionHeadersEnabled: true, + style: { + backgroundColor: backgroundColor + }, + renderItem: function renderItem(_ref) { + var item = _ref.item; + return item; + }, + ItemSeparatorComponent: this._renderSeparator, + renderSectionHeader: function renderSectionHeader(_ref2) { + var _ref2$section = _ref2.section, + label = _ref2$section.label, + collapsable = _ref2$section.collapsable, + collapsed = _ref2$section.collapsed, + collapse = _ref2$section.collapse; + + if (!label) { + return null; + } + + var onPress = function onPress() { + if (typeof collapse === "function") { + collapse(!collapsed); + } + }; + + return label ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[24]).styles.headerParent, { + backgroundColor: backgroundColor + }] + }, collapsable ? _react.default.createElement(_settingHeader.SettingHeaderAccordion, { + collapsed: collapsed, + onPress: onPress + }) : null, _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, _react.default.createElement(_settingHeader.default, { + label: label, + onPress: onPress + }))), _this2._renderSeparatorHeaderBottom()) : null; + } + })))))); + } + }]); + return GeneralSettingsScreen; + }(_$$_REQUIRE(_dependencyMap[25]).NavigationBaseScreen); + + exports.GeneralSettingsScreen = GeneralSettingsScreen; + GeneralSettingsScreen.propTypes = { + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func.isRequired + }).isRequired + }; +},2232,[5,6,7,8,15,90,12,14,16,17,28,201,2233,2039,2235,2241,2250,460,1859,2253,2255,462,572,699,2234,2148,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.SettingClose = exports.SettingHeaderAccordion = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var SettingClose = function SettingClose(props) { + var onPress = props.onPress; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultBackgroundColor(); + + var color = _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress, + style: [_$$_REQUIRE(_dependencyMap[7]).styles.headerAccordionParent, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_iconComponent.default, { + style: [_$$_REQUIRE(_dependencyMap[7]).styles.headerAccordion, { + color: color + }], + name: "close", + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS + })); + }; + + exports.SettingClose = SettingClose; + SettingClose.propTypes = { + onPress: _propTypes.default.func.isRequired + }; + + var SettingHeaderAccordion = function SettingHeaderAccordion(props) { + var collapsed = props.collapsed, + onPress = props.onPress; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultBackgroundColor(); + + var color = _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress, + style: [_$$_REQUIRE(_dependencyMap[7]).styles.headerAccordionParent, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_iconComponent.default, { + style: [_$$_REQUIRE(_dependencyMap[7]).styles.headerAccordion, { + color: color + }], + name: !collapsed ? "chevron-up" : "chevron-down", + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS + })); + }; + + exports.SettingHeaderAccordion = SettingHeaderAccordion; + SettingHeaderAccordion.propTypes = { + collapsed: _propTypes.default.bool, + onPress: _propTypes.default.func.isRequired + }; + + var SettingHeader = function SettingHeader(props) { + var label = props.label, + onPress = props.onPress; + var Parent = typeof onPress === "function" ? _reactNative.TouchableOpacity : _reactNative.View; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultBackgroundColor(); + + var color = _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["settings-header-parent"] + }, _react.default.createElement(Parent, { + style: [_$$_REQUIRE(_dependencyMap[7]).styles.rowHeader, { + backgroundColor: backgroundColor + }], + onPress: onPress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["settings-header-text"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: [_$$_REQUIRE(_dependencyMap[7]).styles.headerText, { + color: color + }] + }, label.toUpperCase())))); + }; + + SettingHeader.propTypes = { + label: _propTypes.default.string.isRequired, + onPress: _propTypes.default.func + }; + var _default = SettingHeader; + exports.default = _default; +},2233,[5,17,201,28,1879,1806,699,2234]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = exports.ROW_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var ROW_HEIGHT = 40; + exports.ROW_HEIGHT = ROW_HEIGHT; + var TITLE_HEIGHT = 30; + var ROW_PADDING = 10; + + var styles = _reactNative.StyleSheet.create({ + root: { + flex: 1 + }, + separator: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey, + height: 1 + }, + separatorHeaderTop: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey, + height: 5 + }, + row: { + minHeight: ROW_HEIGHT, + flexDirection: "row", + padding: ROW_PADDING + }, + rowSlider: { + minHeight: ROW_HEIGHT, + flexDirection: "column", + padding: ROW_PADDING + }, + sliderTextParent: { + flex: 1, + flexDirection: "row", + justifyContent: "space-between" + }, + headerParent: { + flexDirection: "row", + alignItems: "center" + }, + headerAccordionParent: { + height: ROW_HEIGHT, + width: ROW_HEIGHT, + justifyContent: "center", + alignItems: "center", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + headerAccordion: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.black, + fontSize: 30 + }, + rowHeader: { + minHeight: ROW_HEIGHT, + justifyContent: "center", + padding: ROW_PADDING, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + textParent: { + flex: 1, + flexDirection: "column", + justifyContent: "center", + paddingEnd: ROW_PADDING + }, + headerText: { + fontSize: 20, + color: _$$_REQUIRE(_dependencyMap[1]).colors.black + }, + title: { + minHeight: TITLE_HEIGHT, + fontSize: 16 + }, + value: { + minHeight: -10, + fontSize: 12, + textAlign: "left", + color: _$$_REQUIRE(_dependencyMap[1]).colors.grey400 + }, + buttonParent: { + justifyContent: "center" + }, + btn: { + width: 110, + height: 10, + borderWidth: 2, + justifyContent: "center", + alignItems: "center" + }, + input: { + height: 40, + marginTop: 5, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey, + borderWidth: 1 + }, + debugButton: { + height: 40, + marginTop: 5, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey, + borderWidth: 1, + justifyContent: "center", + alignItems: "center" + }, + modal: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + hidden: { + fontSize: 12, + color: _$$_REQUIRE(_dependencyMap[1]).colors.grey400 + }, + log: { + height: 40, + marginTop: 5, + justifyContent: "center" + } + }); + + exports.styles = styles; +},2234,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _settingButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _settingMyHome = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _settingsBaseManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingsRssManager = function (_SettingsBaseManager) { + (0, _inherits2.default)(SettingsRssManager, _SettingsBaseManager); + + var _super = _createSuper(SettingsRssManager); + + function SettingsRssManager(onNavigation, labels) { + var _this; + + (0, _classCallCheck2.default)(this, SettingsRssManager); + _this = _super.call(this, onNavigation, labels); + _this.toggleLayout = _this._toggleLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearFavorites = _this._clearFavorites.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearCache = _this._clearCache.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearDatabase = _this._clearDatabase.bind((0, _assertThisInitialized2.default)(_this)); + _this.showTutorial = _this._showTutorial.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SettingsRssManager, [{ + key: "_retrieveCacheSize", + value: function _retrieveCacheSize() { + var cacheSize; + return _regenerator.default.async(function _retrieveCacheSize$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.getCacheSize()); + + case 2: + cacheSize = _context.sent; + return _context.abrupt("return", _$$_REQUIRE(_dependencyMap[16]).StringUtils.sizeToString(cacheSize)); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_retrieveFavorites", + value: function _retrieveFavorites() { + var favoritesConfig = global.getRssFavoritesConfig(); + return favoritesConfig.getCount(); + } + }, { + key: "_toggleLayout", + value: function _toggleLayout() { + return global.getUserSettings().toggleLayout().text; + } + }, { + key: "_clearFavorites", + value: function _clearFavorites() { + try { + var favoritesConfig = global.getRssFavoritesConfig(); + favoritesConfig.clearFavorites(); + } catch (err) { + this._displayToast(global.strings("err_clear_favorites")); + } + + return this._retrieveFavorites(); + } + }, { + key: "_clearCache", + value: function _clearCache() { + return _regenerator.default.async(function _clearCache$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + _context2.next = 3; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.clearCache()); + + case 3: + _context2.next = 8; + break; + + case 5: + _context2.prev = 5; + _context2.t0 = _context2["catch"](0); + + this._displayToast(global.strings("err_clear_cache")); + + case 8: + return _context2.abrupt("return", this._retrieveCacheSize()); + + case 9: + case "end": + return _context2.stop(); + } + } + }, null, this, [[0, 5]], Promise); + } + }, { + key: "_clearDatabase", + value: function _clearDatabase() { + return _regenerator.default.async(function _clearDatabase$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + _context3.next = 3; + return _regenerator.default.awrap(_RssContentHelper.default.deleteDatabase()); + + case 3: + _LiveConfig.default.setRssDbDeleted(true); + + this._displayToast(global.strings("database_deleted")); + + _context3.next = 10; + break; + + case 7: + _context3.prev = 7; + _context3.t0 = _context3["catch"](0); + + this._displayToast(global.strings("err_clear_database")); + + case 10: + case "end": + return _context3.stop(); + } + } + }, null, this, [[0, 7]], Promise); + } + }, { + key: "_showTutorial", + value: function _showTutorial() { + this.onNavigation("TutorialScreen", { + goBack: true + }); + } + }, { + key: "getSettings", + value: function getSettings() { + var rss = this.labels.rss; + var rssIndexConfig = global.getRssIndex(); + var tutorials = rssIndexConfig.tutorials; + var showToggleLayout = rssIndexConfig.needToShowLayoutButton(); + var myHomeLabel = (0, _$$_REQUIRE(_dependencyMap[17]).getMyHomeLabel)(); + return (0, _extends2.default)({ + label: rss + }, this.getCollapsedParams(), { + data: this.isCollapsed() ? [] : [showToggleLayout ? _react.default.createElement(_settingButton.default, { + label: global.strings("layout"), + value: global.getUserSettings().layout.text, + button: global.strings("toggle"), + onChange: this.toggleLayout + }) : null, myHomeLabel ? _react.default.createElement(_settingMyHome.default, { + label: myHomeLabel, + button: global.strings("change") + }) : null, _react.default.createElement(_settingButton.default, { + label: global.strings("favorites"), + button: global.strings("clear"), + value: this._retrieveFavorites(), + onChange: this.clearFavorites, + alert: { + title: global.strings("msg_clear_favorites"), + message: global.strings("alert_message") + } + }), _react.default.createElement(_settingButton.default, { + label: global.strings("cache_size"), + button: global.strings("clear"), + value: this._retrieveCacheSize, + onChange: this.clearCache, + alert: { + title: global.strings("msg_clear_cache"), + message: global.strings("alert_message") + } + }), _react.default.createElement(_settingButton.default, { + label: global.strings("database"), + button: global.strings("clear"), + onChange: this.clearDatabase, + alert: { + title: global.strings("msg_database_deleted"), + message: global.strings("alert_message") + } + }), !_$$_REQUIRE(_dependencyMap[16]).JSUtils.isEmpty(tutorials) ? _react.default.createElement(_settingButton.default, { + label: global.strings("tutorial"), + button: global.strings("show"), + onChange: this.showTutorial + }) : null] + }); + } + }]); + return SettingsRssManager; + }(_settingsBaseManager.default); + + exports.default = SettingsRssManager; +},2235,[5,80,6,7,8,15,12,14,16,17,1872,2207,574,2236,2239,2240,462,2046]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _setting = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingButton = function (_React$Component) { + (0, _inherits2.default)(SettingButton, _React$Component); + + var _super = _createSuper(SettingButton); + + function SettingButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, SettingButton); + _this = _super.call(this, props); + _this.state = { + value: typeof props.value === "function" ? global.strings("loading") : props.value + }; + _this.onChange = _this._onChange.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SettingButton, [{ + key: "componentDidMount", + value: function componentDidMount() { + var value; + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + value = this.props.value; + + if (!(typeof value === "function")) { + _context.next = 8; + break; + } + + _context.t0 = this; + _context.next = 5; + return _regenerator.default.awrap(value()); + + case 5: + _context.t1 = _context.sent; + _context.t2 = { + value: _context.t1 + }; + + _context.t0.setState.call(_context.t0, _context.t2); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onChange", + value: function _onChange() { + var onChange, value; + return _regenerator.default.async(function _onChange$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + onChange = this.props.onChange; + + if (!(typeof onChange === "function")) { + _context2.next = 6; + break; + } + + _context2.next = 4; + return _regenerator.default.awrap(onChange()); + + case 4: + value = _context2.sent; + this.setState({ + value: value + }); + + case 6: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_renderAlert", + value: function _renderAlert(title, message) { + _reactNative.Alert.alert(title, message, [{ + text: global.strings("btn_cancel"), + onPress: function onPress() {}, + style: "cancel" + }, { + text: global.strings("btn_ok"), + onPress: this.onChange + }], { + cancelable: false + }); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + label = _this$props.label, + button = _this$props.button, + alert = _this$props.alert; + var value = this.state.value; + return _react.default.createElement(_setting.default, { + label: label, + value: value, + onPress: alert ? function () { + return _this2._renderAlert(alert.title, alert.message); + } : this.onChange, + buttonText: button + }); + } + }]); + return SettingButton; + }(_react.default.Component); + + exports.default = SettingButton; + SettingButton.propTypes = { + label: _propTypes.default.string.isRequired, + value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.func]), + button: _propTypes.default.string, + alert: _propTypes.default.shape({ + title: _propTypes.default.string, + message: _propTypes.default.string + }), + onChange: _propTypes.default.func.isRequired + }; +},2236,[5,80,7,8,15,12,14,16,17,201,28,2237]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getSupportColor = getSupportColor; + exports.getRadius = getRadius; + exports.default = exports.Value = exports.Text = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function getSupportColor() { + var supportColor; + var rssIndexConfig = global.getRssIndex(); + + if (rssIndexConfig) { + supportColor = rssIndexConfig.supportColor; + } + + var baseStyle = _$$_REQUIRE(_dependencyMap[8]).Css.getStyleObjByCssClasses(["setting-base-style"]); + + return baseStyle.color || supportColor || _$$_REQUIRE(_dependencyMap[8]).Css.getDefaultForegroundColor(); + } + + function getRadius() { + var borderRadius; + var rssIndexConfig = global.getRssIndex(); + + if (rssIndexConfig) { + borderRadius = rssIndexConfig.borderRadius; + } + + var baseStyle = _$$_REQUIRE(_dependencyMap[8]).Css.getStyleObjByCssClasses(["setting-base-style"]); + + return baseStyle.borderRadius || borderRadius || 0; + } + + var Value = function Value(props) { + var value = props.value, + _props$cssProps = props.cssProps, + cssProps = _props$cssProps === undefined ? {} : _props$cssProps, + rest = (0, _objectWithoutProperties2.default)(props, ["value", "cssProps"]); + return value ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, (0, _extends2.default)({ + classes: ["setting-text-value"] + }, cssProps), _react.default.createElement(_fontText.default, (0, _extends2.default)({ + numberOfLines: 1, + style: _$$_REQUIRE(_dependencyMap[9]).styles.value + }, rest), value)) : null; + }; + + exports.Value = Value; + Value.propTypes = { + value: _propTypes.default.any, + cssProps: _propTypes.default.object + }; + + var Text = function Text(props) { + var label = props.label, + _props$cssProps2 = props.cssProps, + cssProps = _props$cssProps2 === undefined ? {} : _props$cssProps2, + rest = (0, _objectWithoutProperties2.default)(props, ["label", "cssProps"]); + + var color = _$$_REQUIRE(_dependencyMap[8]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, (0, _extends2.default)({ + classes: ["setting-text-label"] + }, cssProps), _react.default.createElement(_fontText.default, (0, _extends2.default)({ + style: [_$$_REQUIRE(_dependencyMap[9]).styles.title, { + color: color + }] + }, rest), label)); + }; + + exports.Text = Text; + Text.propTypes = { + label: _propTypes.default.string, + cssProps: _propTypes.default.object + }; + + var Setting = function Setting(props) { + var imageProps = props.imageProps, + label = props.label, + value = props.value, + onPress = props.onPress, + buttonText = props.buttonText, + children = props.children; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[8]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["setting-line"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[9]).styles.row, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["setting-icon-parent"] + }, _react.default.createElement(_reactNative.View, { + style: { + alignSelf: "center" + } + }, imageProps ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["setting-icon"] + }, _react.default.createElement(_imageIconChooserComponent.default, imageProps)) : null)), _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["setting-text-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[9]).styles.textParent + }, _react.default.createElement(Text, { + label: label + }), _react.default.createElement(Value, { + value: value + }))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["setting-button-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[9]).styles.buttonParent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["setting-button"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Circle.Button, { + onPress: onPress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["setting-button-text"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Circle.Text, null, buttonText)))))), children)); + }; + + Setting.propTypes = { + imageProps: _propTypes.default.object, + label: _propTypes.default.string.isRequired, + value: _propTypes.default.string, + onPress: _propTypes.default.func.isRequired, + buttonText: _propTypes.default.string.isRequired, + children: _propTypes.default.any + }; + Setting.defaultProps = { + value: "" + }; + var _default = Setting; + exports.default = _default; +},2237,[5,6,108,17,201,28,1879,1970,699,2238,2202]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = exports.ROW_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var ROW_HEIGHT = 70; + exports.ROW_HEIGHT = ROW_HEIGHT; + var TITLE_HEIGHT = 30; + var ROW_PADDING = 10; + + var styles = _reactNative.StyleSheet.create({ + root: { + flex: 1 + }, + separator: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey, + height: 1 + }, + row: { + minHeight: ROW_HEIGHT, + flexDirection: "row", + padding: ROW_PADDING, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + textParent: { + flex: 1, + flexDirection: "column", + justifyContent: "center", + paddingEnd: ROW_PADDING + }, + title: { + fontSize: 18, + color: _$$_REQUIRE(_dependencyMap[1]).colors.black + }, + value: { + minHeight: 20, + fontSize: 14, + textAlign: "left", + color: _$$_REQUIRE(_dependencyMap[1]).colors.grey400 + }, + buttonParent: { + justifyContent: "center", + width: 110 + }, + chkParent: { + width: 110, + alignItems: "center" + }, + btn: { + width: 110, + height: 40, + borderWidth: 0.3, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent200, + justifyContent: "center", + alignItems: "center" + }, + input: { + height: 40, + marginTop: 5, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey, + borderWidth: 1 + }, + debugButton: { + height: 40, + marginTop: 5, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.grey, + borderWidth: 1, + justifyContent: "center", + alignItems: "center" + }, + hidden: { + fontSize: 12, + color: _$$_REQUIRE(_dependencyMap[1]).colors.grey400 + }, + log: { + height: 40, + marginTop: 5, + justifyContent: "center" + } + }); + + exports.styles = styles; +},2238,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _setting = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _modal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var SettingMyHome = function SettingMyHome(props) { + var label = props.label, + button = props.button; + + var ref = _react.default.useRef(); + + var show = function show() { + return ref.current && ref.current.expand(); + }; + + var hide = function hide() { + return ref.current && ref.current.collapse(); + }; + + return _react.default.createElement(_setting.default, { + label: label, + buttonText: button, + onPress: show + }, _react.default.createElement(_modal.default, { + ref: ref, + containerStyle: { + paddingVertical: 0, + paddingHorizontal: 0, + flex: 1 + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).RssMyHomeConfig, { + showAlwaysOnClose: true, + onClose: hide, + closeText: global.strings("btn_close"), + category: label, + style: { + paddingBottom: 0 + } + }))); + }; + + SettingMyHome.propTypes = { + label: _propTypes.default.string.isRequired, + button: _propTypes.default.string, + alert: _propTypes.default.shape({ + title: _propTypes.default.string, + message: _propTypes.default.string + }) + }; + var _default = SettingMyHome; + exports.default = _default; +},2239,[5,17,201,2237,1882,2228]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var SettingsBaseManager = function () { + function SettingsBaseManager(onNavigation, labels) { + (0, _classCallCheck2.default)(this, SettingsBaseManager); + this.collapsable = false; + this.collapsed = false; + this.onNavigation = onNavigation; + this.labels = labels; + this.setCollapsed = this._setCollapsed.bind(this); + } + + (0, _createClass2.default)(SettingsBaseManager, [{ + key: "setUpdateUICallback", + value: function setUpdateUICallback(callback) { + this.updateUICallback = callback; + } + }, { + key: "setCollapsable", + value: function setCollapsable(collapsable) { + this.collapsable = collapsable; + } + }, { + key: "isCollapsable", + value: function isCollapsable() { + return this.collapsable; + } + }, { + key: "isCollapsed", + value: function isCollapsed() { + return this.collapsed; + } + }, { + key: "_setCollapsed", + value: function _setCollapsed(collapsed) { + this.collapsed = collapsed; + this.updateUI(); + } + }, { + key: "getCollapsedParams", + value: function getCollapsedParams() { + return { + collapsed: this.isCollapsed(), + collapsable: this.isCollapsable(), + collapse: this.setCollapsed + }; + } + }, { + key: "updateUI", + value: function updateUI() { + if (typeof this.updateUICallback === "function") { + this.updateUICallback(); + } + } + }, { + key: "_displayToast", + value: function _displayToast(msg) { + _$$_REQUIRE(_dependencyMap[3]).Toast.show(msg, { + position: "top" + }); + } + }]); + return SettingsBaseManager; + }(); + + exports.default = SettingsBaseManager; +},2240,[5,7,8,1889]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _TranslationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _NewsmemoryHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _settingPicker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _settingsBaseManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _settingCheckbox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[18])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingsNewsmemoryManager = function (_SettingsBaseManager) { + (0, _inherits2.default)(SettingsNewsmemoryManager, _SettingsBaseManager); + + var _super = _createSuper(SettingsNewsmemoryManager); + + function SettingsNewsmemoryManager() { + (0, _classCallCheck2.default)(this, SettingsNewsmemoryManager); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(SettingsNewsmemoryManager, [{ + key: "getSettings", + value: function getSettings() { + var _this = this; + + var _global$getMainPSetup = global.getMainPSetup(), + showTranslationCustomization = _global$getMainPSetup.showTranslationCustomization, + showArticleColumnViewCustomization = _global$getMainPSetup.showArticleColumnViewCustomization, + enableConnectivityOptions = _global$getMainPSetup.enableConnectivityOptions, + enableGraphSizeCustomization = _global$getMainPSetup.enableGraphSizeCustomization, + enableFontSizeCustomization = _global$getMainPSetup.enableFontSizeCustomization; + + var _global$getActivePSet = global.getActivePSetup(), + pSetup = _global$getActivePSet.pSetup, + machine = _global$getActivePSet.machine, + changeFavoriteEdition = _global$getActivePSet.changeFavoriteEdition; + + var newsmemoryConfig = global.getNewsmemoryConfig(); + var ePaper = this.labels.ePaper; + return (0, _extends2.default)({ + label: ePaper + }, this.getCollapsedParams(), { + data: this.isCollapsed() ? [] : [enableConnectivityOptions ? _react.default.createElement(_settingPicker.default, { + label: global.strings("network"), + value: "" + newsmemoryConfig.network, + values: [{ + image: _$$_REQUIRE(_dependencyMap[19]), + label: global.strings("connection_2"), + text: global.strings("connection_2_description"), + value: _$$_REQUIRE(_dependencyMap[20]).DownloadType.FULL + }, { + image: _$$_REQUIRE(_dependencyMap[21]), + label: global.strings("connection_1"), + text: global.strings("connection_1_description"), + value: _$$_REQUIRE(_dependencyMap[20]).DownloadType.MID_AND_LOW + }, { + image: _$$_REQUIRE(_dependencyMap[22]), + label: global.strings("connection_0"), + text: global.strings("connection_0_description"), + value: _$$_REQUIRE(_dependencyMap[20]).DownloadType.LOW_ONLY + }], + button: global.strings("change"), + onChange: function onChange(value) { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.network, "" + value); + } + }) : null, showTranslationCustomization && newsmemoryConfig.translationsAvailable && newsmemoryConfig.translationsAvailable.length > 0 ? _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_translate"), + value: newsmemoryConfig.currentTranslationLanguage || _NewsmemoryHelper.default.SP.values.no_translation, + values: function values() { + var translations = [{ + label: global.strings("disabled"), + value: _NewsmemoryHelper.default.SP.values.translation_disabled + }, { + label: global.strings("settings_translate_original"), + value: _NewsmemoryHelper.default.SP.values.no_translation + }]; + newsmemoryConfig.translationsAvailable.forEach(function (translation) { + translations.push({ + imageProps: { + source: _TranslationManager.default.getTranslationBadgeIcon(translation.language), + style: { + borderRadius: 40, + borderWidth: 1, + borderColor: _$$_REQUIRE(_dependencyMap[23]).colors.black + } + }, + label: translation.name, + value: translation.language + }); + }); + return translations; + }, + button: global.strings("change"), + onChange: function onChange(value) { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.current_translation_language, value); + } + }) : null, enableFontSizeCustomization ? _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_font_size"), + value: newsmemoryConfig.getFontSize(), + values: [{ + value: 75, + label: "x0.75 " + global.strings("font_small") + }, { + value: 85, + label: "x0.85" + }, { + value: 100, + label: "" + global.strings("font_normal") + }, { + value: 125, + label: "x1.25" + }, { + value: 150, + label: "x1.50" + }, { + value: 200, + label: "x2.00" + }, { + value: 250, + label: "x2.50 " + global.strings("font_large") + }], + button: global.strings("change"), + onChange: function onChange(value) { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.font_size, value); + } + }) : null, enableGraphSizeCustomization ? _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_graph_size"), + value: newsmemoryConfig.graphSize, + values: [{ + value: 75, + label: "x0.75 " + global.strings("font_small") + }, { + value: 85, + label: "x0.85" + }, { + value: 100, + label: "" + global.strings("font_normal") + }, { + value: 125, + label: "x1.25" + }, { + value: 150, + label: "x1.50" + }, { + value: 200, + label: "x2.00" + }, { + value: 250, + label: "x2.50 " + global.strings("font_large") + }], + button: global.strings("change"), + onChange: function onChange(value) { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.graph_size, value); + } + }) : null, _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_number_stored_editions"), + value: newsmemoryConfig.limit + 2, + values: Array.from({ + length: 8 + }, function (item, index) { + return { + value: index + 3, + label: "" + (index + 3) + }; + }), + button: global.strings("change"), + onChange: function onChange(value) { + newsmemoryConfig.setLimit(value - 2); + } + }), changeFavoriteEdition ? _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_favorite_edition"), + value: newsmemoryConfig.favoriteEdition, + values: function _callee() { + var _await$API$get, data, result; + + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(_Api.default.get(_Api.default.baseUrl(machine), {}, { + pSetup: pSetup, + action: "allEditions" + })); + + case 2: + _await$API$get = _context.sent; + data = _await$API$get.data; + result = []; + + if (data.editionsDetails) { + result.push({ + value: "", + label: global.strings("settings_favorite_edition_default_label") + }); + data.editionsDetails.forEach(function (item) { + result.push({ + value: item.val, + label: item.edition + }); + }); + } + + return _context.abrupt("return", result); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }, + button: global.strings("change"), + onChange: function _callee2(value) { + var favEdiPSetup, _global$getActivePSet2, currentPSetup, _await$global$loadPSe, config; + + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.favorite_edition, value); + favEdiPSetup = value.split("|")[1]; + _global$getActivePSet2 = global.getActivePSetup(), currentPSetup = _global$getActivePSet2.pSetup; + _context2.next = 5; + return _regenerator.default.awrap(global.loadPSetup(favEdiPSetup)); + + case 5: + _await$global$loadPSe = _context2.sent; + config = _await$global$loadPSe.config; + + if (!config) { + _context2.next = 16; + break; + } + + if (!(currentPSetup !== favEdiPSetup)) { + _context2.next = 12; + break; + } + + _context2.next = 11; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig(false)); + + case 11: + Analytics.updateAnalyticsClientList(); + + case 12: + _$$_REQUIRE(_dependencyMap[24]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, {}); + + _this.onNavigation("back"); + + _context2.next = 16; + break; + + case 16: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }) : null, showArticleColumnViewCustomization && _$$_REQUIRE(_dependencyMap[23]).PlatformUtils.isTablet() ? _react.default.createElement(_settingCheckbox.default, { + value: newsmemoryConfig.columnView > 0, + label: global.strings("settings_enable_column_view"), + onChange: function onChange() { + var isChecked = newsmemoryConfig.columnView > 0; + var newValue; + + if (isChecked) { + newValue = 0; + } else { + var _global$getActivePSet3 = global.getActivePSetup(), + defaultColumnView = _global$getActivePSet3.columnView; + + if (defaultColumnView === 0) { + newValue = 1; + } else { + newValue = defaultColumnView; + } + } + + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.column_view, "" + newValue); + return newValue > 0; + } + }) : null] + }); + } + }]); + return SettingsNewsmemoryManager; + }(_settingsBaseManager.default); + + exports.default = SettingsNewsmemoryManager; +},2241,[5,80,6,7,8,12,14,16,17,1859,2178,1860,2242,2240,460,2246,431,2154,1871,2247,603,2248,2249,462,572]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _setting = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _dropDownList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var PickerStyles = _reactNative.StyleSheet.create({ + image: { + width: 40, + height: 40, + marginRight: 10 + } + }); + + function SettingPicker(props) { + var propValues = props.values, + value = props.value, + onChange = props.onChange, + loadSelected = props.loadSelected, + getSelectedText = props.getSelectedText, + label = props.label, + button = props.button, + rest = (0, _objectWithoutProperties2.default)(props, ["values", "value", "onChange", "loadSelected", "getSelectedText", "label", "button"]); + + var _useState = (0, _react.useState)(true), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + loading = _useState2[0], + setLoading = _useState2[1]; + + var _useState3 = (0, _react.useState)(false), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + error = _useState4[0], + setError = _useState4[1]; + + var _useState5 = (0, _react.useState)([]), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + values = _useState6[0], + setValues = _useState6[1]; + + var _loadSelected = function _loadSelected() { + if (typeof loadSelected === "function") { + return loadSelected(values); + } + + return values.findIndex(function (item) { + return item.value === value; + }); + }; + + var _getSelectedText = function _getSelectedText(selected) { + if (!selected) { + return ""; + } + + if (typeof getSelectedText === "function") { + return "" + getSelectedText(selected); + } + + return "" + selected.label; + }; + + var _loadValues = function _callee() { + var result; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!(typeof propValues === "function")) { + _context.next = 13; + break; + } + + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(propValues()); + + case 4: + result = _context.sent; + setValues(result); + _context.next = 11; + break; + + case 8: + _context.prev = 8; + _context.t0 = _context["catch"](1); + setError(true); + + case 11: + _context.next = 14; + break; + + case 13: + setValues(propValues); + + case 14: + setLoading(false); + + case 15: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 8]], Promise); + }; + + (0, _react.useEffect)(function () { + _loadValues(); + }, []); + + if (loading || error) { + return null; + } + + return _react.default.createElement(_dropDownList.default, (0, _extends2.default)({ + autoOpen: false, + activeColor: (0, _setting.getSupportColor)(), + options: values, + selected: _loadSelected(), + onClose: function onClose(selected) { + return onChange && onChange(selected.value); + } + }, rest), function (_ref) { + var selected = _ref.selected, + expand = _ref.expand; + return _react.default.createElement(_setting.default, { + imageProps: selected && selected.image ? { + source: selected.image, + style: [PickerStyles.image] + } : undefined, + label: label, + value: _getSelectedText(selected), + buttonText: button, + onPress: expand + }); + }); + } + + SettingPicker.propTypes = { + label: _propTypes.default.string.isRequired, + value: _propTypes.default.any, + values: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.array]).isRequired, + button: _propTypes.default.string, + alert: _propTypes.default.shape({ + title: _propTypes.default.string, + message: _propTypes.default.string + }), + getSelectedText: _propTypes.default.func, + loadSelected: _propTypes.default.func, + onChange: _propTypes.default.func + }; + var _default = SettingPicker; + exports.default = _default; +},2242,[5,80,6,41,108,17,201,28,2237,2243]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _modal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _dropDownOption = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var styles = _reactNative.StyleSheet.create({ + container: { + overflow: "visible", + alignItems: "center" + }, + options: { + padding: 10 + } + }); + + function initSelected(selected) { + if (Array.isArray(selected)) { + return selected; + } + + if (selected > -1) { + return [selected]; + } + + return []; + } + + function DropDownList(props) { + var style = props.style, + textStyle = props.textStyle, + defaultSelected = props.selected, + options = props.options, + onClose = props.onClose, + multiChoice = props.multiChoice, + activeColor = props.activeColor, + autoOpen = props.autoOpen, + children = props.children; + + var _useState = (0, _react.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + expanded = _useState2[0], + setExpanded = _useState2[1]; + + var _useState3 = (0, _react.useState)(initSelected(defaultSelected)), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + selected = _useState4[0], + setSelected = _useState4[1]; + + var modalRef = (0, _react.useRef)(null); + + var _isSelected = function _isSelected(index) { + return selected.includes(index); + }; + + var _getSelected = function _getSelected() { + if (multiChoice) { + return options.filter(function (option, _i) { + return _isSelected(_i); + }); + } + + return options.filter(function (option, _i) { + return _isSelected(_i); + })[0]; + }; + + var _select = function _select(index) { + if (!multiChoice) { + setSelected([index]); + + if (modalRef.current) { + modalRef.current.collapse(); + } + } else { + if (_isSelected(index)) { + setSelected(selected.filter(function (value) { + return value !== index; + })); + } else { + setSelected([].concat((0, _toConsumableArray2.default)(selected), [index])); + } + } + }; + + var _expand = function _expand() { + if (modalRef.current) { + modalRef.current.expand(); + } + }; + + var _collapse = function _collapse() { + if (modalRef.current) { + modalRef.current.collapse(); + } + }; + + var _cancel = function _cancel() { + setSelected(initSelected(defaultSelected)); + }; + + if (!options.length) { + return null; + } + + var _Css$arrayToObject = _$$_REQUIRE(_dependencyMap[8]).Css.arrayToObject(Array.isArray(style) ? style : [style]), + _Css$arrayToObject$ba = _Css$arrayToObject.backgroundColor, + backgroundColor = _Css$arrayToObject$ba === undefined ? _$$_REQUIRE(_dependencyMap[8]).Css.getDefaultBackgroundColor() : _Css$arrayToObject$ba; + + var _Css$arrayToObject2 = _$$_REQUIRE(_dependencyMap[8]).Css.arrayToObject(Array.isArray(textStyle) ? textStyle : [textStyle]), + _Css$arrayToObject2$c = _Css$arrayToObject2.color, + color = _Css$arrayToObject2$c === undefined ? _$$_REQUIRE(_dependencyMap[8]).Css.getDefaultForegroundColor() : _Css$arrayToObject2$c; + + var MainComponent = autoOpen ? _reactNative.TouchableOpacity : _reactNative.View; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["drop-down-container"] + }, _react.default.createElement(MainComponent, { + style: styles.container, + onPress: function onPress() { + return _expand(); + } + }, typeof children === "function" ? children({ + selected: _getSelected(), + expanded: expanded, + expand: _expand, + collapse: _collapse + }) : children, _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["drop-down-options-container"] + }, _react.default.createElement(_modal.default, { + ref: modalRef, + hasFooter: multiChoice, + onCancel: _cancel, + onStateChange: function onStateChange(isExpanded) { + return setExpanded(isExpanded); + }, + onHide: function onHide() { + if (typeof onClose === "function") { + onClose(_getSelected()); + } + }, + backgroundColor: backgroundColor, + foregroundColor: activeColor + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["drop-down-options"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).TecnaviaFlatList, { + style: styles.options, + data: options, + renderItem: function renderItem(_ref) { + var option = _ref.item, + index = _ref.index; + return _react.default.createElement(_dropDownOption.default, { + key: "drop_down_item_" + index, + multiChoice: multiChoice, + color: _isSelected(index) ? activeColor : color, + option: option, + selected: _isSelected(index), + onPress: function onPress() { + return _select(index); + }, + textStyle: [textStyle, { + color: color + }] + }); + } + })))))); + } + + DropDownList.propTypes = { + multiChoice: _propTypes.default.bool, + autoOpen: _propTypes.default.bool, + activeColor: _propTypes.default.string, + selected: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.array]), + options: _propTypes.default.arrayOf(_dropDownOption.default.propTypes.option), + onClose: _propTypes.default.func, + style: _propTypes.default.array, + textStyle: _propTypes.default.array, + children: _propTypes.default.any + }; + DropDownList.defaultProps = { + selected: -1, + multiChoice: false, + autoOpen: true, + options: [], + style: [], + textStyle: [] + }; + var _default = DropDownList; + exports.default = _default; +},2243,[5,21,41,17,201,28,1882,2244,699,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _dropDownDecorators = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var styles = _reactNative.StyleSheet.create({ + option: { + minHeight: 50, + padding: 5, + alignItems: "center", + flexDirection: "row" + }, + textContainer: { + flex: 1, + justifyContent: "center", + marginHorizontal: 10 + } + }); + + function DropDownOption(props) { + var option = props.option, + selected = props.selected, + multiChoice = props.multiChoice, + textStyle = props.textStyle, + onPress = props.onPress, + color = props.color; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drop-down-option-container"] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress, + style: styles.option + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drop-down-option-icon"], + toggle: true, + active: selected + }, _react.default.createElement(_dropDownDecorators.default.Icon, { + color: color, + selected: selected, + multiChoice: multiChoice + })), _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drop-down-option-text-container"], + toggle: true, + active: selected + }, _react.default.createElement(_reactNative.View, { + style: styles.textContainer + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drop-down-option-label"], + toggle: true, + active: selected + }, _react.default.createElement(_dropDownDecorators.default.Label, { + label: option.label, + style: textStyle + })), _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drop-down-option-text"], + toggle: true, + active: selected + }, _react.default.createElement(_dropDownDecorators.default.Text, { + text: option.text, + style: textStyle, + numberOfLines: 0 + })))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drop-down-option-image"], + toggle: true, + active: selected + }, _react.default.createElement(_dropDownDecorators.default.Image, { + source: option.image + })))); + } + + DropDownOption.propTypes = { + option: _propTypes.default.shape({ + label: _propTypes.default.string.isRequired, + text: _propTypes.default.string, + image: _propTypes.default.any + }), + onPress: _propTypes.default.func.isRequired, + multiChoice: _propTypes.default.bool, + selected: _propTypes.default.bool, + textStyle: _dropDownDecorators.default.Text.propTypes.style, + color: _propTypes.default.string + }; + DropDownOption.defaultProps = {}; + var _default = DropDownOption; + exports.default = _default; +},2244,[5,17,201,28,2245,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var styles = _reactNative.StyleSheet.create({ + label: { + fontSize: 18, + color: _$$_REQUIRE(_dependencyMap[9]).colors.black + }, + text: { + fontSize: 14, + textAlign: "left", + color: _$$_REQUIRE(_dependencyMap[9]).colors.grey400 + }, + image: { + width: 40, + height: 40, + marginHorizontal: 5, + backgroundColor: "red" + }, + icon: { + fontSize: 25 + } + }); + + var Text = function Text(props) { + var text = props.text, + style = props.style, + rest = (0, _objectWithoutProperties2.default)(props, ["text", "style"]); + return text ? _react.default.createElement(_fontText.default, (0, _extends2.default)({ + numberOfLines: 1, + style: [styles.text, style] + }, rest), text) : null; + }; + + Text.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + text: _propTypes.default.any + }; + + var Label = function Label(props) { + var label = props.label, + style = props.style, + rest = (0, _objectWithoutProperties2.default)(props, ["label", "style"]); + return _react.default.createElement(_fontText.default, (0, _extends2.default)({ + style: [styles.label, style] + }, rest), label); + }; + + Label.propTypes = { + label: _propTypes.default.string, + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]) + }; + + var Image = function Image(_ref) { + var source = _ref.source, + style = _ref.style, + rest = (0, _objectWithoutProperties2.default)(_ref, ["source", "style"]); + + if (!source) { + return null; + } + + return _react.default.createElement(_imageIconChooserComponent.default, (0, _extends2.default)({ + style: [styles.image, style], + source: source + }, rest)); + }; + + Image.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + source: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]) + }; + + var Icon = function Icon(props) { + var color = props.color, + selected = props.selected, + multiChoice = props.multiChoice, + style = props.style, + rest = (0, _objectWithoutProperties2.default)(props, ["color", "selected", "multiChoice", "style"]); + return _react.default.createElement(_iconComponent.default, (0, _extends2.default)({ + style: [styles.icon, { + color: color + }, style], + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + name: selected ? "" + (multiChoice ? "checkbox-marked" : "checkbox-marked-circle") : "" + (multiChoice ? "checkbox-blank-outline" : "checkbox-blank-circle-outline") + }, rest)); + }; + + Icon.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + color: _propTypes.default.string, + selected: _propTypes.default.bool, + multiChoice: _propTypes.default.bool + }; + var Option = { + Text: Text, + Label: Label, + Image: Image, + Icon: Icon + }; + var _default = Option; + exports.default = _default; +},2245,[5,6,108,17,201,28,1879,1970,1806,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _checkboxComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingCheckbox = function (_React$Component) { + (0, _inherits2.default)(SettingCheckbox, _React$Component); + + var _super = _createSuper(SettingCheckbox); + + function SettingCheckbox(props) { + var _this; + + (0, _classCallCheck2.default)(this, SettingCheckbox); + _this = _super.call(this, props); + _this.state = { + value: props.value + }; + _this.onChange = _this._onChange.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SettingCheckbox, [{ + key: "componentDidMount", + value: function componentDidMount() { + var value; + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + value = this.props.value; + + if (!(typeof value === "function")) { + _context.next = 8; + break; + } + + _context.t0 = this; + _context.next = 5; + return _regenerator.default.awrap(value()); + + case 5: + _context.t1 = _context.sent; + _context.t2 = { + value: _context.t1 + }; + + _context.t0.setState.call(_context.t0, _context.t2); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onChange", + value: function _onChange() { + var onChange, value; + return _regenerator.default.async(function _onChange$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + onChange = this.props.onChange; + + if (!(typeof onChange === "function")) { + _context2.next = 6; + break; + } + + _context2.next = 4; + return _regenerator.default.awrap(onChange()); + + case 4: + value = _context2.sent; + this.setState({ + value: value + }); + + case 6: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "render", + value: function render() { + var label = this.props.label; + var value = this.state.value; + + var style = _$$_REQUIRE(_dependencyMap[12]).Css.getStyleObjByCssClasses(["setting-checkbox"]); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[12]).Css.getDefaultBackgroundColor(); + + var foregroundColor = _$$_REQUIRE(_dependencyMap[12]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["setting-line"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[13]).styles.row, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["setting-text-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[13]).styles.textParent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Text, { + label: label + }))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["setting-checkbox-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[13]).styles.chkParent + }, _react.default.createElement(_checkboxComponent.default, { + checked: value, + onPress: this.onChange, + checkClass: "setting-check", + checkedClass: "setting-checkbox-active", + uncheckedClass: "setting-checkbox-inactive", + checkStyle: { + color: foregroundColor + }, + style: [{ + backgroundColor: backgroundColor, + borderColor: foregroundColor + }, style] + }))))); + } + }]); + return SettingCheckbox; + }(_react.default.Component); + + exports.default = SettingCheckbox; + SettingCheckbox.propTypes = { + label: _propTypes.default.string.isRequired, + value: _propTypes.default.bool, + onChange: _propTypes.default.func.isRequired + }; +},2246,[5,80,7,8,15,12,14,16,17,201,28,2231,699,2238,2237]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/shared/settings-screen/images", + "width": 75, + "height": 75, + "scales": [1], + "hash": "6904cea2409c82167c5f6b705f44314c", + "name": "download_full", + "type": "png" + }); +},2247,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/shared/settings-screen/images", + "width": 75, + "height": 75, + "scales": [1], + "hash": "617a1c398fe256ada82ff77907258ea4", + "name": "download_medium", + "type": "png" + }); +},2248,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/shared/settings-screen/images", + "width": 75, + "height": 75, + "scales": [1], + "hash": "2320ccb49f5de23cb39ccb94661e5df4", + "name": "download_low", + "type": "png" + }); +},2249,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _PushHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _settingButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _settingPicker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _settingPickerMulti = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _settingText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _settingsBaseManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _PushTags = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _settingCheckbox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _cmpUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingsManager = function (_SettingsBaseManager) { + (0, _inherits2.default)(SettingsManager, _SettingsBaseManager); + + var _super = _createSuper(SettingsManager); + + function SettingsManager(onNavigation, labels) { + var _this; + + (0, _classCallCheck2.default)(this, SettingsManager); + _this = _super.call(this, onNavigation, labels); + _this.changeStartWith = _this._changeStartWith.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleAllowFontScaling = _this._toggleAllowFontScaling.bind((0, _assertThisInitialized2.default)(_this)); + _this.openPushSettings = _this._openPushSettings.bind((0, _assertThisInitialized2.default)(_this)); + _this.openAccessibilitySettings = _this._openAccessibilitySettings.bind((0, _assertThisInitialized2.default)(_this)); + _this.openUrl = _this._openUrl.bind((0, _assertThisInitialized2.default)(_this)); + _this.openPrivacySettings = _this._openPrivacySettings.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SettingsManager, [{ + key: "_openUrl", + value: function _openUrl() { + var poweredByURL, url; + return _regenerator.default.async(function _openUrl$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + poweredByURL = global.getMainPSetup(); + url = poweredByURL && poweredByURL.length ? poweredByURL : "http://www.newsmemory.com/"; + _context.next = 4; + return _regenerator.default.awrap(_tecnaviaPlatformUtils.default.openURL(url)); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_fontScalingLabel", + value: function _fontScalingLabel() { + return global.getUserSettings().allowFontScaling ? global.strings("btn_yes") : global.strings("btn_no"); + } + }, { + key: "_toggleAllowFontScaling", + value: function _toggleAllowFontScaling() { + _$$_REQUIRE(_dependencyMap[22]).FontContext.set({ + allowFontScaling: global.getUserSettings().toggleAllowFontScaling() + }); + + return this._fontScalingLabel(); + } + }, { + key: "_changeStartWith", + value: function _changeStartWith(value) { + var _this$labels = this.labels, + startup = _this$labels.startup, + ePaper = _this$labels.ePaper; + + if (value === global.strings("settings_startup_rss")) { + global.getUserSettings().setRssAsStartupMode(); + } else if (value === ePaper) { + global.getUserSettings().setNewsmemoryAsStartupMode(); + } else { + global.getUserSettings().resetStartupMode(); + } + + this._displayToast(global.strings("msg_available_next_startup")); + + return startup; + } + }, { + key: "_openPushSettings", + value: function _openPushSettings() { + _$$_REQUIRE(_dependencyMap[23]).NativeSettingsNavigation.appNotificationSettings(); + } + }, { + key: "_openAccessibilitySettings", + value: function _openAccessibilitySettings() { + _$$_REQUIRE(_dependencyMap[23]).NativeSettingsNavigation.accessibilitySettings(); + } + }, { + key: "_openPrivacySettings", + value: function _openPrivacySettings() { + _cmpUtils.default.editIubendaPreferences().then(function (preference) { + _NavigationService.default.restart(); + }); + } + }, { + key: "getSettings", + value: function getSettings() { + var _global$getMainPSetup = global.getMainPSetup(), + showThemesCustomization = _global$getMainPSetup.showThemesCustomization, + pushTags = _global$getMainPSetup.pushTags; + + var _global$getRSSActiveP = global.getRSSActivePSetup(), + newsMemoryIsEnabled = _global$getRSSActiveP.newsMemoryIsEnabled, + rssIsEnabled = _global$getRSSActiveP.rssIsEnabled, + appModeSelectionPageEnabled = _global$getRSSActiveP.appModeSelectionPageEnabled; + + var userSettings = global.getUserSettings(); + + var themes = _$$_REQUIRE(_dependencyMap[24]).Css.getThemes(); + + var currentTheme = _$$_REQUIRE(_dependencyMap[24]).Css.getActiveTheme(); + + var _this$labels2 = this.labels, + startup = _this$labels2.startup, + ePaper = _this$labels2.ePaper; + var rss = global.strings("settings_startup_rss"); + var startupValues = [{ + value: rss, + label: rss + }, { + value: ePaper, + label: ePaper + }]; + + if (appModeSelectionPageEnabled) { + var chooseEachTime = global.strings("settings_startup_choose"); + startupValues.push({ + value: chooseEachTime, + label: chooseEachTime + }); + } + + return (0, _extends2.default)({ + label: global.strings("general") + }, this.getCollapsedParams(), { + data: this.isCollapsed() ? [] : [newsMemoryIsEnabled && rssIsEnabled ? _react.default.createElement(_settingPicker.default, { + label: global.strings("start_with"), + value: startup, + values: startupValues, + button: global.strings("change"), + onChange: this.changeStartWith + }) : undefined, _react.default.createElement(_settingButton.default, { + label: global.strings("settings_allow_font_scaling"), + value: this._fontScalingLabel(), + button: global.strings("toggle"), + onChange: this.toggleAllowFontScaling + }), showThemesCustomization && themes && themes.length > 0 ? _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_themes"), + value: currentTheme, + values: themes.map(function (theme) { + return { + label: theme.name, + value: theme.key + }; + }), + button: global.strings("change"), + onChange: function onChange(value) { + _GlobalConfig.default.updateCustomStyles(value).then(function (result) { + if (result) { + _NavigationService.default.restart(); + } + }); + } + }) : null, _react.default.createElement(_settingButton.default, { + label: global.strings("push_notification"), + button: global.strings("open"), + onChange: this.openPushSettings + }), _react.default.createElement(_settingCheckbox.default, { + value: userSettings.pushNotificationsEnabled, + label: global.strings("settings_enable_push_notifications"), + onChange: function _callee() { + var newState, result; + return _regenerator.default.async(function _callee$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + newState = !userSettings.pushNotificationsEnabled; + result = false; + _context2.prev = 2; + + if (newState) { + _context2.next = 8; + break; + } + + _context2.next = 6; + return _regenerator.default.awrap(_PushHelper.default.deleteRegistration()); + + case 6: + _context2.next = 10; + break; + + case 8: + _context2.next = 10; + return _regenerator.default.awrap(_PushHelper.default.registerDevice()); + + case 10: + result = true; + _context2.next = 16; + break; + + case 13: + _context2.prev = 13; + _context2.t0 = _context2["catch"](2); + console.warn(_context2.t0.message); + + case 16: + if (result) { + _context2.next = 19; + break; + } + + _$$_REQUIRE(_dependencyMap[25]).Toast.show(global.strings(newState ? "err_enabling_push_notifications" : "err_disabling_push_notifications", { + error: "" + })); + + return _context2.abrupt("return", !newState); + + case 19: + userSettings.setPushNotificationsState(newState); + return _context2.abrupt("return", newState); + + case 21: + case "end": + return _context2.stop(); + } + } + }, null, null, [[2, 13]], Promise); + } + }), pushTags && pushTags.length ? _react.default.createElement(_settingPickerMulti.default, { + label: global.strings("settings_push_scopes"), + selected: _PushTags.default.parseTags(userSettings.userDefinedPushTags), + values: _PushTags.default.parseTags(pushTags), + button: global.strings("change"), + onChange: function onChange(selected) { + var tags = _PushTags.default.formatTags(selected); + + userSettings.setUserDefinedPushTags(tags, pushTags); + + _PushHelper.default.updateTags(); + } + }) : undefined, _$$_REQUIRE(_dependencyMap[26]).PlatformUtils.isAndroid() ? _react.default.createElement(_settingButton.default, { + label: global.strings("accessibility"), + button: global.strings("open"), + onChange: this.openAccessibilitySettings + }) : undefined, _cmpUtils.default.isConsentNeeded() || _cmpUtils.default.isUSComplianceRequired() ? _react.default.createElement(_settingButton.default, { + label: global.strings("settings_manage_privacy_preferences"), + button: global.strings("open"), + onChange: this.openPrivacySettings + }) : null, _react.default.createElement(_settingText.default, { + label: global.getMainPSetup().poweredBy || global.strings("powered_by"), + onPress: this.openUrl + })] + }); + } + }]); + return SettingsManager; + }(_settingsBaseManager.default); + + exports.default = SettingsManager; +},2250,[5,80,6,7,8,15,12,14,16,17,2134,1876,2236,2242,2251,2252,2240,2132,2246,1875,1861,2154,1880,2009,699,1889,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _settingPicker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function SettingPickerMulti(props) { + var selected = props.selected, + onChange = props.onChange, + rest = (0, _objectWithoutProperties2.default)(props, ["selected", "onChange"]); + return _react.default.createElement(_settingPicker.default, (0, _extends2.default)({ + multiChoice: true, + loadSelected: function loadSelected() { + var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var selectedIndex = []; + values.forEach(function (item, index) { + selected.forEach(function (selectedItem) { + if (selectedItem.value === item.value) { + selectedIndex.push(index); + } + }); + }); + return selectedIndex; + }, + getSelectedText: function getSelectedText(newSelection) { + return newSelection.map(function (item) { + return item.label; + }).join(","); + }, + onClose: function onClose(newSelection) { + return typeof onChange === "function" && onChange(newSelection); + } + }, rest)); + } + + SettingPickerMulti.propTypes = (0, _extends2.default)({}, _settingPicker.default.propTypes, { + selected: _propTypes.default.arrayOf(_propTypes.default.shape({ + value: _propTypes.default.string, + label: _propTypes.default.string + })) + }); + SettingPickerMulti.defaultProps = { + selected: [] + }; + var _default = SettingPickerMulti; + exports.default = _default; +},2251,[5,6,108,17,201,2242]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var SettingText = function SettingText(props) { + var label = props.label, + onPress = props.onPress; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[4]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[4]).Css, { + classes: ["setting-line"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[5]).styles.row, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[4]).Css, { + classes: ["setting-text-parent"] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress, + style: _$$_REQUIRE(_dependencyMap[5]).styles.textParent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Text, { + label: label + }))))); + }; + + SettingText.propTypes = { + label: _propTypes.default.string.isRequired, + onPress: _propTypes.default.func + }; + var _default = SettingText; + exports.default = _default; +},2252,[5,17,201,28,699,2238,2237]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _NewsmemoryHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _settingPicker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _settingButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _settingsBaseManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _settingCheckbox = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingsNewsmemoryAdvanceManager = function (_SettingsBaseManager) { + (0, _inherits2.default)(SettingsNewsmemoryAdvanceManager, _SettingsBaseManager); + + var _super = _createSuper(SettingsNewsmemoryAdvanceManager); + + function SettingsNewsmemoryAdvanceManager() { + (0, _classCallCheck2.default)(this, SettingsNewsmemoryAdvanceManager); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(SettingsNewsmemoryAdvanceManager, [{ + key: "getSettings", + value: function getSettings() { + var _this = this; + + var _global$getMainPSetup = global.getMainPSetup(), + enableArticleTypesCustomization = _global$getMainPSetup.enableArticleTypesCustomization, + showNavigationButtonsLayoutCustomization = _global$getMainPSetup.showNavigationButtonsLayoutCustomization, + enableAdvancedGesturesMode = _global$getMainPSetup.enableAdvancedGesturesMode, + showHighlightBehaviorCustomization = _global$getMainPSetup.showHighlightBehaviorCustomization, + backgroundTimerArticleSelected = _global$getMainPSetup.backgroundTimerArticleSelected, + showTabIndexModeCustomization = _global$getMainPSetup.showTabIndexModeCustomization; + + var newsmemoryConfig = global.getNewsmemoryConfig(); + var ePaper = this.labels.ePaper; + return (0, _extends2.default)({ + label: global.strings("advance", { + label: ePaper + }) + }, this.getCollapsedParams(), { + data: this.isCollapsed() ? [] : [showTabIndexModeCustomization ? _react.default.createElement(_settingCheckbox.default, { + value: newsmemoryConfig.enableTabIndexMode, + label: global.strings("settings_tab_index_mode"), + onChange: function onChange() { + newsmemoryConfig.setEnableTabIndexMode(!newsmemoryConfig.enableTabIndexMode); + + _this.updateUI(); + + return newsmemoryConfig.enableTabIndexMode; + } + }) : null, enableAdvancedGesturesMode && _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isTablet() ? _react.default.createElement(_settingCheckbox.default, { + value: newsmemoryConfig.twoFingersTapToArticle, + label: global.strings("settings_two_fingers_tap_to_article"), + onChange: function onChange() { + if (!newsmemoryConfig.twoFingersTapToArticle) { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.single_tap_to_zoom, "1"); + } + + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.two_fingers_tap_to_article, newsmemoryConfig.twoFingersTapToArticle ? "0" : "1"); + + if (!newsmemoryConfig.twoFingersTapToArticle) { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.single_tap_to_zoom, "0"); + } + + _this.updateUI(); + + return newsmemoryConfig.twoFingersTapToArticle; + } + }) : null, enableAdvancedGesturesMode && _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isTablet() && newsmemoryConfig.twoFingersTapToArticle ? _react.default.createElement(_settingCheckbox.default, { + value: newsmemoryConfig.singleTapToZoom, + label: global.strings("settings_single_tap_to_zoom"), + onChange: function onChange() { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.single_tap_to_zoom, newsmemoryConfig.singleTapToZoom ? "0" : "1"); + return newsmemoryConfig.singleTapToZoom; + } + }) : null, enableArticleTypesCustomization ? _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_article_mode"), + value: newsmemoryConfig.showTypesArticle, + values: [{ + value: "0", + label: global.strings("settings_article_mode_only_text") + }, { + value: "1", + label: global.strings("settings_article_mode_text_and_graphics") + }, { + value: "2", + label: global.strings("settings_article_mode_all") + }], + button: global.strings("change"), + onChange: function onChange(value) { + newsmemoryConfig.setShowTypesArticle(value); + } + }) : null, showNavigationButtonsLayoutCustomization ? _react.default.createElement(_settingPicker.default, { + label: global.strings("settings_navigation_arrows"), + value: newsmemoryConfig.pagesNavigationButtonsLayout, + values: [{ + value: "1", + label: global.strings("settings_navigation_arrows_always") + }, { + value: "2", + label: global.strings("settings_navigation_arrows_disapper") + }, { + value: "0", + label: global.strings("settings_navigation_arrows_never") + }], + button: global.strings("change"), + onChange: function onChange(value) { + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.pages_navigation_buttons_layout, value); + } + }) : null, showHighlightBehaviorCustomization && _$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isTablet() ? _react.default.createElement(_settingCheckbox.default, { + value: newsmemoryConfig.backgroundTimerArticleSelected === 0, + label: global.strings("settings_article_highlight"), + onChange: function onChange() { + var newValue = newsmemoryConfig.backgroundTimerArticleSelected === 0 ? backgroundTimerArticleSelected : 0; + newsmemoryConfig.setValue(_NewsmemoryHelper.default.SP.keys.background_timer_article_selected, "" + newValue); + return newValue === 0; + } + }) : null, _optionalPackageUtils.default.isIOSClassicEPaperAvailable() ? _react.default.createElement(_settingButton.default, { + label: global.strings("settings_back_to_classic"), + button: global.strings("open"), + onChange: function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.closeDatabase()); + + case 2: + _$$_REQUIRE(_dependencyMap[19]).EventRegister.emit(_events.default.NEWSMEMORY_CLOSE_CURRENT_DB); + + newsmemoryConfig.setRNUseDemo("0"); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }) : null, _react.default.createElement(_settingButton.default, { + label: global.strings("settings_restore_defaults"), + button: global.strings("reset"), + onChange: function onChange() { + (0, _$$_REQUIRE(_dependencyMap[20]).askTo)(global.strings("msg_restore_default_settings"), function _callee2() { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return _regenerator.default.awrap(newsmemoryConfig.reset()); + + case 2: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }); + + _this.updateUI(); + } + }), _react.default.createElement(_settingButton.default, { + label: global.strings("settings_clear_storage"), + button: global.strings("clear"), + onChange: function _callee3() { + var reloadLatestEdition; + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + _context3.next = 3; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[20]).optionspageDeleteProcess)()); + + case 3: + reloadLatestEdition = _context3.sent; + + if (reloadLatestEdition) { + _$$_REQUIRE(_dependencyMap[19]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_LATEST_EDITION); + } else { + _$$_REQUIRE(_dependencyMap[19]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[21]).tabs.home + }); + } + + _this.onNavigation("back"); + + _context3.next = 10; + break; + + case 8: + _context3.prev = 8; + _context3.t0 = _context3["catch"](0); + + case 10: + case "end": + return _context3.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + })] + }); + } + }]); + return SettingsNewsmemoryAdvanceManager; + }(_settingsBaseManager.default); + + exports.default = SettingsNewsmemoryAdvanceManager; +},2253,[5,80,6,7,8,12,14,16,17,1859,1860,2242,2236,2240,2246,710,460,731,462,572,2254,730]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.optionspageDeleteProcess = exports.askTo = exports.deleteData = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _LoginManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _TranslationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var deleteData = function _callee() { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(new Promise(function (resolve, reject) { + _$$_REQUIRE(_dependencyMap[7]).EventRegister.emit(_events.default.NEWSMEMORY_ON_CLEAR_STORAGE, { + onFinish: resolve, + onError: reject + }); + })); + + case 3: + _context.next = 5; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.resetDatabase()); + + case 5: + _context.next = 7; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.deleteNewspaperDirectory()); + + case 7: + _context.next = 9; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.makeNewspaperDirectory()); + + case 9: + _TranslationManager.default.resetAllTranslations(); + + _context.next = 14; + break; + + case 12: + _context.prev = 12; + _context.t0 = _context["catch"](0); + + case 14: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 12]], Promise); + }; + + exports.deleteData = deleteData; + + var deleteUserInfo = function _callee2() { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return _regenerator.default.awrap(_LoginManager.default.clearAll()); + + case 2: + _context2.next = 4; + return _regenerator.default.awrap(global.getNewsmemoryConfig().reset()); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }; + + var showTo = function _callee3(message) { + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + return _context3.abrupt("return", new Promise(function (resolve) { + _reactNative.Alert.alert("", message, [{ + text: global.strings("btn_ok"), + onPress: resolve + }]); + })); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }; + + var askTo = function _callee4(message, doFunction) { + return _regenerator.default.async(function _callee4$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + return _context5.abrupt("return", new Promise(function (resolve, reject) { + _reactNative.Alert.alert("", message, [{ + text: global.strings("btn_cancel"), + onPress: function onPress() { + resolve(false); + }, + style: "cancel" + }, { + text: global.strings("btn_ok"), + onPress: function onPress() { + return _regenerator.default.async(function onPress$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!(typeof doFunction === "function")) { + _context4.next = 12; + break; + } + + _context4.prev = 1; + _context4.next = 4; + return _regenerator.default.awrap(doFunction()); + + case 4: + resolve(true); + _context4.next = 10; + break; + + case 7: + _context4.prev = 7; + _context4.t0 = _context4["catch"](1); + reject(_context4.t0); + + case 10: + _context4.next = 13; + break; + + case 12: + resolve(true); + + case 13: + case "end": + return _context4.stop(); + } + } + }, null, null, [[1, 7]], Promise); + } + }], { + cancelable: false + }); + })); + + case 1: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + }; + + exports.askTo = askTo; + + var optionspageDeleteProcess = function _callee5() { + var _global$getActivePSet, isNNB, abort, dbDeleted, lsDeleted; + + return _regenerator.default.async(function _callee5$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _global$getActivePSet = global.getActivePSetup(), isNNB = _global$getActivePSet.isNNB; + abort = false; + _context6.prev = 2; + _context6.next = 5; + return _regenerator.default.awrap(askTo(global.strings("msg_delete_db"), deleteData)); + + case 5: + dbDeleted = _context6.sent; + + if (!dbDeleted) { + _context6.next = 28; + break; + } + + lsDeleted = false; + _context6.prev = 8; + _context6.next = 11; + return _regenerator.default.awrap(askTo(global.strings("msg_delete_localstorage"), deleteUserInfo)); + + case 11: + lsDeleted = _context6.sent; + _context6.next = 16; + break; + + case 14: + _context6.prev = 14; + _context6.t0 = _context6["catch"](8); + + case 16: + if (!isNNB) { + _context6.next = 25; + break; + } + + if (!lsDeleted) { + _context6.next = 22; + break; + } + + _context6.next = 20; + return _regenerator.default.awrap(showTo(global.strings("msg_operation_completed"))); + + case 20: + _context6.next = 24; + break; + + case 22: + _context6.next = 24; + return _regenerator.default.awrap(showTo(global.strings("msg_ok_delete_db"))); + + case 24: + return _context6.abrupt("return", false); + + case 25: + _context6.next = 27; + return _regenerator.default.awrap(askTo(global.strings("msg_reload_publication"))); + + case 27: + return _context6.abrupt("return", _context6.sent); + + case 28: + abort = true; + _context6.next = 33; + break; + + case 31: + _context6.prev = 31; + _context6.t1 = _context6["catch"](2); + + case 33: + if (!abort) { + _context6.next = 35; + break; + } + + throw new Error("Interrupped by user"); + + case 35: + return _context6.abrupt("return", false); + + case 36: + case "end": + return _context6.stop(); + } + } + }, null, null, [[2, 31], [8, 14]], Promise); + }; + + exports.optionspageDeleteProcess = optionspageDeleteProcess; +},2254,[5,80,28,710,2057,460,2178,572]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _settingButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _settingDebug = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _settingsBaseManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingsOthers = function (_SettingsBaseManager) { + (0, _inherits2.default)(SettingsOthers, _SettingsBaseManager); + + var _super = _createSuper(SettingsOthers); + + function SettingsOthers(onNavigation, labels) { + var _this; + + (0, _classCallCheck2.default)(this, SettingsOthers); + _this = _super.call(this, onNavigation, labels); + _this.sendFeedbackEmail = _this._sendFeedbackEmail.bind((0, _assertThisInitialized2.default)(_this)); + _this.onForceLayoutSubStyle = _this._onForceLayoutSubStyle.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SettingsOthers, [{ + key: "_onForceLayoutSubStyle", + value: function _onForceLayoutSubStyle() { + this._displayToast(global.strings("msg_available_next_startup")); + } + }, { + key: "_sendFeedbackEmail", + value: function _sendFeedbackEmail() { + var feedback; + return _regenerator.default.async(function _sendFeedbackEmail$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + feedback = new (_$$_REQUIRE(_dependencyMap[14]).Feedback)(); + _context.next = 3; + return _regenerator.default.awrap(feedback.sendFeedbackEmail(false)); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "getSettings", + value: function getSettings() { + var machineId = "n/a"; + + try { + if (global.machineId && global.machineId.length >= 6) { + machineId = global.machineId.substring(global.machineId.length - 6); + } + } catch (e) {} + + return (0, _extends2.default)({}, this.getCollapsedParams(), { + data: [_react.default.createElement(_settingDebug.default, { + numberOfTapToDebug: 1, + label: global.strings("version"), + value: _deviceUtils.default.getAppVersion() + " - " + machineId, + onSublayoutChange: this.onForceLayoutSubStyle + }), _react.default.createElement(_settingButton.default, { + label: global.strings("btn_feedback"), + button: global.strings("write"), + onChange: this.sendFeedbackEmail + })] + }); + } + }]); + return SettingsOthers; + }(_settingsBaseManager.default); + + exports.default = SettingsOthers; +},2255,[5,80,6,7,8,15,12,14,16,17,458,2236,2256,2240,2151]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _reactNativeMail = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _fontTextInput = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _settingHeader = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[16])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _modal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var crashlytics = _optionalPackageUtils.default.getCrashlytics(); + + var PRESS_DELAY = 150; + + var SettingDebug = function (_React$Component) { + (0, _inherits2.default)(SettingDebug, _React$Component); + + var _super = _createSuper(SettingDebug); + + function SettingDebug(props) { + var _this; + + (0, _classCallCheck2.default)(this, SettingDebug); + _this = _super.call(this, props); + + _this._collapse = function () { + return _this.modalRef.current && _this.modalRef.current.collapse(); + }; + + _this._expand = function () { + return _this.modalRef.current && _this.modalRef.current.expand(); + }; + + _this.modalRef = _react.default.createRef(); + _this.state = { + subLayout: global.getUserSettings().forceLayoutSubStyle, + notificationEmail: global.getUserSettings().notificationEmail + }; + _this.tapAction = _this._tapAction.bind((0, _assertThisInitialized2.default)(_this)); + _this.crashAction = _this._crashAction.bind((0, _assertThisInitialized2.default)(_this)); + _this.feedbackAction = _this._feedbackAction.bind((0, _assertThisInitialized2.default)(_this)); + _this.copyAction = _this._copyAction.bind((0, _assertThisInitialized2.default)(_this)); + _this.onShare = _this._onShare.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSending = _this._onSending.bind((0, _assertThisInitialized2.default)(_this)); + _this.setForceLayoutSubStyle = _this._setForceLayoutSubStyle.bind((0, _assertThisInitialized2.default)(_this)); + _this.setForceNotificationEmail = _this._setForceNotificationEmail.bind((0, _assertThisInitialized2.default)(_this)); + _this.pressCounter = 0; + _this.timeoutId = undefined; + return _this; + } + + (0, _createClass2.default)(SettingDebug, [{ + key: "UNSAFE_componentWillMount", + value: function UNSAFE_componentWillMount() { + return _regenerator.default.async(function UNSAFE_componentWillMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(global.analyzeUsedSpace()); + + case 2: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.timeoutId) { + clearTimeout(this.timeoutId); + } + } + }, { + key: "_tapAction", + value: function _tapAction() { + var _this2 = this; + + this.pressCounter += 1; + var numberOfTapToDebug = this.props.numberOfTapToDebug; + + if (!this.timeoutId) { + this.timeoutId = setTimeout(function () { + if (_this2.pressCounter >= numberOfTapToDebug) { + _this2._expand(); + } + + _this2.pressCounter = 0; + delete _this2.timeoutId; + }, PRESS_DELAY * numberOfTapToDebug); + } + } + }, { + key: "_crashAction", + value: function _crashAction() { + if (crashlytics) { + crashlytics().crash(); + } + } + }, { + key: "_copyAction", + value: function _copyAction() { + _$$_REQUIRE(_dependencyMap[21]).LoadingOverlay.show({ + id: "copy" + }); + + _tecnaviaFileUtils.default.zipAndCopyNewspaperBaseDirectory().then(function () { + _$$_REQUIRE(_dependencyMap[21]).LoadingOverlay.hide({ + id: "copy" + }); + }); + } + }, { + key: "_feedbackAction", + value: function _feedbackAction() { + if (_$$_REQUIRE(_dependencyMap[22]).NetworkUtils.isOnline()) { + var feedback = new (_$$_REQUIRE(_dependencyMap[23]).Feedback)(); + + _$$_REQUIRE(_dependencyMap[21]).LoadingOverlay.show({ + id: "feedback" + }); + + feedback.force().then(function () { + _$$_REQUIRE(_dependencyMap[21]).LoadingOverlay.hide({ + id: "feedback" + }); + }); + } else { + _reactNative.Alert.alert("", global.strings("err_internet_connection"), [{ + text: global.strings("btn_ok") + }]); + } + } + }, { + key: "_onSending", + value: function _onSending() { + return _regenerator.default.async(function _onSending$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this._collapse(); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onShare", + value: function _onShare() { + var message, subject, attachments, _global$getActivePSet, enableSessionCollection, path; + + return _regenerator.default.async(function _onShare$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + message = _GlobalConfig.default.getDeviceInfoText(); + message += _GlobalConfig.default.getUsedSpaceText(); + subject = global.strings("feedback_email_subject", { + who: global.appName + }); + _global$getActivePSet = global.getActivePSetup(), enableSessionCollection = _global$getActivePSet.enableSessionCollection; + + if (!(_LiveConfig.default.isEpaperSide() && enableSessionCollection)) { + _context3.next = 9; + break; + } + + _context3.next = 7; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[24]).NewspaperSessionManager.storeActiveSessionToFile()); + + case 7: + path = _context3.sent; + + if (path) { + attachments = [{ + path: path, + type: "json", + name: "session_" + global.machineId + ".json" + }]; + } + + case 9: + _reactNativeMail.default.mail({ + subject: subject, + recipients: [global.strings("support_email")], + body: message, + isHTML: false, + attachments: attachments + }, function () {}); + + case 10: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_setForceLayoutSubStyle", + value: function _setForceLayoutSubStyle() { + var subLayout = this.state.subLayout; + var onSublayoutChange = this.props.onSublayoutChange; + global.getUserSettings().setForceLayoutSubStyle(subLayout); + + if (typeof onSublayoutChange === "function") { + onSublayoutChange(); + } + } + }, { + key: "_setForceNotificationEmail", + value: function _setForceNotificationEmail() { + var _this3 = this; + + var notificationEmail = this.state.notificationEmail; + + if (notificationEmail.length > 0 && _$$_REQUIRE(_dependencyMap[22]).StringUtils.validateNotificationEmail(notificationEmail)) { + global.getUserSettings().setNotificationEmail(notificationEmail); + + _reactNative.Alert.alert("", global.strings("msg_valid_notification_email"), [{ + text: global.strings("btn_ok") + }, { + text: global.strings("restart"), + onPress: function onPress() { + _this3._collapse(); + + _reactNative.InteractionManager.runAfterInteractions(_NavigationService.default.restart); + } + }]); + } else { + var _global$getUserSettin = global.getUserSettings(), + currentNotificationEmail = _global$getUserSettin.notificationEmail; + + if (currentNotificationEmail && _$$_REQUIRE(_dependencyMap[22]).StringUtils.validateNotificationEmail(currentNotificationEmail)) { + _reactNative.Alert.alert("", global.strings("msg_reset_notification_email"), [{ + text: global.strings("btn_ok") + }, { + text: global.strings("restart"), + onPress: function onPress() { + var paperSetupManager = global.getPaperSetupManager(); + + if (paperSetupManager) { + paperSetupManager.resetActivePSetup(); + } + + _this3._collapse(); + + _reactNative.InteractionManager.runAfterInteractions(_NavigationService.default.restart); + } + }]); + } + + global.getUserSettings().resetNotificationEmail(); + } + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props = this.props, + label = _this$props.label, + value = _this$props.value, + hidden = _this$props.hidden; + var _this$state = this.state, + subLayout = _this$state.subLayout, + notificationEmail = _this$state.notificationEmail; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[25]).Css.getDefaultBackgroundColor(); + + var foregroundColor = _$$_REQUIRE(_dependencyMap[25]).Css.getDefaultForegroundColor(); + + var placeholdeTextColor = _$$_REQUIRE(_dependencyMap[22]).colors.grey400; + + var borderColor = _$$_REQUIRE(_dependencyMap[25]).Css.isDarkTheme() ? foregroundColor : _$$_REQUIRE(_dependencyMap[22]).colors.grey; + + var ModalComponent = _react.default.createElement(_modal.default, { + ref: this.modalRef, + backgroundColor: backgroundColor, + foregroundColor: foregroundColor, + needsKeyboardOffsetCheck: true + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[26]).styles.headerParent + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, _react.default.createElement(_settingHeader.default, { + label: global.strings("debug"), + onPress: this._collapse + })), _react.default.createElement(_settingHeader.SettingClose, { + onPress: this._collapse + })), _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).Css, { + classes: ["settings-header-separator"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[26]).styles.separator + })), _react.default.createElement(_$$_REQUIRE(_dependencyMap[27]).TecnaviaScrollView, null, _react.default.createElement(_reactNative.View, { + style: { + padding: 10 + } + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[26]).styles.hidden + }, _GlobalConfig.default.getDeviceInfoText()), _react.default.createElement(_fontTextInput.default, { + style: [_$$_REQUIRE(_dependencyMap[26]).styles.input, { + borderColor: borderColor, + color: foregroundColor + }], + placeholder: "NOTIFICATION EMAIL", + placeholderTextColor: placeholdeTextColor, + onChangeText: function onChangeText(newText) { + _this4.setState({ + notificationEmail: newText + }); + }, + onEndEditing: this.setForceNotificationEmail, + value: notificationEmail, + autoCapitalize: "none" + }), global.isDebug || _$$_REQUIRE(_dependencyMap[22]).NetworkUtils.isTecnaviaIP() ? _react.default.createElement(_fontTextInput.default, { + style: [_$$_REQUIRE(_dependencyMap[26]).styles.input, { + borderColor: borderColor, + color: foregroundColor + }], + placeholder: "FORCE LAYOUT SUB STYLE", + placeholderTextColor: placeholdeTextColor, + onChangeText: function onChangeText(newText) { + return _this4.setState({ + subLayout: newText + }); + }, + onSubmitEditing: this.setForceLayoutSubStyle, + value: subLayout + }) : null, _$$_REQUIRE(_dependencyMap[22]).Logger.enableLog ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[28]).LogButton, { + style: _$$_REQUIRE(_dependencyMap[26]).styles.log, + onSending: this.onSending + }) : null, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.onShare, + style: [_$$_REQUIRE(_dependencyMap[26]).styles.debugButton, { + borderColor: borderColor + }] + }, _react.default.createElement(_fontText.default, { + style: { + color: foregroundColor + } + }, global.strings("action_share"))), _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.feedbackAction, + style: [_$$_REQUIRE(_dependencyMap[26]).styles.debugButton, { + borderColor: borderColor + }] + }, _react.default.createElement(_fontText.default, { + style: { + color: foregroundColor + } + }, global.strings("btn_feedback"))), (global.isDebug || _$$_REQUIRE(_dependencyMap[22]).NetworkUtils.isTecnaviaIP()) && _optionalPackageUtils.default.isCrashlyticsAvailable() ? _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.crashAction, + style: [_$$_REQUIRE(_dependencyMap[26]).styles.debugButton, { + borderColor: borderColor + }] + }, _react.default.createElement(_fontText.default, { + style: { + color: foregroundColor + } + }, global.strings("force_crash"))) : null, global.isDebug || _$$_REQUIRE(_dependencyMap[22]).NetworkUtils.isTecnaviaIP() ? _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.copyAction, + style: [_$$_REQUIRE(_dependencyMap[26]).styles.debugButton, { + borderColor: borderColor + }] + }, _react.default.createElement(_fontText.default, { + style: { + color: foregroundColor + } + }, global.strings("copy_files"))) : null))); + + if (hidden) { + return ModalComponent; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).Css, { + classes: ["setting-line"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[26]).styles.row, { + flexDirection: "column" + }] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.tapAction + }, _react.default.createElement(_reactNative.View, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[29]).Text, { + label: label + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[29]).Value, { + value: value + }))), ModalComponent)); + } + }]); + return SettingDebug; + }(_react.default.Component); + + exports.default = SettingDebug; + SettingDebug.propTypes = { + label: _propTypes.default.string, + value: _propTypes.default.string, + numberOfTapToDebug: _propTypes.default.number.isRequired, + onSublayoutChange: _propTypes.default.func, + hidden: _propTypes.default.bool + }; + SettingDebug.defaultProps = { + hidden: false + }; +},2256,[5,80,7,8,15,12,14,16,17,201,28,2152,1879,2257,1861,2154,2233,1872,574,731,1882,1950,462,2151,1955,699,2234,1909,2258,2237]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.Type = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Type = { + bold: "bold", + medium: "medium", + regular: "regular" + }; + exports.Type = Type; + var FontTextInput = (0, _react.forwardRef)(function (props, ref) { + var _useFonts = (0, _$$_REQUIRE(_dependencyMap[7]).useFonts)(_$$_REQUIRE(_dependencyMap[7]).FontContext), + allowFontScaling = _useFonts.allowFontScaling, + fontRegular = _useFonts.fontRegular, + fontMedium = _useFonts.fontMedium, + fontBold = _useFonts.fontBold; + + var _getFontStyle = function _getFontStyle(type) { + var fontStyle = {}; + + if (type === Type.bold && fontBold) { + fontStyle.fontFamily = fontBold.font; + } else if (type === Type.medium && fontMedium) { + fontStyle.fontFamily = fontMedium.font; + } else if (fontRegular) { + fontStyle.fontFamily = fontRegular.font; + } + + if (!fontStyle.fontFamily) { + fontStyle.fontFamily = "system font"; + fontStyle.fontWeight = type === Type.bold ? "bold" : "normal"; + } + + return fontStyle; + }; + + var type = props.type, + style = props.style, + _onLayout = props.onLayout, + rest = (0, _objectWithoutProperties2.default)(props, ["type", "style", "onLayout"]); + + var fontStyle = _getFontStyle(type); + + var textStyle = []; + + if (style) { + if (Array.isArray(style)) { + textStyle = (0, _toConsumableArray2.default)(style); + } else { + textStyle.push(style); + } + } + + textStyle.push(fontStyle); + return _react.default.createElement(_reactNative.TextInput, (0, _extends2.default)({ + ref: ref, + onLayout: function onLayout(e) { + return _onLayout && _onLayout(e, textStyle); + }, + style: textStyle + }, rest, { + allowFontScaling: allowFontScaling, + maxFontSizeMultiplier: _$$_REQUIRE(_dependencyMap[8]).FontUtils.fontMaxScale + })); + }); + FontTextInput.propTypes = { + type: _propTypes.default.oneOf(Object.values(Type)), + onLayout: _propTypes.default.func, + style: _propTypes.default.any + }; + FontTextInput.defaultProps = { + type: Type.regular + }; + var _default = FontTextInput; + exports.default = _default; +},2257,[5,6,21,108,17,201,28,1880,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.LogButton = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var LogButton = function (_React$Component) { + (0, _inherits2.default)(LogButton, _React$Component); + + var _super = _createSuper(LogButton); + + function LogButton() { + (0, _classCallCheck2.default)(this, LogButton); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(LogButton, [{ + key: "render", + value: function render() { + var _this$props = this.props, + onLayout = _this$props.onLayout, + onSending = _this$props.onSending, + style = _this$props.style; + return _react.default.createElement(_reactNative.TouchableOpacity, { + style: style, + onLayout: onLayout, + onPress: function _callee() { + var result; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (typeof onSending === "function") { + onSending(); + } + + _$$_REQUIRE(_dependencyMap[12]).LoadingOverlay.show({ + id: "log", + text: global.strings("uploading") + }); + + _context.next = 4; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[13]).Logger.areLogsStored()); + + case 4: + _context.next = 6; + return _regenerator.default.awrap(_Api.default.sendLog()); + + case 6: + result = _context.sent; + + _$$_REQUIRE(_dependencyMap[12]).LoadingOverlay.hide({ + id: "log" + }); + + if (result) { + _$$_REQUIRE(_dependencyMap[14]).Toast.show(global.strings("msg_sent", { + result: result + }), { + position: "top" + }); + } else { + _$$_REQUIRE(_dependencyMap[14]).Toast.show(global.strings("msg_failed", { + result: result + }), { + position: "top" + }); + } + + case 9: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, _react.default.createElement(_fontText.default, { + style: { + backgroundColor: _$$_REQUIRE(_dependencyMap[13]).colors.md_orange_800, + color: _$$_REQUIRE(_dependencyMap[13]).colors.black, + fontSize: 18, + padding: 5 + } + }, global.strings("btn_disable_log_file"))); + } + }]); + return LogButton; + }(_react.default.Component); + + exports.LogButton = LogButton; + LogButton.propTypes = { + onLayout: _propTypes.default.func, + onSending: _propTypes.default.func, + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]) + }; +},2258,[5,80,7,8,12,14,16,17,201,28,1879,431,1950,462,1889]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2259,[2260]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RssFavoritesScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RssFavoritesScreen = function (_RssBaseScreen) { + (0, _inherits2.default)(RssFavoritesScreen, _RssBaseScreen); + + var _super = _createSuper(RssFavoritesScreen); + + function RssFavoritesScreen() { + (0, _classCallCheck2.default)(this, RssFavoritesScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(RssFavoritesScreen, [{ + key: "didFocus", + value: function didFocus() { + var _this = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(RssFavoritesScreen.prototype), "didFocus", this).call(this); + this.toggleFavorite = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.TOGGLE_FAVORITE, function () { + _this._retrieveData(); + }); + + this._retrieveData(); + } + }, { + key: "willBlur", + value: function willBlur() { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssFavoritesScreen.prototype), "willBlur", this).call(this); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.toggleFavorite); + } + }, { + key: "onRefresh", + value: function onRefresh(toastPriority, hideRefresh) { + return _regenerator.default.async(function onRefresh$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(this._retrieveData()); + + case 3: + _context.next = 7; + break; + + case 5: + _context.prev = 5; + _context.t0 = _context["catch"](0); + + case 7: + if (typeof hideRefresh === "function") { + hideRefresh(); + } + + case 8: + case "end": + return _context.stop(); + } + } + }, null, this, [[0, 5]], Promise); + } + }, { + key: "_retrieveData", + value: function _retrieveData() { + var favoritesConfig, items, orientation; + return _regenerator.default.async(function _retrieveData$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + favoritesConfig = global.getRssFavoritesConfig(); + items = favoritesConfig.getFavorites(); + orientation = this.state.orientation; + this.setState({ + items: items, + loading: false, + orientation: orientation + }); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getTag", + value: function getTag() { + return "Live News Favorites"; + } + }, { + key: "_getEmpty", + value: function _getEmpty() { + return this._getIconView("surprise", global.strings("msg_empty_favorites")); + } + }, { + key: "_render", + value: function _render() { + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, this._getComponent()); + } + }]); + return RssFavoritesScreen; + }(_$$_REQUIRE(_dependencyMap[12]).RssBaseScreen); + + exports.RssFavoritesScreen = RssFavoritesScreen; +},2260,[5,80,7,8,90,12,14,16,17,28,460,572,2218]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2261,[2262]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RssSearchScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _rssSearchAdvanceModal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RssSearchScreen = function (_RssBaseScreen) { + (0, _inherits2.default)(RssSearchScreen, _RssBaseScreen); + + var _super = _createSuper(RssSearchScreen); + + function RssSearchScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, RssSearchScreen); + _this = _super.call(this, props, {}, false); + _this._advanceModalRef = _react.default.createRef(); + _this.text = ""; + _this.searchData = {}; + _this.onSearch = _this._onSearch.bind((0, _assertThisInitialized2.default)(_this)); + _this.onAdvanceSearch = _this._onAdvanceSearch.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(RssSearchScreen, [{ + key: "onRefresh", + value: function onRefresh(toastPriority, hideRefresh) { + return _regenerator.default.async(function onRefresh$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(this._retrieveData()); + + case 3: + _context.next = 7; + break; + + case 5: + _context.prev = 5; + _context.t0 = _context["catch"](0); + + case 7: + if (typeof hideRefresh === "function") { + hideRefresh(); + } + + case 8: + case "end": + return _context.stop(); + } + } + }, null, this, [[0, 5]], Promise); + } + }, { + key: "_onAdvanceSearch", + value: function _onAdvanceSearch() { + var searchData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + this.searchData = searchData; + + this._retrieveData(); + } + }, { + key: "_onSearch", + value: function _onSearch() { + var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + this.text = text; + + this._retrieveData(); + } + }, { + key: "_retrieveData", + value: function _retrieveData() { + var items, orientation; + return _regenerator.default.async(function _retrieveData$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + items = []; + this.setState({ + loading: true + }); + _context2.next = 4; + return _regenerator.default.awrap(_RssContentHelper.default.getArticlesBySearch(this.text, this.searchData)); + + case 4: + items = _context2.sent; + + try { + orientation = _deviceUtils.default.getCurrentOrientation(); + this.setState({ + items: items, + orientation: orientation, + loading: false + }); + } catch (e) { + this.log(e); + this.setState({ + error: true + }); + } + + case 6: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getEmpty", + value: function _getEmpty() { + return this._getIconView("surprise", global.strings("msg_empty_searches")); + } + }, { + key: "_getSearch", + value: function _getSearch() { + var _this2 = this; + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor, + borderRadius = _global$getRssIndex.borderRadius, + drawerItemsFlat = _global$getRssIndex.drawerItemsFlat; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[13]).Css.getDefaultBackgroundColor(); + + var color = _$$_REQUIRE(_dependencyMap[13]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_reactNative.View, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["rss-search-input"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).SearchInput, { + onSearch: this.onSearch, + placeholder: global.strings("str_search"), + mainColor: supportColor, + textColor: color, + textBackgroundColor: backgroundColor, + borderRadius: borderRadius, + onAdvancePress: function onAdvancePress() { + _this2._advanceModalRef.current.expand(); + } + }), _react.default.createElement(_rssSearchAdvanceModal.default, { + ref: this._advanceModalRef, + onSearch: this.onAdvanceSearch, + categoriesNotSearchable: (drawerItemsFlat || []).filter(function (item) { + return (0, _$$_REQUIRE(_dependencyMap[15]).parseExtra)(item.extra, "searchable", "1") === "0"; + }).map(function (item) { + return item.drawerItemKey; + }) + }))); + } + }, { + key: "getTag", + value: function getTag() { + return "Live News Search"; + } + }, { + key: "_render", + value: function _render() { + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + justifyContent: "space-between" + } + }, this._getSearch(), this._getComponent()); + } + }]); + return RssSearchScreen; + }(_$$_REQUIRE(_dependencyMap[16]).RssBaseScreen); + + exports.RssSearchScreen = RssSearchScreen; +},2262,[5,80,7,8,15,12,14,16,17,28,2207,458,2263,699,2278,2046,2218]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _rangepickerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _dropDownPicker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _rssSearchAdvanceModal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _RssContentHelper = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + var _modal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function getStartAndEndDateFromRange(_min, _max) { + var startDate = _$$_REQUIRE(_dependencyMap[13]).DateUtils.subDaysToToday(30).toDate(); + + if (_min && startDate.getTime() < _min) { + startDate = _$$_REQUIRE(_dependencyMap[13]).DateUtils.toDate(_min); + } + + var endDate = _$$_REQUIRE(_dependencyMap[13]).DateUtils.addDaysToToday(1).toDate(); + + var maxDate; + + if (_max) { + maxDate = _$$_REQUIRE(_dependencyMap[13]).DateUtils.addDaysToDate(_max, 1).toDate(); + + if (endDate.getTime() > maxDate.getTime()) { + endDate = maxDate; + } + } + + return { + startDate: startDate, + endDate: endDate, + minDate: _min, + maxDate: maxDate + }; + } + + function Header(props) { + return _react.default.createElement(_fontText.default, (0, _extends2.default)({ + style: [_rssSearchAdvanceModal.default.header, { + color: _$$_REQUIRE(_dependencyMap[14]).Css.getDefaultForegroundColor() + }], + type: _fontText.Type.bold + }, props)); + } + + var RssSearchAdvanceModal = (0, _react.forwardRef)(function (props, ref) { + var onSearch = props.onSearch, + defaultSearchData = props.defaultSearchData, + categoriesNotSearchable = props.categoriesNotSearchable; + + var _useState = (0, _react.useState)([]), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + bylines = _useState2[0], + setBylines = _useState2[1]; + + var _useState3 = (0, _react.useState)([]), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + categories = _useState4[0], + setCategories = _useState4[1]; + + var _useState5 = (0, _react.useState)(), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + minDate = _useState6[0], + setMinDate = _useState6[1]; + + var _useState7 = (0, _react.useState)(), + _useState8 = (0, _slicedToArray2.default)(_useState7, 2), + maxDate = _useState8[0], + setMaxDate = _useState8[1]; + + var tempSearchData = (0, _react.useRef)((0, _extends2.default)({ + order: _RssContentHelper.ORDER.DESC, + sortBy: _RssContentHelper.SORT.BY_DATE, + startDate: new Date(), + endDate: new Date() + }, defaultSearchData)); + var searchData = (0, _react.useRef)((0, _extends2.default)({}, tempSearchData.current)); + + var _onRangeChange = function _onRangeChange(startDate, endDate) { + tempSearchData.current.startDate = startDate; + tempSearchData.current.endDate = endDate; + }; + + var _onSortByChange = function _onSortByChange(_ref) { + var value = _ref.value; + tempSearchData.current.sortBy = value; + }; + + var _onOrderChange = function _onOrderChange(_ref2) { + var value = _ref2.value; + tempSearchData.current.order = value; + }; + + var _onBylineChange = function _onBylineChange(selected) { + tempSearchData.current.byline = selected.map(function (item) { + return item.value; + }); + }; + + var _onCategoriesChange = function _onCategoriesChange(selected) { + tempSearchData.current.categories = selected.map(function (item) { + return item.value; + }); + }; + + var _cancel = function _cancel() { + tempSearchData.current = (0, _extends2.default)({}, searchData.current); + }; + + var _search = function _search() { + if (typeof onSearch === "function") { + onSearch(tempSearchData.current); + } + + searchData.current = (0, _extends2.default)({}, tempSearchData.current); + }; + + var _loading = function _callee() { + var _await$RssContentHelp, _await$RssContentHelp2, min, max, _getStartAndEndDateFr, _min, _max, rest; + + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.t0 = setBylines; + _context.next = 4; + return _regenerator.default.awrap(_RssContentHelper.default.getBylines()); + + case 4: + _context.t1 = _context.sent; + (0, _context.t0)(_context.t1); + _context.t2 = setCategories; + _context.next = 9; + return _regenerator.default.awrap(_RssContentHelper.default.getCategoriesForSearch(categoriesNotSearchable)); + + case 9: + _context.t3 = _context.sent; + (0, _context.t2)(_context.t3); + _context.next = 13; + return _regenerator.default.awrap(_RssContentHelper.default.getRangeDates()); + + case 13: + _await$RssContentHelp = _context.sent; + _await$RssContentHelp2 = (0, _slicedToArray2.default)(_await$RssContentHelp, 2); + min = _await$RssContentHelp2[0]; + max = _await$RssContentHelp2[1]; + _getStartAndEndDateFr = getStartAndEndDateFromRange(min, max), _min = _getStartAndEndDateFr.minDate, _max = _getStartAndEndDateFr.maxDate, rest = (0, _objectWithoutProperties2.default)(_getStartAndEndDateFr, ["minDate", "maxDate"]); + tempSearchData.current = (0, _extends2.default)({}, tempSearchData.current, rest); + setMinDate(_min); + setMaxDate(_max); + _context.next = 26; + break; + + case 23: + _context.prev = 23; + _context.t4 = _context["catch"](0); + console.warn(_context.t4.message); + + case 26: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 23]], Promise); + }; + + (0, _react.useEffect)(function () { + _loading(); + }, []); + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[14]).Css.getDefaultBackgroundColor(); + + var color = _$$_REQUIRE(_dependencyMap[14]).Css.getDefaultForegroundColor(); + + var borderColor = _$$_REQUIRE(_dependencyMap[14]).Css.isDarkTheme ? color : _$$_REQUIRE(_dependencyMap[13]).colors.transparent600; + var textStyle = [_rssSearchAdvanceModal.default.textStyle, { + color: color + }]; + var DropDownStyles = { + textStyle: textStyle, + iconStyle: textStyle, + style: [_rssSearchAdvanceModal.default.dropDown, { + backgroundColor: backgroundColor, + borderColor: borderColor + }] + }; + var RangeStyles = { + containerStyle: _rssSearchAdvanceModal.default.range, + pickerProps: { + labelStyle: textStyle, + textStyle: textStyle, + style: [{ + borderColor: borderColor + }], + iconStyle: [_rssSearchAdvanceModal.default.iconStyle, { + color: borderColor + }], + locale: global.getLocaleConfig().getCurrentLocale() + } + }; + + var sortByValues = _RssContentHelper.default.getSortByValues(); + + var orderValues = _RssContentHelper.default.getOrderValues(); + + return _react.default.createElement(_modal.default, { + ref: ref, + hasFooter: true, + onConfirm: _search, + onCancel: _cancel, + backgroundColor: backgroundColor, + foregroundColor: supportColor, + containerStyle: { + padding: 20 + } + }, _react.default.createElement(Header, null, global.strings("str_date")), _react.default.createElement(_rangepickerComponent.default, (0, _extends2.default)({ + start: tempSearchData.current.startDate, + end: tempSearchData.current.endDate, + minDate: minDate, + maxDate: maxDate, + onRangeChange: _onRangeChange, + showText: false, + color: borderColor + }, RangeStyles)), _react.default.createElement(Header, null, global.strings("str_sort_by")), _react.default.createElement(_dropDownPicker.default, (0, _extends2.default)({ + selected: sortByValues.findIndex(function (item) { + return item.value === tempSearchData.current.sortBy; + }), + activeColor: supportColor, + options: sortByValues, + onChange: _onSortByChange + }, DropDownStyles)), _react.default.createElement(Header, null, global.strings("srt_order")), _react.default.createElement(_dropDownPicker.default, (0, _extends2.default)({ + selected: orderValues.findIndex(function (item) { + return item.value === tempSearchData.current.order; + }), + activeColor: supportColor, + options: orderValues, + onChange: _onOrderChange + }, DropDownStyles)), bylines.length ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(Header, null, global.strings("str_byline")), _react.default.createElement(_dropDownPicker.default, (0, _extends2.default)({ + selected: bylines.findIndex(function (item) { + return item.value === tempSearchData.current.byline; + }), + activeColor: supportColor, + options: bylines, + onChange: _onBylineChange + }, DropDownStyles))) : null, categories.length ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(Header, null, global.strings("str_categories")), _react.default.createElement(_dropDownPicker.default, (0, _extends2.default)({ + selected: categories.map(function (item, _i) { + return tempSearchData.current.categories && tempSearchData.current.categories.includes(item.value) ? _i : -1; + }).filter(function (item) { + return item !== -1; + }), + activeColor: supportColor, + options: categories, + onChange: _onCategoriesChange + }, DropDownStyles, { + multiChoice: true + }))) : null); + }); + RssSearchAdvanceModal.propTypes = { + onSearch: _propTypes.default.func, + defaultSearchData: _propTypes.default.shape({ + startDate: _propTypes.default.any, + endDate: _propTypes.default.any, + order: _propTypes.default.string, + sortBy: _propTypes.default.string, + byline: _propTypes.default.string, + categories: _propTypes.default.string + }), + categoriesNotSearchable: _propTypes.default.arrayOf(_propTypes.default.string) + }; + RssSearchAdvanceModal.defaultProps = { + defaultSearchData: {}, + categoriesNotSearchable: [] + }; + var _default = RssSearchAdvanceModal; + exports.default = _default; +},2263,[5,80,108,41,6,17,201,1879,2264,2275,2277,2207,1882,462,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _datepickerComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var styles = _reactNative.StyleSheet.create({ + container: {}, + pickerContainer: { + flexDirection: "row", + flex: 1 + }, + picker: { + height: 50, + alignItems: "center", + justifyContent: "center", + marginBottom: 5, + marginTop: 5, + flex: 1, + borderWidth: 0.3, + borderColor: _$$_REQUIRE(_dependencyMap[8]).colors.transparent600, + borderRadius: 20 + }, + icon: { + color: _$$_REQUIRE(_dependencyMap[8]).colors.transparent600 + } + }); + + function RangePickerComponent(props) { + var showText = props.showText, + start = props.start, + end = props.end, + onRangeChange = props.onRangeChange, + color = props.color, + containerStyle = props.containerStyle, + minDate = props.minDate, + maxDate = props.maxDate, + pickerProps = props.pickerProps, + pickerStartProps = props.pickerStartProps, + pickerEndProps = props.pickerEndProps; + + var _useState = (0, _react.useState)((0, _datepickerComponent.getDate)(start)), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + startRange = _useState2[0], + setStartRange = _useState2[1]; + + var _useState3 = (0, _react.useState)((0, _datepickerComponent.getDate)(end)), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + endRange = _useState4[0], + setEndRange = _useState4[1]; + + var _onStartChange = function _onStartChange(strDate, date) { + var startDate = new Date(date); + + if (startDate > new Date(endRange)) { + setStartRange(strDate); + setEndRange(strDate); + } else { + setStartRange(strDate); + } + }; + + var _onEndChange = function _onEndChange(strDate) { + setEndRange(strDate); + }; + + (0, _react.useEffect)(function () { + if (typeof onRangeChange === "function") { + onRangeChange(startRange, endRange); + } + }, [startRange, endRange]); + return _react.default.createElement(_reactNative.View, { + style: [styles.container, containerStyle] + }, _react.default.createElement(_datepickerComponent.default, (0, _extends2.default)({ + title: showText ? global.strings("btn_from") : "", + color: color, + date: startRange, + minDate: (0, _datepickerComponent.getDate)(minDate), + maxDate: (0, _datepickerComponent.getDate)(maxDate) + }, pickerProps, pickerStartProps, { + style: [styles.picker, { + borderColor: color + }, pickerProps.style, pickerStartProps.style], + containerStyle: [styles.pickerContainer, pickerProps.containerStyle, pickerStartProps.containerStyle], + iconStyle: [styles.icon, pickerProps.iconStyle, pickerStartProps.iconStyle], + onDateChange: _onStartChange + })), !showText ? _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + name: "arrow-left-right", + style: { + fontSize: 20, + margin: 5, + alignSelf: "center", + color: color + } + }) : null, _react.default.createElement(_datepickerComponent.default, (0, _extends2.default)({ + title: showText ? global.strings("btn_to") : "", + date: endRange, + color: color, + minDate: startRange, + maxDate: (0, _datepickerComponent.getDate)(maxDate) + }, pickerProps, pickerEndProps, { + style: [styles.picker, { + borderColor: color + }, pickerProps.style, pickerEndProps.style], + containerStyle: [styles.pickerContainer, pickerProps.containerStyle, pickerStartProps.containerStyle], + iconStyle: [styles.icon, pickerProps.iconStyle, pickerStartProps.iconStyle], + onDateChange: _onEndChange + }))); + } + + RangePickerComponent.defaultProps = { + showText: true, + start: new Date(), + end: new Date(), + minDate: new Date(), + containerStyle: {}, + pickerProps: {}, + pickerStartProps: {}, + pickerEndProps: {} + }; + RangePickerComponent.propTypes = { + start: _propTypes.default.string, + end: _propTypes.default.string, + color: _propTypes.default.string, + showText: _propTypes.default.bool, + minDate: _propTypes.default.object, + maxDate: _propTypes.default.object, + onRangeChange: _propTypes.default.func.isRequired, + containerStyle: _propTypes.default.any, + pickerProps: _datepickerComponent.default.propTypes, + pickerStartProps: _datepickerComponent.default.propTypes, + pickerEndProps: _datepickerComponent.default.propTypes + }; + var _default = RangePickerComponent; + exports.default = _default; +},2264,[5,6,41,17,201,28,2265,1806,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.getDate = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _pickerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var FORMATS = { + date: "YYYY-MM-DD", + datetime: "YYYY-MM-DD HH:mm", + time: "HH:mm" + }; + + var getDate = function getDate(date, format) { + if (date) { + if (date instanceof Date) { + return date; + } + + return _$$_REQUIRE(_dependencyMap[8]).DateUtils.toDate(date, format); + } + + return date; + }; + + exports.getDate = getDate; + + var styles = _reactNative.StyleSheet.create({ + container: { + alignItems: "center" + }, + dateTouchBody: { + flexDirection: "row", + flex: 1, + alignItems: "center", + justifyContent: "center" + }, + dateInput: { + flex: 1, + flexDirection: "row", + marginHorizontal: 10, + alignItems: "center", + justifyContent: "space-evenly" + }, + dateText: { + flex: 1, + padding: 2, + textAlign: "center" + }, + dateIcon: { + marginHorizontal: 5, + fontSize: 20 + } + }); + + var DatePicker = (0, _react.forwardRef)(function (props, ref) { + var mode = props.mode, + _props$format = props.format, + format = _props$format === undefined ? FORMATS[mode] : _props$format, + startEmpty = props.startEmpty, + onDateChange = props.onDateChange, + style = props.style, + containerStyle = props.containerStyle, + iconStyle = props.iconStyle, + labelStyle = props.labelStyle, + color = props.color, + title = props.title, + locale = props.locale; + + var _useState = (0, _react.useState)(startEmpty ? undefined : getDate(props.date, format) || new Date()), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + date = _useState2[0], + setDate = _useState2[1]; + + var _useState3 = (0, _react.useState)(getDate(props.minDate, format)), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + minDate = _useState4[0], + setMinDate = _useState4[1]; + + var _useState5 = (0, _react.useState)(getDate(props.maxDate, format)), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + maxDate = _useState6[0], + setMaxDate = _useState6[1]; + + (0, _react.useImperativeHandle)(ref, function () { + return { + getValue: function getValue() { + return date; + } + }; + }); + + var _getDateStr = function _getDateStr(toConvert) { + return _$$_REQUIRE(_dependencyMap[8]).DateUtils.getDateString(toConvert, format); + }; + + var _cancel = function _cancel() { + setDate(startEmpty ? undefined : date); + }; + + var _setDate = function _setDate(event, newDate) { + if (newDate !== undefined) { + setDate(newDate); + } else { + _cancel(); + } + }; + + (0, _react.useEffect)(function () { + setDate(getDate(props.date, format)); + }, [props.date]); + (0, _react.useEffect)(function () { + setMinDate(getDate(props.minDate, format)); + }, [props.minDate]); + (0, _react.useEffect)(function () { + setMaxDate(getDate(props.maxDate, format)); + }, [props.maxDate]); + (0, _react.useEffect)(function () { + if (typeof onDateChange === "function" && date) { + onDateChange(_getDateStr(date), date); + } + }, [date]); + return _react.default.createElement(_reactNative.View, { + style: [styles.container, containerStyle] + }, title ? _react.default.createElement(_fontText.default, { + style: labelStyle + }, title) : null, _react.default.createElement(_reactNative.View, { + style: [styles.dateTouchBody, style] + }, _react.default.createElement(_reactNative.View, { + style: styles.dateInput + }, _react.default.createElement(_iconComponent.default, { + style: [styles.dateIcon, iconStyle], + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + name: "calendar-month" + }), _react.default.createElement(_pickerComponent.default, { + visible: true, + date: date, + minDate: getDate(minDate, format), + maxDate: getDate(maxDate, format), + mode: mode, + onChange: _setDate, + style: { + flex: 1 + }, + locale: locale, + color: color + })))); + }); + DatePicker.defaultProps = { + mode: "date", + startEmpty: false + }; + DatePicker.propTypes = { + style: _propTypes.default.any, + containerStyle: _propTypes.default.any, + labelStyle: _propTypes.default.any, + iconStyle: _propTypes.default.any, + color: _propTypes.default.string, + title: _propTypes.default.string, + mode: _propTypes.default.oneOf(["date", "datetime", "time"]), + format: _propTypes.default.string, + date: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.instanceOf(Date)]), + minDate: _propTypes.default.string, + maxDate: _propTypes.default.string, + onDateChange: _propTypes.default.func, + startEmpty: _propTypes.default.bool, + locale: _propTypes.default.string + }; + var _default = DatePicker; + exports.default = _default; +},2265,[5,41,17,201,28,1879,2266,1806,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _datetimepicker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + function Picker(props) { + var visible = props.visible, + date = props.date, + minDate = props.minDate, + maxDate = props.maxDate, + mode = props.mode, + onChange = props.onChange, + style = props.style, + locale = props.locale, + color = props.color; + + if (visible) { + return _react.default.createElement(_datetimepicker.default, { + value: date || new Date(), + mode: mode, + maximumDate: maxDate, + minimumDate: minDate, + display: "default", + onChange: onChange, + style: style, + textColor: color, + locale: locale + }); + } + + return null; + } + + Picker.propTypes = { + visible: _propTypes.default.bool, + date: _propTypes.default.any, + minDate: _propTypes.default.any, + maxDate: _propTypes.default.any, + mode: _propTypes.default.string, + onChange: _propTypes.default.func, + color: _propTypes.default.string, + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + locale: _propTypes.default.string + }; + Picker.defaultProps = { + visible: false, + onChange: function onChange() {} + }; + var _default = Picker; + exports.default = _default; +},2266,[5,17,201,2267]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + var _exportNames = { + DateTimePickerAndroid: true + }; + Object.defineProperty(exports, "DateTimePickerAndroid", { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0]).DateTimePickerAndroid; + } + }); + exports.default = undefined; + + var _datetimepicker = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + Object.keys(_$$_REQUIRE(_dependencyMap[3])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[3])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3])[key]; + } + }); + }); + var _default = _datetimepicker.default; + exports.default = _default; +},2267,[2268,5,2269,2274]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DateTimePickerAndroid = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var warn = function warn() { + console.warn("DateTimePickerAndroid is not supported on: " + _reactNative.Platform.OS); + }; + + var DateTimePickerAndroid = { + open: warn, + dismiss: warn + }; + exports.DateTimePickerAndroid = DateTimePickerAndroid; +},2268,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = Picker; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _picker = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var React = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var getDisplaySafe = function getDisplaySafe(display) { + var majorVersionIOS = parseInt(_reactNative.Platform.Version, 10); + + if (display === _$$_REQUIRE(_dependencyMap[6]).IOS_DISPLAY.inline && majorVersionIOS < 14) { + return _$$_REQUIRE(_dependencyMap[6]).IOS_DISPLAY.spinner; + } + + if (majorVersionIOS < 14) { + return _$$_REQUIRE(_dependencyMap[6]).IOS_DISPLAY.spinner; + } + + return display; + }; + + function Picker(_ref) { + var value = _ref.value, + locale = _ref.locale, + maximumDate = _ref.maximumDate, + minimumDate = _ref.minimumDate, + minuteInterval = _ref.minuteInterval, + timeZoneOffsetInMinutes = _ref.timeZoneOffsetInMinutes, + textColor = _ref.textColor, + accentColor = _ref.accentColor, + themeVariant = _ref.themeVariant, + onChange = _ref.onChange, + _ref$mode = _ref.mode, + mode = _ref$mode === undefined ? _$$_REQUIRE(_dependencyMap[6]).IOS_MODE.date : _ref$mode, + _ref$display = _ref.display, + providedDisplay = _ref$display === undefined ? _$$_REQUIRE(_dependencyMap[6]).IOS_DISPLAY.default : _ref$display, + _ref$disabled = _ref.disabled, + disabled = _ref$disabled === undefined ? false : _ref$disabled, + other = (0, _objectWithoutProperties2.default)(_ref, ["value", "locale", "maximumDate", "minimumDate", "minuteInterval", "timeZoneOffsetInMinutes", "textColor", "accentColor", "themeVariant", "onChange", "mode", "display", "disabled"]); + (0, _$$_REQUIRE(_dependencyMap[7]).sharedPropsValidation)({ + value: value + }); + var display = getDisplaySafe(providedDisplay); + + var _onChange = function _onChange(event) { + var timestamp = event.nativeEvent.timestamp; + var unifiedEvent = (0, _extends2.default)({}, event, { + type: _$$_REQUIRE(_dependencyMap[6]).EVENT_TYPE_SET + }); + var date = timestamp !== undefined ? new Date(timestamp) : undefined; + onChange && onChange(unifiedEvent, date); + }; + + var onDismiss = function onDismiss() { + onChange && onChange({ + type: _$$_REQUIRE(_dependencyMap[6]).EVENT_TYPE_DISMISSED, + nativeEvent: { + timestamp: value.getTime() + } + }, value); + }; + + return React.createElement(_picker.default, (0, _extends2.default)({}, other, { + date: (0, _$$_REQUIRE(_dependencyMap[7]).dateToMilliseconds)(value), + locale: locale !== null && locale !== '' ? locale : undefined, + maximumDate: (0, _$$_REQUIRE(_dependencyMap[7]).dateToMilliseconds)(maximumDate), + minimumDate: (0, _$$_REQUIRE(_dependencyMap[7]).dateToMilliseconds)(minimumDate), + mode: mode, + minuteInterval: minuteInterval, + timeZoneOffsetInMinutes: timeZoneOffsetInMinutes, + onChange: _onChange, + onPickerDismiss: onDismiss, + textColor: textColor, + accentColor: accentColor, + themeVariant: themeVariant, + onStartShouldSetResponder: function onStartShouldSetResponder() { + return true; + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + return false; + }, + displayIOS: display, + enabled: disabled !== true + })); + } +},2269,[5,6,108,2270,17,28,2272,2273]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _DateTimePickerNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = _DateTimePickerNativeComponent.default; + exports.default = _default; +},2270,[5,2271]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _codegenNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _codegenNativeComponent.default)('RNDateTimePicker'); + + exports.default = _default; +},2271,[5,190]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NEUTRAL_BUTTON_ACTION = exports.DISMISS_ACTION = exports.TIME_SET_ACTION = exports.DATE_SET_ACTION = exports.DAY_OF_WEEK = exports.IOS_MODE = exports.WINDOWS_MODE = exports.ANDROID_MODE = exports.IOS_DISPLAY = exports.ANDROID_EVT_TYPE = exports.EVENT_TYPE_DISMISSED = exports.EVENT_TYPE_SET = exports.ANDROID_DISPLAY = exports.MIN_MS = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var MIN_MS = 60000; + exports.MIN_MS = MIN_MS; + var ANDROID_DISPLAY = Object.freeze({ + default: 'default', + spinner: 'spinner', + clock: 'clock', + calendar: 'calendar' + }); + exports.ANDROID_DISPLAY = ANDROID_DISPLAY; + var EVENT_TYPE_SET = 'set'; + exports.EVENT_TYPE_SET = EVENT_TYPE_SET; + var EVENT_TYPE_DISMISSED = 'dismissed'; + exports.EVENT_TYPE_DISMISSED = EVENT_TYPE_DISMISSED; + var ANDROID_EVT_TYPE = Object.freeze({ + set: EVENT_TYPE_SET, + dismissed: EVENT_TYPE_DISMISSED, + neutralButtonPressed: 'neutralButtonPressed' + }); + exports.ANDROID_EVT_TYPE = ANDROID_EVT_TYPE; + var IOS_DISPLAY = Object.freeze({ + default: 'default', + spinner: 'spinner', + compact: 'compact', + inline: 'inline' + }); + exports.IOS_DISPLAY = IOS_DISPLAY; + var COMMON_MODES = Object.freeze({ + date: 'date', + time: 'time' + }); + var ANDROID_MODE = COMMON_MODES; + exports.ANDROID_MODE = ANDROID_MODE; + var WINDOWS_MODE = COMMON_MODES; + exports.WINDOWS_MODE = WINDOWS_MODE; + var IOS_MODE = Object.freeze((0, _extends2.default)({}, COMMON_MODES, { + datetime: 'datetime', + countdown: 'countdown' + })); + exports.IOS_MODE = IOS_MODE; + var DAY_OF_WEEK = Object.freeze({ + Sunday: 0, + Monday: 1, + Tuesday: 2, + Wednesday: 3, + Thursday: 4, + Friday: 5, + Saturday: 6 + }); + exports.DAY_OF_WEEK = DAY_OF_WEEK; + var DATE_SET_ACTION = 'dateSetAction'; + exports.DATE_SET_ACTION = DATE_SET_ACTION; + var TIME_SET_ACTION = 'timeSetAction'; + exports.TIME_SET_ACTION = TIME_SET_ACTION; + var DISMISS_ACTION = 'dismissedAction'; + exports.DISMISS_ACTION = DISMISS_ACTION; + var NEUTRAL_BUTTON_ACTION = 'neutralButtonAction'; + exports.NEUTRAL_BUTTON_ACTION = NEUTRAL_BUTTON_ACTION; +},2272,[5,6]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.toMilliseconds = toMilliseconds; + exports.dateToMilliseconds = dateToMilliseconds; + exports.sharedPropsValidation = sharedPropsValidation; + + var _invariant = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + function toMilliseconds(options) { + for (var _len = arguments.length, keys = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + keys[_key - 1] = arguments[_key]; + } + + keys.forEach(function each(key) { + var value = options[key]; + + if (Object.prototype.toString.call(value) === '[object Date]') { + options[key] = value.getTime(); + } + }); + } + + function dateToMilliseconds(date) { + if (!date) { + return; + } + + return date.getTime(); + } + + function sharedPropsValidation(_ref) { + var value = _ref.value; + (0, _invariant.default)(value, 'A date or time must be specified as `value` prop'); + (0, _invariant.default)(value instanceof Date, '`value` prop must be an instance of Date object'); + } +},2273,[5,36]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.createNeutralEvtParams = exports.createDismissEvtParams = exports.createDateTimeSetEvtParams = undefined; + + var createDateTimeSetEvtParams = function createDateTimeSetEvtParams(date) { + return [{ + type: _$$_REQUIRE(_dependencyMap[0]).EVENT_TYPE_SET, + nativeEvent: { + timestamp: date.getTime() + } + }, date]; + }; + + exports.createDateTimeSetEvtParams = createDateTimeSetEvtParams; + + var createDismissEvtParams = function createDismissEvtParams(date) { + return [{ + type: _$$_REQUIRE(_dependencyMap[0]).ANDROID_EVT_TYPE.dismissed, + nativeEvent: { + timestamp: date.getTime() + } + }, date]; + }; + + exports.createDismissEvtParams = createDismissEvtParams; + + var createNeutralEvtParams = function createNeutralEvtParams(date) { + return [{ + type: _$$_REQUIRE(_dependencyMap[0]).ANDROID_EVT_TYPE.neutralButtonPressed, + nativeEvent: { + timestamp: date.getTime() + } + }, date]; + }; + + exports.createNeutralEvtParams = createNeutralEvtParams; +},2274,[2272]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _dropDownList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _dropDownButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function DropDown(props) { + var onChange = props.onChange, + rest = (0, _objectWithoutProperties2.default)(props, ["onChange"]); + + var _getText = function _getText(selected) { + if (!selected) { + return global.strings("str_select"); + } + + if (rest.multiChoice) { + return selected.map(function (item) { + return item.label; + }).join(",") || global.strings("str_select"); + } + + return selected.label; + }; + + return _react.default.createElement(_dropDownList.default, (0, _extends2.default)({}, props, { + onClose: function onClose(selected) { + return typeof onChange === "function" && onChange(selected); + } + }), function (_ref) { + var selected = _ref.selected, + expanded = _ref.expanded; + return _react.default.createElement(_dropDownButton.default, { + text: _getText(selected), + expanded: expanded + }); + }); + } + + DropDown.propTypes = (0, _extends2.default)({ + onChange: _propTypes.default.func.isRequired, + style: _propTypes.default.any, + iconStyle: _propTypes.default.any, + textStyle: _propTypes.default.any + }, _dropDownList.default.propTypes); + DropDown.defaultProps = {}; + var _default = DropDown; + exports.default = _default; +},2275,[5,6,108,17,201,2243,2276]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var styles = _reactNative.StyleSheet.create({ + textContainer: { + width: "100%", + height: 50, + paddingHorizontal: 10, + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.white, + borderWidth: 0.3, + borderColor: _$$_REQUIRE(_dependencyMap[5]).colors.transparent200, + borderRadius: 20, + alignItems: "center", + justifyContent: "space-evenly", + flexDirection: "row" + }, + text: { + flex: 1 + }, + icon: { + fontSize: 20, + marginHorizontal: 5 + } + }); + + function DropDownButton(props) { + var style = props.style, + iconStyle = props.iconStyle, + textStyle = props.textStyle, + text = props.text, + expanded = props.expanded; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["drop-down-text-container"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[7]).Circle.Button, { + style: style + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["drop-down-text"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[7]).Circle.Text, { + style: textStyle, + numberOfLines: 2 + }, text)), _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["drop-down-icon"] + }, _react.default.createElement(_iconComponent.default, { + style: [styles.icon, { + color: _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultForegroundColor() + }, iconStyle], + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + name: expanded ? "menu-up" : "menu-down" + })))); + } + + DropDownButton.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]), + iconStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]), + textStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]), + text: _propTypes.default.string, + expanded: _propTypes.default.bool + }; + DropDownButton.defaultProps = { + text: "", + expanded: false + }; + var _default = DropDownButton; + exports.default = _default; +},2276,[5,17,201,28,1806,462,699,2202]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + modal: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + paddingHorizontal: 20, + paddingVertical: 10, + borderRadius: 20 + }, + header: { + paddingVertical: 10, + fontSize: 18 + }, + textStyle: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.black + }, + iconStyle: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.transparent600 + }, + dropDown: { + borderWidth: 0.3, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent600, + borderRadius: 20 + }, + range: { + flexDirection: "row", + width: "100%", + height: 50 + } + }); + + exports.default = _default; +},2277,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2278,[2279]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SearchInput = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + var _fontTextInput = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SearchInput = function (_Component) { + (0, _inherits2.default)(SearchInput, _Component); + + var _super = _createSuper(SearchInput); + + function SearchInput(props) { + var _this; + + (0, _classCallCheck2.default)(this, SearchInput); + _this = _super.call(this, props); + var placeholder = _this.props.placeholder; + _this.placeholder = placeholder || "Search"; + _this.onFocus = _this._onFocus.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSearch = _this._onSearch.bind((0, _assertThisInitialized2.default)(_this)); + _this.onChangeText = _this._onChangeText.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + keyword: "" + }; + return _this; + } + + (0, _createClass2.default)(SearchInput, [{ + key: "_onSearch", + value: function _onSearch() { + var _this$props, beforeSearch, keyboardShouldPersist, onSearch, afterSearch, keyword; + + return _regenerator.default.async(function _onSearch$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _this$props = this.props, beforeSearch = _this$props.beforeSearch, keyboardShouldPersist = _this$props.keyboardShouldPersist, onSearch = _this$props.onSearch, afterSearch = _this$props.afterSearch; + keyword = this.state.keyword; + + if (!beforeSearch) { + _context.next = 5; + break; + } + + _context.next = 5; + return _regenerator.default.awrap(beforeSearch(keyword)); + + case 5: + if (!(keyboardShouldPersist === false)) { + _context.next = 8; + break; + } + + _context.next = 8; + return _regenerator.default.awrap(_reactNative.Keyboard.dismiss()); + + case 8: + if (!onSearch) { + _context.next = 11; + break; + } + + _context.next = 11; + return _regenerator.default.awrap(onSearch(keyword)); + + case 11: + if (!afterSearch) { + _context.next = 14; + break; + } + + _context.next = 14; + return _regenerator.default.awrap(afterSearch(keyword)); + + case 14: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onChangeText", + value: function _onChangeText(text) { + var onChangeText, keyword; + return _regenerator.default.async(function _onChangeText$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + onChangeText = this.props.onChangeText; + keyword = this.state.keyword; + _context2.next = 4; + return _regenerator.default.awrap(this.setState({ + keyword: text + })); + + case 4: + if (!onChangeText) { + _context2.next = 7; + break; + } + + _context2.next = 7; + return _regenerator.default.awrap(onChangeText(keyword)); + + case 7: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onFocus", + value: function _onFocus() { + var _this$props2, beforeFocus, onFocus, afterFocus, keyword; + + return _regenerator.default.async(function _onFocus$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _this$props2 = this.props, beforeFocus = _this$props2.beforeFocus, onFocus = _this$props2.onFocus, afterFocus = _this$props2.afterFocus; + keyword = this.state.keyword; + + if (!beforeFocus) { + _context3.next = 5; + break; + } + + _context3.next = 5; + return _regenerator.default.awrap(beforeFocus()); + + case 5: + if (!(this.inputKeyword && !this.inputKeyword.isFocused())) { + _context3.next = 8; + break; + } + + _context3.next = 8; + return _regenerator.default.awrap(this.inputKeyword.focus()); + + case 8: + if (!onFocus) { + _context3.next = 11; + break; + } + + _context3.next = 11; + return _regenerator.default.awrap(onFocus(keyword)); + + case 11: + if (!afterFocus) { + _context3.next = 14; + break; + } + + _context3.next = 14; + return _regenerator.default.awrap(afterFocus()); + + case 14: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props3 = this.props, + editable = _this$props3.editable, + onBlur = _this$props3.onBlur, + blurOnSubmit = _this$props3.blurOnSubmit, + keyboardType = _this$props3.keyboardType, + autoCapitalize = _this$props3.autoCapitalize, + autoFocus = _this$props3.autoFocus, + mainColor = _this$props3.mainColor, + textBackgroundColor = _this$props3.textBackgroundColor, + textColor = _this$props3.textColor, + borderRadius = _this$props3.borderRadius, + onAdvancePress = _this$props3.onAdvancePress, + style = _this$props3.style; + var keyword = this.state.keyword; + + var searchTextStyle = _$$_REQUIRE(_dependencyMap[13]).Css.getStyleObjByCssClasses(["search-input"]); + + var borderColor = _$$_REQUIRE(_dependencyMap[14]).CssUtils.getAttributeFromStyle("borderColor", [style, searchTextStyle], mainColor); + + var color = _$$_REQUIRE(_dependencyMap[14]).CssUtils.getAttributeFromStyle("color", [style, searchTextStyle], textColor); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[14]).CssUtils.getAttributeFromStyle("backgroundColor", [style, searchTextStyle], textBackgroundColor); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["search-container"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[15]).styles.container, { + backgroundColor: borderColor + }] + }, _react.default.createElement(_fontTextInput.default, { + ref: function ref(inputKeyword) { + _this2.inputKeyword = inputKeyword; + }, + style: [_$$_REQUIRE(_dependencyMap[15]).styles.input, searchTextStyle, style, { + borderColor: borderColor, + backgroundColor: backgroundColor, + borderWidth: 1, + borderRadius: borderRadius, + color: color + }], + editable: editable, + value: keyword, + onChangeText: this.onChangeText, + placeholder: this.placeholder, + placeholderTextColor: color, + onSubmitEditing: this.onSearch, + autoCorrect: false, + blurOnSubmit: blurOnSubmit, + returnKeyType: "search", + keyboardType: keyboardType || "default", + autoCapitalize: autoCapitalize, + onBlur: onBlur, + onFocus: this.onFocus, + underlineColorAndroid: "transparent", + autoFocus: autoFocus + }), typeof onAdvancePress === "function" ? _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onAdvancePress, + style: _$$_REQUIRE(_dependencyMap[15]).styles.iconContainer + }, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + name: "tune", + style: [_$$_REQUIRE(_dependencyMap[15]).styles.icon, { + color: color + }] + })) : null)); + } + }]); + return SearchInput; + }(_react.Component); + + exports.SearchInput = SearchInput; + SearchInput.propTypes = { + afterFocus: _propTypes.default.func, + afterSearch: _propTypes.default.func, + autoCapitalize: _propTypes.default.string, + autoFocus: _propTypes.default.bool, + beforeFocus: _propTypes.default.func, + beforeSearch: _propTypes.default.func, + blurOnSubmit: _propTypes.default.bool, + editable: _propTypes.default.bool, + keyboardShouldPersist: _propTypes.default.bool, + keyboardType: _propTypes.default.string, + onBlur: _propTypes.default.func, + onAdvancePress: _propTypes.default.func, + onChangeText: _propTypes.default.func, + onFocus: _propTypes.default.func, + onSearch: _propTypes.default.func, + placeholder: _propTypes.default.string, + mainColor: _propTypes.default.string, + textBackgroundColor: _propTypes.default.string, + textColor: _propTypes.default.string, + borderRadius: _propTypes.default.number, + style: _propTypes.default.any + }; + SearchInput.defaultProps = { + editable: true, + blurOnSubmit: false, + keyboardShouldPersist: false, + mainColor: _$$_REQUIRE(_dependencyMap[14]).colors.black, + textBackgroundColor: _$$_REQUIRE(_dependencyMap[14]).colors.white, + textColor: _$$_REQUIRE(_dependencyMap[14]).colors.black, + borderRadius: 0, + autoFocus: false + }; +},2279,[5,80,7,8,15,12,14,16,17,201,28,1806,2257,699,462,2280]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + container: { + height: 50, + flexDirection: "row", + justifyContent: "flex-start", + padding: 5 + }, + input: { + flex: 1, + height: 40, + paddingTop: 5, + paddingBottom: 5, + paddingRight: 20, + paddingLeft: 20, + fontSize: 13 + }, + iconContainer: { + position: "absolute", + top: 10, + end: 10, + height: 30, + justifyContent: "center" + }, + icon: { + fontSize: 30 + } + }); + + exports.styles = styles; +},2280,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2281,[2282]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EmptyScreen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EmptyScreen = function (_React$Component) { + (0, _inherits2.default)(EmptyScreen, _React$Component); + + var _super = _createSuper(EmptyScreen); + + function EmptyScreen() { + (0, _classCallCheck2.default)(this, EmptyScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(EmptyScreen, [{ + key: "render", + value: function render() { + return null; + } + }]); + return EmptyScreen; + }(_react.default.Component); + + exports.EmptyScreen = EmptyScreen; +},2282,[5,7,8,12,14,16,17]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2283,[2284]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DrawerComponent = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _drawerLabelComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function hasChildren(structure, parent) { + return structure && structure.find(function (_ref) { + var item = _ref.item; + return item.parent === parent.drawerItemKey && !item.neverShowInDrawer; + }) !== undefined; + } + + function Scene(props) { + var item = props.item, + focused = props.focused, + navigation = props.navigation, + onItemPress = props.onItemPress, + accordion = props.accordion; + + if (item) { + var componentProps = (0, _extends2.default)({}, props); + + if (accordion) { + var onAccordionPress = _react.default.useCallback(function () { + var collapse = item.collapse; + item.collapse = !collapse; + var collapsed = !collapse ? "1" : "0"; + global.getUserSettings().setValue(_navigationUtils.default.getCollapsedStateKeyForDrawerItem(item), collapsed); + + _$$_REQUIRE(_dependencyMap[9]).EventRegister.emit(_events.default.TOGGLE_DRAWER_ITEM, { + category: item.drawerItemKey, + collapsed: collapsed + }); + }); + + componentProps.onAccordionPress = onAccordionPress; + } + + var Component = _react.default.createElement(_drawerLabelComponent.default, componentProps); + + var onPress = (0, _react.useCallback)(function () { + if (typeof onItemPress === "function") { + if (focused) { + try { + navigation.closeDrawer(); + } catch (e) {} + } else { + onItemPress(navigation, item); + } + } else if (componentProps.onAccordionPress) { + componentProps.onAccordionPress(); + } + }); + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress + }, Component); + } + + return null; + } + + Scene.propTypes = { + item: _propTypes.default.object.isRequired, + focused: _propTypes.default.bool, + navigation: _propTypes.default.object, + onItemPress: _propTypes.default.func, + accordion: _propTypes.default.bool + }; + + var DrawerComponent = function DrawerComponent(props) { + var drawerHeader = props.drawerHeader, + skipRoutes = props.skipRoutes, + structure = props.structure, + onItemPress = props.onItemPress, + navigation = props.navigation, + newLayout = props.newLayout; + + var _useState = (0, _react.useState)(""), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + category = _useState2[0], + setCategory = _useState2[1]; + + var _useTecnaviaSafeAreaI = (0, _$$_REQUIRE(_dependencyMap[10]).useTecnaviaSafeAreaInsets)(), + left = _useTecnaviaSafeAreaI.left; + + var toggleDrawerCategory; + (0, _react.useEffect)(function () { + toggleDrawerCategory = _$$_REQUIRE(_dependencyMap[9]).EventRegister.on(_events.default.TOGGLE_DRAWER_ITEM, function (_ref2) { + var drawerCategory = _ref2.category, + collapsed = _ref2.collapsed; + setCategory(drawerCategory + "_" + collapsed); + }); + return function () { + _$$_REQUIRE(_dependencyMap[9]).EventRegister.rm(toggleDrawerCategory); + }; + }, []); + + var focusedRoute = _navigationUtils.default.getActiveRouteFromState(navigation.getState()); + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + paddingTop: 0, + marginLeft: -left, + backgroundColor: newLayout ? _$$_REQUIRE(_dependencyMap[11]).Css.getDefaultBackgroundColor() : _$$_REQUIRE(_dependencyMap[12]).colors.transparent + } + }, drawerHeader, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).DrawerContentScrollView, { + style: { + flex: 1 + }, + contentContainerStyle: { + paddingTop: 0 + } + }, structure.map(function (_ref3) { + var item = _ref3.item, + tabs = _ref3.tabs, + route = _ref3.route; + + if (skipRoutes.includes(route)) { + return null; + } + + var clickable = item.type !== "section" || item.layout === "tab"; + return item ? _react.default.createElement(Scene, { + key: route, + navigation: navigation, + item: item, + focused: focusedRoute === route, + accordion: hasChildren(structure, item), + onItemPress: clickable ? onItemPress : undefined, + newLayout: newLayout, + getParent: function getParent(child) { + var drawerItem = structure.find(function (element) { + return element.item.drawerItemKey === child.parent; + }); + + if (drawerItem) { + return drawerItem.item; + } + + return undefined; + } + }) : null; + }))); + }; + + exports.DrawerComponent = DrawerComponent; + DrawerComponent.propTypes = { + navigation: _propTypes.default.shape({ + getState: _propTypes.default.func + }).isRequired, + skipRoutes: _propTypes.default.arrayOf(_propTypes.default.string), + structure: _propTypes.default.arrayOf(_propTypes.default.shape({ + item: _propTypes.default.object, + tabs: _propTypes.default.arrayOf(_propTypes.default.object) + })).isRequired, + newLayout: _propTypes.default.bool, + onItemPress: _propTypes.default.func.isRequired, + drawerHeader: _propTypes.default.node + }; +},2284,[5,41,6,17,201,28,2285,460,2045,572,2146,699,462,1139]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _RssIndexConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _drawerLabelChevronComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _drawerLabelIconComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _drawerLabelTextComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _drawerLabelComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function isVisible(item, getParent) { + var parent = getParent(item); + return !item.neverShowInDrawer && (!parent || !parent.collapse && isVisible(parent, getParent)); + } + + function getTextAlignment(item) { + var alignment = "left"; + + if (item.textAlign) { + switch (item.textAlign) { + case "right": + alignment = "right"; + break; + + case "middle": + alignment = "center"; + break; + } + } + + return alignment; + } + + function getDarknessBackground(item, menuBackgroundColor) { + var alpha = item.depth ? Math.min(255, item.depth * 40) : 255; + var darkPercentageDecrease = item.depth ? Math.min(100, item.depth * 15) : 0; + return _$$_REQUIRE(_dependencyMap[11]).ColorUtils.applyDarknessToHex(menuBackgroundColor, darkPercentageDecrease, alpha); + } + + function getFocusedStyle(focused, newLayout) { + var _global$getRssIndex = global.getRssIndex(), + borderRadius = _global$getRssIndex.borderRadius, + supportColor = _global$getRssIndex.supportColor; + + var focusedStyle = {}; + + if (focused && newLayout) { + focusedStyle.borderRadius = borderRadius; + focusedStyle.backgroundColor = supportColor; + focusedStyle.color = _$$_REQUIRE(_dependencyMap[11]).ColorUtils.determineTextColor(focusedStyle.backgroundColor); + } + + return focusedStyle; + } + + function getBaseStyle(item, focused, newLayout) { + var _global$getRssIndex2 = global.getRssIndex(), + menuBackgroundColor = _global$getRssIndex2.menuBackgroundColor, + supportColor = _global$getRssIndex2.supportColor; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[11]).colors.white; + + var borderBottomColor = menuBackgroundColor; + var textColor; + + if (!focused && item.type && !newLayout) { + var isFeed = item.type === "feed"; + var isUrl = item.type === "url"; + var isSection = item.type === "section"; + var isTab = isSection && item.layout === "tab"; + + if (isTab || isFeed || isUrl) { + backgroundColor = getDarknessBackground(item, menuBackgroundColor); + borderBottomColor = _$$_REQUIRE(_dependencyMap[11]).colors.grey50; + } + + if (isSection && !isTab) { + textColor = supportColor; + } + } + + var paddingStart = item.depth ? item.depth * 10 : 0; + return { + backgroundColor: backgroundColor, + borderBottomColor: borderBottomColor, + color: textColor || _$$_REQUIRE(_dependencyMap[11]).ColorUtils.determineTextColor(backgroundColor) || _$$_REQUIRE(_dependencyMap[11]).colors.black, + paddingStart: newLayout ? paddingStart : 10 + paddingStart + }; + } + + function getStyle(item, focused, newLayout) { + var _getBaseStyle = getBaseStyle(item, focused, newLayout), + color = _getBaseStyle.color, + backgroundColor = _getBaseStyle.backgroundColor, + borderBottomColor = _getBaseStyle.borderBottomColor, + paddingStart = _getBaseStyle.paddingStart; + + var _getFocusedStyle = getFocusedStyle(focused, newLayout), + focusedColor = _getFocusedStyle.color, + rest = (0, _objectWithoutProperties2.default)(_getFocusedStyle, ["color"]); + + return { + style: (0, _extends2.default)({ + height: newLayout ? 35 : _$$_REQUIRE(_dependencyMap[12]).DRAWER_ITEM_HEIGHT, + borderBottomWidth: item.type === "section" || !newLayout ? 0.5 : 0, + margin: newLayout ? 5 : 0, + backgroundColor: backgroundColor, + paddingStart: newLayout ? 10 : paddingStart, + borderBottomColor: newLayout ? _$$_REQUIRE(_dependencyMap[11]).colors.transparent1200 : borderBottomColor, + paddingHorizontal: newLayout ? 10 : 0, + paddingVertical: newLayout ? 5 : 0 + }, rest), + imageStyle: { + paddingEnd: 10 + }, + textStyle: { + flex: 1, + paddingStart: newLayout ? paddingStart : 0, + fontSize: newLayout ? 14 : 16, + paddingEnd: newLayout ? 5 : 10, + paddingVertical: newLayout ? 0 : 10, + textAlign: getTextAlignment(item), + color: focusedColor || color, + backgroundColor: _$$_REQUIRE(_dependencyMap[11]).colors.transparent, + justifyContent: "center" + }, + chevronStyle: { + color: focusedColor || color, + fontSize: newLayout ? 20 : 27 + } + }; + } + + function DrawerLabelComponent(props) { + var item = props.item, + newLayout = props.newLayout, + focused = props.focused, + accordion = props.accordion, + onAccordionPress = props.onAccordionPress, + getParent = props.getParent; + var visible = isVisible(item, getParent); + + var _getStyle = getStyle(item, focused, newLayout), + textStyle = _getStyle.textStyle, + chevronStyle = _getStyle.chevronStyle, + imageStyle = _getStyle.imageStyle, + style = _getStyle.style; + + var cssKey = item.cssKey || _$$_REQUIRE(_dependencyMap[11]).StringUtils.getKeyFromText(item.drawerItemKey); + + var css = _$$_REQUIRE(_dependencyMap[13]).Css.getStyleObjByCssClasses(["drawer-item-parent"], { + cssKey: cssKey, + toggle: true, + active: focused + }); + + var height = css.height || style.height; + + if (visible) { + return _react.default.createElement(_reactNative.View, { + style: [_drawerLabelComponent.default.labelParent, style, css], + pointerEvents: "box-none" + }, _react.default.createElement(_drawerLabelIconComponent.default, { + cssItemKey: cssKey, + focused: focused, + icon: item.image, + size: height, + style: imageStyle + }), _react.default.createElement(_drawerLabelTextComponent.default, { + cssItemKey: cssKey, + item: item, + focused: focused, + style: textStyle, + upperCase: item.type === "section" + }), accordion ? _react.default.createElement(_drawerLabelChevronComponent.default, { + cssItemKey: cssKey, + item: item, + focused: focused, + height: height, + style: chevronStyle, + onAccordionPress: onAccordionPress + }) : null); + } + + return null; + } + + DrawerLabelComponent.propTypes = { + item: _propTypes.default.object.isRequired, + getParent: _propTypes.default.func.isRequired, + accordion: _propTypes.default.bool, + focused: _propTypes.default.bool, + newLayout: _propTypes.default.bool, + onAccordionPress: _propTypes.default.func + }; + var _default = DrawerLabelComponent; + exports.default = _default; +},2285,[5,6,108,17,28,201,2044,2286,2287,2288,2289,462,2039,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _buttonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function DrawerLabelChevronComponent(props) { + var style = props.style, + item = props.item, + cssItemKey = props.cssItemKey, + focused = props.focused, + onAccordionPress = props.onAccordionPress; + var collapse = item.collapse; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drawer-item-chevron-parent"], + cssKey: cssItemKey, + toggle: true, + active: focused + }, _react.default.createElement(_buttonComponent.default, { + transparent: true, + bordered: false, + style: { + backgroundColor: _$$_REQUIRE(_dependencyMap[6]).colors.transparent + }, + onPress: onAccordionPress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["drawer-item-chevron"], + cssKey: cssItemKey, + toggle: true, + active: focused + }, _react.default.createElement(_iconComponent.default, { + style: style, + name: !collapse ? "chevron-up" : "chevron-down", + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS + })))); + } + + DrawerLabelChevronComponent.propTypes = { + item: _propTypes.default.object.isRequired, + onAccordionPress: _propTypes.default.func.isRequired, + style: _propTypes.default.object, + cssItemKey: _propTypes.default.string, + focused: _propTypes.default.bool + }; + var _default = DrawerLabelChevronComponent; + exports.default = _default; +},2286,[5,17,201,1806,2202,699,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function DrawerLabelIconComponent(props) { + var icon = props.icon, + cssItemKey = props.cssItemKey, + size = props.size, + focused = props.focused, + containerStyle = props.style; + var style = { + maxWidth: size, + height: size, + paddingVertical: Math.max((size - _$$_REQUIRE(_dependencyMap[5]).DRAWER_IMAGE_SIZE) / 2, 0) + }; + + var cssIcon = _$$_REQUIRE(_dependencyMap[6]).Css.getStyleObjByCssClasses(["drawer-item-icon"], { + cssKey: cssItemKey, + toggle: true, + active: focused + }); + + if (!icon && !cssIcon.src) { + return null; + } + + var source = icon; + + if (typeof icon === "string") { + source = { + uri: icon, + cache: "reload", + width: _$$_REQUIRE(_dependencyMap[5]).DRAWER_IMAGE_SIZE, + height: _$$_REQUIRE(_dependencyMap[5]).DRAWER_IMAGE_SIZE + }; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["drawer-item-icon-parent"], + cssKey: cssItemKey, + toggle: true, + active: focused + }, _react.default.createElement(_reactNative.View, { + style: [style, containerStyle] + }, _react.default.createElement(_imageIconChooserComponent.default, { + forceRNComponent: true, + style: [{ + backgroundColor: _$$_REQUIRE(_dependencyMap[7]).colors.transparent + }, cssIcon], + source: source, + resizeMode: "contain" + }))); + } + + DrawerLabelIconComponent.propTypes = { + icon: _propTypes.default.any, + cssItemKey: _propTypes.default.string, + size: _propTypes.default.number, + focused: _propTypes.default.bool, + style: _propTypes.default.object + }; + var _default = DrawerLabelIconComponent; + exports.default = _default; +},2287,[5,17,28,201,1970,2039,699,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DrawerLabelTextComponent = DrawerLabelTextComponent; + exports.default = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _IndexHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function getText(item) { + var action = item.action; + var displayName = item.displayName; + + if (action === _IndexHelper.default.SP.values.drawer.actions.open_paywall_account) { + var _global$getRssIndex = global.getRssIndex(), + mustLoginToViewArticle = _global$getRssIndex.mustLoginToViewArticle; + + if (mustLoginToViewArticle) { + var _global$getRSSActiveP = global.getRSSActivePSetup(), + loginStatus = _global$getRSSActiveP.loginStatus; + + if (loginStatus.isLoggedIn() && !loginStatus.isAllowedIPUser()) { + displayName = global.strings("btn_logout"); + } + } + } + + return displayName; + } + + function DrawerLabelTextComponent(props) { + var item = props.item, + style = props.style, + cssItemKey = props.cssItemKey, + focused = props.focused, + upperCase = props.upperCase; + + var _useState = (0, _react.useState)(getText(item)), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + text = _useState2[0], + setText = _useState2[1]; + + if (item.action === _IndexHelper.default.SP.values.drawer.actions.open_paywall_account) { + var userStatusUpdateListener; + (0, _react.useEffect)(function () { + userStatusUpdateListener = _$$_REQUIRE(_dependencyMap[7]).EventRegister.on(_events.default.PAYWALL_USER_STATUS_UPDATE, function (_ref) { + var caption = _ref.caption; + setText(caption); + }); + return function () { + _$$_REQUIRE(_dependencyMap[7]).EventRegister.rm(userStatusUpdateListener); + }; + }, []); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["drawer-item-text"], + cssKey: cssItemKey, + toggle: true, + active: focused + }, _react.default.createElement(_fontText.default, { + type: item.isBold === "1" ? _fontText.Type.bold : _fontText.Type.regular, + style: [style, { + textTransform: upperCase ? "uppercase" : "none" + }], + numberOfLines: 1 + }, text)); + } + + DrawerLabelTextComponent.propTypes = { + item: _propTypes.default.object, + style: _propTypes.default.object, + focused: _propTypes.default.bool, + upperCase: _propTypes.default.bool, + cssItemKey: _propTypes.default.string + }; + var _default = DrawerLabelTextComponent; + exports.default = _default; +},2288,[5,41,17,201,460,1879,1963,572,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + labelParent: { + flex: 1, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "center" + } + }); + + exports.default = _default; +},2289,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _buttonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _updaterScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _sdkUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var UpdaterScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(UpdaterScreen, _NavigationBaseScreen); + + var _super = _createSuper(UpdaterScreen); + + function UpdaterScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, UpdaterScreen); + _this = _super.call(this, props, { + downloading: true, + error: false + }); + _this.onProgress = _this._onProgress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGoBack = _this._onGoBack.bind((0, _assertThisInitialized2.default)(_this)); + _this.restartContext = _this._restartContext.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(UpdaterScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + var manualRestartContext, url, error, bundleFolder, bundleTemporaryPath, bundleDirectory, _await$TecnaviaFileUt, path, respInfo, headers, fileName, undezippedFiles, bundleFilename, bundleName, paperSetupConfig; + + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(UpdaterScreen.prototype), "componentDidMount", this).call(this); + manualRestartContext = this.props.manualRestartContext; + url = _Api.default.getBundleDownloadUrl(); + error = false; + bundleFolder = ""; + bundleTemporaryPath = ""; + bundleDirectory = _tecnaviaFileUtils.default.getBundleDirectory(); + _context.prev = 7; + _context.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(bundleDirectory)); + + case 10: + _context.next = 12; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.fetch(url, { + progressCallback: this.onProgress + })); + + case 12: + _await$TecnaviaFileUt = _context.sent; + path = _await$TecnaviaFileUt.path; + respInfo = _await$TecnaviaFileUt.respInfo; + headers = respInfo.headers; + bundleTemporaryPath = path(); + fileName = _$$_REQUIRE(_dependencyMap[20]).StringUtils.getFilenameFromHeader(headers["Content-Disposition"]).replace(".zip", ""); + bundleFolder = "" + bundleDirectory + fileName + "/"; + _context.next = 21; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(bundleFolder)); + + case 21: + _context.prev = 21; + _context.next = 24; + return _regenerator.default.awrap(this._purge()); + + case 24: + _context.next = 28; + break; + + case 26: + _context.prev = 26; + _context.t0 = _context["catch"](21); + + case 28: + _context.next = 30; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unzip(bundleTemporaryPath, bundleFolder)); + + case 30: + undezippedFiles = _context.sent; + bundleFilename = _tecnaviaFileUtils.default.getBundleFilename(); + bundleName = undezippedFiles.find(function (file) { + return file.includes(bundleFilename); + }); + + if (!bundleName) { + _context.next = 40; + break; + } + + _context.next = 36; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[21]).OurBridge.saveBundleName(bundleFolder + bundleName, _deviceUtils.default.getAppVersion())); + + case 36: + paperSetupConfig = global.getActivePSetup(); + paperSetupConfig.setBundleUpdateAvailable(false); + _context.next = 41; + break; + + case 40: + error = true; + + case 41: + _context.next = 46; + break; + + case 43: + _context.prev = 43; + _context.t1 = _context["catch"](7); + error = true; + + case 46: + _context.prev = 46; + _context.next = 49; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(bundleTemporaryPath)); + + case 49: + _context.next = 53; + break; + + case 51: + _context.prev = 51; + _context.t2 = _context["catch"](46); + + case 53: + if (!error) { + _context.next = 62; + break; + } + + _context.prev = 54; + + if (!(bundleFolder.startsWith(bundleDirectory) && bundleFolder !== bundleDirectory)) { + _context.next = 58; + break; + } + + _context.next = 58; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(bundleFolder)); + + case 58: + _context.next = 62; + break; + + case 60: + _context.prev = 60; + _context.t3 = _context["catch"](54); + + case 62: + if (!error && !manualRestartContext) { + _$$_REQUIRE(_dependencyMap[22]).HintOverlay.show({ + config: { + hint: global.strings("hint_restart"), + key: "hint_bundle_restart", + autoHideTime: 3000, + showAlways: true + }, + onHide: this.restartContext + }); + } else { + this.setState({ + downloading: false, + error: error + }); + } + + case 63: + case "end": + return _context.stop(); + } + } + }, null, this, [[7, 43], [21, 26], [46, 51], [54, 60]], Promise); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + return true; + } + }, { + key: "getTag", + value: function getTag() { + return "Bundle Update Page"; + } + }, { + key: "_purge", + value: function _purge() { + var bundleName, _await$OurBridge$getB, bundlesDirectory, bundleAppVersionName, files, i, path, _path, bundles, j, pathBundle; + + return _regenerator.default.async(function _purge$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.prev = 0; + _context2.next = 3; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[21]).OurBridge.getBundleName()); + + case 3: + _await$OurBridge$getB = _context2.sent; + bundleName = _await$OurBridge$getB.bundleName; + _context2.next = 9; + break; + + case 7: + _context2.prev = 7; + _context2.t0 = _context2["catch"](0); + + case 9: + bundlesDirectory = _tecnaviaFileUtils.default.getBundlesDirectory(); + bundleAppVersionName = _tecnaviaFileUtils.default.getBundleAppVersionName(); + _context2.next = 13; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.getFiles(bundlesDirectory)); + + case 13: + files = _context2.sent; + i = 0; + + case 15: + if (!(i < files.length)) { + _context2.next = 49; + break; + } + + if (!(files[i] !== bundleAppVersionName)) { + _context2.next = 27; + break; + } + + path = bundlesDirectory + "/" + files[i]; + _context2.prev = 18; + _context2.next = 21; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(path)); + + case 21: + _context2.next = 25; + break; + + case 23: + _context2.prev = 23; + _context2.t1 = _context2["catch"](18); + + case 25: + _context2.next = 46; + break; + + case 27: + if (!bundleName) { + _context2.next = 46; + break; + } + + _path = "" + bundlesDirectory + bundleAppVersionName + "/"; + _context2.next = 31; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.getFiles(_path)); + + case 31: + bundles = _context2.sent; + j = 0; + + case 33: + if (!(j < bundles.length)) { + _context2.next = 46; + break; + } + + if (bundleName.includes(bundles[j])) { + _context2.next = 43; + break; + } + + pathBundle = _path + bundles[j]; + _context2.prev = 36; + _context2.next = 39; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(pathBundle)); + + case 39: + _context2.next = 43; + break; + + case 41: + _context2.prev = 41; + _context2.t2 = _context2["catch"](36); + + case 43: + j++; + _context2.next = 33; + break; + + case 46: + i++; + _context2.next = 15; + break; + + case 49: + case "end": + return _context2.stop(); + } + } + }, null, null, [[0, 7], [18, 23], [36, 41]], Promise); + } + }, { + key: "_onProgress", + value: function _onProgress(received, total) { + if (this.progressCircleRef) { + this.progressCircleRef.updateProgress(received / total); + } + } + }, { + key: "_restartContext", + value: function _restartContext() { + if (global.isTaAddon()) { + _sdkUtils.default.onReload(); + } + + _$$_REQUIRE(_dependencyMap[21]).OurBridge.restartReactContext(); + } + }, { + key: "_onGoBack", + value: function _onGoBack() { + var params = (0, _$$_REQUIRE(_dependencyMap[23]).getNavigationParams)(this.props); + + if (params && typeof params.onBack === "function") { + params.onBack(); + } + } + }, { + key: "_renderButton", + value: function _renderButton(text, buttonText, callback) { + var backgroundColor = _newsmemoryUtils.default.getSpinnerColor(); + + var color = _$$_REQUIRE(_dependencyMap[24]).Css.getDefaultForegroundColor(); + + var textColor = _$$_REQUIRE(_dependencyMap[20]).ColorUtils.determineTextColor(backgroundColor); + + return _react.default.createElement(_reactNative.View, { + style: _updaterScreen.default.endParent + }, _react.default.createElement(_fontText.default, { + style: [_updaterScreen.default.text, { + color: color + }] + }, text), _react.default.createElement(_buttonComponent.default, { + style: { + backgroundColor: backgroundColor, + padding: 20 + }, + onPress: callback + }, _react.default.createElement(_fontText.default, { + style: { + color: textColor + } + }, buttonText))); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$state = this.state, + downloading = _this$state.downloading, + error = _this$state.error; + + var color = _$$_REQUIRE(_dependencyMap[24]).Css.getDefaultForegroundColor(); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[24]).Css.getDefaultBackgroundColor(); + + var spinnerColor = _$$_REQUIRE(_dependencyMap[24]).Css.isDarkTheme() ? color : _newsmemoryUtils.default.getSpinnerColor(); + return _react.default.createElement(_reactNative.View, { + style: [_updaterScreen.default.parent, { + backgroundColor: backgroundColor + }] + }, downloading ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).ProgressCircle, { + ref: function ref(_ref) { + _this2.progressCircleRef = _ref; + }, + parentStyle: [_updaterScreen.default.progressParent, { + backgroundColor: backgroundColor + }], + spinnerStyle: _updaterScreen.default.progress, + spinnerColor: spinnerColor, + showText: true, + text: global.strings("msg_download_bundle"), + textStyle: [_updaterScreen.default.progressText, { + color: color + }], + advanced: true + }) : null, !downloading && !error ? this._renderButton(global.strings("msg_press_restart"), global.strings("btn_reload").toUpperCase(), this.restartContext) : null, error ? this._renderButton(global.strings("msg_download_bundle_error"), global.strings("btn_back").toUpperCase(), this.onGoBack) : null); + } + }]); + return UpdaterScreen; + }(_$$_REQUIRE(_dependencyMap[23]).NavigationBaseScreen); + + exports.default = UpdaterScreen; + UpdaterScreen.propTypes = { + manualRestartContext: _propTypes.default.bool + }; + UpdaterScreen.defaultProps = { + manualRestartContext: global.__DEV__ + }; +},2290,[5,80,7,8,15,90,12,14,16,17,201,28,431,574,603,1879,2202,2291,458,1874,462,582,2003,2148,699,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + progressParent: { + flex: 1, + position: "relative", + flexDirection: "column", + justifyContent: "center" + }, + progress: { + flex: 0 + }, + progressText: { + flex: 0, + margin: 10, + textShadowRadius: 0 + }, + parent: { + flex: 1 + }, + text: { + margin: 20, + marginHorizontal: 50 + }, + endParent: { + flex: 1, + justifyContent: "center", + alignItems: "center" + } + }); + + exports.default = _default; +},2291,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _mainNavigator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _LoginManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _barsComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryComponent = function (_NavigatorBaseScreen) { + (0, _inherits2.default)(NewsmemoryComponent, _NavigatorBaseScreen); + + var _super = _createSuper(NewsmemoryComponent); + + function NewsmemoryComponent(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryComponent); + _this = _super.call(this, props); + var screen; + + if (!_this._needToForceIOSClassic()) { + screen = _GlobalConfig.default.getNewsmemoryScreenVersion(); + } + + _this._setNewsmemoryStartupParams(); + + var statusBarColor = _styleUtils.default.getNewsmemoryStatusBarColor(); + + var navigationBarColor = _styleUtils.default.getNewsmemoryNavigationBarColor(); + + _this.state = { + screen: screen, + statusBarColor: statusBarColor, + navigationBarColor: navigationBarColor + }; + return _this; + } + + (0, _createClass2.default)(NewsmemoryComponent, [{ + key: "UNSAFE_componentWillMount", + value: function UNSAFE_componentWillMount() { + var _this2 = this; + + this.onConfigForceUpdate = _$$_REQUIRE(_dependencyMap[15]).EventRegister.on(_events.default.CONFIG_FORCE_UPDATE, function (_ref) { + var message = _ref.message; + + _this2.showHint(message, function () { + _this2.forceUpdate(); + }); + }); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + var screen, classicPubs; + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryComponent.prototype), "componentDidMount", this).call(this); + + if (!this._needToForceIOSClassic()) { + _context.next = 7; + break; + } + + _context.next = 4; + return _regenerator.default.awrap(_LoginManager.default.checkClassicFavorites()); + + case 4: + classicPubs = _context.sent; + + if (classicPubs && classicPubs.length > 0) { + screen = _$$_REQUIRE(_dependencyMap[16]).NEWSMEMORY_SCREENS_NAME.NATIVE; + } else { + screen = _GlobalConfig.default.getNewsmemoryScreenVersion(); + } + + this.setState({ + screen: screen + }); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "didFocus", + value: function didFocus() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryComponent.prototype), "didFocus", this).call(this); + var _this$state = this.state, + statusBarColor = _this$state.statusBarColor, + navigationBarColor = _this$state.navigationBarColor; + + _$$_REQUIRE(_dependencyMap[17]).PlatformUtils.colorBars(statusBarColor, navigationBarColor); + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.emit(_events.default.NEWSMEMORY_DID_FOCUS); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryComponent.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.rm(this.onConfigForceUpdate); + } + }, { + key: "_needToForceIOSClassic", + value: function _needToForceIOSClassic() { + var _global$getMainPSetup = global.getMainPSetup(), + newsmemoryToUse = _global$getMainPSetup.newsmemoryToUse, + disableRnDemo = _global$getMainPSetup.disableRnDemo; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + useRnDemo = _global$getNewsmemory.useRnDemo; + + return _$$_REQUIRE(_dependencyMap[17]).PlatformUtils.isIOS() && _$$_REQUIRE(_dependencyMap[18]).PaperSetupManager.isGenericAppConfigured() && newsmemoryToUse === _$$_REQUIRE(_dependencyMap[16]).NEWSMEMORY_SCREENS.REACT && (disableRnDemo || useRnDemo === ""); + } + }, { + key: "_setNewsmemoryStartupParams", + value: function _setNewsmemoryStartupParams() { + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[19]).getNavigationParams)(this.props), + _getNavigationParams$ = _getNavigationParams.isFromRss, + isFromRss = _getNavigationParams$ === undefined ? false : _getNavigationParams$, + issue = _getNavigationParams.issue, + edition = _getNavigationParams.edition; + + if (isFromRss) { + global.updateNewsmemoryStartupParams({ + issue: issue, + edition: edition + }); + } + } + }, { + key: "render", + value: function render() { + var params = (0, _$$_REQUIRE(_dependencyMap[19]).getNavigationParams)(this.props); + var _this$state2 = this.state, + screen = _this$state2.screen, + statusBarColor = _this$state2.statusBarColor, + navigationBarColor = _this$state2.navigationBarColor; + + if (screen) { + var Component; + var edges = ["top", "left", "right", "bottom"]; + + var Navigator = _react.default.createElement(_mainNavigator.default, { + tab: params.tab || "", + startupNewsmemoryScreen: screen + }); + + if (_$$_REQUIRE(_dependencyMap[17]).PlatformUtils.isIOS() && screen === _$$_REQUIRE(_dependencyMap[16]).NEWSMEMORY_SCREENS_NAME.NATIVE) { + edges = ["top"]; + Component = Navigator; + } else { + Component = _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).TecnaviaSafeAreaView, { + edges: edges, + backgroundColor: statusBarColor + }, Navigator); + } + + return _react.default.createElement(_react.default.Fragment, null, Component, _react.default.createElement(_barsComponent.default, { + edges: edges, + statusBarColor: statusBarColor, + navigationBarColor: navigationBarColor + })); + } + + return null; + } + }]); + return NewsmemoryComponent; + }(_$$_REQUIRE(_dependencyMap[21]).NavigatorBaseScreen); + + exports.default = NewsmemoryComponent; +},2292,[5,80,7,8,90,12,14,16,17,460,2293,2057,2147,2145,2154,572,717,462,1849,2148,2146,2468]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = NewsmemoryNavigator; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _webScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var CommonHeader = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _landingPageScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _UserSettingsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _epaperModeSelectionScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Stack = _NavigationService.default.navigator.createStack(); + + function _checkLandingPageRules() { + var _global$getMainPSetup = global.getMainPSetup(), + showLandingPageOnce = _global$getMainPSetup.showLandingPageOnce, + landingPageVersion = _global$getMainPSetup.landingPageVersion, + landingPageURL = _global$getMainPSetup.landingPageURL; + + var _global$getUserSettin = global.getUserSettings(), + landingPageVersionSeen = _global$getUserSettin.landingPageVersionSeen, + landingPageDontShowAgain = _global$getUserSettin.landingPageDontShowAgain; + + var landingPageFirstTime = landingPageVersionSeen === -1; + var landingPageAlreadySeen = !showLandingPageOnce && !landingPageDontShowAgain && landingPageVersionSeen > -1; + var landingPageUpdate = landingPageVersion > landingPageVersionSeen; + + if (landingPageURL && (landingPageUpdate || landingPageAlreadySeen || landingPageFirstTime)) { + global.getUserSettings().setValue(_UserSettingsHelper.default.SP.keys.landing_page_version_seen, "" + landingPageVersion); + global.getUserSettings().setValue(_UserSettingsHelper.default.SP.keys.landing_page_dont_show_again, "0"); + return true; + } + + return false; + } + + function _getInitialRouteName(startupNewsmemoryScreen) { + var screen = startupNewsmemoryScreen; + + if (_checkLandingPageRules()) { + screen = "LandingPageScreen"; + } + + return screen; + } + + var SHORTCUT_ENABLE_SCREENS = [_$$_REQUIRE(_dependencyMap[10]).NEWSMEMORY_SCREENS_NAME.REACT]; + + function NewsmemoryNavigator(props) { + var startupNewsmemoryScreen = props.startupNewsmemoryScreen, + tab = props.tab; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).CustomNavigationContainer, { + independent: true + }, _react.default.createElement(Stack.Navigator, { + screenOptions: (0, _extends2.default)({ + gestureEnabled: false + }, _NavigationService.default.getStackScreenOptions()), + initialRouteName: _getInitialRouteName(startupNewsmemoryScreen), + screenListeners: { + state: function state(_ref) { + var data = _ref.data; + + var name = _navigationUtils.default.getActiveRouteFromState(data.state); + + if (name && !SHORTCUT_ENABLE_SCREENS.includes(name)) { + _$$_REQUIRE(_dependencyMap[12]).ShortcutManager.disable(); + } else { + _$$_REQUIRE(_dependencyMap[12]).ShortcutManager.enable(); + } + } + } + }, _react.default.createElement(Stack.Screen, { + name: "LandingPageScreen", + options: { + headerShown: false, + headerTransparent: true, + gesturesEnabled: false + } + }, function (navProps) { + return _react.default.createElement(_landingPageScreen.default, (0, _extends2.default)({}, navProps, { + destinationScreen: startupNewsmemoryScreen + })); + }), _react.default.createElement(Stack.Screen, { + name: "EpaperModeSelectionScreen", + component: _epaperModeSelectionScreen.default, + options: { + headerShown: false, + headerTransparent: true, + gesturesEnabled: false + } + }), _react.default.createElement(Stack.Screen, { + name: _$$_REQUIRE(_dependencyMap[10]).NEWSMEMORY_SCREENS_NAME.REACT, + options: { + headerShown: false, + headerTransparent: true, + gesturesEnabled: false + } + }, function (navProps) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).NewsmemoryScreen, (0, _extends2.default)({}, navProps, { + tab: tab + })); + }), _react.default.createElement(Stack.Screen, { + name: "GeneralSettingsScreen", + component: _$$_REQUIRE(_dependencyMap[14]).GeneralSettingsScreen, + options: function options(navProps) { + return { + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + left: CommonHeader._getHeaderLeftButtonsBackButtonOnly(navProps), + center: CommonHeader._getLogo(), + right: CommonHeader._getEmptyPlaceHolders() + }); + }, + gesturesEnabled: false + }; + } + }), _react.default.createElement(Stack.Screen, { + name: _$$_REQUIRE(_dependencyMap[10]).NEWSMEMORY_SCREENS_NAME.HTML5, + component: _$$_REQUIRE(_dependencyMap[15]).NewsmemoryHTML5Screen, + options: function options(_ref2) { + var navProps = _ref2.navProps; + return { + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + left: CommonHeader._getHeaderLeftButtonsBackButtonOnly(navProps, function () { + _NavigationService.default.main.reset("RssNavigator"); + }), + center: CommonHeader._getLogo(), + right: CommonHeader._getEmptyPlaceHolders() + }); + }, + gesturesEnabled: false + }; + } + }), _react.default.createElement(Stack.Screen, { + name: _$$_REQUIRE(_dependencyMap[10]).NEWSMEMORY_SCREENS_NAME.NATIVE, + options: { + headerShown: false, + gestureEnabled: false + } + }, function (navProps) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).NewsmemoryNativeScreen, (0, _extends2.default)({}, navProps, { + tab: tab + })); + }), _react.default.createElement(Stack.Screen, { + name: "WebScreen", + options: function options(navProps) { + return { + headerStyle: CommonHeader._getStyle(navProps), + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + left: CommonHeader._getHeaderLeftButtonsBackButtonOnly(navProps), + center: CommonHeader._getLogo(navProps), + right: CommonHeader._getSharedHeaderRightButton(navProps) + }); + }, + gesturesEnabled: false + }; + } + }, function (navProps) { + return _react.default.createElement(_webScreen.default, (0, _extends2.default)({}, navProps, { + considerSafeArea: false + })); + }), _react.default.createElement(Stack.Screen, { + name: "GalleryScreen", + component: _$$_REQUIRE(_dependencyMap[17]).GalleryScreen, + options: { + headerShown: false, + gestureEnabled: false + } + }))); + } +},2293,[5,6,17,2294,2144,1861,2295,2078,2296,2045,717,2302,1911,2303,2232,2431,2433,2434]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _webUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Paywall = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _barsComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _sdkUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _keyboardAvoidingComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var WebScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(WebScreen, _NavigationBaseScreen); + + var _super = _createSuper(WebScreen); + + function WebScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, WebScreen); + _this = _super.call(this, props); + _this.canGoBack = false; + _this.state = { + url: "", + external: false, + ignoreUrls: [], + ronDinoWebView: false + }; + _this.onLoadStart = _this._onLoadStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLocal = _this._onLocal.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onNavigationStateChange = _this._onNavigationStateChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onUserStatusUpdate = _this._onUserStatusUpdate.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(WebScreen, [{ + key: "getTag", + value: function getTag() { + var prefix = ""; + + if (_LiveConfig.default.isEpaperSide()) { + prefix = "ePaper "; + } else if (_LiveConfig.default.isRssSide()) { + prefix = "Live News "; + } + + return prefix + "In App Browser"; + } + }, { + key: "didFocus", + value: function didFocus() { + var navigation, params, url, external, _global$getMainPSetup, ronDinoWebView, ignoreUrls, _params$extra, extra, aak, isExternalLinkAccountURL; + + return _regenerator.default.async(function didFocus$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(WebScreen.prototype), "didFocus", this).call(this); + this.onPaywallUserStatusUpdate = _$$_REQUIRE(_dependencyMap[20]).EventRegister.on(_events.default.PAYWALL_USER_STATUS_UPDATE, this.onUserStatusUpdate); + navigation = this.props.navigation; + params = (0, _$$_REQUIRE(_dependencyMap[21]).getNavigationParams)(this.props); + url = params.url; + + if (!(typeof url === "string")) { + _context.next = 33; + break; + } + + external = _webUtils.default.isExternalUrl(url); + + if (external) { + if (url.startsWith("xhttp")) { + url = url.substr(1); + } + + url = _$$_REQUIRE(_dependencyMap[22]).StringUtils.removeParams(url, ["xhttp", "xhttps"]); + } else if (url.startsWith("http://")) { + _global$getMainPSetup = global.getMainPSetup(); + external = _global$getMainPSetup.openHttpLinkOnExternalBrowser; + } + + if (!_$$_REQUIRE(_dependencyMap[22]).StringUtils.isUrl(url)) { + url = _$$_REQUIRE(_dependencyMap[22]).StringUtils.removeProtocolFromURL(url); + } + + url = _$$_REQUIRE(_dependencyMap[22]).NetworkUtils.addDefaultProtocol(url); + + if (_$$_REQUIRE(_dependencyMap[22]).StringUtils.isUrl(url)) { + _context.next = 15; + break; + } + + _$$_REQUIRE(_dependencyMap[23]).Toast.show(global.strings("system_error")); + + this.handleBackButton(); + _context.next = 31; + break; + + case 15: + ronDinoWebView = false; + ignoreUrls = []; + _params$extra = params.extra, extra = _params$extra === undefined ? undefined : _params$extra; + url = _Paywall.default.replaceExtIdInUrl(url); + + if (extra) { + aak = extra.ronDinoPromotionsAAK; + + if (aak) { + ronDinoWebView = true; + url = _$$_REQUIRE(_dependencyMap[22]).StringUtils.appendParams(url, { + aak: aak + }); + ignoreUrls.push("https://www.bing.com"); + } + } + + _context.next = 22; + return _regenerator.default.awrap(_sdkUtils.default.willOpenURL(url)); + + case 22: + if (!_context.sent) { + _context.next = 27; + break; + } + + external = true; + navigation.goBack(null); + _context.next = 30; + break; + + case 27: + isExternalLinkAccountURL = _tecnaviaPlatformUtils.default.externalLinkAccountCheck(url); + external = external || isExternalLinkAccountURL; + + if (external) { + navigation.goBack(null); + + _tecnaviaPlatformUtils.default.openURL(url); + } + + case 30: + this.setState({ + external: external, + url: url, + ronDinoWebView: ronDinoWebView, + ignoreUrls: ignoreUrls + }); + + case 31: + _context.next = 35; + break; + + case 33: + _$$_REQUIRE(_dependencyMap[23]).Toast.show(global.strings("system_error")); + + this.handleBackButton(); + + case 35: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "willBlur", + value: function willBlur() { + (0, _get2.default)((0, _getPrototypeOf2.default)(WebScreen.prototype), "willBlur", this).call(this); + + _$$_REQUIRE(_dependencyMap[20]).EventRegister.rm(this.onPaywallUserStatusUpdate); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(WebScreen.prototype), "componentWillUnmount", this).call(this); + var params = (0, _$$_REQUIRE(_dependencyMap[21]).getNavigationParams)(this.props); + + if (params && typeof params.onClose === "function") { + params.onClose(); + } + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(WebScreen.prototype), "handleBackButton", this).call(this); + + if (this.webview && this.canGoBack) { + this.webview.goBack(); + } else { + this.props.navigation.goBack(null); + } + + return true; + } + }, { + key: "_onUserStatusUpdate", + value: function _onUserStatusUpdate() { + var params = (0, _$$_REQUIRE(_dependencyMap[21]).getNavigationParams)(this.props); + var url = params.url; + + var newUrl = _Paywall.default.replaceExtIdInUrl(url); + + if (url !== newUrl) { + this.setState({ + url: newUrl + }); + } + } + }, { + key: "_onLocal", + value: function _onLocal(segments) { + if (segments !== undefined) { + switch (segments.domain) { + case "xc_tecnaviaPaywallLogIn": + _Paywall.default.account(); + + break; + } + } + } + }, { + key: "_onLayout", + value: function _onLayout(_ref) { + var nativeEvent = _ref.nativeEvent; + this.layout = nativeEvent.layout; + } + }, { + key: "_onNavigationStateChange", + value: function _onNavigationStateChange(navState) { + this.canGoBack = navState.canGoBack; + } + }, { + key: "_onLoadStart", + value: function _onLoadStart() { + var ronDinoWebView = this.props.ronDinoWebView; + + if (ronDinoWebView && this.webview && this.layout) { + var width = this.layout.width; + this.webview.injectJavaScript(_webUtils.default.getRonDinoViewPort(width)); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$state = this.state, + external = _this$state.external, + url = _this$state.url, + ignoreUrls = _this$state.ignoreUrls; + + if (external) { + return null; + } + + var considerSafeArea = this.props.considerSafeArea; + + var Component = _react.default.createElement(_keyboardAvoidingComponent.default, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).BaseWebView, { + innerRef: function innerRef(ref) { + _this2.webview = ref; + }, + onLocal: this.onLocal, + onLayout: this.onLayout, + onNavigationStateChange: this.onNavigationStateChange, + browser: true, + onLoadStart: this.onLoadStart, + ignoreUrls: ignoreUrls, + source: { + uri: url + }, + progressType: _$$_REQUIRE(_dependencyMap[24]).BaseWebView.ProgressTypes.bar + })); + + if (considerSafeArea) { + var edges = ["left", "right", "bottom"]; + + var navigationBarColor = _styleUtils.default.getNavigationBarColor() || _$$_REQUIRE(_dependencyMap[22]).colors.white; + + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).TecnaviaSafeAreaView, { + edges: edges + }, Component), _react.default.createElement(_barsComponent.default, { + edges: edges, + navigationBarColor: navigationBarColor + })); + } + + return Component; + } + }]); + return WebScreen; + }(_$$_REQUIRE(_dependencyMap[21]).NavigationBaseScreen); + + exports.default = WebScreen; + WebScreen.propTypes = { + navigation: _propTypes.default.object.isRequired, + considerSafeArea: _propTypes.default.bool + }; + WebScreen.defaultProps = { + considerSafeArea: true + }; +},2294,[5,80,7,8,15,90,12,14,16,17,201,719,1862,460,2145,2147,1876,1874,1870,1872,572,2148,462,1889,1894,2146]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _UserSettingsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var LandingPageScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(LandingPageScreen, _NavigationBaseScreen); + + var _super = _createSuper(LandingPageScreen); + + function LandingPageScreen() { + (0, _classCallCheck2.default)(this, LandingPageScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(LandingPageScreen, [{ + key: "getTag", + value: function getTag() { + return "Landing Page"; + } + }, { + key: "_dontShowAgain", + value: function _dontShowAgain(value) { + global.getUserSettings().setValue(_UserSettingsHelper.default.SP.keys.landing_page_dont_show_again, value); + } + }, { + key: "render", + value: function render() { + var _this = this; + + var _this$props = this.props, + navigation = _this$props.navigation, + destinationScreen = _this$props.destinationScreen; + + var _global$getMainPSetup = global.getMainPSetup(), + landingPageURL = _global$getMainPSetup.landingPageURL; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).BaseWebView, { + innerRef: function innerRef(ref) { + _this.webview = ref; + }, + onLocal: function onLocal(_ref) { + var domain = _ref.domain, + getParams = _ref.getParams; + + switch (domain) { + case "xc_doNotShowLandingPageAnymore": + _this._dontShowAgain(getParams.doNotShow === "true" ? "1" : "0"); + + break; + + case "xc_closeLandingPage": + navigation.navigate(destinationScreen); + break; + } + }, + source: { + uri: landingPageURL + } + }); + } + }]); + return LandingPageScreen; + }(_$$_REQUIRE(_dependencyMap[9]).NavigationBaseScreen); + + exports.default = LandingPageScreen; +},2295,[5,7,8,12,14,16,17,2078,1894,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _webUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EpaperModeSelectionScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(EpaperModeSelectionScreen, _NavigationBaseScreen); + + var _super = _createSuper(EpaperModeSelectionScreen); + + function EpaperModeSelectionScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, EpaperModeSelectionScreen); + _this = _super.call(this, props, {}); + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRef = _this._onRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoadEnd = _this._onLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onClose = _this._onClose.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(EpaperModeSelectionScreen, [{ + key: "getTag", + value: function getTag() { + return "ePaper Mode Selection"; + } + }, { + key: "_onMessage", + value: function _onMessage(message) { + var sources, newSources, i, _StringUtils$segmentU, domain, icon, base64; + + return _regenerator.default.async(function _onMessage$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!(message.type === "GET_RESOURCES")) { + _context.next = 21; + break; + } + + sources = message.content; + newSources = {}; + i = 0; + + case 4: + if (!(i < sources.length)) { + _context.next = 20; + break; + } + + _StringUtils$segmentU = _$$_REQUIRE(_dependencyMap[15]).StringUtils.segmentUrl(sources[i]), domain = _StringUtils$segmentU.domain; + icon = global.getEpaperLayoutConfig().getIconByAction(domain); + + if (!icon) { + _context.next = 17; + break; + } + + _context.prev = 8; + _context.next = 11; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[16]).getBase64)({ + type: icon.getLibrary(), + name: icon.getIcon(), + source: icon.getIcon(), + size: 50 + })); + + case 11: + base64 = _context.sent; + newSources[sources[i]] = base64; + _context.next = 17; + break; + + case 15: + _context.prev = 15; + _context.t0 = _context["catch"](8); + + case 17: + i++; + _context.next = 4; + break; + + case 20: + if (this.webview) { + this.webview._execJavaScript(_webUtils.default.replaceResourcesInPage(newSources)); + } + + case 21: + case "end": + return _context.stop(); + } + } + }, null, this, [[8, 15]], Promise); + } + }, { + key: "_onRef", + value: function _onRef(ref) { + this.webview = ref; + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd() { + if (this.webview) { + this.webview._execJavaScript(_webUtils.default.getImagesInsidePage()); + } + } + }, { + key: "_onClose", + value: function _onClose() { + var navigation = this.props.navigation; + + if (navigation) { + navigation.goBack(); + } + } + }, { + key: "render", + value: function render() { + var _global$getNewsmemory = global.getNewsmemoryConfig(), + epaperStartMode = _global$getNewsmemory.epaperStartMode; + + var params = (0, _extends2.default)({}, _Api.default.getDefaultParams(), _NewsmemoryAJAX.default.getDefaultGETParams(), { + action: "epaperMode", + mode: epaperStartMode + }); + + var uri = "" + _NewsmemoryAJAX.default.baseUrl(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).TecnaviaSafeAreaView, { + style: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[15]).colors.black + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[18]).Css, { + classes: ["epaper-mode-selection"] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[15]).colors.white + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).BaseOptionspage, { + forceFullscreen: true, + ref: this.onRef, + onMessage: this.onMessage, + onTabLoaded: this.onLoadEnd, + onClose: this.onClose, + url: uri, + closeType: _$$_REQUIRE(_dependencyMap[20]).closeTypes.none, + getParams: params + })))); + } + }]); + return EpaperModeSelectionScreen; + }(_$$_REQUIRE(_dependencyMap[21]).NavigationBaseScreen); + + exports.default = EpaperModeSelectionScreen; +},2296,[5,80,6,7,8,15,12,14,16,17,28,719,431,430,1859,462,1970,2146,699,2297,730,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.BaseOptionspage = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _optionspageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _LoginManager = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _IAPHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _settingDebug = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _closeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _keyboardAvoidingComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var BaseOptionspage = function (_Shortcut) { + (0, _inherits2.default)(BaseOptionspage, _Shortcut); + + var _super = _createSuper(BaseOptionspage); + + function BaseOptionspage(props) { + var _this; + + (0, _classCallCheck2.default)(this, BaseOptionspage); + _this = _super.call(this, props); + var _this$props = _this.props, + tab = _this$props.tab, + url = _this$props.url, + getParams = _this$props.getParams, + closeType = _this$props.closeType, + forceFullscreen = _this$props.forceFullscreen; + + var otherParams = _this._appendOthersParams(getParams); + + var uri = tab ? _optionspageUtils.default.getTabUrl(tab, otherParams) : null; + + if (!uri) { + uri = url ? _optionspageUtils.default.getCustomUrl(url, otherParams) : null; + } + + _this.canGoBack = false; + _this.openTab = _this._openTab.bind((0, _assertThisInitialized2.default)(_this)); + _this.handleLocals = _this._handleLocals.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoading = _this._onLoading.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoadEnd = _this._onLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onError = _this._onError.bind((0, _assertThisInitialized2.default)(_this)); + _this.cancel = _this._cancel.bind((0, _assertThisInitialized2.default)(_this)); + _this.reload = _this._reload.bind((0, _assertThisInitialized2.default)(_this)); + _this.close = _this._close.bind((0, _assertThisInitialized2.default)(_this)); + _this.retries = 0; + _this.state = { + uri: uri, + closeType: closeType || _optionspageUtils.closeTypes.close, + forceFullscreen: forceFullscreen, + hidden: false + }; + return _this; + } + + (0, _createClass2.default)(BaseOptionspage, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(BaseOptionspage.prototype), "componentDidMount", this).call(this); + this.openActionListener = _$$_REQUIRE(_dependencyMap[23]).EventRegister.on(_events.default.OPEN_OPTIONSPAGE, this.openTab); + this.closeActionListener = _$$_REQUIRE(_dependencyMap[23]).EventRegister.on(_events.default.CLOSE_OPTIONSPAGE, function () { + _this2.close(true); + }); + this.onStateChangeForeground = _$$_REQUIRE(_dependencyMap[23]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_FOREGROUND, function () { + var uri = _this2.state.uri; + + if (_$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline() && _this2.webview && uri !== null) { + var currentTab = _optionspageUtils.default.getTabByURL(_this2.currentUrl); + + if (currentTab && currentTab !== _optionspageUtils.tabs.login && currentTab !== _optionspageUtils.tabs.access && currentTab !== _optionspageUtils.tabs.account) { + _this2.reload(); + } + } + }); + this.orientationListener = _$$_REQUIRE(_dependencyMap[23]).EventRegister.on(_events.default.ON_ORIENTATION_CHANGE, function (_ref) { + var orientation = _ref.orientation; + + _this2.forceUpdate(function () { + var angle = 0; + + if (orientation === _$$_REQUIRE(_dependencyMap[24]).PlatformUtils.LANDSCAPE) { + angle = 90; + } else if (orientation === _$$_REQUIRE(_dependencyMap[24]).PlatformUtils.PORTRAIT_UP_SIDE_DOWN) { + angle = 180; + } + + _this2._execJavaScript("xcj_rotateWindow(" + angle + ");"); + }); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(BaseOptionspage.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[23]).EventRegister.rm(this.openActionListener); + + _$$_REQUIRE(_dependencyMap[23]).EventRegister.rm(this.closeActionListener); + + _$$_REQUIRE(_dependencyMap[23]).EventRegister.rm(this.onStateChangeForeground); + + _$$_REQUIRE(_dependencyMap[23]).EventRegister.rm(this.orientationListener); + } + }, { + key: "getTag", + value: function getTag() { + return "Options Page"; + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var _this$state = this.state, + uri = _this$state.uri, + hidden = _this$state.hidden; + + if (uri && !hidden) { + var ANY = _$$_REQUIRE(_dependencyMap[25]).KEY_GROUPS.ANY, + CLOSE = _$$_REQUIRE(_dependencyMap[25]).KEY_GROUPS.CLOSE; + + return [{ + callback: this.close, + keys: CLOSE, + stopPropagation: true + }, { + callback: this.noop, + keys: ANY, + stopPropagation: true + }]; + } + + return []; + } + }, { + key: "_openTab", + value: function _openTab(_ref2) { + var tab = _ref2.tab, + getParams = _ref2.getParams, + url = _ref2.url, + closeType = _ref2.closeType, + forceFullscreen = _ref2.forceFullscreen, + hidden = _ref2.hidden; + + var isOnline = _$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline(); + + if (isOnline) { + try { + var uri = url ? _optionspageUtils.default.getCustomUrl(url, getParams) : _optionspageUtils.default.getTabUrl(tab, this._appendOthersParams(getParams)); + this.setState({ + uri: uri, + closeType: closeType, + forceFullscreen: forceFullscreen, + hidden: hidden + }); + } catch (e) { + _$$_REQUIRE(_dependencyMap[26]).Toast.show(global.strings("system_error")); + } + } else { + _reactNative.Alert.alert("", global.strings("err_offline")); + } + } + }, { + key: "goToRssNavigator", + value: function goToRssNavigator() { + _NavigationService.default.main.reset("RssNavigator"); + } + }, { + key: "goToNewsMemoryNavigator", + value: function goToNewsMemoryNavigator() { + _NavigationService.default.main.reset("NewsmemoryNavigator"); + } + }, { + key: "_goBack", + value: function _goBack() { + this.setState({ + uri: null + }); + } + }, { + key: "_appendOthersParams", + value: function _appendOthersParams() { + var getParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return getParams; + } + }, { + key: "_cancel", + value: function _cancel() { + this.close(true); + } + }, { + key: "_reload", + value: function _reload() { + if (this.webview) { + this.webview.reload(); + } + } + }, { + key: "_close", + value: function _close(force) { + this.setState({ + uri: null + }); + } + }, { + key: "postMessage", + value: function postMessage(js) { + if (this.webview) { + this.webview.injectJavaScript("try{ window.ReactNativeWebView.postMessage(JSON.stringify(" + js + ")); }catch(e){console.log(e.message)}"); + } + } + }, { + key: "_onMessage", + value: function _onMessage(data) { + var onMessage = this.props.onMessage; + + if (data.title) { + var currentTab = _optionspageUtils.default.getTabByURL(this.currentUrl); + + if (currentTab) { + (0, _$$_REQUIRE(_dependencyMap[27]).sendNewsmemoryOptionspage)(currentTab, data.title); + } + } else if (typeof onMessage === "function") { + onMessage(data); + } + } + }, { + key: "_onError", + value: function _onError(nativeEvent) { + if (this.retries === 0) { + this.retries++; + this.reload(); + } else { + this.retries = 0; + var buttons = []; + buttons.push({ + text: global.strings("btn_cancel"), + onPress: this.cancel + }, { + text: global.strings("retry"), + onPress: this.reload + }); + + _reactNative.Alert.alert("", global.strings("system_error"), buttons, { + cancelable: false + }); + } + } + }, { + key: "_handleLocals", + value: function _handleLocals(_ref3) { + var _this3 = this; + + var domain, getParams, newsmemoryConfig, url, callback, close, extraNavigationParams, title, message, okLabel, buttons, _title, _message, _okLabel, cancelLabel, _callback, _buttons, _global$getUsedSpace, usedSpace, numberOfPapersDirs, numberOfIssuesDirs, numberOfPagesDirs, key, _global$getActivePSet, loginStatus, udb, loginStatusValue, value, _key, _value, _callback2, _key2, _key3, _value2, pSetup, machine, username, password, challenge, remember, TAUID, token, TOKEN, extid, tokenToUse, result, params, jsCode, home, data, paperName, _username, _password, extra, _paperName, _username2, _password2, _extra, _await$LoginManager$c, usernameValue, passwordValue, extraValue, show; + + return _regenerator.default.async(function _handleLocals$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + domain = _ref3.domain, getParams = _ref3.getParams; + newsmemoryConfig = global.getNewsmemoryConfig(); + + if (!domain.includes(_optionspageUtils.locals.OPEN_RSS)) { + _context.next = 6; + break; + } + + this.goToRssNavigator(); + _context.next = 141; + break; + + case 6: + if (!domain.includes(_optionspageUtils.locals.OPEN_TAB_HOME)) { + _context.next = 10; + break; + } + + this._resetToHome(); + + _context.next = 141; + break; + + case 10: + if (!(domain.includes(_optionspageUtils.locals.CLOSE) || domain.includes(_optionspageUtils.locals.CLOSE_WINDOW))) { + _context.next = 14; + break; + } + + this._close(true); + + _context.next = 141; + break; + + case 14: + if (!domain.includes(_optionspageUtils.locals.GO_BACK)) { + _context.next = 18; + break; + } + + this._goBack(); + + _context.next = 141; + break; + + case 18: + if (!(domain.includes(_optionspageUtils.locals.OPEN_BROWSER) || domain.includes(_optionspageUtils.locals.OPEN_BROWSER_ALT))) { + _context.next = 25; + break; + } + + url = getParams.url, callback = getParams.callback, close = getParams.close; + + if (url) { + extraNavigationParams = {}; + + if (url.indexOf("archiveSearch=1") !== -1) { + extraNavigationParams.screenTitle = global.strings("btn_archive"); + extraNavigationParams.isArchive = true; + } + + _NavigationService.default.main.navigate("WebScreen", (0, _extends2.default)({ + url: url, + onClose: function onClose() { + _$$_REQUIRE(_dependencyMap[24]).PlatformUtils.colorBars(); + } + }, extraNavigationParams)); + } + + if (callback) { + this._execJavaScript(callback + "();"); + } + + if (close && close === "1") { + this._close(true); + } + + _context.next = 141; + break; + + case 25: + if (!domain.includes(_optionspageUtils.locals.ALERT)) { + _context.next = 32; + break; + } + + title = getParams.title, message = getParams.message, okLabel = getParams.okLabel; + buttons = []; + buttons.push({ + text: okLabel || global.strings("btn_ok") + }); + + _reactNative.Alert.alert(title, message, buttons, { + cancelable: false + }); + + _context.next = 141; + break; + + case 32: + if (!domain.includes(_optionspageUtils.locals.CONFIRM)) { + _context.next = 39; + break; + } + + _title = getParams.title, _message = getParams.message, _okLabel = getParams.okLabel, cancelLabel = getParams.cancelLabel, _callback = getParams.callback; + _buttons = []; + + _buttons.push({ + text: cancelLabel || global.strings("btn_cancel"), + onPress: function onPress() { + _this3._confirmResult(_callback, false); + } + }, { + text: _okLabel || global.strings("btn_ok"), + onPress: function onPress() { + _this3._confirmResult(_callback, true); + } + }); + + _reactNative.Alert.alert(_title, _message, _buttons, { + cancelable: false + }); + + _context.next = 141; + break; + + case 39: + if (!domain.includes(_optionspageUtils.locals.GET_USED_SPACE)) { + _context.next = 46; + break; + } + + _context.next = 42; + return _regenerator.default.awrap(global.analyzeUsedSpace()); + + case 42: + _global$getUsedSpace = global.getUsedSpace(), usedSpace = _global$getUsedSpace.usedSpace, numberOfPapersDirs = _global$getUsedSpace.numberOfPapersDirs, numberOfIssuesDirs = _global$getUsedSpace.numberOfIssuesDirs, numberOfPagesDirs = _global$getUsedSpace.numberOfPagesDirs; + + this._execJavaScript("xcj_getIssuesUsedSpaceResult(" + usedSpace + "," + numberOfPapersDirs + "," + numberOfIssuesDirs + "," + numberOfPagesDirs + ");"); + + _context.next = 141; + break; + + case 46: + if (!domain.includes(_optionspageUtils.locals.GET_CONFIG_DUMP)) { + _context.next = 50; + break; + } + + this._execJavaScript("xcj_getConfigDump('" + JSON.stringify(newsmemoryConfig) + "');"); + + _context.next = 141; + break; + + case 50: + if (!domain.includes(_optionspageUtils.locals.GET_KEY)) { + _context.next = 69; + break; + } + + key = getParams.key; + + if (!key) { + _context.next = 67; + break; + } + + _global$getActivePSet = global.getActivePSetup(), loginStatus = _global$getActivePSet.loginStatus, udb = _global$getActivePSet.udb; + loginStatusValue = ""; + + if (!key.startsWith(udb)) { + _context.next = 59; + break; + } + + _context.next = 58; + return _regenerator.default.awrap(loginStatus.getValue(key.replace(udb + "_", ""))); + + case 58: + loginStatusValue = _context.sent; + + case 59: + _context.t0 = loginStatusValue; + + if (_context.t0) { + _context.next = 64; + break; + } + + _context.next = 63; + return _regenerator.default.awrap(newsmemoryConfig.getValue(key)); + + case 63: + _context.t0 = _context.sent; + + case 64: + value = _context.t0; + + if (typeof value === "string") { + value = "'" + value + "'"; + } + + this._execJavaScript("xcj_getFromKey(" + value + ",'" + key + "');"); + + case 67: + _context.next = 141; + break; + + case 69: + if (!domain.includes(_optionspageUtils.locals.SET_KEY)) { + _context.next = 75; + break; + } + + _key = getParams.key, _value = getParams.value, _callback2 = getParams.callback; + newsmemoryConfig.setValue(_key, _value); + + if (_callback2) { + this._execJavaScript(_callback2 + "();"); + } + + _context.next = 141; + break; + + case 75: + if (!domain.includes(_optionspageUtils.locals.REMOVE_KEY)) { + _context.next = 80; + break; + } + + _key2 = getParams.key; + newsmemoryConfig.removeValue(_key2); + _context.next = 141; + break; + + case 80: + if (!domain.includes(_optionspageUtils.locals.SET_PREF_EDI)) { + _context.next = 85; + break; + } + + _key3 = getParams.key, _value2 = getParams.value; + newsmemoryConfig.setValue(_key3, _value2); + _context.next = 141; + break; + + case 85: + if (!domain.includes(_optionspageUtils.locals.RETURN_FROM_LOGIN)) { + _context.next = 98; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[27]).sendNewsmemoryLoginEvent)("start login"); + + if (this.baseRef) { + this.baseRef.showLoading(); + } + + pSetup = getParams.pSetup, machine = getParams.machine, username = getParams.username, password = getParams.password, challenge = getParams.challenge, remember = getParams.remember, TAUID = getParams.TAUID, token = getParams.token, TOKEN = getParams.TOKEN, extid = getParams.extid; + tokenToUse = token; + + if (TOKEN) { + tokenToUse = TOKEN; + } + + _context.next = 93; + return _regenerator.default.awrap(_LoginManager.default.login({ + pSetup: pSetup, + machine: machine, + username: username, + password: password, + challenge: challenge, + remember: remember, + TAUID: TAUID, + token: tokenToUse, + extid: extid + })); + + case 93: + result = _context.sent; + + if (result && result.data) { + this._execJavaScript("xcj_loginResults(" + result.TAUID + ",'" + JSON.stringify(result.data) + "');"); + } else { + params = this.props.getParams; + home = _optionspageUtils.default.getTabUrl(_optionspageUtils.tabs.home, this._appendOthersParams(params)); + + if (username === global.machineId && this.currentUrl && _optionspageUtils.default.isSamePage(this.currentUrl, home)) { + data = { + protError: 0, + pSetup: pSetup + }; + jsCode = "xcj_loginResults(" + TAUID + ",'" + JSON.stringify(data) + "');"; + } else { + jsCode = "xcj_loginResults(-1,'" + JSON.stringify({ + protError: _LoginManager.PROT_ERROR.NOT_LOGGEDIN + }) + "');"; + } + + this._execJavaScript(jsCode); + } + + if (this.baseRef) { + this.baseRef.hideLoading(); + } + + _context.next = 141; + break; + + case 98: + if (!domain.includes(_optionspageUtils.locals.LOGOUT)) { + _context.next = 103; + break; + } + + _context.next = 101; + return _regenerator.default.awrap(_LoginManager.default.logout()); + + case 101: + _context.next = 141; + break; + + case 103: + if (!domain.includes(_optionspageUtils.locals.STORE_USER_INFO)) { + _context.next = 113; + break; + } + + paperName = getParams.paperName, _username = getParams.username, _password = getParams.password, extra = getParams.extra; + + if (_username) { + newsmemoryConfig.setValue(paperName + "_username", _username); + } + + if (_password) { + newsmemoryConfig.setValue(paperName + "_password", _password); + } + + if (extra) { + newsmemoryConfig.setValue(paperName + "_extra", extra); + } + + _context.next = 110; + return _regenerator.default.awrap(_LoginManager.default.storeClassicCustomLoginStatus({ + paperName: paperName, + username: _username, + password: _password, + extra: extra + })); + + case 110: + this._execJavaScript("xcj_storeUserInfo();"); + + _context.next = 141; + break; + + case 113: + if (!domain.includes(_optionspageUtils.locals.GET_USER_INFO)) { + _context.next = 140; + break; + } + + _paperName = getParams.paperName; + _context.next = 117; + return _regenerator.default.awrap(newsmemoryConfig.getValue(_paperName + "_username")); + + case 117: + _username2 = _context.sent; + _context.next = 120; + return _regenerator.default.awrap(newsmemoryConfig.getValue(_paperName + "_password")); + + case 120: + _password2 = _context.sent; + _context.next = 123; + return _regenerator.default.awrap(newsmemoryConfig.getValue(_paperName + "_extra")); + + case 123: + _extra = _context.sent; + + if (_username2) { + _context.next = 134; + break; + } + + _context.next = 127; + return _regenerator.default.awrap(_LoginManager.default.checkClassicLoginStatus(_paperName)); + + case 127: + _await$LoginManager$c = _context.sent; + _username2 = _await$LoginManager$c.username; + _password2 = _await$LoginManager$c.password; + _extra = _await$LoginManager$c.extra; + + if (_username2) { + newsmemoryConfig.setValue(_paperName + "_username", _username2); + } + + if (_password2) { + newsmemoryConfig.setValue(_paperName + "_password", _password2); + } + + if (_extra) { + newsmemoryConfig.setValue(_paperName + "_extra", _extra); + } + + case 134: + usernameValue = _username2 || ""; + passwordValue = _password2 || ""; + extraValue = _extra || ""; + + this._execJavaScript("xcj_getUserInfo('" + usernameValue + "', '" + passwordValue + "', '" + extraValue + "');"); + + _context.next = 141; + break; + + case 140: + if (domain.includes(_optionspageUtils.locals.SHOW_DEBUG_INFO)) { + if (this.debugRef) { + this.debugRef._expand(); + } + } else if (domain.includes(_optionspageUtils.locals.DISPLAY_LOADER)) { + show = getParams.show; + + if (this.baseRef) { + if (show === "1") { + this.baseRef.showLoading(); + } else { + this.baseRef.hideLoading(); + } + } + } else {} + + case 141: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_resetToHome", + value: function _resetToHome() { + this.setState({ + uri: null + }, this._goBack); + } + }, { + key: "_onLoading", + value: function _onLoading(segments) { + var domain = segments.domain; + var closeType = this.state.closeType; + + var isTecnaviaDomain = _$$_REQUIRE(_dependencyMap[24]).StringUtils.isTecnaviaDomain(domain); + + if (!isTecnaviaDomain) { + this.setState({ + closeType: _optionspageUtils.closeTypes.back + }); + } else if (closeType === _optionspageUtils.closeTypes.back) { + this.setState({ + closeType: _optionspageUtils.closeTypes.close + }); + } + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd(nativeEvent) { + if (nativeEvent) { + if (typeof nativeEvent.code === "undefined") { + this.retries = 0; + } + + var onTabLoaded = this.props.onTabLoaded; + + var currentTab = _optionspageUtils.default.getTabByURL(this.currentUrl); + + if (currentTab) { + this.postMessage("{title: $('#myNavbar li.active a').html()}"); + } + + if (typeof onTabLoaded === "function") { + onTabLoaded(currentTab); + } + } + } + }, { + key: "_confirmResult", + value: function _confirmResult(callback, result) { + if (callback) { + var boolString = result ? "true" : "false"; + + this._execJavaScript(callback + "(" + boolString + ");"); + } + } + }, { + key: "_execJavaScript", + value: function _execJavaScript(jsToExec) { + if (this.webview) { + this.webview.injectJavaScript("try { " + jsToExec + " } catch (e) { };"); + } + } + }, { + key: "_onClose", + value: function _onClose() { + var onClose = this.props.onClose; + + if (typeof onClose === "function") { + onClose(); + } + + if (this.prevNewsmemoryConfig && !_$$_REQUIRE(_dependencyMap[24]).JSUtils.equals(this.prevNewsmemoryConfig, global.getNewsmemoryConfig())) { + _$$_REQUIRE(_dependencyMap[23]).EventRegister.emit(_events.default.NEWSMEMORY_CONFIG_CHANGE, { + previousConfig: this.prevNewsmemoryConfig + }); + } + } + }, { + key: "_onOpen", + value: function _onOpen() { + var onOpen = this.props.onOpen; + var hidden = this.state.hidden; + + if (!hidden && typeof onOpen === "function") { + onOpen(); + } + + this.prevNewsmemoryConfig = (0, _extends2.default)({}, global.getNewsmemoryConfig()); + } + }, { + key: "_getCustomStyle", + value: function _getCustomStyle() { + var style = this.props.style; + return style; + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var backgroundColor = this.props.backgroundColor; + var _this$state2 = this.state, + uri = _this$state2.uri, + closeType = _this$state2.closeType, + forceFullscreen = _this$state2.forceFullscreen, + hidden = _this$state2.hidden; + + _IAPHelper.default.resetServerCallback(); + + if (!uri) { + this._onClose(); + + return null; + } + + this._onOpen(); + + var style = []; + + var customStyle = this._getCustomStyle(); + + var _global$getActivePSet2 = global.getActivePSetup(), + optionspageConfig = _global$getActivePSet2.optionspageConfig, + overrideNewsMemoryUserAgent = _global$getActivePSet2.overrideNewsMemoryUserAgent; + + if (hidden) { + style = _$$_REQUIRE(_dependencyMap[28]).styles.hidden; + } else if (!forceFullscreen && optionspageConfig.isModal()) { + style = [_$$_REQUIRE(_dependencyMap[28]).styles.modal, _$$_REQUIRE(_dependencyMap[28]).styles.main, optionspageConfig.getCoordinates(), customStyle]; + } else { + style = [_$$_REQUIRE(_dependencyMap[28]).styles.fullscreen, _$$_REQUIRE(_dependencyMap[28]).styles.main, customStyle]; + } + + var closeButton; + + if (!hidden && closeType !== _optionspageUtils.closeTypes.none) { + if (closeType === _optionspageUtils.closeTypes.back) { + closeButton = _react.default.createElement(_closeComponent.default, { + source: _$$_REQUIRE(_dependencyMap[29]), + parentStyle: _$$_REQUIRE(_dependencyMap[28]).styles.closeIcon, + cssProps: { + classes: ["newsmemory-icon", "newsmemory-close-icon", "optionspage-icon", "optionspage-back-icon"] + }, + onPress: function onPress() { + _this4._goBack(); + } + }); + } else { + closeButton = _react.default.createElement(_closeComponent.default, { + parentStyle: _$$_REQUIRE(_dependencyMap[28]).styles.closeIcon, + cssProps: { + classes: ["newsmemory-icon", "newsmemory-close-icon", "optionspage-icon", "optionspage-close-icon"] + }, + onPress: function onPress() { + _this4._close(); + } + }); + } + } + + var userAgent = overrideNewsMemoryUserAgent || _$$_REQUIRE(_dependencyMap[24]).PlatformUtils.getUserAgent(); + + var optionspage = _react.default.createElement(_$$_REQUIRE(_dependencyMap[30]).Css, { + classes: ["optionspage"] + }, _react.default.createElement(_reactNative.View, { + style: style + }, _react.default.createElement(_keyboardAvoidingComponent.default, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[31]).BaseWebView, { + ref: function ref(_ref4) { + _this4.baseRef = _ref4; + }, + innerRef: function innerRef(ref) { + _this4.webview = ref; + }, + source: { + uri: uri + }, + browser: true, + progressColor: _newsmemoryUtils.default.getSpinnerColor(), + onLocal: this.handleLocals, + onLoading: this.onLoading, + onLoadEnd: this.onLoadEnd, + onMessage: this.onMessage, + automaticallyAdjustContentInsets: true, + scalesPageToFit: false, + onNavigationStateChange: function onNavigationStateChange(navState) { + _this4.canGoBack = navState.canGoBack; + _this4.currentUrl = navState.url; + }, + enableKeyboardResize: _$$_REQUIRE(_dependencyMap[24]).PlatformUtils.isAndroid(), + startInLoadingState: hidden ? _$$_REQUIRE(_dependencyMap[31]).BaseWebView.LoadingStatePosition.none : _$$_REQUIRE(_dependencyMap[31]).BaseWebView.LoadingStatePosition.center, + userAgent: userAgent, + onError: this.onError + }), closeButton, _react.default.createElement(_settingDebug.default, { + ref: function ref(_ref5) { + _this4.debugRef = _ref5; + }, + numberOfTapToDebug: 1, + hidden: true + })))); + + var backgroundStyle = [_$$_REQUIRE(_dependencyMap[28]).styles.background]; + + if (backgroundColor) { + backgroundStyle.push({ + backgroundColor: backgroundColor + }); + } + + return optionspageConfig.isModal() && !forceFullscreen ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[30]).Css, { + classes: ["optionspage-modal-container"] + }, _react.default.createElement(_reactNative.View, { + style: backgroundStyle + }, optionspage)) : optionspage; + } + }]); + return BaseOptionspage; + }(_$$_REQUIRE(_dependencyMap[32]).Shortcut); + + exports.BaseOptionspage = BaseOptionspage; + BaseOptionspage.propTypes = (0, _extends2.default)({ + url: _propTypes.default.string, + tab: _propTypes.default.string, + getParams: _propTypes.default.object, + onOpen: _propTypes.default.func, + onClose: _propTypes.default.func, + closeType: _propTypes.default.string, + onMessage: _propTypes.default.func, + onTabLoaded: _propTypes.default.func, + backgroundColor: _propTypes.default.string, + forceFullscreen: _propTypes.default.bool, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]) + }, _$$_REQUIRE(_dependencyMap[32]).Shortcut.propTypes); + BaseOptionspage.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[32]).Shortcut.defaultProps, { + shortcutEnabled: true, + forceFullscreen: false + }); +},2297,[5,80,6,7,8,15,90,12,14,16,17,28,201,1861,730,2057,460,1859,1934,2256,603,2298,1870,572,462,1873,1889,1954,2301,1727,699,1894,1911]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _simpleButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var CloseNewsmemory = function (_React$Component) { + (0, _inherits2.default)(CloseNewsmemory, _React$Component); + + var _super = _createSuper(CloseNewsmemory); + + function CloseNewsmemory() { + (0, _classCallCheck2.default)(this, CloseNewsmemory); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(CloseNewsmemory, [{ + key: "render", + value: function render() { + return _react.default.createElement(_simpleButtonComponent.default, this.props); + } + }]); + return CloseNewsmemory; + }(_react.default.Component); + + exports.default = CloseNewsmemory; + CloseNewsmemory.propTypes = (0, _extends2.default)({ + source: _propTypes.default.any, + library: _propTypes.default.string + }, _simpleButtonComponent.default.propTypes); + CloseNewsmemory.defaultProps = { + source: _$$_REQUIRE(_dependencyMap[10]), + library: undefined + }; +},2298,[5,6,7,8,12,14,16,17,201,2299,1757]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _simpleButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SimpleButton = function (_React$Component) { + (0, _inherits2.default)(SimpleButton, _React$Component); + + var _super = _createSuper(SimpleButton); + + function SimpleButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, SimpleButton); + _this = _super.call(this, props); + var visible = props.visible; + _this.state = { + visible: visible + }; + _this.onPress = _this._onPress.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SimpleButton, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var toVisibleEvent = this.props.toVisibleEvent; + + if (toVisibleEvent) { + this.onToVisibleListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(toVisibleEvent, function (_ref) { + var visible = _ref.visible; + + _this2.setState({ + visible: visible + }); + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onToVisibleListener); + } + }, { + key: "show", + value: function show() { + this._updateVisibility(true); + } + }, { + key: "hide", + value: function hide() { + this._updateVisibility(false); + } + }, { + key: "_updateVisibility", + value: function _updateVisibility(newVisibleValue) { + var visible = this.state.visible; + + if (visible !== newVisibleValue) { + this.setState({ + visible: newVisibleValue + }); + } + } + }, { + key: "_onPress", + value: function _onPress() { + var onPress = this.props.onPress; + + if (typeof onPress === "function") { + onPress(); + } + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + parentStyle = _this$props.parentStyle, + ifHiddenRemove = _this$props.ifHiddenRemove, + buttonStyle = _this$props.buttonStyle, + source = _this$props.source, + tintColor = _this$props.tintColor, + library = _this$props.library, + cssProps = _this$props.cssProps, + accessibilityLabel = _this$props.accessibilityLabel; + var visible = this.state.visible; + + if (!visible) { + if (ifHiddenRemove) { + return null; + } + + return _react.default.createElement(_reactNative.View, { + style: [_simpleButtonComponent.default.parent, parentStyle] + }); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-header-icon-container"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).TouchableOpacity, { + containerStyle: [_simpleButtonComponent.default.parent, parentStyle], + onPress: this.onPress, + accessibilityLabel: accessibilityLabel + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, cssProps, _react.default.createElement(_imageIconChooserComponent.default, { + type: library, + name: source, + iconStyle: [_simpleButtonComponent.default.libraryButton, { + color: tintColor + }], + imageStyle: [_simpleButtonComponent.default.button, { + tintColor: tintColor + }], + style: [buttonStyle], + resizeMode: "contain", + source: source, + tintColor: tintColor + })))); + } + }]); + return SimpleButton; + }(_react.default.Component); + + exports.default = SimpleButton; + SimpleButton.propTypes = { + parentStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + buttonStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + library: _propTypes.default.string, + source: _propTypes.default.any.isRequired, + onPress: _propTypes.default.func.isRequired, + toVisibleEvent: _propTypes.default.string, + visible: _propTypes.default.bool, + ifHiddenRemove: _propTypes.default.bool, + tintColor: _propTypes.default.string, + cssProps: _propTypes.default.object, + accessibilityLabel: _propTypes.default.string + }; + SimpleButton.defaultProps = { + parentStyle: {}, + buttonStyle: {}, + visible: true, + library: undefined, + cssProps: {} + }; +},2299,[5,7,8,15,12,14,16,17,201,28,2300,1970,572,699,1]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + parent: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_PARENT_BUTTON_SIZE, + width: _$$_REQUIRE(_dependencyMap[1]).HEADER_PARENT_BUTTON_SIZE, + justifyContent: "center", + alignItems: "center" + }, + button: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE, + width: _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE + }, + libraryButton: { + fontSize: _$$_REQUIRE(_dependencyMap[1]).HEADER_BUTTON_SIZE + }, + badge: { + position: "absolute", + top: 2, + right: 2, + borderWidth: 1, + borderRadius: 10, + width: 20, + height: 20, + backgroundColor: "white", + alignSelf: "center" + } + }); + + exports.default = _default; +},2300,[28,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + main: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + fullscreen: { + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.modalBackgroundLight + }, + background: { + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.modalBackgroundLight + }, + hidden: { + width: 0, + height: 0 + }, + modal: { + position: "absolute", + zIndex: 1000 + }, + closeIcon: { + position: "absolute", + top: 13, + right: 13, + width: 24, + height: 24, + alignItems: "center", + justifyContent: "center" + } + }); + + exports.styles = styles; +},2301,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useRootContainerLayout = useRootContainerLayout; + exports.RootContainerLayoutContextProvider = RootContainerLayoutContextProvider; + exports.setRootContainerLayout = setRootContainerLayout; + exports.CustomNavigationStyledContainer = CustomNavigationStyledContainer; + exports.CustomNavigationContainer = CustomNavigationContainer; + exports.RootContainerLayoutContext = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var RootContainerLayoutContext = (0, _$$_REQUIRE(_dependencyMap[6]).createReactiveContext)({}); + exports.RootContainerLayoutContext = RootContainerLayoutContext; + + function useRootContainerLayout() { + return (0, _$$_REQUIRE(_dependencyMap[6]).useReactiveContext)(RootContainerLayoutContext).state; + } + + function RootContainerLayoutContextProvider(props) { + return _react.default.createElement(RootContainerLayoutContext.Provider, props); + } + + function setRootContainerLayout() { + var layout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + RootContainerLayoutContext.set(layout); + } + + function CustomNavigationStyledContainer(props) { + var children = props.children; + + var _useState = (0, _react.useState)({}), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + style = _useState2[0], + setStyle = _useState2[1]; + + var containerLayout = useRootContainerLayout(); + var onLayoutCallback = (0, _react.useCallback)(function (_ref) { + var nativeEvent = _ref.nativeEvent; + var layout = nativeEvent.layout; + + if (!_$$_REQUIRE(_dependencyMap[7]).JSUtils.isEmpty(containerLayout) && !_$$_REQUIRE(_dependencyMap[7]).JSUtils.areEqualShallow(containerLayout, layout)) { + if ((layout.width <= layout.height && containerLayout.width <= containerLayout.height || layout.width > layout.height && containerLayout.width > containerLayout.height) && layout.height < containerLayout.height) { + setStyle({ + flex: 0, + width: containerLayout.width, + height: containerLayout.height + (containerLayout.height - layout.height) + }); + } + } + }, [containerLayout]); + (0, _react.useEffect)(function () { + setStyle({}); + }, [containerLayout]); + return _react.default.createElement(_reactNative.View, { + style: (0, _extends2.default)({ + flex: 1 + }, style), + onLayout: onLayoutCallback + }, children); + } + + function CustomNavigationContainer(props) { + var children = props.children, + onNavigationRef = props.onNavigationRef, + rest = (0, _objectWithoutProperties2.default)(props, ["children", "onNavigationRef"]); + var Content = children; + + if (!global.appNeedsSafeArea()) { + Content = _react.default.createElement(CustomNavigationStyledContainer, null, Content); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).NavigationContainer, (0, _extends2.default)({ + ref: function ref(_ref2) { + if (typeof onNavigationRef === "function") { + onNavigationRef(_ref2); + } + } + }, rest), Content); + } +},2302,[5,108,6,41,17,28,702,462,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2303,[2304]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewsmemoryScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[13]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _optionspageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _NewsmemoryManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _newsmemoryScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + var _specialSectionComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _NewspaperManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + var _PushHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[28])); + + var _InterstitialsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[29])); + + var _progressDownloadComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[30])); + + var _TranslationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[31])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[32])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[33])); + + var _optionPageAccessibility = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[34])); + + var _nativeOptionsPage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[35])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[36])); + + var _nativeOptionsPageFallback = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[37])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(NewsmemoryScreen, _NavigationBaseScreen); + + var _super = _createSuper(NewsmemoryScreen); + + function NewsmemoryScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryScreen); + _this = _super.call(this, props); + _this.tab = props.tab; + + _LiveConfig.default.setEpaperSide(); + + Analytics.initMatomo(); + Analytics.initMatomoTracker(); + _this.onNewsmemoryRef = _this._onNewsmemoryRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLayoutManagerRef = _this._onLayoutManagerRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onOptionPageClosed = _this._onOptionPageClosed.bind((0, _assertThisInitialized2.default)(_this)); + _this.onOptionPageOpened = _this._onOptionPageOpened.bind((0, _assertThisInitialized2.default)(_this)); + _this.canOptionPageBeClosed = _this._canOptionPageBeClosed.bind((0, _assertThisInitialized2.default)(_this)); + _this.onOptionPageTabLoaded = _this._onOptionPageTabLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.loadSpecialSection = _this._loadSpecialSection.bind((0, _assertThisInitialized2.default)(_this)); + _this.loadMainEditionFromSpecial = _this._loadMainEditionFromSpecial.bind((0, _assertThisInitialized2.default)(_this)); + _this.displayOfflineIssues = _this._displayOfflineIssues.bind((0, _assertThisInitialized2.default)(_this)); + _this.updateStatusBarColor = _this._updateStatusBarColor.bind((0, _assertThisInitialized2.default)(_this)); + _this.newsmemoryManager = new _NewsmemoryManager.default(props.navigation); + _this.isOptionPageOpened = false; + _this.newspaperLoaded = false; + _this.state = { + downloadingDB: false, + loaded: false, + showLoading: false, + logging: false, + updating: false + }; + return _this; + } + + (0, _createClass2.default)(NewsmemoryScreen, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var tab = nextProps.tab; + + if (tab) { + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: tab + }); + + this.tab = undefined; + } + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryScreen.prototype), "componentDidMount", this).call(this); + + this._managePushNotification(); + + this.showPrestitial(); + this.onEditionDownloadRequest = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, function _callee(_ref) { + var issue, edition, currentNewspaperManager, status; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + issue = _ref.issue, edition = _ref.edition; + + if (_this2.layoutManagerRef) { + _this2.layoutManagerRef.resetCurrentArticle(); + + _this2.layoutManagerRef.resetCurrentPageId(); + } + + if (!_this2.newsmemoryManager) { + _context.next = 20; + break; + } + + currentNewspaperManager = _this2.newsmemoryManager.currentNewspaperManager; + + if (!currentNewspaperManager) { + _context.next = 11; + break; + } + + status = currentNewspaperManager.status; + + if (!status) { + _context.next = 11; + break; + } + + _context.next = 9; + return _regenerator.default.awrap(status.resetLastPageNumber()); + + case 9: + _context.next = 11; + return _regenerator.default.awrap(status.resetLastArticleId()); + + case 11: + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryClearRecently)(); + _context.prev = 12; + _context.next = 15; + return _regenerator.default.awrap(_this2.newsmemoryManager.init(global.getActivePSetup())); + + case 15: + _context.next = 19; + break; + + case 17: + _context.prev = 17; + _context.t0 = _context["catch"](12); + + case 19: + _this2.newsmemoryManager.downloadPublication(issue, edition); + + case 20: + case "end": + return _context.stop(); + } + } + }, null, null, [[12, 17]], Promise); + }); + this.onEditionReloadRequest = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_RELOAD_EDITION, function _callee2() { + var currentNewspaperManager, status; + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!_this2.canOptionPageBeClosed()) { + _context2.next = 13; + break; + } + + if (_this2.layoutManagerRef) { + _this2.layoutManagerRef.resetCurrentArticle(); + + _this2.layoutManagerRef.resetCurrentPageId(); + } + + if (!_this2.newsmemoryManager) { + _context2.next = 13; + break; + } + + currentNewspaperManager = _this2.newsmemoryManager.currentNewspaperManager; + + if (!currentNewspaperManager) { + _context2.next = 11; + break; + } + + status = currentNewspaperManager.status; + + if (!status) { + _context2.next = 11; + break; + } + + _context2.next = 9; + return _regenerator.default.awrap(status.resetLastPageNumber()); + + case 9: + _context2.next = 11; + return _regenerator.default.awrap(status.resetLastArticleId()); + + case 11: + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryClearRecently)(); + + _this2.newsmemoryManager.reloadLastPublication(); + + case 13: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }); + this.onLoadSpecialSection = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_ON_LOAD_SPECIAL, this.loadSpecialSection); + this.onLoadMainEdition = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_ON_LOAD_MAIN_EDITION_FROM_SPECIAL, this.loadMainEditionFromSpecial); + this.onEditionDBDownloadStart = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_DB_DOWNLOAD_STARTED, function () { + _this2.setState({ + downloadingDB: true + }); + }); + this.onEditionDBDownloadFinish = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_DB_DOWNLOAD_FINISHED, function () { + _this2.setState({ + downloadingDB: false + }); + }); + this.onEditionLoading = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_NEWSPAPER_LOADING, function (_ref2) { + var changed = _ref2.changed; + + if (changed) { + _this2.setState({ + loaded: false + }); + } + }); + this.onEditionLoaded = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_NEWSPAPER_LOADED, function _callee3() { + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.next = 2; + return _regenerator.default.awrap(_this2.checkIfPaperHasSpecialSection()); + + case 2: + if (_this2.layoutManagerRef) { + _this2.layoutManagerRef.reset(); + } + + _this2._showEpaperModeSelection(); + + _this2.setState({ + loaded: true + }); + + case 5: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }); + this.onEditionUpdateRequested = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_UPDATE_REQUESTED, function () { + var loaded = _this2.state.loaded; + + if (!loaded) { + _this2.setState({ + updating: true + }); + } + }); + this.onEditionUpdateStarted = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_UPDATE_STARTED, function (_ref3) { + var needUpdate = _ref3.needUpdate; + + if (needUpdate) { + _this2.setState({ + loaded: false, + updating: true + }); + } + }); + this.onEditionUpdateFinish = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_UPDATE_FINISHED, function _callee4(_ref4) { + var success, _this2$state, loaded, updating; + + return _regenerator.default.async(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + success = _ref4.success; + _context4.next = 3; + return _regenerator.default.awrap(_this2.checkIfPaperHasSpecialSection()); + + case 3: + _this2$state = _this2.state, loaded = _this2$state.loaded, updating = _this2$state.updating; + + if (!loaded || success && updating) { + _this2.setState({ + loaded: true, + updating: false + }); + } + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + }); + this.onEditionChanged = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_NEWSPAPER_CHANGED, function (_ref5) { + var newspaper = _ref5.newspaper; + + if (newspaper) { + var firstPage = null; + var editionModel = newspaper.getEditionModel(); + + if (editionModel) { + firstPage = editionModel.getFirstPage(); + + if (firstPage) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryEditionLoad)(editionModel, firstPage); + } + } + } + }); + this.onClearStorage = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_ON_CLEAR_STORAGE, function _callee5(_ref6) { + var onFinish, onError, currentNewspaperManager, status; + return _regenerator.default.async(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + onFinish = _ref6.onFinish, onError = _ref6.onError; + _context5.prev = 1; + currentNewspaperManager = _this2.newsmemoryManager.currentNewspaperManager; + + if (!currentNewspaperManager) { + _context5.next = 9; + break; + } + + currentNewspaperManager.clearQueues(); + status = currentNewspaperManager.status; + + if (!status) { + _context5.next = 9; + break; + } + + _context5.next = 9; + return _regenerator.default.awrap(status.reset()); + + case 9: + _context5.next = 11; + return _regenerator.default.awrap(_this2.newsmemoryManager.deleteCurrentEditionDatabase()); + + case 11: + _context5.next = 13; + return _regenerator.default.awrap(_this2.newsmemoryManager.destroy()); + + case 13: + _this2.newsmemoryManager = new _NewsmemoryManager.default(); + _context5.next = 16; + return _regenerator.default.awrap(_this2.newsmemoryManager.init(global.getActivePSetup())); + + case 16: + if (typeof onFinish === "function") { + onFinish(); + } + + _context5.next = 22; + break; + + case 19: + _context5.prev = 19; + _context5.t0 = _context5["catch"](1); + + if (typeof onError === "function") { + onError(_context5.t0); + } + + case 22: + case "end": + return _context5.stop(); + } + } + }, null, null, [[1, 19]], Promise); + }); + this.onDownloadLatestEdition = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_DOWNLOAD_LATEST_EDITION, function () { + _this2.newsmemoryManager.downloadLatestPublication(); + }); + this.onStateChangeForeground = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_FOREGROUND, function () { + _this2.showPrestitial(); + + if (_$$_REQUIRE(_dependencyMap[40]).NetworkUtils.isOnline()) { + var _global$getMainPSetup = global.getMainPSetup(), + migrate = _global$getMainPSetup.migrate; + + var _global$getActivePSet = global.getActivePSetup(), + migrateActive = _global$getActivePSet.migrate; + + if (migrate || migrateActive) { + _NavigationService.default.restart(); + } else { + var feedback = new (_$$_REQUIRE(_dependencyMap[41]).Feedback)(); + feedback.check(); + + if (_this2.newsmemoryManager) { + _this2.newsmemoryManager.restart({ + forceMessage: false, + isOptionspageOpen: _this2.isOptionPageOpened + }); + } + } + } + }); + this.onLoginCheckStart = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_LOGIN_CHECK_STARTED, function () { + _this2.setState({ + logging: true + }); + }); + this.onLoginCheckEnd = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_LOGIN_CHECK_ENDED, function () { + _this2.setState({ + logging: false + }); + }); + this.onOpenOfflineEditionsMenu = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.NEWSMEMORY_OPEN_OFFLINE_EDITION_MENU, this.displayOfflineIssues); + this.onNewsmemoryRestart = _$$_REQUIRE(_dependencyMap[38]).EventRegister.on(_events.default.TRIGGER_NEWSMEMORY_RESTART, function () { + if (_this2.newsmemoryManager && _this2.newspaperLoaded) { + _this2.newsmemoryManager.restart({ + forceMessage: !_this2.isOptionPageOpened, + isOptionspageOpen: _this2.isOptionPageOpened + }); + } + }); + this.loadNewsmemory(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + return _regenerator.default.async(function componentWillUnmount$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryScreen.prototype), "componentWillUnmount", this).call(this); + _context6.next = 3; + return _regenerator.default.awrap(this.newsmemoryManager.destroy()); + + case 3: + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionDownloadRequest); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionReloadRequest); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionDBDownloadStart); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionDBDownloadFinish); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionLoading); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionLoaded); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onExtraGoToPagePress); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionUpdateRequested); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionUpdateStarted); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionUpdateFinish); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onEditionChanged); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onClearStorage); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onDownloadLatestEdition); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onStateChangeForeground); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onLoginCheckStart); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onLoginCheckEnd); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onOpenOfflineEditionsMenu); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onLoadMainEdition); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onLoadSpecialSection); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.rm(this.onNewsmemoryRestart); + + if (NewsmemoryScreen.INTERSTITIAL_TIMER) { + _InterstitialsHelper.default.resetTimer(NewsmemoryScreen.INTERSTITIAL_TIMER); + } + + case 24: + case "end": + return _context6.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "orientationListener", + value: function orientationListener(orientation) { + this.updateStatusBarColor(); + } + }, { + key: "handleConnectivityChange", + value: function handleConnectivityChange(_ref7) { + var online = _ref7.online; + + if (!online) { + var message = global.strings("err_offline"); + + if (this.newsmemoryManager && this.newsmemoryManager.currentNewspaperManager) { + var currentNewspaper = this.newsmemoryManager.currentNewspaperManager.getCurrentNewspaper(); + + if (currentNewspaper && !currentNewspaper.hasHighResolutionDownloaded()) { + message = global.strings("offline_download_warning"); + } + } + + _reactNative.Alert.alert(global.strings("title_offline"), message); + } + } + }, { + key: "_updateStatusBarColor", + value: function _updateStatusBarColor() { + var colors = _styleUtils.default.getNewsmemoryBarColors(); + + if (this.isOptionPageOpened) { + colors = _styleUtils.default.getNewsmemoryBarColors(["system-optionspage-status-bar", "system-newsmemory-optionspage-status-bar"], ["system-optionspage-navigation-bar", "system-newsmemory-optionspage-navigation-bar"]); + } + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.ON_SAFE_AREA_COLOR_CHANGE, colors); + } + }, { + key: "showPrestitial", + value: function showPrestitial() { + if (NewsmemoryScreen.INTERSTITIAL_TIMER) { + _InterstitialsHelper.default.resetTimer(NewsmemoryScreen.INTERSTITIAL_TIMER); + } + + _InterstitialsHelper.default.getPrestitial(function (timer) { + NewsmemoryScreen.INTERSTITIAL_TIMER = timer; + }); + } + }, { + key: "checkIfPaperHasSpecialSection", + value: function checkIfPaperHasSpecialSection() { + var currentNewspaperManager, url, response, hasSpecialSections; + return _regenerator.default.async(function checkIfPaperHasSpecialSection$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + if (!(_$$_REQUIRE(_dependencyMap[40]).NetworkUtils.isOnline() && this.newsmemoryManager && this.newsmemoryManager.currentNewspaperManager && this.newsmemoryManager.currentNewspaperManager.getCurrentNewspaper())) { + _context7.next = 14; + break; + } + + _context7.prev = 1; + currentNewspaperManager = this.newsmemoryManager.currentNewspaperManager; + url = currentNewspaperManager.hasSpecialSection(); + + if (!url) { + _context7.next = 10; + break; + } + + _context7.next = 7; + return _regenerator.default.awrap(_Api.default.get(url, {}, {}, true)); + + case 7: + response = _context7.sent; + hasSpecialSections = Object.keys(response.data).length > 0; + currentNewspaperManager.getCurrentNewspaper().getEditionModel().setHasSpecialSections(hasSpecialSections); + + case 10: + _context7.next = 14; + break; + + case 12: + _context7.prev = 12; + _context7.t0 = _context7["catch"](1); + + case 14: + case "end": + return _context7.stop(); + } + } + }, null, this, [[1, 12]], Promise); + } + }, { + key: "_managePushNotification", + value: function _managePushNotification() { + if (_PushHelper.default.isTherePush()) { + var _PushHelper$getPush = _PushHelper.default.getPush(), + action = _PushHelper$getPush.action, + value = _PushHelper$getPush.value; + + _PushHelper.default.clearPush(); + + switch (action) { + case "openUrl": + var navigation = this.props.navigation; + navigation.dispatch(_$$_REQUIRE(_dependencyMap[42]).CommonActions.navigate({ + name: "WebScreen", + params: { + url: value + } + })); + break; + + case "openEpaperCoordinates": + var edition = value.edition, + issue = value.issue, + article = value.article, + page = value.page; + break; + } + } + } + }, { + key: "_loadSpecialSection", + value: function _loadSpecialSection(params) { + var pSetup, issue, edition, machine, paperDomain, _global$getActivePSet2, currentPSetup, _await$global$loadPSe, config; + + return _regenerator.default.async(function _loadSpecialSection$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + _context8.prev = 0; + this.setState({ + loaded: false, + showLoading: true + }); + pSetup = params.pSetup, issue = params.issue, edition = params.edition, machine = params.machine, paperDomain = params.paperDomain; + _global$getActivePSet2 = global.getActivePSetup(), currentPSetup = _global$getActivePSet2.pSetup; + _context8.next = 6; + return _regenerator.default.awrap(global.loadPSetup(pSetup, paperDomain || machine)); + + case 6: + _await$global$loadPSe = _context8.sent; + config = _await$global$loadPSe.config; + + if (!config) { + _context8.next = 16; + break; + } + + if (!(currentPSetup !== pSetup)) { + _context8.next = 13; + break; + } + + _context8.next = 12; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig()); + + case 12: + Analytics.updateAnalyticsClientList(); + + case 13: + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue, + edition: edition + }); + + _context8.next = 18; + break; + + case 16: + _$$_REQUIRE(_dependencyMap[43]).Toast.show(global.strings("msg_tts_error")); + + this.setState({ + loaded: true, + showLoading: false + }); + + case 18: + _context8.next = 23; + break; + + case 20: + _context8.prev = 20; + _context8.t0 = _context8["catch"](0); + this.setState({ + loaded: true, + showLoading: false + }); + + case 23: + case "end": + return _context8.stop(); + } + } + }, null, this, [[0, 20]], Promise); + } + }, { + key: "_loadMainEditionFromSpecial", + value: function _loadMainEditionFromSpecial() { + var _global$getActivePSet3, currentPSetup, newsmemoryConfig, editionfromcalling, config, pSetup, issue, edition, splitted, thumbnail, _splitted, _NewsmemoryUtils$pars, mainpSetup, xpSetup, _await$global$loadPSe2; + + return _regenerator.default.async(function _loadMainEditionFromSpecial$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + _global$getActivePSet3 = global.getActivePSetup(), currentPSetup = _global$getActivePSet3.pSetup; + newsmemoryConfig = global.getNewsmemoryConfig(); + editionfromcalling = newsmemoryConfig.editionfromcalling; + _context9.prev = 3; + this.setState({ + loaded: false, + showLoading: true + }); + + if (editionfromcalling) { + splitted = _$$_REQUIRE(_dependencyMap[40]).StringUtils.decodeURIComponent(editionfromcalling).split(","); + _splitted = (0, _slicedToArray2.default)(splitted, 4); + edition = _splitted[0]; + thumbnail = _splitted[1]; + issue = _splitted[2]; + pSetup = _splitted[3]; + } else { + _NewsmemoryUtils$pars = _newsmemoryUtils.default.parseXpSetup(currentPSetup), mainpSetup = _NewsmemoryUtils$pars.mainpSetup, xpSetup = _NewsmemoryUtils$pars.xpSetup; + + if (xpSetup) { + pSetup = mainpSetup; + } + } + + if (!pSetup) { + _context9.next = 19; + break; + } + + _context9.next = 9; + return _regenerator.default.awrap(global.loadPSetup(pSetup)); + + case 9: + _await$global$loadPSe2 = _context9.sent; + config = _await$global$loadPSe2.config; + + if (!(config && currentPSetup !== pSetup)) { + _context9.next = 16; + break; + } + + _context9.next = 14; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig()); + + case 14: + Analytics.updateAnalyticsClientList(); + + if (!edition) { + newsmemoryConfig.resetPrefEdi(); + } + + case 16: + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue, + edition: edition + }); + + _context9.next = 21; + break; + + case 19: + _$$_REQUIRE(_dependencyMap[43]).Toast.show(global.strings("msg_tts_error")); + + this.setState({ + loaded: true, + showLoading: false + }); + + case 21: + _context9.next = 26; + break; + + case 23: + _context9.prev = 23; + _context9.t0 = _context9["catch"](3); + this.setState({ + loaded: true, + showLoading: false + }); + + case 26: + case "end": + return _context9.stop(); + } + } + }, null, this, [[3, 23]], Promise); + } + }, { + key: "_showEpaperModeSelection", + value: function _showEpaperModeSelection() { + var _global$getActivePSet4 = global.getActivePSetup(), + disableEPaperModeSelectionPage = _global$getActivePSet4.disableEPaperModeSelectionPage; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + epaperStartModeDontShowAgain = _global$getNewsmemory.epaperStartModeDontShowAgain; + + if (_$$_REQUIRE(_dependencyMap[40]).NetworkUtils.isOnline() && !disableEPaperModeSelectionPage && !epaperStartModeDontShowAgain && this.newsmemoryManager && _newsmemoryUtils.default.canEnableReadMode(this.newsmemoryManager.currentNewspaperManager)) { + var navigation = this.props.navigation; + navigation.navigate("EpaperModeSelectionScreen"); + } + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + if (this.isOptionPageOpened && !this.optFromBackButton && this.canOptionPageBeClosed()) { + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.CLOSE_OPTIONSPAGE); + } else { + if (!this.layoutManagerRef || !this.layoutManagerRef.handleBack()) { + var _global$getActivePSet5 = global.getActivePSetup(), + showNativeOptionsPage = _global$getActivePSet5.showNativeOptionsPage, + showNativeOptionsPageFallbackUrl = _global$getActivePSet5.showNativeOptionsPageFallbackUrl; + + if (!this.isOptionPageOpened && (_$$_REQUIRE(_dependencyMap[40]).NetworkUtils.isOnline() || showNativeOptionsPage && !showNativeOptionsPageFallbackUrl)) { + this.optFromBackButton = true; + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[44]).tabs.home + }); + + return true; + } + + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryScreen.prototype), "handleBackButton", this).call(this); + + if (_LiveConfig.default.getStartUpNavigator() === "NewsmemoryNavigator") { + this.closeAlert(); + return true; + } + + this.goToRssNavigator(); + } + } + + return true; + } + }, { + key: "getTag", + value: function getTag() { + return "ePaper"; + } + }, { + key: "trackScreen", + value: function trackScreen() {} + }, { + key: "goToRssNavigator", + value: function goToRssNavigator() { + _NavigationService.default.main.reset("RssNavigator"); + } + }, { + key: "_onNewsmemoryRef", + value: function _onNewsmemoryRef(ref) { + this.newsmemoryRef = ref; + } + }, { + key: "_onLayoutManagerRef", + value: function _onLayoutManagerRef(ref) { + this.layoutManagerRef = ref; + } + }, { + key: "_onOptionPageOpened", + value: function _onOptionPageOpened() { + this.isOptionPageOpened = true; + + if (this.newsmemoryRef) { + this.newsmemoryRef.setNativeProps({ + pointerEvents: "none" + }); + } + + this.updateStatusBarColor(); + } + }, { + key: "_onOptionPageTabLoaded", + value: function _onOptionPageTabLoaded(tab) { + var _global$getActivePSet6 = global.getActivePSetup(), + loginStatus = _global$getActivePSet6.loginStatus; + + var loggedIn = loginStatus.isLoggedIn(); + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.ON_SAFE_AREA_COLOR_CHANGE, _styleUtils.default.getNewsmemoryBarColors(["system-optionspage-status-bar", "system-newsmemory-optionspage-status-bar", loggedIn ? "system-newsmemory-optionspage-status-bar-loggedIn" : "", "system-newsmemory-optionspage-" + tab + "-status-bar", loggedIn ? "system-newsmemory-optionspage-" + tab + "-status-bar-loggedIn" : ""], ["system-optionspage-navigation-bar", "system-newsmemory-optionspage-navigation-bar", loggedIn ? "system-newsmemory-optionspage-navigation-bar-loggedIn" : "", "system-newsmemory-optionspage-" + tab + "-navigation-bar", loggedIn ? "system-newsmemory-optionspage-" + tab + "-navigation-bar-loggedIn" : ""])); + } + }, { + key: "_onOptionPageClosed", + value: function _onOptionPageClosed() { + this.isOptionPageOpened = false; + this.optFromBackButton = false; + + if (this.newsmemoryRef) { + this.newsmemoryRef.setNativeProps({ + pointerEvents: "auto" + }); + } + + this.updateStatusBarColor(); + } + }, { + key: "_canOptionPageBeClosed", + value: function _canOptionPageBeClosed() { + if (this.newsmemoryManager && this.newsmemoryManager.currentNewspaperManager) { + return !!this.newsmemoryManager.currentNewspaperManager.getCurrentNewspaper(); + } + + return false; + } + }, { + key: "_displayOfflineIssues", + value: function _displayOfflineIssues() { + var issues, currentNewspaper, editionModel, currentIssue, currentEdition, _global$getEpaperLayo, mainFooter, _global$getRSSActiveP, rssIsEnabled, buttons; + + return _regenerator.default.async(function _displayOfflineIssues$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + issues = []; + _context11.prev = 1; + _context11.next = 4; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.getAllIssues()); + + case 4: + issues = _context11.sent; + _context11.next = 9; + break; + + case 7: + _context11.prev = 7; + _context11.t0 = _context11["catch"](1); + + case 9: + if (issues.length > 0) { + currentNewspaper = this.newsmemoryManager && this.newsmemoryManager.currentNewspaperManager && this.newsmemoryManager.currentNewspaperManager.getCurrentNewspaper(); + editionModel = currentNewspaper && currentNewspaper.getEditionModel(); + currentIssue = editionModel && editionModel.getIssue(); + currentEdition = editionModel && editionModel.getEdition(); + _global$getEpaperLayo = global.getEpaperLayoutConfig(), mainFooter = _global$getEpaperLayo.mainFooter; + + _$$_REQUIRE(_dependencyMap[45]).MyBottomSheet.show({ + options: issues.map(function (issue) { + var _global$getActivePSet7 = global.getActivePSetup(), + pSetup = _global$getActivePSet7.pSetup; + + var isSamePSetup = pSetup === issue.getPSetup(); + var isSameIssue = currentIssue === issue.getIssue(); + var isSameEdition = currentEdition === issue.getEdition(); + var isCurrent = isSamePSetup && isSameIssue && isSameEdition; + return { + title: issue.getEdition() + " - " + _newsmemoryUtils.default.getFormattedIssue(issue.getIssue()), + onPress: function onPress() { + var _await$global$getPape, success; + + return _regenerator.default.async(function onPress$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + if (isSamePSetup) { + _context10.next = 13; + break; + } + + _context10.prev = 1; + _context10.next = 4; + return _regenerator.default.awrap(global.getPaperSetupManager().init(issue.getPSetup())); + + case 4: + _await$global$getPape = _context10.sent; + success = _await$global$getPape.success; + + if (!success) { + _context10.next = 9; + break; + } + + _context10.next = 9; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig()); + + case 9: + _context10.next = 13; + break; + + case 11: + _context10.prev = 11; + _context10.t0 = _context10["catch"](1); + + case 13: + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue.getIssue(), + edition: issue.getEdition() + }); + + case 14: + case "end": + return _context10.stop(); + } + } + }, null, null, [[1, 11]], Promise); + }, + style: { + backgroundColor: isCurrent ? mainFooter.textColor : mainFooter.backgroundColor + }, + textStyle: { + color: isCurrent ? mainFooter.backgroundColor : mainFooter.textColor + } + }; + }), + styleContainer: { + backgroundColor: mainFooter.backgroundColor + } + }); + } else { + _global$getRSSActiveP = global.getRSSActivePSetup(), rssIsEnabled = _global$getRSSActiveP.rssIsEnabled; + buttons = []; + + if (rssIsEnabled) { + buttons.push({ + text: global.strings("btn_cancel") + }, { + text: global.strings("btn_feed"), + onPress: this.goToRssNavigator + }); + } else { + buttons.push({ + text: global.strings("btn_ok") + }); + } + + _reactNative.Alert.alert("", global.strings("err_offline"), buttons, { + cancelable: false + }); + } + + case 10: + case "end": + return _context11.stop(); + } + } + }, null, this, [[1, 7]], Promise); + } + }, { + key: "loadActiveNewspaper", + value: function loadActiveNewspaper() { + return _regenerator.default.async(function loadActiveNewspaper$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + _context12.next = 2; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig()); + + case 2: + Analytics.updateAnalyticsClientList(); + _context12.next = 5; + return _regenerator.default.awrap(this.newsmemoryManager.init(global.getActivePSetup())); + + case 5: + if (!this.tab) { + _context12.next = 10; + break; + } + + _$$_REQUIRE(_dependencyMap[38]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: this.tab + }); + + this.tab = undefined; + _context12.next = 12; + break; + + case 10: + _context12.next = 12; + return _regenerator.default.awrap(this.newsmemoryManager.load()); + + case 12: + case "end": + return _context12.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadNewsmemory", + value: function loadNewsmemory() { + return _regenerator.default.async(function loadNewsmemory$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + _context13.next = 2; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.makeNewspaperDirectory()); + + case 2: + _context13.next = 4; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.createDatabasesTable()); + + case 4: + _TranslationManager.default.init(); + + _context13.next = 7; + return _regenerator.default.awrap(this.loadActiveNewspaper()); + + case 7: + this.newspaperLoaded = true; + + case 8: + case "end": + return _context13.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_renderOptionsPage", + value: function _renderOptionsPage() { + var _global$getActivePSet8 = global.getActivePSetup(), + showNativeOptionsPage = _global$getActivePSet8.showNativeOptionsPage, + showNativeOptionsPageFallbackUrl = _global$getActivePSet8.showNativeOptionsPageFallbackUrl; + + var props = { + onOpen: this.onOptionPageOpened, + onClose: this.onOptionPageClosed, + onTabLoaded: this.onOptionPageTabLoaded, + handleBackButton: this.onHandleBackButton, + isNewspaperLoaded: this.canOptionPageBeClosed, + newsmemoryManager: this.newsmemoryManager + }; + + if (showNativeOptionsPageFallbackUrl) { + return _react.default.createElement(_nativeOptionsPageFallback.default, (0, _extends2.default)({}, props, { + url: showNativeOptionsPageFallbackUrl + })); + } + + if (showNativeOptionsPage && _optionalPackageUtils.default.isNativeOptionsPageAvailable()) { + return _react.default.createElement(_nativeOptionsPage.default, props); + } + + return _react.default.createElement(_optionspageComponent.default, (0, _extends2.default)({}, props, { + shortcutPriority: 100 + })); + } + }, { + key: "render", + value: function render() { + this.updateStatusBarColor(); + var _this$state = this.state, + downloadingDB = _this$state.downloadingDB, + loaded = _this$state.loaded, + showLoading = _this$state.showLoading, + logging = _this$state.logging, + updating = _this$state.updating; + var component = null; + + var parentStyle = _$$_REQUIRE(_dependencyMap[46]).Css.getStyleObjByCssClasses(["newsmemory-screen"]); + + if (logging || updating) { + component = _react.default.createElement(_$$_REQUIRE(_dependencyMap[47]).ProgressCircle, { + spinnerStyle: [_newsmemoryScreen.default.parent, parentStyle], + spinnerColor: parentStyle.color || _newsmemoryUtils.default.getSpinnerColor() + }); + } else if (downloadingDB) { + component = _react.default.createElement(_progressDownloadComponent.default, { + color: _newsmemoryUtils.default.getSpinnerColor(), + text: global.strings("msg_download_edition"), + event: _events.default.NEWSMEMORY_DB_DOWNLOAD_PROGRESS, + retryEvent: _events.default.NEWSMEMORY_DB_DOWNLOAD_RETRY, + style: [{ + position: "relative", + flex: 1 + }, parentStyle], + cssClasses: ["newsmemory-download-circle"], + cssTextClasses: ["newsmemory-download-circle-text"] + }); + } else if (loaded) { + var navigation = this.props.navigation; + component = _react.default.createElement(_reactNative.View, { + ref: this.onNewsmemoryRef, + style: [_newsmemoryScreen.default.parent, parentStyle] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[48]).NewsmemoryLayoutManager, { + ref: this.onLayoutManagerRef, + navigation: navigation, + currentNewspaperManager: this.newsmemoryManager.currentNewspaperManager, + shortcutPriority: 1 + })); + } else { + component = _react.default.createElement(_$$_REQUIRE(_dependencyMap[49]).WallpaperLoading, { + showLoading: showLoading, + ignoreSafeArea: showLoading, + retryEvent: _events.default.PAPER_SETUP_API_RETRY + }); + } + + return _react.default.createElement(_reactNative.View, { + style: [_newsmemoryScreen.default.parent, parentStyle] + }, component, _react.default.createElement(_optionPageAccessibility.default, { + shortcutPriority: 100 + }), this._renderOptionsPage(), loaded ? _react.default.createElement(_specialSectionComponent.default, { + onOpen: this.onOptionPageOpened, + onClose: this.onOptionPageClosed, + newspaperManager: this.newsmemoryManager.currentNewspaperManager + }) : null); + } + }]); + return NewsmemoryScreen; + }(_$$_REQUIRE(_dependencyMap[50]).NavigationBaseScreen); + + exports.NewsmemoryScreen = NewsmemoryScreen; + NewsmemoryScreen.INTERSTITIAL_TIMER = undefined; + + NewsmemoryScreen.navigationOptions = function (_ref8) { + var navigation = _ref8.navigation; + var params = navigation.state.params; + return params; + }; + + NewsmemoryScreen.propTypes = { + navigation: _propTypes.default.object, + tab: _propTypes.default.string + }; +},2304,[5,80,6,41,7,8,15,90,12,14,16,17,201,28,460,1871,1872,1861,2305,2318,710,2319,714,603,431,2320,1859,2306,2134,2321,2326,2178,2147,2154,2328,2331,731,2335,572,1954,462,2151,1002,1889,730,1904,699,1953,2336,2427,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _optionspageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _IAPHelper = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _NewspaperManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[19])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _NewsmemoryManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _LoginManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getIapModule(), + IAPErrorCode = _OptionalPackages$get.IAPErrorCode; + + var Optionspage = function (_BaseOptionspage) { + (0, _inherits2.default)(Optionspage, _BaseOptionspage); + + var _super = _createSuper(Optionspage); + + function Optionspage(props) { + var _this; + + (0, _classCallCheck2.default)(this, Optionspage); + _this = _super.call(this, props); + _this.sendIAPTransactionResult = _this._sendIAPTransactionResult.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(Optionspage, [{ + key: "_onLoading", + value: function _onLoading(segments) { + var domain = segments.domain; + var closeType = this.state.closeType; + + var isTecnaviaDomain = _$$_REQUIRE(_dependencyMap[25]).StringUtils.isTecnaviaDomain(domain); + + if (!isTecnaviaDomain) { + this.setState({ + closeType: _optionspageUtils.closeTypes.back + }); + } else if (closeType !== _optionspageUtils.closeTypes.none) { + var isNewspaperLoaded = this.props.isNewspaperLoaded; + + var _global$getRSSActiveP = global.getRSSActivePSetup(), + rssIsEnabled = _global$getRSSActiveP.rssIsEnabled; + + var hideCloseButton = !rssIsEnabled && !isNewspaperLoaded() && !_$$_REQUIRE(_dependencyMap[26]).PaperSetupManager.isGenericAppConfigured(); + + if (hideCloseButton) { + this.setState({ + closeType: _optionspageUtils.closeTypes.none + }); + } else if (closeType !== _optionspageUtils.closeTypes.close) { + this.setState({ + closeType: _optionspageUtils.closeTypes.close + }); + } + } + } + }, { + key: "_openTab", + value: function _openTab(_ref) { + var tab = _ref.tab, + getParams = _ref.getParams, + url = _ref.url, + closeType = _ref.closeType, + forceFullscreen = _ref.forceFullscreen, + hidden = _ref.hidden; + + var isOnline = _$$_REQUIRE(_dependencyMap[25]).NetworkUtils.isOnline(); + + if (isOnline && tab === _optionspageUtils.tabs.specialsections) { + var newsmemoryManager = this.props.newsmemoryManager; + var currentNewspaperManager = newsmemoryManager.currentNewspaperManager; + + if (currentNewspaperManager) { + this.setState({ + uri: currentNewspaperManager.getSpecialSectionPage(true) + }); + } + } else { + (0, _get2.default)((0, _getPrototypeOf2.default)(Optionspage.prototype), "_openTab", this).call(this, { + tab: tab, + getParams: getParams, + url: url, + closeType: closeType, + forceFullscreen: forceFullscreen, + hidden: hidden + }); + } + } + }, { + key: "_goBack", + value: function _goBack() { + var getParams = this.props.getParams; + var params = (0, _extends2.default)({}, getParams, { + r: Math.floor(Math.random() * 1000) + }); + + this._openTab({ + tab: _optionspageUtils.tabs.home, + getParams: params + }); + } + }, { + key: "_appendOthersParams", + value: function _appendOthersParams() { + var getParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var newsmemoryManager = this.props.newsmemoryManager; + var currentNewspaperManager = newsmemoryManager.currentNewspaperManager; + + if (currentNewspaperManager && currentNewspaperManager.currentNewspaper) { + if (!getParams.edition) { + getParams.edition = currentNewspaperManager.currentNewspaper.getEdition(); + } + + if (!getParams.issue) { + getParams.issue = currentNewspaperManager.currentNewspaper.getIssue(); + } + } + + var _global$getActivePSet = global.getActivePSetup(), + external = _global$getActivePSet.external; + + if (external && !_$$_REQUIRE(_dependencyMap[26]).PaperSetupManager.isGenericAppConfigured()) { + var _global$getMainPSetup = global.getMainPSetup(), + pSetup = _global$getMainPSetup.pSetup; + + getParams.originalPSetup = pSetup; + } + + return getParams; + } + }, { + key: "_cancel", + value: function _cancel() { + this.close(true); + + if (this.currentUrl) { + var isNewspaperLoaded = this.props.isNewspaperLoaded; + + var currentTab = _optionspageUtils.default.getTabByURL(this.currentUrl); + + if (!isNewspaperLoaded() || currentTab && currentTab === _optionspageUtils.tabs.home) { + _$$_REQUIRE(_dependencyMap[27]).EventRegister.emit(_events.default.NEWSMEMORY_OPEN_OFFLINE_EDITION_MENU); + } + } + } + }, { + key: "_close", + value: function _close(force) { + var _this$props = this.props, + isNewspaperLoaded = _this$props.isNewspaperLoaded, + handleBackButton = _this$props.handleBackButton, + getParams = _this$props.getParams; + var newsmemoryConfig = global.getNewsmemoryConfig(); + var accessibilityModeEnabled = newsmemoryConfig.accessibilityModeEnabled; + + if (!force && accessibilityModeEnabled) { + newsmemoryConfig.setAccessibilityMode(false); + } + + newsmemoryConfig.setArchiveMode(false); + + if (force) { + this.setState({ + uri: null + }); + } else if (isNewspaperLoaded()) { + this.setState({ + uri: null + }); + } else { + var uri = this.state.uri; + + var _global$getRSSActiveP2 = global.getRSSActivePSetup(), + rssIsEnabled = _global$getRSSActiveP2.rssIsEnabled; + + var home = _optionspageUtils.default.getTabUrl(_optionspageUtils.tabs.home, this._appendOthersParams(getParams)); + + if (!_optionspageUtils.default.isSamePage(uri, home)) { + this._goBack(); + } else if (this.currentUrl && !_optionspageUtils.default.isSamePage(this.currentUrl, home)) { + this._resetToHome(); + } else if (rssIsEnabled) { + this.goToRssNavigator(); + } else if (_$$_REQUIRE(_dependencyMap[26]).PaperSetupManager.isGenericAppConfigured()) { + _NavigationService.default.main.navigate("PublicationsPageScreen"); + } else if (typeof handleBackButton === "function") { + handleBackButton(); + } + } + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd(nativeEvent) { + var newsmemoryConfig = global.getNewsmemoryConfig(); + var archiveModeEnabled = newsmemoryConfig.archiveModeEnabled; + + if (archiveModeEnabled) { + var currentTab = _optionspageUtils.default.getTabByURL(this.currentUrl); + + if (currentTab !== _optionspageUtils.tabs.login && currentTab !== _optionspageUtils.tabs.archive) { + newsmemoryConfig.setArchiveMode(false); + } + } + + (0, _get2.default)((0, _getPrototypeOf2.default)(Optionspage.prototype), "_onLoadEnd", this).call(this, nativeEvent); + } + }, { + key: "_loadPublication", + value: function _loadPublication(getParams) { + var external, + pSetup, + issue, + edition, + machine, + paperDomain, + _global$getActivePSet2, + currentPSetup, + _await$global$loadPSe, + config, + _args = arguments; + + return _regenerator.default.async(function _loadPublication$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + external = _args.length > 1 && _args[1] !== undefined ? _args[1] : false; + pSetup = getParams.pSetup, issue = getParams.issue, edition = getParams.edition, machine = getParams.machine; + paperDomain = getParams.paperDomain || machine; + _global$getActivePSet2 = global.getActivePSetup(), currentPSetup = _global$getActivePSet2.pSetup; + _context.next = 6; + return _regenerator.default.awrap(global.loadPSetup(pSetup, paperDomain, {}, external)); + + case 6: + _await$global$loadPSe = _context.sent; + config = _await$global$loadPSe.config; + + if (!config) { + _context.next = 20; + break; + } + + this._close(true); + + if (!(currentPSetup !== pSetup)) { + _context.next = 17; + break; + } + + _context.next = 13; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig()); + + case 13: + if (!external) { + _context.next = 16; + break; + } + + _context.next = 16; + return _regenerator.default.awrap(_GlobalConfig.default.initCustomFonts(config)); + + case 16: + Analytics.updateAnalyticsClientList(); + + case 17: + _$$_REQUIRE(_dependencyMap[27]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue, + edition: edition + }); + + _context.next = 21; + break; + + case 20: + _$$_REQUIRE(_dependencyMap[28]).Toast.show(global.strings("err_download_psetup")); + + case 21: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_handleLocals", + value: function _handleLocals(_ref2) { + var domain, getParams, newsmemoryConfig, newsmemoryManager, currentNewspaperManager, reloadLatestEdition, issues, savedIssues, accessibilityModeEnabled, archiveModeEnabled, pSetup, issue, edition, productId, invoiceId, editionId, period, isRecurring, model, _productId, transactionId, recurring, _productId2, result, _global$getActivePSet3, protectSite, loginStatus, _newsmemoryManager, url, callback, navigation; + + return _regenerator.default.async(function _handleLocals$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + domain = _ref2.domain, getParams = _ref2.getParams; + newsmemoryConfig = global.getNewsmemoryConfig(); + + if (!domain.includes(_optionspageUtils.locals.SET_RN_DEMO)) { + _context3.next = 17; + break; + } + + if (!_optionalPackageUtils.default.isIOSClassicEPaperAvailable()) { + _context3.next = 14; + break; + } + + _context3.next = 6; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.closeDatabase()); + + case 6: + newsmemoryManager = this.props.newsmemoryManager; + currentNewspaperManager = newsmemoryManager.currentNewspaperManager; + + if (!currentNewspaperManager) { + _context3.next = 11; + break; + } + + _context3.next = 11; + return _regenerator.default.awrap(currentNewspaperManager.closeCurrentEditionDatabase()); + + case 11: + newsmemoryConfig.setRNUseDemo(getParams.useRnDemo); + _context3.next = 15; + break; + + case 14: + _$$_REQUIRE(_dependencyMap[28]).Toast.show(global.strings("err_module_unavailable", { + module: "Classic eEdition" + })); + + case 15: + _context3.next = 138; + break; + + case 17: + if (!domain.includes(_optionspageUtils.locals.CLEAR_STORAGE)) { + _context3.next = 29; + break; + } + + _context3.prev = 18; + _context3.next = 21; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[29]).optionspageDeleteProcess)()); + + case 21: + reloadLatestEdition = _context3.sent; + + if (reloadLatestEdition) { + _$$_REQUIRE(_dependencyMap[27]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_LATEST_EDITION); + + this._close(true); + } else { + this._resetToHome(); + } + + _context3.next = 27; + break; + + case 25: + _context3.prev = 25; + _context3.t0 = _context3["catch"](18); + + case 27: + _context3.next = 138; + break; + + case 29: + if (!domain.includes(_optionspageUtils.locals.RESTORE_DEFAULT_SETTINGS)) { + _context3.next = 35; + break; + } + + _context3.next = 32; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[29]).askTo)(global.strings("msg_restore_default_settings"), function _callee() { + return _regenerator.default.async(function _callee$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return _regenerator.default.awrap(global.getNewsmemoryConfig().reset()); + + case 2: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + })); + + case 32: + this.reload(); + _context3.next = 138; + break; + + case 35: + if (!domain.includes(_optionspageUtils.locals.GET_SAVED_ISSUES)) { + _context3.next = 48; + break; + } + + _context3.prev = 36; + _context3.next = 39; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.getAllIssues()); + + case 39: + issues = _context3.sent; + savedIssues = issues.reduce(function (result, issue) { + result.push({ + edition: issue.getEdition(), + issue: issue.getIssue(), + paper: issue.getPaper(), + status: issue.getStatus() || 0 + }); + return result; + }, []); + + this._execJavaScript("xcj_getSavedIssues('" + JSON.stringify(savedIssues) + "');"); + + _context3.next = 46; + break; + + case 44: + _context3.prev = 44; + _context3.t1 = _context3["catch"](36); + + case 46: + _context3.next = 138; + break; + + case 48: + if (!domain.includes(_optionspageUtils.locals.DELETE_ISSUE)) { + _context3.next = 51; + break; + } + + _context3.next = 138; + break; + + case 51: + if (!domain.includes(_optionspageUtils.locals.INITPAGE_SET_NEWSPAPER_AND_READ)) { + _context3.next = 66; + break; + } + + accessibilityModeEnabled = newsmemoryConfig.accessibilityModeEnabled, archiveModeEnabled = newsmemoryConfig.archiveModeEnabled; + + if (!accessibilityModeEnabled) { + _context3.next = 57; + break; + } + + this.openTab({ + tab: _optionspageUtils.tabs.accessibility, + hidden: true + }); + _context3.next = 64; + break; + + case 57: + if (!archiveModeEnabled) { + _context3.next = 62; + break; + } + + newsmemoryConfig.setArchiveMode(false); + this.openTab({ + tab: _optionspageUtils.tabs.archive, + hidden: true, + getParams: { + hideTabs: 1 + } + }); + _context3.next = 64; + break; + + case 62: + _context3.next = 64; + return _regenerator.default.awrap(this._loadPublication(getParams)); + + case 64: + _context3.next = 138; + break; + + case 66: + if (!domain.includes(_optionspageUtils.locals.INITPAGE_SET_EXTERNAL_NEWSPAPER)) { + _context3.next = 71; + break; + } + + _context3.next = 69; + return _regenerator.default.awrap(this._loadPublication(getParams, true)); + + case 69: + _context3.next = 138; + break; + + case 71: + if (!domain.includes(_optionspageUtils.locals.LOAD_LATEST_PUBLICATION)) { + _context3.next = 74; + break; + } + + _context3.next = 138; + break; + + case 74: + if (!domain.includes(_optionspageUtils.locals.BUY)) { + _context3.next = 94; + break; + } + + if (!_optionalPackageUtils.default.isIapModuleAvailable()) { + _context3.next = 91; + break; + } + + pSetup = getParams.pSetup, issue = getParams.issue, edition = getParams.edition, productId = getParams.productID, invoiceId = getParams.invoiceID, editionId = getParams.editionid, period = getParams.period, isRecurring = getParams.isRecurring; + _context3.next = 79; + return _regenerator.default.awrap(_IAPHelper.default.setServerCallback(this.sendIAPTransactionResult)); + + case 79: + model = new (_$$_REQUIRE(_dependencyMap[30]).IAPTecnaviaModel)(); + model.setProductId(productId); + model.setInvoiceId(invoiceId); + model.setPSetup(pSetup); + model.setIssue(issue); + model.setEdition(edition); + model.setEditionId(editionId); + + if (period && (_$$_REQUIRE(_dependencyMap[25]).JSUtils.isNull(isRecurring) || isRecurring === "1")) { + model.setRecurringSubscriptionPeriod(period); + } + + if (period) { + model.setType(_$$_REQUIRE(_dependencyMap[30]).IAPTecnaviaType.SUBSCRIPTION); + } + + _IAPHelper.default.requestIAP(model); + + _context3.next = 92; + break; + + case 91: + this._execJavaScript("xc_failedTransaction_RN('','No IAP module present!');"); + + case 92: + _context3.next = 138; + break; + + case 94: + if (!domain.includes(_optionspageUtils.locals.RESUME_TRANSACTIONS)) { + _context3.next = 97; + break; + } + + _context3.next = 138; + break; + + case 97: + if (!domain.includes(_optionspageUtils.locals.FINISH_TRANSACTION)) { + _context3.next = 105; + break; + } + + if (!_optionalPackageUtils.default.isIapModuleAvailable()) { + _context3.next = 103; + break; + } + + _productId = getParams.productID, transactionId = getParams.finishTransaction, recurring = getParams.recurring; + + if (!(transactionId && _productId && !recurring)) { + _context3.next = 103; + break; + } + + _context3.next = 103; + return _regenerator.default.awrap(_IAPHelper.default.clearAll(_productId)); + + case 103: + _context3.next = 138; + break; + + case 105: + if (!domain.includes(_optionspageUtils.locals.RESTORE_COMPLETED_TRANSACTIONS)) { + _context3.next = 119; + break; + } + + if (!_optionalPackageUtils.default.isIapModuleAvailable()) { + _context3.next = 116; + break; + } + + _productId2 = getParams.productID; + _context3.next = 110; + return _regenerator.default.awrap(_IAPHelper.default.setServerCallback(this.sendIAPTransactionResult)); + + case 110: + _context3.next = 112; + return _regenerator.default.awrap(_IAPHelper.default.restoreTransactions(_productId2)); + + case 112: + result = _context3.sent; + + this._restoredTransactions(result); + + _context3.next = 117; + break; + + case 116: + this._execJavaScript("xc_failedTransaction_RN('','No IAP module present!');"); + + case 117: + _context3.next = 138; + break; + + case 119: + if (!domain.includes(_optionspageUtils.locals.OPEN_ACCESSIBILITY_MODE)) { + _context3.next = 126; + break; + } + + _global$getActivePSet3 = global.getActivePSetup(), protectSite = _global$getActivePSet3.protectSite, loginStatus = _global$getActivePSet3.loginStatus; + _newsmemoryManager = this.props.newsmemoryManager; + newsmemoryConfig.setAccessibilityMode(true); + + if (protectSite === 0 || loginStatus.isLoggedIn()) { + url = getParams.url, callback = getParams.callback; + + _NavigationService.default.main.navigate("WebScreen", { + url: url, + onClose: function onClose() { + _$$_REQUIRE(_dependencyMap[25]).PlatformUtils.colorBars(); + + newsmemoryConfig.setAccessibilityMode(false); + + if (_newsmemoryManager) { + _newsmemoryManager.load(); + } + }, + backAccessibilityLabel: global.strings("label_exit_accessibility_mode"), + screenTitle: global.strings("btn_accessibility"), + isAccessibilityMode: true + }); + + if (callback) { + this._execJavaScript(callback + "();"); + } + + this._close(true); + } else { + this.openTab({ + tab: _optionspageUtils.tabs.login, + hidden: false, + getParams: { + hideTabs: 1, + isRss: 1 + } + }); + } + + _context3.next = 138; + break; + + case 126: + if (!domain.includes(_optionspageUtils.locals.OPEN_NATIVE_SETTINGS_SCREEN)) { + _context3.next = 131; + break; + } + + navigation = this.props.navigation; + + if (navigation) { + navigation.navigate("GeneralSettingsScreen", { + module: _$$_REQUIRE(_dependencyMap[31]).GeneralSettingsModules.EPAPER + }); + } + + _context3.next = 138; + break; + + case 131: + if (!domain.includes(_optionspageUtils.locals.LOGOUT)) { + _context3.next = 137; + break; + } + + _context3.next = 134; + return _regenerator.default.awrap(_LoginManager.default.logout()); + + case 134: + _$$_REQUIRE(_dependencyMap[27]).EventRegister.emit(_events.default.NEWSMEMORY_RELOAD_EDITION); + + _context3.next = 138; + break; + + case 137: + (0, _get2.default)((0, _getPrototypeOf2.default)(Optionspage.prototype), "_handleLocals", this).call(this, { + domain: domain, + getParams: getParams + }); + + case 138: + case "end": + return _context3.stop(); + } + } + }, null, this, [[18, 25], [36, 44]], Promise); + } + }, { + key: "_sendIAPTransactionResult", + value: function _sendIAPTransactionResult(params) { + var status, error, model; + return _regenerator.default.async(function _sendIAPTransactionResult$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + status = params.status, error = params.error, model = params.model; + _context4.t0 = status; + _context4.next = _context4.t0 === _IAPHelper.IAP_STATUS.SUCCESS ? 4 : _context4.t0 === _IAPHelper.IAP_STATUS.RESTORED ? 6 : _context4.t0 === _IAPHelper.IAP_STATUS.FAILED ? 8 : 8; + break; + + case 4: + this._completedTransaction(model); + + return _context4.abrupt("break", 10); + + case 6: + this._restoredTransactions(); + + return _context4.abrupt("break", 10); + + case 8: + this._failedTransaction(model, error); + + return _context4.abrupt("break", 10); + + case 10: + return _context4.abrupt("return", true); + + case 11: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_failedTransaction", + value: function _failedTransaction(model, error) { + var message = _optionspageUtils.default.getIAPErrorMessage(error); + + this._execJavaScript("xc_failedTransaction_RN('" + (model ? model.productId : "") + "','" + message + "');"); + } + }, { + key: "_completedTransaction", + value: function _completedTransaction(model) { + return _regenerator.default.async(function _completedTransaction$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + if (!_optionalPackageUtils.default.isIapModuleAvailable()) { + _context5.next = 9; + break; + } + + if (!(model && model.productId)) { + _context5.next = 8; + break; + } + + if (!(!model.isRecurring() || !model.receipt)) { + _context5.next = 5; + break; + } + + _context5.next = 5; + return _regenerator.default.awrap(_IAPHelper.default.clearAll(model.productId)); + + case 5: + this._execJavaScript("xc_completeTransaction_RN('" + model.productId + "');"); + + _context5.next = 9; + break; + + case 8: + this._failedTransaction(model, { + code: IAPErrorCode.E_ITEM_UNAVAILABLE, + message: "Missing product identifier" + }); + + case 9: + case "end": + return _context5.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_restoredTransactions", + value: function _restoredTransactions(_ref3) { + var success = _ref3.success, + message = _ref3.message, + purchases = _ref3.purchases; + + if (!success) { + if (!message) { + message = "Restore transactions failed"; + } + + this._execJavaScript("xc_restoreTransactionFinished(\"" + message + "\");"); + } else { + this._execJavaScript("xc_restoreTransactionFinished();"); + } + } + }]); + return Optionspage; + }(_$$_REQUIRE(_dependencyMap[32]).BaseOptionspage); + + Optionspage.propTypes = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[32]).BaseOptionspage.propTypes, { + handleBackButton: _propTypes.default.func, + isNewspaperLoaded: _propTypes.default.func, + newsmemoryManager: _propTypes.default.instanceOf(_NewsmemoryManager.default) + }); + + var _default = function _default(props) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[33]).useNavigation)(); + return _react.default.createElement(Optionspage, (0, _extends2.default)({}, props, { + navigation: navigation + })); + }; + + exports.default = _default; +},2305,[5,80,6,7,8,15,90,12,14,16,17,201,730,460,1859,1934,710,714,2306,1871,1861,2318,2154,2057,731,462,1849,572,1889,2254,1937,2232,2297,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _NewsmemoryEditionsManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NewspaperIssue = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _DownloadManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _SingleImageDownloadOperation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _SingleZipDownloadOperation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _MultiZipDownloadOperation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _SingleHRZipDownloadOperation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _DownloadOperation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _newsmemoryUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[23])); + + var _optionspageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[24])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _TranslationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + var _PurgeManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[28])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[29])); + + var _IAPHelper = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[30])); + + var _LoginManager = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[31])); + + var _NewsmemoryToDTO = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[32])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var BULK_INSERT_TIMEOUT = 3000; + + var NewspaperManager = function () { + function NewspaperManager(pSetupConfig) { + (0, _classCallCheck2.default)(this, NewspaperManager); + this.lastHighQueuePriorityValue = 1; + var paper = pSetupConfig.xpaper, + machineForHR = pSetupConfig.machineForHR; + this.saveImages = this._saveImages.bind(this); + this.getDownloadProgress = this._getDownloadProgress.bind(this); + this.newspapers = []; + this.imageToStoreList = []; + this.insertTimeout = undefined; + this.editionsManager = new _NewsmemoryEditionsManager.default(paper); + this.downloadManager = new _DownloadManager.default(paper, machineForHR, this.saveImages); + this.downloadFullEditionActive = false; + this.downloadFullEdition = this._downloadFullEdition.bind(this); + this.downloadResource = this._downloadResource.bind(this); + this.saveDownloadHR = this._saveDownloadHR.bind(this); + this.downloadResourceHR = this._downloadResourceHR.bind(this); + this.generatePNG = this._generatePNG.bind(this); + this.clearQueueHR = this._clearQueueHR.bind(this); + this.restartQueueHR = this._restartQueueHR.bind(this); + this.resumeQueueHR = this._resumeQueueHR.bind(this); + this.pauseQueueHR = this._pauseQueueHR.bind(this); + this.closeCurrentDb = this._closeCurrentDb.bind(this); + this.clearQueueThumbnail = this._clearQueueThumbnail.bind(this); + this.connectionTypeChange = this._connectionTypeChange.bind(this); + this.triggerInitialDownload = this._triggerInitialDownload.bind(this); + this.refreshEdition = this._refreshEdition.bind(this); + this.updateCallback = this._updateCallback.bind(this); + this.onConnectionTypeListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.ON_CONNECTIVITY_CHANGE, this.connectionTypeChange); + this.onDownloadFullEditionListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_DOWNLOAD_FULL_EDITION, this.downloadFullEdition); + this.onDownloadResourceListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_REQUEST_DOWNLOAD_IMAGE, this.downloadResource); + this.onSaveDownloadHRListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_SAVE_HR, this.saveDownloadHR); + this.onDownloadResourceHRListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_REQUEST_DOWNLOAD_HR, this.downloadResourceHR); + this.onGeneratePNGListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_GENERATE_PNG, this.generatePNG); + this.onRestartQueueHRListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_RESTART_HIGH_RES_QUEUE, this.restartQueueHR); + this.onResumeQueueHRListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_RESUME_HIGH_RES_QUEUE, this.resumeQueueHR); + this.onPauseQueueHRListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_PAUSE_HIGH_RES_QUEUE, this.pauseQueueHR); + this.onClearQueueHRListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_CLEAR_HIGH_RES_QUEUE, this.clearQueueHR); + this.onClearQueueThumbnailListener = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.ON_THUMBNAIL_CLOSE, this.clearQueueThumbnail); + this.onCloseCurrentDb = _$$_REQUIRE(_dependencyMap[33]).EventRegister.on(_events.default.NEWSMEMORY_CLOSE_CURRENT_DB, this.closeCurrentDb); + } + + (0, _createClass2.default)(NewspaperManager, [{ + key: "init", + value: function init(pSetupConfig) { + var paper, downloadMultiZips, maxZipsToDownloadEachRequest; + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + paper = pSetupConfig.xpaper, downloadMultiZips = pSetupConfig.downloadMultiZips, maxZipsToDownloadEachRequest = pSetupConfig.maxZipsToDownloadEachRequest; + this.paper = paper; + this.lowSpeedDownload = false; + this.downloadMultiZips = downloadMultiZips; + this.maxZipsToDownloadEachRequest = maxZipsToDownloadEachRequest; + this.currentNewspaper = undefined; + this.currentPage = undefined; + this.lastHighQueuePriorityValue = 1; + this.resetPageCounters(); + this.resetPageHrCounters(); + _context.next = 12; + return _regenerator.default.awrap(this._resetBulkInsertTimeout(true)); + + case 12: + this.status = new (_$$_REQUIRE(_dependencyMap[34]).NewspaperStatus)(); + _context.next = 15; + return _regenerator.default.awrap(this.status.init(pSetupConfig, global.getNewsmemoryStartupParams())); + + case 15: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_downloadFullEdition", + value: function _downloadFullEdition() { + var _this = this; + + return _regenerator.default.async(function _downloadFullEdition$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this.downloadFullEditionActive = true; + this.loadPagesHRComponents(); + + if (this.downloadManager) { + this.downloadManager.startStandardPriorityQueue(); + this.downloadManager.onStandardPriorityQueueIdle().then(function () { + if (_this.failedDownloadOperations === 0) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_FULL_DOWNLOAD_FINISHED); + + _this.updateNewspaperStatus(_NewspaperIssue.DBStatus.HIGH_RES_DOWNLOADED); + } + + if (_this.downloadManager) { + _this.downloadManager.pauseStandardPriorityQueue(); + } + }); + } + + case 3: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getStatus", + value: function getStatus() { + return this.status; + } + }, { + key: "_downloadResource", + value: function _downloadResource(params) { + var pageId, pageFileName, type, callback, currentNewspaper, page, currentPage, imageToDownload, currentPageId, pageBoundaries, priority; + return _regenerator.default.async(function _downloadResource$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + pageId = params.pageId, pageFileName = params.pageFileName, type = params.type, callback = params.callback; + currentNewspaper = this.getCurrentNewspaper(); + + if (!currentNewspaper) { + _context3.next = 28; + break; + } + + page = currentNewspaper.getPages().find(function (aPage) { + return aPage.getPageId() === pageId && aPage.getFilename() === pageFileName; + }); + + if (!page) { + _context3.next = 26; + break; + } + + currentPage = this.getCurrentPage(); + imageToDownload = _newsmemoryUtils.default.getImageFromPage(page, type); + + if (!imageToDownload) { + _context3.next = 10; + break; + } + + _context3.next = 25; + break; + + case 10: + if (!currentPage) { + _context3.next = 25; + break; + } + + currentPageId = currentPage.getPageId(); + pageBoundaries = 2; + + if (pageId === currentPageId) { + priority = this.lastHighQueuePriorityValue + 1; + } else { + priority = _$$_REQUIRE(_dependencyMap[35]).JSUtils.inInterval(pageId, currentPageId - pageBoundaries, currentPageId + pageBoundaries) ? this.lastHighQueuePriorityValue : 0; + } + + imageToDownload = new _EPaperImage.default(); + imageToDownload.setPageId(pageId); + imageToDownload.setType(type); + _context3.prev = 17; + _context3.next = 20; + return _regenerator.default.awrap(this.downloadManager.loadImageInQueue(currentNewspaper, page, imageToDownload, true, priority)); + + case 20: + imageToDownload = _context3.sent; + _context3.next = 25; + break; + + case 23: + _context3.prev = 23; + _context3.t0 = _context3["catch"](17); + + case 25: + if (typeof callback === "function") { + callback(imageToDownload); + } + + case 26: + _context3.next = 28; + break; + + case 28: + case "end": + return _context3.stop(); + } + } + }, null, this, [[17, 23]], Promise); + } + }, { + key: "_downloadResourceHR", + value: function _downloadResourceHR(params) { + var issue, edition, pageId, xmlId, boxId, callback, graph, currentNewspaper, hrPage, priority, image; + return _regenerator.default.async(function _downloadResourceHR$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + issue = params.issue, edition = params.edition, pageId = params.pageId, xmlId = params.xmlId, boxId = params.boxId, callback = params.callback, graph = params.graph; + currentNewspaper = this.getCurrentNewspaper(); + + if (!currentNewspaper) { + _context4.next = 25; + break; + } + + if (!(issue === currentNewspaper.getIssue() && edition === currentNewspaper.getEdition())) { + _context4.next = 23; + break; + } + + hrPage = currentNewspaper.getEditionModel().getPages().find(function (page) { + return page.getPageId() === pageId; + }); + + if (!(hrPage && this.downloadManager)) { + _context4.next = 20; + break; + } + + _context4.prev = 6; + this.downloadHrOperations += 1; + priority = this.getCurrentPage().getPageId() === pageId ? 2 : 1; + _context4.next = 11; + return _regenerator.default.awrap(this.downloadManager.loadHRImageInQueue(currentNewspaper, hrPage, xmlId, boxId, priority, graph)); + + case 11: + image = _context4.sent; + + if (_$$_REQUIRE(_dependencyMap[35]).NetworkUtils.isOnline()) { + if (image) { + this.completedHrDownloadOperations += 1; + + if (this.failedHrDownloadOperations > 0) { + this.partialCompletedHrDownloadOperations += 1; + + if (this.partialCompletedHrDownloadOperations >= 10) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_HR_DOWNLOAD_SUCCESS); + + this.partialCompletedHrDownloadOperations = 0; + } + } + } else { + this.failedHrDownloadOperations += 1; + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_HR_DOWNLOAD_ERROR); + } + } + + if (typeof callback === "function") { + callback(image); + } + + _context4.next = 18; + break; + + case 16: + _context4.prev = 16; + _context4.t0 = _context4["catch"](6); + + case 18: + _context4.next = 21; + break; + + case 20: + if (!hrPage) {} + + case 21: + _context4.next = 23; + break; + + case 23: + _context4.next = 25; + break; + + case 25: + case "end": + return _context4.stop(); + } + } + }, null, this, [[6, 16]], Promise); + } + }, { + key: "_saveDownloadHR", + value: function _saveDownloadHR(params) { + var newspaper, page, xmlId, boxId, graph, callback, invalidateCallback, imagePath, _await$getImageSize, width, height, relativePathToImage, imageName, image; + + return _regenerator.default.async(function _saveDownloadHR$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + newspaper = params.newspaper, page = params.page, xmlId = params.xmlId, boxId = params.boxId, graph = params.graph, callback = params.callback, invalidateCallback = params.invalidateCallback; + + if (!(newspaper && page)) { + _context5.next = 28; + break; + } + + imagePath = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(newspaper.getPaper(), newspaper.getIssue()) + page.getFilename() + "/" + _newsmemoryUtils.default.getHrImageName(xmlId, boxId, graph); + _context5.next = 5; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[36]).getImageSize)("file://" + imagePath)); + + case 5: + _await$getImageSize = _context5.sent; + width = _await$getImageSize.width; + height = _await$getImageSize.height; + relativePathToImage = imagePath.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + imageName = _tecnaviaFileUtils.default.getFilename(imagePath); + image = new _EPaperImage.default(); + image.setPageId(page.getPageId()); + image.setName(imageName); + image.setTypeByName(imageName); + image.setBase64(relativePathToImage); + image.setWidth(width); + image.setHeight(height); + page.addImage(image); + + if (!_$$_REQUIRE(_dependencyMap[35]).PlatformUtils.isAndroid()) { + _context5.next = 26; + break; + } + + _context5.next = 21; + return _regenerator.default.awrap(this.downloadManager.addWatermark(imagePath, image, page, xmlId)); + + case 21: + _context5.t0 = _context5.sent; + + if (!_context5.t0) { + _context5.next = 24; + break; + } + + _context5.t0 = typeof invalidateCallback === "function"; + + case 24: + if (!_context5.t0) { + _context5.next = 26; + break; + } + + invalidateCallback(); + + case 26: + if (typeof callback === "function") { + callback(); + } + + this.saveImages([image], newspaper); + + case 28: + case "end": + return _context5.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_connectionTypeChange", + value: function _connectionTypeChange() { + if (this.downloadManager) { + var isHighSpeedNetwork = _$$_REQUIRE(_dependencyMap[35]).NetworkUtils.isHighSpeedNetwork(); + + this.downloadManager.setHighPriorityQueuePoolSize(!isHighSpeedNetwork); + this.downloadManager.setStandardQueuePoolSize(!isHighSpeedNetwork); + } + } + }, { + key: "_closeCurrentDb", + value: function _closeCurrentDb() { + this.closeCurrentEditionDatabase(); + } + }, { + key: "_clearQueueThumbnail", + value: function _clearQueueThumbnail() { + if (this.downloadManager) { + this.downloadManager.clearThumbnailQueue(); + } + } + }, { + key: "_clearQueueHR", + value: function _clearQueueHR(params) { + var newspaper; + return _regenerator.default.async(function _clearQueueHR$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + if (this.downloadManager) { + newspaper = this.getCurrentNewspaper(); + this.downloadManager.startHighResDownloadQueue(this.lowSpeedDownload || !newspaper || !newspaper.isNewspaperCompleteForMode()); + + if (params && typeof params.callback === "function") { + params.callback(); + } + } + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_restartQueueHR", + value: function _restartQueueHR() { + if (this.downloadManager) { + this.downloadManager.restartHighResQueue(); + } + } + }, { + key: "_resumeQueueHR", + value: function _resumeQueueHR() { + if (this.downloadManager) { + this.downloadManager.resumeHighResQueue(); + } + } + }, { + key: "_pauseQueueHR", + value: function _pauseQueueHR() { + if (this.downloadManager) { + this.downloadManager.pauseHighResQueue(); + } + } + }, { + key: "_generatePNG", + value: function _generatePNG(params) { + var issue, edition, pageId, pageFileName, callback, currentNewspaper, page, imageToGenerate; + return _regenerator.default.async(function _generatePNG$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + issue = params.issue, edition = params.edition, pageId = params.pageId, pageFileName = params.pageFileName, callback = params.callback; + currentNewspaper = this.getCurrentNewspaper(); + + if (!currentNewspaper) { + _context7.next = 16; + break; + } + + if (!(issue === currentNewspaper.getIssue() && edition === currentNewspaper.getEdition())) { + _context7.next = 14; + break; + } + + page = currentNewspaper.getPages().find(function (aPage) { + return aPage.getPageId() === pageId && aPage.getFilename() === pageFileName; + }); + + if (!page) { + _context7.next = 12; + break; + } + + imageToGenerate = _newsmemoryUtils.default.getImageFromPage(page, _EPaperImage.EPaperImageType.PNG); + + if (imageToGenerate) { + _context7.next = 11; + break; + } + + _context7.next = 10; + return _regenerator.default.awrap(this.downloadManager.generateTextPngFromImages(currentNewspaper, page, page.getImages())); + + case 10: + imageToGenerate = page.getPNGImage(); + + case 11: + if (typeof callback === "function") { + callback(imageToGenerate); + } + + case 12: + _context7.next = 14; + break; + + case 14: + _context7.next = 16; + break; + + case 16: + case "end": + return _context7.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "resetPageCounters", + value: function resetPageCounters() { + this.downloadOperations = 0; + this.downloadOperationsWeight = 0; + this.completedDownloadOperations = 0; + this.completedDownloadOperationsWeight = 0; + this.failedDownloadOperations = 0; + this.advancedPagesNumber = 0; + } + }, { + key: "resetPageHrCounters", + value: function resetPageHrCounters() { + this.downloadHrOperations = 0; + this.completedHrDownloadOperations = 0; + this.partialCompletedHrDownloadOperations = 0; + this.failedHrDownloadOperations = 0; + } + }, { + key: "unregister", + value: function unregister() { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onClearQueueThumbnailListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onCloseCurrentDb); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onConnectionTypeListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onDownloadFullEditionListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onDownloadResourceListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onSaveDownloadHRListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onDownloadResourceHRListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onRestartQueueHRListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onResumeQueueHRListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onPauseQueueHRListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onClearQueueHRListener); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.rm(this.onGeneratePNGListener); + } + }, { + key: "loadNewspaper", + value: function loadNewspaper(newspaperIssue) { + var dbFilename, dbIssue, dbEdition, dbSecret, edition; + return _regenerator.default.async(function loadNewspaper$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + if (!newspaperIssue) { + _context8.next = 16; + break; + } + + dbFilename = newspaperIssue.dbFilename, dbIssue = newspaperIssue.dbIssue, dbEdition = newspaperIssue.dbEdition, dbSecret = newspaperIssue.dbSecret; + _context8.next = 4; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(dbFilename)); + + case 4: + if (!_context8.sent) { + _context8.next = 16; + break; + } + + _context8.prev = 5; + this.editionsManager.initDatabase(dbFilename); + _context8.next = 9; + return _regenerator.default.awrap(this.editionsManager.getEdition(dbIssue, dbEdition, dbSecret)); + + case 9: + edition = _context8.sent; + + if (edition) { + newspaperIssue.setEditionModel(edition); + this.addNewspaper(newspaperIssue); + } + + return _context8.abrupt("return", !!edition); + + case 14: + _context8.prev = 14; + _context8.t0 = _context8["catch"](5); + + case 16: + return _context8.abrupt("return", false); + + case 17: + case "end": + return _context8.stop(); + } + } + }, null, this, [[5, 14]], Promise); + } + }, { + key: "addNewspaper", + value: function addNewspaper(newspaper) { + if (this.newspapers) { + this.newspapers.push(newspaper); + } + } + }, { + key: "removeNewspaper", + value: function removeNewspaper(newspaper) { + if (newspaper && this.newspapers) { + var index = this.newspapers.findIndex(function (item) { + return item && item.getIssue() === newspaper.getIssue() && item.getEdition() === newspaper.getEdition(); + }); + delete this.newspapers[index]; + + if (this.currentNewspaper && this.currentNewspaper.equals(newspaper)) { + this.currentNewspaper = undefined; + } + } + } + }, { + key: "setCurrentNewspaper", + value: function setCurrentNewspaper(newspaper) { + this.currentNewspaper = newspaper; + var newsmemoryConfig = global.getNewsmemoryConfig(); + + if (newsmemoryConfig) { + newsmemoryConfig.setLastOperationTimestamp(); + } + + if (this.status) { + var dbIssue = newspaper.dbIssue, + dbEdition = newspaper.dbEdition; + this.status.setLastIssue(dbIssue); + this.status.setLastEdition(dbEdition); + } + } + }, { + key: "getCurrentNewspaper", + value: function getCurrentNewspaper() { + return this.currentNewspaper; + } + }, { + key: "setCurrentPage", + value: function setCurrentPage(pageId) { + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + var pages = currentNewspaper.getPages(); + this.lastHighQueuePriorityValue += 1; + this.currentPage = pageId ? pages.find(function (page) { + return page.getPageId() === pageId; + }) : pages[0]; + + if (this.currentPage) { + this.status.setLastPageNumber(this.currentPage.getPage()); + } + } + } + }, { + key: "getCurrentPage", + value: function getCurrentPage() { + return this.currentPage; + } + }, { + key: "getNewspaper", + value: function getNewspaper(issue, edition) { + var newspapers, newspaper; + return _regenerator.default.async(function getNewspaper$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + newspapers = this.newspapers.filter(function (item) { + return item.getIssue() === issue && item.getEdition() === edition; + }); + + if (!(newspapers.length > 0)) { + _context9.next = 3; + break; + } + + return _context9.abrupt("return", newspapers[0]); + + case 3: + _context9.next = 5; + return _regenerator.default.awrap(this.getNewspaperFromDB(issue, edition)); + + case 5: + newspaper = _context9.sent; + return _context9.abrupt("return", newspaper); + + case 7: + case "end": + return _context9.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getNewspaperFromDB", + value: function getNewspaperFromDB(issue, edition) { + var newspaper; + return _regenerator.default.async(function getNewspaperFromDB$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.prev = 0; + _context10.next = 3; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.getIssue(this.paper, issue, edition)); + + case 3: + newspaper = _context10.sent; + _context10.next = 6; + return _regenerator.default.awrap(this.loadNewspaper(newspaper)); + + case 6: + if (!_context10.sent) { + _context10.next = 8; + break; + } + + return _context10.abrupt("return", newspaper); + + case 8: + _context10.next = 13; + break; + + case 10: + _context10.prev = 10; + _context10.t0 = _context10["catch"](0); + + if (_context10.t0.message === "Issue not found") {} else {} + + case 13: + return _context10.abrupt("return", null); + + case 14: + case "end": + return _context10.stop(); + } + } + }, null, this, [[0, 10]], Promise); + } + }, { + key: "updateNewspaper", + value: function updateNewspaper(newspaper) { + var index = this.newspapers.findIndex(function (_ref) { + var issue = _ref.issue, + edition = _ref.edition; + return issue === newspaper.issue && edition === newspaper.edition; + }); + + if (index >= 0) { + this.newspapers[index] = newspaper; + } else { + this.newspapers.push(newspaper); + } + } + }, { + key: "updatePageVisibility", + value: function updatePageVisibility(newspaper) { + var _global$getActivePSet = global.getActivePSetup(), + seeNewspaperPreview = _global$getActivePSet.seeNewspaperPreview; + + if (seeNewspaperPreview && newspaper) { + var editionModel = newspaper.getEditionModel(); + + if (editionModel) { + var pages = editionModel.getPages(true); + + if (pages.length > 0) { + var updatedPages = 0; + + var numberOfPreviewPages = _newsmemoryUtils.default.numberOfPagesInTrialMode(newspaper.getIssue(), newspaper.getEdition()); + + pages.forEach(function (page, index) { + var visible = true; + var prot = false; + + if (numberOfPreviewPages > -1) { + visible = index < numberOfPreviewPages; + prot = index >= numberOfPreviewPages - 1; + } + + if (page.isVisible() !== visible || page.isProtected() !== prot) { + updatedPages++; + page.setVisible(visible); + page.setProtected(prot); + } + }); + + if (updatedPages > 0) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_UPDATE_STARTED, { + needUpdate: updatedPages > 0 + }); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_UPDATE_FINISHED, { + success: true + }); + } + } + } + } + } + }, { + key: "savePages", + value: function savePages(_ref2, pages) { + var dbFilename; + return _regenerator.default.async(function savePages$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + dbFilename = _ref2.dbFilename; + this.editionsManager.initDatabase(dbFilename); + return _context11.abrupt("return", this.editionsManager.savePages(pages)); + + case 3: + case "end": + return _context11.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "savePage", + value: function savePage(page) { + return _regenerator.default.async(function savePage$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + return _context12.abrupt("return", this.savePages(this.getCurrentNewspaper(), [page])); + + case 1: + case "end": + return _context12.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "insertPages", + value: function insertPages(_ref3, pages) { + var dbFilename; + return _regenerator.default.async(function insertPages$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + dbFilename = _ref3.dbFilename; + this.editionsManager.initDatabase(dbFilename); + return _context13.abrupt("return", this.editionsManager.insertPages(pages)); + + case 3: + case "end": + return _context13.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "insertPage", + value: function insertPage(page) { + return _regenerator.default.async(function insertPage$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + return _context14.abrupt("return", this.insertPages(this.getCurrentNewspaper(), [page])); + + case 1: + case "end": + return _context14.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removePages", + value: function removePages(newspaper, pages) { + var dbFilename, i, page; + return _regenerator.default.async(function removePages$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + _context15.prev = 0; + dbFilename = newspaper.dbFilename; + this.editionsManager.initDatabase(dbFilename); + _context15.next = 5; + return _regenerator.default.awrap(this.editionsManager.removePages(pages)); + + case 5: + _context15.next = 7; + return _regenerator.default.awrap(this.editionsManager.removeImagesForPages(pages)); + + case 7: + _context15.next = 9; + return _regenerator.default.awrap(this.editionsManager.removeArticlesForPages(pages)); + + case 9: + i = 0; + + case 10: + if (!(i < pages.length)) { + _context15.next = 19; + break; + } + + page = pages[i]; + newspaper.getEditionModel().removePage(page); + + _TranslationManager.default.resetTranslationsForPage(newspaper, page); + + _context15.next = 16; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink("" + (_NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(newspaper.getPaper(), newspaper.getIssue()) + page.filename))); + + case 16: + i++; + _context15.next = 10; + break; + + case 19: + _context15.next = 23; + break; + + case 21: + _context15.prev = 21; + _context15.t0 = _context15["catch"](0); + + case 23: + case "end": + return _context15.stop(); + } + } + }, null, this, [[0, 21]], Promise); + } + }, { + key: "removePage", + value: function removePage(page) { + return _regenerator.default.async(function removePage$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + return _context16.abrupt("return", this.removePages(this.getCurrentNewspaper(), [page])); + + case 1: + case "end": + return _context16.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_saveImages", + value: function _saveImages(images, newspaper) { + var dbFilename, currentNewspaper; + return _regenerator.default.async(function _saveImages$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + if (newspaper) { + dbFilename = newspaper.getFilename(); + } else { + currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + dbFilename = currentNewspaper.getFilename(); + } + } + + if (!dbFilename) { + _context17.next = 3; + break; + } + + return _context17.abrupt("return", this.saveImagesInDB(dbFilename, images)); + + case 3: + return _context17.abrupt("return", undefined); + + case 4: + case "end": + return _context17.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeImagesForPages", + value: function removeImagesForPages(_ref4, pages) { + var dbFilename; + return _regenerator.default.async(function removeImagesForPages$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + dbFilename = _ref4.dbFilename; + this.editionsManager.initDatabase(dbFilename); + return _context18.abrupt("return", this.editionsManager.removeImagesForPages(pages)); + + case 3: + case "end": + return _context18.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeImagesForPage", + value: function removeImagesForPage(page) { + return _regenerator.default.async(function removeImagesForPage$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + return _context19.abrupt("return", this.removeImagesForPages(this.getCurrentNewspaper(), [page])); + + case 1: + case "end": + return _context19.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeArticlesForPages", + value: function removeArticlesForPages(_ref5, pages) { + var dbFilename; + return _regenerator.default.async(function removeArticlesForPages$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + dbFilename = _ref5.dbFilename; + this.editionsManager.initDatabase(dbFilename); + return _context20.abrupt("return", this.editionsManager.removeImagesForPages(pages)); + + case 3: + case "end": + return _context20.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeArticlesForPage", + value: function removeArticlesForPage(page) { + return _regenerator.default.async(function removeArticlesForPage$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + return _context21.abrupt("return", this.removeArticlesForPages(this.getCurrentNewspaper(), [page])); + + case 1: + case "end": + return _context21.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "saveImagesInDB", + value: function saveImagesInDB(dbFilename, images) { + var _this2 = this; + + var synchronous, + _args22 = arguments; + return _regenerator.default.async(function saveImagesInDB$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + synchronous = _args22.length > 2 && _args22[2] !== undefined ? _args22[2] : false; + + if (!synchronous) { + _context22.next = 4; + break; + } + + this.editionsManager.initDatabase(dbFilename); + return _context22.abrupt("return", this.editionsManager.saveImages(images)); + + case 4: + this.imageToStoreList.push({ + dbFilename: dbFilename, + images: images + }); + + this._resetBulkInsertTimeout(false); + + this.insertTimeout = setTimeout(function () { + _this2._storeIntoDb(); + }, BULK_INSERT_TIMEOUT); + return _context22.abrupt("return", undefined); + + case 8: + case "end": + return _context22.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_resetBulkInsertTimeout", + value: function _resetBulkInsertTimeout(storeBeforeClear) { + return _regenerator.default.async(function _resetBulkInsertTimeout$(_context23) { + while (1) { + switch (_context23.prev = _context23.next) { + case 0: + if (this.insertTimeout) { + clearTimeout(this.insertTimeout); + this.insertTimeout = undefined; + } + + if (!(this.imageToStoreList && this.imageToStoreList.length && storeBeforeClear)) { + _context23.next = 4; + break; + } + + _context23.next = 4; + return _regenerator.default.awrap(this._storeIntoDb()); + + case 4: + case "end": + return _context23.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_storeIntoDb", + value: function _storeIntoDb() { + var _this3 = this; + + var promises, organizedImages; + return _regenerator.default.async(function _storeIntoDb$(_context24) { + while (1) { + switch (_context24.prev = _context24.next) { + case 0: + promises = []; + + if (this.imageToStoreList.length) { + organizedImages = this.imageToStoreList.reduce(function (result, item) { + var _result$item$dbFilena; + + if (!result[item.dbFilename]) { + result[item.dbFilename] = []; + } + + (_result$item$dbFilena = result[item.dbFilename]).push.apply(_result$item$dbFilena, (0, _toConsumableArray2.default)(item.images)); + + return result; + }, {}); + promises = Object.keys(organizedImages).map(function (key) { + if (_this3.editionsManager) { + _this3.editionsManager.initDatabase(key); + + return _this3.editionsManager.saveImages(organizedImages[key]); + } + + return Promise.resolve(); + }); + this.imageToStoreList = []; + } + + return _context24.abrupt("return", Promise.all(promises)); + + case 3: + case "end": + return _context24.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getPageByFilename", + value: function getPageByFilename(dbFilename, filename) { + var page; + return _regenerator.default.async(function getPageByFilename$(_context25) { + while (1) { + switch (_context25.prev = _context25.next) { + case 0: + _context25.prev = 0; + this.editionsManager.initDatabase(dbFilename); + _context25.next = 4; + return _regenerator.default.awrap(this.editionsManager.getPageByFilename(filename)); + + case 4: + page = _context25.sent; + return _context25.abrupt("return", page); + + case 8: + _context25.prev = 8; + _context25.t0 = _context25["catch"](0); + return _context25.abrupt("return", null); + + case 11: + case "end": + return _context25.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "getLatestIssue", + value: function getLatestIssue(edition) { + var issues; + return _regenerator.default.async(function getLatestIssue$(_context26) { + while (1) { + switch (_context26.prev = _context26.next) { + case 0: + _context26.prev = 0; + _context26.next = 3; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.getIssues(edition)); + + case 3: + issues = _context26.sent; + + if (!(Array.isArray(issues) && issues.length > 0)) { + _context26.next = 6; + break; + } + + return _context26.abrupt("return", issues[0]); + + case 6: + _context26.next = 10; + break; + + case 8: + _context26.prev = 8; + _context26.t0 = _context26["catch"](0); + + case 10: + return _context26.abrupt("return", null); + + case 11: + case "end": + return _context26.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + }, { + key: "getEditions", + value: function getEditions(issue) { + var editions; + return _regenerator.default.async(function getEditions$(_context27) { + while (1) { + switch (_context27.prev = _context27.next) { + case 0: + _context27.prev = 0; + _context27.next = 3; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.getEditions(issue)); + + case 3: + editions = _context27.sent; + + if (!(Array.isArray(editions) && editions.length > 0)) { + _context27.next = 6; + break; + } + + return _context27.abrupt("return", editions.map(function (edition) { + return edition.edition; + })); + + case 6: + _context27.next = 10; + break; + + case 8: + _context27.prev = 8; + _context27.t0 = _context27["catch"](0); + + case 10: + return _context27.abrupt("return", []); + + case 11: + case "end": + return _context27.stop(); + } + } + }, null, null, [[0, 8]], Promise); + } + }, { + key: "insertIssueDBIntoDatabases", + value: function insertIssueDBIntoDatabases(db, issue, edition, secret, network) { + var success; + return _regenerator.default.async(function insertIssueDBIntoDatabases$(_context28) { + while (1) { + switch (_context28.prev = _context28.next) { + case 0: + success = false; + _context28.prev = 1; + _context28.next = 4; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.insertIssue(db, this.paper, issue, edition, secret, undefined, network)); + + case 4: + success = _context28.sent; + _context28.next = 9; + break; + + case 7: + _context28.prev = 7; + _context28.t0 = _context28["catch"](1); + + case 9: + return _context28.abrupt("return", success); + + case 10: + case "end": + return _context28.stop(); + } + } + }, null, this, [[1, 7]], Promise); + } + }, { + key: "clearQueues", + value: function clearQueues() { + this.resetPageCounters(); + this.resetPageHrCounters(); + + if (this.downloadManager) { + this.downloadManager.clearQueues(); + } + } + }, { + key: "_handleLastPageNumberAndArticle", + value: function _handleLastPageNumberAndArticle(newspaper) { + var lastPageId; + var _this$status = this.status, + lastPageNumber = _this$status.lastPageNumber, + lastArticleId = _this$status.lastArticleId; + + if (lastPageNumber) { + if (newspaper) { + var editionModel = newspaper.getEditionModel(); + + if (editionModel) { + var firstPage = editionModel.getFirstPage(); + + if (firstPage && lastPageNumber !== firstPage.getPage()) { + var lastPage = _pageUtils.default.getPageByPageNumber(editionModel.getPages(), lastPageNumber); + + if (lastPage) { + lastPageId = lastPage.getPageId(); + + if (lastArticleId) { + var _decodeArticleId = (0, _$$_REQUIRE(_dependencyMap[37]).decodeArticleId)(lastArticleId), + pageId = _decodeArticleId.pageId, + xmlId = _decodeArticleId.xmlId; + + if (pageId === 0) { + var articles = lastPage.getArticles(); + + if (articles && articles.length > 0) { + var article = articles.find(function (currentArticle) { + return currentArticle.getXmlId() === xmlId; + }); + + if (article) { + this.status.setLastArticleId((0, _$$_REQUIRE(_dependencyMap[37]).getArticleId)(article)); + } else { + this.status.resetLastArticleId(); + } + } + } + } + } + } + } + } else {} + } + + this.setCurrentPage(lastPageId); + } + }, { + key: "checkResponseHeaders", + value: function checkResponseHeaders(responseHeaders) { + if (responseHeaders) { + var warningHeader = responseHeaders["Ta-Validation-Warning"] || responseHeaders["ta-validation-warning"]; + + if (warningHeader) { + try { + var params = JSON.parse(warningHeader); + var warning = parseInt(params.warning || "0", 10); + + switch (warning) { + case _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_WARNING_CODES.SUBSCRIPTION_WARNING: + _IAPHelper.default.autoRestoreSubscription(); + + break; + + case _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_WARNING_CODES.VALIDATION_WARNING: + if (params.edition) { + params.edition = _$$_REQUIRE(_dependencyMap[35]).StringUtils.decodeURIComponent(params.edition); + } + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.validation, + getParams: params + }); + + break; + } + } catch (e) {} + } + } + } + }, { + key: "downloadNewspaper", + value: function downloadNewspaper(issue, edition) { + var _this4 = this; + + var success, downloadedDB, _this$status2, lastIssue, lastEdition, newspaper, currentNewspaper, changed, _global$getActivePSet2, paper, enableAppendFirstPages, enableSessionCollection, seeNewspaperPreview, disableLowSpeedLimit, lowSpeedLimit, maxZipsToDownloadEachRequest, demoIssue, loginStatus, showLoadInAdvance, synchronousCDNCall, result, appendFirstPages, _await$this$downloadM, db, rawPages, secret, speed, responseHeaders, pages, _loop, i, images, _i, editionModel, editionPages, advancedPagesFilenames, _i2, j, page, NO_GRANTS, NO_GRANTS_ALLOWED_IP, INVALID_ZIP, NO_ZIP, code, message, params, isAllowedIP, otherParams, getParams, _await$LoginManager$a, userid, purgeTask, loaded, _newspaper, dbStatus; + + return _regenerator.default.async(function downloadNewspaper$(_context30) { + while (1) { + switch (_context30.prev = _context30.next) { + case 0: + success = false; + downloadedDB = false; + this.clearQueues(); + this.advancedPagesNumber = 0; + _this$status2 = this.status, lastIssue = _this$status2.lastIssue, lastEdition = _this$status2.lastEdition; + + if (!(lastIssue && lastEdition && (lastIssue !== issue || lastEdition !== edition))) { + _context30.next = 8; + break; + } + + _context30.next = 8; + return _regenerator.default.awrap(this.status.reset()); + + case 8: + _context30.next = 10; + return _regenerator.default.awrap(this.getNewspaper(issue, edition)); + + case 10: + newspaper = _context30.sent; + currentNewspaper = this.getCurrentNewspaper(); + changed = !(currentNewspaper && newspaper && newspaper.equals(currentNewspaper)); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_NEWSPAPER_LOADING, { + changed: changed + }); + + _global$getActivePSet2 = global.getActivePSetup(), paper = _global$getActivePSet2.paper, enableAppendFirstPages = _global$getActivePSet2.enableAppendFirstPages, enableSessionCollection = _global$getActivePSet2.enableSessionCollection, seeNewspaperPreview = _global$getActivePSet2.seeNewspaperPreview, disableLowSpeedLimit = _global$getActivePSet2.disableLowSpeedLimit, lowSpeedLimit = _global$getActivePSet2.lowSpeedLimit, maxZipsToDownloadEachRequest = _global$getActivePSet2.maxZipsToDownloadEachRequest, demoIssue = _global$getActivePSet2.demoIssue, loginStatus = _global$getActivePSet2.loginStatus; + + if (changed && enableSessionCollection) { + _$$_REQUIRE(_dependencyMap[39]).NewspaperSessionManager.flushActiveSession(); + } + + showLoadInAdvance = false; + _context30.t0 = loginStatus; + _context30.next = 20; + return _regenerator.default.awrap(_IAPHelper.default.validateReceipt(loginStatus.receipt)); + + case 20: + if (!_context30.sent) { + _context30.next = 24; + break; + } + + _context30.t1 = _IAPHelper.IAP_SECRET; + _context30.next = 25; + break; + + case 24: + _context30.t1 = undefined; + + case 25: + _context30.t2 = _context30.t1; + + _context30.t0.setIAPSecret.call(_context30.t0, _context30.t2); + + if (!_$$_REQUIRE(_dependencyMap[35]).NetworkUtils.isOnline()) { + _context30.next = 38; + break; + } + + synchronousCDNCall = seeNewspaperPreview || !newspaper && issue === demoIssue; + + if (!synchronousCDNCall) { + _context30.next = 37; + break; + } + + if (newspaper) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_UPDATE_REQUESTED); + } else { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.CLOSE_OPTIONSPAGE); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_DB_DOWNLOAD_STARTED); + + showLoadInAdvance = true; + } + + _context30.next = 33; + return _regenerator.default.awrap(this.downloadManager.updateCDNStatus(issue, edition)); + + case 33: + result = _context30.sent; + + if (result) { + this.checkResponseHeaders(result.headers); + } + + _context30.next = 38; + break; + + case 37: + this.downloadManager.updateCDNStatus(issue, edition).then(function (result) { + if (result) { + _this4.checkResponseHeaders(result.headers); + } + }); + + case 38: + if (newspaper) { + _context30.next = 166; + break; + } + + if (!showLoadInAdvance) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.CLOSE_OPTIONSPAGE); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_DB_DOWNLOAD_STARTED); + } + + _context30.prev = 40; + appendFirstPages = enableAppendFirstPages && !_newsmemoryUtils.default.isModeLow(); + _context30.next = 44; + return _regenerator.default.awrap(this.downloadManager.downloadEditionDB(issue, edition, appendFirstPages)); + + case 44: + _await$this$downloadM = _context30.sent; + db = _await$this$downloadM.db; + rawPages = _await$this$downloadM.pages; + secret = _await$this$downloadM.secret; + speed = _await$this$downloadM.speed; + responseHeaders = _await$this$downloadM.responseHeaders; + (0, _$$_REQUIRE(_dependencyMap[40]).sendNewsmemoryDownloadIpaddb)(paper, issue, edition, speed); + this.checkResponseHeaders(responseHeaders); + + if (!disableLowSpeedLimit && speed > 0) { + if (speed < lowSpeedLimit) { + _Api.default.set2GTimeout(); + + this.lowSpeedDownload = true; + } else if (speed < 2 * lowSpeedLimit) { + _Api.default.set3GTimeout(); + + this.downloadMultiZips = 0; + } else { + _Api.default.set4GTimeout(); + + if (speed < 4 * lowSpeedLimit) { + this.maxZipsToDownloadEachRequest = 4; + } else if (speed < 8 * lowSpeedLimit) { + this.maxZipsToDownloadEachRequest = 8; + } + } + + this.maxZipsToDownloadEachRequest = Math.min(this.maxZipsToDownloadEachRequest, maxZipsToDownloadEachRequest); + } + + if (this.downloadManager) { + this.downloadManager.setHighPriorityQueuePoolSize(this.lowSpeedDownload); + this.downloadManager.setStandardQueuePoolSize(this.lowSpeedDownload); + } + + if (!db) { + _context30.next = 95; + break; + } + + downloadedDB = true; + pages = []; + + if (!rawPages) { + _context30.next = 66; + break; + } + + _loop = function _callee(i) { + var images, _rawPages$i, name, rawImages, page, watermarkPromises; + + return _regenerator.default.async(function _callee$(_context29) { + while (1) { + switch (_context29.prev = _context29.next) { + case 0: + images = []; + _rawPages$i = rawPages[i], name = _rawPages$i.name, rawImages = _rawPages$i.images; + _context29.next = 4; + return _regenerator.default.awrap(_this4.getPageByFilename(db, name)); + + case 4: + page = _context29.sent; + + if (!page) { + _context29.next = 13; + break; + } + + watermarkPromises = []; + rawImages.forEach(function (rawImage) { + var imageName = rawImage.name, + imagePath = rawImage.path, + width = rawImage.width, + height = rawImage.height; + var image = new _EPaperImage.default(); + image.setPageId(page.pageId); + image.setWidth(width); + image.setHeight(height); + image.setTypeByName(imageName); + var relativePathToImage = imagePath.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + image.setBase64(relativePathToImage); + images.push(image); + watermarkPromises.push(_this4.downloadManager.addWatermark(imagePath, image, page)); + }); + + if (!(watermarkPromises.length > 0)) { + _context29.next = 11; + break; + } + + _context29.next = 11; + return _regenerator.default.awrap(Promise.all(watermarkPromises)); + + case 11: + page.setImages(images); + pages.push(page); + + case 13: + case "end": + return _context29.stop(); + } + } + }, null, null, null, Promise); + }; + + i = 0; + + case 60: + if (!(i < rawPages.length)) { + _context30.next = 66; + break; + } + + _context30.next = 63; + return _regenerator.default.awrap(_loop(i)); + + case 63: + i++; + _context30.next = 60; + break; + + case 66: + _context30.next = 68; + return _regenerator.default.awrap(this.insertIssueDBIntoDatabases(db, issue, edition, secret, this.lowSpeedDownload ? _newsmemoryUtils.DownloadType.LOW_ONLY : undefined)); + + case 68: + if (!_context30.sent) { + _context30.next = 95; + break; + } + + this.advancedPagesNumber = pages.length; + + if (!(this.advancedPagesNumber > 0)) { + _context30.next = 75; + break; + } + + images = []; + + for (_i = 0; _i < this.advancedPagesNumber; _i++) { + images.push.apply(images, (0, _toConsumableArray2.default)(pages[_i].getImages())); + } + + _context30.next = 75; + return _regenerator.default.awrap(this.saveImagesInDB(db, images, true)); + + case 75: + _context30.next = 77; + return _regenerator.default.awrap(this.getNewspaperFromDB(issue, edition)); + + case 77: + newspaper = _context30.sent; + + if (!(newspaper && !newspaper.isEmpty())) { + _context30.next = 95; + break; + } + + editionModel = newspaper.getEditionModel(); + + if (!editionModel) { + _context30.next = 93; + break; + } + + editionPages = editionModel.getPages(); + advancedPagesFilenames = pages.map(function (page) { + return page.getFilename(); + }); + _i2 = 0, j = 0; + + case 84: + if (!(_i2 < editionPages.length && j < advancedPagesFilenames.length)) { + _context30.next = 93; + break; + } + + page = editionPages[_i2]; + + if (!(page && advancedPagesFilenames.includes(page.getFilename()))) { + _context30.next = 90; + break; + } + + _context30.next = 89; + return _regenerator.default.awrap(this.downloadManager.generateTextPngFromImages(newspaper, page, page.getImages())); + + case 89: + j += 1; + + case 90: + _i2++; + _context30.next = 84; + break; + + case 93: + this.setCurrentNewspaper(newspaper); + success = true; + + case 95: + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_DB_DOWNLOAD_FINISHED); + + if (!success) { + _context30.next = 100; + break; + } + + this._handleLastPageNumberAndArticle(newspaper); + + _context30.next = 103; + break; + + case 100: + _context30.next = 102; + return _regenerator.default.awrap(this.deleteCurrentEditionDatabase()); + + case 102: + return _context30.abrupt("return", { + success: false, + downloadedDB: downloadedDB + }); + + case 103: + _context30.next = 164; + break; + + case 105: + _context30.prev = 105; + _context30.t3 = _context30["catch"](40); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_DB_DOWNLOAD_FINISHED); + + if (!(_context30.t3 instanceof _$$_REQUIRE(_dependencyMap[38]).DownloadError)) { + _context30.next = 163; + break; + } + + NO_GRANTS = _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_ERROR_CODES.NO_GRANTS, NO_GRANTS_ALLOWED_IP = _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_ERROR_CODES.NO_GRANTS_ALLOWED_IP, INVALID_ZIP = _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_ERROR_CODES.INVALID_ZIP, NO_ZIP = _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_ERROR_CODES.NO_ZIP; + code = _context30.t3.code, message = _context30.t3.message, params = _context30.t3.params; + isAllowedIP = params.isAllowedIP, otherParams = (0, _objectWithoutProperties2.default)(params, ["isAllowedIP"]); + getParams = _optionspageUtils.default.getOptionspageGetParams(otherParams); + + if (!(code === NO_GRANTS)) { + _context30.next = 143; + break; + } + + if (!(isAllowedIP && isAllowedIP === _$$_REQUIRE(_dependencyMap[35]).NetworkUtils.getIP())) { + _context30.next = 133; + break; + } + + _context30.prev = 115; + _context30.next = 118; + return _regenerator.default.awrap(_LoginManager.default.autoLogin()); + + case 118: + _await$LoginManager$a = _context30.sent; + userid = _await$LoginManager$a.userid; + loginStatus.updateTAUID(userid); + loginStatus.setIsAllowedIPUser(true); + _context30.next = 130; + break; + + case 124: + _context30.prev = 124; + _context30.t4 = _context30["catch"](115); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.validation, + getParams: getParams + }); + + _context30.next = 129; + return _regenerator.default.awrap(this.status.reset()); + + case 129: + throw _context30.t3; + + case 130: + throw new (_$$_REQUIRE(_dependencyMap[38]).DownloadError)(NO_GRANTS_ALLOWED_IP, "No grants but allowed IP"); + + case 133: + if (!(loginStatus.isLoggedIn() && loginStatus.isAllowedIPUser())) { + _context30.next = 137; + break; + } + + _context30.next = 136; + return _regenerator.default.awrap(_LoginManager.default.resetAllowedIP()); + + case 136: + if (!loginStatus.isLoggedIn()) { + getParams.valErrCode = _LoginManager.PROT_ERROR.NOT_LOGGEDIN; + } + + case 137: + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.validation, + getParams: getParams + }); + + _context30.next = 140; + return _regenerator.default.awrap(this.status.reset()); + + case 140: + throw _context30.t3; + + case 141: + _context30.next = 163; + break; + + case 143: + if (!(code === INVALID_ZIP)) { + _context30.next = 159; + break; + } + + _context30.prev = 144; + purgeTask = new _PurgeManager.default(); + _context30.next = 148; + return _regenerator.default.awrap(purgeTask.purgeIssue(issue)); + + case 148: + this.removeNewspaper(newspaper); + _context30.next = 153; + break; + + case 151: + _context30.prev = 151; + _context30.t5 = _context30["catch"](144); + + case 153: + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home, + getParams: getParams + }); + + _context30.next = 156; + return _regenerator.default.awrap(this.status.reset()); + + case 156: + throw _context30.t3; + + case 159: + if (!(code === NO_ZIP)) { + _context30.next = 163; + break; + } + + _context30.next = 162; + return _regenerator.default.awrap(this.status.reset()); + + case 162: + throw _context30.t3; + + case 163: + return _context30.abrupt("return", { + success: false, + downloadedDB: downloadedDB + }); + + case 164: + _context30.next = 173; + break; + + case 166: + if (!newspaper.isEmpty()) { + _context30.next = 172; + break; + } + + _context30.next = 169; + return _regenerator.default.awrap(this.loadNewspaper(newspaper)); + + case 169: + loaded = _context30.sent; + + if (loaded) { + _context30.next = 172; + break; + } + + throw new Error("Unable to reload newspaper model"); + + case 172: + if (!newspaper.isEmpty()) { + this.setCurrentNewspaper(newspaper); + _newspaper = newspaper, dbStatus = _newspaper.dbStatus; + + if (dbStatus === _NewspaperIssue.DBStatus.PAPER_BACKGROUND_DOWNLOADED) {} + + this._handleLastPageNumberAndArticle(newspaper); + + success = true; + } + + case 173: + this.currentDownloadRef = Math.round(Math.random() * 1000000); + this.downloadManager.startHighResDownloadQueue(this.lowSpeedDownload || !newspaper.isNewspaperCompleteForMode()); + + if (success) { + this.updatePageVisibility(newspaper); + + if (changed) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_NEWSPAPER_CHANGED, { + newspaper: newspaper + }); + } + } + + return _context30.abrupt("return", { + success: success, + downloadedDB: downloadedDB + }); + + case 177: + case "end": + return _context30.stop(); + } + } + }, null, this, [[40, 105], [115, 124], [144, 151]], Promise); + } + }, { + key: "loadPagesLow", + value: function loadPagesLow() { + var _this5 = this; + + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper && this.downloadManager) { + var operations = []; + + var _pages = currentNewspaper.getPages(); + + _pages.forEach(function (page, index) { + var lowImage = _this5.downloadManager.checkPageComponentsToDownload(page).find(function (image) { + return image.isLow(); + }); + + if (lowImage) { + var lowPriority = 3 + (index === 0 ? 6 : 0); + operations.push(new _SingleImageDownloadOperation.default({ + page: page, + image: lowImage + }, lowPriority, _this5.currentDownloadRef)); + } + }); + + this.loadPagesOperations(operations); + } + } + }, { + key: "loadPagesComponents", + value: function loadPagesComponents() { + var _this6 = this; + + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper && this.downloadManager) { + var operations = []; + + var _pages2 = currentNewspaper.getPages(); + + var operationsIndex = 0; + + _pages2.forEach(function (page) { + var imagesToDownload = _this6.downloadManager.checkPageComponentsToDownload(page); + + if (imagesToDownload.length > 1) { + if (_this6.downloadMultiZips) { + if (!operations[operationsIndex]) { + operations[operationsIndex] = new _MultiZipDownloadOperation.default([], 1, _this6.currentDownloadRef); + } + + if (operations[operationsIndex].getNumberOfPages() === _this6.maxZipsToDownloadEachRequest) { + operationsIndex += 1; + operations[operationsIndex] = new _MultiZipDownloadOperation.default([], 1, _this6.currentDownloadRef); + } + + operations[operationsIndex].addPage(page); + } else { + operations[operationsIndex] = new _SingleZipDownloadOperation.default(page, 0, _this6.currentDownloadRef); + operationsIndex += 1; + } + } else if (imagesToDownload.length === 1) { + operations[operationsIndex] = new _SingleImageDownloadOperation.default({ + page: page, + image: imagesToDownload[0] + }, 0, _this6.currentDownloadRef); + operationsIndex += 1; + } else { + _this6.downloadOperations += 1; + _this6.downloadOperationsWeight += 1; + _this6.completedDownloadOperations += 1; + _this6.completedDownloadOperationsWeight += 1; + } + }); + + this.loadPagesOperations(operations); + } + } + }, { + key: "loadPagesOperations", + value: function loadPagesOperations(operations) { + var _this7 = this; + + var _loop2 = function _loop2(i) { + var operation = operations[i]; + var priority = operation.getPriority(); + var resource = operation.getResource(); + _this7.downloadOperations += 1; + _this7.downloadOperationsWeight += operation.getWeight(); + + if (operation instanceof _MultiZipDownloadOperation.default) { + _this7.downloadMultiZip(resource, 1).then(function (images) { + if (images && images.length > 0) {} else { + _this7.failedDownloadOperations++; + } + + _this7.updateCompletedDownloadOperations(operation); + }); + } else if (operation instanceof _SingleZipDownloadOperation.default) { + _this7.downloadSingleZip(resource, priority).then(function (images) { + if (images && images.length > 0) {} else { + _this7.failedDownloadOperations++; + } + + _this7.updateCompletedDownloadOperations(operation); + }); + } else if (operation instanceof _SingleHRZipDownloadOperation.default) { + _this7.downloadHRImages(resource, priority).then(function (images) { + if (images && images.length > 0) {} else { + _this7.failedDownloadOperations++; + } + + _this7.updateCompletedDownloadOperations(operation); + }); + } else if (operation instanceof _SingleImageDownloadOperation.default) { + var page = resource.page, + image = resource.image; + + _this7.downloadSingleImage(page, image, priority).then(function (downloadedImage) { + if (downloadedImage) {} else { + _this7.failedDownloadOperations++; + } + + _this7.updateCompletedDownloadOperations(operation); + }); + } + }; + + for (var i = 0; i < operations.length; i++) { + _loop2(i); + } + } + }, { + key: "loadPagesHRComponents", + value: function loadPagesHRComponents() { + var _this8 = this; + + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + var operations = []; + + var _pages3 = currentNewspaper.getPages(); + + _pages3.forEach(function (page) { + if (_this8.downloadManager.checkPageHRImagesToDownload(page).length > 0) { + operations.push(new _SingleHRZipDownloadOperation.default(page, 0, _this8.currentDownloadRef)); + } else { + _this8.downloadOperations += 1; + _this8.downloadOperationsWeight += 1; + _this8.completedDownloadOperations += 1; + _this8.completedDownloadOperationsWeight += 1; + } + }); + + this.loadPagesOperations(operations); + } + } + }, { + key: "downloadMultiZip", + value: function downloadMultiZip(pages) { + var priority, + _args31 = arguments; + return _regenerator.default.async(function downloadMultiZip$(_context31) { + while (1) { + switch (_context31.prev = _context31.next) { + case 0: + priority = _args31.length > 1 && _args31[1] !== undefined ? _args31[1] : 0; + return _context31.abrupt("return", this.downloadManager.loadMultiZipInQueue(this.getCurrentNewspaper(), pages, false, priority)); + + case 2: + case "end": + return _context31.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "downloadSingleZip", + value: function downloadSingleZip(page) { + var priority, + _args32 = arguments; + return _regenerator.default.async(function downloadSingleZip$(_context32) { + while (1) { + switch (_context32.prev = _context32.next) { + case 0: + priority = _args32.length > 1 && _args32[1] !== undefined ? _args32[1] : 0; + return _context32.abrupt("return", this.downloadManager.loadZipInQueue(this.getCurrentNewspaper(), page, false, priority)); + + case 2: + case "end": + return _context32.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "downloadHRImages", + value: function downloadHRImages(page) { + var priority, + _args33 = arguments; + return _regenerator.default.async(function downloadHRImages$(_context33) { + while (1) { + switch (_context33.prev = _context33.next) { + case 0: + priority = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : 0; + return _context33.abrupt("return", this.downloadManager.loadHRImagesInQueue(this.getCurrentNewspaper(), page, false, priority)); + + case 2: + case "end": + return _context33.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "downloadSingleImage", + value: function downloadSingleImage(page, image) { + var priority, + _args34 = arguments; + return _regenerator.default.async(function downloadSingleImage$(_context34) { + while (1) { + switch (_context34.prev = _context34.next) { + case 0: + priority = _args34.length > 2 && _args34[2] !== undefined ? _args34[2] : 0; + return _context34.abrupt("return", this.downloadManager.loadImageInQueue(this.getCurrentNewspaper(), page, image, false, priority)); + + case 2: + case "end": + return _context34.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "downloadThumbnailImageOnQueue", + value: function downloadThumbnailImageOnQueue(page, image) { + return _regenerator.default.async(function downloadThumbnailImageOnQueue$(_context35) { + while (1) { + switch (_context35.prev = _context35.next) { + case 0: + return _context35.abrupt("return", this.downloadManager.loadThumbnailInQueue(this.getCurrentNewspaper(), page, image)); + + case 1: + case "end": + return _context35.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "clearThumbnailQueue", + value: function clearThumbnailQueue() { + this.downloadManager.clearThumbnailQueue(); + } + }, { + key: "getCurrentVersionOfPage", + value: function getCurrentVersionOfPage(page) { + var filename = page.filename; + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + var edition = currentNewspaper.getEditionModel(); + + if (edition) { + return edition.getPages(true).find(function (_ref6) { + var currentFilename = _ref6.filename; + return currentFilename === filename; + }); + } + } + + return undefined; + } + }, { + key: "analyzePagesToUpdate", + value: function analyzePagesToUpdate(updatedPages) { + var metadataChanged = []; + var pagesChanged = []; + var pagesAdded = []; + var pagesDeleted = []; + + for (var i = 0; i < updatedPages.length; i++) { + var updatedPage = updatedPages[i]; + var currentPage = this.getCurrentVersionOfPage(updatedPage); + + if (currentPage) { + if (currentPage.modifyTime === updatedPage.modifyTime) { + if (!_pageUtils.default.comparePages(currentPage, updatedPage)) { + metadataChanged.push({ + oldPage: currentPage, + newPage: updatedPage + }); + } + } else { + pagesChanged.push({ + oldPage: currentPage, + newPage: updatedPage + }); + } + } else { + pagesAdded.push(updatedPage); + } + } + + if (this.getCurrentNewspaper() && this.getCurrentNewspaper().getEditionModel()) { + var currentPages = this.getCurrentNewspaper().getEditionModel().getPages(); + + var _loop3 = function _loop3(_i3) { + var currentPage = currentPages[_i3]; + var currentFilename = currentPage.filename; + + if (!updatedPages.find(function (_ref7) { + var filename = _ref7.filename; + return currentFilename === filename; + })) { + pagesDeleted.push(currentPage); + } + }; + + for (var _i3 = 0; _i3 < currentPages.length; _i3++) { + _loop3(_i3); + } + } + + return { + metadataChanged: metadataChanged, + pagesChanged: pagesChanged, + pagesAdded: pagesAdded, + pagesDeleted: pagesDeleted + }; + } + }, { + key: "updatePageMetadata", + value: function updatePageMetadata(currentPage, updatedPage) { + return _regenerator.default.async(function updatePageMetadata$(_context36) { + while (1) { + switch (_context36.prev = _context36.next) { + case 0: + updatedPage.setPageId(currentPage.getPageId()); + updatedPage.setIssueId(currentPage.getIssueId()); + updatedPage.setImages(currentPage.getImages()); + updatedPage.setArticles(currentPage.getArticles()); + + if (this.getCurrentNewspaper() && this.getCurrentNewspaper().getEditionModel()) { + this.getCurrentNewspaper().getEditionModel().updatePage(updatedPage); + } + + _context36.next = 7; + return _regenerator.default.awrap(this.savePage(updatedPage)); + + case 7: + case "end": + return _context36.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "replacePage", + value: function replacePage(currentPage, updatedPage) { + var _this$getCurrentNewsp, editionModel, dbFilename, articles, updatedPageFromDb; + + return _regenerator.default.async(function replacePage$(_context37) { + while (1) { + switch (_context37.prev = _context37.next) { + case 0: + _context37.prev = 0; + _this$getCurrentNewsp = this.getCurrentNewspaper(), editionModel = _this$getCurrentNewsp.editionModel, dbFilename = _this$getCurrentNewsp.dbFilename; + _context37.next = 4; + return _regenerator.default.awrap(this.retrieveArticlesForPages(updatedPage.getFilename())); + + case 4: + articles = _context37.sent; + + if (!(articles && articles.length)) { + _context37.next = 25; + break; + } + + _context37.next = 8; + return _regenerator.default.awrap(this.removePage(currentPage)); + + case 8: + updatedPage.setIssueId(editionModel.getIssueId()); + _context37.next = 11; + return _regenerator.default.awrap(this.insertPage(updatedPage)); + + case 11: + _context37.next = 13; + return _regenerator.default.awrap(this.getPageByFilename(dbFilename, updatedPage.getFilename())); + + case 13: + updatedPageFromDb = _context37.sent; + + if (!updatedPageFromDb) { + _context37.next = 23; + break; + } + + articles.forEach(function (article) { + article.setPageId(updatedPageFromDb.getPageId()); + }); + _context37.next = 18; + return _regenerator.default.awrap(this.editionsManager.saveArticles(articles)); + + case 18: + updatedPageFromDb.setArticles(articles); + updatedPageFromDb.setImages([]); + editionModel.updatePage(updatedPageFromDb); + _context37.next = 23; + break; + + case 23: + _context37.next = 25; + break; + + case 25: + _context37.next = 29; + break; + + case 27: + _context37.prev = 27; + _context37.t0 = _context37["catch"](0); + + case 29: + case "end": + return _context37.stop(); + } + } + }, null, this, [[0, 27]], Promise); + } + }, { + key: "addPage", + value: function addPage(page) { + var _this$getCurrentNewsp2, editionModel, dbFilename, newPage, articles; + + return _regenerator.default.async(function addPage$(_context38) { + while (1) { + switch (_context38.prev = _context38.next) { + case 0: + _this$getCurrentNewsp2 = this.getCurrentNewspaper(), editionModel = _this$getCurrentNewsp2.editionModel, dbFilename = _this$getCurrentNewsp2.dbFilename; + page.setIssueId(editionModel.getIssueId()); + _context38.prev = 2; + _context38.next = 5; + return _regenerator.default.awrap(this.insertPage(page)); + + case 5: + _context38.next = 7; + return _regenerator.default.awrap(this.getPageByFilename(dbFilename, page.getFilename())); + + case 7: + newPage = _context38.sent; + + if (!newPage) { + _context38.next = 21; + break; + } + + editionModel.updatePage(newPage); + _context38.next = 12; + return _regenerator.default.awrap(this.retrieveArticlesForPages(newPage.getFilename())); + + case 12: + _context38.t0 = _context38.sent; + + if (_context38.t0) { + _context38.next = 15; + break; + } + + _context38.t0 = []; + + case 15: + articles = _context38.t0; + articles.forEach(function (article) { + article.setPageId(newPage.getPageId()); + }); + _context38.next = 19; + return _regenerator.default.awrap(this.editionsManager.saveArticles(articles)); + + case 19: + newPage.setArticles(articles); + newPage.setImages([]); + + case 21: + _context38.next = 25; + break; + + case 23: + _context38.prev = 23; + _context38.t1 = _context38["catch"](2); + + case 25: + case "end": + return _context38.stop(); + } + } + }, null, this, [[2, 23]], Promise); + } + }, { + key: "retrieveArticlesForPages", + value: function retrieveArticlesForPages(pageFileName) { + var _this$getCurrentNewsp3, editionModel, secret, articles; + + return _regenerator.default.async(function retrieveArticlesForPages$(_context39) { + while (1) { + switch (_context39.prev = _context39.next) { + case 0: + _context39.prev = 0; + _this$getCurrentNewsp3 = this.getCurrentNewspaper(), editionModel = _this$getCurrentNewsp3.editionModel, secret = _this$getCurrentNewsp3.dbSecret; + _context39.next = 4; + return _regenerator.default.awrap(_DownloadManager.default.downloadArticles(editionModel.getIssue(), editionModel.getEdition(), pageFileName, secret)); + + case 4: + articles = _context39.sent; + return _context39.abrupt("return", articles); + + case 8: + _context39.prev = 8; + _context39.t0 = _context39["catch"](0); + return _context39.abrupt("return", undefined); + + case 11: + case "end": + return _context39.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "closeCurrentEditionDatabase", + value: function closeCurrentEditionDatabase() { + return _regenerator.default.async(function closeCurrentEditionDatabase$(_context40) { + while (1) { + switch (_context40.prev = _context40.next) { + case 0: + _context40.next = 2; + return _regenerator.default.awrap(this.editionsManager.closeDatabase()); + + case 2: + return _context40.abrupt("return", true); + + case 3: + case "end": + return _context40.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "deleteCurrentEditionDatabase", + value: function deleteCurrentEditionDatabase() { + return _regenerator.default.async(function deleteCurrentEditionDatabase$(_context41) { + while (1) { + switch (_context41.prev = _context41.next) { + case 0: + _context41.next = 2; + return _regenerator.default.awrap(this.editionsManager.closeDatabase()); + + case 2: + _context41.next = 4; + return _regenerator.default.awrap(this.editionsManager.deleteDatabase()); + + case 4: + return _context41.abrupt("return", true); + + case 5: + case "end": + return _context41.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_refreshEdition", + value: function _refreshEdition() { + var _this9 = this; + + var newspaper, + paper, + issue, + edition, + onCancel, + onRetry, + onReset, + _await$this$downloadN, + success, + NO_ZIP, + code, + params, + getParams, + _args43 = arguments; + + return _regenerator.default.async(function _refreshEdition$(_context43) { + while (1) { + switch (_context43.prev = _context43.next) { + case 0: + newspaper = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : this.getCurrentNewspaper(); + + if (!newspaper) { + _context43.next = 32; + break; + } + + this.removeNewspaper(newspaper); + paper = newspaper.getPaper(); + issue = newspaper.getIssue(); + edition = newspaper.getEdition(); + _context43.prev = 6; + _context43.next = 9; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.deleteIssue(paper, issue, edition)); + + case 9: + _context43.next = 11; + return _regenerator.default.awrap(this.deleteCurrentEditionDatabase()); + + case 11: + _context43.next = 13; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink("" + _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue))); + + case 13: + _TranslationManager.default.resetTranslationsForIssue(newspaper); + + _context43.next = 18; + break; + + case 16: + _context43.prev = 16; + _context43.t0 = _context43["catch"](6); + + case 18: + onCancel = function onCancel() { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home, + getParams: { + edition: edition + } + }); + }; + + onRetry = function onRetry() { + _this9.refreshEdition(newspaper); + }; + + onReset = function _callee2() { + return _regenerator.default.async(function _callee2$(_context42) { + while (1) { + switch (_context42.prev = _context42.next) { + case 0: + _context42.next = 2; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[41]).deleteData)()); + + case 2: + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue, + edition: edition + }); + + case 3: + case "end": + return _context42.stop(); + } + } + }, null, null, null, Promise); + }; + + _context43.prev = 21; + _context43.next = 24; + return _regenerator.default.awrap(this.downloadNewspaper(issue, edition)); + + case 24: + _await$this$downloadN = _context43.sent; + success = _await$this$downloadN.success; + + if (success) { + this.loadPages(true); + } else { + _newsmemoryUtils.default.showDownloadDBErrorDialog(issue, edition, onRetry, onCancel, onReset); + } + + _context43.next = 32; + break; + + case 29: + _context43.prev = 29; + _context43.t1 = _context43["catch"](21); + + if (_context43.t1 instanceof _$$_REQUIRE(_dependencyMap[38]).DownloadError) { + NO_ZIP = _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_ERROR_CODES.NO_ZIP; + code = _context43.t1.code, params = _context43.t1.params; + + if (code === NO_ZIP) { + getParams = _optionspageUtils.default.getOptionspageGetParams(params); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home, + getParams: getParams + }); + } + } else { + _newsmemoryUtils.default.showDownloadDBErrorDialog(issue, edition, onRetry, onCancel, onReset); + } + + case 32: + case "end": + return _context43.stop(); + } + } + }, null, this, [[6, 16], [21, 29]], Promise); + } + }, { + key: "updateIndex", + value: function updateIndex() { + var success, currentNewspaper, _global$getActivePSet3, seeNewspaperPreview, _await$this$downloadM2, index, customIndex, newsmemoryLiteIssue, editionModel, customIndexChanged, currentCustomIndexMTime, serverCustomIndexMTime, wasLite, issueId, isLite, updatedPages, _this$analyzePagesToU, metadataChanged, pagesChanged, pagesAdded, pagesDeleted, totalChangedOrAdded, percentageOfChanges, _global$getActivePSet4, updateDBPercentage, totalChanged, needUpdate, i, _metadataChanged$i, oldPage, newPage, _i4, _pagesChanged$_i, _oldPage, _newPage, _i5, _i6, lastPageNumber; + + return _regenerator.default.async(function updateIndex$(_context44) { + while (1) { + switch (_context44.prev = _context44.next) { + case 0: + success = false; + _context44.prev = 1; + currentNewspaper = this.getCurrentNewspaper(); + _global$getActivePSet3 = global.getActivePSetup(), seeNewspaperPreview = _global$getActivePSet3.seeNewspaperPreview; + + if (!seeNewspaperPreview) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_UPDATE_REQUESTED); + } + + _context44.next = 7; + return _regenerator.default.awrap(this.downloadManager.downloadIndex(currentNewspaper)); + + case 7: + _await$this$downloadM2 = _context44.sent; + index = _await$this$downloadM2.index; + customIndex = _await$this$downloadM2.customIndex; + newsmemoryLiteIssue = _await$this$downloadM2.newsmemoryLiteIssue; + editionModel = currentNewspaper.getEditionModel(); + customIndexChanged = false; + + if (editionModel.getCustomIndexHtml() && customIndex && customIndex.mtime) { + currentCustomIndexMTime = editionModel.getCustomIndexModifyTime() >> 1 << 1; + serverCustomIndexMTime = parseInt(customIndex.mtime, 10) >> 1 << 1; + customIndexChanged = currentCustomIndexMTime !== serverCustomIndexMTime; + } else if (customIndex && customIndex.mtime) { + customIndexChanged = true; + } + + wasLite = editionModel.isLite; + issueId = editionModel.getIssueId(); + isLite = newsmemoryLiteIssue === 1; + editionModel.setIsLite(isLite); + + if (!(wasLite && !isLite)) { + _context44.next = 23; + break; + } + + _context44.next = 21; + return _regenerator.default.awrap(this.editionsManager.removeLite(issueId)); + + case 21: + _context44.next = 26; + break; + + case 23: + if (!(!wasLite && isLite)) { + _context44.next = 26; + break; + } + + _context44.next = 26; + return _regenerator.default.awrap(this.editionsManager.addLite(issueId, isLite)); + + case 26: + updatedPages = _NewsmemoryToDTO.default.parseIndex(index); + _this$analyzePagesToU = this.analyzePagesToUpdate(updatedPages), metadataChanged = _this$analyzePagesToU.metadataChanged, pagesChanged = _this$analyzePagesToU.pagesChanged, pagesAdded = _this$analyzePagesToU.pagesAdded, pagesDeleted = _this$analyzePagesToU.pagesDeleted; + totalChangedOrAdded = metadataChanged.length + pagesChanged.length + pagesAdded.length; + percentageOfChanges = totalChangedOrAdded / updatedPages.length * 100; + _global$getActivePSet4 = global.getActivePSetup(), updateDBPercentage = _global$getActivePSet4.updateDBPercentage; + + if (!(percentageOfChanges > updateDBPercentage || customIndexChanged)) { + _context44.next = 34; + break; + } + + this.refreshEdition(); + return _context44.abrupt("return", false); + + case 34: + totalChanged = totalChangedOrAdded + pagesDeleted.length; + needUpdate = totalChanged > 0 || wasLite !== isLite; + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_UPDATE_STARTED, { + needUpdate: needUpdate + }); + + if (!(totalChanged > 0)) { + _context44.next = 73; + break; + } + + i = 0; + + case 39: + if (!(i < metadataChanged.length)) { + _context44.next = 46; + break; + } + + _metadataChanged$i = metadataChanged[i], oldPage = _metadataChanged$i.oldPage, newPage = _metadataChanged$i.newPage; + _context44.next = 43; + return _regenerator.default.awrap(this.updatePageMetadata(oldPage, newPage)); + + case 43: + i++; + _context44.next = 39; + break; + + case 46: + _i4 = 0; + + case 47: + if (!(_i4 < pagesChanged.length)) { + _context44.next = 54; + break; + } + + _pagesChanged$_i = pagesChanged[_i4], _oldPage = _pagesChanged$_i.oldPage, _newPage = _pagesChanged$_i.newPage; + _context44.next = 51; + return _regenerator.default.awrap(this.replacePage(_oldPage, _newPage)); + + case 51: + _i4++; + _context44.next = 47; + break; + + case 54: + _i5 = 0; + + case 55: + if (!(_i5 < pagesAdded.length)) { + _context44.next = 61; + break; + } + + _context44.next = 58; + return _regenerator.default.awrap(this.addPage(pagesAdded[_i5])); + + case 58: + _i5++; + _context44.next = 55; + break; + + case 61: + _i6 = 0; + + case 62: + if (!(_i6 < pagesDeleted.length)) { + _context44.next = 70; + break; + } + + _context44.next = 65; + return _regenerator.default.awrap(this.removePage(pagesDeleted[_i6])); + + case 65: + lastPageNumber = this.status.lastPageNumber; + + if (lastPageNumber === pagesDeleted[_i6].getPage()) { + this.getStatus().resetLastPageNumber(); + this.getStatus().resetLastArticleId(); + } + + case 67: + _i6++; + _context44.next = 62; + break; + + case 70: + if (!(pagesAdded.length + pagesChanged.length > 0)) { + _context44.next = 73; + break; + } + + _context44.next = 73; + return _regenerator.default.awrap(this.updateNewspaperStatus(_NewspaperIssue.DBStatus.DB_DOWNLOADED)); + + case 73: + success = true; + _context44.next = 80; + break; + + case 76: + _context44.prev = 76; + _context44.t0 = _context44["catch"](1); + _context44.next = 80; + return _regenerator.default.awrap(this._handleDownloadError(_context44.t0)); + + case 80: + return _context44.abrupt("return", success); + + case 81: + case "end": + return _context44.stop(); + } + } + }, null, this, [[1, 76]], Promise); + } + }, { + key: "_handleDownloadError", + value: function _handleDownloadError(e) { + var NO_GRANTS, code, params, extraParams, editionEncoded, rest, getParams, _global$getActivePSet5, loginStatus, _newspaper2, purgeTask; + + return _regenerator.default.async(function _handleDownloadError$(_context45) { + while (1) { + switch (_context45.prev = _context45.next) { + case 0: + if (!(e instanceof _$$_REQUIRE(_dependencyMap[38]).DownloadError)) { + _context45.next = 26; + break; + } + + NO_GRANTS = _$$_REQUIRE(_dependencyMap[38]).DOWNLOAD_ERROR_CODES.NO_GRANTS; + code = e.code, params = e.params; + + if (!(code === NO_GRANTS)) { + _context45.next = 26; + break; + } + + extraParams = params.extraParams, editionEncoded = params.edition, rest = (0, _objectWithoutProperties2.default)(params, ["extraParams", "edition"]); + getParams = (0, _extends2.default)({}, rest, _$$_REQUIRE(_dependencyMap[35]).StringUtils.parseQuerystring(extraParams)); + + if (editionEncoded) { + getParams.edition = _$$_REQUIRE(_dependencyMap[35]).StringUtils.decodeURIComponent(editionEncoded); + } + + _global$getActivePSet5 = global.getActivePSetup(), loginStatus = _global$getActivePSet5.loginStatus; + + if (!(loginStatus.isLoggedIn() && loginStatus.isAllowedIPUser())) { + _context45.next = 12; + break; + } + + _context45.next = 11; + return _regenerator.default.awrap(_LoginManager.default.resetAllowedIP()); + + case 11: + if (!loginStatus.isLoggedIn()) { + getParams.valErrCode = _LoginManager.PROT_ERROR.NOT_LOGGEDIN; + } + + case 12: + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.validation, + getParams: getParams + }); + + _newspaper2 = this.getCurrentNewspaper(); + + if (!_newspaper2) { + _context45.next = 24; + break; + } + + _context45.prev = 15; + purgeTask = new _PurgeManager.default(); + _context45.next = 19; + return _regenerator.default.awrap(purgeTask.purgeIssue(getParams.issue)); + + case 19: + this.removeNewspaper(_newspaper2); + _context45.next = 24; + break; + + case 22: + _context45.prev = 22; + _context45.t0 = _context45["catch"](15); + + case 24: + _context45.next = 26; + return _regenerator.default.awrap(this.status.reset()); + + case 26: + case "end": + return _context45.stop(); + } + } + }, null, this, [[15, 22]], Promise); + } + }, { + key: "_updateCallback", + value: function _updateCallback(updated) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_UPDATE_FINISHED, { + success: updated + }); + + if (updated) { + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + if (!currentNewspaper.isNewspaperCompleteForMode() || this.downloadFullEditionActive) { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_PROGRESS, { + progress: 0 + }); + } + + var network = this.downloadFullEditionActive ? _newsmemoryUtils.DownloadType.FULL : currentNewspaper.getDbNetwork(); + this.triggerInitialDownload(network); + } + } else {} + } + }, { + key: "loadPages", + value: function loadPages() { + var _this10 = this; + + var skipUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (_$$_REQUIRE(_dependencyMap[35]).NetworkUtils.isOnline()) { + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + if (!skipUpdate) { + this.updateIndex().then(this.updateCallback); + } else { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_NEWSPAPER_LOADED, { + status: currentNewspaper.getStatus() + }); + + if (_$$_REQUIRE(_dependencyMap[35]).NetworkUtils.isCellular() && _newsmemoryUtils.default.isModeFull()) { + var buttons = []; + buttons.push({ + text: global.strings("btn_cancel"), + onPress: function onPress() { + _this10.triggerInitialDownload(_newsmemoryUtils.DownloadType.MID_AND_LOW); + } + }); + buttons.push({ + text: global.strings("btn_ok"), + onPress: this.triggerInitialDownload + }); + + _reactNative.Alert.alert(global.strings("mobile_network_warning"), global.strings("offline_download_dialog"), buttons, { + cancelable: false + }); + } else { + this.triggerInitialDownload(currentNewspaper.getDbNetwork()); + } + } + } + } else { + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_UPDATE_FINISHED, { + success: false + }); + + this.triggerInitialDownload(); + } + } + }, { + key: "_getDownloadProgress", + value: function _getDownloadProgress() { + var progress = 0; + + if (this.downloadOperationsWeight > 0) { + progress = this.completedDownloadOperationsWeight / this.downloadOperationsWeight; + } + + return progress; + } + }, { + key: "_triggerInitialDownload", + value: function _triggerInitialDownload(network) { + var _this11 = this; + + var networkToUse = network; + + var isHighSpeedNetwork = _$$_REQUIRE(_dependencyMap[35]).NetworkUtils.isHighSpeedNetwork(); + + if (this.lowSpeedDownload || !isHighSpeedNetwork) { + networkToUse = _newsmemoryUtils.DownloadType.LOW_ONLY; + } else if (!network) { + networkToUse = global.getNewsmemoryConfig().network; + } else if (isHighSpeedNetwork && _newsmemoryUtils.default.isModeLow(network)) { + networkToUse = global.getNewsmemoryConfig().network; + } + + if (_$$_REQUIRE(_dependencyMap[35]).NetworkUtils.isOnline()) { + this.updateNewspaperNetwork(networkToUse); + + if (_newsmemoryUtils.default.isModeLow(networkToUse)) { + this.loadPagesLow(); + } else { + this.loadPagesComponents(); + + if (_newsmemoryUtils.default.isModeFull(networkToUse)) { + this.loadPagesHRComponents(); + } + } + + if (this.downloadManager && this.downloadManager.getStandardPriorityQueueLength() > 0) { + if (this.advancedPagesNumber > 0) { + this.downloadOperations += 1; + this.downloadOperationsWeight += this.advancedPagesNumber; + this.completedDownloadOperations += 1; + this.completedDownloadOperationsWeight += this.advancedPagesNumber; + } + + var startProgress = this.getDownloadProgress(); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_INITIAL_DOWNLOAD_STARTED, { + startProgress: startProgress + }); + + this.downloadManager.startStandardPriorityQueue(); + this.downloadManager.onStandardPriorityQueueIdle().then(function () { + if (_this11.downloadOperations > 0 && _this11.completedDownloadOperations >= _this11.downloadOperations - 1) { + if (_this11.downloadManager) { + _this11.downloadManager.pauseStandardPriorityQueue(); + + _this11.downloadManager.increaseHighResDownloadQueueConcurrency(); + } + + var newDbStatus = _NewspaperIssue.DBStatus.DB_DOWNLOADED; + + var currentNewspaper = _this11.getCurrentNewspaper(); + + if (currentNewspaper) { + newDbStatus = currentNewspaper.getStatus(); + + if (_this11.failedDownloadOperations === 0) { + newDbStatus = _newsmemoryUtils.default.isModeFull(networkToUse) ? _NewspaperIssue.DBStatus.HIGH_RES_DOWNLOADED : _NewspaperIssue.DBStatus.LOW_MID_PDF_DOWNLOADED; + + _this11.updateNewspaperStatus(newDbStatus); + } + } + + if (_this11.downloadFullEditionActive) { + _this11.downloadFullEditionActive = false; + } + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_INITIAL_DOWNLOAD_FINISHED, { + status: newDbStatus + }); + } + }); + } else { + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + var currentDbStatus = currentNewspaper.getStatus(); + + if (currentDbStatus === _NewspaperIssue.DBStatus.DB_DOWNLOADED) { + var newDbStatus = _newsmemoryUtils.default.isModeFull(networkToUse) ? _NewspaperIssue.DBStatus.HIGH_RES_DOWNLOADED : _NewspaperIssue.DBStatus.LOW_MID_PDF_DOWNLOADED; + this.updateNewspaperStatus(newDbStatus); + } + } + } + } else { + var _currentNewspaper = this.getCurrentNewspaper(); + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_INITIAL_DOWNLOAD_FINISHED, { + status: _currentNewspaper ? _currentNewspaper.getStatus() : _NewspaperIssue.DBStatus.DB_DOWNLOADED + }); + + if (!_$$_REQUIRE(_dependencyMap[35]).PlatformUtils.isTablet()) { + var message = _currentNewspaper && _currentNewspaper.hasHighResolutionDownloaded() ? global.strings("err_offline") : global.strings("offline_download_warning"); + + _reactNative.Alert.alert(global.strings("title_offline"), message); + } + } + } + }, { + key: "updateNewspaperStatus", + value: function updateNewspaperStatus(newDbStatus) { + var currentNewspaper; + return _regenerator.default.async(function updateNewspaperStatus$(_context46) { + while (1) { + switch (_context46.prev = _context46.next) { + case 0: + currentNewspaper = this.getCurrentNewspaper(); + + if (!currentNewspaper) { + _context46.next = 5; + break; + } + + currentNewspaper.setStatus(newDbStatus); + _context46.next = 5; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.updateStatus(currentNewspaper.getPaper(), currentNewspaper.getIssue(), currentNewspaper.getEdition(), newDbStatus)); + + case 5: + case "end": + return _context46.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "updateNewspaperNetwork", + value: function updateNewspaperNetwork(network) { + var currentNewspaper; + return _regenerator.default.async(function updateNewspaperNetwork$(_context47) { + while (1) { + switch (_context47.prev = _context47.next) { + case 0: + currentNewspaper = this.getCurrentNewspaper(); + + if (!currentNewspaper) { + _context47.next = 5; + break; + } + + currentNewspaper.setDbNetwork(network); + _context47.next = 5; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.updateNetwork(currentNewspaper.getPaper(), currentNewspaper.getIssue(), currentNewspaper.getEdition(), network)); + + case 5: + case "end": + return _context47.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "updateCompletedDownloadOperations", + value: function updateCompletedDownloadOperations(operation) { + var _this12 = this; + + var downloadRef = operation.getDownloadRef(); + + if (downloadRef !== this.currentDownloadRef) {} else { + var weight = operation.getWeight(); + + if (this.downloadOperationsWeight > 0) { + this.completedDownloadOperations += 1; + this.completedDownloadOperationsWeight += weight; + var progress = this.completedDownloadOperationsWeight / this.downloadOperationsWeight; + var percentage = progress * 100; + + _$$_REQUIRE(_dependencyMap[33]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_PROGRESS, { + progress: Math.min(progress, 1) + }); + + if (percentage >= 100) { + if (this.failedDownloadOperations > 0) { + var buttons = []; + buttons.push({ + text: global.strings("btn_cancel") + }, { + text: global.strings("retry"), + onPress: function onPress() { + _this12.loadPages(true); + } + }); + + _reactNative.Alert.alert("", global.strings("err_download_edition"), buttons, { + cancelable: false + }); + } + + this.resetPageCounters(); + } + } + } + } + }, { + key: "isCurrentNewspaperASpecialSection", + value: function isCurrentNewspaperASpecialSection() { + var _global$getActivePSet6 = global.getActivePSetup(), + pSetup = _global$getActivePSet6.pSetup, + initpageXpaperNotView = _global$getActivePSet6.initpageXpaperNotView; + + if (initpageXpaperNotView && pSetup.includes("-xp-")) { + var pSetupSplitted = pSetup.split("-xp-"); + var xPaperSplitted = initpageXpaperNotView.split(","); + return pSetupSplitted[1] && xPaperSplitted.includes(pSetupSplitted[1]); + } + + return false; + } + }, { + key: "hasSpecialSection", + value: function hasSpecialSection() { + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + var editionModel = currentNewspaper.getEditionModel(); + + if (editionModel) { + var _issue = editionModel.issue, + _edition = editionModel.edition; + return _NewsmemoryAJAX.default.getSpecialSectionUrl("specialsections", _issue, _edition, currentNewspaper.getSecret(), this.isCurrentNewspaperASpecialSection()); + } + } + + return ""; + } + }, { + key: "getSpecialSectionPage", + value: function getSpecialSectionPage(showSections) { + var currentNewspaper = this.getCurrentNewspaper(); + + if (currentNewspaper) { + var editionModel = currentNewspaper.getEditionModel(); + + if (editionModel) { + var hasSpecialSections = editionModel.hasSpecialSections, + _issue2 = editionModel.issue, + _edition2 = editionModel.edition; + + if (hasSpecialSections) { + return _NewsmemoryAJAX.default.getSpecialSectionUrl("indexspecial", _issue2, _edition2, currentNewspaper.getSecret(), this.isCurrentNewspaperASpecialSection(), showSections); + } + } + } + + return ""; + } + }, { + key: "destroy", + value: function destroy() { + return _regenerator.default.async(function destroy$(_context48) { + while (1) { + switch (_context48.prev = _context48.next) { + case 0: + this.clearQueues(); + this.unregister(); + _context48.next = 4; + return _regenerator.default.awrap(this._resetBulkInsertTimeout(true)); + + case 4: + this.newspapers = []; + _context48.next = 7; + return _regenerator.default.awrap(this.editionsManager.closeDatabase()); + + case 7: + this.editionsManager = undefined; + this.downloadManager = undefined; + this.currentNewspaper = undefined; + this.currentPage = undefined; + + case 11: + case "end": + return _context48.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return NewspaperManager; + }(); + + exports.default = NewspaperManager; +},2306,[5,80,6,108,21,7,8,28,2307,714,644,710,638,587,2310,430,460,2311,2313,2314,2315,2312,574,603,730,715,640,2178,2316,431,1934,2057,2308,572,2317,462,588,2187,586,1955,1954,2254]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Database = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NewsmemoryToDTO = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _EPaperImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _DTOToNewsmemory = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _DownloadManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var NewsmemoryEditionsManager = function () { + function NewsmemoryEditionsManager(paper) { + (0, _classCallCheck2.default)(this, NewsmemoryEditionsManager); + this.paper = paper; + } + + (0, _createClass2.default)(NewsmemoryEditionsManager, [{ + key: "initDatabase", + value: function initDatabase(path) { + if (this.database) { + if (this.database.getPath() === path) { + return; + } + + this.database.destroy(); + } + + this.database = new _Database.default(path); + } + }, { + key: "databaseExists", + value: function databaseExists() { + return _regenerator.default.async(function databaseExists$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!this.database) { + _context.next = 2; + break; + } + + return _context.abrupt("return", this.database.exists()); + + case 2: + return _context.abrupt("return", false); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "closeDatabase", + value: function closeDatabase() { + return _regenerator.default.async(function closeDatabase$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!this.database) { + _context2.next = 2; + break; + } + + return _context2.abrupt("return", this.database.close()); + + case 2: + return _context2.abrupt("return", false); + + case 3: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "deleteDatabase", + value: function deleteDatabase() { + return _regenerator.default.async(function deleteDatabase$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!this.database) { + _context3.next = 2; + break; + } + + return _context3.abrupt("return", this.database.delete()); + + case 2: + return _context3.abrupt("return", false); + + case 3: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "openTransaction", + value: function openTransaction(query, params) { + return _regenerator.default.async(function openTransaction$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!this.database) { + _context4.next = 2; + break; + } + + return _context4.abrupt("return", this.database.transaction(query, params)); + + case 2: + return _context4.abrupt("return", []); + + case 3: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "insertPage", + value: function insertPage(issueId, filename, type, section, edition) { + var optional, + query, + _args5 = arguments; + return _regenerator.default.async(function insertPage$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + optional = _args5.length > 5 && _args5[5] !== undefined ? _args5[5] : {}; + query = "INSERT INTO pages (issueId, filename, type, section, edition, extralinks, mtime, page, frameW, frameH, extramd5) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; + _context5.prev = 2; + _context5.next = 5; + return _regenerator.default.awrap(this.openTransaction(query, [issueId, filename, type, section, edition, optional.extralinks, optional.mtime, optional.page, optional.frameW, optional.frameH, optional.extramd5])); + + case 5: + return _context5.abrupt("return", true); + + case 8: + _context5.prev = 8; + _context5.t0 = _context5["catch"](2); + throw _context5.t0; + + case 11: + case "end": + return _context5.stop(); + } + } + }, null, this, [[2, 8]], Promise); + } + }, { + key: "getIssue", + value: function getIssue(issue) { + var result; + return _regenerator.default.async(function getIssue$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _context6.prev = 0; + _context6.next = 3; + return _regenerator.default.awrap(this.openTransaction("SELECT * FROM issues WHERE paper = ? AND issue = ?;", [this.paper, issue])); + + case 3: + result = _context6.sent; + + if (!(result && result.length)) { + _context6.next = 6; + break; + } + + return _context6.abrupt("return", _NewsmemoryToDTO.default.dbIssueToDTO(result[0])); + + case 6: + throw new Error("Missing issue inside database " + this.paper + ", " + issue); + + case 9: + _context6.prev = 9; + _context6.t0 = _context6["catch"](0); + throw _context6.t0; + + case 12: + case "end": + return _context6.stop(); + } + } + }, null, this, [[0, 9]], Promise); + } + }, { + key: "getPageByFilename", + value: function getPageByFilename(filename) { + var query, pages; + return _regenerator.default.async(function getPageByFilename$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + _context7.prev = 0; + query = "SELECT * FROM pages WHERE filename = ?"; + _context7.next = 4; + return _regenerator.default.awrap(this.openTransaction(query, [filename])); + + case 4: + pages = _context7.sent; + + if (!(pages && pages.length)) { + _context7.next = 7; + break; + } + + return _context7.abrupt("return", _NewsmemoryToDTO.default.dbPageToDTO(pages[0])); + + case 7: + throw new Error("Missing page inside database " + filename); + + case 10: + _context7.prev = 10; + _context7.t0 = _context7["catch"](0); + throw _context7.t0; + + case 13: + case "end": + return _context7.stop(); + } + } + }, null, this, [[0, 10]], Promise); + } + }, { + key: "getArticles", + value: function getArticles(pageId) { + var query, articles; + return _regenerator.default.async(function getArticles$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + _context8.prev = 0; + query = "SELECT * FROM articles WHERE pageId = ?;"; + _context8.next = 4; + return _regenerator.default.awrap(this.openTransaction(query, [pageId])); + + case 4: + articles = _context8.sent.map(function (article) { + return _NewsmemoryToDTO.default.dbArticleToDTO(article); + }); + return _context8.abrupt("return", articles); + + case 8: + _context8.prev = 8; + _context8.t0 = _context8["catch"](0); + return _context8.abrupt("return", []); + + case 11: + case "end": + return _context8.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "getAllArticles", + value: function getAllArticles() { + var query, articles; + return _regenerator.default.async(function getAllArticles$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + _context9.prev = 0; + query = "SELECT * FROM articles;"; + _context9.next = 4; + return _regenerator.default.awrap(this.openTransaction(query, [])); + + case 4: + articles = _context9.sent.map(function (article) { + return _NewsmemoryToDTO.default.dbArticleToDTO(article); + }); + return _context9.abrupt("return", articles); + + case 8: + _context9.prev = 8; + _context9.t0 = _context9["catch"](0); + return _context9.abrupt("return", []); + + case 11: + case "end": + return _context9.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "getImages", + value: function getImages(pageId) { + var query, images; + return _regenerator.default.async(function getImages$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.prev = 0; + query = "SELECT * FROM images WHERE pageId = ?"; + _context10.next = 4; + return _regenerator.default.awrap(this.openTransaction(query, [pageId])); + + case 4: + images = _context10.sent.map(function (image) { + return _NewsmemoryToDTO.default.dbImageToDTO(image); + }); + return _context10.abrupt("return", images); + + case 8: + _context10.prev = 8; + _context10.t0 = _context10["catch"](0); + return _context10.abrupt("return", []); + + case 11: + case "end": + return _context10.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "getAllImages", + value: function getAllImages() { + var query, images; + return _regenerator.default.async(function getAllImages$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + _context11.prev = 0; + query = "SELECT * FROM images"; + _context11.next = 4; + return _regenerator.default.awrap(this.openTransaction(query, [])); + + case 4: + images = _context11.sent.map(function (image) { + return _NewsmemoryToDTO.default.dbImageToDTO(image); + }); + return _context11.abrupt("return", images); + + case 8: + _context11.prev = 8; + _context11.t0 = _context11["catch"](0); + return _context11.abrupt("return", []); + + case 11: + case "end": + return _context11.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "getPages", + value: function getPages() { + var query, pages; + return _regenerator.default.async(function getPages$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + _context12.prev = 0; + query = "SELECT * FROM pages"; + _context12.next = 4; + return _regenerator.default.awrap(this.openTransaction(query)); + + case 4: + pages = _context12.sent.map(function (page) { + return _NewsmemoryToDTO.default.dbPageToDTO(page); + }); + return _context12.abrupt("return", pages); + + case 8: + _context12.prev = 8; + _context12.t0 = _context12["catch"](0); + return _context12.abrupt("return", []); + + case 11: + case "end": + return _context12.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "getEdition", + value: function getEdition(issue, edition, secret) { + var _this = this; + + var newspaper, pages, dbPages, allArticles, allImages, _await$this$getCustom, customIndexMTime, customIndexHtml, _loop, i, isLite, _global$getActivePSet; + + return _regenerator.default.async(function getEdition$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + _context14.prev = 0; + _context14.next = 3; + return _regenerator.default.awrap(this.getIssue(issue)); + + case 3: + newspaper = _context14.sent; + pages = []; + _context14.next = 7; + return _regenerator.default.awrap(this.openTransaction("SELECT * FROM pages WHERE issueId = ? AND edition = ? AND type <> 'IX' AND type <> 'LT' ORDER BY page;", [newspaper.getIssueId(), edition])); + + case 7: + dbPages = _context14.sent; + _context14.next = 10; + return _regenerator.default.awrap(this.getAllArticles()); + + case 10: + allArticles = _context14.sent; + _context14.next = 13; + return _regenerator.default.awrap(this.getAllImages()); + + case 13: + allImages = _context14.sent; + _context14.next = 16; + return _regenerator.default.awrap(this.getCustomIndex(issue)); + + case 16: + _await$this$getCustom = _context14.sent; + customIndexMTime = _await$this$getCustom.mtime; + customIndexHtml = _await$this$getCustom.html; + + _loop = function _callee(i) { + var dto, articles; + return _regenerator.default.async(function _callee$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + dto = _NewsmemoryToDTO.default.dbPageToDTO(dbPages[i]); + articles = allArticles.filter(function (article) { + return article.getPageId() === dto.getPageId(); + }); + + if (!(!articles || articles.length === 0)) { + _context13.next = 15; + break; + } + + _context13.prev = 3; + _context13.next = 6; + return _regenerator.default.awrap(_DownloadManager.default.downloadArticles(issue, edition, dto.getFilename(), secret)); + + case 6: + articles = _context13.sent; + articles.forEach(function (article) { + article.setPageId(dto.getPageId()); + }); + _context13.next = 10; + return _regenerator.default.awrap(_this.saveArticles(articles)); + + case 10: + _context13.next = 15; + break; + + case 12: + _context13.prev = 12; + _context13.t0 = _context13["catch"](3); + articles = []; + + case 15: + if (articles) { + dto.setArticles(articles); + } + + dto.setImages(allImages.filter(function (image) { + return image.getPageId() === dto.getPageId(); + })); + pages.push(dto); + + case 18: + case "end": + return _context13.stop(); + } + } + }, null, null, [[3, 12]], Promise); + }; + + i = 0; + + case 21: + if (!(i < dbPages.length)) { + _context14.next = 27; + break; + } + + _context14.next = 24; + return _regenerator.default.awrap(_loop(i)); + + case 24: + i++; + _context14.next = 21; + break; + + case 27: + newspaper.setEdition(edition); + newspaper.setPages(pages); + _context14.next = 31; + return _regenerator.default.awrap(this.isLite(issue)); + + case 31: + isLite = _context14.sent; + + if (isLite === undefined) { + _global$getActivePSet = global.getActivePSetup(); + isLite = _global$getActivePSet.isLite; + } + + newspaper.setIsLite(isLite); + newspaper.setCustomIndexModifyTime(parseInt(customIndexMTime, 10)); + newspaper.setCustomIndexHtml(customIndexHtml); + return _context14.abrupt("return", newspaper); + + case 39: + _context14.prev = 39; + _context14.t0 = _context14["catch"](0); + throw _context14.t0; + + case 42: + case "end": + return _context14.stop(); + } + } + }, null, this, [[0, 39]], Promise); + } + }, { + key: "savePages", + value: function savePages(pages) { + return _regenerator.default.async(function savePages$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + _context15.prev = 0; + return _context15.abrupt("return", this.database.replaceInto("pages", ["pageId", "issueId", "page", "shownpage", "type", "filename", "edition", "section", "frameH", "frameW", "extramd5", "extralinks", "mtime"], pages.map(function (page) { + return _DTOToNewsmemory.default.pageDTOtoDb(page); + }))); + + case 4: + _context15.prev = 4; + _context15.t0 = _context15["catch"](0); + + case 6: + return _context15.abrupt("return", false); + + case 7: + case "end": + return _context15.stop(); + } + } + }, null, this, [[0, 4]], Promise); + } + }, { + key: "insertPages", + value: function insertPages(pages) { + return _regenerator.default.async(function insertPages$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + _context16.prev = 0; + return _context16.abrupt("return", this.database.replaceInto("pages", ["issueId", "page", "shownpage", "type", "filename", "edition", "section", "frameH", "frameW", "extramd5", "extralinks", "mtime"], pages.map(function (page) { + var params = _DTOToNewsmemory.default.pageDTOtoDb(page); + + params.shift(); + return params; + }))); + + case 4: + _context16.prev = 4; + _context16.t0 = _context16["catch"](0); + + case 6: + return _context16.abrupt("return", false); + + case 7: + case "end": + return _context16.stop(); + } + } + }, null, this, [[0, 4]], Promise); + } + }, { + key: "saveImages", + value: function saveImages(images) { + return _regenerator.default.async(function saveImages$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + _context17.prev = 0; + return _context17.abrupt("return", this.database.replaceInto("images", ["base64image", "pageId", "type", "sizeX", "sizeY"], images.map(function (image) { + return _DTOToNewsmemory.default.imageDTOtoDb(image); + }))); + + case 4: + _context17.prev = 4; + _context17.t0 = _context17["catch"](0); + + case 6: + return _context17.abrupt("return", false); + + case 7: + case "end": + return _context17.stop(); + } + } + }, null, this, [[0, 4]], Promise); + } + }, { + key: "saveArticles", + value: function saveArticles(articles) { + return _regenerator.default.async(function saveArticles$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + return _context18.abrupt("return", this.database.replaceInto("articles", ["pageId", "xmlId", "type", "subtype", "title", "html", "inc", "childart", "pj", "boxes"], articles.map(function (article) { + return _DTOToNewsmemory.default.articleDTOtoDb(article); + }))); + + case 1: + case "end": + return _context18.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getPageIdsWhereClause", + value: function getPageIdsWhereClause(pages) { + var whereClause = null; + + if (pages.length > 0) { + var pageIds = pages.reduce(function (result, _ref) { + var pageId = _ref.pageId; + result.push(pageId); + return result; + }, []); + whereClause = "pageId IN (" + pageIds.join(",") + ")"; + } + + return whereClause; + } + }, { + key: "getCustomIndex", + value: function getCustomIndex(issue) { + var pageId, mtime, html, result, _result$item; + + return _regenerator.default.async(function getCustomIndex$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + pageId = -1; + _context19.prev = 1; + _context19.next = 4; + return _regenerator.default.awrap(this.database.executeSqlNoTx("SELECT pages.pageId, pages.mtime, articles.html FROM articles, pages, issues WHERE articles.pageId = pages.pageId " + ("AND articles.type = 'html' AND issues.issueId = pages.issueId AND issues.issue = '" + issue + "' ") + "AND pages.filename='index' AND pages.type = 'IX' AND pages.page = '' AND pages.section = '' LIMIT 1")); + + case 4: + result = _context19.sent; + + if (result && result.item(0)) { + _result$item = result.item(0); + pageId = _result$item.pageId; + mtime = _result$item.mtime; + html = _result$item.html; + } + + _context19.next = 10; + break; + + case 8: + _context19.prev = 8; + _context19.t0 = _context19["catch"](1); + + case 10: + return _context19.abrupt("return", { + pageId: pageId, + mtime: mtime, + html: html + }); + + case 11: + case "end": + return _context19.stop(); + } + } + }, null, this, [[1, 8]], Promise); + } + }, { + key: "isLite", + value: function isLite(issue) { + var result, _result$item2, filename; + + return _regenerator.default.async(function isLite$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + _context20.prev = 0; + _context20.next = 3; + return _regenerator.default.awrap(this.database.executeSqlNoTx("SELECT pages.filename FROM pages, issues WHERE " + ("issues.issueId = pages.issueId AND issues.issue = '" + issue + "' ") + "AND pages.type = 'LT' LIMIT 1")); + + case 3: + result = _context20.sent; + + if (!(result && result.item(0))) { + _context20.next = 7; + break; + } + + _result$item2 = result.item(0), filename = _result$item2.filename; + return _context20.abrupt("return", filename === "1"); + + case 7: + _context20.next = 11; + break; + + case 9: + _context20.prev = 9; + _context20.t0 = _context20["catch"](0); + + case 11: + return _context20.abrupt("return", undefined); + + case 12: + case "end": + return _context20.stop(); + } + } + }, null, this, [[0, 9]], Promise); + } + }, { + key: "addLite", + value: function addLite(issueId, isLite) { + var isLiteValue; + return _regenerator.default.async(function addLite$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + isLiteValue = isLite ? "1" : "0"; + return _context21.abrupt("return", this.database.replaceInto("pages", ["issueId", "filename", "type"], [issueId, isLiteValue, "LT"])); + + case 2: + case "end": + return _context21.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeLite", + value: function removeLite(issueId) { + return _regenerator.default.async(function removeLite$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + return _context22.abrupt("return", this.database.deleteFrom("pages", "issueId = " + issueId + " AND type = 'LT'")); + + case 1: + case "end": + return _context22.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removePages", + value: function removePages(pages) { + return _regenerator.default.async(function removePages$(_context23) { + while (1) { + switch (_context23.prev = _context23.next) { + case 0: + return _context23.abrupt("return", this.database.deleteFrom("pages", this.getPageIdsWhereClause(pages))); + + case 1: + case "end": + return _context23.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeImagesForPages", + value: function removeImagesForPages(pages) { + return _regenerator.default.async(function removeImagesForPages$(_context24) { + while (1) { + switch (_context24.prev = _context24.next) { + case 0: + return _context24.abrupt("return", this.database.deleteFrom("images", this.getPageIdsWhereClause(pages))); + + case 1: + case "end": + return _context24.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeArticlesForPages", + value: function removeArticlesForPages(pages) { + return _regenerator.default.async(function removeArticlesForPages$(_context25) { + while (1) { + switch (_context25.prev = _context25.next) { + case 0: + return _context25.abrupt("return", this.database.deleteFrom("articles", this.getPageIdsWhereClause(pages))); + + case 1: + case "end": + return _context25.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return NewsmemoryEditionsManager; + }(); + + exports.default = NewsmemoryEditionsManager; +},2307,[5,80,7,8,711,644,2308,587,640,2309,638,2310]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _ExtraLinks = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _EPaperImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Box = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _BoxesInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _PageJump = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var NewsmemoryToDTO = function () { + function NewsmemoryToDTO() { + (0, _classCallCheck2.default)(this, NewsmemoryToDTO); + } + + (0, _createClass2.default)(NewsmemoryToDTO, null, [{ + key: "dbIssueToDTO", + value: function dbIssueToDTO(dbNewspaper) { + var newspaper = new _Edition.default(); + newspaper.setIssueId(dbNewspaper.issueId); + newspaper.setIssue(dbNewspaper.issue); + newspaper.setDownloadTime(dbNewspaper.downtime); + newspaper.setUpdated(dbNewspaper.updated === 1); + newspaper.setPaper(dbNewspaper.paper); + newspaper.setModifyTime(_$$_REQUIRE(_dependencyMap[12]).DateUtils.stringToUnix(dbNewspaper.mtime + " +0000", "YYYYMMDD HH:mm:ss Z")); + return newspaper; + } + }, { + key: "dbPageToDTO", + value: function dbPageToDTO(dbPage) { + var page = new _Page.default(); + page.setEdition(dbPage.edition); + page.setExtraMd5(dbPage.extramd5); + page.setExtralinks(NewsmemoryToDTO.dbExtralinksToDTOs(dbPage.extralinks)); + page.setFilename(dbPage.filename); + page.setFrameHeight(parseInt(dbPage.frameH || dbPage.h, 10)); + page.setFrameWidth(parseInt(dbPage.frameW || dbPage.w, 10)); + page.setIssueId(dbPage.issueId); + page.setModifyTime(dbPage.mtime); + page.setPage(dbPage.page); + page.setPageId(dbPage.pageId); + page.setSection(dbPage.section); + page.setShownPage(dbPage.shownpage || dbPage.page); + page.setType(parseInt(dbPage.type, 10)); + page.setImages([]); + page.setVisible(true); + page.setProtected(false); + return page; + } + }, { + key: "dbImageToDTO", + value: function dbImageToDTO(dbImage) { + var image = new _EPaperImage.default(); + image.setBase64(dbImage.base64image); + image.setPageId(dbImage.pageId); + image.setType(dbImage.type); + image.setWidth(dbImage.sizeX); + image.setHeight(dbImage.sizeY); + return image; + } + }, { + key: "dbArticleToDTO", + value: function dbArticleToDTO(dbArticle) { + var article = new _EPaperArticle.default(); + article.setPageId(dbArticle.pageId); + article.setXmlId(parseInt(dbArticle.xmlId, 10)); + article.setType(dbArticle.type); + article.setSubType(dbArticle.subtype); + article.setTitle(NewsmemoryToDTO._unescapeHTML(dbArticle.title)); + article.setHtml(dbArticle.html); + article.setInc(dbArticle.inc); + article.setChildart(dbArticle.childart); + article.setPageJumps(NewsmemoryToDTO.dbPageJumpsToDTO(dbArticle.pj)); + article.setBoxes(NewsmemoryToDTO.dbBoxesToDTO(dbArticle.boxes)); + article.setBoxesInfo(NewsmemoryToDTO.dbBoxesInfoToDTO(dbArticle.boxes)); + return article; + } + }, { + key: "dbPageJumpsToDTO", + value: function dbPageJumpsToDTO(info) { + if (info) { + try { + var pageJumpsObj = JSON.parse(info); + return Object.keys(pageJumpsObj).map(function (key) { + var pj = pageJumpsObj[key]; + var from = pj.from, + to = pj.to, + type = pj.type, + artid = pj.artid, + articlefrom = pj.articlefrom; + + var articleId = _newsmemoryUtils.default.getArticleId(artid); + + var articleFrom = _newsmemoryUtils.default.getArticleId(articlefrom); + + return new _PageJump.default(key, from, to, type, articleId, articleFrom); + }); + } catch (e) {} + } + + return []; + } + }, { + key: "dbBoxesToDTO", + value: function dbBoxesToDTO(info) { + var boxes = info.split("@")[0]; + + if (boxes) { + try { + return boxes.split(";").map(function (box) { + var splitted = box.split(","); + return new _Box.default(parseInt(splitted[0], 10), parseInt(splitted[2], 10), parseInt(splitted[1], 10), parseInt(splitted[3], 10), parseInt(splitted[4], 10)); + }); + } catch (e) {} + } + + return []; + } + }, { + key: "dbBoxesInfoToDTO", + value: function dbBoxesInfoToDTO(info) { + var infos = info.split("@")[1]; + + if (infos) { + try { + return new _BoxesInfo.default(infos.split(",")); + } catch (e) {} + } + + return null; + } + }, { + key: "dbExtralinksToDTOs", + value: function dbExtralinksToDTOs(dbExtralinks) { + var extralinks = []; + + if (dbExtralinks) { + var extraArray = dbExtralinks.split(";"); + extraArray.forEach(function (extra) { + var elementArray = extra.split(","); + + if (elementArray.length > 7) { + var type = elementArray[0]; + var left = parseInt(elementArray[1], 10); + var top = parseInt(elementArray[2], 10); + var width = parseInt(elementArray[3], 10); + var height = parseInt(elementArray[4], 10); + var pdfWidth = parseInt(elementArray[5], 10); + var pdfHeight = parseInt(elementArray[6], 10); + var content = elementArray[7]; + var imageURL = elementArray[8]; + extralinks.push(new _ExtraLinks.default(type, content, imageURL, { + left: left, + top: top + }, { + width: width, + height: height + }, { + width: pdfWidth, + height: pdfHeight + })); + } + }); + } else {} + + return extralinks; + } + }, { + key: "_unescapeHTML", + value: function _unescapeHTML(text) { + var decoded = ""; + + if (text) { + try { + decoded = _$$_REQUIRE(_dependencyMap[12]).StringUtils.decodeHTML(text); + decoded = decoded.replace(/]*>|<\/span>/g, ""); + } catch (e) {} + } + + return decoded; + } + }, { + key: "parseIndex", + value: function parseIndex(index) { + var pages = []; + index.forEach(function (rawPage) { + pages.push(NewsmemoryToDTO.dbPageToDTO(rawPage)); + }); + return pages; + } + }]); + return NewsmemoryToDTO; + }(); + + exports.default = NewsmemoryToDTO; +},2308,[5,7,8,638,639,587,640,641,642,643,644,603,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _ExtraLinks = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _EPaperImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Box = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _BoxesInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _PageJump = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var DTOToNewsmemory = function () { + function DTOToNewsmemory() { + (0, _classCallCheck2.default)(this, DTOToNewsmemory); + } + + (0, _createClass2.default)(DTOToNewsmemory, null, [{ + key: "issueDTOtoDb", + value: function issueDTOtoDb(edition) { + return [edition.getIssueId(), edition.getIssue(), edition.getDownloadTime(), edition.isUpdated() ? 1 : 0, edition.getPaper(), _$$_REQUIRE(_dependencyMap[11]).DateUtils.unixToString(edition.getModifyTime(), "YYYYMMDD HH:mm:ss")]; + } + }, { + key: "pageDTOtoDb", + value: function pageDTOtoDb(page) { + return [page.getPageId(), page.getIssueId(), page.getPage(), page.getShownPage(), page.getType(), page.getFilename(), page.getEdition(), page.getSection(), page.getFrameHeight(), page.getFrameWidth(), page.getExtraMd5(), DTOToNewsmemory.extralinksDTOtoDb(page.getExtralinks()), page.getModifyTime()]; + } + }, { + key: "imageDTOtoDb", + value: function imageDTOtoDb(image) { + return [image.getBase64(), image.getPageId(), image.getType(), image.getWidth(), image.getHeight()]; + } + }, { + key: "articleDTOtoDb", + value: function articleDTOtoDb(article) { + return [article.getPageId(), article.getXmlId(), article.getType(), article.getSubType(), article.getTitle(), article.getHtml(), article.getInc(), article.getChildart(), DTOToNewsmemory.pageJumpsDTOtoDb(article.getPageJumps()), DTOToNewsmemory.boxesAndInfoDTOtoDb(article.getBoxes(), article.getBoxesInfo())]; + } + }, { + key: "pageJumpsDTOtoDb", + value: function pageJumpsDTOtoDb(pageJumps) { + if (pageJumps && pageJumps.length > 0) { + return "{" + pageJumps.map(function (pageJump) { + return pageJump.toString(); + }).join(",") + "}"; + } + + return "[]"; + } + }, { + key: "boxesAndInfoDTOtoDb", + value: function boxesAndInfoDTOtoDb(boxes, info) { + var strBoxes = boxes ? boxes.map(function (box) { + return box.toString(); + }).join(";") : ""; + var strInfo = info ? info.toString() : ""; + return strBoxes.concat("@").concat(strInfo); + } + }, { + key: "extralinksDTOtoDb", + value: function extralinksDTOtoDb(extralinks) { + return extralinks.map(function (link) { + return link.toString(); + }).join(";"); + } + }]); + return DTOToNewsmemory; + }(); + + exports.default = DTOToNewsmemory; +},2309,[5,7,8,644,638,639,587,640,641,642,643,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _pQueue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _pdfUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _downloadUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _NewsmemoryToDTO = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var MIN_NUMBER_STANDARD_DOWNLOADS = 1; + var MAX_NUMBER_STANDARD_DOWNLOADS = 4; + var MIN_NUMBER_PRIORITY_DOWNLOADS = 1; + var MAX_NUMBER_PRIORITY_DOWNLOADS = 2; + var MIN_NUMBER_HIGH_RES_DOWNLOADS = 1; + var MAX_NUMBER_HIGH_RES_DOWNLOADS = 4; + + var DownloadManager = function () { + function DownloadManager(paper, machineForHR, onDownloadImageListener) { + (0, _classCallCheck2.default)(this, DownloadManager); + this.paper = paper; + this.machineForHR = machineForHR; + this.onDownloadImageListener = onDownloadImageListener; + this.priorityDownloadQueue = new _pQueue.default({ + concurrency: MAX_NUMBER_PRIORITY_DOWNLOADS + }); + this.standardDownloadQueue = new _pQueue.default({ + concurrency: MAX_NUMBER_STANDARD_DOWNLOADS, + autoStart: false + }); + this.thumbnailDownloadQueue = new _pQueue.default({ + concurrency: 1 + }); + this.loadMultiZip = this._loadMultiZip.bind(this); + this.loadZip = this._loadZip.bind(this); + this.loadHRImages = this._loadHRImages.bind(this); + this.loadHrImage = this._loadHrImage.bind(this); + this.loadImage = this._loadImage.bind(this); + } + + (0, _createClass2.default)(DownloadManager, [{ + key: "downloadEditionDB", + value: function downloadEditionDB(issue, edition) { + var appendFirstPages, + result, + code, + message, + NO_GRANTS, + INVALID_ZIP, + NO_ZIP, + GENERIC_ERROR, + _args = arguments; + return _regenerator.default.async(function downloadEditionDB$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + appendFirstPages = _args.length > 2 && _args[2] !== undefined ? _args[2] : false; + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.downloadEditionDB(this.paper, issue, edition, appendFirstPages, { + progressCallback: function progressCallback(received, total) { + _$$_REQUIRE(_dependencyMap[20]).EventRegister.emit(_events.default.NEWSMEMORY_DB_DOWNLOAD_PROGRESS, { + progress: received / total + }); + }, + retryCallback: function retryCallback(retry, maxRetries) { + _$$_REQUIRE(_dependencyMap[20]).EventRegister.emit(_events.default.NEWSMEMORY_DB_DOWNLOAD_RETRY, { + retryText: global.strings("msg_download_retry", { + retry: retry, + maxRetries: maxRetries + }) + }); + } + })); + + case 4: + result = _context.sent; + + if (result.db) { + _context.next = 7; + break; + } + + throw new Error("DownloadManager - downloadEditionDB: unable to download db for issue " + issue + " and edition " + edition); + + case 7: + return _context.abrupt("return", result); + + case 10: + _context.prev = 10; + _context.t0 = _context["catch"](1); + code = _context.t0.code, message = _context.t0.message; + NO_GRANTS = _downloadUtils.DOWNLOAD_ERROR_CODES.NO_GRANTS, INVALID_ZIP = _downloadUtils.DOWNLOAD_ERROR_CODES.INVALID_ZIP, NO_ZIP = _downloadUtils.DOWNLOAD_ERROR_CODES.NO_ZIP, GENERIC_ERROR = _downloadUtils.DOWNLOAD_ERROR_CODES.GENERIC_ERROR; + + if (!(code === NO_GRANTS || code === INVALID_ZIP || code === NO_ZIP)) { + _context.next = 18; + break; + } + + throw _context.t0; + + case 18: + if (code === GENERIC_ERROR) {} + + case 19: + return _context.abrupt("return", {}); + + case 20: + case "end": + return _context.stop(); + } + } + }, null, this, [[1, 10]], Promise); + } + }, { + key: "checkPageImagesToDownload", + value: function checkPageImagesToDownload(page, types) { + var imagesToDownload = []; + var pageId = page.pageId, + images = page.images; + types.forEach(function (type) { + if (!images.find(function (image) { + return image.getType() === type; + })) { + var image = new _EPaperImage.default(); + image.setPageId(pageId); + image.setType(type); + imagesToDownload.push(image); + } + }); + return imagesToDownload; + } + }, { + key: "checkPageComponentsToDownload", + value: function checkPageComponentsToDownload(page) { + return this.checkPageImagesToDownload(page, [_EPaperImage.EPaperImageType.LOW, _EPaperImage.EPaperImageType.GRAPH, _EPaperImage.EPaperImageType.TEXT]); + } + }, { + key: "checkPageHRImagesToDownload", + value: function checkPageHRImagesToDownload(page) { + var imagesToDownload = []; + var pageId = page.pageId, + images = page.images; + var hrImages = images.filter(function (image) { + return image.getType() === _EPaperImage.EPaperImageType.HR_ZIP || image.getType().search(_EPaperImage.EPaperImageType.HR + "_" + _EPaperImage.EPaperImageName.HR) > -1; + }); + + if (hrImages.length === 0) { + var image = new _EPaperImage.default(); + image.setPageId(pageId); + image.setType(_EPaperImage.EPaperImageType.HR); + imagesToDownload.push(image); + } + + return imagesToDownload; + } + }, { + key: "applyWatermark", + value: function applyWatermark(path) { + var options, + tempPath, + _args2 = arguments; + return _regenerator.default.async(function applyWatermark$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + options = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : {}; + _context2.prev = 1; + _context2.next = 4; + return _regenerator.default.awrap(_newsmemoryUtils.default.addWatermarkToPageComponent(path, options)); + + case 4: + tempPath = _context2.sent; + _context2.next = 7; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[21]).FileUtils.unlink(path)); + + case 7: + _context2.next = 9; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[21]).FileUtils.moveFile(tempPath, path)); + + case 9: + return _context2.abrupt("return", true); + + case 12: + _context2.prev = 12; + _context2.t0 = _context2["catch"](1); + + case 14: + return _context2.abrupt("return", false); + + case 15: + case "end": + return _context2.stop(); + } + } + }, null, null, [[1, 12]], Promise); + } + }, { + key: "componentNeedsWatermark", + value: function componentNeedsWatermark(image, page) { + var xmlId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : -1; + + if (image && image.isGraph()) { + return true; + } + + if (page && xmlId >= 0 && !_$$_REQUIRE(_dependencyMap[21]).JSUtils.isEmpty(page.getArticles())) { + var articleByXmlId = page.getArticles().find(function (article) { + return article.getXmlId() === xmlId; + }); + + if (articleByXmlId) { + return articleByXmlId.isText() && image.isHighRes() && image.getName().search("pag_[0-9]+_0.jpg") > -1; + } + } + + return false; + } + }, { + key: "addWatermark", + value: function addWatermark(path, image, page, xmlId) { + var _global$getActivePSet, addWatermark, options, success; + + return _regenerator.default.async(function addWatermark$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _global$getActivePSet = global.getActivePSetup(), addWatermark = _global$getActivePSet.addWatermark; + + if (!(addWatermark && this.componentNeedsWatermark(image, page, xmlId))) { + _context3.next = 8; + break; + } + + options = { + position: image.isGraph() ? "center" : "topLeft", + fontSize: image.isGraph() ? 40 : 25, + cssClasses: image.isGraph() ? ["newsmemory-watermark-graph"] : ["newsmemory-watermark-pag"] + }; + _context3.next = 5; + return _regenerator.default.awrap(this.applyWatermark(path, options)); + + case 5: + success = _context3.sent; + + if (!success) { + _context3.next = 8; + break; + } + + return _context3.abrupt("return", { + path: path, + image: image + }); + + case 8: + return _context3.abrupt("return", undefined); + + case 9: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "downloadResourceWithRetry", + value: function downloadResourceWithRetry(type, downloadMethod) { + var resource, + finished, + retry, + _len, + args, + _key, + TIMEOUT, + SERVICE_ERROR, + code, + _args4 = arguments; + + return _regenerator.default.async(function downloadResourceWithRetry$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + finished = false; + retry = 0; + + for (_len = _args4.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + args[_key - 2] = _args4[_key]; + } + + case 3: + _context4.prev = 3; + + if (retry > 0) {} + + _context4.next = 7; + return _regenerator.default.awrap(downloadMethod.apply(undefined, args)); + + case 7: + resource = _context4.sent; + finished = true; + _context4.next = 14; + break; + + case 11: + _context4.prev = 11; + _context4.t0 = _context4["catch"](3); + + if (_context4.t0 instanceof _downloadUtils.DownloadError) { + TIMEOUT = _downloadUtils.DOWNLOAD_ERROR_CODES.TIMEOUT, SERVICE_ERROR = _downloadUtils.DOWNLOAD_ERROR_CODES.SERVICE_ERROR; + code = _context4.t0.code; + + if (code === TIMEOUT || code === SERVICE_ERROR) { + retry += 1; + } else { + finished = true; + } + } + + case 14: + if (!finished && retry < 2) { + _context4.next = 3; + break; + } + + case 15: + return _context4.abrupt("return", resource); + + case 16: + case "end": + return _context4.stop(); + } + } + }, null, null, [[3, 11]], Promise); + } + }, { + key: "downloadImages", + value: function downloadImages(newspaper, page, images) { + var paper, issue, secret, filename, filetime, isModeLow, downloadedImages, watermarkPromises, i, image, imageName, _ref, path, width, height, relativePathToImage; + + return _regenerator.default.async(function downloadImages$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + paper = newspaper.getPaper(); + issue = newspaper.getIssue(); + secret = newspaper.getSecret(); + filename = page.getFilename(); + filetime = page.getModifyTime(); + isModeLow = _newsmemoryUtils.default.isModeLow(newspaper.dbNetwork); + downloadedImages = []; + watermarkPromises = []; + i = 0; + + case 9: + if (!(i < images.length)) { + _context5.next = 25; + break; + } + + image = images[i]; + imageName = image.getName(isModeLow); + _context5.next = 14; + return _regenerator.default.awrap(this.downloadResourceWithRetry("image", _NewsmemoryAJAX.default.downloadImage, paper, issue, imageName, filename, filetime, secret)); + + case 14: + _context5.t0 = _context5.sent; + + if (_context5.t0) { + _context5.next = 17; + break; + } + + _context5.t0 = {}; + + case 17: + _ref = _context5.t0; + path = _ref.path; + width = _ref.width; + height = _ref.height; + + if (path) { + relativePathToImage = path.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + image.setBase64(relativePathToImage); + image.setWidth(width); + image.setHeight(height); + downloadedImages.push(image); + watermarkPromises.push(this.addWatermark(path, image, page)); + } + + case 22: + i++; + _context5.next = 9; + break; + + case 25: + if (!(watermarkPromises.length > 0)) { + _context5.next = 33; + break; + } + + _context5.prev = 26; + _context5.next = 29; + return _regenerator.default.awrap(Promise.all(watermarkPromises)); + + case 29: + _context5.next = 33; + break; + + case 31: + _context5.prev = 31; + _context5.t1 = _context5["catch"](26); + + case 33: + return _context5.abrupt("return", downloadedImages); + + case 34: + case "end": + return _context5.stop(); + } + } + }, null, this, [[26, 31]], Promise); + } + }, { + key: "downloadHRImage", + value: function downloadHRImage(newspaper, page, xmlId, boxId) { + var graph, + image, + _ref2, + path, + width, + height, + relativePathToImage, + imageName, + _args6 = arguments; + + return _regenerator.default.async(function downloadHRImage$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + graph = _args6.length > 4 && _args6[4] !== undefined ? _args6[4] : true; + _context6.next = 3; + return _regenerator.default.awrap(this.downloadResourceWithRetry("hrimage", _NewsmemoryAJAX.default.downloadHRImage, newspaper.getPaper(), newspaper.getIssue(), page.getFilename(), page.getModifyTime(), xmlId, boxId, graph, newspaper.getSecret())); + + case 3: + _context6.t0 = _context6.sent; + + if (_context6.t0) { + _context6.next = 6; + break; + } + + _context6.t0 = {}; + + case 6: + _ref2 = _context6.t0; + path = _ref2.path; + width = _ref2.width; + height = _ref2.height; + + if (!path) { + _context6.next = 27; + break; + } + + relativePathToImage = path.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + imageName = _tecnaviaFileUtils.default.getFilename(path); + image = new _EPaperImage.default(); + image.setPageId(page.getPageId()); + image.setName(imageName); + image.setTypeByName(imageName); + image.setBase64(relativePathToImage); + image.setWidth(width); + image.setHeight(height); + _context6.prev = 20; + _context6.next = 23; + return _regenerator.default.awrap(this.addWatermark(path, image, page, xmlId)); + + case 23: + _context6.next = 27; + break; + + case 25: + _context6.prev = 25; + _context6.t1 = _context6["catch"](20); + + case 27: + return _context6.abrupt("return", image); + + case 28: + case "end": + return _context6.stop(); + } + } + }, null, this, [[20, 25]], Promise); + } + }, { + key: "downloadHRImages", + value: function downloadHRImages(newspaper, page) { + var _this = this; + + var paper, issue, secret, filename, filetime, downloadedImages, path, addZipToModel, _global$getActivePSet2, addWatermark, hasEditorials, destinationFolder, HR, images, watermarkPromises, watermarkedImages, watermarkedImagePaths, nonWatermarkedImages, image, relativePathToZip; + + return _regenerator.default.async(function downloadHRImages$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + paper = newspaper.getPaper(); + issue = newspaper.getIssue(); + secret = newspaper.getSecret(); + filename = page.getFilename(); + filetime = page.getModifyTime(); + downloadedImages = []; + _context7.next = 8; + return _regenerator.default.awrap(this.downloadResourceWithRetry("hrimages", _NewsmemoryAJAX.default.downloadHRImagesZip, paper, issue, filename, filetime, secret)); + + case 8: + path = _context7.sent; + + if (!path) { + _context7.next = 51; + break; + } + + _context7.prev = 10; + addZipToModel = true; + _global$getActivePSet2 = global.getActivePSetup(), addWatermark = _global$getActivePSet2.addWatermark; + hasEditorials = false; + + if (page && !_$$_REQUIRE(_dependencyMap[21]).JSUtils.isEmpty(page.getArticles())) { + hasEditorials = page.getArticles().find(function (article) { + return article.isText(); + }) !== undefined; + } + + if (!(addWatermark && hasEditorials)) { + _context7.next = 46; + break; + } + + destinationFolder = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + filename + "/"; + _context7.next = 19; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unzip(path, destinationFolder)); + + case 19: + HR = _EPaperImage.EPaperImageName.HR; + _context7.next = 22; + return _regenerator.default.awrap(_downloadUtils.default.scanPageFolderForImages(destinationFolder, [HR])); + + case 22: + images = _context7.sent; + watermarkPromises = []; + images.forEach(function (_ref3) { + var imagePath = _ref3.path, + name = _ref3.name, + width = _ref3.width, + height = _ref3.height; + var relativePathToImage = imagePath.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + var image = new _EPaperImage.default(); + image.setPageId(page.getPageId()); + image.setName(name); + image.setTypeByName(name); + image.setBase64(relativePathToImage); + image.setWidth(width); + image.setHeight(height); + var imageNameParts = name.split("_"); + + if (imageNameParts.length > 1) { + var xmlId = parseInt(imageNameParts[1], 10); + watermarkPromises.push(_this.addWatermark(imagePath, image, page, xmlId)); + } + }); + watermarkedImages = []; + + if (!(watermarkPromises.length > 0)) { + _context7.next = 30; + break; + } + + _context7.next = 29; + return _regenerator.default.awrap(Promise.all(watermarkPromises)); + + case 29: + watermarkedImages = _context7.sent.filter(function (filePath) { + return !_$$_REQUIRE(_dependencyMap[21]).JSUtils.isEmpty(filePath); + }); + + case 30: + if (!(watermarkedImages.length > 0)) { + _context7.next = 45; + break; + } + + watermarkedImages.forEach(function (_ref4) { + var image = _ref4.image; + downloadedImages.push(image); + }); + _context7.next = 34; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[21]).FileUtils.unlink(path)); + + case 34: + watermarkedImagePaths = watermarkedImages.map(function (_ref5) { + var imagePath = _ref5.path; + return imagePath; + }); + nonWatermarkedImages = images.map(function (_ref6) { + var imagePath = _ref6.path; + return imagePath; + }).filter(function (imagePath) { + return !watermarkedImagePaths.includes(imagePath); + }); + + if (!(nonWatermarkedImages.length > 0)) { + _context7.next = 42; + break; + } + + _context7.next = 39; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[21]).FileUtils.zipFiles(nonWatermarkedImages, path, { + compression: false + })); + + case 39: + nonWatermarkedImages.forEach(function (imagePath) { + _$$_REQUIRE(_dependencyMap[21]).FileUtils.unlink(imagePath); + }); + _context7.next = 43; + break; + + case 42: + addZipToModel = false; + + case 43: + _context7.next = 46; + break; + + case 45: + images.forEach(function (imagePath) { + _$$_REQUIRE(_dependencyMap[21]).FileUtils.unlink(imagePath); + }); + + case 46: + if (addZipToModel) { + image = new _EPaperImage.default(); + image.setPageId(page.pageId); + image.setType(_EPaperImage.EPaperImageType.HR_ZIP); + relativePathToZip = path.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + image.setBase64(relativePathToZip); + downloadedImages.push(image); + } + + _context7.next = 51; + break; + + case 49: + _context7.prev = 49; + _context7.t0 = _context7["catch"](10); + + case 51: + return _context7.abrupt("return", downloadedImages); + + case 52: + case "end": + return _context7.stop(); + } + } + }, null, this, [[10, 49]], Promise); + } + }, { + key: "downloadZip", + value: function downloadZip(newspaper, page) { + var _this2 = this; + + var paper, issue, secret, filename, filetime, localImagesFilenames, downloadedImages, watermarkPromises; + return _regenerator.default.async(function downloadZip$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + paper = newspaper.getPaper(); + issue = newspaper.getIssue(); + secret = newspaper.getSecret(); + filename = page.getFilename(); + filetime = page.getModifyTime(); + _context8.next = 7; + return _regenerator.default.awrap(this.downloadResourceWithRetry("singlezip", _NewsmemoryAJAX.default.downloadPageZip, paper, issue, filename, filetime, secret)); + + case 7: + _context8.t0 = _context8.sent; + + if (_context8.t0) { + _context8.next = 10; + break; + } + + _context8.t0 = []; + + case 10: + localImagesFilenames = _context8.t0; + downloadedImages = []; + _context8.prev = 12; + watermarkPromises = []; + localImagesFilenames.forEach(function (_ref7) { + var path = _ref7.path, + name = _ref7.name, + width = _ref7.width, + height = _ref7.height; + var image = new _EPaperImage.default(); + var relativePathToImage = path.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + image.setPageId(page.pageId); + image.setTypeByName(name); + image.setBase64(relativePathToImage); + image.setWidth(width); + image.setHeight(height); + downloadedImages.push(image); + watermarkPromises.push(_this2.addWatermark(path, image, page)); + }); + + if (!(watermarkPromises.length > 0)) { + _context8.next = 18; + break; + } + + _context8.next = 18; + return _regenerator.default.awrap(Promise.all(watermarkPromises)); + + case 18: + _context8.next = 22; + break; + + case 20: + _context8.prev = 20; + _context8.t1 = _context8["catch"](12); + + case 22: + return _context8.abrupt("return", downloadedImages); + + case 23: + case "end": + return _context8.stop(); + } + } + }, null, this, [[12, 20]], Promise); + } + }, { + key: "downloadMultiZip", + value: function downloadMultiZip(newspaper, pages) { + var _this3 = this; + + var paper, issue, secret, filenames, filetimes, localPages, downloadedImages, watermarkPromises; + return _regenerator.default.async(function downloadMultiZip$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + paper = newspaper.getPaper(); + issue = newspaper.getIssue(); + secret = newspaper.getSecret(); + filenames = pages.map(function (page) { + return page.getFilename(); + }); + filetimes = pages.map(function (page) { + return page.getModifyTime(); + }); + _context9.next = 7; + return _regenerator.default.awrap(this.downloadResourceWithRetry("multizip", _NewsmemoryAJAX.default.downloadMultiplePagesZips, paper, issue, filenames, filetimes, secret)); + + case 7: + _context9.t0 = _context9.sent; + + if (_context9.t0) { + _context9.next = 10; + break; + } + + _context9.t0 = []; + + case 10: + localPages = _context9.t0; + downloadedImages = []; + watermarkPromises = []; + _context9.prev = 13; + localPages.forEach(function (localPage, index) { + watermarkPromises.push.apply(watermarkPromises, (0, _toConsumableArray2.default)(localPage.map(function (_ref8) { + var path = _ref8.path, + name = _ref8.name, + width = _ref8.width, + height = _ref8.height; + var image = new _EPaperImage.default(); + var relativePathToImage = path.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), "./"); + image.setPageId(pages[index].pageId); + image.setTypeByName(name); + image.setBase64(relativePathToImage); + image.setWidth(width); + image.setHeight(height); + downloadedImages.push(image); + return _this3.addWatermark(path, image, pages[index]); + }))); + }); + + if (!(watermarkPromises.length > 0)) { + _context9.next = 18; + break; + } + + _context9.next = 18; + return _regenerator.default.awrap(Promise.all(watermarkPromises)); + + case 18: + _context9.next = 22; + break; + + case 20: + _context9.prev = 20; + _context9.t1 = _context9["catch"](13); + + case 22: + return _context9.abrupt("return", downloadedImages); + + case 23: + case "end": + return _context9.stop(); + } + } + }, null, this, [[13, 20]], Promise); + } + }, { + key: "loadImages", + value: function loadImages(newspaper, page, images) { + var downloadedImages; + return _regenerator.default.async(function loadImages$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + _context10.next = 2; + return _regenerator.default.awrap(this.downloadImages(newspaper, page, images)); + + case 2: + downloadedImages = _context10.sent; + downloadedImages = downloadedImages.filter(function (downloadedImage) { + return downloadedImage; + }); + + if (!(downloadedImages.length > 0)) { + _context10.next = 9; + break; + } + + downloadedImages.forEach(function (downloadedImage) { + page.addImage(downloadedImage); + }); + this.callDownloadListener(downloadedImages, newspaper); + _context10.next = 9; + return _regenerator.default.awrap(this.generateTextPngFromImages(newspaper, page, downloadedImages)); + + case 9: + return _context10.abrupt("return", downloadedImages); + + case 10: + case "end": + return _context10.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "callDownloadListener", + value: function callDownloadListener(downloadedImages, newspaper) { + return _regenerator.default.async(function callDownloadListener$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + _context11.prev = 0; + + if (!(typeof this.onDownloadImageListener === "function" && downloadedImages)) { + _context11.next = 4; + break; + } + + _context11.next = 4; + return _regenerator.default.awrap(this.onDownloadImageListener(downloadedImages, newspaper)); + + case 4: + _context11.next = 8; + break; + + case 6: + _context11.prev = 6; + _context11.t0 = _context11["catch"](0); + + case 8: + case "end": + return _context11.stop(); + } + } + }, null, this, [[0, 6]], Promise); + } + }, { + key: "getHighPriorityQueueLength", + value: function getHighPriorityQueueLength() { + return this.priorityDownloadQueue.size; + } + }, { + key: "startHighResDownloadQueue", + value: function startHighResDownloadQueue(limited) { + var concurrency = limited ? MIN_NUMBER_HIGH_RES_DOWNLOADS : MAX_NUMBER_HIGH_RES_DOWNLOADS; + + if (!this.highResDownloadQueue) { + this.highResDownloadQueue = new _pQueue.default({ + concurrency: concurrency + }); + } else { + this.highResDownloadQueue.concurrency = concurrency; + } + + this.highResDownloadQueue.clear(); + + _$$_REQUIRE(_dependencyMap[22]).HrUtility.clearQueue(); + + _$$_REQUIRE(_dependencyMap[22]).HrUtility.setPoolSize(concurrency); + } + }, { + key: "increaseHighResDownloadQueueConcurrency", + value: function increaseHighResDownloadQueueConcurrency() { + if (!this.highResDownloadQueue) { + this.startHighResDownloadQueue(false); + } else { + this.highResDownloadQueue.concurrency = MAX_NUMBER_HIGH_RES_DOWNLOADS; + } + + _$$_REQUIRE(_dependencyMap[22]).HrUtility.setPoolSize(MAX_NUMBER_HIGH_RES_DOWNLOADS); + } + }, { + key: "restartHighResQueue", + value: function restartHighResQueue() { + if (this.highResDownloadQueue) { + this.highResDownloadQueue.clear(); + this.highResDownloadQueue.start(); + } + + _$$_REQUIRE(_dependencyMap[22]).HrUtility.clearQueue(); + } + }, { + key: "resumeHighResQueue", + value: function resumeHighResQueue() { + if (this.highResDownloadQueue) { + this.highResDownloadQueue.start(); + } + + _$$_REQUIRE(_dependencyMap[22]).HrUtility.resumeQueue(); + } + }, { + key: "pauseHighResQueue", + value: function pauseHighResQueue() { + if (this.highResDownloadQueue) { + this.highResDownloadQueue.pause(); + } + + _$$_REQUIRE(_dependencyMap[22]).HrUtility.pauseQueue(); + } + }, { + key: "startHighPriorityQueue", + value: function startHighPriorityQueue() { + this.priorityDownloadQueue.start(); + } + }, { + key: "pauseHighPriorityQueue", + value: function pauseHighPriorityQueue() { + this.priorityDownloadQueue.pause(); + } + }, { + key: "setHighPriorityQueuePoolSize", + value: function setHighPriorityQueuePoolSize(limited) { + if (this.priorityDownloadQueue) { + this.priorityDownloadQueue.concurrency = limited ? MIN_NUMBER_PRIORITY_DOWNLOADS : MAX_NUMBER_PRIORITY_DOWNLOADS; + } + } + }, { + key: "onHighPriorityQueueIdle", + value: function onHighPriorityQueueIdle() { + return this.priorityDownloadQueue.onIdle(); + } + }, { + key: "getStandardPriorityQueueLength", + value: function getStandardPriorityQueueLength() { + return this.standardDownloadQueue.size; + } + }, { + key: "startStandardPriorityQueue", + value: function startStandardPriorityQueue() { + this.standardDownloadQueue.start(); + } + }, { + key: "setStandardQueuePoolSize", + value: function setStandardQueuePoolSize(limited) { + if (this.standardDownloadQueue) { + this.standardDownloadQueue.concurrency = limited ? MIN_NUMBER_STANDARD_DOWNLOADS : MAX_NUMBER_STANDARD_DOWNLOADS; + } + } + }, { + key: "pauseStandardPriorityQueue", + value: function pauseStandardPriorityQueue() { + this.standardDownloadQueue.pause(); + } + }, { + key: "onStandardPriorityQueueIdle", + value: function onStandardPriorityQueueIdle() { + return this.standardDownloadQueue.onIdle(); + } + }, { + key: "clearThumbnailQueue", + value: function clearThumbnailQueue() { + if (this.thumbnailDownloadQueue) { + this.thumbnailDownloadQueue.clear(); + } + } + }, { + key: "clearQueues", + value: function clearQueues() { + if (this.standardDownloadQueue) { + this.standardDownloadQueue.clear(); + } + + if (this.priorityDownloadQueue) { + this.priorityDownloadQueue.clear(); + } + + if (this.highResDownloadQueue) { + this.highResDownloadQueue.clear(); + } + + this.clearThumbnailQueue(); + } + }, { + key: "loadResource", + value: function loadResource(isHighPriorityQueue, priority, operation) { + var _len2, + args, + _key2, + queue, + _args13 = arguments; + + return _regenerator.default.async(function loadResource$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + for (_len2 = _args13.length, args = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) { + args[_key2 - 3] = _args13[_key2]; + } + + queue = isHighPriorityQueue ? this.priorityDownloadQueue : this.standardDownloadQueue; + return _context13.abrupt("return", queue.add(function _callee() { + return _regenerator.default.async(function _callee$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + return _context12.abrupt("return", operation.apply(undefined, args)); + + case 1: + case "end": + return _context12.stop(); + } + } + }, null, null, null, Promise); + }, { + priority: priority + })); + + case 3: + case "end": + return _context13.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadHighResResource", + value: function loadHighResResource(priority, operation) { + var _len3, + args, + _key3, + _args15 = arguments; + + return _regenerator.default.async(function loadHighResResource$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + for (_len3 = _args15.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) { + args[_key3 - 2] = _args15[_key3]; + } + + return _context15.abrupt("return", this.highResDownloadQueue.add(function _callee2() { + return _regenerator.default.async(function _callee2$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + return _context14.abrupt("return", operation.apply(undefined, args)); + + case 1: + case "end": + return _context14.stop(); + } + } + }, null, null, null, Promise); + }, { + priority: priority + })); + + case 2: + case "end": + return _context15.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_loadImage", + value: function _loadImage(newspaper, page, image) { + var downloadedImages; + return _regenerator.default.async(function _loadImage$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + _context16.next = 2; + return _regenerator.default.awrap(this.loadImages(newspaper, page, [image])); + + case 2: + downloadedImages = _context16.sent; + + if (!(downloadedImages.length > 0)) { + _context16.next = 5; + break; + } + + return _context16.abrupt("return", downloadedImages[0]); + + case 5: + return _context16.abrupt("return", null); + + case 6: + case "end": + return _context16.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_loadHrImage", + value: function _loadHrImage(newspaper, page, xmlId, boxId, graph) { + var downloadedImage; + return _regenerator.default.async(function _loadHrImage$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + _context17.next = 2; + return _regenerator.default.awrap(this.downloadHRImage(newspaper, page, xmlId, boxId, graph)); + + case 2: + downloadedImage = _context17.sent; + + if (downloadedImage) { + page.addImage(downloadedImage); + this.callDownloadListener([downloadedImage], newspaper); + } + + return _context17.abrupt("return", downloadedImage); + + case 5: + case "end": + return _context17.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_loadHRImages", + value: function _loadHRImages(newspaper, page) { + var downloadedImages; + return _regenerator.default.async(function _loadHRImages$(_context18) { + while (1) { + switch (_context18.prev = _context18.next) { + case 0: + _context18.next = 2; + return _regenerator.default.awrap(this.downloadHRImages(newspaper, page)); + + case 2: + downloadedImages = _context18.sent; + downloadedImages = downloadedImages.filter(function (downloadedImage) { + return downloadedImage; + }); + + if (downloadedImages.length > 0) { + downloadedImages.forEach(function (downloadedImage) { + page.addImage(downloadedImage); + }); + this.callDownloadListener(downloadedImages, newspaper); + } + + return _context18.abrupt("return", downloadedImages); + + case 6: + case "end": + return _context18.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_loadZip", + value: function _loadZip(newspaper, page) { + var downloadedImages; + return _regenerator.default.async(function _loadZip$(_context19) { + while (1) { + switch (_context19.prev = _context19.next) { + case 0: + _context19.next = 2; + return _regenerator.default.awrap(this.downloadZip(newspaper, page)); + + case 2: + downloadedImages = _context19.sent; + downloadedImages = downloadedImages.filter(function (downloadedImage) { + return downloadedImage; + }); + + if (!(downloadedImages.length > 0)) { + _context19.next = 9; + break; + } + + downloadedImages.forEach(function (downloadedImage) { + page.addImage(downloadedImage); + }); + this.callDownloadListener(downloadedImages, newspaper); + _context19.next = 9; + return _regenerator.default.awrap(this.generateTextPngFromImages(newspaper, page, downloadedImages)); + + case 9: + return _context19.abrupt("return", downloadedImages); + + case 10: + case "end": + return _context19.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_loadMultiZip", + value: function _loadMultiZip(newspaper, pages) { + var _this4 = this; + + var downloadedImages, _loop, i; + + return _regenerator.default.async(function _loadMultiZip$(_context21) { + while (1) { + switch (_context21.prev = _context21.next) { + case 0: + _context21.next = 2; + return _regenerator.default.awrap(this.downloadMultiZip(newspaper, pages)); + + case 2: + downloadedImages = _context21.sent; + downloadedImages = downloadedImages.filter(function (downloadedImage) { + return downloadedImage; + }); + + if (!(downloadedImages.length > 0)) { + _context21.next = 14; + break; + } + + _loop = function _callee3(i) { + var page, pageId, downloadedImagesForPage; + return _regenerator.default.async(function _callee3$(_context20) { + while (1) { + switch (_context20.prev = _context20.next) { + case 0: + page = pages[i]; + pageId = page.pageId; + downloadedImagesForPage = downloadedImages.filter(function (elem) { + return elem.pageId === pageId; + }); + + if (!(downloadedImagesForPage && downloadedImagesForPage.length > 0)) { + _context20.next = 7; + break; + } + + downloadedImagesForPage.forEach(function (downloadedImage) { + page.addImage(downloadedImage); + }); + _context20.next = 7; + return _regenerator.default.awrap(_this4.generateTextPngFromImages(newspaper, page, downloadedImagesForPage)); + + case 7: + case "end": + return _context20.stop(); + } + } + }, null, null, null, Promise); + }; + + i = 0; + + case 7: + if (!(i < pages.length)) { + _context21.next = 13; + break; + } + + _context21.next = 10; + return _regenerator.default.awrap(_loop(i)); + + case 10: + i++; + _context21.next = 7; + break; + + case 13: + this.callDownloadListener(downloadedImages, newspaper); + + case 14: + return _context21.abrupt("return", downloadedImages); + + case 15: + case "end": + return _context21.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadImageInQueue", + value: function loadImageInQueue(newspaper, page, image, isHighPriorityQueue, innerPriority) { + return _regenerator.default.async(function loadImageInQueue$(_context22) { + while (1) { + switch (_context22.prev = _context22.next) { + case 0: + return _context22.abrupt("return", this.loadResource(isHighPriorityQueue, innerPriority, this.loadImage, newspaper, page, image)); + + case 1: + case "end": + return _context22.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadThumbnailInQueue", + value: function loadThumbnailInQueue(newspaper, page, image) { + var _this5 = this; + + return _regenerator.default.async(function loadThumbnailInQueue$(_context24) { + while (1) { + switch (_context24.prev = _context24.next) { + case 0: + return _context24.abrupt("return", this.thumbnailDownloadQueue.add(function _callee4() { + return _regenerator.default.async(function _callee4$(_context23) { + while (1) { + switch (_context23.prev = _context23.next) { + case 0: + return _context23.abrupt("return", _this5.loadImage(newspaper, page, image)); + + case 1: + case "end": + return _context23.stop(); + } + } + }, null, null, null, Promise); + })); + + case 1: + case "end": + return _context24.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadHRImageInQueue", + value: function loadHRImageInQueue(newspaper, page, xmlId, boxId, innerPriority, graph) { + return _regenerator.default.async(function loadHRImageInQueue$(_context25) { + while (1) { + switch (_context25.prev = _context25.next) { + case 0: + return _context25.abrupt("return", this.loadHighResResource(innerPriority, this.loadHrImage, newspaper, page, xmlId, boxId, graph)); + + case 1: + case "end": + return _context25.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadHRImagesInQueue", + value: function loadHRImagesInQueue(newspaper, page, isHighPriorityQueue, innerPriority) { + return _regenerator.default.async(function loadHRImagesInQueue$(_context26) { + while (1) { + switch (_context26.prev = _context26.next) { + case 0: + return _context26.abrupt("return", this.loadResource(isHighPriorityQueue, innerPriority, this.loadHRImages, newspaper, page)); + + case 1: + case "end": + return _context26.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadZipInQueue", + value: function loadZipInQueue(newspaper, page, isHighPriorityQueue, innerPriority) { + return _regenerator.default.async(function loadZipInQueue$(_context27) { + while (1) { + switch (_context27.prev = _context27.next) { + case 0: + return _context27.abrupt("return", this.loadResource(isHighPriorityQueue, innerPriority, this.loadZip, newspaper, page)); + + case 1: + case "end": + return _context27.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "loadMultiZipInQueue", + value: function loadMultiZipInQueue(newspaper, pages, isHighPriorityQueue, innerPriority) { + return _regenerator.default.async(function loadMultiZipInQueue$(_context28) { + while (1) { + switch (_context28.prev = _context28.next) { + case 0: + return _context28.abrupt("return", this.loadResource(isHighPriorityQueue, innerPriority, this.loadMultiZip, newspaper, pages)); + + case 1: + case "end": + return _context28.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "downloadIndex", + value: function downloadIndex(newspaper) { + var error, TIMEOUT, NO_GRANTS, GENERIC_ERROR, issue, edition, result, invalid, index, params; + return _regenerator.default.async(function downloadIndex$(_context29) { + while (1) { + switch (_context29.prev = _context29.next) { + case 0: + TIMEOUT = _downloadUtils.DOWNLOAD_ERROR_CODES.TIMEOUT, NO_GRANTS = _downloadUtils.DOWNLOAD_ERROR_CODES.NO_GRANTS, GENERIC_ERROR = _downloadUtils.DOWNLOAD_ERROR_CODES.GENERIC_ERROR; + issue = newspaper.dbIssue, edition = newspaper.dbEdition; + _context29.prev = 2; + _context29.next = 5; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.downloadPaperIndex(issue, edition)); + + case 5: + result = _context29.sent; + invalid = result.invalid ? parseInt(result.invalid, 10) : 0; + + if (invalid) { + _context29.next = 16; + break; + } + + if (!(Array.isArray(result) && result.length > 0)) { + _context29.next = 10; + break; + } + + return _context29.abrupt("return", { + index: result + }); + + case 10: + index = result.index; + + if (!(index && Array.isArray(index) && index.length > 0)) { + _context29.next = 13; + break; + } + + return _context29.abrupt("return", result); + + case 13: + error = new _downloadUtils.DownloadError(GENERIC_ERROR, "Index is invalid"); + _context29.next = 18; + break; + + case 16: + params = { + valErrCode: result.valErrCode, + issue: result.issue, + edition: result.edition, + extraParams: result.extraParams + }; + + if (invalid === NO_GRANTS) { + error = new _downloadUtils.DownloadError(NO_GRANTS, "No grants"); + error.setParams(params); + } else { + error = new _downloadUtils.DownloadError(GENERIC_ERROR, "Invalid response from the server"); + } + + case 18: + _context29.next = 23; + break; + + case 20: + _context29.prev = 20; + _context29.t0 = _context29["catch"](2); + error = new _downloadUtils.DownloadError(TIMEOUT, "Unable to download index from server"); + + case 23: + throw error; + + case 24: + case "end": + return _context29.stop(); + } + } + }, null, null, [[2, 20]], Promise); + } + }, { + key: "generateTextPngFromImages", + value: function generateTextPngFromImages(newspaper, page, downloadedImages) { + var i, downloadedImage, textPDFFullPath, destination, _DeviceUtils$getScree, width, height, isPortrait, _ref9, graphWidth, graphHeight, _global$getActivePSet3, pngQualityFactor, generatePNGBasedOnScreenDimensions, considerPixelRatioInPNGGeneration, pngWidthLimit, pngLocation, pngImage, pngName, relativePathToImage, paper, issue, secret, filename, filetime, path, _width, _height, gifLocation, _await$getImageSize, _await$NewsmemoryAJAX, _pngImage, _relativePathToImage; + + return _regenerator.default.async(function generateTextPngFromImages$(_context30) { + while (1) { + switch (_context30.prev = _context30.next) { + case 0: + if (!_$$_REQUIRE(_dependencyMap[21]).PlatformUtils.isAndroid()) { + _context30.next = 3; + break; + } + + _context30.next = 86; + break; + + case 3: + if (!page.getPNGImage()) { + _context30.next = 6; + break; + } + + _context30.next = 86; + break; + + case 6: + i = 0; + + case 7: + if (!(i < downloadedImages.length)) { + _context30.next = 86; + break; + } + + downloadedImage = downloadedImages[i]; + + if (!downloadedImage.isTextPDF()) { + _context30.next = 83; + break; + } + + textPDFFullPath = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory() + downloadedImage.getBase64(); + destination = textPDFFullPath.replace(/.{3}$/, "png"); + _context30.prev = 12; + _DeviceUtils$getScree = _deviceUtils.default.getScreenDimensions(), width = _DeviceUtils$getScree.width, height = _DeviceUtils$getScree.height, isPortrait = _DeviceUtils$getScree.isPortrait; + _ref9 = page.getGraphImage() || { + width: page.getFrameWidth(), + height: page.getFrameHeight() + }, graphWidth = _ref9.width, graphHeight = _ref9.height; + _global$getActivePSet3 = global.getActivePSetup(), pngQualityFactor = _global$getActivePSet3.pngQualityFactor, generatePNGBasedOnScreenDimensions = _global$getActivePSet3.generatePNGBasedOnScreenDimensions, considerPixelRatioInPNGGeneration = _global$getActivePSet3.considerPixelRatioInPNGGeneration, pngWidthLimit = _global$getActivePSet3.pngWidthLimit; + _context30.next = 18; + return _regenerator.default.awrap(_pdfUtils.default.pdfToPng({ + page: page.getPageId(), + isDoubleTruck: page.isDoubleTruck(), + source: textPDFFullPath, + destination: destination, + graphWidth: graphWidth, + graphHeight: graphHeight, + pngQualityFactor: pngQualityFactor, + generatePNGBasedOnScreenDimensions: generatePNGBasedOnScreenDimensions, + width: isPortrait ? width : height, + height: isPortrait ? height : width, + pixelRatio: considerPixelRatioInPNGGeneration ? _$$_REQUIRE(_dependencyMap[21]).PlatformUtils.info.pixelRatio : 1, + pngWidthLimit: pngWidthLimit || 1080 + })); + + case 18: + pngLocation = _context30.sent; + + if (!(pngLocation === destination)) { + _context30.next = 33; + break; + } + + pngImage = new _EPaperImage.default(); + pngImage.setHeight(downloadedImage.getHeight()); + pngImage.setWidth(downloadedImage.getWidth()); + pngImage.setPageId(downloadedImage.getPageId()); + pngName = _$$_REQUIRE(_dependencyMap[21]).StringUtils.fileNameFromPath(pngLocation); + pngImage.setName(pngName); + pngImage.setTypeByName(pngName); + relativePathToImage = pngLocation.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), ""); + pngImage.setBase64(relativePathToImage); + page.addImage(pngImage); + this.callDownloadListener([pngImage], newspaper); + _context30.next = 34; + break; + + case 33: + throw new Error("path to generated PNG does not match destination path: " + pngLocation + ", " + destination); + + case 34: + _context30.next = 83; + break; + + case 36: + _context30.prev = 36; + _context30.t0 = _context30["catch"](12); + + if (!newspaper) { + _context30.next = 83; + break; + } + + paper = newspaper.getPaper(); + issue = newspaper.getIssue(); + secret = newspaper.getSecret(); + filename = page.getFilename(); + filetime = page.getModifyTime(); + _context30.prev = 44; + path = undefined; + _width = undefined; + _height = undefined; + gifLocation = _NewsmemoryDatabasesManager.default.getNewspaperIssueDirectory(paper, issue) + filename + "/" + _EPaperImage.EPaperImageName.GIF; + _context30.next = 51; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(gifLocation)); + + case 51: + if (!_context30.sent) { + _context30.next = 60; + break; + } + + path = gifLocation; + _context30.next = 55; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[23]).getImageSize)("file://" + path)); + + case 55: + _await$getImageSize = _context30.sent; + _width = _await$getImageSize.width; + _height = _await$getImageSize.height; + _context30.next = 66; + break; + + case 60: + _context30.next = 62; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.downloadImage(paper, issue, _EPaperImage.EPaperImageName.GIF, filename, filetime, secret)); + + case 62: + _await$NewsmemoryAJAX = _context30.sent; + path = _await$NewsmemoryAJAX.path; + _width = _await$NewsmemoryAJAX.width; + _height = _await$NewsmemoryAJAX.height; + + case 66: + if (!path) { + _context30.next = 79; + break; + } + + _context30.next = 69; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.moveFile(path, destination)); + + case 69: + _pngImage = new _EPaperImage.default(); + + _pngImage.setHeight(_height); + + _pngImage.setWidth(_width); + + _pngImage.setPageId(downloadedImage.getPageId()); + + _pngImage.setName(_EPaperImage.EPaperImageName.PNG); + + _pngImage.setTypeByName(_EPaperImage.EPaperImageName.PNG); + + _relativePathToImage = destination.replace(_tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(), ""); + + _pngImage.setBase64(_relativePathToImage); + + page.addImage(_pngImage); + this.callDownloadListener([_pngImage], newspaper); + + case 79: + _context30.next = 83; + break; + + case 81: + _context30.prev = 81; + _context30.t1 = _context30["catch"](44); + + case 83: + i++; + _context30.next = 7; + break; + + case 86: + case "end": + return _context30.stop(); + } + } + }, null, this, [[12, 36], [44, 81]], Promise); + } + }, { + key: "updateCDNStatus", + value: function updateCDNStatus(issue, edition) { + var _global$getActivePSet4, cdnEnabled, cdnServer, loginStatus, newsmemoryConfig, result, _result, data, enabled, server, version, userValid, oneTimeTokenValid, pSetupChange; + + return _regenerator.default.async(function updateCDNStatus$(_context31) { + while (1) { + switch (_context31.prev = _context31.next) { + case 0: + _global$getActivePSet4 = global.getActivePSetup(), cdnEnabled = _global$getActivePSet4.cdnEnabled, cdnServer = _global$getActivePSet4.cdnServer, loginStatus = _global$getActivePSet4.loginStatus; + newsmemoryConfig = global.getNewsmemoryConfig(); + + if (newsmemoryConfig) { + newsmemoryConfig.setCDNEnabled(cdnEnabled); + newsmemoryConfig.setCDNServer(cdnServer); + newsmemoryConfig.resetDBDownloadPSetup(); + } + + _context31.prev = 3; + _context31.next = 6; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.getCDNStatus(issue, edition)); + + case 6: + result = _context31.sent; + _context31.next = 12; + break; + + case 9: + _context31.prev = 9; + _context31.t0 = _context31["catch"](3); + + if (loginStatus) { + loginStatus.setHasAccess(issue, edition, true); + } + + case 12: + if (result && result.data) { + _result = result, data = _result.data; + + try {} catch (e) {} + + enabled = data.enabled, server = data.server, version = data.version, userValid = data.userValid, oneTimeTokenValid = data.oneTimeTokenValid, pSetupChange = data.pSetupChange; + + if (loginStatus) { + loginStatus.setHasAccess(issue, edition, userValid); + + if (!oneTimeTokenValid) { + loginStatus.resetOneTimeToken(); + } + } + + if (newsmemoryConfig) { + if (enabled !== undefined) { + newsmemoryConfig.setCDNEnabled(enabled === 1); + } + + if (server) { + newsmemoryConfig.setCDNServer(server); + } + + if (pSetupChange) { + newsmemoryConfig.setDBDownloadPSetup(pSetupChange); + } + } + } + + return _context31.abrupt("return", result); + + case 14: + case "end": + return _context31.stop(); + } + } + }, null, null, [[3, 9]], Promise); + } + }], [{ + key: "downloadArticles", + value: function downloadArticles(issue, edition, pageFileName, secret) { + var articles, inc, rawArticles; + return _regenerator.default.async(function downloadArticles$(_context32) { + while (1) { + switch (_context32.prev = _context32.next) { + case 0: + articles = []; + _context32.prev = 1; + inc = 0; + _context32.next = 5; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.downloadArticles(issue, edition, pageFileName, secret)); + + case 5: + rawArticles = _context32.sent; + articles = rawArticles.map(function (rawArticle) { + if (rawArticle.pageDesc) { + rawArticle.boxes = rawArticle.boxes + "@" + rawArticle.pageDesc; + } + + rawArticle.inc = inc; + inc += 1; + return _NewsmemoryToDTO.default.dbArticleToDTO(rawArticle); + }); + _context32.next = 11; + break; + + case 9: + _context32.prev = 9; + _context32.t0 = _context32["catch"](1); + + case 11: + return _context32.abrupt("return", articles); + + case 12: + case "end": + return _context32.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }]); + return DownloadManager; + }(); + + exports.default = DownloadManager; +},2310,[5,80,21,7,8,1940,430,714,638,587,574,2160,460,586,458,1859,2308,640,603,710,572,462,2168,588]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _DownloadOperation2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _EPaperImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SingleImageDownloadOperation = function (_DownloadOperation) { + (0, _inherits2.default)(SingleImageDownloadOperation, _DownloadOperation); + + var _super = _createSuper(SingleImageDownloadOperation); + + function SingleImageDownloadOperation(resource, priority, downloadRef) { + (0, _classCallCheck2.default)(this, SingleImageDownloadOperation); + return _super.call(this, _DownloadOperation2.DownloadOperationTypes.SINGLE_IMAGE, resource, priority, downloadRef); + } + + (0, _createClass2.default)(SingleImageDownloadOperation, [{ + key: "getPage", + value: function getPage() { + var page = this.resource.page; + return page; + } + }, { + key: "getImage", + value: function getImage() { + var image = this.resource.image; + return image; + } + }]); + return SingleImageDownloadOperation; + }(_DownloadOperation2.default); + + exports.default = SingleImageDownloadOperation; +},2311,[5,7,8,12,14,16,2312,638,587]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.DownloadOperationTypes = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var DownloadOperationTypes = { + SINGLE_IMAGE: "singleimage", + SINGLE_ZIP: "singlezip", + MULTI_ZIP: "multizip", + SINGLE_HR_ZIP: "singlehrzip" + }; + exports.DownloadOperationTypes = DownloadOperationTypes; + + var DownloadOperation = function () { + function DownloadOperation(type, resource) { + var priority = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; + var downloadRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : -1; + (0, _classCallCheck2.default)(this, DownloadOperation); + this.type = type; + this.resource = resource; + this.priority = priority; + this.downloadRef = downloadRef; + this.weight = 1; + } + + (0, _createClass2.default)(DownloadOperation, [{ + key: "getDownloadRef", + value: function getDownloadRef() { + return this.downloadRef; + } + }, { + key: "getType", + value: function getType() { + return this.type; + } + }, { + key: "getResource", + value: function getResource() { + return this.resource; + } + }, { + key: "getPriority", + value: function getPriority() { + return this.priority; + } + }, { + key: "getWeight", + value: function getWeight() { + return this.weight; + } + }]); + return DownloadOperation; + }(); + + exports.default = DownloadOperation; +},2312,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _DownloadOperation2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SingleZipDownloadOperation = function (_DownloadOperation) { + (0, _inherits2.default)(SingleZipDownloadOperation, _DownloadOperation); + + var _super = _createSuper(SingleZipDownloadOperation); + + function SingleZipDownloadOperation(resource, priority, downloadRef) { + (0, _classCallCheck2.default)(this, SingleZipDownloadOperation); + return _super.call(this, _DownloadOperation2.DownloadOperationTypes.SINGLE_ZIP, resource, priority, downloadRef); + } + + return SingleZipDownloadOperation; + }(_DownloadOperation2.default); + + exports.default = SingleZipDownloadOperation; +},2313,[5,7,12,14,16,2312,638]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _DownloadOperation2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MultiZipDownloadOperation = function (_DownloadOperation) { + (0, _inherits2.default)(MultiZipDownloadOperation, _DownloadOperation); + + var _super = _createSuper(MultiZipDownloadOperation); + + function MultiZipDownloadOperation() { + var _this; + + var resource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var priority = arguments.length > 1 ? arguments[1] : undefined; + var downloadRef = arguments.length > 2 ? arguments[2] : undefined; + (0, _classCallCheck2.default)(this, MultiZipDownloadOperation); + _this = _super.call(this, _DownloadOperation2.DownloadOperationTypes.MULTI_ZIP, resource, priority, downloadRef); + _this.weight = resource.length; + return _this; + } + + (0, _createClass2.default)(MultiZipDownloadOperation, [{ + key: "getNumberOfPages", + value: function getNumberOfPages() { + return this.resource.length; + } + }, { + key: "addPage", + value: function addPage(page) { + this.resource.push(page); + this.weight = this.resource.length; + } + }]); + return MultiZipDownloadOperation; + }(_DownloadOperation2.default); + + exports.default = MultiZipDownloadOperation; +},2314,[5,7,8,12,14,16,2312,638]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _DownloadOperation2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SingleHRZipDownloadOperation = function (_DownloadOperation) { + (0, _inherits2.default)(SingleHRZipDownloadOperation, _DownloadOperation); + + var _super = _createSuper(SingleHRZipDownloadOperation); + + function SingleHRZipDownloadOperation(resource, priority, downloadRef) { + (0, _classCallCheck2.default)(this, SingleHRZipDownloadOperation); + return _super.call(this, _DownloadOperation2.DownloadOperationTypes.SINGLE_HR_ZIP, resource, priority, downloadRef); + } + + return SingleHRZipDownloadOperation; + }(_DownloadOperation2.default); + + exports.default = SingleHRZipDownloadOperation; +},2315,[5,7,12,14,16,2312,638]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _Database = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _NewsmemoryEditionsManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var PurgeTask = function () { + function PurgeTask(issueToDownload) { + (0, _classCallCheck2.default)(this, PurgeTask); + this.TAG = "PURGE_TASK"; + this.basePath = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(); + this.baseEditionPath = _tecnaviaFileUtils.default.getNewspaperBaseDirectory(); + this.downloadedSharedPdf = _tecnaviaFileUtils.default.getDownloadedPdfDirectory(); + + if (issueToDownload) { + this.issueToDownload = issueToDownload; + this.issueToDownloadPath = this.basePath + issueToDownload; + } + + this.nIssuesToLeave = this.getNIssuesToLeave(); + this.newspapersToDelete = []; + this.issuesToLeave = []; + this.issuesToRemove = []; + this.foldersToRemove = []; + this.foldersToLeave = []; + this.purgeStartTime = 0; + } + + (0, _createClass2.default)(PurgeTask, [{ + key: "onPreExecute", + value: function onPreExecute() { + this.purgeStartTime = new Date().getTime(); + this.purgeLog(" ======== START ======= "); + } + }, { + key: "onPostExecute", + value: function onPostExecute(result) { + var purgeEndTime = new Date().getTime(); + this.purgeLog("finish -> result: " + result + ", time: " + (purgeEndTime - this.purgeStartTime) / 1000 + "s "); + this.purgeLog(" ======== STOP ======= "); + } + }, { + key: "purgeIssue", + value: function purgeIssue(issue) { + var result, allIssues, allIssueToLeave; + return _regenerator.default.async(function purgeIssue$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + this.onPreExecute(); + result = true; + _context.prev = 2; + _context.next = 5; + return _regenerator.default.awrap(this.getAllIssues()); + + case 5: + allIssues = _context.sent; + _context.next = 8; + return _regenerator.default.awrap(allIssues.reduce(function (reduced, item) { + if (item.getIssue() !== issue) { + reduced.push(item.getIssue()); + } + + return reduced; + }, [])); + + case 8: + allIssueToLeave = _context.sent; + _context.next = 11; + return _regenerator.default.awrap(this.doPurgeInBackground(allIssueToLeave, allIssueToLeave.length)); + + case 11: + result = _context.sent; + _context.next = 18; + break; + + case 14: + _context.prev = 14; + _context.t0 = _context["catch"](2); + this.purgeLog(_context.t0); + result = false; + + case 18: + this.onPostExecute(result); + return _context.abrupt("return", result); + + case 20: + case "end": + return _context.stop(); + } + } + }, null, this, [[2, 14]], Promise); + } + }, { + key: "purge", + value: function purge() { + var result; + return _regenerator.default.async(function purge$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this.onPreExecute(); + _context2.next = 3; + return _regenerator.default.awrap(this.doPurgeInBackground([this.getToday(), this.getYesterday()], this.nIssuesToLeave)); + + case 3: + result = _context2.sent; + this.onPostExecute(result); + return _context2.abrupt("return", result); + + case 6: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "doPurgeInBackground", + value: function doPurgeInBackground(issuesToMaintain, slots) { + var result; + return _regenerator.default.async(function doPurgeInBackground$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + result = true; + _context3.prev = 1; + _context3.next = 4; + return _regenerator.default.awrap(this.initIssuesStored(issuesToMaintain, slots)); + + case 4: + if (!this.isThereSomethingToPurge()) { + _context3.next = 21; + break; + } + + _context3.next = 7; + return _regenerator.default.awrap(this.initFolderToLeave()); + + case 7: + _context3.next = 9; + return _regenerator.default.awrap(this.initFolderToRemove()); + + case 9: + _context3.next = 11; + return _regenerator.default.awrap(this.cleanFolderToRemoveFromSharePage()); + + case 11: + _context3.next = 13; + return _regenerator.default.awrap(this.deletePages()); + + case 13: + _context3.next = 15; + return _regenerator.default.awrap(this.deleteSecret()); + + case 15: + _context3.next = 17; + return _regenerator.default.awrap(this.deleteIssueDatabase()); + + case 17: + _context3.next = 19; + return _regenerator.default.awrap(this.deleteParentFolderIfEmpty()); + + case 19: + _context3.next = 21; + return _regenerator.default.awrap(this.deleteIssueFromDatabases()); + + case 21: + _context3.next = 23; + return _regenerator.default.awrap(this.deleteSharedPdf()); + + case 23: + _context3.next = 29; + break; + + case 25: + _context3.prev = 25; + _context3.t0 = _context3["catch"](1); + this.purgeLog(_context3.t0); + result = false; + + case 29: + return _context3.abrupt("return", result); + + case 30: + case "end": + return _context3.stop(); + } + } + }, null, this, [[1, 25]], Promise); + } + }, { + key: "isThereSomethingToPurge", + value: function isThereSomethingToPurge() { + return this.issuesToRemove.length > 0; + } + }, { + key: "detachBasePath", + value: function detachBasePath(filePath) { + return filePath.replace(this.basePath, ""); + } + }, { + key: "deletePages", + value: function deletePages() { + var i, result; + return _regenerator.default.async(function deletePages$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + this.purgeLog("DELETE ISSUE PAGES"); + i = 0; + + case 2: + if (!(i < this.foldersToRemove.length)) { + _context4.next = 17; + break; + } + + result = false; + _context4.prev = 4; + _context4.next = 7; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(this.foldersToRemove[i])); + + case 7: + result = true; + _context4.next = 13; + break; + + case 10: + _context4.prev = 10; + _context4.t0 = _context4["catch"](4); + this.purgeLog(_context4.t0.message); + + case 13: + this.purgeLog("page -> " + this.foldersToRemove[i] + " -> " + result); + + case 14: + i++; + _context4.next = 2; + break; + + case 17: + case "end": + return _context4.stop(); + } + } + }, null, this, [[4, 10]], Promise); + } + }, { + key: "deleteSecret", + value: function deleteSecret() { + var i, result, secretFile; + return _regenerator.default.async(function deleteSecret$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + this.purgeLog("DELETE SECRET FILES"); + i = 0; + + case 2: + if (!(i < this.issuesToRemove.length)) { + _context5.next = 18; + break; + } + + result = false; + secretFile = _$$_REQUIRE(_dependencyMap[10]).StringUtils.getParentPath(this.issuesToRemove[i]) + "/secret.pdf"; + _context5.prev = 5; + _context5.next = 8; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(secretFile)); + + case 8: + result = true; + _context5.next = 14; + break; + + case 11: + _context5.prev = 11; + _context5.t0 = _context5["catch"](5); + this.purgeLog(_context5.t0.message); + + case 14: + this.purgeLog("secret -> " + secretFile + "-> " + result); + + case 15: + i++; + _context5.next = 2; + break; + + case 18: + case "end": + return _context5.stop(); + } + } + }, null, this, [[5, 11]], Promise); + } + }, { + key: "deleteIssueDatabase", + value: function deleteIssueDatabase() { + var i, result, database; + return _regenerator.default.async(function deleteIssueDatabase$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + this.purgeLog("DELETE ISSUES DATABASE"); + i = 0; + + case 2: + if (!(i < this.issuesToRemove.length)) { + _context6.next = 18; + break; + } + + result = false; + _context6.prev = 4; + database = new _Database.default(this.issuesToRemove[i]); + _context6.next = 8; + return _regenerator.default.awrap(database.delete()); + + case 8: + result = _context6.sent; + _context6.next = 14; + break; + + case 11: + _context6.prev = 11; + _context6.t0 = _context6["catch"](4); + this.purgeLog(_context6.t0.message); + + case 14: + this.purgeLog("database -> " + this.issuesToRemove[i] + " -> " + result); + + case 15: + i++; + _context6.next = 2; + break; + + case 18: + case "end": + return _context6.stop(); + } + } + }, null, this, [[4, 11]], Promise); + } + }, { + key: "deleteParentFolderIfEmpty", + value: function deleteParentFolderIfEmpty() { + var i, result, parentFolder; + return _regenerator.default.async(function deleteParentFolderIfEmpty$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + this.purgeLog("DELETE ISSUES FOLDER"); + i = 0; + + case 2: + if (!(i < this.issuesToRemove.length)) { + _context7.next = 21; + break; + } + + result = false; + parentFolder = _$$_REQUIRE(_dependencyMap[10]).StringUtils.getParentPath(this.issuesToRemove[i]); + _context7.prev = 5; + _context7.next = 8; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.empty(parentFolder)); + + case 8: + if (!_context7.sent) { + _context7.next = 12; + break; + } + + _context7.next = 11; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(parentFolder)); + + case 11: + result = true; + + case 12: + _context7.next = 17; + break; + + case 14: + _context7.prev = 14; + _context7.t0 = _context7["catch"](5); + this.purgeLog(_context7.t0.message); + + case 17: + this.purgeLog("issue folder -> " + parentFolder + " -> " + result); + + case 18: + i++; + _context7.next = 2; + break; + + case 21: + case "end": + return _context7.stop(); + } + } + }, null, this, [[5, 14]], Promise); + } + }, { + key: "deleteIssueFromDatabases", + value: function deleteIssueFromDatabases() { + var i, result, issue; + return _regenerator.default.async(function deleteIssueFromDatabases$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + this.purgeLog("DELETE ISSUES FROM DATABASES"); + i = 0; + + case 2: + if (!(i < this.issuesToRemove.length)) { + _context8.next = 18; + break; + } + + result = false; + issue = this.detachBasePath(this.issuesToRemove[i]); + _context8.prev = 5; + _context8.next = 8; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.deleteIssueByFilename(issue)); + + case 8: + result = _context8.sent; + _context8.next = 14; + break; + + case 11: + _context8.prev = 11; + _context8.t0 = _context8["catch"](5); + this.purgeLog(_context8.t0.message); + + case 14: + this.purgeLog("issue -> " + issue + " -> " + result); + + case 15: + i++; + _context8.next = 2; + break; + + case 18: + case "end": + return _context8.stop(); + } + } + }, null, this, [[5, 11]], Promise); + } + }, { + key: "deleteSharedPdf", + value: function deleteSharedPdf() { + var today, olderMills, files, i, mtime; + return _regenerator.default.async(function deleteSharedPdf$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + this.purgeLog("DELETE SHARED PDF"); + today = new Date().getTime(); + olderMills = 172800000; + _context9.prev = 3; + _context9.next = 6; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readDir(this.downloadedSharedPdf)); + + case 6: + files = _context9.sent; + i = 0; + + case 8: + if (!(i < files.length)) { + _context9.next = 17; + break; + } + + mtime = new Date(files[i].mtime).getTime(); + + if (!(today - mtime > olderMills)) { + _context9.next = 14; + break; + } + + this.purgeLog("delete " + files[i].path); + _context9.next = 14; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(files[i].path)); + + case 14: + i++; + _context9.next = 8; + break; + + case 17: + _context9.next = 22; + break; + + case 19: + _context9.prev = 19; + _context9.t0 = _context9["catch"](3); + this.purgeLog(_context9.t0.message); + + case 22: + case "end": + return _context9.stop(); + } + } + }, null, this, [[3, 19]], Promise); + } + }, { + key: "getToday", + value: function getToday() { + return _$$_REQUIRE(_dependencyMap[10]).DateUtils.getTodayString("YYYYMMDD"); + } + }, { + key: "getYesterday", + value: function getYesterday() { + return _$$_REQUIRE(_dependencyMap[10]).DateUtils.getYesterdayString("YYYYMMDD"); + } + }, { + key: "getAllIssues", + value: function getAllIssues() { + return _regenerator.default.async(function getAllIssues$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + return _context10.abrupt("return", _NewsmemoryDatabasesManager.default.getAllIssues()); + + case 1: + case "end": + return _context10.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "initIssuesStored", + value: function initIssuesStored(recentlyIssues, totalSlots) { + var _this = this; + + var allIssues, mainIssues, otherIssues, alreadyDownload, downloadingSlot; + return _regenerator.default.async(function initIssuesStored$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + _context11.prev = 0; + _context11.next = 3; + return _regenerator.default.awrap(this.getAllIssues()); + + case 3: + allIssues = _context11.sent; + mainIssues = allIssues.filter(function (issue) { + return recentlyIssues.includes(issue.getIssue()); + }); + otherIssues = allIssues.filter(function (issue) { + return !recentlyIssues.includes(issue.getIssue()); + }); + alreadyDownload = this.issueToDownload ? allIssues.findIndex(function (issue) { + return issue.getIssue() === _this.issueToDownload; + }) > -1 : true; + downloadingSlot = alreadyDownload ? 0 : 1; + this.purgeLog("leave slots " + totalSlots + " -> other issues: " + otherIssues.length + ", main issues: " + mainIssues.length + ", downloading: " + downloadingSlot); + this.purgeLog("ISSUES"); + mainIssues.forEach(function (issue) { + var fileName = issue.getFilename(); + + if (_this.issuesToLeave.length < totalSlots - downloadingSlot) { + _this.issuesToLeave.push(fileName); + + _this.purgeLog("main to leave -> " + fileName); + } else { + _this.newspapersToDelete.push(issue); + + _this.issuesToRemove.push(fileName); + + _this.purgeLog("main to remove -> " + fileName); + } + }); + otherIssues.sort(function (a, b) { + return b.getDownloadTime() - a.getDownloadTime(); + }); + otherIssues.forEach(function (issue) { + var fileName = issue.getFilename(); + + if (_this.issuesToLeave.length < totalSlots - downloadingSlot) { + _this.issuesToLeave.push(fileName); + + _this.purgeLog("to leave -> " + fileName); + } else { + _this.newspapersToDelete.push(issue); + + _this.issuesToRemove.push(fileName); + + _this.purgeLog("to remove -> " + fileName); + } + }); + _context11.next = 18; + break; + + case 15: + _context11.prev = 15; + _context11.t0 = _context11["catch"](0); + this.purgeLog(_context11.t0); + + case 18: + case "end": + return _context11.stop(); + } + } + }, null, this, [[0, 15]], Promise); + } + }, { + key: "initFolderToLeave", + value: function initFolderToLeave() { + return _regenerator.default.async(function initFolderToLeave$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + _context12.next = 2; + return _regenerator.default.awrap(this.initFolderListFromEditions(this.issuesToLeave)); + + case 2: + this.foldersToLeave = _context12.sent; + + case 3: + case "end": + return _context12.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "initFolderToRemove", + value: function initFolderToRemove() { + return _regenerator.default.async(function initFolderToRemove$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + _context13.next = 2; + return _regenerator.default.awrap(this.initFolderListFromEditions(this.issuesToRemove)); + + case 2: + this.foldersToRemove = _context13.sent; + + case 3: + case "end": + return _context13.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "initFolderListFromEditions", + value: function initFolderListFromEditions() { + var _this2 = this; + + var issuesDb, + folders, + _loop, + i, + _args15 = arguments; + + return _regenerator.default.async(function initFolderListFromEditions$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + issuesDb = _args15.length > 0 && _args15[0] !== undefined ? _args15[0] : []; + folders = []; + + _loop = function _callee(i) { + var issueDbPath, issueManager, pages; + return _regenerator.default.async(function _callee$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + issueDbPath = issuesDb[i]; + issueManager = new _NewsmemoryEditionsManager.default(); + issueManager.initDatabase(issueDbPath); + _context14.prev = 3; + _context14.next = 6; + return _regenerator.default.awrap(issueManager.getPages()); + + case 6: + pages = _context14.sent; + pages.forEach(function (page) { + folders.push(_$$_REQUIRE(_dependencyMap[10]).StringUtils.getParentPath(issueDbPath) + "/" + page.getFilename()); + }); + _context14.next = 13; + break; + + case 10: + _context14.prev = 10; + _context14.t0 = _context14["catch"](3); + + _this2.purgeLog(_context14.t0); + + case 13: + case "end": + return _context14.stop(); + } + } + }, null, null, [[3, 10]], Promise); + }; + + i = 0; + + case 4: + if (!(i < issuesDb.length)) { + _context15.next = 10; + break; + } + + _context15.next = 7; + return _regenerator.default.awrap(_loop(i)); + + case 7: + i++; + _context15.next = 4; + break; + + case 10: + return _context15.abrupt("return", folders); + + case 11: + case "end": + return _context15.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "cleanFolderToRemoveFromSharePage", + value: function cleanFolderToRemoveFromSharePage() { + var _this3 = this; + + this.purgeLog("REMOVED SHARED PAGES FROM TO BE REMOVED LIST"); + this.foldersToRemove = this.foldersToRemove.filter(function (folder) { + if (_this3.foldersToLeave.includes(folder)) { + _this3.purgeLog("shared pages -> " + folder); + + return false; + } + + return true; + }); + } + }, { + key: "getNIssuesToLeave", + value: function getNIssuesToLeave() { + return 2 + parseInt(global.getNewsmemoryConfig().limit, 10); + } + }, { + key: "fileNotExistsInList", + value: function fileNotExistsInList(path, list) { + var found = !list.length || list.findIndex(function (toLeave) { + try { + return _tecnaviaFileUtils.default.getCanonicalPath(toLeave).includes(path); + } catch (e) { + return true; + } + }) > -1; + return !found; + } + }, { + key: "checkZombie", + value: function checkZombie(basePath) { + var files, i, _files$i, path, name, isDirectory, database; + + return _regenerator.default.async(function checkZombie$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + this.purgeLog("CHECK ZOMBIE IN " + basePath); + _context16.next = 3; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.exists(basePath)); + + case 3: + if (!_context16.sent) { + _context16.next = 31; + break; + } + + _context16.next = 6; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readDir(basePath)); + + case 6: + files = _context16.sent; + i = 0; + + case 8: + if (!(i < files.length)) { + _context16.next = 31; + break; + } + + _files$i = files[i], path = _files$i.path, name = _files$i.name, isDirectory = _files$i.isDirectory; + + if (!isDirectory()) { + _context16.next = 22; + break; + } + + if (!(!this.issueToDownloadPath || !path.includes(this.issueToDownloadPath))) { + _context16.next = 20; + break; + } + + if (!this.fileNotExistsInList(path, this.foldersToLeave)) { + _context16.next = 18; + break; + } + + this.purgeLog("zombie -> " + path); + _context16.next = 16; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(path)); + + case 16: + _context16.next = 20; + break; + + case 18: + _context16.next = 20; + return _regenerator.default.awrap(this.checkZombie(path)); + + case 20: + _context16.next = 28; + break; + + case 22: + if (!name.endsWith(".db")) { + _context16.next = 28; + break; + } + + if (!this.fileNotExistsInList(path, this.issuesToLeave)) { + _context16.next = 28; + break; + } + + this.purgeLog("zombie -> " + path); + database = new _Database.default(path); + _context16.next = 28; + return _regenerator.default.awrap(database.delete()); + + case 28: + i++; + _context16.next = 8; + break; + + case 31: + case "end": + return _context16.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "purgeZombie", + value: function purgeZombie() { + return _regenerator.default.async(function purgeZombie$(_context17) { + while (1) { + switch (_context17.prev = _context17.next) { + case 0: + _context17.next = 2; + return _regenerator.default.awrap(this.initIssuesStored([this.getToday(), this.getYesterday()], this.nIssuesToLeave)); + + case 2: + _context17.next = 4; + return _regenerator.default.awrap(this.initFolderToLeave()); + + case 4: + _context17.next = 6; + return _regenerator.default.awrap(this.checkZombie(this.baseEditionPath)); + + case 6: + case "end": + return _context17.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getDeletedNewspapers", + value: function getDeletedNewspapers() { + return this.newspapersToDelete; + } + }, { + key: "purgeLog", + value: function purgeLog(message) {} + }]); + return PurgeTask; + }(); + + exports.default = PurgeTask; +},2316,[5,80,7,8,574,710,711,714,2307,638,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewspaperStatus = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _NewsmemoryHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var NewspaperStatus = function () { + function NewspaperStatus() { + (0, _classCallCheck2.default)(this, NewspaperStatus); + } + + (0, _createClass2.default)(NewspaperStatus, [{ + key: "init", + value: function init(pSetupConfig) { + var _this = this; + + var startupParams, + pSetup, + udb, + keys, + i, + key, + statusStartupParams, + lastEdition, + lastIssue, + lastPageNumber, + lastArticleId, + statupEditionDifferent, + startupIssueDifferent, + _args = arguments; + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + startupParams = _args.length > 1 && _args[1] !== undefined ? _args[1] : {}; + pSetup = pSetupConfig.pSetup, udb = pSetupConfig.udb; + this.pSetup = pSetup; + this.udb = udb; + this.lastTTSIndex = -1; + this.lastArticlePositionId = 0; + keys = Object.values(_NewsmemoryHelper.default.SP.paper); + i = 0; + + case 8: + if (!(i < keys.length)) { + _context.next = 16; + break; + } + + key = keys[i]; + _context.next = 12; + return _regenerator.default.awrap(this.getValue(key)); + + case 12: + this[key] = _context.sent; + + case 13: + i++; + _context.next = 8; + break; + + case 16: + statusStartupParams = _newsmemoryUtils.default.getStatusFromStartupParams(startupParams); + lastEdition = statusStartupParams.lastEdition, lastIssue = statusStartupParams.lastIssue, lastPageNumber = statusStartupParams.lastPageNumber, lastArticleId = statusStartupParams.lastArticleId; + statupEditionDifferent = lastEdition && lastEdition !== this.lastEdition; + startupIssueDifferent = lastIssue && lastIssue !== this.lastIssue; + + if (!(statupEditionDifferent || startupIssueDifferent)) { + _context.next = 25; + break; + } + + _context.next = 23; + return _regenerator.default.awrap(this.resetLastPageNumber()); + + case 23: + _context.next = 25; + return _regenerator.default.awrap(this.resetLastArticleId()); + + case 25: + if (!(lastPageNumber && !lastArticleId)) { + _context.next = 28; + break; + } + + _context.next = 28; + return _regenerator.default.awrap(this.resetLastArticleId()); + + case 28: + Object.keys(statusStartupParams).forEach(function (key) { + if (statusStartupParams[key]) { + _this.setValue(key, statusStartupParams[key]); + } + }); + return _context.abrupt("return", true); + + case 30: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getStorageKey", + value: function getStorageKey(key) { + var prefix = key === _NewsmemoryHelper.default.SP.paper.preferredEdition ? this.udb : this.pSetup; + return prefix + "_" + key; + } + }, { + key: "setValue", + value: function setValue(key, value) { + return _regenerator.default.async(function setValue$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this[key] = value; + return _context2.abrupt("return", _NewsmemoryHelper.default.setItem(this.getStorageKey(key), value)); + + case 2: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getValue", + value: function getValue(key) { + var value; + return _regenerator.default.async(function getValue$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + value = this[key]; + + if (!(value === null || value === undefined)) { + _context3.next = 5; + break; + } + + _context3.next = 4; + return _regenerator.default.awrap(_NewsmemoryHelper.default.getItem(this.getStorageKey(key))); + + case 4: + value = _context3.sent; + + case 5: + return _context3.abrupt("return", value); + + case 6: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "updateValue", + value: function updateValue(key, value) { + return _regenerator.default.async(function updateValue$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!value) { + _context4.next = 2; + break; + } + + return _context4.abrupt("return", this.setValue(key, value)); + + case 2: + return _context4.abrupt("return", this.removeValue(key)); + + case 3: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "removeValue", + value: function removeValue(key) { + return _regenerator.default.async(function removeValue$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + this[key] = undefined; + return _context5.abrupt("return", _NewsmemoryHelper.default.removeItem(this.getStorageKey(key))); + + case 2: + case "end": + return _context5.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "clear", + value: function clear() { + var keys, i, key; + return _regenerator.default.async(function clear$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + keys = Object.values(_NewsmemoryHelper.default.SP.paper); + i = 0; + + case 2: + if (!(i < keys.length)) { + _context6.next = 9; + break; + } + + key = keys[i]; + _context6.next = 6; + return _regenerator.default.awrap(this.removeValue(key)); + + case 6: + i++; + _context6.next = 2; + break; + + case 9: + case "end": + return _context6.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setLastIssue", + value: function setLastIssue(issue) { + return _regenerator.default.async(function setLastIssue$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", this.setValue(_NewsmemoryHelper.default.SP.paper.lastIssue, issue)); + + case 1: + case "end": + return _context7.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "resetLastIssue", + value: function resetLastIssue() { + return _regenerator.default.async(function resetLastIssue$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + return _context8.abrupt("return", this.removeValue(_NewsmemoryHelper.default.SP.paper.lastIssue)); + + case 1: + case "end": + return _context8.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setLastEdition", + value: function setLastEdition(edition) { + return _regenerator.default.async(function setLastEdition$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + return _context9.abrupt("return", this.setValue(_NewsmemoryHelper.default.SP.paper.lastEdition, edition)); + + case 1: + case "end": + return _context9.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "resetLastEdition", + value: function resetLastEdition() { + return _regenerator.default.async(function resetLastEdition$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + return _context10.abrupt("return", this.removeValue(_NewsmemoryHelper.default.SP.paper.lastEdition)); + + case 1: + case "end": + return _context10.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setLastPageNumber", + value: function setLastPageNumber(pageNumber) { + return _regenerator.default.async(function setLastPageNumber$(_context11) { + while (1) { + switch (_context11.prev = _context11.next) { + case 0: + return _context11.abrupt("return", this.setValue(_NewsmemoryHelper.default.SP.paper.lastPageNumber, pageNumber)); + + case 1: + case "end": + return _context11.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "resetLastPageNumber", + value: function resetLastPageNumber() { + return _regenerator.default.async(function resetLastPageNumber$(_context12) { + while (1) { + switch (_context12.prev = _context12.next) { + case 0: + return _context12.abrupt("return", this.removeValue(_NewsmemoryHelper.default.SP.paper.lastPageNumber)); + + case 1: + case "end": + return _context12.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setLastArticleId", + value: function setLastArticleId(articleId) { + return _regenerator.default.async(function setLastArticleId$(_context13) { + while (1) { + switch (_context13.prev = _context13.next) { + case 0: + return _context13.abrupt("return", this.setValue(_NewsmemoryHelper.default.SP.paper.lastArticleId, "" + articleId)); + + case 1: + case "end": + return _context13.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "resetLastArticleId", + value: function resetLastArticleId() { + return _regenerator.default.async(function resetLastArticleId$(_context14) { + while (1) { + switch (_context14.prev = _context14.next) { + case 0: + return _context14.abrupt("return", this.removeValue(_NewsmemoryHelper.default.SP.paper.lastArticleId)); + + case 1: + case "end": + return _context14.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "reset", + value: function reset() { + return _regenerator.default.async(function reset$(_context15) { + while (1) { + switch (_context15.prev = _context15.next) { + case 0: + _context15.next = 2; + return _regenerator.default.awrap(this.resetLastIssue()); + + case 2: + _context15.next = 4; + return _regenerator.default.awrap(this.resetLastEdition()); + + case 4: + _context15.next = 6; + return _regenerator.default.awrap(this.resetLastPageNumber()); + + case 6: + _context15.next = 8; + return _regenerator.default.awrap(this.resetLastArticleId()); + + case 8: + case "end": + return _context15.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setLastMostRecentIssueOnServer", + value: function setLastMostRecentIssueOnServer(issue) { + return _regenerator.default.async(function setLastMostRecentIssueOnServer$(_context16) { + while (1) { + switch (_context16.prev = _context16.next) { + case 0: + return _context16.abrupt("return", this.setValue(_NewsmemoryHelper.default.SP.paper.lastMostRecentIssueOnServer, issue)); + + case 1: + case "end": + return _context16.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "setLastTTSIndex", + value: function setLastTTSIndex(index) { + this.lastTTSIndex = index; + } + }, { + key: "getLastTTSIndex", + value: function getLastTTSIndex() { + return this.lastTTSIndex; + } + }, { + key: "resetLastTTSIndex", + value: function resetLastTTSIndex() { + this.lastTTSIndex = -1; + } + }, { + key: "setLastArticlePositionId", + value: function setLastArticlePositionId(positionId) { + this.lastArticlePositionId = positionId; + } + }, { + key: "getLastArticlePositionId", + value: function getLastArticlePositionId() { + return this.lastArticlePositionId; + } + }, { + key: "resetLastArticlePositionId", + value: function resetLastArticlePositionId() { + this.lastArticlePositionId = 0; + } + }]); + return NewspaperStatus; + }(); + + exports.NewspaperStatus = NewspaperStatus; +},2317,[5,80,7,8,1860,603]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _NewspaperManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _LoginManager = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _optionspageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _PurgeManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NewsmemoryManager = function () { + function NewsmemoryManager(navigation) { + (0, _classCallCheck2.default)(this, NewsmemoryManager); + this.navigation = navigation; + } + + (0, _createClass2.default)(NewsmemoryManager, [{ + key: "init", + value: function init(pSetupConfig) { + return _regenerator.default.async(function init$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(this.destroy()); + + case 2: + this.currentNewspaperManager = new _NewspaperManager.default(pSetupConfig); + _context.next = 5; + return _regenerator.default.awrap(this.currentNewspaperManager.init(pSetupConfig)); + + case 5: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "load", + value: function load() { + var status, lastIssue, lastEdition, _status, isForcedIssue, _NewsmemoryUtils$getS, code, message, pSetupConfig, protectSite, onLoginErrorGoTo, issues, latestIssue, _global$getNewsmemory, accessibilityModeEnabled, lastOperationTimestamp, _global$getActivePSet, timeLimitCheckEdition, lastPSetup, mostRecentIssueOnServer, mostRecentEditionOnServer, optionspageConfig; + + return _regenerator.default.async(function load$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (this.currentNewspaperManager) { + status = this.currentNewspaperManager.status; + _status = status; + lastIssue = _status.lastIssue; + lastEdition = _status.lastEdition; + } + + isForcedIssue = global.isIssueInNewsmemoryStartupParams(); + + if (isForcedIssue) { + _NewsmemoryUtils$getS = _newsmemoryUtils.default.getStatusFromStartupParams(global.getNewsmemoryStartupParams()); + lastEdition = _NewsmemoryUtils$getS.lastEdition; + } + + _context2.prev = 3; + _context2.next = 6; + return _regenerator.default.awrap(_LoginManager.default.recheckLogin()); + + case 6: + global.resetNewsmemoryStartupParams(); + _context2.next = 36; + break; + + case 9: + _context2.prev = 9; + _context2.t0 = _context2["catch"](3); + global.resetNewsmemoryStartupParams(); + + if (!(_context2.t0 instanceof _LoginManager.LoginError)) { + _context2.next = 36; + break; + } + + code = _context2.t0.code, message = _context2.t0.message; + + if (!(code === _LoginManager.PROT_ERROR.NOT_LOGGEDIN && !lastIssue)) { + _context2.next = 36; + break; + } + + pSetupConfig = global.getActivePSetup(); + protectSite = pSetupConfig.protectSite; + onLoginErrorGoTo = pSetupConfig.onLoginErrorGoTo; + + if (_$$_REQUIRE(_dependencyMap[15]).PlatformUtils.isSystemAccessibilityEnabled()) { + onLoginErrorGoTo = _optionspageUtils.tabs.account; + } + + if (_$$_REQUIRE(_dependencyMap[15]).NetworkUtils.isOnline()) { + _context2.next = 33; + break; + } + + _context2.next = 22; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.getAllIssues()); + + case 22: + issues = _context2.sent; + + if (!(issues && issues.length > 0)) { + _context2.next = 29; + break; + } + + latestIssue = issues[0]; + lastIssue = latestIssue.getIssue(); + lastEdition = latestIssue.getEdition(); + _context2.next = 31; + break; + + case 29: + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: onLoginErrorGoTo, + getParams: { + edition: lastEdition + } + }); + + return _context2.abrupt("return"); + + case 31: + _context2.next = 36; + break; + + case 33: + if (!(protectSite > 0)) { + _context2.next = 36; + break; + } + + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: onLoginErrorGoTo, + getParams: { + edition: lastEdition + } + }); + + return _context2.abrupt("return"); + + case 36: + _global$getNewsmemory = global.getNewsmemoryConfig(), accessibilityModeEnabled = _global$getNewsmemory.accessibilityModeEnabled, lastOperationTimestamp = _global$getNewsmemory.lastOperationTimestamp; + + if (accessibilityModeEnabled) { + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.accessibility, + hidden: true + }); + } else { + _global$getActivePSet = global.getActivePSetup(), timeLimitCheckEdition = _global$getActivePSet.timeLimitCheckEdition, lastPSetup = _global$getActivePSet.lastPSetup, mostRecentIssueOnServer = _global$getActivePSet.lastIssue, mostRecentEditionOnServer = _global$getActivePSet.lastEdition, optionspageConfig = _global$getActivePSet.optionspageConfig; + + if (status) { + status.setLastMostRecentIssueOnServer(mostRecentIssueOnServer); + } + + if (_$$_REQUIRE(_dependencyMap[15]).NetworkUtils.isOnline() && (!lastOperationTimestamp || Math.abs(new Date().getTime() - lastOperationTimestamp) > timeLimitCheckEdition)) { + if (isForcedIssue) { + this.downloadPublication(lastIssue, lastEdition); + } else { + if (optionspageConfig.alwaysOpenAtStartup()) { + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home, + getParams: { + pSetup: lastPSetup, + edition: mostRecentEditionOnServer || lastEdition + } + }); + } else if (lastIssue && lastIssue === mostRecentIssueOnServer) { + this.downloadPublication(lastIssue, lastEdition); + } else { + this.downloadPublication(mostRecentIssueOnServer, mostRecentEditionOnServer); + } + } + } else { + this.downloadPublication(lastIssue, lastEdition); + } + } + + case 38: + case "end": + return _context2.stop(); + } + } + }, null, this, [[3, 9]], Promise); + } + }, { + key: "restart", + value: function restart() { + var _ref, + _ref$forceMessage, + forceMessage, + _ref$isOptionspageOpe, + isOptionspageOpen, + now, + _global$getNewsmemory2, + lastOperationTimestamp, + _global$getActivePSet2, + timeLimitCheckEdition, + lastPSetup, + mostRecentIssueOnServer, + mostRecentEditionOnServer, + optionspageConfig, + enableSessionCollection, + status, + lastIssue, + lastEdition, + lastMostRecentIssueOnServer, + newIssueAvailable, + lastIssueLoadedIsAlsoTheLatestAvailable, + reloadOptionspage, + _args3 = arguments; + + return _regenerator.default.async(function restart$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _ref = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {}, _ref$forceMessage = _ref.forceMessage, forceMessage = _ref$forceMessage === undefined ? false : _ref$forceMessage, _ref$isOptionspageOpe = _ref.isOptionspageOpen, isOptionspageOpen = _ref$isOptionspageOpe === undefined ? false : _ref$isOptionspageOpe; + now = new Date().getTime(); + _global$getNewsmemory2 = global.getNewsmemoryConfig(), lastOperationTimestamp = _global$getNewsmemory2.lastOperationTimestamp; + _global$getActivePSet2 = global.getActivePSetup(), timeLimitCheckEdition = _global$getActivePSet2.timeLimitCheckEdition, lastPSetup = _global$getActivePSet2.lastPSetup, mostRecentIssueOnServer = _global$getActivePSet2.lastIssue, mostRecentEditionOnServer = _global$getActivePSet2.lastEdition, optionspageConfig = _global$getActivePSet2.optionspageConfig, enableSessionCollection = _global$getActivePSet2.enableSessionCollection; + _context3.prev = 4; + _context3.next = 7; + return _regenerator.default.awrap(_LoginManager.default.recheckLogin()); + + case 7: + _context3.next = 11; + break; + + case 9: + _context3.prev = 9; + _context3.t0 = _context3["catch"](4); + + case 11: + if (!(this.currentNewspaperManager === undefined)) { + _context3.next = 13; + break; + } + + return _context3.abrupt("return"); + + case 13: + status = this.currentNewspaperManager.status; + lastIssue = status.lastIssue, lastEdition = status.lastEdition, lastMostRecentIssueOnServer = status.lastMostRecentIssueOnServer; + status.setLastMostRecentIssueOnServer(mostRecentIssueOnServer); + newIssueAvailable = lastMostRecentIssueOnServer !== null && parseInt(lastMostRecentIssueOnServer, 10) < parseInt(mostRecentIssueOnServer, 10); + lastIssueLoadedIsAlsoTheLatestAvailable = lastIssue === lastMostRecentIssueOnServer; + + reloadOptionspage = function reloadOptionspage() { + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home, + getParams: { + pSetup: lastPSetup, + issue: mostRecentIssueOnServer || lastIssue, + edition: mostRecentEditionOnServer || lastEdition + } + }); + }; + + if (!forceMessage && lastOperationTimestamp && Math.abs(now - lastOperationTimestamp) > timeLimitCheckEdition) { + if (enableSessionCollection) { + _$$_REQUIRE(_dependencyMap[17]).NewspaperSessionManager.flushActiveSession(); + } + + if (newIssueAvailable) { + if (lastIssueLoadedIsAlsoTheLatestAvailable) { + if (optionspageConfig.alwaysOpenAtStartup() || isOptionspageOpen) { + reloadOptionspage(); + } else { + this.downloadLatestPublication(); + } + } else if (lastIssue) { + if (isOptionspageOpen) { + reloadOptionspage(); + } + + if (lastIssue === mostRecentIssueOnServer) { + this.reloadLastPublication(); + } else if (!isOptionspageOpen) { + this.showDialog(false); + } + } + } else if (!lastMostRecentIssueOnServer || lastIssueLoadedIsAlsoTheLatestAvailable) { + this.reloadLastPublication(); + } else if (lastIssue) { + if (lastIssue === mostRecentIssueOnServer) { + this.reloadLastPublication(); + } else if (!isOptionspageOpen) { + this.showDialog(false); + } + } + } else if (lastIssue) { + if (newIssueAvailable && !isOptionspageOpen) { + this.showDialog(true); + } else { + this.reloadLastPublication(); + } + } + + case 20: + case "end": + return _context3.stop(); + } + } + }, null, this, [[4, 9]], Promise); + } + }, { + key: "downloadLatestPublication", + value: function downloadLatestPublication() { + var status; + return _regenerator.default.async(function downloadLatestPublication$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!this.currentNewspaperManager) { + _context4.next = 5; + break; + } + + status = this.currentNewspaperManager.status; + + if (!status) { + _context4.next = 5; + break; + } + + _context4.next = 5; + return _regenerator.default.awrap(status.reset()); + + case 5: + _context4.next = 7; + return _regenerator.default.awrap(this.downloadPublication()); + + case 7: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "downloadPublication", + value: function downloadPublication(issue, edition) { + var _this = this; + + var onCancel, onRetry, onReset, result, _global$getActivePSet3, pSetup, newsmemoryConfig, favEdiPSetup, _await$global$loadPSe, favEdiPSetupConfig, purgeTask, newspapersDeleted, _await$this$currentNe, success, downloadedDB, NO_GRANTS_ALLOWED_IP, NO_ZIP, code, params, getParams, pSetupChange, _global$getActivePSet4, _pSetup, pSetupToUse, _await$global$loadPSe2, pSetupToUseConfig, _global$getActivePSet5, showNativeOptionsPage, showNativeOptionsPageFallbackUrl; + + return _regenerator.default.async(function downloadPublication$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + onCancel = function onCancel() { + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home, + getParams: { + edition: edition + } + }); + }; + + onRetry = function onRetry() { + _this.downloadPublication(issue, edition); + }; + + onReset = function _callee() { + return _regenerator.default.async(function _callee$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _context5.next = 2; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[18]).deleteData)()); + + case 2: + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue, + edition: edition + }); + + case 3: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + }; + + _context6.prev = 3; + result = { + issue: issue, + edition: edition + }; + + if (issue) { + _context6.next = 29; + break; + } + + if (edition) { + _context6.next = 24; + break; + } + + _global$getActivePSet3 = global.getActivePSetup(), pSetup = _global$getActivePSet3.pSetup; + newsmemoryConfig = global.getNewsmemoryConfig(); + _context6.next = 11; + return _regenerator.default.awrap(newsmemoryConfig.getFavEdiPSetup()); + + case 11: + favEdiPSetup = _context6.sent; + + if (!(favEdiPSetup && favEdiPSetup !== pSetup)) { + _context6.next = 24; + break; + } + + _context6.next = 15; + return _regenerator.default.awrap(global.loadPSetup(favEdiPSetup)); + + case 15: + _await$global$loadPSe = _context6.sent; + favEdiPSetupConfig = _await$global$loadPSe.config; + + if (!favEdiPSetupConfig) { + _context6.next = 23; + break; + } + + _context6.next = 20; + return _regenerator.default.awrap(this.init(favEdiPSetupConfig)); + + case 20: + Analytics.updateAnalyticsClientList(); + _context6.next = 24; + break; + + case 23: + throw new Error("Unable to load the new pSetup " + favEdiPSetup); + + case 24: + _context6.next = 26; + return _regenerator.default.awrap(this.getFirstIssueAndMainEdition(edition)); + + case 26: + result = _context6.sent; + _context6.next = 33; + break; + + case 29: + if (edition) { + _context6.next = 33; + break; + } + + _context6.next = 32; + return _regenerator.default.awrap(this.getEdition(issue)); + + case 32: + result = _context6.sent; + + case 33: + _context6.prev = 33; + purgeTask = new _PurgeManager.default(result.issue); + _context6.next = 37; + return _regenerator.default.awrap(purgeTask.purge()); + + case 37: + newspapersDeleted = purgeTask.getDeletedNewspapers(); + newspapersDeleted.forEach(function (newspaper) { + return _this.currentNewspaperManager.removeNewspaper(newspaper); + }); + _context6.next = 43; + break; + + case 41: + _context6.prev = 41; + _context6.t0 = _context6["catch"](33); + + case 43: + _context6.prev = 43; + _context6.next = 46; + return _regenerator.default.awrap(this.currentNewspaperManager.downloadNewspaper(result.issue, result.edition)); + + case 46: + _await$this$currentNe = _context6.sent; + success = _await$this$currentNe.success; + downloadedDB = _await$this$currentNe.downloadedDB; + + if (success) { + this.currentNewspaperManager.loadPages(downloadedDB); + } else { + _newsmemoryUtils.default.showDownloadDBErrorDialog(issue, edition, onRetry, onCancel, onReset); + } + + _context6.next = 81; + break; + + case 52: + _context6.prev = 52; + _context6.t1 = _context6["catch"](43); + + if (!(_context6.t1 instanceof _$$_REQUIRE(_dependencyMap[19]).DownloadError)) { + _context6.next = 80; + break; + } + + NO_GRANTS_ALLOWED_IP = _$$_REQUIRE(_dependencyMap[19]).DOWNLOAD_ERROR_CODES.NO_GRANTS_ALLOWED_IP, NO_ZIP = _$$_REQUIRE(_dependencyMap[19]).DOWNLOAD_ERROR_CODES.NO_ZIP; + code = _context6.t1.code, params = _context6.t1.params; + + if (!(code === NO_GRANTS_ALLOWED_IP)) { + _context6.next = 60; + break; + } + + onRetry(); + return _context6.abrupt("return"); + + case 60: + if (!(code === NO_ZIP)) { + _context6.next = 78; + break; + } + + getParams = _optionspageUtils.default.getOptionspageGetParams(params); + pSetupChange = getParams.pSetupChange; + + if (!pSetupChange) { + _context6.next = 77; + break; + } + + _global$getActivePSet4 = global.getActivePSetup(), _pSetup = _global$getActivePSet4.pSetup; + pSetupToUse = pSetupChange.pSetup; + + if (!(pSetupToUse && pSetupToUse !== _pSetup)) { + _context6.next = 77; + break; + } + + _context6.next = 69; + return _regenerator.default.awrap(global.loadPSetup(pSetupToUse)); + + case 69: + _await$global$loadPSe2 = _context6.sent; + pSetupToUseConfig = _await$global$loadPSe2.config; + + if (!pSetupToUseConfig) { + _context6.next = 77; + break; + } + + _context6.next = 74; + return _regenerator.default.awrap(this.init(pSetupToUseConfig)); + + case 74: + Analytics.updateAnalyticsClientList(); + onRetry(); + return _context6.abrupt("return"); + + case 77: + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home, + getParams: getParams + }); + + case 78: + _context6.next = 81; + break; + + case 80: + _newsmemoryUtils.default.showDownloadDBErrorDialog(issue, edition, onRetry, onCancel, onReset); + + case 81: + _context6.next = 87; + break; + + case 83: + _context6.prev = 83; + _context6.t2 = _context6["catch"](3); + _global$getActivePSet5 = global.getActivePSetup(), showNativeOptionsPage = _global$getActivePSet5.showNativeOptionsPage, showNativeOptionsPageFallbackUrl = _global$getActivePSet5.showNativeOptionsPageFallbackUrl; + + if (_$$_REQUIRE(_dependencyMap[15]).NetworkUtils.isOnline() || showNativeOptionsPage && !showNativeOptionsPageFallbackUrl) { + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _optionspageUtils.tabs.home + }); + } else { + _$$_REQUIRE(_dependencyMap[16]).EventRegister.emit(_events.default.NEWSMEMORY_OPEN_OFFLINE_EDITION_MENU); + } + + case 87: + case "end": + return _context6.stop(); + } + } + }, null, this, [[3, 83], [33, 41], [43, 52]], Promise); + } + }, { + key: "reloadLastPublication", + value: function reloadLastPublication() { + var lastIssue; + var lastEdition; + + if (this.currentNewspaperManager) { + var status = this.currentNewspaperManager.status; + lastIssue = status.lastIssue; + lastEdition = status.lastEdition; + } + + this.downloadPublication(lastIssue, lastEdition); + } + }, { + key: "showDialog", + value: function showDialog(newIssueAvailable) { + var _this2 = this; + + var _global$getActivePSet6 = global.getActivePSetup(), + mostRecentIssueOnServer = _global$getActivePSet6.lastIssue, + mostRecentEditionOnServer = _global$getActivePSet6.lastEdition, + latestEditionAvailableMessageFormat = _global$getActivePSet6.latestEditionAvailableMessageFormat, + dateFormat = _global$getActivePSet6.dateFormat, + language = _global$getActivePSet6.language; + + var buttons = []; + buttons.push({ + text: global.strings("btn_cancel"), + onPress: function onPress() { + _this2.reloadLastPublication(); + }, + style: "cancel" + }, { + text: global.strings("btn_ok"), + onPress: function onPress() { + if (_this2.navigation) { + _this2.navigation.popToTop(); + } + + _this2.downloadPublication(mostRecentIssueOnServer, mostRecentEditionOnServer); + } + }); + var status = this.currentNewspaperManager.status; + var lastIssue = status.lastIssue, + lastEdition = status.lastEdition; + var title = ""; + var titleKey = "msg_new_issue_available_title"; + var messageKey = newIssueAvailable ? "msg_new_issue_available" : "msg_not_on_latest_issue"; + var message = global.strings(messageKey); + + if (latestEditionAvailableMessageFormat !== _$$_REQUIRE(_dependencyMap[20]).LATEST_AVAILABLE_EDITION_FORMAT.PLAIN_MESSAGE) { + if (latestEditionAvailableMessageFormat === _$$_REQUIRE(_dependencyMap[20]).LATEST_AVAILABLE_EDITION_FORMAT.ONLY_EDITION) { + title = global.strings("msg_new_issue_available_title_edition", { + edition: _newsmemoryUtils.default.getFullEditionNameWithArticle(lastEdition, false) + }); + message = global.strings(messageKey + "_edition", { + edition: _newsmemoryUtils.default.getFullEditionNameWithArticle(mostRecentEditionOnServer, true) + }); + } else if (latestEditionAvailableMessageFormat === _$$_REQUIRE(_dependencyMap[20]).LATEST_AVAILABLE_EDITION_FORMAT.ISSUE_AND_EDITION) { + title = global.strings("msg_new_issue_available_title_edition_date", { + date: _$$_REQUIRE(_dependencyMap[15]).DateUtils.getDayAndMonthStringByLanguage(lastIssue, dateFormat, language), + edition: _newsmemoryUtils.default.getFullEditionNameWithArticle(lastEdition, true) + }); + message = global.strings(lastEdition === mostRecentEditionOnServer ? messageKey + "_date" : messageKey + "_edition_date", { + date: _$$_REQUIRE(_dependencyMap[15]).DateUtils.getDayAndMonthStringByLanguage(mostRecentIssueOnServer, dateFormat, language), + edition: _newsmemoryUtils.default.getFullEditionNameWithArticle(mostRecentEditionOnServer, true) + }); + } + } + + _reactNative.Alert.alert(title, message, buttons, { + cancelable: true + }); + } + }, { + key: "getFirstIssueAndMainEdition", + value: function getFirstIssueAndMainEdition(edition) { + var issue, firstIssue, mainEdition, pSetupToUse, _global$getActivePSet7, pSetup, _await$global$loadPSe3, pSetupToUseConfig; + + return _regenerator.default.async(function getFirstIssueAndMainEdition$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + if (!this.currentNewspaperManager) { + _context7.next = 27; + break; + } + + _context7.next = 3; + return _regenerator.default.awrap(this.currentNewspaperManager.getLatestIssue(edition)); + + case 3: + issue = _context7.sent; + + if (!issue) { + _context7.next = 24; + break; + } + + firstIssue = issue.issue, mainEdition = issue.mainEdition, pSetupToUse = issue.pSetup; + + if (!firstIssue) { + _context7.next = 21; + break; + } + + _global$getActivePSet7 = global.getActivePSetup(), pSetup = _global$getActivePSet7.pSetup; + + if (!(pSetupToUse && pSetupToUse !== pSetup)) { + _context7.next = 20; + break; + } + + _context7.next = 11; + return _regenerator.default.awrap(global.loadPSetup(pSetupToUse)); + + case 11: + _await$global$loadPSe3 = _context7.sent; + pSetupToUseConfig = _await$global$loadPSe3.config; + + if (!pSetupToUseConfig) { + _context7.next = 19; + break; + } + + _context7.next = 16; + return _regenerator.default.awrap(this.init(pSetupToUseConfig)); + + case 16: + Analytics.updateAnalyticsClientList(); + _context7.next = 20; + break; + + case 19: + throw new Error("Unable to load the new pSetup " + pSetupToUse); + + case 20: + return _context7.abrupt("return", { + issue: firstIssue, + edition: mainEdition + }); + + case 21: + throw new Error("getIssue did not return a valid issue " + JSON.stringify(issue)); + + case 24: + throw new Error("getIssue did not return any issue"); + + case 25: + _context7.next = 28; + break; + + case 27: + throw new Error("currentNewspaperManager is undefined"); + + case 28: + case "end": + return _context7.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getEdition", + value: function getEdition(issue) { + var editions, _global$getNewsmemory3, prefEdi, editionToUse; + + return _regenerator.default.async(function getEdition$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + if (!this.currentNewspaperManager) { + _context8.next = 12; + break; + } + + _context8.next = 3; + return _regenerator.default.awrap(this.currentNewspaperManager.getEditions(issue)); + + case 3: + editions = _context8.sent; + + if (!(editions.length > 0)) { + _context8.next = 9; + break; + } + + _global$getNewsmemory3 = global.getNewsmemoryConfig(), prefEdi = _global$getNewsmemory3.prefEdi; + editionToUse = editions[0]; + + if (editions.includes(prefEdi)) { + editionToUse = prefEdi; + } + + return _context8.abrupt("return", { + issue: issue, + edition: editionToUse + }); + + case 9: + throw new Error("getEditions did not return any edition"); + + case 12: + throw new Error("currentNewspaperManager is undefined"); + + case 13: + case "end": + return _context8.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "deleteCurrentEditionDatabase", + value: function deleteCurrentEditionDatabase() { + return _regenerator.default.async(function deleteCurrentEditionDatabase$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + if (!this.currentNewspaperManager) { + _context9.next = 2; + break; + } + + return _context9.abrupt("return", this.currentNewspaperManager.deleteCurrentEditionDatabase()); + + case 2: + return _context9.abrupt("return", false); + + case 3: + case "end": + return _context9.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "destroy", + value: function destroy() { + return _regenerator.default.async(function destroy$(_context10) { + while (1) { + switch (_context10.prev = _context10.next) { + case 0: + if (!this.currentNewspaperManager) { + _context10.next = 4; + break; + } + + _context10.next = 3; + return _regenerator.default.awrap(this.currentNewspaperManager.destroy()); + + case 3: + this.currentNewspaperManager = undefined; + + case 4: + case "end": + return _context10.stop(); + } + } + }, null, this, null, Promise); + } + }]); + return NewsmemoryManager; + }(); + + var _default = NewsmemoryManager; + exports.default = _default; +},2318,[5,80,7,8,28,2306,2057,460,730,2316,710,714,1871,603,1859,462,572,1955,2254,586,717]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + progressParent: { + flex: 1, + position: "relative", + flexDirection: "column", + justifyContent: "center" + }, + progress: { + flex: 0 + }, + progressText: { + flex: 0, + margin: 10 + }, + parent: { + flex: 1 + } + }); + + exports.default = _default; +},2319,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _reactNativeWebview = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NewspaperManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _closeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SpecialSection = function (_PureComponent) { + (0, _inherits2.default)(SpecialSection, _PureComponent); + + var _super = _createSuper(SpecialSection); + + function SpecialSection(props) { + var _this; + + (0, _classCallCheck2.default)(this, SpecialSection); + _this = _super.call(this, props); + _this.state = { + visible: props.visible + }; + _this.isModal = !props.visible; + _this.onOpen = _this._onOpen.bind((0, _assertThisInitialized2.default)(_this)); + _this.onClose = _this._onClose.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLocal = _this._onLocal.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRef = _this._onRef.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SpecialSection, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (this.isModal) { + this.onOpenId = _$$_REQUIRE(_dependencyMap[17]).EventRegister.on(_events.default.NEWSMEMORY_OPEN_SPECIAL_SECTION, this.onOpen); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[17]).EventRegister.rm(this.onOpenId); + } + }, { + key: "_onOpen", + value: function _onOpen() { + var onOpen = this.props.onOpen; + this.setState({ + visible: true + }, onOpen); + } + }, { + key: "_onClose", + value: function _onClose() { + var onClose = this.props.onClose; + this.setState({ + visible: false + }, onClose); + } + }, { + key: "_onLocal", + value: function _onLocal(_ref) { + var domain, getParams, newsmemoryConfig, key, value, callback; + return _regenerator.default.async(function _onLocal$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + domain = _ref.domain, getParams = _ref.getParams; + newsmemoryConfig = global.getNewsmemoryConfig(); + _context.t0 = domain; + _context.next = _context.t0 === _$$_REQUIRE(_dependencyMap[18]).locals.SET_KEY ? 5 : _context.t0 === _$$_REQUIRE(_dependencyMap[18]).locals.INITPAGE_SET_NEWSPAPER_AND_READ ? 9 : 12; + break; + + case 5: + key = getParams.key, value = getParams.value, callback = getParams.callback; + newsmemoryConfig.setValue(key, value); + + if (callback && this.webViewRef) { + this.webViewRef.injectJavaScript(callback + "(); "); + } + + return _context.abrupt("break", 12); + + case 9: + if (this.isModal) { + this.onClose(); + } + + _$$_REQUIRE(_dependencyMap[17]).EventRegister.emit(_events.default.NEWSMEMORY_ON_LOAD_SPECIAL, getParams); + + return _context.abrupt("break", 12); + + case 12: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onRef", + value: function _onRef(ref) { + this.webViewRef = ref; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + showSections = _this$props.showSections, + newspaperManager = _this$props.newspaperManager; + + if (!_$$_REQUIRE(_dependencyMap[19]).NetworkUtils.isOnline() || !newspaperManager) { + return null; + } + + var visible = this.state.visible; + var injectedJavaScript; + + var activeTheme = _$$_REQUIRE(_dependencyMap[20]).Css.getThemeInUse(); + + if (activeTheme) { + injectedJavaScript = "document.body.setAttribute('class', '" + activeTheme + "');"; + } + + var url = newspaperManager.getSpecialSectionPage(showSections); + var webViewProps = { + source: { + uri: url + }, + onLocal: this.onLocal, + startInLoadingState: _$$_REQUIRE(_dependencyMap[21]).BaseWebView.LoadingStatePosition.center, + innerRef: this.onRef, + injectedJavaScript: injectedJavaScript + }; + + if (this.isModal) { + if (!visible) { + return null; + } + + var style; + + var _global$getActivePSet = global.getActivePSetup(), + optionspageConfig = _global$getActivePSet.optionspageConfig; + + if (optionspageConfig.isModal()) { + style = [_$$_REQUIRE(_dependencyMap[22]).styles.modal, _$$_REQUIRE(_dependencyMap[22]).styles.main, optionspageConfig.getCoordinates()]; + } else { + style = [_$$_REQUIRE(_dependencyMap[22]).styles.fullscreen, _$$_REQUIRE(_dependencyMap[22]).styles.main]; + } + + var optionspage = _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).Css, { + classes: ["optionspage", "optionspage-specialsections"] + }, _react.default.createElement(_reactNative.View, { + style: style + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).BaseWebView, webViewProps), _react.default.createElement(_closeComponent.default, { + parentStyle: _$$_REQUIRE(_dependencyMap[22]).styles.closeIcon, + cssProps: { + classes: ["newsmemory-icon", "newsmemory-close-icon", "optionspage-icon", "optionspage-close-icon", "optionspage-specialsections-close-icon"] + }, + onPress: this.onClose + }))); + + return optionspageConfig.isModal() ? _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[22]).styles.background] + }, optionspage) : optionspage; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).AutoHeightWebView, (0, _extends2.default)({}, webViewProps, { + defaultHeight: 50 + })); + } + }]); + return SpecialSection; + }(_react.PureComponent); + + exports.default = SpecialSection; + SpecialSection.propTypes = { + newspaperManager: _propTypes.default.instanceOf(_NewspaperManager.default), + showSections: _propTypes.default.bool, + visible: _propTypes.default.bool, + onOpen: _propTypes.default.func, + onClose: _propTypes.default.func + }; + SpecialSection.defaultProps = { + showSections: true, + visible: false, + onOpen: function onOpen() {}, + onClose: function onClose() {} + }; +},2320,[5,80,6,7,8,15,12,14,16,17,28,1226,201,2306,460,1859,2298,572,730,462,699,1894,2301,1901]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NoticeFullscreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _NoticeInterstitial = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _NoticePrestitial = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NoticeAdOverPage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _OptionalPackages$get = _optionalPackageUtils.default.getPrebid(), + PrebidInterstitial = _OptionalPackages$get.PrebidInterstitial; + + var _OptionalPackages$get2 = _optionalPackageUtils.default.getAdMob(), + InterstitialAd = _OptionalPackages$get2.InterstitialAd, + AdEventType = _OptionalPackages$get2.AdEventType, + TestIds = _OptionalPackages$get2.TestIds; + + var _OptionalPackages$get3 = _optionalPackageUtils.default.getDFP(), + Interstitial = _OptionalPackages$get3.Interstitial; + + var InterstitialsHelper = function () { + function InterstitialsHelper() { + (0, _classCallCheck2.default)(this, InterstitialsHelper); + } + + (0, _createClass2.default)(InterstitialsHelper, null, [{ + key: "resetTimer", + value: function resetTimer(timer) { + clearTimeout(timer); + } + }, { + key: "getPrestitial", + value: function getPrestitial() { + var timerCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + var notice = global.getAdsConfig().getPrestitial(); + + if (notice) { + InterstitialsHelper.getComponentFromModel(notice, timerCallback); + } + } + }, { + key: "getInterstitial", + value: function getInterstitial() { + var timerCallback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + var notice = global.getAdsConfig().getInterstitial(); + + if (notice) { + InterstitialsHelper.getComponentFromModel(notice, timerCallback); + } + } + }, { + key: "getAdOverPage", + value: function getAdOverPage(page, onOpen, onClose, innerRef) { + var notice, delay; + return _regenerator.default.async(function getAdOverPage$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!page) { + _context2.next = 10; + break; + } + + notice = global.getAdsConfig().getAdOverPage({ + page: page.getShownPage() + }); + _context2.prev = 2; + + if (!notice) { + _context2.next = 6; + break; + } + + delay = notice.getTimeToShowFirst() || 0; + return _context2.abrupt("return", new Promise(function (resolve) { + setTimeout(function _callee() { + var view; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + view = _$$_REQUIRE(_dependencyMap[11]).InterstitialContainer.get(notice, onOpen, onClose, innerRef); + notice.setCoolDown(Date.now()); + resolve(view); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }, delay); + })); + + case 6: + _context2.next = 10; + break; + + case 8: + _context2.prev = 8; + _context2.t0 = _context2["catch"](2); + + case 10: + return _context2.abrupt("return", Promise.resolve(null)); + + case 11: + case "end": + return _context2.stop(); + } + } + }, null, null, [[2, 8]], Promise); + } + }, { + key: "getInterstitialEpaper", + value: function getInterstitialEpaper(pages) { + var prevPages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var isLastPage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (pages) { + var notice = global.getAdsConfig().getInterstitialEpaper({ + pages: pages, + prevPages: prevPages, + isLastPage: isLastPage + }); + + if (notice) { + return InterstitialsHelper.getComponentFromModel(notice); + } + } + + return undefined; + } + }, { + key: "getComponentFromModel", + value: function getComponentFromModel(notice) { + var timerCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (notice.isWeb()) { + InterstitialsHelper.showWebComponentFromModel(notice, timerCallback); + } else { + InterstitialsHelper.showNativeComponentFromModel(notice, timerCallback); + } + } + }, { + key: "showWebComponentFromModel", + value: function showWebComponentFromModel(notice) { + var timerCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + var timer = setTimeout(function () { + _$$_REQUIRE(_dependencyMap[11]).InterstitialContainer.show(notice); + + global.getAdsConfig().setNoticeCoolDown(notice.getId(), Date.now()); + }, notice.getTimeToShowFirst()); + + if (timerCallback) { + timerCallback(timer); + } + } + }, { + key: "showNativeComponentFromModel", + value: function showNativeComponentFromModel(notice) { + var timerCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + InterstitialsHelper.getNativeInterstitialComponent(notice, timerCallback); + } + }, { + key: "getNativeInterstitialComponent", + value: function getNativeInterstitialComponent(notice) { + var timerCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (global.getAdsConfig().useAdMob(notice.getAdProvider())) { + InterstitialsHelper.getAdMobInterstitialComponent(notice, timerCallback); + } else if (global.getAdsConfig().useDFP(notice.getAdProvider())) { + InterstitialsHelper.getDFPInterstitialComponent(notice, timerCallback); + } else if (global.getAdsConfig().usePrebid(notice.getAdProvider())) { + InterstitialsHelper.getPrebidInterstitialComponent(notice, timerCallback); + } + } + }, { + key: "getAdMobInterstitialComponent", + value: function getAdMobInterstitialComponent(notice) { + var timerCallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (_optionalPackageUtils.default.isAdMobAvailable()) { + var adUnitID = global.__DEV__ ? TestIds.INTERSTITIAL : notice.getAdUnitId(); + var interstitial = InterstitialAd.createForAdRequest(adUnitID); + interstitial.load(); + interstitial.onAdEvent(function (type, error) { + if (type === AdEventType.LOADED) { + InterstitialsHelper.handleDelay(notice, Date.now(), function () { + _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.hideStatusBar(); + + interstitial.show(); + InterstitialsHelper.showingNativeInterstitial = true; + global.getAdsConfig().setNoticeCoolDown(notice.getId(), Date.now()); + notice.incrementIndex(); + }, timerCallback); + } else if (type === AdEventType.ERROR) { + notice.incrementIndex(); + } else if (type === AdEventType.CLOSED) { + _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.showStatusBar(); + + _styleUtils.default.colorStatusBar(); + + notice.incrementIndex(); + } + }); + } + } + }, { + key: "getDFPInterstitialComponent", + value: function getDFPInterstitialComponent(notice) { + var timerCallback, + adConfig, + targeting, + _args3 = arguments; + return _regenerator.default.async(function getDFPInterstitialComponent$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + timerCallback = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null; + + if (!_optionalPackageUtils.default.isDFPAvailable()) { + _context3.next = 14; + break; + } + + _context3.prev = 2; + adConfig = { + adUnitId: notice.getAdUnitId(), + testDevice: global.adsTestDevices[0] + }; + targeting = notice.getTargeting(); + + if (!_$$_REQUIRE(_dependencyMap[12]).JSUtils.isEmpty(targeting)) { + adConfig.targeting = targeting; + } + + _context3.next = 8; + return _regenerator.default.awrap(Interstitial.loadAdFromAdUnitId(adConfig)); + + case 8: + InterstitialsHelper.handleDelay(notice, Date.now(), function () { + if (_$$_REQUIRE(_dependencyMap[12]).PlatformUtils.isIOS()) { + _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.hideStatusBar(); + + Interstitial.showAd(function () { + _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.showStatusBar(); + + _styleUtils.default.colorStatusBar(); + }); + } else { + Interstitial.showAd(); + } + + InterstitialsHelper.showingNativeInterstitial = true; + global.getAdsConfig().setNoticeCoolDown(notice.getId(), Date.now()); + notice.incrementIndex(); + }, timerCallback); + _context3.next = 14; + break; + + case 11: + _context3.prev = 11; + _context3.t0 = _context3["catch"](2); + + if (notice) { + notice.incrementIndex(); + } + + case 14: + case "end": + return _context3.stop(); + } + } + }, null, null, [[2, 11]], Promise); + } + }, { + key: "getPrebidInterstitialComponent", + value: function getPrebidInterstitialComponent(notice) { + var timerCallback, + _args4 = arguments; + return _regenerator.default.async(function getPrebidInterstitialComponent$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + timerCallback = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : null; + + if (_optionalPackageUtils.default.isPrebidAvailable()) { + _context4.next = 3; + break; + } + + return _context4.abrupt("return"); + + case 3: + if (InterstitialsHelper.prebidInitialized) { + _context4.next = 12; + break; + } + + _context4.prev = 4; + _context4.next = 7; + return _regenerator.default.awrap(PrebidInterstitial.initPrebid({ + serverAccountId: notice.getPrebidAccount(), + serverHost: notice.getPrebidHost(), + shareGeolocation: notice.isPrebidShareGeolocation() + })); + + case 7: + InterstitialsHelper.prebidInitialized = _context4.sent.initialized; + _context4.next = 12; + break; + + case 10: + _context4.prev = 10; + _context4.t0 = _context4["catch"](4); + + case 12: + _context4.prev = 12; + _context4.next = 15; + return _regenerator.default.awrap(PrebidInterstitial.loadAdFromConfig({ + adUnitId: notice.getAdUnitId(), + configurationId: notice.getPrebidConfigurationId() + })); + + case 15: + InterstitialsHelper.handleDelay(notice, Date.now(), function () { + PrebidInterstitial.showAd(); + InterstitialsHelper.showingNativeInterstitial = true; + global.getAdsConfig().setNoticeCoolDown(notice.getId(), Date.now()); + notice.incrementIndex(); + }, timerCallback); + _context4.next = 21; + break; + + case 18: + _context4.prev = 18; + _context4.t1 = _context4["catch"](12); + + if (notice) { + notice.incrementIndex(); + } + + case 21: + case "end": + return _context4.stop(); + } + } + }, null, null, [[4, 10], [12, 18]], Promise); + } + }, { + key: "handleDelay", + value: function handleDelay(notice, setupTime, showAdCallback, timerCallback) { + var delay = notice.getTimeToShowFirst(); + var readyTime = Date.now(); + var timeDiff = readyTime - setupTime; + + if (timeDiff >= delay) { + showAdCallback(); + } else { + InterstitialsHelper.interstitialTimeout(delay - timeDiff, showAdCallback, timerCallback); + } + } + }, { + key: "interstitialTimeout", + value: function interstitialTimeout(delay, callback, parentCallback) { + var timer = setTimeout(function () { + if (callback) { + callback(); + } + }, delay); + + if (parentCallback) { + parentCallback(timer); + } + } + }]); + return InterstitialsHelper; + }(); + + exports.default = InterstitialsHelper; + InterstitialsHelper.prebidInitialized = false; + InterstitialsHelper.showingNativeInterstitial = false; +},2321,[5,80,7,8,638,731,2020,2022,2023,2019,2147,2322,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.InterstitialContainer = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _interstitial = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _interstitialComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NoticeFullscreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var InterstitialContainer = function (_React$Component) { + (0, _inherits2.default)(InterstitialContainer, _React$Component); + + var _super = _createSuper(InterstitialContainer); + + function InterstitialContainer(props) { + var _this; + + (0, _classCallCheck2.default)(this, InterstitialContainer); + _this = _super.call(this, props); + _this.removeTimer = 0; + _this.top = undefined; + _this.hideInterstitial = _this.hideInterstitial.bind((0, _assertThisInitialized2.default)(_this)); + _this.close = _this._close.bind((0, _assertThisInitialized2.default)(_this)); + _this.open = _this._open.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + visible: false, + model: null + }; + return _this; + } + + (0, _createClass2.default)(InterstitialContainer, [{ + key: "showInterstitial", + value: function showInterstitial(model) { + this.setState({ + visible: true, + model: model + }); + } + }, { + key: "hideInterstitial", + value: function hideInterstitial() { + this.setState({ + visible: false, + model: null + }); + } + }, { + key: "_open", + value: function _open() { + var _this2 = this; + + return _regenerator.default.async(function _open$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", new Promise(function (resolve) { + if (_this2.top) { + _reactNative.Animated.timing(_this2.top, { + toValue: 0, + useNativeDriver: false + }).start(function () { + resolve(); + }); + } else { + resolve(); + } + })); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_close", + value: function _close() { + var _this3 = this; + + return _regenerator.default.async(function _close$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", new Promise(function (resolve) { + if (_this3.top) { + var _DeviceUtils$getScree = _deviceUtils.default.getScreenDimensions(), + height = _DeviceUtils$getScree.height; + + _reactNative.Animated.timing(_this3.top, { + toValue: height, + useNativeDriver: false + }).start(function () { + resolve(); + + _this3.hideInterstitial(); + }); + } else { + resolve(); + } + })); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "render", + value: function render() { + var _this$state = this.state, + visible = _this$state.visible, + model = _this$state.model; + + if (visible && model) { + var _DeviceUtils$getScree2 = _deviceUtils.default.getScreenDimensions(), + width = _DeviceUtils$getScree2.width, + height = _DeviceUtils$getScree2.height; + + if (this.top === undefined) { + this.top = new _reactNative.Animated.Value(height); + } + + return _react.default.createElement(_reactNative.Animated.View, (0, _extends2.default)({}, this.props, { + style: [_interstitial.default.container, { + width: width, + height: height, + top: this.top + }] + }), _react.default.createElement(_interstitialComponent.default, { + model: model, + onClose: this.close, + onOpen: this.open + })); + } + + return null; + } + }], [{ + key: "show", + value: function show(notice) { + this.interstitialInstance.showInterstitial(notice); + } + }, { + key: "hide", + value: function hide() { + this.interstitialInstance.hideInterstitial(); + } + }, { + key: "get", + value: function get(notice, onOpen, onClose, innerRef) { + return _react.default.createElement(_interstitialComponent.default, { + model: notice, + onOpen: onOpen, + onClose: onClose, + innerRef: innerRef + }); + } + }]); + return InterstitialContainer; + }(_react.default.Component); + + exports.InterstitialContainer = InterstitialContainer; + InterstitialContainer.popup = {}; +},2322,[5,80,6,7,8,15,12,14,16,17,28,2323,458,2324,2020]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + container: { + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent + }, + closeContainer: { + position: "absolute", + justifyContent: "center", + alignItems: "center", + margin: 5, + width: 20, + height: 20, + borderWidth: 1.5, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + borderRadius: 10, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + shadowOffset: { + width: 0.5, + height: 0.5 + }, + shadowColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + shadowOpacity: 1.0, + shadowRadius: 0.5 + }, + close: { + fontSize: 14, + marginEnd: 0, + marginStart: 0, + marginRight: 0, + textAlign: "center", + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.default = _default; +},2323,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _interstitialCloseComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _interstitial = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NoticeFullscreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NoticeAdOverPage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _cmpUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Interstitial = function (_React$PureComponent) { + (0, _inherits2.default)(Interstitial, _React$PureComponent); + + var _super = _createSuper(Interstitial); + + function Interstitial(props) { + var _this; + + (0, _classCallCheck2.default)(this, Interstitial); + _this = _super.call(this, props); + _this.removeTimer = 0; + _this.onInnerRef = _this._onInnerRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.close = _this._close.bind((0, _assertThisInitialized2.default)(_this)); + _this.startAutoClose = _this._startAutoClose.bind((0, _assertThisInitialized2.default)(_this)); + _this.handleLocals = _this._handleLocals.bind((0, _assertThisInitialized2.default)(_this)); + _this.handleLinkClicked = _this._handleLinkClicked.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoadEnd = _this._onLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(Interstitial, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._shouldOpen(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this._shouldOpen(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.removeTimer) { + clearTimeout(this.removeTimer); + this.removeTimer = 0; + } + } + }, { + key: "_shouldOpen", + value: function _shouldOpen() { + var model = this.props.model; + + if (model) { + if (!model.shouldWaitForLocal()) { + this._open(); + } + } + } + }, { + key: "_open", + value: function _open() { + var onOpen; + return _regenerator.default.async(function _open$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + onOpen = this.props.onOpen; + + if (!(typeof onOpen === "function")) { + _context.next = 4; + break; + } + + _context.next = 4; + return _regenerator.default.awrap(onOpen()); + + case 4: + this.startAutoClose(); + + case 5: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_startAutoClose", + value: function _startAutoClose() { + var model = this.props.model; + + if (model) { + if (model.isRemoveAfterSeconds() && model.getRemoveAfterSeconds() !== undefined) { + this.removeTimer = setTimeout(this.close, model.getRemoveAfterSeconds()); + } + } + } + }, { + key: "_close", + value: function _close() { + var onClose; + return _regenerator.default.async(function _close$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + onClose = this.props.onClose; + + if (!(typeof onClose === "function")) { + _context2.next = 4; + break; + } + + _context2.next = 4; + return _regenerator.default.awrap(onClose()); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onInnerRef", + value: function _onInnerRef(ref) { + var innerRef = this.props.innerRef; + + if (typeof innerRef === "function") { + innerRef(ref); + } + } + }, { + key: "_handleLocals", + value: function _handleLocals(_ref) { + var domain = _ref.domain; + + if (domain.includes("ad_loaded")) { + this._open(); + } + + if (domain.includes("closeInterstitial")) { + this._close(); + } + } + }, { + key: "_handleLinkClicked", + value: function _handleLinkClicked() { + this._close(); + + return false; + } + }, { + key: "_getCloseButton", + value: function _getCloseButton(model) { + if (model) { + return _react.default.createElement(_interstitialCloseComponent.default, { + onClose: this.close, + showAfter: model.getShowButtonAfterSeconds() + }); + } + + return null; + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd() { + var model = this.props.model; + (0, _$$_REQUIRE(_dependencyMap[18]).trackWebInterstitial)(model, "loaded"); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + model = _this$props.model, + onClose = _this$props.onClose; + + if (model) { + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA.top; + + var scrollEnabled = true; + + if (model instanceof _NoticeAdOverPage.default) { + top = 0; + scrollEnabled = false; + } + + var backgroundColor = model.getBackgroundColor(); + var uri = model.getUri(); + return _react.default.createElement(_reactNative.View, (0, _extends2.default)({}, this.props, { + style: [_interstitial.default.container, { + backgroundColor: backgroundColor + }] + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).BaseWebView, { + innerRef: this.onInnerRef, + overScrollMode: "content", + injectedJavaScriptBeforeContentLoaded: _cmpUtils.default.getCMPScript(), + onLocal: this.handleLocals, + onLinkClicked: this.handleLinkClicked, + onLoadEnd: this.onLoadEnd, + source: { + uri: uri + }, + progressType: _$$_REQUIRE(_dependencyMap[19]).BaseWebView.ProgressTypes.bar, + progressStyle: { + top: top + }, + scrollEnabled: scrollEnabled + }), this._getCloseButton(model, onClose)); + } + + return null; + } + }]); + return Interstitial; + }(_react.default.PureComponent); + + exports.default = Interstitial; + Interstitial.propTypes = { + model: _propTypes.default.instanceOf(_NoticeFullscreen.default), + onClose: _propTypes.default.func, + onOpen: _propTypes.default.func, + innerRef: _propTypes.default.func + }; + Interstitial.defaultProps = { + innerRef: function innerRef() {} + }; +},2324,[5,80,6,7,8,15,12,14,16,17,201,28,2325,2323,2020,2019,458,1875,1871,1894]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _interstitial = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var InterstitialCloseComponent = function (_React$Component) { + (0, _inherits2.default)(InterstitialCloseComponent, _React$Component); + + var _super = _createSuper(InterstitialCloseComponent); + + function InterstitialCloseComponent(props) { + var _this; + + (0, _classCallCheck2.default)(this, InterstitialCloseComponent); + _this = _super.call(this, props); + _this.showTimer = 0; + _this.state = { + visible: false + }; + return _this; + } + + (0, _createClass2.default)(InterstitialCloseComponent, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var showAfter = this.props.showAfter; + this.showTimer = setTimeout(function () { + _this2.setState({ + visible: true + }); + }, showAfter); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.showTimer) { + clearTimeout(this.showTimer); + this.showTimer = 0; + } + } + }, { + key: "render", + value: function render() { + var visible = this.state.visible; + + if (!visible) { + return null; + } + + var onClose = this.props.onClose; + + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(), + safeAreaTop = _DeviceUtils$getSafeA.top, + left = _DeviceUtils$getSafeA.left; + + var top = Math.max(safeAreaTop, 20); + + var closeContainerStyle = _$$_REQUIRE(_dependencyMap[12]).Css.getStyleObjByCssClasses(["interstitial-close-container"]); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).TapGestureHandler, { + onHandlerStateChange: function onHandlerStateChange(_ref) { + var nativeEvent = _ref.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[13]).State.ACTIVE) { + onClose(); + } + } + }, _react.default.createElement(_reactNative.View, { + style: [_interstitial.default.closeContainer, { + top: top + }, _$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isRTL() ? { + end: left + } : { + start: left + }, closeContainerStyle] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["interstitial-close-icon"] + }, _react.default.createElement(_iconComponent.default, { + onPress: onClose, + name: "times", + style: _interstitial.default.close, + type: _iconComponent.TecnaviaIconType.FONT_AWESOME + })))); + } + }]); + return InterstitialCloseComponent; + }(_react.default.Component); + + exports.default = InterstitialCloseComponent; + InterstitialCloseComponent.propTypes = { + showAfter: _propTypes.default.number, + onClose: _propTypes.default.func + }; +},2325,[5,7,8,12,14,16,17,28,201,2323,1806,458,699,1,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _progressDownloadComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ProgressDownload = function (_React$Component) { + (0, _inherits2.default)(ProgressDownload, _React$Component); + + var _super = _createSuper(ProgressDownload); + + function ProgressDownload(props) { + var _this; + + (0, _classCallCheck2.default)(this, ProgressDownload); + _this = _super.call(this, props); + _this.state = { + visible: props.visible + }; + _this.onProgressCircleRef = _this._onProgressCircleRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onProgressChange = _this._onProgressChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRetry = _this._onRetry.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(ProgressDownload, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this$props = this.props, + event = _this$props.event, + retryEvent = _this$props.retryEvent; + this.onDownloadEvent = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(event, this.onProgressChange); + + if (retryEvent) { + this.onRetryEvent = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(retryEvent, this.onRetry); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(this.onDownloadEvent); + + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(this.onRetryEvent); + } + }, { + key: "_onProgressChange", + value: function _onProgressChange(_ref) { + var progress = _ref.progress, + _ref$downloading = _ref.downloading, + downloading = _ref$downloading === undefined ? true : _ref$downloading; + var visible = this.state.visible; + + if (visible !== downloading) { + this.setState({ + visible: downloading + }); + } + + if (this.progressCircleRef) { + this.progressCircleRef.updateProgress(progress); + } + } + }, { + key: "_onProgressCircleRef", + value: function _onProgressCircleRef(ref) { + this.progressCircleRef = ref; + } + }, { + key: "_onRetry", + value: function _onRetry(_ref2) { + var retryText = _ref2.retryText; + + if (this.progressCircleRef) { + this.progressCircleRef.updateRetryText(retryText); + } + } + }, { + key: "render", + value: function render() { + var visible = this.state.visible; + + if (!visible) { + return null; + } + + var _this$props2 = this.props, + text = _this$props2.text, + color = _this$props2.color, + style = _this$props2.style, + cssClasses = _this$props2.cssClasses, + cssTextClasses = _this$props2.cssTextClasses, + rest = (0, _objectWithoutProperties2.default)(_this$props2, ["text", "color", "style", "cssClasses", "cssTextClasses"]); + return _react.default.createElement(_reactNative.View, { + style: [_progressDownloadComponent.default.parent, style], + pointerEvents: "none" + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ProgressCircle, (0, _extends2.default)({ + ref: this.onProgressCircleRef, + parentStyle: _progressDownloadComponent.default.progressParent, + spinnerStyle: _progressDownloadComponent.default.progress, + spinnerColor: color, + showText: true, + text: text, + textStyle: _progressDownloadComponent.default.progressText, + advanced: true, + cssClasses: cssClasses, + cssTextClasses: cssTextClasses + }, rest))); + } + }]); + return ProgressDownload; + }(_react.default.Component); + + exports.default = ProgressDownload; + ProgressDownload.propTypes = { + text: _propTypes.default.string.isRequired, + color: _propTypes.default.string.isRequired, + event: _propTypes.default.string.isRequired, + retryEvent: _propTypes.default.string, + style: _propTypes.default.any, + visible: _propTypes.default.bool, + cssClasses: _propTypes.default.arrayOf(_propTypes.default.string), + cssTextClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }; + ProgressDownload.defaultProps = { + visible: true, + cssClasses: [], + cssTextClasses: [] + }; +},2326,[5,6,108,7,8,15,12,14,16,17,28,201,2327,572,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + parent: { + position: "absolute", + start: 0, + end: 0, + top: 0, + bottom: 0, + backgroundColor: "white", + justifyContent: "center" + }, + progressParent: { + flex: 1, + flexDirection: "column" + }, + progress: { + flex: 0 + }, + progressText: { + flex: 0, + margin: 10 + } + }); + + exports.default = _default; +},2327,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _shortcutList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _optionPageAccessibility = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _AccessibilityListItem = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[19])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var OptionPageAccessibility = function (_React$Component) { + (0, _inherits2.default)(OptionPageAccessibility, _React$Component); + + var _super = _createSuper(OptionPageAccessibility); + + function OptionPageAccessibility(props) { + var _this; + + (0, _classCallCheck2.default)(this, OptionPageAccessibility); + _this = _super.call(this, props); + _this.state = { + open: false, + structure: [] + }; + _this.onOpen = _this._onOpen.bind((0, _assertThisInitialized2.default)(_this)); + _this.onClose = _this._onClose.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRead = _this._onRead.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageRead = _this._onPageRead.bind((0, _assertThisInitialized2.default)(_this)); + _this.onListRef = _this._onListRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.renderSeparator = _this._renderSeparator.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(OptionPageAccessibility, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._onShowListenerId = _$$_REQUIRE(_dependencyMap[20]).EventRegister.on(_events.default.OPEN_OPTIONSPAGE_ACCESSIBILITY, this.onOpen); + this._onCloseListenerId = _$$_REQUIRE(_dependencyMap[20]).EventRegister.on(_events.default.CLOSE_OPTIONSPAGE_ACCESSIBILITY, this.onClose); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[20]).EventRegister.rm(this._onShowListenerId); + + _$$_REQUIRE(_dependencyMap[20]).EventRegister.rm(this._onCloseListenerId); + } + }, { + key: "_onOpen", + value: function _onOpen() { + var result; + return _regenerator.default.async(function _onOpen$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + this.setState({ + open: true + }); + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.getEditionsAndIssues()); + + case 4: + result = _context.sent; + this.setState({ + structure: this._makeStructure(result) + }); + + if (!_$$_REQUIRE(_dependencyMap[21]).PlatformUtils.isSystemAccessibilityEnabled()) { + global.getAudio().ttsStart(global.strings("accessibility_issue_list_header")); + } + + _context.next = 12; + break; + + case 9: + _context.prev = 9; + _context.t0 = _context["catch"](1); + + this._onClose(); + + case 12: + case "end": + return _context.stop(); + } + } + }, null, this, [[1, 9]], Promise); + } + }, { + key: "_onClose", + value: function _onClose() { + this.setState({ + open: false + }); + } + }, { + key: "_onListRef", + value: function _onListRef(ref) { + this.listRef = ref; + } + }, { + key: "_onRead", + value: function _onRead(item) { + return this._getItemText(item); + } + }, { + key: "_onPageRead", + value: function _onPageRead(page) { + return global.strings("selected_page", { + page: page + 1 + }); + } + }, { + key: "_onItemPress", + value: function _onItemPress(item, index) { + if (item instanceof _AccessibilityListItem.default) { + if (item.getKey() === _$$_REQUIRE(_dependencyMap[22]).ACTIONS.closeEditions.key) { + this._onClose(); + } + } else if (item instanceof _$$_REQUIRE(_dependencyMap[23]).EditionModel) {} else if (item instanceof _$$_REQUIRE(_dependencyMap[23]).IssueModel) { + this._openIssue(item); + } else {} + } + }, { + key: "_openIssue", + value: function _openIssue(item) { + var structure, eModel, machine, pSetup, issue, edition, paperDomain, _global$getActivePSet, currentPSetup, config; + + return _regenerator.default.async(function _openIssue$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + structure = this.state.structure; + eModel = structure[item.editionIndex]; + machine = item.machine, pSetup = item.pSetup, issue = item.issue; + edition = eModel.edition; + paperDomain = machine; + _global$getActivePSet = global.getActivePSetup(), currentPSetup = _global$getActivePSet.pSetup; + _context2.next = 8; + return _regenerator.default.awrap(global.loadPSetup(pSetup, paperDomain)); + + case 8: + config = _context2.sent; + + if (!config) { + _context2.next = 16; + break; + } + + this._onClose(); + + if (!(currentPSetup !== pSetup)) { + _context2.next = 15; + break; + } + + _context2.next = 14; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig(false)); + + case 14: + Analytics.updateAnalyticsClientList(); + + case 15: + _$$_REQUIRE(_dependencyMap[20]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue, + edition: edition + }); + + case 16: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getItemAccessibilityText", + value: function _getItemAccessibilityText(item) { + if (item instanceof _$$_REQUIRE(_dependencyMap[23]).EditionModel) { + return _$$_REQUIRE(_dependencyMap[21]).StringUtils.decodeHTML(item.labelEdition); + } + + if (item instanceof _$$_REQUIRE(_dependencyMap[23]).IssueModel) { + var structure = this.state.structure; + return structure[item.editionIndex].labelEdition + " " + _$$_REQUIRE(_dependencyMap[21]).StringUtils.BULLET + " " + _$$_REQUIRE(_dependencyMap[21]).StringUtils.decodeHTML(item.dateLabelAccessibility); + } + + if (item instanceof _AccessibilityListItem.default) { + return item.getText(); + } + + return ""; + } + }, { + key: "_getItemText", + value: function _getItemText(item) { + if (item instanceof _$$_REQUIRE(_dependencyMap[23]).EditionModel) { + return _$$_REQUIRE(_dependencyMap[21]).StringUtils.decodeHTML(item.labelEdition); + } + + if (item instanceof _$$_REQUIRE(_dependencyMap[23]).IssueModel) { + return _$$_REQUIRE(_dependencyMap[21]).StringUtils.BULLET + " " + _$$_REQUIRE(_dependencyMap[21]).StringUtils.decodeHTML(item.dateLabelAccessibility); + } + + if (item instanceof _AccessibilityListItem.default) { + return item.getText(); + } + + return ""; + } + }, { + key: "_renderItem", + value: function _renderItem(item, focused) { + if (item instanceof _$$_REQUIRE(_dependencyMap[23]).EditionModel) { + return _react.default.createElement(_reactNative.View, { + style: [_optionPageAccessibility.default.item, _optionPageAccessibility.default.edition] + }, _react.default.createElement(_fontText.default, { + style: [_optionPageAccessibility.default.editionText] + }, this._getItemText(item))); + } + + if (item instanceof _$$_REQUIRE(_dependencyMap[23]).IssueModel) { + return _react.default.createElement(_reactNative.View, { + style: [_optionPageAccessibility.default.item, _optionPageAccessibility.default.issue] + }, _react.default.createElement(_fontText.default, { + style: [_optionPageAccessibility.default.issueText] + }, this._getItemText(item))); + } + + if (item instanceof _AccessibilityListItem.default) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).ItemListAccessibility, { + text: item.getText(), + key: item.getKey(), + style: [_optionPageAccessibility.default.item, _optionPageAccessibility.default.issue], + focused: focused + }); + } + + return null; + } + }, { + key: "_renderSeparator", + value: function _renderSeparator() { + return (0, _$$_REQUIRE(_dependencyMap[25]).hr)({ + backgroundColor: _$$_REQUIRE(_dependencyMap[21]).colors.black, + height: 0.5 + }); + } + }, { + key: "_makeStructure", + value: function _makeStructure(_ref) { + var edition = _ref.edition, + pics = _ref.pics; + var items = [new _AccessibilityListItem.default(_$$_REQUIRE(_dependencyMap[22]).ACTIONS.closeEditions)]; + var editionsKeys = Object.keys(pics); + editionsKeys.forEach(function (editionKey) { + if (edition[editionKey]) { + items.push(new (_$$_REQUIRE(_dependencyMap[23]).EditionModel)((0, _extends2.default)({}, edition[editionKey], { + edition: editionKey + }))); + var editionIndex = items.length - 1; + var issuesKeys = Object.keys(pics[editionKey]); + + for (var i = issuesKeys.length - 1; i >= 0; i--) { + var issueKey = issuesKeys[i]; + var issue = pics[editionKey][issueKey]; + items.push(new (_$$_REQUIRE(_dependencyMap[23]).IssueModel)((0, _extends2.default)({}, issue, { + issue: issueKey, + editionIndex: editionIndex + }))); + } + } + }); + return items; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$state = this.state, + open = _this$state.open, + structure = _this$state.structure; + + if (!open || !structure) { + return null; + } + + var shortcutPriority = this.props.shortcutPriority; + return _react.default.createElement(_reactNative.View, { + style: _optionPageAccessibility.default.container, + accessibilityLabel: global.strings("accessibility_issue_list_header") + }, _react.default.createElement(_shortcutList.default, { + ref: this.onListRef, + keyExtractor: function keyExtractor(current, idx) { + return "index_level_" + idx; + }, + readFocusedItem: false, + onRead: this.onRead, + onPageRead: this.onPageRead, + ItemSeparatorComponent: this.renderSeparator, + renderItem: function renderItem(_ref2) { + var item = _ref2.item, + index = _ref2.index, + focusedItem = _ref2.focusedItem; + + var focused = _$$_REQUIRE(_dependencyMap[21]).JSUtils.areEqualShallow(item, focusedItem); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).ItemAccessibilityFocused, { + touchable: true, + focused: focused, + style: [_optionPageAccessibility.default.row, focused ? _optionPageAccessibility.default.rowFocused : undefined], + key: index, + hasTVPreferredFocus: true, + onPress: function onPress() { + return _this2._onItemPress(item, index); + }, + accessibilityEnabled: true, + accessibilityLabel: _this2._getItemAccessibilityText(item) + }, _this2._renderItem(item, focused)); + }, + accessibilityEnabled: true, + data: structure, + plainData: structure, + shortcutPriority: shortcutPriority + })); + } + }]); + return OptionPageAccessibility; + }(_react.default.Component); + + exports.default = OptionPageAccessibility; + OptionPageAccessibility.propTypes = { + shortcutPriority: _propTypes.default.number + }; + OptionPageAccessibility.defaultProps = { + shortcutPriority: 0 + }; +},2328,[5,80,6,7,8,15,12,14,16,17,28,201,460,430,1908,2329,1879,1726,2154,1871,572,462,1725,2330,2189,2195]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + container: { + position: "absolute", + top: 0, + bottom: 0, + left: 0, + right: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + row: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + flexDirection: "row", + justifyContent: "space-between", + alignItems: "center" + }, + rowFocused: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.keyboardHighlight + }, + item: { + flex: 1, + fontSize: 18, + paddingHorizontal: 6, + paddingVertical: 11 + }, + edition: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black + }, + editionText: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + issue: {}, + issueText: {} + }); + + exports.default = _default; +},2329,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.IssueModel = exports.EditionModel = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var EditionModel = function EditionModel(obj) { + (0, _classCallCheck2.default)(this, EditionModel); + this.edition = obj.edition; + this.labelEdition = obj.label_edition; + this.pSetup = obj.pSetup; + this.subtitleEdition = obj.subtitle_edition; + }; + + exports.EditionModel = EditionModel; + + var IssueModel = function IssueModel(obj) { + (0, _classCallCheck2.default)(this, IssueModel); + this.issue = obj.issue; + this.dateLabel = obj.dateLabel; + this.dateLabelAccessibility = obj.dateLabelAccessibility; + this.dayOfWeek = obj.dayOfWeek; + this.dayOfWeekComplete = obj.dayOfWeekComplete; + this.deliveryTime = obj.deliveryTime; + this.filename = obj.filename; + this.lastClosed = obj.lastClosed; + this.pSetup = obj.pSetup; + this.machine = obj.machine; + this.paper = obj.paper; + this.pathEdi = obj.pathEdi; + this.editionIndex = obj.editionIndex; + }; + + exports.IssueModel = IssueModel; +},2330,[5,7]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _NewsmemoryManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _nativeOptionsPageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _keyboardAvoidingComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _LoginManager = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[23])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getNativeOptionsPage(), + OptionsPage = _OptionalPackages$get.OptionsPage, + Methods = _OptionalPackages$get.Methods, + Models = _OptionalPackages$get.Models; + + var LOG_CALLBACKS = { + onLog: function onLog(message) { + for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + rest[_key - 1] = arguments[_key]; + } + }, + onDebug: function onDebug(message) { + for (var _len2 = arguments.length, rest = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + rest[_key2 - 1] = arguments[_key2]; + } + }, + onWarning: function onWarning(message) { + for (var _len3 = arguments.length, rest = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) { + rest[_key3 - 1] = arguments[_key3]; + } + }, + onError: function onError(message) { + for (var _len4 = arguments.length, rest = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) { + rest[_key4 - 1] = arguments[_key4]; + } + } + }; + + var NativeOptionsPage = function (_React$Component) { + (0, _inherits2.default)(NativeOptionsPage, _React$Component); + + var _super = _createSuper(NativeOptionsPage); + + function NativeOptionsPage(props) { + var _this; + + (0, _classCallCheck2.default)(this, NativeOptionsPage); + _this = _super.call(this, props); + + _this._close = function (force) { + var _this$props = _this.props, + isNewspaperLoaded = _this$props.isNewspaperLoaded, + onClose = _this$props.onClose, + handleBackButton = _this$props.handleBackButton; + + if (force || typeof isNewspaperLoaded === "function" && isNewspaperLoaded()) { + _this.setState({ + visible: false + }); + + if (typeof onClose === "function") { + onClose(); + } + } else { + var initialRoute = _this.state.initialRoute; + + var _global$getRSSActiveP = global.getRSSActivePSetup(), + rssIsEnabled = _global$getRSSActiveP.rssIsEnabled; + + if (_this.currentRoute && !(_this.currentRoute instanceof Models.RouteEdition) && _this.currentRoute.getRoute() !== initialRoute) { + Methods.Navigation.navigateToHome(); + } else if (rssIsEnabled) { + _NavigationService.default.main.reset("RssNavigator"); + } else if (_$$_REQUIRE(_dependencyMap[25]).PaperSetupManager.isGenericAppConfigured()) { + _NavigationService.default.main.navigate("PublicationsPageScreen"); + } else if (typeof handleBackButton === "function") { + handleBackButton(); + } + } + }; + + _this._onLocal = function (_ref) { + var uri = _ref.uri, + jsInjection = _ref.jsInjection; + + try { + var data = (0, _extends2.default)({ + local: uri.getDomain(), + protocol: uri.getProtocol(), + port: uri.getPort() + }, uri.getParams()); + var message = new Models.Message(); + message.setData(JSON.stringify(data)); + + _this._onMessage({ + message: message, + jsInjection: jsInjection + }); + } catch (e) {} + }; + + _this._injectionJs = function (local, js) { + var jsInjection = _this.jsInjectCallbacks[local]; + + if (typeof jsInjection === "function") { + jsInjection({ + js: js + }); + delete _this.jsInjectCallbacks[local]; + } + }; + + _this._onMessage = function _callee3(_ref2) { + var message, jsInjection, data, local, rest, result, jsCode, newsmemoryManager, _NativeOptionsPageUti, initialRoute, urlParams, mIssue, _mIssue, js, callback, close, _js, _js2; + + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + message = _ref2.message, jsInjection = _ref2.jsInjection; + _context3.prev = 1; + data = JSON.parse(message.getData()); + local = data.local, rest = (0, _objectWithoutProperties2.default)(data, ["local"]); + _this.jsInjectCallbacks[local] = jsInjection; + + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.RETURN_FROM_LOGIN)) { + _context3.next = 13; + break; + } + + _context3.next = 8; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[27]).returnFromLogin)(rest)); + + case 8: + result = _context3.sent; + + if (result && result.data) { + jsCode = "xcj_loginResults(" + result.TAUID + ",'" + JSON.stringify(result.data) + "');"; + } else { + jsCode = "xcj_loginResults(-1,'" + JSON.stringify({ + protError: _LoginManager.PROT_ERROR.NOT_LOGGEDIN + }) + "');"; + } + + _this._injectionJs(local, jsCode); + + _context3.next = 108; + break; + + case 13: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.LOGOUT)) { + _context3.next = 21; + break; + } + + _context3.next = 16; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[27]).logout)()); + + case 16: + newsmemoryManager = _this.props.newsmemoryManager; + _NativeOptionsPageUti = _nativeOptionsPageUtils.default.getStateFromTab(_$$_REQUIRE(_dependencyMap[26]).tabs.login, {}, newsmemoryManager), initialRoute = _NativeOptionsPageUti.initialRoute, urlParams = _NativeOptionsPageUti.params; + + _this.setState({ + initialRoute: initialRoute, + urlParams: urlParams + }); + + _context3.next = 108; + break; + + case 21: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.INITPAGE_SET_NEWSPAPER_AND_READ)) { + _context3.next = 30; + break; + } + + mIssue = new Models.Issue(); + mIssue.setMachine(rest.machine); + mIssue.setPSetup(rest.pSetup); + mIssue.setIssue(rest.issue); + mIssue.setEdition(rest.edition); + + _this._onIssuePress(mIssue); + + _context3.next = 108; + break; + + case 30: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.INITPAGE_SET_EXTERNAL_NEWSPAPER)) { + _context3.next = 39; + break; + } + + _mIssue = new Models.Issue(); + + _mIssue.setMachine(rest.machine); + + _mIssue.setPSetup(rest.pSetup); + + _mIssue.setIssue(rest.issue); + + _mIssue.setEdition(rest.edition); + + _this._onIssuePress(_mIssue); + + _context3.next = 108; + break; + + case 39: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.BUY)) { + _context3.next = 43; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[28]).buy)(rest, function _callee(iapParams) { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _this._iapSystemCallback(iapParams, local)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }); + _context3.next = 108; + break; + + case 43: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.RESUME_TRANSACTIONS)) { + _context3.next = 47; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[28]).resumeTransaction)(); + _context3.next = 108; + break; + + case 47: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.FINISH_TRANSACTION)) { + _context3.next = 51; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[28]).finishTransaction)(); + _context3.next = 108; + break; + + case 51: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.RESTORE_COMPLETED_TRANSACTIONS)) { + _context3.next = 58; + break; + } + + _context3.next = 54; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[28]).completeTransaction)(rest, function _callee2(iapParams) { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", _this._iapSystemCallback(iapParams, local)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + })); + + case 54: + js = _context3.sent; + + _this._injectionJs(local, js); + + _context3.next = 108; + break; + + case 58: + if (!(local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.OPEN_BROWSER) || local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.OPEN_BROWSER_ALT))) { + _context3.next = 65; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[27]).openBrowser)(rest); + callback = rest.callback, close = rest.close; + + if (callback) { + _this._injectionJs(local, callback + "();"); + } + + if (close && close === "1") { + _this._close(true); + } + + _context3.next = 108; + break; + + case 65: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.ALERT)) { + _context3.next = 69; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[27]).showAlert)(rest); + _context3.next = 108; + break; + + case 69: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.CONFIRM)) { + _context3.next = 73; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[27]).showConfirm)(rest); + _context3.next = 108; + break; + + case 73: + if (!(local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.CLOSE) || local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.CLOSE_WINDOW))) { + _context3.next = 77; + break; + } + + _this._close(true); + + _context3.next = 108; + break; + + case 77: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.GO_BACK)) { + _context3.next = 81; + break; + } + + Methods.Navigation.navigateToHome(); + _context3.next = 108; + break; + + case 81: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.OPEN_RSS)) { + _context3.next = 85; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[27]).goToRssNavigator)(); + _context3.next = 108; + break; + + case 85: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.OPEN_TAB_HOME)) { + _context3.next = 89; + break; + } + + Methods.Navigation.navigateToHome(); + _context3.next = 108; + break; + + case 89: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.OPEN_TAB_LOGIN)) { + _context3.next = 93; + break; + } + + Methods.Navigation.navigateToLogin(); + _context3.next = 108; + break; + + case 93: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.GET_KEY)) { + _context3.next = 100; + break; + } + + _context3.next = 96; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[27]).getKey)(data)); + + case 96: + _js = _context3.sent; + + _this._injectionJs(local, _js); + + _context3.next = 108; + break; + + case 100: + if (!local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.SET_KEY)) { + _context3.next = 107; + break; + } + + _context3.next = 103; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[27]).setKey)(data)); + + case 103: + _js2 = _context3.sent; + + _this._injectionJs(local, _js2); + + _context3.next = 108; + break; + + case 107: + if (local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.REMOVE_KEY)) { + (0, _$$_REQUIRE(_dependencyMap[27]).removeKey)(data); + } else if (local.includes(_$$_REQUIRE(_dependencyMap[26]).locals.SET_PREF_EDI)) { + (0, _$$_REQUIRE(_dependencyMap[27]).setPrefEdit)(data); + } + + case 108: + _context3.next = 112; + break; + + case 110: + _context3.prev = 110; + _context3.t0 = _context3["catch"](1); + + case 112: + case "end": + return _context3.stop(); + } + } + }, null, null, [[1, 110]], Promise); + }; + + _this._iapSystemCallback = function _callee4(iapParams, local) { + var js; + return _regenerator.default.async(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _context4.next = 2; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[28]).transactionResult)(iapParams)); + + case 2: + js = _context4.sent; + + _this._injectionJs(local, js); + + return _context4.abrupt("return", true); + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + }; + + _this._onIssuePress = function _callee5(issue) { + var _global$getActivePSet, machine, iapActive, loginStatus, TAUID, paperDomain, external, _global$getActivePSet2, currentPSetup, _await$global$loadPSe, config; + + return _regenerator.default.async(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _global$getActivePSet = global.getActivePSetup(), machine = _global$getActivePSet.machine, iapActive = _global$getActivePSet.iapActive, loginStatus = _global$getActivePSet.loginStatus; + TAUID = loginStatus.TAUID; + + if (!(iapActive && !_$$_REQUIRE(_dependencyMap[29]).LoginStatus.isValidTAUID(TAUID))) { + _context5.next = 5; + break; + } + + _context5.next = 5; + return _regenerator.default.awrap(_LoginManager.default.autoIAPLogin()); + + case 5: + paperDomain = issue.getMachine() || machine; + external = false; + _global$getActivePSet2 = global.getActivePSetup(), currentPSetup = _global$getActivePSet2.pSetup; + _context5.next = 10; + return _regenerator.default.awrap(global.loadPSetup(issue.getPSetup(), paperDomain, {}, external)); + + case 10: + _await$global$loadPSe = _context5.sent; + config = _await$global$loadPSe.config; + + if (!config) { + _context5.next = 24; + break; + } + + _this._close(true); + + if (!(currentPSetup !== issue.getPSetup())) { + _context5.next = 21; + break; + } + + _context5.next = 17; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig()); + + case 17: + if (!external) { + _context5.next = 20; + break; + } + + _context5.next = 20; + return _regenerator.default.awrap(_GlobalConfig.default.initCustomFonts(config)); + + case 20: + Analytics.updateAnalyticsClientList(); + + case 21: + _$$_REQUIRE(_dependencyMap[30]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue.getIssue(), + edition: issue.getEdition() + }); + + _context5.next = 25; + break; + + case 24: + _$$_REQUIRE(_dependencyMap[31]).Toast.show(global.strings("err_download_psetup")); + + case 25: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + }; + + _this._onRouteChange = function (route) { + _this.currentRoute = route; + }; + + _this._onError = function (error) {}; + + _this.state = { + visible: false, + initialRoute: "", + urlParams: {} + }; + _this.jsInjectCallbacks = {}; + _this.close = _this._close.bind((0, _assertThisInitialized2.default)(_this)); + _this.shouldHideCloseButton = _this._shouldHideCloseButton.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRouteChange = _this._onRouteChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onActionClicked = _this._onActionClicked.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(NativeOptionsPage, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.openOptionsPageId = _$$_REQUIRE(_dependencyMap[30]).EventRegister.on(_events.default.OPEN_OPTIONSPAGE, function (params) { + var newsmemoryManager = _this2.props.newsmemoryManager; + var tab = params.tab, + getParams = params.getParams, + url = params.url, + closeType = params.closeType, + forceFullscreen = params.forceFullscreen, + hidden = params.hidden; + + try { + var _NativeOptionsPageUti2 = _nativeOptionsPageUtils.default.getStateFromTab(tab, getParams, newsmemoryManager), + initialRoute = _NativeOptionsPageUti2.initialRoute, + urlParams = _NativeOptionsPageUti2.params; + + _this2.setState({ + visible: true, + initialRoute: initialRoute, + urlParams: urlParams + }); + } catch (e) { + _$$_REQUIRE(_dependencyMap[31]).Toast.show(global.strings("system_error")); + + _this2.setState({ + visible: true + }); + } + }); + this.closeOptionsPageId = _$$_REQUIRE(_dependencyMap[30]).EventRegister.on(_events.default.CLOSE_OPTIONSPAGE, function () { + _this2.close(true); + }); + var config = global.getNewsmemoryConfig(); + config.getFavEdi().then(Methods.setFavoriteEdition); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[30]).EventRegister.rm(this.openOptionsPageId); + + _$$_REQUIRE(_dependencyMap[30]).EventRegister.rm(this.closeOptionsPageId); + } + }, { + key: "_shouldHideCloseButton", + value: function _shouldHideCloseButton() { + var isNewspaperLoaded = this.props.isNewspaperLoaded; + + var _global$getRSSActiveP2 = global.getRSSActivePSetup(), + rssIsEnabled = _global$getRSSActiveP2.rssIsEnabled; + + return _$$_REQUIRE(_dependencyMap[32]).PlatformUtils.isIOS() && !(typeof isNewspaperLoaded === "function" && isNewspaperLoaded()) && !rssIsEnabled && !_$$_REQUIRE(_dependencyMap[25]).PaperSetupManager.isGenericAppConfigured(); + } + }, { + key: "_onExternalLinkClicked", + value: function _onExternalLinkClicked(url) { + _tecnaviaPlatformUtils.default.openURL(url); + } + }, { + key: "_onActionClicked", + value: function _onActionClicked(action) { + var navigation = this.props.navigation; + + switch (action) { + case _$$_REQUIRE(_dependencyMap[33]).ACTIONS.openOptionPageSettings.key: + navigation.navigate("GeneralSettingsScreen", { + module: _$$_REQUIRE(_dependencyMap[34]).GeneralSettingsModules.EPAPER + }); + break; + + case _$$_REQUIRE(_dependencyMap[33]).ACTIONS.openOptionPagePublications.key: + _NavigationService.default.main.navigate("PublicationsPageScreen"); + + break; + } + } + }, { + key: "render", + value: function render() { + var onOpen = this.props.onOpen; + var _this$state = this.state, + visible = _this$state.visible, + initialRoute = _this$state.initialRoute, + urlParams = _this$state.urlParams; + + if (!visible) { + return null; + } + + if (typeof onOpen === "function") { + onOpen(); + } + + var _global$getActivePSet3 = global.getActivePSetup(), + pSetup = _global$getActivePSet3.pSetup, + machine = _global$getActivePSet3.machine, + overrideNewsMemoryUserAgent = _global$getActivePSet3.overrideNewsMemoryUserAgent; + + var userAgent = overrideNewsMemoryUserAgent || _$$_REQUIRE(_dependencyMap[32]).PlatformUtils.getUserAgent(); + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + var favoriteEdition = global.getNewsmemoryConfig().getFavEdiSync(); + return _react.default.createElement(_reactNative.View, { + style: { + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0 + } + }, _react.default.createElement(OptionsPage, { + WebViewComponent: _react.default.forwardRef(function (forwardedProps, ref) { + return _react.default.createElement(_keyboardAvoidingComponent.default, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[35]).TecnaviaScrollView, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[36]).AutoHeightWebView, (0, _extends2.default)({}, forwardedProps, { + htmlContentId: "", + ref: ref, + startInLoadingState: _$$_REQUIRE(_dependencyMap[37]).BaseWebView.LoadingStatePosition.top, + progressType: _$$_REQUIRE(_dependencyMap[37]).BaseWebView.ProgressTypes.bar, + defaultHeight: _deviceUtils.default.getSafeArea().height + })))); + }), + getSavedIssues: _nativeOptionsPageUtils.default.getSavedIssues, + LogoComponent: _$$_REQUIRE(_dependencyMap[38]).LogoImage, + pSetup: pSetup, + server: machine, + initialRoute: initialRoute, + hideCloseButton: this.shouldHideCloseButton(), + onLocal: this._onLocal, + onMessage: this._onMessage, + onClose: this.close, + apiParams: { + isDebug: global.isDebug, + isGenericApp: _$$_REQUIRE(_dependencyMap[25]).PaperSetupManager.isGenericAppConfigured() ? 1 : 0 + }, + urlParams: urlParams, + onRouteChange: this.onRouteChange, + issueCallbacks: { + onIssuePress: this._onIssuePress + }, + externalLinkCallbacks: { + onClick: this._onExternalLinkClicked + }, + actionCallbacks: { + onClick: this.onActionClicked + }, + onPSetupError: this._onError, + onEditionsError: this._onError, + onLocaleError: this._onError, + onUserSettingsError: this._onError, + onSpecialsError: this._onError, + logCallbacks: LOG_CALLBACKS, + supportColor: supportColor, + customUserAgent: userAgent, + favoriteEdition: favoriteEdition, + needsCssProvider: false + })); + } + }]); + return NativeOptionsPage; + }(_react.default.Component); + + NativeOptionsPage.propTypes = { + onOpen: _propTypes.default.func, + onClose: _propTypes.default.func, + onTabLoaded: _propTypes.default.func, + handleBackButton: _propTypes.default.func, + isNewspaperLoaded: _propTypes.default.func, + newsmemoryManager: _propTypes.default.instanceOf(_NewsmemoryManager.default), + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }) + }; + + var _default = function _default(props) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[39]).useNavigation)(); + return _react.default.createElement(NativeOptionsPage, (0, _extends2.default)({}, props, { + navigation: navigation + })); + }; + + exports.default = _default; +},2331,[5,80,108,6,7,8,15,12,14,16,17,201,28,1871,2318,460,2154,2332,1861,731,1876,458,1870,2057,1859,1849,730,2333,2334,721,572,1889,462,1725,2232,1909,1901,1894,2201,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NewsmemoryDatabasesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NewsmemoryManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _NewspaperManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _optionspageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var NativeOptionsPageUtils = function () { + function NativeOptionsPageUtils() { + (0, _classCallCheck2.default)(this, NativeOptionsPageUtils); + } + + (0, _createClass2.default)(NativeOptionsPageUtils, null, [{ + key: "getSavedIssues", + value: function getSavedIssues() { + var issues; + return _regenerator.default.async(function getSavedIssues$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(_NewsmemoryDatabasesManager.default.getAllIssues()); + + case 3: + issues = _context.sent; + return _context.abrupt("return", issues.map(function (issue) { + return { + edition: issue.getEdition(), + issue: issue.getIssue(), + paper: issue.getPaper(), + status: issue.getStatus() || 0 + }; + })); + + case 7: + _context.prev = 7; + _context.t0 = _context["catch"](0); + return _context.abrupt("return", []); + + case 10: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 7]], Promise); + } + }, { + key: "appendOthersParams", + value: function appendOthersParams(newsmemoryManager) { + var getParams = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var currentNewspaperManager = newsmemoryManager.currentNewspaperManager; + + if (currentNewspaperManager && currentNewspaperManager.currentNewspaper) { + if (!getParams.edition) { + getParams.edition = currentNewspaperManager.currentNewspaper.getEdition(); + } + + if (!getParams.issue) { + getParams.issue = currentNewspaperManager.currentNewspaper.getIssue(); + } + } + + var _global$getActivePSet = global.getActivePSetup(), + external = _global$getActivePSet.external; + + if (external && !_$$_REQUIRE(_dependencyMap[10]).PaperSetupManager.isGenericAppConfigured()) { + var _global$getMainPSetup = global.getMainPSetup(), + pSetup = _global$getMainPSetup.pSetup; + + getParams.originalPSetup = pSetup; + } + + return getParams; + } + }, { + key: "getStateFromTab", + value: function getStateFromTab(tab, getParams, newsmemoryManager) { + var _StringUtils$segmentU = _$$_REQUIRE(_dependencyMap[11]).StringUtils.segmentUrl(_optionspageUtils.default.getBaseURL()), + baseUrlGetParams = _StringUtils$segmentU.getParams; + + var params = (0, _extends2.default)({}, _optionspageUtils.default.getDefaultParams(), baseUrlGetParams, NativeOptionsPageUtils.appendOthersParams(newsmemoryManager, getParams)); + + var _global$getActivePSet2 = global.getActivePSetup(), + onValidationErrorGoTo = _global$getActivePSet2.onValidationErrorGoTo; + + var initialRoute = tab; + + if (tab === _optionspageUtils.tabs.home) { + initialRoute = "newsstand"; + } else if ((tab === _optionspageUtils.tabs.validation || tab === _optionspageUtils.tabs.account) && onValidationErrorGoTo) { + initialRoute = onValidationErrorGoTo; + } + + return { + initialRoute: initialRoute, + params: params + }; + } + }]); + return NativeOptionsPageUtils; + }(); + + var _default = NativeOptionsPageUtils; + exports.default = _default; +},2332,[5,80,6,7,8,710,2318,2306,730,714,1849,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.returnFromLogin = returnFromLogin; + exports.logout = logout; + exports.openBrowser = openBrowser; + exports.showAlert = showAlert; + exports.showConfirm = showConfirm; + exports.goToRssNavigator = goToRssNavigator; + exports.getKey = getKey; + exports.setKey = setKey; + exports.removeKey = removeKey; + exports.setPrefEdit = setPrefEdit; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _LoginManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function returnFromLogin(data) { + var pSetup, machine, username, password, challenge, remember, TAUID, token, TOKEN, extid; + return _regenerator.default.async(function returnFromLogin$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _$$_REQUIRE(_dependencyMap[7]).sendNewsmemoryLoginEvent)("start login"); + pSetup = data.pSetup, machine = data.machine, username = data.username, password = data.password, challenge = data.challenge, remember = data.remember, TAUID = data.TAUID, token = data.token, TOKEN = data.TOKEN, extid = data.extid; + return _context.abrupt("return", _LoginManager.default.login({ + pSetup: pSetup, + machine: machine, + username: username, + password: password, + challenge: challenge, + remember: remember, + TAUID: TAUID, + token: TOKEN || token, + extid: extid + })); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + function logout() { + return _regenerator.default.async(function logout$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _context2.next = 2; + return _regenerator.default.awrap(_LoginManager.default.logout()); + + case 2: + _$$_REQUIRE(_dependencyMap[8]).EventRegister.emit(_events.default.NEWSMEMORY_RELOAD_EDITION); + + case 3: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + + function openBrowser(data) { + var url = data.url, + callback = data.callback, + close = data.close; + + if (url) { + var extraNavigationParams = {}; + + if (url.indexOf("archiveSearch=1") !== -1) { + extraNavigationParams.screenTitle = global.strings("btn_archive"); + extraNavigationParams.isArchive = true; + } + + _NavigationService.default.main.navigate("WebScreen", (0, _extends2.default)({ + url: url, + onClose: function onClose() { + _$$_REQUIRE(_dependencyMap[9]).PlatformUtils.colorBars(); + } + }, extraNavigationParams)); + } + } + + function showAlert(data) { + var title = data.title, + message = data.message, + okLabel = data.okLabel; + var buttons = []; + buttons.push({ + text: okLabel || global.strings("btn_ok") + }); + + _reactNative.Alert.alert(title, message, buttons, { + cancelable: false + }); + } + + function showConfirm(data) { + var _this = this; + + var title = data.title, + message = data.message, + okLabel = data.okLabel, + cancelLabel = data.cancelLabel, + callback = data.callback; + var buttons = []; + buttons.push({ + text: cancelLabel || global.strings("btn_cancel"), + onPress: function onPress() { + _this._confirmResult(callback, false); + } + }, { + text: okLabel || global.strings("btn_ok"), + onPress: function onPress() { + _this._confirmResult(callback, true); + } + }); + + _reactNative.Alert.alert(title, message, buttons, { + cancelable: false + }); + } + + function goToRssNavigator() { + _NavigationService.default.main.reset("RssNavigator"); + } + + function getKey(data) { + var key, _global$getActivePSet, loginStatus, udb, loginStatusValue, value; + + return _regenerator.default.async(function getKey$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + key = data.key; + + if (!key) { + _context3.next = 16; + break; + } + + _global$getActivePSet = global.getActivePSetup(), loginStatus = _global$getActivePSet.loginStatus, udb = _global$getActivePSet.udb; + loginStatusValue = ""; + + if (!key.startsWith(udb)) { + _context3.next = 8; + break; + } + + _context3.next = 7; + return _regenerator.default.awrap(loginStatus.getValue(key.replace(udb + "_", ""))); + + case 7: + loginStatusValue = _context3.sent; + + case 8: + _context3.t0 = loginStatusValue; + + if (_context3.t0) { + _context3.next = 13; + break; + } + + _context3.next = 12; + return _regenerator.default.awrap(global.getNewsmemoryConfig().getValue(key)); + + case 12: + _context3.t0 = _context3.sent; + + case 13: + value = _context3.t0; + + if (typeof value === "string") { + value = "'" + value + "'"; + } + + return _context3.abrupt("return", "xcj_getFromKey(" + value + ",'" + key + "');"); + + case 16: + return _context3.abrupt("return", ""); + + case 17: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + + function setKey(data) { + var key, value, callback; + return _regenerator.default.async(function setKey$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + key = data.key, value = data.value, callback = data.callback; + global.getNewsmemoryConfig().setValue(key, value); + + if (!callback) { + _context4.next = 4; + break; + } + + return _context4.abrupt("return", callback + "();"); + + case 4: + return _context4.abrupt("return", ""); + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + + function removeKey(data) { + var key; + return _regenerator.default.async(function removeKey$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + key = data.key; + global.getNewsmemoryConfig().removeValue(key); + + case 2: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } + + function setPrefEdit(data) { + var key, value; + return _regenerator.default.async(function setPrefEdit$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + key = data.key, value = data.value; + global.getNewsmemoryConfig().setValue(key, value); + + case 2: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } +},2333,[5,6,80,28,2057,460,1861,1954,572,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.resumeTransaction = resumeTransaction; + exports.finishTransaction = finishTransaction; + exports.buy = buy; + exports.completeTransaction = completeTransaction; + exports.transactionResult = transactionResult; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _IAPHelper = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _optionspageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _OptionalPackages$get = _optionalPackageUtils.default.getIapModule(), + IAPErrorCode = _OptionalPackages$get.IAPErrorCode; + + function injectFailedTransaction(model, error) { + var message = _optionspageUtils.default.getIAPErrorMessage(error); + + return "xc_failedTransaction_RN('" + (model ? model.productId : "") + "','" + message + "');"; + } + + function injectCompletedTransaction(model) { + return _regenerator.default.async(function injectCompletedTransaction$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!(model && model.productId)) { + _context.next = 5; + break; + } + + if (!(!model.isRecurring() || !model.receipt)) { + _context.next = 4; + break; + } + + _context.next = 4; + return _regenerator.default.awrap(_IAPHelper.default.clearAll(model.productId)); + + case 4: + return _context.abrupt("return", "xc_completeTransaction_RN('" + model.productId + "');"); + + case 5: + return _context.abrupt("return", injectFailedTransaction(model, { + code: IAPErrorCode.E_ITEM_UNAVAILABLE, + message: "Missing product identifier" + })); + + case 6: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + } + + function injectRestoredTransactions(_ref) { + var success = _ref.success, + message = _ref.message, + purchases = _ref.purchases; + + if (!success) { + if (!message) { + message = "Restore transactions failed"; + } + + return "xc_restoreTransactionFinished(\"" + message + "\");"; + } + + return "xc_restoreTransactionFinished();"; + } + + function transactionResult(params) { + var status, error, model; + return _regenerator.default.async(function transactionResult$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + status = params.status, error = params.error, model = params.model; + _context2.t0 = status; + _context2.next = _context2.t0 === _IAPHelper.IAP_STATUS.SUCCESS ? 4 : _context2.t0 === _IAPHelper.IAP_STATUS.RESTORED ? 5 : _context2.t0 === _IAPHelper.IAP_STATUS.FAILED ? 6 : 6; + break; + + case 4: + return _context2.abrupt("return", injectCompletedTransaction(model)); + + case 5: + return _context2.abrupt("return", injectRestoredTransactions()); + + case 6: + return _context2.abrupt("return", injectFailedTransaction(model, error)); + + case 7: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + + function resumeTransaction() {} + + function finishTransaction(data) { + var productId, transactionId, recurring; + return _regenerator.default.async(function finishTransaction$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + productId = data.productID, transactionId = data.finishTransaction, recurring = data.recurring; + + if (!(transactionId && productId && !recurring)) { + _context3.next = 4; + break; + } + + _context3.next = 4; + return _regenerator.default.awrap(_IAPHelper.default.clearAll(productId)); + + case 4: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + + function buy(data, serverResultCallback) { + var pSetup, issue, edition, productId, invoiceId, editionId, period, isRecurring, model; + return _regenerator.default.async(function buy$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!_optionalPackageUtils.default.isIapModuleAvailable()) { + _context4.next = 14; + break; + } + + pSetup = data.pSetup, issue = data.issue, edition = data.edition, productId = data.productID, invoiceId = data.invoiceID, editionId = data.editionid, period = data.period, isRecurring = data.isRecurring; + _context4.next = 4; + return _regenerator.default.awrap(_IAPHelper.default.setServerCallback(serverResultCallback)); + + case 4: + model = new (_$$_REQUIRE(_dependencyMap[5]).IAPTecnaviaModel)(); + model.setProductId(productId); + model.setInvoiceId(invoiceId); + model.setPSetup(pSetup); + model.setIssue(issue); + model.setEdition(edition); + model.setEditionId(editionId); + + if (period && (_$$_REQUIRE(_dependencyMap[6]).JSUtils.isNull(isRecurring) || isRecurring === "1")) { + model.setRecurringSubscriptionPeriod(period); + } + + if (period) { + model.setType(_$$_REQUIRE(_dependencyMap[5]).IAPTecnaviaType.SUBSCRIPTION); + } + + _IAPHelper.default.requestIAP(model); + + case 14: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + } + + function completeTransaction(data, serverResultCallback) { + var productId, result; + return _regenerator.default.async(function completeTransaction$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + productId = data.productID; + _context5.next = 3; + return _regenerator.default.awrap(_IAPHelper.default.setServerCallback(serverResultCallback)); + + case 3: + _context5.next = 5; + return _regenerator.default.awrap(_IAPHelper.default.restoreTransactions(productId)); + + case 5: + result = _context5.sent; + return _context5.abrupt("return", injectRestoredTransactions(result)); + + case 7: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + } +},2334,[5,80,1934,730,731,1937,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _NewsmemoryManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _nativeOptionsPageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getNativeOptionsPage(), + Methods = _OptionalPackages$get.Methods, + Models = _OptionalPackages$get.Models; + + var NativeOptionsPageFallback = function (_React$Component) { + (0, _inherits2.default)(NativeOptionsPageFallback, _React$Component); + + var _super = _createSuper(NativeOptionsPageFallback); + + function NativeOptionsPageFallback(props) { + var _this; + + (0, _classCallCheck2.default)(this, NativeOptionsPageFallback); + _this = _super.call(this, props); + + _this._close = function (force) { + var _this$props = _this.props, + isNewspaperLoaded = _this$props.isNewspaperLoaded, + onClose = _this$props.onClose, + handleBackButton = _this$props.handleBackButton; + + if (force || typeof isNewspaperLoaded === "function" && isNewspaperLoaded()) { + _this.setState({ + visible: false + }); + + if (typeof onClose === "function") { + onClose(); + } + } else { + var initialRoute = _this.state.initialRoute; + + var _global$getRSSActiveP = global.getRSSActivePSetup(), + rssIsEnabled = _global$getRSSActiveP.rssIsEnabled; + + if (_this.currentRoute && !(_this.currentRoute instanceof Models.RouteEdition) && _this.currentRoute.getRoute() !== initialRoute) { + Methods.Navigation.navigateToHome(); + } else if (rssIsEnabled) { + _NavigationService.default.main.reset("RssNavigator"); + } else if (_$$_REQUIRE(_dependencyMap[20]).PaperSetupManager.isGenericAppConfigured()) { + _NavigationService.default.main.navigate("PublicationsPageScreen"); + } else if (typeof handleBackButton === "function") { + handleBackButton(); + } + } + }; + + _this._onLocal = function (_ref) { + var domain = _ref.domain, + getParams = _ref.getParams, + protocol = _ref.protocol; + + try { + _this._onMessage({ + type: domain, + content: (0, _extends2.default)({ + protocol: protocol + }, getParams) + }); + } catch (e) {} + }; + + _this._injectJavascript = function (js) { + try { + _this.fallbackOptRef.current.injectJavaScript("\n try{\n " + js + ";\n } catch(e){ \n console.debug(e.message); \n }\n "); + } catch (e) {} + }; + + _this._resolveAwaitPostMessage = function (key, method, payload) { + _this._injectJavascript("window.TaOptionsPage.awaitPostMessage('" + key + "', '" + method + "', '" + payload + "');"); + }; + + _this._iframeInjection = function (js) { + _this._injectJavascript("window.TaOptionsPage.iframeInjection(\"" + encodeURIComponent(js) + "\")"); + }; + + _this._onMessage = function _callee3(data) { + var type, asyncKey, content, savedIssues, result, jsCode, newsmemoryManager, _NativeOptionsPageUti, initialRoute, urlParams, mRoute, navigation, mIssue, _mIssue, js, callback, close, _js, _js2; + + return _regenerator.default.async(function _callee3$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + type = data.type, asyncKey = data.asyncKey, content = data.content; + + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.GET_SAVED_ISSUES)) { + _context3.next = 15; + break; + } + + _context3.prev = 3; + _context3.next = 6; + return _regenerator.default.awrap(_nativeOptionsPageUtils.default.getSavedIssues()); + + case 6: + savedIssues = _context3.sent; + + _this._resolveAwaitPostMessage(asyncKey, "resolve", JSON.stringify(savedIssues)); + + _context3.next = 13; + break; + + case 10: + _context3.prev = 10; + _context3.t0 = _context3["catch"](3); + + _this._resolveAwaitPostMessage(asyncKey, "reject", _context3.t0.message); + + case 13: + _context3.next = 146; + break; + + case 15: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.RETURN_FROM_LOGIN)) { + _context3.next = 23; + break; + } + + _context3.next = 18; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[22]).returnFromLogin)(content)); + + case 18: + result = _context3.sent; + + if (result && result.data) { + jsCode = "xcj_loginResults(" + result.TAUID + ",'" + JSON.stringify(result.data) + "');"; + } else { + jsCode = "xcj_loginResults(-1,'" + JSON.stringify({ + protError: _$$_REQUIRE(_dependencyMap[23]).PROT_ERROR.NOT_LOGGEDIN + }) + "');"; + } + + _this._iframeInjection(jsCode); + + _context3.next = 146; + break; + + case 23: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.LOGOUT)) { + _context3.next = 31; + break; + } + + _context3.next = 26; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[22]).logout)()); + + case 26: + newsmemoryManager = _this.props.newsmemoryManager; + _NativeOptionsPageUti = _nativeOptionsPageUtils.default.getStateFromTab(_$$_REQUIRE(_dependencyMap[21]).tabs.login, {}, newsmemoryManager), initialRoute = _NativeOptionsPageUti.initialRoute, urlParams = _NativeOptionsPageUti.params; + + _this.setState({ + initialRoute: initialRoute, + urlParams: urlParams + }); + + _context3.next = 146; + break; + + case 31: + if (!type.includes("ON_CLOSE")) { + _context3.next = 35; + break; + } + + _this._close(true); + + _context3.next = 146; + break; + + case 35: + if (!type.includes("ON_ERROR")) { + _context3.next = 38; + break; + } + + _context3.next = 146; + break; + + case 38: + if (!type.includes("ON_ROUTE_CHANGE")) { + _context3.next = 44; + break; + } + + mRoute = new Models.Route(); + mRoute.setRoute(content.route); + + _this._onRouteChange(mRoute); + + _context3.next = 146; + break; + + case 44: + if (!type.includes("ON_EXTERNAL_LINK_CLICK")) { + _context3.next = 48; + break; + } + + _tecnaviaPlatformUtils.default.openURL(content); + + _context3.next = 146; + break; + + case 48: + if (!type.includes("ON_ACTION_CLICK")) { + _context3.next = 59; + break; + } + + navigation = _this.props.navigation; + _context3.t1 = content; + _context3.next = _context3.t1 === _$$_REQUIRE(_dependencyMap[24]).ACTIONS.openOptionPageSettings.key ? 53 : _context3.t1 === _$$_REQUIRE(_dependencyMap[24]).ACTIONS.openOptionPagePublications.key ? 55 : 57; + break; + + case 53: + navigation.navigate("GeneralSettingsScreen", { + module: _$$_REQUIRE(_dependencyMap[25]).GeneralSettingsModules.EPAPER + }); + return _context3.abrupt("break", 57); + + case 55: + _NavigationService.default.main.navigate("PublicationsPageScreen"); + + return _context3.abrupt("break", 57); + + case 57: + _context3.next = 146; + break; + + case 59: + if (!(type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.INITPAGE_SET_NEWSPAPER_AND_READ) || type.includes("ON_ISSUE_PRESS"))) { + _context3.next = 68; + break; + } + + mIssue = new Models.Issue(); + mIssue.setMachine(content.machine); + mIssue.setPSetup(content.pSetup); + mIssue.setIssue(content.issue); + mIssue.setEdition(content.edition); + + _this._onIssuePress(mIssue); + + _context3.next = 146; + break; + + case 68: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.INITPAGE_SET_EXTERNAL_NEWSPAPER)) { + _context3.next = 77; + break; + } + + _mIssue = new Models.Issue(); + + _mIssue.setMachine(content.machine); + + _mIssue.setPSetup(content.pSetup); + + _mIssue.setIssue(content.issue); + + _mIssue.setEdition(content.edition); + + _this._onIssuePress(_mIssue); + + _context3.next = 146; + break; + + case 77: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.BUY)) { + _context3.next = 81; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[26]).buy)(content, function _callee(iapParams) { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", _this._iapSystemCallback(iapParams, type)); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }); + _context3.next = 146; + break; + + case 81: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.RESUME_TRANSACTIONS)) { + _context3.next = 85; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[26]).resumeTransaction)(); + _context3.next = 146; + break; + + case 85: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.FINISH_TRANSACTION)) { + _context3.next = 89; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[26]).finishTransaction)(); + _context3.next = 146; + break; + + case 89: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.RESTORE_COMPLETED_TRANSACTIONS)) { + _context3.next = 96; + break; + } + + _context3.next = 92; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[26]).completeTransaction)(content, function _callee2(iapParams) { + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + return _context2.abrupt("return", _this._iapSystemCallback(iapParams, type)); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + })); + + case 92: + js = _context3.sent; + + _this._iframeInjection(js); + + _context3.next = 146; + break; + + case 96: + if (!(type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.OPEN_BROWSER) || type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.OPEN_BROWSER_ALT))) { + _context3.next = 103; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[22]).openBrowser)(content); + callback = content.callback, close = content.close; + + if (callback) { + _this._iframeInjection(callback + "();"); + } + + if (close && close === "1") { + _this._close(true); + } + + _context3.next = 146; + break; + + case 103: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.ALERT)) { + _context3.next = 107; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[22]).showAlert)(content); + _context3.next = 146; + break; + + case 107: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.CONFIRM)) { + _context3.next = 111; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[22]).showConfirm)(content); + _context3.next = 146; + break; + + case 111: + if (!(type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.CLOSE) || type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.CLOSE_WINDOW))) { + _context3.next = 115; + break; + } + + _this._close(true); + + _context3.next = 146; + break; + + case 115: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.GO_BACK)) { + _context3.next = 119; + break; + } + + Methods.Navigation.navigateToHome(); + _context3.next = 146; + break; + + case 119: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.OPEN_RSS)) { + _context3.next = 123; + break; + } + + (0, _$$_REQUIRE(_dependencyMap[22]).goToRssNavigator)(); + _context3.next = 146; + break; + + case 123: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.OPEN_TAB_HOME)) { + _context3.next = 127; + break; + } + + Methods.Navigation.navigateToHome(); + _context3.next = 146; + break; + + case 127: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.OPEN_TAB_LOGIN)) { + _context3.next = 131; + break; + } + + Methods.Navigation.navigateToLogin(); + _context3.next = 146; + break; + + case 131: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.GET_KEY)) { + _context3.next = 138; + break; + } + + _context3.next = 134; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[22]).getKey)(data)); + + case 134: + _js = _context3.sent; + + _this._iframeInjection(_js); + + _context3.next = 146; + break; + + case 138: + if (!type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.SET_KEY)) { + _context3.next = 145; + break; + } + + _context3.next = 141; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[22]).setKey)(data)); + + case 141: + _js2 = _context3.sent; + + _this._iframeInjection(_js2); + + _context3.next = 146; + break; + + case 145: + if (type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.REMOVE_KEY)) { + (0, _$$_REQUIRE(_dependencyMap[22]).removeKey)(data); + } else if (type.includes(_$$_REQUIRE(_dependencyMap[21]).locals.SET_PREF_EDI)) { + (0, _$$_REQUIRE(_dependencyMap[22]).setPrefEdit)(data); + } else if (type.includes("LOG_ERR")) {} else if (type.includes("LOG_WARN")) {} else if (type.includes("LOG")) {} + + case 146: + _context3.next = 150; + break; + + case 148: + _context3.prev = 148; + _context3.t2 = _context3["catch"](0); + + case 150: + case "end": + return _context3.stop(); + } + } + }, null, null, [[0, 148], [3, 10]], Promise); + }; + + _this._iapSystemCallback = function _callee4(iapParams, local) { + var js; + return _regenerator.default.async(function _callee4$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _context4.next = 2; + return _regenerator.default.awrap((0, _$$_REQUIRE(_dependencyMap[26]).transactionResult)(iapParams)); + + case 2: + js = _context4.sent; + + _this._iframeInjection(js); + + return _context4.abrupt("return", true); + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + }; + + _this._onIssuePress = function _callee5(issue) { + var _global$getActivePSet, machine, paperDomain, external, _global$getActivePSet2, currentPSetup, _await$global$loadPSe, config; + + return _regenerator.default.async(function _callee5$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _global$getActivePSet = global.getActivePSetup(), machine = _global$getActivePSet.machine; + paperDomain = issue.getMachine() || machine; + external = false; + _global$getActivePSet2 = global.getActivePSetup(), currentPSetup = _global$getActivePSet2.pSetup; + _context5.next = 6; + return _regenerator.default.awrap(global.loadPSetup(issue.getPSetup(), paperDomain, {}, external)); + + case 6: + _await$global$loadPSe = _context5.sent; + config = _await$global$loadPSe.config; + + if (!config) { + _context5.next = 20; + break; + } + + _this._close(true); + + if (!(currentPSetup !== issue.getPSetup())) { + _context5.next = 17; + break; + } + + _context5.next = 13; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig()); + + case 13: + if (!external) { + _context5.next = 16; + break; + } + + _context5.next = 16; + return _regenerator.default.awrap(_GlobalConfig.default.initCustomFonts(config)); + + case 16: + Analytics.updateAnalyticsClientList(); + + case 17: + _$$_REQUIRE(_dependencyMap[27]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_EDITION, { + issue: issue.getIssue(), + edition: issue.getEdition() + }); + + _context5.next = 21; + break; + + case 20: + _$$_REQUIRE(_dependencyMap[28]).Toast.show(global.strings("err_download_psetup")); + + case 21: + case "end": + return _context5.stop(); + } + } + }, null, null, null, Promise); + }; + + _this._onRouteChange = function (route) { + _this.currentRoute = route; + }; + + _this._onError = function (error) {}; + + _this.state = { + visible: false, + initialRoute: "", + urlParams: {} + }; + _this.fallbackOptRef = _react.default.createRef(); + _this.close = _this._close.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(NativeOptionsPageFallback, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.openOptionsPageId = _$$_REQUIRE(_dependencyMap[27]).EventRegister.on(_events.default.OPEN_OPTIONSPAGE, function (params) { + var newsmemoryManager = _this2.props.newsmemoryManager; + var tab = params.tab, + getParams = params.getParams, + url = params.url, + closeType = params.closeType, + forceFullscreen = params.forceFullscreen, + hidden = params.hidden; + + try { + var _NativeOptionsPageUti2 = _nativeOptionsPageUtils.default.getStateFromTab(tab, getParams, newsmemoryManager), + initialRoute = _NativeOptionsPageUti2.initialRoute, + urlParams = _NativeOptionsPageUti2.params; + + _this2.setState({ + visible: true, + initialRoute: initialRoute, + urlParams: urlParams + }); + } catch (e) { + _$$_REQUIRE(_dependencyMap[28]).Toast.show(global.strings("system_error")); + + _this2.setState({ + visible: true + }); + } + }); + this.closeOptionsPageId = _$$_REQUIRE(_dependencyMap[27]).EventRegister.on(_events.default.CLOSE_OPTIONSPAGE, function () { + _this2.close(true); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[27]).EventRegister.rm(this.openOptionsPageId); + + _$$_REQUIRE(_dependencyMap[27]).EventRegister.rm(this.closeOptionsPageId); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + onOpen = _this$props2.onOpen, + url = _this$props2.url, + isNewspaperLoaded = _this$props2.isNewspaperLoaded, + onTabLoaded = _this$props2.onTabLoaded; + var _this$state = this.state, + visible = _this$state.visible, + initialRoute = _this$state.initialRoute, + urlParams = _this$state.urlParams; + + if (!visible) { + return null; + } + + if (typeof onOpen === "function") { + onOpen(); + } + + var _global$getActivePSet3 = global.getActivePSetup(), + pSetup = _global$getActivePSet3.pSetup, + machine = _global$getActivePSet3.machine, + overrideNewsMemoryUserAgent = _global$getActivePSet3.overrideNewsMemoryUserAgent; + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + var userAgent = overrideNewsMemoryUserAgent || _$$_REQUIRE(_dependencyMap[29]).PlatformUtils.getUserAgent(); + + var favoriteEdition = global.getNewsmemoryConfig().getFavEdiSync(); + var params = (0, _extends2.default)({ + pSetup: pSetup, + machine: machine, + supportColor: supportColor, + initialRoute: initialRoute, + isDebug: global.isDebug, + isGenericApp: _$$_REQUIRE(_dependencyMap[20]).PaperSetupManager.isGenericAppConfigured() ? 1 : 0, + hideCloseButton: typeof isNewspaperLoaded === "function" && isNewspaperLoaded(), + favoriteEdition: favoriteEdition + }, urlParams); + return _react.default.createElement(_reactNative.View, { + style: { + position: "absolute", + top: 0, + left: 0, + right: 0, + bottom: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[29]).colors.white + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[30]).BaseWebView, { + ref: this.fallbackOptRef, + source: { + uri: _$$_REQUIRE(_dependencyMap[29]).StringUtils.appendParams(url, params) + }, + onMessage: this.onMessage, + onLocal: this._onLocal, + userAgent: userAgent + })); + } + }]); + return NativeOptionsPageFallback; + }(_react.default.Component); + + NativeOptionsPageFallback.propTypes = { + url: _propTypes.default.string.isRequired, + onOpen: _propTypes.default.func, + onClose: _propTypes.default.func, + onTabLoaded: _propTypes.default.func, + handleBackButton: _propTypes.default.func, + isNewspaperLoaded: _propTypes.default.func, + newsmemoryManager: _propTypes.default.instanceOf(_NewsmemoryManager.default), + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }) + }; + + var _default = function _default(props) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[31]).useNavigation)(); + return _react.default.createElement(NativeOptionsPageFallback, (0, _extends2.default)({}, props, { + navigation: navigation + })); + }; + + exports.default = _default; +},2335,[5,80,6,7,8,15,12,14,16,17,201,28,1871,2318,460,2154,2332,1861,731,1876,1849,730,2333,2057,1725,2232,2334,572,1889,462,1894,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewsmemoryLayoutManager = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _newsmemoryFooterBarComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _searchComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _thumbnailComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _indexLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _pagesLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _NewspaperIssue = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[24])); + + var _EpaperLayoutConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _layoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + var _specialSectionComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[28])); + + var _NewspaperManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[29])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[30])); + + var _backgroundPages = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[31])); + + var _EPaperImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[32])); + + var _articleModeManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[33])); + + var _simulateAccessibilityAlert = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[34])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryLayoutManager = function (_Shortcut) { + (0, _inherits2.default)(NewsmemoryLayoutManager, _Shortcut); + + var _super = _createSuper(NewsmemoryLayoutManager); + + function NewsmemoryLayoutManager(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryLayoutManager); + _this = _super.call(this, props); + _this.indexLevel = 1; + _this.updateArticleInterface = false; + _this.onBackgroundRef = _this._onBackgroundRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMainLayout = _this._onMainLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticlePress = _this._onArticlePress.bind((0, _assertThisInitialized2.default)(_this)); + _this.openCurrentPageFirstArticle = _this._openCurrentPageFirstArticle.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageLongPress = _this._onPageLongPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageChange = _this._onPageChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPagesLoaded = _this._onPagesLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPagesUnmounted = _this._onPagesUnmounted.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageRangeChange = _this._onPageRangeChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScaleChange = _this._onScaleChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanChange = _this._onPanChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.isAccessibilityModeEnabled = _this._isAccessibilityModeEnabled.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexLevelChange = _this._onIndexLevelChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexOpenArticle = _this._onIndexOpenArticle.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexOpenSection = _this._onIndexOpenSection.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexOpenPage = _this._onIndexOpenPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexScrollToPage = _this._onIndexScrollToPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexClose = _this._onIndexClose.bind((0, _assertThisInitialized2.default)(_this)); + _this.onCloseAccessibility = _this._onCloseAccessibility.bind((0, _assertThisInitialized2.default)(_this)); + _this.onCloseCarMode = _this._onCloseCarMode.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleClose = _this._onArticleClose.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLogoPress = _this._onLogoPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleOpenIndex = _this._onArticleOpenIndex.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleOpenSearch = _this._onArticleOpenSearch.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleClearSearch = _this._onArticleClearSearch.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleToggleFullscreen = _this._onArticleToggleFullscreen.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleSelected = _this._onArticleSelected.bind((0, _assertThisInitialized2.default)(_this)); + _this.onThumbnailPress = _this._onThumbnailPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onThumbnailDownload = _this._onThumbnailDownload.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFooterItemPress = _this._onFooterItemPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.isFooterItemActive = _this._isFooterIconActive.bind((0, _assertThisInitialized2.default)(_this)); + _this.isFooterItemVisible = _this._isFooterItemVisible.bind((0, _assertThisInitialized2.default)(_this)); + _this.isFooterItemPresent = _this._isFooterItemPresent.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSearchClose = _this._onSearchClose.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSearchPress = _this._onSearchPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageLayoutRef = _this._onPageLayoutRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleLayoutRef = _this._onArticleLayoutRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexLayoutRef = _this._onIndexLayoutRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFooterLayoutRef = _this._onFooterLayoutRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.getCurrentArticle = _this._getCurrentArticle.bind((0, _assertThisInitialized2.default)(_this)); + _this.getCurrentPage = _this._getCurrentPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onUnFit = _this._onUnFit.bind((0, _assertThisInitialized2.default)(_this)); + _this.isReadModeEnabled = _this._isReadModeEnabled.bind((0, _assertThisInitialized2.default)(_this)); + _this.isTextModeOpen = _this._isTextModeOpen.bind((0, _assertThisInitialized2.default)(_this)); + _this.isLite = _this._isLite.bind((0, _assertThisInitialized2.default)(_this)); + _this.openBrowseMode = _this._openBrowseMode.bind((0, _assertThisInitialized2.default)(_this)); + _this.isSingleTapToZoomEnabled = _this._isSingleTapToZoomEnabled.bind((0, _assertThisInitialized2.default)(_this)); + _this.getNewspaperStatus = _this._getNewspaperStatus.bind((0, _assertThisInitialized2.default)(_this)); + _this.animateLayoutButtons = _this._animateLayoutButtons.bind((0, _assertThisInitialized2.default)(_this)); + _this.openThumbnail = _this._openThumbnail.bind((0, _assertThisInitialized2.default)(_this)); + + var isLandscape = _this.isLandscape(); + + var _global$getActivePSet = global.getActivePSetup(), + fixButtonsBarToBottom = _global$getActivePSet.fixButtonsBarToBottom; + + var fullscreen = _this._isArticleFullscreen(); + + _this.layoutFlexManager = new (_$$_REQUIRE(_dependencyMap[35]).LayoutFlexManager)(fullscreen, fixButtonsBarToBottom); + + _this.layoutFlexManager.setIsLite(_this.isLite()); + + _this.layoutFlexManager.setSize(_deviceUtils.default.getSafeArea()); + + _this.layoutFlexManager.setIsFooterAbsolute(_this._canHideFooter()); + + _this.isTablet = _$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTablet(); + _this.highlightEnabled = !_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isEInk(); + _this.currentArticle = undefined; + _this.articleSelectedTimer = undefined; + + var startInFitMode = _this._startInFitMode(isLandscape); + + _this.state = (0, _extends2.default)({ + isLandscape: isLandscape, + userFitModeKey: _this.getFitModeKey(startInFitMode), + fitPageHorizontally: startInFitMode, + tempFitPageHorizontally: startInFitMode + }, _this.layoutFlexManager.getStyles()); + return _this; + } + + (0, _createClass2.default)(NewsmemoryLayoutManager, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryLayoutManager.prototype), "componentDidMount", this).call(this); + this.onAccessibilityModeListener = _$$_REQUIRE(_dependencyMap[37]).EventRegister.on(_events.default.ON_ACCESSIBILITY_MODE_CHANGE, function (_ref) { + var enable = _ref.enable; + + _this2._openAccessibility(enable); + }); + this.configChangeListener = _$$_REQUIRE(_dependencyMap[37]).EventRegister.on(_events.default.NEWSMEMORY_CONFIG_CHANGE, function (_ref2) { + var previousConfig = _ref2.previousConfig; + + _this2.layoutFlexManager.setIsArticleFullscreen(_this2._isArticleFullscreen()); + + var prevIsFooterAbsolute = _this2.layoutFlexManager.isFooterAbsolute; + + var isFooterAbsolute = _this2._canHideFooter(); + + _this2.layoutFlexManager.setIsFooterAbsolute(isFooterAbsolute); + + var prevTwoFingersTapToArticle = previousConfig.twoFingersTapToArticle, + prevReadModeEnabled = previousConfig.readModeEnabled, + prevSingleTapToZoom = previousConfig.singleTapToZoom; + var newsmemoryConfig = global.getNewsmemoryConfig(); + var twoFingersTapToArticle = newsmemoryConfig.twoFingersTapToArticle, + readModeEnabled = newsmemoryConfig.readModeEnabled, + singleTapToZoom = newsmemoryConfig.singleTapToZoom; + var isZoomTapBehaviorChanged = prevSingleTapToZoom !== singleTapToZoom; + var isFooterAbsoluteChanged = isFooterAbsolute !== prevIsFooterAbsolute; + var updateLayout = false; + var isTwoFingersChanged = twoFingersTapToArticle !== prevTwoFingersTapToArticle; + + if (_this2._canEnableReadMode()) { + var isEpaperModeChanged = readModeEnabled !== prevReadModeEnabled; + + if (isTwoFingersChanged) { + if (twoFingersTapToArticle) { + if (_this2.layoutFlexManager.isBrowse() && readModeEnabled) { + updateLayout = true; + + _this2._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openRead.key + }, { + maintainFit: true + }); + } + } else { + newsmemoryConfig.setReadMode(false); + + if (_this2.layoutFlexManager.isRead()) { + updateLayout = true; + + _this2._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openBrowse.key + }); + } + } + } + + if (isEpaperModeChanged && twoFingersTapToArticle) { + if (readModeEnabled) { + var isLandscape = _this2.isLandscape(); + + if (isLandscape) { + if (!_this2.layoutFlexManager.isIndex()) { + _this2.indexLevel = 1; + + _this2.layoutFlexManager.openIndex(); + + updateLayout = true; + + _this2.setState((0, _extends2.default)({ + fitPageHorizontally: false, + tempFitPageHorizontally: false + }, _this2.layoutFlexManager.getStyles())); + } + } else if (!_this2.layoutFlexManager.isRead()) { + updateLayout = true; + + _this2._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openRead.key + }); + } + } else if (!_this2.layoutFlexManager.isBrowse()) { + updateLayout = true; + + _this2._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSwipe.key + }); + } + } + } else if (isTwoFingersChanged && prevReadModeEnabled && _this2.layoutFlexManager.isRead()) { + _this2._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openBrowse.key + }); + } + + if (!updateLayout && isZoomTapBehaviorChanged && isFooterAbsoluteChanged) { + _this2.setState((0, _extends2.default)({}, _this2.layoutFlexManager.getStyles())); + } + }); + this.orientationEventId = _$$_REQUIRE(_dependencyMap[37]).EventRegister.on(_events.default.ON_ORIENTATION_CHANGE, function (_ref3) { + var orientation = _ref3.orientation; + var previousLandscape = _this2.state.isLandscape; + + var isLandscape = _this2.isLandscape(); + + var oldSize = _this2.layoutFlexManager.getSize(); + + var newSize = _deviceUtils.default.getSafeArea(); + + if (previousLandscape !== isLandscape) { + _this2.layoutFlexManager.setChangingOrientation(true); + } + + if (!_$$_REQUIRE(_dependencyMap[36]).JSUtils.areEqualShallow(oldSize, newSize)) { + _this2.layoutFlexManager.setSize(newSize); + } + + var currentNewspaperManager = _this2.props.currentNewspaperManager; + + var _global$getActivePSet2 = global.getActivePSetup(), + enableVmodeAndFitOrientation = _global$getActivePSet2.enableVmodeAndFitOrientation; + + var fullscreen = _this2._isArticleFullscreen(); + + _this2.layoutFlexManager.setIsArticleFullscreen(fullscreen); + + _this2.layoutFlexManager.setIsLandscape(isLandscape); + + _this2.layoutFlexManager.setIsFooterAbsolute(_this2._canHideFooter()); + + var tempFitPageHorizontally = !_this2.isTextModeOpen() && _this2._startInFitMode(isLandscape); + + if (!_this2._canEnableReadMode() && !_this2.isLite() && enableVmodeAndFitOrientation && _this2.isTablet) { + var _currentNewspaperMana = currentNewspaperManager.getStatus(), + lastArticleId = _currentNewspaperMana.lastArticleId; + + if (isLandscape && (_this2.layoutFlexManager.isBrowse() || _this2.layoutFlexManager.isRead() || _this2.layoutFlexManager.isArticle() && !lastArticleId)) { + _this2.layoutFlexManager.openIndex(); + } else if (!isLandscape && !_this2.layoutFlexManager.isBrowse()) { + if (_this2.layoutFlexManager.isIndex() || !lastArticleId) { + _this2.layoutFlexManager.openBrowse(); + } + } + } + + try { + if (currentNewspaperManager) { + var currentNewspaper = currentNewspaperManager.getCurrentNewspaper(); + + if (currentNewspaper) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryRotateEvent)(orientation, currentNewspaper.getEditionModel()); + } + } + } catch (e) {} + + _this2.setState((0, _extends2.default)({ + isLandscape: isLandscape, + fitPageHorizontally: _this2._startInFitMode(isLandscape), + tempFitPageHorizontally: tempFitPageHorizontally + }, _this2.layoutFlexManager.getStyles())); + }); + this.onExtraGoToPagePress = _$$_REQUIRE(_dependencyMap[37]).EventRegister.on(_events.default.NEWSMEMORY_ON_EXTRA_GO_TO_PAGE_PRESS, function (_ref4) { + var pageNumber = _ref4.page; + + var page = _this2._getPageByNumber(pageNumber); + + if (page) { + var pageId = page.getPageId(); + + if (_this2.pageLayoutManager && !_this2._isTextModeOpen()) { + _this2.pageLayoutManager.navigateToPage(pageId); + } else { + _this2.setCurrentPageId(pageId); + + _this2._openBrowseMode(); + } + } + }); + this.onArticleJump = _$$_REQUIRE(_dependencyMap[37]).EventRegister.on(_events.default.NEWSMEMORY_ARTICLE_JUMP, function (_ref5) { + var page = _ref5.page, + issue = _ref5.issue, + filename = _ref5.filename, + xmlId = _ref5.xmlId; + + _this2._goToArticle(page, issue, filename, xmlId); + }); + + var _global$getActivePSet3 = global.getActivePSetup(), + enableVmodeAndFitOrientation = _global$getActivePSet3.enableVmodeAndFitOrientation; + + var lastArticle = this._getCurrentArticle(); + + if (lastArticle) { + this.layoutFlexManager.openArticle(); + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles(), { + tempFitPageHorizontally: false + })); + } else if (!enableVmodeAndFitOrientation && this._shouldEnableReadMode()) { + this.layoutFlexManager.openArticle(true); + } + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + this.layoutFlexManager.setIsLite(this.isLite()); + } + }, { + key: "UNSAFE_componentWillUpdate", + value: function UNSAFE_componentWillUpdate(nextProps, nextState) { + if (!nextState.fitPageHorizontally) { + this.clickArticleEvent = undefined; + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this.event = undefined; + + if (!this.layoutFlexManager.isArticle()) { + this.clickArticleEvent = undefined; + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryLayoutManager.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[37]).EventRegister.rm(this.configChangeListener); + + _$$_REQUIRE(_dependencyMap[37]).EventRegister.rm(this.orientationEventId); + + _$$_REQUIRE(_dependencyMap[37]).EventRegister.rm(this.onExtraGoToPagePress); + + _$$_REQUIRE(_dependencyMap[37]).EventRegister.rm(this.onArticleCloseEvent); + + _$$_REQUIRE(_dependencyMap[37]).EventRegister.rm(this.onArticleJump); + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var _this3 = this; + + var OPEN = _$$_REQUIRE(_dependencyMap[40]).KEY_GROUPS.OPEN; + + var shortcuts = [{ + callback: function callback() { + _this3._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openAccessibility.key + }); + }, + keys: ["T"] + }]; + + if (!this._isAccessibilityModeEnabled()) { + shortcuts.push({ + callback: this.openBrowseMode, + keys: ["B"] + }); + shortcuts.push({ + callback: function callback() { + _this3._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSearch.key + }); + }, + keys: ["SEARCH"] + }); + shortcuts.push({ + callback: function callback() { + _this3._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openIndex.key + }, { + fromFooter: true + }); + }, + keys: ["I"] + }); + shortcuts.push({ + callback: this.openThumbnail, + keys: ["NUMPAD_DOT", "P", "ESCAPE"] + }); + shortcuts.push({ + callback: function callback() { + _this3._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.fitPageToggle.key + }, { + fromFooter: true + }); + }, + keys: ["SPACE"] + }); + shortcuts.push({ + callback: this.openCurrentPageFirstArticle, + keys: OPEN + }); + } + + return shortcuts; + } + }, { + key: "_getFirstPageWidthScreenRatio", + value: function _getFirstPageWidthScreenRatio() { + var ratio = 0; + + var edition = this._getCurrentEdition(); + + if (edition) { + var firstPage = edition.getFirstPage(); + var size = this.layoutFlexManager.getBrowseSize(); + + var pageSize = _newsmemoryUtils.default.getPageViewSize(firstPage, size, false, 1); + + if (pageSize) { + var scaledWidth = pageSize.scaledWidth; + ratio = scaledWidth / size.width; + } + } + + return ratio; + } + }, { + key: "_startInFitMode", + value: function _startInFitMode(isLandscape) { + var _global$getActivePSet4 = global.getActivePSetup(), + enableVmodeAndFitOrientation = _global$getActivePSet4.enableVmodeAndFitOrientation, + fitPageType = _global$getActivePSet4.fitPageType; + + if (this._canEnableReadMode()) { + var _global$getNewsmemory = global.getNewsmemoryConfig(), + readModeEnabled = _global$getNewsmemory.readModeEnabled; + + if (!readModeEnabled) { + return true; + } + + if (!isLandscape && this._getNumberOfPagesByOrientation() === 1) { + var ratio = this._getFirstPageWidthScreenRatio(); + + return ratio > 0 && ratio < 0.8; + } + + return false; + } + + if (enableVmodeAndFitOrientation) { + return isLandscape ? false : Boolean(fitPageType & 2 && fitPageType & 1); + } + + return Boolean((isLandscape ? fitPageType & 4 : fitPageType & 2) && fitPageType & 1); + } + }, { + key: "_getCurrentArticle", + value: function _getCurrentArticle() { + var lastArticle; + var currentNewspaperManager = this.props.currentNewspaperManager; + + if (currentNewspaperManager) { + var _currentNewspaperMana2 = currentNewspaperManager.getStatus(), + lastArticleId = _currentNewspaperMana2.lastArticleId; + + if (lastArticleId) { + var _decodeArticleId = (0, _$$_REQUIRE(_dependencyMap[41]).decodeArticleId)(lastArticleId), + pageId = _decodeArticleId.pageId, + xmlId = _decodeArticleId.xmlId; + + var edition = this._getCurrentEdition(); + + if (edition) { + lastArticle = _newsmemoryUtils.default.getAllArticles(edition).find(function (article) { + return article.getPageId() === pageId && article.getXmlId() === xmlId; + }); + } + } + } + + return this.currentArticle || lastArticle; + } + }, { + key: "_getPageByNumber", + value: function _getPageByNumber(pageNumber) { + var edition = this._getCurrentEdition(); + + if (edition) { + var page = _pageUtils.default.getPageByPageNumber(edition.getPages(), pageNumber); + + return page; + } + + return null; + } + }, { + key: "_goToArticle", + value: function _goToArticle(pageNumber, issue, filename, xmlId) { + var _this4 = this; + + var edition = this._getCurrentEdition(); + + if (edition) { + var found = _newsmemoryUtils.default.getAllArticles(edition).find(function (article) { + var page = _this4._getPageByNumber(pageNumber); + + if (page) { + return article.getPageId() === page.getPageId() && article.getXmlId() === parseInt(xmlId, 10); + } + + return false; + }); + + if (found) { + this._onIndexOpenArticle(found); + } + } + } + }, { + key: "handleBack", + value: function handleBack() { + if (this.layoutFlexManager.isIndex()) { + var latestLayout = this.layoutFlexManager.getLatestLayout(); + + if (latestLayout === _$$_REQUIRE(_dependencyMap[35]).LAYOUTS.ARTICLE.key) { + if (!this._isIndexSecondLevel()) { + var edition = this._getCurrentEdition(); + + if (!_newsmemoryUtils.default.oneLevelIndex(edition)) { + this.indexLevel = 2; + } + + this.setState((0, _extends2.default)({ + tempFitPageHorizontally: false + }, this.layoutFlexManager.getStyles())); + return true; + } + } else { + if (this._isIndexSecondLevel() && this.indexLayoutRef) { + this.indexLayoutRef._onSwipeDown(); + + return true; + } + } + } + + var previousLayout = this.layoutFlexManager.popPreviousLayout(); + + if (previousLayout) { + this.layoutFlexManager.layout = previousLayout; + + var startInFitMode = this._startInFitMode(this.isLandscape()); + + this.setState((0, _extends2.default)({ + tempFitPageHorizontally: previousLayout.key === _$$_REQUIRE(_dependencyMap[35]).LAYOUTS.BROWSE.key ? startInFitMode : false + }, this.layoutFlexManager.getStyles())); + return true; + } + + return false; + } + }, { + key: "clearLastArticleFromStatus", + value: function clearLastArticleFromStatus() { + var currentNewspaperManager = this.props.currentNewspaperManager; + + if (currentNewspaperManager) { + currentNewspaperManager.getStatus().resetLastArticleId(); + } + } + }, { + key: "resetCurrentArticle", + value: function resetCurrentArticle() { + this.clearLastArticleFromStatus(); + this.currentArticle = undefined; + this.clickArticleEvent = undefined; + } + }, { + key: "resetCurrentPageId", + value: function resetCurrentPageId() { + this.currentPageId = undefined; + } + }, { + key: "setCurrentPageId", + value: function setCurrentPageId(pageId) { + global.getNewsmemoryConfig().setLastOperationTimestamp(); + + if (this.currentPageId !== pageId) { + if (this.layoutFlexManager.isBrowseVisible()) { + if (this.pageLayoutManager) { + this.pageLayoutManager.navigateToPage(pageId); + } + } + + this.currentPageId = pageId; + var currentNewspaperManager = this.props.currentNewspaperManager; + + if (currentNewspaperManager) { + currentNewspaperManager.setCurrentPage(this.currentPageId); + } + } + } + }, { + key: "getCurrentPageId", + value: function getCurrentPageId() { + var currentNewspaperManager = this.props.currentNewspaperManager; + + var edition = this._getCurrentEdition(); + + if (edition) { + var lastPage = edition.getFirstPage(); + + var _currentNewspaperMana3 = currentNewspaperManager.getStatus(), + lastPageNumber = _currentNewspaperMana3.lastPageNumber; + + if (lastPageNumber) { + var lastPageViewed = _pageUtils.default.getPageByPageNumber(edition.getPages(), lastPageNumber); + + if (lastPageViewed) { + lastPage = lastPageViewed; + } + } + + if (this.currentPageId) { + return this.currentPageId; + } + + if (lastPage) { + return lastPage.getPageId(); + } + } + + return this.currentPageId; + } + }, { + key: "isLandscape", + value: function isLandscape() { + return !_deviceUtils.default.isPortrait(); + } + }, { + key: "getFitModeKey", + value: function getFitModeKey(fitMode) { + return "landscape_" + this.isLandscape() + "_fit_" + fitMode; + } + }, { + key: "reset", + value: function reset() { + this.layoutFlexManager.reset(); + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles())); + } + }, { + key: "_onPageLayoutRef", + value: function _onPageLayoutRef(ref) { + this.pageLayoutManager = ref; + } + }, { + key: "_onArticleLayoutRef", + value: function _onArticleLayoutRef(ref) { + this.articleLayoutManager = ref; + } + }, { + key: "_onIndexLayoutRef", + value: function _onIndexLayoutRef(ref) { + this.indexLayoutRef = ref; + } + }, { + key: "_onFooterLayoutRef", + value: function _onFooterLayoutRef(ref) { + this.footerLayoutRef = ref; + } + }, { + key: "_getIndexTitle", + value: function _getIndexTitle() { + var edition = this._getCurrentEdition(); + + if (edition) { + return _newsmemoryUtils.default.getFormattedIssue(edition.getIssue()); + } + + return ""; + } + }, { + key: "_isLite", + value: function _isLite() { + var currentNewspaperManager = this.props.currentNewspaperManager; + return _newsmemoryUtils.default.isLite(currentNewspaperManager); + } + }, { + key: "_isSingleTapToZoomEnabled", + value: function _isSingleTapToZoomEnabled() { + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + singleTapToZoom = _global$getNewsmemory2.singleTapToZoom; + + if (this.isLite()) { + return true; + } + + if (this._isReadModeEnabled()) { + return false; + } + + return singleTapToZoom && !this._isTextModeOpen(); + } + }, { + key: "_canHideFooter", + value: function _canHideFooter() { + var _global$getActivePSet5 = global.getActivePSetup(), + animateLayoutFooter = _global$getActivePSet5.animateLayoutFooter; + + return animateLayoutFooter && this._canEnableReadMode() && !this._isSingleTapToZoomEnabled(); + } + }, { + key: "_canEnableReadMode", + value: function _canEnableReadMode() { + var currentNewspaperManager = this.props.currentNewspaperManager; + return _newsmemoryUtils.default.canEnableReadMode(currentNewspaperManager); + } + }, { + key: "_shouldEnableReadMode", + value: function _shouldEnableReadMode() { + var _global$getNewsmemory3 = global.getNewsmemoryConfig(), + readModeEnabled = _global$getNewsmemory3.readModeEnabled; + + return this._canEnableReadMode() && readModeEnabled; + } + }, { + key: "_shouldEnableBrowseMode", + value: function _shouldEnableBrowseMode() { + var canEnableReadMode = this._canEnableReadMode(); + + var _global$getNewsmemory4 = global.getNewsmemoryConfig(), + readModeEnabled = _global$getNewsmemory4.readModeEnabled; + + return canEnableReadMode && !readModeEnabled; + } + }, { + key: "_onFooterItemPress", + value: function _onFooterItemPress(item) { + this._onItemPress(item, { + fromFooter: true + }); + } + }, { + key: "_openThumbnail", + value: function _openThumbnail() { + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openThumbnail.key + }); + } + }, { + key: "_toggleVoiceManager", + value: function _toggleVoiceManager(start) { + var mgr = global.getAudio(); + + if (mgr) { + if (start) { + mgr.srStart(true); + } else { + mgr.srStop(); + } + } + } + }, { + key: "_openCloseCarMode", + value: function _openCloseCarMode(open) { + if (global.getMainPSetup().useCarMode) { + this._toggleVoiceManager(open); + + if (!open) { + this.layoutFlexManager.setCarModeEnabled(false); + this.layoutFlexManager.reset(); + } else { + this.layoutFlexManager.setCarModeEnabled(true); + this.layoutFlexManager.openCarMode(); + } + + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles())); + } + } + }, { + key: "_openAccessibility", + value: function _openAccessibility(open) { + var _this5 = this; + + if (global.getMainPSetup().useNativeAccessibility) { + if (!open) { + this._toggleVoiceManager(false); + + this.layoutFlexManager.setAccessibilityModeEnabled(false); + this.layoutFlexManager.reset(); + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles())); + } else { + this.indexLevel = 1; + + if (!_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isSystemAccessibilityEnabled()) { + _simulateAccessibilityAlert.default.show({ + onConfirm: function onConfirm() { + _this5.layoutFlexManager.setAccessibilityModeEnabled(true); + + _this5.layoutFlexManager.openAccessibility(); + + _this5.setState((0, _extends2.default)({}, _this5.layoutFlexManager.getStyles())); + } + }); + } else { + this.layoutFlexManager.setAccessibilityModeEnabled(true); + this.layoutFlexManager.openAccessibility(); + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles())); + } + } + } else { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[42]).tabs.accessibility, + hidden: true + }); + } + } + }, { + key: "_onItemPress", + value: function _onItemPress(item) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _this$state = this.state, + fitPageHorizontally = _this$state.fitPageHorizontally, + userFitModeKey = _this$state.userFitModeKey; + var newsmemoryConfig = global.getNewsmemoryConfig(); + newsmemoryConfig.setLastOperationTimestamp(); + + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_PAUSE_HIGH_RES_QUEUE); + + if (!(this.layoutFlexManager.isArticle() && item.action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSearch.key) && !(this.layoutFlexManager.isSearch() && item.action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openArticle.key)) { + this.searchedTerm = undefined; + } + + var _config$maintainFit = config.maintainFit, + maintainFit = _config$maintainFit === undefined ? false : _config$maintainFit, + _config$fromFooter = config.fromFooter, + fromFooter = _config$fromFooter === undefined ? false : _config$fromFooter, + _config$stateCallback = config.stateCallback, + stateCallback = _config$stateCallback === undefined ? function () {} : _config$stateCallback; + var startInFitMode = false; + + switch (item.action) { + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openCarMode.key: + this._openCloseCarMode(true); + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openOptionPageAccessibility.key: + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openAccessibility.key: + this._openAccessibility(true); + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openOptionPageEditions.key: + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_OPEN_OFFLINE_EDITION_MENU); + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openRead.key: + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_RESET_NAVIGATION_BUTTONS_POSITION, { + enabled: true + }); + + this.clearLastArticleFromStatus(); + this.layoutFlexManager.openArticle(true); + newsmemoryConfig.setReadMode(true); + + if (maintainFit) { + this.setState((0, _extends2.default)({ + tempFitPageHorizontally: fitPageHorizontally + }, this.layoutFlexManager.getStyles()), stateCallback); + } else { + startInFitMode = this._startInFitMode(this.isLandscape()); + this.setState((0, _extends2.default)({ + fitPageHorizontally: startInFitMode, + tempFitPageHorizontally: startInFitMode + }, this.layoutFlexManager.getStyles()), stateCallback); + } + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSwipe.key: + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_RESET_NAVIGATION_BUTTONS_POSITION, { + enabled: false + }); + + this.clearLastArticleFromStatus(); + this.layoutFlexManager.openBrowse(); + this.layoutFlexManager.setIsFooterAbsolute(this._canHideFooter()); + newsmemoryConfig.setReadMode(false); + startInFitMode = this._startInFitMode(this.isLandscape()); + this.setState((0, _extends2.default)({ + fitPageHorizontally: startInFitMode, + tempFitPageHorizontally: startInFitMode + }, this.layoutFlexManager.getStyles()), stateCallback); + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openBrowse.key: + this.clearLastArticleFromStatus(); + this.layoutFlexManager.openBrowse(); + startInFitMode = this._startInFitMode(this.isLandscape()); + var userFitModeChanged = this.getFitModeKey(fitPageHorizontally) === userFitModeKey; + this.setState((0, _extends2.default)({ + fitPageHorizontally: userFitModeChanged ? fitPageHorizontally : startInFitMode, + tempFitPageHorizontally: userFitModeChanged ? fitPageHorizontally : startInFitMode + }, this.layoutFlexManager.getStyles()), stateCallback); + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openArticle.key: + if (!this.isLite()) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_RESUME_HIGH_RES_QUEUE); + + if (!this.layoutFlexManager.isArticle() || this.clearingSearch) { + this.clearingSearch = false; + this.layoutFlexManager.openArticle(); + this.setState((0, _extends2.default)({ + tempFitPageHorizontally: false + }, this.layoutFlexManager.getStyles()), stateCallback); + } else if (this.articleLayoutManager) { + this.articleLayoutManager.update(); + } + } + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openIndex.key: + this.indexLevel = 1; + + if (!fromFooter) { + this.indexLevel = this.layoutFlexManager.isArticle() ? 2 : 1; + } + + this.layoutFlexManager.openIndex(); + this.setState((0, _extends2.default)({ + tempFitPageHorizontally: false + }, this.layoutFlexManager.getStyles()), stateCallback); + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openThumbnail.key: + this.layoutFlexManager.openThumbnail(); + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles()), stateCallback); + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSearch.key: + this.layoutFlexManager.openSearch(); + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles()), stateCallback); + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.nextArticle.key: + if (this.layoutFlexManager.isArticle() && this.articleLayoutManager) { + this.articleLayoutManager.goNext(); + } else if (this.layoutFlexManager.isIndex() && this.indexLayoutRef && this._isIndexSecondLevel()) { + this.indexLayoutRef.goToNextSection(); + } + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.previousArticle.key: + if (this.layoutFlexManager.isArticle() && this.articleLayoutManager) { + this.articleLayoutManager.goPrev(); + } else if (this.layoutFlexManager.isIndex() && this.indexLayoutRef && this._isIndexSecondLevel()) { + this.indexLayoutRef.goToPreviousSection(); + } + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openIndexAlt.key: + if (this.layoutFlexManager.isArticle()) { + this.layoutFlexManager.openIndex(); + + var _global$getNewsmemory5 = global.getNewsmemoryConfig(), + enableTabIndexMode = _global$getNewsmemory5.enableTabIndexMode; + + if (!enableTabIndexMode) { + var edition = this._getCurrentEdition(); + + if (!_newsmemoryUtils.default.oneLevelIndex(edition)) { + this.indexLevel = 2; + } + } + + this.setState((0, _extends2.default)({ + tempFitPageHorizontally: false + }, this.layoutFlexManager.getStyles()), stateCallback); + } else if (this.layoutFlexManager.isIndex()) { + if (this.indexLayoutRef) { + this.indexLayoutRef.goToTop(); + } + } + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.shareAlt.key: + if (this.articleLayoutManager) { + this.articleLayoutManager.share(); + } + + break; + + case _$$_REQUIRE(_dependencyMap[38]).ACTIONS.fitPageToggle.key: + if (this._shouldEnableReadMode()) { + this.layoutFlexManager.openArticle(true); + } else { + this.layoutFlexManager.openBrowse(); + } + + this.setState((0, _extends2.default)({ + fitPageHorizontally: !fitPageHorizontally, + tempFitPageHorizontally: !fitPageHorizontally, + userFitModeKey: this.getFitModeKey(!fitPageHorizontally) + }, this.layoutFlexManager.getStyles()), stateCallback); + break; + } + } + }, { + key: "_openEditions", + value: function _openEditions() { + var _global$getActivePSet6 = global.getActivePSetup(), + showNativeOptionsPage = _global$getActivePSet6.showNativeOptionsPage, + showNativeOptionsPageFallbackUrl = _global$getActivePSet6.showNativeOptionsPageFallbackUrl; + + if (_$$_REQUIRE(_dependencyMap[36]).NetworkUtils.isOnline() || showNativeOptionsPage && !showNativeOptionsPageFallbackUrl) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[42]).tabs.home + }); + } else { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_OPEN_OFFLINE_EDITION_MENU); + } + } + }, { + key: "_onUnFit", + value: function _onUnFit(gesture) { + var fitPageHorizontally = this.state.fitPageHorizontally; + + if (fitPageHorizontally) { + if (this._shouldEnableReadMode()) { + this.layoutFlexManager.openArticle(true); + } else { + this.layoutFlexManager.openBrowse(); + } + + this.setState((0, _extends2.default)({ + fitPageHorizontally: false, + tempFitPageHorizontally: false + }, this.layoutFlexManager.getStyles())); + } + } + }, { + key: "_isIndexSecondLevel", + value: function _isIndexSecondLevel() { + return this.indexLevel === 2; + } + }, { + key: "_shouldShowFitButton", + value: function _shouldShowFitButton() { + var _global$getActivePSet7 = global.getActivePSetup(), + enableVmodeAndFitOrientation = _global$getActivePSet7.enableVmodeAndFitOrientation, + fitPageType = _global$getActivePSet7.fitPageType; + + var fullscreen = this._isArticleFullscreen() && this.isTextModeOpen(); + var hideFit = fullscreen || this.layoutFlexManager.isThumbnail(); + + if (hideFit) { + return false; + } + + if (!this.isTextModeOpen()) { + var numberOfShowedPages = this._getNumberOfPagesToShow(); + + if (numberOfShowedPages === 1) { + var ratio = this._getFirstPageWidthScreenRatio(); + + hideFit = ratio >= 0.95; + } + } + + return !hideFit && (enableVmodeAndFitOrientation || fitPageType === 1 || this.isLandscape() && fitPageType & 4 || !this.isLandscape() && fitPageType & 2); + } + }, { + key: "_isFooterItemPresent", + value: function _isFooterItemPresent(icon) { + var action = icon.action; + + if (_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTablet()) { + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openRead.key || action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSwipe.key) { + return this._canEnableReadMode(); + } + } else { + var _global$getRSSActiveP = global.getRSSActivePSetup(), + rssIsEnabled = _global$getRSSActiveP.rssIsEnabled; + + var isTextModeOpen = this.isTextModeOpen(); + + var fitButton = action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.fitPageToggle.key; + + var graphButtonInGraphMode = !isTextModeOpen && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openBrowse.key; + + var needsLiveNewsButton = rssIsEnabled || global.TaAddonNeedsCloseButton(); + + if (fitButton || graphButtonInGraphMode) { + var _global$getEpaperLayo = global.getEpaperLayoutConfig(), + mainFooter = _global$getEpaperLayo.mainFooter; + + var editionsButtonPresent = false; + var fitButtonPresent = false; + + if (!isTextModeOpen && mainFooter) { + editionsButtonPresent = !!mainFooter.buttons.find(function (footerIcon) { + return footerIcon.action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openOptionPageEditions.key; + }); + fitButtonPresent = !!mainFooter.buttons.find(function (footerIcon) { + return footerIcon.action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.fitPageToggle.key; + }); + } + + if (!needsLiveNewsButton && !editionsButtonPresent) { + return true; + } + + var shouldShowFitButton = this._shouldShowFitButton(); + + if (fitButton) { + return shouldShowFitButton; + } + + if (needsLiveNewsButton) { + if (fitButtonPresent) { + return !shouldShowFitButton; + } + + return !editionsButtonPresent; + } + + return !editionsButtonPresent || !fitButtonPresent || !shouldShowFitButton; + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openLiveNews.key) { + return needsLiveNewsButton; + } + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.showWith.key) { + return this._isFooterItemPresent({ + action: icon.actionValue + }); + } + + return true; + } + }, { + key: "_isFooterItemVisible", + value: function _isFooterItemVisible(icon) { + var action = icon.action; + + var _global$getActivePSet8 = global.getActivePSetup(), + protectSite = _global$getActivePSet8.protectSite, + enableShare = _global$getActivePSet8.enableShare; + + var _global$getRSSActiveP2 = global.getRSSActivePSetup(), + rssIsEnabled = _global$getRSSActiveP2.rssIsEnabled; + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openBrowse.key) { + return !this._canEnableReadMode(); + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSpecialSections.key) { + var edition = this._getCurrentEdition(); + + var editionHasSpecialSections = edition ? edition.hasSpecialSections : false; + return editionHasSpecialSections; + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openLiveNews.key) { + return rssIsEnabled || global.TaAddonNeedsCloseButton(); + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSearch.key || action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openIndex.key) { + return !this.isLite(); + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.fitPageToggle.key) { + return this._shouldShowFitButton(); + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.downloadEdition.key) { + var currentNewspaperManager = this.props.currentNewspaperManager; + + if (currentNewspaperManager && currentNewspaperManager.getCurrentNewspaper()) { + var dbStatus = currentNewspaperManager.getCurrentNewspaper().getStatus(); + return dbStatus < _NewspaperIssue.DBStatus.HIGH_RES_DOWNLOADED; + } + + return false; + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.nextArticle.key) { + if (this.layoutFlexManager.isIndex() && !this._isIndexSecondLevel()) { + return false; + } + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.previousArticle.key) { + if (this.layoutFlexManager.isIndex() && !this._isIndexSecondLevel()) { + return false; + } + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.shareAlt.key) { + return enableShare && !this.layoutFlexManager.isIndex(); + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openOptionPageLogin.key) { + return protectSite > 0; + } + + var isGenericApp = _$$_REQUIRE(_dependencyMap[43]).PaperSetupManager.isGenericAppConfigured(); + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openOptionPagePublications.key) { + return isGenericApp; + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openStore.key) { + return !isGenericApp; + } + + return true; + } + }, { + key: "_isFooterIconActive", + value: function _isFooterIconActive(icon) { + var action = icon.action; + var fitPageHorizontally = this.state.fitPageHorizontally; + + if (this._shouldEnableReadMode() && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openRead.key) { + return true; + } + + if (this._shouldEnableBrowseMode() && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSwipe.key) { + return true; + } + + if (this.layoutFlexManager.isBrowse() && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openBrowse.key) { + return true; + } + + var canEnableReadMode = this._canEnableReadMode(); + + if (this.layoutFlexManager.isIndex() && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openIndex.key) { + return !canEnableReadMode; + } + + var isArticleModeIconActive = this.layoutFlexManager.isArticle(); + + if (isArticleModeIconActive && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openIndex.key) { + return !canEnableReadMode; + } + + if (this.layoutFlexManager.isThumbnail() && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openThumbnail.key) { + return true; + } + + if (this.layoutFlexManager.isSearch() && action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSearch.key) { + return true; + } + + if (action === _$$_REQUIRE(_dependencyMap[38]).ACTIONS.fitPageToggle.key && fitPageHorizontally) { + return true; + } + + return false; + } + }, { + key: "_getCurrentNewspaper", + value: function _getCurrentNewspaper() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + var currentNewspaperManager = props.currentNewspaperManager; + + if (currentNewspaperManager) { + return currentNewspaperManager.getCurrentNewspaper(); + } + + return null; + } + }, { + key: "_getCurrentEdition", + value: function _getCurrentEdition() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + + var currentNewspaper = this._getCurrentNewspaper(props); + + if (currentNewspaper) { + return currentNewspaper.getEditionModel(); + } + + return null; + } + }, { + key: "_getSelectedPage", + value: function _getSelectedPage() { + var currentEdition = this._getCurrentEdition(); + + if (currentEdition) { + return currentEdition.getPages()[0]; + } + + return null; + } + }, { + key: "_getNumberOfPagesByOrientation", + value: function _getNumberOfPagesByOrientation() { + var result = 1; + var isLandscape = this.isLandscape(); + var isTextModeOpen = this.isTextModeOpen(); + + if (!this.isTablet && isLandscape && !isTextModeOpen) { + result = 2; + } else if (this.isTablet) { + if (!isLandscape && isTextModeOpen) { + result = 2; + } else if (isLandscape && !isTextModeOpen) { + result = 2; + } + } + + return result; + } + }, { + key: "_getNumberOfPagesToShow", + value: function _getNumberOfPagesToShow() { + var result = 1; + var tempFitPageHorizontally = this.state.tempFitPageHorizontally; + + if (!tempFitPageHorizontally) { + result = this._getNumberOfPagesByOrientation(); + } + + return result; + } + }, { + key: "_isSpecialSection", + value: function _isSpecialSection() { + var currentNewspaperManager = this.props.currentNewspaperManager; + return currentNewspaperManager ? currentNewspaperManager.isCurrentNewspaperASpecialSection() : false; + } + }, { + key: "_isArticleFullscreen", + value: function _isArticleFullscreen() { + var isLandscape = this.isLandscape(); + + var _global$getNewsmemory6 = global.getNewsmemoryConfig(), + articleFullscreen = _global$getNewsmemory6.articleFullscreen, + showTypesArticle = _global$getNewsmemory6.showTypesArticle; + + var _global$getActivePSet9 = global.getActivePSetup(), + articleModeDefaultFullscreenPortrait = _global$getActivePSet9.articleModeDefaultFullscreenPortrait, + defaultShowTypesArticle = _global$getActivePSet9.showTypesArticle; + + if (isLandscape) { + return articleFullscreen.landscape; + } + + var isDefaultPortraitFullscreen = articleModeDefaultFullscreenPortrait === "1"; + var isUserSettingsPortraitFullscreen = articleFullscreen.portrait; + var userChangeSettings = isDefaultPortraitFullscreen !== isUserSettingsPortraitFullscreen; + + if (userChangeSettings) { + return isUserSettingsPortraitFullscreen; + } + + if (showTypesArticle === defaultShowTypesArticle) { + return isDefaultPortraitFullscreen; + } + + if (_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isAndroid() && !_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTabletTenInches()) { + return true; + } + + if (showTypesArticle > _$$_REQUIRE(_dependencyMap[44]).SHOW_TYPES_ARTICLE.TEXT_AND_GRAPH) { + return true; + } + + return false; + } + }, { + key: "_isArticleInRange", + value: function _isArticleInRange(article) { + if (article && this.midPagesRendered) { + if (this.midPagesRendered.includes(article.getPageId())) { + return true; + } + } + + return false; + } + }, { + key: "_onPageRangeChange", + value: function _onPageRangeChange(midPages) { + this.midPagesRendered = midPages; + + if (!this._isArticleInRange(this.currentArticle)) { + this.resetCurrentArticle(); + + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_REMOVE_HIGHLIGHT); + } + } + }, { + key: "_onPagesLoaded", + value: function _onPagesLoaded() { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_FOOTER_BUTTON_HIDE_STARTUP); + + if (this.backgroundRef) { + this.backgroundRef.hide(); + } + } + }, { + key: "_onPagesUnmounted", + value: function _onPagesUnmounted() { + if (this.backgroundRef) { + this.backgroundRef.show(); + } + } + }, { + key: "_onPageChange", + value: function _onPageChange(currentPageId, isZoomed) { + var currentNewspaperManager = this.props.currentNewspaperManager; + this.currentPageId = currentPageId; + global.getNewsmemoryConfig().setLastOperationTimestamp(); + + if (currentNewspaperManager) { + currentNewspaperManager.setCurrentPage(this.currentPageId); + + var currentPage = this._getCurrentPage(); + + var _global$getActivePSet10 = global.getActivePSetup(), + previewHighlightEnabled = _global$getActivePSet10.previewHighlightEnabled; + + if (previewHighlightEnabled) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_SHOW_EXTRA, { + page: currentPage + }); + } + + var edition = this._getCurrentEdition(); + + if (edition && currentPage) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryScroll)(edition, currentPage, isZoomed); + } + } + } + }, { + key: "_onScaleChange", + value: function _onScaleChange(isScaled, scale, isPinch) { + if (isScaled) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_REMOVE_HIGHLIGHT); + + var edition = this._getCurrentEdition(); + + var page = this._getCurrentPage(); + + if (edition && page) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryZoom)(edition, page, scale); + + if (isPinch) { + if (!this.lastScale || this.lastScale < scale) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryPinchToZoomEvent)(edition, page, scale); + } + } + } + + if (!_$$_REQUIRE(_dependencyMap[36]).NetworkUtils.isOnline() && !_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTablet()) { + var currentNewspaper = this._getCurrentNewspaper(); + + if (currentNewspaper && !currentNewspaper.hasHighResolutionDownloaded()) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_MISSING_HR_WARNING_SHOW); + } else { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_MISSING_HR_WARNING_HIDE); + } + } + } else if (!_$$_REQUIRE(_dependencyMap[36]).NetworkUtils.isOnline() && !_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTablet()) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_MISSING_HR_WARNING_HIDE); + } + + this.lastScale = scale; + } + }, { + key: "_onPanChange", + value: function _onPanChange(isScaled, visibleAreas) { + if (isScaled) { + var edition = this._getCurrentEdition(); + + var page = this._getCurrentPage(); + + if (edition && page && (!this.lastScrollZoomedPage || this.lastScrollZoomedPage === page)) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryScrollZoomedEvent)(edition, page, visibleAreas); + } + + this.lastScrollZoomedPage = page; + } + } + }, { + key: "_openBrowseMode", + value: function _openBrowseMode() { + if (this._canEnableReadMode()) { + if (this._shouldEnableReadMode()) { + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openRead.key + }, { + maintainFit: true + }); + } else { + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSwipe.key + }); + } + } else { + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openBrowse.key + }); + } + } + }, { + key: "_onIndexOpenSection", + value: function _onIndexOpenSection(page) { + if (!this._isArticleFullscreen()) { + this.setCurrentPageId(page.getPageId()); + } + } + }, { + key: "_onIndexOpenPage", + value: function _onIndexOpenPage(page) { + this.setCurrentPageId(page.getPageId()); + this.openBrowseMode(); + } + }, { + key: "_onIndexScrollToPage", + value: function _onIndexScrollToPage(page) { + if (page) { + this.setCurrentPageId(page.getPageId()); + } + + if (this.layoutFlexManager.isArticleFullscreen) { + this.openBrowseMode(); + } + } + }, { + key: "_onIndexClose", + value: function _onIndexClose() { + this.openBrowseMode(); + } + }, { + key: "_onCloseAccessibility", + value: function _onCloseAccessibility() { + this._openAccessibility(false); + } + }, { + key: "_onCloseCarMode", + value: function _onCloseCarMode() { + this._openCloseCarMode(false); + } + }, { + key: "_onArticleClose", + value: function _onArticleClose() { + var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + var clickedPage = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + var currentNewspaperManager = this.props.currentNewspaperManager; + + if (currentNewspaperManager) { + currentNewspaperManager.getStatus().resetLastArticleId(); + } + + this.event = event; + + if (clickedPage) { + this._onPageChange(clickedPage.getPageId()); + } + + this.openBrowseMode(); + } + }, { + key: "_onLogoPress", + value: function _onLogoPress(action) { + this._onItemPress({ + action: action + }); + } + }, { + key: "_onArticleOpenIndex", + value: function _onArticleOpenIndex() { + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openIndexAlt.key + }); + } + }, { + key: "_onArticleOpenSearch", + value: function _onArticleOpenSearch(searchedTerm) { + this.searchedTerm = searchedTerm; + + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openSearch.key + }); + } + }, { + key: "_onArticleClearSearch", + value: function _onArticleClearSearch() { + this.searchedTerm = undefined; + this.clearingSearch = true; + + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openArticle.key + }); + } + }, { + key: "_onArticleToggleFullscreen", + value: function _onArticleToggleFullscreen(fullscreen) { + this.layoutFlexManager.setIsArticleFullscreen(fullscreen); + global.getNewsmemoryConfig().setFullscreen(fullscreen, this.isLandscape()); + this.setState((0, _extends2.default)({}, this.layoutFlexManager.getStyles())); + } + }, { + key: "_isAccessibilityModeEnabled", + value: function _isAccessibilityModeEnabled() { + return this.layoutFlexManager.accessibilityModeEnabled; + } + }, { + key: "_isCardModeEnabled", + value: function _isCardModeEnabled() { + return this.layoutFlexManager.carModeEnabled; + } + }, { + key: "_onIndexLevelChange", + value: function _onIndexLevelChange(level) { + if (this.indexLevel !== level) { + this.indexLevel = level; + + var currentEdition = this._getCurrentEdition(); + + if (currentEdition && !this._isIndexSecondLevel()) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryIndex)(currentEdition); + } + + if (!this.isTablet && this.footerLayoutRef) { + var _global$getEpaperLayo2 = global.getEpaperLayoutConfig(), + firstLevelIndexFooter = _global$getEpaperLayo2.firstLevelIndexFooter, + secondLevelIndexFooter = _global$getEpaperLayo2.secondLevelIndexFooter; + + if (_$$_REQUIRE(_dependencyMap[36]).JSUtils.equals(firstLevelIndexFooter, secondLevelIndexFooter)) { + this.footerLayoutRef.update(); + } else { + this.forceUpdate(); + } + } + } + } + }, { + key: "_onSearchPress", + value: function _onSearchPress(keyword, clickedPosition, items) { + this.searchedTerm = keyword; + + if (!this.isLite()) { + var article = items[clickedPosition].article; + + this._setCurrentArticle(article); + + this.currentPageId = article.getPageId(); + + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openArticle.key + }); + } + } + }, { + key: "_onIndexOpenArticle", + value: function _onIndexOpenArticle(article) { + if (!this.isLite()) { + if (this.searchedTerm) { + this.searchedTerm = undefined; + this.clearingSearch = true; + } + + this.updateArticleInterface = true; + + this._setCurrentArticle(article); + + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openArticle.key + }); + } + } + }, { + key: "_onArticlePress", + value: function _onArticlePress(article, event, open) { + var _this6 = this; + + this.clickArticleEvent = event; + + if (!this.isLite()) { + var currentNewspaperStatus = this.getNewspaperStatus(); + + if (currentNewspaperStatus) { + currentNewspaperStatus.resetLastArticlePositionId(); + } + + if (this.searchedTerm) { + this.searchedTerm = undefined; + this.clearingSearch = true; + } + + this.currentPageId = article.getPageId(); + var callback; + + if (open) { + this._setCurrentArticle(article); + + callback = function callback() { + _this6._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openArticle.key + }); + }; + } + + if (!this.highlightEnabled) { + if (open) { + this._onItemPress({ + action: _$$_REQUIRE(_dependencyMap[38]).ACTIONS.openArticle.key + }); + } + } else { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_ARTICLE_HIGHLIGHT, { + article: article, + toSelect: !open, + callback: callback + }); + } + } + } + }, { + key: "_openCurrentPageFirstArticle", + value: function _openCurrentPageFirstArticle() { + var currentPage = this._getCurrentPage(); + + if (currentPage) { + var firstArticle = currentPage.getArticles().find(function (article) { + return article.isText(); + }); + + if (!firstArticle) { + firstArticle = currentPage.getArticles().find(function (article) { + return !article.isLayout(); + }); + } + + this._onArticlePress(firstArticle, undefined, true); + } + } + }, { + key: "_onArticleSelected", + value: function _onArticleSelected(article, mode) { + var _this7 = this; + + if (!this.isLite()) { + var alreadySelected = this.currentArticle && this.currentArticle.equals(article); + + this._setCurrentArticle(article); + + this.setCurrentPageId(article.getPageId()); + + if ((!alreadySelected || this.updateArticleInterface) && this.layoutFlexManager.isBrowseVisible()) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_ARTICLE_HIGHLIGHT, { + article: article, + toSelect: false + }); + + this.updateArticleInterface = false; + } + + var edition = this._getCurrentEdition(); + + var page = this._getCurrentPage(); + + if (edition && page) { + if (this.articleSelectedTimer) { + clearTimeout(this.articleSelectedTimer); + } + + this.articleSelectedTimer = setTimeout(function () { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryArticle)(edition, page, article, mode); + _this7.articleSelectedTimer = undefined; + }, _$$_REQUIRE(_dependencyMap[45]).ARTICLE_READ_ANALYTICS_COOL_DOWN); + } + } + } + }, { + key: "_onPageLongPress", + value: function _onPageLongPress(event) { + if (_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTablet() && this._isTextModeOpen() && !this._isArticleFullscreen()) { + var article = this._getCurrentArticle(); + + if (article) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_ARTICLE_HIGHLIGHT, { + article: article, + toSelect: false + }); + + return true; + } + } + + return false; + } + }, { + key: "_setCurrentArticle", + value: function _setCurrentArticle(article) { + this.currentArticle = article; + var currentNewspaperManager = this.props.currentNewspaperManager; + currentNewspaperManager.getStatus().setLastArticleId((0, _$$_REQUIRE(_dependencyMap[41]).getArticleId)(article)); + } + }, { + key: "_onThumbnailPress", + value: function _onThumbnailPress(page) { + this.currentPageId = page.getPageId(); + this.openBrowseMode(); + } + }, { + key: "_onThumbnailDownload", + value: function _onThumbnailDownload(page, image) { + var currentNewspaperManager; + return _regenerator.default.async(function _onThumbnailDownload$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + currentNewspaperManager = this.props.currentNewspaperManager; + + if (!currentNewspaperManager) { + _context.next = 3; + break; + } + + return _context.abrupt("return", currentNewspaperManager.downloadThumbnailImageOnQueue(page, image)); + + case 3: + return _context.abrupt("return", null); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onSearchClose", + value: function _onSearchClose() { + this.openBrowseMode(); + } + }, { + key: "_getCurrentPage", + value: function _getCurrentPage() { + var _this8 = this; + + var edition = this._getCurrentEdition(); + + if (edition) { + var page = edition.getPages().find(function (item) { + return item.getPageId() === _this8.currentPageId; + }); + return page; + } + + return null; + } + }, { + key: "_onBackgroundRef", + value: function _onBackgroundRef(ref) { + this.backgroundRef = ref; + } + }, { + key: "_getBgPages", + value: function _getBgPages(newspaper, numberOfShowedPages) { + if (_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isEInk()) { + return null; + } + + var _this$state2 = this.state, + tempFitPageHorizontally = _this$state2.tempFitPageHorizontally, + isLandscape = _this$state2.isLandscape; + + var safeArea = _deviceUtils.default.getSafeArea(); + + var _global$getActivePSet11 = global.getActivePSetup(), + fixButtonsBarToBottom = _global$getActivePSet11.fixButtonsBarToBottom; + + var size = this.layoutFlexManager.getBrowseSize(); + + if (_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isIOS()) { + var safeAreaBrowseSize = this.layoutFlexManager.getBrowseSize(safeArea); + var footerSize; + + if (isLandscape && fixButtonsBarToBottom) { + footerSize = this.layoutFlexManager.getFooterSize(safeArea, false); + } else { + footerSize = this.layoutFlexManager.getFooterSize(safeArea); + } + + if (!tempFitPageHorizontally && (!isLandscape || isLandscape && fixButtonsBarToBottom) && footerSize.height > 0 && _$$_REQUIRE(_dependencyMap[36]).JSUtils.areEqualShallow(safeAreaBrowseSize, safeArea)) { + size = safeAreaBrowseSize; + size.height -= footerSize.height; + } + } + + size = this._getPagesAvailableSize(size, true); + return _react.default.createElement(_backgroundPages.default, { + ref: this.onBackgroundRef, + currentPageId: this.getCurrentPageId(), + newspaper: newspaper, + numberOfShowedPages: numberOfShowedPages, + fit: tempFitPageHorizontally, + style: size, + size: { + width: size.width, + height: size.height + }, + isLandscape: isLandscape, + getCurrentArticle: this.getCurrentArticle + }); + } + }, { + key: "_isTextModeOpen", + value: function _isTextModeOpen() { + return this.layoutFlexManager.isArticle() || this.layoutFlexManager.isIndex(); + } + }, { + key: "_isReadModeEnabled", + value: function _isReadModeEnabled() { + return this.layoutFlexManager.isRead(); + } + }, { + key: "_getFirstPageFitVerticalWidth", + value: function _getFirstPageFitVerticalWidth(layout) { + var edition = this._getCurrentEdition(); + + if (edition) { + var firstPage = edition.getFirstPage(); + + if (firstPage) { + var pageRatio = firstPage.getFrameWidth() / firstPage.getFrameHeight(); + return layout.height * pageRatio; + } + } + + return undefined; + } + }, { + key: "_onLayout", + value: function _onLayout(_ref6) { + var nativeEvent = _ref6.nativeEvent; + + if (this.layoutFlexManager.isChangingLayout(nativeEvent.layout)) { + this.layoutFlexManager.setSize(nativeEvent.layout); + + var _global$getActivePSet12 = global.getActivePSetup(), + enableDesktopArticleLayoutOnIPadProInLandscape = _global$getActivePSet12.enableDesktopArticleLayoutOnIPadProInLandscape; + + if (_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isiPadPro12dot9() && enableDesktopArticleLayoutOnIPadProInLandscape) { + this.layoutFlexManager.setPageFitVerticalWidth(this._getFirstPageFitVerticalWidth(nativeEvent.layout)); + } + + this.layoutFlexManager.setChangingOrientation(false); + this.forceUpdate(); + } + } + }, { + key: "_onMainLayout", + value: function _onMainLayout() { + if (this.layoutFlexManager.isChangingFooterAbsolute()) { + this.layoutFlexManager.setChangingFooterAbsolute(false); + this.forceUpdate(); + } + } + }, { + key: "_animateLayoutButtons", + value: function _animateLayoutButtons() { + var newsmemoryConfig = global.getNewsmemoryConfig(); + + if (!newsmemoryConfig.pagesNavigationButtonsAnimated()) { + return false; + } + + if (this._canEnableReadMode()) { + var readModeEnabled = newsmemoryConfig.readModeEnabled; + return readModeEnabled; + } + + return true; + } + }, { + key: "_getPagesAvailableSize", + value: function _getPagesAvailableSize(size) { + var applyTop = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var availableHeight = size.height; + var top = 0; + var bottomAd = global.getAdsConfig().getEpaperBottomAd(); + var topAd = global.getAdsConfig().getEpaperTopAd(); + + if (topAd) { + availableHeight -= topAd.getHeight(); + top = topAd.getHeight(); + } + + if (bottomAd) { + availableHeight -= bottomAd.getHeight(); + } + + if (applyTop) { + return { + width: size.width, + height: availableHeight, + top: top + }; + } + + return { + width: size.width, + height: availableHeight + }; + } + }, { + key: "_getNewspaperStatus", + value: function _getNewspaperStatus() { + var currentNewspaperManager = this.props.currentNewspaperManager; + + if (currentNewspaperManager) { + return currentNewspaperManager.getStatus(); + } + + return undefined; + } + }, { + key: "render", + value: function render() { + var _this$state3 = this.state, + browseStyle = _this$state3.browseStyle, + indexStyle = _this$state3.indexStyle, + articleStyle = _this$state3.articleStyle, + thumbnailStyle = _this$state3.thumbnailStyle, + searchStyle = _this$state3.searchStyle, + footerStyle = _this$state3.footerStyle, + mainStyle = _this$state3.mainStyle, + parentStyle = _this$state3.parentStyle, + tempFitPageHorizontally = _this$state3.tempFitPageHorizontally, + isLandscape = _this$state3.isLandscape; + var currentNewspaperManager = this.props.currentNewspaperManager; + + var fullscreen = this._isArticleFullscreen(); + + var _global$getActivePSet13 = global.getActivePSetup(), + fixButtonsBarToBottom = _global$getActivePSet13.fixButtonsBarToBottom; + + var _global$getEpaperLayo3 = global.getEpaperLayoutConfig(), + articleHeader = _global$getEpaperLayo3.articleHeader, + articleFooter = _global$getEpaperLayo3.articleFooter, + mainFooter = _global$getEpaperLayo3.mainFooter, + firstLevelIndexHeader = _global$getEpaperLayo3.firstLevelIndexHeader, + secondLevelIndexHeader = _global$getEpaperLayo3.secondLevelIndexHeader, + firstLevelIndexFooter = _global$getEpaperLayo3.firstLevelIndexFooter, + secondLevelIndexFooter = _global$getEpaperLayo3.secondLevelIndexFooter, + navigationModel = _global$getEpaperLayo3.navigationModel; + + var bottomAd = global.getAdsConfig().getEpaperBottomAd(); + var topAd = global.getAdsConfig().getEpaperTopAd(); + var currentPageId = this.getCurrentPageId(); + + var numberOfShowedPages = this._getNumberOfPagesToShow(); + + var currentNewspaper = this._getCurrentNewspaper(); + + var currentEdition = this._getCurrentEdition(); + + var indexTitle = this._getIndexTitle(); + + (0, _$$_REQUIRE(_dependencyMap[39]).trackNewsmemoryRoute)(this.layoutFlexManager.getLayout(), currentEdition); + var key = "layoutmanager"; + + if (this.layoutFlexManager.getSize()) { + var _this$layoutFlexManag = this.layoutFlexManager.getSize(), + width = _this$layoutFlexManag.width, + height = _this$layoutFlexManag.height; + + key += "_" + width + "_" + height; + } + + var textSize = this.layoutFlexManager.getArticleSize(); + + if (this.layoutFlexManager.isIndex()) { + textSize = this.layoutFlexManager.getIndexSize(); + + if (currentEdition && !this._isIndexSecondLevel()) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryIndex)(currentEdition); + } + } else if (this.layoutFlexManager.isThumbnail() && currentEdition) { + (0, _$$_REQUIRE(_dependencyMap[39]).sendNewsmemoryThumbnails)(currentEdition); + } + + var isTextModeOpen = this.isTextModeOpen(); + + if (!isTextModeOpen) { + var currentNewspaperStatus = this.getNewspaperStatus(); + + if (currentNewspaperStatus) { + currentNewspaperStatus.resetLastTTSIndex(); + currentNewspaperStatus.resetLastArticlePositionId(); + } + + var mgr = global.getAudio(); + + if (mgr) { + mgr.ttsDestroy(); + } + } + + var footerModel = mainFooter; + + if (isTextModeOpen && !this.isTablet) { + if (this.layoutFlexManager.isIndex()) { + footerModel = this._isIndexSecondLevel() ? secondLevelIndexFooter : firstLevelIndexFooter; + } else { + footerModel = articleFooter; + } + } + + var initialEvent = !isTextModeOpen ? this.event || this.clickArticleEvent : undefined; + var showPages = !this.layoutFlexManager.isChangingOrientation() && !this.layoutFlexManager.isChangingFooterAbsolute(); + var currentIssue; + var hasSpecialSections = false; + + if (currentEdition) { + hasSpecialSections = currentEdition.hasSpecialSections; + currentIssue = currentEdition.getIssue(); + } + + var SpecialComponent = hasSpecialSections ? _react.default.createElement(_specialSectionComponent.default, { + visible: true, + newspaperManager: currentNewspaperManager, + showSections: true + }) : null; + var footerAnimateProp = "bottom"; + + if (isLandscape && !fixButtonsBarToBottom) { + footerAnimateProp = "end"; + } + + var articleModeManagerSize; + var pageShortcutEnabled = false; + + if (articleStyle) { + articleModeManagerSize = this.layoutFlexManager.getArticleSize(); + } else if (indexStyle) { + articleModeManagerSize = this.layoutFlexManager.getIndexSize(); + } else { + articleModeManagerSize = { + width: 0, + height: 0 + }; + pageShortcutEnabled = true; + } + + var customBrowseStyle = _$$_REQUIRE(_dependencyMap[46]).Css.getStyleByCssClasses(["newsmemory-pages-container"]); + + var customArticleStyle = _$$_REQUIRE(_dependencyMap[46]).Css.getStyleObjByCssClasses(["newsmemory-article-container", fullscreen ? "newsmemory-article-container-fullscreen" : "newsmemory-article-container-splitscreen"]); + + var cssArticleModeManagerSize = _$$_REQUIRE(_dependencyMap[36]).CssUtils.updateSizeByApplingStyle(articleModeManagerSize, customArticleStyle); + + var browseSize = this.layoutFlexManager.getBrowseSize(); + return _react.default.createElement(_reactNative.View, { + style: [_layoutManager.default.parent, parentStyle], + onLayout: this.onLayout + }, _react.default.createElement(_reactNative.View, { + key: key, + onLayout: this.onMainLayout, + style: [_layoutManager.default.parent, mainStyle] + }, browseStyle ? _react.default.createElement(_reactNative.View, { + style: [browseStyle, customBrowseStyle] + }, showPages ? _react.default.createElement(_reactNative.View, { + style: [_layoutManager.default.pagesManager, (0, _extends2.default)({}, browseSize)] + }, global.getAdsConfig().getAdView(topAd, browseSize.width), _react.default.createElement(_pagesLayoutManager.default, (0, _extends2.default)({ + ref: this.onPageLayoutRef, + highlightEnabled: this.highlightEnabled, + animateButtons: this.animateLayoutButtons, + bgColor: _$$_REQUIRE(_dependencyMap[47]).HEADER_BG_COLOR, + isSpecialSection: this._isSpecialSection(), + onUnFit: this.onUnFit, + textColor: mainFooter.textColor, + numberOfShowedPages: numberOfShowedPages, + currentPageId: currentPageId, + getCurrentArticle: this.getCurrentArticle, + fitPageHorizontally: tempFitPageHorizontally, + onArticlePress: this.onArticlePress, + onPageChange: this.onPageChange, + onPageRangeChange: this.onPageRangeChange, + onPageLongPress: this.onPageLongPress, + onScaleChange: this.onScaleChange, + onPanChange: this.onPanChange, + newspaper: currentNewspaper, + onLoaded: this.onPagesLoaded, + onUnmounted: this.onPagesUnmounted, + isLandscape: isLandscape, + isTextModeOpen: this.isTextModeOpen, + isReadMode: this.isReadModeEnabled, + articleClose: this.onArticleClose, + initialEvent: initialEvent, + size: this._getPagesAvailableSize(browseSize), + textSize: textSize, + isSingleTapToZoomEnabled: this.isSingleTapToZoomEnabled, + navigationModel: navigationModel + }, this.props, { + shortcutEnabled: pageShortcutEnabled, + shortcutPriority: 2 + })), global.getAdsConfig().getAdView(bottomAd, browseSize.width), !_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTablet() ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[48]).ProgressBar, { + startProgress: currentNewspaperManager && currentNewspaperManager.getDownloadProgress ? currentNewspaperManager.getDownloadProgress() : 0, + style: { + position: "absolute", + bottom: 0, + width: browseSize.width + }, + cssClasses: ["newsmemory-phone-download-bar"] + }) : null) : null, !initialEvent ? this._getBgPages(currentNewspaper, numberOfShowedPages) : null) : null, articleStyle || indexStyle ? _react.default.createElement(_reactNative.View, { + style: [articleModeManagerSize, { + backgroundColor: _$$_REQUIRE(_dependencyMap[36]).colors.white + }, customArticleStyle] + }, !this.layoutFlexManager.isChangingOrientation() ? _react.default.createElement(_articleModeManager.default, (0, _extends2.default)({ + indexMode: !!indexStyle, + isLandscape: isLandscape, + fullscreen: fullscreen, + title: indexTitle, + header: this.isTablet && (isLandscape || fullscreen), + headerTopLine: !this.isTablet || !isLandscape, + size: cssArticleModeManagerSize, + model: articleHeader, + firstLevelModel: firstLevelIndexHeader, + secondLevelModel: secondLevelIndexHeader, + newspaper: currentNewspaper, + indexLevel: this.indexLevel, + searchText: this.searchedTerm, + SpecialComponent: SpecialComponent, + getCurrentArticle: this.getCurrentArticle, + getCurrentPage: this.getCurrentPage, + downloadImageMethod: this.onThumbnailDownload, + onLogoPress: this.onLogoPress, + onToggleFullscreen: this.onArticleToggleFullscreen, + onArticleRef: this.onArticleLayoutRef, + onArticleOpenIndex: this.onArticleOpenIndex, + onArticleOpenSearch: this.onArticleOpenSearch, + onArticleClearSearch: this.onArticleClearSearch, + onArticleSelected: this.onArticleSelected, + onCloseAccessibility: this.onCloseAccessibility, + onCloseCarMode: this.onCloseCarMode, + onArticleClose: this.onArticleClose, + onArticleLongPress: this.onPageLongPress, + onIndexRef: this.onIndexLayoutRef, + onIndexGoToPage: this.onIndexOpenPage, + onIndexOpenSection: this.onIndexOpenSection, + onIndexOpenArticle: this.onIndexOpenArticle, + onIndexClose: this.onIndexClose, + onIndexScrollToPage: this.onIndexScrollToPage, + onIndexLevelChange: this.onIndexLevelChange, + accessibilityEnabled: this._isAccessibilityModeEnabled(), + carModeEnabled: this._isCardModeEnabled(), + getNewspaperStatus: this.getNewspaperStatus + }, this.props, { + shortcutEnabled: true, + shortcutPriority: 3 + })) : null) : null, thumbnailStyle ? _react.default.createElement(_reactNative.View, { + style: thumbnailStyle + }, !this.layoutFlexManager.isChangingOrientation() ? _react.default.createElement(_thumbnailComponent.default, (0, _extends2.default)({ + SpecialComponent: hasSpecialSections ? _react.default.createElement(_specialSectionComponent.default, { + visible: true, + newspaperManager: currentNewspaperManager, + showSections: false + }) : null, + newspaper: currentNewspaper, + downloadImageMethod: this.onThumbnailDownload, + currentPageId: currentPageId, + onItemClick: this.onThumbnailPress, + size: this.layoutFlexManager.getThumbnailSize() + }, this.props, { + shortcutEnabled: true, + shortcutPriority: 2 + })) : _react.default.createElement(_$$_REQUIRE(_dependencyMap[49]).ProgressCircle, null)) : null, searchStyle ? _react.default.createElement(_reactNative.View, { + style: searchStyle + }, _react.default.createElement(_searchComponent.default, (0, _extends2.default)({ + searchedTerm: this.searchedTerm, + edition: currentEdition, + onClose: this.onSearchClose, + onItemClick: this.onSearchPress, + issueText: indexTitle, + model: articleHeader + }, this.props, { + shortcutEnabled: true, + shortcutPriority: 10 + }))) : null), footerStyle ? _react.default.createElement(_reactNative.View, { + style: footerStyle + }, _react.default.createElement(_newsmemoryFooterBarComponent.default, (0, _extends2.default)({ + ref: this.onFooterLayoutRef, + model: footerModel, + hideText: !_$$_REQUIRE(_dependencyMap[36]).PlatformUtils.isTabletTenInches() || isLandscape && fixButtonsBarToBottom, + animated: this.layoutFlexManager.isFooterAbsolute, + onItemPress: this.onFooterItemPress, + isItemActive: this.isFooterItemActive, + isItemVisible: this.isFooterItemVisible, + isItemPresent: this.isFooterItemPresent, + issue: currentIssue, + stylePropToAnimate: footerAnimateProp, + style: { + flexDirection: footerStyle.flexDirection + }, + size: this.layoutFlexManager.getFooterConstraitSize() + }, this.props, { + shortcutEnabled: true, + shortcutPriority: 50 + }))) : null); + } + }]); + return NewsmemoryLayoutManager; + }(_$$_REQUIRE(_dependencyMap[50]).Shortcut); + + exports.NewsmemoryLayoutManager = NewsmemoryLayoutManager; + NewsmemoryLayoutManager.propTypes = (0, _extends2.default)({ + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }), + currentNewspaperManager: _propTypes.default.instanceOf(_NewspaperManager.default) + }, _$$_REQUIRE(_dependencyMap[50]).Shortcut.propTypes); + NewsmemoryLayoutManager.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[50]).Shortcut.defaultProps, { + shortcutEnabled: true + }); +},2336,[5,80,6,7,8,15,90,12,14,16,17,201,28,460,458,2337,2344,2346,2354,638,640,644,1859,2381,714,429,2414,603,2320,2306,715,2415,587,2416,2422,2424,462,572,1725,1954,1873,2187,730,1849,717,1892,699,729,2425,1953,1911]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[13]); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _NewspaperManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _hidingAnimationComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _sdkUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MORE_ICON_SIZE = 30; + + var NewsMemoryFooterBar = function (_Shortcut) { + (0, _inherits2.default)(NewsMemoryFooterBar, _Shortcut); + + var _super = _createSuper(NewsMemoryFooterBar); + + function NewsMemoryFooterBar(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsMemoryFooterBar); + _this = _super.call(this, props); + _this.onItemPress = _this._onItemPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onButtonRef = _this._onButtonRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.prevButtonHighlight = _this._prevButtonHighlight.bind((0, _assertThisInitialized2.default)(_this)); + _this.nextButtonHighlight = _this._nextButtonHighlight.bind((0, _assertThisInitialized2.default)(_this)); + _this.removeButtonHighlight = _this._removeButtonHighlight.bind((0, _assertThisInitialized2.default)(_this)); + _this.buttonRefs = []; + _this.currentButtonIndex = -1; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + twoFingersTapToArticle = _global$getNewsmemory.twoFingersTapToArticle; + + _this.state = { + twoFingersTapToArticle: twoFingersTapToArticle + }; + return _this; + } + + (0, _createClass2.default)(NewsMemoryFooterBar, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsMemoryFooterBar.prototype), "componentDidMount", this).call(this); + this.configChangeListener = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.NEWSMEMORY_CONFIG_CHANGE, function () { + var currentTwoFingersTapToArticle = _this2.state.twoFingersTapToArticle; + var newsmemoryConfig = global.getNewsmemoryConfig(); + var twoFingersTapToArticle = newsmemoryConfig.twoFingersTapToArticle; + + if (twoFingersTapToArticle !== currentTwoFingersTapToArticle) { + _this2.setState({ + twoFingersTapToArticle: twoFingersTapToArticle + }); + } + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsMemoryFooterBar.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onNewsmemoryDidFocus); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.configChangeListener); + } + }, { + key: "update", + value: function update() { + this.forceUpdate(); + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var LEFT = _$$_REQUIRE(_dependencyMap[23]).KEY_GROUPS.LEFT, + RIGHT = _$$_REQUIRE(_dependencyMap[23]).KEY_GROUPS.RIGHT, + UP = _$$_REQUIRE(_dependencyMap[23]).KEY_GROUPS.UP, + DOWN = _$$_REQUIRE(_dependencyMap[23]).KEY_GROUPS.DOWN, + CLOSE = _$$_REQUIRE(_dependencyMap[23]).KEY_GROUPS.CLOSE; + + var buttonHighlighted = this.currentButtonIndex >= 0; + var shortcuts = [{ + callback: this.removeButtonHighlight, + keys: CLOSE, + stopPropagation: buttonHighlighted + }]; + var keys = ["TAB"]; + + if (buttonHighlighted) { + var _global$getActivePSet = global.getActivePSetup(), + fixButtonsBarToBottom = _global$getActivePSet.fixButtonsBarToBottom; + + var prevKeys; + var noopKeys; + + if (!_deviceUtils.default.isPortrait() && !fixButtonsBarToBottom) { + keys.push.apply(keys, (0, _toConsumableArray2.default)(DOWN)); + prevKeys = UP; + noopKeys = [].concat((0, _toConsumableArray2.default)(LEFT), (0, _toConsumableArray2.default)(RIGHT)); + } else { + keys.push.apply(keys, (0, _toConsumableArray2.default)(RIGHT)); + prevKeys = LEFT; + noopKeys = [].concat((0, _toConsumableArray2.default)(UP), (0, _toConsumableArray2.default)(DOWN)); + } + + shortcuts.push({ + callbackRepeat: this.prevButtonHighlight, + keys: prevKeys, + stopPropagation: true + }, { + callback: this.noop, + keys: noopKeys, + stopPropagation: true + }); + } + + shortcuts.push({ + callbackRepeat: this.nextButtonHighlight, + keys: keys, + stopPropagation: true + }); + return shortcuts; + } + }, { + key: "_onRelabel", + value: function _onRelabel(icon, disableHideText) { + var hideText = this.props.hideText; + + var textStyle = _$$_REQUIRE(_dependencyMap[24]).Css.getStyleObjByCssClasses(["newsmemory-footer-text"]); + + var textDisplay = _$$_REQUIRE(_dependencyMap[25]).CssUtils.getAttributeFromStyle("display", textStyle, hideText ? "none" : "flex"); + + if (textDisplay === "none" && !disableHideText) { + return undefined; + } + + var forceText = icon.isForceText(); + + var _global$getActivePSet2 = global.getActivePSetup(), + loginStatus = _global$getActivePSet2.loginStatus; + + var isLoggedIn = loginStatus.isLoggedIn(); + + if (isLoggedIn) { + var loggedInText = icon.getLoggedInText(); + + if (forceText && loggedInText) { + return loggedInText; + } + } + + var text = icon.getText(); + + if (forceText && text) { + return text; + } + + var action = _$$_REQUIRE(_dependencyMap[26]).ACTIONS[icon.getAction()] || {}; + var pSetupRelabel = action.pSetupRelabel, + defaultLabelKey = action.defaultLabelKey; + + var _global$getActivePSet3 = global.getActivePSetup(), + relabel = _global$getActivePSet3.relabel; + + if (pSetupRelabel && relabel[pSetupRelabel]) { + return relabel[pSetupRelabel]; + } + + if (defaultLabelKey) { + return global.strings(defaultLabelKey); + } + + return text; + } + }, { + key: "_getMoreIcon", + value: function _getMoreIcon(item, label) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-icon", "newsmemory-footer-more-icon", label ? "newsmemory-footer-more-icon-" + label : "", "newsmemory-footer-more-icon-" + item.getAction()] + }, _react.default.createElement(_imageIconChooserComponent.default, { + type: item.getLibrary(), + name: item.getIcon(), + size: MORE_ICON_SIZE, + imageStyle: { + width: MORE_ICON_SIZE, + height: MORE_ICON_SIZE + }, + source: item.getIcon(), + resizeMode: "contain" + })); + } + }, { + key: "_displayMoreMenu", + value: function _displayMoreMenu() { + var _this3 = this; + + var _this$props = this.props, + isItemVisible = _this$props.isItemVisible, + footer = _this$props.model; + + var moreMenuStyle = _$$_REQUIRE(_dependencyMap[24]).Css.getStyleObjByCssClasses(["newsmemory-footer", "newsmemory-footer-more-menu"]); + + var textColor = _$$_REQUIRE(_dependencyMap[25]).CssUtils.getAttributeFromStyle("color", moreMenuStyle); + + var bgColor = _$$_REQUIRE(_dependencyMap[25]).CssUtils.getAttributeFromStyle("backgroundColor", moreMenuStyle); + + var textStyle = _$$_REQUIRE(_dependencyMap[24]).Css.getStyleObjByCssClasses(["newsmemory-footer-more-menu-text"]); + + var lineStyle = _$$_REQUIRE(_dependencyMap[24]).Css.getStyleObjByCssClasses(["newsmemory-footer-more-menu-item"]); + + _$$_REQUIRE(_dependencyMap[27]).MyBottomSheet.show({ + options: footer.more.filter(function (item) { + return isItemVisible(item); + }).map(function (item) { + var label = _this3._onRelabel(item, true); + + return { + title: label, + icon: _this3._getMoreIcon(item, label), + waitModalHide: item.action === _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageAccessibility.key || item.action === _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openAccessibility.key, + onPress: function onPress() { + _this3.onItemPress(item); + }, + textStyle: _$$_REQUIRE(_dependencyMap[24]).Css.getStyleObjByCssClasses(["newsmemory-footer-more-menu-text-" + _$$_REQUIRE(_dependencyMap[25]).StringUtils.getKeyFromText(label), "newsmemory-footer-more-menu-text-" + item.action]), + containerStyle: _$$_REQUIRE(_dependencyMap[24]).Css.getStyleObjByCssClasses(["newsmemory-footer-more-menu-item-" + _$$_REQUIRE(_dependencyMap[25]).StringUtils.getKeyFromText(label), "newsmemory-footer-more-menu-item-" + item.action]) + }; + }), + styleContainer: (0, _extends2.default)({ + backgroundColor: bgColor || footer.backgroundColor + }, lineStyle), + textStyle: (0, _extends2.default)({ + color: textColor || footer.textColor + }, textStyle) + }); + + this.removeButtonHighlight(); + } + }, { + key: "_onItemPress", + value: function _onItemPress(item) { + var _this$props2 = this.props, + navigation = _this$props2.navigation, + onItemPress = _this$props2.onItemPress; + + switch (item.action) { + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openMore.key: + this._displayMoreMenu(); + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openLiveNews.key: + if (global.TaAddonNeedsCloseButton()) { + _sdkUtils.default.close(); + } else { + _NavigationService.default.main.reset("RssNavigator"); + } + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openStore.key: + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.market + }); + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageEditions.key: + var _global$getActivePSet4 = global.getActivePSetup(), + showNativeOptionsPage = _global$getActivePSet4.showNativeOptionsPage, + showNativeOptionsPageFallbackUrl = _global$getActivePSet4.showNativeOptionsPageFallbackUrl; + + if (_$$_REQUIRE(_dependencyMap[25]).NetworkUtils.isOnline() || showNativeOptionsPage && !showNativeOptionsPageFallbackUrl) { + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.home + }); + } else { + onItemPress(item); + } + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.downloadEdition.key: + if (_$$_REQUIRE(_dependencyMap[25]).NetworkUtils.isOnline()) { + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + showDownloadTip = _global$getNewsmemory2.showDownloadTip; + + if (showDownloadTip) { + var buttons = []; + buttons.push({ + text: global.strings("btn_cancel") + }); + buttons.push({ + text: global.strings("btn_ok"), + onPress: function onPress() { + return _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_FULL_EDITION); + } + }); + buttons.push({ + text: global.strings("btn_ok") + " (" + global.strings("btn_do_not_show") + ")", + onPress: function onPress() { + global.getNewsmemoryConfig().dontShowAgainDownloadTip(); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_FULL_EDITION); + } + }); + + _reactNative.Alert.alert(global.strings("offline_download_dialog"), global.strings("user_tip_download_title") + ": " + global.strings("user_tip_download"), buttons, { + cancelable: false + }); + } else { + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.NEWSMEMORY_DOWNLOAD_FULL_EDITION); + } + } else { + var _buttons = []; + + _buttons.push({ + text: global.strings("btn_ok") + }); + + _reactNative.Alert.alert("", global.strings("offline_download_warning"), _buttons, { + cancelable: false + }); + } + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openSpecialSections.key: + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.NEWSMEMORY_OPEN_SPECIAL_SECTION); + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageContact.key: + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.contact + }); + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageLogin.key: + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.account + }); + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageSettings.key: + if (global.getMainPSetup().showNativeSettingsScreen || !_$$_REQUIRE(_dependencyMap[25]).NetworkUtils.isOnline()) { + navigation.navigate("GeneralSettingsScreen", { + module: _$$_REQUIRE(_dependencyMap[29]).GeneralSettingsModules.EPAPER + }); + } else { + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.settings + }); + } + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageHelp.key: + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.help + }); + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openLink.key: + if (item.actionValue) { + navigation.navigate("WebScreen", { + url: item.actionValue + }); + } + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openAktuell.key: + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.generic, + url: item.actionValue + }); + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageArchive.key: + var newsmemoryConfig = global.getNewsmemoryConfig(); + + var _global$getActivePSet5 = global.getActivePSetup(), + protectSite = _global$getActivePSet5.protectSite, + loginStatus = _global$getActivePSet5.loginStatus; + + if (protectSite === 0 || loginStatus.isLoggedIn()) { + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.archive, + hidden: true, + getParams: { + hideTabs: 1 + } + }); + } else { + newsmemoryConfig.setArchiveMode(true); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.login, + hidden: false, + getParams: { + hideTabs: 1, + isRss: 1 + } + }); + } + + break; + + case _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPagePublications.key: + _NavigationService.default.main.navigate("PublicationsPageScreen"); + + break; + + default: + onItemPress(item); + this.forceUpdate(); + } + } + }, { + key: "_onButtonRef", + value: function _onButtonRef(ref, index) { + this.buttonRefs[index] = ref; + } + }, { + key: "_getVisibleButtonRefs", + value: function _getVisibleButtonRefs() { + return Object.values(this.buttonRefs).filter(function (buttonRef) { + return buttonRef && buttonRef.isVisible(); + }); + } + }, { + key: "_prevButtonHighlight", + value: function _prevButtonHighlight() { + var buttonsArray; + return _regenerator.default.async(function _prevButtonHighlight$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + buttonsArray = this._getVisibleButtonRefs(); + + if (!(buttonsArray.length > 0)) { + _context.next = 7; + break; + } + + if (this.currentButtonIndex >= 0 && buttonsArray[this.currentButtonIndex]) { + buttonsArray[this.currentButtonIndex].highlight(false); + } + + this.currentButtonIndex -= 1; + + if (this.currentButtonIndex < 0) { + this.currentButtonIndex = buttonsArray.length - 1; + } + + if (!buttonsArray[this.currentButtonIndex]) { + _context.next = 7; + break; + } + + return _context.abrupt("return", buttonsArray[this.currentButtonIndex].highlight(true)); + + case 7: + return _context.abrupt("return", Promise.reject()); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_nextButtonHighlight", + value: function _nextButtonHighlight() { + var buttonsArray; + return _regenerator.default.async(function _nextButtonHighlight$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + buttonsArray = this._getVisibleButtonRefs(); + + if (!(buttonsArray.length > 0)) { + _context2.next = 7; + break; + } + + if (this.currentButtonIndex >= 0 && buttonsArray[this.currentButtonIndex]) { + buttonsArray[this.currentButtonIndex].highlight(false); + } + + this.currentButtonIndex += 1; + + if (this.currentButtonIndex >= buttonsArray.length) { + this.currentButtonIndex = 0; + } + + if (!buttonsArray[this.currentButtonIndex]) { + _context2.next = 7; + break; + } + + return _context2.abrupt("return", buttonsArray[this.currentButtonIndex].highlight(true)); + + case 7: + return _context2.abrupt("return", Promise.reject()); + + case 8: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_removeButtonHighlight", + value: function _removeButtonHighlight() { + var buttonsArray = this._getVisibleButtonRefs(); + + if (buttonsArray.length > 0) { + if (this.currentButtonIndex >= 0 && buttonsArray[this.currentButtonIndex]) { + buttonsArray[this.currentButtonIndex].highlight(false); + } + + this.currentButtonIndex = -1; + } + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props3 = this.props, + isItemActive = _this$props3.isItemActive, + isItemVisible = _this$props3.isItemVisible, + isItemPresent = _this$props3.isItemPresent, + model = _this$props3.model, + issue = _this$props3.issue, + size = _this$props3.size, + currentNewspaperManager = _this$props3.currentNewspaperManager, + animated = _this$props3.animated, + stylePropToAnimate = _this$props3.stylePropToAnimate, + style = _this$props3.style, + shortcutEnabled = _this$props3.shortcutEnabled, + shortcutPriority = _this$props3.shortcutPriority; + var m = model; + + var _global$getActivePSet6 = global.getActivePSetup(), + dateFormat = _global$getActivePSet6.dateFormat; + + var dayText = issue ? _$$_REQUIRE(_dependencyMap[25]).DateUtils.getCalendarText(issue, dateFormat) : undefined; + + if (m && m.buttons) { + return _react.default.createElement(_hidingAnimationComponent.default, { + tag: "FOOTER", + stylePropToAnimate: stylePropToAnimate, + style: { + flex: 1 + }, + enabled: animated, + duration: 500, + autoHide: false, + autoHideOnLoad: false, + animateShow: true, + animateHide: true, + eventToHide: _events.default.NEWSMEMORY_FOOTER_BUTTON_HIDE, + eventToHideAfter: _events.default.NEWSMEMORY_FOOTER_BUTTON_HIDE_STARTUP, + eventToToggle: _events.default.NEWSMEMORY_FOOTER_TOGGLE_VISIBILITY + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[30]).TecnaviaFooter, { + style: { + flex: 1 + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-footer"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[30]).TecnaviaFooterTab, { + style: [{ + backgroundColor: m.backgroundColor, + flexDirection: "row", + flex: 1 + }, style] + }, m.buttons.map(function (button, index) { + if (!isItemPresent(button)) { + return null; + } + + var active = isItemActive(button); + var visible = isItemVisible(button); + var key = button.action + "_" + index; + var ButtonComponent = null; + + if (visible) { + var action = button.getAction(); + + if (action) { + var buttonProps = { + ref: function ref(_ref) { + _this4.onButtonRef(_ref, index); + }, + item: button, + text: _this4._onRelabel(button), + accessibilityLabel: _this4._onRelabel(button, true), + foregroundColor: m.textColor, + onItemClick: _this4.onItemPress, + maxSize: size, + parentStyle: { + flexDirection: style.flexDirection + }, + shortcutEnabled: shortcutEnabled, + shortcutPriority: shortcutPriority + 1 + }; + + if (action === _$$_REQUIRE(_dependencyMap[26]).ACTIONS.downloadEdition.key) { + ButtonComponent = _react.default.createElement(_$$_REQUIRE(_dependencyMap[31]).NewsMemoryDownloadIcon, (0, _extends2.default)({ + startProgress: currentNewspaperManager && currentNewspaperManager.getDownloadProgress ? currentNewspaperManager.getDownloadProgress() : 0 + }, buttonProps)); + } else if (action === _$$_REQUIRE(_dependencyMap[26]).ACTIONS.openOptionPageEditions.key) { + ButtonComponent = _react.default.createElement(_$$_REQUIRE(_dependencyMap[32]).NewsMemoryFooterIcon, (0, _extends2.default)({}, buttonProps, { + iconText: button.supportInnerText() ? dayText : undefined + })); + } else if (_$$_REQUIRE(_dependencyMap[26]).ACTIONS[action] && _$$_REQUIRE(_dependencyMap[26]).ACTIONS[action].type === _$$_REQUIRE(_dependencyMap[26]).ACTIONS_TYPE.link) { + ButtonComponent = _react.default.createElement(_$$_REQUIRE(_dependencyMap[32]).NewsMemoryFooterIcon, buttonProps); + } else { + if (active) { + buttonProps.backgroundColor = m.textColor; + buttonProps.foregroundColor = m.backgroundColor; + } + + ButtonComponent = _react.default.createElement(_$$_REQUIRE(_dependencyMap[32]).NewsMemoryFooterIcon, (0, _extends2.default)({ + active: active + }, buttonProps)); + } + } + } + + return _react.default.createElement(_reactNative.View, { + key: key, + style: { + flex: 1 + } + }, ButtonComponent); + }))))); + } + + return null; + } + }]); + return NewsMemoryFooterBar; + }(_$$_REQUIRE(_dependencyMap[33]).Shortcut); + + exports.default = NewsMemoryFooterBar; + NewsMemoryFooterBar.propTypes = (0, _extends2.default)({ + model: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[34]).Footer), + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }), + currentNewspaperManager: _propTypes.default.instanceOf(_NewspaperManager.default), + stylePropToAnimate: _propTypes.default.string, + size: _propTypes.default.number, + animated: _propTypes.default.bool, + hideText: _propTypes.default.bool, + issue: _propTypes.default.string, + onItemPress: _propTypes.default.func.isRequired, + isItemActive: _propTypes.default.func, + isItemVisible: _propTypes.default.func, + isItemPresent: _propTypes.default.func, + style: _propTypes.default.any + }, _$$_REQUIRE(_dependencyMap[33]).Shortcut.propTypes); +},2337,[5,80,6,21,7,8,15,90,12,14,16,17,201,28,458,1861,460,1859,2306,2338,1970,1874,572,1873,699,462,1725,1905,730,2232,2090,2339,2343,1911,1846]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DEFAULT_CONSTRAINT = -50; + + var HidingAnimationView = function (_React$Component) { + (0, _inherits2.default)(HidingAnimationView, _React$Component); + + var _super = _createSuper(HidingAnimationView); + + function HidingAnimationView(props) { + var _this; + + (0, _classCallCheck2.default)(this, HidingAnimationView); + _this = _super.call(this, props); + _this.direction = _this._getDirection(props); + _this.hidingMaxValue = DEFAULT_CONSTRAINT; + _this.constraint = new _reactNative.Animated.Value(0); + _this.startShow = _this._startShow.bind((0, _assertThisInitialized2.default)(_this)); + _this.show = _this._show.bind((0, _assertThisInitialized2.default)(_this)); + _this.startHide = _this._startHide.bind((0, _assertThisInitialized2.default)(_this)); + _this.hide = _this._hide.bind((0, _assertThisInitialized2.default)(_this)); + _this.hideAfter = _this._hideAfter.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggle = _this._toggle.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleEnable = _this._toggleEnable.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + enabled: props.enabled + }; + _this.isVisible = true; + return _this; + } + + (0, _createClass2.default)(HidingAnimationView, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this$props = this.props, + autoHideOnLoad = _this$props.autoHideOnLoad, + eventToHide = _this$props.eventToHide, + eventToHideAfter = _this$props.eventToHideAfter, + eventToShow = _this$props.eventToShow, + eventToggleEnable = _this$props.eventToggleEnable, + eventToToggle = _this$props.eventToToggle; + + if (eventToShow) { + this.onShowListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(eventToShow, this.show); + } + + if (eventToggleEnable) { + this.onToggleEnableListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(eventToggleEnable, this.toggleEnable); + } + + if (eventToToggle) { + this.onToggleListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(eventToToggle, this.toggle); + } + + if (eventToHide) { + this.onHideListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(eventToHide, this.hide); + } + + if (eventToHideAfter) { + this.onHideAfterListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(eventToHideAfter, this.hideAfter); + } + + if (autoHideOnLoad) { + this.hide(); + } + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(props) { + this.direction = this._getDirection(props); + var enabled = this.state.enabled; + + if (enabled !== props.enabled) { + this.setState({ + enabled: props.enabled + }); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + var autoHideOnLoad = this.props.autoHideOnLoad; + var enabled = this.state.enabled; + this.constraint.setValue(0); + + if (enabled && autoHideOnLoad) { + this.hide(); + } else { + if (this.hideAnimationTimeoutId) { + clearTimeout(this.hideAnimationTimeoutId); + } + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onShowListener); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onToggleEnableListener); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onToggleListener); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onHideListener); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onHideAfterListener); + } + }, { + key: "_getDirection", + value: function _getDirection(props) { + if (["start", "end", "left", "right"].includes(props.stylePropToAnimate)) { + return "horizontal"; + } + + return "vertical"; + } + }, { + key: "_isHorizontal", + value: function _isHorizontal() { + return this.direction === "horizontal"; + } + }, { + key: "_onLayout", + value: function _onLayout(event) { + var nativeEvent = event.nativeEvent; + + if (this._isHorizontal()) { + this.hidingMaxValue = -nativeEvent.layout.width; + } else { + this.hidingMaxValue = -nativeEvent.layout.height; + } + + var onLayout = this.props.onLayout; + + if (typeof onLayout === "function") { + onLayout(event); + } + } + }, { + key: "_toggle", + value: function _toggle() { + this._log("is visible: " + this.isVisible); + + if (this.isVisible) { + this.hide(); + } else { + this.show(); + } + } + }, { + key: "_toggleEnable", + value: function _toggleEnable(_ref) { + var nextEnabled = _ref.enabled; + var enabled = this.state.enabled; + + if (enabled !== nextEnabled) { + this.setState({ + enabled: nextEnabled + }); + } + } + }, { + key: "_show", + value: function _show() { + var _this2 = this; + + var enabled = this.state.enabled; + var autoHide = this.props.autoHide; + + if (enabled) { + this.startShow(function () { + if (autoHide) { + _this2.hide(); + } + }); + } + } + }, { + key: "_hideAfter", + value: function _hideAfter() { + var _this3 = this; + + var hideAfter = this.props.hideAfter; + + if (this.hideAnimationTimeoutId) { + clearTimeout(this.hideAnimationTimeoutId); + } + + this.hideAnimationTimeoutId = setTimeout(function () { + _this3.hideAnimationTimeoutId = undefined; + + _this3.startHide(); + }, hideAfter); + } + }, { + key: "_hide", + value: function _hide() { + var enabled = this.state.enabled; + var _this$props2 = this.props, + autoHide = _this$props2.autoHide, + autoHideOnLoad = _this$props2.autoHideOnLoad; + + if (enabled) { + if (!autoHideOnLoad || !this.animationHide && !this.hideAnimationTimeoutId) { + if (autoHide) { + this.hideAfter(); + } else { + this.startHide(); + } + } + } + } + }, { + key: "_startShow", + value: function _startShow(onFinish) { + var _this4 = this; + + var _this$props3 = this.props, + animateShow = _this$props3.animateShow, + duration = _this$props3.duration; + + if (animateShow) { + if (this.animationHide) { + this.animationHide.stop(); + } + + this.animationShow = _reactNative.Animated.timing(this.constraint, { + toValue: 0, + useNativeDriver: false, + duration: duration + }); + this.animationShow.start(function (_ref2) { + var finished = _ref2.finished; + _this4.animationShow = undefined; + + if (finished) { + if (typeof onFinish === "function") { + onFinish(); + } + + _this4.isVisible = true; + } + }); + } else { + this.isVisible = true; + this.constraint.setValue(0); + + if (typeof onFinish === "function") { + onFinish(); + } + } + } + }, { + key: "_startHide", + value: function _startHide() { + var _this5 = this; + + var _this$props4 = this.props, + animateHide = _this$props4.animateHide, + duration = _this$props4.duration; + + if (animateHide) { + if (this.animationShow) { + this.animationShow.stop(); + } + + this.animationHide = _reactNative.Animated.timing(this.constraint, { + toValue: this.hidingMaxValue, + useNativeDriver: false, + duration: duration + }); + this.animationHide.start(function (_ref3) { + var finished = _ref3.finished; + _this5.animationHide = undefined; + + if (finished) { + _this5.isVisible = false; + } + }); + } else { + this.isVisible = false; + this.constraint.setValue(this.hidingMaxValue); + } + } + }, { + key: "_log", + value: function _log(message) { + var tag = this.props.tag; + } + }, { + key: "render", + value: function render() { + var _this$props5 = this.props, + style = _this$props5.style, + stylePropToAnimate = _this$props5.stylePropToAnimate, + rest = (0, _objectWithoutProperties2.default)(_this$props5, ["style", "stylePropToAnimate"]); + var enabled = this.state.enabled; + var Component = enabled ? _reactNative.Animated.View : _reactNative.View; + var animatedStyle = {}; + + if (enabled && stylePropToAnimate) { + animatedStyle[stylePropToAnimate] = this.constraint; + } + + return _react.default.createElement(Component, (0, _extends2.default)({ + onLayout: this.onLayout, + style: [style, animatedStyle] + }, rest)); + } + }]); + return HidingAnimationView; + }(_react.default.Component); + + exports.default = HidingAnimationView; + HidingAnimationView.propTypes = { + tag: _propTypes.default.string, + enabled: _propTypes.default.bool, + animateHide: _propTypes.default.bool, + animateShow: _propTypes.default.bool, + autoHideOnLoad: _propTypes.default.bool, + autoHide: _propTypes.default.bool, + duration: _propTypes.default.number, + hideAfter: _propTypes.default.number, + eventToHide: _propTypes.default.string, + eventToHideAfter: _propTypes.default.string, + eventToShow: _propTypes.default.string, + eventToToggle: _propTypes.default.string, + eventToggleEnable: _propTypes.default.string, + style: _propTypes.default.any, + onLayout: _propTypes.default.func, + stylePropToAnimate: _propTypes.default.string.isRequired + }; + HidingAnimationView.defaultProps = { + tag: "generic", + enabled: true, + autoHideOnLoad: true, + autoHide: true, + animateHide: true, + animateShow: false, + duration: _$$_REQUIRE(_dependencyMap[13]).HIDE_ANIMATION_DURATION, + hideAfter: _$$_REQUIRE(_dependencyMap[13]).HIDE_ANIMATION_TIMER + }; +},2338,[5,6,108,7,8,15,12,14,16,17,201,28,572,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewsMemoryDownloadIcon = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _newsmemoryIcon = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DOWNLOAD_SPINNER_SIZE = 35; + + var NewsMemoryDownloadIcon = function (_NewsMemoryFooterIcon) { + (0, _inherits2.default)(NewsMemoryDownloadIcon, _NewsMemoryFooterIcon); + + var _super = _createSuper(NewsMemoryDownloadIcon); + + function NewsMemoryDownloadIcon(props) { + (0, _classCallCheck2.default)(this, NewsMemoryDownloadIcon); + return _super.call(this, props, { + downloading: props.startProgress > 0 && props.startProgress < 1, + startProgress: props.startProgress, + error: false + }); + } + + (0, _createClass2.default)(NewsMemoryDownloadIcon, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsMemoryDownloadIcon.prototype), "componentDidMount", this).call(this); + this.downloadStartedId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_INITIAL_DOWNLOAD_STARTED, function (_ref) { + var startProgress = _ref.startProgress; + + _this.setState({ + downloading: true, + visible: true, + startProgress: startProgress, + error: false + }); + }); + this.downloadFinishedId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_INITIAL_DOWNLOAD_FINISHED, function (_ref2) { + var status = _ref2.status; + + _this.setState({ + downloading: false, + visible: status < _$$_REQUIRE(_dependencyMap[12]).DBStatus.HIGH_RES_DOWNLOADED, + error: false + }); + }); + this.downloadProgressId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_DOWNLOAD_PROGRESS, function (_ref3) { + var progress = _ref3.progress; + + if (_this.progressCircleRef) { + _this.progressCircleRef.updateProgress(progress); + } else if (progress < 1) { + _this.setState({ + downloading: true, + visible: true, + startProgress: progress, + error: false + }); + } + }); + this.downloadFullEditionId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_DOWNLOAD_FULL_EDITION, function () { + _this.setState({ + downloading: true, + startProgress: 0, + error: false + }); + }); + this.downloadFullStartedId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_FULL_DOWNLOAD_STARTED, function () {}); + this.downloadFullFinishedId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_FULL_DOWNLOAD_FINISHED, function () { + _this.setState({ + downloading: false, + visible: false, + error: false + }); + }); + this.downloadFinishedId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_NEWSPAPER_LOADED, function (_ref4) { + var status = _ref4.status; + + _this.setState({ + downloading: false, + visible: status < _$$_REQUIRE(_dependencyMap[12]).DBStatus.HIGH_RES_DOWNLOADED, + error: false + }); + }); + this.onConnectivityChangeId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.ON_CONNECTIVITY_CHANGE, function () { + _this.forceUpdate(); + }); + this.onHrDownloadErrorId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_HR_DOWNLOAD_ERROR, function () { + var _this$state = _this.state, + error = _this$state.error, + downloading = _this$state.downloading; + + if (!error && !downloading) { + _this.setState({ + error: true + }); + } + }); + this.onHrDownloadSuccessId = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(_events.default.NEWSMEMORY_HR_DOWNLOAD_SUCCESS, function () { + var error = _this.state.error; + + if (error) { + _this.setState({ + error: false + }); + } + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsMemoryDownloadIcon.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.downloadStartedId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.downloadFinishedId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.downloadProgressId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.downloadFullEditionId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.downloadFullStartedId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.downloadFullFinishedId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.downloadFullProgressId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.onConnectivityChangeId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.onHrDownloadErrorId); + + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.onHrDownloadSuccessId); + } + }, { + key: "_onPress", + value: function _onPress() { + var _this$state2 = this.state, + downloading = _this$state2.downloading, + error = _this$state2.error; + + if (error) { + _reactNative.Alert.alert(global.strings("err_download_edition"), global.strings("offline_download_warning")); + } else if (!downloading) { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsMemoryDownloadIcon.prototype), "_onPress", this).call(this); + } + } + }, { + key: "_getIcon", + value: function _getIcon() { + var _this2 = this; + + var _this$props = this.props, + item = _this$props.item, + text = _this$props.text; + var foregroundColor = this.props.foregroundColor; + var _this$state3 = this.state, + downloading = _this$state3.downloading, + startProgress = _this$state3.startProgress, + error = _this$state3.error; + var icon = item.icon; + var library = item.isLibraryIcon() && icon ? item.getLibrary() : undefined; + + if (!_$$_REQUIRE(_dependencyMap[13]).NetworkUtils.isOnline() || error) { + icon = _$$_REQUIRE(_dependencyMap[14]).ACTIONS.warning.icon; + library = undefined; + foregroundColor = error ? _$$_REQUIRE(_dependencyMap[13]).colors.md_red_600 : _$$_REQUIRE(_dependencyMap[13]).colors.md_orange_600; + } else if (downloading) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).ProgressCircle, { + ref: function ref(_ref5) { + _this2.progressCircleRef = _ref5; + }, + spinnerStyle: { + justifyContent: "center", + alignSelf: "center" + }, + spinnerColor: foregroundColor, + spinnerSize: DOWNLOAD_SPINNER_SIZE, + spinnerTextStyle: _$$_REQUIRE(_dependencyMap[16]).styles.imageText, + startProgress: startProgress, + advanced: true, + cssClasses: ["newsmemory-icon", "newsmemory-footer-icon", "newsmemory-footer-icon-downloadEdition", "newsmemory-footer-icon-downloadEdition-spinner"] + }); + } + + return _react.default.createElement(_newsmemoryIcon.default, { + center: text === undefined, + cssIconClasses: ["newsmemory-icon", "newsmemory-footer-icon", "newsmemory-footer-icon-inactive", "newsmemory-footer-icon-downloadEdition", "newsmemory-footer-icon-downloadEdition-inactive"], + icon: icon, + library: library, + foregroundColor: foregroundColor + }); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + return state; + } + }]); + return NewsMemoryDownloadIcon; + }(_$$_REQUIRE(_dependencyMap[17]).NewsMemoryFooterIcon); + + exports.NewsMemoryDownloadIcon = NewsMemoryDownloadIcon; +},2339,[5,7,8,90,12,14,16,17,28,460,2340,572,714,462,1725,1953,2342,2343]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _resolveAssetSource = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _newsmemoryIconText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryIcon = function (_React$PureComponent) { + (0, _inherits2.default)(NewsmemoryIcon, _React$PureComponent); + + var _super = _createSuper(NewsmemoryIcon); + + function NewsmemoryIcon(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryIcon); + _this = _super.call(this, props); + _this.state = { + layout: undefined + }; + return _this; + } + + (0, _createClass2.default)(NewsmemoryIcon, [{ + key: "render", + value: function render() { + var _this2 = this; + + var layout = this.state.layout; + var _this$props = this.props, + foregroundColor = _this$props.foregroundColor, + icon = _this$props.icon, + iconText = _this$props.iconText, + library = _this$props.library, + center = _this$props.center, + cssIconClasses = _this$props.cssIconClasses, + cssTextClasses = _this$props.cssTextClasses, + cssTextParentClasses = _this$props.cssTextParentClasses; + var isRequireIcon = typeof icon === "number"; + var iconComponent; + var height; + + if (layout) { + height = layout.height; + var refDimension = Math.min(layout.width, height); + var fontSize = refDimension * 0.8; + var tintColor = {}; + + if (isRequireIcon) { + tintColor.tintColor = foregroundColor; + } + + if (typeof icon === "number") { + var size = (0, _resolveAssetSource.default)(icon); + height = size.height * Math.min(layout.width / size.width, layout.height / size.height); + } + + iconComponent = _react.default.createElement(_imageIconChooserComponent.default, { + type: library, + name: icon, + iconStyle: { + fontSize: fontSize, + color: foregroundColor + }, + imageStyle: (0, _extends2.default)({ + width: layout.width, + height: height + }, tintColor), + resizeMode: "contain", + forceRNComponent: true, + source: icon + }); + } + + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[13]).styles.imageParent, { + justifyContent: center ? "center" : "flex-end" + }], + onLayout: function onLayout(_ref) { + var nativeEvent = _ref.nativeEvent; + + _this2.setState({ + layout: nativeEvent.layout + }); + } + }, layout ? _react.default.createElement(_reactNative.View, { + style: { + justifyContent: "center", + alignItems: "center", + width: layout.width, + height: height + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: cssIconClasses + }, iconComponent), iconText ? _react.default.createElement(_newsmemoryIconText.default, { + width: layout.width, + height: height, + text: iconText, + foregroundColor: foregroundColor, + cssClasses: cssTextClasses, + cssParentClasses: cssTextParentClasses + }) : null) : null); + } + }]); + return NewsmemoryIcon; + }(_react.default.PureComponent); + + exports.default = NewsmemoryIcon; + NewsmemoryIcon.propTypes = { + icon: _propTypes.default.any.isRequired, + foregroundColor: _propTypes.default.string, + iconText: _propTypes.default.string, + library: _propTypes.default.string, + center: _propTypes.default.bool, + cssIconClasses: _propTypes.default.arrayOf(_propTypes.default.string), + cssTextClasses: _propTypes.default.arrayOf(_propTypes.default.string), + cssTextParentClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }; + NewsmemoryIcon.defaultProps = { + center: false, + cssIconClasses: [], + cssTextClasses: [], + cssTextParentClasses: [] + }; +},2340,[5,6,7,8,12,14,16,17,28,165,201,2341,1970,2342,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryIconText = function (_React$PureComponent) { + (0, _inherits2.default)(NewsmemoryIconText, _React$PureComponent); + + var _super = _createSuper(NewsmemoryIconText); + + function NewsmemoryIconText(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryIconText); + _this = _super.call(this, props); + _this.state = { + textHeight: undefined + }; + return _this; + } + + (0, _createClass2.default)(NewsmemoryIconText, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this$props, width, text, size; + + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _this$props = this.props, width = _this$props.width, text = _this$props.text; + + if (!text) { + _context.next = 11; + break; + } + + _context.prev = 2; + _context.next = 5; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[11]).StringUtils.textSize(text, width, { + fontSize: 12 + })); + + case 5: + size = _context.sent; + this.setState({ + textHeight: size.height + }); + _context.next = 11; + break; + + case 9: + _context.prev = 9; + _context.t0 = _context["catch"](2); + + case 11: + case "end": + return _context.stop(); + } + } + }, null, this, [[2, 9]], Promise); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + width = _this$props2.width, + height = _this$props2.height, + text = _this$props2.text, + foregroundColor = _this$props2.foregroundColor, + cssClasses = _this$props2.cssClasses, + cssParentClasses = _this$props2.cssParentClasses; + var textHeight = this.state.textHeight; + + if (textHeight === undefined) { + return null; + } + + var bottom = (height - textHeight) / 2 - 4; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: cssParentClasses + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[13]).styles.imageTextParent, { + bottom: bottom, + width: width + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: cssClasses + }, _react.default.createElement(_fontText.default, { + supportFontScaling: false, + style: [_$$_REQUIRE(_dependencyMap[13]).styles.imageText, { + color: foregroundColor + }], + textAlignVertical: "bottom" + }, text)))); + } + }]); + return NewsmemoryIconText; + }(_react.default.PureComponent); + + exports.default = NewsmemoryIconText; + NewsmemoryIconText.propTypes = { + width: _propTypes.default.number, + height: _propTypes.default.number, + text: _propTypes.default.string, + foregroundColor: _propTypes.default.string, + cssClasses: _propTypes.default.arrayOf(_propTypes.default.string), + cssParentClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }; + NewsmemoryIconText.defaultProps = { + cssClasses: [], + cssParentClasses: [] + }; +},2341,[5,80,7,8,12,14,16,17,201,28,1879,462,699,2342]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = exports.LIBRARY_ICON_PADDING_VERTICAL = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var LIBRARY_ICON_PADDING_VERTICAL = 8; + exports.LIBRARY_ICON_PADDING_VERTICAL = LIBRARY_ICON_PADDING_VERTICAL; + + var styles = _reactNative.StyleSheet.create({ + parent: { + flex: 1, + padding: 6 + }, + touchable: { + flex: 1 + }, + imageParent: { + flex: 1, + alignItems: "center" + }, + imageTextParent: { + position: "absolute", + alignItems: "center" + }, + imageText: { + fontSize: 12 + }, + text: { + fontSize: 12 + } + }); + + exports.styles = styles; +},2342,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewsMemoryFooterIcon = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _newsmemoryIcon = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsMemoryFooterIcon = function (_Shortcut) { + (0, _inherits2.default)(NewsMemoryFooterIcon, _Shortcut); + + var _super = _createSuper(NewsMemoryFooterIcon); + + function NewsMemoryFooterIcon(props) { + var _this; + + var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + (0, _classCallCheck2.default)(this, NewsMemoryFooterIcon); + _this = _super.call(this, props); + _this.onPress = _this._onPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.highlight = _this._highlight.bind((0, _assertThisInitialized2.default)(_this)); + _this.isVisible = _this._isVisible.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = (0, _extends2.default)({ + active: props.active, + visible: props.visible, + highlighted: false + }, state); + return _this; + } + + (0, _createClass2.default)(NewsMemoryFooterIcon, [{ + key: "_handleShortcut", + value: function _handleShortcut() { + var highlighted = this.state.highlighted; + + if (highlighted) { + return [{ + callback: this.onPress, + keys: ["ENTER"], + stopPropagation: true + }]; + } + + return []; + } + }, { + key: "_onPress", + value: function _onPress() { + var _this$props = this.props, + onItemClick = _this$props.onItemClick, + item = _this$props.item; + + if (typeof onItemClick === "function") { + onItemClick(item); + } + } + }, { + key: "_getIcon", + value: function _getIcon() { + var _this$props2 = this.props, + text = _this$props2.text, + foregroundColor = _this$props2.foregroundColor, + iconText = _this$props2.iconText, + item = _this$props2.item; + var _this$state = this.state, + active = _this$state.active, + highlighted = _this$state.highlighted; + var icon = active && item.activeIcon ? item.activeIcon : item.icon; + var libraryProps = {}; + + if (item.isLibraryIcon()) { + libraryProps.library = item.getLibrary(); + } + + return _react.default.createElement(_newsmemoryIcon.default, (0, _extends2.default)({ + center: text === undefined, + icon: icon, + foregroundColor: highlighted ? _$$_REQUIRE(_dependencyMap[14]).colors.white : foregroundColor, + iconText: iconText, + cssIconClasses: ["newsmemory-icon", "newsmemory-footer-icon", active ? "newsmemory-footer-icon-active" : "newsmemory-footer-icon-inactive", "newsmemory-footer-icon-" + item.action, active ? "newsmemory-footer-icon-" + item.action + "-active" : "newsmemory-footer-icon-" + item.action + "-inactive"], + cssTextClasses: ["newsmemory-text", "newsmemory-footer-text", "newsmemory-footer-icon-text", active ? "newsmemory-footer-icon-text-active" : "newsmemory-footer-icon-text-inactive", "newsmemory-footer-icon-" + item.action + "-text", active ? "newsmemory-footer-icon-" + item.action + "-text-active" : "newsmemory-footer-icon-" + item.action + "-text-inactive"], + cssTextParentClasses: ["newsmemory-footer-icon-text-parent", active ? "newsmemory-footer-icon-text-parent-active" : "newsmemory-footer-icon-text-parent-inactive", "newsmemory-footer-icon-" + item.action + "-text-parent", active ? "newsmemory-footer-icon-" + item.action + "-text-parent-active" : "newsmemory-footer-icon-" + item.action + "-text-parent-inactive"] + }, libraryProps)); + } + }, { + key: "_highlight", + value: function _highlight(highlighted) { + return _regenerator.default.async(function _highlight$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + return _context.abrupt("return", this.setStatePromise({ + highlighted: highlighted + })); + + case 1: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_isVisible", + value: function _isVisible() { + var visible = this.state.visible; + return visible; + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + text = _this$props3.text, + accessibilityLabel = _this$props3.accessibilityLabel, + backgroundColor = _this$props3.backgroundColor, + foregroundColor = _this$props3.foregroundColor, + maxSize = _this$props3.maxSize, + parentStyle = _this$props3.parentStyle, + item = _this$props3.item; + var _this$state2 = this.state, + visible = _this$state2.visible, + active = _this$state2.active, + highlighted = _this$state2.highlighted; + var padding = _$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isTablet() ? 2 : 6; + var touchableStyle = { + flex: 1 + }; + + if (maxSize) { + touchableStyle.maxWidth = maxSize; + touchableStyle.maxHeight = maxSize; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-footer-element"], + toggle: true, + cssKey: item.action, + active: active + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[16]).styles.parent, { + justifyContent: "center", + backgroundColor: highlighted ? _$$_REQUIRE(_dependencyMap[14]).colors.keyboardHighlight : backgroundColor, + padding: padding + }, parentStyle] + }, visible ? _react.default.createElement(_reactNative.TouchableOpacity, { + style: touchableStyle, + onPress: this.onPress, + accessibilityLabel: accessibilityLabel + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, this._getIcon()), text ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-text", "newsmemory-footer-text"], + toggle: true, + active: active + }, _react.default.createElement(_fontText.default, { + numberOfLines: 1, + ellipsizeMode: "tail", + style: [_$$_REQUIRE(_dependencyMap[16]).styles.text, { + color: highlighted ? _$$_REQUIRE(_dependencyMap[14]).colors.white : foregroundColor, + textAlign: "center" + }] + }, text)) : null) : null)); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + if (props.active !== state.active || props.visible !== state.visible) { + return (0, _extends2.default)({}, state, { + active: props.active, + visible: props.visible + }); + } + + return state; + } + }]); + return NewsMemoryFooterIcon; + }(_$$_REQUIRE(_dependencyMap[17]).Shortcut); + + exports.NewsMemoryFooterIcon = NewsMemoryFooterIcon; + NewsMemoryFooterIcon.propTypes = (0, _extends2.default)({ + active: _propTypes.default.bool, + visible: _propTypes.default.bool, + text: _propTypes.default.string, + accessibilityLabel: _propTypes.default.string, + iconText: _propTypes.default.string, + maxSize: _propTypes.default.number, + backgroundColor: _propTypes.default.string, + foregroundColor: _propTypes.default.string, + onItemClick: _propTypes.default.func.isRequired, + item: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[18]).Icon).isRequired, + parentStyle: _propTypes.default.any + }, _$$_REQUIRE(_dependencyMap[17]).Shortcut.propTypes); + NewsMemoryFooterIcon.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[17]).Shortcut.defaultProps, { + active: false, + visible: true + }); +},2343,[5,80,6,7,8,15,12,14,16,17,201,28,1879,2340,462,699,2342,1911,1805]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + var _closeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _searchComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _EPaperArticle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _emptyComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _shortcutList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemorySearch = function (_Shortcut) { + (0, _inherits2.default)(NewsmemorySearch, _Shortcut); + + var _super = _createSuper(NewsmemorySearch); + + function NewsmemorySearch(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemorySearch); + _this = _super.call(this, props); + _this.keyword = props.searchedTerm; + _this.close = _this._close.bind((0, _assertThisInitialized2.default)(_this)); + _this.search = _this._search.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSearch = _this._onSearch.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSearchInputRef = _this._onSearchInputRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSearchInputBlur = _this._onSearchInputBlur.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + items: _this.search(_this.keyword), + error: !props.edition + }; + return _this; + } + + (0, _createClass2.default)(NewsmemorySearch, [{ + key: "_onSearchInputRef", + value: function _onSearchInputRef(ref) { + this.searchInput = ref; + } + }, { + key: "_onSearchInputBlur", + value: function _onSearchInputBlur() { + if (!this.keyword && this.searchInput) { + this.searchInput._onFocus(); + } + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var CLOSE = _$$_REQUIRE(_dependencyMap[21]).KEY_GROUPS.CLOSE, + ANY = _$$_REQUIRE(_dependencyMap[21]).KEY_GROUPS.ANY; + + return [{ + callback: this.close, + keys: CLOSE, + stopPropagation: true + }, { + callback: this.noop, + keys: ANY, + stopPropagation: true + }]; + } + }, { + key: "_getEdition", + value: function _getEdition() { + var edition = this.props.edition; + return edition; + } + }, { + key: "_search", + value: function _search(keyword) { + var edition = this._getEdition(); + + var found = []; + + if (keyword) { + edition.getPages().forEach(function (page) { + if (page) { + page.getArticles().forEach(function (article) { + if (article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL && (article.getTitle().toLowerCase().includes(keyword.toLowerCase()) || article.getHtml().toLowerCase().includes(keyword.toLowerCase()))) { + found.push({ + page: _pageUtils.default.removeZerosFromPageNumber(page.getShownPage()), + article: article + }); + } + }); + } + }); + } + + return found; + } + }, { + key: "_onSearch", + value: function _onSearch(keyword) { + this.keyword = keyword; + this.setState({ + items: this.search(keyword) + }); + } + }, { + key: "_getEmpty", + value: function _getEmpty() { + return _react.default.createElement(_emptyComponent.default, { + color: _$$_REQUIRE(_dependencyMap[22]).HEADER_BG_COLOR, + message: this.keyword ? global.strings("msg_search_not_found", { + text: this.keyword + }) : global.strings("msg_search_empty"), + cssClassesContainer: ["newsmemory-search-result-empty-container"], + cssClassesParent: ["newsmemory-search-result-empty-parent"], + cssClassesText: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-result-empty"] + }); + } + }, { + key: "_getError", + value: function _getError() { + return _react.default.createElement(_emptyComponent.default, { + color: _$$_REQUIRE(_dependencyMap[22]).HEADER_BG_COLOR, + message: global.strings("msg_error_newspaper"), + cssClassesContainer: ["newsmemory-search-result-error-container"], + cssClassesParent: ["newsmemory-search-result-error-parent"], + cssClassesText: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-result-error"] + }); + } + }, { + key: "_close", + value: function _close() { + var onClose = this.props.onClose; + + if (typeof onClose === "function") { + onClose(); + } + } + }, { + key: "_getCloseButton", + value: function _getCloseButton() { + var model = this.props.model; + var buttonProps = {}; + + if (model) { + var rightSection = model.getRight(); + + if (rightSection) { + var buttons = rightSection.getButtons(); + var closeButton = buttons.find(function (button) { + return button.getAction() === _$$_REQUIRE(_dependencyMap[23]).ACTIONS.closeArticle.key; + }); + + if (closeButton) { + var source = closeButton.getIcon(); + + if (closeButton.isLibraryIcon() && source) { + var library = closeButton.getLibrary(); + buttonProps = { + library: library, + source: source + }; + } + } + } + } + + return _react.default.createElement(_closeComponent.default, (0, _extends2.default)({}, buttonProps, { + cssProps: { + classes: ["newsmemory-icon", "newsmemory-search-close-icon"] + }, + onPress: this.close + })); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + onItemClick = _this$props.onItemClick, + issueText = _this$props.issueText, + shortcutPriority = _this$props.shortcutPriority; + var _this$state = this.state, + items = _this$state.items, + error = _this$state.error; + + var color = _$$_REQUIRE(_dependencyMap[24]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search-container"] + }, _react.default.createElement(_reactNative.View, { + style: _searchComponent.default.parent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search-title-container"] + }, _react.default.createElement(_reactNative.View, { + style: [_searchComponent.default.titleContainer, { + borderBottomColor: color + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-title"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: [_searchComponent.default.title, { + color: color + }] + }, issueText)), this._getCloseButton())), error ? this._getError() : _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search-input"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).SearchInput, { + ref: this.onSearchInputRef, + onSearch: this.onSearch, + placeholder: global.strings("str_search"), + mainColor: color, + autoFocus: true, + onBlur: this.onSearchInputBlur + })), !error && items.length ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search-header-container"] + }, _react.default.createElement(_reactNative.View, { + style: [_searchComponent.default.subTitleContainer, { + backgroundColor: color + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-subtitle"] + }, _react.default.createElement(_fontText.default, { + style: _searchComponent.default.subTitle + }, global.strings("str_search_results", { + text: this.keyword, + count: items.length + }))))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search-list"] + }, _react.default.createElement(_shortcutList.default, { + keyExtractor: function keyExtractor(item, index) { + return "search_item_" + index; + }, + data: items, + plainData: items, + onPress: function onPress(item, index) { + if (typeof onItemClick === "function") { + onItemClick(_this2.keyword, index, items); + + if (_$$_REQUIRE(_dependencyMap[26]).PlatformUtils.isIOS()) { + _LiveConfig.default.keyUp({ + keyCode: 40 + }); + + _LiveConfig.default.keyUp({ + keyCode: 88 + }); + } + } + }, + shortcutPriority: shortcutPriority + 1, + ItemSeparatorComponent: function ItemSeparatorComponent() { + return (0, _$$_REQUIRE(_dependencyMap[27]).hr)(_searchComponent.default.hr, "newsmemory-search-item-separator"); + }, + ListHeaderComponent: _react.default.createElement(_reactNative.View, { + style: _searchComponent.default.item + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-header-page"] + }, _react.default.createElement(_fontText.default, { + style: _searchComponent.default.itemPage + }, global.strings("str_page"))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text"] + }, _react.default.createElement(_fontText.default, { + style: _searchComponent.default.itemSeparator + }, " ")), _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-header-title"] + }, _react.default.createElement(_fontText.default, { + style: _searchComponent.default.itemText + }, global.strings("str_title")))), + renderItem: function renderItem(_ref) { + var item = _ref.item, + index = _ref.index, + focusedItem = _ref.focusedItem; + + var focused = _$$_REQUIRE(_dependencyMap[26]).JSUtils.equals(item, focusedItem); + + var focusedStyle = {}; + + if (focused) { + focusedStyle.backgroundColor = _$$_REQUIRE(_dependencyMap[26]).colors.keyboardHighlight; + } + + return _react.default.createElement(_reactNative.TouchableOpacity, { + style: [_searchComponent.default.item, focusedStyle], + onPress: function onPress() { + if (typeof onItemClick === "function") { + onItemClick(_this2.keyword, index, items); + } + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-result-page"] + }, _react.default.createElement(_fontText.default, { + style: _searchComponent.default.itemPage + }, item.page ? item.page : "")), _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-result-bullet"] + }, _react.default.createElement(_fontText.default, { + style: _searchComponent.default.itemSeparator + }, _$$_REQUIRE(_dependencyMap[26]).StringUtils.BULLET)), _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-search", "newsmemory-search-text", "newsmemory-search-result-title"] + }, _react.default.createElement(_fontText.default, { + style: _searchComponent.default.itemText + }, item.article ? "" + item.article.getTitle() : ""))); + } + }))) : null, !error && !items.length ? this._getEmpty() : null)); + } + }]); + return NewsmemorySearch; + }(_$$_REQUIRE(_dependencyMap[28]).Shortcut); + + exports.default = NewsmemorySearch; + NewsmemorySearch.propTypes = (0, _extends2.default)({ + searchedTerm: _propTypes.default.string, + edition: _propTypes.default.instanceOf(_Edition.default).isRequired, + onClose: _propTypes.default.func.isRequired, + onItemClick: _propTypes.default.func.isRequired, + issueText: _propTypes.default.string.isRequired, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }).isRequired, + model: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[29]).Header).isRequired + }, _$$_REQUIRE(_dependencyMap[28]).Shortcut.propTypes); +},2344,[5,6,7,8,15,12,14,16,17,201,28,1879,2298,2345,640,638,2220,644,715,1872,1908,1873,729,1725,699,2279,462,2195,1911,1853]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + parent: { + flex: 1, + flexDirection: "column" + }, + titleContainer: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_HEIGHT, + flexDirection: "row", + alignItems: "center", + borderBottomWidth: _$$_REQUIRE(_dependencyMap[1]).HEADER_HR_SIZE, + borderBottomColor: _$$_REQUIRE(_dependencyMap[2]).colors.black + }, + title: { + paddingHorizontal: 10, + fontSize: _$$_REQUIRE(_dependencyMap[1]).TITLE_SIZE, + color: _$$_REQUIRE(_dependencyMap[2]).colors.black, + flex: 1 + }, + subTitleContainer: { + height: _$$_REQUIRE(_dependencyMap[1]).SUB_HEADER_HEIGHT, + flexDirection: "row", + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.black, + alignItems: "center" + }, + subTitle: { + color: _$$_REQUIRE(_dependencyMap[2]).colors.white, + paddingHorizontal: 10, + fontSize: _$$_REQUIRE(_dependencyMap[1]).INFO_SIZE, + flex: 1 + }, + hr: { + height: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_SEPARATOR_HEIGHT, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_SEPARATOR_COLOR + }, + item: { + flexDirection: "row", + minHeight: _$$_REQUIRE(_dependencyMap[1]).LIST_ITEM_HEIGHT, + alignItems: "center", + padding: 5 + }, + itemPage: { + fontSize: _$$_REQUIRE(_dependencyMap[1]).SEARCH_TEXT_SIZE, + color: _$$_REQUIRE(_dependencyMap[1]).SEARCH_COLOR, + paddingHorizontal: 5 + }, + itemSeparator: { + fontSize: _$$_REQUIRE(_dependencyMap[1]).SEARCH_TEXT_SIZE, + color: _$$_REQUIRE(_dependencyMap[1]).SEARCH_COLOR + }, + itemText: { + flex: 1, + fontSize: _$$_REQUIRE(_dependencyMap[1]).SEARCH_TEXT_SIZE, + paddingHorizontal: 5, + color: _$$_REQUIRE(_dependencyMap[1]).SEARCH_COLOR + } + }); + + exports.default = _default; +},2345,[28,729,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _reactNativeSectionListGetItemLayout = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _thumbnailComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[17])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NO_LETTERS = "no_letters"; + + var NewsmemoryThumbnail = function (_Shortcut) { + (0, _inherits2.default)(NewsmemoryThumbnail, _Shortcut); + + var _super = _createSuper(NewsmemoryThumbnail); + + function NewsmemoryThumbnail(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryThumbnail); + _this = _super.call(this, props); + _this.sectionItemsRefs = []; + _this.itemLayout = (0, _reactNativeSectionListGetItemLayout.default)({ + getItemHeight: _thumbnailComponent._getSectionItemHeight, + getSeparatorHeight: function getSeparatorHeight() { + return 0; + }, + getSectionHeaderHeight: function getSectionHeaderHeight() { + return 0; + }, + getSectionFooterHeight: function getSectionFooterHeight() { + return 0; + } + }); + _this.state = { + focusedPageId: props.currentPageId + }; + _this.thumbnails = _this._getThumbnails(); + _this.isGridMode = _this._isGridMode(); + _this.content = _this._getContent(); + _this.onSectionItemsRef = _this._onSectionItemsRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSectionsRef = _this._onSectionsRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.focusRightThumbnail = _this._focusRightThumbnail.bind((0, _assertThisInitialized2.default)(_this)); + _this.focusLeftThumbnail = _this._focusLeftThumbnail.bind((0, _assertThisInitialized2.default)(_this)); + _this.selectFocusedThumbnail = _this._selectFocusedThumbnail.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(NewsmemoryThumbnail, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.onConnectivityChangeListener = _$$_REQUIRE(_dependencyMap[24]).EventRegister.on(_events.default.ON_CONNECTIVITY_CHANGE, function (_ref) { + var online = _ref.online; + + var _global$getActivePSet = global.getActivePSetup(), + maxSharesCheckType = _global$getActivePSet.maxSharesCheckType; + + if (maxSharesCheckType === _$$_REQUIRE(_dependencyMap[25]).MAX_SHARE_CHECK_TYPES.REMOTE) { + _$$_REQUIRE(_dependencyMap[24]).EventRegister.emit(_events.default.SHARE_CHANGE_BUTTON_VISIBILITY, { + disabled: !online + }); + } + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryThumbnail.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[24]).EventRegister.emit(_events.default.ON_THUMBNAIL_CLOSE); + + _$$_REQUIRE(_dependencyMap[24]).EventRegister.rm(_events.default.SHARE_CHANGE_BUTTON_VISIBILITY); + } + }, { + key: "_onSectionsRef", + value: function _onSectionsRef(ref) { + this.sectionsRef = ref; + } + }, { + key: "_onSectionItemsRef", + value: function _onSectionItemsRef(ref, index) { + this.sectionItemsRefs[index] = ref; + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var LEFT = _$$_REQUIRE(_dependencyMap[26]).KEY_GROUPS.LEFT, + RIGHT = _$$_REQUIRE(_dependencyMap[26]).KEY_GROUPS.RIGHT, + SELECT = _$$_REQUIRE(_dependencyMap[26]).KEY_GROUPS.SELECT; + + return [{ + callbackRepeat: this.focusLeftThumbnail, + keys: LEFT + }, { + callbackRepeat: this.focusRightThumbnail, + keys: RIGHT + }, { + callback: this.selectFocusedThumbnail, + keys: SELECT + }]; + } + }, { + key: "_getPageFromId", + value: function _getPageFromId(pageId) { + var newspaper = this.props.newspaper; + var pages = newspaper.getPages(); + return pages.find(function (page) { + return page.getPageId() === pageId; + }); + } + }, { + key: "_getCurrentFocusedPageIndex", + value: function _getCurrentFocusedPageIndex() { + var newspaper = this.props.newspaper; + var focusedPageId = this.state.focusedPageId; + var pages = newspaper.getPages(); + + for (var i = 0; i < pages.length; i++) { + if (pages[i].getPageId() === focusedPageId) { + return i; + } + } + + return 0; + } + }, { + key: "_focusLeftThumbnail", + value: function _focusLeftThumbnail() { + var newspaper, pages, newFocusedPagedId; + return _regenerator.default.async(function _focusLeftThumbnail$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + newspaper = this.props.newspaper; + pages = newspaper.getPages(); + newFocusedPagedId = pages[Math.max(0, this._getCurrentFocusedPageIndex() - 1)].getPageId(); + + this._setFocusedThumbnail(newFocusedPagedId); + + this._scrollToFocused(newFocusedPagedId); + + return _context.abrupt("return", this.setStatePromise({ + focusedPageId: newFocusedPagedId + })); + + case 6: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_focusRightThumbnail", + value: function _focusRightThumbnail() { + var newspaper, pages, newFocusedPagedId; + return _regenerator.default.async(function _focusRightThumbnail$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + newspaper = this.props.newspaper; + pages = newspaper.getPages(); + newFocusedPagedId = pages[Math.min(pages.length - 1, this._getCurrentFocusedPageIndex() + 1)].getPageId(); + + this._setFocusedThumbnail(newFocusedPagedId); + + this._scrollToFocused(newFocusedPagedId); + + return _context2.abrupt("return", this.setStatePromise({ + focusedPageId: newFocusedPagedId + })); + + case 6: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_scrollToFocused", + value: function _scrollToFocused(focusedPageId) { + if (this.sectionsRef) { + var _this$_getPositionOfA = this._getPositionOfActiveItem(this.content, this._itemChecker, focusedPageId), + sectionIndex = _this$_getPositionOfA.sectionIndex, + sectionRowIndex = _this$_getPositionOfA.sectionRowIndex, + sectionRowItemIndex = _this$_getPositionOfA.sectionRowItemIndex; + + if (!this.isGridMode) { + this.sectionsRef.scrollToLocation({ + itemIndex: 0, + sectionIndex: sectionIndex + }); + + if (this.sectionItemsRefs[sectionIndex]) { + this.sectionItemsRefs[sectionIndex].scrollToIndex({ + index: sectionRowItemIndex + }); + } + } else { + this.sectionsRef.scrollToLocation({ + itemIndex: sectionRowIndex, + sectionIndex: sectionIndex + }); + } + } + } + }, { + key: "_setFocusedThumbnail", + value: function _setFocusedThumbnail(focusedPageId) { + Object.values(this.thumbnails).forEach(function (section) { + section.forEach(function (thumbnails) { + thumbnails.forEach(function (thumbnail) { + thumbnail.setFocused(thumbnail.getPage().getPageId() === focusedPageId); + }); + }); + }); + } + }, { + key: "_selectFocusedThumbnail", + value: function _selectFocusedThumbnail() { + var onItemClick = this.props.onItemClick; + var focusedPageId = this.state.focusedPageId; + + if (typeof onItemClick === "function") { + var page = this._getPageFromId(focusedPageId); + + if (page) { + onItemClick(page); + } + } + } + }, { + key: "_getSectionLetterFromPage", + value: function _getSectionLetterFromPage(page) { + var letters = _pageUtils.default.getSectionLetterFromPage(page); + + return letters.length ? letters : NO_LETTERS; + } + }, { + key: "_getThumbnails", + value: function _getThumbnails() { + var _this2 = this; + + var _this$props = this.props, + downloadImageMethod = _this$props.downloadImageMethod, + currentPageId = _this$props.currentPageId, + newspaper = _this$props.newspaper; + var focusedPageId = this.state.focusedPageId; + + if (newspaper) { + var edition = newspaper.getEditionModel(); + var pages = edition.getPages(); + + var baseLocalPath = _tecnaviaFileUtils.default.getNewspaperBaseDirectory(); + + var baseEditionPath = "" + baseLocalPath + edition.getPaper() + "/" + edition.getIssue(); + var result = pages.reduce(function (object, page) { + var localPath = "file://" + baseEditionPath + "/" + page.getFilename() + "/low.jpg"; + + var letters = _this2._getSectionLetterFromPage(page.getPage()); + + if (!Array.isArray(object[letters])) { + object[letters] = []; + } + + var thumbnail = new (_$$_REQUIRE(_dependencyMap[27]).Thumbnail)(); + thumbnail.setSize(_newsmemoryUtils.default.getPageSizeFixed(edition, page)); + thumbnail.setLocalPath(localPath); + thumbnail.setDownloadMethod(function _callee() { + var image; + return _regenerator.default.async(function _callee$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!(typeof downloadImageMethod === "function")) { + _context3.next = 8; + break; + } + + image = new _EPaperImage.default(); + image.setPageId(page.getPageId()); + image.setType(_EPaperImage.EPaperImageType.LOW); + _context3.next = 6; + return _regenerator.default.awrap(downloadImageMethod(page, image)); + + case 6: + _context3.next = 9; + break; + + case 8: + throw new Error("Missing fallback method to download low image"); + + case 9: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + }); + thumbnail.setSelected(page.getPageId() === currentPageId); + thumbnail.setFocused(page.getPageId() === focusedPageId); + thumbnail.setPage(page); + object[letters].push(thumbnail); + return object; + }, {}); + result = Object.keys(result).reduce(function (object, key) { + if (result[key] && result[key].length) { + var thumbnail = result[key][0]; + + var section = _$$_REQUIRE(_dependencyMap[28]).StringUtils.decodeHTML(thumbnail.getPage().getSection()); + + var sectionPages = []; + var i = 0; + + while (i < result[key].length) { + if (i === 0 || i === result[key].length - 1 || result[key][i].page.isDoubleTruck() || result[key][i + 1] && result[key][i + 1].page.isDoubleTruck()) { + sectionPages.push([result[key][i]]); + i += 1; + } else { + sectionPages.push([result[key][i], result[key][i + 1]]); + i += 2; + } + } + + if (Array.isArray(object[section])) { + var _object$section; + + (_object$section = object[section]).push.apply(_object$section, sectionPages); + } else { + object[section] = sectionPages; + } + } + + return object; + }, {}); + return result; + } + + return {}; + } + }, { + key: "_getLowFromPage", + value: function _getLowFromPage(page) { + return _newsmemoryUtils.default.getImageFromPage(page, _EPaperImage.EPaperImageType.LOW); + } + }, { + key: "_getSectionsPageSize", + value: function _getSectionsPageSize(sections) { + var _this$props2 = this.props, + size = _this$props2.size, + newspaper = _this$props2.newspaper; + var windowWidth = size.width, + windowHeight = size.height; + var availableSpace = windowWidth - _thumbnailComponent.THUMBNAIL_MARGIN * 2; + var edition = newspaper.getEditionModel(); + var referenceHeight = (0, _thumbnailComponent._getThumbnailHeight)(); + var minimumHeight = Math.max(windowWidth, windowHeight) / 5; + var height = Math.min(Math.max(referenceHeight, minimumHeight), referenceHeight * 1.5); + return Object.values(sections).map(function (section) { + var maxWidth = 0; + section.forEach(function (thumbnails) { + for (var i = 0; i < thumbnails.length; i++) { + var thumbnailWidth = (0, _thumbnailComponent._getThumbnailWidth)(edition, thumbnails[i].getPage(), availableSpace, height); + + if (thumbnails[i].getPage().isDoubleTruck()) { + thumbnailWidth /= 2; + } + + if (thumbnailWidth > maxWidth) { + maxWidth = thumbnailWidth; + } + } + }); + return { + width: maxWidth, + height: height + }; + }); + } + }, { + key: "_updateAndGetThumbnailsSize", + value: function _updateAndGetThumbnailsSize(thumbnails, sectionPageSize) { + var thumbnailsWidth = 0; + thumbnails.forEach(function (thumbnail) { + var width = sectionPageSize.width; + + if (thumbnail.getPage().isDoubleTruck()) { + width *= 2; + } + + thumbnailsWidth += width; + thumbnail.getSize().width = width; + thumbnail.getSize().height = sectionPageSize.height; + return thumbnail; + }); + var page = thumbnails[0].page; + + if (thumbnails.length < 2 && !page.isDoubleTruck()) { + thumbnailsWidth *= 2; + } + + thumbnailsWidth = thumbnailsWidth || 0; + return thumbnailsWidth + _thumbnailComponent.THUMBNAIL_MARGIN * 2; + } + }, { + key: "_getSectionsGrid", + value: function _getSectionsGrid(sections) { + var _this3 = this; + + var _this$props3 = this.props, + size = _this$props3.size, + newspaper = _this$props3.newspaper; + + if (newspaper) { + var windowWidth = size.width; + + var sectionsPageSize = this._getSectionsPageSize(sections); + + return Object.keys(sections).map(function (key, index) { + var sectionPageSize = sectionsPageSize[index]; + var row = { + title: key, + data: [], + maxWidth: -1 + }; + var newArrayIndex = 0; + var availableSpace = row.maxWidth; + sections[key].forEach(function (thumbnails, thumbIndex) { + var thumbnailsWidth = _this3._updateAndGetThumbnailsSize(thumbnails, sectionPageSize); + + var maxWidth = Math.ceil(Math.floor(windowWidth / thumbnailsWidth) * thumbnailsWidth); + + if (row.maxWidth < 0) { + row.maxWidth = maxWidth; + availableSpace = maxWidth; + } + + availableSpace -= thumbnailsWidth; + + if (availableSpace < 0 && thumbIndex > 0) { + availableSpace = Math.max(row.maxWidth - thumbnailsWidth, 0); + newArrayIndex += 1; + } + + if (!Array.isArray(row.data[newArrayIndex])) { + row.data[newArrayIndex] = []; + } + + row.data[newArrayIndex].push(thumbnails); + }); + return row; + }); + } + + return []; + } + }, { + key: "_getSectionsHorizontalList", + value: function _getSectionsHorizontalList(sections) { + return Object.keys(sections).map(function (key) { + return { + title: key, + data: [sections[key]] + }; + }); + } + }, { + key: "_getSpecial", + value: function _getSpecial() { + var SpecialComponent = this.props.SpecialComponent; + return { + title: global.strings("str_special_sections"), + data: [_react.default.createElement(_reactNative.View, null, SpecialComponent)], + isSpecial: true + }; + } + }, { + key: "_itemChecker", + value: function _itemChecker(row, currentPageId) { + if (Array.isArray(row)) { + var index = row.findIndex(function (thumbnails) { + var found = thumbnails.find(function (thumbnail) { + return thumbnail.getPage().getPageId() === currentPageId; + }); + return found !== undefined; + }); + return index; + } + + return 0; + } + }, { + key: "_getPositionOfActiveItem", + value: function _getPositionOfActiveItem(sections, itemsChecker, pageId) { + var itemsBeforeSelected = 0; + var sectionRowItemIndex = 0; + var sectionRowIndex = 0; + var sectionIndex = sections.findIndex(function (_ref2) { + var data = _ref2.data; + sectionRowIndex = data.findIndex(function (row) { + var activeIndex = itemsChecker(row, pageId); + + if (activeIndex > -1) { + sectionRowItemIndex = activeIndex; + } + + return activeIndex > -1; + }); + + if (sectionRowIndex > -1) { + itemsBeforeSelected += sectionRowIndex + 1; + return true; + } + + itemsBeforeSelected += data.length; + return false; + }); + return { + totalIndex: itemsBeforeSelected + sectionIndex, + sectionIndex: sectionIndex, + sectionRowIndex: sectionRowIndex, + sectionRowItemIndex: sectionRowItemIndex + }; + } + }, { + key: "_getContent", + value: function _getContent() { + var SpecialComponent = this.props.SpecialComponent; + var content; + + if (this.isGridMode) { + content = this._getSectionsGrid(this.thumbnails); + } else { + content = this._getSectionsHorizontalList(this.thumbnails); + } + + if (SpecialComponent) { + content.push(this._getSpecial()); + } + + return content; + } + }, { + key: "_isGridMode", + value: function _isGridMode() { + var numberOfSections = Object.keys(this.thumbnails).length; + + var _global$getActivePSet2 = global.getActivePSetup(), + scrollTiles = _global$getActivePSet2.scrollTiles; + + var gridMode; + + if (scrollTiles === 2) { + gridMode = numberOfSections < 3; + } else { + gridMode = scrollTiles !== 1; + } + + return gridMode; + } + }, { + key: "_getSectionIndex", + value: function _getSectionIndex(title) { + return Math.max(0, this.content.findIndex(function (section) { + return section.title === title; + })); + } + }, { + key: "_renderContent", + value: function _renderContent() { + var _this4 = this; + + var newspaper = this.props.newspaper; + + if (!newspaper) { + return null; + } + + var _this$props4 = this.props, + onItemClick = _this$props4.onItemClick, + currentPageId = _this$props4.currentPageId; + + var _global$getActivePSet3 = global.getActivePSetup(), + showEditionThumbs = _global$getActivePSet3.showEditionThumbs; + + var _this$_getPositionOfA2 = this._getPositionOfActiveItem(this.content, this._itemChecker, currentPageId), + totalIndex = _this$_getPositionOfA2.totalIndex; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[29]).TecnaviaSectionList, { + ref: this.onSectionsRef, + stickySectionHeadersEnabled: true, + sections: this.content, + initialScrollIndex: totalIndex, + getItemLayout: this.itemLayout, + keyExtractor: _$$_REQUIRE(_dependencyMap[30])._rowKeyExtractor, + renderItem: function renderItem(_ref3) { + var item = _ref3.item, + index = _ref3.index, + section = _ref3.section; + + if (Array.isArray(item)) { + var title = section.title, + data = section.data; + + var addPlaceholder = _$$_REQUIRE(_dependencyMap[30]).PLACEHOLDER_POSITION.NONE; + + var style = {}; + + if (_this4.isGridMode) { + var maxWidth; + + if (section) { + maxWidth = section.maxWidth; + } + + style = { + width: maxWidth || "100%", + alignSelf: "center" + }; + + if (index === 0) { + var firstPage = newspaper.getEditionModel().getFirstPage(); + + if (firstPage && firstPage.isDoubleTruck()) { + addPlaceholder = _$$_REQUIRE(_dependencyMap[30]).PLACEHOLDER_POSITION.NONE; + } else { + addPlaceholder = _$$_REQUIRE(_dependencyMap[30]).PLACEHOLDER_POSITION.LEFT; + } + } else if (index === data.length - 1 && item.length === 1) { + addPlaceholder = _$$_REQUIRE(_dependencyMap[30]).PLACEHOLDER_POSITION.RIGHT; + } + } + + return (0, _$$_REQUIRE(_dependencyMap[30])._getHorizontalList)(function (ref) { + return _this4.onSectionItemsRef(ref, _this4._getSectionIndex(title)); + }, item, onItemClick, newspaper, _this4._itemChecker(item, currentPageId), addPlaceholder, style); + } + + return item; + }, + renderSectionHeader: function renderSectionHeader(_ref4) { + var _ref4$section = _ref4.section, + title = _ref4$section.title, + isSpecial = _ref4$section.isSpecial; + + if (showEditionThumbs) { + return (0, _$$_REQUIRE(_dependencyMap[30])._getSectionView)(title, isSpecial); + } + + return null; + } + }); + } + }, { + key: "render", + value: function render() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[31]).Css, { + classes: ["newsmemory-thumbnails-container"] + }, _react.default.createElement(_reactNative.View, { + style: _thumbnailComponent.default.container + }, this._renderContent())); + } + }]); + return NewsmemoryThumbnail; + }(_$$_REQUIRE(_dependencyMap[32]).Shortcut); + + exports.default = NewsmemoryThumbnail; + NewsmemoryThumbnail.propTypes = (0, _extends2.default)({ + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + currentPageId: _propTypes.default.number.isRequired, + downloadImageMethod: _propTypes.default.func, + onItemClick: _propTypes.default.func.isRequired, + SpecialComponent: _propTypes.default.node, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }).isRequired, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }).isRequired + }, _$$_REQUIRE(_dependencyMap[32]).Shortcut.propTypes); + NewsmemoryThumbnail.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[32]).Shortcut.defaultProps); +},2346,[5,80,6,7,8,15,90,12,14,16,17,201,28,2347,2348,644,638,587,603,574,715,460,714,458,572,717,1873,2349,462,1910,2350,699,1911]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + exports.__esModule = true; + + exports["default"] = function (_a) { + var getItemHeight = _a.getItemHeight, + _b = _a.getSeparatorHeight, + getSeparatorHeight = _b === undefined ? function () { + return 0; + } : _b, + _c = _a.getSectionHeaderHeight, + getSectionHeaderHeight = _c === undefined ? function () { + return 0; + } : _c, + _d = _a.getSectionFooterHeight, + getSectionFooterHeight = _d === undefined ? function () { + return 0; + } : _d, + _e = _a.listHeaderHeight, + listHeaderHeight = _e === undefined ? 0 : _e; + return function (data, index) { + var i = 0; + var sectionIndex = 0; + var elementPointer = { + type: 'SECTION_HEADER' + }; + var offset = typeof listHeaderHeight === 'function' ? listHeaderHeight() : listHeaderHeight; + + while (i < index) { + switch (elementPointer.type) { + case 'SECTION_HEADER': + { + var sectionData = data[sectionIndex].data; + offset += getSectionHeaderHeight(sectionIndex); + + if (sectionData.length === 0) { + elementPointer = { + type: 'SECTION_FOOTER' + }; + } else { + elementPointer = { + type: 'ROW', + index: 0 + }; + } + + break; + } + + case 'ROW': + { + var sectionData = data[sectionIndex].data; + var rowIndex = elementPointer.index; + offset += getItemHeight(sectionData[rowIndex], sectionIndex, rowIndex); + elementPointer.index += 1; + + if (rowIndex === sectionData.length - 1) { + elementPointer = { + type: 'SECTION_FOOTER' + }; + } else { + offset += getSeparatorHeight(sectionIndex, rowIndex); + } + + break; + } + + case 'SECTION_FOOTER': + { + offset += getSectionFooterHeight(sectionIndex); + sectionIndex += 1; + elementPointer = { + type: 'SECTION_HEADER' + }; + break; + } + } + + i += 1; + } + + var length; + + switch (elementPointer.type) { + case 'SECTION_HEADER': + length = getSectionHeaderHeight(sectionIndex); + break; + + case 'ROW': + var rowIndex = elementPointer.index; + length = getItemHeight(data[sectionIndex].data[rowIndex], sectionIndex, rowIndex); + break; + + case 'SECTION_FOOTER': + length = getSectionFooterHeight(sectionIndex); + break; + + default: + throw new Error('Unknown elementPointer.type'); + } + + return { + length: length, + offset: offset, + index: index + }; + }; + }; +},2347,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports._getThumbnailsWidth = exports._getThumbnailWidth = exports._getSectionItemHeight = exports._getThumbnailHeight = exports._getSectionHeight = exports.MINIMUM_THUMBNAIL_WIDTH = exports.THUMBNAIL_BORDER_WIDTH = exports.THUMBNAIL_MARGIN = exports.THUMBNAIL_HEIGHT = exports.THUMBNAIL_GRADIENT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _Page = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[3])); + + var _Edition = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[4])); + + var THUMBNAIL_GRADIENT = [_$$_REQUIRE(_dependencyMap[5]).colors.transparent, _$$_REQUIRE(_dependencyMap[5]).colors.transparent, _$$_REQUIRE(_dependencyMap[5]).colors.transparent1200]; + exports.THUMBNAIL_GRADIENT = THUMBNAIL_GRADIENT; + var THUMBNAIL_HEIGHT = 210; + exports.THUMBNAIL_HEIGHT = THUMBNAIL_HEIGHT; + var THUMBNAIL_MARGIN = 20; + exports.THUMBNAIL_MARGIN = THUMBNAIL_MARGIN; + var THUMBNAIL_BORDER_WIDTH = 1; + exports.THUMBNAIL_BORDER_WIDTH = THUMBNAIL_BORDER_WIDTH; + var MINIMUM_THUMBNAIL_WIDTH = 100; + exports.MINIMUM_THUMBNAIL_WIDTH = MINIMUM_THUMBNAIL_WIDTH; + + var _getSectionHeight = function _getSectionHeight() { + return _$$_REQUIRE(_dependencyMap[6]).HEADER_HEIGHT + _$$_REQUIRE(_dependencyMap[6]).HEADER_HR_SIZE; + }; + + exports._getSectionHeight = _getSectionHeight; + + var _getThumbnailHeight = function _getThumbnailHeight(page) { + return THUMBNAIL_HEIGHT; + }; + + exports._getThumbnailHeight = _getThumbnailHeight; + + var _getSectionItemHeight = function _getSectionItemHeight(rowData) { + if (rowData && rowData[0] && rowData[0][0]) { + var page = rowData[0][0].page; + return _getThumbnailHeight(page) + 40; + } + + return 0; + }; + + exports._getSectionItemHeight = _getSectionItemHeight; + + var _getThumbnailWidth = function _getThumbnailWidth(edition, page, maxWidth, referenceHeight) { + var pageSize = _newsmemoryUtils.default.getPageSizeFixed(edition, page); + + var divider = page.isDoubleTruck() ? 2 : 1; + var aspectRatio = pageSize.pageWidth / divider / pageSize.pageHeight; + + var height = referenceHeight || _getThumbnailHeight(page); + + var width = Math.max(height * aspectRatio, MINIMUM_THUMBNAIL_WIDTH); + + if (maxWidth) { + width = Math.min(width, maxWidth / 2); + } + + return width * divider; + }; + + exports._getThumbnailWidth = _getThumbnailWidth; + + var _getThumbnailsWidth = function _getThumbnailsWidth(edition, thumbnails, withMargin, maxWidth, referenceHeight) { + if (thumbnails) { + var thumbWidth = thumbnails.reduce(function (width, thumbnail) { + var thumbnailWidth = thumbnail.size.width || _getThumbnailWidth(edition, thumbnail.page, maxWidth, referenceHeight); + + return width + thumbnailWidth; + }, 0); + var margin = withMargin ? 40 : 0; + return thumbWidth + margin; + } + + return 0; + }; + + exports._getThumbnailsWidth = _getThumbnailsWidth; + + var _default = _reactNative.StyleSheet.create({ + container: { + flex: 1, + flexDirection: "column", + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.white + }, + sectionParent: { + flexDirection: "column" + }, + section: { + minHeight: _$$_REQUIRE(_dependencyMap[6]).HEADER_HEIGHT, + padding: _$$_REQUIRE(_dependencyMap[6]).HEADER_PADDING, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "flex-end", + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.white + }, + hr: { + height: _$$_REQUIRE(_dependencyMap[6]).HEADER_HR_SIZE, + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.black + }, + sectionText: { + fontSize: _$$_REQUIRE(_dependencyMap[6]).TITLE_SIZE, + color: _$$_REQUIRE(_dependencyMap[5]).colors.black + }, + row: { + flexDirection: "row", + justifyContent: "space-between" + }, + thumbnailParent: { + flexDirection: "row" + }, + text: { + position: "absolute", + alignSelf: "center", + bottom: 0, + padding: 5, + fontSize: _$$_REQUIRE(_dependencyMap[6]).PAGE_SIZE, + color: _$$_REQUIRE(_dependencyMap[5]).colors.white + }, + textRight: { + end: 0 + }, + textLeft: { + start: 0 + }, + textUnselected: { + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.black + }, + textFocused: { + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.md_grey_600 + }, + textSelected: { + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.md_red_600 + }, + touchable: { + marginVertical: THUMBNAIL_MARGIN, + borderWidth: THUMBNAIL_BORDER_WIDTH + }, + touchableSelected: { + borderColor: _$$_REQUIRE(_dependencyMap[5]).colors.md_red_600 + }, + touchableUnselected: { + borderColor: _$$_REQUIRE(_dependencyMap[5]).colors.black + }, + touchableFocused: { + borderColor: _$$_REQUIRE(_dependencyMap[5]).colors.md_grey_600 + }, + touchableUnFocused: { + borderColor: _$$_REQUIRE(_dependencyMap[5]).colors.black + }, + image: { + flex: 1, + height: THUMBNAIL_HEIGHT + }, + gradient: { + position: "absolute", + top: 0, + start: 0, + end: 0, + bottom: 0 + }, + download: { + marginHorizontal: 10, + width: 50 + }, + downloadIcon: { + fontSize: _$$_REQUIRE(_dependencyMap[6]).PAGE_SIZE, + padding: 5 + }, + downloadSpinner: { + flex: 0, + alignSelf: "center", + padding: 5 + } + }); + + exports.default = _default; +},2348,[28,5,638,603,644,462,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Thumbnail = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var Thumbnail = function () { + function Thumbnail() { + (0, _classCallCheck2.default)(this, Thumbnail); + } + + (0, _createClass2.default)(Thumbnail, [{ + key: "setSize", + value: function setSize(size) { + this.size = size; + } + }, { + key: "getSize", + value: function getSize() { + return this.size; + } + }, { + key: "setLocalPath", + value: function setLocalPath(localPath) { + this.localPath = localPath; + } + }, { + key: "getLocalPath", + value: function getLocalPath() { + return this.localPath; + } + }, { + key: "setDownloadMethod", + value: function setDownloadMethod(downloadMethod) { + this.downloadMethod = downloadMethod; + } + }, { + key: "getDownloadMethod", + value: function getDownloadMethod() { + return this.downloadMethod; + } + }, { + key: "setSelected", + value: function setSelected(selected) { + this.selected = selected; + } + }, { + key: "isSelected", + value: function isSelected() { + return this.selected; + } + }, { + key: "setFocused", + value: function setFocused(focused) { + this.focused = focused; + } + }, { + key: "isFocused", + value: function isFocused() { + return this.focused; + } + }, { + key: "setPage", + value: function setPage(page) { + this.page = page; + } + }, { + key: "getPage", + value: function getPage() { + return this.page; + } + }]); + return Thumbnail; + }(); + + exports.Thumbnail = Thumbnail; +},2349,[5,7,8,638]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports._getHorizontalList = exports._rowKeyExtractor = exports._getThumbnail = exports._getSectionView = exports.PLACEHOLDER_POSITION = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _thumbnailComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _fallbackImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _share = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var PLACEHOLDER_POSITION = { + NONE: 0, + LEFT: 1, + RIGHT: 2 + }; + exports.PLACEHOLDER_POSITION = PLACEHOLDER_POSITION; + + var _getSectionView = function _getSectionView(section) { + var isSpecial = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var containerClasses = ["newsmemory-thumbnails-section-container"]; + var textClasses = ["newsmemory-thumbnails-section-text"]; + + if (isSpecial) { + containerClasses.push("newsmemory-thumbnails-special-section-container"); + textClasses.push("newsmemory-thumbnails-special-section-text"); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: containerClasses + }, _react.default.createElement(_reactNative.View, { + style: _thumbnailComponent.default.section + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: textClasses + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: _thumbnailComponent.default.sectionText + }, section))), (0, _$$_REQUIRE(_dependencyMap[15]).hr)(_thumbnailComponent.default.hr, "newsmemory-thumbnails-section-separator")); + }; + + exports._getSectionView = _getSectionView; + + var _getLeftPage = function _getLeftPage(page, isSelected, isFocused) { + var isHighlighted = isSelected || isFocused; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["newsmemory-thumbnails-page-text", !isHighlighted ? "newsmemory-thumbnails-page-text-unselected" : "", isFocused ? "newsmemory-thumbnails-page-text-focused" : "", isSelected ? "newsmemory-thumbnails-page-text-selected" : "", "newsmemory-thumbnails-page-text-left"] + }, _react.default.createElement(_fontText.default, { + style: [_thumbnailComponent.default.text, _thumbnailComponent.default.textLeft, !isHighlighted ? _thumbnailComponent.default.textUnselected : undefined, isFocused ? _thumbnailComponent.default.textFocused : undefined, isSelected ? _thumbnailComponent.default.textSelected : undefined] + }, _pageUtils.default.removeZerosFromPageNumber(page.getShownPage()))); + }; + + var _getRightPage = function _getRightPage(page, isSelected, isFocused) { + var isHighlighted = isSelected || isFocused; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["newsmemory-thumbnails-page-text", !isHighlighted ? "newsmemory-thumbnails-page-text-unselected" : "", isFocused ? "newsmemory-thumbnails-page-text-focused" : "", isSelected ? "newsmemory-thumbnails-page-text-selected" : "", "newsmemory-thumbnails-page-text-right"] + }, _react.default.createElement(_fontText.default, { + style: [_thumbnailComponent.default.text, _thumbnailComponent.default.textRight, !isHighlighted ? _thumbnailComponent.default.textUnselected : undefined, isFocused ? _thumbnailComponent.default.textFocused : undefined, isSelected ? _thumbnailComponent.default.textSelected : undefined] + }, page.isDoubleTruck() ? _pageUtils.default.removeZerosFromPageNumber(_pageUtils.default.getNextPageNumber(page.getShownPage())) : _pageUtils.default.removeZerosFromPageNumber(page.getShownPage()))); + }; + + var _downloadPDF = function _callee(newspaper, page) { + var overlayConfig; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + overlayConfig = { + id: "download" + }; + + _$$_REQUIRE(_dependencyMap[16]).LoadingOverlay.show(overlayConfig); + + _context.next = 4; + return _regenerator.default.awrap(_share.default.sharePDF(newspaper, page)); + + case 4: + (0, _$$_REQUIRE(_dependencyMap[17]).sendNewsmemoryDownloadPDFEvent)(newspaper.getEditionModel(), page); + + _$$_REQUIRE(_dependencyMap[16]).LoadingOverlay.hide(overlayConfig); + + case 6: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + var _getThumbnail = function _getThumbnail(newspaper, thumbnails, index, _onPress, addPlaceholder) { + var _global$getActivePSet = global.getActivePSetup(), + downloadSinglePdf = _global$getActivePSet.downloadSinglePdf; + + var edition = newspaper.getEditionModel(); + var isPlaceholderLeft = addPlaceholder === PLACEHOLDER_POSITION.LEFT; + var isPlaceholderRight = addPlaceholder === PLACEHOLDER_POSITION.RIGHT; + var placeholder = null; + + if (isPlaceholderLeft || isPlaceholderRight) { + var styleMargin = {}; + + if (isPlaceholderLeft) { + styleMargin.marginStart = _thumbnailComponent.THUMBNAIL_MARGIN; + } else { + styleMargin.marginEnd = _thumbnailComponent.THUMBNAIL_MARGIN; + } + + placeholder = _react.default.createElement(_reactNative.View, { + key: "placeholder", + style: [_thumbnailComponent.default.touchable, { + width: thumbnails[0].getSize().width || (0, _thumbnailComponent._getThumbnailWidth)(edition, thumbnails[0].getPage()), + borderWidth: 0 + }, styleMargin] + }); + } + + return _react.default.createElement(_reactNative.View, { + style: [_thumbnailComponent.default.thumbnailParent], + key: index + }, isPlaceholderLeft ? placeholder : null, thumbnails.map(function (item, thumbnailIndex) { + var thumbnail = item.getPage(); + var isHighlighted = item.isSelected() || item.isFocused(); + var leftPage = null; + var rightPage = null; + var marginStart = isPlaceholderLeft ? 0 : _thumbnailComponent.THUMBNAIL_MARGIN; + var marginEnd = isPlaceholderRight ? 0 : _thumbnailComponent.THUMBNAIL_MARGIN; + var borderStartWidth = _thumbnailComponent.THUMBNAIL_BORDER_WIDTH; + var borderEndWidth = _thumbnailComponent.THUMBNAIL_BORDER_WIDTH; + var borderVertical = _thumbnailComponent.THUMBNAIL_BORDER_WIDTH; + var alignDownload; + + if (thumbnail.isDoubleTruck()) { + leftPage = _getLeftPage(thumbnail, item.isSelected(), item.isFocused()); + rightPage = _getRightPage(thumbnail, item.isSelected(), item.isFocused()); + alignDownload = "center"; + } else if (thumbnailIndex === 1) { + rightPage = _getRightPage(thumbnail, item.isSelected(), item.isFocused()); + borderStartWidth = isHighlighted || isPlaceholderLeft ? _thumbnailComponent.THUMBNAIL_BORDER_WIDTH : 0; + marginStart = 0; + alignDownload = "flex-start"; + } else { + rightPage = _getLeftPage(thumbnail, item.isSelected(), item.isFocused()); + borderEndWidth = isHighlighted || thumbnails.length === 1 || isPlaceholderRight ? _thumbnailComponent.THUMBNAIL_BORDER_WIDTH : 0; + marginEnd = thumbnails.length === 1 && !isPlaceholderRight ? _thumbnailComponent.THUMBNAIL_MARGIN : 0; + alignDownload = "flex-end"; + } + + if (isHighlighted) { + borderStartWidth *= 2; + borderEndWidth *= 2; + borderVertical *= 2; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + key: thumbnailIndex, + classes: ["newsmemory-thumbnails-pages", !isHighlighted ? "newsmemory-thumbnails-pages-unselected" : "", item.isFocused() ? "newsmemory-thumbnails-pages-focused" : "", item.isSelected() ? "newsmemory-thumbnails-pages-selected" : ""] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + style: [_thumbnailComponent.default.touchable, !isHighlighted ? _thumbnailComponent.default.touchableUnselected : undefined, item.isFocused() ? _thumbnailComponent.default.touchableFocused : undefined, item.isSelected() ? _thumbnailComponent.default.touchableSelected : undefined, { + height: item.size.height || (0, _thumbnailComponent._getThumbnailHeight)(thumbnail), + width: item.size.width || (0, _thumbnailComponent._getThumbnailWidth)(edition, thumbnail), + marginEnd: marginEnd, + marginStart: marginStart, + borderStartWidth: borderStartWidth, + borderEndWidth: borderEndWidth, + borderTopWidth: borderVertical, + borderBottomWidth: borderVertical + }], + onPress: function onPress() { + if (typeof _onPress === "function") { + _onPress(thumbnail); + } + } + }, _react.default.createElement(_fallbackImageComponent.default, { + resizeMode: "contain", + style: [_thumbnailComponent.default.image, { + height: item.size.height || (0, _thumbnailComponent._getThumbnailHeight)(thumbnail) + }], + fallback: item.getDownloadMethod(), + spinnerColor: _newsmemoryUtils.default.getSpinnerColor(), + source: { + uri: item.getLocalPath() + } + }), leftPage, rightPage, downloadSinglePdf ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[18]).DownloadButton, { + name: "file-download", + style: [_thumbnailComponent.default.download, { + alignSelf: alignDownload + }], + iconStyle: [_thumbnailComponent.default.downloadIcon, { + alignSelf: alignDownload + }], + spinnerSize: _$$_REQUIRE(_dependencyMap[19]).PAGE_SIZE, + spinnerStyle: _thumbnailComponent.default.downloadSpinner, + type: _$$_REQUIRE(_dependencyMap[20]).TecnaviaIconType.MATERIAL_ICONS, + onPress: function onPress() { + return _downloadPDF(newspaper, thumbnail); + }, + disabled: thumbnail.isProtected() || _share.default.checkSharesRemotely() && !_$$_REQUIRE(_dependencyMap[21]).NetworkUtils.isOnline(), + disableEvent: _events.default.SHARE_CHANGE_BUTTON_VISIBILITY + }) : null)); + }), isPlaceholderRight ? placeholder : null); + }; + + exports._getThumbnail = _getThumbnail; + + var _keyExtractor = function _keyExtractor(thumbnails, index) { + if (thumbnails) { + var key = thumbnails.reduce(function (result, _ref) { + var page = _ref.page; + return result + "_" + page.getPageId(); + }, ""); + return key; + } + + return index; + }; + + var _rowKeyExtractor = function _rowKeyExtractor(row, index) { + if (row && Array.isArray(row)) { + return row.reduce(function (result, items) { + return result + "_" + _keyExtractor(items); + }, ""); + } + + return index; + }; + + exports._rowKeyExtractor = _rowKeyExtractor; + + var _renderItem = function _renderItem(newspaper, row, total, onPress, addPlaceholder) { + var item = row.item, + index = row.index; + + if (addPlaceholder === PLACEHOLDER_POSITION.LEFT && index !== 0) { + addPlaceholder = PLACEHOLDER_POSITION.NONE; + } else if (addPlaceholder === PLACEHOLDER_POSITION.RIGHT && index !== total - 1) { + addPlaceholder = PLACEHOLDER_POSITION.NONE; + } + + if (item && item.length === 2) { + addPlaceholder = PLACEHOLDER_POSITION.NONE; + } + + return _getThumbnail(newspaper, item, index, onPress, addPlaceholder); + }; + + var _getHorizontalList = function _getHorizontalList(onRef, thumbnails, onPress, newspaper, initialIndex, addPlaceholder) { + var style = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {}; + var edition = newspaper.getEditionModel(); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["newsmemory-thumbnails-section-content"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[22]).TecnaviaFlatList, { + ref: onRef, + data: thumbnails, + onScrollToIndexFailed: function onScrollToIndexFailed(info) {}, + getItemLayout: function getItemLayout(data, index) { + var width = (0, _thumbnailComponent._getThumbnailsWidth)(edition, data[index], true); + var offset = 0; + + for (var i = 0; i < index; i++) { + offset += (0, _thumbnailComponent._getThumbnailsWidth)(edition, data[i], true); + } + + var result = { + length: width, + offset: offset, + index: index + }; + return result; + }, + keyExtractor: _keyExtractor, + horizontal: true, + bounces: false, + initialScrollIndex: initialIndex, + renderItem: function renderItem(item) { + return _renderItem(newspaper, item, thumbnails.length, onPress, addPlaceholder); + }, + style: style + })); + }; + + exports._getHorizontalList = _getHorizontalList; +},2350,[5,80,17,28,2348,1879,2351,638,715,603,644,714,2352,460,699,2195,1950,1954,2353,729,1806,462,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FallbackImage = function (_React$Component) { + (0, _inherits2.default)(FallbackImage, _React$Component); + + var _super = _createSuper(FallbackImage); + + function FallbackImage(props) { + var _this; + + (0, _classCallCheck2.default)(this, FallbackImage); + _this = _super.call(this, props); + _this.state = { + error: false, + useFallback: false + }; + return _this; + } + + (0, _createClass2.default)(FallbackImage, [{ + key: "_onFallback", + value: function _onFallback() { + var _this$state, error, useFallback, fallback; + + return _regenerator.default.async(function _onFallback$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _this$state = this.state, error = _this$state.error, useFallback = _this$state.useFallback; + fallback = this.props.fallback; + + if (!(error && !useFallback)) { + _context.next = 11; + break; + } + + _context.prev = 3; + _context.next = 6; + return _regenerator.default.awrap(fallback()); + + case 6: + this.setState({ + error: false, + useFallback: true + }); + _context.next = 11; + break; + + case 9: + _context.prev = 9; + _context.t0 = _context["catch"](3); + + case 11: + case "end": + return _context.stop(); + } + } + }, null, this, [[3, 9]], Promise); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + source = _this$props.source, + fallback = _this$props.fallback, + spinnerColor = _this$props.spinnerColor, + style = _this$props.style, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["source", "fallback", "spinnerColor", "style"]); + var error = this.state.error; + + if (error) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).ProgressCircle, { + spinnerColor: spinnerColor, + spinnerStyle: [{ + flex: 0 + }, style] + }); + } + + return _react.default.createElement(_imageComponent.default, (0, _extends2.default)({}, rest, { + style: style, + onError: function onError() { + _this2.setState({ + error: true + }, _this2._onFallback); + }, + source: source + })); + } + }]); + return FallbackImage; + }(_react.default.Component); + + exports.default = FallbackImage; + FallbackImage.propTypes = { + fallback: _propTypes.default.func.isRequired, + spinnerColor: _propTypes.default.string, + style: _propTypes.default.any, + source: _propTypes.default.object + }; +},2351,[5,80,6,108,7,8,12,14,16,17,201,588,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.SHARE_REMOTE_ERRORS = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _reactNativeShare = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNativeMail = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var SHARE_REMOTE_ERRORS = { + NONE: 0, + GENERIC: 1, + LIMIT_REACHED: 2 + }; + exports.SHARE_REMOTE_ERRORS = SHARE_REMOTE_ERRORS; + + var NewsmemoryShare = function () { + function NewsmemoryShare() { + (0, _classCallCheck2.default)(this, NewsmemoryShare); + } + + (0, _createClass2.default)(NewsmemoryShare, [{ + key: "share", + value: function share(onShareLoaded) { + var _global$getActivePSet, messageMaxShare, issue, edition, shareParams, shareConfig, shareid, publinkURL, publinkShortURL, error, NONE, LIMIT_REACHED, fullPublink, shortPublink, shareType, _await$this$shareAll, app, userConfig; + + return _regenerator.default.async(function share$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _global$getActivePSet = global.getActivePSetup(), messageMaxShare = _global$getActivePSet.messageMaxShare; + issue = this.editionModel.getIssue(); + edition = this.editionModel.getEdition(); + shareParams = { + artmode: this.articleType, + issue: issue, + edition: edition, + filename: this.page.getFilename(), + page: this.page.getPage(), + section: this.page.getSection(), + title: this.article.getTitle(), + article: this.article.getXmlId(), + type: "share" + }; + _context.next = 7; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.share(shareParams)); + + case 7: + shareConfig = _context.sent; + + if (typeof onShareLoaded === "function") { + onShareLoaded(); + } + + shareid = shareConfig.shareid, publinkURL = shareConfig.publinkURL, publinkShortURL = shareConfig.publinkShortURL, error = shareConfig.error; + NONE = SHARE_REMOTE_ERRORS.NONE, LIMIT_REACHED = SHARE_REMOTE_ERRORS.LIMIT_REACHED; + + if (!(error && error > NONE)) { + _context.next = 15; + break; + } + + if (error === LIMIT_REACHED) { + _$$_REQUIRE(_dependencyMap[16]).Toast.show(messageMaxShare || global.strings("msg_max_share")); + } else { + _$$_REQUIRE(_dependencyMap[16]).Toast.show(global.strings("system_error")); + } + + _context.next = 44; + break; + + case 15: + if (!(shareid && shareid.length > 0)) { + _context.next = 43; + break; + } + + fullPublink = this.getPublink(publinkURL, shareid); + shortPublink = this.getPublink(publinkShortURL || publinkURL, shareid); + shareType = this.shareType; + _context.t0 = this.shareType; + _context.next = _context.t0 === _$$_REQUIRE(_dependencyMap[17]).NewsmemoryShareType.ALL ? 22 : _context.t0 === _$$_REQUIRE(_dependencyMap[17]).NewsmemoryShareType.FACEBOOK ? 28 : _context.t0 === _$$_REQUIRE(_dependencyMap[17]).NewsmemoryShareType.TWITTER ? 31 : _context.t0 === _$$_REQUIRE(_dependencyMap[17]).NewsmemoryShareType.REDDIT ? 34 : _context.t0 === _$$_REQUIRE(_dependencyMap[17]).NewsmemoryShareType.EMAIL ? 37 : 40; + break; + + case 22: + _context.next = 24; + return _regenerator.default.awrap(this.shareAll(fullPublink, shortPublink)); + + case 24: + _await$this$shareAll = _context.sent; + app = _await$this$shareAll.message; + + if (app) { + shareType = (0, _$$_REQUIRE(_dependencyMap[18]).getShareTypeByApp)(app); + } + + return _context.abrupt("break", 40); + + case 28: + _context.next = 30; + return _regenerator.default.awrap(this.shareFacebook(fullPublink)); + + case 30: + return _context.abrupt("break", 40); + + case 31: + _context.next = 33; + return _regenerator.default.awrap(this.shareTwitter(shortPublink)); + + case 33: + return _context.abrupt("break", 40); + + case 34: + _context.next = 36; + return _regenerator.default.awrap(this.shareFacebook(fullPublink)); + + case 36: + return _context.abrupt("break", 40); + + case 37: + _context.next = 39; + return _regenerator.default.awrap(this.shareEmail(fullPublink)); + + case 39: + return _context.abrupt("break", 40); + + case 40: + try { + if (NewsmemoryShare.checkSharesLocally()) { + userConfig = global.getUserSettings(); + userConfig.incrementShareCounters(issue, edition); + } + + (0, _$$_REQUIRE(_dependencyMap[19]).sendNewsmemoryShareEvent)(this.editionModel, this.page, this.article, shareType); + + _NewsmemoryAJAX.default.share((0, _extends2.default)({}, shareParams, { + shareId: shareid, + shareType: shareType + })); + } catch (e) {} + + _context.next = 44; + break; + + case 43: + _$$_REQUIRE(_dependencyMap[16]).Toast.show(global.strings("system_error")); + + case 44: + _context.next = 49; + break; + + case 46: + _context.prev = 46; + _context.t1 = _context["catch"](0); + throw _context.t1; + + case 49: + case "end": + return _context.stop(); + } + } + }, null, this, [[0, 46]], Promise); + } + }, { + key: "getPublink", + value: function getPublink(publink, shareid) { + if (publink && publink.length) { + return publink; + } + + return global.getActivePSetup().machine + "/publink.php?shareid=" + shareid; + } + }, { + key: "getTitle", + value: function getTitle(title) { + if (title) { + return this.replacePlaceholders(_$$_REQUIRE(_dependencyMap[20]).StringUtils.decodeHTML(_$$_REQUIRE(_dependencyMap[20]).StringUtils.decodeURIComponent(title))); + } + + return ""; + } + }, { + key: "replacePlaceholders", + value: function replacePlaceholders(text) { + return text.replace("", global.getActivePSetup().paperName).replace("", this.article.getTitle()).replace("##paper##", global.getActivePSetup().paperName).replace("##title##", this.article.getTitle()); + } + }, { + key: "getDefaultTitle", + value: function getDefaultTitle() { + return this.getTitle(global.getActivePSetup().emailSubject); + } + }, { + key: "getTwitterTitle", + value: function getTwitterTitle() { + return this.getTitle(global.getActivePSetup().twitterText); + } + }, { + key: "getContent", + value: function getContent(publink) { + var _global$getActivePSet2 = global.getActivePSetup(), + emailContent = _global$getActivePSet2.emailContent; + + emailContent = this.replacePlaceholders(_$$_REQUIRE(_dependencyMap[20]).StringUtils.decodeHTML(_$$_REQUIRE(_dependencyMap[20]).StringUtils.decodeURIComponent(emailContent))); + + var decodedTitle = _$$_REQUIRE(_dependencyMap[20]).StringUtils.decodeHTML(_$$_REQUIRE(_dependencyMap[20]).StringUtils.decodeURIComponent(this.article.getTitle())); + + if (emailContent.indexOf(decodedTitle) === -1) { + return emailContent + "\n" + decodedTitle + "\n" + publink; + } + + return emailContent + "\n" + publink; + } + }, { + key: "shareAll", + value: function shareAll(publink, shortPublink) { + var title, message, shortMessage, activityItemSources, textItem, shortTextItem, placeholderItem, content, osMajorVersion, base64File, fileItem, options; + return _regenerator.default.async(function shareAll$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + title = this.getDefaultTitle(); + message = this.getContent(publink); + shortMessage = this.getContent(shortPublink); + activityItemSources = []; + + if (!_$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isIOS()) { + _context2.next = 22; + break; + } + + textItem = { + type: "text", + content: message + }; + shortTextItem = { + type: "text", + content: shortMessage + }; + activityItemSources.push({ + placeholderItem: textItem, + item: { + default: textItem, + message: shortTextItem, + postToTwitter: shortTextItem, + copyToPasteBoard: { + type: "text", + content: publink + } + } + }); + + if (!this.pdfFilePath) { + _context2.next = 22; + break; + } + + placeholderItem = textItem; + osMajorVersion = _$$_REQUIRE(_dependencyMap[20]).PlatformUtils.getMajorSystemVersion(); + + if (!(osMajorVersion < 17 && osMajorVersion >= 15)) { + _context2.next = 18; + break; + } + + _context2.next = 14; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.readFileBase64(this.pdfFilePath)); + + case 14: + base64File = _context2.sent; + content = "data:application/pdf;base64," + base64File; + _context2.next = 19; + break; + + case 18: + content = this.pdfFilePath; + + case 19: + fileItem = { + type: "url", + content: content + }; + + if (this.articleType === _$$_REQUIRE(_dependencyMap[17]).NewsmemoryArticleModes.GRAPHIC) { + placeholderItem = fileItem; + } + + activityItemSources.push({ + placeholderItem: placeholderItem, + item: { + default: fileItem, + postToFacebook: null, + copyToPasteBoard: null, + mail: null, + message: null, + postToTwitter: null + }, + linkMetadata: { + title: _tecnaviaFileUtils.default.getFilename(this.pdfFilePath) + } + }); + + case 22: + options = _reactNative.Platform.select({ + ios: { + activityItemSources: activityItemSources, + subject: title, + title: title + }, + default: { + title: title, + subject: title, + message: message, + type: "text/plain" + } + }); + return _context2.abrupt("return", _reactNativeShare.default.open(options)); + + case 24: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "shareFacebook", + value: function shareFacebook(publink) { + var shareUrl; + return _regenerator.default.async(function shareFacebook$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + shareUrl = "https://www.facebook.com/sharer/sharer.php?"; + shareUrl += "t=" + this.getDefaultTitle(); + shareUrl += "&u=" + publink; + _context3.next = 5; + return _regenerator.default.awrap(_tecnaviaPlatformUtils.default.openURL(shareUrl)); + + case 5: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "shareTwitter", + value: function shareTwitter(publink) { + var shareUrl; + return _regenerator.default.async(function shareTwitter$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + shareUrl = "https://twitter.com/intent/tweet?"; + shareUrl += "text=" + this.getTwitterTitle(); + shareUrl += "&url=" + publink; + _context4.next = 5; + return _regenerator.default.awrap(_tecnaviaPlatformUtils.default.openURL(shareUrl)); + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "shareReddit", + value: function shareReddit(publink) { + var shareUrl; + return _regenerator.default.async(function shareReddit$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + shareUrl = "https://reddit.com/submit?"; + shareUrl += "title=" + this.getDefaultTitle(); + shareUrl += "text=" + this.getContent(publink); + shareUrl += "&url=" + publink; + _context5.next = 6; + return _regenerator.default.awrap(_tecnaviaPlatformUtils.default.openURL(shareUrl)); + + case 6: + case "end": + return _context5.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "shareEmail", + value: function shareEmail(publink) { + _reactNativeMail.default.mail({ + subject: this.getDefaultTitle(), + recipients: [], + body: this.getContent(publink), + isHTML: false + }, function (error) {}); + } + }], [{ + key: "shareToFiles", + value: function shareToFiles(url, type) { + var options; + return _regenerator.default.async(function shareToFiles$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + if (_$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isIOS()) { + options = { + type: type, + url: url, + saveToFiles: true + }; + } else { + options = { + url: "file://" + url + }; + } + + _context6.prev = 1; + _context6.next = 4; + return _regenerator.default.awrap(_reactNativeShare.default.open(options)); + + case 4: + if (!_$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isIOS()) { + _context6.next = 7; + break; + } + + _context6.next = 7; + return _regenerator.default.awrap(_tecnaviaPlatformUtils.default.openURL("shareddocuments://")); + + case 7: + _context6.next = 11; + break; + + case 9: + _context6.prev = 9; + _context6.t0 = _context6["catch"](1); + + case 11: + case "end": + return _context6.stop(); + } + } + }, null, null, [[1, 9]], Promise); + } + }, { + key: "checkSharesLocally", + value: function checkSharesLocally() { + var _global$getActivePSet3 = global.getActivePSetup(), + maxShares = _global$getActivePSet3.maxShares, + maxSharesCheckType = _global$getActivePSet3.maxSharesCheckType; + + return maxShares > 0 && maxSharesCheckType === _$$_REQUIRE(_dependencyMap[21]).MAX_SHARE_CHECK_TYPES.LOCAL; + } + }, { + key: "checkSharesRemotely", + value: function checkSharesRemotely() { + var _global$getActivePSet4 = global.getActivePSetup(), + maxSharesCheckType = _global$getActivePSet4.maxSharesCheckType; + + return maxSharesCheckType === _$$_REQUIRE(_dependencyMap[21]).MAX_SHARE_CHECK_TYPES.REMOTE; + } + }, { + key: "canShare", + value: function canShare(issue, edition) { + if (NewsmemoryShare.checkSharesLocally()) { + var _global$getActivePSet5 = global.getActivePSetup(), + maxShares = _global$getActivePSet5.maxShares; + + var userConfig = global.getUserSettings(); + var count = userConfig.getShareCounters(issue, edition); + return count < maxShares; + } + + if (NewsmemoryShare.checkSharesRemotely()) { + return _$$_REQUIRE(_dependencyMap[20]).NetworkUtils.isOnline(); + } + + return true; + } + }, { + key: "sharePDF", + value: function sharePDF(newspaper, page) { + var _global$getActivePSet6, messageMaxShare, issue, edition, url, type, _await$NewsmemoryAJAX, path, userConfig, NO_GRANTS, code; + + return _regenerator.default.async(function sharePDF$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + _global$getActivePSet6 = global.getActivePSetup(), messageMaxShare = _global$getActivePSet6.messageMaxShare; + _context7.prev = 1; + issue = newspaper.getIssue(); + edition = newspaper.getEdition(); + + if (!NewsmemoryShare.canShare(issue, edition)) { + _context7.next = 23; + break; + } + + if (!(_$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isIOS() && _$$_REQUIRE(_dependencyMap[20]).PlatformUtils.getMajorSystemVersion() < 11)) { + _context7.next = 12; + break; + } + + _context7.next = 8; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.getDownloadPdfUrl(newspaper, page)); + + case 8: + url = _context7.sent; + + _NavigationService.default.main.navigate("WebScreen", { + url: url, + externalBrowserIsEnabled: false, + printButtonIsEnabled: true + }); + + _context7.next = 19; + break; + + case 12: + type = "application/pdf"; + _context7.next = 15; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.downloadPDF(newspaper, page)); + + case 15: + _await$NewsmemoryAJAX = _context7.sent; + path = _await$NewsmemoryAJAX.path; + _context7.next = 19; + return _regenerator.default.awrap(NewsmemoryShare.shareToFiles(path, type)); + + case 19: + if (NewsmemoryShare.checkSharesLocally()) { + userConfig = global.getUserSettings(); + userConfig.incrementShareCounters(issue, edition); + } + + _NewsmemoryAJAX.default.share({ + issue: issue, + edition: edition, + filename: page.getFilename(), + page: page.getPage(), + section: page.getSection(), + type: "download", + shareType: _$$_REQUIRE(_dependencyMap[17]).NewsmemoryShareType.PDF + }); + + _context7.next = 24; + break; + + case 23: + if (NewsmemoryShare.checkSharesRemotely()) { + _$$_REQUIRE(_dependencyMap[16]).Toast.show(global.strings("err_offline")); + } else { + _$$_REQUIRE(_dependencyMap[16]).Toast.show(messageMaxShare || global.strings("msg_max_share")); + } + + case 24: + _context7.next = 29; + break; + + case 26: + _context7.prev = 26; + _context7.t0 = _context7["catch"](1); + + if (_context7.t0 instanceof _$$_REQUIRE(_dependencyMap[22]).DownloadError) { + NO_GRANTS = _$$_REQUIRE(_dependencyMap[22]).DOWNLOAD_ERROR_CODES.NO_GRANTS; + code = _context7.t0.code; + + if (code === NO_GRANTS) { + _$$_REQUIRE(_dependencyMap[16]).Toast.show(messageMaxShare || global.strings("msg_max_share")); + } + } else {} + + case 29: + case "end": + return _context7.stop(); + } + } + }, null, null, [[1, 26]], Promise); + } + }]); + return NewsmemoryShare; + }(); + + exports.default = NewsmemoryShare; +},2352,[5,80,6,7,8,28,575,2152,430,640,638,644,714,1861,574,1876,1889,1893,1892,1954,462,717,586]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DownloadButton = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _iconComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DownloadButton = function (_React$Component) { + (0, _inherits2.default)(DownloadButton, _React$Component); + + var _super = _createSuper(DownloadButton); + + function DownloadButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, DownloadButton); + _this = _super.call(this, props); + _this.onPress = _this._onPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + downloading: false, + disabled: props.disabled + }; + return _this; + } + + (0, _createClass2.default)(DownloadButton, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var _this$props = this.props, + completedEvent = _this$props.completedEvent, + disableEvent = _this$props.disableEvent; + + if (completedEvent) { + this.completedId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(completedEvent, function () { + var _this2$state = _this2.state, + downloading = _this2$state.downloading, + disabled = _this2$state.disabled; + + if (downloading) { + _this2.setState({ + downloading: false + }); + } else if (disabled) { + _this2.setState({ + disabled: false + }); + } + }); + } + + if (disableEvent) { + this.disabledId = _$$_REQUIRE(_dependencyMap[13]).EventRegister.on(disableEvent, function (_ref) { + var disabled = _ref.disabled; + var downloading = _this2.state.downloading; + + if (!downloading) { + _this2.setState({ + disabled: disabled + }); + } + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(this.completedId); + + _$$_REQUIRE(_dependencyMap[13]).EventRegister.rm(this.disabledId); + } + }, { + key: "_onPress", + value: function _onPress() { + var _this$props2 = this.props, + completedEvent = _this$props2.completedEvent, + onPress = _this$props2.onPress; + var downloading = this.state.downloading; + + if (!downloading && onPress && typeof onPress === "function") { + if (completedEvent) { + this.setState({ + downloading: true + }, onPress); + } else { + onPress(); + } + } + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + onPress = _this$props3.onPress, + spinnerSize = _this$props3.spinnerSize, + spinnerStyle = _this$props3.spinnerStyle, + style = _this$props3.style, + iconStyle = _this$props3.iconStyle, + rest = (0, _objectWithoutProperties2.default)(_this$props3, ["onPress", "spinnerSize", "spinnerStyle", "style", "iconStyle"]); + var _this$state = this.state, + downloading = _this$state.downloading, + disabled = _this$state.disabled; + var IconComponent; + + if (downloading) { + IconComponent = _react.default.createElement(_reactNative.View, { + style: style + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["newsmemory-thumbnail-download-icon"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).ProgressCircle, { + advanced: true, + indeterminate: true, + spinnerSize: spinnerSize, + spinnerStyle: [spinnerStyle, _$$_REQUIRE(_dependencyMap[14]).Css.getStyleObjByCssClasses(["newsmemory-thumbnail-download-icon"])] + }))); + } else { + var cssStyles = ["newsmemory-icon", "newsmemory-thumbnail-download-icon"]; + + if (disabled) { + cssStyles.push("newsmemory-thumbnail-download-icon-disabled"); + } + + IconComponent = _react.default.createElement(_reactNative.TouchableOpacity, { + style: iconStyle, + disabled: disabled, + onPress: this.onPress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: cssStyles + }, _react.default.createElement(_iconComponent.default, (0, _extends2.default)({ + style: iconStyle + }, rest)))); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["newsmemory-thumbnail-download-parent"] + }, IconComponent); + } + }]); + return DownloadButton; + }(_react.default.Component); + + exports.DownloadButton = DownloadButton; + DownloadButton.propTypes = (0, _extends2.default)({ + onPress: _propTypes.default.func.isRequired, + completedEvent: _propTypes.default.string, + disableEvent: _propTypes.default.string, + spinnerSize: _propTypes.default.number, + iconStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + spinnerStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + disabled: _propTypes.default.bool + }, _iconComponent.default.PropTypes); + DownloadButton.defaultProps = { + disabled: false + }; +},2353,[5,6,108,7,8,15,12,14,16,17,201,28,1806,572,699,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _indexComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _secondIndexComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _EPaperArticle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + var _InStoryAd = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _simpleButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _closeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _subHeaderComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _headerInfoComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _twoStateButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + var _subHeaderButtons = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _customIndexComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _AccessibilityListItem = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[28])); + + var _newsmemoryUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[29])); + + var _sdkUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[30])); + + var _tabIndexComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[31])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[32])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryIndexLayoutManager = function (_PureShortcut) { + (0, _inherits2.default)(NewsmemoryIndexLayoutManager, _PureShortcut); + + var _super = _createSuper(NewsmemoryIndexLayoutManager); + + function NewsmemoryIndexLayoutManager(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryIndexLayoutManager); + _this = _super.call(this, props); + _this.firstLevel = []; + _this.allArticles = []; + _this.secondLevels = []; + _this.indexSecondLevel = 0; + _this.onIndexSecondLevelItemPress = _this._onIndexSecondLevelItemPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onIndexFirstLevelItemPress = _this._onIndexFirstLevelItemPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.closeAccessibility = _this._closeAccessibility.bind((0, _assertThisInitialized2.default)(_this)); + _this.closeCarMode = _this._closeCarMode.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSwipeDown = _this._onSwipeDown.bind((0, _assertThisInitialized2.default)(_this)); + _this.goToNextSection = _this._goToNextSection.bind((0, _assertThisInitialized2.default)(_this)); + _this.goToNextSectionRepeat = _this._goToNextSectionRepeat.bind((0, _assertThisInitialized2.default)(_this)); + _this.goToPreviousSection = _this._goToPreviousSection.bind((0, _assertThisInitialized2.default)(_this)); + _this.goToPreviousSectionRepeat = _this._goToPreviousSectionRepeat.bind((0, _assertThisInitialized2.default)(_this)); + _this.goToTop = _this._goToTop.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSecondLevelChange = _this._onSecondLevelChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleFullscreen = _this._toggleFullscreen.bind((0, _assertThisInitialized2.default)(_this)); + _this.getButton = _this._getButton.bind((0, _assertThisInitialized2.default)(_this)); + _this.shouldUseCustomIndex = props.customIndexHtml !== undefined; + _this.isCustomIndex = !props.accessibilityEnabled && _this.shouldUseCustomIndex; + _this.firstLevel = _this._getFirstLevel(); + _this.allArticles = _this._getSecondLevelItems(); + _this.secondLevels = _this._getSecondLevel(_this.firstLevel); + + _this._setLevel(props.indexLevel); + + _this.indexSecondLevel = _this._getSectionByArticle(props); + return _this; + } + + (0, _createClass2.default)(NewsmemoryIndexLayoutManager, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(props) { + this.shouldUseCustomIndex = props.customIndexHtml !== undefined; + this.isCustomIndex = !props.accessibilityEnabled && this.shouldUseCustomIndex; + this.firstLevel = this._getFirstLevel(); + this.allArticles = this._getSecondLevelItems(); + this.secondLevels = this._getSecondLevel(this.firstLevel); + + this._setLevel(props.indexLevel); + + this.indexSecondLevel = this._getSectionByArticle(props); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + if (this.isSecondLevel()) { + this._alignPageToCurrentSection(); + } + + var onIndexLevelChange = this.props.onIndexLevelChange; + + if (typeof onIndexLevelChange === "function") { + onIndexLevelChange(this.level); + } + } + }, { + key: "isSecondLevel", + value: function isSecondLevel() { + return this.level === 2; + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var onClose = this.props.onClose; + + var LEFT = _$$_REQUIRE(_dependencyMap[33]).KEY_GROUPS.LEFT, + RIGHT = _$$_REQUIRE(_dependencyMap[33]).KEY_GROUPS.RIGHT, + OPEN = _$$_REQUIRE(_dependencyMap[33]).KEY_GROUPS.OPEN, + CLOSE = _$$_REQUIRE(_dependencyMap[33]).KEY_GROUPS.CLOSE; + + var NEXT = _$$_REQUIRE(_dependencyMap[33]).VOICE_GROUPS.NEXT, + PREVIOUS = _$$_REQUIRE(_dependencyMap[33]).VOICE_GROUPS.PREVIOUS, + GO_UP = _$$_REQUIRE(_dependencyMap[33]).VOICE_GROUPS.GO_UP, + CLOSE_APP = _$$_REQUIRE(_dependencyMap[33]).VOICE_GROUPS.CLOSE_APP; + + var shortcuts = [{ + callback: this.toggleFullscreen, + keys: ["SPACE"], + stopPropagation: true + }, { + callback: onClose, + keys: CLOSE, + stopPropagation: true + }, { + callback: this.closeCarMode, + keys: CLOSE_APP(), + stopPropagation: true + }]; + + if (this.isSecondLevel()) { + shortcuts.push({ + callbackRepeat: this.goToPreviousSectionRepeat, + keys: LEFT + }, { + callbackRepeat: this.goToPreviousSectionRepeat, + keys: PREVIOUS() + }, { + callbackRepeat: this.goToNextSectionRepeat, + keys: RIGHT + }, { + callbackRepeat: this.goToNextSectionRepeat, + keys: NEXT() + }, { + callback: this.onSwipeDown, + keys: OPEN, + stopPropagation: true + }, { + callback: this.onSwipeDown, + keys: GO_UP(), + stopPropagation: true + }); + } + + return shortcuts; + } + }, { + key: "_setLevel", + value: function _setLevel(level) { + var edition = this.props.edition; + this.level = _newsmemoryUtils.default.oneLevelIndex(edition) ? 1 : level; + } + }, { + key: "_simulateAccessibility", + value: function _simulateAccessibility() { + var accessibilityEnabled = this.props.accessibilityEnabled; + return accessibilityEnabled && !_$$_REQUIRE(_dependencyMap[34]).PlatformUtils.isSystemAccessibilityEnabled(); + } + }, { + key: "_goToNextSection", + value: function _goToNextSection() { + if (this.secondIndexRef) { + this.secondIndexRef.next(); + return true; + } + + return false; + } + }, { + key: "_goToNextSectionRepeat", + value: function _goToNextSectionRepeat() { + return _regenerator.default.async(function _goToNextSectionRepeat$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!this.goToNextSection()) { + _context.next = 2; + break; + } + + return _context.abrupt("return", this.getCallbackRepeatPromise()); + + case 2: + return _context.abrupt("return", Promise.reject()); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_goToPreviousSection", + value: function _goToPreviousSection() { + if (this.secondIndexRef) { + this.secondIndexRef.prev(); + return true; + } + + return false; + } + }, { + key: "_goToPreviousSectionRepeat", + value: function _goToPreviousSectionRepeat() { + return _regenerator.default.async(function _goToPreviousSectionRepeat$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!this.goToPreviousSection()) { + _context2.next = 2; + break; + } + + return _context2.abrupt("return", this.getCallbackRepeatPromise()); + + case 2: + return _context2.abrupt("return", Promise.reject()); + + case 3: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_goToTop", + value: function _goToTop() { + this.onSwipeDown(); + } + }, { + key: "_getFirstLevel", + value: function _getFirstLevel(filterType) { + var items = []; + var edition = this.props.edition; + var sections = []; + var pages = edition.getPages().filter(function (page) { + return page && !page.isProtected() && page.getArticles().find(function (article) { + return article && (!filterType || article.getType() === filterType) && !(article.isSlug() && article.hasFrom()); + }) !== undefined; + }); + pages.forEach(function (page) { + var section = page.getSection(); + + if (!sections.includes(section)) { + items.push(page); + sections.push(section); + } + }); + return items; + } + }, { + key: "_getSecondLevel", + value: function _getSecondLevel(firstLevel) { + var _this2 = this; + + if (firstLevel) { + return firstLevel.map(function (page) { + return _this2._getSecondLevelItems(page.getSection()); + }); + } + + return []; + } + }, { + key: "_getSecondLevelItems", + value: function _getSecondLevelItems(section) { + var items = []; + var edition = this.props.edition; + var skipSection = section === undefined; + edition.getPages().forEach(function (page) { + if (page && !page.isProtected() && (page.getSection() === section || skipSection)) { + if (!skipSection) { + items.push(page); + } + + page.getArticles().forEach(function (article) { + if (article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL && !(article.isSlug() && article.hasFrom())) { + items.push(article); + } + }); + } + }); + return items; + } + }, { + key: "_getSectionByArticle", + value: function _getSectionByArticle(props) { + var edition = props.edition, + currentArticle = props.currentArticle, + currentPage = props.currentPage; + var found; + + if (currentArticle) { + found = edition.getPages().find(function (page) { + return page.getPageId() === currentArticle.getPageId(); + }); + } else if (currentPage) { + found = currentPage; + } + + if (found) { + var index = this.firstLevel.findIndex(function (page) { + return page.getSection() === found.getSection(); + }); + + if (index >= 0) { + return index; + } + } + + return this.indexSecondLevel; + } + }, { + key: "_onSecondLevelChange", + value: function _onSecondLevelChange(index, firstSectionPage) { + if (firstSectionPage) { + var edition = this.props.edition; + (0, _$$_REQUIRE(_dependencyMap[35]).sendNewsmemorySectionIndex)(edition, firstSectionPage); + } + + if (index !== this.indexSecondLevel) { + this.indexSecondLevel = index; + + this._alignPageToCurrentSection(); + } + } + }, { + key: "_onIndexFirstLevelItemPress", + value: function _onIndexFirstLevelItemPress(item, index) { + var onGoToPage = this.props.onGoToPage; + + if (item instanceof _AccessibilityListItem.default) { + this._onIndexAccessibilityItemPress(item); + } else if (typeof onGoToPage === "function" && item instanceof _Page.default && index === -1) { + onGoToPage(item, false, true); + } else { + this._setLevel(2); + + this.indexSecondLevel = index; + this.forceUpdate(); + } + } + }, { + key: "_onIndexAccessibilityItemPress", + value: function _onIndexAccessibilityItemPress(item) { + switch (item.getKey()) { + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.openLiveNews.key: + if (global.TaAddonNeedsCloseButton()) { + _sdkUtils.default.close(); + } else { + this._onOpenLiveNews(); + } + + break; + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.closeAccessibility.key: + this._closeAccessibility(); + + break; + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.goUp.key: + this._onSwipeDown(); + + break; + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.goBack.key: + this._goToPreviousSection(); + + break; + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.goNext.key: + this._goToNextSection(); + + break; + } + } + }, { + key: "_alignPageToCurrentSection", + value: function _alignPageToCurrentSection() { + var item = this.firstLevel[this.indexSecondLevel]; + + if (item) { + _$$_REQUIRE(_dependencyMap[37]).EventRegister.emit(_events.default.NEWSMEMORY_INDEX_CHANGE, { + leftText: item.getSection() + }); + + var onOpenSection = this.props.onOpenSection; + + if (typeof onOpenSection === "function" && item instanceof _Page.default) { + onOpenSection(item); + } + } + } + }, { + key: "_onIndexSecondLevelItemPress", + value: function _onIndexSecondLevelItemPress(item) { + var _this$props = this.props, + onOpenArticle = _this$props.onOpenArticle, + onGoToPage = _this$props.onGoToPage; + + if (item instanceof _AccessibilityListItem.default) { + this._onIndexAccessibilityItemPress(item); + } else if (typeof onGoToPage === "function" && item instanceof _Page.default) { + onGoToPage(item, false, true); + } else if (typeof onOpenArticle === "function" && item instanceof _EPaperArticle.default) { + onOpenArticle(item); + } + } + }, { + key: "_onOpenLiveNews", + value: function _onOpenLiveNews() { + _NavigationService.default.main.reset("RssNavigator"); + } + }, { + key: "_closeAccessibility", + value: function _closeAccessibility() { + var onCloseAccessibility = this.props.onCloseAccessibility; + + if (typeof onCloseAccessibility === "function") { + onCloseAccessibility(); + } + } + }, { + key: "_closeCarMode", + value: function _closeCarMode() { + var onCloseCarMode = this.props.onCloseCarMode; + + if (typeof onCloseCarMode === "function") { + onCloseCarMode(); + } + } + }, { + key: "_onSwipeDown", + value: function _onSwipeDown() { + if (this.isSecondLevel()) { + this.level = 1; + this.indexSecondLevel = 0; + this.forceUpdate(); + } else { + var onIndexFirstLevelClose = this.props.onIndexFirstLevelClose; + onIndexFirstLevelClose(); + } + } + }, { + key: "_renderIndex", + value: function _renderIndex() { + var edition = this.props.edition; + + if (_newsmemoryUtils.default.oneLevelIndex(edition) || this.shouldUseCustomIndex) { + return this._renderIndexAllArtLevel(); + } + + if (this.isSecondLevel()) { + return this._renderIndexSecondLevel(); + } + + return this._renderIndexFirstLevel(); + } + }, { + key: "_renderCustomIndex", + value: function _renderCustomIndex() { + var _this$props2 = this.props, + SpecialComponent = _this$props2.SpecialComponent, + onLocal = _this$props2.onLocal, + customIndexHtml = _this$props2.customIndexHtml, + fullscreen = _this$props2.fullscreen; + + var _global$getActivePSet = global.getActivePSetup(), + specialBeforeIndexTablet = _global$getActivePSet.specialBeforeIndexTablet, + specialBeforeIndexPhone = _global$getActivePSet.specialBeforeIndexPhone; + + var specialPosition = specialBeforeIndexTablet; + + if (!_$$_REQUIRE(_dependencyMap[34]).PlatformUtils.isTablet() || !_deviceUtils.default.isPortrait() && !fullscreen) { + specialPosition = specialBeforeIndexPhone; + } + + return _react.default.createElement(_customIndexComponent.default, { + customIndexHtml: customIndexHtml, + onLocal: onLocal, + SpecialComponent: SpecialComponent, + specialPosition: specialPosition + }); + } + }, { + key: "_renderIndexFirstLevel", + value: function _renderIndexFirstLevel() { + var _this$props3 = this.props, + title = _this$props3.title, + SpecialComponent = _this$props3.SpecialComponent, + FooterComponent = _this$props3.FooterComponent, + fullscreen = _this$props3.fullscreen, + downloadImageMethod = _this$props3.downloadImageMethod, + shortcutEnabled = _this$props3.shortcutEnabled, + shortcutPriority = _this$props3.shortcutPriority, + edition = _this$props3.edition, + accessibilityEnabled = _this$props3.accessibilityEnabled; + + var _global$getActivePSet2 = global.getActivePSetup(), + specialBeforeIndexTablet = _global$getActivePSet2.specialBeforeIndexTablet, + specialBeforeIndexPhone = _global$getActivePSet2.specialBeforeIndexPhone; + + var specialPosition = specialBeforeIndexTablet; + + if (!_$$_REQUIRE(_dependencyMap[34]).PlatformUtils.isTablet() || !_deviceUtils.default.isPortrait() && !fullscreen) { + specialPosition = specialBeforeIndexPhone; + } + + return _react.default.createElement(_indexComponent.default, { + data: this.firstLevel, + title: title, + fullscreen: fullscreen, + onSwipeDown: this.onSwipeDown, + onItemPress: this.onIndexFirstLevelItemPress, + ComponentFooter: FooterComponent, + SpecialComponent: SpecialComponent, + specialPosition: specialPosition, + downloadImageMethod: downloadImageMethod, + layout: _newsmemoryUtils.default.getIndexLayout(edition, accessibilityEnabled), + shortcutEnabled: shortcutEnabled, + shortcutPriority: shortcutPriority + 1, + accessibilityEnabled: accessibilityEnabled, + carModeEnabled: this._isCarModeEnabled() + }); + } + }, { + key: "_renderIndexAllArtLevel", + value: function _renderIndexAllArtLevel() { + var _this$props4 = this.props, + title = _this$props4.title, + SpecialComponent = _this$props4.SpecialComponent, + FooterComponent = _this$props4.FooterComponent, + fullscreen = _this$props4.fullscreen, + shortcutEnabled = _this$props4.shortcutEnabled, + shortcutPriority = _this$props4.shortcutPriority, + edition = _this$props4.edition, + accessibilityEnabled = _this$props4.accessibilityEnabled; + + var _global$getActivePSet3 = global.getActivePSetup(), + specialBeforeIndexTablet = _global$getActivePSet3.specialBeforeIndexTablet, + specialBeforeIndexPhone = _global$getActivePSet3.specialBeforeIndexPhone; + + var specialPosition = specialBeforeIndexTablet; + + if (!_$$_REQUIRE(_dependencyMap[34]).PlatformUtils.isTablet() || !_deviceUtils.default.isPortrait() && !fullscreen) { + specialPosition = specialBeforeIndexPhone; + } + + return _react.default.createElement(_indexComponent.default, { + data: this.allArticles, + title: title, + onItemPress: this.onIndexSecondLevelItemPress, + onSwipeDown: this.onSwipeDown, + fullscreen: fullscreen, + ComponentFooter: FooterComponent, + SpecialComponent: SpecialComponent, + specialPosition: specialPosition, + layout: _newsmemoryUtils.default.getIndexLayout(edition, accessibilityEnabled), + shortcutEnabled: shortcutEnabled, + shortPriority: shortcutPriority + 1, + accessibilityEnabled: accessibilityEnabled, + carModeEnabled: this._isCarModeEnabled() + }); + } + }, { + key: "_renderIndexSecondLevel", + value: function _renderIndexSecondLevel() { + var _this3 = this; + + var _this$props5 = this.props, + FooterComponent = _this$props5.FooterComponent, + fullscreen = _this$props5.fullscreen, + downloadImageMethod = _this$props5.downloadImageMethod, + secondLevelModel = _this$props5.secondLevelModel, + renderHr = _this$props5.renderHr, + shortcutEnabled = _this$props5.shortcutEnabled, + shortcutPriority = _this$props5.shortcutPriority, + edition = _this$props5.edition, + accessibilityEnabled = _this$props5.accessibilityEnabled; + var hrTop; + + if (secondLevelModel) { + hrTop = secondLevelModel.getHrTop(); + } + + return _react.default.createElement(_secondIndexComponent.default, { + ref: function ref(_ref) { + _this3.secondIndexRef = _ref; + }, + data: this.secondLevels, + onItemPress: this.onIndexSecondLevelItemPress, + onSwipeDown: this.onSwipeDown, + onSecondLevelChange: this.onSecondLevelChange, + downloadImageMethod: downloadImageMethod, + enableSeparator: accessibilityEnabled, + fullscreen: fullscreen, + ComponentFooter: FooterComponent, + secondLevelIndex: this.indexSecondLevel, + HrComponent: renderHr(hrTop), + layout: _newsmemoryUtils.default.getIndexLayout(edition, accessibilityEnabled), + shortcutEnabled: shortcutEnabled, + shortcutPriority: shortcutPriority + 1, + accessibilityEnabled: accessibilityEnabled, + carModeEnabled: this._isCarModeEnabled() + }); + } + }, { + key: "_toggleFullscreen", + value: function _toggleFullscreen() { + var active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.fullscreen; + var onToggleFullscreen = this.props.onToggleFullscreen; + + if (typeof onToggleFullscreen === "function") { + onToggleFullscreen(!active); + } + } + }, { + key: "_getButton", + value: function _getButton(button) { + var _this$props6 = this.props, + fullscreen = _this$props6.fullscreen, + onClose = _this$props6.onClose; + var action = button.getAction(); + var library; + var customIcon = button.getIcon(); + var customActiveIcon = button.getActiveIcon(); + + var source = customIcon || _$$_REQUIRE(_dependencyMap[36]).ACTIONS[action].icon; + + var activeSource = customActiveIcon || _$$_REQUIRE(_dependencyMap[36]).ACTIONS[action].activeIcon; + + if (button && button.isLibraryIcon() && customIcon) { + library = button.getLibrary(); + } + + var cssProps = { + classes: ["newsmemory-icon", "newsmemory-index-header-icon"], + cssKey: action + }; + var commonProps = { + key: action, + library: library, + source: source, + cssProps: cssProps + }; + + switch (action) { + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.closeAccessibility.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.closeAccessibility + })); + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.closeCarMode.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.closeCarMode + })); + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.closeArticle.key: + return _react.default.createElement(_closeComponent.default, (0, _extends2.default)({}, commonProps, { + source: library ? customIcon : undefined, + onPress: onClose + })); + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.goBack.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.goToPreviousSection + })); + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.goUp.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.onSwipeDown + })); + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.goNext.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.goToNextSection + })); + + case _$$_REQUIRE(_dependencyMap[36]).ACTIONS.toggleFullScreen.key: + return _react.default.createElement(_twoStateButtonComponent.default, { + key: action, + library: library, + activeSource: activeSource, + inactiveSource: source, + active: fullscreen, + cssProps: cssProps, + onPress: this.toggleFullscreen + }); + } + + return null; + } + }, { + key: "_isCarModeEnabled", + value: function _isCarModeEnabled() { + var carModeEnabled = this.props.carModeEnabled; + return carModeEnabled; + } + }, { + key: "_getComponentSubHeader", + value: function _getComponentSubHeader() { + var _this$props7 = this.props, + firstLevelModel = _this$props7.firstLevelModel, + secondLevelModel = _this$props7.secondLevelModel, + renderHr = _this$props7.renderHr, + accessibilityEnabled = _this$props7.accessibilityEnabled; + var hrTop; + var rightButtons; + var leftButtons; + var textSize = 20; + + var color = _$$_REQUIRE(_dependencyMap[34]).colors.black; + + var header = this.isSecondLevel() ? secondLevelModel : firstLevelModel; + + if (header) { + hrTop = header.getHrTop(); + + if (hrTop) { + color = hrTop.getColor(); + } + + var leftSection = header.getLeft(); + var rightSection = header.getRight(); + var carModeSection = header.getCarMode(); + + if (this._isCarModeEnabled()) { + rightButtons = carModeSection.getButtons(); + + if (carModeSection.getTextSize()) { + textSize = carModeSection.getTextSize(); + } + } else { + leftButtons = leftSection.getButtons(); + rightButtons = rightSection.getButtons(); + + if (leftSection.getTextSize()) { + textSize = leftSection.getTextSize(); + } + } + } + + var _this$props8 = this.props, + title = _this$props8.title, + size = _this$props8.size; + return _react.default.createElement(_subHeaderComponent.default, { + TextComponent: _react.default.createElement(_headerInfoComponent.default, { + color: _$$_REQUIRE(_dependencyMap[34]).ColorUtils.determineTextColor(color), + leftText: title, + textSize: textSize, + accessibilityEnabled: accessibilityEnabled + }), + ButtonsComponent: _react.default.createElement(_subHeaderButtons.default, { + cssButtonClasses: ["newsmemory-icon", "newsmemory-index-header-icon"], + width: size.width, + leftButtons: !accessibilityEnabled || this._isCarModeEnabled() ? leftButtons : [], + rightButtons: !accessibilityEnabled || this._isCarModeEnabled() ? rightButtons : [], + renderButton: this.getButton + }), + HrComponent: renderHr(hrTop), + bgColor: color, + cssClasses: ["newsmemory-index-header"] + }); + } + }, { + key: "render", + value: function render() { + var _this$props9 = this.props, + topAd = _this$props9.topAd, + size = _this$props9.size, + edition = _this$props9.edition, + accessibilityEnabled = _this$props9.accessibilityEnabled, + rest = (0, _objectWithoutProperties2.default)(_this$props9, ["topAd", "size", "edition", "accessibilityEnabled"]); + + if (this.isCustomIndex) { + return this._renderCustomIndex(); + } + + var indexLayout = _newsmemoryUtils.default.getIndexLayout(edition, accessibilityEnabled); + + if (indexLayout === _newsmemoryUtils.IndexLayout.TABS) { + var firstLevel = this._getFirstLevel(_EPaperArticle.EPaperArticleType.EDITORIAL); + + var secondLevels = this._getSecondLevel(firstLevel); + + return _react.default.createElement(_tabIndexComponent.default, (0, _extends2.default)({ + size: size, + firstLevel: firstLevel, + secondLevels: secondLevels, + initialRouteIndex: this.indexSecondLevel + }, rest)); + } + + return _react.default.createElement(_react.default.Fragment, null, this._getComponentSubHeader(), global.getAdsConfig().getAdView(topAd, size.width), _react.default.createElement(_$$_REQUIRE(_dependencyMap[38]).Css, { + classes: ["newsmemory-index"] + }, this._renderIndex())); + } + }]); + return NewsmemoryIndexLayoutManager; + }(_$$_REQUIRE(_dependencyMap[39]).PureShortcut); + + exports.default = NewsmemoryIndexLayoutManager; + NewsmemoryIndexLayoutManager.propTypes = (0, _extends2.default)({ + title: _propTypes.default.string, + firstLevelModel: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[40]).Header).isRequired, + secondLevelModel: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[40]).Header).isRequired, + onLocal: _propTypes.default.func, + onCloseAccessibility: _propTypes.default.func, + onCloseCarMode: _propTypes.default.func, + onClose: _propTypes.default.func, + downloadImageMethod: _propTypes.default.func, + onIndexLevelChange: _propTypes.default.func, + onOpenArticle: _propTypes.default.func, + onOpenSection: _propTypes.default.func, + onIndexFirstLevelClose: _propTypes.default.func, + onGoToPage: _propTypes.default.func, + renderHr: _propTypes.default.func, + fullscreen: _propTypes.default.bool, + onToggleFullscreen: _propTypes.default.func, + currentArticle: _propTypes.default.instanceOf(_EPaperArticle.default), + currentPage: _propTypes.default.instanceOf(_Page.default), + header: _propTypes.default.bool, + FooterComponent: _propTypes.default.node, + SpecialComponent: _propTypes.default.node, + topAd: _propTypes.default.instanceOf(_InStoryAd.default), + customIndexHtml: _propTypes.default.string, + indexLevel: _propTypes.default.number, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }).isRequired, + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default), + edition: _propTypes.default.instanceOf(_Edition.default), + size: _propTypes.default.shape({ + width: _propTypes.default.number + }), + accessibilityEnabled: _propTypes.default.bool, + carModeEnabled: _propTypes.default.bool + }, _$$_REQUIRE(_dependencyMap[39]).PureShortcut.propTypes); + NewsmemoryIndexLayoutManager.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[39]).PureShortcut.defaultProps, { + indexLevel: 1 + }); +},2354,[5,80,108,6,7,8,15,12,14,16,17,201,2355,2359,638,640,2017,2299,458,2298,2372,2374,460,644,2376,2377,2378,1726,1861,603,1874,2380,714,1873,462,1954,1725,572,699,1911,1853]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _indexBaseComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryIndex = function (_IndexBase) { + (0, _inherits2.default)(NewsmemoryIndex, _IndexBase); + + var _super = _createSuper(NewsmemoryIndex); + + function NewsmemoryIndex(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryIndex); + _this = _super.call(this, props); + + _this._init(props); + + return _this; + } + + (0, _createClass2.default)(NewsmemoryIndex, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._readHeader(); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate() { + this._readHeader(); + } + }, { + key: "UNSAFE_componentWillUpdate", + value: function UNSAFE_componentWillUpdate(nextProps) { + this._init(nextProps); + } + }, { + key: "_init", + value: function _init(props) { + this.data = this._getData(props.data, props.accessibilityEnabled); + this.sections = this._getThumbnailsSections(props.layout, props.data); + this.sections.unshift(this._getData([], props.accessibilityEnabled)); + } + }, { + key: "_getAccessibilityItems", + value: function _getAccessibilityItems() { + return (0, _$$_REQUIRE(_dependencyMap[12]).getAccessibilityItemsIndexFirstLevel)(global.getRSSActivePSetup().rssIsEnabled); + } + }, { + key: "_getNumberOfAccessibilityItems", + value: function _getNumberOfAccessibilityItems() { + var accessibilityEnabled = this.props.accessibilityEnabled; + + if (accessibilityEnabled) { + return this._getAccessibilityItems().length; + } + + return 0; + } + }, { + key: "_readHeader", + value: function _readHeader() { + var title = this.props.title; + + if (this._isAccessibilityModeSimulated()) { + global.getAudio().ttsStart(title); + } + } + }, { + key: "_onRead", + value: function _onRead(item) { + return (0, _$$_REQUIRE(_dependencyMap[13]).getFirstLevelText)(item); + } + }, { + key: "_onPageRead", + value: function _onPageRead(page) { + return global.strings("selected_page_of_index", { + page: page + 1 + }); + } + }, { + key: "_getData", + value: function _getData() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var accessibilityEnabled = arguments.length > 1 ? arguments[1] : undefined; + var newData = (0, _toConsumableArray2.default)(data); + + if (accessibilityEnabled) { + newData.unshift.apply(newData, (0, _toConsumableArray2.default)(this._getAccessibilityItems())); + } + + return newData; + } + }, { + key: "_getThumbnailsSections", + value: function _getThumbnailsSections(layout, data) { + switch (layout) { + case _$$_REQUIRE(_dependencyMap[14]).IndexLayout.LIST_WITH_THUMBNAIL: + var result = []; + var thumbnail = []; + var lastSectionLetter = ""; + + for (var i = 0; i < data.length; i++) { + var sectionLetter = _pageUtils.default.getSectionLetterFromPage(data[i].getSection()); + + if ((data[i].getShownPage().includes(".") || data[i].getSection().includes(":") && sectionLetter !== lastSectionLetter) && thumbnail.length > 0) { + lastSectionLetter = sectionLetter; + result.push(thumbnail); + thumbnail = []; + } + + thumbnail.push(data[i]); + + if (i === data.length - 1 && thumbnail.length > 0) { + result.push(thumbnail); + } + } + + return result; + + default: + return []; + } + } + }, { + key: "_showThumbnail", + value: function _showThumbnail() { + var fullscreen = this.props.fullscreen; + return _deviceUtils.default.isPortrait() || fullscreen; + } + }, { + key: "_render", + value: function _render(listProps) { + var _this$props = this.props, + layout = _this$props.layout, + accessibilityEnabled = _this$props.accessibilityEnabled, + carModeEnabled = _this$props.carModeEnabled; + + switch (layout) { + case _$$_REQUIRE(_dependencyMap[14]).IndexLayout.ALL_ART: + return this._renderList(this.data, listProps, _$$_REQUIRE(_dependencyMap[13]).ItemIndexSecondLevel); + + case _$$_REQUIRE(_dependencyMap[14]).IndexLayout.LIST: + return this._renderList(this.data, listProps, _$$_REQUIRE(_dependencyMap[13]).ItemIndexFirstLevel); + + case _$$_REQUIRE(_dependencyMap[14]).IndexLayout.LIST_WITH_THUMBNAIL: + return this._renderSectionWithThumb(this.sections, listProps, function (element) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).ItemIndexFirstLevel, { + item: element.item, + index: element.index, + onPress: listProps.onPress, + focused: element.focused, + accessibilityEnabled: accessibilityEnabled, + carModeEnabled: carModeEnabled + }); + }, this.onThumbnailPress); + } + + return null; + } + }]); + return NewsmemoryIndex; + }(_indexBaseComponent.default); + + exports.default = NewsmemoryIndex; + NewsmemoryIndex.propTypes = { + title: _propTypes.default.string + }; +},2355,[5,21,7,8,12,14,16,17,201,458,715,2356,1725,2357,603]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.SpecialPosition = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _refreshComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _indexLayoutManager = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _shortcutList = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SpecialPosition = { + 0: "bottom", + 1: "top", + none: "none", + top: "top", + bottom: "bottom", + right: "right", + left: "left" + }; + exports.SpecialPosition = SpecialPosition; + + var IndexBase = function (_React$Component) { + (0, _inherits2.default)(IndexBase, _React$Component); + + var _super = _createSuper(IndexBase); + + function IndexBase(props) { + var _this; + + var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + (0, _classCallCheck2.default)(this, IndexBase); + _this = _super.call(this, props); + _this.listRefs = []; + _this.state = (0, _extends2.default)({ + refreshing: false + }, state); + _this.up = _this._up.bind((0, _assertThisInitialized2.default)(_this)); + _this.down = _this._down.bind((0, _assertThisInitialized2.default)(_this)); + _this.getSeparator = _this._getSeparator.bind((0, _assertThisInitialized2.default)(_this)); + _this.onThumbnailPress = _this._onThumbmailPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.isActive = _this._isActive.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRead = _this._onRead.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageRead = _this._onPageRead.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(IndexBase, [{ + key: "_onRef", + value: function _onRef(ref, index) { + this.listRefs[index] = ref; + } + }, { + key: "_getRef", + value: function _getRef() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + return this.listRefs[index]; + } + }, { + key: "_up", + value: function _up() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + if (this.listRefs[index]) { + this.listRefs[index].scrollUp(); + } + } + }, { + key: "_down", + value: function _down() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + if (this.listRefs[index]) { + this.listRefs[index].scrollDown(); + } + } + }, { + key: "_getHeader", + value: function _getHeader() { + return _react.default.createElement(_reactNative.View, null, this._getSpecialView(SpecialPosition.top)); + } + }, { + key: "_getSpecialView", + value: function _getSpecialView(pos) { + var _this$props = this.props, + specialPosition = _this$props.specialPosition, + SpecialComponent = _this$props.SpecialComponent; + return SpecialPosition[specialPosition] === pos && SpecialComponent ? SpecialComponent : null; + } + }, { + key: "_getFooter", + value: function _getFooter() { + var _this$props2 = this.props, + ComponentFooter = _this$props2.ComponentFooter, + accessibilityEnabled = _this$props2.accessibilityEnabled; + return _react.default.createElement(_reactNative.View, null, !accessibilityEnabled ? this._getSpecialView(SpecialPosition.bottom) : null, ComponentFooter); + } + }, { + key: "_getLeftList", + value: function _getLeftList() { + return this._getSpecialView(SpecialPosition.left); + } + }, { + key: "_getRightList", + value: function _getRightList() { + return this._getSpecialView(SpecialPosition.right); + } + }, { + key: "_getSeparator", + value: function _getSeparator() { + var enableSeparator = this.props.enableSeparator; + + if (enableSeparator) { + return this._getSeparatorLine({ + backgroundColor: _$$_REQUIRE(_dependencyMap[16]).LIST_ITEM_SEPARATOR_COLOR, + height: _$$_REQUIRE(_dependencyMap[16]).LIST_ITEM_SEPARATOR_HEIGHT + }); + } + + return null; + } + }, { + key: "_getSeparatorLine", + value: function _getSeparatorLine(style) { + return (0, _$$_REQUIRE(_dependencyMap[17]).hr)(style); + } + }, { + key: "_render", + value: function _render() { + return null; + } + }, { + key: "_onThumbmailPress", + value: function _onThumbmailPress(page) { + var onItemPress = this.props.onItemPress; + onItemPress(page, -1); + } + }, { + key: "_showThumbnail", + value: function _showThumbnail() { + return false; + } + }, { + key: "_isActive", + value: function _isActive(index) { + return true; + } + }, { + key: "_onRead", + value: function _onRead(item) { + return undefined; + } + }, { + key: "_onPageRead", + value: function _onPageRead(item) { + return undefined; + } + }, { + key: "_getNumberOfAccessibilityItems", + value: function _getNumberOfAccessibilityItems() { + return 0; + } + }, { + key: "_isAccessibilityModeSimulated", + value: function _isAccessibilityModeSimulated() { + var accessibilityEnabled = this.props.accessibilityEnabled; + return accessibilityEnabled && !_$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isSystemAccessibilityEnabled(); + } + }, { + key: "_renderList", + value: function _renderList(data, listProps, RenderComponent) { + var _this2 = this; + + var sectionIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; + var _this$props3 = this.props, + shortcutPriority = _this$props3.shortcutPriority, + carModeEnabled = _this$props3.carModeEnabled, + accessibilityEnabled = _this$props3.accessibilityEnabled; + + var numberOfAccessibilityItems = this._getNumberOfAccessibilityItems(sectionIndex); + + return _react.default.createElement(_shortcutList.default, (0, _extends2.default)({ + ref: function ref(_ref2) { + return _this2._onRef(_ref2, sectionIndex); + }, + keyExtractor: function keyExtractor(current, idx) { + return "index_level_" + idx; + } + }, listProps, { + readFocusedItem: carModeEnabled, + onRead: this.onRead, + onPageRead: this.onPageRead, + ItemSeparatorComponent: this.getSeparator, + ListHeaderComponent: this._getHeader(data, sectionIndex), + renderItem: function renderItem(_ref) { + var item = _ref.item, + index = _ref.index, + focusedItem = _ref.focusedItem; + return _react.default.createElement(RenderComponent, { + item: item, + index: Math.max(index - numberOfAccessibilityItems, 0), + onPress: listProps.onPress, + focused: _$$_REQUIRE(_dependencyMap[18]).JSUtils.areEqualShallow(item, focusedItem), + accessibilityEnabled: accessibilityEnabled, + carModeEnabled: carModeEnabled + }); + }, + data: data, + plainData: data, + isActive: function isActive() { + return _this2.isActive(sectionIndex); + }, + shortcutPriority: shortcutPriority + 1 + })); + } + }, { + key: "_renderSectionWithThumb", + value: function _renderSectionWithThumb(data, listProps, _renderItem, onThumbnailPress) { + var _this3 = this; + + var sectionIndex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; + var _this$props4 = this.props, + shortcutPriority = _this$props4.shortcutPriority, + fullscreen = _this$props4.fullscreen, + downloadImageMethod = _this$props4.downloadImageMethod, + carModeEnabled = _this$props4.carModeEnabled, + accessibilityEnabled = _this$props4.accessibilityEnabled; + var plainData = data.reduce(function (current, subData) { + return [].concat((0, _toConsumableArray2.default)(current), (0, _toConsumableArray2.default)(subData)); + }, []); + var generalIndex = 0; + return _react.default.createElement(_shortcutList.default, (0, _extends2.default)({ + ref: function ref(_ref4) { + return _this3._onRef(_ref4, sectionIndex); + }, + keyExtractor: function keyExtractor(item, index) { + return "level_" + index; + }, + readFocusedItem: carModeEnabled, + onRead: this.onRead, + onPageRead: this.onPageRead + }, listProps, { + ListHeaderComponent: this._getHeader(plainData, sectionIndex), + ItemSeparatorComponent: this.getSeparator, + data: data, + plainData: plainData, + isActive: function isActive() { + return _this3.isActive(sectionIndex); + }, + renderItem: function renderItem(_ref3) { + var item = _ref3.item, + index = _ref3.index, + focusedItem = _ref3.focusedItem; + var page; + + if (item[0] instanceof _Page.default) { + page = item[0]; + } + + generalIndex += data[index - 1] ? data[index - 1].length : 0; + return _react.default.createElement(_reactNative.View, { + style: _indexLayoutManager.default.secondLevelThumbLine + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).IndexThumbnail, { + page: page, + downloadImageMethod: downloadImageMethod, + fullscreen: fullscreen, + showThumbnail: _this3._showThumbnail(), + onPress: onThumbnailPress, + accessibilityEnabled: accessibilityEnabled, + carModeEnabled: carModeEnabled + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).Css, { + classes: ["newsmemory-index-item-right"] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, item.map(function (element, idx) { + return typeof _renderItem === "function" ? _react.default.createElement(_react.default.Fragment, null, _renderItem({ + item: element, + index: idx + generalIndex, + focused: _$$_REQUIRE(_dependencyMap[18]).JSUtils.areEqualShallow(element, focusedItem) + }), idx < item.length - 1 ? _this3.getSeparator() : null) : null; + })))); + } + })); + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props5 = this.props, + onSwipeDown = _this$props5.onSwipeDown, + onItemPress = _this$props5.onItemPress, + accessibilityEnabled = _this$props5.accessibilityEnabled; + var refreshing = this.state.refreshing; + + var indexContainerStyle = _$$_REQUIRE(_dependencyMap[20]).Css.getStyleByCssClasses(["newsmemory-index-container"]); + + var indexFooterStyle = _$$_REQUIRE(_dependencyMap[20]).Css.getStyleByCssClasses(["newsmemory-index-footer"]); + + var listProps = { + accessibilityEnabled: accessibilityEnabled, + contentContainerStyle: [{ + flexGrow: 1 + }, indexContainerStyle], + ListFooterComponent: this._getFooter(), + ListFooterComponentStyle: [{ + flex: 1, + justifyContent: "flex-end", + marginTop: _indexLayoutManager.LINE_PADDING + }, indexFooterStyle], + onPress: onItemPress, + refreshControl: !accessibilityEnabled ? _react.default.createElement(_refreshComponent.default, { + refreshing: refreshing, + onRefresh: function onRefresh() { + if (typeof onSwipeDown === "function") { + onSwipeDown(); + } + + _this4.setState({ + refreshing: false + }); + }, + cssClasses: ["newsmemory-article-refresh-control"] + }) : null + }; + var leftSpecial = !accessibilityEnabled ? this._getLeftList() : null; + var rightSpecial = !accessibilityEnabled ? this._getRightList() : null; + return _react.default.createElement(_reactNative.View, { + style: _indexLayoutManager.default.parent + }, leftSpecial ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).Css, { + classes: ["newsmemory-index-left"] + }, _react.default.createElement(_reactNative.View, { + style: _indexLayoutManager.default.specialContainer + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).TecnaviaScrollView, { + style: _indexLayoutManager.default.container + }, leftSpecial))) : null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).Css, { + classes: ["newsmemory-index-center"] + }, _react.default.createElement(_reactNative.View, { + style: _indexLayoutManager.default.centerContainer + }, this._render(listProps))), rightSpecial ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).Css, { + classes: ["newsmemory-index-right"] + }, _react.default.createElement(_reactNative.View, { + style: _indexLayoutManager.default.specialContainer + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).TecnaviaScrollView, { + style: _indexLayoutManager.default.container + }, rightSpecial))) : null); + } + }]); + return IndexBase; + }(_react.default.Component); + + exports.default = IndexBase; + IndexBase.propTypes = (0, _extends2.default)({ + data: _propTypes.default.array.isRequired, + layout: _propTypes.default.oneOf([_$$_REQUIRE(_dependencyMap[22]).IndexLayout.LIST, _$$_REQUIRE(_dependencyMap[22]).IndexLayout.LIST_WITH_THUMBNAIL]), + onSwipeDown: _propTypes.default.func, + downloadImageMethod: _propTypes.default.func, + fullscreen: _propTypes.default.bool, + onItemPress: _propTypes.default.func.isRequired, + renderItem: _propTypes.default.func, + enableSeparator: _propTypes.default.bool, + accessibilityEnabled: _propTypes.default.bool, + carModeEnabled: _propTypes.default.bool, + renderSeparator: _propTypes.default.func, + specialPosition: _propTypes.default.oneOf(["0", "1", SpecialPosition.none, SpecialPosition.top, SpecialPosition.bottom, SpecialPosition.right, SpecialPosition.left]), + ComponentFooter: _propTypes.default.node.isRequired, + SpecialComponent: _propTypes.default.node + }, _$$_REQUIRE(_dependencyMap[23]).Shortcut.propTypes); + IndexBase.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[23]).Shortcut.defaultProps, { + specialPosition: SpecialPosition.none, + enableSeparator: true, + fullscreen: false + }); +},2356,[5,21,6,7,8,15,12,14,16,17,28,201,2099,638,2190,1908,729,2195,462,2357,699,1909,603,1911]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getSecondLevelText = exports.getSecondLevelHeaderText = exports.getFirstLevelText = exports.IndexThumbnail = exports.ItemIndexSecondLevel = exports.ItemIndexFirstLevel = exports.IndexSectionHeader = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _indexLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _newsmemoryScalableImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _AccessibilityListItem = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var getFirstLevelText = function getFirstLevelText(item) { + if (item instanceof _AccessibilityListItem.default) { + return item.getText(); + } + + if (item instanceof _EPaperArticle.default) { + return _$$_REQUIRE(_dependencyMap[14]).StringUtils.decodeHTML(item.getTitle()); + } + + if (item instanceof _Page.default) { + return _$$_REQUIRE(_dependencyMap[14]).StringUtils.decodeHTML(item.getSection()); + } + + return ""; + }; + + exports.getFirstLevelText = getFirstLevelText; + + var ItemIndexFirstLevel = function ItemIndexFirstLevel(props) { + var item = props.item, + index = props.index, + _onPress = props.onPress, + focused = props.focused, + accessibilityEnabled = props.accessibilityEnabled, + carModeEnabled = props.carModeEnabled; + var text = getFirstLevelText(item); + var enableTouch = !accessibilityEnabled && !carModeEnabled; + var PageComponent = enableTouch ? _reactNative.TouchableOpacity : _reactNative.View; + var pageProps = { + key: index + }; + + if (enableTouch) { + pageProps.onPress = function () { + return _onPress(item, -1); + }; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-item", "newsmemory-index-item-first-level", focused ? "newsmemory-index-item-focused" : "", focused ? "newsmemory-index-item-first-level-focused" : ""] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ItemAccessibilityFocused, { + touchable: true, + focused: focused, + style: [_indexLayoutManager.default.firstLevelItem, focused ? _indexLayoutManager.default.firstLevelItemFocused : undefined], + key: index, + hasTVPreferredFocus: true, + onPress: function onPress() { + return _onPress(item, index); + }, + accessibilityEnabled: accessibilityEnabled, + accessibilityLabel: text + }, item instanceof _AccessibilityListItem.default ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ItemListAccessibility, { + text: text, + style: _indexLayoutManager.default.firstLevelItemAccessibility, + classes: ["newsmemory-index-accessibility-text-first-level"] + }) : _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-text", "newsmemory-index-first-level-section"] + }, _react.default.createElement(_fontText.default, { + style: _indexLayoutManager.default.firstLevelItemSection, + numberOfLines: 1, + ellipsizeMode: "tail" + }, text)), _react.default.createElement(PageComponent, pageProps, item instanceof _Page.default ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-text", "newsmemory-index-first-level-page"] + }, _react.default.createElement(_fontText.default, { + style: [_indexLayoutManager.default.firstLevelItemPage, accessibilityEnabled || carModeEnabled ? _indexLayoutManager.default.firstLevelItemPageAccessibility : undefined] + }, _pageUtils.default.removeZerosFromPageNumber(item.getShownPage()))) : null))); + }; + + exports.ItemIndexFirstLevel = ItemIndexFirstLevel; + + var getSecondLevelHeaderText = function getSecondLevelHeaderText(page) { + if (page) { + return _$$_REQUIRE(_dependencyMap[14]).StringUtils.decodeHTML(page.getSection()); + } + + return ""; + }; + + exports.getSecondLevelHeaderText = getSecondLevelHeaderText; + + var IndexSectionHeader = function IndexSectionHeader(props) { + var _props$section = props.section, + section = _props$section === undefined ? "" : _props$section, + accessibilityEnabled = props.accessibilityEnabled; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-item", "newsmemory-index-second-level-header"] + }, _react.default.createElement(_reactNative.View, { + style: [_indexLayoutManager.default.secondLevelHeaderParent] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ItemAccessibilityFocused, { + accessibilityEnabled: accessibilityEnabled, + touchable: false, + accessibilityLabel: section + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-text", "newsmemory-index-second-level-text"] + }, _react.default.createElement(_fontText.default, { + style: _indexLayoutManager.default.secondLevelHeader, + numberOfLines: 1, + ellipsizeMode: "tail", + type: _fontText.Type.bold + }, section))))); + }; + + exports.IndexSectionHeader = IndexSectionHeader; + + var IndexThumbnail = function IndexThumbnail(props) { + var page = props.page, + downloadImageMethod = props.downloadImageMethod, + showThumbnail = props.showThumbnail, + onPress = props.onPress, + fullscreen = props.fullscreen, + accessibilityEnabled = props.accessibilityEnabled, + carModeEnabled = props.carModeEnabled; + + if (!page || !showThumbnail) { + return null; + } + + var height = 90; + + if (_$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isTablet()) { + height = 156; + + if (fullscreen && !_deviceUtils.default.isPortrait()) { + height = 256; + } + } else if (!_deviceUtils.default.isPortrait()) { + height = 256; + } + + var thumbnailCss = _$$_REQUIRE(_dependencyMap[15]).Css.getStyleObjByCssClasses(["newsmemory-index-item-image", fullscreen ? "newsmemory-index-item-image-fullscreen" : "newsmemory-index-item-image-spit-screen"]); + + height = thumbnailCss.height || height; + var enableTouch = !accessibilityEnabled && !carModeEnabled; + var PageComponent = enableTouch ? _reactNative.TouchableOpacity : _reactNative.View; + var pageProps = { + style: _indexLayoutManager.default.secondLevelTouchable, + accessibilityLabel: global.strings("str_page") + " " + _pageUtils.default.removeZerosFromPageNumber(page.getPage()) + }; + + if (enableTouch) { + pageProps.onPress = function () { + if (typeof onPress === "function") { + onPress(page); + } + }; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-item-left"] + }, _react.default.createElement(PageComponent, pageProps, _react.default.createElement(_newsmemoryScalableImageComponent.default, { + onDownload: downloadImageMethod, + style: [_indexLayoutManager.default.secondLevelImage, thumbnailCss], + height: height, + color: _newsmemoryUtils.default.getSpinnerColor(), + page: page + }))); + }; + + exports.IndexThumbnail = IndexThumbnail; + IndexThumbnail.propTypes = { + page: _propTypes.default.instanceOf(_Page.default), + fullscreen: _propTypes.default.bool, + accessibilityEnabled: _propTypes.default.bool, + carModeEnabled: _propTypes.default.bool, + showThumbnail: _propTypes.default.bool, + downloadImageMethod: _propTypes.default.func, + onPress: _propTypes.default.func + }; + + var getSecondLevelText = function getSecondLevelText(item) { + var text = ""; + + if (item instanceof _AccessibilityListItem.default) { + text = item.getText(); + } else if (item instanceof _Page.default) { + text = global.strings("str_page") + " " + _pageUtils.default.removeZerosFromPageNumber(item.getPage()); + } else if (item instanceof _EPaperArticle.default) { + text = "" + _$$_REQUIRE(_dependencyMap[14]).StringUtils.decodeHTML(item.getTitle()); + } + + return text; + }; + + exports.getSecondLevelText = getSecondLevelText; + + var ItemIndexSecondLevel = function ItemIndexSecondLevel(props) { + var item = props.item, + index = props.index, + onPress = props.onPress, + focused = props.focused, + accessibilityEnabled = props.accessibilityEnabled, + carModeEnabled = props.carModeEnabled; + var text = getSecondLevelText(item); + var enableTouch = item instanceof _EPaperArticle.default || item instanceof _AccessibilityListItem.default || !accessibilityEnabled && !carModeEnabled; + var parentProps = { + accessibilityEnabled: accessibilityEnabled, + accessibilityLabel: text, + style: [_indexLayoutManager.default.secondLevelItem, focused ? _indexLayoutManager.default.secondLevelItemFocused : undefined], + key: index + }; + + if (enableTouch) { + parentProps.onPress = function () { + return onPress(item, index); + }; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-item", focused ? "newsmemory-index-item-focused" : "", "newsmemory-index-item-second-level", focused ? "newsmemory-index-item-second-level-focused" : ""] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ItemAccessibilityFocused, (0, _extends2.default)({ + touchable: enableTouch, + focused: focused + }, parentProps), item instanceof _AccessibilityListItem.default ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ItemListAccessibility, { + text: text, + style: _indexLayoutManager.default.secondLevelItemAccessibility, + classes: ["newsmemory-index-accessibility-text-second-level"] + }) : null, item instanceof _Page.default ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-text", "newsmemory-index-second-level-page"] + }, _react.default.createElement(_fontText.default, { + style: [_indexLayoutManager.default.secondLevelItemPage, accessibilityEnabled || carModeEnabled ? _indexLayoutManager.default.secondLevelItemPageAccessibility : undefined] + }, text)) : null, item instanceof _EPaperArticle.default ? _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-text", "newsmemory-index-second-level-title", "newsmemory-index-second-level-bullet"] + }, _react.default.createElement(_fontText.default, { + style: _indexLayoutManager.default.secondLevelItemBullet + }, _$$_REQUIRE(_dependencyMap[14]).StringUtils.BULLET + " ")), _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).Css, { + classes: ["newsmemory-index-text", "newsmemory-index-second-level-title"] + }, _react.default.createElement(_fontText.default, { + style: _indexLayoutManager.default.secondLevelItemTitle, + numberOfLines: 2, + ellipsizeMode: "tail" + }, text))) : null)); + }; + + exports.ItemIndexSecondLevel = ItemIndexSecondLevel; +},2357,[5,6,17,201,28,1879,2190,638,640,715,603,458,2358,1726,462,699,2189]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryScalableImage = function (_React$Component) { + (0, _inherits2.default)(NewsmemoryScalableImage, _React$Component); + + var _super = _createSuper(NewsmemoryScalableImage); + + function NewsmemoryScalableImage(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryScalableImage); + _this = _super.call(this, props); + _this.state = { + error: false, + loading: true + }; + _this.imageSize = undefined; + _this.onDownload = _this._onDownload.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(NewsmemoryScalableImage, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._checkSize(this.props); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + this._checkSize(nextProps); + } + }, { + key: "_checkSize", + value: function _checkSize(props) { + var style, error; + return _regenerator.default.async(function _checkSize$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + style = props.style; + this.size = { + width: _$$_REQUIRE(_dependencyMap[17]).CssUtils.getAttributeFromStyle("width", style), + height: _$$_REQUIRE(_dependencyMap[17]).CssUtils.getAttributeFromStyle("height", style) + }; + error = false; + _context.prev = 3; + _context.next = 6; + return _regenerator.default.awrap(this._getImageSize()); + + case 6: + this.imageSize = _context.sent; + _context.next = 24; + break; + + case 9: + _context.prev = 9; + _context.t0 = _context["catch"](3); + _context.prev = 11; + _context.next = 14; + return _regenerator.default.awrap(this._onDownload()); + + case 14: + error = !_context.sent; + + if (error) { + _context.next = 19; + break; + } + + _context.next = 18; + return _regenerator.default.awrap(this._getImageSize()); + + case 18: + this.imageSize = _context.sent; + + case 19: + _context.next = 24; + break; + + case 21: + _context.prev = 21; + _context.t1 = _context["catch"](11); + error = true; + + case 24: + this.setState({ + loading: false, + error: error + }); + + case 25: + case "end": + return _context.stop(); + } + } + }, null, this, [[3, 9], [11, 21]], Promise); + } + }, { + key: "_getImageSize", + value: function _getImageSize() { + var page; + return _regenerator.default.async(function _getImageSize$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + page = this.props.page; + + if (!page.getLowImage()) { + _context2.next = 3; + break; + } + + return _context2.abrupt("return", { + width: page.getLowImage().getWidth(), + height: page.getLowImage().getHeight() + }); + + case 3: + throw new Error("Not works with static images"); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onDownload", + value: function _onDownload() { + var _this$props, onDownload, page, image; + + return _regenerator.default.async(function _onDownload$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _this$props = this.props, onDownload = _this$props.onDownload, page = _this$props.page; + + if (!(typeof onDownload === "function")) { + _context3.next = 8; + break; + } + + image = new _EPaperImage.default(); + image.setPageId(page.getPageId()); + image.setType(_EPaperImage.EPaperImageType.LOW); + _context3.next = 7; + return _regenerator.default.awrap(onDownload(page, image)); + + case 7: + return _context3.abrupt("return", true); + + case 8: + return _context3.abrupt("return", false); + + case 9: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + page = _this$props2.page, + color = _this$props2.color, + style = _this$props2.style, + height = _this$props2.height, + rest = (0, _objectWithoutProperties2.default)(_this$props2, ["page", "color", "style", "height"]); + var _this$state = this.state, + error = _this$state.error, + loading = _this$state.loading; + + if (error) { + return null; + } + + if (loading) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[18]).ProgressCircle, { + spinnerColor: color, + spinnerStyle: { + flex: 0 + } + }); + } + + var aspectRatio = this.imageSize.height / this.imageSize.width; + var scaleY = 1; + + if (height < this.imageSize.height) { + scaleY = height / this.imageSize.height; + } + + var xDivider = page.isDoubleTruck() ? 2 : 1; + this.imageSize.height *= scaleY; + var imageWidth = this.imageSize.height / aspectRatio || 0; + return _react.default.createElement(_reactNative.View, { + style: [style, { + width: imageWidth / xDivider, + height: this.imageSize.height, + overflow: "hidden" + }] + }, _react.default.createElement(_imageComponent.default, (0, _extends2.default)({}, rest, { + style: { + width: imageWidth, + height: this.imageSize.height + }, + source: { + uri: "file://" + _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory() + page.getLowImage().getBase64() + }, + resizeMode: "contain" + }))); + } + }]); + return NewsmemoryScalableImage; + }(_react.default.Component); + + exports.default = NewsmemoryScalableImage; + NewsmemoryScalableImage.propTypes = { + onDownload: _propTypes.default.func.isRequired, + color: _propTypes.default.string, + height: _propTypes.default.number, + style: _propTypes.default.any, + page: _propTypes.default.instanceOf(_Page.default) + }; +},2358,[5,80,6,108,7,8,15,12,14,16,17,201,28,588,638,587,574,462,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _viewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _indexBaseComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemorySecondIndex = function (_IndexBase) { + (0, _inherits2.default)(NewsmemorySecondIndex, _IndexBase); + + var _super = _createSuper(NewsmemorySecondIndex); + + function NewsmemorySecondIndex(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemorySecondIndex); + _this = _super.call(this, props); + _this.sectionIndex = props.secondLevelIndex; + _this.sections = _this._getThumbnailsSections(props.layout, props.data); + _this.sectionsName = _this._getSectionsName(props.layout); + _this.next = _this._next.bind((0, _assertThisInitialized2.default)(_this)); + _this.prev = _this._prev.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSectionRef = _this._onSectionRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageChange = _this._onPageChange.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(NewsmemorySecondIndex, [{ + key: "_getSectionsName", + value: function _getSectionsName(layout) { + var names = []; + + if (this.sections) { + switch (layout) { + case _$$_REQUIRE(_dependencyMap[15]).IndexLayout.LIST_WITH_THUMBNAIL: + names = this.sections.map(function (section) { + var page; + + for (var i = 0; i < section.length && !page; i++) { + page = section[i].find(function (item) { + return item instanceof _Page.default; + }); + } + + return page ? (0, _$$_REQUIRE(_dependencyMap[16]).getSecondLevelHeaderText)(page) : ""; + }); + break; + + default: + names = this.sections.map(function (section) { + var page = section.find(function (item) { + return item instanceof _Page.default; + }); + return page ? (0, _$$_REQUIRE(_dependencyMap[16]).getSecondLevelHeaderText)(page) : ""; + }); + break; + } + } + + return names; + } + }, { + key: "_readHeader", + value: function _readHeader(index) { + if (this.lastSectionHeaderRead !== index) { + this.lastSectionHeaderRead = index; + + try { + if (this._isAccessibilityModeSimulated()) { + global.getAudio().ttsStart(global.strings("msg_entering_section", { + section: this.sectionsName[index] + })); + } + } catch (e) {} + } + } + }, { + key: "_getData", + value: function _getData() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var index = arguments.length > 1 ? arguments[1] : undefined; + var length = arguments.length > 2 ? arguments[2] : undefined; + var accessibilityEnabled = this.props.accessibilityEnabled; + var newData = (0, _toConsumableArray2.default)(data); + + if (accessibilityEnabled) { + newData.unshift.apply(newData, (0, _toConsumableArray2.default)((0, _$$_REQUIRE(_dependencyMap[17]).getAccessibilityItemsIndexSecondLevel)(index, length, this.sectionsName))); + } + + return newData; + } + }, { + key: "_clearFocus", + value: function _clearFocus() { + var _this2 = this; + + this.listRefs.forEach(function (ref, index) { + if (ref && _this2.sectionIndex !== index) { + ref.resetFocusedItem(); + } + }); + } + }, { + key: "_next", + value: function _next() { + if (this.secondLevelRef) { + this.secondLevelRef.scrollToNext(); + } + + this._clearFocus(); + } + }, { + key: "_prev", + value: function _prev() { + if (this.secondLevelRef) { + this.secondLevelRef.scrollToPrev(); + } + + this._clearFocus(); + } + }, { + key: "_up", + value: function _up() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemorySecondIndex.prototype), "_up", this).call(this, this.sectionIndex); + } + }, { + key: "_down", + value: function _down() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemorySecondIndex.prototype), "_down", this).call(this, this.sectionIndex); + } + }, { + key: "_onPageChange", + value: function _onPageChange(index) { + var _this$props = this.props, + onSecondLevelChange = _this$props.onSecondLevelChange, + data = _this$props.data; + + if (typeof onSecondLevelChange === "function") { + var firstPageOfSection; + + if (data[index] && data[index].length > 0) { + firstPageOfSection = data[index][0]; + } + + onSecondLevelChange(index, firstPageOfSection); + } + + this._readHeader(index); + + if (this.sectionIndex !== index) { + this.sectionIndex = index; + + this._clearFocus(); + } + } + }, { + key: "_onSectionRef", + value: function _onSectionRef(ref) { + this.secondLevelRef = ref; + } + }, { + key: "_getNumberOfAccessibilityItems", + value: function _getNumberOfAccessibilityItems(index) { + var accessibilityEnabled = this.props.accessibilityEnabled; + + if (accessibilityEnabled) { + return (0, _$$_REQUIRE(_dependencyMap[17]).getAccessibilityItemsIndexSecondLevel)(index, this.sections.length, this.sectionsName).length; + } + + return 0; + } + }, { + key: "_onRead", + value: function _onRead(item) { + return (0, _$$_REQUIRE(_dependencyMap[16]).getSecondLevelText)(item); + } + }, { + key: "_onPageRead", + value: function _onPageRead(page) { + return global.strings("selected_page_of_section", { + page: page + 1, + section: this.sectionsName[this.sectionIndex] + }); + } + }, { + key: "_getThumbnailsSections", + value: function _getThumbnailsSections(layout, data) { + switch (layout) { + case _$$_REQUIRE(_dependencyMap[15]).IndexLayout.LIST_WITH_THUMBNAIL: + return data.map(function (section) { + var thumbnail = []; + var result = []; + + for (var i = 0; i < section.length; i++) { + if (section[i] instanceof _Page.default && thumbnail.length > 0) { + result.push(thumbnail); + thumbnail = []; + } + + thumbnail.push(section[i]); + + if (i === section.length - 1 && thumbnail.length > 0) { + result.push(thumbnail); + } + } + + return result; + }); + + default: + return data; + } + } + }, { + key: "_getHeader", + value: function _getHeader(section, index) { + var _this$props2 = this.props, + HrComponent = _this$props2.HrComponent, + accessibilityEnabled = _this$props2.accessibilityEnabled; + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).IndexSectionHeader, { + section: this.sectionsName[index], + accessibilityEnabled: accessibilityEnabled + }), HrComponent); + } + }, { + key: "_showThumbnail", + value: function _showThumbnail() { + return true; + } + }, { + key: "_isActive", + value: function _isActive(index) { + return this.sectionIndex === index; + } + }, { + key: "_renderSection", + value: function _renderSection(section, index, listProps) { + var _this$props3 = this.props, + layout = _this$props3.layout, + accessibilityEnabled = _this$props3.accessibilityEnabled, + carModeEnabled = _this$props3.carModeEnabled; + + switch (layout) { + case _$$_REQUIRE(_dependencyMap[15]).IndexLayout.LIST: + return this._renderList(this._getData(section, index, this.sections.length), listProps, _$$_REQUIRE(_dependencyMap[16]).ItemIndexSecondLevel, index); + + case _$$_REQUIRE(_dependencyMap[15]).IndexLayout.LIST_WITH_THUMBNAIL: + var newSection = [this._getData([], index, this.sections.length)].concat((0, _toConsumableArray2.default)(section)); + return this._renderSectionWithThumb(newSection, listProps, function (element) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ItemIndexSecondLevel, { + item: element.item, + index: element.index, + onPress: listProps.onPress, + focused: element.focused, + accessibilityEnabled: accessibilityEnabled, + carModeEnabled: carModeEnabled + }); + }, this.onThumbnailPress, index); + } + + return null; + } + }, { + key: "_render", + value: function _render(listProps) { + var _this3 = this; + + return _react.default.createElement(_viewPagerComponent.default, { + ref: this.onSectionRef, + data: this.sections, + startPage: this.sectionIndex, + onPageChange: this.onPageChange, + nestedScrollEnabled: true, + minPointers: this._isAccessibilityModeSimulated() ? 2 : 1, + renderPage: function renderPage(section, index) { + return _this3._renderSection(_this3.sections[index], index, listProps); + } + }); + } + }]); + return NewsmemorySecondIndex; + }(_indexBaseComponent.default); + + exports.default = NewsmemorySecondIndex; + NewsmemorySecondIndex.propTypes = (0, _extends2.default)({}, _indexBaseComponent.default.propTypes, { + secondLevelIndex: _propTypes.default.number, + HrComponent: _propTypes.default.node, + onSecondLevelChange: _propTypes.default.func.isRequired + }); + NewsmemorySecondIndex.defaultProps = (0, _extends2.default)({}, _indexBaseComponent.default.defaultProps, { + secondLevelIndex: 0 + }); +},2359,[5,6,21,7,8,15,90,12,14,16,17,201,2360,2356,638,603,2357,1725]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _newViewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _oldIosViewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var ViewPager = _react.default.forwardRef(function (props, ref) { + var _global$getActivePSet = global.getActivePSetup(), + useNativeViewPagerIOS = _global$getActivePSet.useNativeViewPagerIOS; + + var ViewPagerComponent = useNativeViewPagerIOS ? _newViewPagerComponent.default : _oldIosViewPagerComponent.default; + return _react.default.createElement(ViewPagerComponent, (0, _extends2.default)({}, props, { + ref: ref + })); + }); + + var _default = ViewPager; + exports.default = _default; +},2360,[5,6,17,2361,2370]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _reactNativePagerView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _viewPagerIndicators = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _viewPagerChild = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _einkNavigationsButtons = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var WrappedViewPager = (0, _$$_REQUIRE(_dependencyMap[15]).createNativeWrapper)(_reactNativePagerView.default, { + disallowInterruption: false, + shouldActivateOnStart: true + }); + + var ViewPager = function (_React$Component) { + (0, _inherits2.default)(ViewPager, _React$Component); + + var _super = _createSuper(ViewPager); + + function ViewPager(props) { + var _this; + + (0, _classCallCheck2.default)(this, ViewPager); + _this = _super.call(this, props); + _this.viewPagerRef = _react.default.createRef(); + _this.einkRef = _react.default.createRef(); + _this.state = { + index: props.startPage + }; + _this.isRtl = _$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isRTL(); + _this.toggleViewPagerState = _this._toggleViewPagerState.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageSelected = _this._onPageSelected.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(ViewPager, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var index = this.state.index; + + if (index !== nextProps.startPage && this.getRef()) { + this.scrollTo(nextProps.startPage); + } + } + }, { + key: "getRef", + value: function getRef() { + return this.viewPagerRef && this.viewPagerRef.current ? this.viewPagerRef.current : undefined; + } + }, { + key: "getGestureHandlerRef", + value: function getGestureHandlerRef() { + return this.viewPagerRef; + } + }, { + key: "scrollTo", + value: function scrollTo(newPage) { + var animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var ref = this.getRef(); + + if (ref) { + var data = this.props.data; + + if (newPage >= 0 && newPage < data.length) { + if (animated && !_$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isEInk()) { + ref.setPage(newPage); + } else { + ref.setPageWithoutAnimation(newPage); + } + } + } + } + }, { + key: "scrollToNext", + value: function scrollToNext() { + var index = this.state.index; + this.scrollTo(this.isRtl ? index - 1 : index + 1, true); + } + }, { + key: "scrollToPrev", + value: function scrollToPrev() { + var index = this.state.index; + this.scrollTo(this.isRtl ? index + 1 : index - 1, true); + } + }, { + key: "toggleState", + value: function toggleState(state) { + if (this.getRef()) { + this.getRef().setScrollEnabled(_$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isEInk() ? false : state); + } + } + }, { + key: "_toggleViewPagerState", + value: function _toggleViewPagerState(_ref) { + var scrollEnabled = _ref.scrollEnabled, + simultaneousHandlers = _ref.simultaneousHandlers, + waitFor = _ref.waitFor, + enabled = _ref.enabled; + this.toggleState(scrollEnabled); + } + }, { + key: "_onPageSelected", + value: function _onPageSelected(_ref2) { + var nativeEvent = _ref2.nativeEvent; + var _this$props = this.props, + onPageChange = _this$props.onPageChange, + data = _this$props.data; + + if (typeof onPageChange === "function") { + onPageChange(nativeEvent.position); + } + + var index = this.state.index; + + if (nativeEvent.position !== index) { + if (this.einkRef && this.einkRef.current) { + this.einkRef.current.toggleLeft(nativeEvent.position > 0); + this.einkRef.current.toggleRight(nativeEvent.position < data.length - 1); + } + + this.setState({ + index: nativeEvent.position + }); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props2 = this.props, + renderPage = _this$props2.renderPage, + data = _this$props2.data, + numberOfRenderPages = _this$props2.numberOfRenderPages, + showIndicators = _this$props2.showIndicators, + indicatorsActiveColor = _this$props2.indicatorsActiveColor, + indicatorsColor = _this$props2.indicatorsColor, + skipChildMemo = _this$props2.skipChildMemo; + var index = this.state.index; + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, _react.default.createElement(WrappedViewPager, { + scrollEnabled: !_$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isEInk(), + layoutDirection: this.isRtl ? "rtl" : "ltr", + overScrollMode: "never", + ref: this.viewPagerRef, + initialPage: index, + style: { + flex: 1 + }, + onPageSelected: this.onPageSelected + }, data.map(function (item, pos) { + var lowInterval = index - numberOfRenderPages; + var highInterval = index + numberOfRenderPages; + var isInInterval = pos >= lowInterval && pos <= highInterval; + var isInProgressInterval = !isInInterval && pos >= lowInterval - 1 && pos <= highInterval + 1; + return _react.default.createElement(_viewPagerChild.default, { + key: "element_" + pos, + item: item, + index: pos, + skipMemo: skipChildMemo, + orientation: _deviceUtils.default.currentOrientation, + renderChildContent: renderPage, + isInInterval: isInInterval, + isInProgressInterval: isInProgressInterval + }); + })), _react.default.createElement(_einkNavigationsButtons.default, { + ref: this.einkRef, + enabled: _$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isEInk(), + onLeftPress: function onLeftPress() { + return _this2.scrollToPrev(); + }, + onRightPress: function onRightPress() { + return _this2.scrollToNext(); + } + }), showIndicators ? _react.default.createElement(_viewPagerIndicators.default, { + total: data.length, + activeIndex: index, + color: indicatorsColor, + activeColor: indicatorsActiveColor + }) : null); + } + }]); + return ViewPager; + }(_react.default.Component); + + exports.default = ViewPager; + ViewPager.propTypes = { + showIndicators: _propTypes.default.bool, + indicatorsColor: _propTypes.default.string, + indicatorsActiveColor: _propTypes.default.string, + numberOfRenderPages: _propTypes.default.number, + data: _propTypes.default.array.isRequired, + startPage: _propTypes.default.number, + renderPage: _propTypes.default.func.isRequired, + onPageChange: _propTypes.default.func, + skipChildMemo: _propTypes.default.bool + }; + ViewPager.defaultProps = { + numberOfRenderPages: 1, + startPage: 0, + showIndicators: false, + skipChildMemo: false + }; +},2361,[5,7,8,15,12,14,16,17,201,28,1653,2362,2364,458,2365,1,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _viewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function Indicators(props) { + var color = props.color, + activeColor = props.activeColor, + activeIndex = props.activeIndex, + total = props.total; + + if (total < 2) { + return null; + } + + var dots = []; + + for (var i = 0; i < total; i++) { + dots.push(_react.default.createElement(_reactNative.View, { + key: i, + style: [{ + backgroundColor: i === activeIndex ? activeColor : color + }, _viewPagerComponent.default.dot] + })); + } + + return _react.default.createElement(_reactNative.View, { + pointerEvents: "none", + style: _viewPagerComponent.default.pagination + }, dots); + } + + Indicators.propTypes = { + color: _propTypes.default.string, + activeColor: _propTypes.default.string, + total: _propTypes.default.number.isRequired, + activeIndex: _propTypes.default.number.isRequired + }; + Indicators.defaultProps = { + color: _$$_REQUIRE(_dependencyMap[5]).colors.black, + activeColor: _$$_REQUIRE(_dependencyMap[5]).colors.white + }; + var _default = Indicators; + exports.default = _default; +},2362,[5,17,201,28,2363,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + pagination: { + position: "absolute", + bottom: 25, + left: 0, + right: 0, + flexDirection: "row", + flex: 1, + justifyContent: "center", + alignItems: "center", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent + }, + dot: { + width: 8, + height: 8, + borderRadius: 4, + marginLeft: 3, + marginRight: 3, + marginTop: 3, + marginBottom: 3 + } + }); + + exports.default = _default; +},2363,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var styles = _reactNative.StyleSheet.create({ + container: { + width: "100%", + height: "100%" + } + }); + + function Child(props) { + var index = props.index, + isInInterval = props.isInInterval, + isInProgressInterval = props.isInProgressInterval, + renderChildContent = props.renderChildContent, + item = props.item; + var Component = null; + + if (isInInterval) { + Component = renderChildContent(item, index); + } else if (isInProgressInterval) { + Component = _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).ProgressCircle, { + spinnerColor: _newsmemoryUtils.default.getSpinnerColor() + }); + } + + return _react.default.createElement(_reactNative.View, { + style: styles.container, + collapsable: false + }, Component); + } + + Child.propTypes = { + item: _propTypes.default.object, + index: _propTypes.default.number, + isInInterval: _propTypes.default.bool, + isInProgressInterval: _propTypes.default.bool, + renderChildContent: _propTypes.default.func + }; + Child.defaultProps = {}; + + var ViewPagerChild = _react.default.memo(Child, function (prevProps, nextProps) { + return prevProps.isInInterval === nextProps.isInInterval && prevProps.isInProgressInterval === nextProps.isInProgressInterval && prevProps.orientation === nextProps.orientation && prevProps.skipMemo === false; + }); + + var _default = ViewPagerChild; + exports.default = _default; +},2364,[5,17,201,28,603,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + var _einkButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var styles = _reactNative.StyleSheet.create({ + container: { + position: "absolute", + flexDirection: "column", + justifyContent: "center" + }, + left: { + top: 0, + bottom: 0, + start: 0 + }, + right: { + top: 0, + bottom: 0, + end: 0 + }, + button: { + position: "absolute" + }, + buttonStart: { + left: 0, + alignItems: "flex-start" + }, + buttonRight: { + end: 0, + alignItems: "flex-end" + } + }); + + function EInkSectionButtons(props) { + var children = props.children, + style = props.style, + rest = (0, _objectWithoutProperties2.default)(props, ["children", "style"]); + + var _useState = (0, _react.useState)(null), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + layout = _useState2[0], + setLayout = _useState2[1]; + + var onLayout = function onLayout(_ref) { + var nativeEvent = _ref.nativeEvent; + setLayout(nativeEvent.layout); + }; + + return _react.default.createElement(_reactNative.View, (0, _extends2.default)({}, rest, { + style: [styles.container, style], + onLayout: onLayout + }), children && typeof children === "function" && layout ? children(layout) : null); + } + + var EInkNavigationButtons = _react.default.forwardRef(function (props, ref) { + var enabled = props.enabled, + onLeftPress = props.onLeftPress, + onRightPress = props.onRightPress; + + var _useState3 = (0, _react.useState)(true), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + leftVisible = _useState4[0], + setLeftVisibility = _useState4[1]; + + var _useState5 = (0, _react.useState)(true), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + rightVisible = _useState6[0], + setRightVisibility = _useState6[1]; + + if (!enabled) { + return null; + } + + (0, _react.useImperativeHandle)(ref, function () { + return { + toggleLeft: function toggleLeft(state) { + return setLeftVisibility(state); + }, + toggleRight: function toggleRight(state) { + return setRightVisibility(state); + } + }; + }); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["newsmemory-navigation-icons-parent"] + }, leftVisible ? _react.default.createElement(EInkSectionButtons, { + key: "eink_left", + style: styles.left + }, function (_ref2) { + var height = _ref2.height; + return _react.default.createElement(_einkButton.default, { + button: { + key: "scrollLeft", + icon: _$$_REQUIRE(_dependencyMap[9]), + callback: function callback() { + if (typeof onLeftPress === "function") { + onLeftPress(); + } + } + }, + style: [styles.button, styles.buttonStart] + }); + }) : null, rightVisible ? _react.default.createElement(EInkSectionButtons, { + key: "eink_right", + style: styles.right + }, function (_ref3) { + var height = _ref3.height; + return _react.default.createElement(_einkButton.default, { + button: { + key: "scrollRight", + icon: _$$_REQUIRE(_dependencyMap[10]), + callback: function callback() { + if (typeof onRightPress === "function") { + onRightPress(); + } + } + }, + style: [styles.button, styles.buttonRight] + }); + }) : null); + }); + + EInkNavigationButtons.propTypes = { + enabled: _propTypes.default.bool, + onLeftPress: _propTypes.default.func, + onRightPress: _propTypes.default.func + }; + EInkNavigationButtons.defaultProps = { + enabled: false + }; + var _default = EInkNavigationButtons; + exports.default = _default; +},2365,[5,6,41,108,17,201,28,2366,699,2368,2369]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _einkIcon = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function EInkButton(props) { + var button = props.button, + style = props.style; + + if (!button) { + return null; + } + + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + if (typeof button.callback === "function") { + button.callback(); + } + }, + key: "eink_button_" + button.key, + style: style + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[5]).Css, { + classes: ["page-navigation-button"], + cssKey: button.key + }, _react.default.createElement(_einkIcon.default, { + button: button + }))); + } + + EInkButton.propTypes = { + style: _propTypes.default.any, + button: _propTypes.default.shape({ + key: _propTypes.default.string, + callback: _propTypes.default.func, + icon: _propTypes.default.number + }) + }; + var _default = EInkButton; + exports.default = _default; +},2366,[5,17,201,28,2367,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.EINK_ICON_MARGIN = exports.EINK_ICON_HEIGHT = undefined; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var EINK_ICON_HEIGHT = 50; + exports.EINK_ICON_HEIGHT = EINK_ICON_HEIGHT; + var EINK_ICON_MARGIN = 5; + exports.EINK_ICON_MARGIN = EINK_ICON_MARGIN; + + function ButtonIcon(props) { + var button = props.button; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[4]).Css, { + classes: ["newsmemory-icon", "newsmemory-navigation-icon", "newsmemory-navigation-" + button.key + "-icon"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + style: { + width: EINK_ICON_HEIGHT, + height: EINK_ICON_HEIGHT + }, + resizeMode: "contain", + source: button.icon + })); + } + + ButtonIcon.propTypes = { + button: _propTypes.default.shape({ + key: _propTypes.default.string, + icon: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]) + }) + }; + var _default = ButtonIcon; + exports.default = _default; +},2367,[5,17,201,1970,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/shared/eink/icons", + "width": 128, + "height": 128, + "scales": [1], + "hash": "06455f4cdb6180deff379acb17c85f44", + "name": "ic-left-button", + "type": "png" + }); +},2368,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/shared/eink/icons", + "width": 128, + "height": 128, + "scales": [1], + "hash": "2b506ed47a2e1d629b2330b93e68ad41", + "name": "ic-right-button", + "type": "png" + }); +},2369,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _swiper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ViewPagerIOS = function (_React$Component) { + (0, _inherits2.default)(ViewPagerIOS, _React$Component); + + var _super = _createSuper(ViewPagerIOS); + + function ViewPagerIOS(props) { + var _this; + + (0, _classCallCheck2.default)(this, ViewPagerIOS); + _this = _super.call(this, props); + _this.scrollRef = _react.default.createRef(); + _this.isRtl = _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.isRTL(); + _this.toggleViewPagerState = _this._toggleViewPagerState.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(ViewPagerIOS, [{ + key: "_convertProps", + value: function _convertProps() { + var _this$props = this.props, + startPage = _this$props.startPage, + showIndicators = _this$props.showIndicators, + numberOfRenderPages = _this$props.numberOfRenderPages, + containerStyle = _this$props.containerStyle, + indicatorsColor = _this$props.indicatorsColor, + indicatorsActiveColor = _this$props.indicatorsActiveColor, + onPageChange = _this$props.onPageChange, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["startPage", "showIndicators", "numberOfRenderPages", "containerStyle", "indicatorsColor", "indicatorsActiveColor", "onPageChange"]); + var converted = (0, _extends2.default)({}, rest); + converted.dataIndex = startPage; + converted.showsPagination = showIndicators; + converted.loadMinimalSize = numberOfRenderPages; + + if (containerStyle) { + converted.containerStyle = containerStyle; + } + + if (indicatorsColor) { + converted.dotColor = indicatorsColor; + } + + if (indicatorsActiveColor) { + converted.activeDotColor = indicatorsActiveColor; + } + + if (onPageChange) { + converted.onIndexChanged = onPageChange; + } + + converted.scrollRef = this.scrollRef; + return converted; + } + }, { + key: "scrollTo", + value: function scrollTo(newPage) { + var animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (this.swiper) { + this.swiper.scrollTo(newPage, animated); + } + } + }, { + key: "scrollToPage", + value: function scrollToPage(newPage) { + var animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (this.swiper) { + this.swiper.scrollByDataIndex(newPage, animated); + } + } + }, { + key: "scrollToNext", + value: function scrollToNext() { + var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + if (this.swiper) { + if (this.isRtl) { + this.swiper.scrollToPrev(animated); + } else { + this.swiper.scrollToNext(animated); + } + } + } + }, { + key: "scrollToPrev", + value: function scrollToPrev() { + var animated = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + if (this.swiper) { + if (this.isRtl) { + this.swiper.scrollToNext(animated); + } else { + this.swiper.scrollToPrev(animated); + } + } + } + }, { + key: "_toggleViewPagerState", + value: function _toggleViewPagerState(object) { + if (this.scrollRef && this.scrollRef.current) { + this.scrollRef.current.setNativeProps(object); + } + } + }, { + key: "getGestureHandlerRef", + value: function getGestureHandlerRef() { + return this.scrollRef; + } + }, { + key: "toggleState", + value: function toggleState(state) { + if (this.swiper) { + this.swiper.toggleState(state); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var newProps = this._convertProps(); + + return _react.default.createElement(_swiper.default, (0, _extends2.default)({ + key: newProps.data.length, + ref: function ref(swiper) { + _this2.swiper = swiper; + } + }, newProps)); + } + }]); + return ViewPagerIOS; + }(_react.default.Component); + + exports.default = ViewPagerIOS; + ViewPagerIOS.propTypes = (0, _extends2.default)({ + containerStyle: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object, _propTypes.default.number]), + showIndicators: _propTypes.default.bool, + indicatorsColor: _propTypes.default.string, + indicatorsActiveColor: _propTypes.default.string, + numberOfRenderPages: _propTypes.default.number, + data: _propTypes.default.array.isRequired, + startPage: _propTypes.default.number, + renderPage: _propTypes.default.func.isRequired, + onPageChange: _propTypes.default.func + }, _swiper.default.propTypes); + ViewPagerIOS.defaultProps = { + numberOfRenderPages: 1, + startPage: 0, + showIndicators: false, + containerStyle: {} + }; +},2370,[5,6,108,7,8,15,12,14,16,17,201,2371,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var styles = { + container: { + backgroundColor: _$$_REQUIRE(_dependencyMap[14]).colors.transparent, + position: "relative", + flex: 1 + }, + slide: { + backgroundColor: _$$_REQUIRE(_dependencyMap[14]).colors.transparent + }, + pagination: { + position: "absolute", + bottom: 25, + left: 0, + right: 0, + flexDirection: "row", + flex: 1, + justifyContent: "center", + alignItems: "center", + backgroundColor: _$$_REQUIRE(_dependencyMap[14]).colors.transparent + }, + dot: { + width: 8, + height: 8, + borderRadius: 4, + marginLeft: 3, + marginRight: 3, + marginTop: 3, + marginBottom: 3 + } + }; + + var _default = function (_Component) { + (0, _inherits2.default)(_default, _Component); + + var _super = _createSuper(_default); + + function _default(props) { + var _this; + + (0, _classCallCheck2.default)(this, _default); + _this = _super.call(this, props); + + _this.onLayout = function (event) { + var _event$nativeEvent$la = event.nativeEvent.layout, + width = _event$nativeEvent$la.width, + height = _event$nativeEvent$la.height; + var offset = _this.internals.offset = {}; + var state = { + width: width, + height: height, + loading: false + }; + + if (_this.state.total > 1) { + var setup = _this.state.swiperIndex; + offset[_this.state.dir] = _this.state.dir === "x" ? width * setup : height * setup; + } + + state.offset = offset; + + if (_this.state.total > 1 && _this.getScrollView()) { + _this.getScrollView().scrollTo((0, _extends2.default)({}, offset, { + animated: false + })); + } + + if (width !== _this.state.width || height !== _this.state.height || _this.state.loading) { + _this.setState(state); + } + }; + + _this.onScrollBegin = function () { + _this.internals.isScrolling = true; + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.emit(_events.default.SWIPER_SCROLL_BEGIN); + }; + + _this.onScrollEnd = function (e) { + _this.internals.isScrolling = false; + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.emit(_events.default.SWIPER_SCROLL_END); + + if (!e.nativeEvent.contentOffset) { + if (_this.state.dir === "x") { + e.nativeEvent.contentOffset = { + x: e.nativeEvent.position * _this.state.width + }; + } else { + e.nativeEvent.contentOffset = { + y: e.nativeEvent.position * _this.state.height + }; + } + } + + _this.updateIndex(e.nativeEvent.contentOffset); + }; + + _this.onScrollEndDrag = function (e) { + var contentOffset = e.nativeEvent.contentOffset; + var _this$state = _this.state, + data = _this$state.data, + swiperIndex = _this$state.swiperIndex, + dir = _this$state.dir; + var offset = _this.internals.offset; + var previousOffset = dir === "x" ? offset.x : offset.y; + var newOffset = dir === "x" ? contentOffset.x : contentOffset.y; + + if (previousOffset === newOffset && (swiperIndex === 0 || swiperIndex === data.length - 1)) { + _this.internals.isScrolling = false; + } + }; + + _this.updateIndex = function (offset) { + var _assertThisInitialize = (0, _assertThisInitialized2.default)(_this), + state = _assertThisInitialize.state; + + var swiperIndex = state.swiperIndex; + + if (!_this.internals.offset) { + _this.internals.offset = {}; + } + + var diff = offset[state.dir] - (_this.internals.offset[state.dir] || 0); + var step = state.dir === "x" ? state.width : state.height; + + if (!diff) { + return; + } + + swiperIndex = parseInt(swiperIndex + Math.round(diff / step), 10); + var newState = {}; + newState.swiperIndex = swiperIndex; + _this.internals.offset = offset; + + _this.setState(newState); + }; + + _this.scrollTo = function (swiperIndex) { + var animated = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + + if (_this.state.total < 2) { + return; + } + + swiperIndex = Math.max(0, Math.min(_this.state.total - 1, swiperIndex)); + + var _assertThisInitialize2 = (0, _assertThisInitialized2.default)(_this), + state = _assertThisInitialize2.state; + + var diff = _this.state.swiperIndex + (swiperIndex - _this.state.swiperIndex); + var x = 0; + var y = 0; + + if (state.dir === "x") { + x = diff * state.width; + } + + if (state.dir === "y") { + y = diff * state.height; + } + + if (_this.getScrollView()) { + _this.getScrollView().scrollTo({ + x: x, + y: y, + animated: animated + }); + } + + _this.internals.isScrolling = true; + + if (!animated || _$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isAndroid()) { + _this.onScrollEnd({ + nativeEvent: { + position: diff + } + }); + } + }; + + _this.renderPagination = function () { + if (_this.state.total <= 1) { + return null; + } + + var dots = []; + + for (var i = 0; i < _this.state.total; i++) { + dots.push(_react.default.createElement(_reactNative.View, { + key: i, + style: [{ + backgroundColor: i === _this.state.swiperIndex ? _this.props.activeDotColor || _$$_REQUIRE(_dependencyMap[14]).colors.white : _this.props.dotColor || _$$_REQUIRE(_dependencyMap[14]).colors.black + }, styles.dot] + })); + } + + return _react.default.createElement(_reactNative.View, { + pointerEvents: "none", + style: styles.pagination + }, dots); + }; + + _this.getScrollView = function () { + return _this.scrollRef.current; + }; + + _this.renderScrollView = function (pages) { + var _this$props = _this.props, + style = _this$props.style, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["style"]); + var offset = _this.state.offset; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).TecnaviaGestureHandlerScrollview, (0, _extends2.default)({ + ref: _this.scrollRef, + showsHorizontalScrollIndicator: false, + showsVerticalScrollIndicator: false, + automaticallyAdjustContentInsets: false, + scrollEventThrottle: 16, + bounces: false, + scrollsToTop: false, + horizontal: true, + contentContainerStyle: style, + contentOffset: offset + }, rest, { + onScrollBeginDrag: _this.onScrollBegin, + onMomentumScrollEnd: _this.onScrollEnd, + onScrollEndDrag: _this.onScrollEndDrag + }), pages); + }; + + _this.state = _this.initState(_this.props); + _this.scrollRef = props.scrollRef || _react.default.createRef(); + + _this._onIndexChange(); + + return _this; + } + + (0, _createClass2.default)(_default, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var _this2 = this; + + var _this$state2 = this.state, + swiperIndex = _this$state2.swiperIndex, + data = _this$state2.data; + this.setState(this.initState(nextProps, nextProps.data.length !== data.length || nextProps.dataIndex !== swiperIndex), function () { + if (swiperIndex !== nextProps.dataIndex) { + _this2.scrollTo(nextProps.dataIndex); + } + }); + } + }, { + key: "UNSAFE_componentWillUpdate", + value: function UNSAFE_componentWillUpdate(nextProps, nextState) { + this._onIndexChange(nextState); + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + var offset = this.state.offset; + + if (prevState.offset.x !== offset.x && this.getScrollView()) { + this.getScrollView().scrollTo((0, _extends2.default)({}, offset, { + animated: false + })); + + this._onIndexChange(); + } + } + }, { + key: "_onIndexChange", + value: function _onIndexChange() { + var nextState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state; + var swiperIndex = nextState.swiperIndex; + var onIndexChanged = this.props.onIndexChanged; + + if (onIndexChanged) { + onIndexChanged(swiperIndex); + } + } + }, { + key: "scrollToNext", + value: function scrollToNext(animated) { + var swiperIndex = this.state.swiperIndex; + this.scrollTo(swiperIndex + 1, animated); + } + }, { + key: "scrollToPrev", + value: function scrollToPrev(animated) { + var swiperIndex = this.state.swiperIndex; + this.scrollTo(swiperIndex - 1, animated); + } + }, { + key: "scrollByDataIndex", + value: function scrollByDataIndex(dataIndex, animated) { + this.scrollTo(dataIndex, animated); + } + }, { + key: "toggleState", + value: function toggleState(state) { + var scrollEnabled = this.props.scrollEnabled; + + if (this.getScrollView() && scrollEnabled) { + this.getScrollView().setNativeProps({ + enabled: state, + scrollEnabled: state + }); + } + } + }, { + key: "initState", + value: function initState(props) { + var update = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var state = this.state || { + width: 0, + height: 0, + offset: { + x: 0, + y: 0 + }, + loading: true + }; + var initState = { + data: null, + offset: {}, + loading: state.loading + }; + + var _Dimensions$get = _reactNative.Dimensions.get("window"), + width = _Dimensions$get.width, + height = _Dimensions$get.height; + + if (this.state && this.state.width) { + initState.width = this.state.width; + } else if (props.width) { + initState.width = props.width; + } else { + initState.width = width; + } + + if (this.state && this.state.height) { + initState.height = this.state.height; + } else if (props.height) { + initState.height = props.height; + } else { + initState.height = height; + } + + initState.dir = props.horizontal ? "x" : "y"; + initState.data = props.data; + initState.total = initState.data.length; + + if (state.total === initState.total && !update) { + initState.swiperIndex = state.swiperIndex; + } else { + if (state.swiperIndex && state.swiperIndex === props.dataIndex) { + initState.swiperIndex = state.swiperIndex; + } else { + var currentIndex = props.dataIndex; + initState.swiperIndex = initState.total > 1 ? Math.min(currentIndex, initState.total - 1) : 0; + } + } + + initState.offset[initState.dir] = initState.dir === "x" ? initState.width * initState.swiperIndex : initState.height * initState.swiperIndex; + this.internals = (0, _extends2.default)({}, this.internals, { + offset: initState.offset, + isScrolling: false + }); + return initState; + } + }, { + key: "fullState", + value: function fullState() { + return (0, _extends2.default)({}, this.state, this.internals); + } + }, { + key: "render", + value: function render() { + var _this$state3 = this.state, + swiperIndex = _this$state3.swiperIndex, + width = _this$state3.width, + height = _this$state3.height, + data = _this$state3.data, + loading = _this$state3.loading; + var _this$props2 = this.props, + containerStyle = _this$props2.containerStyle, + loadMinimalSize = _this$props2.loadMinimalSize, + showsPagination = _this$props2.showsPagination, + renderPage = _this$props2.renderPage; + var pages = []; + pages = data.map(function (page, i) { + if (i >= swiperIndex - loadMinimalSize && i <= swiperIndex + loadMinimalSize) { + return _react.default.createElement(_reactNative.View, { + style: [styles.slide, { + width: width, + height: height + }], + key: "page_" + i + }, !loading ? renderPage(page, i) : null); + } + + var showProgress = i >= swiperIndex - loadMinimalSize - 1 && i <= swiperIndex + loadMinimalSize + 1 && !loading; + return _react.default.createElement(_reactNative.View, { + style: { + width: width, + height: height, + justifyContent: "center", + alignItems: "center" + }, + key: "progress_" + i + }, showProgress ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).ProgressCircle, { + spinnerColor: _newsmemoryUtils.default.getSpinnerColor() + }) : null); + }); + return _react.default.createElement(_reactNative.View, { + style: [styles.container, containerStyle], + onLayout: this.onLayout + }, this.renderScrollView(pages), showsPagination && this.renderPagination()); + } + }]); + return _default; + }(_react.Component); + + exports.default = _default; + _default.propTypes = { + scrollRef: _propTypes.default.object, + data: _propTypes.default.array.isRequired, + dataIndex: _propTypes.default.number, + renderPage: _propTypes.default.func.isRequired, + containerStyle: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.object, _propTypes.default.number]), + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + scrollEnabled: _propTypes.default.bool, + pagingEnabled: _propTypes.default.bool, + showsPagination: _propTypes.default.bool, + horizontal: _propTypes.default.bool, + loadMinimalSize: _propTypes.default.number, + dotColor: _propTypes.default.string, + activeDotColor: _propTypes.default.string, + onIndexChanged: _propTypes.default.func, + width: _propTypes.default.number + }; + _default.defaultProps = { + containerStyle: {}, + scrollEnabled: true, + pagingEnabled: true, + showsPagination: true, + loadMinimalSize: 1, + dataIndex: 0, + horizontal: true, + onIndexChanged: function onIndexChanged() { + return null; + } + }; +},2371,[5,108,6,7,8,15,12,14,16,17,201,28,603,460,462,572,1909,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _subHeaderComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SubHeaderComponent = function (_React$Component) { + (0, _inherits2.default)(SubHeaderComponent, _React$Component); + + var _super = _createSuper(SubHeaderComponent); + + function SubHeaderComponent() { + (0, _classCallCheck2.default)(this, SubHeaderComponent); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(SubHeaderComponent, [{ + key: "render", + value: function render() { + var _this$props = this.props, + bgColor = _this$props.bgColor, + ButtonsComponent = _this$props.ButtonsComponent, + HrComponent = _this$props.HrComponent, + SubButtonsComponent = _this$props.SubButtonsComponent, + TextComponent = _this$props.TextComponent, + cssClasses = _this$props.cssClasses; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: cssClasses + }, _react.default.createElement(_reactNative.View, { + style: { + backgroundColor: bgColor + } + }, _react.default.createElement(_reactNative.View, { + style: _subHeaderComponent.default.parent + }, TextComponent), ButtonsComponent || SubButtonsComponent ? HrComponent : null, ButtonsComponent, SubButtonsComponent, ButtonsComponent || SubButtonsComponent ? HrComponent : null)); + } + }]); + return SubHeaderComponent; + }(_react.default.Component); + + exports.default = SubHeaderComponent; + SubHeaderComponent.propTypes = { + bgColor: _propTypes.default.string, + TextComponent: _propTypes.default.node, + HrComponent: _propTypes.default.node, + ButtonsComponent: _propTypes.default.node, + SubButtonsComponent: _propTypes.default.node, + cssClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }; + SubHeaderComponent.defaultProps = { + cssClasses: [] + }; +},2372,[5,7,8,12,14,16,17,201,28,2373,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + parent: { + width: "100%", + flexDirection: "row" + }, + header: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_HEIGHT, + flexDirection: "row", + justifyContent: "flex-end" + } + }); + + exports.default = _default; +},2373,[28,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _headerInfoComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var HeaderInfo = function (_React$PureComponent) { + (0, _inherits2.default)(HeaderInfo, _React$PureComponent); + + var _super = _createSuper(HeaderInfo); + + function HeaderInfo(props) { + var _this; + + (0, _classCallCheck2.default)(this, HeaderInfo); + _this = _super.call(this, props); + _this.leftText = props.leftText; + _this.rightText = props.rightText; + return _this; + } + + (0, _createClass2.default)(HeaderInfo, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var onChangeEventName = this.props.onChangeEventName; + this.onChange = _$$_REQUIRE(_dependencyMap[11]).EventRegister.on(onChangeEventName, function (_ref) { + var leftText = _ref.leftText, + rightText = _ref.rightText; + + if (_this2.leftText !== leftText || _this2.rightText !== rightText) { + _this2.leftText = leftText; + _this2.rightText = rightText; + + _this2.forceUpdate(); + } + }); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + this.leftText = nextProps.leftText; + this.rightText = nextProps.rightText; + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[11]).EventRegister.rm(this.onChange); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + color = _this$props.color, + textSize = _this$props.textSize, + accessibilityEnabled = _this$props.accessibilityEnabled; + var leftSize = textSize ? { + fontSize: textSize + } : undefined; + var rightSize = textSize ? { + fontSize: textSize - 4 + } : undefined; + + var text = _$$_REQUIRE(_dependencyMap[12]).StringUtils.decodeHTML(this.leftText); + + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-mode-sub-header-section-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _headerInfoComponent.default.section + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ItemAccessibilityFocused, { + accessibilityEnabled: accessibilityEnabled, + touchable: false, + accessibilityLabel: text + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-mode-sub-header-section"] + }, _react.default.createElement(_fontText.default, { + style: [_headerInfoComponent.default.sectionText, leftSize, { + color: color + }], + numberOfLines: 1, + ellipsizeMode: "tail" + }, text))))), this.rightText ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-mode-sub-header-info-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _headerInfoComponent.default.info + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ItemAccessibilityFocused, { + accessibilityEnabled: accessibilityEnabled, + touchable: false, + accessibilityLabel: this.rightText + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-mode-sub-header-info"] + }, _react.default.createElement(_fontText.default, { + style: [_headerInfoComponent.default.infoText, rightSize, { + color: color + }] + }, this.rightText))))) : null); + } + }]); + return HeaderInfo; + }(_react.default.PureComponent); + + exports.default = HeaderInfo; + HeaderInfo.propTypes = { + leftText: _propTypes.default.string, + rightText: _propTypes.default.string, + textSize: _propTypes.default.number, + accessibilityEnabled: _propTypes.default.bool, + color: _propTypes.default.string.isRequired, + onChangeEventName: _propTypes.default.string + }; +},2374,[5,7,8,12,14,16,17,28,201,1879,2375,572,462,699,2189]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + section: { + flex: 1, + paddingHorizontal: 10, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "center" + }, + info: { + flex: 1, + paddingHorizontal: 10, + justifyContent: "flex-end", + alignItems: "center", + flexDirection: "row" + }, + sectionText: { + fontSize: _$$_REQUIRE(_dependencyMap[1]).HEADER_FONT_SIZE, + textAlign: "left" + }, + infoText: { + textAlign: "right", + fontSize: _$$_REQUIRE(_dependencyMap[1]).HEADER_FONT_SIZE - 4, + fontStyle: "italic" + } + }); + + exports.default = _default; +},2375,[28,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _simpleButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TwoStateButton = function (_React$Component) { + (0, _inherits2.default)(TwoStateButton, _React$Component); + + var _super = _createSuper(TwoStateButton); + + function TwoStateButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, TwoStateButton); + _this = _super.call(this, props); + _this.state = { + active: props.active + }; + _this.onPress = _this._onPress.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(TwoStateButton, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var _this$props = this.props, + toInactiveEvent = _this$props.toInactiveEvent, + toActiveEvent = _this$props.toActiveEvent; + + if (toInactiveEvent) { + this.onToInactiveListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(toInactiveEvent, function () { + _this2._updateState(false); + }); + } + + if (toActiveEvent) { + this.onToActiveListener = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(toActiveEvent, function () { + _this2._updateState(true); + }); + } + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(props) { + this._updateState(props.active); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onToInactiveListener); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onToActiveListener); + } + }, { + key: "_toggle", + value: function _toggle() { + var active = this.state.active; + + this._updateState(!active); + } + }, { + key: "_updateState", + value: function _updateState(newActiveValue) { + var active = this.state.active; + + if (active !== newActiveValue) { + this.setState({ + active: newActiveValue + }); + } + } + }, { + key: "_onPress", + value: function _onPress() { + var _this$props2 = this.props, + onActivePress = _this$props2.onActivePress, + onInactivePress = _this$props2.onInactivePress, + onPress = _this$props2.onPress; + var active = this.state.active; + + try { + var skipToggle = false; + + if (typeof onPress === "function") { + skipToggle = onPress(active); + } + + if (typeof onActivePress === "function" && active) { + skipToggle = onActivePress(); + } + + if (typeof onInactivePress === "function" && !active) { + skipToggle = onInactivePress(); + } + + if (!skipToggle) { + this._toggle(); + } + } catch (e) {} + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + activeSource = _this$props3.activeSource, + inactiveSource = _this$props3.inactiveSource, + onActivePress = _this$props3.onActivePress, + onInactivePress = _this$props3.onInactivePress, + onPress = _this$props3.onPress, + cssProps = _this$props3.cssProps, + rest = (0, _objectWithoutProperties2.default)(_this$props3, ["activeSource", "inactiveSource", "onActivePress", "onInactivePress", "onPress", "cssProps"]); + var active = this.state.active; + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, rest, { + onPress: this.onPress, + source: active ? activeSource : inactiveSource, + cssProps: (0, _extends2.default)({}, cssProps, { + toggle: true, + active: active + }) + })); + } + }]); + return TwoStateButton; + }(_react.default.Component); + + exports.default = TwoStateButton; + TwoStateButton.propTypes = { + activeSource: _propTypes.default.any.isRequired, + inactiveSource: _propTypes.default.any.isRequired, + active: _propTypes.default.bool, + onPress: _propTypes.default.func, + onActivePress: _propTypes.default.func, + onInactivePress: _propTypes.default.func, + toInactiveEvent: _propTypes.default.string, + toActiveEvent: _propTypes.default.string, + cssProps: _propTypes.default.object + }; + TwoStateButton.defaultProps = { + active: false, + cssProps: {} + }; +},2376,[5,6,108,7,8,15,12,14,16,17,201,2299,572]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FIXED_ACTIONS = [_$$_REQUIRE(_dependencyMap[10]).ACTIONS.closeArticle.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.closeAccessibility.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.closeCarMode.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.share.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.shareFacebook.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.shareTwitter.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.shareReddit.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.shareEmail.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.print.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.toggleFullScreen.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.toggleGraphic.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.goBack.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.goUp.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.goNext.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.search.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.clearSearch.key]; + var GRAPH_ACTIONS = [_$$_REQUIRE(_dependencyMap[10]).ACTIONS.toggleArticleExtra.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.toggleGraphZoom.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.graphIncrease.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.graphDecrease.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.graphZoomUnfit.key]; + var TEXT_ACTIONS = [_$$_REQUIRE(_dependencyMap[10]).ACTIONS.toggleFont.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.fontIncrease.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.fontDecrease.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.translate.key, _$$_REQUIRE(_dependencyMap[10]).ACTIONS.toggleTextToSpeech.key]; + + var SubHeaderButtons = function (_React$Component) { + (0, _inherits2.default)(SubHeaderButtons, _React$Component); + + var _super = _createSuper(SubHeaderButtons); + + function SubHeaderButtons() { + (0, _classCallCheck2.default)(this, SubHeaderButtons); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(SubHeaderButtons, [{ + key: "_getButtonsInSlot", + value: function _getButtonsInSlot(buttons) { + var slot = []; + var textSlotPosition = []; + var graphicSlotPosition = []; + buttons.forEach(function (button) { + if (FIXED_ACTIONS.includes(button.getAction())) { + slot.push([button]); + } else if (TEXT_ACTIONS.includes(button.getAction())) { + var found = false; + + for (var i = 0; i < slot.length && !found; i++) { + if (graphicSlotPosition.includes(i) && slot[i].length === 1) { + slot[i].push(button); + found = true; + } + } + + if (!found) { + slot.push([button]); + textSlotPosition.push(slot.length - 1); + } + } else if (GRAPH_ACTIONS.includes(button.getAction())) { + var _found = false; + + for (var _i = 0; _i < slot.length && !_found; _i++) { + if (textSlotPosition.includes(_i) && slot[_i].length === 1) { + slot[_i].push(button); + + _found = true; + } + } + + if (!_found) { + slot.push([button]); + graphicSlotPosition.push(slot.length - 1); + } + } + }); + return slot; + } + }, { + key: "_getWidth", + value: function _getWidth() { + var width = this.props.width; + return width - this._getHorizontalMargin() * 2; + } + }, { + key: "_getHorizontalMargin", + value: function _getHorizontalMargin() { + var cssButtonClasses = this.props.cssButtonClasses; + + var style = _$$_REQUIRE(_dependencyMap[11]).Css.getStyleObjByCssClasses(cssButtonClasses); + + var newSize = _$$_REQUIRE(_dependencyMap[12]).CssUtils.updateSizeByApplingStyle({ + width: style.width || _$$_REQUIRE(_dependencyMap[13]).HEADER_BUTTON_SIZE, + height: style.height || _$$_REQUIRE(_dependencyMap[13]).HEADER_BUTTON_SIZE + }, style); + + var slotSize = this._getSlotWidth(); + + return _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.isTablet() ? (slotSize - newSize.width) / 2 : 0; + } + }, { + key: "_getSlotWidth", + value: function _getSlotWidth() { + var slotStyle = _$$_REQUIRE(_dependencyMap[11]).Css.getStyleObjByCssClasses(["newsmemory-article-buttons-slot"]); + + return _$$_REQUIRE(_dependencyMap[12]).CssUtils.getAttributeFromStyle("width", slotStyle, _$$_REQUIRE(_dependencyMap[13]).HEADER_PARENT_BUTTON_SIZE); + } + }, { + key: "_getButtons", + value: function _getButtons() { + var _this$props = this.props, + leftButtons = _this$props.leftButtons, + rightButtons = _this$props.rightButtons; + var reversedRightButtons = (0, _toConsumableArray2.default)(rightButtons).reverse(); + + var left = this._getButtonsInSlot(leftButtons); + + var right = this._getButtonsInSlot(reversedRightButtons).reverse(); + + var slotAvailable = Math.floor(this._getWidth() / this._getSlotWidth()); + var tSlots = left.length + right.length; + + if (!left.length && !right.length) { + return {}; + } + + var slots = []; + slots.push.apply(slots, (0, _toConsumableArray2.default)(left)); + + if (tSlots < slotAvailable) { + for (var i = left.length; i < left.length + slotAvailable - tSlots; i++) { + slots.push([]); + } + } + + slots.push.apply(slots, (0, _toConsumableArray2.default)(right)); + return { + slots: slots, + isFull: tSlots < slotAvailable + }; + } + }, { + key: "_renderSlot", + value: function _renderSlot(slot, index) { + var renderButton = this.props.renderButton; + + var slotWidth = this._getSlotWidth(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).Css, { + classes: ["newsmemory-article-buttons-slot"], + key: "button_" + index + }, _react.default.createElement(_reactNative.View, { + style: { + flexDirection: "column", + width: slotWidth, + height: slotWidth, + overflow: "hidden", + justifyContent: "flex-start" + } + }, slot.map(function (item, subIndex) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).Css, { + classes: ["newsmemory-article-buttons-slot-child"], + key: "button_" + subIndex + }, _react.default.createElement(_reactNative.View, null, renderButton(item))); + }))); + } + }, { + key: "render", + value: function render() { + var _this = this; + + var direction = _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.isRTL() ? "row-reverse" : "row"; + + var _this$_getButtons = this._getButtons(), + slots = _this$_getButtons.slots; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).Css, { + classes: ["newsmemory-header-buttons"] + }, _react.default.createElement(_reactNative.View, { + accessibilityRole: "toolbar", + style: { + flexDirection: direction, + marginHorizontal: this._getHorizontalMargin(), + justifyContent: "space-evenly", + alignItems: "center", + height: slots && slots.length ? _$$_REQUIRE(_dependencyMap[13]).HEADER_HEIGHT : 0 + } + }, slots ? slots.map(function (slot, index) { + return _this._renderSlot(slot, index); + }) : null)); + } + }]); + return SubHeaderButtons; + }(_react.default.Component); + + exports.default = SubHeaderButtons; + SubHeaderButtons.propsTypes = { + leftButtons: _propTypes.default.arrayOf(_propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[14]).Icon)), + rightButtons: _propTypes.default.arrayOf(_propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[14]).Icon)), + renderButton: _propTypes.default.func.isRequired, + width: _propTypes.default.number.isRequired, + cssButtonClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }; + SubHeaderButtons.defaultProps = { + leftButtons: [], + rightButtons: [], + cssButtonClasses: [] + }; +},2377,[5,21,7,8,12,14,16,17,201,28,1725,699,462,729,1805]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _indexBaseComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _indexLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _articleComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var CustomIndex = function (_IndexBase) { + (0, _inherits2.default)(CustomIndex, _IndexBase); + + var _super = _createSuper(CustomIndex); + + function CustomIndex() { + (0, _classCallCheck2.default)(this, CustomIndex); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(CustomIndex, [{ + key: "_render", + value: function _render() { + var _this$props = this.props, + customIndexHtml = _this$props.customIndexHtml, + onLocal = _this$props.onLocal; + + var cssTheme = _$$_REQUIRE(_dependencyMap[11]).Css.getThemeInUse(); + + var themeClass = ""; + + if (cssTheme) { + themeClass = "\n document.body.classList.add('" + cssTheme + "');\n "; + } + + var INJECTEDJAVASCRIPT = "\n parent.hybrid_openOptionPage = function(){ \n window.location.href = 'local://openOptionPage';\n };\n const manualIndex = document.getElementById('manualIndex');\n if(manualIndex){\n manualIndex.style.height = 'auto';\n }\n const meta = document.createElement('meta');\n if (meta) {\n meta.setAttribute('content', 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0');\n meta.setAttribute('name', 'viewport');\n document.getElementsByTagName('head')[0].appendChild(meta);\n }\n " + themeClass + "\n "; + + var _global$getActivePSet = global.getActivePSetup(), + enableArticleTextSelection = _global$getActivePSet.enableArticleTextSelection; + + var darkModeStyle = ""; + + if (cssTheme && _$$_REQUIRE(_dependencyMap[11]).Css.isDarkTheme()) { + darkModeStyle = "\n ." + cssTheme + " #manualIndex .article-title,\n ." + cssTheme + " #manualIndex .subhead,\n ." + cssTheme + " #manualIndex .byline,\n ." + cssTheme + " #manualIndex .index-element,\n ." + cssTheme + " #manualIndex .page-number-container,\n ." + cssTheme + " #manualIndex h2 {\n color: " + _$$_REQUIRE(_dependencyMap[11]).Css.getDefaultForegroundColor() + ";\n }\n ." + cssTheme + " #manualIndex .logo {\n filter: invert(50%);\n }\n "; + } + + var defaultCss = "<style>\n " + (0, _$$_REQUIRE(_dependencyMap[12]).NO_ARTICLE_TEXT_SELECTION_CSS)(enableArticleTextSelection) + "\n " + darkModeStyle + "\n </style>"; + var customCss = "<style>" + _articleComponent.default.customCss + "</style>"; + var FONT_AWESOME_CSS_URL = _Api.default.getServer() + "/eebrowser/librarybranches/libraries.check.20120417/css/4.5.0/css/font-awesome.min.css"; + var fontAwesome = "<link rel=\"stylesheet\" href=\"" + FONT_AWESOME_CSS_URL + "\" type=\"text/css\">"; + var jQuery = "<script src=\"data:text/javascript;base64," + _$$_REQUIRE(_dependencyMap[13]).jQueryBase64 + "\"></script>"; + var iframeDefinition = (0, _$$_REQUIRE(_dependencyMap[14]).getCustomIndexIframeDefinition)(); + var indexFunctionDefinition = (0, _$$_REQUIRE(_dependencyMap[14]).getCustomIndexFunctionDefinition)(); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).TecnaviaScrollView, { + style: _indexLayoutManager.default.container + }, this._getHeader(), _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).AutoHeightWebView, { + htmlContentId: "manualIndex", + source: { + html: defaultCss + customCss + fontAwesome + jQuery + customIndexHtml + iframeDefinition + indexFunctionDefinition + }, + onLocal: onLocal, + injectedJavaScript: INJECTEDJAVASCRIPT + }), this._getFooter()); + } + }]); + return CustomIndex; + }(_indexBaseComponent.default); + + exports.default = CustomIndex; +},2378,[5,7,8,12,14,16,17,431,2356,2190,2155,699,2186,2188,2379,1909,1901]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getCustomIndexIframeDefinition = exports.getCustomIndexFunctionDefinition = undefined; + + var getCustomIndexFunctionDefinition = function getCustomIndexFunctionDefinition() { + return "\n <script>\n function gotoPageAllMode(pageNumber, xmlId){\n document.getElementById('xCodeIndex1').src = 'local://xc_scrollToPage?pageNumber='+pageNumber;\n }\n function art_closeTextArticle(){\n document.getElementById('xCodeIndex1').src = 'local://art_closeTextArticle';\n }\n function xc_openBrowser(url){\n document.getElementById('xCodeIndex1').src = 'local://xc_openBrowser?url='+url;\n }\n </script>"; + }; + + exports.getCustomIndexFunctionDefinition = getCustomIndexFunctionDefinition; + + var getCustomIndexIframeDefinition = function getCustomIndexIframeDefinition() { + return "\n <iframe style='float: left; width: 10px; height: 1px; border:0; margin:0; visibility:hidden;' target='_blank' src='./exec/code/pages/none.html' id='xCodeIndex1'>\n </iframe>"; + }; + + exports.getCustomIndexIframeDefinition = getCustomIndexIframeDefinition; +},2379,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = TabIndex; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _RssActionManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _rssCardComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _tabNavigator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function formatNewsmemoryArticle(article, newspaper) { + var edition = newspaper.getEditionModel(); + var html = article.getHtml(); + var secret = newspaper.getSecret(); + + var isOnline = _$$_REQUIRE(_dependencyMap[10]).NetworkUtils.isOnline(); + + var result = (0, _$$_REQUIRE(_dependencyMap[11]).getTagsFromHTML)(html, edition, article, secret, isOnline); + var tags = result.tags; + var tagsByline = tags.tagsByline; + + var _global$getActivePSet = global.getActivePSetup(), + mergeArticles = _global$getActivePSet.mergeArticles; + + var newHtml = _$$_REQUIRE(_dependencyMap[10]).StringUtils.serializeHtml(html.replace(/\n|\t/gm, "")); + + newHtml = (0, _$$_REQUIRE(_dependencyMap[11]).applyMergeArtToHTML)(html, mergeArticles, false, false, isOnline, edition, article, secret); + var gallery = (0, _$$_REQUIRE(_dependencyMap[11]).getAllImages)(newHtml); + var biggestImage = (0, _$$_REQUIRE(_dependencyMap[11]).getBiggestImage)(gallery); + var title = article.getTitle(); + var summary = newHtml; + tagsByline.forEach(function (tagByline) { + summary = summary.replace(tagByline, ""); + }); + summary = (0, _$$_REQUIRE(_dependencyMap[11]).stripHTMLTags)(_$$_REQUIRE(_dependencyMap[10]).StringUtils.decodeHTML(summary)).replace(title, "").trim().replace(/\t|\n/gm, "").replace(/[ ]{2,}/g, " "); + var summaryParts = summary.split("."); + summary = ""; + + for (var i = 0; i < summaryParts.length && summary.length < 200; i++) { + summary += summaryParts[i] + "."; + } + + var mArticle = new (_$$_REQUIRE(_dependencyMap[12]).Article)(); + mArticle.action = new _RssActionManager.default(); + mArticle.priority = (0, _$$_REQUIRE(_dependencyMap[13]).parsePriority)("1x1"); + mArticle.feedId = (0, _$$_REQUIRE(_dependencyMap[14]).getArticleId)(article); + mArticle.byline = ""; + mArticle.category = ""; + mArticle.summary = summary; + mArticle.title = title.replace(/[ ]{2,}/g, " "); + mArticle.image = biggestImage && biggestImage.getUrl(); + mArticle.gallery = []; + mArticle.html = html; + mArticle.date = newspaper.getPages().find(function (page) { + return page.getPageId() === article.getPageId(); + }).getShownPage(); + return mArticle; + } + + function TabIndexItem(props) { + var navigation = props.navigation, + rest = (0, _objectWithoutProperties2.default)(props, ["navigation"]); + var focused = navigation.isFocused(); + + if (focused) { + var cardProps = { + refreshing: false, + renderEmpty: function renderEmpty() {}, + onRefresh: function onRefresh() {}, + renderError: function renderError() {}, + orientation: _deviceUtils.default.currentOrientation, + numberOfColumns: (0, _$$_REQUIRE(_dependencyMap[15]).getRssNumberOfColumns)() + }; + return _react.default.createElement(_rssCardComponent.default, (0, _extends2.default)({}, cardProps, rest)); + } + + return null; + } + + function TabIndex(props) { + var firstLevel = props.firstLevel, + secondLevels = props.secondLevels, + initialRouteIndex = props.initialRouteIndex, + size = props.size, + onOpenArticle = props.onOpenArticle, + newspaper = props.newspaper; + var tabs = firstLevel.map(function (page, index) { + var sectionName = (0, _$$_REQUIRE(_dependencyMap[16]).getFirstLevelText)(page); + return { + page: page, + item: { + drawerItemKey: sectionName + "_" + index, + displayName: sectionName + }, + route: sectionName, + isInitialRoute: index === initialRouteIndex + }; + }); + return _react.default.createElement(_tabNavigator.default, { + style: { + marginTop: 0 + }, + width: size.width, + initialRouteName: (0, _$$_REQUIRE(_dependencyMap[17]).getInitialRouteFromStructure)(tabs), + tabs: tabs.map(function (_ref) { + var item = _ref.item, + rest = (0, _objectWithoutProperties2.default)(_ref, ["item"]); + return (0, _extends2.default)({}, rest, { + item: item, + label: item.displayName + }); + }), + tabStyles: { + tabBarStyle: _$$_REQUIRE(_dependencyMap[18]).Css.getStyleObjByCssClasses(["rss-tab"]), + tabBarIndicatorStyle: _$$_REQUIRE(_dependencyMap[18]).Css.getStyleObjByCssClasses(["rss-tab-indicator"]) + }, + tabScreen: function tabScreen(_ref2, navProps) { + var page = _ref2.page, + tabItem = _ref2.item, + tabRoute = _ref2.route, + index = _ref2.index; + var ePaperArticles = secondLevels[index].filter(function (element) { + return element instanceof _EPaperArticle.default; + }); + var articles = ePaperArticles.map(function (article) { + return formatNewsmemoryArticle(article, newspaper); + }).filter(function (article) { + return article.summary.length > 10; + }); + var tabIndexItemProps = { + settings: tabItem, + items: articles, + width: size.width, + onItemClick: function onItemClick(items, item) { + var article = ePaperArticles.find(function (ePaperArticle) { + return item.feedId === (0, _$$_REQUIRE(_dependencyMap[14]).getArticleId)(ePaperArticle); + }); + onOpenArticle(article); + } + }; + return _react.default.createElement(TabIndexItem, (0, _extends2.default)({}, navProps, tabIndexItemProps)); + }, + supportColor: global.getRssIndex() + }); + } +},2380,[5,6,108,17,1964,458,640,714,2116,2211,462,2182,1972,2051,2187,2039,2357,2046,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _Page = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _pagesNavigation = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _horizontalPagesManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _InterstitialsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PagesLayoutManager = function (_Shortcut) { + (0, _inherits2.default)(PagesLayoutManager, _Shortcut); + + var _super = _createSuper(PagesLayoutManager); + + function PagesLayoutManager(props) { + var _this; + + (0, _classCallCheck2.default)(this, PagesLayoutManager); + _this = _super.call(this, props); + _this.layout = {}; + _this.currentIndex = _this.getPageIndexById(props.currentPageId); + _this.onUpdateViews = _this._updateViews.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGoToLeftPagePress = _this._onGoToLeftPagePress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGoToRightPagePress = _this._onGoToRightPagePress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGoToLeftSectionPress = _this._goToPreviousSection.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGoToRightSectionPress = _this._goToNextSection.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGoToFirstPage = _this._onGoToFirstPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGoToLastPage = _this._onGoToLastPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGotToMainEdition = _this._onGotToMainEdition.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRef = _this._onRef.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(PagesLayoutManager, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(PagesLayoutManager.prototype), "componentDidMount", this).call(this); + this.onIsVisible = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.NEWSMEMORY_SHOW_NAVIGATION_BUTTONS, function (params) { + if (_this2.pagesNavigationRef) { + _this2.pagesNavigationRef.updateVisibility(params.visible); + } + }); + this.configChangeListener = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.NEWSMEMORY_CONFIG_CHANGE, function (_ref) { + var previousConfig = _ref.previousConfig; + var prevPagesNavigationButtonsLayout = previousConfig.pagesNavigationButtonsLayout; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + pagesNavigationButtonsLayout = _global$getNewsmemory.pagesNavigationButtonsLayout; + + if (prevPagesNavigationButtonsLayout !== pagesNavigationButtonsLayout && _this2.pagesNavigationRef) { + _this2.pagesNavigationRef.updateNavigationLayout(_this2._getPagesNavigationState()); + } + }); + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + var _this$props = this.props, + newspaper = _this$props.newspaper, + isLandscape = _this$props.isLandscape, + fitPageHorizontally = _this$props.fitPageHorizontally, + numberOfShowedPages = _this$props.numberOfShowedPages, + size = _this$props.size, + initialEvent = _this$props.initialEvent; + return isLandscape !== nextProps.isLandscape || fitPageHorizontally !== nextProps.fitPageHorizontally || numberOfShowedPages !== nextProps.numberOfShowedPages || !_$$_REQUIRE(_dependencyMap[23]).JSUtils.areEqualShallow(newspaper, nextProps.newspaper) || !_$$_REQUIRE(_dependencyMap[23]).JSUtils.equals(size, nextProps.size) || !_$$_REQUIRE(_dependencyMap[23]).JSUtils.equals(initialEvent, nextProps.initialEvent); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(PagesLayoutManager.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.NEWSMEMORY_CLEAR_HIGH_RES_QUEUE); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onIsVisible); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.configChangeListener); + } + }, { + key: "getPages", + value: function getPages() { + var newspaper = this.props.newspaper; + return newspaper ? newspaper.getPages() : []; + } + }, { + key: "getPageIndexById", + value: function getPageIndexById(id) { + var index = this.getPages().findIndex(function (page) { + return page.getPageId() === id; + }); + return index > -1 ? index : 0; + } + }, { + key: "getLeftPage", + value: function getLeftPage() { + if (this.infos) { + var left = this.infos.left; + + if (left) { + var isDTRightSide = left.isDTRightSide, + page = left.page; + + if (page) { + if (isDTRightSide) { + return _pageUtils.default.removeZerosFromPageNumber(_pageUtils.default.getNextPageNumber(page.getShownPage())); + } + + return _pageUtils.default.removeZerosFromPageNumber(page.getShownPage()); + } + } + } + + return undefined; + } + }, { + key: "getRightPage", + value: function getRightPage() { + if (this.infos) { + var right = this.infos.right; + + if (right) { + var isDTRightSide = right.isDTRightSide, + page = right.page; + + if (page) { + if (isDTRightSide) { + return _pageUtils.default.removeZerosFromPageNumber(_pageUtils.default.getNextPageNumber(page.getShownPage())); + } + + return _pageUtils.default.removeZerosFromPageNumber(page.getShownPage()); + } + } + } + + return undefined; + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var _this3 = this; + + var HOME = _$$_REQUIRE(_dependencyMap[24]).KEY_GROUPS.HOME, + END = _$$_REQUIRE(_dependencyMap[24]).KEY_GROUPS.END; + + return [{ + callbackRepeat: function callbackRepeat() { + return _regenerator.default.async(function callbackRepeat$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _this3.onGoToLeftSectionPress(); + + return _context.abrupt("return", _this3.getCallbackRepeatPromise()); + + case 2: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }, + keys: HOME + }, { + callbackRepeat: function callbackRepeat() { + return _regenerator.default.async(function callbackRepeat$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _this3.onGoToRightSectionPress(); + + return _context2.abrupt("return", _this3.getCallbackRepeatPromise()); + + case 2: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }, + keys: END + }]; + } + }, { + key: "_goToNextSection", + value: function _goToNextSection() { + var pages = this.getPages(); + + var _NewsmemoryUtils$pars = _newsmemoryUtils.default.parsePageInfo(this.getLeftPage()), + leftSection = _NewsmemoryUtils$pars.section; + + var section = leftSection; + var rightPage = this.getRightPage(); + + if (rightPage) { + var _NewsmemoryUtils$pars2 = _newsmemoryUtils.default.parsePageInfo(rightPage), + rightSection = _NewsmemoryUtils$pars2.section; + + section = rightSection; + } + + for (var i = this.currentIndex + 1; i < pages.length; i++) { + var page = pages[i]; + + if (page.getShownPage().startsWith(_Page.SYMBOL_PAGE_STOP)) { + this.goToPage(i); + return; + } + + var _NewsmemoryUtils$pars3 = _newsmemoryUtils.default.parsePageInfo(page.getPage()), + nextPageSection = _NewsmemoryUtils$pars3.section; + + if (section !== nextPageSection) { + this.goToPage(i); + return; + } + } + + this._onGoToLastPage(); + } + }, { + key: "_goToPreviousSection", + value: function _goToPreviousSection() { + var pages = this.getPages(); + + if (pages) { + var currentPage = pages[this.currentIndex]; + + if (currentPage) { + var _NewsmemoryUtils$pars4 = _newsmemoryUtils.default.parsePageInfo(currentPage.getPage()), + section = _NewsmemoryUtils$pars4.section; + + if (section.length) { + for (var i = this.currentIndex - 1; i >= 0; i--) { + var page = pages[i]; + + if (page.getShownPage().startsWith(_Page.SYMBOL_PAGE_STOP)) { + this.goToPage(i); + return; + } + + var _NewsmemoryUtils$pars5 = _newsmemoryUtils.default.parsePageInfo(page.getPage()), + prevPageSection = _NewsmemoryUtils$pars5.section, + prevPageNumber = _NewsmemoryUtils$pars5.number; + + if (section !== prevPageSection && prevPageNumber === 1) { + this.goToPage(i); + return; + } + + if (section === prevPageSection) { + if (prevPageNumber === 1) { + this.goToPage(i); + return; + } + + var secondPrev = pages[i - 1]; + + if (secondPrev) { + var _NewsmemoryUtils$pars6 = _newsmemoryUtils.default.parsePageInfo(secondPrev.getPage()), + secondPrevPageSection = _NewsmemoryUtils$pars6.section; + + if (secondPrevPageSection !== prevPageSection) { + this.goToPage(i); + return; + } + } + } + } + } + + this._onGoToFirstPage(); + } + } + } + }, { + key: "goToPage", + value: function goToPage(index) { + if (this.horizontalPagesManagerRef) { + this.horizontalPagesManagerRef.scrollTo(index); + } + } + }, { + key: "goToPrevPage", + value: function goToPrevPage() { + if (this.horizontalPagesManagerRef) { + this.horizontalPagesManagerRef.scrollToPrev(); + } + } + }, { + key: "goToNextPage", + value: function goToNextPage() { + if (this.horizontalPagesManagerRef) { + this.horizontalPagesManagerRef.scrollToNext(); + } + } + }, { + key: "pagesCounter", + value: function pagesCounter() { + var pages = this.getPages(); + return pages.length; + } + }, { + key: "navigateToPage", + value: function navigateToPage(pageId) { + this.currentIndex = this.getPageIndexById(pageId); + this.goToPage(this.currentIndex); + } + }, { + key: "_getPagesNavigationState", + value: function _getPagesNavigationState(isDoubleTruckRightSide) { + var _this$props2 = this.props, + numberOfShowedPages = _this$props2.numberOfShowedPages, + animateButtons = _this$props2.animateButtons; + var leftNavigationIsHidden = true; + var rightNavigationIsHidden = true; + var newsmemoryConfig = global.getNewsmemoryConfig(); + + if (!newsmemoryConfig.pagesNavigationButtonsHidden()) { + leftNavigationIsHidden = this._isFirstPageVisible(); + rightNavigationIsHidden = this._isLastPageVisible(); + } + + return { + leftPageNumber: this.getLeftPage(isDoubleTruckRightSide), + leftPageNumberIsHidden: false, + rightPageNumber: this.getRightPage(), + rightPageNumberIsHidden: numberOfShowedPages < 2, + leftNavigationIsHidden: leftNavigationIsHidden, + rightNavigationIsHidden: rightNavigationIsHidden, + animateButtons: animateButtons() + }; + } + }, { + key: "_visiblePages", + value: function _visiblePages() { + var pages = []; + + if (this.infos) { + var _this$infos = this.infos, + left = _this$infos.left, + right = _this$infos.right; + + if (left && left.page) { + pages.push(left.page); + } + + if (right && right.page) { + pages.push(right.page); + } + } + + return pages; + } + }, { + key: "_visiblePagesId", + value: function _visiblePagesId() { + return this._visiblePages().map(function (page) { + return page.getPageId(); + }); + } + }, { + key: "_isLastPageVisible", + value: function _isLastPageVisible() { + var pages = this.getPages(); + + if (pages[pages.length - 1]) { + return this._visiblePagesId().includes(pages[pages.length - 1].getPageId()); + } + + return false; + } + }, { + key: "_isFirstPageVisible", + value: function _isFirstPageVisible() { + var pages = this.getPages(); + + if (pages[0]) { + return this._visiblePagesId().includes(pages[0].getPageId()); + } + + return false; + } + }, { + key: "_updateViews", + value: function _updateViews(index, range, isScrolling, isZoomed, infos) { + var _this$props3 = this.props, + onPageChange = _this$props3.onPageChange, + onPageRangeChange = _this$props3.onPageRangeChange, + numberOfShowedPages = _this$props3.numberOfShowedPages; + var pages = this.getPages(); + this.currentIndex = index; + this.infos = infos; + + var visiblePages = this._visiblePages(); + + if (!isScrolling) { + if (typeof onPageRangeChange === "function") { + onPageRangeChange(range, this.infos); + } + + if (typeof onPageChange === "function" && pages[this.currentIndex]) { + onPageChange(pages[this.currentIndex].getPageId(), isZoomed); + } + + var prevPages = []; + + if (numberOfShowedPages === 2 && this.currentIndex > 1) { + prevPages.push(pages[this.currentIndex - 2]); + } + + if (this.currentIndex > 0) { + prevPages.push(pages[this.currentIndex - 1]); + } + + _InterstitialsHelper.default.getInterstitialEpaper(visiblePages, prevPages, this._isLastPageVisible()); + } + + if (this.pagesNavigationRef) { + this.pagesNavigationRef.updateNavigationLayout(this._getPagesNavigationState()); + } + } + }, { + key: "_onGoToLeftPagePress", + value: function _onGoToLeftPagePress() { + this.goToPrevPage(); + } + }, { + key: "_onGoToFirstPage", + value: function _onGoToFirstPage() { + this.goToPage(0); + } + }, { + key: "_onGoToRightPagePress", + value: function _onGoToRightPagePress() { + this.goToNextPage(); + } + }, { + key: "_onGoToLastPage", + value: function _onGoToLastPage() { + var newspaper = this.props.newspaper; + var pages = this.getPages(); + this.goToPage(pages.length - 1); + var lastPage = pages[pages.length - 1]; + + if (newspaper && lastPage) { + (0, _$$_REQUIRE(_dependencyMap[25]).sendNewsmemoryGoToLastPageEvent)(newspaper.getEditionModel(), lastPage); + } + } + }, { + key: "_onGotToMainEdition", + value: function _onGotToMainEdition() { + return _regenerator.default.async(function _onGotToMainEdition$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.NEWSMEMORY_ON_LOAD_MAIN_EDITION_FROM_SPECIAL); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_onRef", + value: function _onRef(ref) { + if (ref instanceof _horizontalPagesManager.default) { + this.horizontalPagesManagerRef = ref; + } else if (ref instanceof _pagesNavigation.default) { + this.pagesNavigationRef = ref; + } + } + }, { + key: "_renderContent", + value: function _renderContent() { + var _this$props4 = this.props, + onArticlePress = _this$props4.onArticlePress, + onPageLongPress = _this$props4.onPageLongPress, + onScaleChange = _this$props4.onScaleChange, + onPanChange = _this$props4.onPanChange, + newspaper = _this$props4.newspaper, + navigation = _this$props4.navigation, + pageNumberTop = _this$props4.pageNumberTop, + getCurrentArticle = _this$props4.getCurrentArticle, + bgColor = _this$props4.bgColor, + textColor = _this$props4.textColor, + isTextModeOpen = _this$props4.isTextModeOpen, + isReadMode = _this$props4.isReadMode, + articleClose = _this$props4.articleClose, + isSpecialSection = _this$props4.isSpecialSection, + isSingleTapToZoomEnabled = _this$props4.isSingleTapToZoomEnabled, + onUnFit = _this$props4.onUnFit, + size = _this$props4.size, + textSize = _this$props4.textSize, + onUnmounted = _this$props4.onUnmounted, + onLoaded = _this$props4.onLoaded, + navigationModel = _this$props4.navigationModel, + shortcutEnabled = _this$props4.shortcutEnabled, + shortcutPriority = _this$props4.shortcutPriority, + highlightEnabled = _this$props4.highlightEnabled; + var width = size.width, + height = size.height; + var _this$props5 = this.props, + numberOfShowedPages = _this$props5.numberOfShowedPages, + fitPageHorizontally = _this$props5.fitPageHorizontally, + isLandscape = _this$props5.isLandscape, + initialEvent = _this$props5.initialEvent; + var pages = this.getPages(); + var convertedEvent; + + if (initialEvent) { + var scaleFactor = fitPageHorizontally ? width / initialEvent.width : height / initialEvent.height; + convertedEvent = (0, _extends2.default)({ + scale: scaleFactor, + disableZoomFactor: initialEvent.disableZoomFactor === undefined ? false : initialEvent.disableZoomFactor + }, initialEvent); + } + + var _global$getActivePSet = global.getActivePSetup(), + midQualityToRender = _global$getActivePSet.midPagesToRender; + + if (midQualityToRender < 2 && numberOfShowedPages === 2) { + midQualityToRender += 1; + } + + if (_newsmemoryUtils.default.isModeLow(newspaper && newspaper.getDbNetwork())) { + midQualityToRender = 0; + } + + var lowQualityToRender = 0; + + if (!(typeof isTextModeOpen === "function" && isTextModeOpen())) { + var _global$getActivePSet2 = global.getActivePSetup(); + + lowQualityToRender = _global$getActivePSet2.lowPagesToRender; + + if (lowQualityToRender < 2 && numberOfShowedPages === 2) { + lowQualityToRender += 1; + } + } + + var children = []; + children.push(_react.default.createElement(_horizontalPagesManager.default, { + key: "horizontal_pages", + ref: this.onRef, + navigation: navigation, + newspaper: newspaper, + size: { + width: width, + height: height + }, + textSize: textSize, + data: pages, + firstPage: this.currentIndex, + onArticlePress: onArticlePress, + onUnFit: onUnFit, + onScaleChange: onScaleChange, + onPanChange: onPanChange, + fitPageHorizontally: fitPageHorizontally, + getCurrentArticle: getCurrentArticle, + onPageChange: this.onUpdateViews, + onPageLongPress: onPageLongPress, + renderedPagesOffset: midQualityToRender, + renderedLowPagesOffset: lowQualityToRender, + numberOfShowedPages: numberOfShowedPages, + isTextModeOpen: isTextModeOpen, + isReadMode: isReadMode, + isSingleTapToZoomEnabled: isSingleTapToZoomEnabled, + articleClose: articleClose, + initialEvent: convertedEvent, + isLandscape: isLandscape, + onLoaded: onLoaded, + onUnmounted: onUnmounted, + shortcutEnabled: shortcutEnabled, + shortcutPriority: shortcutPriority + 1, + highlightEnabled: highlightEnabled + })); + + var pageViewSize = _newsmemoryUtils.default.getPageViewSize(pages[0], size, fitPageHorizontally, numberOfShowedPages); + + if (pageViewSize) { + var scaledWidth = pageViewSize.scaledWidth, + scaledHeight = pageViewSize.scaledHeight; + var pagesAreaSize = { + width: scaledWidth * numberOfShowedPages, + height: scaledHeight + }; + children.push(_react.default.createElement(_pagesNavigation.default, { + key: "navigation", + ref: this.onRef, + model: navigationModel, + pageNumberTop: pageNumberTop, + width: width, + height: height, + pagesAreaSize: pagesAreaSize, + bgColor: bgColor, + textColor: textColor, + isSpecialSection: isSpecialSection, + onGoToLeftPagePress: this.onGoToLeftPagePress, + onGoToLeftSectionPress: this.onGoToLeftSectionPress, + onGoToFirstPage: this.onGoToFirstPage, + onGoToRightPagePress: this.onGoToRightPagePress, + onGoToRightSectionPress: this.onGoToRightSectionPress, + onGoToLastPage: this.onGoToLastPage, + onGotToMainEdition: this.onGotToMainEdition, + defaultState: this._getPagesNavigationState() + })); + } + + return children; + } + }, { + key: "render", + value: function render() { + var _this$props6 = this.props, + currentPageId = _this$props6.currentPageId, + numberOfShowedPages = _this$props6.numberOfShowedPages, + fitPageHorizontally = _this$props6.fitPageHorizontally, + isLandscape = _this$props6.isLandscape; + this.currentIndex = this.getPageIndexById(currentPageId); + return _react.default.createElement(_reactNative.View, { + key: "view_" + numberOfShowedPages + "_" + fitPageHorizontally + "_" + isLandscape, + style: { + flex: 1, + justifyContent: "flex-end" + } + }, this._renderContent()); + } + }]); + return PagesLayoutManager; + }(_$$_REQUIRE(_dependencyMap[26]).Shortcut); + + exports.default = PagesLayoutManager; + PagesLayoutManager.propTypes = (0, _extends2.default)({ + bgColor: _propTypes.default.string, + textColor: _propTypes.default.string, + onPageRangeChange: _propTypes.default.func.isRequired, + numberOfShowedPages: _propTypes.default.number, + currentPageId: _propTypes.default.number, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }).isRequired, + pageNumberTop: _propTypes.default.bool, + animateButtons: _propTypes.default.func, + isLandscape: _propTypes.default.bool, + isTextModeOpen: _propTypes.default.func, + isReadMode: _propTypes.default.func, + isSpecialSection: _propTypes.default.bool, + articleClose: _propTypes.default.func, + navigationModel: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[27]).Navigation) + }, _horizontalPagesManager.default.propTypes, _$$_REQUIRE(_dependencyMap[26]).Shortcut.propTypes); + PagesLayoutManager.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[26]).Shortcut.defaultProps, { + numberOfShowedPages: 2, + pageNumberTop: true, + isSpecialSection: false + }); +},2381,[5,80,6,7,8,15,90,12,14,16,17,201,28,638,603,460,2382,2396,715,2321,714,1859,572,462,1873,1954,1911,1858]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _pagesTextInfo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _pagesNavigationButtons = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _pagesLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _pagesBackToPaperButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _newsmemoryIcon = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PagesNavigation = function (_React$Component) { + (0, _inherits2.default)(PagesNavigation, _React$Component); + + var _super = _createSuper(PagesNavigation); + + function PagesNavigation(props) { + var _this; + + (0, _classCallCheck2.default)(this, PagesNavigation); + _this = _super.call(this, props); + _this.state = (0, _extends2.default)({}, props.defaultState, { + visible: true + }); + return _this; + } + + (0, _createClass2.default)(PagesNavigation, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + if (!_$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isTablet()) { + this.onHrDownloadErrorId = _$$_REQUIRE(_dependencyMap[20]).EventRegister.on(_events.default.NEWSMEMORY_HR_DOWNLOAD_ERROR, function () { + var error = _this2.state.error; + + if (!error) { + _this2.setState({ + error: true, + warning: false + }); + } + }); + this.onHrDownloadSuccessId = _$$_REQUIRE(_dependencyMap[20]).EventRegister.on(_events.default.NEWSMEMORY_HR_DOWNLOAD_SUCCESS, function () { + var error = _this2.state.error; + + if (error) { + _this2.setState({ + error: false, + warning: false + }); + } + }); + this.onWarningShow = _$$_REQUIRE(_dependencyMap[20]).EventRegister.on(_events.default.NEWSMEMORY_MISSING_HR_WARNING_SHOW, function () { + var error = _this2.state.error; + + if (!error) { + _this2.setState({ + error: false, + warning: true + }); + } + }); + this.onWarningHide = _$$_REQUIRE(_dependencyMap[20]).EventRegister.on(_events.default.NEWSMEMORY_MISSING_HR_WARNING_HIDE, function () { + var error = _this2.state.error; + + if (error) { + _this2.setState({ + error: false, + warning: false + }); + } + }); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[20]).EventRegister.rm(this.onHrDownloadErrorId); + + _$$_REQUIRE(_dependencyMap[20]).EventRegister.rm(this.onHrDownloadSuccessId); + + _$$_REQUIRE(_dependencyMap[20]).EventRegister.rm(this.onWarningShow); + + _$$_REQUIRE(_dependencyMap[20]).EventRegister.rm(this.onWarningHide); + } + }, { + key: "updateVisibility", + value: function updateVisibility(value) { + var visible = this.state.visible; + + if (visible !== value) { + this.setState({ + visible: value + }); + } + } + }, { + key: "updateNavigationLayout", + value: function updateNavigationLayout(param) { + var _this$state = this.state, + visible = _this$state.visible, + rest = (0, _objectWithoutProperties2.default)(_this$state, ["visible"]); + + if (!_$$_REQUIRE(_dependencyMap[19]).JSUtils.areEqualShallow(rest, param)) { + this.setState(param); + } + } + }, { + key: "_getErrorIcon", + value: function _getErrorIcon(error) { + return _react.default.createElement(_reactNative.View, { + style: [_pagesLayoutManager.default.pageNumberContainer, _pagesLayoutManager.default.pageNumberContainerRight, _pagesLayoutManager.default.pageNumberContainerTop, _pagesLayoutManager.default.pageNumberContainerRightTop, error ? _pagesLayoutManager.default.errorContainer : _pagesLayoutManager.default.warningContainer] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).TouchableOpacity, { + onPress: function onPress() { + _reactNative.Alert.alert(error ? global.strings("err_download_edition") : "", global.strings("offline_download_warning")); + } + }, _react.default.createElement(_reactNative.View, { + style: _pagesLayoutManager.default.warningIcon + }, _react.default.createElement(_newsmemoryIcon.default, { + center: true, + icon: _$$_REQUIRE(_dependencyMap[22]).ACTIONS.warning.icon, + foregroundColor: _$$_REQUIRE(_dependencyMap[19]).colors.white + })))); + } + }, { + key: "_getTopLeftComponent", + value: function _getTopLeftComponent() { + var _this$props = this.props, + pageNumberTop = _this$props.pageNumberTop, + width = _this$props.width, + height = _this$props.height, + pagesAreaSize = _this$props.pagesAreaSize, + bgColor = _this$props.bgColor, + textColor = _this$props.textColor; + var _this$state2 = this.state, + leftPageNumber = _this$state2.leftPageNumber, + leftPageNumberIsHidden = _this$state2.leftPageNumberIsHidden, + animateButtons = _this$state2.animateButtons; + var leftRadiusStyle = {}; + + if (pageNumberTop) { + leftRadiusStyle = _pagesLayoutManager.default.pageNumberContainerLeftTop; + } else { + leftRadiusStyle = _pagesLayoutManager.default.pageNumberContainerLeftBottom; + } + + return !leftPageNumberIsHidden ? _react.default.createElement(_pagesTextInfo.default, { + key: "leftPage", + position: _pagesNavigationButtons.PagesNavigationButtonsPosition.left, + stylePropToAnimate: "start", + style: [_pagesLayoutManager.default.pageNumberContainer, _pagesLayoutManager.default.pageNumberContainerLeft, { + backgroundColor: bgColor + }, leftRadiusStyle, pageNumberTop ? _pagesLayoutManager.default.pageNumberContainerTop : _pagesLayoutManager.default.pageNumberContainerBottom], + animated: animateButtons, + textStyle: [_pagesLayoutManager.default.pageText, { + color: textColor + }], + text: leftPageNumber, + width: width, + height: height, + pagesAreaSize: pagesAreaSize + }) : null; + } + }, { + key: "_getTopCenterComponent", + value: function _getTopCenterComponent() { + var _this$props2 = this.props, + pageNumberTop = _this$props2.pageNumberTop, + width = _this$props2.width, + height = _this$props2.height, + pagesAreaSize = _this$props2.pagesAreaSize, + bgColor = _this$props2.bgColor, + textColor = _this$props2.textColor, + isSpecialSection = _this$props2.isSpecialSection, + onGotToMainEdition = _this$props2.onGotToMainEdition; + + var _global$getActivePSet = global.getActivePSetup(), + showXPaperNavigationCloseButton = _global$getActivePSet.showXPaperNavigationCloseButton, + paperName = _global$getActivePSet.paperName; + + if (!showXPaperNavigationCloseButton || !_newsmemoryUtils.default.isXPaperActive() && !isSpecialSection) { + return null; + } + + var _this$state3 = this.state, + animateButtons = _this$state3.animateButtons, + rightPageNumberIsHidden = _this$state3.rightPageNumberIsHidden, + error = _this$state3.error; + var textStyle = [_pagesLayoutManager.default.pageText, _pagesLayoutManager.default.xpaperInfoText, { + color: textColor + }]; + return _react.default.createElement(_pagesTextInfo.default, { + key: "xpaperInfo", + position: _pagesNavigationButtons.PagesNavigationButtonsPosition.center, + stylePropToAnimate: "end", + style: [_pagesLayoutManager.default.paperInfoContainer, { + backgroundColor: bgColor, + alignItems: rightPageNumberIsHidden && !error ? "flex-end" : "center" + }, pageNumberTop ? _pagesLayoutManager.default.pageNumberContainerTop : _pagesLayoutManager.default.pageNumberContainerBottom], + animated: animateButtons, + textStyle: textStyle, + IconComponent: _react.default.createElement(_imageIconChooserComponent.default, { + type: _$$_REQUIRE(_dependencyMap[23]).TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + name: "close", + iconStyle: textStyle + }), + text: global.strings("btn_close") + " " + paperName, + width: width, + height: height, + pagesAreaSize: pagesAreaSize, + onPress: onGotToMainEdition + }); + } + }, { + key: "_getTopRightComponent", + value: function _getTopRightComponent() { + var _this$props3 = this.props, + pageNumberTop = _this$props3.pageNumberTop, + width = _this$props3.width, + height = _this$props3.height, + pagesAreaSize = _this$props3.pagesAreaSize, + bgColor = _this$props3.bgColor, + textColor = _this$props3.textColor; + var _this$state4 = this.state, + rightPageNumber = _this$state4.rightPageNumber, + rightPageNumberIsHidden = _this$state4.rightPageNumberIsHidden, + animateButtons = _this$state4.animateButtons; + var rightRadiusStyle = {}; + + if (pageNumberTop) { + rightRadiusStyle = _pagesLayoutManager.default.pageNumberContainerRightTop; + } else { + rightRadiusStyle = _pagesLayoutManager.default.pageNumberContainerRightBottom; + } + + return !rightPageNumberIsHidden ? _react.default.createElement(_pagesTextInfo.default, { + key: "rightPage", + position: _pagesNavigationButtons.PagesNavigationButtonsPosition.right, + stylePropToAnimate: "end", + style: [_pagesLayoutManager.default.pageNumberContainer, _pagesLayoutManager.default.pageNumberContainerRight, { + backgroundColor: bgColor + }, rightRadiusStyle, pageNumberTop ? _pagesLayoutManager.default.pageNumberContainerTop : _pagesLayoutManager.default.pageNumberContainerBottom], + animated: animateButtons, + textStyle: [_pagesLayoutManager.default.pageText, { + color: textColor + }], + text: rightPageNumber, + width: width, + height: height, + pagesAreaSize: pagesAreaSize + }) : null; + } + }, { + key: "render", + value: function render() { + var _this$state5 = this.state, + leftNavigationIsHidden = _this$state5.leftNavigationIsHidden, + rightNavigationIsHidden = _this$state5.rightNavigationIsHidden, + visible = _this$state5.visible, + error = _this$state5.error, + warning = _this$state5.warning, + animateButtons = _this$state5.animateButtons; + var _this$props4 = this.props, + model = _this$props4.model, + width = _this$props4.width, + height = _this$props4.height, + pagesAreaSize = _this$props4.pagesAreaSize, + onGoToLeftPagePress = _this$props4.onGoToLeftPagePress, + onGoToLeftSectionPress = _this$props4.onGoToLeftSectionPress, + onGoToFirstPage = _this$props4.onGoToFirstPage, + onGoToRightPagePress = _this$props4.onGoToRightPagePress, + onGoToRightSectionPress = _this$props4.onGoToRightSectionPress, + onGoToLastPage = _this$props4.onGoToLastPage, + isSpecialSection = _this$props4.isSpecialSection, + onGotToMainEdition = _this$props4.onGotToMainEdition; + + if (!visible) { + if (error || warning) { + return this._getErrorIcon(error); + } + + return null; + } + + return [this._getTopCenterComponent(), this._getTopLeftComponent(), this._getTopRightComponent(), isSpecialSection ? _react.default.createElement(_pagesBackToPaperButton.default, { + onPress: onGotToMainEdition + }) : null, error ? this._getErrorIcon(true) : null, !leftNavigationIsHidden ? _react.default.createElement(_pagesNavigationButtons.default, { + key: "leftNavigation", + model: model, + width: width, + height: height, + pagesAreaSize: pagesAreaSize, + animated: animateButtons, + position: _pagesNavigationButtons.PagesNavigationButtonsPosition.left, + onPagePress: onGoToLeftPagePress, + onSectionPress: onGoToLeftSectionPress, + onSectionDoublePress: onGoToFirstPage + }) : null, !rightNavigationIsHidden ? _react.default.createElement(_pagesNavigationButtons.default, { + key: "rightNavigation", + model: model, + width: width, + height: height, + pagesAreaSize: pagesAreaSize, + animated: animateButtons, + position: _pagesNavigationButtons.PagesNavigationButtonsPosition.right, + onPagePress: onGoToRightPagePress, + onSectionPress: onGoToRightSectionPress, + onSectionDoublePress: onGoToLastPage + }) : null]; + } + }]); + return PagesNavigation; + }(_react.default.Component); + + exports.default = PagesNavigation; + PagesNavigation.propTypes = { + model: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[24]).Navigation), + pageNumberTop: _propTypes.default.bool.isRequired, + isSpecialSection: _propTypes.default.bool, + width: _propTypes.default.number.isRequired, + height: _propTypes.default.number.isRequired, + pagesAreaSize: _propTypes.default.object, + onGoToLeftPagePress: _propTypes.default.func.isRequired, + onGoToLeftSectionPress: _propTypes.default.func.isRequired, + onGoToFirstPage: _propTypes.default.func.isRequired, + onGoToRightPagePress: _propTypes.default.func.isRequired, + onGoToRightSectionPress: _propTypes.default.func.isRequired, + onGoToLastPage: _propTypes.default.func.isRequired, + onGotToMainEdition: _propTypes.default.func.isRequired, + bgColor: _propTypes.default.string, + textColor: _propTypes.default.string, + defaultState: _propTypes.default.shape({ + leftPageNumber: _propTypes.default.string, + rightPageNumber: _propTypes.default.string, + leftPageNumberIsHidden: _propTypes.default.bool, + rightPageNumberIsHidden: _propTypes.default.bool, + leftNavigationIsHidden: _propTypes.default.bool, + rightNavigationIsHidden: _propTypes.default.bool + }) + }; + PagesNavigation.defaultProps = { + isSpecialSection: false, + defaultState: { + leftPageNumber: undefined, + rightPageNumber: undefined, + leftPageNumberIsHidden: true, + rightPageNumberIsHidden: true, + leftNavigationIsHidden: true, + rightNavigationIsHidden: true, + error: false, + warning: false, + animateButtons: false + } + }; +},2382,[5,108,6,7,8,12,14,16,17,201,28,2383,2384,2385,2394,460,2340,603,1970,462,572,1,1725,1806,1858]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _hidingAnimationComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PagesTextInfo = function (_React$PureComponent) { + (0, _inherits2.default)(PagesTextInfo, _React$PureComponent); + + var _super = _createSuper(PagesTextInfo); + + function PagesTextInfo(props) { + var _this; + + (0, _classCallCheck2.default)(this, PagesTextInfo); + _this = _super.call(this, props); + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + animated: props.animated + }; + return _this; + } + + (0, _createClass2.default)(PagesTextInfo, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var animated = this.props.animated; + + if (animated !== nextProps.animated) { + this.setState({ + animated: nextProps.animated + }); + } + } + }, { + key: "_onLayout", + value: function _onLayout(_ref) { + var nativeEvent = _ref.nativeEvent; + var _this$props = this.props, + width = _this$props.width, + height = _this$props.height, + pagesAreaSize = _this$props.pagesAreaSize; + var animated = this.state.animated; + + if (animated) { + var layout = nativeEvent.layout; + + if (layout) { + var horizontalBorderAreaWidth = Math.max(width - pagesAreaSize.width, 0) / 2; + var horizontalBorderAreaHeight = Math.max(height - pagesAreaSize.height, 0) / 2; + + if (horizontalBorderAreaHeight >= layout.height) { + animated = false; + } else if (horizontalBorderAreaWidth >= layout.width) { + animated = false; + } + } + + this.setState({ + animated: animated + }); + } + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + text = _this$props2.text, + IconComponent = _this$props2.IconComponent, + position = _this$props2.position, + style = _this$props2.style, + textStyle = _this$props2.textStyle, + stylePropToAnimate = _this$props2.stylePropToAnimate, + onPress = _this$props2.onPress; + + if (!text || !text.length) { + return null; + } + + var animated = this.state.animated; + + var Component = _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-text", "newsmemory-navigation-text", "newsmemory-navigation-" + position + "-text"] + }, _react.default.createElement(_fontText.default, { + style: textStyle + }, text)); + + if (IconComponent) { + Component = _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "row", + justifyContent: "center", + alignItems: "center" + } + }, Component, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-icon", "newsmemory-navigation-icon", "newsmemory-navigation-" + position + "-icon"] + }, IconComponent)); + } + + if (typeof onPress === "function") { + Component = _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).TouchableOpacity, { + onPress: onPress + }, Component); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-navigation-text-parent", "newsmemory-navigation-" + position + "-text-parent"] + }, _react.default.createElement(_hidingAnimationComponent.default, { + style: style, + enabled: animated, + stylePropToAnimate: stylePropToAnimate, + eventToShow: _events.default.NEWSMEMORY_VIEWPAGER_GESTURE_START, + eventToggleEnable: _events.default.NEWSMEMORY_RESET_NAVIGATION_BUTTONS_POSITION, + onLayout: this.onLayout + }, Component)); + } + }]); + return PagesTextInfo; + }(_react.default.PureComponent); + + exports.default = PagesTextInfo; + PagesTextInfo.propTypes = { + text: _propTypes.default.string, + position: _propTypes.default.oneOf([_$$_REQUIRE(_dependencyMap[15]).PagesNavigationButtonsPosition.left, _$$_REQUIRE(_dependencyMap[15]).PagesNavigationButtonsPosition.center, _$$_REQUIRE(_dependencyMap[15]).PagesNavigationButtonsPosition.right]), + stylePropToAnimate: _propTypes.default.string, + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + textStyle: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + IconComponent: _propTypes.default.node, + animated: _propTypes.default.bool, + width: _propTypes.default.number, + height: _propTypes.default.number, + pagesAreaSize: _propTypes.default.object, + onPress: _propTypes.default.func + }; +},2383,[5,7,8,15,12,14,16,17,201,28,1879,2338,460,699,1,2384]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.PagesNavigationButtonsPosition = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _pagesLayoutManager = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + var _tapView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _hidingAnimationComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PagesNavigationButtonsPosition = { + left: "LEFT", + center: "CENTER", + right: "RIGHT" + }; + exports.PagesNavigationButtonsPosition = PagesNavigationButtonsPosition; + var ICONS = { + 1: { + icons: { + backPage: { + key: "backPage", + icon: _$$_REQUIRE(_dependencyMap[16]) + }, + backSection: { + key: "backSection", + icon: _$$_REQUIRE(_dependencyMap[17]) + }, + forwardPage: { + key: "forwardPage", + icon: _$$_REQUIRE(_dependencyMap[18]) + }, + forwardSection: { + key: "forwardSection", + icon: _$$_REQUIRE(_dependencyMap[19]) + } + }, + styling: { + resizeMode: "stretch", + parentHeight: _pagesLayoutManager.NAVIGATION_PARENT_BUTTON, + style: { + opacity: 0.6 + } + } + }, + 2: { + icons: { + backPage: { + key: "backPage", + icon: _$$_REQUIRE(_dependencyMap[20]) + }, + backSection: { + key: "backSection", + icon: _$$_REQUIRE(_dependencyMap[21]) + }, + forwardPage: { + key: "forwardPage", + icon: _$$_REQUIRE(_dependencyMap[22]) + }, + forwardSection: { + key: "forwardSection", + icon: _$$_REQUIRE(_dependencyMap[23]) + } + }, + styling: { + resizeMode: "contain", + style: { + height: _pagesLayoutManager.NAVIGATION_ROUND_BUTTON_HEIGHT, + margin: 2 + }, + parentHeight: _pagesLayoutManager.NAVIGATION_PARENT_ROUND_BUTTON + } + } + }; + + var PagesNavigationButtons = function (_React$PureComponent) { + (0, _inherits2.default)(PagesNavigationButtons, _React$PureComponent); + + var _super = _createSuper(PagesNavigationButtons); + + function PagesNavigationButtons(props) { + var _this; + + (0, _classCallCheck2.default)(this, PagesNavigationButtons); + _this = _super.call(this, props); + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + animated: props.animated + }; + return _this; + } + + (0, _createClass2.default)(PagesNavigationButtons, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var animated = this.props.animated; + + if (animated !== nextProps.animated) { + this.setState({ + animated: nextProps.animated + }); + } + } + }, { + key: "_onLayout", + value: function _onLayout(_ref) { + var nativeEvent = _ref.nativeEvent; + var _this$props = this.props, + width = _this$props.width, + pagesAreaSize = _this$props.pagesAreaSize; + var animated = this.state.animated; + + if (animated) { + var layout = nativeEvent.layout; + + if (layout) { + var horizontalBorderAreaWidth = Math.max(width - pagesAreaSize.width, 0) / 2; + + if (horizontalBorderAreaWidth >= layout.width) { + animated = false; + } + } + + this.setState({ + animated: animated + }); + } + } + }, { + key: "_getIcon", + value: function _getIcon(button, buttonStyle) { + var version = this.props.version; + var _ICONS$version = ICONS[version], + icons = _ICONS$version.icons, + styling = _ICONS$version.styling; + var resizeMode = styling.resizeMode, + style = styling.style; + var action = button.getAction(); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-icon", "newsmemory-navigation-icon", "newsmemory-navigation-" + action + "-icon"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + style: [buttonStyle, style], + resizeMode: resizeMode, + source: icons[action].icon, + type: button.getLibrary(), + name: button.getIcon() + })); + } + }, { + key: "_getButton", + value: function _getButton(button) { + var _this$props2 = this.props, + onPagePress = _this$props2.onPagePress, + onSectionPress = _this$props2.onSectionPress, + onSectionDoublePress = _this$props2.onSectionDoublePress, + position = _this$props2.position; + var action = button.getAction(); + var isLeft = position === PagesNavigationButtonsPosition.left; + + switch (action) { + case "backPage": + case "forwardPage": + return _react.default.createElement(_tapView.default, { + onPress: onPagePress, + onSingleTap: onPagePress, + onDoubleTap: onPagePress, + key: "page_navigation_" + action + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["page-navigation-button"], + cssKey: action + }, _react.default.createElement(_reactNative.View, { + style: [_pagesLayoutManager.default.navigationParentButton, isLeft ? _pagesLayoutManager.default.navigationParentButtonLeft : _pagesLayoutManager.default.navigationParentButtonRight] + }, this._getIcon(button, _pagesLayoutManager.default.navigationMainButton)))); + + case "backSection": + case "forwardSection": + return _react.default.createElement(_tapView.default, { + onPress: onSectionPress, + onSingleTap: onSectionPress, + onDoubleTap: onSectionDoublePress, + key: "page_navigation_" + action + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["page-navigation-button"], + cssKey: action + }, _react.default.createElement(_reactNative.View, { + style: [_pagesLayoutManager.default.navigationParentButton, isLeft ? _pagesLayoutManager.default.navigationParentButtonLeft : _pagesLayoutManager.default.navigationParentButtonRight] + }, this._getIcon(button, _pagesLayoutManager.default.navigationSubButton)))); + } + + return null; + } + }, { + key: "_getButtons", + value: function _getButtons(buttons) { + var _this2 = this; + + return buttons && buttons.map(function (button) { + return _this2._getButton(button); + }); + } + }, { + key: "render", + value: function render() { + var _this$props3 = this.props, + height = _this$props3.height, + position = _this$props3.position, + version = _this$props3.version, + model = _this$props3.model; + var animated = this.state.animated; + var isLeft = position === PagesNavigationButtonsPosition.left; + var horizontalConstraint = isLeft ? { + start: 0 + } : { + end: 0 + }; + var styling = ICONS[version].styling; + var parentHeight = styling.parentHeight; + var backSection; + var forwardSection; + + if (model) { + backSection = model.getBack(); + forwardSection = model.getForward(); + } + + var buttons; + var direction; + + if (_$$_REQUIRE(_dependencyMap[25]).PlatformUtils.isRTL()) { + buttons = isLeft ? forwardSection && forwardSection.getButtons() : backSection && backSection.getButtons(); + direction = isLeft ? "forward" : "back"; + } else { + buttons = isLeft ? backSection && backSection.getButtons() : forwardSection && forwardSection.getButtons(); + direction = isLeft ? "back" : "forward"; + } + + var top = height * 0.6 - parentHeight / 2; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["newsmemory-navigation-icons-parent", "newsmemory-navigation-" + direction + "-icons-parent"] + }, _react.default.createElement(_hidingAnimationComponent.default, { + stylePropToAnimate: isLeft ? "start" : "end", + style: [_pagesLayoutManager.default.navigationParentButtons, (0, _extends2.default)({ + top: top + }, horizontalConstraint), { + height: parentHeight + }], + enabled: animated, + eventToShow: _events.default.NEWSMEMORY_VIEWPAGER_GESTURE_START, + eventToggleEnable: _events.default.NEWSMEMORY_RESET_NAVIGATION_BUTTONS_POSITION, + onLayout: this.onLayout + }, this._getButtons(buttons))); + } + }]); + return PagesNavigationButtons; + }(_react.default.PureComponent); + + exports.default = PagesNavigationButtons; + PagesNavigationButtons.propTypes = { + model: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[26]).Navigation), + width: _propTypes.default.number, + height: _propTypes.default.number, + animated: _propTypes.default.bool, + pagesAreaSize: _propTypes.default.object, + position: _propTypes.default.oneOf([PagesNavigationButtonsPosition.left, PagesNavigationButtonsPosition.right]), + onPagePress: _propTypes.default.func.isRequired, + onSectionPress: _propTypes.default.func.isRequired, + onSectionDoublePress: _propTypes.default.func.isRequired, + version: _propTypes.default.number + }; + PagesNavigationButtons.defaultProps = { + version: 2 + }; +},2384,[5,6,7,8,15,12,14,16,17,201,28,2385,2163,460,2338,1970,2386,2387,2388,2389,2390,2391,2392,2393,699,462,1858]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.NAVIGATION_PAGE_NUMBER_MIN_WIDTH = exports.NAVIGATION_PARENT_ROUND_BUTTON = exports.NAVIGATION_PARENT_BUTTON = exports.NAVIGATION_ROUND_BUTTON_HEIGHT = exports.NAVIGATION_SUB_BUTTON_HEIGHT = exports.NAVIGATION_MAIN_BUTTON_HEIGHT = exports.NAVIGATION_BUTTON_WIDTH = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var NAVIGATION_BUTTON_WIDTH = 30; + exports.NAVIGATION_BUTTON_WIDTH = NAVIGATION_BUTTON_WIDTH; + var NAVIGATION_MAIN_BUTTON_HEIGHT = 90; + exports.NAVIGATION_MAIN_BUTTON_HEIGHT = NAVIGATION_MAIN_BUTTON_HEIGHT; + var NAVIGATION_SUB_BUTTON_HEIGHT = 70; + exports.NAVIGATION_SUB_BUTTON_HEIGHT = NAVIGATION_SUB_BUTTON_HEIGHT; + var NAVIGATION_ROUND_BUTTON_HEIGHT = 50; + exports.NAVIGATION_ROUND_BUTTON_HEIGHT = NAVIGATION_ROUND_BUTTON_HEIGHT; + var NAVIGATION_PARENT_BUTTON = 180; + exports.NAVIGATION_PARENT_BUTTON = NAVIGATION_PARENT_BUTTON; + var NAVIGATION_PARENT_ROUND_BUTTON = 120; + exports.NAVIGATION_PARENT_ROUND_BUTTON = NAVIGATION_PARENT_ROUND_BUTTON; + var NAVIGATION_PAGE_NUMBER_MIN_WIDTH = 40; + exports.NAVIGATION_PAGE_NUMBER_MIN_WIDTH = NAVIGATION_PAGE_NUMBER_MIN_WIDTH; + + var _default = _reactNative.StyleSheet.create({ + navigationParentButtons: { + position: "absolute", + height: NAVIGATION_PARENT_BUTTON, + flexDirection: "column", + justifyContent: "space-between" + }, + navigationParentButton: { + width: 50 + }, + navigationParentButtonLeft: { + alignItems: "flex-start" + }, + navigationParentButtonRight: { + alignItems: "flex-end" + }, + navigationMainButton: { + width: NAVIGATION_BUTTON_WIDTH, + fontSize: NAVIGATION_BUTTON_WIDTH, + height: NAVIGATION_MAIN_BUTTON_HEIGHT + }, + navigationSubButton: { + width: NAVIGATION_BUTTON_WIDTH, + fontSize: NAVIGATION_BUTTON_WIDTH, + height: NAVIGATION_SUB_BUTTON_HEIGHT + }, + pageNumberContainer: { + position: "absolute", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + minWidth: NAVIGATION_PAGE_NUMBER_MIN_WIDTH, + justifyContent: "center", + alignItems: "center" + }, + paperInfoContainer: { + position: "absolute", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + minWidth: "100%", + justifyContent: "center", + alignItems: "center", + paddingHorizontal: 5 + }, + pageNumberContainerTop: { + top: 0 + }, + pageNumberContainerBottom: { + bottom: 0 + }, + pageNumberContainerLeft: { + start: 0 + }, + pageNumberContainerLeftTop: { + borderBottomRightRadius: 5 + }, + pageNumberContainerRightTop: { + borderBottomLeftRadius: 5 + }, + pageNumberContainerLeftBottom: { + borderTopRightRadius: 5 + }, + pageNumberContainerRightBottom: { + borderTopLeftRadius: 5 + }, + pageNumberContainerRight: { + end: 0 + }, + pageText: { + fontSize: _$$_REQUIRE(_dependencyMap[2]).HEADER_FONT_SIZE, + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + xpaperInfoText: { + fontSize: 14, + paddingVertical: 2.5, + paddingHorizontal: 5 + }, + errorContainer: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.md_red_600 + }, + warningContainer: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.md_orange_600 + }, + warningIcon: { + width: 20, + height: 23 + } + }); + + exports.default = _default; +},2385,[28,462,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v1", + "width": 167, + "height": 500, + "scales": [1], + "hash": "eddb3297c148d18d34f7269acf7ebe45", + "name": "ic-back-button", + "type": "png" + }); +},2386,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v1", + "width": 167, + "height": 360, + "scales": [1], + "hash": "52fe379bda57a6463fe980e3ad3bdfba", + "name": "ic-back-section-button", + "type": "png" + }); +},2387,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v1", + "width": 167, + "height": 500, + "scales": [1], + "hash": "ce4d0b25d3444d5ace31e50afda0539d", + "name": "ic-forward-button", + "type": "png" + }); +},2388,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v1", + "width": 167, + "height": 360, + "scales": [1], + "hash": "76f318bb980d02f483cc0153757edc0a", + "name": "ic-forward-section-button", + "type": "png" + }); +},2389,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v2", + "width": 128, + "height": 128, + "scales": [1], + "hash": "52688047c7df4a6391489d2bf47c571f", + "name": "ic-back-button", + "type": "png" + }); +},2390,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v2", + "width": 128, + "height": 128, + "scales": [1], + "hash": "facf45c0236cc9a31b2ba87bb8cab43a", + "name": "ic-back-section-button", + "type": "png" + }); +},2391,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v2", + "width": 128, + "height": 128, + "scales": [1], + "hash": "ceec2685ab684910db8bab70380d187f", + "name": "ic-forward-button", + "type": "png" + }); +},2392,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v2", + "width": 128, + "height": 128, + "scales": [1], + "hash": "ad1531bf863fb714df86c06448227f11", + "name": "ic-forward-section-button", + "type": "png" + }); +},2393,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _pagesLayoutManager = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PagesBackToPaperButton = function (_React$Component) { + (0, _inherits2.default)(PagesBackToPaperButton, _React$Component); + + var _super = _createSuper(PagesBackToPaperButton); + + function PagesBackToPaperButton() { + (0, _classCallCheck2.default)(this, PagesBackToPaperButton); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(PagesBackToPaperButton, [{ + key: "render", + value: function render() { + var onPress = this.props.onPress; + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: onPress, + style: { + position: "absolute", + top: 40 + } + }, _react.default.createElement(_imageComponent.default, { + style: [_pagesLayoutManager.default.navigationMainButton, { + height: _pagesLayoutManager.NAVIGATION_ROUND_BUTTON_HEIGHT, + margin: 2 + }], + resizeMode: "contain", + source: _$$_REQUIRE(_dependencyMap[11]) + })); + } + }]); + return PagesBackToPaperButton; + }(_react.default.Component); + + exports.default = PagesBackToPaperButton; + PagesBackToPaperButton.propTypes = { + onPress: _propTypes.default.func.isRequired + }; +},2394,[5,7,8,12,14,16,17,201,28,2385,588,2395]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/newsmemory/pages-layout-manager/icons/v2", + "width": 128, + "height": 128, + "scales": [1], + "hash": "bce7a2aa9b8a82442d8021acd91fdbdf", + "name": "ic-back-to-paper", + "type": "png" + }); +},2395,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _pageViewComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _EPaperArticle = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Box = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _zoomViewPager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _zoomClickEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _pageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[23])); + + var _zoomConstants = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MIN_ZOOM = 1; + + var HorizontalPagesManager = function (_Shortcut) { + (0, _inherits2.default)(HorizontalPagesManager, _Shortcut); + + var _super = _createSuper(HorizontalPagesManager); + + function HorizontalPagesManager(props) { + var _this; + + (0, _classCallCheck2.default)(this, HorizontalPagesManager); + _this = _super.call(this, props); + _this._isRtl = _$$_REQUIRE(_dependencyMap[25]).PlatformUtils.isRTL(); + _this.pageRefs = []; + _this.pagesIndexMapping = _this._getIndexMapping(); + _this.viewPagerPosition = _this._getViewPagerIndexFromPageIndex(props.firstPage); + _this.firstRender = true; + _this.viewPagerScrolling = false; + _this.onSwipe = _this._onSwipe.bind((0, _assertThisInitialized2.default)(_this)); + _this.onExtraPress = _this._onExtraPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSingleTap = _this._onSingleTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onDoubleTap = _this._onDoubleTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTwoFingersTap = _this._onTwoFingersTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLongPress = _this._onLongPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSwipeOnLastPage = _this._onSwipeOnLastPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGestureEnd = _this._onGestureEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanBottomReached = _this._onPanBottomReached.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGestureStart = _this._onGestureStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFit = _this._onFit.bind((0, _assertThisInitialized2.default)(_this)); + _this.onUnFit = _this._onUnFit.bind((0, _assertThisInitialized2.default)(_this)); + _this.onToggleFit = _this._onToggleFit.bind((0, _assertThisInitialized2.default)(_this)); + _this.getPageDips = _this._getPageDips.bind((0, _assertThisInitialized2.default)(_this)); + _this.renderItem = _this._renderItem.bind((0, _assertThisInitialized2.default)(_this)); + _this.isTwoFingersTapEnabled = _this._isTwoFingersTapEnabled.bind((0, _assertThisInitialized2.default)(_this)); + _this.shortcutLeft = _this._shortcutLeft.bind((0, _assertThisInitialized2.default)(_this)); + _this.shortcutRight = _this._shortcutRight.bind((0, _assertThisInitialized2.default)(_this)); + _this.panToUp = _this._panToUp.bind((0, _assertThisInitialized2.default)(_this)); + _this.panToDown = _this._panToDown.bind((0, _assertThisInitialized2.default)(_this)); + _this.zoomIn = _this._zoomIn.bind((0, _assertThisInitialized2.default)(_this)); + _this.zoomOut = _this._zoomOut.bind((0, _assertThisInitialized2.default)(_this)); + _this.zoomInOut = _this._zoomInOut.bind((0, _assertThisInitialized2.default)(_this)); + var graphSize = global.getNewsmemoryConfig().getGraphSize(); + _this.state = { + graphSize: graphSize + }; + return _this; + } + + (0, _createClass2.default)(HorizontalPagesManager, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(HorizontalPagesManager.prototype), "componentDidMount", this).call(this); + this.configChangeListener = _$$_REQUIRE(_dependencyMap[26]).EventRegister.on(_events.default.NEWSMEMORY_CONFIG_CHANGE, function () { + var currentGraphSize = _this2.state.graphSize; + var graphSize = global.getNewsmemoryConfig().getGraphSize(); + + if (graphSize !== currentGraphSize) { + _this2.setState({ + graphSize: graphSize + }); + } + }); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var firstPage = nextProps.firstPage; + this.viewPagerPosition = this._getViewPagerIndexFromPageIndex(firstPage); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(HorizontalPagesManager.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[26]).EventRegister.rm(this.configChangeListener); + + var onUnmounted = this.props.onUnmounted; + + if (typeof onUnmounted === "function") { + onUnmounted(); + } + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var LEFT = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.LEFT, + RIGHT = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.RIGHT, + UP = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.UP, + DOWN = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.DOWN, + MORE = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.MORE, + LESS = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.LESS, + PAGE_UP = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.PAGE_UP, + PAGE_DOWN = _$$_REQUIRE(_dependencyMap[27]).KEY_GROUPS.PAGE_DOWN; + + return [{ + callbackRepeat: this.shortcutLeft, + keys: [].concat((0, _toConsumableArray2.default)(LEFT), (0, _toConsumableArray2.default)(PAGE_DOWN)) + }, { + callbackRepeat: this.shortcutRight, + keys: [].concat((0, _toConsumableArray2.default)(RIGHT), (0, _toConsumableArray2.default)(PAGE_UP)) + }, { + callbackRepeat: this.panToUp, + keys: UP + }, { + callbackRepeat: this.panToDown, + keys: DOWN + }, { + callbackRepeat: this.zoomIn, + keys: MORE + }, { + callbackRepeat: this.zoomOut, + keys: LESS + }]; + } + }, { + key: "_isTextModeOpen", + value: function _isTextModeOpen() { + var isTextModeOpen = this.props.isTextModeOpen; + + if (typeof isTextModeOpen === "function") { + return isTextModeOpen(); + } + + return false; + } + }, { + key: "_isReadMode", + value: function _isReadMode() { + var isReadMode = this.props.isReadMode; + + if (typeof isReadMode === "function") { + return isReadMode(); + } + + return false; + } + }, { + key: "_isTwoFingersTapEnabled", + value: function _isTwoFingersTapEnabled() { + var _global$getNewsmemory = global.getNewsmemoryConfig(), + twoFingersTapToArticle = _global$getNewsmemory.twoFingersTapToArticle; + + return twoFingersTapToArticle; + } + }, { + key: "_fixEventFromExtra", + value: function _fixEventFromExtra(event, page) { + var _this$props = this.props, + numberOfShowedPages = _this$props.numberOfShowedPages, + size = _this$props.size; + + if (event && page && numberOfShowedPages === 2) { + var clickedPageIndex = this._getPageIndexFromPage(page); + + var xToFix = _$$_REQUIRE(_dependencyMap[25]).PlatformUtils.isRTL() ? clickedPageIndex < this.viewPagerPosition : clickedPageIndex > this.viewPagerPosition; + + if (xToFix) { + event.x += size.width / 2; + } + } + + return event; + } + }, { + key: "_getIndexMapping", + value: function _getIndexMapping() { + var data = this.props.data; + var iMap = []; + + for (var i = 0; i < data.length; i++) { + var page = data[i]; + + if (page.isDoubleTruck()) { + iMap.push(i, i); + } else { + iMap.push(i); + } + } + + return iMap; + } + }, { + key: "_getPageIndexFromViewPagerIndex", + value: function _getPageIndexFromViewPagerIndex(viewPagerIndex) { + return this.pagesIndexMapping[viewPagerIndex]; + } + }, { + key: "_getViewPagerIndexFromPageIndex", + value: function _getViewPagerIndexFromPageIndex(pageIndex) { + return this.pagesIndexMapping.findIndex(function (item) { + return item === pageIndex; + }); + } + }, { + key: "_getPageIndexFromPage", + value: function _getPageIndexFromPage(page) { + var data = this.props.data; + var dataIndex = data.findIndex(function (item) { + return item.getPageId() === page.getPageId(); + }); + return this._getViewPagerIndexFromPageIndex(dataIndex); + } + }, { + key: "_getCurrentPage", + value: function _getCurrentPage() { + var data = this.props.data; + return data[this.pagesIndexMapping[this.viewPagerPosition]]; + } + }, { + key: "scrollTo", + value: function scrollTo(pageIndex) { + if (this.pagesViewPager) { + var viewPagerIndex = this._getViewPagerIndexFromPageIndex(pageIndex); + + var outOfWindow = viewPagerIndex < this.viewPagerPosition - 1 || viewPagerIndex > this.viewPagerPosition + 1; + var page = this.pageRefs[pageIndex]; + + if (page && outOfWindow) { + page.showLow(true); + } + + this.pagesViewPager.scrollTo(viewPagerIndex); + } + } + }, { + key: "_shortcutLeft", + value: function _shortcutLeft() { + return _regenerator.default.async(function _shortcutLeft$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!this.pagesViewPager) { + _context.next = 3; + break; + } + + if (this.pagesViewPager.isScaled()) { + this.pagesViewPager.panToLeft(); + } else { + this.scrollToPrev(); + } + + return _context.abrupt("return", this.getCallbackRepeatPromise(_zoomConstants.default.constants.ZOOM_TO_DURATION)); + + case 3: + return _context.abrupt("return", Promise.reject()); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_shortcutRight", + value: function _shortcutRight() { + return _regenerator.default.async(function _shortcutRight$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (!this.pagesViewPager) { + _context2.next = 3; + break; + } + + if (this.pagesViewPager.isScaled()) { + this.pagesViewPager.panToRight(); + } else { + this.scrollToNext(); + } + + return _context2.abrupt("return", this.getCallbackRepeatPromise(_zoomConstants.default.constants.ZOOM_TO_DURATION)); + + case 3: + return _context2.abrupt("return", Promise.reject()); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_panToUp", + value: function _panToUp() { + return _regenerator.default.async(function _panToUp$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + if (!this.pagesViewPager) { + _context3.next = 3; + break; + } + + this.pagesViewPager.panToUp(); + return _context3.abrupt("return", this.getCallbackRepeatPromise(_zoomConstants.default.constants.ZOOM_TO_DURATION)); + + case 3: + return _context3.abrupt("return", Promise.reject()); + + case 4: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_panToDown", + value: function _panToDown() { + return _regenerator.default.async(function _panToDown$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!this.pagesViewPager) { + _context4.next = 3; + break; + } + + this.pagesViewPager.panToDown(); + return _context4.abrupt("return", this.getCallbackRepeatPromise(_zoomConstants.default.constants.ZOOM_TO_DURATION)); + + case 3: + return _context4.abrupt("return", Promise.reject()); + + case 4: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_zoomInOut", + value: function _zoomInOut(zoomDiff) { + return _regenerator.default.async(function _zoomInOut$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + if (!this.pagesViewPager) { + _context5.next = 3; + break; + } + + this.pagesViewPager.zoomToCenter(zoomDiff); + return _context5.abrupt("return", this.getCallbackRepeatPromise()); + + case 3: + return _context5.abrupt("return", Promise.reject()); + + case 4: + case "end": + return _context5.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_zoomIn", + value: function _zoomIn() { + return _regenerator.default.async(function _zoomIn$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + return _context6.abrupt("return", this._zoomInOut(0.5)); + + case 1: + case "end": + return _context6.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_zoomOut", + value: function _zoomOut() { + return _regenerator.default.async(function _zoomOut$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + return _context7.abrupt("return", this._zoomInOut(-0.5)); + + case 1: + case "end": + return _context7.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "scrollToPrev", + value: function scrollToPrev() { + if (this.pagesViewPager) { + this.pagesViewPager.scrollToPrev(); + } + } + }, { + key: "scrollToNext", + value: function scrollToNext() { + if (this.pagesViewPager) { + this.pagesViewPager.scrollToNext(); + } + } + }, { + key: "_onExtraPress", + value: function _onExtraPress(event) { + var _this3 = this; + + var hasExtra = false; + + if (event) { + var _this$_getScaledCoord = this._getScaledCoordinates(event), + scale = _this$_getScaledCoord.scale, + viewIndex = _this$_getScaledCoord.viewIndex, + scaledCoordinates = _this$_getScaledCoord.scaledCoordinates; + + var page = this.pageRefs[viewIndex]; + var extraEvent = (0, _extends2.default)({}, scaledCoordinates, { + scale: scale + }); + hasExtra = page && page.hasExtraForEvent(extraEvent, function (extraType) { + var isOpenArticleExtra = extraType === _$$_REQUIRE(_dependencyMap[28]).PageExtraType.OPEN_ARTICLE; + + _this3._onPagePress(event, true, isOpenArticleExtra); + }); + } + + return hasExtra; + } + }, { + key: "_onSingleTap", + value: function _onSingleTap(event) { + var isSingleTapToZoomEnabled = this.props.isSingleTapToZoomEnabled; + + if (!this._isTwoFingersTapEnabled() || this._isTextModeOpen() || this._isReadMode()) { + this._onPagePress(event, true); + } else { + if (!isSingleTapToZoomEnabled()) { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_FOOTER_TOGGLE_VISIBILITY); + } + } + } + }, { + key: "_showTwoFingersTapHintIfNeeded", + value: function _showTwoFingersTapHintIfNeeded() { + var newsmemoryConfig = global.getNewsmemoryConfig(); + + if (this.isTwoFingersTapEnabled() && newsmemoryConfig && newsmemoryConfig.shouldShowTwoFingersTapHint()) { + _$$_REQUIRE(_dependencyMap[29]).Toast.show(global.strings("hint_two_fingers_tap"), 3000); + } + } + }, { + key: "_onDoubleTap", + value: function _onDoubleTap(event) { + var _this$props2 = this.props, + articleClose = _this$props2.articleClose, + newspaper = _this$props2.newspaper, + isSingleTapToZoomEnabled = _this$props2.isSingleTapToZoomEnabled; + var delegateZoom = false; + + if (event && newspaper) { + var edition = newspaper.getEditionModel(); + + var currentPage = this._getCurrentPage(); + + if (event.getScaledCoordinates) { + if (this._isTextModeOpen()) { + var scaledCoordinates = event.getScaledCoordinates(); + + var _this$_getPageCoordin = this._getPageCoordinates(scaledCoordinates), + coordinates = _this$_getPageCoordin.coordinates, + page = _this$_getPageCoordin.page; + + (0, _$$_REQUIRE(_dependencyMap[30]).sendNewsmemoryDoubleTapToZoomEvent)(edition, page); + + if (articleClose) { + articleClose(coordinates, page); + } + + currentPage = page; + delegateZoom = true; + } else if (event.scale === 1 && isSingleTapToZoomEnabled()) { + this._showTwoFingersTapHintIfNeeded(); + } + } else {} + + if (event.scale === 1) { + (0, _$$_REQUIRE(_dependencyMap[30]).sendNewsmemoryDoubleTapToZoomEvent)(edition, currentPage); + } + } + + return delegateZoom; + } + }, { + key: "_onTwoFingersTap", + value: function _onTwoFingersTap(event) { + var isTwoFingersTapEnabled = this._isTwoFingersTapEnabled(); + + var newsmemoryConfig = global.getNewsmemoryConfig(); + + if (isTwoFingersTapEnabled) { + newsmemoryConfig.disableTwoFingersTapHint(); + } + + if (isTwoFingersTapEnabled || this._isTextModeOpen() || this._isReadMode()) { + this._onPagePress(event, true, true); + } + } + }, { + key: "_onLongPress", + value: function _onLongPress(event) { + var skipSelection = false; + var onPageLongPress = this.props.onPageLongPress; + + if (typeof onPageLongPress === "function") { + skipSelection = onPageLongPress(event); + } + + var _global$getActivePSet = global.getActivePSetup(), + previewHighlightEnabled = _global$getActivePSet.previewHighlightEnabled; + + if (previewHighlightEnabled && event) { + var eventIndex = event.getIndex(); + + if (eventIndex !== undefined) { + var data = this.props.data; + var clickedPageIndex = this.pagesIndexMapping[eventIndex]; + var page = data[clickedPageIndex]; + + if (page) { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_SHOW_EXTRA, { + page: page + }); + + if (!skipSelection) { + this._onPagePress(event); + } + } + } + } + } + }, { + key: "_onSwipe", + value: function _onSwipe(event) { + var _this4 = this; + + var index = event.index, + visibleAreas = event.visibleAreas, + isScrolling = event.isScrolling, + scale = event.scale; + + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_CLEAR_HIGH_RES_QUEUE); + + if (index !== this.viewPagerPosition || isScrolling !== this.viewPagerScrolling || this.firstRender) { + var pagesIndex = visibleAreas.map(function (area) { + return _this4.pagesIndexMapping[area.index]; + }); + var _this$props3 = this.props, + onPageChange = _this$props3.onPageChange, + renderedPagesOffset = _this$props3.renderedPagesOffset, + renderedLowPagesOffset = _this$props3.renderedLowPagesOffset, + data = _this$props3.data, + numberOfShowedPages = _this$props3.numberOfShowedPages, + getCurrentArticle = _this$props3.getCurrentArticle; + var lowLeft = []; + var lowRight = []; + var mid = []; + var pageIndex = this.pagesIndexMapping[index]; + var startRenderOffset; + var endRenderOffset; + + if (this._isRtl) { + startRenderOffset = Math.max(0, pageIndex - numberOfShowedPages - renderedPagesOffset + 1); + endRenderOffset = Math.min(pageIndex + renderedPagesOffset + 1, data.length); + } else { + startRenderOffset = Math.max(0, pageIndex - renderedPagesOffset); + endRenderOffset = Math.min(pageIndex + numberOfShowedPages + renderedPagesOffset, data.length); + } + + var startRenderLowOffset = Math.max(0, startRenderOffset - renderedLowPagesOffset); + var endRenderLowOffset = Math.min(endRenderOffset + renderedLowPagesOffset, data.length); + + var _global$getActivePSet2 = global.getActivePSetup(), + loadMidResOnScroll = _global$getActivePSet2.loadMidResOnScroll; + + var swipeRight = index > this.viewPagerPosition; + + if (swipeRight) { + for (var i = pageIndex; i < endRenderOffset; i++) { + if ((loadMidResOnScroll || !isScrolling) && this.pageRefs[i] && !pagesIndex.includes(i)) { + this.pageRefs[i].show(!isScrolling); + } + + if (data[i]) { + mid.push(data[i].getPageId()); + } + } + + for (var _i = endRenderOffset; _i < endRenderLowOffset; _i++) { + if (this.pageRefs[_i] && !pagesIndex.includes(_i)) { + this.pageRefs[_i].showLow(!isScrolling); + } + + if (data[_i]) { + lowRight.push(data[_i].getPageId()); + } + } + + for (var _i2 = pageIndex - 1; _i2 >= startRenderOffset; _i2--) { + if (!isScrolling && this.pageRefs[_i2] && !pagesIndex.includes(_i2)) { + this.pageRefs[_i2].show(!isScrolling); + } + + if (data[_i2]) { + mid.push(data[_i2].getPageId()); + } + } + + for (var _i3 = startRenderOffset - 1; _i3 >= startRenderLowOffset; _i3--) { + if (!isScrolling && this.pageRefs[_i3] && !pagesIndex.includes(_i3)) { + this.pageRefs[_i3].showLow(!isScrolling); + } + + if (data[_i3]) { + lowLeft.push(data[_i3].getPageId()); + } + } + } else { + for (var _i4 = pageIndex; _i4 >= startRenderOffset; _i4--) { + if ((loadMidResOnScroll || !isScrolling) && this.pageRefs[_i4] && !pagesIndex.includes(_i4)) { + this.pageRefs[_i4].show(!isScrolling); + } + + if (data[_i4]) { + mid.push(data[_i4].getPageId()); + } + } + + for (var _i5 = startRenderOffset - 1; _i5 >= startRenderLowOffset; _i5--) { + if (this.pageRefs[_i5] && !pagesIndex.includes(_i5)) { + this.pageRefs[_i5].showLow(!isScrolling); + } + + if (data[_i5]) { + lowLeft.push(data[_i5].getPageId()); + } + } + + for (var _i6 = pageIndex + 1; _i6 < endRenderOffset; _i6++) { + if (!isScrolling && this.pageRefs[_i6] && !pagesIndex.includes(_i6)) { + this.pageRefs[_i6].show(!isScrolling); + } + + if (data[_i6]) { + mid.push(data[_i6].getPageId()); + } + } + + for (var _i7 = endRenderOffset; _i7 < endRenderLowOffset; _i7++) { + if (!isScrolling && this.pageRefs[_i7] && !pagesIndex.includes(_i7)) { + this.pageRefs[_i7].showLow(!isScrolling); + } + + if (data[_i7]) { + lowRight.push(data[_i7].getPageId()); + } + } + } + + for (var _i8 = 0; _i8 < data.length; _i8++) { + if ((_i8 < startRenderLowOffset || _i8 > endRenderLowOffset) && this.pageRefs[_i8]) { + this.pageRefs[_i8].hide(); + } + } + + var currentArticle = getCurrentArticle(); + var nextPageIndex = this.pagesIndexMapping[index + 1]; + + if (numberOfShowedPages === 2 && currentArticle && nextPageIndex) { + var articlePageId = currentArticle.getPageId(); + var rightPageId = data[nextPageIndex].getPageId(); + + if (articlePageId === rightPageId) { + pageIndex = nextPageIndex; + } + } + + var pagesInfo = this._getVisiblePagesInfo(index); + + var isZoomed = scale > MIN_ZOOM; + + this._updateWhiteMargin(pagesInfo, numberOfShowedPages); + + onPageChange(Math.max(0, pageIndex), mid, isScrolling, isZoomed, pagesInfo); + this.firstRender = false; + + var currentPage = this._getCurrentPage(); + + if (currentPage) { + var currentPageRef = this.pageRefs[pageIndex]; + + if (numberOfShowedPages === 1 && this.viewPagerPosition !== index) { + if (currentPageRef) { + if (currentPage.isDoubleTruck() && currentPage.isProtected()) { + if (swipeRight) { + currentPageRef.changeLoginOverlayPosition(_pageUtils.PageViewPosition.RIGHT); + } else { + currentPageRef.changeLoginOverlayPosition(_pageUtils.PageViewPosition.LEFT); + } + } else if (data[pageIndex] && data[pageIndex].isDoubleTruck() && data[pageIndex].isProtected()) { + if (swipeRight) { + currentPageRef.changeLoginOverlayPosition(_pageUtils.PageViewPosition.LEFT); + } else { + currentPageRef.changeLoginOverlayPosition(_pageUtils.PageViewPosition.RIGHT); + } + } + } + } else if (numberOfShowedPages === 2) { + if (currentPage.isDoubleTruck()) { + if (currentPageRef && currentPage.isProtected()) { + currentPageRef.changeLoginOverlayPosition(_pageUtils.PageViewPosition.CENTER); + } + } else if (nextPageIndex && this.pageRefs[nextPageIndex] && data[nextPageIndex] && data[nextPageIndex].isDoubleTruck()) { + this.pageRefs[nextPageIndex].changeLoginOverlayPosition(_pageUtils.PageViewPosition.LEFT); + } + } + } + } + + this.viewPagerPosition = index; + this.viewPagerScrolling = isScrolling; + } + }, { + key: "_updateWhiteMargin", + value: function _updateWhiteMargin(pagesInfo, numberOfShowedPages) { + if (this.pagesViewPager && pagesInfo) { + var marginLeftDivider = 1; + var marginRightDivider = 1; + + if (numberOfShowedPages === 1) { + if (pagesInfo.left && pagesInfo.left.page && pagesInfo.left.page.isDoubleTruck()) { + if (pagesInfo.left.isDTRightSide) { + marginLeftDivider = 2; + } else { + marginRightDivider = 2; + } + } + } else { + if (pagesInfo.left && pagesInfo.left.page && pagesInfo.left.page.isDoubleTruck() && pagesInfo.left.isDTRightSide) { + marginLeftDivider = 2; + } + + if (pagesInfo.right && pagesInfo.right.page && pagesInfo.right.page.isDoubleTruck() && !pagesInfo.right.isDTRightSide) { + marginRightDivider = 2; + } + } + + this.pagesViewPager.reduceMargins(marginLeftDivider, marginRightDivider); + } + } + }, { + key: "_getVisiblePagesInfo", + value: function _getVisiblePagesInfo(index) { + var _this$props4 = this.props, + numberOfShowedPages = _this$props4.numberOfShowedPages, + data = _this$props4.data; + var result; + + if (numberOfShowedPages === 1) { + var pageIndex = this.pagesIndexMapping[index]; + var previousPageIndex = this.pagesIndexMapping[index - 1]; + var isDTRightSide = pageIndex === previousPageIndex; + var page = data[pageIndex]; + result = { + left: { + isDTRightSide: isDTRightSide, + page: page + } + }; + } else { + var previousLeftPageIndex = this.pagesIndexMapping[this._isRtl ? index - 2 : index - 1]; + var leftPageIndex = this.pagesIndexMapping[Math.max(0, this._isRtl ? index - 1 : index)]; + var rightPageIndex = this.pagesIndexMapping[this._isRtl ? index : index + 1]; + var isRightPageDTRightSide = leftPageIndex === rightPageIndex; + var isLeftPageDTRightSide = previousLeftPageIndex === leftPageIndex; + var leftPage = data[leftPageIndex]; + var rightPage = data[rightPageIndex]; + result = { + left: { + isDTRightSide: isLeftPageDTRightSide, + page: leftPage + }, + right: { + isDTRightSide: isRightPageDTRightSide, + page: rightPage + } + }; + } + + return result; + } + }, { + key: "_onSwipeOnLastPage", + value: function _onSwipeOnLastPage() { + var newspaper = this.props.newspaper; + + if (newspaper && newspaper.getEditionModel() && newspaper.getEditionModel().hasSpecialSections) { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_OPEN_SPECIAL_SECTION); + } + } + }, { + key: "_onGestureEnd", + value: function _onGestureEnd(event) { + var _this5 = this; + + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_RESTART_HIGH_RES_QUEUE); + + if (event) { + var _this$props5 = this.props, + onScaleChange = _this$props5.onScaleChange, + onPanChange = _this$props5.onPanChange; + var isScrolling = event.isScrolling, + isPan = event.isPan, + isPinch = event.isPinch, + scale = event.scale, + visibleAreas = event.visibleAreas, + x = event.x, + y = event.y; + + if (!isScrolling) { + var isZoomed = scale > MIN_ZOOM; + + if (isPan) { + if (!this.lastPanCoordinates || !_$$_REQUIRE(_dependencyMap[25]).JSUtils.areEqualShallow({ + x: x, + y: y + }, this.lastPanCoordinates)) { + onPanChange(isZoomed, visibleAreas); + } + + this.lastPanCoordinates = { + x: x, + y: y + }; + } else { + onScaleChange(isZoomed, scale, isPinch); + } + + var nativeEvent = event.nativeEvent; + var _width = nativeEvent._width; + var visibleAreasMapped = visibleAreas.map(function (pageEvent) { + return (0, _extends2.default)({}, pageEvent, { + pageId: _this5.pagesIndexMapping[pageEvent.index] + }); + }); + + for (var i = 0; i < visibleAreasMapped.length - 1; i++) { + for (var j = i + 1; j < visibleAreasMapped.length; j++) { + if (visibleAreasMapped[i] && visibleAreasMapped[j]) { + if (visibleAreasMapped[i].pageId === visibleAreasMapped[j].pageId) { + visibleAreasMapped[i].y = Math.min(visibleAreasMapped[i].y, visibleAreasMapped[j].y); + var right = Math.max(visibleAreasMapped[i].x + visibleAreasMapped[i].width, visibleAreasMapped[j].x + visibleAreasMapped[j].width + _width); + var bottom = Math.max(visibleAreasMapped[i].y + visibleAreasMapped[i].height, visibleAreasMapped[j].y + visibleAreasMapped[j].height); + visibleAreasMapped[i].width = right - visibleAreasMapped[i].x; + visibleAreasMapped[i].height = bottom - visibleAreasMapped[i].y; + visibleAreasMapped[j] = undefined; + } + } + } + } + + var mergedAreas = visibleAreasMapped.filter(function (item) { + return item !== undefined; + }); + + for (var k = 0; k < mergedAreas.length; k++) { + var pageEvent = mergedAreas[k]; + var previousPageIndex = this.pagesIndexMapping[pageEvent.index - 1]; + var pageIndex = pageEvent.pageId; + var isDTRightSide = previousPageIndex === pageIndex; + + if (isDTRightSide) { + pageEvent.x += _width; + } + + if (this.pageRefs[pageIndex]) { + this.pageRefs[pageIndex].showHr((0, _extends2.default)({ + scale: scale, + downloadIfMissing: true + }, pageEvent)); + + if (k === mergedAreas.length - 1) { + this.pageRefs[pageIndex].hideBorder(); + } + } + } + } + } + } + }, { + key: "_onGestureStart", + value: function _onGestureStart() { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_VIEWPAGER_GESTURE_START); + + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_PAUSE_HIGH_RES_QUEUE); + + var data = this.props.data; + + for (var i = 0; i < data.length; i++) { + if (this.pageRefs[i]) { + this.pageRefs[i].showBorder(); + } + } + } + }, { + key: "_onUnFit", + value: function _onUnFit() { + var currentPage = this._getCurrentPage(); + + if (currentPage) { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_SHOW_NAVIGATION_BUTTONS, { + pageId: currentPage.getPageId(), + visible: true + }); + } else {} + } + }, { + key: "_onFit", + value: function _onFit() { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_FOOTER_BUTTON_HIDE); + + var currentPage = this._getCurrentPage(); + + if (currentPage) { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_SHOW_NAVIGATION_BUTTONS, { + pageId: currentPage.getPageId(), + visible: false + }); + } else {} + } + }, { + key: "_onPanBottomReached", + value: function _onPanBottomReached() { + _$$_REQUIRE(_dependencyMap[26]).EventRegister.emit(_events.default.NEWSMEMORY_FOOTER_BUTTON_HIDE); + } + }, { + key: "_onToggleFit", + value: function _onToggleFit() { + var onUnFit = this.props.onUnFit; + + if (typeof onUnFit === "function") { + onUnFit(); + } + } + }, { + key: "_getPageCoordinates", + value: function _getPageCoordinates(_ref) { + var x = _ref.x, + y = _ref.y, + width = _ref.width, + height = _ref.height, + index = _ref.index; + var data = this.props.data; + var page = data[this.pagesIndexMapping[index]]; + return { + coordinates: { + x: x, + y: y, + width: width, + height: height, + index: index + }, + page: page + }; + } + }, { + key: "_getScaledCoordinates", + value: function _getScaledCoordinates(event) { + if (event.getScaledCoordinates) { + var scaledCoordinates = event.getScaledCoordinates(); + var eventIndex = event.getIndex(); + + if (eventIndex !== undefined) { + var data = this.props.data; + var clickedPageIndexPrevious = this.pagesIndexMapping[eventIndex - 1]; + var clickedPageIndex = this.pagesIndexMapping[eventIndex]; + var clickedPage = data[clickedPageIndex]; + + if (clickedPage !== undefined) { + var isDoubleTruck = clickedPage.isDoubleTruck(); + var isDoubleTruckRightSide = isDoubleTruck && clickedPageIndexPrevious === clickedPageIndex; + var pageRef = this.pageRefs[clickedPageIndex]; + + if (pageRef && pageRef.margins && pageRef.margins.top) { + scaledCoordinates.y -= pageRef.margins.top * event.getScale(); + } + + var newspaper = this.props.newspaper; + var edition = newspaper && newspaper.getEditionModel(); + + var realPageSize = _newsmemoryUtils.default.getPageSize(edition, clickedPage); + + var realPageRatio = clickedPage.isDoubleTruck() ? 2 : 1; + var scaledCoordinatesRatio = parseFloat((scaledCoordinates.width / scaledCoordinates.height).toFixed(2)); + var realPageSizeRatio = parseFloat((realPageSize.pageWidth / realPageRatio / realPageSize.pageHeight).toFixed(2)); + + if (scaledCoordinatesRatio > realPageSizeRatio) { + var fixRatio = scaledCoordinates.height / clickedPage.getFrameHeight(); + scaledCoordinates.width = realPageSize.pageWidth / realPageRatio * fixRatio; + scaledCoordinates.height = realPageSize.pageHeight * fixRatio; + } + + if (isDoubleTruckRightSide) { + scaledCoordinates.x += scaledCoordinates.width; + } + + if (clickedPage.isDoubleTruck()) { + scaledCoordinates.width *= 2; + } + } + + return { + scale: event.getScale(), + scaledCoordinates: scaledCoordinates, + clickedPage: clickedPage, + index: eventIndex, + viewIndex: clickedPageIndex + }; + } + } + + return {}; + } + }, { + key: "_onPagePress", + value: function _onPagePress(event) { + var open = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var disableZoomCheck = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (event) { + if (disableZoomCheck || !event.isGreaterThanFit()) { + var _this$_getScaledCoord2 = this._getScaledCoordinates(event), + scaledCoordinates = _this$_getScaledCoord2.scaledCoordinates, + clickedPage = _this$_getScaledCoord2.clickedPage; + + if (scaledCoordinates && clickedPage) { + var found = clickedPage.getArticles().find(function (article) { + var boxes = article.getBoxes(); + var boxFound = boxes.find(function (box) { + var boxSize = _newsmemoryUtils.default.getHrStyle(box, article.getBoxesInfo(), { + width: scaledCoordinates.width, + height: scaledCoordinates.height + }, true); + + return _$$_REQUIRE(_dependencyMap[25]).JSUtils.rectContainsPoint(boxSize, scaledCoordinates); + }); + return boxFound !== undefined; + }); + + if (found) { + var topBox = found.getTopCoordinate(); + + if (topBox) { + var topBoxSize = _newsmemoryUtils.default.getHrStyle(topBox, found.getBoxesInfo(), { + width: scaledCoordinates.width, + height: scaledCoordinates.height + }, true); + + scaledCoordinates.y = topBoxSize.top; + } + + if (!found.isHidden()) { + var onArticlePress = this.props.onArticlePress; + onArticlePress(found, (0, _extends2.default)({}, scaledCoordinates, { + disableZoomFactor: true + }), open); + } else {} + } + } else {} + } else { + this._showTwoFingersTapHintIfNeeded(); + } + } else {} + } + }, { + key: "_getPageDips", + value: function _getPageDips() { + var data = this.props.data; + + var page = data[this._getPageIndexFromViewPagerIndex(this.viewPagerPosition)]; + + return _newsmemoryUtils.default.getHorizontalPageDips(page); + } + }, { + key: "_needToShowBorderOnPage", + value: function _needToShowBorderOnPage(page) { + var newspaper = this.props.newspaper; + + if (newspaper && page) { + if (page.isDoubleTruck() || _pageUtils.default.getPageNumberFromPage(page.getPage()) % 2 === 1) { + return true; + } + + var nextPage = _pageUtils.default.getNextPage(page, newspaper.getPages()); + + if (nextPage) { + return _pageUtils.default.getSectionLetterFromPage(page.getPage()) !== _pageUtils.default.getSectionLetterFromPage(nextPage.getPage()); + } + } + + return false; + } + }, { + key: "_renderItem", + value: function _renderItem(_ref2) { + var _this6 = this; + + var item = _ref2.item, + pageIndex = _ref2.index, + slotSize = _ref2.slotSize, + viewSize = _ref2.viewSize; + + var _global$getActivePSet3 = global.getActivePSetup(), + pdfThumbnailRatio = _global$getActivePSet3.pdfThumbnailRatio; + + var scaledPdfThumbnailRatio = pdfThumbnailRatio; + var _this$props6 = this.props, + numberOfShowedPages = _this$props6.numberOfShowedPages, + isLandscape = _this$props6.isLandscape, + newspaper = _this$props6.newspaper, + navigation = _this$props6.navigation, + getCurrentArticle = _this$props6.getCurrentArticle, + fitPageHorizontally = _this$props6.fitPageHorizontally, + textSize = _this$props6.textSize, + highlightEnabled = _this$props6.highlightEnabled; + + if (!fitPageHorizontally) { + var edition = newspaper && newspaper.getEditionModel(); + + var _NewsmemoryUtils$getP = _newsmemoryUtils.default.getPageSizeFixed(edition, item), + pageWidth = _NewsmemoryUtils$getP.pageWidth; + + var scaleFit = 1; + + if (item.isDoubleTruck()) { + scaleFit = viewSize.width / (pageWidth / 2); + } else { + scaleFit = viewSize.width / pageWidth; + } + + scaledPdfThumbnailRatio += scaleFit < 1 ? 1 - scaleFit : scaleFit - 1; + } + + var mappedIndex = this._getViewPagerIndexFromPageIndex(pageIndex); + + var isCurrentPage = pageIndex === this.pagesIndexMapping[this.viewPagerPosition]; + var currentViewPagerIndexIsEven = this.viewPagerPosition % 2 === 0; + var isViewPagerIndexLeft = numberOfShowedPages === 2 && currentViewPagerIndexIsEven ? mappedIndex + 1 === this.viewPagerPosition : false; + var isViewPagerIndexRight = numberOfShowedPages === 2 && (!currentViewPagerIndexIsEven || mappedIndex === 1) ? mappedIndex - 1 === this.viewPagerPosition : false; + var isVisible = isViewPagerIndexLeft || isCurrentPage || isViewPagerIndexRight; + + var showBorder = this._needToShowBorderOnPage(item); + + var loginOverlayPosition = _pageUtils.PageViewPosition.CENTER; + + if (item.isDoubleTruck() && numberOfShowedPages === 1) { + loginOverlayPosition = _pageUtils.PageViewPosition.LEFT; + } + + return _react.default.createElement(_pageViewComponent.default, { + ref: function ref(_ref3) { + _this6.pageRefs[pageIndex] = _ref3; + }, + onMounted: function onMounted() { + if (_this6.firstRender && isCurrentPage) { + setTimeout(function () { + if (_this6.pagesViewPager) { + _this6.pagesViewPager.zoomToClickedPosition(); + } + }, 300); + } + }, + key: item.getPageId(), + newspaper: newspaper, + page: item, + pdfThumbnailRatio: Math.max(scaledPdfThumbnailRatio, pdfThumbnailRatio), + navigation: navigation, + getCurrentArticle: getCurrentArticle, + showOnlyLow: !isVisible, + isVisible: isVisible, + hidePage: !isVisible, + slotSize: slotSize, + size: viewSize, + textSize: textSize, + isLandscape: isLandscape, + showBorder: showBorder, + loginOverlayPosition: loginOverlayPosition, + highlightEnabled: highlightEnabled + }); + } + }, { + key: "_getSnapSize", + value: function _getSnapSize() { + var _this$props7 = this.props, + data = _this$props7.data, + size = _this$props7.size, + fitPageHorizontally = _this$props7.fitPageHorizontally, + numberOfShowedPages = _this$props7.numberOfShowedPages; + var firstPage = data[0]; + var left; + var snapDivider = 10; + + if (firstPage) { + try { + try { + var right; + firstPage.getArticles().forEach(function (article) { + if (article.isText()) { + article.getBoxes().forEach(function (box) { + var boxHr = _newsmemoryUtils.default.getHrStyle(box, article.getBoxesInfo(), size, true); + + if (left === undefined || left > boxHr.start) { + left = boxHr.start; + } + + if (right === undefined || right > size.width - (boxHr.start + boxHr.width)) { + right = size.width - (boxHr.start + boxHr.width); + } + }); + } + }); + left = _$$_REQUIRE(_dependencyMap[25]).JSUtils.min(left, right); + } catch (e) {} + + var pageViewSize = _newsmemoryUtils.default.getPageViewSize(firstPage, size, fitPageHorizontally, numberOfShowedPages); + + var scaledWidth = 0; + + if (pageViewSize) { + scaledWidth = pageViewSize.scaledWidth; + } + + if (!_$$_REQUIRE(_dependencyMap[25]).JSUtils.isNumber(left)) { + left = scaledWidth / snapDivider; + } + + left = _$$_REQUIRE(_dependencyMap[25]).JSUtils.min(scaledWidth / snapDivider, left); + } catch (e) {} + } + + left = _$$_REQUIRE(_dependencyMap[25]).JSUtils.min(left, size.width / 4); + return left; + } + }, { + key: "render", + value: function render() { + var _this7 = this; + + var _this$props8 = this.props, + data = _this$props8.data, + size = _this$props8.size, + numberOfShowedPages = _this$props8.numberOfShowedPages, + fitPageHorizontally = _this$props8.fitPageHorizontally, + isSingleTapToZoomEnabled = _this$props8.isSingleTapToZoomEnabled, + initialEvent = _this$props8.initialEvent, + onLoaded = _this$props8.onLoaded; + var firstPage = data[0]; + + var pageViewSize = _newsmemoryUtils.default.getPageViewSize(firstPage, size, fitPageHorizontally, numberOfShowedPages); + + if (pageViewSize) { + var scaledWidth = pageViewSize.scaledWidth, + scaledHeight = pageViewSize.scaledHeight, + maxZoom = pageViewSize.maxZoom; + + var graphUserScaleFactor = _newsmemoryUtils.default.getZoomingFactor(); + + return _react.default.createElement(_zoomViewPager.default, { + ref: function ref(_ref4) { + _this7.pagesViewPager = _ref4; + }, + isRtl: this._isRtl, + size: size, + contentSize: { + width: scaledWidth, + height: scaledHeight + }, + data: data, + fitX: fitPageHorizontally, + nPages: this.pagesIndexMapping.length, + numberOfShowedPages: numberOfShowedPages, + initialPage: this.viewPagerPosition, + minScale: MIN_ZOOM, + maxScale: maxZoom * graphUserScaleFactor, + dipsScale: this.getPageDips, + snapSize: this._getSnapSize(), + zoomingFactor: graphUserScaleFactor, + singleTapToZoom: isSingleTapToZoomEnabled, + twoFingerTapEnabled: this.isTwoFingersTapEnabled, + onPageChange: this.onSwipe, + onGestureStart: this.onGestureStart, + onGestureEnd: this.onGestureEnd, + onPanBottomReached: this.onPanBottomReached, + onFit: this.onFit, + onUnFit: this.onUnFit, + onToggleFit: this.onToggleFit, + onExtraTap: this.onExtraPress, + onSingleTap: this.onSingleTap, + onDoubleTap: this.onDoubleTap, + onTwoFingersTap: this.onTwoFingersTap, + onLongPress: this.onLongPress, + onSwipeOnLastPage: this.onSwipeOnLastPage, + clickPosition: initialEvent, + isTablet: _$$_REQUIRE(_dependencyMap[25]).PlatformUtils.isTablet(), + renderItem: this.renderItem, + spinnerColor: _newsmemoryUtils.default.getSpinnerColor(), + cssContainerClasses: ["newsmemory-pages-container"], + onLoaded: onLoaded + }); + } + + return null; + } + }]); + return HorizontalPagesManager; + }(_$$_REQUIRE(_dependencyMap[31]).Shortcut); + + exports.default = HorizontalPagesManager; + HorizontalPagesManager.propTypes = (0, _extends2.default)({ + data: _propTypes.default.arrayOf(_propTypes.default.instanceOf(_Page.default)), + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + textSize: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + firstPage: _propTypes.default.number, + onLoaded: _propTypes.default.func.isRequired, + onUnmounted: _propTypes.default.func.isRequired, + onPageChange: _propTypes.default.func.isRequired, + onPageLongPress: _propTypes.default.func.isRequired, + onArticlePress: _propTypes.default.func.isRequired, + onUnFit: _propTypes.default.func.isRequired, + onScaleChange: _propTypes.default.func.isRequired, + onPanChange: _propTypes.default.func.isRequired, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }).isRequired, + renderedPagesOffset: _propTypes.default.number, + renderedLowPagesOffset: _propTypes.default.number, + numberOfShowedPages: _propTypes.default.number, + fitPageHorizontally: _propTypes.default.bool, + getCurrentArticle: _propTypes.default.func.isRequired, + isTextModeOpen: _propTypes.default.func, + isReadMode: _propTypes.default.func, + isSingleTapToZoomEnabled: _propTypes.default.func, + articleClose: _propTypes.default.func, + initialEvent: _propTypes.default.object, + isLandscape: _propTypes.default.bool, + highlightEnabled: _propTypes.default.bool + }, _$$_REQUIRE(_dependencyMap[31]).Shortcut.propTypes); + HorizontalPagesManager.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[31]).Shortcut.defaultProps, { + firstPage: 0, + renderedPagesOffset: 2, + renderedLowPagesOffset: 3, + numberOfShowedPages: 1, + initialEvent: undefined + }); +},2396,[5,80,6,21,7,8,15,90,12,14,16,17,201,638,2397,640,641,603,460,1859,2407,2413,714,715,2165,462,572,1873,639,1889,1954,1911]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _pageViewComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _pageImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _pageTextComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _pageHighlightComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _pageExtraComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _adOverPage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _pageBorderView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _loginOverlay = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _morseView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PageView = function (_React$Component) { + (0, _inherits2.default)(PageView, _React$Component); + + var _super = _createSuper(PageView); + + function PageView(props) { + var _this; + + (0, _classCallCheck2.default)(this, PageView); + _this = _super.call(this, props); + _this.state = { + hidePage: props.hidePage, + showHR: props.showHR, + showOnlyLow: props.showOnlyLow, + zoom: props.zoom, + visibleArea: { + top: 0, + left: 0, + width: props.size.width, + height: props.size.height + }, + downloadIfMissing: props.downloadIfMissing + }; + _this.status = { + low: false, + lowDownloading: false, + lowDownloadAttempts: 0, + graph: false, + graphDownloading: false, + graphDownloadAttempts: 0, + text: false, + textDownloading: false, + textDownloadAttempts: 0, + hr: false + }; + _this.downloadMissingResource = _this._downloadMissingResource.bind((0, _assertThisInitialized2.default)(_this)); + _this.onBorderRef = _this._onBorderRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onExtraRef = _this._onExtraRef.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(PageView, [{ + key: "componentDidMount", + value: function componentDidMount() { + var onMounted = this.props.onMounted; + + if (typeof onMounted === "function") { + onMounted(); + } + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + return !_$$_REQUIRE(_dependencyMap[24]).JSUtils.equals(nextProps, this.props) || !_$$_REQUIRE(_dependencyMap[24]).JSUtils.equals(nextState, this.state); + } + }, { + key: "_getPositionStyle", + value: function _getPositionStyle(start, top) { + return { + start: start / 2, + end: start / 2, + top: top / 2, + bottom: top / 2 + }; + } + }, { + key: "showHr", + value: function showHr(params) { + var x = params.x, + scale = params.scale, + downloadIfMissing = params.downloadIfMissing, + width = params.width, + height = params.height; + var y = params.y; + + var _this$_getFitCoordina = this._getFitCoordinates(), + top = _this$_getFitCoordina.top; + + y -= top / 2; + var _this$state = this.state, + hidePage = _this$state.hidePage, + showOnlyLow = _this$state.showOnlyLow, + showHR = _this$state.showHR, + zoom = _this$state.zoom, + visibleArea = _this$state.visibleArea; + var visibleAreaChanged = visibleArea.top !== y || visibleArea.left !== x || visibleArea.width !== width || visibleArea.height !== height; + var scaleChanged = zoom !== scale; + var layerChanged = hidePage || showOnlyLow || !showHR; + + if (layerChanged || scaleChanged || visibleAreaChanged) { + this.setState({ + hidePage: false, + showOnlyLow: false, + showHR: true, + zoom: scale, + visibleArea: { + top: y, + left: x, + width: width, + height: height + }, + downloadIfMissing: downloadIfMissing + }); + } + } + }, { + key: "showLow", + value: function showLow(downloadIfMissing) { + var _this$state2 = this.state, + hidePage = _this$state2.hidePage, + showHR = _this$state2.showHR, + showOnlyLow = _this$state2.showOnlyLow, + prevDownloadIfMissing = _this$state2.downloadIfMissing; + + if (hidePage || showHR || showOnlyLow && !prevDownloadIfMissing && downloadIfMissing) { + this.setState({ + hidePage: false, + showHR: false, + showOnlyLow: true, + downloadIfMissing: downloadIfMissing === undefined ? prevDownloadIfMissing : downloadIfMissing + }); + } + } + }, { + key: "show", + value: function show(downloadIfMissing) { + var _this$state3 = this.state, + hidePage = _this$state3.hidePage, + showHR = _this$state3.showHR, + showOnlyLow = _this$state3.showOnlyLow, + prevDownloadIfMissing = _this$state3.downloadIfMissing; + + if (hidePage || showHR || showOnlyLow || !showOnlyLow && !prevDownloadIfMissing && downloadIfMissing) { + this.setState({ + hidePage: false, + showHR: false, + showOnlyLow: false, + downloadIfMissing: downloadIfMissing === undefined ? prevDownloadIfMissing : downloadIfMissing + }); + } + } + }, { + key: "hide", + value: function hide() { + var hidePage = this.state.hidePage; + + if (!hidePage) { + this.setState({ + hidePage: true, + showHR: false, + showOnlyLow: false + }); + } + } + }, { + key: "showBorder", + value: function showBorder() { + var hidePage = this.state.hidePage; + + if (!hidePage && this.borderRef) { + this.borderRef.show(); + } + } + }, { + key: "hideBorder", + value: function hideBorder() { + var hidePage = this.state.hidePage; + + if (!hidePage && this.borderRef) { + this.borderRef.hide(); + } + } + }, { + key: "hasExtraForEvent", + value: function hasExtraForEvent(event, defaultCallback) { + if (this.extraRef) { + return this.extraRef.hasExtraForEvent(event, defaultCallback); + } + + return false; + } + }, { + key: "_onExtraRef", + value: function _onExtraRef(ref) { + this.extraRef = ref; + } + }, { + key: "_onBorderRef", + value: function _onBorderRef(ref) { + this.borderRef = ref; + } + }, { + key: "_showEinkCompleteHighResolution", + value: function _showEinkCompleteHighResolution(pageSize) { + var _global$getActivePSet = global.getActivePSetup(), + einkCompleteHrFactor = _global$getActivePSet.einkCompleteHrFactor; + + return !_$$_REQUIRE(_dependencyMap[24]).PlatformUtils.isEInk() || this._showByFactor(pageSize, einkCompleteHrFactor); + } + }, { + key: "_showHighResolution", + value: function _showHighResolution(pageSize) { + var _global$getActivePSet2 = global.getActivePSetup(), + hrFactor = _global$getActivePSet2.hrFactor; + + return this._showByFactor(pageSize, hrFactor); + } + }, { + key: "_showPdf", + value: function _showPdf(pageSize) { + var isLandscape = this.props.isLandscape; + + var _global$getActivePSet3 = global.getActivePSetup(), + pdfFactor = _global$getActivePSet3.pdfFactor, + pdfFactorLandscape = _global$getActivePSet3.pdfFactorLandscape; + + return this._showByFactor(pageSize, isLandscape ? pdfFactorLandscape : pdfFactor); + } + }, { + key: "_showByFactor", + value: function _showByFactor(pageSize, factor) { + var _this$props = this.props, + newspaper = _this$props.newspaper, + page = _this$props.page, + size = _this$props.size, + textSize = _this$props.textSize, + isLandscape = _this$props.isLandscape; + var _this$state4 = this.state, + zoom = _this$state4.zoom, + showHR = _this$state4.showHR; + var multiplier = page.isDoubleTruck() ? 2 : 1; + var pagesViewWidth = size.width; + + if (isLandscape && textSize) { + pagesViewWidth += textSize.width; + } + + var resolutionFactor = Math.ceil(pageSize.width) * zoom / (pagesViewWidth * multiplier); + resolutionFactor = parseFloat(resolutionFactor.toFixed(1)); + var isContentWidthEnough = resolutionFactor >= factor; + + if (_newsmemoryUtils.default.isModeLow(newspaper && newspaper.getDbNetwork()) || !_$$_REQUIRE(_dependencyMap[24]).PlatformUtils.isTablet()) { + isContentWidthEnough = resolutionFactor > factor; + } + + return showHR && isContentWidthEnough; + } + }, { + key: "_getFitInfo", + value: function _getFitInfo(width, height, pageWidth, pageHeight) { + var scale; + var fitProp; + var scaleX = pageWidth > 0 ? width / pageWidth : 1; + var scaleY = pageHeight > 0 ? height / pageHeight : 1; + + if (scaleX < scaleY) { + scale = scaleX; + fitProp = { + width: width + }; + } else { + scale = scaleY; + fitProp = { + height: height + }; + } + + return { + scale: scale, + fitProp: fitProp + }; + } + }, { + key: "_getFitCoordinates", + value: function _getFitCoordinates() { + var _this$props2 = this.props, + size = _this$props2.size, + slotSize = _this$props2.slotSize, + page = _this$props2.page, + newspaper = _this$props2.newspaper; + var edition = newspaper && newspaper.getEditionModel(); + + var _NewsmemoryUtils$getP = _newsmemoryUtils.default.getPageSizeFixed(edition, page), + pageWidth = _NewsmemoryUtils$getP.pageWidth, + pageHeight = _NewsmemoryUtils$getP.pageHeight; + + var pageSize = (0, _extends2.default)({}, slotSize); + + if (page.isDoubleTruck()) { + pageSize.width *= 2; + } + + var viewSize = (0, _extends2.default)({}, pageSize); + + var _this$_getFitInfo = this._getFitInfo(pageSize.width, pageSize.height, pageWidth, pageHeight), + scale = _this$_getFitInfo.scale, + fitProp = _this$_getFitInfo.fitProp; + + var scaledHeight = pageHeight * scale; + var scaledWidth = pageWidth * scale; + var start = Math.max(pageSize.width - scaledWidth, 0); + var top = 0; + + if (scaledHeight < size.height) { + top = size.height - scaledHeight; + } else if (scaledHeight < pageSize.height) { + top = 0; + } else { + top = pageSize.height - scaledHeight; + } + + return { + start: start, + top: Math.max(top, 0), + scaledHeight: scaledHeight, + scaledWidth: scaledWidth, + scale: scale, + fitProp: fitProp, + viewSize: viewSize, + pageSize: pageSize, + pageWidth: pageWidth, + pageHeight: pageHeight + }; + } + }, { + key: "checkDownloadStatus", + value: function checkDownloadStatus() { + var page = this.props.page; + + var lowFailed = this.status.lowDownloadAttempts === _$$_REQUIRE(_dependencyMap[25]).MAX_DOWNLOAD_ATTEMPTS; + + var graphFailed = this.status.graphDownloadAttempts === _$$_REQUIRE(_dependencyMap[25]).MAX_DOWNLOAD_ATTEMPTS; + + var textFailed = this.status.textDownloadAttempts === _$$_REQUIRE(_dependencyMap[25]).MAX_DOWNLOAD_ATTEMPTS; + + if (page.getLowImage() || lowFailed) { + this.status.low = true; + this.status.lowDownloading = false; + + if (page.getGraphImage() && page.getTextImage()) { + this.status.hr = true; + this.status.graph = true; + this.status.text = true; + } else { + if (!page.getTextImage()) { + if (!this.status.textDownloading && !textFailed) { + this.status.textDownloading = this._downloadMissingResource(_$$_REQUIRE(_dependencyMap[26]).EPaperImageType.TEXT); + this.status.textDownloadAttempts += 1; + } + } else { + this.status.text = true; + this.status.textDownloading = false; + } + + if (!page.getGraphImage()) { + if (!this.status.graphDownloading && !graphFailed) { + this.status.graphDownloading = this._downloadMissingResource(_$$_REQUIRE(_dependencyMap[26]).EPaperImageType.GRAPH); + this.status.graphDownloadAttempts += 1; + } + } else { + this.status.graph = true; + this.status.graphDownloading = false; + } + } + } else if (!this.status.lowDownloading) { + this.status.lowDownloading = this._downloadMissingResource(_$$_REQUIRE(_dependencyMap[26]).EPaperImageType.LOW); + this.status.lowDownloadAttempts += 1; + } + + return this.status; + } + }, { + key: "_downloadMissingResource", + value: function _downloadMissingResource(type) { + var _this2 = this; + + var page = this.props.page; + var downloadIfMissing = this.state.downloadIfMissing; + + if (downloadIfMissing) { + _$$_REQUIRE(_dependencyMap[27]).EventRegister.emit(_events.default.NEWSMEMORY_REQUEST_DOWNLOAD_IMAGE, { + pageId: page.getPageId(), + pageFileName: page.getFilename(), + type: type, + callback: function callback() { + return _this2.forceUpdate(); + } + }); + + return true; + } + + return false; + } + }, { + key: "changeLoginOverlayPosition", + value: function changeLoginOverlayPosition(position) { + var page = this.props.page; + + if (this.loginOverlayRef && page.isDoubleTruck()) { + this.loginOverlayRef.changeContainerStyle(position); + } + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$props3 = this.props, + showOnlyMid = _this$props3.showOnlyMid, + newspaper = _this$props3.newspaper, + page = _this$props3.page, + navigation = _this$props3.navigation, + getCurrentArticle = _this$props3.getCurrentArticle, + pdfThumbnailRatio = _this$props3.pdfThumbnailRatio, + forceHighlight = _this$props3.forceHighlight, + showBorder = _this$props3.showBorder, + highlightEnabled = _this$props3.highlightEnabled, + loginOverlayPosition = _this$props3.loginOverlayPosition; + var _this$state5 = this.state, + showHR = _this$state5.showHR, + hidePage = _this$state5.hidePage, + showOnlyLow = _this$state5.showOnlyLow, + zoom = _this$state5.zoom, + visibleArea = _this$state5.visibleArea, + downloadIfMissing = _this$state5.downloadIfMissing; + + var _global$getActivePSet4 = global.getActivePSetup(), + loginStatus = _global$getActivePSet4.loginStatus, + morseTAUID = _global$getActivePSet4.morseTAUID; + + var _this$_getFitCoordina2 = this._getFitCoordinates(), + start = _this$_getFitCoordina2.start, + top = _this$_getFitCoordina2.top, + scaledHeight = _this$_getFitCoordina2.scaledHeight, + scaledWidth = _this$_getFitCoordina2.scaledWidth, + fitProp = _this$_getFitCoordina2.fitProp, + viewSize = _this$_getFitCoordina2.viewSize, + pageSize = _this$_getFitCoordina2.pageSize; + + pageSize.width = scaledWidth; + pageSize.height = scaledHeight; + this.margins = this._getPositionStyle(start, top); + + var showHighResolution = this._showHighResolution(pageSize); + + var showEinkCompleteHighResolution = this._showEinkCompleteHighResolution(pageSize); + + var showPdf = this._showPdf(pageSize); + + var children = null; + + if (!hidePage) { + children = []; + + var _this$checkDownloadSt = this.checkDownloadStatus(), + low = _this$checkDownloadSt.low, + graph = _this$checkDownloadSt.graph, + text = _this$checkDownloadSt.text, + hr = _this$checkDownloadSt.hr; + + if (low) { + children.push(_react.default.createElement(_pageImage.default, (0, _extends2.default)({ + key: "low", + type: _$$_REQUIRE(_dependencyMap[26]).EPaperImageType.LOW, + page: page, + style: [_pageViewComponent.default.page, pageSize] + }, fitProp))); + + if (!showOnlyLow) { + if (graph) { + children.push(_react.default.createElement(_pageImage.default, (0, _extends2.default)({ + key: "graph", + type: _$$_REQUIRE(_dependencyMap[26]).EPaperImageType.GRAPH, + page: page, + style: [_pageViewComponent.default.page, pageSize] + }, fitProp))); + } + + if (text && newspaper) { + children.push(_react.default.createElement(_pageTextComponent.default, { + key: "hr", + pdfThumbnailRatio: pdfThumbnailRatio, + showHr: !showOnlyMid && showHighResolution && hr, + showEinkHr: showEinkCompleteHighResolution, + showPdf: !showOnlyMid && showPdf, + newspaper: newspaper, + page: page, + size: pageSize, + visibleArea: visibleArea, + zoom: zoom, + style: [_pageViewComponent.default.page, pageSize], + enablePNGGeneration: downloadIfMissing, + fitProp: fitProp + })); + } + } + + if (morseTAUID && newspaper) { + children.push(_react.default.createElement(_morseView.default, { + key: "morse", + edition: newspaper.getEditionModel(), + page: page, + zoom: zoom, + style: [_pageViewComponent.default.page, pageSize] + })); + } + + if ((!showOnlyMid && !showOnlyLow || forceHighlight) && highlightEnabled) { + children.push(_react.default.createElement(_pageHighlightComponent.default, { + key: "highlight", + size: pageSize, + style: [_pageViewComponent.default.page, pageSize], + page: page, + getCurrentArticle: getCurrentArticle + })); + } + + if (!showOnlyMid && !showOnlyLow && newspaper) { + children.push(_react.default.createElement(_pageExtraComponent.default, { + key: "extra", + ref: this.onExtraRef, + navigation: navigation, + edition: newspaper.getEditionModel(), + size: pageSize, + pageSize: pageSize, + zoom: zoom, + style: [_pageViewComponent.default.page, pageSize], + page: page, + getCurrentArticle: getCurrentArticle + })); + } + + if (showHR && !showOnlyMid) { + children.push(_react.default.createElement(_adOverPage.default, { + key: "adOverPage", + page: page, + style: [_pageViewComponent.default.page, pageSize] + })); + } + + if (page.isProtected()) { + var width = pageSize.width, + height = pageSize.height; + var containerWidth = page.isDoubleTruck() ? width / 2 : width; + children.push(_react.default.createElement(_reactNative.View, { + style: _pageViewComponent.default.page, + key: "loginOverlay" + }, _react.default.createElement(_loginOverlay.default, { + ref: function ref(_ref) { + _this3.loginOverlayRef = _ref; + }, + style: { + width: width, + height: height, + position: "absolute" + }, + containerStyle: { + width: containerWidth + }, + containerPosition: loginOverlayPosition, + title: global.strings("msg_access_reserved"), + showLogin: !loginStatus.isLoggedIn() + }))); + } + + if (showBorder) { + children.push(_react.default.createElement(_pageBorderView.default, { + key: "border", + ref: this.onBorderRef, + style: { + height: pageSize.height + } + })); + } + } + } + + return _react.default.createElement(_reactNative.View, { + style: [viewSize, this.margins, _pageViewComponent.default.parent] + }, children); + } + }]); + return PageView; + }(_react.default.Component); + + exports.default = PageView; + PageView.propTypes = { + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + textSize: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + slotSize: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + showHR: _propTypes.default.bool, + showOnlyLow: _propTypes.default.bool, + showOnlyMid: _propTypes.default.bool, + hidePage: _propTypes.default.bool, + zoom: _propTypes.default.number, + pdfThumbnailRatio: _propTypes.default.number, + position: _propTypes.default.string, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }), + getCurrentArticle: _propTypes.default.func, + onMounted: _propTypes.default.func, + isLandscape: _propTypes.default.bool, + forceHighlight: _propTypes.default.bool, + downloadIfMissing: _propTypes.default.bool, + showBorder: _propTypes.default.bool, + highlightEnabled: _propTypes.default.bool, + loginOverlayPosition: _propTypes.default.string + }; + PageView.defaultProps = { + showHR: false, + hidePage: false, + showOnlyLow: false, + showOnlyMid: false, + forceHighlight: false, + zoom: 1, + downloadIfMissing: true, + highlightEnabled: true, + position: _$$_REQUIRE(_dependencyMap[28]).PageViewPosition.CENTER, + showBorder: false, + loginOverlayPosition: _$$_REQUIRE(_dependencyMap[28]).PageViewPosition.CENTER + }; +},2397,[5,6,7,8,15,12,14,16,17,201,28,638,2398,2399,2400,2403,2169,603,714,460,2404,2405,2180,2406,462,586,587,572,715]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + parent: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent + }, + page: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent, + position: "absolute", + top: 0, + start: 0, + end: 0, + bottom: 0 + }, + loginOverlayButtonParent: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + loginOverlayButton: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.black + } + }); + + exports.default = _default; +},2398,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PageImage = function (_React$PureComponent) { + (0, _inherits2.default)(PageImage, _React$PureComponent); + + var _super = _createSuper(PageImage); + + function PageImage() { + (0, _classCallCheck2.default)(this, PageImage); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(PageImage, [{ + key: "render", + value: function render() { + var _this$props = this.props, + page = _this$props.page, + type = _this$props.type, + showProp = _this$props.show, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["page", "type", "show"]); + + var baseLocalPath = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(); + + var image = page.getImageByType(type); + + if (image) { + var path = baseLocalPath + "/" + image.getBase64(); + var source = { + uri: "file://" + path + }; + var patch = {}; + + if (_$$_REQUIRE(_dependencyMap[13]).PlatformUtils.isIOS() && image.isTextGIF()) { + patch.defaultSource = source; + } + + return _react.default.createElement(_imageComponent.default, (0, _extends2.default)({ + key: path, + source: source + }, patch, { + resizeMode: "stretch", + resizeMethod: "scale" + }, rest)); + } + + return type === _EPaperImage.EPaperImageType.LOW ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ProgressCircle, null) : null; + } + }]); + return PageImage; + }(_react.default.PureComponent); + + exports.default = PageImage; + PageImage.propTypes = { + show: _propTypes.default.bool, + page: _propTypes.default.object, + type: _propTypes.default.string + }; + PageImage.defaultProps = { + show: true + }; +},2399,[5,6,108,7,8,12,14,16,17,201,587,574,588,462,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _pdfComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _pageImage = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _pageHrComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FADE_ANIMATION_DURATION = 100; + + var PageText = function (_React$Component) { + (0, _inherits2.default)(PageText, _React$Component); + + var _super = _createSuper(PageText); + + function PageText(props) { + var _this; + + (0, _classCallCheck2.default)(this, PageText); + _this = _super.call(this, props); + _this.pngRequested = false; + _this.pngFade = new _reactNative.Animated.Value(1); + _this.pdfFade = new _reactNative.Animated.Value(0.01); + _this.onPdfDrawn = _this._onPdfDrawn.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + showPng: true, + forcePdf: false, + enablePNGGeneration: props.enablePNGGeneration + }; + return _this; + } + + (0, _createClass2.default)(PageText, [{ + key: "componentDidUpdate", + value: function componentDidUpdate() { + var showPdf = this.props.showPdf; + var showPng = this.state.showPng; + + if (showPng && !showPdf && this.animations) { + this.animations.stop(); + this.animations = undefined; + } + + if (!this.animations) { + var needToShowPng = showPng || !showPdf; + var pngFadeValue = needToShowPng ? 1 : 0; + var pdfFadeValue = showPng ? 0.01 : 1; + this.pngFade.setValue(pngFadeValue); + this.pdfFade.setValue(pdfFadeValue); + } + } + }, { + key: "_askPNGGeneration", + value: function _askPNGGeneration() { + var _this2 = this; + + var enablePNGGeneration = this.state.enablePNGGeneration; + + if (enablePNGGeneration && !this.pngRequested) { + var _this$props = this.props, + newspaper = _this$props.newspaper, + page = _this$props.page; + + _$$_REQUIRE(_dependencyMap[19]).EventRegister.emit(_events.default.NEWSMEMORY_GENERATE_PNG, { + issue: newspaper.getIssue(), + edition: newspaper.getEdition(), + pageId: page.getPageId(), + pageFileName: page.getFilename(), + callback: function callback(image) { + _this2.pngRequested = false; + + if (image) { + _this2.forceUpdate(); + } else { + _this2.attempt += 1; + + if (_this2.attempt < _$$_REQUIRE(_dependencyMap[20]).MAX_PNG_GENERATION_ATTEMPTS) { + _this2._askPNGGeneration(); + } else { + _this2.setState({ + showPng: false, + forcePdf: true + }); + } + } + } + }); + + this.pngRequested = true; + } + } + }, { + key: "_onPdfDrawn", + value: function _onPdfDrawn() { + var _this3 = this; + + var _this$props2 = this.props, + page = _this$props2.page, + showPdf = _this$props2.showPdf; + var _this$state = this.state, + showPng = _this$state.showPng, + forcePdf = _this$state.forcePdf; + + if (showPng && (showPdf || forcePdf) && !this.animations) { + var animations = []; + animations.push(_reactNative.Animated.timing(this.pngFade, { + toValue: 0, + duration: FADE_ANIMATION_DURATION, + useNativeDriver: true + })); + animations.push(_reactNative.Animated.timing(this.pdfFade, { + toValue: 1, + duration: FADE_ANIMATION_DURATION, + useNativeDriver: true + })); + this.animations = _reactNative.Animated.parallel(animations); + this.animations.start(function (_ref) { + var finished = _ref.finished; + + if (finished) { + _this3.animations = undefined; + + _this3.setState({ + showPng: false + }); + } + }); + } + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$state2 = this.state, + showPng = _this$state2.showPng, + forcePdf = _this$state2.forcePdf; + var _this$props3 = this.props, + visibleArea = _this$props3.visibleArea, + showPdf = _this$props3.showPdf, + showHr = _this$props3.showHr, + zoom = _this$props3.zoom, + newspaper = _this$props3.newspaper, + page = _this$props3.page, + fitWidth = _this$props3.fitWidth, + style = _this$props3.style, + size = _this$props3.size, + pdfThumbnailRatio = _this$props3.pdfThumbnailRatio, + fitProp = _this$props3.fitProp; + + var baseLocalPath = _tecnaviaFileUtils.default.getNewsmemoryBaseDirectory(); + + var textImage = page.getTextImage(); + var pngImage = page.getPNGImage(); + var edition = newspaper && newspaper.getEditionModel(); + var children = []; + var displayPng = pngImage && showPng; + var displayPdf = textImage && textImage.isTextPDF() && (showPdf || forcePdf); + var displayGif = textImage && textImage.isTextGIF(); + var generatePng = !displayPdf && !displayGif && showPng && !pngImage; + + if (generatePng) { + this._askPNGGeneration(); + } + + if (displayGif) { + children.push(_react.default.createElement(_pageImage.default, (0, _extends2.default)({ + key: "gif", + type: _EPaperImage.EPaperImageType.TEXT, + page: page, + style: style, + visibleArea: visibleArea + }, fitProp))); + } + + if (showHr && newspaper) { + children.push(_react.default.createElement(_pageHrComponent.default, { + ref: function ref(_ref2) { + _this4.hrRef = _ref2; + }, + key: "hr", + size: size, + fitWidth: fitWidth, + style: style, + newspaper: newspaper, + issue: edition.getIssue(), + page: page, + visibleArea: visibleArea + })); + } + + if (displayPng) { + children.push(_react.default.createElement(_reactNative.Animated.View, { + key: "png", + style: { + opacity: this.pngFade + } + }, _react.default.createElement(_pageImage.default, (0, _extends2.default)({ + ref: function ref(_ref3) { + _this4.pngRef = _ref3; + }, + type: _EPaperImage.EPaperImageType.PNG, + page: page, + style: style + }, fitProp)))); + } + + if (displayPdf) { + children.push(_react.default.createElement(_reactNative.Animated.View, { + key: "pdf", + style: { + opacity: this.pdfFade + } + }, _react.default.createElement(_pdfComponent.default, { + ref: function ref(_ref4) { + _this4.pdfRef = _ref4; + }, + size: size, + zoom: zoom, + thumbnailRatio: pdfThumbnailRatio, + enableThumbnail: true, + visibleArea: visibleArea, + onPdfDrawn: this.onPdfDrawn, + path: baseLocalPath + "/" + textImage.getBase64(), + style: style + }))); + } + + if (global.isLayoutDebug) { + children.push(_react.default.createElement(_reactNative.View, { + style: (0, _extends2.default)({ + position: "absolute" + }, visibleArea, { + borderWidth: 2, + borderColor: "#00F" + }) + })); + } + + return _react.default.createElement(_reactNative.View, { + style: style + }, children); + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(props, state) { + var needToShowPng = state.showPng || !props.showPdf; + var newState = { + showPng: needToShowPng, + enablePNGGeneration: props.enablePNGGeneration + }; + return newState; + } + }]); + return PageText; + }(_react.default.Component); + + exports.default = PageText; + PageText.propTypes = { + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + zoom: _propTypes.default.number, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + fitWidth: _propTypes.default.bool, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array, _propTypes.default.number]), + pdfThumbnailRatio: _propTypes.default.number, + showHr: _propTypes.default.bool, + showPdf: _propTypes.default.bool, + fitProp: _propTypes.default.object, + visibleArea: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number, + top: _propTypes.default.number, + left: _propTypes.default.number + }), + enablePNGGeneration: _propTypes.default.bool + }; +},2400,[5,6,7,8,15,12,14,16,17,201,2401,28,638,587,2399,460,2402,574,714,572,586]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PdfComponent; + + var Pdf = function (_React$Component) { + (0, _inherits2.default)(Pdf, _React$Component); + + var _super = _createSuper(Pdf); + + function Pdf(props) { + var _this; + + (0, _classCallCheck2.default)(this, Pdf); + _this = _super.call(this, props); + _this.pdfComponentName = _reactNative.Platform.select({ + android: "RCTPdf", + ios: "RCTPdfView" + }); + + if (!PdfComponent) { + PdfComponent = (0, _reactNative.requireNativeComponent)(_this.pdfComponentName, Pdf, { + nativeOnly: { + path: true, + onChange: true + } + }); + } + + _this.onPdfLoaded = _this._onPdfLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPdfError = _this._onPdfError.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPdfDrawn = _this._onPdfDrawn.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(Pdf, [{ + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps) { + var _this$props = this.props, + zoom = _this$props.zoom, + size = _this$props.size, + visibleArea = _this$props.visibleArea; + + if (nextProps.zoom !== zoom) { + return true; + } + + if (!_$$_REQUIRE(_dependencyMap[12]).JSUtils.areEqualShallow(nextProps.size, size)) { + return true; + } + + if (!_$$_REQUIRE(_dependencyMap[12]).JSUtils.areEqualShallow(nextProps.visibleArea, visibleArea)) { + return true; + } + + return false; + } + }, { + key: "_onPdfLoaded", + value: function _onPdfLoaded() { + var onPdfLoaded = this.props.onPdfLoaded; + + if (typeof onPdfLoaded === "function") { + onPdfLoaded(); + } + } + }, { + key: "_onPdfError", + value: function _onPdfError() { + var onPdfError = this.props.onPdfError; + + if (typeof onPdfError === "function") { + onPdfError(); + } + } + }, { + key: "_onPdfDrawn", + value: function _onPdfDrawn() { + var onPdfDrawn = this.props.onPdfDrawn; + + if (typeof onPdfDrawn === "function") { + onPdfDrawn(); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props2 = this.props, + onPdfLoaded = _this$props2.onPdfLoaded, + onPdfError = _this$props2.onPdfError, + onPdfDrawn = _this$props2.onPdfDrawn, + visibleArea = _this$props2.visibleArea, + scale = _this$props2.zoom, + rest = (0, _objectWithoutProperties2.default)(_this$props2, ["onPdfLoaded", "onPdfError", "onPdfDrawn", "visibleArea", "zoom"]); + return _react.default.createElement(PdfComponent, (0, _extends2.default)({ + ref: function ref(component) { + _this2._root = component; + } + }, rest, { + scale: scale, + offsetX: visibleArea.left || 0, + offsetY: visibleArea.top || 0, + visibleWidth: visibleArea.width || 0, + visibleHeight: visibleArea.height || 0, + onPdfLoaded: this.onPdfLoaded, + onPdfError: this.onPdfError, + onPdfDrawn: this.onPdfDrawn + })); + } + }]); + return Pdf; + }(_react.default.Component); + + exports.default = Pdf; + Pdf.propTypes = (0, _extends2.default)({}, _reactNative.ViewPropTypes, { + thumbnailRatio: _propTypes.default.number, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }), + visibleArea: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number, + top: _propTypes.default.number, + left: _propTypes.default.number + }), + path: _propTypes.default.string, + asset: _propTypes.default.string, + page: _propTypes.default.number, + zoom: _propTypes.default.number, + onLayout: _propTypes.default.bool, + isDoubleTruck: _propTypes.default.bool, + blackAndWhite: _propTypes.default.bool, + onPdfDrawn: _propTypes.default.func, + onPdfError: _propTypes.default.func, + onPdfLoaded: _propTypes.default.func, + enableThumbnail: _propTypes.default.bool + }); + Pdf.defaultProps = { + zoom: 1, + page: 0, + thumbnailRatio: 1, + blackAndWhite: false, + enableThumbnail: false + }; +},2401,[5,6,108,7,8,15,12,14,16,17,201,28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _EPaperImage = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _hrContainerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PageHr = function (_React$Component) { + (0, _inherits2.default)(PageHr, _React$Component); + + var _super = _createSuper(PageHr); + + function PageHr(props) { + var _this; + + (0, _classCallCheck2.default)(this, PageHr); + _this = _super.call(this, props); + + _this._updateBoxes(props); + + return _this; + } + + (0, _createClass2.default)(PageHr, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + this._updateBoxes(nextProps); + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps) { + var currentVisibleArea = this.props.visibleArea; + return !_$$_REQUIRE(_dependencyMap[16]).JSUtils.equals(nextProps.visibleArea, currentVisibleArea); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[17]).EventRegister.emit(_events.default.NEWSMEMORY_CLEAR_HIGH_RES_QUEUE); + } + }, { + key: "_getHrScale", + value: function _getHrScale(props) { + if (this.data && this.data.length > 0) { + var size = props.size, + fitWidth = props.fitWidth; + return _newsmemoryUtils.default.getHrScale(this.data[0].boxesInfo, size, fitWidth); + } + + return 1; + } + }, { + key: "_updateBoxes", + value: function _updateBoxes(props) { + this.data = _newsmemoryUtils.default.allPageArticlesHrImages(props.page, props.showAll); + this.hrScale = this._getHrScale(props); + this.visibleBoxes = this._getVisibleBoxes(props); + } + }, { + key: "_boxIntersectVisibleArea", + value: function _boxIntersectVisibleArea(visibleArea, box) { + var top = visibleArea.top, + left = visibleArea.left, + width = visibleArea.width, + height = visibleArea.height; + return !(box.start >= left + width || box.start + box.width <= left || box.top >= top + height || box.top + box.height <= top); + } + }, { + key: "_getVisibleBoxes", + value: function _getVisibleBoxes(props) { + var _this2 = this; + + var boxesToRender = []; + var visibleArea = props.visibleArea; + + if (this.data) { + this.data.forEach(function (item) { + var xmlId = item.xmlId, + boxes = item.boxes, + boxesInfo = item.boxesInfo; + boxes.forEach(function (boxItem) { + var box = boxItem.box, + graph = boxItem.graph, + text = boxItem.text; + + var boxStyle = _newsmemoryUtils.default.getHrStyle(box, boxesInfo); + + var coordinates = { + top: boxStyle.top * _this2.hrScale, + start: boxStyle.start * _this2.hrScale, + width: boxStyle.width * _this2.hrScale, + height: boxStyle.height * _this2.hrScale + }; + + if (!visibleArea || _this2._boxIntersectVisibleArea(visibleArea, coordinates)) { + boxesToRender.push({ + key: "hr_" + xmlId + "_" + box.getId(), + boxStyle: boxStyle, + useImageDimensions: _newsmemoryUtils.default.isBorderBoxToFix(box, boxesInfo), + xmlId: xmlId, + boxId: box.getId(), + path: graph ? graph.getBase64() : undefined, + pathText: text ? text.getBase64() : undefined + }); + } + }); + }); + } + + return boxesToRender; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + issue = _this$props.issue, + page = _this$props.page, + style = _this$props.style, + visibleArea = _this$props.visibleArea, + newspaper = _this$props.newspaper, + _this$props$hrProps = _this$props.hrProps, + hrProps = _this$props$hrProps === undefined ? {} : _this$props$hrProps, + size = _this$props.size; + var textImage = page.getImageByType(_EPaperImage.EPaperImageType.TEXT); + var hasGif = textImage && textImage.isTextGIF(); + var hrZip = page.getHrZip(); + var translateFactor = (this.hrScale - 1) / 2; + var translateX = size.width * translateFactor; + var translateY = size.height * translateFactor; + return _react.default.createElement(_reactNative.View, { + style: [style, { + transform: [{ + translateX: translateX + }, { + translateY: translateY + }, { + scale: this.hrScale + }] + }] + }, this.visibleBoxes.map(function (item) { + var boxStyle = item.boxStyle, + boxId = item.boxId, + xmlId = item.xmlId, + useImageDimensions = item.useImageDimensions; + var commonProps = (0, _extends2.default)({ + style: [{ + position: "absolute" + }, boxStyle], + issue: issue, + newspaper: newspaper, + page: page, + edition: page.getEdition(), + pageId: page.getPageId(), + boxId: boxId, + xmlId: xmlId, + zipGraphArchivePath: hrZip ? hrZip.getBase64() : undefined, + useImageDimensions: useImageDimensions + }, hrProps); + var borderColor = boxId % 2 === 0 ? "#FD0" : "#0FD"; + + if (useImageDimensions) { + borderColor = "#F00"; + } + + return _react.default.createElement(_react.default.Fragment, { + key: "fragment_" + item.key + }, _react.default.createElement(_hrContainerComponent.default, (0, _extends2.default)({ + item: item, + showAll: hasGif + }, commonProps)), global.isLayoutDebug ? _react.default.createElement(_reactNative.View, { + style: [{ + borderWidth: 1, + borderColor: borderColor, + zIndex: 10 + }, commonProps.style] + }, _react.default.createElement(_reactNative.Text, { + style: { + fontSize: 10, + textAlign: "center" + } + }, xmlId + "_" + boxId)) : null); + }), global.isLayoutDebug ? _react.default.createElement(_reactNative.View, { + style: (0, _extends2.default)({ + position: "absolute" + }, visibleArea, { + borderWidth: 3, + borderColor: page.getPageId() % 2 ? "#00F" : "#0F0", + zIndex: 30 + }) + }) : null); + } + }]); + return PageHr; + }(_react.default.Component); + + exports.default = PageHr; + PageHr.propTypes = { + issue: _propTypes.default.string.isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }).isRequired, + fitWidth: _propTypes.default.bool, + visibleArea: _propTypes.default.object, + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + showAll: _propTypes.default.bool, + hrProps: _propTypes.default.shape((0, _extends2.default)({}, _hrContainerComponent.default.propTypes, { + item: _propTypes.default.object, + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]) + })) + }; + PageHr.defaultProps = { + showAll: true + }; +},2402,[5,6,7,8,12,14,16,17,201,28,638,603,460,714,587,2167,462,572]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _reactNativeSvg = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _Box = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _newsmemoryExtraUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _ExtraLinks = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[16])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PageHighlight = function (_React$PureComponent) { + (0, _inherits2.default)(PageHighlight, _React$PureComponent); + + var _super = _createSuper(PageHighlight); + + function PageHighlight(props) { + var _this; + + (0, _classCallCheck2.default)(this, PageHighlight); + _this = _super.call(this, props); + + var backgroundColor = _this._getBackgroundColor(); + + _this.onArticleChange = _this._onArticleChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRemoveHighlight = _this._onRemoveHighlight.bind((0, _assertThisInitialized2.default)(_this)); + _this.isArticleOnCurrentPage = _this._isArticleOnCurrentPage.bind((0, _assertThisInitialized2.default)(_this)); + var article = props.getCurrentArticle(); + _this.opacity = new _reactNative.Animated.Value(1); + _this.state = { + article: article, + backgroundColor: backgroundColor, + hasOpenArticleExtras: _this._hasOpenArticleExtra(article) + }; + return _this; + } + + (0, _createClass2.default)(PageHighlight, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.articleChangeListener = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.NEWSMEMORY_ARTICLE_HIGHLIGHT, this.onArticleChange); + this.removeListener = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.NEWSMEMORY_REMOVE_HIGHLIGHT, this.onRemoveHighlight); + this.configChangeListener = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.NEWSMEMORY_CONFIG_CHANGE, function (_ref) { + var previousConfig = _ref.previousConfig; + + if (_this2.isArticleOnCurrentPage()) { + var prevBackgroundTimerArticleSelected = previousConfig.backgroundTimerArticleSelected; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + backgroundTimerArticleSelected = _global$getNewsmemory.backgroundTimerArticleSelected; + + if (prevBackgroundTimerArticleSelected !== backgroundTimerArticleSelected) { + if (backgroundTimerArticleSelected > 0) { + _this2._timingToHideHighlight(); + } else { + _this2.opacity.setValue(1); + } + } + } + }); + + if (this.isArticleOnCurrentPage()) { + this._timingToHideHighlight(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.articleChangeListener); + + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.removeListener); + + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.configChangeListener); + + if (this.timeoutId) { + clearTimeout(this.timeoutId); + } + } + }, { + key: "_isArticleOnCurrentPage", + value: function _isArticleOnCurrentPage(articleToCheck) { + var page = this.props.page; + var article = this.state.article; + var currentArticle = articleToCheck || article; + return currentArticle && page && currentArticle.getPageId() === page.getPageId(); + } + }, { + key: "_timingToHideHighlight", + value: function _timingToHideHighlight() { + var _this3 = this; + + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + backgroundTimerArticleSelected = _global$getNewsmemory2.backgroundTimerArticleSelected, + backgroundDurationArticleSelected = _global$getNewsmemory2.backgroundDurationArticleSelected; + + this.opacity.setValue(1); + + if (backgroundTimerArticleSelected) { + if (this.timeoutId) { + clearTimeout(this.timeoutId); + } + + this.timeoutId = setTimeout(function () { + _this3.timeoutId = undefined; + + _reactNative.Animated.timing(_this3.opacity, { + toValue: 0, + useNativeDriver: true, + duration: backgroundDurationArticleSelected + }).start(); + }, backgroundTimerArticleSelected); + } + } + }, { + key: "_getBackgroundColor", + value: function _getBackgroundColor(toSelect) { + var _global$getActivePSet = global.getActivePSetup(), + backgroundColorArticleSelected = _global$getActivePSet.backgroundColorArticleSelected, + backgroundColorArticleToSelect = _global$getActivePSet.backgroundColorArticleToSelect; + + var bgColorToUse = toSelect ? backgroundColorArticleToSelect : backgroundColorArticleSelected; + return _$$_REQUIRE(_dependencyMap[19]).StringUtils.parseColor(bgColorToUse, _$$_REQUIRE(_dependencyMap[19]).colors.articleHighlight); + } + }, { + key: "_onRemoveHighlight", + value: function _onRemoveHighlight() { + var article = this.state.article; + + if (article) { + var backgroundColor = this._getBackgroundColor(); + + this.setState({ + article: undefined, + backgroundColor: backgroundColor, + hasOpenArticleExtras: false + }); + } + } + }, { + key: "_hasOpenArticleExtra", + value: function _hasOpenArticleExtra(article) { + var page = this.props.page; + return page && article && _newsmemoryExtraUtils.default.getExtrasForArticle(page, article).find(function (extra) { + return extra.getType() === _ExtraLinks.PageExtraType.OPEN_ARTICLE; + }) !== undefined; + } + }, { + key: "_onArticleChange", + value: function _onArticleChange(_ref2) { + var _this4 = this; + + var article = _ref2.article, + toSelect = _ref2.toSelect, + callback = _ref2.callback; + var page = this.props.page; + + if (page && article) { + var backgroundColor = this._getBackgroundColor(toSelect); + + var articleInPage = this.isArticleOnCurrentPage(article); + + if (articleInPage) { + this.setState({ + article: article, + backgroundColor: backgroundColor, + hasOpenArticleExtras: this._hasOpenArticleExtra(article) + }, function () { + setTimeout(function () { + if (typeof callback === "function") { + callback(); + } + }, 1); + + _this4._timingToHideHighlight(); + }); + } else { + this.setState({ + article: undefined, + backgroundColor: backgroundColor, + hasOpenArticleExtras: false + }); + } + } + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + style = _this$props.style, + size = _this$props.size, + fitWidth = _this$props.fitWidth; + var _this$state = this.state, + article = _this$state.article, + backgroundColor = _this$state.backgroundColor, + hasOpenArticleExtras = _this$state.hasOpenArticleExtras; + + if (this.isArticleOnCurrentPage(article) && !hasOpenArticleExtras) { + var boxesStyle = article.getBoxes().map(function (box) { + return _newsmemoryUtils.default.getHighlightStyle(box, article.getBoxesInfo(), size, fitWidth); + }).filter(function (boxStyle) { + return _$$_REQUIRE(_dependencyMap[19]).JSUtils.isValidRect(boxStyle); + }); + + if (boxesStyle.length > 0) { + return _react.default.createElement(_reactNative.Animated.View, { + style: [style, { + opacity: this.opacity + }] + }, _react.default.createElement(_reactNativeSvg.default, null, boxesStyle.map(function (_ref3, index) { + var start = _ref3.start, + top = _ref3.top, + width = _ref3.width, + height = _ref3.height; + return _react.default.createElement(_reactNativeSvg.Rect, { + key: "polygon_" + index, + x: start, + y: top, + width: width, + height: height, + fill: backgroundColor, + strokeWidth: "0" + }); + }))); + } + } + + return null; + } + }]); + return PageHighlight; + }(_react.default.PureComponent); + + exports.default = PageHighlight; + PageHighlight.propTypes = { + page: _propTypes.default.instanceOf(_Page.default).isRequired, + getCurrentArticle: _propTypes.default.func.isRequired, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }).isRequired, + fitWidth: _propTypes.default.bool + }; +},2403,[5,7,8,15,12,14,16,17,201,28,777,460,603,641,1859,2170,639,638,572,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _reactNativeWebview = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _InterstitialsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ANIMATION_DURATION = 500; + var FLING_VELOCITYX = 600; + + var AdOverPage = function (_React$PureComponent) { + (0, _inherits2.default)(AdOverPage, _React$PureComponent); + + var _super = _createSuper(AdOverPage); + + function AdOverPage(props) { + var _this; + + (0, _classCallCheck2.default)(this, AdOverPage); + _this = _super.call(this, props); + _this.flingLeftRef = _react.default.createRef(); + _this.flingRightRef = _react.default.createRef(); + _this.onShow = _this._onShow.bind((0, _assertThisInitialized2.default)(_this)); + _this.onHide = _this._onHide.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFlingLeft = _this._onFlingLeft.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFlingRight = _this._onFlingRight.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanHandler = _this._onPanHandler.bind((0, _assertThisInitialized2.default)(_this)); + _this.onInterstitialWebViewRef = _this._onInterstitialWebViewRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTapGestureHandler = _this._onTapGestureHandler.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.animationStarted = false; + _this.left = new _reactNative.Animated.Value(0); + _this.state = { + view: null, + height: 0 + }; + return _this; + } + + (0, _createClass2.default)(AdOverPage, [{ + key: "componentDidMount", + value: function componentDidMount() { + var page, view; + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + page = this.props.page; + _context.next = 3; + return _regenerator.default.awrap(_InterstitialsHelper.default.getAdOverPage(page, this.onShow, this.onHide, this.onInterstitialWebViewRef)); + + case 3: + view = _context.sent; + this.setState({ + view: view, + height: 0 + }); + + case 5: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onShow", + value: function _onShow() { + var style = this.props.style; + this.setState({ + height: _$$_REQUIRE(_dependencyMap[16]).CssUtils.getAttributeFromStyle("height", style, "100%") + }); + } + }, { + key: "_onHide", + value: function _onHide() { + this.setState({ + view: null + }); + } + }, { + key: "_onFlingLeft", + value: function _onFlingLeft(_ref) { + var nativeEvent = _ref.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[17]).State.ACTIVE) { + this._startOffscreenAnimation(_$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isRTL()); + } + } + }, { + key: "_onFlingRight", + value: function _onFlingRight(_ref2) { + var nativeEvent = _ref2.nativeEvent; + + if (nativeEvent.state === _$$_REQUIRE(_dependencyMap[17]).State.ACTIVE) { + this._startOffscreenAnimation(!_$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isRTL()); + } + } + }, { + key: "_onPanHandler", + value: function _onPanHandler(event) { + var _event$nativeEvent = event.nativeEvent, + state = _event$nativeEvent.state, + velocityX = _event$nativeEvent.velocityX; + + if (state === _$$_REQUIRE(_dependencyMap[17]).State.ACTIVE) { + if (velocityX < -600) { + this._onFlingLeft(event); + } else if (velocityX > FLING_VELOCITYX) { + this._onFlingRight(event); + } + } + } + }, { + key: "_startOffscreenAnimation", + value: function _startOffscreenAnimation(right) { + var _this2 = this; + + if (this.size) { + if (!this.animationStarted) { + var width = this.size.width; + this.animationStarted = true; + + _reactNative.Animated.timing(this.left, { + toValue: right ? width : -width, + duration: ANIMATION_DURATION + }).start(function () { + _this2.animationStarted = false; + + _this2.onHide(); + }); + } + } else { + this.onHide(); + } + } + }, { + key: "_onInterstitialWebViewRef", + value: function _onInterstitialWebViewRef(ref) { + this.interstitialWebViewRef = ref; + } + }, { + key: "_onTapGestureHandler", + value: function _onTapGestureHandler(_ref3) { + var nativeEvent, state, x, y, node; + return _regenerator.default.async(function _onTapGestureHandler$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + nativeEvent = _ref3.nativeEvent; + + if (!nativeEvent) { + _context2.next = 12; + break; + } + + state = nativeEvent.state, x = nativeEvent.x, y = nativeEvent.y; + + if (!(state === _$$_REQUIRE(_dependencyMap[17]).State.ACTIVE && this.interstitialWebViewRef)) { + _context2.next = 12; + break; + } + + _context2.prev = 4; + node = (0, _reactNative.findNodeHandle)(this.interstitialWebViewRef); + _context2.next = 8; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[18]).OurBridge.dispatchTap(node, x, y)); + + case 8: + _context2.next = 12; + break; + + case 10: + _context2.prev = 10; + _context2.t0 = _context2["catch"](4); + + case 12: + case "end": + return _context2.stop(); + } + } + }, null, this, [[4, 10]], Promise); + } + }, { + key: "_onLayout", + value: function _onLayout(_ref4) { + var nativeEvent = _ref4.nativeEvent; + this.size = nativeEvent.layout; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + style = _this$props.style, + page = _this$props.page, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["style", "page"]); + var _this$state = this.state, + view = _this$state.view, + height = _this$state.height; + + if (view !== null) { + var innerView = _react.default.createElement(_reactNative.Animated.View, (0, _extends2.default)({ + style: [style, { + left: this.left + }], + onLayout: this.onLayout + }, rest), view); + + if (_$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isAndroid()) { + innerView = _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).PanGestureHandler, { + onHandlerStateChange: this.onPanHandler + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).TapGestureHandler, { + onHandlerStateChange: this.onTapGestureHandler + }, innerView)); + } else { + innerView = _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).PanGestureHandler, { + enableTrackpadTwoFingerGesture: true, + waitFor: [this.flingRightRef, this.flingLeftRef] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).FlingGestureHandler, { + ref: this.flingRightRef, + direction: _$$_REQUIRE(_dependencyMap[17]).Directions.RIGHT, + onHandlerStateChange: this.onFlingRight, + simultaneousHandlers: this.flingLeftRef + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).FlingGestureHandler, { + ref: this.flingLeftRef, + direction: _$$_REQUIRE(_dependencyMap[17]).Directions.LEFT, + onHandlerStateChange: this.onFlingLeft, + simultaneousHandlers: this.flingRightRef + }, innerView))); + } + + return _react.default.createElement(_reactNative.View, { + style: [style, { + overflow: "hidden", + height: height + }] + }, innerView); + } + + return view; + } + }]); + return AdOverPage; + }(_react.default.PureComponent); + + exports.default = AdOverPage; + AdOverPage.propTypes = { + page: _propTypes.default.instanceOf(_Page.default), + style: _propTypes.default.any + }; +},2404,[5,80,6,108,7,8,15,12,14,16,17,28,1226,201,638,2321,462,1,582]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PageBorderView = function (_React$PureComponent) { + (0, _inherits2.default)(PageBorderView, _React$PureComponent); + + var _super = _createSuper(PageBorderView); + + function PageBorderView(props) { + var _this; + + (0, _classCallCheck2.default)(this, PageBorderView); + _this = _super.call(this, props); + _this.state = { + hidden: false + }; + _this.opacity = new _reactNative.Animated.Value(1); + return _this; + } + + (0, _createClass2.default)(PageBorderView, [{ + key: "show", + value: function show() { + this.opacity.setValue(1); + var hidden = this.state.hidden; + + if (hidden) { + this.setState({ + hidden: false + }); + } + } + }, { + key: "hide", + value: function hide() { + var _this2 = this; + + var hidden = this.state.hidden; + + _reactNative.Animated.timing(this.opacity, { + toValue: 0, + useNativeDriver: true, + duration: 200 + }).start(function (_ref) { + var finished = _ref.finished; + + if (finished && !hidden) { + _this2.setState({ + hidden: true + }); + } + }); + } + }, { + key: "render", + value: function render() { + var hidden = this.state.hidden; + var style = this.props.style; + return hidden ? null : _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).Css, { + classes: ["newsmemory-page-border"] + }, _react.default.createElement(_reactNative.Animated.View, { + style: [{ + position: "absolute", + backgroundColor: _$$_REQUIRE(_dependencyMap[9]).colors.grey300, + width: 2, + top: 0, + right: 0, + opacity: this.opacity + }, style] + })); + } + }]); + return PageBorderView; + }(_react.default.PureComponent); + + exports.default = PageBorderView; +},2405,[5,7,8,12,14,16,17,28,699,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MorseView = function (_React$PureComponent) { + (0, _inherits2.default)(MorseView, _React$PureComponent); + + var _super = _createSuper(MorseView); + + function MorseView(props) { + var _this; + + (0, _classCallCheck2.default)(this, MorseView); + _this = _super.call(this, props); + var pages = props.edition.getPages(); + _this.pageIndex = pages.findIndex(function (currentPage) { + return currentPage.getPageId() === props.page.getPageId(); + }); + _this.state = { + hidden: props.hidden + }; + return _this; + } + + (0, _createClass2.default)(MorseView, [{ + key: "show", + value: function show() { + var hidden = this.state.hidden; + + if (hidden) { + this.setState({ + hidden: false + }); + } + } + }, { + key: "hide", + value: function hide() { + var hidden = this.state.hidden; + + if (!hidden) { + this.setState({ + hidden: true + }); + } + } + }, { + key: "_getMorseCode", + value: function _getMorseCode(position) { + var code = ""; + + var ip = _$$_REQUIRE(_dependencyMap[13]).NetworkUtils.getIP(); + + var _global$getActivePSet = global.getActivePSetup(), + loginStatus = _global$getActivePSet.loginStatus; + + var TAUID = loginStatus.TAUID; + + if (position === "top") { + if (loginStatus.isLoggedIn()) { + if (this.pageIndex === 0 || this.pageIndex % 5 === 0) { + code = _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(TAUID); + } else if (this.pageIndex % 8 === 0) { + code = _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCodeAlt(TAUID); + } + } + } else if (position === "center") { + if (ip && ip !== "n/a") { + var _ip$split = ip.split("."), + _ip$split2 = (0, _slicedToArray2.default)(_ip$split, 4), + zero = _ip$split2[0], + one = _ip$split2[1], + two = _ip$split2[2], + three = _ip$split2[3]; + + if (this.pageIndex % 2 === 1) { + code = _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(zero) + "-" + _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(one); + } else if (this.pageIndex % 3 === 2) { + code = _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(two) + "-" + _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(three); + } + } + } else if (position === "bottom") { + if (ip && ip !== "n/a") { + var _ip$split3 = ip.split("."), + _ip$split4 = (0, _slicedToArray2.default)(_ip$split3, 4), + _zero = _ip$split4[0], + _one = _ip$split4[1], + _two = _ip$split4[2], + _three = _ip$split4[3]; + + if (this.pageIndex % 2 === 0) { + code = _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(_zero) + "-" + _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(_one); + } else if (this.pageIndex % 3 === 0) { + code = _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(_two) + "-" + _$$_REQUIRE(_dependencyMap[13]).StringUtils.getMorseLikeCode(_three); + } + } + } + + return code; + } + }, { + key: "_getMorse", + value: function _getMorse(position) { + var zoom = this.props.zoom; + + var code = this._getMorseCode(position); + + if (code) { + var morseStyle = _$$_REQUIRE(_dependencyMap[14]).Css.getStyleObjByCssClasses(["newsmemory-morse", "newsmemory-morse-" + position]); + + var fontSize = _$$_REQUIRE(_dependencyMap[13]).CssUtils.getAttributeFromStyle("fontSize", morseStyle, 14); + + var morseContainerStyle = _$$_REQUIRE(_dependencyMap[14]).Css.getStyleObjByCssClasses(["newsmemory-morse-container", "newsmemory-morse-" + position + "-container"]); + + var height = _$$_REQUIRE(_dependencyMap[13]).CssUtils.getAttributeFromStyle("height", morseContainerStyle, 20); + + return _react.default.createElement(_reactNative.Animated.View, { + style: [morseContainerStyle, { + transform: [{ + scale: 1 / zoom + }, { + translateY: height * (zoom - 1) / 4 + }] + }] + }, _react.default.createElement(_fontText.default, { + style: [morseStyle, fontSize] + }, code)); + } + + return _react.default.createElement(_reactNative.View, null); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + style = _this$props.style, + zoom = _this$props.zoom, + minZoom = _this$props.minZoom; + var hidden = this.state.hidden; + + if (hidden) { + return null; + } + + var Components = [this._getMorse("top")]; + + if (zoom > minZoom) { + Components.push(this._getMorse("center"), _react.default.createElement(_reactNative.View, null)); + } else { + Components.push(_react.default.createElement(_reactNative.View, null), this._getMorse("bottom")); + } + + return _react.default.createElement(_reactNative.View, { + style: [{ + alignItems: "center", + justifyContent: "space-between" + }, style] + }, Components); + } + }]); + return MorseView; + }(_react.default.PureComponent); + + exports.default = MorseView; + MorseView.propTypes = { + edition: _propTypes.default.instanceOf(_Edition.default).isRequired, + page: _propTypes.default.instanceOf(_Page.default).isRequired, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + zoom: _propTypes.default.number, + minZoom: _propTypes.default.number, + hidden: _propTypes.default.bool + }; + MorseView.defaultProps = { + minZoom: 1, + hidden: false + }; +},2406,[5,41,7,8,12,14,16,17,28,201,638,644,1879,462,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.GESTURE_CANCEL_TIMEOUT = exports.GESTURE_TIMEOUT = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _reactNativeReanimated = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _zoomViewPager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _zoomViewPagerManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _tapViewPagerManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _tapView = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _gestureTimer = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var divide = _reactNativeReanimated.default.divide, + Value = _reactNativeReanimated.default.Value; + var GESTURE_TIMEOUT = 250; + exports.GESTURE_TIMEOUT = GESTURE_TIMEOUT; + var GESTURE_CANCEL_TIMEOUT = 5000; + exports.GESTURE_CANCEL_TIMEOUT = GESTURE_CANCEL_TIMEOUT; + var TIMERS = { + GESTURE_END: "viewpager_gesture_end", + GESTURE_START: "viewpager_gesture_start" + }; + + var ZoomViewPager = function (_React$Component) { + (0, _inherits2.default)(ZoomViewPager, _React$Component); + + var _super = _createSuper(ZoomViewPager); + + function ZoomViewPager(props) { + var _this; + + (0, _classCallCheck2.default)(this, ZoomViewPager); + _this = _super.call(this, props); + _this.pinchRef = _react.default.createRef(); + _this.panRef = _react.default.createRef(); + _this.state = { + loading: true + }; + _this.dataSet = []; + _this._isScrolling = false; + _this._lastEvent = undefined; + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTapStart = _this._onTapStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGestureStart = _this._onGestureStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onGestureEnd = _this._onGestureEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPanBottomReached = _this._onPanBottomReached.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScrollStart = _this._onScrollStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScrollEnd = _this._onScrollEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSwipeOnLastPage = _this._onSwipeOnLastPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFit = _this._onFit.bind((0, _assertThisInitialized2.default)(_this)); + _this.onUnFit = _this._onUnFit.bind((0, _assertThisInitialized2.default)(_this)); + _this.onToggleFit = _this._onToggleFit.bind((0, _assertThisInitialized2.default)(_this)); + _this.onAutoZoom = _this._onAutoZoom.bind((0, _assertThisInitialized2.default)(_this)); + _this.onExtraTap = _this._onExtraTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSingleTap = _this._onSingleTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onDoubleTap = _this._onDoubleTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTwoFingersTap = _this._onTwoFingersTap.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLongPress = _this._onLongPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.leftMarginDivider = new Value(1); + _this.rightMarginDivider = new Value(1); + return _this; + } + + (0, _createClass2.default)(ZoomViewPager, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (_$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isIOS()) { + this._initialize(); + } + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var loading = this.state.loading; + + if (!loading) { + this.tapMgr.setProps(nextProps); + this.gestureMgr.setProps(nextProps); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps, prevState) { + var onLoaded = this.props.onLoaded; + var loading = this.state.loading; + + if (prevState.loading && !loading && typeof onLoaded === "function") { + onLoaded(); + } + } + }, { + key: "_onLayout", + value: function _onLayout() { + if (_$$_REQUIRE(_dependencyMap[18]).PlatformUtils.isAndroid()) { + this._initialize(); + } + } + }, { + key: "_initialize", + value: function _initialize() { + var loading = this.state.loading; + + if (loading) { + var _this$dataSet; + + var _this$props = this.props, + data = _this$props.data, + clickPosition = _this$props.clickPosition, + minScale = _this$props.minScale, + maxScale = _this$props.maxScale, + contentSize = _this$props.contentSize, + size = _this$props.size, + snapSize = _this$props.snapSize, + initialPage = _this$props.initialPage, + nPages = _this$props.nPages, + numberOfShowedPages = _this$props.numberOfShowedPages, + fitX = _this$props.fitX, + isTablet = _this$props.isTablet, + isRtl = _this$props.isRtl; + this.dataSet = []; + + (_this$dataSet = this.dataSet).push.apply(_this$dataSet, (0, _toConsumableArray2.default)(data)); + + if (isRtl) { + this.dataSet.reverse(); + } + + this._currentIndex = (0, _$$_REQUIRE(_dependencyMap[19]).fixStartupIndex)(this._adaptIndexForRTL(initialPage), nPages, numberOfShowedPages, isRtl); + this._isScrolling = false; + this.tapMgr = new _tapViewPagerManager.default((0, _extends2.default)({}, this.props, { + onSingleTap: this.onSingleTap, + onTwoFingersTap: this.onTwoFingersTap, + onDoubleTap: this.onDoubleTap, + onLongPress: this.onLongPress, + onExtraTap: this.onExtraTap + })); + this.tapMgr.setOnAutoZoom(this.onAutoZoom); + var panX = -this._currentIndex * contentSize.width; + var panY = 0; + + if (clickPosition && clickPosition.disableZoomFactor) { + clickPosition.y = clickPosition.y * contentSize.height / clickPosition.height; + clickPosition.x = clickPosition.x * contentSize.width / clickPosition.width; + clickPosition.width = contentSize.width; + clickPosition.height = contentSize.height; + + if (size && size.height && clickPosition.scale >= 1 && clickPosition.height * clickPosition.scale > size.height && clickPosition.y * clickPosition.scale > size.height) { + panY -= Math.min(Math.max(0, clickPosition.y), contentSize.height - size.height); + } + } + + this.gestureMgr = new _zoomViewPagerManager.default(panX, panY, minScale, minScale, maxScale, nPages, this._currentIndex, numberOfShowedPages, size, contentSize, snapSize, fitX, isTablet, isRtl); + this.gestureMgr.setInitialPage(this._currentIndex); + this.gestureMgr.setOnStartGestureListener(this.onGestureStart); + this.gestureMgr.setOnEndGestureListener(this.onGestureEnd); + this.gestureMgr.setOnPanBottomReached(this.onPanBottomReached); + this.gestureMgr.setOnStartScrollGestureListener(this.onScrollStart); + this.gestureMgr.setOnScrollEndGestureListener(this.onScrollEnd); + this.gestureMgr.setOnSwipeOnLastPageListener(this.onSwipeOnLastPage); + this.gestureMgr.setOnFitListener(this.onFit); + this.gestureMgr.setOnUnFitListener(this.onUnFit); + this.gestureMgr.setOnToggleFitListener(this.onToggleFit); + this.setState({ + loading: false + }); + } + } + }, { + key: "reduceMargins", + value: function reduceMargins() { + var leftDivider = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; + var rightDivider = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; + this.leftMarginDivider.setValue(leftDivider); + this.rightMarginDivider.setValue(rightDivider); + } + }, { + key: "_onExtraTap", + value: function _onExtraTap(nativeEvent) { + var onExtraTap = this.props.onExtraTap; + + if (typeof onExtraTap === "function") { + return onExtraTap(this._adaptEventForRTL(nativeEvent)); + } + + return false; + } + }, { + key: "_onSingleTap", + value: function _onSingleTap(nativeEvent) { + var onSingleTap = this.props.onSingleTap; + + if (typeof onSingleTap === "function") { + onSingleTap(this._adaptEventForRTL(nativeEvent)); + } + } + }, { + key: "_onDoubleTap", + value: function _onDoubleTap(nativeEvent) { + var onDoubleTap = this.props.onDoubleTap; + + if (typeof onDoubleTap === "function") { + onDoubleTap(this._adaptEventForRTL(nativeEvent)); + } + } + }, { + key: "_onTwoFingersTap", + value: function _onTwoFingersTap(nativeEvent) { + var onTwoFingersTap = this.props.onTwoFingersTap; + + if (typeof onTwoFingersTap === "function") { + onTwoFingersTap(this._adaptEventForRTL(nativeEvent)); + } + } + }, { + key: "_onLongPress", + value: function _onLongPress(nativeEvent) { + var onLongPress = this.props.onLongPress; + + if (typeof onLongPress === "function") { + onLongPress(this._adaptEventForRTL(nativeEvent)); + } + } + }, { + key: "_onTapStart", + value: function _onTapStart() { + var onGestureStart = this.props.onGestureStart; + + if (typeof onGestureStart === "function") { + onGestureStart(); + } + } + }, { + key: "_onGestureStart", + value: function _onGestureStart() { + var _this2 = this; + + _gestureTimer.default.resetTimer(TIMERS.GESTURE_END); + + _gestureTimer.default.resetTimer(TIMERS.GESTURE_START); + + var onGestureStart = this.props.onGestureStart; + + if (typeof onGestureStart === "function") { + onGestureStart(); + + _gestureTimer.default.startTimer(TIMERS.GESTURE_START, function () { + if (_this2._lastEvent) { + _this2._onGestureEnd(_this2._lastEvent); + } + }, GESTURE_CANCEL_TIMEOUT); + } + } + }, { + key: "_onPanBottomReached", + value: function _onPanBottomReached() { + var onPanBottomReached = this.props.onPanBottomReached; + + if (typeof onPanBottomReached === "function") { + onPanBottomReached(); + } + } + }, { + key: "_onGestureEnd", + value: function _onGestureEnd(event) { + var _this3 = this; + + event = this._adaptEventForRTL(event); + event.isScrolling = this._isScrolling; + this.tapMgr.setGestureEvent(event.nativeEvent); + + this._onPageChange(event); + + _gestureTimer.default.resetTimer(TIMERS.GESTURE_START); + + _gestureTimer.default.resetTimer(TIMERS.GESTURE_END); + + _gestureTimer.default.startTimer(TIMERS.GESTURE_END, function () { + var onGestureEnd = _this3.props.onGestureEnd; + event.isScrolling = false; + + _this3._onPageChange(event); + + if (typeof onGestureEnd === "function") { + _this3._lastEvent = event; + onGestureEnd(event); + } + }, GESTURE_TIMEOUT); + } + }, { + key: "_onScrollEnd", + value: function _onScrollEnd(event) { + this._onGestureEnd(event); + } + }, { + key: "_onScrollStart", + value: function _onScrollStart() { + this._isScrolling = true; + + this._onGestureStart(); + } + }, { + key: "_onPageChange", + value: function _onPageChange(event) { + var onPageChange = this.props.onPageChange; + + if (typeof onPageChange === "function") { + onPageChange(event); + } + + this._currentIndex = event.index; + } + }, { + key: "_onSwipeOnLastPage", + value: function _onSwipeOnLastPage() { + var onSwipeOnLastPage = this.props.onSwipeOnLastPage; + + if (typeof onSwipeOnLastPage === "function") { + onSwipeOnLastPage(); + } + } + }, { + key: "_onFit", + value: function _onFit() { + this.tapMgr.setFit(true); + var onFit = this.props.onFit; + + if (typeof onFit === "function") { + onFit(); + } + } + }, { + key: "_onAutoZoom", + value: function _onAutoZoom(event) { + var onDoubleTap = this.props.onDoubleTap; + this.gestureMgr.zoomTo(event); + + if (event.numTaps > 1) { + onDoubleTap(event); + } + } + }, { + key: "_onUnFit", + value: function _onUnFit() { + this.tapMgr.setFit(false); + var onUnFit = this.props.onUnFit; + + if (typeof onUnFit === "function") { + onUnFit(); + } + } + }, { + key: "_onToggleFit", + value: function _onToggleFit() { + var onToggleFit = this.props.onToggleFit; + + if (typeof onToggleFit === "function") { + onToggleFit(); + } + } + }, { + key: "scrollTo", + value: function scrollTo(index) { + if (this.gestureMgr) { + this.gestureMgr.scrollTo(this._adaptIndexForRTL(index)); + } + } + }, { + key: "scrollToPrev", + value: function scrollToPrev() { + this.scrollPage(this._currentIndex - 1); + } + }, { + key: "scrollToNext", + value: function scrollToNext() { + this.scrollPage(this._currentIndex + 1); + } + }, { + key: "panToLeft", + value: function panToLeft() { + if (this.gestureMgr) { + this.gestureMgr.panToLeft(); + } + } + }, { + key: "panToRight", + value: function panToRight() { + if (this.gestureMgr) { + this.gestureMgr.panToRight(); + } + } + }, { + key: "panToUp", + value: function panToUp() { + if (this.gestureMgr) { + this.gestureMgr.panToUp(); + } + } + }, { + key: "panToDown", + value: function panToDown() { + if (this.gestureMgr) { + this.gestureMgr.panToDown(); + } + } + }, { + key: "scrollPage", + value: function scrollPage(index) { + if (this.gestureMgr) { + this.gestureMgr.scrollPage(this._adaptIndexForRTL(index)); + } + } + }, { + key: "zoomToClickedPosition", + value: function zoomToClickedPosition() { + var _this$props2 = this.props, + clickPosition = _this$props2.clickPosition, + numberOfShowedPages = _this$props2.numberOfShowedPages, + nPages = _this$props2.nPages, + isRtl = _this$props2.isRtl; + + if (clickPosition) { + var width = clickPosition.width, + y = clickPosition.y, + scaleFactor = clickPosition.scale, + disableZoomFactor = clickPosition.disableZoomFactor; + var index = clickPosition.index, + x = clickPosition.x; + index = this._adaptIndexForRTL(index); + var fixIndex = (0, _$$_REQUIRE(_dependencyMap[19]).fixStartupIndex)(index, nPages, numberOfShowedPages, isRtl); + x += (index - fixIndex) * width; + + if (!disableZoomFactor) { + var scaleToGo = this.tapMgr._computeScaleToGo(); + + this._onAutoZoom({ + x: x * scaleFactor, + y: y * scaleFactor, + scale: scaleToGo + }); + } + } + } + }, { + key: "zoomToCenter", + value: function zoomToCenter(scaleToAdd) { + if (this.gestureMgr) { + var _this$props3 = this.props, + contentSize = _this$props3.contentSize, + numberOfShowedPages = _this$props3.numberOfShowedPages; + var width = contentSize.width, + height = contentSize.height; + + var _this$gestureMgr$_get = this.gestureMgr._getEventObject(), + scale = _this$gestureMgr$_get.scale; + + this.gestureMgr.zoom({ + x: width * numberOfShowedPages / 2, + y: height / 2 + }, scale + scaleToAdd); + } + } + }, { + key: "zoomTo", + value: function zoomTo(event) { + if (this.tapMgr && event) { + this.tapMgr._autoZoom(event); + } + } + }, { + key: "isScaled", + value: function isScaled() { + if (this.gestureMgr) { + return this.gestureMgr._isScaled(); + } + + return false; + } + }, { + key: "getClickedPosition", + value: function getClickedPosition(event) { + if (this.tapMgr && event) { + return this.tapMgr._getClickedPosition(event); + } + + return null; + } + }, { + key: "_adaptIndexForRTL", + value: function _adaptIndexForRTL(index) { + var data = this.props.data; + return (0, _$$_REQUIRE(_dependencyMap[19]).adaptIndexForRTL)(index, data.length); + } + }, { + key: "_adaptEventForRTL", + value: function _adaptEventForRTL(event) { + var _this4 = this; + + if (event.index !== undefined) { + event.index = this._adaptIndexForRTL(event.index); + } + + if (event.visibleAreas !== undefined) { + event.visibleAreas.forEach(function (area) { + if (area.index !== undefined) { + area.index = _this4._adaptIndexForRTL(area.index); + } + }); + } + + return event; + } + }, { + key: "render", + value: function render() { + var _this5 = this; + + var props = this.props; + var renderItem = props.renderItem, + contentSize = props.contentSize, + size = props.size, + numberOfShowedPages = props.numberOfShowedPages, + isRtl = props.isRtl, + cssContainerClasses = props.cssContainerClasses; + var loading = this.state.loading; + return _react.default.createElement(_reactNative.View, { + style: _zoomViewPager.default.main, + onLayout: this.onLayout + }, !loading ? _react.default.createElement(_tapView.default, { + onGestureStart: this.onTapStart, + onSingleTap: this.tapMgr.getOnTap(), + onDoubleTap: this.tapMgr.getOnDoubleTap(), + onTwoFingersTap: this.tapMgr.getOnTwoFingersTap(), + onLongPress: this.tapMgr.getOnLongPress(), + twoFingersTapHandlerWaitFor: this.pinchRef, + doubleTapHandlerWaitFor: this.pinchRef + }, _react.default.createElement(_reactNativeReanimated.default.View, { + style: _zoomViewPager.default.container, + collapsable: false + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).PinchGestureHandler, { + ref: this.pinchRef, + onGestureEvent: this.gestureMgr.getPinchGestureEvent(), + onHandlerStateChange: this.gestureMgr.getPinchGestureEvent(), + simultaneousHandlers: this.panRef + }, _react.default.createElement(_reactNativeReanimated.default.View, { + style: _zoomViewPager.default.container, + collapsable: false + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).PanGestureHandler, { + ref: this.panRef, + onGestureEvent: this.gestureMgr.getPanGestureEvent(), + onHandlerStateChange: this.gestureMgr.getPanGestureEvent(), + simultaneousHandlers: this.pinchRef, + minDist: 10, + avgTouches: true, + enableTrackpadTwoFingerGesture: true + }, _react.default.createElement(_reactNativeReanimated.default.View, { + style: [_zoomViewPager.default.container, { + width: this.gestureMgr._scaledContentWidth, + height: size.height + }], + collapsable: false + }, _react.default.createElement(_reactNativeReanimated.default.View, { + style: [{ + width: contentSize.width * numberOfShowedPages, + height: size.height, + flexDirection: "row" + (isRtl ? "-reverse" : ""), + transform: [{ + translateX: this.gestureMgr._translateX + }, { + translateY: this.gestureMgr._translateY + }, { + translateX: this.gestureMgr._focalDisplacementX + }, { + translateY: this.gestureMgr._focalDisplacementY + }, { + translateX: this.gestureMgr._scaleTopLeftFixX + }, { + translateY: this.gestureMgr._scaleTopLeftFixY + }, { + scale: this.gestureMgr._scale + }, { + perspective: 1000 + }] + }] + }, this.dataSet.map(function (item, index) { + return renderItem({ + item: item, + index: _this5._adaptIndexForRTL(index), + slotSize: contentSize, + viewSize: size + }); + })))))))) : null, !loading ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).Css, { + classes: cssContainerClasses + }, _react.default.createElement(_reactNativeReanimated.default.View, { + pointerEvents: "none", + style: [_zoomViewPager.default.sideBandLeft, { + width: divide(this.gestureMgr._horizontalMargin, this.leftMarginDivider) + }] + })) : null, !loading ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).Css, { + classes: cssContainerClasses + }, _react.default.createElement(_reactNativeReanimated.default.View, { + pointerEvents: "none", + style: [_zoomViewPager.default.sideBandRight, { + width: divide(this.gestureMgr._horizontalMargin, this.rightMarginDivider) + }] + })) : null); + } + }]); + return ZoomViewPager; + }(_react.default.Component); + + exports.default = ZoomViewPager; + ZoomViewPager.propTypes = { + data: _propTypes.default.array.isRequired, + nPages: _propTypes.default.number.isRequired, + numberOfShowedPages: _propTypes.default.number, + initialPage: _propTypes.default.number, + contentSize: _propTypes.default.shape({ + width: _propTypes.default.number.isRequired, + height: _propTypes.default.number.isRequired + }).isRequired, + size: _propTypes.default.shape({ + width: _propTypes.default.number.isRequired, + height: _propTypes.default.number.isRequired + }).isRequired, + fitX: _propTypes.default.bool, + isRtl: _propTypes.default.bool, + isTablet: _propTypes.default.bool, + snapSize: _propTypes.default.number, + minScale: _propTypes.default.number, + maxScale: _propTypes.default.number, + dipsScale: _propTypes.default.func.isRequired, + twoFingerTapEnabled: _propTypes.default.func, + singleTapToZoom: _propTypes.default.func, + zoomingFactor: _propTypes.default.number, + onPageChange: _propTypes.default.func, + onSwipeOnLastPage: _propTypes.default.func, + onGestureStart: _propTypes.default.func, + onGestureEnd: _propTypes.default.func, + onPanBottomReached: _propTypes.default.func, + onFit: _propTypes.default.func, + onUnFit: _propTypes.default.func, + onToggleFit: _propTypes.default.func, + onExtraTap: _propTypes.default.func, + onSingleTap: _propTypes.default.func, + onDoubleTap: _propTypes.default.func, + onTwoFingersTap: _propTypes.default.func, + onLongPress: _propTypes.default.func, + renderItem: _propTypes.default.func.isRequired, + clickPosition: _propTypes.default.object, + onLoaded: _propTypes.default.func, + cssContainerClasses: _propTypes.default.array + }; + ZoomViewPager.defaultProps = { + initialPage: 0, + minScale: 1, + maxScale: 8, + isRtl: false, + twoFingerTapEnabled: false, + cssContainerClasses: [] + }; +},2407,[5,6,21,7,8,15,12,14,16,17,201,28,646,2408,2409,2412,2163,2164,462,645,1,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + main: { + flex: 1, + width: "100%", + justifyContent: "center", + alignItems: "center", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent, + position: "absolute", + top: 0, + left: 0 + }, + container: { + alignItems: "center", + flex: 1, + justifyContent: "center" + }, + wrapper: { + flex: 1 + }, + sideBandLeft: { + position: "absolute", + start: 0, + top: 0, + bottom: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + sideBandRight: { + position: "absolute", + end: 0, + top: 0, + bottom: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.default = _default; +},2408,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNativeReanimated = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _zoomConstants = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var lessThan = _reactNativeReanimated.default.lessThan, + event = _reactNativeReanimated.default.event, + add = _reactNativeReanimated.default.add, + sub = _reactNativeReanimated.default.sub, + set = _reactNativeReanimated.default.set, + Value = _reactNativeReanimated.default.Value, + debug = _reactNativeReanimated.default.debug, + cond = _reactNativeReanimated.default.cond, + and = _reactNativeReanimated.default.and, + atan = _reactNativeReanimated.default.atan, + or = _reactNativeReanimated.default.or, + eq = _reactNativeReanimated.default.eq, + abs = _reactNativeReanimated.default.abs, + greaterThan = _reactNativeReanimated.default.greaterThan, + max = _reactNativeReanimated.default.max, + min = _reactNativeReanimated.default.min, + multiply = _reactNativeReanimated.default.multiply, + divide = _reactNativeReanimated.default.divide; + + var ZoomViewPagerMgr = function () { + function ZoomViewPagerMgr(panX, panY, startScale, minScale, maxScale, nPages, index, pagesVisible, size, contentSize, snapSize, fitX, isTablet, isRtl) { + (0, _classCallCheck2.default)(this, ZoomViewPagerMgr); + this._notAnimatedStatus = { + _starting: true, + _panX: panX, + _panY: panY, + _focalDisplacementX: 0, + _focalDisplacementY: 0, + _width: contentSize.width, + _height: contentSize.height, + _viewWidth: size.width, + _viewHeight: size.height, + _snapSize: snapSize, + _horizontalMargin: Math.max((size.width - contentSize.width * pagesVisible * minScale) / 2, 0), + _verticalMargin: Math.max((size.height - contentSize.height * minScale) / 2, 0), + _fitHorizontally: fitX, + _xFitScale: size.width / contentSize.width, + _yFitScale: size.height / contentSize.height, + _pagesVisible: pagesVisible, + _viewIsLandscape: size.width > size.height, + _nPages: nPages, + _left: 0, + _right: 0, + _limits: this._computeLimits(0, panX, index, pagesVisible, contentSize.width, minScale), + _top: 0, + _bottom: 0, + _index: index, + _scale: startScale, + _minScale: minScale, + _maxScale: maxScale, + _isRtl: isRtl + }; + this.onPanStart = this._onPanStart.bind(this); + this.onPanEndX = this._onPanEndX.bind(this); + this.onScrollEnd = this._onScrollEnd.bind(this); + this.onScrollStart = this._onScrollStart.bind(this); + this.onPanEndY = this._onPanEndY.bind(this); + this.onPanBottomReached = this._onPanBottomReached.bind(this); + this.onPanEnd = this._onPanEnd.bind(this); + this.onPinchStart = this._onPinchStart.bind(this); + this.onPinchEnd = this._onPinchEnd.bind(this); + this.onFit = this._onFit.bind(this); + this.onUnFit = this._onUnFit.bind(this); + this.onToggleFit = this._onToggleFit.bind(this); + this.onLeftChange = this._onLeftChange.bind(this); + this.onRightChange = this._onRightChange.bind(this); + this.onTopChange = this._onTopChange.bind(this); + this.onBottomChange = this._onBottomChange.bind(this); + this.onLimitChange = this._onLimitChange.bind(this); + this._nPages = new Value(nPages); + this._pagesVisible = new Value(pagesVisible); + this._viewIsLandscape = new Value(this._notAnimatedStatus._viewIsLandscape); + this._contentLayout = { + width: new Value(contentSize.width), + height: new Value(contentSize.height) + }; + this._layout = { + width: new Value(size.width), + height: new Value(size.height) + }; + this._currentPage = new Value(this._notAnimatedStatus._index); + this._horizontalMargin = new Value(this._notAnimatedStatus._horizontalMargin); + var fitHorizontally = new Value(this._notAnimatedStatus._fitHorizontally ? 1 : 0); + this.scale = new Value(this._notAnimatedStatus._scale); + var panTransX = new Value(this._notAnimatedStatus._panX); + var panTransY = new Value(this._notAnimatedStatus._panY); + var hMargin = new Value(this._notAnimatedStatus._horizontalMargin); + var whiteMargin = sub(hMargin, this._horizontalMargin); + var starting = new Value(1); + this._scrollToAnimated = new Value(0); + this._scrollState = new Value(_$$_REQUIRE(_dependencyMap[7]).State.UNDETERMINED); + this._zoomToState = new Value(_$$_REQUIRE(_dependencyMap[7]).State.UNDETERMINED); + this._zoomToValue = new Value(1); + this._zoomToDragX = new Value(0); + this._zoomToDragY = new Value(0); + var pinchOldState = new Value(-1); + var pinchState = new Value(-1); + var pinchScale = new Value(1); + this._pinchFocalX = new Value(0); + this._pinchFocalY = new Value(0); + this._minScale = new Value(this._notAnimatedStatus._minScale); + this._maxScale = new Value(this._notAnimatedStatus._maxScale); + this._focalDisplacementX = new Value(0); + this._focalDisplacementY = new Value(0); + this.onPinchGestureEvent = event([{ + nativeEvent: { + state: pinchState, + oldState: pinchOldState, + scale: pinchScale, + focalX: this._pinchFocalX, + focalY: this._pinchFocalY + } + }]); + var pinchStart = and(eq(pinchOldState, _$$_REQUIRE(_dependencyMap[7]).State.UNDETERMINED), eq(pinchState, _$$_REQUIRE(_dependencyMap[7]).State.BEGAN)); + var pinchActive = eq(pinchState, _$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + var zoomActive = eq(this._zoomToState, _$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + var pinchEnd = eq(pinchOldState, _$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + var fit = new Value(0); + var relativePinchX = sub(this._pinchFocalX, cond(zoomActive, 0, whiteMargin)); + var relativeFocalX = sub(relativePinchX, add(panTransX, this._focalDisplacementX)); + var relativeFocalY = sub(this._pinchFocalY, add(panTransY, this._focalDisplacementY)); + var isFitted = eq(fit, 1); + this.dragX = new Value(0); + var dragY = new Value(0); + var leftLimit = new Value(0); + var rightLimit = new Value(0); + var topLimit = new Value(0); + var bottomLimit = new Value(0); + this._scale = set(this.scale, (0, _$$_REQUIRE(_dependencyMap[8]).pinchMgr)(starting, pinchStart, pinchActive, pinchEnd, pinchOldState, pinchScale, this.scale, relativeFocalX, relativeFocalY, this._focalDisplacementX, this._focalDisplacementY, this._minScale, this._maxScale, this.onPinchStart, this.onPinchEnd, this._nPages, this._pagesVisible, eq(fitHorizontally, 1), fit, isFitted, this.onFit, this.onUnFit, this._contentLayout.width, this._contentLayout.height, this._layout.width, this._layout.height, this._horizontalMargin, this.onToggleFit, this._zoomToState, this._zoomToValue, and(eq(this._scrollToAnimated, 0), eq(this._scrollState, _$$_REQUIRE(_dependencyMap[7]).State.ACTIVE)), leftLimit, topLimit, rightLimit, bottomLimit, this.onLimitChange)); + var panState = new Value(-1); + var panOldState = new Value(-1); + var velocityX = new Value(0); + var velocityY = new Value(0); + this.onPanGestureEvent = event([{ + nativeEvent: { + state: panState, + oldState: panOldState, + translationX: this.dragX, + translationY: dragY, + velocityX: velocityX, + velocityY: velocityY + } + }]); + var panStart = [debug("PAN OLD STATE: ", panOldState), debug("PAN STATE: ", panState), and(eq(panOldState, _$$_REQUIRE(_dependencyMap[7]).State.UNDETERMINED), eq(panState, _$$_REQUIRE(_dependencyMap[7]).State.BEGAN))]; + var panActive = or(pinchActive, zoomActive, eq(panState, _$$_REQUIRE(_dependencyMap[7]).State.ACTIVE)); + var panEnd = eq(panOldState, _$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + this.keyPanXState = new Value(-1); + this.keyPanXValue = new Value(0); + this.keyPanYState = new Value(-1); + this.keyPanYValue = new Value(0); + var panCancelled = or(and(eq(panOldState, _$$_REQUIRE(_dependencyMap[7]).State.BEGAN), eq(panState, _$$_REQUIRE(_dependencyMap[7]).State.CANCELLED)), and(eq(panOldState, _$$_REQUIRE(_dependencyMap[7]).State.BEGAN), eq(panState, _$$_REQUIRE(_dependencyMap[7]).State.END)), and(eq(panOldState, _$$_REQUIRE(_dependencyMap[7]).State.BEGAN), eq(panState, _$$_REQUIRE(_dependencyMap[7]).State.FAILED))); + var dragSlope = divide(sub(0, dragY), sub(0, this.dragX)); + var radiansFromXAxis = abs(atan(dragSlope)); + var enableAnimationOnYAxis = greaterThan(radiansFromXAxis, _zoomConstants.default.constants.PAN_ANIMATION_DEGREES_THRESHOLD * Math.PI / 180); + var enableAnimationOnXAxis = lessThan(radiansFromXAxis, (90 - _zoomConstants.default.constants.PAN_ANIMATION_DEGREES_THRESHOLD) * Math.PI / 180); + this._translateX = set(panTransX, (0, _$$_REQUIRE(_dependencyMap[9]).panXMgr)(panStart, panActive, panEnd, panCancelled, this._scrollState, this._scrollToAnimated, panTransX, this.dragX, velocityX, enableAnimationOnXAxis, leftLimit, rightLimit, this._viewIsLandscape, isFitted, this._contentLayout.width, snapSize, whiteMargin, this._currentPage, this._scale, this._minScale, this._pagesVisible, this._nPages, this.onPanStart, this.onPanEndX, this.onScrollStart, this.onScrollEnd, panTransY, topLimit, isTablet, zoomActive, this._zoomToDragX, eq(isRtl, true), this.keyPanXState, this.keyPanXValue)); + this._translateY = set(panTransY, (0, _$$_REQUIRE(_dependencyMap[9]).panYMgr)(panStart, panActive, panEnd, panCancelled, panTransY, dragY, velocityY, enableAnimationOnYAxis, topLimit, bottomLimit, this._viewIsLandscape, this._scale, this._contentLayout.height, this._layout.height, this.onPanStart, this.onPanEndY, this.onPanBottomReached, zoomActive, this._zoomToDragY, this.keyPanYState, this.keyPanYValue)); + this._scaleTopLeftFixX = divide(multiply(this._contentLayout.width, this._pagesVisible, add(this._scale, -1)), 2); + this._scaleTopLeftFixY = divide(multiply(this._layout.height, add(this._scale, -1)), 2); + this._scaledContentWidth = max(multiply(this._contentLayout.width, this._pagesVisible, this._minScale), min(this._layout.width, multiply(this._contentLayout.width, this._pagesVisible, this._scale))); + } + + (0, _createClass2.default)(ZoomViewPagerMgr, [{ + key: "_computeLimits", + value: function _computeLimits(left, panX, index, visiblePages, pageWidth, scale) { + var limits = []; + var zoomedWidth = pageWidth * Math.max(1, scale); + var absoluteX = -1 * left + panX; + var leftIndex = Math.max(0, Math.floor(parseFloat(Math.abs(absoluteX) / zoomedWidth).toFixed(1))); + var startLimit = -leftIndex * zoomedWidth; + var screenLimit = absoluteX - pageWidth * visiblePages; + limits.push(startLimit); + var nextLimit = startLimit; + + while (nextLimit > screenLimit) { + nextLimit -= zoomedWidth; + nextLimit = parseFloat(nextLimit.toFixed(2)); + limits.push(nextLimit); + } + + return limits; + } + }, { + key: "_getEventObject", + value: function _getEventObject() { + var eventObject = { + nativeEvent: this._notAnimatedStatus, + x: this._notAnimatedStatus._limits[0] - this._notAnimatedStatus._panX, + y: this._notAnimatedStatus._panY, + scale: this._notAnimatedStatus._scale, + index: this._notAnimatedStatus._index, + visibleAreas: (0, _$$_REQUIRE(_dependencyMap[10]).pagesVisibleArea)(this._notAnimatedStatus) + }; + return eventObject; + } + }, { + key: "getPinchGestureEvent", + value: function getPinchGestureEvent() { + return this.onPinchGestureEvent; + } + }, { + key: "getPanGestureEvent", + value: function getPanGestureEvent() { + return this.onPanGestureEvent; + } + }, { + key: "_onPinchStart", + value: function _onPinchStart() { + if (this._notAnimatedStatus._starting) { + this._notAnimatedStatus._starting = false; + this.onEndGestureListener(this._getEventObject()); + } else { + if (this.onStartGestureListener) { + this.onStartGestureListener(); + } + } + } + }, { + key: "_onPanStart", + value: function _onPanStart() { + if (this.onStartGestureListener) { + this.onStartGestureListener(); + } + } + }, { + key: "_onPanEndX", + value: function _onPanEndX(params) { + this._notAnimatedStatus._panX = params[0]; + this._notAnimatedStatus._index = params[1]; + var _this$_notAnimatedSta = this._notAnimatedStatus, + _left = _this$_notAnimatedSta._left, + _panX = _this$_notAnimatedSta._panX, + _index = _this$_notAnimatedSta._index, + _pagesVisible = _this$_notAnimatedSta._pagesVisible, + _width = _this$_notAnimatedSta._width, + _scale = _this$_notAnimatedSta._scale; + this._notAnimatedStatus._limits = this._computeLimits(_left, _panX, _index, _pagesVisible, _width, _scale); + + this._onPanEnd(); + } + }, { + key: "_onScrollStart", + value: function _onScrollStart() { + if (this.onScrollStartGestureListener) { + this.onScrollStartGestureListener(); + } + } + }, { + key: "_onScrollEnd", + value: function _onScrollEnd(params) { + if (params[1] === this._notAnimatedStatus._index && params[1] === this._notAnimatedStatus._nPages - 1) { + if (this.onSwipeOnLastPageListener) { + this.onSwipeOnLastPageListener(); + } + } + + this._notAnimatedStatus._panX = params[0]; + this._notAnimatedStatus._index = params[1]; + var _this$_notAnimatedSta2 = this._notAnimatedStatus, + _left = _this$_notAnimatedSta2._left, + _panX = _this$_notAnimatedSta2._panX, + _index = _this$_notAnimatedSta2._index, + _pagesVisible = _this$_notAnimatedSta2._pagesVisible, + _width = _this$_notAnimatedSta2._width, + _scale = _this$_notAnimatedSta2._scale; + this._notAnimatedStatus._limits = this._computeLimits(_left, _panX, _index, _pagesVisible, _width, _scale); + + if (this.onScrollEndGestureListener) { + this.onScrollEndGestureListener(this._getEventObject()); + } + } + }, { + key: "_onPanBottomReached", + value: function _onPanBottomReached() { + if (this.onPanBottomReached) { + this.onPanBottomReached(); + } + } + }, { + key: "_onPanEndY", + value: function _onPanEndY(params) { + this._notAnimatedStatus._panY = params[0]; + + this._onPanEnd(); + } + }, { + key: "_onPanEnd", + value: function _onPanEnd() { + if (this.onEndGestureListener) { + this.onEndGestureListener((0, _extends2.default)({}, this._getEventObject(), { + isPan: true + })); + } + } + }, { + key: "_onPinchEnd", + value: function _onPinchEnd(params) { + this._notAnimatedStatus._scale = params[0]; + this._notAnimatedStatus._focalDisplacementX = params[1]; + this._notAnimatedStatus._focalDisplacementY = params[2]; + var _this$_notAnimatedSta3 = this._notAnimatedStatus, + _left = _this$_notAnimatedSta3._left, + _panX = _this$_notAnimatedSta3._panX, + _index = _this$_notAnimatedSta3._index, + _pagesVisible = _this$_notAnimatedSta3._pagesVisible, + _width = _this$_notAnimatedSta3._width, + _scale = _this$_notAnimatedSta3._scale; + this._notAnimatedStatus._limits = this._computeLimits(_left, _panX, _index, _pagesVisible, _width, _scale); + + if (this.onEndGestureListener) { + this.onEndGestureListener((0, _extends2.default)({}, this._getEventObject(), { + isPinch: params[3] === 0 + })); + } + } + }, { + key: "_onFit", + value: function _onFit() { + if (this.onFitListener) { + this.onFitListener(); + } + } + }, { + key: "_onUnFit", + value: function _onUnFit() { + if (this.onUnFitListener) { + this.onUnFitListener(); + } + } + }, { + key: "_onToggleFit", + value: function _onToggleFit() { + if (this.onToggleFitListener) { + this.onToggleFitListener(); + } + } + }, { + key: "_onLeftChange", + value: function _onLeftChange(_ref) { + var _ref2 = (0, _slicedToArray2.default)(_ref, 1), + limit = _ref2[0]; + + this._notAnimatedStatus._left = limit; + } + }, { + key: "_onRightChange", + value: function _onRightChange(_ref3) { + var _ref4 = (0, _slicedToArray2.default)(_ref3, 1), + limit = _ref4[0]; + + this._notAnimatedStatus._right = limit; + } + }, { + key: "_onTopChange", + value: function _onTopChange(_ref5) { + var _ref6 = (0, _slicedToArray2.default)(_ref5, 1), + limit = _ref6[0]; + + this._notAnimatedStatus._top = limit; + } + }, { + key: "_onBottomChange", + value: function _onBottomChange(_ref7) { + var _ref8 = (0, _slicedToArray2.default)(_ref7, 1), + limit = _ref8[0]; + + this._notAnimatedStatus._bottom = limit; + } + }, { + key: "_onLimitChange", + value: function _onLimitChange(_ref9) { + var _ref10 = (0, _slicedToArray2.default)(_ref9, 4), + left = _ref10[0], + top = _ref10[1], + right = _ref10[2], + bottom = _ref10[3]; + + this._notAnimatedStatus._left = left; + this._notAnimatedStatus._top = top; + this._notAnimatedStatus._right = right; + this._notAnimatedStatus._bottom = bottom; + } + }, { + key: "_isScaled", + value: function _isScaled() { + var _this$_notAnimatedSta4 = this._notAnimatedStatus, + _scale = _this$_notAnimatedSta4._scale, + _minScale = _this$_notAnimatedSta4._minScale; + return _scale > _minScale; + } + }, { + key: "panToLeft", + value: function panToLeft() { + this.keyPanXState.setValue(_$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + this.keyPanXValue.setValue(_zoomConstants.default.constants.PAN_TO_DIST); + } + }, { + key: "panToRight", + value: function panToRight() { + this.keyPanXState.setValue(_$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + this.keyPanXValue.setValue(-_zoomConstants.default.constants.PAN_TO_DIST); + } + }, { + key: "panToUp", + value: function panToUp() { + this.keyPanYState.setValue(_$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + this.keyPanYValue.setValue(_zoomConstants.default.constants.PAN_TO_DIST); + } + }, { + key: "panToDown", + value: function panToDown() { + this.keyPanYState.setValue(_$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + this.keyPanYValue.setValue(-_zoomConstants.default.constants.PAN_TO_DIST); + } + }, { + key: "scrollTo", + value: function scrollTo(index) { + var _this$_notAnimatedSta5 = this._notAnimatedStatus, + _minScale = _this$_notAnimatedSta5._minScale, + _nPages = _this$_notAnimatedSta5._nPages, + _pagesVisible = _this$_notAnimatedSta5._pagesVisible, + _isRtl = _this$_notAnimatedSta5._isRtl; + this.scale.setValue(_minScale); + + this._scrollToAnimated.setValue(0); + + this._scrollState.setValue(_$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + + this._currentPage.setValue((0, _$$_REQUIRE(_dependencyMap[10]).fixStartupIndex)(index, _nPages, _pagesVisible, _isRtl)); + } + }, { + key: "scrollPage", + value: function scrollPage(index) { + var _this$_notAnimatedSta6 = this._notAnimatedStatus, + _nPages = _this$_notAnimatedSta6._nPages, + _pagesVisible = _this$_notAnimatedSta6._pagesVisible, + _index = _this$_notAnimatedSta6._index, + _isRtl = _this$_notAnimatedSta6._isRtl; + var twoPageVisible = _pagesVisible === 2; + var isLeftSwipe = index < _index; + var isRightSwipe = !isLeftSwipe; + var firstOrSecondLast = _index === 0 || _index === _nPages - 2; + var secondOrLast = _index === 1 || _index === _nPages - 1; + var odd = _index % 2 === 1; + var nPagesToSwipe; + + if (_isRtl && _nPages % 2 === 1) { + nPagesToSwipe = !twoPageVisible || isRightSwipe && secondOrLast || isLeftSwipe && firstOrSecondLast || odd ? 1 : _pagesVisible; + } else { + nPagesToSwipe = !twoPageVisible || isRightSwipe && firstOrSecondLast || isLeftSwipe && secondOrLast || !odd ? 1 : _pagesVisible; + } + + var newIndex = isRightSwipe ? _index + nPagesToSwipe : _index - nPagesToSwipe; + + this._currentPage.setValue(newIndex); + + this._scrollToAnimated.setValue(1); + + this._scrollState.setValue(_$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + } + }, { + key: "zoomTo", + value: function zoomTo(nativeEvent) { + var scale = nativeEvent.scale; + var x = nativeEvent.x, + y = nativeEvent.y; + var _this$_notAnimatedSta7 = this._notAnimatedStatus, + _scale = _this$_notAnimatedSta7._scale, + _minScale = _this$_notAnimatedSta7._minScale; + + if (_scale > _minScale) { + scale = _minScale; + } + + this.zoom({ + x: x, + y: y + }, scale); + } + }, { + key: "zoom", + value: function zoom(_ref11, scale) { + var x = _ref11.x, + y = _ref11.y; + var _this$_notAnimatedSta8 = this._notAnimatedStatus, + _minScale = _this$_notAnimatedSta8._minScale, + _maxScale = _this$_notAnimatedSta8._maxScale; + var scaleToGo = Math.min(Math.max(scale, _minScale), _maxScale); + + this._onPinchStart(); + + this._zoomToState.setValue(_$$_REQUIRE(_dependencyMap[7]).State.ACTIVE); + + var _this$_adjustDrag = this._adjustDrag({ + x: x, + y: y + }, scaleToGo), + dragX = _this$_adjustDrag.dragX, + dragY = _this$_adjustDrag.dragY; + + this._zoomToDragX.setValue(dragX); + + this._zoomToDragY.setValue(dragY); + + this._pinchFocalX.setValue(x); + + this._pinchFocalY.setValue(y); + + this._zoomToValue.setValue(scaleToGo); + } + }, { + key: "_adjustDrag", + value: function _adjustDrag(_ref12, scale) { + var x = _ref12.x, + y = _ref12.y; + var _this$_notAnimatedSta9 = this._notAnimatedStatus, + _viewHeight = _this$_notAnimatedSta9._viewHeight, + _minScale = _this$_notAnimatedSta9._minScale; + var dragY = 0; + + if (scale > _minScale) { + if (y < _viewHeight / 4) { + dragY = 50; + } else if (y > _viewHeight * 3 / 4) { + dragY = -50; + } + } + + return { + dragX: 0, + dragY: dragY + }; + } + }, { + key: "setLayout", + value: function setLayout(_ref13) { + var width = _ref13.width, + height = _ref13.height; + + this._layout.width.setValue(width); + + this._layout.height.setValue(height); + } + }, { + key: "setContentLayout", + value: function setContentLayout(_ref14) { + var width = _ref14.width, + height = _ref14.height; + this._notAnimatedStatus._width = width; + this._notAnimatedStatus._height = height; + + this._contentLayout.width.setValue(width); + + this._contentLayout.height.setValue(height); + } + }, { + key: "setInitialPage", + value: function setInitialPage(index) {} + }, { + key: "setOnStartGestureListener", + value: function setOnStartGestureListener(listener) { + this.onStartGestureListener = listener; + } + }, { + key: "setOnEndGestureListener", + value: function setOnEndGestureListener(listener) { + this.onEndGestureListener = listener; + } + }, { + key: "setOnPanBottomReached", + value: function setOnPanBottomReached(listener) { + this.onPanBottomReached = listener; + } + }, { + key: "setOnScrollEndGestureListener", + value: function setOnScrollEndGestureListener(listener) { + this.onScrollEndGestureListener = listener; + } + }, { + key: "setOnStartScrollGestureListener", + value: function setOnStartScrollGestureListener(listener) { + this.onScrollStartGestureListener = listener; + } + }, { + key: "setOnSwipeOnLastPageListener", + value: function setOnSwipeOnLastPageListener(listener) { + this.onSwipeOnLastPageListener = listener; + } + }, { + key: "setOnFitListener", + value: function setOnFitListener(listener) { + this.onFitListener = listener; + } + }, { + key: "setOnUnFitListener", + value: function setOnUnFitListener(listener) { + this.onUnFitListener = listener; + } + }, { + key: "setOnToggleFitListener", + value: function setOnToggleFitListener(listener) { + this.onToggleFitListener = listener; + } + }, { + key: "setProps", + value: function setProps(_ref15) { + var maxScale = _ref15.maxScale; + this._notAnimatedStatus._maxScale = maxScale; + + this._maxScale.setValue(maxScale); + } + }]); + return ZoomViewPagerMgr; + }(); + + exports.default = ZoomViewPagerMgr; +},2409,[5,41,6,7,8,646,2165,1,2410,2411,645]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.pinchMgr = pinchMgr; + + var _reactNativeReanimated = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _zoomConstants = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var add = _reactNativeReanimated.default.add, + sub = _reactNativeReanimated.default.sub, + abs = _reactNativeReanimated.default.abs, + round = _reactNativeReanimated.default.round, + set = _reactNativeReanimated.default.set, + cond = _reactNativeReanimated.default.cond, + Value = _reactNativeReanimated.default.Value, + and = _reactNativeReanimated.default.and, + or = _reactNativeReanimated.default.or, + eq = _reactNativeReanimated.default.eq, + multiply = _reactNativeReanimated.default.multiply, + lessThan = _reactNativeReanimated.default.lessThan, + greaterThan = _reactNativeReanimated.default.greaterThan, + divide = _reactNativeReanimated.default.divide, + max = _reactNativeReanimated.default.max, + min = _reactNativeReanimated.default.min, + debug = _reactNativeReanimated.default.debug, + clockRunning = _reactNativeReanimated.default.clockRunning, + stopClock = _reactNativeReanimated.default.stopClock, + not = _reactNativeReanimated.default.not, + call = _reactNativeReanimated.default.call, + Clock = _reactNativeReanimated.default.Clock; + + function scaleRest(minScale, maxScale, value) { + return cond(greaterThan(value, maxScale), maxScale, cond(lessThan(value, minScale), minScale, value)); + } + + function scaleFriction(value, rest, delta) { + var MAX_FRICTION = 20; + var MAX_VALUE = 0.5; + var res = multiply(value, delta); + var howFar = abs(sub(rest, value)); + var animatedFriction = max(1, min(MAX_FRICTION, add(1, multiply(howFar, 38)))); + return cond(lessThan(0, howFar), multiply(value, add(1, divide(add(delta, -1), animatedFriction))), res); + } + + function fitValue(scale, contentWidth, viewWidth) { + return greaterThan(multiply(round(contentWidth), scale), round(viewWidth)); + } + + function hMargin(scale, minScale, contentWidth, viewWidth, pagesVisible) { + var margin = max(divide(sub(viewWidth, multiply(contentWidth, max(minScale, scale), pagesVisible)), 2), 0); + return [debug("HORIZONTAL MARGIN: ", margin), margin]; + } + + function topConstraint(scale, minScale, displacementY) { + var limit = multiply(displacementY, -1); + return [debug("TOP: ", limit), limit]; + } + + function bottomConstraint(top, scale, minScale, height, viewHeight) { + var limit = sub(top, sub(multiply(max(height, viewHeight), max(minScale, scale)), viewHeight)); + return [debug("BOTTOM: ", limit), limit]; + } + + function leftConstraint(scale, minScale, displacementX) { + var limit = cond(lessThan(scale, minScale), 0, multiply(displacementX, -1)); + return [debug("LEFT: ", limit), limit]; + } + + function rightConstraint(left, scale, width, pages, pagesVisible) { + var limit = add(left, multiply(max(1, scale), pages, width, -1), multiply(width, pagesVisible)); + return [debug("RIGHT: ", limit), limit]; + } + + function pinchMgr(starting, pinchStart, pinchActive, pinchEnd, pinchOldState, pinchScale, value, relativeFocalX, relativeFocalY, displacementX, displacementY, minScale, maxScale, onStart, onEnd, nPages, pagesVisible, isFitMode, fit, isFitted, onFit, onUnFit, width, height, viewWidth, viewHeight, horizontalMargin, toggleFit, zoomToState, zoomToValue, scrollNotAnimated, leftLimit, topLimit, rightLimit, bottomLimit, onUpdateLimit) { + var clock = new Clock(); + var nextScale = new Value(1); + var scaleToRet = new Value(1); + var finishPinch = new Value(0); + var isStartScaleEqualToMinScale = new Value(0); + var zoomToActive = eq(zoomToState, _$$_REQUIRE(_dependencyMap[3]).State.ACTIVE); + var zoomClock = new Clock(); + var tmpDelta = new Value(1); + var prevPinchScale = new Value(1); + var delta = [set(tmpDelta, divide(pinchScale, prevPinchScale)), set(prevPinchScale, pinchScale), tmpDelta]; + var variation = multiply(value, delta); + var rest = scaleRest(minScale, maxScale, value); + var focalXRest = cond(lessThan(value, minScale), 0, sub(displacementX, multiply(relativeFocalX, add(-1, divide(rest, value))))); + var focalYRest = cond(lessThan(value, minScale), 0, sub(displacementY, multiply(relativeFocalY, add(-1, divide(rest, value))))); + var enableFriction = or(clockRunning(clock), and(isFitMode, lessThan(variation, minScale), eq(isStartScaleEqualToMinScale, 1))); + var checkToggleFit = cond(and(isFitMode, lessThan(add(variation, _zoomConstants.default.constants.TOGGLE_FIT_VARIATION), minScale)), [debug("SCALE X:", divide(viewWidth, width)), stopClock(clock), call([], toggleFit)]); + var nextScaleRest = cond(enableFriction, scaleFriction(value, rest, delta), scaleRest(minScale, maxScale, variation)); + return [set(scaleToRet, cond(scrollNotAnimated, [set(nextScale, minScale), debug("PINCH BY SCROLL NOT ANIMATED: ", nextScale), set(finishPinch, 1), nextScale], cond(zoomToActive, [cond(not(clockRunning(zoomClock)), [debug("ZOOM TO START: ", value), call([], onStart)]), set(nextScale, (0, _$$_REQUIRE(_dependencyMap[4]).runTiming)(zoomClock, value, zoomToValue, { + duration: _zoomConstants.default.constants.ZOOM_TO_DURATION + })), set(displacementX, sub(displacementX, multiply(relativeFocalX, add(-1, divide(nextScale, value))))), set(displacementY, sub(displacementY, multiply(relativeFocalY, add(-1, divide(nextScale, value))))), debug("ZOOM TO: ", nextScale), cond(not(clockRunning(zoomClock)), [debug("ZOOM TO END: ", nextScale), set(zoomToState, _$$_REQUIRE(_dependencyMap[3]).State.END), set(finishPinch, 1)]), nextScale], cond([delta, pinchActive], [stopClock(clock), set(nextScale, nextScaleRest), set(displacementX, sub(displacementX, multiply(relativeFocalX, add(-1, divide(nextScale, value))))), set(displacementY, sub(displacementY, multiply(relativeFocalY, add(-1, divide(nextScale, value))))), debug("SCALE: ", nextScale), nextScale], cond(enableFriction, [debug("SCALE BOUNCY: ", rest), checkToggleFit, set(displacementX, (0, _$$_REQUIRE(_dependencyMap[4]).runTiming)(clock, displacementX, focalXRest, { + startStopClock: false + })), set(displacementY, (0, _$$_REQUIRE(_dependencyMap[4]).runTiming)(clock, displacementY, focalYRest, { + startStopClock: false + })), (0, _$$_REQUIRE(_dependencyMap[4]).runTiming)(clock, value, rest)], cond(pinchEnd, [set(displacementX, focalXRest), set(displacementY, focalYRest), set(finishPinch, 1), debug("SCALE TO END: ", rest), rest], [debug("SCALE START: ", value), set(isStartScaleEqualToMinScale, cond(eq(value, minScale), 1, 0)), cond(or(pinchStart, eq(starting, 1)), [set(starting, 0), call([starting], onStart)]), value])))))), set(leftLimit, leftConstraint(scaleToRet, minScale, displacementX)), set(topLimit, topConstraint(scaleToRet, minScale, displacementY)), set(rightLimit, rightConstraint(leftLimit, scaleToRet, width, nPages, pagesVisible)), set(bottomLimit, bottomConstraint(topLimit, scaleToRet, minScale, height, viewHeight)), set(fit, fitValue(scaleToRet, width, viewWidth)), set(horizontalMargin, hMargin(scaleToRet, minScale, width, viewWidth, pagesVisible)), cond(eq(finishPinch, 1), [call([leftLimit, topLimit, rightLimit, bottomLimit], onUpdateLimit), cond(isFitted, call([], onFit), call([], onUnFit)), call([scaleToRet, displacementX, displacementY, zoomToActive], onEnd), set(finishPinch, 0), set(pinchOldState, _$$_REQUIRE(_dependencyMap[3]).State.UNDETERMINED), set(prevPinchScale, 1), set(pinchScale, 1)]), scaleToRet]; + } +},2410,[5,646,2165,1,645]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.panXMgr = panXMgr; + exports.panYMgr = panYMgr; + + var _reactNativeReanimated = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0])); + + var _zoomConstants = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var add = _reactNativeReanimated.default.add, + sub = _reactNativeReanimated.default.sub, + modulo = _reactNativeReanimated.default.modulo, + abs = _reactNativeReanimated.default.abs, + floor = _reactNativeReanimated.default.floor, + round = _reactNativeReanimated.default.round, + set = _reactNativeReanimated.default.set, + cond = _reactNativeReanimated.default.cond, + Value = _reactNativeReanimated.default.Value, + and = _reactNativeReanimated.default.and, + or = _reactNativeReanimated.default.or, + eq = _reactNativeReanimated.default.eq, + multiply = _reactNativeReanimated.default.multiply, + lessThan = _reactNativeReanimated.default.lessThan, + greaterThan = _reactNativeReanimated.default.greaterThan, + divide = _reactNativeReanimated.default.divide, + max = _reactNativeReanimated.default.max, + debug = _reactNativeReanimated.default.debug, + clockRunning = _reactNativeReanimated.default.clockRunning, + stopClock = _reactNativeReanimated.default.stopClock, + not = _reactNativeReanimated.default.not, + call = _reactNativeReanimated.default.call, + Clock = _reactNativeReanimated.default.Clock; + + function fixStartupAnimatedIndex(index, nPages, pagesVisible) { + var isRtl = eq(_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isRTL(), true); + var oddPages = eq(modulo(nPages, 2), 1); + var oddPage = eq(modulo(index, 2), 1); + return cond(eq(pagesVisible, 1), index, cond(eq(index, 0), index, cond(eq(index, add(nPages, -1)), add(index, -1), cond(and(isRtl, oddPages, not(oddPage)), index, cond(and(isRtl, oddPages, not(oddPage)), add(index, -1), cond(and(isRtl, not(oddPage)), add(index, -1), cond(oddPage, index, add(index, -1)))))))); + } + + function scaleDiff(value) { + var tmp = new Value(1); + var prev = new Value(1); + return [set(tmp, divide(value, prev)), set(prev, value), tmp]; + } + + function dragDiff(value, updating) { + var tmp = new Value(0); + var prev = new Value(0); + return cond(updating, [set(tmp, sub(value, prev)), set(prev, value), tmp], set(prev, 0)); + } + + function panRest(top, bottom, value) { + return cond(lessThan(value, bottom), bottom, cond(greaterThan(value, top), top, value)); + } + + function getIndex(x, width, scale, left) { + var scaledWidth = multiply(width, scale); + var translationX = sub(left, x); + var mod = sub(scaledWidth, abs(modulo(translationX, scaledWidth))); + var temp = abs(divide(translationX, scaledWidth)); + var floorTemp = max(floor(temp), 0); + var roundTemp = max(round(temp), 0); + var page = cond(greaterThan(mod, multiply(width, 0.5)), floorTemp, roundTemp); + return [debug("PAGE: ", page), page]; + } + + function panXMgr(panStart, panActive, panEnd, panCancelled, scrollState, scrollAnimated, value, drag, velocityX, enableAnimation, left, right, isLandscape, isFitted, width, snapSize, whiteMargin, index, scale, minScale, pagesVisible, nPages, onStart, onEnd, onScrollStart, onScrollEnd, valueY, top, isTablet, zoomActive, zoomToDragX, isRtl, keyPanState, keyPanValue) { + var clockSwipe = new Clock(); + var clockMagnetic = new Clock(); + var clockAlign = new Clock(); + var keyPanClock = new Clock(); + var rest = panRest(left, right, value); + var areTwoPagesVisible = eq(pagesVisible, 2); + var pageScaledWidth = multiply(width, scale); + var pagesScaledWidth = multiply(pageScaledWidth, pagesVisible); + var visibleAreaWidth = add(multiply(width, pagesVisible), whiteMargin, whiteMargin); + var scaledSnapSize = max(0, sub(multiply(snapSize, scale), _zoomConstants.default.constants.SNAP_PADDING)); + var maxVelocityX = new Value(0); + var scaleDelta = scaleDiff(scale); + var isScaling = not(eq(scaleDelta, 1)); + var isScalingDown = lessThan(scaleDelta, 1); + var isSwiping = or(clockRunning(clockSwipe), and(greaterThan(abs(maxVelocityX), cond(areTwoPagesVisible, _zoomConstants.default.constants.VIEW_PAGER_VELOCITY_2PAGES, _zoomConstants.default.constants.VIEW_PAGER_VELOCITY_1PAGE)), panEnd, enableAnimation, not(isFitted))); + var isMagnetic = or(clockRunning(clockMagnetic), and(enableAnimation, greaterThan(abs(maxVelocityX), _zoomConstants.default.constants.MAGNETIC_PAN_VELOCITY_X), isFitted, panEnd)); + var isLeftSwipe = greaterThan(maxVelocityX, 0); + var isRightSwipe = not(isLeftSwipe); + var odd = eq(modulo(index, 2), 1); + var oddPages = eq(modulo(nPages, 2), 1); + var isFirstPage = eq(index, 0); + var isSecondPage = eq(index, 1); + var isSecondLast = eq(index, add(nPages, -2)); + var isLastPage = eq(index, add(nPages, -1)); + var firstOrSecondLast = or(isFirstPage, isSecondLast); + var secondOrLast = or(isSecondPage, isLastPage); + var rtlAndOddPagesToSwipe = cond(or(not(areTwoPagesVisible), and(isRightSwipe, secondOrLast), and(isLeftSwipe, firstOrSecondLast), odd), 1, pagesVisible); + var pagesToSwipe = cond(or(not(areTwoPagesVisible), and(isRightSwipe, firstOrSecondLast), and(isLeftSwipe, secondOrLast), not(odd)), 1, pagesVisible); + var nPagesToSwipe = cond(and(isRtl, oddPages), rtlAndOddPagesToSwipe, pagesToSwipe); + var fixedIndex = fixStartupAnimatedIndex(index, nPages, pagesVisible); + var visiblePageLeftBorder = sub(left, multiply(pageScaledWidth, fixedIndex), whiteMargin); + var visiblePageRightBorder = sub(visiblePageLeftBorder, multiply(pageScaledWidth, pagesVisible)); + var paperPageLeftBorder = cond(areTwoPagesVisible, cond(isFirstPage, sub(left, whiteMargin), cond(isLastPage, sub(left, multiply(pageScaledWidth, index), whiteMargin), cond(isSecondLast, cond(isFitted, sub(left, multiply(pageScaledWidth, add(index, -1)), whiteMargin), sub(left, multiply(pageScaledWidth, index), whiteMargin)), visiblePageLeftBorder))), visiblePageLeftBorder); + var paperPageRightBorder = cond(areTwoPagesVisible, [cond(isFirstPage, cond(isFitted, sub(paperPageLeftBorder, pageScaledWidth), sub(paperPageLeftBorder, pagesScaledWidth)), cond(isSecondLast, sub(paperPageLeftBorder, pagesScaledWidth), visiblePageRightBorder))], visiblePageRightBorder); + var magneticFactor = cond(areTwoPagesVisible, _zoomConstants.default.constants.MAGNETIC_PAN_X_FACTOR_2PAGES, _zoomConstants.default.constants.MAGNETIC_PAN_X_FACTOR_1PAGE); + var absoluteVariation = multiply(width, pagesVisible, magneticFactor); + var tempDestination = add(rest, cond(isLeftSwipe, absoluteVariation, multiply(absoluteVariation, -1))); + var magneticDestination = panRest(left, right, cond(isLeftSwipe, cond(and(greaterThan(tempDestination, paperPageLeftBorder), lessThan(rest, paperPageLeftBorder)), paperPageLeftBorder, cond(lessThan(abs(sub(add(paperPageLeftBorder, visibleAreaWidth), tempDestination)), scaledSnapSize), add(paperPageLeftBorder, visibleAreaWidth), tempDestination)), cond(and(lessThan(tempDestination, add(paperPageRightBorder, visibleAreaWidth)), greaterThan(rest, add(visibleAreaWidth, paperPageRightBorder))), add(paperPageRightBorder, visibleAreaWidth), cond(lessThan(abs(sub(paperPageRightBorder, tempDestination)), scaledSnapSize), paperPageRightBorder, tempDestination)))); + var scrollActive = eq(scrollState, _$$_REQUIRE(_dependencyMap[4]).State.ACTIVE); + var scrollAnimatedActive = eq(scrollAnimated, 1); + var newIndex = cond(scrollActive, index, cond(isRightSwipe, add(index, nPagesToSwipe), sub(index, nPagesToSwipe))); + var swipeDestination = add(multiply(pageScaledWidth, newIndex), whiteMargin); + var absolutePanX = add(multiply(-1, left), cond(scrollActive, value, sub(value, drag))); + var fixedSwipeDestination = panRest(left, right, cond(and(or(not(scrollActive), scrollAnimatedActive), greaterThan(abs(sub(abs(absolutePanX), swipeDestination)), multiply(pagesScaledWidth, 1.25))), cond(greaterThan(value, sub(left, swipeDestination)), sub(left, multiply(pageScaledWidth, sub(newIndex, 1)), whiteMargin), sub(left, multiply(pageScaledWidth, add(newIndex, 1)), whiteMargin)), sub(left, swipeDestination))); + var diffX = dragDiff(drag, panActive); + var panDestination = panRest(left, right, add(value, diffX)); + var nearLeft = lessThan(abs(sub(paperPageLeftBorder, rest)), scaledSnapSize); + var nearRight = lessThan(abs(sub(paperPageRightBorder, sub(rest, visibleAreaWidth))), scaledSnapSize); + var nextValue = new Value(0); + var alignToTop = cond(and(not(eq(valueY, top)), or(enableAnimation, scrollAnimatedActive), clockRunning(clockSwipe)), [debug("ALIGN TOP:", valueY), set(valueY, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(clockSwipe, valueY, top, { + startStopClock: false + }))]); + var enableSnap = or(clockRunning(clockAlign), and(greaterThan(abs(maxVelocityX), 0), or(and(isLeftSwipe, nearLeft), and(isRightSwipe, nearRight)))); + var snapTiming = (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(clockAlign, rest, cond(nearLeft, paperPageLeftBorder, add(paperPageRightBorder, visibleAreaWidth)), { + duration: _zoomConstants.default.constants.SNAP_VELOCITY + }); + var tempDragX = new Value(0); + var tempPan = new Value(0); + var zoomClock = new Clock(); + return cond(or(eq(keyPanState, _$$_REQUIRE(_dependencyMap[4]).State.ACTIVE), clockRunning(keyPanClock)), [cond(not(clockRunning(keyPanClock)), set(tempPan, value)), set(tempDragX, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(keyPanClock, 0, keyPanValue, { + duration: _zoomConstants.default.constants.ZOOM_TO_DURATION + })), set(value, panRest(left, right, add(tempPan, tempDragX))), set(index, getIndex(value, width, scale, left)), cond(not(clockRunning(keyPanClock)), [set(keyPanState, _$$_REQUIRE(_dependencyMap[4]).State.UNDETERMINED), set(keyPanValue, 0), call([value, index], onEnd)]), value], cond(or(zoomActive, clockRunning(zoomClock)), [set(tempDragX, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(zoomClock, 0, zoomToDragX, { + duration: _zoomConstants.default.constants.ZOOM_TO_DURATION + })), set(tempPan, cond(isScalingDown, panRest(visiblePageLeftBorder, add(visiblePageRightBorder, multiply(width, pagesVisible)), add(value, dragDiff(tempDragX, zoomActive))), add(value, dragDiff(tempDragX, zoomActive)))), set(index, getIndex(tempPan, width, scale, left)), cond(not(clockRunning(zoomClock)), [call([tempPan, index], onEnd)]), tempPan], cond(scrollActive, [cond(not(clockRunning(clockSwipe)), [debug("SCROLL START", nextValue), call([], onScrollStart)]), cond(scrollAnimatedActive, [alignToTop, debug("SCROLL FIXED: ", fixedSwipeDestination), set(nextValue, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(clockSwipe, rest, fixedSwipeDestination, { + duration: _zoomConstants.default.constants.VIEW_PAGER_SWIPE_DURATION + }))], [set(nextValue, fixedSwipeDestination), set(valueY, top)]), cond(or(not(scrollAnimatedActive), not(clockRunning(clockSwipe))), [debug("SCROLL END X: ", nextValue), set(index, getIndex(nextValue, width, scale, left)), set(scrollState, _$$_REQUIRE(_dependencyMap[4]).State.END), call([nextValue, index], onScrollEnd)]), nextValue], cond(isSwiping, [cond(not(clockRunning(clockSwipe)), [debug("SWIPE START", nextValue), call([], onScrollStart)]), alignToTop, set(nextValue, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(clockSwipe, rest, fixedSwipeDestination, { + duration: _zoomConstants.default.constants.VIEW_PAGER_SWIPE_DURATION + })), cond(not(clockRunning(clockSwipe)), [debug("SWIPE END X: ", nextValue), set(maxVelocityX, 0), set(drag, 0), set(index, getIndex(nextValue, width, scale, left)), call([nextValue, index], onScrollEnd)]), nextValue], cond([diffX, velocityX, panActive], [stopClock(clockMagnetic), cond(not(isScaling), cond(greaterThan(abs(velocityX), 0), set(maxVelocityX, velocityX)), set(maxVelocityX, 0)), set(velocityX, 0), debug("PAN ACTIVE MAX VELOCITY X: ", maxVelocityX), panDestination], cond(and(panEnd, not(panCancelled)), cond(isMagnetic, [set(nextValue, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(clockMagnetic, rest, magneticDestination)), cond(not(clockRunning(clockMagnetic)), [debug("MAGNETIC END X: ", nextValue), set(maxVelocityX, 0), set(index, getIndex(nextValue, width, scale, left)), call([nextValue, index], onEnd)]), nextValue], [set(index, getIndex(rest, width, scale, left)), debug("PAN END VELOCITY X: ", maxVelocityX), cond(enableSnap, [debug("SNAP X: ", rest), set(nextValue, snapTiming), cond(not(clockRunning(clockAlign)), [call([nextValue, index], onEnd)]), nextValue], [debug("PAN END X: ", rest), set(maxVelocityX, 0), call([rest, index], onEnd), rest])]), [cond(panStart, [debug("PAN START X: ", rest), call([], onStart)]), set(index, getIndex(rest, width, scale, left)), cond(panCancelled, [stopClock(clockMagnetic), call([rest, index], onEnd), set(maxVelocityX, 0)]), rest])))))); + } + + function panYMgr(panStart, panActive, panEnd, panCancelled, value, drag, velocityY, enableAnimation, top, bottom, isLandscape, scale, height, parentHeight, onStart, onEnd, onBottomReached, zoomActive, zoomToDragY, keyPanState, keyPanValue) { + var clockMagnetic = new Clock(); + var scaleDelta = scaleDiff(scale); + var isScaling = not(eq(scaleDelta, 1)); + var maxVelocityY = new Value(0); + var diffY = dragDiff(drag, panActive); + var rest = panRest(top, bottom, value); + var isMagneting = or(clockRunning(clockMagnetic), and(enableAnimation, greaterThan(abs(maxVelocityY), _zoomConstants.default.constants.MAGNETIC_PAN_VELOCITY_Y))); + var absoluteVariation = multiply(parentHeight, cond(isLandscape, _zoomConstants.default.constants.MAGNETIC_PAN_Y_FACTOR_LANDSCAPE, _zoomConstants.default.constants.MAGNETIC_PAN_Y_FACTOR_PORTRAIT)); + var variation = cond(greaterThan(maxVelocityY, 0), absoluteVariation, multiply(absoluteVariation, -1)); + var magneticDestination = panRest(top, bottom, add(rest, variation)); + var nextMagneticValue = new Value(0); + var tempDragY = new Value(0); + var tempPan = new Value(0); + var zoomClock = new Clock(); + var keyPanClock = new Clock(); + var bottomReachedCalled = new Value(0); + return cond(or(eq(keyPanState, _$$_REQUIRE(_dependencyMap[4]).State.ACTIVE), clockRunning(keyPanClock)), [cond(not(clockRunning(keyPanClock)), set(tempPan, value)), set(tempDragY, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(keyPanClock, 0, keyPanValue, { + duration: _zoomConstants.default.constants.ZOOM_TO_DURATION + })), set(value, panRest(top, bottom, add(tempPan, tempDragY))), cond(not(clockRunning(keyPanClock)), [set(keyPanState, _$$_REQUIRE(_dependencyMap[4]).State.UNDETERMINED), set(tempDragY, 0), set(keyPanValue, 0), call([value], onEnd)]), value], cond(or(zoomActive, clockRunning(zoomClock)), [cond(not(clockRunning(zoomClock)), set(tempPan, value)), set(tempDragY, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(zoomClock, 0, zoomToDragY, { + duration: _zoomConstants.default.constants.ZOOM_TO_DURATION + })), set(value, panRest(top, bottom, add(tempPan, tempDragY))), cond(not(clockRunning(zoomClock)), [set(tempDragY, 0), set(zoomToDragY, 0), call([value], onEnd)]), value], cond([diffY, velocityY, panActive], [stopClock(clockMagnetic), cond(not(isScaling), cond(greaterThan(abs(velocityY), 0), set(maxVelocityY, velocityY)), set(maxVelocityY, 0)), cond(and(eq(bottomReachedCalled, 0), (0, _reactNativeReanimated.lessOrEq)(value, bottom), lessThan(drag, -_zoomConstants.default.constants.VERTICAL_THRESHOLD)), [set(bottomReachedCalled, 1), call([], onBottomReached)]), set(velocityY, 0), debug("VELOCITY Y: ", maxVelocityY), panRest(top, bottom, add(value, diffY))], cond(and(panEnd, not(panCancelled)), cond(isMagneting, [set(nextMagneticValue, (0, _$$_REQUIRE(_dependencyMap[5]).runTiming)(clockMagnetic, rest, magneticDestination)), cond(not(clockRunning(clockMagnetic)), [debug("MAGNETIC END Y: ", nextMagneticValue), set(bottomReachedCalled, 0), set(maxVelocityY, 0), call([nextMagneticValue], onEnd)]), nextMagneticValue], [debug("PAN END Y: ", rest), stopClock(zoomClock), call([rest], onEnd), set(bottomReachedCalled, 0), set(maxVelocityY, 0), rest]), [cond(panStart, [debug("PAN START Y: ", value), call([], onStart)]), cond(panCancelled, [debug("PAN CANCELLED Y: ", value), stopClock(clockMagnetic), call([rest], onEnd), set(bottomReachedCalled, 0), set(maxVelocityY, 0)]), rest])))); + } +},2411,[646,5,2165,462,1,645]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _zoomClickEvent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var TapViewPagerManager = function () { + function TapViewPagerManager(props) { + (0, _classCallCheck2.default)(this, TapViewPagerManager); + this.props = props; + this.isFitted = false; + this.onTwoFingersTap = this._onTwoFingersTap.bind(this); + this.onDoubleTap = this._onDoubleTap.bind(this); + this.onTap = this._onTap.bind(this); + this.onLongPress = this._onLongPress.bind(this); + } + + (0, _createClass2.default)(TapViewPagerManager, [{ + key: "setProps", + value: function setProps(props) { + this.props = props; + } + }, { + key: "_getClickedPosition", + value: function _getClickedPosition(_ref) { + var x = _ref.x, + y = _ref.y; + var model = new _zoomClickEvent.default(); + + if (this.gestureEvent) { + var _this$gestureEvent = this.gestureEvent, + _left = _this$gestureEvent._left, + _top = _this$gestureEvent._top, + pageLimits = _this$gestureEvent._limits, + index = _this$gestureEvent._index, + panX = _this$gestureEvent._panX, + panY = _this$gestureEvent._panY, + width = _this$gestureEvent._width, + height = _this$gestureEvent._height, + scale = _this$gestureEvent._scale; + var _this$props = this.props, + size = _this$props.size, + minScale = _this$props.minScale, + numberOfShowedPages = _this$props.numberOfShowedPages; + var scaledWidth = width * Math.max(minScale, scale); + var margin = Math.max((size.width - width * minScale * numberOfShowedPages) / 2, 0); + var scaledMargin = Math.max((size.width - scaledWidth * numberOfShowedPages) / 2, 0); + var clickableMargin = margin - scaledMargin; + var absolutePanX = -1 * _left + panX + clickableMargin; + var absolutePanY = -1 * _top + panY; + model.setOffsetX(absolutePanX); + model.setOffsetY(absolutePanY); + var clickX = 0; + var clickIndex = index; + + for (var i = 1; i < pageLimits.length; i++) { + var prevLimit = pageLimits[i - 1]; + var nextLimit = pageLimits[i]; + var absoluteClickX = absolutePanX - x; + + if (absoluteClickX > nextLimit) { + clickX = Math.abs(prevLimit - absoluteClickX); + clickIndex = Math.floor(Math.abs(absoluteClickX) / scaledWidth); + break; + } + } + + model.setX(clickX); + model.setIndex(clickIndex); + model.setY(Math.abs(absolutePanY - y)); + model.setScale(scale); + model.setContentWidth(width); + model.setContentHeight(height); + model.setGreaterThanFit(this.isFitted); + } + + return model; + } + }, { + key: "_computeScaleToGo", + value: function _computeScaleToGo() { + var _this$props2 = this.props, + zoomingFactor = _this$props2.zoomingFactor, + contentSize = _this$props2.contentSize, + dipsScale = _this$props2.dipsScale; + var scale = dipsScale() * zoomingFactor / contentSize.width; + return scale; + } + }, { + key: "_autoZoom", + value: function _autoZoom(event) { + var scale = this._computeScaleToGo(); + + var x = event.x, + y = event.y, + numTaps = event.numTaps; + + this._applyScale({ + scale: scale, + x: x, + y: y, + numTaps: numTaps + }); + } + }, { + key: "_applyScale", + value: function _applyScale(_ref2) { + var scale = _ref2.scale, + _ref2$x = _ref2.x, + x = _ref2$x === undefined ? 0 : _ref2$x, + _ref2$y = _ref2.y, + y = _ref2$y === undefined ? 0 : _ref2$y, + _ref2$numTaps = _ref2.numTaps, + numTaps = _ref2$numTaps === undefined ? 1 : _ref2$numTaps; + var minScale = this.props.minScale; + var newScale = scale || minScale; + this.onAutoZoomListener({ + scale: newScale, + x: x, + y: y, + numTaps: numTaps + }); + } + }, { + key: "_getFitScale", + value: function _getFitScale() { + var _this$props3 = this.props, + size = _this$props3.size, + contentSize = _this$props3.contentSize; + var fitScale = size.width / contentSize.width; + return fitScale; + } + }, { + key: "_isGreaterThanFitZoom", + value: function _isGreaterThanFitZoom() { + var _scale = this.gestureEvent._scale; + return _scale > this._getFitScale() * 1.1; + } + }, { + key: "_onTwoFingersTap", + value: function _onTwoFingersTap(_ref3) { + var nativeEvent = _ref3.nativeEvent; + var _this$props4 = this.props, + twoFingerTapEnabled = _this$props4.twoFingerTapEnabled, + onTwoFingersTap = _this$props4.onTwoFingersTap, + onSingleTap = _this$props4.onSingleTap; + + if (typeof twoFingerTapEnabled === "function" && twoFingerTapEnabled()) { + if (typeof onTwoFingersTap === "function") { + onTwoFingersTap(this._getClickedPosition(nativeEvent)); + } + } else if (typeof onSingleTap === "function") { + onSingleTap(this._getClickedPosition(nativeEvent)); + } + } + }, { + key: "_onDoubleTap", + value: function _onDoubleTap(_ref4) { + var nativeEvent = _ref4.nativeEvent; + var onDoubleTap = this.props.onDoubleTap; + var customHandle = typeof onDoubleTap === "function" && !this._isGreaterThanFitZoom() && onDoubleTap(this._getClickedPosition(nativeEvent)); + + if (!customHandle) { + this._autoZoom((0, _extends2.default)({}, nativeEvent, { + numTaps: 2 + })); + } + } + }, { + key: "_onTap", + value: function _onTap(_ref5) { + var nativeEvent = _ref5.nativeEvent; + var _this$props5 = this.props, + onExtraTap = _this$props5.onExtraTap, + onSingleTap = _this$props5.onSingleTap, + singleTapToZoom = _this$props5.singleTapToZoom; + + if (typeof onExtraTap !== "function" || !onExtraTap(this._getClickedPosition(nativeEvent))) { + if (typeof singleTapToZoom === "function" && singleTapToZoom() || !_$$_REQUIRE(_dependencyMap[5]).PlatformUtils.isTablet() && this._isGreaterThanFitZoom()) { + var customHandle = typeof onSingleTap === "function" && !this._isGreaterThanFitZoom() && onSingleTap(this._getClickedPosition(nativeEvent)); + + if (!customHandle) { + this._autoZoom((0, _extends2.default)({}, nativeEvent, { + numTaps: 1 + })); + } + } else if (typeof onSingleTap === "function") { + onSingleTap(this._getClickedPosition(nativeEvent)); + } + } + } + }, { + key: "_onLongPress", + value: function _onLongPress(_ref6) { + var nativeEvent = _ref6.nativeEvent; + var onLongPress = this.props.onLongPress; + + if (typeof onLongPress === "function" && !this._isGreaterThanFitZoom()) { + onLongPress(this._getClickedPosition(nativeEvent)); + } + } + }, { + key: "setFit", + value: function setFit(isFit) { + this.isFitted = isFit; + } + }, { + key: "setGestureEvent", + value: function setGestureEvent(event) { + this.gestureEvent = event; + } + }, { + key: "setOnAutoZoom", + value: function setOnAutoZoom(listener) { + this.onAutoZoomListener = listener; + } + }, { + key: "getOnTwoFingersTap", + value: function getOnTwoFingersTap() { + return this.onTwoFingersTap; + } + }, { + key: "getOnDoubleTap", + value: function getOnDoubleTap() { + return this.onDoubleTap; + } + }, { + key: "getOnTap", + value: function getOnTap() { + return this.onTap; + } + }, { + key: "getOnLongPress", + value: function getOnLongPress() { + return this.onLongPress; + } + }]); + return TapViewPagerManager; + }(); + + exports.default = TapViewPagerManager; +},2412,[5,6,7,8,2413,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var ZoomClickEvent = function () { + function ZoomClickEvent() { + (0, _classCallCheck2.default)(this, ZoomClickEvent); + } + + (0, _createClass2.default)(ZoomClickEvent, [{ + key: "setOffsetX", + value: function setOffsetX(offset) { + this.offsetX = offset; + } + }, { + key: "getOffsetX", + value: function getOffsetX() { + return this.offsetX; + } + }, { + key: "setOffsetY", + value: function setOffsetY(offset) { + this.offsetY = offset; + } + }, { + key: "getOffsetY", + value: function getOffsetY() { + return this.offsetY; + } + }, { + key: "setX", + value: function setX(x) { + this.x = x; + } + }, { + key: "getX", + value: function getX() { + return this.x; + } + }, { + key: "setY", + value: function setY(y) { + this.y = y; + } + }, { + key: "getY", + value: function getY() { + return this.y; + } + }, { + key: "setScale", + value: function setScale(scale) { + this.scale = scale; + } + }, { + key: "getScale", + value: function getScale() { + return this.scale; + } + }, { + key: "setContentWidth", + value: function setContentWidth(width) { + this.contentWidth = width; + } + }, { + key: "getContentWidth", + value: function getContentWidth() { + return this.contentWidth; + } + }, { + key: "setContentHeight", + value: function setContentHeight(height) { + this.contentHeight = height; + } + }, { + key: "getContentHeight", + value: function getContentHeight() { + return this.contentHeight; + } + }, { + key: "setIndex", + value: function setIndex(index) { + this.index = index; + } + }, { + key: "getIndex", + value: function getIndex() { + return this.index; + } + }, { + key: "setGreaterThanFit", + value: function setGreaterThanFit(greaterThanFit) { + this.greaterThanFit = greaterThanFit; + } + }, { + key: "isGreaterThanFit", + value: function isGreaterThanFit() { + return this.greaterThanFit; + } + }, { + key: "getScaledCoordinates", + value: function getScaledCoordinates() { + var x = this.getX(); + var y = this.getY(); + var width = this.getContentWidth() * this.getScale(); + var height = this.getContentHeight() * this.getScale(); + return { + x: x, + y: y, + width: width, + height: height, + index: this.getIndex() + }; + } + }, { + key: "toString", + value: function toString() { + return "ZOOM_VIEW_CLICK -> { x: " + this.getX() + ", " + ("y: " + this.getY() + ", ") + ("offsetX: " + this.getOffsetX() + ", ") + ("offsetY: " + this.getOffsetY() + ", ") + ("width: " + this.getContentWidth() + ", ") + ("height: " + this.getContentHeight() + ", ") + ("scale: " + this.getScale() + ", ") + ("index: " + this.getIndex() + " }"); + } + }]); + return ZoomClickEvent; + }(); + + exports.default = ZoomClickEvent; +},2413,[5,7,8]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + parent: { + flex: 1, + justifyContent: "flex-end", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + background: { + justifyContent: "center", + flexDirection: "row" + }, + pagesBackground: { + justifyContent: "flex-start", + flexDirection: "row", + overflow: "hidden" + }, + pagesManager: { + position: "absolute", + top: 0, + start: 0, + overflow: "hidden" + } + }); + + exports.default = _default; +},2414,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _layoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _pageViewComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var BackgroundPages = function (_React$Component) { + (0, _inherits2.default)(BackgroundPages, _React$Component); + + var _super = _createSuper(BackgroundPages); + + function BackgroundPages(props) { + var _this; + + (0, _classCallCheck2.default)(this, BackgroundPages); + _this = _super.call(this, props); + _this.state = { + hidden: false + }; + _this.opacity = new _reactNative.Animated.Value(1); + _this.onParentRef = _this._onParentRef.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(BackgroundPages, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.onViewPagerGestureStart = _$$_REQUIRE(_dependencyMap[18]).EventRegister.on(_events.default.NEWSMEMORY_VIEWPAGER_GESTURE_START, function () { + if (_this2._parentRef) { + _this2._parentRef.setNativeProps({ + style: { + display: "none" + } + }); + } + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[18]).EventRegister.rm(this.onViewPagerGestureStart); + } + }, { + key: "hide", + value: function hide() { + var _this3 = this; + + if (this.progressRef) { + this.progressRef.hide(); + } + + var hidden = this.state.hidden; + + _reactNative.Animated.timing(this.opacity, { + toValue: 0, + useNativeDriver: true, + duration: _$$_REQUIRE(_dependencyMap[19]).HIDE_ANIMATION_DURATION + }).start(function (_ref) { + var finished = _ref.finished; + + if (finished && !hidden) { + _this3.setState({ + hidden: true + }); + } + }); + } + }, { + key: "show", + value: function show() { + if (this.progressRef) { + this.progressRef.show(); + } + + this.opacity.setValue(1); + var hidden = this.state.hidden; + + if (hidden) { + this.setState({ + hidden: false + }); + } + } + }, { + key: "_onParentRef", + value: function _onParentRef(ref) { + this.parentRef = ref; + } + }, { + key: "_getPageView", + value: function _getPageView(page, size, currentPageSize) { + var isLandscape = this.props.isLandscape; + return _react.default.createElement(_pageViewComponent.default, (0, _extends2.default)({}, this.props, { + page: page, + showOnlyMid: true, + forceHighlight: true, + slotSize: { + width: currentPageSize.scaledWidth, + height: currentPageSize.scaledHeight + }, + downloadIfMissing: false, + size: size, + isLandscape: isLandscape + })); + } + }, { + key: "_getNextPage", + value: function _getNextPage(page) { + var newspaper = this.props.newspaper; + + if (newspaper) { + var edition = newspaper.getEditionModel(); + + if (edition) { + var index = edition.getPages().findIndex(function (item) { + return item.getPageId() === page.getPageId(); + }); + index = _$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isRTL() ? index - 1 : index + 1; + index = Math.max(0, Math.min(index, edition.getPages().length - 1)); + return edition.getPages()[index]; + } + } + + return undefined; + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props = this.props, + size = _this$props.size, + newspaper = _this$props.newspaper, + numberOfShowedPages = _this$props.numberOfShowedPages, + fit = _this$props.fit, + currentPageId = _this$props.currentPageId, + style = _this$props.style; + var hidden = this.state.hidden; + + if (!newspaper || hidden) { + return null; + } + + var edition = newspaper.getEditionModel(); + + if (!edition) { + return null; + } + + var sizeToEdit = (0, _extends2.default)({}, size); + var firstPage = edition.getFirstPage(); + + var currentPageSize = _newsmemoryUtils.default.getPageViewSize(firstPage, sizeToEdit, fit, numberOfShowedPages); + + if (!currentPageSize) { + return null; + } + + var pageLeft = _newsmemoryUtils.default.getPagesToRenderByIndex(edition.getPages(), currentPageId, numberOfShowedPages, _$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isRTL()); + + var pageRight; + + if (numberOfShowedPages === 2 && pageLeft && !pageLeft.isDoubleTruck()) { + pageRight = this._getNextPage(pageLeft); + } + + var pagesContainerWidthMultiplier = numberOfShowedPages; + var containerWidthMultiplier = 1; + var pagesContainerStyle = {}; + + if (pageLeft && pageLeft.isDoubleTruck() && numberOfShowedPages === 1) { + pagesContainerWidthMultiplier = 2; + containerWidthMultiplier = 2; + pagesContainerStyle = { + justifyContent: "flex-start", + left: Math.max((sizeToEdit.width - currentPageSize.scaledWidth) / 2, 0) + }; + } + + sizeToEdit.width *= containerWidthMultiplier; + return _react.default.createElement(_reactNative.View, { + ref: this.onParentRef, + style: style, + pointerEvents: "none" + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).Css, { + classes: ["newsmemory-background-pages-bottom-layer"] + }, _react.default.createElement(_reactNative.View, { + style: { + width: currentPageSize.scaledWidth * pagesContainerWidthMultiplier, + height: currentPageSize.scaledHeight, + position: "absolute", + top: Math.max((sizeToEdit.height - currentPageSize.scaledHeight) / 2, 0), + left: Math.max((sizeToEdit.width - currentPageSize.scaledWidth * pagesContainerWidthMultiplier) / (2 * pagesContainerWidthMultiplier), 0) + } + })), _react.default.createElement(_reactNative.Animated.View, { + pointerEvents: "none", + style: [_layoutManager.default.background, sizeToEdit, pagesContainerStyle, { + opacity: this.opacity + }] + }, _react.default.createElement(_reactNative.View, { + style: [_layoutManager.default.pagesBackground, { + flexDirection: _$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isRTL() ? "row-reverse" : "row", + width: currentPageSize.scaledWidth * pagesContainerWidthMultiplier, + height: sizeToEdit.height + }] + }, pageLeft ? this._getPageView(pageLeft, sizeToEdit, currentPageSize) : null, pageRight ? this._getPageView(pageRight, sizeToEdit, currentPageSize) : null)), _react.default.createElement(_$$_REQUIRE(_dependencyMap[22]).ProgressCircle, { + ref: function ref(_ref2) { + _this4.progressRef = _ref2; + }, + spinnerColor: _newsmemoryUtils.default.getSpinnerColor(), + spinnerStyle: [{ + position: "absolute" + }, size] + })); + } + }]); + return BackgroundPages; + }(_react.default.Component); + + exports.default = BackgroundPages; + BackgroundPages.propTypes = { + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + style: _propTypes.default.any.isRequired, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }).isRequired, + fit: _propTypes.default.bool, + numberOfShowedPages: _propTypes.default.number, + isLandscape: _propTypes.default.bool, + currentPageId: _propTypes.default.number, + getCurrentArticle: _propTypes.default.func + }; +},2415,[5,6,7,8,15,12,14,16,17,28,201,2414,603,2397,638,714,644,460,572,729,462,699,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _headerParentComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _indexLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ArticleModeManager = function (_React$PureComponent) { + (0, _inherits2.default)(ArticleModeManager, _React$PureComponent); + + var _super = _createSuper(ArticleModeManager); + + function ArticleModeManager(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleModeManager); + _this = _super.call(this, props); + _this.onIndexLocal = _this._onIndexLocal.bind((0, _assertThisInitialized2.default)(_this)); + _this.openEditions = _this._openEditions.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(ArticleModeManager, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this$props = this.props, + onLoaded = _this$props.onLoaded, + indexMode = _this$props.indexMode; + + if (onLoaded) { + onLoaded(indexMode); + } + } + }, { + key: "_openEditions", + value: function _openEditions() { + var _global$getActivePSet = global.getActivePSetup(), + showNativeOptionsPage = _global$getActivePSet.showNativeOptionsPage, + showNativeOptionsPageFallbackUrl = _global$getActivePSet.showNativeOptionsPageFallbackUrl; + + if (_$$_REQUIRE(_dependencyMap[20]).NetworkUtils.isOnline() || showNativeOptionsPage && !showNativeOptionsPageFallbackUrl) { + var accessibilityEnabled = this.props.accessibilityEnabled; + + if (accessibilityEnabled) { + _$$_REQUIRE(_dependencyMap[21]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE_ACCESSIBILITY); + } else { + _$$_REQUIRE(_dependencyMap[21]).EventRegister.emit(_events.default.OPEN_OPTIONSPAGE, { + tab: _$$_REQUIRE(_dependencyMap[22]).tabs.home, + getParams: { + accessibilityMode: accessibilityEnabled ? "1" : "0" + } + }); + } + } else { + _$$_REQUIRE(_dependencyMap[21]).EventRegister.emit(_events.default.NEWSMEMORY_OPEN_OFFLINE_EDITION_MENU); + } + } + }, { + key: "_getCurrentNewspaper", + value: function _getCurrentNewspaper() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + var currentNewspaperManager = props.currentNewspaperManager; + return currentNewspaperManager.getCurrentNewspaper(); + } + }, { + key: "_getCurrentEdition", + value: function _getCurrentEdition() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props; + + var currentNewspaper = this._getCurrentNewspaper(props); + + if (currentNewspaper) { + return currentNewspaper.getEditionModel(); + } + + return null; + } + }, { + key: "_onIndexLocal", + value: function _onIndexLocal(_ref) { + var domain = _ref.domain, + getParams = _ref.getParams; + var _this$props2 = this.props, + onIndexScrollToPage = _this$props2.onIndexScrollToPage, + onIndexClose = _this$props2.onIndexClose; + + if (domain.includes(_$$_REQUIRE(_dependencyMap[22]).locals.SCROLL_TO_PAGE) && getParams.pageNumber) { + var pageNumber = _pageUtils.default.removeZerosFromPageNumber(getParams.pageNumber); + + var edition = this._getCurrentEdition(); + + if (edition) { + var page = _pageUtils.default.getPageByPageNumber(edition.getPages(), pageNumber); + + if (!page) { + var pageNumberNoLetter = pageNumber.replace(/[^0-9]/, ""); + page = _pageUtils.default.getPageByPageNumber(edition.getPages(), pageNumberNoLetter); + } + + onIndexScrollToPage(page); + } + } else if (domain.includes(_$$_REQUIRE(_dependencyMap[22]).locals.CLOSE_ARTICLE)) { + onIndexClose(); + } else if (domain.includes(_$$_REQUIRE(_dependencyMap[22]).locals.OPEN_OPTIONSPAGE)) { + this.openEditions(); + } else if (domain.includes(_$$_REQUIRE(_dependencyMap[22]).locals.OPEN_BROWSER)) { + var url = getParams.url; + + if (url) { + _NavigationService.default.main.navigate("WebScreen", { + url: url, + onClose: function onClose() { + _$$_REQUIRE(_dependencyMap[20]).PlatformUtils.colorBars(); + } + }); + } + } + } + }, { + key: "_getCopyright", + value: function _getCopyright() { + var newspaper = this.props.newspaper; + + var _global$getActivePSet2 = global.getActivePSetup(), + copyright = _global$getActivePSet2.copyright, + copyrightURL = _global$getActivePSet2.copyrightURL; + + var _global$getActivePSet3 = global.getActivePSetup(), + poweredBy = _global$getActivePSet3.poweredBy, + poweredByURL = _global$getActivePSet3.poweredByURL, + paperName = _global$getActivePSet3.paperName; + + if (newspaper) { + var edition = newspaper.getEditionModel(); + + if (copyright.includes("$$year")) { + copyright = copyright.replace("$$year", edition && edition.issue ? edition.issue.substring(0, 4) : _$$_REQUIRE(_dependencyMap[20]).DateUtils.getCurrentYear()); + } + + if (copyright.includes("$$edition")) { + copyright = copyright.replace("$$edition", edition && edition.edition || paperName); + } + + if (!copyrightURL || !copyrightURL.length) { + copyrightURL = "https://www.newsmemory.com"; + } + } + + return [{ + text: copyright, + url: copyrightURL + }, { + text: poweredBy, + url: poweredByURL + }]; + } + }, { + key: "_renderFooter", + value: function _renderFooter() { + var model = this.props.model; + + var items = this._getCopyright(); + + return (0, _headerParentComponent.footer)(items, model.getHrBottom()); + } + }, { + key: "_renderHr", + value: function _renderHr(line) { + var hrHeight = line ? line.getHeight() : 1; + var color = line ? line.getColor() : "black"; + + var hrStyle = _$$_REQUIRE(_dependencyMap[23]).Css.getStyleObjByCssClasses(["newsmemory-article-mode-sub-header-hr"]); + + return (0, _headerParentComponent.hr)([{ + backgroundColor: color, + height: hrHeight + }, hrStyle], "newsmemory-article-header-separator"); + } + }, { + key: "render", + value: function render() { + var managerToLoad = null; + var _this$props3 = this.props, + model = _this$props3.model, + header = _this$props3.header, + headerTopLine = _this$props3.headerTopLine, + indexMode = _this$props3.indexMode, + onLogoPress = _this$props3.onLogoPress, + onArticleRef = _this$props3.onArticleRef, + onIndexRef = _this$props3.onIndexRef, + onIndexClose = _this$props3.onIndexClose, + onIndexGoToPage = _this$props3.onIndexGoToPage, + onIndexOpenSection = _this$props3.onIndexOpenSection, + onIndexOpenArticle = _this$props3.onIndexOpenArticle, + onArticleOpenIndex = _this$props3.onArticleOpenIndex, + onArticleClose = _this$props3.onArticleClose, + onArticleOpenSearch = _this$props3.onArticleOpenSearch, + onArticleClearSearch = _this$props3.onArticleClearSearch, + newspaper = _this$props3.newspaper, + getCurrentArticle = _this$props3.getCurrentArticle, + getCurrentPage = _this$props3.getCurrentPage, + title = _this$props3.title, + indexLevel = _this$props3.indexLevel, + firstLevelModel = _this$props3.firstLevelModel, + secondLevelModel = _this$props3.secondLevelModel, + shortcutEnabled = _this$props3.shortcutEnabled, + shortcutPriority = _this$props3.shortcutPriority, + rest = (0, _objectWithoutProperties2.default)(_this$props3, ["model", "header", "headerTopLine", "indexMode", "onLogoPress", "onArticleRef", "onIndexRef", "onIndexClose", "onIndexGoToPage", "onIndexOpenSection", "onIndexOpenArticle", "onArticleOpenIndex", "onArticleClose", "onArticleOpenSearch", "onArticleClearSearch", "newspaper", "getCurrentArticle", "getCurrentPage", "title", "indexLevel", "firstLevelModel", "secondLevelModel", "shortcutEnabled", "shortcutPriority"]); + + if (!newspaper) { + return null; + } + + var edition = newspaper.getEditionModel(); + + var footerInfo = this._getCopyright(); + + if (!indexMode) { + managerToLoad = _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).NewsmemoryArticleLayoutManager, (0, _extends2.default)({}, rest, { + ref: onArticleRef, + newspaper: newspaper, + formattedIssue: title, + footer: footerInfo, + getCurrentArticle: getCurrentArticle, + onOpenIndex: onArticleOpenIndex, + onOpenSearch: onArticleOpenSearch, + onClearSearch: onArticleClearSearch, + onClose: onArticleClose, + FooterComponent: this._renderFooter(), + renderHr: this._renderHr, + model: model, + header: header, + shortcutEnabled: shortcutEnabled, + shortcutPriority: shortcutPriority + })); + } else { + var topIndexAd = global.getAdsConfig().getEpaperTopIndexAd(); + var customIndexHtml = edition && edition.getCustomIndexHtml(); + var isCustomIndex = customIndexHtml !== undefined && !_newsmemoryUtils.default.isCustomIndexDisabled(customIndexHtml); + managerToLoad = _react.default.createElement(_indexLayoutManager.default, (0, _extends2.default)({}, rest, { + newspaper: newspaper, + indexLevel: indexLevel, + firstLevelModel: firstLevelModel, + secondLevelModel: secondLevelModel, + ref: onIndexRef, + topAd: topIndexAd, + edition: edition, + title: title, + footer: footerInfo, + customIndexHtml: isCustomIndex ? customIndexHtml : undefined, + currentArticle: getCurrentArticle(), + currentPage: getCurrentPage(), + onOpenSection: onIndexOpenSection, + onGoToPage: onIndexGoToPage, + onOpenArticle: onIndexOpenArticle, + onIndexFirstLevelClose: this.openEditions, + onClose: onIndexClose, + onLocal: this.onIndexLocal, + FooterComponent: this._renderFooter(), + renderHr: this._renderHr, + model: model, + header: header, + shortcutEnabled: shortcutEnabled, + shortcutPriority: shortcutPriority + })); + + if (isCustomIndex) { + return managerToLoad; + } + } + + var headerModel = model; + + if (indexMode) { + if (indexLevel === 2) { + headerModel = secondLevelModel; + } else { + headerModel = firstLevelModel; + } + } + + return _react.default.createElement(_headerParentComponent.default, { + header: header, + headerTopLine: headerTopLine, + onLogoPress: onLogoPress, + edition: edition, + model: headerModel + }, managerToLoad); + } + }]); + return ArticleModeManager; + }(_react.default.PureComponent); + + exports.default = ArticleModeManager; + ArticleModeManager.propTypes = (0, _extends2.default)({ + indexMode: _propTypes.default.bool, + onArticleRef: _propTypes.default.func.isRequired, + onIndexRef: _propTypes.default.func.isRequired, + onIndexClose: _propTypes.default.func, + onIndexOpenSection: _propTypes.default.func, + onIndexOpenArticle: _propTypes.default.func, + onArticleClose: _propTypes.default.func, + onArticleOpenIndex: _propTypes.default.func, + onArticleOpenSearch: _propTypes.default.func, + onArticleClearSearch: _propTypes.default.func, + onIndexScrollToPage: _propTypes.default.func, + onIndexGoToPage: _propTypes.default.func, + onLogoPress: _propTypes.default.func.isRequired, + onLoaded: _propTypes.default.func + }, _$$_REQUIRE(_dependencyMap[24]).NewsmemoryArticleLayoutManager.propTypes, _indexLayoutManager.default.propTypes, _$$_REQUIRE(_dependencyMap[25]).Shortcut.propTypes); + ArticleModeManager.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[25]).Shortcut.defaultProps, { + indexMode: false + }); +},2416,[5,6,108,7,8,15,12,14,16,17,201,644,714,2195,2354,460,638,715,603,1861,462,572,730,699,2417,1911]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewsmemoryArticleLayoutManager = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _articleLayoutManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _simpleButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _twoStateButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _closeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _Edition = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _viewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _EPaperArticle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[19])); + + var _Page = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _articleComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _share2 = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[24])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _articleZoomLevelText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + var _NewspaperIssue = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[28])); + + var _pageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[29])); + + var _subHeaderComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[30])); + + var _headerInfoComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[31])); + + var _simpleBadgeButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[32])); + + var _tecnaviaFileUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[33])); + + var _pdfUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[34])); + + var _subHeaderButtons = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[35])); + + var _player = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[36])); + + var _flagIconComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[37])); + + var _AccessibilityListItem = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[38])); + + var _AudioManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[39])); + + var _NewsmemoryHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[40])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[41])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ARTICLE_WINDOW_SIZE = 1; + + var NewsmemoryArticleLayoutManager = function (_Shortcut) { + (0, _inherits2.default)(NewsmemoryArticleLayoutManager, _Shortcut); + + var _super = _createSuper(NewsmemoryArticleLayoutManager); + + function NewsmemoryArticleLayoutManager(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryArticleLayoutManager); + _this = _super.call(this, props); + _this.isSpeaking = false; + _this.articleViewPager = _react.default.createRef(); + _this.articleRefs = []; + var edition = props.newspaper && props.newspaper.getEditionModel(); + _this.allArticles = _newsmemoryUtils.default.getAllArticles(edition); + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + showTypesArticle = _global$getNewsmemory.showTypesArticle; + + _this.showTypesArticle = showTypesArticle; + _this.articleTypeChange = false; + _this.lastOnSwipeIndex = -1; + _this.loadSelectedOnly = true; + _this.goNext = _this._goNext.bind((0, _assertThisInitialized2.default)(_this)); + _this.goNextRepeat = _this._goNextRepeat.bind((0, _assertThisInitialized2.default)(_this)); + _this.scrollToNextHr = _this._scrollToNextHr.bind((0, _assertThisInitialized2.default)(_this)); + _this.goFirstArticleOnNextPage = _this._goFirstArticleOnNextPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.closeAccessibility = _this._closeAccessibility.bind((0, _assertThisInitialized2.default)(_this)); + _this.closeCarMode = _this._closeCarMode.bind((0, _assertThisInitialized2.default)(_this)); + _this.goPrev = _this._goPrev.bind((0, _assertThisInitialized2.default)(_this)); + _this.goPrevRepeat = _this._goPrevRepeat.bind((0, _assertThisInitialized2.default)(_this)); + _this.scrollToPrevHr = _this._scrollToPrevHr.bind((0, _assertThisInitialized2.default)(_this)); + _this.scrollUp = _this._scrollUp.bind((0, _assertThisInitialized2.default)(_this)); + _this.selectAccessibilityItem = _this._selectAccessibilityItem.bind((0, _assertThisInitialized2.default)(_this)); + _this.scrollDown = _this._scrollDown.bind((0, _assertThisInitialized2.default)(_this)); + _this.goFirstArticleOnPrevPage = _this._goFirstArticleOnPrevPage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSwipe = _this._onSwipe.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSwipeDown = _this._onSwipeDown.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTextLoaded = _this._onTextLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.onOpenGallery = _this._onOpenGallery.bind((0, _assertThisInitialized2.default)(_this)); + _this.onModeChange = _this._onModeChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.closeArticle = _this._closeArticle.bind((0, _assertThisInitialized2.default)(_this)); + _this.share = _this._share.bind((0, _assertThisInitialized2.default)(_this)); + _this.search = _this._search.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearSearch = _this._clearSearch.bind((0, _assertThisInitialized2.default)(_this)); + _this.shareFacebook = _this._shareFacebook.bind((0, _assertThisInitialized2.default)(_this)); + _this.shareTwitter = _this._shareTwitter.bind((0, _assertThisInitialized2.default)(_this)); + _this.shareReddit = _this._shareReddit.bind((0, _assertThisInitialized2.default)(_this)); + _this.shareEmail = _this._shareEmail.bind((0, _assertThisInitialized2.default)(_this)); + _this.fontDecrease = _this._fontDecrease.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleFontSize = _this._toggleFontSize.bind((0, _assertThisInitialized2.default)(_this)); + _this.fontIncrease = _this._fontIncrease.bind((0, _assertThisInitialized2.default)(_this)); + _this.graphDecrease = _this._graphDecrease.bind((0, _assertThisInitialized2.default)(_this)); + _this.graphIncrease = _this._graphIncrease.bind((0, _assertThisInitialized2.default)(_this)); + _this.graphZoomUnfit = _this._graphZoomUnfit.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleGraphSize = _this._toggleGraphSize.bind((0, _assertThisInitialized2.default)(_this)); + _this.zoomDecrease = _this._zoomDecrease.bind((0, _assertThisInitialized2.default)(_this)); + _this.zoomIncrease = _this._zoomIncrease.bind((0, _assertThisInitialized2.default)(_this)); + _this.print = _this._print.bind((0, _assertThisInitialized2.default)(_this)); + _this.chooseLanguage = _this._chooseLanguage.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleFullScreen = _this._toggleFullscreen.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleGraphic = _this._toggleGraphic.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleArticleExtra = _this._toggleArticleExtra.bind((0, _assertThisInitialized2.default)(_this)); + _this.startTTS = _this._startTTS.bind((0, _assertThisInitialized2.default)(_this)); + _this.stopTTS = _this._stopTTS.bind((0, _assertThisInitialized2.default)(_this)); + _this.whatTTS = _this._whatTTS.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleTTS = _this._toggleTTS.bind((0, _assertThisInitialized2.default)(_this)); + _this.getContent = _this._getContent.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoadEnd = _this._onLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.isActive = _this._isActive.bind((0, _assertThisInitialized2.default)(_this)); + _this.configUpdate = _this._configUpdate.bind((0, _assertThisInitialized2.default)(_this)); + _this.getFilteredArticles = _this._getFilteredArticles.bind((0, _assertThisInitialized2.default)(_this)); + _this.getButton = _this._getButton.bind((0, _assertThisInitialized2.default)(_this)); + _this.getSearchButton = _this._getSearchButton.bind((0, _assertThisInitialized2.default)(_this)); + _this.onAccessibilityItemPress = _this._onAccessibilityItemPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.items = _this.getFilteredArticles(props); + _this.currentPosition = _this._getArticleIndex(_this.items, props.getCurrentArticle()); + return _this; + } + + (0, _createClass2.default)(NewsmemoryArticleLayoutManager, [{ + key: "componentDidMount", + value: function componentDidMount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryArticleLayoutManager.prototype), "componentDidMount", this).call(this); + this.configChangeListener = _$$_REQUIRE(_dependencyMap[42]).EventRegister.on(_events.default.NEWSMEMORY_CONFIG_CHANGE, this.configUpdate); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + this.prevArticle = this.items[this.currentPosition]; + var nextEdition = nextProps.newspaper && nextProps.newspaper.getEditionModel(); + this.allArticles = _newsmemoryUtils.default.getAllArticles(nextEdition); + this.items = this.getFilteredArticles(nextProps); + + var newPosition = this._getArticleIndex(this.items, nextProps.getCurrentArticle()); + + this.lastOnSwipeIndex = -1; + this.currentPosition = newPosition; + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + var newCurrentArticle = nextProps.getCurrentArticle(); + + if (!_$$_REQUIRE(_dependencyMap[43]).JSUtils.equals(this.prevArticle, newCurrentArticle)) { + return true; + } + + return !_$$_REQUIRE(_dependencyMap[43]).JSUtils.equals(nextProps, this.props) || !_$$_REQUIRE(_dependencyMap[43]).JSUtils.equals(nextState, this.state); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryArticleLayoutManager.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.rm(this.configChangeListener); + + _deviceUtils.default.enableIdleTimer(); + + var mgr = global.getAudio(); + + if (mgr.ttsIsSpeaking()) { + mgr.ttsPause(); + } else if (!mgr.ttsIsPaused()) { + mgr.ttsDestroy(); + } + } + }, { + key: "update", + value: function update() { + this.UNSAFE_componentWillReceiveProps(this.props); + this.loadSelectedOnly = true; + + if (this.timer) { + clearTimeout(this.timer); + } + + this.forceUpdate(); + } + }, { + key: "getNavigationInfo", + value: function getNavigationInfo(index) { + var items = this.items; + + if (items[index]) { + var page = this._getPageById(items[index].getPageId()); + + if (page) { + var result = { + counter: items.length, + index: index, + page: _pageUtils.default.removeZerosFromPageNumber(page.getShownPage()), + section: _$$_REQUIRE(_dependencyMap[43]).StringUtils.decodeHTML(page.getSection()), + article: items[index] + }; + return result; + } + } + + return undefined; + } + }, { + key: "_handleShortcut", + value: function _handleShortcut() { + var _this2 = this; + + var searchText = this.props.searchText; + + var UP = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.UP, + DOWN = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.DOWN, + LEFT = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.LEFT, + RIGHT = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.RIGHT, + MORE = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.MORE, + LESS = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.LESS, + PAGE_UP = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.PAGE_UP, + PAGE_DOWN = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.PAGE_DOWN, + HOME = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.HOME, + END = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.END, + OPEN = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.OPEN, + CLOSE = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.CLOSE, + SELECT = _$$_REQUIRE(_dependencyMap[44]).KEY_GROUPS.SELECT; + + var NEXT = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.NEXT, + PREVIOUS = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.PREVIOUS, + NEXT_PAGE = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.NEXT_PAGE, + PREVIOUS_PAGE = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.PREVIOUS_PAGE, + READ = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.READ, + STOP = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.STOP, + WHAT = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.WHAT, + GO_UP = _$$_REQUIRE(_dependencyMap[44]).VOICE_GROUPS.GO_UP; + + return [{ + callbackRepeat: this.scrollUp, + keys: UP + }, { + callback: this.selectAccessibilityItem, + keys: SELECT + }, { + callbackRepeat: this.scrollDown, + keys: DOWN + }, { + callback: this.scrollToPrevHr, + keys: HOME + }, { + callback: this.scrollToNextHr, + keys: END + }, { + callback: this.startTTS, + keys: READ() + }, { + callback: this.stopTTS, + keys: STOP() + }, { + callback: this.whatTTS, + keys: WHAT() + }, { + callback: this.goNext, + keys: NEXT() + }, { + callback: this.goPrev, + keys: PREVIOUS() + }, { + callbackRepeat: this.goPrevRepeat, + keys: LEFT + }, { + callbackRepeat: this.goNextRepeat, + keys: RIGHT + }, { + callback: this.goFirstArticleOnPrevPage, + keys: PREVIOUS_PAGE() + }, { + callback: this.goFirstArticleOnPrevPage, + keys: PAGE_UP + }, { + callback: this.goFirstArticleOnPrevPage, + keys: NEXT_PAGE() + }, { + callback: this.goFirstArticleOnNextPage, + keys: PAGE_DOWN + }, { + callback: this.onSwipeDown, + keys: GO_UP(), + stopPropagation: true + }, { + callback: this.onSwipeDown, + keys: OPEN, + stopPropagation: true + }, { + callback: this.toggleTTS, + keys: ["V"] + }, { + callback: this.zoomDecrease, + keys: LESS + }, { + callback: this.zoomIncrease, + keys: MORE + }, { + callback: this.toggleFullScreen, + keys: ["SPACE"], + stopPropagation: true + }, { + callback: function callback() { + if (searchText) { + _this2.clearSearch(); + } else { + _this2.closeArticle(); + } + }, + keys: CLOSE, + stopPropagation: true + }, { + callback: this.share, + keys: ["S"], + stopPropagation: true + }, { + callback: this.print, + keys: ["P"], + stopPropagation: true + }]; + } + }, { + key: "_configUpdate", + value: function _configUpdate() { + var component = this.articleRefs[this.currentPosition]; + + if (component) { + if (component.isTextMode()) { + var isNotAd = !this.items[this.currentPosition].isAd(); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TRANSLATE_CHANGE_BUTTON_VISIBILITY, { + visible: isNotAd && global.getNewsmemoryConfig().isTranslationAvailable() + }); + } else { + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.ARTICLE_GRAPHIC_ZOOM_CHANGE, { + level: global.getNewsmemoryConfig().getGraphSize() + }); + } + } + + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + showTypesArticle = _global$getNewsmemory2.showTypesArticle; + + if (this.showTypesArticle !== showTypesArticle) { + this.showTypesArticle = showTypesArticle; + this.articleTypeChange = true; + this.update(); + } + } + }, { + key: "_getRef", + value: function _getRef() { + return this.articleViewPager && this.articleViewPager.current ? this.articleViewPager.current : undefined; + } + }, { + key: "_onAccessibilityItemPress", + value: function _onAccessibilityItemPress(item) { + if (item) { + switch (item.getKey()) { + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.closeAccessibility.key: + this._closeAccessibility(); + + break; + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.goUp.key: + this._onSwipeDown(); + + break; + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.goBack.key: + this._goPrev(); + + break; + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.goNext.key: + this._goNext(); + + break; + } + } + } + }, { + key: "_goNext", + value: function _goNext() { + var ref = this._getRef(); + + if (ref) { + ref.scrollToNext(true); + return true; + } + + return false; + } + }, { + key: "_goNextRepeat", + value: function _goNextRepeat() { + return _regenerator.default.async(function _goNextRepeat$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!this._goNext()) { + _context.next = 2; + break; + } + + return _context.abrupt("return", this.getCallbackRepeatPromise()); + + case 2: + return _context.abrupt("return", Promise.reject()); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_goToPage", + value: function _goToPage(index) { + var ref = this._getRef(); + + if (ref) { + ref.scrollTo(index, true); + return true; + } + + return false; + } + }, { + key: "_scrollToNextHr", + value: function _scrollToNextHr() { + var component = this.articleRefs[this.currentPosition]; + + if (component && component.isTextMode()) { + component.scrollToHrAfter(); + } + } + }, { + key: "_goFirstArticleOnNextPage", + value: function _goFirstArticleOnNextPage() { + var ref = this._getRef(); + + if (ref) { + var currentArticle = this.items[this.currentPosition]; + var i; + + for (i = this.currentPosition + 1; i < this.items.length; i++) { + if (this.items[i].getPageId() !== currentArticle.getPageId()) { + break; + } + } + + ref.scrollTo(Math.min(i, this.items.length)); + } + } + }, { + key: "_scrollToPrevHr", + value: function _scrollToPrevHr() { + var component = this.articleRefs[this.currentPosition]; + + if (component && component.isTextMode()) { + component.scrollToHrBefore(); + } + } + }, { + key: "_selectAccessibilityItem", + value: function _selectAccessibilityItem() { + var component = this.articleRefs[this.currentPosition]; + + if (component && component.isTextMode()) { + component.selectAccessibilityItem(); + } + } + }, { + key: "_scrollUp", + value: function _scrollUp() { + var component; + return _regenerator.default.async(function _scrollUp$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + component = this.articleRefs[this.currentPosition]; + + if (!(component && component.isTextMode())) { + _context2.next = 4; + break; + } + + component.scrollUp(); + return _context2.abrupt("return", this.getCallbackRepeatPromise()); + + case 4: + return _context2.abrupt("return", Promise.reject()); + + case 5: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_scrollDown", + value: function _scrollDown() { + var component; + return _regenerator.default.async(function _scrollDown$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + component = this.articleRefs[this.currentPosition]; + + if (!(component && component.isTextMode())) { + _context3.next = 4; + break; + } + + component.scrollDown(); + return _context3.abrupt("return", this.getCallbackRepeatPromise()); + + case 4: + return _context3.abrupt("return", Promise.reject()); + + case 5: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_closeAccessibility", + value: function _closeAccessibility() { + var onCloseAccessibility = this.props.onCloseAccessibility; + + if (typeof onCloseAccessibility === "function") { + onCloseAccessibility(); + } + } + }, { + key: "_closeCarMode", + value: function _closeCarMode() { + var onCloseCarMode = this.props.onCloseCarMode; + + if (typeof onCloseCarMode === "function") { + onCloseCarMode(); + } + } + }, { + key: "_goPrev", + value: function _goPrev() { + var ref = this._getRef(); + + if (ref) { + ref.scrollToPrev(true); + return true; + } + + return false; + } + }, { + key: "_goPrevRepeat", + value: function _goPrevRepeat() { + return _regenerator.default.async(function _goPrevRepeat$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!this._goPrev()) { + _context4.next = 2; + break; + } + + return _context4.abrupt("return", this.getCallbackRepeatPromise()); + + case 2: + return _context4.abrupt("return", Promise.reject()); + + case 3: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_goFirstArticleOnPrevPage", + value: function _goFirstArticleOnPrevPage() { + var ref = this._getRef(); + + if (ref) { + var currentArticle = this.items[this.currentPosition]; + var prevPageId; + var i = this.currentPosition - 1; + + while (i >= 0) { + if (this.items[i].getPageId() !== currentArticle.getPageId()) { + if (!prevPageId) { + prevPageId = this.items[i].getPageId(); + } else if (this.items[i].getPageId() !== prevPageId) { + i += 1; + break; + } + } + + i -= 1; + } + + ref.scrollTo(Math.max(i, 0)); + } + } + }, { + key: "_shareFacebook", + value: function _shareFacebook() { + this.share(_$$_REQUIRE(_dependencyMap[46]).NewsmemoryShareType.FACEBOOK); + } + }, { + key: "_shareTwitter", + value: function _shareTwitter() { + this.share(_$$_REQUIRE(_dependencyMap[46]).NewsmemoryShareType.TWITTER); + } + }, { + key: "_shareReddit", + value: function _shareReddit() { + this.share(_$$_REQUIRE(_dependencyMap[46]).NewsmemoryShareType.REDDIT); + } + }, { + key: "_shareEmail", + value: function _shareEmail() { + this.share(_$$_REQUIRE(_dependencyMap[46]).NewsmemoryShareType.EMAIL); + } + }, { + key: "_search", + value: function _search() { + var _this$props = this.props, + searchText = _this$props.searchText, + onOpenSearch = _this$props.onOpenSearch; + + if (typeof onOpenSearch === "function") { + onOpenSearch(searchText); + } + } + }, { + key: "_clearSearch", + value: function _clearSearch() { + var onClearSearch = this.props.onClearSearch; + + if (typeof onClearSearch === "function") { + onClearSearch(); + } + } + }, { + key: "_share", + value: function _share() { + var type, + newspaper, + editionModel, + issue, + edition, + currentArticle, + share, + currentPage, + component, + _global$getActivePSet, + paperName, + pageNumber, + article, + destinationFolder, + _await$component$getP, + html, + destinationFilename, + _await$PdfUtils$htmlT, + pdfFilePath, + _global$getActivePSet2, + messageMaxShare, + _args5 = arguments; + + return _regenerator.default.async(function _share$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + type = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : _$$_REQUIRE(_dependencyMap[46]).NewsmemoryShareType.ALL; + newspaper = this.props.newspaper; + _context5.prev = 2; + editionModel = newspaper.getEditionModel(); + issue = editionModel.getIssue(); + edition = editionModel.getEdition(); + + if (!_share2.default.canShare(issue, edition)) { + _context5.next = 41; + break; + } + + _$$_REQUIRE(_dependencyMap[47]).LoadingOverlay.show({ + id: "share" + }); + + currentArticle = this.items[this.currentPosition]; + share = new _share2.default(); + share.article = currentArticle; + share.editionModel = editionModel; + currentPage = this._getCurrentPage(currentArticle.getPageId()); + share.page = currentPage; + share.shareType = type; + component = this.articleRefs[this.currentPosition]; + + if (!component) { + _context5.next = 37; + break; + } + + share.articleType = component.getMode(); + + if (!(_$$_REQUIRE(_dependencyMap[43]).PlatformUtils.isIOS() && type === _$$_REQUIRE(_dependencyMap[46]).NewsmemoryShareType.ALL)) { + _context5.next = 37; + break; + } + + _global$getActivePSet = global.getActivePSetup(), paperName = _global$getActivePSet.paperName; + paperName = _newsmemoryUtils.default.normalizePaperName(paperName); + pageNumber = _pageUtils.default.removeZerosFromPageNumber(currentPage.getPage()); + article = currentArticle.getXmlId(); + destinationFolder = _tecnaviaFileUtils.default.getDownloadedPdfDirectory(); + _context5.next = 26; + return _regenerator.default.awrap(component.getPrintHtml()); + + case 26: + _await$component$getP = _context5.sent; + html = _await$component$getP.html; + _context5.next = 30; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(destinationFolder)); + + case 30: + destinationFilename = _tecnaviaFileUtils.DOWNLOADED_PDF_DIRECTORY + "/" + paperName + "_" + issue + "_" + pageNumber + "_" + article; + + if (component.isTextMode()) { + destinationFilename = destinationFilename + "_t"; + } + + _context5.next = 34; + return _regenerator.default.awrap(_pdfUtils.default.htmlToPDF({ + html: html, + fileName: destinationFilename + })); + + case 34: + _await$PdfUtils$htmlT = _context5.sent; + pdfFilePath = _await$PdfUtils$htmlT.filePath; + share.pdfFilePath = pdfFilePath; + + case 37: + _context5.next = 39; + return _regenerator.default.awrap(share.share(function () { + _$$_REQUIRE(_dependencyMap[47]).LoadingOverlay.hide({ + id: "share" + }); + })); + + case 39: + _context5.next = 42; + break; + + case 41: + if (_share2.default.checkSharesRemotely()) { + _$$_REQUIRE(_dependencyMap[48]).Toast.show(global.strings("err_offline")); + } else { + _global$getActivePSet2 = global.getActivePSetup(), messageMaxShare = _global$getActivePSet2.messageMaxShare; + + _$$_REQUIRE(_dependencyMap[48]).Toast.show(messageMaxShare || global.strings("msg_max_share")); + } + + case 42: + _context5.next = 47; + break; + + case 44: + _context5.prev = 44; + _context5.t0 = _context5["catch"](2); + + _$$_REQUIRE(_dependencyMap[47]).LoadingOverlay.hide({ + id: "share" + }); + + case 47: + case "end": + return _context5.stop(); + } + } + }, null, this, [[2, 44]], Promise); + } + }, { + key: "_getCurrentPage", + value: function _getCurrentPage(pageId) { + var newspaper = this.props.newspaper; + + if (newspaper) { + var edition = newspaper.getEditionModel(); + + if (edition) { + var page = edition.getPages().find(function (item) { + return item.getPageId() === pageId; + }); + return page; + } + } + + return undefined; + } + }, { + key: "_onModeChange", + value: function _onModeChange(isText, index) { + if (index === this.currentPosition) { + var isNotAd = !this.items[index].isAd() && isText; + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TRANSLATE_CHANGE_BUTTON_VISIBILITY, { + visible: isNotAd && global.getNewsmemoryConfig().isTranslationAvailable() + }); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_FONT_CHANGE_BUTTON_VISIBILITY, { + visible: isNotAd + }); + + var component = this.articleRefs[index]; + var text = component && component.getText(); + var hasText = !!(text && text.trim().length > 0); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TTS_CHANGE_BUTTON_VISIBILITY, { + visible: isNotAd && hasText + }); + + if (isText) { + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_GRAPH_CHANGE_BUTTON_VISIBILITY, { + visible: false + }); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_GRAPH_UNFIT_CHANGE_BUTTON_VISIBILITY, { + visible: false + }); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_ARTICLE_EXTRA_CHANGE_BUTTON_VISIBILITY, { + visible: false + }); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_ARTICLE_TEXT); + } else { + if (component && component.graphArticle) { + var isFitScale = component.graphArticle.isFitScale(); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_GRAPH_UNFIT_CHANGE_BUTTON_VISIBILITY, { + visible: isFitScale + }); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_GRAPH_CHANGE_BUTTON_VISIBILITY, { + visible: !isFitScale + }); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_ARTICLE_GRAPHIC); + } + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.NEWSMEMORY_RESTART_HIGH_RES_QUEUE); + } + + if (this._getRef()) { + this._getRef().toggleState(true); + } + } + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd(index) { + var _this3 = this; + + var article = this.items[index]; + + if (this.loadSelectedOnly) { + if (this.timer) { + clearTimeout(this.timer); + } + + this.timer = setTimeout(function () { + var articlesRefs = _this3.articleRefs.filter(function (ref) { + return !!ref; + }); + + articlesRefs.forEach(function (articlesRef) { + articlesRef.show(); + }); + _this3.timer = undefined; + }, 1000); + } + + var onArticleLoaded = this.props.onArticleLoaded; + var currentArticle = this.items[this.currentPosition]; + + if (_$$_REQUIRE(_dependencyMap[43]).JSUtils.equals(article, currentArticle)) { + if (typeof onArticleLoaded === "function") { + onArticleLoaded(article); + } + + if (!this.loadSelectedOnly) { + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.NEWSMEMORY_ON_ARTICLE_GRAPH_LOADED, { + loadedIndex: index + }); + } + } + + this.loadSelectedOnly = false; + } + }, { + key: "_isActive", + value: function _isActive(position) { + return position === this.currentPosition; + } + }, { + key: "_getAccessibilityItems", + value: function _getAccessibilityItems(index, length) { + var accessibilityEnabled = this.props.accessibilityEnabled; + var article = this.items[index]; + var section = ""; + + if (article) { + var page = this._getPageById(article.getPageId()); + + if (page) { + section = page.getSection(); + } + } + + if (accessibilityEnabled) { + return (0, _$$_REQUIRE(_dependencyMap[45]).getAccessibilityItemsArticle)(index, length, section); + } + + return []; + } + }, { + key: "_getContent", + value: function _getContent(article, index) { + var _this4 = this; + + var _this$props2 = this.props, + searchText = _this$props2.searchText, + newspaper = _this$props2.newspaper, + searchColor = _this$props2.searchColor, + size = _this$props2.size, + formattedIssue = _this$props2.formattedIssue, + FooterComponent = _this$props2.FooterComponent, + onArticleLongPress = _this$props2.onArticleLongPress, + navigation = _this$props2.navigation, + getNewspaperStatus = _this$props2.getNewspaperStatus, + fullscreen = _this$props2.fullscreen, + isLandscape = _this$props2.isLandscape; + + if (!newspaper) { + return null; + } + + var edition = newspaper.getEditionModel(); + + var _global$getActivePSet3 = global.getActivePSetup(), + enablePhoneArticleLayoutOnTabletInLandscape = _global$getActivePSet3.enablePhoneArticleLayoutOnTabletInLandscape, + enableDesktopArticleLayoutOnIPadProInLandscape = _global$getActivePSet3.enableDesktopArticleLayoutOnIPadProInLandscape; + + var deviceSupportColumnizer = _$$_REQUIRE(_dependencyMap[43]).PlatformUtils.isTablet() && (fullscreen || isLandscape && Math.round(size.width / _$$_REQUIRE(_dependencyMap[49]).columnizerBaseColumnWidth) > 1); + var showArticleHeader = !deviceSupportColumnizer && enablePhoneArticleLayoutOnTabletInLandscape; + var enableDesktopLayout = _$$_REQUIRE(_dependencyMap[43]).PlatformUtils.isiPadPro12dot9() && isLandscape && enableDesktopArticleLayoutOnIPadProInLandscape; + + if (enableDesktopLayout) { + deviceSupportColumnizer = false; + showArticleHeader = false; + } + + return _react.default.createElement(_articleComponent.default, { + key: index, + index: index, + navigation: navigation, + ref: function ref(_ref) { + var newRef = !_this4.articleRefs[index] && _ref; + _this4.articleRefs[index] = _ref; + + if (newRef && !_this4.loadSelectedOnly) { + _ref.show(); + } + }, + onUnmount: function onUnmount() { + _this4.articleRefs[index] = undefined; + }, + deviceSupportColumnizer: deviceSupportColumnizer, + enableDesktopLayout: enableDesktopLayout, + formattedIssue: formattedIssue, + edition: edition, + page: this._getCurrentPage(article.getPageId()), + article: article, + newspaper: newspaper, + mode: article.isText() ? _$$_REQUIRE(_dependencyMap[46]).NewsmemoryArticleModes.TEXT : _$$_REQUIRE(_dependencyMap[46]).NewsmemoryArticleModes.GRAPHIC, + searchText: searchText, + searchColor: searchColor, + carModeEnabled: this._isCarModeEnabled(), + accessibilityEnabled: this._isAccessibilityModeEnabled(), + header: showArticleHeader, + headerHtml: this._getHeaderHtml(), + disclaimerHtml: this._getDisclaimerHTML(), + copyrightHtml: this._copyrightHTML(), + defaultHeight: size.height, + defaultWidth: size.width, + isActive: this.isActive, + hidden: this.loadSelectedOnly && index !== this.currentPosition, + viewPagerRef: this.articleViewPager, + FooterComponent: FooterComponent, + goNext: this.goNext, + goPrev: this.goPrev, + onModeChange: this.onModeChange, + onLongPress: onArticleLongPress, + onSwipeDown: this.onSwipeDown, + onTextLoaded: this.onTextLoaded, + onOpenGallery: this.onOpenGallery, + onLoadEnd: this.onLoadEnd, + onGraphLoadEnd: this.onLoadEnd, + getNewspaperStatus: getNewspaperStatus, + hasAccessibilityFocus: function hasAccessibilityFocus() { + return index === _this4.currentPosition && _this4._simulateAccessibility(); + }, + accessibilityItems: this._getAccessibilityItems(index, this.items.length), + onAccessibilityItemPress: this.onAccessibilityItemPress + }); + } + }, { + key: "_getHeaderHtml", + value: function _getHeaderHtml() { + var formattedIssue = this.props.formattedIssue; + var info = this.getNavigationInfo(this.currentPosition); + var page = ""; + + if (info) { + page = global.strings("str_page") + ": " + info.page; + } + + return "<div id='header_info' style='flex-direction: row;display: flex'>" + (" <div style='flex: 1;display: flex;'>" + formattedIssue + "</div>") + (" <div style='text-align: end;'>" + page + "</div>") + "</div>"; + } + }, { + key: "_getDisclaimerHTML", + value: function _getDisclaimerHTML() { + var _global$getActivePSet4 = global.getActivePSetup(), + addDisclaimer = _global$getActivePSet4.addDisclaimer; + + if (addDisclaimer != undefined && addDisclaimer.length > 0) { + return "<div id='footer_disclaimer' style='flex-direction: row;display: flex;'>" + addDisclaimer + "</div>"; + } + + return ""; + } + }, { + key: "_copyrightHTML", + value: function _copyrightHTML() { + var config = this.props.footer; + var footerItemsString = "<div id='footer_copyright' style='flex-direction: row;display: flex;'>"; + + if (config) { + footerItemsString += config.reduce(function (result, item, index) { + var customStyle = ""; + + if (index % 2 === 1) { + customStyle = "flex: 0; text-align: end;"; + } + + return result + "<div style='flex: 1; min-width: 30%; " + customStyle + "'><a href='" + item.url + "'>" + item.text + "</a></div>"; + }, ""); + return footerItemsString + "</div>"; + } + + return undefined; + } + }, { + key: "_getEventParams", + value: function _getEventParams() { + var _this$props3 = this.props, + newspaper = _this$props3.newspaper, + getCurrentArticle = _this$props3.getCurrentArticle; + var page; + var article = getCurrentArticle(); + + if (article) { + page = this._getCurrentPage(article.getPageId()); + } + + return { + edition: newspaper.getEditionModel(), + page: page, + article: article + }; + } + }, { + key: "_print", + value: function _print() { + var component, _this$_getEventParams, edition, page, article, _global$getActivePSet6, messageMaxShare; + + return _regenerator.default.async(function _print$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + component = this.articleRefs[this.currentPosition]; + + if (component) { + _this$_getEventParams = this._getEventParams(), edition = _this$_getEventParams.edition, page = _this$_getEventParams.page, article = _this$_getEventParams.article; + + if (edition && page && article) { + if (_share2.default.canShare(edition.getIssue(), edition.getEdition())) { + _$$_REQUIRE(_dependencyMap[47]).LoadingOverlay.show({ + id: "print", + timeout: -1, + callback: function callback() { + var shareParams, shareConfig, shareid, error, NONE, LIMIT_REACHED, _global$getActivePSet5, messageMaxShare; + + return _regenerator.default.async(function callback$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _context6.prev = 0; + shareParams = { + artmode: component.getMode(), + issue: edition.getIssue(), + edition: edition.getEdition(), + filename: page.getFilename(), + page: page.getPage(), + section: page.getSection(), + title: article.getTitle(), + article: article.getXmlId(), + type: "share" + }; + _context6.next = 4; + return _regenerator.default.awrap(_NewsmemoryAJAX.default.share(shareParams)); + + case 4: + shareConfig = _context6.sent; + shareid = shareConfig.shareid, error = shareConfig.error; + NONE = _share2.SHARE_REMOTE_ERRORS.NONE, LIMIT_REACHED = _share2.SHARE_REMOTE_ERRORS.LIMIT_REACHED; + + if (!(error && error > NONE)) { + _context6.next = 11; + break; + } + + if (error === LIMIT_REACHED) { + _global$getActivePSet5 = global.getActivePSetup(), messageMaxShare = _global$getActivePSet5.messageMaxShare; + + _$$_REQUIRE(_dependencyMap[48]).Toast.show(messageMaxShare || global.strings("msg_max_share")); + } else { + _$$_REQUIRE(_dependencyMap[48]).Toast.show(global.strings("system_error")); + } + + _context6.next = 20; + break; + + case 11: + _context6.prev = 11; + _context6.next = 14; + return _regenerator.default.awrap(component.print()); + + case 14: + (0, _$$_REQUIRE(_dependencyMap[50]).sendNewsmemoryPrintEvent)(edition, page, article); + + _NewsmemoryAJAX.default.share((0, _extends2.default)({}, shareParams, { + shareId: shareid, + shareType: _$$_REQUIRE(_dependencyMap[46]).NewsmemoryShareType.PRINT + })); + + _context6.next = 20; + break; + + case 18: + _context6.prev = 18; + _context6.t0 = _context6["catch"](11); + + case 20: + _context6.next = 24; + break; + + case 22: + _context6.prev = 22; + _context6.t1 = _context6["catch"](0); + + case 24: + _$$_REQUIRE(_dependencyMap[47]).LoadingOverlay.hide({ + id: "print" + }); + + case 25: + case "end": + return _context6.stop(); + } + } + }, null, null, [[0, 22], [11, 18]], Promise); + } + }); + } else if (_share2.default.checkSharesRemotely()) { + _$$_REQUIRE(_dependencyMap[48]).Toast.show(global.strings("err_offline")); + } else { + _global$getActivePSet6 = global.getActivePSetup(), messageMaxShare = _global$getActivePSet6.messageMaxShare; + + _$$_REQUIRE(_dependencyMap[48]).Toast.show(messageMaxShare || global.strings("msg_max_share")); + } + } + } + + case 2: + case "end": + return _context7.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_sendFontSizeChangeEvent", + value: function _sendFontSizeChangeEvent(event, fontSize) { + var _this$_getEventParams2 = this._getEventParams(), + edition = _this$_getEventParams2.edition, + page = _this$_getEventParams2.page, + article = _this$_getEventParams2.article; + + (0, _$$_REQUIRE(_dependencyMap[50]).sendNewsmemoryFontSizeChangeEvent)(event, fontSize, edition, page, article); + } + }, { + key: "_sendGraphSizeChangeEvent", + value: function _sendGraphSizeChangeEvent(event, graphSize) { + var _this$_getEventParams3 = this._getEventParams(), + edition = _this$_getEventParams3.edition, + page = _this$_getEventParams3.page, + article = _this$_getEventParams3.article; + + (0, _$$_REQUIRE(_dependencyMap[50]).sendNewsmemoryGraphSizeChangeEvent)(event, graphSize, edition, page, article); + } + }, { + key: "_toggleFontSize", + value: function _toggleFontSize() { + var fontSize = global.getUserSettings().toggleFontSize(false, true); + + this._sendFontSizeChangeEvent("toggle_font_size", fontSize); + } + }, { + key: "_fontIncrease", + value: function _fontIncrease() { + var fontSize = global.getUserSettings().toggleFontSize(false, false); + + this._sendFontSizeChangeEvent("increase_font_size", fontSize); + } + }, { + key: "_fontDecrease", + value: function _fontDecrease() { + var fontSize = global.getUserSettings().toggleFontSize(true, false); + + this._sendFontSizeChangeEvent("decrease_font_size", fontSize); + } + }, { + key: "_graphDecrease", + value: function _graphDecrease() { + var graphSize = global.getNewsmemoryConfig().toggleGraphSize(true, false); + + this._sendGraphSizeChangeEvent("decrease_graph_size", graphSize); + } + }, { + key: "_graphZoomUnfit", + value: function _graphZoomUnfit() { + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.ARTICLE_GRAPH_ZOOM_UNFIT); + + this._sendGraphSizeChangeEvent("unfit_graph"); + } + }, { + key: "_graphIncrease", + value: function _graphIncrease() { + var graphSize = global.getNewsmemoryConfig().toggleGraphSize(false, false); + + this._sendGraphSizeChangeEvent("increase_graph_size", graphSize); + } + }, { + key: "_toggleGraphSize", + value: function _toggleGraphSize() { + var graphSize = global.getNewsmemoryConfig().toggleGraphSize(false, true); + + this._sendGraphSizeChangeEvent("toggle_graph_size", graphSize); + } + }, { + key: "_zoomDecrease", + value: function _zoomDecrease() { + var component = this.articleRefs[this.currentPosition]; + + if (component) { + if (component.isTextMode()) { + this._fontDecrease(); + } else { + this._graphDecrease(); + } + } + } + }, { + key: "_zoomIncrease", + value: function _zoomIncrease() { + var component = this.articleRefs[this.currentPosition]; + + if (component) { + if (component.isTextMode()) { + this._fontIncrease(); + } else { + this._graphIncrease(); + } + } + } + }, { + key: "_closeArticle", + value: function _closeArticle() { + var onClose = this.props.onClose; + + if (onClose) { + onClose(); + } + } + }, { + key: "_chooseLanguage", + value: function _chooseLanguage() { + var newsmemoryConfig = global.getNewsmemoryConfig(); + var translationsAvailable = newsmemoryConfig.translationsAvailable, + currentTranslationLanguage = newsmemoryConfig.currentTranslationLanguage, + lastTranslationLanguage = newsmemoryConfig.lastTranslationLanguage; + + if (translationsAvailable && translationsAvailable.length > 0) { + var currentArticleRef = this.articleRefs[this.currentPosition]; + + if (currentTranslationLanguage) { + newsmemoryConfig.resetCurrentTranslationLanguage(); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TRANSLATE_CHANGE_BUTTON_BADGE); + + currentArticleRef.translate(); + var start = Math.max(0, this.currentPosition - ARTICLE_WINDOW_SIZE); + var end = Math.min(this.articleRefs.length, this.currentPosition + ARTICLE_WINDOW_SIZE + 1); + + for (var i = start; i < end; i++) { + if (i !== this.currentPosition && this.articleRefs[i]) { + this.articleRefs[i].translate(); + } + } + } else { + if (lastTranslationLanguage) { + translationsAvailable.forEach(function (item, i) { + if (item.language === lastTranslationLanguage) { + translationsAvailable.splice(i, 1); + translationsAvailable.unshift(item); + } + }); + } + + _$$_REQUIRE(_dependencyMap[51]).MyBottomSheet.show({ + options: translationsAvailable.map(function (item) { + var language = item.language, + name = item.name; + + var badgeComponent = _react.default.createElement(_flagIconComponent.default, { + style: { + width: 30, + height: 30 + }, + language: language + }); + + return { + title: name, + icon: badgeComponent, + style: language === lastTranslationLanguage ? { + borderBottomWidth: 1, + borderColor: _$$_REQUIRE(_dependencyMap[43]).colors.black + } : {}, + textStyle: language === lastTranslationLanguage ? { + fontWeight: "bold" + } : {}, + onPress: function onPress() { + newsmemoryConfig.setCurrentTranslationLanguage(language); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TRANSLATE_CHANGE_BUTTON_BADGE); + + currentArticleRef.translate(language); + } + }; + }) + }); + } + } + + return true; + } + }, { + key: "_toggleFullscreen", + value: function _toggleFullscreen() { + var active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.fullscreen; + var onToggleFullscreen = this.props.onToggleFullscreen; + + if (typeof onToggleFullscreen === "function") { + var _this$_getEventParams4 = this._getEventParams(), + edition = _this$_getEventParams4.edition, + page = _this$_getEventParams4.page, + article = _this$_getEventParams4.article; + + (0, _$$_REQUIRE(_dependencyMap[50]).sendNewsmemoryToggleFullscreenEvent)(!active, edition, page, article); + onToggleFullscreen(!active); + } + } + }, { + key: "_toggleGraphic", + value: function _toggleGraphic() { + var component = this.articleRefs[this.currentPosition]; + + if (component) { + component.toggleMode(); + } + } + }, { + key: "_toggleArticleExtra", + value: function _toggleArticleExtra(previousActive) { + this.articleRefs.forEach(function (articleRef) { + if (articleRef) { + articleRef.toggleArticleExtra(); + } + }); + global.getNewsmemoryConfig().setEnableArticleExtras(!previousActive); + } + }, { + key: "_getButton", + value: function _getButton(button) { + var _this$props4 = this.props, + fullscreen = _this$props4.fullscreen, + getNewspaperStatus = _this$props4.getNewspaperStatus; + var currentArticle = this.items[this.currentPosition]; + var isTextArticle = currentArticle && !currentArticle.isAd() && currentArticle.isText(); + var action = button.getAction(); + var library; + var customIcon = button.getIcon(); + var customActiveIcon = button.getActiveIcon(); + + var config = _$$_REQUIRE(_dependencyMap[45]).ACTIONS[action]; + + var source = customIcon || config.icon; + var activeSource = customActiveIcon || config.activeIcon; + + if (button && button.isLibraryIcon() && customIcon) { + library = button.getLibrary(); + } + + var cssProps = { + classes: ["newsmemory-icon", "newsmemory-article-header-icon"], + cssKey: action + }; + var commonProps = { + key: action, + accessibilityLabel: global.strings(config.defaultLabelKey), + library: library, + source: source, + cssProps: cssProps + }; + var shareProps = {}; + + if (action === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.share.key || action === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareFacebook.key || action === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareTwitter.key || action === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareReddit.key || action === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareEmail.key || action === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.print.key) { + shareProps = { + visible: !_share2.default.checkSharesRemotely() || _$$_REQUIRE(_dependencyMap[43]).NetworkUtils.isOnline(), + toVisibleEvent: _events.default.SHARE_CHANGE_BUTTON_VISIBILITY + }; + } + + switch (action) { + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.closeAccessibility.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.closeAccessibility + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.closeCarMode.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.closeCarMode + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.closeArticle.key: + return _react.default.createElement(_closeComponent.default, (0, _extends2.default)({}, commonProps, { + source: library ? customIcon : undefined, + onPress: this.closeArticle + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.goBack.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.goPrev + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.goUp.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.onSwipeDown + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.goNext.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.goNext + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.share.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, shareProps, { + onPress: this.share + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareFacebook.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, shareProps, { + onPress: this.shareFacebook + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareTwitter.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, shareProps, { + onPress: this.shareTwitter + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareReddit.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, shareProps, { + onPress: this.shareReddit + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.shareEmail.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, shareProps, { + onPress: this.shareEmail + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.print.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, shareProps, { + onPress: this.print + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.toggleFont.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + toVisibleEvent: _events.default.TOGGLE_FONT_CHANGE_BUTTON_VISIBILITY, + onPress: this.toggleFontSize, + ifHiddenRemove: true, + visible: isTextArticle + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.fontIncrease.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + toVisibleEvent: _events.default.TOGGLE_FONT_CHANGE_BUTTON_VISIBILITY, + onPress: this.fontIncrease, + ifHiddenRemove: true, + visible: isTextArticle + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.fontDecrease.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + toVisibleEvent: _events.default.TOGGLE_FONT_CHANGE_BUTTON_VISIBILITY, + onPress: this.fontDecrease, + ifHiddenRemove: true, + visible: isTextArticle + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.toggleGraphZoom.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + toVisibleEvent: _events.default.TOGGLE_GRAPH_CHANGE_BUTTON_VISIBILITY, + onPress: this.toggleGraphSize, + ifHiddenRemove: true, + visible: currentArticle && currentArticle.isAd() + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.graphIncrease.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + toVisibleEvent: _events.default.TOGGLE_GRAPH_CHANGE_BUTTON_VISIBILITY, + onPress: this.graphIncrease, + ifHiddenRemove: true, + visible: currentArticle && currentArticle.isAd() + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.graphDecrease.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + toVisibleEvent: _events.default.TOGGLE_GRAPH_CHANGE_BUTTON_VISIBILITY, + onPress: this.graphDecrease, + ifHiddenRemove: true, + visible: currentArticle && currentArticle.isAd() + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.graphZoomUnfit.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + toVisibleEvent: _events.default.TOGGLE_GRAPH_UNFIT_CHANGE_BUTTON_VISIBILITY, + onPress: this.graphZoomUnfit, + ifHiddenRemove: true, + visible: currentArticle && currentArticle.isAd() + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.translate.key: + return _react.default.createElement(_simpleBadgeButtonComponent.default, (0, _extends2.default)({}, commonProps, { + getBadgeComponent: function getBadgeComponent(props) { + return _react.default.createElement(_flagIconComponent.default, (0, _extends2.default)({ + language: global.getNewsmemoryConfig().currentTranslationLanguage + }, props)); + }, + badgeEvent: _events.default.TRANSLATE_CHANGE_BUTTON_BADGE, + toVisibleEvent: _events.default.TRANSLATE_CHANGE_BUTTON_VISIBILITY, + onPress: this.chooseLanguage, + visible: currentArticle && !currentArticle.isAd() && global.getNewsmemoryConfig().isTranslationAvailable(), + cssBadgeClasses: ["newsmemory-translate-icon-badge"], + ifHiddenRemove: true + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.toggleFullScreen.key: + return _react.default.createElement(_twoStateButtonComponent.default, { + key: action, + library: library, + activeSource: activeSource, + inactiveSource: source, + active: fullscreen, + onPress: this.toggleFullScreen, + cssProps: cssProps, + ifHiddenRemove: true + }); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.toggleTextToSpeech.key: + var mgr = global.getAudio(); + var lastTTSIndex = -1; + var currentNewspaperStatus = getNewspaperStatus(); + + if (currentNewspaperStatus) { + lastTTSIndex = currentNewspaperStatus.getLastTTSIndex(); + } + + var ttsButtonIsActive = mgr.ttsIsSpeaking() || mgr.ttsIsPaused() && !mgr.ttsIsUserPaused() && lastTTSIndex !== -1; + return _react.default.createElement(_twoStateButtonComponent.default, { + key: action, + library: library, + activeSource: activeSource, + inactiveSource: source, + active: ttsButtonIsActive, + toInactiveEvent: _events.default.TTS_ENGINE_STOPPED, + toActiveEvent: _events.default.TTS_ENGINE_STARTED, + toVisibleEvent: _events.default.TTS_CHANGE_BUTTON_VISIBILITY, + onActivePress: this.stopTTS, + onInactivePress: this.startTTS, + visible: currentArticle && !currentArticle.isAd(), + cssProps: cssProps, + ifHiddenRemove: true + }); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.toggleGraphic.key: + return _react.default.createElement(_twoStateButtonComponent.default, { + key: action, + library: library, + activeSource: activeSource, + inactiveSource: source, + active: this._getLoadedArticleTypeState(), + toInactiveEvent: _events.default.TOGGLE_ARTICLE_TEXT, + toActiveEvent: _events.default.TOGGLE_ARTICLE_GRAPHIC, + toVisibleEvent: _events.default.TOGGLE_GRAPHIC_CHANGE_BUTTON_VISIBILITY, + onPress: this.toggleGraphic, + visible: currentArticle && !currentArticle.isAd(), + cssProps: cssProps, + ifHiddenRemove: true + }); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.toggleArticleExtra.key: + var _global$getActivePSet7 = global.getActivePSetup(), + showExtrasInArticleGraphicMode = _global$getActivePSet7.showExtrasInArticleGraphicMode; + + var _global$getNewsmemory3 = global.getNewsmemoryConfig(), + enableArticleExtras = _global$getNewsmemory3.enableArticleExtras; + + return _react.default.createElement(_twoStateButtonComponent.default, { + key: action, + library: library, + activeSource: activeSource, + inactiveSource: source, + active: enableArticleExtras, + toInactiveEvent: _events.default.DISABLE_ARTICLE_EXTRA, + toActiveEvent: _events.default.ENABLE_ARTICLE_EXTRA, + toVisibleEvent: _events.default.TOGGLE_ARTICLE_EXTRA_CHANGE_BUTTON_VISIBILITY, + onPress: this.toggleArticleExtra, + visible: showExtrasInArticleGraphicMode && !isTextArticle, + cssProps: cssProps, + ifHiddenRemove: true + }); + } + + return null; + } + }, { + key: "_isAccessibilityModeEnabled", + value: function _isAccessibilityModeEnabled() { + var accessibilityEnabled = this.props.accessibilityEnabled; + return accessibilityEnabled; + } + }, { + key: "_isCarModeEnabled", + value: function _isCarModeEnabled() { + var carModeEnabled = this.props.carModeEnabled; + return carModeEnabled; + } + }, { + key: "_getLoadedArticleTypeState", + value: function _getLoadedArticleTypeState() { + var article = this.items[this.currentPosition]; + return article ? !article.isText() : false; + } + }, { + key: "_getSearchButton", + value: function _getSearchButton(button) { + var action = button.getAction(); + var customIcon = button.getIcon(); + + var source = customIcon || _$$_REQUIRE(_dependencyMap[45]).ACTIONS[action].icon; + + var library; + + if (button && button.isLibraryIcon() && customIcon) { + library = button.getLibrary(); + } + + var commonProps = { + key: action, + library: library, + source: source, + cssProps: { + classes: ["newsmemory-icon", "newsmemory-article-header-icon"], + cssKey: action + } + }; + + switch (action) { + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.search.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.search + })); + + case _$$_REQUIRE(_dependencyMap[45]).ACTIONS.clearSearch.key: + return _react.default.createElement(_simpleButtonComponent.default, (0, _extends2.default)({}, commonProps, { + onPress: this.clearSearch + })); + } + + return null; + } + }, { + key: "_getHeaderInfoTexts", + value: function _getHeaderInfoTexts() { + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var leftText = ""; + var rightText = ""; + + if (info) { + var section = info.section, + page = info.page, + index = info.index, + counter = info.counter; + leftText = section; + rightText = global.strings("counter", { + current: index + 1, + total: counter + }) + " " + _$$_REQUIRE(_dependencyMap[43]).StringUtils.BULLET + " " + global.strings("str_page") + ": " + page; + } + + return { + leftText: leftText, + rightText: rightText + }; + } + }, { + key: "_getInfo", + value: function _getInfo() { + var leftSection = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var color = arguments.length > 1 ? arguments[1] : undefined; + var accessibilityEnabled = this.props.accessibilityEnabled; + var textSize = leftSection.textSize; + var info = this.getNavigationInfo(this.currentPosition); + + if (info) { + return _react.default.createElement(_headerInfoComponent.default, (0, _extends2.default)({}, this._getHeaderInfoTexts(info), { + color: _$$_REQUIRE(_dependencyMap[43]).ColorUtils.determineTextColor(color), + onChangeEventName: _events.default.NEWSMEMORY_ARTICLE_CHANGE, + textSize: textSize, + accessibilityEnabled: accessibilityEnabled + })); + } + + return null; + } + }, { + key: "_isFromSearch", + value: function _isFromSearch() { + var searchText = this.props.searchText; + return searchText && searchText.length; + } + }, { + key: "_getFilteredButtons", + value: function _getFilteredButtons() { + var buttons = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var isSearch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var searchText = this.props.searchText; + + var _global$getActivePSet8 = global.getActivePSetup(), + enableTextToSpeech = _global$getActivePSet8.enableTextToSpeech, + enableShare = _global$getActivePSet8.enableShare, + enablePrint = _global$getActivePSet8.enablePrint; + + var filteredButtons = buttons.filter(function (button) { + if (isSearch) { + if (button.getAction() === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.search.key || button.getAction() === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.clearSearch.key) { + return searchText !== undefined; + } + + return false; + } + + if (button.getAction() === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.search.key || button.getAction() === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.clearSearch.key) { + return false; + } + + if (button.getAction() === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.toggleTextToSpeech.key) { + return enableTextToSpeech; + } + + if (button.getAction() === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.share.key) { + return enableShare; + } + + if (button.getAction() === _$$_REQUIRE(_dependencyMap[45]).ACTIONS.print.key) { + return enablePrint; + } + + return true; + }); + return filteredButtons; + } + }, { + key: "_getComponentSubHeader", + value: function _getComponentSubHeader(header) { + var _this$props5 = this.props, + searchColor = _this$props5.searchColor, + size = _this$props5.size, + renderHr = _this$props5.renderHr; + var leftSection = header.getLeft(); + var rightSection = header.getRight(); + var carModeSection = header.getCarMode(); + var hrTop = header.getHrTop(); + + var searchStyle = _$$_REQUIRE(_dependencyMap[52]).Css.getStyleObjByCssClasses(["newsmemory-search"]); + + var customSearchColor = _$$_REQUIRE(_dependencyMap[43]).CssUtils.getAttributeFromStyle("color", searchStyle, searchColor); + + var bgColor = this._isFromSearch() ? customSearchColor : hrTop.getColor(); + var rightButtons; + var leftButtons; + var searchButtons; + + if (this._isCarModeEnabled()) { + rightButtons = this._getFilteredButtons(carModeSection.getButtons()); + } else if (!this._isAccessibilityModeEnabled()) { + rightButtons = this._getFilteredButtons(rightSection.getButtons()); + leftButtons = this._getFilteredButtons(leftSection.getButtons()); + searchButtons = this._getFilteredButtons(rightSection.getButtons(), true); + } + + return _react.default.createElement(_subHeaderComponent.default, { + TextComponent: this._getInfo(leftSection, bgColor), + HrComponent: renderHr(hrTop), + ButtonsComponent: this._isAccessibilityModeEnabled() ? null : _react.default.createElement(_subHeaderButtons.default, { + cssButtonClasses: ["newsmemory-icon", "newsmemory-article-header-icon"], + leftButtons: leftButtons, + rightButtons: rightButtons, + width: size.width, + renderButton: this.getButton + }), + SubButtonsComponent: this._isAccessibilityModeEnabled() ? null : _react.default.createElement(_subHeaderButtons.default, { + rightButtons: searchButtons, + width: size.width, + renderButton: this.getSearchButton + }), + bgColor: bgColor, + cssClasses: ["newsmemory-article-mode-header"] + }); + } + }, { + key: "_getPageById", + value: function _getPageById(id) { + var newspaper = this.props.newspaper; + + if (newspaper) { + var edition = newspaper.getEditionModel(); + + if (edition) { + var pages = edition.getPages(); + return pages.find(function (page) { + return page.getPageId() === id; + }); + } + } + + return undefined; + } + }, { + key: "_getFilteredArticles", + value: function _getFilteredArticles(_ref2) { + var _this5 = this; + + var getCurrentArticle = _ref2.getCurrentArticle, + searchText = _ref2.searchText; + var currentArticle = getCurrentArticle(); + var clickedType = currentArticle ? currentArticle.getType() : _EPaperArticle.EPaperArticleType.EDITORIAL; + var searchTextLowerCase = searchText ? searchText.toLowerCase() : searchText; + var filteredArticles = this.allArticles.filter(function (article) { + var page = _this5._getPageById(article.getPageId()); + + if (page && page.isProtected()) { + return false; + } + + if (_this5._isAccessibilityModeEnabled()) { + return article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL; + } + + if (searchTextLowerCase) { + return article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL && (article.getHtml().toLowerCase().includes(searchTextLowerCase) || article.getTitle().toLowerCase().includes(searchTextLowerCase)); + } + + if (_this5.showTypesArticle === _$$_REQUIRE(_dependencyMap[53]).SHOW_TYPES_ARTICLE.ONLY_TEXT || _newsmemoryUtils.default.isModeLow()) { + if (clickedType === _EPaperArticle.EPaperArticleType.EDITORIAL) { + return article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL; + } + + if (_this5.articleTypeChange) { + return article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL || currentArticle === article; + } + } + + if (_this5.showTypesArticle === _$$_REQUIRE(_dependencyMap[53]).SHOW_TYPES_ARTICLE.TEXT_AND_GRAPH) { + if (clickedType === _EPaperArticle.EPaperArticleType.EDITORIAL || clickedType === _EPaperArticle.EPaperArticleType.GRAPHIC || clickedType === _EPaperArticle.EPaperArticleType.TABLE) { + return article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL || article.getType() === _EPaperArticle.EPaperArticleType.GRAPHIC || article.getType() === _EPaperArticle.EPaperArticleType.TABLE; + } + + if (_this5.articleTypeChange) { + return article.getType() === _EPaperArticle.EPaperArticleType.EDITORIAL || article.getType() === _EPaperArticle.EPaperArticleType.GRAPHIC || article.getType() === _EPaperArticle.EPaperArticleType.TABLE || currentArticle === article; + } + } + + return article.getType() !== _EPaperArticle.EPaperArticleType.PAGE_LAYOUT || currentArticle === article; + }); + + if (this.articleTypeChange) { + this.articleTypeChange = false; + } + + return filteredArticles; + } + }, { + key: "_getArticleIndex", + value: function _getArticleIndex(articles, current) { + var index = articles.findIndex(function (article) { + return article === current; + }); + return index >= 0 ? index : 0; + } + }, { + key: "_onSwipeDown", + value: function _onSwipeDown() { + var onOpenIndex = this.props.onOpenIndex; + + if (typeof onOpenIndex === "function") { + onOpenIndex(); + } + } + }, { + key: "_onOpenGallery", + value: function _onOpenGallery(gallery, index) { + var _this$props6 = this.props, + navigation = _this$props6.navigation, + newspaper = _this$props6.newspaper; + + if (navigation && gallery && gallery.length) { + var params = { + items: gallery, + caller: "epaper", + index: index + }; + + if (newspaper) { + params.edition = newspaper.getEditionModel(); + var currentArticle = this.items[this.currentPosition]; + + if (currentArticle) { + params.article = currentArticle; + + var page = this._getCurrentPage(currentArticle.getPageId()); + + if (page) { + params.page = page; + } + } + } + + navigation.navigate("GalleryScreen", params); + } + } + }, { + key: "_delayScreenIdleTimer", + value: function _delayScreenIdleTimer(text, currentArticle) { + var _global$getActivePSet9 = global.getActivePSetup(), + disableScreenIdleTimerDelay = _global$getActivePSet9.disableScreenIdleTimerDelay; + + if (!disableScreenIdleTimerDelay && text && currentArticle && !currentArticle.isAd()) { + var _StringUtils$getReadi = _$$_REQUIRE(_dependencyMap[43]).StringUtils.getReadingTime(text), + time = _StringUtils$getReadi.time; + + _deviceUtils.default.delayIdleTimer(time); + } + } + }, { + key: "_onTextLoaded", + value: function _onTextLoaded(index, text) { + if (index === this.lastOnSwipeIndex) { + var hasText = !!(text && text.trim().length > 0); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TTS_CHANGE_BUTTON_VISIBILITY, { + visible: hasText + }); + + if (hasText) { + var getNewspaperStatus = this.props.getNewspaperStatus; + var currentNewspaperStatus = getNewspaperStatus(); + var mgr = global.getAudio(); + + if (mgr.ttsIsSpeaking()) { + if (currentNewspaperStatus) { + currentNewspaperStatus.setLastTTSIndex(index); + } + + mgr.ttsStart(text); + } else if (mgr.ttsIsPaused()) { + if (mgr.ttsIsUserPaused()) { + mgr.ttsShowPlayer(); + } else { + if (currentNewspaperStatus) { + currentNewspaperStatus.setLastTTSIndex(index); + } + + mgr.ttsResume(); + } + } else if (mgr.ttsIsAutoRestart()) { + if (currentNewspaperStatus) { + currentNewspaperStatus.setLastTTSIndex(index); + } + + mgr.ttsStart(text); + } + + var currentArticle = this.items[index]; + + this._delayScreenIdleTimer(text, currentArticle); + } + } + } + }, { + key: "_whatTTS", + value: function _whatTTS() { + global.getAudio().ttsWhat(); + } + }, { + key: "_stopTTS", + value: function _stopTTS() { + var onSwipe = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var onClose = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var getNewspaperStatus = this.props.getNewspaperStatus; + var currentNewspaperStatus = getNewspaperStatus(); + + if (currentNewspaperStatus) { + currentNewspaperStatus.resetLastTTSIndex(); + } + + global.getAudio().ttsStop(onSwipe); + + if (!onSwipe && !onClose) { + var newspaper = this.props.newspaper; + + if (newspaper) { + var currentArticle = this.items[this.currentPosition]; + var edition = newspaper.getEditionModel(); + + var page = this._getCurrentPage(currentArticle.getPageId()); + + (0, _$$_REQUIRE(_dependencyMap[50]).sendNewsmemoryTTSEvent)(_events.default.TTS_ENGINE_STOPPED, edition, page, currentArticle); + } + } + } + }, { + key: "_startTTS", + value: function _startTTS() { + var onSwipe = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + var _this$props7 = this.props, + newspaper = _this$props7.newspaper, + getNewspaperStatus = _this$props7.getNewspaperStatus; + var component = this.articleRefs[this.currentPosition]; + + if (component) { + var currentArticle = this.items[this.currentPosition]; + var text = component.getText(); + + if (text && currentArticle && !currentArticle.isAd()) { + var currentNewspaperStatus = getNewspaperStatus(); + + if (currentNewspaperStatus) { + currentNewspaperStatus.setLastTTSIndex(this.currentPosition); + } + + global.getAudio().ttsStart(text); + + if (!onSwipe && newspaper) { + var edition = newspaper.getEditionModel(); + + if (edition) { + var page = this._getCurrentPage(currentArticle.getPageId()); + + (0, _$$_REQUIRE(_dependencyMap[50]).sendNewsmemoryTTSEvent)(_events.default.TTS_ENGINE_STARTED, edition, page, currentArticle); + } + } + } + } + } + }, { + key: "_toggleTTS", + value: function _toggleTTS() { + if (global.getAudio().ttsIsSpeaking()) { + this._stopTTS(); + } else { + this._startTTS(); + } + } + }, { + key: "_onSwipe", + value: function _onSwipe(index) { + var _this6 = this; + + var getNewspaperStatus = this.props.getNewspaperStatus; + var currentArticle = this.items[index]; + var currentArticleRef = this.articleRefs[index]; + + if (this.lastOnSwipeIndex !== index) { + if (currentArticleRef && !currentArticleRef.isTextMode()) { + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.NEWSMEMORY_RESTART_HIGH_RES_QUEUE); + } + + var mgr = global.getAudio(); + + if (mgr.ttsIsSpeaking() && currentArticle && (!currentArticle.isText() || !(0, _$$_REQUIRE(_dependencyMap[54]).stripHTMLTags)(currentArticle.getHtml()).trim())) { + var nextTextArticleIndex = index; + + var findNextEditorial = function findNextEditorial(item) { + return item.isText() && (0, _$$_REQUIRE(_dependencyMap[54]).stripHTMLTags)(item.getHtml()).trim(); + }; + + if (index > this.lastOnSwipeIndex) { + var partialIndex = this.items.slice(index).findIndex(findNextEditorial); + + if (partialIndex > -1) { + nextTextArticleIndex = partialIndex + index; + } + } else { + var _partialIndex = this.items.slice(0, index).reverse().findIndex(findNextEditorial); + + if (_partialIndex > -1) { + nextTextArticleIndex = index - 1 - _partialIndex; + } + } + + if (nextTextArticleIndex !== index) { + this.lastOnSwipeIndex = index; + this.currentPosition = index; + setTimeout(function () { + _this6._goToPage(nextTextArticleIndex); + }, 0); + return; + } + } + + var lastTTSIndex = -1; + var currentNewspaperStatus = getNewspaperStatus(); + + if (currentNewspaperStatus) { + lastTTSIndex = currentNewspaperStatus.getLastTTSIndex(); + + if (this.lastOnSwipeIndex !== -1) { + currentNewspaperStatus.resetLastArticlePositionId(); + } + } + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.NEWSMEMORY_ARTICLE_CHANGE, this._getHeaderInfoTexts(this.getNavigationInfo(index))); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TOGGLE_GRAPHIC_CHANGE_BUTTON_VISIBILITY, { + visible: !(currentArticle && currentArticle.isAd()) + }); + + var _global$getNewsmemory4 = global.getNewsmemoryConfig(), + currentTranslationLanguage = _global$getNewsmemory4.currentTranslationLanguage; + + var toTranslate = currentTranslationLanguage && currentTranslationLanguage !== _NewsmemoryHelper.default.SP.values.translation_disabled && currentArticleRef && currentArticleRef.isTextMode() && !currentArticleRef.isTranslated(currentTranslationLanguage); + + if (this.lastOnSwipeIndex === -1 && lastTTSIndex === index) { + this.currentPosition = index; + } else if (lastTTSIndex !== index) { + if (mgr.ttsIsUserPaused() || lastTTSIndex === -1) { + this.currentPosition = index; + mgr.ttsDestroy(); + } else { + this.stopTTS(true); + this.currentPosition = index; + + if (mgr.ttsIsAutoRestart() && !toTranslate) { + this.startTTS(true); + } + } + } + + if (toTranslate && currentArticleRef) { + currentArticleRef.translate(currentTranslationLanguage); + } + + if (this._simulateAccessibility()) { + var prevArticleRef = this.articleRefs[this.lastOnSwipeIndex]; + + if (prevArticleRef) { + prevArticleRef.accessibilityUnfocus(); + } + + if (currentArticleRef) { + currentArticleRef.accessibilityFocus(); + } + } + + this.lastOnSwipeIndex = index; + + if (currentArticleRef) { + currentArticleRef.checkArticleExtra(); + var text = currentArticleRef.getText(); + var hasText = !!(text && text.trim().length > 0); + + _$$_REQUIRE(_dependencyMap[42]).EventRegister.emit(_events.default.TTS_CHANGE_BUTTON_VISIBILITY, { + visible: currentArticle && currentArticle.isText() && hasText + }); + + this._delayScreenIdleTimer(text, currentArticle); + + currentArticleRef.startHeightCheck(); + this.articleRefs.forEach(function (ref, refIndex) { + if (ref && refIndex !== index) { + ref.stopHeightCheck(); + } + }); + } + } + + var onArticleSelected = this.props.onArticleSelected; + + if (typeof onArticleSelected === "function" && currentArticle) { + onArticleSelected(currentArticle, !currentArticleRef || currentArticleRef.isTextMode() ? _$$_REQUIRE(_dependencyMap[46]).NewsmemoryArticleModes.TEXT : _$$_REQUIRE(_dependencyMap[46]).NewsmemoryArticleModes.GRAPHIC); + } + } + }, { + key: "_simulateAccessibility", + value: function _simulateAccessibility() { + var accessibilityEnabled = this.props.accessibilityEnabled; + return accessibilityEnabled && !_$$_REQUIRE(_dependencyMap[43]).PlatformUtils.isSystemAccessibilityEnabled(); + } + }, { + key: "render", + value: function render() { + var _this$props8 = this.props, + model = _this$props8.model, + isLandscape = _this$props8.isLandscape, + searchText = _this$props8.searchText, + size = _this$props8.size; + return _react.default.createElement(_react.default.Fragment, null, this._getComponentSubHeader(model), _react.default.createElement(_reactNative.View, { + key: "articles_" + isLandscape + "_" + searchText, + style: { + flex: 1 + } + }, _react.default.createElement(_viewPagerComponent.default, { + ref: this.articleViewPager, + containerStyle: _articleLayoutManager.default.swiper, + numberOfRenderPages: ARTICLE_WINDOW_SIZE, + data: this.items, + startPage: this.currentPosition, + onPageChange: this.onSwipe, + width: size.width, + renderPage: this.getContent, + minPointers: this._simulateAccessibility() ? 2 : 1, + skipChildMemo: true + }), global.getAudio() ? _react.default.createElement(_player.default, global.getAudio().ttsPlayerProps()) : null, _react.default.createElement(_articleZoomLevelText.default, null))); + } + }]); + return NewsmemoryArticleLayoutManager; + }(_$$_REQUIRE(_dependencyMap[55]).Shortcut); + + exports.NewsmemoryArticleLayoutManager = NewsmemoryArticleLayoutManager; + NewsmemoryArticleLayoutManager.propTypes = (0, _extends2.default)({ + model: _propTypes.default.instanceOf(_$$_REQUIRE(_dependencyMap[56]).Header).isRequired, + newspaper: _propTypes.default.instanceOf(_NewspaperIssue.default).isRequired, + getCurrentArticle: _propTypes.default.func.isRequired, + getNewspaperStatus: _propTypes.default.func.isRequired, + searchText: _propTypes.default.string, + accessibilityEnabled: _propTypes.default.bool, + carModeEnabled: _propTypes.default.bool, + onCloseAccessibility: _propTypes.default.func, + onCloseCarMode: _propTypes.default.func, + onClose: _propTypes.default.func, + onOpenSearch: _propTypes.default.func, + onOpenIndex: _propTypes.default.func, + onClearSearch: _propTypes.default.func, + onArticleLongPress: _propTypes.default.func, + onArticleSelected: _propTypes.default.func, + onArticleLoaded: _propTypes.default.func, + renderHr: _propTypes.default.func, + fullscreen: _propTypes.default.bool, + onToggleFullscreen: _propTypes.default.func, + header: _propTypes.default.bool, + footer: _propTypes.default.arrayOf(_propTypes.default.shape({ + text: _propTypes.default.string, + url: _propTypes.default.string + })), + formattedIssue: _propTypes.default.string, + isLandscape: _propTypes.default.bool, + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func + }).isRequired, + searchColor: _propTypes.default.string, + size: _propTypes.default.shape({ + width: _propTypes.default.number, + height: _propTypes.default.number + }).isRequired, + FooterComponent: _propTypes.default.node + }, _$$_REQUIRE(_dependencyMap[55]).Shortcut.propTypes); + NewsmemoryArticleLayoutManager.defaultProps = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[55]).Shortcut.defaultProps, { + header: false, + searchColor: _$$_REQUIRE(_dependencyMap[57]).SEARCH_COLOR + }); +},2417,[5,80,6,7,8,15,90,12,14,16,17,201,28,2418,2299,2376,2298,644,2360,640,638,2155,458,460,2352,1859,603,2419,714,715,2372,2374,2420,574,2160,2377,1996,2421,1726,1994,1860,430,572,462,1873,1725,1893,1950,1889,2183,1954,1905,699,717,2182,1911,1853,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + root: { + position: "absolute", + top: 0, + bottom: 0, + left: 0, + right: 0, + width: null, + height: null + }, + header: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_HEIGHT, + flexDirection: "row", + justifyContent: "flex-end" + }, + buttonsContainer: { + flexDirection: "row", + alignItems: "center" + }, + buttons: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_HEIGHT, + flexDirection: "row", + flex: 0, + alignItems: "center" + }, + buttonsRight: { + justifyContent: "flex-end" + }, + buttonsLeft: { + justifyContent: "flex-start", + flex: 1 + }, + left: { + flexDirection: "row" + }, + right: { + flexDirection: "row-reverse" + }, + hr: { + height: _$$_REQUIRE(_dependencyMap[1]).HEADER_HR_SIZE + }, + swiper: { + flex: 1 + } + }); + + exports.default = _default; +},2418,[28,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TIME_TO_HIDE_MILLS = 3000; + var DEFAULT_LEVEL = 100; + var LEVEL_PRECISION = 2; + + var style = _reactNative.StyleSheet.create({ + parent: { + justifyContent: "center", + alignItems: "center", + position: "absolute", + paddingHorizontal: 5, + backgroundColor: "white", + top: 0, + end: 0 + } + }); + + var ArticleZoomLevelText = function (_React$Component) { + (0, _inherits2.default)(ArticleZoomLevelText, _React$Component); + + var _super = _createSuper(ArticleZoomLevelText); + + function ArticleZoomLevelText(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleZoomLevelText); + _this = _super.call(this, props); + _this.state = { + visible: props.visible, + level: props.level + }; + _this.scheduleHide = _this._scheduleHide.bind((0, _assertThisInitialized2.default)(_this)); + + if (props.visible) { + _this.scheduleHide(); + } + + return _this; + } + + (0, _createClass2.default)(ArticleZoomLevelText, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.zoomTextLevelChange = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.ARTICLE_TEXT_ZOOM_CHANGE, function () { + _this2._updateLevel(global.getUserSettings().fontSize); + }); + this.zoomGraphLevelChange = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.ARTICLE_GRAPHIC_ZOOM_CHANGE, function () { + _this2._updateLevel(global.getNewsmemoryConfig().graphSize); + }); + this.onToggleArticleText = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.TOGGLE_ARTICLE_TEXT, function () { + _this2._updateLevel(global.getUserSettings().fontSize); + }); + this.onToggleArticleGraph = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.TOGGLE_ARTICLE_GRAPHIC, function () { + _this2._updateLevel(global.getNewsmemoryConfig().graphSize); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.zoomTextLevelChange); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.zoomGraphLevelChange); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onToggleArticleText); + + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onToggleArticleGraph); + + if (this.showTimerId !== undefined) { + clearTimeout(this.showTimerId); + } + } + }, { + key: "_updateLevel", + value: function _updateLevel(level) { + var currentLevel = this.state.level; + + if (currentLevel !== level) { + this.setState({ + level: level, + visible: true + }, this.scheduleHide); + } + } + }, { + key: "_scheduleHide", + value: function _scheduleHide() { + var _this3 = this; + + if (this.showTimerId !== undefined) { + clearTimeout(this.showTimerId); + this.showTimerId = undefined; + } + + this.showTimerId = setTimeout(function () { + _this3.setState({ + visible: false + }); + }, TIME_TO_HIDE_MILLS); + } + }, { + key: "_getLabel", + value: function _getLabel() { + var level = this.state.level; + + if (Number.isNaN(level)) { + return ""; + } + + return "x" + (level / DEFAULT_LEVEL).toFixed(LEVEL_PRECISION); + } + }, { + key: "render", + value: function render() { + var _this$state = this.state, + visible = _this$state.visible, + level = _this$state.level; + + if (!visible) { + return null; + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-zoom-level-parent"] + }, _react.default.createElement(_reactNative.View, { + style: style.parent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["newsmemory-article-zoom-level-text"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: { + fontSize: _$$_REQUIRE(_dependencyMap[14]).HEADER_FONT_SIZE + } + }, this._getLabel())))); + } + }]); + return ArticleZoomLevelText; + }(_react.default.Component); + + exports.default = ArticleZoomLevelText; + ArticleZoomLevelText.propTypes = { + level: _propTypes.default.number, + visible: _propTypes.default.bool + }; + ArticleZoomLevelText.defaultProps = { + level: DEFAULT_LEVEL, + visible: false + }; +},2419,[5,7,8,15,12,14,16,17,28,201,1879,460,572,699,729]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _simpleButtonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _simpleButtonComponent2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SimpleBadgeButton = function (_SimpleButton) { + (0, _inherits2.default)(SimpleBadgeButton, _SimpleButton); + + var _super = _createSuper(SimpleBadgeButton); + + function SimpleBadgeButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, SimpleBadgeButton); + _this = _super.call(this, props); + var visible = props.visible, + badgeIcon = props.badgeIcon; + _this.state = { + visible: visible, + badgeIcon: badgeIcon + }; + return _this; + } + + (0, _createClass2.default)(SimpleBadgeButton, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(SimpleBadgeButton.prototype), "componentDidMount", this).call(this); + var badgeEvent = this.props.badgeEvent; + + if (badgeEvent) { + this.onBadgeEvent = _$$_REQUIRE(_dependencyMap[14]).EventRegister.on(badgeEvent, function () { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + badgeIcon = _ref.badgeIcon; + + var getBadgeComponent = _this2.props.getBadgeComponent; + + if (getBadgeComponent) { + _this2.forceUpdate(); + } else { + _this2.setState({ + badgeIcon: badgeIcon + }); + } + }); + } + } + }, { + key: "shouldComponentUpdate", + value: function shouldComponentUpdate(nextProps, nextState) { + return !_$$_REQUIRE(_dependencyMap[15]).JSUtils.equals(nextProps, this.props) || !_$$_REQUIRE(_dependencyMap[15]).JSUtils.equals(nextState, this.state); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(SimpleBadgeButton.prototype), "componentWillUnmount", this).call(this); + + _$$_REQUIRE(_dependencyMap[14]).EventRegister.rm(this.onBadgeEvent); + } + }, { + key: "_getBadgeComponent", + value: function _getBadgeComponent() { + var _this$props = this.props, + getBadgeComponent = _this$props.getBadgeComponent, + cssBadgeClasses = _this$props.cssBadgeClasses; + var enableRadius = !_$$_REQUIRE(_dependencyMap[15]).PlatformUtils.isPreviousMarshmallow(); + var style = [_simpleButtonComponent2.default.badge, { + borderRadius: enableRadius ? 10 : 0 + }]; + + if (getBadgeComponent) { + return getBadgeComponent({ + style: style + }); + } + + var badgeIcon = this.state.badgeIcon; + return badgeIcon ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: cssBadgeClasses + }, _react.default.createElement(_imageIconChooserComponent.default, { + style: style, + source: badgeIcon, + forceFastComponent: true, + resizeMode: "contain" + })) : null; + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + parentStyle = _this$props2.parentStyle, + ifHiddenRemove = _this$props2.ifHiddenRemove, + buttonStyle = _this$props2.buttonStyle, + source = _this$props2.source, + tintColor = _this$props2.tintColor, + library = _this$props2.library, + cssProps = _this$props2.cssProps; + var visible = this.state.visible; + + if (!visible) { + if (ifHiddenRemove) { + return null; + } + + return _react.default.createElement(_reactNative.View, { + style: [_simpleButtonComponent2.default.parent, parentStyle] + }); + } + + return _react.default.createElement(_reactNative.TouchableOpacity, { + style: [_simpleButtonComponent2.default.parent, parentStyle], + onPress: this.onPress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, cssProps, _react.default.createElement(_imageIconChooserComponent.default, { + type: library, + name: source, + iconStyle: [_simpleButtonComponent2.default.libraryButton, { + color: tintColor + }], + imageStyle: [_simpleButtonComponent2.default.button, { + tintColor: tintColor + }], + style: [buttonStyle], + resizeMode: "contain", + source: source, + tintColor: tintColor + })), this._getBadgeComponent()); + } + }]); + return SimpleBadgeButton; + }(_simpleButtonComponent.default); + + exports.default = SimpleBadgeButton; + SimpleBadgeButton.propTypes = (0, _extends2.default)({}, _simpleButtonComponent.default.propTypes, { + badgeIcon: _propTypes.default.object, + getBadgeComponent: _propTypes.default.func, + badgeEvent: _propTypes.default.string, + cssBadgeClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }); + SimpleBadgeButton.defaultProps = { + badgeIcon: undefined, + cssBadgeClasses: [] + }; +},2420,[5,6,7,8,90,12,14,16,17,201,28,2299,2300,1970,572,462,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[6]); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _TranslationManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var FlagIconComponent = function FlagIconComponent(props) { + var style = props.style, + language = props.language, + cssClasses = props.cssClasses, + rest = (0, _objectWithoutProperties2.default)(props, ["style", "language", "cssClasses"]); + var enableRadius = !_$$_REQUIRE(_dependencyMap[10]).PlatformUtils.isPreviousMarshmallow(); + var badgeStyle = [{ + borderWidth: 1, + borderRadius: enableRadius ? 15 : 0, + justifyContent: "center" + }, style]; + + var badgeIcon = _TranslationManager.default.getTranslationBadgeIcon(language); + + if (badgeIcon) { + var badgeComponent = badgeIcon === _$$_REQUIRE(_dependencyMap[11]).ACTIONS.translate.noneIcon ? _react.default.createElement(_reactNative.View, { + style: badgeStyle + }, _react.default.createElement(_fontText.default, { + style: { + textAlign: "center" + } + }, language)) : _react.default.createElement(_imageIconChooserComponent.default, (0, _extends2.default)({ + style: badgeStyle, + source: badgeIcon, + resizeMode: "contain" + }, rest)); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Css, { + classes: ["newsmemory-flag-icon"].concat((0, _toConsumableArray2.default)(cssClasses)) + }, badgeComponent); + } + + return null; + }; + + FlagIconComponent.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number, _propTypes.default.array]), + language: _propTypes.default.string, + cssClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }; + FlagIconComponent.defaultProps = { + cssClasses: [] + }; + var _default = FlagIconComponent; + exports.default = _default; +},2421,[5,21,6,108,17,201,28,1970,2178,1879,462,1725,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _simulateAccessibilityAlert = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var SimulateAccessibilityAlert = function () { + function SimulateAccessibilityAlert() { + (0, _classCallCheck2.default)(this, SimulateAccessibilityAlert); + } + + (0, _createClass2.default)(SimulateAccessibilityAlert, null, [{ + key: "show", + value: function show() { + var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var onConfirm = params.onConfirm; + + _$$_REQUIRE(_dependencyMap[6]).ModalOverlay.alert({ + title: global.strings("msg_simulate_accessibility_title"), + message: global.strings("msg_simulate_accessibility", { + accessibilityAppName: _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isAndroid() ? "TalkBack" : "VoiceOver" + }), + buttons: [{ + text: global.strings("btn_cancel") + }, { + Component: _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).ItemAccessibilityFocused, { + touchable: true, + accessibilityEnabled: true, + accessibilityLabel: global.strings("btn_continue"), + style: _simulateAccessibilityAlert.default.button, + onPress: function onPress() { + if (typeof onConfirm === "function") { + onConfirm(); + } + + _$$_REQUIRE(_dependencyMap[6]).ModalOverlay.hide(); + } + }, _react.default.createElement(_fontText.default, { + style: _simulateAccessibilityAlert.default.buttonText, + type: _fontText.Type.bold + }, global.strings("btn_continue"))) + }] + }); + } + }]); + return SimulateAccessibilityAlert; + }(); + + exports.default = SimulateAccessibilityAlert; +},2422,[5,7,8,17,1879,2423,1877,462,2189]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + modal: { + padding: 10 + }, + title: { + fontSize: 20, + color: _$$_REQUIRE(_dependencyMap[1]).colors.black, + margin: 10 + }, + text: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.black, + marginHorizontal: 10, + marginBottom: 10 + }, + button: { + flex: 1, + alignItems: "center", + justifyContent: "center", + height: 50, + borderWidth: 0.5, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + margin: 5 + }, + buttonText: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.black + } + }); + + exports.default = _default; +},2423,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.LayoutFlexManager = exports.LAYOUTS = exports.FOOTER_SIZE = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var FOOTER_SIZE = 54; + exports.FOOTER_SIZE = FOOTER_SIZE; + + function getFooterFlex(windowSize, isLandscape, isFooterAlwaysBottom) { + var style = _$$_REQUIRE(_dependencyMap[6]).Css.getStyleObjByCssClasses(["newsmemory-footer-container"]); + + if (style.flex !== undefined) { + return style.flex; + } + + if (!isFooterAlwaysBottom && isLandscape && style.width !== undefined) { + return 100 * style.width / windowSize.width; + } + + if ((isFooterAlwaysBottom || !isLandscape) && style.height !== undefined) { + return 100 * style.height / windowSize.height; + } + + if (_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isTablet()) { + if (!isFooterAlwaysBottom && isLandscape) { + return 5400 / windowSize.width; + } + + return 5400 / windowSize.height; + } + + return 7; + } + + function getFooterSize(windowSize, isLandscape, isFooterAlwaysBottom) { + var style = _$$_REQUIRE(_dependencyMap[6]).Css.getStyleObjByCssClasses(["newsmemory-footer-container"]); + + var constraintSize = !isFooterAlwaysBottom && isLandscape ? windowSize.width : windowSize.height; + + if (style.flex !== undefined) { + return constraintSize * style.flex / 100; + } + + if (!isFooterAlwaysBottom && isLandscape && style.width !== undefined) { + return style.width; + } + + if ((isFooterAlwaysBottom || !isLandscape) && style.height !== undefined) { + return style.height; + } + + if (_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isTablet()) { + return FOOTER_SIZE; + } + + return constraintSize * 7 / 100; + } + + var LAYOUTS = { + SEARCH: { + key: "search", + style: function style() { + return { + flex: 100 + }; + } + }, + READ: { + key: "read", + style: function style() { + return undefined; + } + }, + ARTICLE: { + key: "article", + style: function style(full) { + var forceFlex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50; + return { + flex: full ? 100 : forceFlex + }; + } + }, + INDEX: { + key: "index", + style: function style(full) { + var forceFlex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50; + return { + flex: full ? 100 : forceFlex + }; + } + }, + THUMBNAIL: { + key: "thumbnail", + style: function style() { + return { + flex: 100 + }; + } + }, + BROWSE: { + key: "browse", + style: function style(full) { + var forceFlex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 50; + return { + flex: full ? 100 : forceFlex + }; + } + }, + FOOTER: { + key: "footer", + style: function style(absolute, windowSize, isLandscape, isFooterAlwaysBottom) { + var flexDirection = "row"; + + if (isLandscape) { + if (!isFooterAlwaysBottom) { + flexDirection = "column"; + } else if (_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isRTL()) { + flexDirection = "row-reverse"; + } + } else if (_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isRTL()) { + flexDirection = "row-reverse"; + } + + if (absolute) { + return { + position: "absolute", + bottom: 0, + start: 0, + end: 0, + height: getFooterSize(windowSize, isLandscape, isFooterAlwaysBottom), + flexDirection: flexDirection + }; + } + + return { + flex: getFooterFlex(windowSize, isLandscape, isFooterAlwaysBottom), + flexDirection: flexDirection + }; + } + }, + PARENT: { + key: "parent", + style: function style(size, isLandscape, isFooterAlwaysBottom) { + var flexDirection = "column"; + + if (isLandscape && !isFooterAlwaysBottom) { + flexDirection = _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isRTL() ? "row-reverse" : "row"; + } + + return (0, _extends2.default)({}, size, { + flexDirection: flexDirection + }); + } + }, + MAIN: { + key: "main", + style: function style(full, windowSize, isLandscape, isFooterAlwaysBottom) { + var flexDirection = "column"; + + if (isLandscape) { + flexDirection = _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isRTL() ? "row-reverse" : "row"; + } + + return { + flex: full ? 100 : 100 - getFooterFlex(windowSize, isLandscape, isFooterAlwaysBottom), + flexDirection: flexDirection + }; + } + }, + EMPTY: { + key: "empty", + style: function style() { + return undefined; + } + } + }; + exports.LAYOUTS = LAYOUTS; + + var LayoutFlexManager = function () { + function LayoutFlexManager(articleFullscreen) { + var footerAlwaysBottom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + (0, _classCallCheck2.default)(this, LayoutFlexManager); + this.history = []; + this.changingOrientation = true; + this.changingFooterAbsolute = true; + this.isFooterAlwaysBottom = footerAlwaysBottom; + this.isPhone = !_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isTablet(); + this.isLandscape = !_deviceUtils.default.isPortrait(); + this.isArticleFullscreen = this.isPhone || articleFullscreen; + this.accessibilityModeEnabled = _$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isSystemAccessibilityEnabled() || LayoutFlexManager.LAST_ACCESSIBILITY_STATE; + LayoutFlexManager.LAST_ACCESSIBILITY_STATE = this.accessibilityModeEnabled; + this.carModeEnabled = false; + this.pageFitVerticalWidth = undefined; + this.reset(); + } + + (0, _createClass2.default)(LayoutFlexManager, [{ + key: "popPreviousLayout", + value: function popPreviousLayout() { + var previousKey = this.history.pop(); + + if (previousKey && LAYOUTS[previousKey.toUpperCase()]) { + return LAYOUTS[previousKey.toUpperCase()]; + } + + return undefined; + } + }, { + key: "getLatestLayout", + value: function getLatestLayout() { + return this.history[this.history.length - 1]; + } + }, { + key: "isLatestLayoutIndex", + value: function isLatestLayoutIndex() { + return this.getLatestLayout() === LAYOUTS.INDEX.key; + } + }, { + key: "setCarModeEnabled", + value: function setCarModeEnabled(enabled) { + this.carModeEnabled = enabled; + } + }, { + key: "isCarModeEnabled", + value: function isCarModeEnabled() { + return this.carModeEnabled; + } + }, { + key: "setAccessibilityModeEnabled", + value: function setAccessibilityModeEnabled(enabled) { + this.accessibilityModeEnabled = enabled; + LayoutFlexManager.LAST_ACCESSIBILITY_STATE = enabled; + } + }, { + key: "isAccessibilityModeEnabled", + value: function isAccessibilityModeEnabled() { + return this.accessibilityModeEnabled; + } + }, { + key: "setChangingOrientation", + value: function setChangingOrientation(changingOrientation) { + this.changingOrientation = changingOrientation; + } + }, { + key: "isChangingOrientation", + value: function isChangingOrientation() { + return this.changingOrientation; + } + }, { + key: "isChangingLayout", + value: function isChangingLayout(_ref) { + var width = _ref.width, + height = _ref.height; + return this.changingOrientation || !_$$_REQUIRE(_dependencyMap[7]).JSUtils.areEqualShallow({ + width: width, + height: height + }, this.size) && !_deviceUtils.default.isAppInBackground(); + } + }, { + key: "setIsFooterAbsolute", + value: function setIsFooterAbsolute(isFooterAbsolute) { + var prevValue = this.isFooterAbsolute; + + if (this.layout.key === LAYOUTS.BROWSE.key && (this.isFooterAlwaysBottom || !this.isLandscape)) { + this.isFooterAbsolute = isFooterAbsolute; + } else { + this.isFooterAbsolute = false; + } + + this.setChangingFooterAbsolute(prevValue !== this.isFooterAbsolute); + } + }, { + key: "isChangingFooterAbsolute", + value: function isChangingFooterAbsolute() { + return this.changingFooterAbsolute; + } + }, { + key: "setChangingFooterAbsolute", + value: function setChangingFooterAbsolute(changingFooterAbsolute) { + this.changingFooterAbsolute = changingFooterAbsolute; + } + }, { + key: "setIsLite", + value: function setIsLite(isLite) { + if (this.isLite !== isLite) { + this.isLite = isLite; + this.reset(); + } + } + }, { + key: "setSize", + value: function setSize(size) { + this.size = size; + } + }, { + key: "setPageFitVerticalWidth", + value: function setPageFitVerticalWidth(width) { + this.pageFitVerticalWidth = width; + } + }, { + key: "reset", + value: function reset() { + this.history = []; + + var _global$getActivePSet = global.getActivePSetup(), + enableVmodeAndFitOrientation = _global$getActivePSet.enableVmodeAndFitOrientation, + startInIndexMode = _global$getActivePSet.startInIndexMode; + + var _global$getNewsmemory = global.getNewsmemoryConfig(), + twoFingersTapToArticle = _global$getNewsmemory.twoFingersTapToArticle, + readModeEnabled = _global$getNewsmemory.readModeEnabled; + + if (this.accessibilityModeEnabled || this.carModeEnabled) { + this.layout = LAYOUTS.INDEX; + } else { + if (!this.isPhone && !this.isLite && twoFingersTapToArticle) { + if (readModeEnabled) { + this.layout = !enableVmodeAndFitOrientation || !this.isLandscape || this.isArticleFullscreen ? LAYOUTS.READ : LAYOUTS.INDEX; + } else { + this.layout = LAYOUTS.BROWSE; + } + } else { + if (this.isLite) { + this.layout = LAYOUTS.BROWSE; + } else if (this.isPhone && startInIndexMode === "1" || !this.isPhone && startInIndexMode === "2" || startInIndexMode === "3") { + this.layout = LAYOUTS.INDEX; + } else { + this.layout = this.isPhone || !enableVmodeAndFitOrientation || !this.isLandscape || this.isArticleFullscreen ? LAYOUTS.BROWSE : LAYOUTS.INDEX; + } + } + } + } + }, { + key: "setLayout", + value: function setLayout(newLayout) { + this.history.push(this.layout.key); + this.layout = newLayout; + + if (this.layout.key !== LAYOUTS.BROWSE.key) { + this.setIsFooterAbsolute(this.isAccessibilityModeEnabled() || this.isCarModeEnabled()); + } + + var _global$getActivePSet2 = global.getActivePSetup(), + startInIndexMode = _global$getActivePSet2.startInIndexMode; + + if (this.isAccessibilityModeEnabled() || this.isCarModeEnabled()) { + if (this.layout.key === LAYOUTS.INDEX.key) { + this.history = []; + } + } else if ((this.isPhone && startInIndexMode === "1" || !this.isPhone && startInIndexMode === "2" || startInIndexMode === "3") && this.layout.key === LAYOUTS.INDEX.key) { + this.history = []; + } else if (startInIndexMode === "0" && (this.layout.key === LAYOUTS.BROWSE.key || this.layout.key === LAYOUTS.READ.key)) { + this.history = []; + } + } + }, { + key: "setIsArticleFullscreen", + value: function setIsArticleFullscreen(articleFullscreen) { + this.isArticleFullscreen = this.isPhone || articleFullscreen; + } + }, { + key: "getThumbnailSize", + value: function getThumbnailSize() { + var style = this.getThumbnailStyle(); + return this.getSectionSize(this.size, style); + } + }, { + key: "getBrowseSize", + value: function getBrowseSize() { + var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.size; + var style = this.getBrowseStyle(); + return this.getSectionSize(size, style); + } + }, { + key: "getAccessibilitySize", + value: function getAccessibilitySize() { + var style = this.getAccessibilityStyle(); + return this.getSectionSize(this.size, style); + } + }, { + key: "getIndexSize", + value: function getIndexSize() { + var style = this.getIndexStyle(); + return this.getSectionSize(this.size, style); + } + }, { + key: "getArticleSize", + value: function getArticleSize() { + var style = this.getArticleStyle(); + return this.getSectionSize(this.size, style); + } + }, { + key: "getFooterSize", + value: function getFooterSize() { + var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.size; + var isLanscape = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.isLandscape; + var style = this.getFooterStyle(); + return this.getSectionSize(size, style, isLanscape); + } + }, { + key: "getSize", + value: function getSize() { + return this.size; + } + }, { + key: "getSectionSize", + value: function getSectionSize(size, style) { + var isLandscape = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.isLandscape; + + if (size && style) { + var _this$getMainStyle = this.getMainStyle(), + flex = _this$getMainStyle.flex; + + var _this$getParentStyle = this.getParentStyle(), + parentFlexDirection = _this$getParentStyle.flexDirection; + + var mainWidth = size.width * flex / 100; + var mainHeight = size.height; + + if (parentFlexDirection.startsWith("column")) { + mainWidth = size.width; + mainHeight = size.height * flex / 100; + } + + if (isLandscape) { + return { + height: mainHeight, + width: mainWidth * style.flex / 100 + }; + } + + return { + height: mainHeight * style.flex / 100, + width: mainWidth + }; + } + + return { + height: 0, + width: 0 + }; + } + }, { + key: "getBrowseForcedFlex", + value: function getBrowseForcedFlex() { + if (_$$_REQUIRE(_dependencyMap[7]).PlatformUtils.isiPadPro12dot9() && this.isLandscape && !_$$_REQUIRE(_dependencyMap[7]).JSUtils.isNull(this.pageFitVerticalWidth)) { + var mainStyle = this.getMainStyle(); + var mainSize = this.getSectionSize(this.size, mainStyle, this.isLandscape); + return Math.min(this.pageFitVerticalWidth / mainSize.width * 100, 50); + } + + return undefined; + } + }, { + key: "getArticleForcedFlex", + value: function getArticleForcedFlex() { + var browseForcedFlex = this.getBrowseForcedFlex(); + + if (!_$$_REQUIRE(_dependencyMap[7]).JSUtils.isNull(browseForcedFlex)) { + return 100 - browseForcedFlex; + } + + return undefined; + } + }, { + key: "getBrowseStyle", + value: function getBrowseStyle() { + if (this.isBrowse() || this.isRead()) { + return LAYOUTS.BROWSE.style(true); + } + + if (!this.isPhone) { + if ((this.isIndex() || this.isArticle()) && !this.isArticleFullscreen && !this.isAccessibilityModeEnabled() && !this.isCarModeEnabled()) { + return LAYOUTS.BROWSE.style(this.isLite, this.getBrowseForcedFlex()); + } + } + + return LAYOUTS.EMPTY.style(); + } + }, { + key: "getIndexStyle", + value: function getIndexStyle() { + if (this.isIndex() && !this.isLite) { + var _global$getNewsmemory2 = global.getNewsmemoryConfig(), + enableTabIndexMode = _global$getNewsmemory2.enableTabIndexMode; + + return LAYOUTS.INDEX.style(this.isArticleFullscreen || this.isAccessibilityModeEnabled() || this.isCarModeEnabled() || enableTabIndexMode, this.getArticleForcedFlex()); + } + + return LAYOUTS.EMPTY.style(); + } + }, { + key: "getArticleStyle", + value: function getArticleStyle() { + if (!this.isLite) { + if (this.isArticle()) { + return LAYOUTS.ARTICLE.style(this.isArticleFullscreen || this.isAccessibilityModeEnabled() || this.isCarModeEnabled(), this.getArticleForcedFlex()); + } + + if (this.isRead()) { + return LAYOUTS.READ.style(); + } + } + + return LAYOUTS.EMPTY.style(); + } + }, { + key: "getThumbnailStyle", + value: function getThumbnailStyle() { + if (this.isThumbnail()) { + return LAYOUTS.THUMBNAIL.style(); + } + + return LAYOUTS.EMPTY.style(); + } + }, { + key: "getSearchStyle", + value: function getSearchStyle() { + if (this.isSearch()) { + return LAYOUTS.SEARCH.style(); + } + + return LAYOUTS.EMPTY.style(); + } + }, { + key: "getFooterStyle", + value: function getFooterStyle() { + if (this.isAccessibilityModeEnabled() || this.isCarModeEnabled()) { + return LAYOUTS.EMPTY.style(); + } + + return LAYOUTS.FOOTER.style(this.isFooterAbsolute, this.size, this.isLandscape, this.isFooterAlwaysBottom); + } + }, { + key: "getMainStyle", + value: function getMainStyle() { + return LAYOUTS.MAIN.style(this.isFooterAbsolute || this.accessibilityModeEnabled || this.carModeEnabled, this.size, this.isLandscape, this.isFooterAlwaysBottom); + } + }, { + key: "getParentStyle", + value: function getParentStyle() { + return LAYOUTS.PARENT.style(this.size, this.isLandscape, this.isFooterAlwaysBottom); + } + }, { + key: "getLayout", + value: function getLayout() { + return this.layout.key; + } + }, { + key: "setIsLandscape", + value: function setIsLandscape(isLandscape) { + this.isLandscape = isLandscape; + } + }, { + key: "isBrowse", + value: function isBrowse() { + return this.getLayout() === LAYOUTS.BROWSE.key; + } + }, { + key: "isIndex", + value: function isIndex() { + return this.getLayout() === LAYOUTS.INDEX.key; + } + }, { + key: "isArticle", + value: function isArticle() { + return this.getLayout() === LAYOUTS.ARTICLE.key; + } + }, { + key: "isRead", + value: function isRead() { + return this.getLayout() === LAYOUTS.READ.key; + } + }, { + key: "isThumbnail", + value: function isThumbnail() { + return this.getLayout() === LAYOUTS.THUMBNAIL.key; + } + }, { + key: "isBrowseVisible", + value: function isBrowseVisible() { + if (this.isThumbnail() || this.isSearch()) { + return false; + } + + if ((this.isArticle() || this.isIndex()) && this.isArticleFullscreen) { + return false; + } + + return true; + } + }, { + key: "isSearch", + value: function isSearch() { + return this.getLayout() === LAYOUTS.SEARCH.key; + } + }, { + key: "openIndex", + value: function openIndex() { + this.setLayout(LAYOUTS.INDEX); + } + }, { + key: "openArticle", + value: function openArticle(read) { + if (read) { + this.setLayout(LAYOUTS.READ); + } else { + this.setLayout(LAYOUTS.ARTICLE); + } + } + }, { + key: "openThumbnail", + value: function openThumbnail() { + this.setLayout(LAYOUTS.THUMBNAIL); + } + }, { + key: "openSearch", + value: function openSearch() { + this.setLayout(LAYOUTS.SEARCH); + } + }, { + key: "openBrowse", + value: function openBrowse() { + this.setLayout(LAYOUTS.BROWSE); + } + }, { + key: "openAccessibility", + value: function openAccessibility() { + this.setLayout(LAYOUTS.INDEX); + } + }, { + key: "openCarMode", + value: function openCarMode() { + this.setLayout(LAYOUTS.INDEX); + } + }, { + key: "getFooterConstraitSize", + value: function getFooterConstraitSize() { + return getFooterSize(this.size, this.isLandscape, this.isFooterAlwaysBottom); + } + }, { + key: "getStyles", + value: function getStyles() { + return { + browseStyle: this.getBrowseStyle(), + indexStyle: this.getIndexStyle(), + articleStyle: this.getArticleStyle(), + thumbnailStyle: this.getThumbnailStyle(), + searchStyle: this.getSearchStyle(), + footerStyle: this.getFooterStyle(), + mainStyle: this.getMainStyle(), + parentStyle: this.getParentStyle() + }; + } + }]); + return LayoutFlexManager; + }(); + + exports.LayoutFlexManager = LayoutFlexManager; + LayoutFlexManager.LAST_ACCESSIBILITY_STATE = false; +},2424,[5,7,8,6,458,1859,699,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2425,[2426]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ProgressBar = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ProgressBar = function (_React$Component) { + (0, _inherits2.default)(ProgressBar, _React$Component); + + var _super = _createSuper(ProgressBar); + + function ProgressBar(props) { + var _this; + + (0, _classCallCheck2.default)(this, ProgressBar); + _this = _super.call(this, props); + _this.state = { + downloading: props.startProgress > 0 && props.startProgress < 1, + startProgress: props.startProgress + }; + return _this; + } + + (0, _createClass2.default)(ProgressBar, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.downloadStartedId = _$$_REQUIRE(_dependencyMap[9]).EventRegister.on(_events.default.NEWSMEMORY_INITIAL_DOWNLOAD_STARTED, function (_ref) { + var startProgress = _ref.startProgress; + + _this2.setState({ + downloading: true, + startProgress: startProgress + }); + }); + this.downloadFinishedId = _$$_REQUIRE(_dependencyMap[9]).EventRegister.on(_events.default.NEWSMEMORY_INITIAL_DOWNLOAD_FINISHED, function () { + _this2.setState({ + downloading: false + }); + }); + this.downloadProgressId = _$$_REQUIRE(_dependencyMap[9]).EventRegister.on(_events.default.NEWSMEMORY_DOWNLOAD_PROGRESS, function (_ref2) { + var progress = _ref2.progress; + + if (_this2.progressCircleRef) { + _this2.progressCircleRef.updateProgress(progress); + } else { + _this2.setState({ + downloading: progress < 1, + startProgress: progress + }); + } + }); + this.newspaperLoadedId = _$$_REQUIRE(_dependencyMap[9]).EventRegister.on(_events.default.NEWSMEMORY_NEWSPAPER_LOADED, function () { + _this2.setState({ + downloading: false + }); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[9]).EventRegister.rm(this.downloadStartedId); + + _$$_REQUIRE(_dependencyMap[9]).EventRegister.rm(this.downloadFinishedId); + + _$$_REQUIRE(_dependencyMap[9]).EventRegister.rm(this.downloadProgressId); + + _$$_REQUIRE(_dependencyMap[9]).EventRegister.rm(this.newspaperLoadedId); + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$props = this.props, + style = _this$props.style, + cssClasses = _this$props.cssClasses, + cssTextClasses = _this$props.cssTextClasses; + var _this$state = this.state, + downloading = _this$state.downloading, + startProgress = _this$state.startProgress; + + if (downloading) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).ProgressCircle, { + ref: function ref(_ref3) { + _this3.progressCircleRef = _ref3; + }, + spinnerStyle: style, + spinnerColor: _$$_REQUIRE(_dependencyMap[11]).colors.barColor, + startProgress: startProgress, + advanced: true, + bar: true, + cssClasses: cssClasses, + cssTextClasses: cssTextClasses + }); + } + + return null; + } + }]); + return ProgressBar; + }(_react.default.Component); + + exports.ProgressBar = ProgressBar; + ProgressBar.propTypes = { + startProgress: _propTypes.default.number, + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array]), + cssClasses: _propTypes.default.arrayOf(_propTypes.default.string), + cssTextClasses: _propTypes.default.arrayOf(_propTypes.default.string) + }; + ProgressBar.defaultProps = { + cssClasses: [], + cssTextClasses: [] + }; +},2426,[5,7,8,12,14,16,17,201,460,572,1953,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2427,[2428]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.WallpaperLoading = exports.Wallpaper = undefined; + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var Wallpaper = function (_React$Component) { + (0, _inherits2.default)(Wallpaper, _React$Component); + + var _super = _createSuper(Wallpaper); + + function Wallpaper(props) { + var _this; + + (0, _classCallCheck2.default)(this, Wallpaper); + _this = _super.call(this, props); + + var orientation = _deviceUtils.default.getCurrentFullOrientation(); + + _this.state = { + background: (0, _$$_REQUIRE(_dependencyMap[13]).getSourceByOrientation)(orientation), + style: (0, _$$_REQUIRE(_dependencyMap[13]).getStyleByOrientation)(orientation, props.ignoreSafeArea) + }; + return _this; + } + + (0, _createClass2.default)(Wallpaper, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.orientationListener = _$$_REQUIRE(_dependencyMap[14]).EventRegister.on(_events.default.ON_ORIENTATION_CHANGE, function (_ref) { + var orientation = _ref.orientation, + fullOrientation = _ref.fullOrientation; + + _this2._updateImage(fullOrientation || orientation); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[14]).EventRegister.rm(this.orientationListener); + } + }, { + key: "_updateImage", + value: function _updateImage(orientation) { + var ignoreSafeArea = this.props.ignoreSafeArea; + this.setState({ + background: (0, _$$_REQUIRE(_dependencyMap[13]).getSourceByOrientation)(orientation), + style: (0, _$$_REQUIRE(_dependencyMap[13]).getStyleByOrientation)(orientation, ignoreSafeArea) + }); + } + }, { + key: "render", + value: function render() { + var _this$state = this.state, + background = _this$state.background, + style = _this$state.style; + + if (background) { + return _react.default.createElement(_imageComponent.default, { + source: background, + style: [_$$_REQUIRE(_dependencyMap[15]).styles.center, { + backgroundColor: global.splashBgColor + }, style], + forceRNComponent: true + }); + } + + return null; + } + }], [{ + key: "getDefaultWallpaper", + value: function getDefaultWallpaper(portrait) { + var pSetupConfig = global.getMainPSetup(); + + if (pSetupConfig) { + var layoutStyle = pSetupConfig.layoutStyle, + layoutSubStyle = pSetupConfig.layoutSubStyle; + + if (layoutStyle && layoutSubStyle) { + return global.getAppServer() + "/eeLayout/" + layoutStyle + "/" + layoutSubStyle + "/images/webapp/Default-" + (portrait ? "Portrait" : "Landscape") + ".png"; + } + } + + return undefined; + } + }]); + return Wallpaper; + }(_react.default.Component); + + exports.Wallpaper = Wallpaper; + Wallpaper.propTypes = { + ignoreSafeArea: _propTypes.default.bool + }; + Wallpaper.defaultProps = { + ignoreSafeArea: false + }; + + var WallpaperLoading = function (_React$Component2) { + (0, _inherits2.default)(WallpaperLoading, _React$Component2); + + var _super2 = _createSuper(WallpaperLoading); + + function WallpaperLoading(props) { + var _this3; + + (0, _classCallCheck2.default)(this, WallpaperLoading); + _this3 = _super2.call(this, props); + _this3.onRetry = _this3._onRetry.bind((0, _assertThisInitialized2.default)(_this3)); + return _this3; + } + + (0, _createClass2.default)(WallpaperLoading, [{ + key: "componentDidMount", + value: function componentDidMount() { + var retryEvent = this.props.retryEvent; + + if (retryEvent) { + this.onRetryEvent = _$$_REQUIRE(_dependencyMap[14]).EventRegister.on(retryEvent, this.onRetry); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[14]).EventRegister.rm(this.onRetryEvent); + } + }, { + key: "_onRetry", + value: function _onRetry(_ref2) { + var retryText = _ref2.retryText; + + if (this.progressRef) { + this.progressRef.updateRetryText(retryText); + } + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props = this.props, + showLoading = _this$props.showLoading, + ignoreSafeArea = _this$props.ignoreSafeArea, + text = _this$props.text; + var backgroundColor = WallpaperLoading.getBackground(); + var component = WallpaperLoading.getComponent(ignoreSafeArea); + + if (!showLoading) { + return component; + } + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + justifyContent: "flex-end", + flexDirection: "column", + backgroundColor: backgroundColor + } + }, global.isTaAddon() ? null : component, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ProgressCircle, { + ref: function ref(_ref3) { + _this4.progressRef = _ref3; + }, + parentStyle: { + height: 50, + bottom: 50 + }, + spinnerColor: WallpaperLoading.getTextColor(backgroundColor), + showText: true, + text: text || global.strings("loading") + })); + } + }], [{ + key: "getComponent", + value: function getComponent(ignoreSafeArea) { + if (global.isTaAddon()) { + return null; + } + + return _react.default.createElement(Wallpaper, { + ignoreSafeArea: ignoreSafeArea + }); + } + }, { + key: "getBackground", + value: function getBackground() { + if (global.isTaAddon()) { + return _$$_REQUIRE(_dependencyMap[17]).colors.transparent600; + } + + if (global.splashBgColor) { + return global.splashBgColor; + } + + return _$$_REQUIRE(_dependencyMap[17]).colors.white; + } + }, { + key: "getTextColor", + value: function getTextColor(backgroundColor) { + if (global.isTaAddon()) { + return _$$_REQUIRE(_dependencyMap[17]).ColorUtils.determineTextColor(backgroundColor); + } + + return global.loadingColor; + } + }]); + return WallpaperLoading; + }(_react.default.Component); + + exports.WallpaperLoading = WallpaperLoading; + WallpaperLoading.propTypes = { + showLoading: _propTypes.default.bool, + ignoreSafeArea: _propTypes.default.bool, + text: _propTypes.default.string, + retryEvent: _propTypes.default.string + }; + WallpaperLoading.defaultProps = { + showLoading: true, + ignoreSafeArea: false + }; +},2428,[5,15,7,8,12,14,16,17,201,28,458,460,588,2429,572,2430,1953,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getStyleByOrientation = exports.getSourceByOrientation = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var DEVICE_LOGICAL_DIMENSIONS = { + IPAD_PRO_12_9: { + width: 1024, + height: 1366 + }, + IPAD_PRO_11: { + width: 834, + height: 1194 + }, + IPAD_PRO_10_5: { + width: 834, + height: 1112 + }, + IPAD_REGULAR: { + width: 768, + height: 1024 + }, + IPHONE_XS_MAX: { + width: 414, + height: 896 + }, + IPHONE_XR: { + width: 414, + height: 896 + }, + IPHONE_X: { + width: 375, + height: 812 + }, + IPHONE_PLUS: { + width: 414, + height: 736 + }, + IPHONE_REGULAR: { + width: 375, + height: 667 + }, + IPHONE_SE: { + width: 320, + height: 568 + } + }; + + var getDeviceLogicalDimensions = function getDeviceLogicalDimensions(orientation) { + var dimensions; + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhone()) { + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneXSMax()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPHONE_XS_MAX; + } else if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneXr()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPHONE_XR; + } else if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneX()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPHONE_X; + } else if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhonePlus()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPHONE_PLUS; + } else if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneRegular()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPHONE_REGULAR; + } else { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPHONE_SE; + } + } else { + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPadPro12dot9()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPAD_PRO_12_9; + } else if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPadPro11()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPAD_PRO_11; + } else if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPadPro10dot5()) { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPAD_PRO_10_5; + } else { + dimensions = DEVICE_LOGICAL_DIMENSIONS.IPAD_REGULAR; + } + } + + var isPortrait = _deviceUtils.default.isPortrait(orientation); + + var width = isPortrait ? dimensions.width : dimensions.height; + var height = isPortrait ? dimensions.height : dimensions.width; + return { + width: width, + height: height + }; + }; + + var getSourceByOrientation = function getSourceByOrientation(orientation) { + var isPortrait = _deviceUtils.default.isPortrait(orientation); + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhone()) { + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneXSMax()) { + if (isPortrait) { + return { + uri: "Default-1242h" + }; + } + + return { + uri: "Default-Landscape-1242h" + }; + } + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneXr()) { + if (isPortrait) { + return { + uri: "Default-896h" + }; + } + + return { + uri: "Default-Landscape-896h" + }; + } + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneX()) { + if (isPortrait) { + return { + uri: "Default-375w-812h" + }; + } + + return { + uri: "Default-Landscape-812h" + }; + } + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhonePlus()) { + if (isPortrait) { + return { + uri: "Default-736h" + }; + } + + return { + uri: "Default-Landscape-414w-736h" + }; + } + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneRegular()) { + return { + uri: "Default-667h" + }; + } + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPhoneSE()) { + return { + uri: "Default-568h" + }; + } + } else { + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPadPro12dot9()) { + if (isPortrait) { + return { + uri: "Default-Portrait-1024w-1366h" + }; + } + + return { + uri: "Default-Landscape-1024w-1366h" + }; + } + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPadPro11()) { + if (isPortrait) { + return { + uri: "Default-Portrait-1194h" + }; + } + + return { + uri: "Default-Landscape-1194h" + }; + } + + if (_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isiPadPro10dot5()) { + if (isPortrait) { + return { + uri: "Default-Portrait-834w-1112h" + }; + } + + return { + uri: "Default-Landscape-834w-1112h" + }; + } + } + + if (isPortrait) { + return { + uri: "Default-Portrait" + }; + } + + return { + uri: "Default-Landscape" + }; + }; + + exports.getSourceByOrientation = getSourceByOrientation; + + var getStyleByOrientation = function getStyleByOrientation(orientation) { + var ignoreSafeArea = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var style = {}; + + if (!_$$_REQUIRE(_dependencyMap[3]).PlatformUtils.hasLandscapeSplashImage() && !_deviceUtils.default.isPortrait(orientation)) { + var rotate = _$$_REQUIRE(_dependencyMap[3]).PlatformUtils.isLandscapeLeft(orientation) ? "90deg" : "270deg"; + style.transform = [{ + rotate: rotate + }]; + style.resizeMode = "center"; + } + + return (0, _extends2.default)({}, getDeviceLogicalDimensions(orientation), style, { + left: ignoreSafeArea ? 0 : -_deviceUtils.default.insets.left, + right: ignoreSafeArea ? 0 : -_deviceUtils.default.insets.right, + top: ignoreSafeArea ? 0 : -_deviceUtils.default.insets.top, + bottom: ignoreSafeArea ? 0 : -_deviceUtils.default.insets.bottom + }); + }; + + exports.getStyleByOrientation = getStyleByOrientation; +},2429,[5,6,458,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + center: { + flex: 0, + width: "100%", + height: "100%" + } + }); + + exports.styles = styles; +},2430,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2431,[2432]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewsmemoryHTML5Screen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _reactNativeShare = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryHTML5Screen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(NewsmemoryHTML5Screen, _NavigationBaseScreen); + + var _super = _createSuper(NewsmemoryHTML5Screen); + + function NewsmemoryHTML5Screen() { + (0, _classCallCheck2.default)(this, NewsmemoryHTML5Screen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(NewsmemoryHTML5Screen, [{ + key: "UNSAFE_componentWillMount", + value: function UNSAFE_componentWillMount() { + _LiveConfig.default.setEpaperHTML5Side(); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryHTML5Screen.prototype), "handleBackButton", this).call(this); + + if (_LiveConfig.default.getStartUpNavigator() === "NewsmemoryNavigator") { + this.closeApp(); + } else { + this.goToRssNavigator(); + } + + return true; + } + }, { + key: "goToRssNavigator", + value: function goToRssNavigator() { + _NavigationService.default.main.reset("RssNavigator"); + } + }, { + key: "getTag", + value: function getTag() { + return "ePaper HTML5"; + } + }, { + key: "render", + value: function render() { + var _global$getMainPSetup = global.getMainPSetup(), + siteDomain = _global$getMainPSetup.siteDomain, + overrideNewsMemoryUserAgent = _global$getMainPSetup.overrideNewsMemoryUserAgent; + + var uri = siteDomain; + + if (uri.indexOf("?") !== -1) { + uri += "&"; + } else { + uri += "?"; + } + + uri += "rn=1"; + + if (uri.indexOf("http") !== 0) { + uri = _$$_REQUIRE(_dependencyMap[13]).NetworkUtils.addDefaultProtocol(uri); + } + + var userAgent = overrideNewsMemoryUserAgent || _$$_REQUIRE(_dependencyMap[13]).PlatformUtils.getUserAgent(); + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "column", + justifyContent: "flex-end" + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).BaseWebView, { + source: { + uri: uri + }, + onLinkClicked: function onLinkClicked() { + return true; + }, + onLocal: function onLocal(_ref) { + var domain = _ref.domain, + getParams = _ref.getParams; + + if (domain === "share") { + var type = getParams.type, + url = getParams.url, + subject = getParams.subject, + title = getParams.title; + + if (["facebook", "whatsapp", "twitter"].includes(type)) { + _reactNativeShare.default.shareSingle({ + url: url, + message: "", + title: title, + social: type + }); + } else if (type === "email") { + _reactNativeShare.default.shareSingle({ + url: url, + message: "", + title: title, + subject: subject, + social: type + }); + } else if (type === "clipboard") { + _reactNative.Clipboard.setString(url); + + _$$_REQUIRE(_dependencyMap[15]).Toast.show(global.strings("msg_copy_to_clipboard"), { + position: "top" + }); + } else { + _$$_REQUIRE(_dependencyMap[15]).Toast.show(global.strings("msg_share_unmanaged"), { + position: "top" + }); + } + } + }, + userAgent: userAgent + })); + } + }]); + return NewsmemoryHTML5Screen; + }(_$$_REQUIRE(_dependencyMap[16]).NavigationBaseScreen); + + exports.NewsmemoryHTML5Screen = NewsmemoryHTML5Screen; + + NewsmemoryHTML5Screen.navigationOptions = function (_ref2) { + var navigation = _ref2.navigation; + var params = navigation.state.params; + return params; + }; + + NewsmemoryHTML5Screen.propTypes = { + navigation: _propTypes.default.object + }; +},2432,[5,7,8,90,12,14,16,17,28,575,201,1872,1861,462,1894,1889,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewsmemoryNativeScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _RssIndexConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + var _NewsmemoryConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _IAPHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var NewsmemoryNativeScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(NewsmemoryNativeScreen, _NavigationBaseScreen); + + var _super = _createSuper(NewsmemoryNativeScreen); + + function NewsmemoryNativeScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, NewsmemoryNativeScreen); + _this = _super.call(this, props); + _this.currentOrientation = _deviceUtils.default.currentFullOrientation; + return _this; + } + + (0, _createClass2.default)(NewsmemoryNativeScreen, [{ + key: "UNSAFE_componentWillMount", + value: function UNSAFE_componentWillMount() { + _LiveConfig.default.setEpaperClassicSide(); + + Analytics.initMatomo(); + Analytics.initMatomoTracker(); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryNativeScreen.prototype), "componentDidMount", this).call(this); + + _IAPHelper.default.unregisterReceiver(); + + var _global$getRssIndex = global.getRssIndex(), + paywallEnabled = _global$getRssIndex.paywallEnabled; + + var _global$getFontsConfi = global.getFontsConfig(), + fontBold = _global$getFontsConfi.fontBold, + fontMedium = _global$getFontsConfi.fontMedium, + fontRegular = _global$getFontsConfi.fontRegular; + + var tab = this.props.tab; + var reactTag = this.viewRef ? (0, _reactNative.findNodeHandle)(this.viewRef) : undefined; + + var IOSClassicEPaper = _optionalPackageUtils.default.getIOSClassicEPaper(); + + if (IOSClassicEPaper) { + IOSClassicEPaper.navigateToNewsmemory({ + splashPortrait: _$$_REQUIRE(_dependencyMap[20]).Wallpaper.getDefaultWallpaper(true) || "", + splashLandscape: _$$_REQUIRE(_dependencyMap[20]).Wallpaper.getDefaultWallpaper(false) || "", + machineId: global.machineId || "", + isHTTPS: global.isHTTPS(), + buildPSetup: global.getAppPSetup(), + buildServer: global.getAppServer(), + backToRssAfterLogin: false, + isPaywallEnabled: paywallEnabled || false, + startupNavigator: _LiveConfig.default.getStartUpNavigator() === "NewsmemoryNavigator", + fontBold: fontBold, + fontMedium: fontMedium, + fontRegular: fontRegular, + tab: tab, + startupParams: global.getNewsmemoryStartupParams(), + reactTag: reactTag + }).then(function () { + _this2.setNewsmemoryDemo = IOSClassicEPaper.addListener(IOSClassicEPaper.NEWSMEMORY_SET_RN_DEMO, function (params) { + var newsmemoryConfig = global.getNewsmemoryConfig(); + newsmemoryConfig.setRNUseDemo(params.useRnDemo); + }); + _this2.closeListener = IOSClassicEPaper.addListener(IOSClassicEPaper.NEWSMEMORY_CLOSE, function () { + _this2.handleBackButton(); + }); + _this2.goToRss = IOSClassicEPaper.addListener(IOSClassicEPaper.NEWSMEMORY_GO_TO_RSS, function () { + _this2.goToRssNavigator(); + }); + _this2.analyticsScreen = IOSClassicEPaper.addListener(IOSClassicEPaper.NEWSMEMORY_ANALYTICS_SCREEN, function (params) { + try { + var _screenMapping = (0, _$$_REQUIRE(_dependencyMap[21]).screenMapping)(params), + screen = _screenMapping.screen, + event = _screenMapping.event, + customDimensions = _screenMapping.customDimensions, + remp = _screenMapping.remp; + + Analytics.trackCustomFirebaseEvent(event); + Analytics.trackScreen(screen, params, customDimensions); + + if (remp) { + Analytics.trackRempAccount(remp); + } + } catch (e) {} + }); + _this2.analyticsEvent = IOSClassicEPaper.addListener(IOSClassicEPaper.NEWSMEMORY_ANALYTICS_EVENT, function (params) { + Analytics.trackEvent((0, _$$_REQUIRE(_dependencyMap[21]).eventMapping)(params)); + }); + _this2.loginListener = IOSClassicEPaper.addListener(IOSClassicEPaper.NEWSMEMORY_LOGIN, function _callee(params) { + var pSetup, machine, TAUID, token, username, password, extid, extraUserInfo, _global$getActivePSet, currentPSetup, _global$getActivePSet2, loginStatus, firebaseAnalyticsSendExternalId; + + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + pSetup = params.pSetup, machine = params.machine, TAUID = params.TAUID, token = params.token, username = params.username, password = params.password, extid = params.extid, extraUserInfo = params.extraUserInfo; + _global$getActivePSet = global.getActivePSetup(), currentPSetup = _global$getActivePSet.pSetup; + + if (!(pSetup && pSetup !== currentPSetup)) { + _context.next = 6; + break; + } + + _context.next = 5; + return _regenerator.default.awrap(global.loadPSetup(pSetup, machine, { + fromCache: false + })); + + case 5: + Analytics.updateAnalyticsClientList(); + + case 6: + _global$getActivePSet2 = global.getActivePSetup(), loginStatus = _global$getActivePSet2.loginStatus, firebaseAnalyticsSendExternalId = _global$getActivePSet2.firebaseAnalyticsSendExternalId; + + if (!loginStatus) { + _context.next = 17; + break; + } + + loginStatus.setTAUID(TAUID); + loginStatus.setToken(token); + loginStatus.setUsername(username); + loginStatus.setPassword(password); + loginStatus.setExtId(extid); + loginStatus.setExtraUserInfo(extraUserInfo); + + if (!firebaseAnalyticsSendExternalId) { + _context.next = 17; + break; + } + + _context.next = 17; + return _regenerator.default.awrap(Analytics.initGoogleAnalyticsFirebase()); + + case 17: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }); + _this2.logoutListener = IOSClassicEPaper.addListener(IOSClassicEPaper.NEWSMEMORY_LOGOUT, function () { + var _global$getActivePSet3 = global.getActivePSetup(), + loginStatus = _global$getActivePSet3.loginStatus; + + if (loginStatus) { + loginStatus.clear(); + } + }); + }); + this.onStateChangeForeground = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_FOREGROUND, function () { + IOSClassicEPaper.goingForeground(); + + if (_$$_REQUIRE(_dependencyMap[23]).NetworkUtils.isOnline()) { + var feedback = new (_$$_REQUIRE(_dependencyMap[24]).Feedback)(); + feedback.check(); + } + }); + this.onStateChangeInactive = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_INACTIVE, IOSClassicEPaper.goingInactive); + this.onStateChangeBackground = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_BACKGROUND, IOSClassicEPaper.goingBackground); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryNativeScreen.prototype), "componentWillUnmount", this).call(this); + + if (this.closeListener) { + this.closeListener.remove(); + } + + if (this.goToRss) { + this.goToRss.remove(); + } + + if (this.analyticsScreen) { + this.analyticsScreen.remove(); + } + + if (this.analyticsEvent) { + this.analyticsEvent.remove(); + } + + if (this.loginListener) { + this.loginListener.remove(); + } + + if (this.logoutListener) { + this.logoutListener.remove(); + } + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onStateChangeForeground); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onStateChangeInactive); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onStateChangeBackground); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(NewsmemoryNativeScreen.prototype), "handleBackButton", this).call(this); + + if (_LiveConfig.default.getStartUpNavigator() === "NewsmemoryNavigator") { + this.closeApp(); + } else { + this.goToRssNavigator(); + } + + return true; + } + }, { + key: "orientationListener", + value: function orientationListener(orientation) { + var IOSClassicEPaper = _optionalPackageUtils.default.getIOSClassicEPaper(); + + if (IOSClassicEPaper) { + IOSClassicEPaper.rotate(this.currentOrientation, _deviceUtils.default.currentFullOrientation); + this.currentOrientation = _deviceUtils.default.currentFullOrientation; + } + } + }, { + key: "goToRssNavigator", + value: function goToRssNavigator() { + _NavigationService.default.main.reset("RssNavigator"); + } + }, { + key: "getTag", + value: function getTag() { + return "ePaper Classic"; + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + return _react.default.createElement(_reactNative.View, { + ref: function ref(_ref) { + _this3.viewRef = _ref; + }, + style: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[23]).colors.black + } + }); + } + }]); + return NewsmemoryNativeScreen; + }(_$$_REQUIRE(_dependencyMap[25]).NavigationBaseScreen); + + exports.NewsmemoryNativeScreen = NewsmemoryNativeScreen; + + NewsmemoryNativeScreen.navigationOptions = function (_ref2) { + var navigation = _ref2.navigation; + var params = navigation.state.params; + return params; + }; + + NewsmemoryNativeScreen.propTypes = { + navigation: _propTypes.default.object + }; +},2433,[5,80,7,8,90,12,14,16,17,28,201,1872,2044,1861,460,1871,1859,1934,731,458,2428,1959,572,462,2151,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2434,[2435]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GalleryScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _galleryThumbnailsComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _galleryPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _galleryCounter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[16])); + + var _share = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(GalleryScreen, _NavigationBaseScreen); + + var _super = _createSuper(GalleryScreen); + + function GalleryScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryScreen); + _this = _super.call(this, props, { + thumbnailVisible: _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isTablet() + }); + _this.updateViews = _this._updateViews.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleThumbnail = _this._toggleThumbnail.bind((0, _assertThisInitialized2.default)(_this)); + _this.currentPosition = _this._getStartIndex(); + return _this; + } + + (0, _createClass2.default)(GalleryScreen, [{ + key: "getTag", + value: function getTag() { + return "Gallery"; + } + }, { + key: "trackScreen", + value: function trackScreen() {} + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(GalleryScreen.prototype), "handleBackButton", this).call(this); + var navigation = this.props.navigation; + navigation.goBack(); + return true; + } + }, { + key: "_getThumbnailList", + value: function _getThumbnailList(items) { + var thumbnail = []; + items.forEach(function (item) { + if (item.thumbnail) { + thumbnail.push(item.thumbnail); + } else { + thumbnail.push(item.url); + } + }); + return thumbnail; + } + }, { + key: "_sendAnalytics", + value: function _sendAnalytics(index) { + var current = this._getItems()[index]; + + if (current) { + var lastSegment = current.url ? current.url.substring(current.url.lastIndexOf("/") + 1) : ""; + var title = this._getTitle() || current.title || ""; + + var caller = this._getCaller(); + + if (caller === "live_news") { + (0, _$$_REQUIRE(_dependencyMap[20]).sendToAnalytics)({ + event_action: caller + "_gallery", + screen_name: "Live News Gallery", + category: this._getCategory(), + title: title, + index: index, + type: current.action, + gallery_id: lastSegment + }); + } else { + var edition = this._getEdition(); + + var page = this._getPage(); + + var article = this._getArticle(); + + if (article) { + (0, _$$_REQUIRE(_dependencyMap[21]).sendNewsmemoryArticleGallery)(index, edition, page, article); + } else { + (0, _$$_REQUIRE(_dependencyMap[21]).sendNewsmemoryGallery)(title, lastSegment, index, edition, page); + } + } + } + } + }, { + key: "_toggleThumbnail", + value: function _toggleThumbnail() { + this.setState(function (prevState) { + return { + thumbnailVisible: !prevState.thumbnailVisible + }; + }); + } + }, { + key: "_getTextColor", + value: function _getTextColor(color) { + return color || _$$_REQUIRE(_dependencyMap[19]).colors.white; + } + }, { + key: "_getParam", + value: function _getParam(name, defaultValue) { + var params = (0, _$$_REQUIRE(_dependencyMap[22]).getNavigationParams)(this.props); + return params[name] || defaultValue; + } + }, { + key: "_getCategory", + value: function _getCategory() { + return this._getParam("category", ""); + } + }, { + key: "_getTitle", + value: function _getTitle() { + return this._getParam("title", ""); + } + }, { + key: "_getStartIndex", + value: function _getStartIndex() { + return this._getParam("index", 0); + } + }, { + key: "_getItems", + value: function _getItems() { + return this._getParam("items", []); + } + }, { + key: "_getEdition", + value: function _getEdition() { + return this._getParam("edition"); + } + }, { + key: "_getPage", + value: function _getPage() { + return this._getParam("page"); + } + }, { + key: "_getArticle", + value: function _getArticle() { + return this._getParam("article"); + } + }, { + key: "_getCaller", + value: function _getCaller() { + return this._getParam("caller", ""); + } + }, { + key: "_updateViews", + value: function _updateViews(item, index) { + if (this.currentPosition !== index) { + this.currentPosition = index; + + if (this.thumbnailsRef) { + this.thumbnailsRef.scrollTo(index); + } + + if (this.galleryCaptionRef) { + this.galleryCaptionRef.setText(item.caption); + } + + if (this.galleryCounterRef) { + this.galleryCounterRef.setIndex(index); + } + + if (this.galleryTitleRef) { + this.galleryTitleRef.setText(item.title); + } + } + + this._sendAnalytics(index); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + navigation = _this$props.navigation, + considerSafeAreaTop = _this$props.considerSafeAreaTop; + var thumbnailVisible = this.state.thumbnailVisible; + + var items = this._getItems(navigation); + + var current = items[this.currentPosition]; + + if (items && items.length) { + var _global$getActivePSet = global.getActivePSetup(), + galleryDownloadEnabled = _global$getActivePSet.galleryDownloadEnabled, + galleryThumbnailEnabled = _global$getActivePSet.galleryThumbnailEnabled; + + var _global$getRssIndex = global.getRssIndex(), + showGalleryTitle = _global$getRssIndex.showGalleryTitle; + + var galleryDownload = galleryDownloadEnabled; + + if (galleryDownload && _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isIOS()) { + galleryDownload = _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.getMajorSystemVersion() >= 11; + } + + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[23]).styles.parent, { + top: considerSafeAreaTop ? _deviceUtils.default.getSafeAreaInsets().top : 0 + }] + }, _react.default.createElement(_galleryPagerComponent.default, { + ref: function ref(_ref) { + _this2.galleryPagerRef = _ref; + }, + startIndex: this.currentPosition, + onIndexChanged: this.updateViews, + data: items + }), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[23]).styles.header + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[23]).styles.toolbar + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[23]).styles.toolbarLeft + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.onHandleBackButton + }, _react.default.createElement(_iconComponent.default, { + name: _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isRTL() ? "arrow-forward" : "arrow-back", + style: _$$_REQUIRE(_dependencyMap[23]).styles.btn, + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS + }))), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[23]).styles.toolbarCenter + }, _react.default.createElement(_galleryCounter.default, { + ref: function ref(_ref2) { + _this2.galleryCounterRef = _ref2; + }, + total: items.length, + startIndex: this.currentPosition + })), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[23]).styles.toolbarRight + }, galleryDownload ? _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + GalleryScreen._downloadImage(items[_this2.currentPosition], _this2.currentPosition, _this2._getTitle()); + } + }, _react.default.createElement(_iconComponent.default, { + name: "cloud-download", + style: _$$_REQUIRE(_dependencyMap[23]).styles.btn, + type: _iconComponent.TecnaviaIconType.FONT_AWESOME + })) : null, galleryThumbnailEnabled && items.length > 1 ? _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.toggleThumbnail + }, _react.default.createElement(_iconComponent.default, { + name: "view-grid", + style: _$$_REQUIRE(_dependencyMap[23]).styles.btn, + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS + })) : null)), showGalleryTitle ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).GalleryText, { + ref: function ref(_ref3) { + _this2.galleryTitleRef = _ref3; + }, + text: current.title, + color: this._getTextColor(current.color), + styles: [_$$_REQUIRE(_dependencyMap[23]).styles.text, _$$_REQUIRE(_dependencyMap[23]).styles.title], + maxLines: 1 + }) : null), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[23]).styles.footer + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).GalleryText, { + ref: function ref(_ref4) { + _this2.galleryCaptionRef = _ref4; + }, + text: current.caption, + color: this._getTextColor(current.color), + styles: [_$$_REQUIRE(_dependencyMap[23]).styles.text, _$$_REQUIRE(_dependencyMap[23]).styles.caption], + maxLines: _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isTablet() ? 3 : 2 + }), galleryThumbnailEnabled ? _react.default.createElement(_galleryThumbnailsComponent.default, { + ref: function ref(_ref5) { + _this2.thumbnailsRef = _ref5; + }, + data: this._getThumbnailList(items), + startIndex: this.currentPosition, + visible: thumbnailVisible && items.length > 1, + onThumbnailPress: function onThumbnailPress(item, index) { + if (_this2.galleryPagerRef) { + _this2.galleryPagerRef.scrollTo(index); + } + } + }) : null)); + } + + this.handleBackButton(); + return null; + } + }], [{ + key: "_downloadImage", + value: function _downloadImage(_ref6, position, galleryTitle) { + var url, extension, hasPermission, basePath, path, response, downloadPath, type; + return _regenerator.default.async(function _downloadImage$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + url = _ref6.url, extension = _ref6.extension; + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[19]).PlatformUtils.requestPermission({ + permission: _reactNative.PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE, + title: global.strings("permission_title", { + appName: global.appName + }), + message: global.strings("permission_storage_message", { + appName: global.appName + }) + })); + + case 4: + hasPermission = _context.sent; + + if (!hasPermission) { + _context.next = 37; + break; + } + + basePath = _$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isIOS() ? "" + _tecnaviaFileUtils.default.temporaryDirectory + (galleryTitle ? "gallery_" + galleryTitle : "gallery") : _tecnaviaFileUtils.default.picturesDirectory + "/" + global.appName; + path = extension ? basePath + "/image_" + galleryTitle + "_" + position + "." + extension : basePath + "/image_" + galleryTitle + "_" + position; + _context.next = 10; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.fetch(url)); + + case 10: + response = _context.sent; + downloadPath = response.path(); + _context.prev = 12; + _context.next = 15; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.mkdir(basePath)); + + case 15: + _context.next = 17; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(path)); + + case 17: + _context.next = 21; + break; + + case 19: + _context.prev = 19; + _context.t0 = _context["catch"](12); + + case 21: + _context.prev = 21; + _context.next = 24; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.moveFile(downloadPath, path)); + + case 24: + _context.next = 28; + break; + + case 26: + _context.prev = 26; + _context.t1 = _context["catch"](21); + + case 28: + if (!_$$_REQUIRE(_dependencyMap[19]).PlatformUtils.isIOS()) { + _context.next = 34; + break; + } + + type = extension === "jpg" ? "image/jpeg" : "image/png"; + _context.next = 32; + return _regenerator.default.awrap(_share.default.shareToFiles(path, type)); + + case 32: + _context.next = 35; + break; + + case 34: + _tecnaviaFileUtils.default.scanFile(downloadPath); + + case 35: + _context.next = 37; + break; + + case 37: + _context.next = 41; + break; + + case 39: + _context.prev = 39; + _context.t2 = _context["catch"](1); + + case 41: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 39], [12, 19], [21, 26]], Promise); + } + }]); + return GalleryScreen; + }(_$$_REQUIRE(_dependencyMap[22]).NavigationBaseScreen); + + exports.GalleryScreen = GalleryScreen; + GalleryScreen.propTypes = { + navigation: _propTypes.default.object, + considerSafeAreaTop: _propTypes.default.bool + }; + GalleryScreen.defaultProps = { + considerSafeAreaTop: false + }; +},2435,[5,80,7,8,15,90,12,14,16,17,28,201,458,2436,2440,2464,1806,2352,574,462,2210,1954,2148,2444,2466]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _galleryThumbnailComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryThumbnails = function (_Component) { + (0, _inherits2.default)(GalleryThumbnails, _Component); + + var _super = _createSuper(GalleryThumbnails); + + function GalleryThumbnails(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryThumbnails); + _this = _super.call(this, props); + _this.state = { + visible: props.visible + }; + return _this; + } + + (0, _createClass2.default)(GalleryThumbnails, [{ + key: "scrollTo", + value: function scrollTo(index) { + _$$_REQUIRE(_dependencyMap[10]).EventRegister.emit(_events.default.GALLERY_THUMBNAIL_CLICK, { + index: index + }); + + if (this.flatList) { + if (_$$_REQUIRE(_dependencyMap[11]).PlatformUtils.isIOS() && _$$_REQUIRE(_dependencyMap[11]).PlatformUtils.isRTL()) { + var data = this.props.data; + + if (data && data.length > 0) { + index = data.length - index; + } + } + + this.flatList.scrollToIndex({ + animated: true, + index: index + }); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + data = _this$props.data, + onThumbnailPress = _this$props.onThumbnailPress, + startIndex = _this$props.startIndex; + var visible = this.state.visible; + + if (data && data.length && visible) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).TecnaviaFlatList, { + ref: function ref(_ref2) { + _this2.flatList = _ref2; + }, + initialScrollIndex: startIndex, + onScrollToIndexFailed: function onScrollToIndexFailed(info) {}, + getItemLayout: function getItemLayout(items, index) { + var offset = _$$_REQUIRE(_dependencyMap[13]).GALLERY_THUMBNAIL_WIDTH * index; + var result = { + length: _$$_REQUIRE(_dependencyMap[13]).GALLERY_THUMBNAIL_WIDTH, + offset: offset, + index: index + }; + return result; + }, + keyExtractor: function keyExtractor(item, index) { + return item + "_" + index; + }, + horizontal: true, + data: data, + renderItem: function renderItem(_ref) { + var item = _ref.item, + index = _ref.index; + return _react.default.createElement(_galleryThumbnailComponent.default, { + item: item, + index: index, + onPress: onThumbnailPress, + selected: startIndex === index + }); + } + }); + } + + return null; + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(nextProps, prevState) { + var visible = nextProps.visible, + indexSelected = nextProps.indexSelected; + + if (visible !== prevState.visible || indexSelected !== prevState.currentPosition) { + return { + visible: visible + }; + } + + return null; + } + }]); + return GalleryThumbnails; + }(_react.Component); + + exports.default = GalleryThumbnails; + GalleryThumbnails.propTypes = { + data: _propTypes.default.array.isRequired, + visible: _propTypes.default.bool, + onThumbnailPress: _propTypes.default.func, + startIndex: _propTypes.default.number + }; + GalleryThumbnails.defaultProps = { + visible: true, + startIndex: 0 + }; +},2436,[5,7,8,12,14,16,17,201,460,2437,572,462,1910,2438]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _galleryThumbnailComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryThumbnail = function (_React$Component) { + (0, _inherits2.default)(GalleryThumbnail, _React$Component); + + var _super = _createSuper(GalleryThumbnail); + + function GalleryThumbnail(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryThumbnail); + _this = _super.call(this, props); + _this.state = { + selected: props.selected + }; + return _this; + } + + (0, _createClass2.default)(GalleryThumbnail, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.onThumbnailPress = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(_events.default.GALLERY_THUMBNAIL_CLICK, function (_ref) { + var selectedIndex = _ref.index; + var selected = _this2.state.selected; + var index = _this2.props.index; + + if (index === selectedIndex && !selected) { + _this2.setState({ + selected: true + }); + } else if (index !== selectedIndex && selected) { + _this2.setState({ + selected: false + }); + } + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.onThumbnailPress); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + _onPress = _this$props.onPress, + index = _this$props.index, + item = _this$props.item; + var selected = this.state.selected; + + var source = _$$_REQUIRE(_dependencyMap[13]); + + if (_$$_REQUIRE(_dependencyMap[14]).StringUtils.isUrl(item) || _$$_REQUIRE(_dependencyMap[14]).StringUtils.isImageBase64(item)) { + source = { + uri: item + }; + } + + return _react.default.createElement(_reactNative.TouchableWithoutFeedback, { + onPress: function onPress() { + if (typeof _onPress === "function") { + _onPress(item, index); + } + } + }, _react.default.createElement(_reactNative.View, { + style: selected ? _galleryThumbnailComponent.default.selected : {} + }, _react.default.createElement(_imageComponent.default, { + source: source, + style: _galleryThumbnailComponent.default.thumbnail, + resizeMode: "contain" + }))); + } + }]); + return GalleryThumbnail; + }(_react.default.Component); + + exports.default = GalleryThumbnail; + GalleryThumbnail.propTypes = { + onPress: _propTypes.default.func.isRequired, + index: _propTypes.default.number.isRequired, + selected: _propTypes.default.bool, + item: _propTypes.default.string.isRequired + }; + GalleryThumbnail.defaultProps = { + selected: false + }; +},2437,[5,7,8,12,14,16,17,201,28,460,2438,588,572,2439,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.GALLERY_THUMBNAIL_WIDTH = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var isTablet = _$$_REQUIRE(_dependencyMap[1]).PlatformUtils.isTablet(); + + var GALLERY_THUMBNAIL_WIDTH = isTablet ? 150 : 100; + exports.GALLERY_THUMBNAIL_WIDTH = GALLERY_THUMBNAIL_WIDTH; + + var _default = _reactNative.StyleSheet.create({ + thumbnail: { + height: isTablet ? 200 : 150, + width: GALLERY_THUMBNAIL_WIDTH, + padding: 3, + margin: 3 + }, + selected: { + borderRadius: 5, + borderWidth: 2, + borderColor: "white" + } + }); + + exports.default = _default; +},2438,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/shared/gallery-thumbnail-component", + "width": 500, + "height": 362, + "scales": [1], + "hash": "f228fdd55ec7477271dee51823570651", + "name": "ic_not_available", + "type": "png" + }); +},2439,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _viewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryPager = function (_Component) { + (0, _inherits2.default)(GalleryPager, _Component); + + var _super = _createSuper(GalleryPager); + + function GalleryPager(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryPager); + _this = _super.call(this, props); + _this.scrollRef = _react.default.createRef(); + _this.currentPosition = props.startIndex; + _this.videoStreamRefs = []; + _this.onRef = _this._onRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPageChange = _this._onPageChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRenderPage = _this._onRenderPage.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(GalleryPager, [{ + key: "_onRef", + value: function _onRef(ref) { + this.swiper = ref; + } + }, { + key: "_onPageChange", + value: function _onPageChange(index) { + var _this$props = this.props, + data = _this$props.data, + onIndexChanged = _this$props.onIndexChanged; + this.currentPosition = index; + + if (onIndexChanged) { + onIndexChanged(data[index], index); + } + + if (this.videoStreamRefs) { + this.videoStreamRefs.forEach(function (videoStreamRef) { + if (videoStreamRef) { + videoStreamRef.pause(); + } + }); + } + } + }, { + key: "_onRenderPage", + value: function _onRenderPage(item, index) { + var _this2 = this; + + switch (item.action) { + case "dailymotion": + case "dailymotionPlaylist": + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).GalleryVideoDailymotion, { + key: index, + item: item, + isPlaylist: item.action === "dailymotionPlaylist" + }); + + case "videoStream": + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).GalleryVideoStream, { + ref: function ref(_ref) { + _this2.videoStreamRefs[index] = _ref; + }, + key: index, + item: item + }); + + case "videoLink": + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).GalleryVideoLink, { + key: index, + item: item + }); + + case "videoEmbed": + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).GalleryVideoEmbed, { + key: index, + item: item + }); + + default: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).GalleryImage, { + key: index, + item: item + }); + } + } + }, { + key: "scrollTo", + value: function scrollTo(index) { + if (this.swiper) { + this.swiper.scrollTo(index, true); + } + } + }, { + key: "render", + value: function render() { + var data = this.props.data; + + if (data && data.length) { + return _react.default.createElement(_viewPagerComponent.default, { + ref: this.onRef, + containerStyle: _$$_REQUIRE(_dependencyMap[15]).styles.galleryParent, + data: data, + startPage: this.currentPosition, + onPageChange: this.onPageChange, + renderPage: this.onRenderPage, + scrollRef: this.scrollRef + }); + } + + return null; + } + }]); + return GalleryPager; + }(_react.Component); + + exports.default = GalleryPager; + GalleryPager.propTypes = { + data: _propTypes.default.array.isRequired, + onIndexChanged: _propTypes.default.func, + startIndex: _propTypes.default.number + }; + GalleryPager.defaultProps = { + startIndex: 0 + }; +},2440,[5,7,8,15,12,14,16,17,201,2360,2441,2445,2455,2458,2461,2463]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2441,[2442]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GalleryVideoDailymotion = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getDailymotionVideoPlayer(), + DailymotionVideoPlayer = _OptionalPackages$get.Player; + + var GalleryVideoDailymotion = function (_React$Component) { + (0, _inherits2.default)(GalleryVideoDailymotion, _React$Component); + + var _super = _createSuper(GalleryVideoDailymotion); + + function GalleryVideoDailymotion() { + (0, _classCallCheck2.default)(this, GalleryVideoDailymotion); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(GalleryVideoDailymotion, [{ + key: "render", + value: function render() { + var _this = this; + + if (DailymotionVideoPlayer) { + var _this$props = this.props, + item = _this$props.item, + isPlaylist = _this$props.isPlaylist; + var url = item.url; + var playerData = { + autoplay: false + }; + + if (isPlaylist) { + playerData.playlist = url; + } else { + playerData.video = url; + } + + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[10]).styles.parent + }, _react.default.createElement(DailymotionVideoPlayer, { + ref: function ref(r) { + _this.player = r; + }, + playerData: playerData, + style: { + height: "100%", + width: "100%" + }, + onPlayerEvent: function onPlayerEvent(payload) { + return; + }, + onStart: function onStart(payload) { + return; + }, + onPause: function onPause(payload) { + return; + }, + onSeeked: function onSeeked(payload) { + return; + }, + onEnd: function onEnd(payload) { + return; + } + })); + } + + return null; + } + }]); + return GalleryVideoDailymotion; + }(_react.default.Component); + + exports.GalleryVideoDailymotion = GalleryVideoDailymotion; + GalleryVideoDailymotion.propTypes = { + item: _propTypes.default.shape({ + thumbnail: _propTypes.default.string, + url: _propTypes.default.string.isRequired + }), + isPlaylist: _propTypes.default.bool + }; +},2442,[5,7,8,12,14,16,17,28,201,731,2443]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + flex: 1, + justifyContent: "center", + alignItems: "center", + flexDirection: "column", + paddingTop: _$$_REQUIRE(_dependencyMap[1]).GALLERY_ITEM_HEIGHT + } + }); + + exports.styles = styles; +},2443,[28,2444]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = exports.GALLERY_ITEM_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var isTablet = _$$_REQUIRE(_dependencyMap[1]).PlatformUtils.isTablet(); + + var GALLERY_ITEM_HEIGHT = 50; + exports.GALLERY_ITEM_HEIGHT = GALLERY_ITEM_HEIGHT; + + var styles = _reactNative.StyleSheet.create({ + parent: { + position: "absolute", + backgroundColor: "black", + top: 0, + bottom: 0, + left: 0, + right: 0, + width: null, + height: null + }, + header: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent600, + position: "absolute", + start: 0, + end: 0, + flexDirection: "column" + }, + text: { + paddingTop: 10, + paddingBottom: 10, + textAlign: "center" + }, + title: { + fontSize: isTablet ? 20 : 16, + paddingStart: isTablet ? 40 : 20, + paddingEnd: isTablet ? 40 : 20 + }, + caption: { + fontSize: isTablet ? 16 : 14, + paddingStart: isTablet ? 20 : 10, + paddingEnd: isTablet ? 20 : 10 + }, + toolbar: { + height: GALLERY_ITEM_HEIGHT, + flexDirection: "row", + justifyContent: "space-between" + }, + toolbarLeft: { + height: GALLERY_ITEM_HEIGHT, + flex: 1, + justifyContent: "flex-start", + flexDirection: "row" + }, + toolbarCenter: { + height: GALLERY_ITEM_HEIGHT, + flex: 1, + justifyContent: "center", + flexDirection: "row" + }, + toolbarRight: { + height: GALLERY_ITEM_HEIGHT, + flex: 1, + justifyContent: "flex-end", + flexDirection: "row" + }, + counter: { + color: "white", + height: GALLERY_ITEM_HEIGHT, + fontSize: 20, + padding: 10, + textAlign: "center", + textAlignVertical: "center" + }, + btn: { + fontSize: 30, + padding: 5, + margin: 5, + color: "white" + }, + galleryParent: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + flex: 1 + }, + footer: { + position: "absolute", + bottom: 0, + start: 0, + end: 0, + flexDirection: "column", + alignItems: "flex-start", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent600 + }, + thumbnailList: {}, + thumbnail: { + height: isTablet ? 200 : 150, + width: isTablet ? 150 : 100, + padding: 3, + margin: 3 + }, + selected: { + borderRadius: 5, + borderWidth: 2, + borderColor: "white" + } + }); + + exports.styles = styles; +},2444,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2445,[2446]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GalleryVideoStream = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNativeVideoPlayer = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryVideoStream = function (_React$Component) { + (0, _inherits2.default)(GalleryVideoStream, _React$Component); + + var _super = _createSuper(GalleryVideoStream); + + function GalleryVideoStream() { + (0, _classCallCheck2.default)(this, GalleryVideoStream); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(GalleryVideoStream, [{ + key: "pause", + value: function pause() { + if (this.player && this.player.state.isPlaying) { + this.player.pause(); + } + } + }, { + key: "render", + value: function render() { + var _this = this; + + var item = this.props.item; + var thumbnail = item.thumbnail, + url = item.url; + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[10]).styles.videoParent + }, _react.default.createElement(_reactNativeVideoPlayer.default, { + autoplay: false, + endWithThumbnail: true, + useTextureView: false, + thumbnail: { + uri: thumbnail + }, + video: { + uri: url + }, + ref: function ref(r) { + _this.player = r; + } + })); + } + }]); + return GalleryVideoStream; + }(_react.default.Component); + + exports.GalleryVideoStream = GalleryVideoStream; + GalleryVideoStream.propTypes = { + item: _propTypes.default.shape({ + thumbnail: _propTypes.default.string, + url: _propTypes.default.string.isRequired + }) + }; +},2446,[5,7,8,12,14,16,17,2447,28,201,2454]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _MaterialIcons = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _reactNativeVideo = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var BackgroundImage = _reactNative.ImageBackground || _reactNative.Image; + var ViewPropTypesVar; + + if (_reactNative.ViewPropTypes) { + ViewPropTypesVar = _reactNative.ViewPropTypes; + } else { + ViewPropTypesVar = _reactNative.View.propTypes; + } + + var styles = _reactNative.StyleSheet.create({ + preloadingPlaceholder: { + backgroundColor: 'black', + justifyContent: 'center', + alignItems: 'center' + }, + thumbnail: { + backgroundColor: 'black', + justifyContent: 'center', + alignItems: 'center' + }, + playButton: { + backgroundColor: 'rgba(0, 0, 0, 0.6)', + width: 64, + height: 64, + borderRadius: 32, + justifyContent: 'center', + alignItems: 'center' + }, + playArrow: { + color: 'white' + }, + video: _reactNative.Platform.Version >= 24 ? {} : { + backgroundColor: 'black' + }, + controls: { + backgroundColor: 'rgba(0, 0, 0, 0.6)', + height: 48, + marginTop: -48, + flexDirection: 'row', + alignItems: 'center' + }, + playControl: { + color: 'white', + padding: 8 + }, + extraControl: { + color: 'white', + padding: 8 + }, + seekBar: { + alignItems: 'center', + height: 30, + flexGrow: 1, + flexDirection: 'row', + paddingHorizontal: 10, + marginLeft: -10, + marginRight: -5 + }, + seekBarFullWidth: { + marginLeft: 0, + marginRight: 0, + paddingHorizontal: 0, + marginTop: -3, + height: 3 + }, + seekBarProgress: { + height: 3, + backgroundColor: '#F00' + }, + seekBarKnob: { + width: 20, + height: 20, + marginHorizontal: -8, + marginVertical: -10, + borderRadius: 10, + backgroundColor: '#F00', + transform: [{ + scale: 0.8 + }], + zIndex: 1 + }, + seekBarBackground: { + backgroundColor: 'rgba(255, 255, 255, 0.5)', + height: 3 + }, + overlayButton: { + flex: 1 + } + }); + + var VideoPlayer = function (_Component) { + (0, _inherits2.default)(VideoPlayer, _Component); + + var _super = _createSuper(VideoPlayer); + + function VideoPlayer(props) { + var _this; + + (0, _classCallCheck2.default)(this, VideoPlayer); + _this = _super.call(this, props); + _this.state = { + isStarted: props.autoplay, + isPlaying: props.autoplay, + hasEnded: false, + width: 200, + progress: 0, + isMuted: props.defaultMuted, + isControlsVisible: !props.hideControlsOnStart, + duration: 0, + isSeeking: false + }; + _this.seekBarWidth = 200; + _this.wasPlayingBeforeSeek = props.autoplay; + _this.seekTouchStart = 0; + _this.seekProgressStart = 0; + _this.onLayout = _this.onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onStartPress = _this.onStartPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onProgress = _this.onProgress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onEnd = _this.onEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoad = _this.onLoad.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPlayPress = _this.onPlayPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMutePress = _this.onMutePress.bind((0, _assertThisInitialized2.default)(_this)); + _this.showControls = _this.showControls.bind((0, _assertThisInitialized2.default)(_this)); + _this.onToggleFullScreen = _this.onToggleFullScreen.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSeekBarLayout = _this.onSeekBarLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSeekGrant = _this.onSeekGrant.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSeekRelease = _this.onSeekRelease.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSeek = _this.onSeek.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(VideoPlayer, [{ + key: "componentDidMount", + value: function componentDidMount() { + if (this.props.autoplay) { + this.hideControls(); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.controlsTimeout) { + clearTimeout(this.controlsTimeout); + this.controlsTimeout = null; + } + } + }, { + key: "onLayout", + value: function onLayout(event) { + var width = event.nativeEvent.layout.width; + this.setState({ + width: width + }); + } + }, { + key: "onStartPress", + value: function onStartPress() { + if (this.props.onStart) { + this.props.onStart(); + } + + this.setState(function (state) { + return { + isPlaying: true, + isStarted: true, + hasEnded: false, + progress: state.progress === 1 ? 0 : state.progress + }; + }); + this.hideControls(); + } + }, { + key: "onProgress", + value: function onProgress(event) { + if (this.state.isSeeking) { + return; + } + + if (this.props.onProgress) { + this.props.onProgress(event); + } + + this.setState({ + progress: event.currentTime / (this.props.duration || this.state.duration) + }); + } + }, { + key: "onEnd", + value: function onEnd(event) { + var _this2 = this; + + if (this.props.onEnd) { + this.props.onEnd(event); + } + + if (this.props.endWithThumbnail || this.props.endThumbnail) { + this.setState({ + isStarted: false, + hasEnded: true + }); + this.player.dismissFullscreenPlayer(); + } + + this.setState({ + progress: 1 + }); + + if (!this.props.loop) { + this.setState({ + isPlaying: false + }, function () { + return _this2.player && _this2.player.seek(0); + }); + } else { + this.player.seek(0); + } + } + }, { + key: "onLoad", + value: function onLoad(event) { + if (this.props.onLoad) { + this.props.onLoad(event); + } + + var duration = event.duration; + this.setState({ + duration: duration + }); + } + }, { + key: "onPlayPress", + value: function onPlayPress() { + if (this.props.onPlayPress) { + this.props.onPlayPress(); + } + + this.setState({ + isPlaying: !this.state.isPlaying + }); + this.showControls(); + } + }, { + key: "onMutePress", + value: function onMutePress() { + var isMuted = !this.state.isMuted; + + if (this.props.onMutePress) { + this.props.onMutePress(isMuted); + } + + this.setState({ + isMuted: isMuted + }); + this.showControls(); + } + }, { + key: "onToggleFullScreen", + value: function onToggleFullScreen() { + this.player.presentFullscreenPlayer(); + } + }, { + key: "onSeekBarLayout", + value: function onSeekBarLayout(_ref) { + var nativeEvent = _ref.nativeEvent; + var customStyle = this.props.customStyles.seekBar; + var padding = 0; + + if (customStyle && customStyle.paddingHorizontal) { + padding = customStyle.paddingHorizontal * 2; + } else if (customStyle) { + padding = customStyle.paddingLeft || 0; + padding += customStyle.paddingRight ? customStyle.paddingRight : 0; + } else { + padding = 20; + } + + this.seekBarWidth = nativeEvent.layout.width - padding; + } + }, { + key: "onSeekStartResponder", + value: function onSeekStartResponder() { + return true; + } + }, { + key: "onSeekMoveResponder", + value: function onSeekMoveResponder() { + return true; + } + }, { + key: "onSeekGrant", + value: function onSeekGrant(e) { + this.seekTouchStart = e.nativeEvent.pageX; + this.seekProgressStart = this.state.progress; + this.wasPlayingBeforeSeek = this.state.isPlaying; + this.setState({ + isSeeking: true, + isPlaying: false + }); + } + }, { + key: "onSeekRelease", + value: function onSeekRelease() { + this.setState({ + isSeeking: false, + isPlaying: this.wasPlayingBeforeSeek + }); + this.showControls(); + } + }, { + key: "onSeek", + value: function onSeek(e) { + var diff = e.nativeEvent.pageX - this.seekTouchStart; + var ratio = 100 / this.seekBarWidth; + var progress = this.seekProgressStart + ratio * diff / 100; + this.setState({ + progress: progress + }); + this.player.seek(progress * this.state.duration); + } + }, { + key: "getSizeStyles", + value: function getSizeStyles() { + var _this$props = this.props, + videoWidth = _this$props.videoWidth, + videoHeight = _this$props.videoHeight; + var width = this.state.width; + var ratio = videoHeight / videoWidth; + return { + height: width * ratio, + width: width + }; + } + }, { + key: "hideControls", + value: function hideControls() { + var _this3 = this; + + if (this.props.onHideControls) { + this.props.onHideControls(); + } + + if (this.props.disableControlsAutoHide) { + return; + } + + if (this.controlsTimeout) { + clearTimeout(this.controlsTimeout); + this.controlsTimeout = null; + } + + this.controlsTimeout = setTimeout(function () { + _this3.setState({ + isControlsVisible: false + }); + }, this.props.controlsTimeout); + } + }, { + key: "showControls", + value: function showControls() { + if (this.props.onShowControls) { + this.props.onShowControls(); + } + + this.setState({ + isControlsVisible: true + }); + this.hideControls(); + } + }, { + key: "seek", + value: function seek(t) { + this.player.seek(t); + } + }, { + key: "stop", + value: function stop() { + this.setState({ + isPlaying: false, + progress: 0 + }); + this.seek(0); + this.showControls(); + } + }, { + key: "pause", + value: function pause() { + this.setState({ + isPlaying: false + }); + this.showControls(); + } + }, { + key: "resume", + value: function resume() { + this.setState({ + isPlaying: true + }); + this.showControls(); + } + }, { + key: "renderStartButton", + value: function renderStartButton() { + var customStyles = this.props.customStyles; + return _react.default.createElement(_reactNative.TouchableOpacity, { + style: [styles.playButton, customStyles.playButton], + onPress: this.onStartPress + }, _react.default.createElement(_MaterialIcons.default, { + style: [styles.playArrow, customStyles.playArrow], + name: "play-arrow", + size: 42 + })); + } + }, { + key: "renderThumbnail", + value: function renderThumbnail(thumbnail) { + var _this$props2 = this.props, + style = _this$props2.style, + customStyles = _this$props2.customStyles, + props = (0, _objectWithoutProperties2.default)(_this$props2, ["style", "customStyles"]); + return _react.default.createElement(BackgroundImage, (0, _extends2.default)({}, props, { + style: [styles.thumbnail, this.getSizeStyles(), style, customStyles.thumbnail], + source: thumbnail + }), this.renderStartButton()); + } + }, { + key: "renderSeekBar", + value: function renderSeekBar(fullWidth) { + var _this$props3 = this.props, + customStyles = _this$props3.customStyles, + disableSeek = _this$props3.disableSeek; + return _react.default.createElement(_reactNative.View, { + style: [styles.seekBar, fullWidth ? styles.seekBarFullWidth : {}, customStyles.seekBar, fullWidth ? customStyles.seekBarFullWidth : {}], + onLayout: this.onSeekBarLayout + }, _react.default.createElement(_reactNative.View, { + style: [{ + flexGrow: this.state.progress + }, styles.seekBarProgress, customStyles.seekBarProgress] + }), !fullWidth && !disableSeek ? _react.default.createElement(_reactNative.View, { + style: [styles.seekBarKnob, customStyles.seekBarKnob, this.state.isSeeking ? { + transform: [{ + scale: 1 + }] + } : {}, this.state.isSeeking ? customStyles.seekBarKnobSeeking : {}], + hitSlop: { + top: 20, + bottom: 20, + left: 10, + right: 20 + }, + onStartShouldSetResponder: this.onSeekStartResponder, + onMoveShouldSetPanResponder: this.onSeekMoveResponder, + onResponderGrant: this.onSeekGrant, + onResponderMove: this.onSeek, + onResponderRelease: this.onSeekRelease, + onResponderTerminate: this.onSeekRelease + }) : null, _react.default.createElement(_reactNative.View, { + style: [styles.seekBarBackground, { + flexGrow: 1 - this.state.progress + }, customStyles.seekBarBackground] + })); + } + }, { + key: "renderControls", + value: function renderControls() { + var customStyles = this.props.customStyles; + return _react.default.createElement(_reactNative.View, { + style: [styles.controls, customStyles.controls] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.onPlayPress, + style: [customStyles.controlButton, customStyles.playControl] + }, _react.default.createElement(_MaterialIcons.default, { + style: [styles.playControl, customStyles.controlIcon, customStyles.playIcon], + name: this.state.isPlaying ? 'pause' : 'play-arrow', + size: 32 + })), this.renderSeekBar(), this.props.muted ? null : _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.onMutePress, + style: customStyles.controlButton + }, _react.default.createElement(_MaterialIcons.default, { + style: [styles.extraControl, customStyles.controlIcon], + name: this.state.isMuted ? 'volume-off' : 'volume-up', + size: 24 + })), _reactNative.Platform.OS === 'android' || this.props.disableFullscreen ? null : _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.onToggleFullScreen, + style: customStyles.controlButton + }, _react.default.createElement(_MaterialIcons.default, { + style: [styles.extraControl, customStyles.controlIcon], + name: "fullscreen", + size: 32 + }))); + } + }, { + key: "renderVideo", + value: function renderVideo() { + var _this4 = this; + + var _this$props4 = this.props, + video = _this$props4.video, + style = _this$props4.style, + resizeMode = _this$props4.resizeMode, + pauseOnPress = _this$props4.pauseOnPress, + fullScreenOnLongPress = _this$props4.fullScreenOnLongPress, + customStyles = _this$props4.customStyles, + props = (0, _objectWithoutProperties2.default)(_this$props4, ["video", "style", "resizeMode", "pauseOnPress", "fullScreenOnLongPress", "customStyles"]); + return _react.default.createElement(_reactNative.View, { + style: customStyles.videoWrapper + }, _react.default.createElement(_reactNativeVideo.default, (0, _extends2.default)({}, props, { + style: [styles.video, this.getSizeStyles(), style, customStyles.video], + ref: function ref(p) { + _this4.player = p; + }, + muted: this.props.muted || this.state.isMuted, + paused: this.props.paused ? this.props.paused || !this.state.isPlaying : !this.state.isPlaying, + onProgress: this.onProgress, + onEnd: this.onEnd, + onLoad: this.onLoad, + source: video, + resizeMode: resizeMode + })), _react.default.createElement(_reactNative.View, { + style: [this.getSizeStyles(), { + marginTop: -this.getSizeStyles().height + }] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + style: styles.overlayButton, + onPress: function onPress() { + _this4.showControls(); + + if (pauseOnPress) _this4.onPlayPress(); + }, + onLongPress: function onLongPress() { + if (fullScreenOnLongPress && _reactNative.Platform.OS !== 'android') _this4.onToggleFullScreen(); + } + })), !this.state.isPlaying || this.state.isControlsVisible ? this.renderControls() : this.renderSeekBar(true)); + } + }, { + key: "renderContent", + value: function renderContent() { + var _this$props5 = this.props, + thumbnail = _this$props5.thumbnail, + endThumbnail = _this$props5.endThumbnail, + style = _this$props5.style; + var _this$state = this.state, + isStarted = _this$state.isStarted, + hasEnded = _this$state.hasEnded; + + if (hasEnded && endThumbnail) { + return this.renderThumbnail(endThumbnail); + } else if (!isStarted && thumbnail) { + return this.renderThumbnail(thumbnail); + } else if (!isStarted) { + return _react.default.createElement(_reactNative.View, { + style: [styles.preloadingPlaceholder, this.getSizeStyles(), style] + }, this.renderStartButton()); + } + + return this.renderVideo(); + } + }, { + key: "render", + value: function render() { + return _react.default.createElement(_reactNative.View, { + onLayout: this.onLayout, + style: this.props.customStyles.wrapper + }, this.renderContent()); + } + }]); + return VideoPlayer; + }(_react.Component); + + exports.default = VideoPlayer; + VideoPlayer.propTypes = { + video: _reactNativeVideo.default.propTypes.source, + thumbnail: _reactNative.Image.propTypes.source, + endThumbnail: _reactNative.Image.propTypes.source, + videoWidth: _propTypes.default.number, + videoHeight: _propTypes.default.number, + duration: _propTypes.default.number, + autoplay: _propTypes.default.bool, + paused: _propTypes.default.bool, + defaultMuted: _propTypes.default.bool, + muted: _propTypes.default.bool, + style: ViewPropTypesVar.style, + controlsTimeout: _propTypes.default.number, + disableControlsAutoHide: _propTypes.default.bool, + disableFullscreen: _propTypes.default.bool, + loop: _propTypes.default.bool, + resizeMode: _reactNativeVideo.default.propTypes.resizeMode, + hideControlsOnStart: _propTypes.default.bool, + endWithThumbnail: _propTypes.default.bool, + disableSeek: _propTypes.default.bool, + pauseOnPress: _propTypes.default.bool, + fullScreenOnLongPress: _propTypes.default.bool, + customStyles: _propTypes.default.shape({ + wrapper: ViewPropTypesVar.style, + video: _reactNativeVideo.default.propTypes.style, + videoWrapper: ViewPropTypesVar.style, + controls: ViewPropTypesVar.style, + playControl: ViewPropTypesVar.style, + controlButton: ViewPropTypesVar.style, + controlIcon: _MaterialIcons.default.propTypes.style, + playIcon: _MaterialIcons.default.propTypes.style, + seekBar: ViewPropTypesVar.style, + seekBarFullWidth: ViewPropTypesVar.style, + seekBarProgress: ViewPropTypesVar.style, + seekBarKnob: ViewPropTypesVar.style, + seekBarKnobSeeking: ViewPropTypesVar.style, + seekBarBackground: ViewPropTypesVar.style, + thumbnail: _reactNative.Image.propTypes.style, + playButton: ViewPropTypesVar.style, + playArrow: _MaterialIcons.default.propTypes.style + }), + onEnd: _propTypes.default.func, + onProgress: _propTypes.default.func, + onLoad: _propTypes.default.func, + onStart: _propTypes.default.func, + onPlayPress: _propTypes.default.func, + onHideControls: _propTypes.default.func, + onShowControls: _propTypes.default.func, + onMutePress: _propTypes.default.func + }; + VideoPlayer.defaultProps = { + videoWidth: 1280, + videoHeight: 720, + autoplay: false, + controlsTimeout: 2000, + loop: false, + resizeMode: 'contain', + disableSeek: false, + pauseOnPress: false, + fullScreenOnLongPress: false, + customStyles: {} + }; +},2447,[5,6,108,7,8,15,12,14,16,17,201,28,1836,2448]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "TextTrackType", { + enumerable: true, + get: function get() { + return _TextTrackType.default; + } + }); + Object.defineProperty(exports, "FilterType", { + enumerable: true, + get: function get() { + return _FilterType.default; + } + }); + Object.defineProperty(exports, "DRMType", { + enumerable: true, + get: function get() { + return _DRMType.default; + } + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _resolveAssetSource = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _TextTrackType = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _FilterType = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _DRMType = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _VideoResizeMode = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var styles = _reactNative.StyleSheet.create({ + base: { + overflow: 'hidden' + } + }); + + var Video = function (_Component) { + (0, _inherits2.default)(Video, _Component); + + var _super = _createSuper(Video); + + function Video(props) { + var _this; + + (0, _classCallCheck2.default)(this, Video); + _this = _super.call(this, props); + + _this.seek = function (time) { + var tolerance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; + + if (isNaN(time)) { + throw new Error('Specified time is not a number'); + } + + if (_reactNative.Platform.OS === 'ios') { + _this.setNativeProps({ + seek: { + time: time, + tolerance: tolerance + } + }); + } else { + _this.setNativeProps({ + seek: time + }); + } + }; + + _this.presentFullscreenPlayer = function () { + _this.setNativeProps({ + fullscreen: true + }); + }; + + _this.dismissFullscreenPlayer = function () { + _this.setNativeProps({ + fullscreen: false + }); + }; + + _this.save = function _callee(options) { + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(_reactNative.NativeModules.VideoManager.save(options, (0, _reactNative.findNodeHandle)(_this._root))); + + case 2: + return _context.abrupt("return", _context.sent); + + case 3: + case "end": + return _context.stop(); + } + } + }, null, null, null, Promise); + }; + + _this.restoreUserInterfaceForPictureInPictureStopCompleted = function (restored) { + _this.setNativeProps({ + restoreUserInterfaceForPIPStopCompletionHandler: restored + }); + }; + + _this._assignRoot = function (component) { + _this._root = component; + }; + + _this._hidePoster = function () { + if (_this.state.showPoster) { + _this.setState({ + showPoster: false + }); + } + }; + + _this._onLoadStart = function (event) { + if (_this.props.onLoadStart) { + _this.props.onLoadStart(event.nativeEvent); + } + }; + + _this._onLoad = function (event) { + if (_reactNative.Platform.OS === 'windows') { + _this._hidePoster(); + } + + if (_this.props.onLoad) { + _this.props.onLoad(event.nativeEvent); + } + }; + + _this._onError = function (event) { + if (_this.props.onError) { + _this.props.onError(event.nativeEvent); + } + }; + + _this._onProgress = function (event) { + if (_this.props.onProgress) { + _this.props.onProgress(event.nativeEvent); + } + }; + + _this._onBandwidthUpdate = function (event) { + if (_this.props.onBandwidthUpdate) { + _this.props.onBandwidthUpdate(event.nativeEvent); + } + }; + + _this._onSeek = function (event) { + if (_this.props.onSeek) { + _this.props.onSeek(event.nativeEvent); + } + }; + + _this._onEnd = function (event) { + if (_this.props.onEnd) { + _this.props.onEnd(event.nativeEvent); + } + }; + + _this._onTimedMetadata = function (event) { + if (_this.props.onTimedMetadata) { + _this.props.onTimedMetadata(event.nativeEvent); + } + }; + + _this._onFullscreenPlayerWillPresent = function (event) { + if (_this.props.onFullscreenPlayerWillPresent) { + _this.props.onFullscreenPlayerWillPresent(event.nativeEvent); + } + }; + + _this._onFullscreenPlayerDidPresent = function (event) { + if (_this.props.onFullscreenPlayerDidPresent) { + _this.props.onFullscreenPlayerDidPresent(event.nativeEvent); + } + }; + + _this._onFullscreenPlayerWillDismiss = function (event) { + if (_this.props.onFullscreenPlayerWillDismiss) { + _this.props.onFullscreenPlayerWillDismiss(event.nativeEvent); + } + }; + + _this._onFullscreenPlayerDidDismiss = function (event) { + if (_this.props.onFullscreenPlayerDidDismiss) { + _this.props.onFullscreenPlayerDidDismiss(event.nativeEvent); + } + }; + + _this._onReadyForDisplay = function (event) { + if (!_this.props.audioOnly) { + _this._hidePoster(); + } + + if (_this.props.onReadyForDisplay) { + _this.props.onReadyForDisplay(event.nativeEvent); + } + }; + + _this._onPlaybackStalled = function (event) { + if (_this.props.onPlaybackStalled) { + _this.props.onPlaybackStalled(event.nativeEvent); + } + }; + + _this._onPlaybackResume = function (event) { + if (_this.props.onPlaybackResume) { + _this.props.onPlaybackResume(event.nativeEvent); + } + }; + + _this._onPlaybackRateChange = function (event) { + if (_this.props.onPlaybackRateChange) { + _this.props.onPlaybackRateChange(event.nativeEvent); + } + }; + + _this._onExternalPlaybackChange = function (event) { + if (_this.props.onExternalPlaybackChange) { + _this.props.onExternalPlaybackChange(event.nativeEvent); + } + }; + + _this._onAudioBecomingNoisy = function () { + if (_this.props.onAudioBecomingNoisy) { + _this.props.onAudioBecomingNoisy(); + } + }; + + _this._onPictureInPictureStatusChanged = function (event) { + if (_this.props.onPictureInPictureStatusChanged) { + _this.props.onPictureInPictureStatusChanged(event.nativeEvent); + } + }; + + _this._onRestoreUserInterfaceForPictureInPictureStop = function (event) { + if (_this.props.onRestoreUserInterfaceForPictureInPictureStop) { + _this.props.onRestoreUserInterfaceForPictureInPictureStop(); + } + }; + + _this._onAudioFocusChanged = function (event) { + if (_this.props.onAudioFocusChanged) { + _this.props.onAudioFocusChanged(event.nativeEvent); + } + }; + + _this._onBuffer = function (event) { + if (_this.props.onBuffer) { + _this.props.onBuffer(event.nativeEvent); + } + }; + + _this._onGetLicense = function (event) { + if (_this.props.drm && _this.props.drm.getLicense instanceof Function) { + var data = event.nativeEvent; + + if (data && data.spcBase64) { + var getLicenseOverride = _this.props.drm.getLicense(data.spcBase64, data.contentId, data.licenseUrl); + + var getLicensePromise = Promise.resolve(getLicenseOverride); + getLicensePromise.then(function (result) { + if (result !== undefined) { + _reactNative.NativeModules.VideoManager.setLicenseResult(result, (0, _reactNative.findNodeHandle)(_this._root)); + } else { + _reactNative.NativeModules.VideoManager.setLicenseError && _reactNative.NativeModules.VideoManager.setLicenseError('Empty license result', (0, _reactNative.findNodeHandle)(_this._root)); + } + }).catch(function (error) { + _reactNative.NativeModules.VideoManager.setLicenseError && _reactNative.NativeModules.VideoManager.setLicenseError(error, (0, _reactNative.findNodeHandle)(_this._root)); + }); + } else { + _reactNative.NativeModules.VideoManager.setLicenseError && _reactNative.NativeModules.VideoManager.setLicenseError("No spc received", (0, _reactNative.findNodeHandle)(_this._root)); + } + } + }; + + _this.getViewManagerConfig = function (viewManagerName) { + if (!_reactNative.NativeModules.UIManager.getViewManagerConfig) { + return _reactNative.NativeModules.UIManager[viewManagerName]; + } + + return _reactNative.NativeModules.UIManager.getViewManagerConfig(viewManagerName); + }; + + _this.state = { + showPoster: !!props.poster + }; + return _this; + } + + (0, _createClass2.default)(Video, [{ + key: "setNativeProps", + value: function setNativeProps(nativeProps) { + this._root.setNativeProps(nativeProps); + } + }, { + key: "toTypeString", + value: function toTypeString(x) { + switch (typeof x) { + case 'object': + return x instanceof Date ? x.toISOString() : JSON.stringify(x); + + case 'undefined': + return ''; + + default: + return x.toString(); + } + } + }, { + key: "stringsOnlyObject", + value: function stringsOnlyObject(obj) { + var _this2 = this; + + var strObj = {}; + Object.keys(obj).forEach(function (x) { + strObj[x] = _this2.toTypeString(obj[x]); + }); + return strObj; + } + }, { + key: "render", + value: function render() { + var resizeMode = this.props.resizeMode; + var source = (0, _resolveAssetSource.default)(this.props.source) || {}; + var shouldCache = !source.__packager_asset; + var uri = source.uri || ''; + + if (uri && uri.match(/^\//)) { + uri = "file://" + uri; + } + + if (!uri) { + console.warn('Trying to load empty source.'); + } + + var isNetwork = !!(uri && uri.match(/^https?:/)); + var isAsset = !!(uri && uri.match(/^(assets-library|ipod-library|file|content|ms-appx|ms-appdata):/)); + var nativeResizeMode; + var RCTVideoInstance = this.getViewManagerConfig('RCTVideo'); + + if (resizeMode === _VideoResizeMode.default.stretch) { + nativeResizeMode = RCTVideoInstance.Constants.ScaleToFill; + } else if (resizeMode === _VideoResizeMode.default.contain) { + nativeResizeMode = RCTVideoInstance.Constants.ScaleAspectFit; + } else if (resizeMode === _VideoResizeMode.default.cover) { + nativeResizeMode = RCTVideoInstance.Constants.ScaleAspectFill; + } else { + nativeResizeMode = RCTVideoInstance.Constants.ScaleNone; + } + + var nativeProps = (0, _extends2.default)({}, this.props); + (0, _extends2.default)(nativeProps, { + style: [styles.base, nativeProps.style], + resizeMode: nativeResizeMode, + src: { + uri: uri, + isNetwork: isNetwork, + isAsset: isAsset, + shouldCache: shouldCache, + type: source.type || '', + mainVer: source.mainVer || 0, + patchVer: source.patchVer || 0, + requestHeaders: source.headers ? this.stringsOnlyObject(source.headers) : {} + }, + onVideoLoadStart: this._onLoadStart, + onVideoLoad: this._onLoad, + onVideoError: this._onError, + onVideoProgress: this._onProgress, + onVideoSeek: this._onSeek, + onVideoEnd: this._onEnd, + onVideoBuffer: this._onBuffer, + onVideoBandwidthUpdate: this._onBandwidthUpdate, + onTimedMetadata: this._onTimedMetadata, + onVideoAudioBecomingNoisy: this._onAudioBecomingNoisy, + onVideoExternalPlaybackChange: this._onExternalPlaybackChange, + onVideoFullscreenPlayerWillPresent: this._onFullscreenPlayerWillPresent, + onVideoFullscreenPlayerDidPresent: this._onFullscreenPlayerDidPresent, + onVideoFullscreenPlayerWillDismiss: this._onFullscreenPlayerWillDismiss, + onVideoFullscreenPlayerDidDismiss: this._onFullscreenPlayerDidDismiss, + onReadyForDisplay: this._onReadyForDisplay, + onPlaybackStalled: this._onPlaybackStalled, + onPlaybackResume: this._onPlaybackResume, + onPlaybackRateChange: this._onPlaybackRateChange, + onAudioFocusChanged: this._onAudioFocusChanged, + onAudioBecomingNoisy: this._onAudioBecomingNoisy, + onGetLicense: nativeProps.drm && nativeProps.drm.getLicense && this._onGetLicense, + onPictureInPictureStatusChanged: this._onPictureInPictureStatusChanged, + onRestoreUserInterfaceForPictureInPictureStop: this._onRestoreUserInterfaceForPictureInPictureStop + }); + var posterStyle = (0, _extends2.default)({}, _reactNative.StyleSheet.absoluteFillObject, { + resizeMode: this.props.posterResizeMode || 'contain' + }); + return _react.default.createElement(_reactNative.View, { + style: nativeProps.style + }, _react.default.createElement(RCTVideo, (0, _extends2.default)({ + ref: this._assignRoot + }, nativeProps, { + style: _reactNative.StyleSheet.absoluteFill + })), this.state.showPoster && _react.default.createElement(_reactNative.Image, { + style: posterStyle, + source: { + uri: this.props.poster + } + })); + } + }]); + return Video; + }(_react.Component); + + exports.default = Video; + Video.propTypes = (0, _extends2.default)({ + filter: _propTypes.default.oneOf([_FilterType.default.NONE, _FilterType.default.INVERT, _FilterType.default.MONOCHROME, _FilterType.default.POSTERIZE, _FilterType.default.FALSE, _FilterType.default.MAXIMUMCOMPONENT, _FilterType.default.MINIMUMCOMPONENT, _FilterType.default.CHROME, _FilterType.default.FADE, _FilterType.default.INSTANT, _FilterType.default.MONO, _FilterType.default.NOIR, _FilterType.default.PROCESS, _FilterType.default.TONAL, _FilterType.default.TRANSFER, _FilterType.default.SEPIA]), + filterEnabled: _propTypes.default.bool, + src: _propTypes.default.object, + seek: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object]), + fullscreen: _propTypes.default.bool, + onVideoLoadStart: _propTypes.default.func, + onVideoLoad: _propTypes.default.func, + onVideoBuffer: _propTypes.default.func, + onVideoError: _propTypes.default.func, + onVideoProgress: _propTypes.default.func, + onVideoBandwidthUpdate: _propTypes.default.func, + onVideoSeek: _propTypes.default.func, + onVideoEnd: _propTypes.default.func, + onTimedMetadata: _propTypes.default.func, + onVideoAudioBecomingNoisy: _propTypes.default.func, + onVideoExternalPlaybackChange: _propTypes.default.func, + onVideoFullscreenPlayerWillPresent: _propTypes.default.func, + onVideoFullscreenPlayerDidPresent: _propTypes.default.func, + onVideoFullscreenPlayerWillDismiss: _propTypes.default.func, + onVideoFullscreenPlayerDidDismiss: _propTypes.default.func, + source: _propTypes.default.oneOfType([_propTypes.default.shape({ + uri: _propTypes.default.string + }), _propTypes.default.number]), + drm: _propTypes.default.shape({ + type: _propTypes.default.oneOf([_DRMType.default.CLEARKEY, _DRMType.default.FAIRPLAY, _DRMType.default.WIDEVINE, _DRMType.default.PLAYREADY]), + licenseServer: _propTypes.default.string, + headers: _propTypes.default.shape({}), + base64Certificate: _propTypes.default.bool, + certificateUrl: _propTypes.default.string, + getLicense: _propTypes.default.func + }), + minLoadRetryCount: _propTypes.default.number, + maxBitRate: _propTypes.default.number, + resizeMode: _propTypes.default.string, + poster: _propTypes.default.string, + posterResizeMode: _reactNative.Image.propTypes.resizeMode, + repeat: _propTypes.default.bool, + automaticallyWaitsToMinimizeStalling: _propTypes.default.bool, + allowsExternalPlayback: _propTypes.default.bool, + selectedAudioTrack: _propTypes.default.shape({ + type: _propTypes.default.string.isRequired, + value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]) + }), + selectedVideoTrack: _propTypes.default.shape({ + type: _propTypes.default.string.isRequired, + value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]) + }), + selectedTextTrack: _propTypes.default.shape({ + type: _propTypes.default.string.isRequired, + value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]) + }), + textTracks: _propTypes.default.arrayOf(_propTypes.default.shape({ + title: _propTypes.default.string, + uri: _propTypes.default.string.isRequired, + type: _propTypes.default.oneOf([_TextTrackType.default.SRT, _TextTrackType.default.TTML, _TextTrackType.default.VTT]), + language: _propTypes.default.string.isRequired + })), + paused: _propTypes.default.bool, + muted: _propTypes.default.bool, + volume: _propTypes.default.number, + bufferConfig: _propTypes.default.shape({ + minBufferMs: _propTypes.default.number, + maxBufferMs: _propTypes.default.number, + bufferForPlaybackMs: _propTypes.default.number, + bufferForPlaybackAfterRebufferMs: _propTypes.default.number + }), + stereoPan: _propTypes.default.number, + rate: _propTypes.default.number, + pictureInPicture: _propTypes.default.bool, + playInBackground: _propTypes.default.bool, + preferredForwardBufferDuration: _propTypes.default.number, + playWhenInactive: _propTypes.default.bool, + ignoreSilentSwitch: _propTypes.default.oneOf(['ignore', 'obey']), + reportBandwidth: _propTypes.default.bool, + disableFocus: _propTypes.default.bool, + controls: _propTypes.default.bool, + audioOnly: _propTypes.default.bool, + currentTime: _propTypes.default.number, + fullscreenAutorotate: _propTypes.default.bool, + fullscreenOrientation: _propTypes.default.oneOf(['all', 'landscape', 'portrait']), + progressUpdateInterval: _propTypes.default.number, + useTextureView: _propTypes.default.bool, + hideShutterView: _propTypes.default.bool, + onLoadStart: _propTypes.default.func, + onLoad: _propTypes.default.func, + onBuffer: _propTypes.default.func, + onError: _propTypes.default.func, + onProgress: _propTypes.default.func, + onBandwidthUpdate: _propTypes.default.func, + onSeek: _propTypes.default.func, + onEnd: _propTypes.default.func, + onFullscreenPlayerWillPresent: _propTypes.default.func, + onFullscreenPlayerDidPresent: _propTypes.default.func, + onFullscreenPlayerWillDismiss: _propTypes.default.func, + onFullscreenPlayerDidDismiss: _propTypes.default.func, + onReadyForDisplay: _propTypes.default.func, + onPlaybackStalled: _propTypes.default.func, + onPlaybackResume: _propTypes.default.func, + onPlaybackRateChange: _propTypes.default.func, + onAudioFocusChanged: _propTypes.default.func, + onAudioBecomingNoisy: _propTypes.default.func, + onPictureInPictureStatusChanged: _propTypes.default.func, + needsToRestoreUserInterfaceForPictureInPictureStop: _propTypes.default.func, + onExternalPlaybackChange: _propTypes.default.func, + scaleX: _propTypes.default.number, + scaleY: _propTypes.default.number, + translateX: _propTypes.default.number, + translateY: _propTypes.default.number, + rotation: _propTypes.default.number + }, _reactNative.ViewPropTypes); + var RCTVideo = (0, _reactNative.requireNativeComponent)('RCTVideo', Video, { + nativeOnly: { + src: true, + seek: true, + fullscreen: true + } + }); +},2448,[5,80,6,7,8,12,14,16,17,201,28,165,2449,2450,2451,2452]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var _default = { + SRT: 'application/x-subrip', + TTML: 'application/ttml+xml', + VTT: 'text/vtt' + }; + exports.default = _default; +},2449,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var _default = { + NONE: '', + INVERT: 'CIColorInvert', + MONOCHROME: 'CIColorMonochrome', + POSTERIZE: 'CIColorPosterize', + FALSE: 'CIFalseColor', + MAXIMUMCOMPONENT: 'CIMaximumComponent', + MINIMUMCOMPONENT: 'CIMinimumComponent', + CHROME: 'CIPhotoEffectChrome', + FADE: 'CIPhotoEffectFade', + INSTANT: 'CIPhotoEffectInstant', + MONO: 'CIPhotoEffectMono', + NOIR: 'CIPhotoEffectNoir', + PROCESS: 'CIPhotoEffectProcess', + TONAL: 'CIPhotoEffectTonal', + TRANSFER: 'CIPhotoEffectTransfer', + SEPIA: 'CISepiaTone' + }; + exports.default = _default; +},2450,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + var _default = { + WIDEVINE: 'widevine', + PLAYREADY: 'playready', + CLEARKEY: 'clearkey', + FAIRPLAY: 'fairplay' + }; + exports.default = _default; +},2451,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _keymirror = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _default = (0, _keymirror.default)({ + contain: null, + cover: null, + stretch: null + }); + + exports.default = _default; +},2452,[5,2453]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + "use strict"; + + var keyMirror = function keyMirror(obj) { + var ret = {}; + var key; + + if (!(obj instanceof Object && !Array.isArray(obj))) { + throw new Error('keyMirror(...): Argument must be an object.'); + } + + for (key in obj) { + if (!obj.hasOwnProperty(key)) { + continue; + } + + ret[key] = key; + } + + return ret; + }; + + module.exports = keyMirror; +},2453,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + videoParent: { + flex: 1, + flexDirection: "column", + justifyContent: "center" + } + }); + + exports.styles = styles; +},2454,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2455,[2456]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GalleryVideoLink = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryVideoLink = function (_React$Component) { + (0, _inherits2.default)(GalleryVideoLink, _React$Component); + + var _super = _createSuper(GalleryVideoLink); + + function GalleryVideoLink(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryVideoLink); + _this = _super.call(this, props); + _this.openNativeApp = _this._openNativeApp.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(GalleryVideoLink, [{ + key: "_openNativeApp", + value: function _openNativeApp() { + var item = this.props.item; + var url = item.url; + + _tecnaviaPlatformUtils.default.openURL(url); + } + }, { + key: "render", + value: function render() { + var item = this.props.item; + var thumbnail = item.thumbnail; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["gallery-video-link-parent"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.parent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["gallery-video-link-image"] + }, _react.default.createElement(_imageComponent.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.video, + source: { + uri: thumbnail + }, + resizeMode: "contain" + })), _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["gallery-video-link-play-icon"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + onPress: this.openNativeApp, + name: "play-circle", + style: _$$_REQUIRE(_dependencyMap[14]).styles.playButton, + type: _$$_REQUIRE(_dependencyMap[15]).TecnaviaIconType.FONT_AWESOME + })))); + } + }]); + return GalleryVideoLink; + }(_react.default.Component); + + exports.GalleryVideoLink = GalleryVideoLink; + GalleryVideoLink.propTypes = { + item: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired, + thumbnail: _propTypes.default.string + }) + }; +},2456,[5,7,8,15,12,14,16,17,28,201,588,1876,1970,699,2457,1806]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + flex: 1, + justifyContent: "center", + alignItems: "center", + flexDirection: "column" + }, + video: { + position: "absolute", + top: 0, + bottom: 0, + end: 0, + start: 0 + }, + playButton: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white, + fontSize: 80 + } + }); + + exports.styles = styles; +},2457,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2458,[2459]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GalleryVideoEmbed = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryVideoEmbed = function (_React$Component) { + (0, _inherits2.default)(GalleryVideoEmbed, _React$Component); + + var _super = _createSuper(GalleryVideoEmbed); + + function GalleryVideoEmbed(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryVideoEmbed); + _this = _super.call(this, props); + _this.onVideoEmbedLoaded = _this._onVideoEmbedLoaded.bind((0, _assertThisInitialized2.default)(_this)); + _this.onInnerRef = _this._onInnerRef.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(GalleryVideoEmbed, [{ + key: "_onVideoEmbedLoaded", + value: function _onVideoEmbedLoaded() { + if (this.webview) { + var jsStyle = "try{ document.documentElement.style.height = '100%'; document.body.style.height = '100%'; document.body.style.display = 'flex'; document.body.style.flexDirection = 'column'; document.body.style.justifyContent = 'center'; document.body.style.alignItems = 'center'; document.body.style.backgroundColor = 'black'; }catch(e){console.log(e);}"; + this.webview.injectJavaScript(jsStyle); + } + } + }, { + key: "_onInnerRef", + value: function _onInnerRef(webview) { + this.webview = webview; + } + }, { + key: "render", + value: function render() { + var item = this.props.item; + var url = item.url; + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[10]).styles.videoParent + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).BaseWebView, { + innerRef: this.onInnerRef, + automaticallyAdjustContentInsets: true, + scrollEnabled: false, + onLoadEnd: this.onVideoEmbedLoaded, + source: { + html: url, + baseUrl: _$$_REQUIRE(_dependencyMap[12]).WEBVIEW_BASE_URL + } + })); + } + }]); + return GalleryVideoEmbed; + }(_react.default.Component); + + exports.GalleryVideoEmbed = GalleryVideoEmbed; + GalleryVideoEmbed.propTypes = { + item: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired + }) + }; +},2459,[5,7,8,15,12,14,16,17,201,28,2460,1894,719]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + videoParent: { + paddingTop: 40, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent200, + justifyContent: "center", + flex: 1 + } + }); + + exports.styles = styles; +},2460,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2461,[2462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GalleryImage = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var styles = _reactNative.StyleSheet.create({ + galleryImageParent: { + flex: 1, + justifyContent: "center", + alignItems: "center" + }, + galleryImage: { + flex: 1, + width: "100%" + } + }); + + var GalleryImage = function (_React$PureComponent) { + (0, _inherits2.default)(GalleryImage, _React$PureComponent); + + var _super = _createSuper(GalleryImage); + + function GalleryImage(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryImage); + _this = _super.call(this, props); + _this.state = { + url: props.item.url, + fallbackMethodUsed: false + }; + _this.onError = _this._onError.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoad = _this._onLoad.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(GalleryImage, [{ + key: "_onError", + value: function _onError() { + var fallbackMethodUsed, item, url, path, response; + return _regenerator.default.async(function _onError$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + fallbackMethodUsed = this.state.fallbackMethodUsed; + + if (fallbackMethodUsed) { + _context.next = 19; + break; + } + + _context.prev = 2; + item = this.props.item; + url = item.url; + + if (!_$$_REQUIRE(_dependencyMap[14]).StringUtils.isImageBase64(url)) { + _context.next = 9; + break; + } + + path = url; + _context.next = 13; + break; + + case 9: + _context.next = 11; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.fetch(url, { + cacheEnabled: true + })); + + case 11: + response = _context.sent; + path = "file://" + response.path(); + + case 13: + this.setState({ + url: path, + fallbackMethodUsed: true + }); + _context.next = 19; + break; + + case 16: + _context.prev = 16; + _context.t0 = _context["catch"](2); + this.setState({ + url: "", + fallbackMethodUsed: true + }); + + case 19: + case "end": + return _context.stop(); + } + } + }, null, this, [[2, 16]], Promise); + } + }, { + key: "_onLoad", + value: function _onLoad() { + var item = this.props.item; + } + }, { + key: "render", + value: function render() { + var url = this.state.url; + + if (url) { + var item = this.props.item; + var width = item.width, + height = item.height; + var screenSize = _deviceUtils.default.safeArea; + var minimumZoomScale = width && height ? Math.min(Math.max(width / screenSize.width, height / screenSize.height, 0.25), 1.0) : 1.0; + var maximumZoomScale = 3 * minimumZoomScale; + + if (_$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isAndroid()) { + maximumZoomScale = Math.max(maximumZoomScale, 1.8); + minimumZoomScale = Math.min(minimumZoomScale, 1.7); + } + + return _react.default.createElement(_reactNative.View, { + style: styles.galleryImageParent + }, _react.default.createElement(_imageComponent.default, { + forceZoomComponent: true, + source: { + uri: url + }, + resizeMode: "contain", + onLoad: this.onLoad, + onError: this.onError, + minimumZoomScale: minimumZoomScale, + maximumZoomScale: maximumZoomScale, + style: styles.galleryImage + })); + } + + return null; + } + }]); + return GalleryImage; + }(_react.default.PureComponent); + + exports.GalleryImage = GalleryImage; + GalleryImage.propTypes = { + item: _propTypes.default.shape({ + url: _propTypes.default.string.isRequired, + width: _propTypes.default.number, + height: _propTypes.default.number + }) + }; +},2462,[5,80,7,8,15,12,14,16,17,28,201,574,458,588,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var isTablet = _$$_REQUIRE(_dependencyMap[1]).PlatformUtils.isTablet(); + + var styles = _reactNative.StyleSheet.create({ + thumbnail: { + height: isTablet ? 200 : 150, + width: isTablet ? 150 : 100, + padding: 3, + margin: 3 + }, + selected: { + borderRadius: 5, + borderWidth: 2, + borderColor: "white" + } + }); + + exports.styles = styles; +},2463,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _galleryCounter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryCounter = function (_React$Component) { + (0, _inherits2.default)(GalleryCounter, _React$Component); + + var _super = _createSuper(GalleryCounter); + + function GalleryCounter(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryCounter); + _this = _super.call(this, props); + _this.state = { + index: props.startIndex + }; + return _this; + } + + (0, _createClass2.default)(GalleryCounter, [{ + key: "setIndex", + value: function setIndex(index) { + this.setState({ + index: index + }); + } + }, { + key: "render", + value: function render() { + var index = this.state.index; + var total = this.props.total; + return _react.default.createElement(_fontText.default, { + style: _galleryCounter.default.counter + }, global.strings("counter", { + total: total, + current: index + 1 + })); + } + }]); + return GalleryCounter; + }(_react.default.Component); + + exports.default = GalleryCounter; + GalleryCounter.propTypes = { + startIndex: _propTypes.default.number.isRequired, + total: _propTypes.default.number.isRequired + }; +},2464,[5,7,8,12,14,16,17,201,1879,2465]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + counter: { + color: "white", + height: _$$_REQUIRE(_dependencyMap[1]).GALLERY_ITEM_HEIGHT, + fontSize: 20, + padding: 10, + textAlign: "center", + textAlignVertical: "center" + } + }); + + exports.default = _default; +},2465,[28,2444]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2466,[2467]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.GalleryText = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var GalleryText = function (_Component) { + (0, _inherits2.default)(GalleryText, _Component); + + var _super = _createSuper(GalleryText); + + function GalleryText(props) { + var _this; + + (0, _classCallCheck2.default)(this, GalleryText); + _this = _super.call(this, props); + _this.state = { + collapse: true, + text: props.text + }; + return _this; + } + + (0, _createClass2.default)(GalleryText, [{ + key: "setText", + value: function setText(text) { + this.setState({ + collapse: true, + text: text + }); + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + color = _this$props.color, + styles = _this$props.styles, + maxLines = _this$props.maxLines; + var _this$state = this.state, + collapse = _this$state.collapse, + text = _this$state.text; + var optionalProps = {}; + + if (collapse) { + optionalProps.numberOfLines = maxLines; + } + + if (text) { + return _react.default.createElement(_fontText.default, (0, _extends2.default)({}, optionalProps, { + onPress: function onPress() { + _this2.setState(function (prevState) { + return { + collapse: !prevState.collapse + }; + }); + }, + style: [styles, { + width: "100%", + color: color + }] + }), text); + } + + return null; + } + }]); + return GalleryText; + }(_react.Component); + + exports.GalleryText = GalleryText; + GalleryText.propTypes = { + color: _propTypes.default.string, + text: _propTypes.default.string, + maxLines: _propTypes.default.number, + styles: _propTypes.default.array + }; + GalleryText.defaultProps = { + maxLines: 1, + color: _$$_REQUIRE(_dependencyMap[10]).colors.white + }; +},2467,[5,6,7,8,12,14,16,17,201,1879,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NavigatorBaseScreen = exports.ScreenState = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ScreenState = { + FOCUSED: "focused", + UNFOCUSED: "unfocused", + MOUNTED: "mounted", + UNMOUNTED: "unmounted" + }; + exports.ScreenState = ScreenState; + + var NavigatorBaseScreen = function (_React$Component) { + (0, _inherits2.default)(NavigatorBaseScreen, _React$Component); + + var _super = _createSuper(NavigatorBaseScreen); + + function NavigatorBaseScreen() { + (0, _classCallCheck2.default)(this, NavigatorBaseScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(NavigatorBaseScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this = this; + + this.log("navigator mounted"); + var navigation = this.props.navigation; + + if (navigation) { + this._onFocusListener = navigation.addListener("focus", function () { + _this.didFocus(); + }); + this._onWillBlur = navigation.addListener("blur", function () { + _this.willBlur(); + }); + } + + this.currentScreenState = ScreenState.MOUNTED; + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + if (this.hasScreenFocus()) { + this.willBlur(); + } + + this.log("navigator unmount"); + + if (this._onFocusListener) { + this._onFocusListener(); + } + + if (this._onWillBlur) { + this._onWillBlur(); + } + + this.currentScreenState = ScreenState.UNMOUNTED; + } + }, { + key: "getTag", + value: function getTag() { + return "NavigatorBaseScreen"; + } + }, { + key: "log", + value: function log(msg) { + if (msg) {} + } + }, { + key: "didFocus", + value: function didFocus() { + this.log("navigator focus"); + this.currentScreenState = ScreenState.FOCUSED; + } + }, { + key: "willBlur", + value: function willBlur() { + this.log("navigator blur"); + this.currentScreenState = ScreenState.UNFOCUSED; + } + }, { + key: "hasScreenFocus", + value: function hasScreenFocus() { + return this.currentScreenState === ScreenState.FOCUSED; + } + }, { + key: "isScreenMounted", + value: function isScreenMounted() { + return this.currentScreenState !== ScreenState.UNMOUNTED; + } + }, { + key: "showHint", + value: function showHint(hint, onHide) { + _$$_REQUIRE(_dependencyMap[8]).HintOverlay.show({ + config: { + hint: hint, + key: "hint_" + this.constructor.name, + autoHideTime: 3000, + showAlways: true + }, + onHide: onHide + }); + } + }]); + return NavigatorBaseScreen; + }(_react.default.Component); + + exports.NavigatorBaseScreen = NavigatorBaseScreen; + NavigatorBaseScreen.propTypes = { + navigation: _propTypes.default.object + }; +},2468,[5,7,8,12,14,16,17,201,2003]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _mainNavigator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _InterstitialsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _PushHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _rssOptionspageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _barsComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _LoginManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[21])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RssComponent = function (_NavigatorBaseScreen) { + (0, _inherits2.default)(RssComponent, _NavigatorBaseScreen); + + var _super = _createSuper(RssComponent); + + function RssComponent(props) { + var _this; + + (0, _classCallCheck2.default)(this, RssComponent); + _this = _super.call(this, props); + _this.state = { + mounted: false, + focused: false + }; + _this.onGoingForeground = _this._onGoingForeground.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearRssDbAutoUpdate = _this._clearRssDbAutoUpdate.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(RssComponent, [{ + key: "UNSAFE_componentWillMount", + value: function UNSAFE_componentWillMount() { + var _this2 = this; + + _LiveConfig.default.setRssSide(); + + Analytics.initMatomo(); + Analytics.initMatomoTracker(); + this.onConfigForceUpdate = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.CONFIG_FORCE_UPDATE, function (_ref) { + var message = _ref.message; + + _this2.showHint(message, function () { + _this2.forceUpdate(); + }); + }); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + var config; + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(RssComponent.prototype), "componentDidMount", this).call(this); + + this._scheduleRssDbAutoUpdate(); + + this.onStateChangeForeground = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_FOREGROUND, this.onGoingForeground); + this.onStateChangeBackground = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.ON_STATE_CHANGE_GOING_BACKGROUND, this.clearRssDbAutoUpdate); + this.onPaywallLogout = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.PAYWALL_LOGOUT, _LoginManager.default.ePaperLogout); + _context.prev = 5; + _context.next = 8; + return _regenerator.default.awrap(_RssContentHelper.default.initDatabase()); + + case 8: + _context.next = 12; + break; + + case 10: + _context.prev = 10; + _context.t0 = _context["catch"](5); + + case 12: + config = global.getRSSActivePSetup(); + _context.next = 15; + return _regenerator.default.awrap(_LoginManager.default.checkAllowedIP(config)); + + case 15: + this.setState({ + mounted: true + }); + + case 16: + case "end": + return _context.stop(); + } + } + }, null, this, [[5, 10]], Promise); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssComponent.prototype), "componentWillUnmount", this).call(this); + + if (RssComponent.INTERSTITIAL_TIMER) { + _InterstitialsHelper.default.resetTimer(RssComponent.INTERSTITIAL_TIMER); + } + + this.clearRssDbAutoUpdate(); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onStateChangeForeground); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onStateChangeBackground); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onConfigForceUpdate); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.onPaywallLogout); + } + }, { + key: "didFocus", + value: function didFocus() { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssComponent.prototype), "didFocus", this).call(this); + + _styleUtils.default.colorStatusBar(); + + this.setState({ + focused: true + }); + } + }, { + key: "_showPrestitial", + value: function _showPrestitial() { + if (RssComponent.INTERSTITIAL_TIMER) { + _InterstitialsHelper.default.resetTimer(RssComponent.INTERSTITIAL_TIMER); + } + + _InterstitialsHelper.default.getPrestitial(function (timer) { + RssComponent.INTERSTITIAL_TIMER = timer; + }); + } + }, { + key: "_clearRssDbAutoUpdate", + value: function _clearRssDbAutoUpdate() { + if (RssComponent.INTERVAL_ID > -1) { + clearInterval(RssComponent.INTERVAL_ID); + } + + RssComponent.INTERVAL_ID = -1; + } + }, { + key: "_scheduleRssDbAutoUpdate", + value: function _scheduleRssDbAutoUpdate() { + var _global$getRssIndex = global.getRssIndex(), + appAutoRefreshMinutes = _global$getRssIndex.appAutoRefreshMinutes; + + if (appAutoRefreshMinutes > 0 && RssComponent.INTERVAL_ID < 0) { + RssComponent.INTERVAL_ID = setInterval(function () { + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.TRIGGER_RSS_DB_UPDATE); + }, appAutoRefreshMinutes * 60 * 1000); + } + } + }, { + key: "_onGoingForeground", + value: function _onGoingForeground() { + this._showPrestitial(); + + var _global$getMainPSetup = global.getMainPSetup(), + migrate = _global$getMainPSetup.migrate; + + var _global$getActivePSet = global.getActivePSetup(), + migrateActive = _global$getActivePSet.migrate; + + var isOnline = _$$_REQUIRE(_dependencyMap[23]).NetworkUtils.isOnline(); + + if (isOnline && (migrate || migrateActive)) { + _NavigationService.default.restart(); + } else { + if (isOnline) { + var feedback = new (_$$_REQUIRE(_dependencyMap[24]).Feedback)(); + feedback.check(); + } + + this._scheduleRssDbAutoUpdate(); + + if (_PushHelper.default.isTherePush()) {} else { + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.TRIGGER_RSS_DB_UPDATE); + } + } + } + }, { + key: "restartRssNavigator", + value: function restartRssNavigator() { + _NavigationService.default.main.reset("RssNavigator"); + } + }, { + key: "render", + value: function render() { + _styleUtils.default.colorStatusBar(); + + var _this$state = this.state, + mounted = _this$state.mounted, + focused = _this$state.focused; + + if (!mounted || !focused) { + return null; + } + + this._showPrestitial(); + + var _global$getRssIndex2 = global.getRssIndex(), + actionBarBackgroundColor = _global$getRssIndex2.actionBarBackgroundColor; + + var backgroundColor = _styleUtils.default.fixColorForDarkTheme(actionBarBackgroundColor); + + var statusBarColor = _styleUtils.default.getRssStatusBarColor(); + + var navigationBarColor = _styleUtils.default.getRssNavigationBarColor(); + + var edges = ["left", "right", "bottom"]; + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[25]).TecnaviaSafeAreaView, { + edges: edges, + backgroundColor: backgroundColor + }, _react.default.createElement(_mainNavigator.default, null), _react.default.createElement(_rssOptionspageComponent.default, { + handleBackButton: this.onHandleBackButton, + backgroundColor: backgroundColor, + onUserClose: this.restartRssNavigator + })), _react.default.createElement(_barsComponent.default, { + statusBarColor: statusBarColor, + navigationBarColor: navigationBarColor, + edges: edges + })); + } + }]); + return RssComponent; + }(_$$_REQUIRE(_dependencyMap[26]).NavigatorBaseScreen); + + exports.default = RssComponent; + RssComponent.INTERVAL_ID = -1; + RssComponent.INTERSTITIAL_TIMER = undefined; +},2469,[5,80,7,8,15,90,12,14,16,17,2470,2321,460,2207,2134,1861,2591,2145,2147,1872,2057,1871,572,462,2151,2146,2468]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = RssNavigator; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _webScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _drawerNavigator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var CommonHeader = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _verticalJobNavigator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _verticalEventNavigator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Stack = _NavigationService.default.navigator.createStack(); + + function _getInitialRouteName() { + var screen = "DrawerNavigator"; + + if (!global.getUserSettings().tutorialAlreadyShown) { + screen = "TutorialScreen"; + global.getUserSettings().tutorialAlreadyShowTrue(); + } + + return screen; + } + + var SHORTCUT_ENABLE_SCREENS = []; + + function RssNavigator(props) { + var _global$getRssIndex = global.getRssIndex(), + actionBarBackgroundColor = _global$getRssIndex.actionBarBackgroundColor; + + var backgroundColor = _styleUtils.default.fixColorForDarkTheme(actionBarBackgroundColor); + + var isPortrait = (0, _$$_REQUIRE(_dependencyMap[11]).useIsPortrait)(); + + var isSidebar = !isPortrait && _$$_REQUIRE(_dependencyMap[12]).PlatformUtils.isTablet(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).CustomNavigationContainer, { + independent: true + }, _react.default.createElement(Stack.Navigator, { + screenOptions: (0, _extends2.default)({ + gestureEnabled: false + }, _NavigationService.default.getStackScreenOptions()), + initialRouteName: _getInitialRouteName(), + screenListeners: { + state: function state(_ref) { + var data = _ref.data; + + var name = _navigationUtils.default.getActiveRouteFromState(data.state); + + if (name && !SHORTCUT_ENABLE_SCREENS.includes(name)) { + _$$_REQUIRE(_dependencyMap[14]).ShortcutManager.disable(); + } + } + } + }, _react.default.createElement(Stack.Screen, { + name: "TutorialScreen", + component: _$$_REQUIRE(_dependencyMap[15]).TutorialScreen, + options: { + headerShown: false, + gesturesEnabled: false + } + }), _react.default.createElement(Stack.Screen, { + name: "DrawerNavigator", + options: function options(navProps) { + return { + headerShown: !isSidebar || !global.getRssIndex().is3_0(), + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + considerSafeAreaTop: true, + backgroundColor: backgroundColor, + left: CommonHeader._getRssHeaderLeftButtons(navProps, isSidebar), + center: CommonHeader._getLogo(), + right: CommonHeader._getRssHeaderRightButtons(navProps), + style: CommonHeader._getStyle(navProps) + }); + }, + gesturesEnabled: false + }; + } + }, function (navProps) { + return _react.default.createElement(_drawerNavigator.default, (0, _extends2.default)({}, navProps, { + isSidebar: isSidebar + })); + }), _react.default.createElement(Stack.Screen, { + name: "GalleryScreen", + options: { + headerShown: false, + gesturesEnabled: false + } + }, function (navProps) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).GalleryScreen, (0, _extends2.default)({}, navProps, { + isSidebar: isSidebar, + considerSafeAreaTop: true + })); + }), _react.default.createElement(Stack.Screen, { + name: "WebScreen", + options: function options(navProps) { + return { + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + considerSafeAreaTop: true, + backgroundColor: backgroundColor, + left: CommonHeader._getHeaderLeftButtonsBackButtonOnly(navProps), + center: CommonHeader._getLogo(), + right: CommonHeader._getSharedHeaderRightButton(navProps) + }); + }, + gesturesEnabled: false + }; + } + }, function (navProps) { + return _react.default.createElement(_webScreen.default, (0, _extends2.default)({}, navProps, { + considerSafeArea: false, + enablePostponeAction: true + })); + }), _react.default.createElement(Stack.Screen, { + name: "SettingsScreen", + component: _$$_REQUIRE(_dependencyMap[17]).SettingsScreen, + options: function options(navProps) { + return { + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + considerSafeAreaTop: true, + backgroundColor: backgroundColor, + left: CommonHeader._getHeaderLeftButtonsBackButtonOnly(navProps), + center: CommonHeader._getLogo(), + right: CommonHeader._getEmptyPlaceHolders() + }); + }, + gesturesEnabled: false + }; + } + }), _react.default.createElement(Stack.Screen, { + name: "GeneralSettingsScreen", + component: _$$_REQUIRE(_dependencyMap[18]).GeneralSettingsScreen, + options: function options(navProps) { + return { + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + considerSafeAreaTop: true, + backgroundColor: backgroundColor, + left: CommonHeader._getHeaderLeftButtonsBackButtonOnly(navProps), + center: CommonHeader._getLogo(), + right: CommonHeader._getEmptyPlaceHolders() + }); + }, + gesturesEnabled: false + }; + } + }), _react.default.createElement(Stack.Screen, { + name: "ArticleScreen", + options: function options(navProps) { + return { + headerShown: true, + header: function header() { + return _react.default.createElement(CommonHeader.ActionBar, { + considerSafeAreaTop: true, + backgroundColor: backgroundColor, + left: CommonHeader._getHeaderLeftButtonsBackButtonOnly(navProps), + center: CommonHeader._getLogo(), + right: CommonHeader._getRssHeaderRightButtonsCustomOnly(navProps) + }); + }, + gesturesEnabled: false + }; + } + }, function (navProps) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).ArticleScreen, (0, _extends2.default)({}, navProps, { + enablePostponeAction: true + })); + }), _react.default.createElement(Stack.Screen, { + name: "JobNavigator", + component: _verticalJobNavigator.default, + options: { + animation: "none", + headerShown: false, + gesturesEnabled: false + } + }), _react.default.createElement(Stack.Screen, { + name: "EventNavigator", + component: _verticalEventNavigator.default, + options: { + headerShown: false, + gesturesEnabled: false + } + }))); + } +},2470,[5,6,17,2294,2206,2144,2471,2529,2045,1861,2147,2580,462,2302,1911,2581,2434,2584,2232,2586]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = VerticalJobNavigator; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var Header = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Stack = _NavigationService.default.navigator.createStack(); + + var Tab = _NavigationService.default.navigator.createBottomTab(); + + function VerticalTabNavigator(props) { + return _react.default.createElement(Tab.Navigator, { + screenOptions: function screenOptions(_ref) { + var route = _ref.route; + return { + headerShown: false, + tabBarShowLabel: false, + swipeEnabled: false, + tabBarStyle: { + backgroundColor: _$$_REQUIRE(_dependencyMap[5]).colors.white + }, + tabBarIcon: function tabBarIcon(_ref2) { + var focused = _ref2.focused; + var routeName = route.name; + var iconName; + + if (routeName === "VerticalFiltersScreen") { + iconName = "filter"; + } else if (routeName === "VerticalSavedSearchScreen") { + iconName = "search"; + } else if (routeName === "VerticalFavoritesScreen") { + var favoritesConfig = global.getRssFavoritesConfig(); + iconName = favoritesConfig.getIcon(); + } else if (routeName === "VerticalListScreen") { + iconName = "list-ul"; + } + + return _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: iconName, + size: 25, + color: (0, _$$_REQUIRE(_dependencyMap[6]).getJobColor)() + }); + } + }; + } + }, _react.default.createElement(Tab.Screen, { + name: "VerticalFiltersScreen", + component: _$$_REQUIRE(_dependencyMap[7]).JobFilterScreen + }), _react.default.createElement(Tab.Screen, { + name: "VerticalSavedSearchScreen", + component: _$$_REQUIRE(_dependencyMap[8]).JobSearchScreen + }), _react.default.createElement(Tab.Screen, { + name: "VerticalFavoritesScreen", + component: _$$_REQUIRE(_dependencyMap[9]).JobFavoritesScreen + }), _react.default.createElement(Tab.Screen, { + name: "VerticalListScreen", + component: _$$_REQUIRE(_dependencyMap[10]).JobListScreen + })); + } + + function VerticalJobNavigator() { + return _react.default.createElement(Stack.Navigator, { + screenOptions: _NavigationService.default.getStackScreenOptions(), + initialRouteName: "VerticalTabNavigator" + }, _react.default.createElement(Stack.Screen, { + name: "VerticalTabNavigator", + component: VerticalTabNavigator, + options: function options(props) { + return { + header: function header() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).ActionBar, { + considerSafeAreaTop: true, + left: Header._getHeaderLeftButtonsBackButtonOnly(props.navigation, (0, _$$_REQUIRE(_dependencyMap[6]).getJobColor)()), + center: Header._getLogo((0, _$$_REQUIRE(_dependencyMap[12]).getNavigationParams)(props).logoUrl || (0, _$$_REQUIRE(_dependencyMap[6]).getJobLogo)(), _$$_REQUIRE(_dependencyMap[13])) + }); + }, + gesturesEnabled: false, + backBehavior: "initialRoute" + }; + } + }), _react.default.createElement(Stack.Screen, { + name: "VerticalDetailScreen", + component: _$$_REQUIRE(_dependencyMap[14]).JobDetailScreen, + options: function options(props) { + return { + header: function header() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).ActionBar, { + considerSafeAreaTop: true, + left: Header._getHeaderLeftButtonsBackButtonOnly(props.navigation, (0, _$$_REQUIRE(_dependencyMap[6]).getJobColor)()), + center: Header._getLogo((0, _$$_REQUIRE(_dependencyMap[12]).getNavigationParams)(props).logoUrl || (0, _$$_REQUIRE(_dependencyMap[6]).getJobLogo)(), _$$_REQUIRE(_dependencyMap[13])) + }); + }, + gesturesEnabled: false + }; + } + })); + } +},2471,[5,17,2472,1806,1861,462,2474,2475,2502,2508,2515,2144,2148,2527,2528]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports._getLogo = _getLogo; + exports._getHeaderLeftButtonsBackButtonOnly = _getHeaderLeftButtonsBackButtonOnly; + exports._getHeaderRightButton = _getHeaderRightButton; + exports._getHeader = _getHeader; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _buttonComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _getLogo(url, requireDefaultObj) { + return _react.default.createElement(_imageComponent.default, { + resizeMode: "contain", + style: _$$_REQUIRE(_dependencyMap[7]).styles.headerLogo, + source: url ? { + uri: url + } : requireDefaultObj + }); + } + + function _getHeaderLeftButtonsBackButtonOnly(navigation, color) { + var buttonStyle = [_$$_REQUIRE(_dependencyMap[7]).styles.button]; + var iconStyle = [_$$_REQUIRE(_dependencyMap[7]).styles.icon, { + color: color + }]; + + if (_$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isiPhone()) { + buttonStyle.push(_$$_REQUIRE(_dependencyMap[7]).styles.buttonIphone); + iconStyle.push(_$$_REQUIRE(_dependencyMap[7]).styles.iconIphone); + } + + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[7]).styles.container + }, _react.default.createElement(_buttonComponent.default, { + style: buttonStyle, + onPress: function onPress() { + navigation.goBack(null); + } + }, _react.default.createElement(_iconComponent.default, { + name: _$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isRTL() ? "arrow-forward" : "arrow-back", + style: iconStyle, + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS + }))); + } + + function _getHeaderRightButton(navigation, color, iconName, text, callback) { + var iconStyle = [_$$_REQUIRE(_dependencyMap[7]).styles.icon, { + color: color + }]; + + if (_$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isiPhone()) { + iconStyle.push(_$$_REQUIRE(_dependencyMap[7]).styles.iconIphone); + } + + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[7]).styles.container] + }, _react.default.createElement(_buttonComponent.default, { + style: _$$_REQUIRE(_dependencyMap[7]).styles.rightButton, + onPress: callback + }, _react.default.createElement(_fontText.default, { + style: { + color: color + } + }, text), _react.default.createElement(_iconComponent.default, { + name: iconName, + style: iconStyle, + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS + }))); + } + + function _getHeader(title, subtitle, callback, imageUrl) { + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: callback + }, _react.default.createElement(_reactNative.View, { + style: { + display: "flex", + flexDirection: "column", + alignItems: "center" + } + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[7]).styles.titleText, + type: "medium" + }, title), _react.default.createElement(_reactNative.View, { + style: { + display: "flex", + flexDirection: "row", + alignItems: "flex-end" + } + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[7]).styles.subtitleText + }, subtitle), _react.default.createElement(_reactNative.Image, { + style: _$$_REQUIRE(_dependencyMap[7]).styles.image, + source: { + uri: imageUrl + } + })))); + } +},2472,[5,17,28,588,1806,2202,1879,2473,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + headerTitle: { + position: "absolute", + top: 0, + start: 0, + bottom: 0, + end: 0, + resizeMode: "center", + width: null, + height: null + }, + headerLogo: { + position: "absolute", + top: 0, + start: 0, + bottom: 0, + end: 0, + width: null, + height: null, + marginHorizontal: 25, + marginVertical: 5 + }, + container: { + flexWrap: "wrap", + alignItems: "flex-start", + flexDirection: "row" + }, + icon: { + fontSize: 24, + marginEnd: 0, + marginLeft: 0, + marginStart: 0, + marginRight: 0 + }, + iconIphone: { + fontSize: 16 + }, + button: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + alignItems: "center", + justifyContent: "center", + width: 40, + height: 40, + borderRadius: 40, + marginEnd: 5, + marginStart: 5 + }, + buttonIphone: { + width: 30, + height: 30 + }, + rightButton: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + alignItems: "center", + justifyContent: "center", + borderRadius: 40, + marginEnd: 10, + marginStart: 10, + flexDirection: "row" + }, + titleText: { + fontSize: 17 + }, + subtitleText: { + fontSize: 8, + fontStyle: "italic" + }, + image: { + width: 39, + height: 14 + } + }); + + exports.styles = styles; +},2473,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getJobType = exports.getJobDuration = exports.getEventSchedule = exports.getJobTypes = exports.getJobDurations = exports.getEventBackground = exports.getJobBackground = exports.getJobLogo = exports.getCitySparkLogo = exports.getCitySparkUrl = exports.getNewEventUrl = exports.getEventColor = exports.getEventById = exports.getEventCategories = exports.getFeaturedEventApi = exports.getEventApi = exports.getJobColor = exports.getJobUrlPageById = undefined; + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var getJobUrlPageById = function getJobUrlPageById(id) { + return "http://jobview.local-jobs.monster.com/Job-US-" + id + ".aspx"; + }; + + exports.getJobUrlPageById = getJobUrlPageById; + + var getJobColor = function getJobColor() { + return _$$_REQUIRE(_dependencyMap[2]).colors.md_purple_800; + }; + + exports.getJobColor = getJobColor; + + var getEventApi = function getEventApi() { + return "https://api.cityspark.com/v1/events"; + }; + + exports.getEventApi = getEventApi; + + var getFeaturedEventApi = function getFeaturedEventApi() { + return "https://api.cityspark.com/v1/Promotions/Flat"; + }; + + exports.getFeaturedEventApi = getFeaturedEventApi; + + var getEventCategories = function getEventCategories() { + return "https://api.cityspark.com/v1/categories"; + }; + + exports.getEventCategories = getEventCategories; + + var getEventById = function getEventById(id) { + return "https://api.cityspark.com/v1/event/" + id; + }; + + exports.getEventById = getEventById; + + var getEventColor = function getEventColor() { + return _$$_REQUIRE(_dependencyMap[2]).colors.md_blue_800; + }; + + exports.getEventColor = getEventColor; + + var getNewEventUrl = function getNewEventUrl() { + return "https://portal.cityspark.com/EventEntry/EventEntry/joplinglobe"; + }; + + exports.getNewEventUrl = getNewEventUrl; + + var getCitySparkUrl = function getCitySparkUrl() { + return "https://www.cityspark.com"; + }; + + exports.getCitySparkUrl = getCitySparkUrl; + + var getCitySparkLogo = function getCitySparkLogo() { + return "https://www.cityspark.com/wp-content/uploads/2019/05/citysparklogoSmall.png"; + }; + + exports.getCitySparkLogo = getCitySparkLogo; + + var getJobLogo = function getJobLogo() { + return _Api.default.baseUrl() + "?pSetup=" + global.getActivePSetup().pSetup + "&action=jobs&view=logo"; + }; + + exports.getJobLogo = getJobLogo; + + var getJobBackground = function getJobBackground() { + return "https://media.newjobs.com/homepage/images/hero-img/bg_purple_7.jpg"; + }; + + exports.getJobBackground = getJobBackground; + + var getEventBackground = function getEventBackground() { + return "https://cdn.pixabay.com/photo/2016/03/28/09/52/firework-1285264_960_720.jpg"; + }; + + exports.getEventBackground = getEventBackground; + + var getJobDurations = function getJobDurations() { + return [{ + text: "All" + }, { + text: "Full Time", + value: "FULLTIME" + }, { + text: "Part Time", + value: "PARTTIME" + }]; + }; + + exports.getJobDurations = getJobDurations; + + var getJobTypes = function getJobTypes() { + return [{ + text: "All" + }, { + text: "Permanent", + value: "1" + }, { + text: "Temporary", + value: "2" + }, { + text: "Internship", + value: "3" + }]; + }; + + exports.getJobTypes = getJobTypes; + + var getEventSchedule = function getEventSchedule() { + return [{ + text: "This week" + }, { + text: "Next week" + }, { + text: "This weekend" + }, { + text: "Today" + }, { + text: "Tomorrow" + }, { + text: "Custom Date Range" + }]; + }; + + exports.getEventSchedule = getEventSchedule; + + var getJobDuration = function getJobDuration(value) { + return getJobDurations().find(function (duration) { + return duration.value === value; + }).text; + }; + + exports.getJobDuration = getJobDuration; + + var getJobType = function getJobType(value) { + return getJobTypes().find(function (type) { + return type.value === value; + }).text; + }; + + exports.getJobType = getJobType; +},2474,[5,431,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2475,[2476]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.JobFilterScreen = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _datepickerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var JobFilterScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(JobFilterScreen, _NavigationBaseScreen); + + var _super = _createSuper(JobFilterScreen); + + function JobFilterScreen() { + (0, _classCallCheck2.default)(this, JobFilterScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(JobFilterScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(JobFilterScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getFilterValue", + value: function getFilterValue(filter, defaultValue) { + var value = defaultValue; + + if (filter) { + if (filter.getValue()) { + value = filter.getValue(); + } + } + + return value; + } + }, { + key: "getTag", + value: function getTag() { + return "Job Filter"; + } + }, { + key: "render", + value: function render() { + var _this = this; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).FilterParent, { + backgroundUrl: (0, _$$_REQUIRE(_dependencyMap[11]).getJobBackground)(), + color: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + onSearch: function onSearch() { + var navigation = _this.props.navigation; + + var _this$getFilterValue = _this.getFilterValue(_this.filterLocation, {}), + state = _this$getFilterValue.state, + city = _this$getFilterValue.city, + input = _this$getFilterValue.input, + zip = _this$getFilterValue.zip; + + var term = _this.getFilterValue(_this.filterText, ""); + + var dayPublished = _$$_REQUIRE(_dependencyMap[12]).DateUtils.getDaysFromDateToToday(_this.getFilterValue(_this.filterDate, "")); + + var type = _this.getFilterValue(_this.filterType, ""); + + var status = _this.getFilterValue(_this.filterDuration, ""); + + var _this$getFilterValue2 = _this.getFilterValue(_this.filterSalary, {}), + min = _this$getFilterValue2.min, + max = _this$getFilterValue2.max, + error = _this$getFilterValue2.error; + + if (error) { + return [error]; + } + + navigation.navigate("VerticalListScreen", { + filters: (0, _extends2.default)({ + action: "jobs", + view: "filtered", + day_published: dayPublished, + salary_min: min, + salary_max: max, + job_type: type, + job_status: status, + city: city || input, + term: term + }, state ? { + state: state + } : {}, zip ? { + zip: zip + } : {}) + }); + return []; + }, + advanceFilters: [_react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).FilterRadioButton, { + key: "filter_duration", + ref: function ref(_ref) { + _this.filterDuration = _ref; + }, + bgColor: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + textColor: _$$_REQUIRE(_dependencyMap[12]).colors.white, + buttons: (0, _$$_REQUIRE(_dependencyMap[11]).getJobDurations)(), + active: "All" + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).FilterRadioButton, { + key: "filter_type", + ref: function ref(_ref2) { + _this.filterType = _ref2; + }, + bgColor: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + textColor: _$$_REQUIRE(_dependencyMap[12]).colors.white, + buttons: (0, _$$_REQUIRE(_dependencyMap[11]).getJobTypes)(), + active: "All" + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).FilterMinMax, { + key: "filter_salary", + ref: function ref(_ref3) { + _this.filterSalary = _ref3; + }, + borderColor: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + hintMin: global.strings("min_salary"), + hintMax: global.strings("max_salary") + }), _react.default.createElement(_datepickerComponent.default, { + key: "filter_date", + startEmpty: true, + maxDate: new Date(), + style: [_$$_REQUIRE(_dependencyMap[15]).styles.datePicker, { + borderColor: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)() + }], + ref: function ref(_ref4) { + _this.filterDate = _ref4; + }, + borderColor: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + hint: global.strings("str_published_after_date"), + locale: global.getLocaleConfig().getCurrentLocale() + })] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).FilterText, { + key: "filter_text", + style: _$$_REQUIRE(_dependencyMap[15]).styles.filter, + borderColor: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + hint: global.strings("vertical_job_text_hint"), + ref: function ref(_ref5) { + _this.filterText = _ref5; + } + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).FilterLocation, { + key: "filter_location", + style: _$$_REQUIRE(_dependencyMap[15]).styles.filter, + hint: global.strings("vertical_job_location_hint"), + borderColor: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + textColor: _$$_REQUIRE(_dependencyMap[12]).colors.white, + ref: function ref(_ref6) { + _this.filterLocation = _ref6; + } + })); + } + }]); + return JobFilterScreen; + }(_$$_REQUIRE(_dependencyMap[18]).NavigationBaseScreen); + + exports.JobFilterScreen = JobFilterScreen; +},2476,[5,6,7,8,90,12,14,16,17,2265,2477,2474,462,2490,2493,2496,2497,2499,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2477,[2478]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FilterParent = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FilterParent = function (_React$Component) { + (0, _inherits2.default)(FilterParent, _React$Component); + + var _super = _createSuper(FilterParent); + + function FilterParent(props) { + var _this; + + (0, _classCallCheck2.default)(this, FilterParent); + _this = _super.call(this, props); + _this.state = { + errors: [] + }; + return _this; + } + + (0, _createClass2.default)(FilterParent, [{ + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + backgroundUrl = _this$props.backgroundUrl, + children = _this$props.children, + color = _this$props.color, + onSearch = _this$props.onSearch, + advanceFilters = _this$props.advanceFilters, + backGroundResizeMode = _this$props.backGroundResizeMode, + buttons = _this$props.buttons; + var errors = this.state.errors; + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[9]).styles.parent + }, _react.default.createElement(_reactNative.ImageBackground, { + source: { + uri: backgroundUrl + }, + style: _$$_REQUIRE(_dependencyMap[9]).styles.background, + resizeMode: backGroundResizeMode || "cover" + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).TecnaviaScrollView, { + width: "100%", + horizontal: false, + centerContent: true + }, children, advanceFilters.length ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).FilterAccordion, { + textColor: _$$_REQUIRE(_dependencyMap[12]).colors.white, + headerColor: color, + borderColor: color, + style: _$$_REQUIRE(_dependencyMap[9]).styles.filter + }, advanceFilters) : null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).FilterSearch, { + style: _$$_REQUIRE(_dependencyMap[9]).styles.filterButton, + backgroundColor: _$$_REQUIRE(_dependencyMap[12]).colors.white, + textColor: color, + borderColor: color, + onPress: function onPress() { + var newErrors = onSearch(); + + if (newErrors && newErrors.length) { + _this2.setState({ + errors: newErrors + }); + } + } + }), buttons.map(function (_ref, index) { + var label = _ref.label, + onPress = _ref.onPress; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).FilterSearch, { + key: index, + text: label, + style: _$$_REQUIRE(_dependencyMap[9]).styles.filterButton, + backgroundColor: color, + onPress: onPress + }); + }))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Error, { + style: { + position: "absolute", + bottom: 0, + start: 0, + end: 0 + }, + errors: errors + })); + } + }]); + return FilterParent; + }(_react.default.Component); + + exports.FilterParent = FilterParent; + FilterParent.propTypes = { + children: _propTypes.default.array.isRequired, + backgroundUrl: _propTypes.default.string, + color: _propTypes.default.string.isRequired, + onSearch: _propTypes.default.func.isRequired, + advanceFilters: _propTypes.default.arrayOf(_propTypes.default.node), + backGroundResizeMode: _propTypes.default.string, + buttons: _propTypes.default.arrayOf(_propTypes.default.shape({ + label: _propTypes.default.string.isRequired, + onPress: _propTypes.default.func.isRequired + })) + }; + FilterParent.defaultProps = { + advanceFilters: [], + buttons: [] + }; +},2478,[5,7,8,12,14,16,17,201,28,2479,1909,2480,462,2488,2171]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + flex: 1, + justifyContent: "center", + alignItems: "center" + }, + background: { + width: "100%", + flex: 1, + flexDirection: "column", + justifyContent: "center", + alignItems: "center" + }, + filterViews: { + width: "100%", + flexDirection: "column", + justifyContent: "center", + alignItems: "center" + }, + filter: { + width: "100%" + }, + searchButton: { + borderWidth: 1, + borderColor: (0, _$$_REQUIRE(_dependencyMap[1]).getEventColor)() + } + }); + + exports.styles = styles; +},2479,[28,2474]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2480,[2481]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FilterAccordion = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _accordionComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FilterAccordion = function (_React$Component) { + (0, _inherits2.default)(FilterAccordion, _React$Component); + + var _super = _createSuper(FilterAccordion); + + function FilterAccordion(props) { + var _this; + + (0, _classCallCheck2.default)(this, FilterAccordion); + _this = _super.call(this, props); + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + _this.borderColor = props.borderColor || supportColor; + return _this; + } + + (0, _createClass2.default)(FilterAccordion, [{ + key: "_renderHeader", + value: function _renderHeader(item, index, expanded) { + var _this$props = this.props, + textColor = _this$props.textColor, + headerColor = _this$props.headerColor; + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[11]).styles.header, { + backgroundColor: headerColor, + borderColor: this.borderColor + }] + }, _react.default.createElement(_reactNative.Text, { + style: [_$$_REQUIRE(_dependencyMap[11]).styles.headerText, { + color: textColor + }] + }, item.title), expanded ? _react.default.createElement(_iconComponent.default, { + style: { + fontSize: 18, + color: textColor + }, + name: "remove", + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS + }) : _react.default.createElement(_iconComponent.default, { + style: { + fontSize: 18, + color: textColor + }, + name: "add", + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS + })); + } + }, { + key: "_renderContent", + value: function _renderContent() { + var _this$props2 = this.props, + children = _this$props2.children, + contentStyle = _this$props2.contentStyle; + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[11]).styles.content, { + backgroundColor: _$$_REQUIRE(_dependencyMap[12]).colors.transparent + }, contentStyle] + }, children); + } + }, { + key: "render", + value: function render() { + var style = this.props.style; + return _react.default.createElement(_accordionComponent.default, { + style: style, + sections: [{ + title: global.strings("btn_advance_filters") + }], + renderHeader: this._renderHeader.bind(this), + renderContent: this._renderContent.bind(this) + }); + } + }]); + return FilterAccordion; + }(_react.default.Component); + + exports.FilterAccordion = FilterAccordion; + FilterAccordion.propTypes = { + textColor: _propTypes.default.string, + headerColor: _propTypes.default.string, + borderColor: _propTypes.default.string, + style: _propTypes.default.object, + children: _propTypes.default.array, + contentStyle: _propTypes.default.object + }; + FilterAccordion.defaultProps = { + textColor: _$$_REQUIRE(_dependencyMap[12]).colors.white, + headerColor: _$$_REQUIRE(_dependencyMap[12]).colors.black, + borderColor: _$$_REQUIRE(_dependencyMap[12]).colors.black + }; +},2481,[5,7,8,12,14,16,17,28,201,1806,2482,2486,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = TecnaviaAccordion; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _Accordion = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function TecnaviaAccordion(props) { + var _React$useState = _react.default.useState([]), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + activeSections = _React$useState2[0], + setActiveSections = _React$useState2[1]; + + return _react.default.createElement(_Accordion.default, (0, _extends2.default)({ + underlayColor: _$$_REQUIRE(_dependencyMap[6]).colors.transparent + }, props, { + activeSections: activeSections, + onChange: function onChange() { + var active = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + return setActiveSections((0, _toConsumableArray2.default)(active)); + } + })); + } +},2482,[5,6,21,41,17,2483,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _Collapsible = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var COLLAPSIBLE_PROPS = Object.keys(_Collapsible.default.propTypes); + var VIEW_PROPS = Object.keys(_$$_REQUIRE(_dependencyMap[12]).ViewPropTypes); + + var Accordion = function (_Component) { + (0, _inherits2.default)(Accordion, _Component); + + var _super = _createSuper(Accordion); + + function Accordion() { + (0, _classCallCheck2.default)(this, Accordion); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(Accordion, [{ + key: "_toggleSection", + value: function _toggleSection(section) { + if (!this.props.disabled) { + var _this$props = this.props, + activeSections = _this$props.activeSections, + expandMultiple = _this$props.expandMultiple, + onChange = _this$props.onChange; + var updatedSections = []; + + if (activeSections.includes(section)) { + updatedSections = activeSections.filter(function (a) { + return a !== section; + }); + } else if (expandMultiple) { + updatedSections = [].concat((0, _toConsumableArray2.default)(activeSections), [section]); + } else { + updatedSections = [section]; + } + + onChange && onChange(updatedSections); + } + } + }, { + key: "render", + value: function render() { + var _this = this; + + var viewProps = {}; + var collapsibleProps = {}; + Object.keys(this.props).forEach(function (key) { + if (COLLAPSIBLE_PROPS.includes(key)) { + collapsibleProps[key] = _this.props[key]; + } else if (VIEW_PROPS.includes(key)) { + viewProps[key] = _this.props[key]; + } + }); + var _this$props2 = this.props, + activeSections = _this$props2.activeSections, + containerStyle = _this$props2.containerStyle, + sectionContainerStyle = _this$props2.sectionContainerStyle, + expandFromBottom = _this$props2.expandFromBottom, + sections = _this$props2.sections, + underlayColor = _this$props2.underlayColor, + touchableProps = _this$props2.touchableProps, + Touchable = _this$props2.touchableComponent, + _onAnimationEnd = _this$props2.onAnimationEnd, + renderContent = _this$props2.renderContent, + renderHeader = _this$props2.renderHeader, + renderFooter = _this$props2.renderFooter, + renderSectionTitle = _this$props2.renderSectionTitle; + + var renderCollapsible = function renderCollapsible(section, key) { + return _react.default.createElement(_Collapsible.default, (0, _extends2.default)({ + collapsed: !activeSections.includes(key) + }, collapsibleProps, { + onAnimationEnd: function onAnimationEnd() { + return _onAnimationEnd(section, key); + } + }), renderContent(section, key, activeSections.includes(key), sections)); + }; + + return _react.default.createElement(_reactNative.View, (0, _extends2.default)({ + style: containerStyle + }, viewProps), sections.map(function (section, key) { + return _react.default.createElement(_reactNative.View, { + key: key, + style: sectionContainerStyle + }, renderSectionTitle(section, key, activeSections.includes(key)), expandFromBottom && renderCollapsible(section, key), _react.default.createElement(Touchable, (0, _extends2.default)({ + onPress: function onPress() { + return _this._toggleSection(key); + }, + underlayColor: underlayColor + }, touchableProps), renderHeader(section, key, activeSections.includes(key), sections)), !expandFromBottom && renderCollapsible(section, key), renderFooter && renderFooter(section, key, activeSections.includes(key), sections)); + })); + } + }]); + return Accordion; + }(_react.Component); + + exports.default = Accordion; + Accordion.propTypes = { + sections: _propTypes.default.array.isRequired, + renderHeader: _propTypes.default.func.isRequired, + renderContent: _propTypes.default.func.isRequired, + renderFooter: _propTypes.default.func, + renderSectionTitle: _propTypes.default.func, + activeSections: _propTypes.default.arrayOf(_propTypes.default.number).isRequired, + onChange: _propTypes.default.func.isRequired, + align: _propTypes.default.oneOf(['top', 'center', 'bottom']), + duration: _propTypes.default.number, + easing: _propTypes.default.string, + underlayColor: _propTypes.default.string, + touchableComponent: _propTypes.default.elementType, + touchableProps: _propTypes.default.object, + disabled: _propTypes.default.bool, + expandFromBottom: _propTypes.default.bool, + expandMultiple: _propTypes.default.bool, + onAnimationEnd: _propTypes.default.func, + sectionContainerStyle: _$$_REQUIRE(_dependencyMap[12]).ViewPropTypes.style, + containerStyle: _$$_REQUIRE(_dependencyMap[12]).ViewPropTypes.style + }; + Accordion.defaultProps = { + underlayColor: 'black', + disabled: false, + expandFromBottom: false, + expandMultiple: false, + touchableComponent: _reactNative.TouchableHighlight, + renderSectionTitle: function renderSectionTitle() { + return null; + }, + onAnimationEnd: function onAnimationEnd() { + return null; + }, + sectionContainerStyle: {} + }; +},2483,[5,6,21,7,8,12,14,16,17,201,28,2484,2485]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ANIMATED_EASING_PREFIXES = ['easeInOut', 'easeOut', 'easeIn']; + + var Collapsible = function (_Component) { + (0, _inherits2.default)(Collapsible, _Component); + + var _super = _createSuper(Collapsible); + + function Collapsible(props) { + var _this; + + (0, _classCallCheck2.default)(this, Collapsible); + _this = _super.call(this, props); + _this.contentHandle = null; + + _this._handleRef = function (ref) { + _this.contentHandle = ref; + }; + + _this._handleLayoutChange = function (event) { + var contentHeight = event.nativeEvent.layout.height; + + if (_this.state.animating || _this.props.collapsed || _this.state.measuring || _this.state.contentHeight === contentHeight) { + return; + } + + _this.state.height.setValue(contentHeight); + + _this.setState({ + contentHeight: contentHeight + }); + }; + + _this.state = { + measuring: false, + measured: false, + height: new _reactNative.Animated.Value(props.collapsedHeight), + contentHeight: 0, + animating: false + }; + return _this; + } + + (0, _createClass2.default)(Collapsible, [{ + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var _this2 = this; + + if (prevProps.collapsed !== this.props.collapsed) { + this.setState({ + measured: false + }, function () { + return _this2._componentDidUpdate(prevProps); + }); + } else { + this._componentDidUpdate(prevProps); + } + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.unmounted = true; + } + }, { + key: "_componentDidUpdate", + value: function _componentDidUpdate(prevProps) { + if (prevProps.collapsed !== this.props.collapsed) { + this._toggleCollapsed(this.props.collapsed); + } else if (this.props.collapsed && prevProps.collapsedHeight !== this.props.collapsedHeight) { + this.state.height.setValue(this.props.collapsedHeight); + } + } + }, { + key: "_measureContent", + value: function _measureContent(callback) { + var _this3 = this; + + this.setState({ + measuring: true + }, function () { + requestAnimationFrame(function () { + if (!_this3.contentHandle) { + _this3.setState({ + measuring: false + }, function () { + return callback(_this3.props.collapsedHeight); + }); + } else { + var ref; + + if (typeof _this3.contentHandle.measure === 'function') { + ref = _this3.contentHandle; + } else { + ref = _this3.contentHandle.getNode(); + } + + ref.measure(function (x, y, width, height) { + _this3.setState({ + measuring: false, + measured: true, + contentHeight: height + }, function () { + return callback(height); + }); + }); + } + }); + }); + } + }, { + key: "_toggleCollapsed", + value: function _toggleCollapsed(collapsed) { + var _this4 = this; + + if (collapsed) { + this._transitionToHeight(this.props.collapsedHeight); + } else if (!this.contentHandle) { + if (this.state.measured) { + this._transitionToHeight(this.state.contentHeight); + } + + return; + } else { + this._measureContent(function (contentHeight) { + _this4._transitionToHeight(contentHeight); + }); + } + } + }, { + key: "_transitionToHeight", + value: function _transitionToHeight(height) { + var _this5 = this; + + var duration = this.props.duration; + var easing = this.props.easing; + + if (typeof easing === 'string') { + var prefix; + var found = false; + + for (var i = 0; i < ANIMATED_EASING_PREFIXES.length; i++) { + prefix = ANIMATED_EASING_PREFIXES[i]; + + if (easing.substr(0, prefix.length) === prefix) { + easing = easing.substr(prefix.length, 1).toLowerCase() + easing.substr(prefix.length + 1); + prefix = prefix.substr(4, 1).toLowerCase() + prefix.substr(5); + easing = _reactNative.Easing[prefix](_reactNative.Easing[easing || 'ease']); + found = true; + break; + } + } + + if (!found) { + easing = _reactNative.Easing[easing]; + } + + if (!easing) { + throw new Error('Invalid easing type "' + this.props.easing + '"'); + } + } + + if (this._animation) { + this._animation.stop(); + } + + this.setState({ + animating: true + }); + this._animation = _reactNative.Animated.timing(this.state.height, { + useNativeDriver: false, + toValue: height, + duration: duration, + easing: easing + }).start(function () { + if (_this5.unmounted) { + return; + } + + _this5.setState({ + animating: false + }, function () { + if (_this5.unmounted) { + return; + } + + _this5.props.onAnimationEnd(); + }); + }); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + collapsed = _this$props.collapsed, + enablePointerEvents = _this$props.enablePointerEvents; + var _this$state = this.state, + height = _this$state.height, + contentHeight = _this$state.contentHeight, + measuring = _this$state.measuring, + measured = _this$state.measured; + var hasKnownHeight = !measuring && (measured || collapsed); + var style = hasKnownHeight && { + overflow: 'hidden', + height: height + }; + var contentStyle = {}; + + if (measuring) { + contentStyle.position = 'absolute'; + contentStyle.opacity = 0; + } else if (this.props.align === 'center') { + contentStyle.transform = [{ + translateY: height.interpolate({ + inputRange: [0, contentHeight], + outputRange: [contentHeight / -2, 0] + }) + }]; + } else if (this.props.align === 'bottom') { + contentStyle.transform = [{ + translateY: height.interpolate({ + inputRange: [0, contentHeight], + outputRange: [-contentHeight, 0] + }) + }]; + } + + return _react.default.createElement(_reactNative.Animated.View, { + style: style, + pointerEvents: !enablePointerEvents && collapsed ? 'none' : 'auto' + }, _react.default.createElement(_reactNative.Animated.View, { + ref: this._handleRef, + style: [this.props.style, contentStyle], + onLayout: this.state.animating ? undefined : this._handleLayoutChange + }, this.props.children)); + } + }]); + return Collapsible; + }(_react.Component); + + exports.default = Collapsible; + Collapsible.propTypes = { + align: _propTypes.default.oneOf(['top', 'center', 'bottom']), + collapsed: _propTypes.default.bool, + collapsedHeight: _propTypes.default.number, + enablePointerEvents: _propTypes.default.bool, + duration: _propTypes.default.number, + easing: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.func]), + style: _$$_REQUIRE(_dependencyMap[9]).ViewPropTypes.style, + onAnimationEnd: _propTypes.default.func, + children: _propTypes.default.node + }; + Collapsible.defaultProps = { + align: 'top', + collapsed: true, + collapsedHeight: 0, + enablePointerEvents: false, + duration: 300, + easing: 'easeOutCubic', + onAnimationEnd: function onAnimationEnd() { + return null; + } + }; +},2484,[5,7,8,12,14,16,17,201,28,2485]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ViewPropTypes = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var ViewPropTypes = _reactNative.ViewPropTypes || _reactNative.View.propTypes; + exports.ViewPropTypes = ViewPropTypes; +},2485,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + header: { + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + margin: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + borderWidth: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_WIDTH, + borderRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS, + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + padding: _$$_REQUIRE(_dependencyMap[1]).filterStyles.TEXT_PADDING + }, + headerText: { + flex: 3 + }, + headerIcon: { + flex: 1 + }, + content: { + flexDirection: "column" + } + }); + + exports.styles = styles; +},2486,[28,2487]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.filterStyles = undefined; + var filterStyles = { + LINE_HEIGHT: 50, + TEXT_PADDING: 5, + MARGIN: 10, + BORDER_WIDTH: 2, + BORDER_RADIUS: 5, + SEARCH_WIDTH: 200 + }; + exports.filterStyles = filterStyles; +},2487,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FilterSearch = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FilterSearch = function (_React$Component) { + (0, _inherits2.default)(FilterSearch, _React$Component); + + var _super = _createSuper(FilterSearch); + + function FilterSearch() { + (0, _classCallCheck2.default)(this, FilterSearch); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(FilterSearch, [{ + key: "render", + value: function render() { + var _this$props = this.props, + style = _this$props.style, + backgroundColor = _this$props.backgroundColor, + textColor = _this$props.textColor, + borderColor = _this$props.borderColor, + _onPress = _this$props.onPress; + var text = this.props.text; + text = text || global.strings("btn_search"); + return _react.default.createElement(_reactNative.View, { + style: style + }, _react.default.createElement(_reactNative.TouchableOpacity, { + activeOpacity: 0.8, + onPress: function onPress() { + if (typeof _onPress === "function") { + _onPress(); + } + }, + style: [_$$_REQUIRE(_dependencyMap[9]).styles.touchable, { + backgroundColor: backgroundColor, + borderColor: borderColor, + borderWidth: borderColor ? 2 : 0 + }] + }, _react.default.createElement(_reactNative.Text, { + style: [_$$_REQUIRE(_dependencyMap[9]).styles.text, { + color: textColor + }] + }, text))); + } + }]); + return FilterSearch; + }(_react.default.Component); + + exports.FilterSearch = FilterSearch; + FilterSearch.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number]), + backgroundColor: _propTypes.default.string, + textColor: _propTypes.default.string, + borderColor: _propTypes.default.string, + text: _propTypes.default.string, + onPress: _propTypes.default.func.isRequired + }; + FilterSearch.defaultProps = { + backgroundColor: _$$_REQUIRE(_dependencyMap[10]).colors.black, + textColor: _$$_REQUIRE(_dependencyMap[10]).colors.white + }; +},2488,[5,7,8,12,14,16,17,28,201,2489,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + touchable: { + margin: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + width: _$$_REQUIRE(_dependencyMap[1]).filterStyles.SEARCH_WIDTH, + borderRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS, + flexDirection: "column", + justifyContent: "center", + alignItems: "center", + alignSelf: "center" + }, + text: { + color: _$$_REQUIRE(_dependencyMap[2]).colors.white, + padding: _$$_REQUIRE(_dependencyMap[1]).filterStyles.TEXT_PADDING + } + }); + + exports.styles = styles; +},2489,[28,2487,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2490,[2491]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FilterRadioButton = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FilterRadioButton = function (_React$Component) { + (0, _inherits2.default)(FilterRadioButton, _React$Component); + + var _super = _createSuper(FilterRadioButton); + + function FilterRadioButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, FilterRadioButton); + _this = _super.call(this, props); + _this.state = { + activeText: props.active + }; + return _this; + } + + (0, _createClass2.default)(FilterRadioButton, [{ + key: "getValue", + value: function getValue() { + var buttons = this.props.buttons; + var activeText = this.state.activeText; + var result = buttons.find(function (_ref) { + var text = _ref.text; + return text === activeText; + }); + + if (result && result.value) { + return result.value; + } + + return ""; + } + }, { + key: "isActive", + value: function isActive(toCheck) { + var activeText = this.state.activeText; + return toCheck === activeText; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + buttons = _this$props.buttons, + style = _this$props.style; + var _this$props2 = this.props, + bgColor = _this$props2.bgColor, + textColor = _this$props2.textColor; + + var _global$getRssIndex = global.getRssIndex(), + actionBarBackgroundColor = _global$getRssIndex.actionBarBackgroundColor, + supportColor = _global$getRssIndex.supportColor; + + bgColor = bgColor || supportColor; + textColor = textColor || actionBarBackgroundColor; + return buttons ? _react.default.createElement(_reactNative.View, { + style: [style, _$$_REQUIRE(_dependencyMap[9]).styles.parent] + }, buttons.map(function (_ref2, index) { + var text = _ref2.text; + return _react.default.createElement(_reactNative.TouchableOpacity, { + activeOpacity: 1, + key: index, + onPress: function onPress() { + _this2.setState({ + activeText: text + }); + }, + style: [_$$_REQUIRE(_dependencyMap[9]).styles.button, { + borderColor: bgColor, + borderRightWidth: index === buttons.length - 1 ? _$$_REQUIRE(_dependencyMap[10]).filterStyles.BORDER_WIDTH : 0, + backgroundColor: _this2.isActive(text) ? bgColor : textColor, + borderTopLeftRadius: index === 0 ? _$$_REQUIRE(_dependencyMap[10]).filterStyles.BORDER_RADIUS : 0, + borderBottomLeftRadius: index === 0 ? _$$_REQUIRE(_dependencyMap[10]).filterStyles.BORDER_RADIUS : 0, + borderTopRightRadius: index === buttons.length - 1 ? _$$_REQUIRE(_dependencyMap[10]).filterStyles.BORDER_RADIUS : 0, + borderBottomRightRadius: index === buttons.length - 1 ? _$$_REQUIRE(_dependencyMap[10]).filterStyles.BORDER_RADIUS : 0 + }] + }, _react.default.createElement(_reactNative.Text, { + style: { + color: _this2.isActive(text) ? textColor : bgColor, + textAlign: "center" + } + }, text)); + })) : null; + } + }]); + return FilterRadioButton; + }(_react.default.Component); + + exports.FilterRadioButton = FilterRadioButton; + FilterRadioButton.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number]), + buttons: _propTypes.default.arrayOf(_propTypes.default.shape({ + text: _propTypes.default.string.isRequired, + value: _propTypes.default.string + })).isRequired, + bgColor: _propTypes.default.string, + textColor: _propTypes.default.string, + active: _propTypes.default.string.isRequired + }; +},2491,[5,7,8,12,14,16,17,28,201,2492,2487]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + flexDirection: "row", + margin: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN + }, + button: { + flex: 1, + justifyContent: "center", + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + borderWidth: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_WIDTH + } + }); + + exports.styles = styles; +},2492,[28,2487]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2493,[2494]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FilterMinMax = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _fontTextInput = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FilterMinMax = function (_React$Component) { + (0, _inherits2.default)(FilterMinMax, _React$Component); + + var _super = _createSuper(FilterMinMax); + + function FilterMinMax(props) { + var _this; + + (0, _classCallCheck2.default)(this, FilterMinMax); + _this = _super.call(this, props); + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + _this.borderColor = props.borderColor || supportColor; + _this.state = { + min: "", + max: "" + }; + return _this; + } + + (0, _createClass2.default)(FilterMinMax, [{ + key: "getValue", + value: function getValue() { + var min = parseInt(this.state.min, 10); + var max = parseInt(this.state.max, 10); + + if (this.isFilterValid(min, max)) { + return { + min: min, + max: max + }; + } + + return { + error: global.strings("err_max_min") + }; + } + }, { + key: "isFilterValid", + value: function isFilterValid(min, max) { + return !min && !max || min || max || min < max; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + hintMin = _this$props.hintMin, + hintMax = _this$props.hintMax; + var style = this.props.style; + hintMin = hintMin || global.strings("filter_min"); + hintMax = hintMax || global.strings("filter_max"); + var _this$state = this.state, + min = _this$state.min, + max = _this$state.max; + return _react.default.createElement(_reactNative.View, { + style: [style, _$$_REQUIRE(_dependencyMap[10]).styles.parent] + }, _react.default.createElement(_fontTextInput.default, { + keyboardType: "numeric", + style: [_$$_REQUIRE(_dependencyMap[10]).styles.min, { + borderColor: this.borderColor + }], + underlineColorAndroid: this.borderColor, + onChangeText: function onChangeText(number) { + _this2.setState({ + min: number + }); + }, + value: min, + returnKeyType: "done", + placeholder: hintMin + }), _react.default.createElement(_fontTextInput.default, { + keyboardType: "numeric", + style: [_$$_REQUIRE(_dependencyMap[10]).styles.max, { + borderColor: this.borderColor + }], + underlineColorAndroid: this.borderColor, + onChangeText: function onChangeText(number) { + _this2.setState({ + max: number + }); + }, + value: max, + returnKeyType: "done", + placeholder: hintMax + })); + } + }]); + return FilterMinMax; + }(_react.default.Component); + + exports.FilterMinMax = FilterMinMax; + FilterMinMax.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number]), + borderColor: _propTypes.default.string, + hintMin: _propTypes.default.string, + hintMax: _propTypes.default.string + }; +},2494,[5,7,8,12,14,16,17,201,28,2257,2495]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + flexDirection: "row", + margin: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN + }, + min: { + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.white, + flex: 1, + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + marginEnd: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN / 2, + borderWidth: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_WIDTH, + borderRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS + }, + max: { + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.white, + flex: 1, + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + marginStart: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN / 2, + borderWidth: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_WIDTH, + borderRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS + } + }); + + exports.styles = styles; +},2495,[28,2487,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + flex: 1, + justifyContent: "center", + alignItems: "center" + }, + background: { + width: "100%", + flex: 1, + flexDirection: "column", + justifyContent: "center", + alignItems: "center" + }, + filterViews: { + maxWidth: 500, + width: "100%", + flexDirection: "column", + justifyContent: "center", + alignItems: "center" + }, + filter: { + width: "100%" + }, + filterButton: {}, + text: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.white, + padding: _$$_REQUIRE(_dependencyMap[2]).filterStyles.TEXT_PADDING + }, + datePicker: { + alignItems: "center", + justifyContent: "center", + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + height: _$$_REQUIRE(_dependencyMap[2]).filterStyles.LINE_HEIGHT, + margin: _$$_REQUIRE(_dependencyMap[2]).filterStyles.MARGIN, + borderWidth: _$$_REQUIRE(_dependencyMap[2]).filterStyles.BORDER_WIDTH, + borderRadius: _$$_REQUIRE(_dependencyMap[2]).filterStyles.BORDER_RADIUS + } + }); + + exports.styles = styles; +},2496,[28,462,2487]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FilterText = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _fontTextInput = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var FilterText = function (_React$Component) { + (0, _inherits2.default)(FilterText, _React$Component); + + var _super = _createSuper(FilterText); + + function FilterText(props) { + var _this; + + (0, _classCallCheck2.default)(this, FilterText); + _this = _super.call(this, props); + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + _this.borderColor = props.borderColor || supportColor; + _this.state = { + input: props.defaultSearch || "" + }; + return _this; + } + + (0, _createClass2.default)(FilterText, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + if (newProps.defaultSearch !== undefined) { + this.setState({ + input: newProps.defaultSearch + }); + } + } + }, { + key: "getValue", + value: function getValue() { + var input = this.state.input; + return input; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var style = this.props.style; + var hint = this.props.hint; + hint = hint || global.strings("filter_text"); + var input = this.state.input; + return _react.default.createElement(_reactNative.View, { + style: style + }, _react.default.createElement(_fontTextInput.default, { + style: [_$$_REQUIRE(_dependencyMap[10]).styles.text, { + borderColor: this.borderColor, + padding: 5, + color: _$$_REQUIRE(_dependencyMap[11]).colors.md_black_1000 + }], + underlineColorAndroid: this.borderColor, + onChangeText: function onChangeText(text) { + return _this2.setState({ + input: text + }); + }, + value: input, + returnKeyType: "done", + placeholder: hint, + placeholderTextColor: _$$_REQUIRE(_dependencyMap[11]).colors.grey + })); + } + }]); + return FilterText; + }(_react.default.Component); + + exports.FilterText = FilterText; + FilterText.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number]), + borderColor: _propTypes.default.string, + hint: _propTypes.default.string, + defaultSearch: _propTypes.default.string + }; +},2497,[5,7,8,12,14,16,17,201,28,2257,2498,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + text: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white, + height: _$$_REQUIRE(_dependencyMap[2]).filterStyles.LINE_HEIGHT, + margin: _$$_REQUIRE(_dependencyMap[2]).filterStyles.MARGIN, + borderWidth: _$$_REQUIRE(_dependencyMap[2]).filterStyles.BORDER_WIDTH, + borderRadius: _$$_REQUIRE(_dependencyMap[2]).filterStyles.BORDER_RADIUS + } + }); + + exports.styles = styles; +},2498,[28,462,2487]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2499,[2500]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FilterLocation = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _RssIndexConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _fontTextInput = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _modal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + function parseApiCitiesResult(result) { + if (result === undefined || typeof result === "string" || typeof result === "number") { + return []; + } + + var parsed; + + if (!Array.isArray(result)) { + parsed = [result]; + } else { + parsed = result; + } + + return parsed.map(function (item) { + var lng = item.lng, + rest = (0, _objectWithoutProperties2.default)(item, ["lng"]); + return (0, _extends2.default)({}, rest, { + lon: lng + }); + }); + } + + function getCities(input) { + var result; + return _regenerator.default.async(function getCities$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(_Api.default.cities(input)); + + case 3: + result = _context.sent.data; + return _context.abrupt("return", parseApiCitiesResult(result)); + + case 7: + _context.prev = 7; + _context.t0 = _context["catch"](0); + + case 9: + return _context.abrupt("return", []); + + case 10: + case "end": + return _context.stop(); + } + } + }, null, null, [[0, 7]], Promise); + } + + function getClosestCities() { + var location, + result, + _args2 = arguments; + return _regenerator.default.async(function getClosestCities$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + location = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : {}; + _context2.prev = 1; + _context2.next = 4; + return _regenerator.default.awrap(_Api.default.closestCities(location)); + + case 4: + result = _context2.sent.data; + return _context2.abrupt("return", parseApiCitiesResult(result)); + + case 8: + _context2.prev = 8; + _context2.t0 = _context2["catch"](1); + + case 10: + return _context2.abrupt("return", []); + + case 11: + case "end": + return _context2.stop(); + } + } + }, null, null, [[1, 8]], Promise); + } + + var FilterLocation = function (_React$Component) { + (0, _inherits2.default)(FilterLocation, _React$Component); + + var _super = _createSuper(FilterLocation); + + function FilterLocation(props) { + var _this; + + (0, _classCallCheck2.default)(this, FilterLocation); + _this = _super.call(this, props); + _this.state = { + input: "", + switchValue: props.useLocation || false, + data: [], + modal: false + }; + _this.toggleModal = _this._toggleModal.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTextChange = _this._onTextChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSelectItem = _this._onSelectItem.bind((0, _assertThisInitialized2.default)(_this)); + _this.renderItem = _this._renderItem.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSwitchChange = _this._onSwitchChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLayout = _this._onLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLocationChange = _this._onLocationChange.bind((0, _assertThisInitialized2.default)(_this)); + + var _global$getRssIndex = global.getRssIndex(), + actionBarBackgroundColor = _global$getRssIndex.actionBarBackgroundColor, + supportColor = _global$getRssIndex.supportColor; + + _this.textColor = props.textColor || actionBarBackgroundColor; + _this.borderColor = props.borderColor || supportColor; + + _this._initDefaultLocation(props); + + if (props.useLocation) { + _this._manageLocation(props.useLocation); + } + + return _this; + } + + (0, _createClass2.default)(FilterLocation, [{ + key: "componentDidMount", + value: function componentDidMount() { + this._initDefaultCity(); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + this._initDefaultLocation(newProps); + + this._initDefaultCity(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this._unWatch(); + } + }, { + key: "getValue", + value: function getValue() { + var _this$state = this.state, + input = _this$state.input, + switchValue = _this$state.switchValue; + return { + input: input, + city: this.selected ? this.selected.city : "", + state: this.selected ? this.selected.state : "", + zip: this.selected ? this.selected.zip : "", + latitude: this.selected ? this.selected.lat : "", + longitude: this.selected ? this.selected.lon : "", + useLocation: switchValue + }; + } + }, { + key: "_initDefaultLocation", + value: function _initDefaultLocation() { + var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var _global$getRssIndex2 = global.getRssIndex(), + latitude = _global$getRssIndex2.latitude, + longitude = _global$getRssIndex2.longitude; + + if (props.latitude && props.longitude) { + latitude = props.latitude; + longitude = props.longitude; + } + + this.selected = { + lat: latitude, + lon: longitude + }; + } + }, { + key: "_initDefaultCity", + value: function _initDefaultCity() { + var item; + return _regenerator.default.async(function _initDefaultCity$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.prev = 0; + + if (!this.selected) { + _context3.next = 6; + break; + } + + _context3.next = 4; + return _regenerator.default.awrap(getClosestCities(this.selected)); + + case 4: + item = _context3.sent[0]; + + if (item !== undefined) { + this.selected = item; + + this._updateInput(item.city + ", " + item.state); + } + + case 6: + _context3.next = 10; + break; + + case 8: + _context3.prev = 8; + _context3.t0 = _context3["catch"](0); + + case 10: + case "end": + return _context3.stop(); + } + } + }, null, this, [[0, 8]], Promise); + } + }, { + key: "_manageLocation", + value: function _manageLocation(enable) { + return _regenerator.default.async(function _manageLocation$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (enable) { + if (this.geolocation === undefined) { + this.geolocation = new (_$$_REQUIRE(_dependencyMap[18]).LocationMgr)(); + } + + this.geolocation.watchPosition(this.onLocationChange); + } else { + this._unWatch(); + } + + case 1: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_onLocationChange", + value: function _onLocationChange(_ref) { + var coords, data; + return _regenerator.default.async(function _onLocationChange$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + coords = _ref.coords; + _context5.prev = 1; + _context5.next = 4; + return _regenerator.default.awrap(this._updateListByLocation(coords)); + + case 4: + data = _context5.sent; + + if (data.length === 0) { + _$$_REQUIRE(_dependencyMap[19]).Toast.show(global.strings("msg_zip_not_found")); + + this._updateSwitch(false); + } else { + this.selected = data[0]; + this.setState({ + input: data[0].city + ", " + data[0].state + }); + } + + _context5.next = 11; + break; + + case 8: + _context5.prev = 8; + _context5.t0 = _context5["catch"](1); + + this._updateSwitch(false); + + case 11: + case "end": + return _context5.stop(); + } + } + }, null, this, [[1, 8]], Promise); + } + }, { + key: "_unWatch", + value: function _unWatch() { + if (this.geolocation && this.geolocation.isWatching()) { + this.geolocation.unWatch(); + } + } + }, { + key: "_updateSwitch", + value: function _updateSwitch(value) { + var onDisableSwitch = this.props.onDisableSwitch; + + if (!value) { + this._initDefaultLocation(this.props); + + this._initDefaultCity(); + + if (typeof onDisableSwitch === "function") { + onDisableSwitch(); + } + } + + this.setState({ + switchValue: value, + data: [] + }); + } + }, { + key: "_updateInput", + value: function _updateInput(text) { + this.setState({ + input: text, + switchValue: false, + data: [] + }); + + this._unWatch(); + } + }, { + key: "_updateListByLocation", + value: function _updateListByLocation(location) { + var _global$getRssIndex3, latitude, longitude, lon, lat; + + return _regenerator.default.async(function _updateListByLocation$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _global$getRssIndex3 = global.getRssIndex(), latitude = _global$getRssIndex3.latitude, longitude = _global$getRssIndex3.longitude; + lon = location ? location.longitude : longitude; + lat = location ? location.latitude : latitude; + return _context6.abrupt("return", getClosestCities({ + lat: lat, + lon: lon + })); + + case 4: + case "end": + return _context6.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_filterData", + value: function _filterData(input) { + var cities; + return _regenerator.default.async(function _filterData$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + _context7.prev = 0; + _context7.next = 3; + return _regenerator.default.awrap(getCities({ + wording: input + })); + + case 3: + cities = _context7.sent; + this.setState({ + data: cities + }); + _context7.next = 9; + break; + + case 7: + _context7.prev = 7; + _context7.t0 = _context7["catch"](0); + + case 9: + case "end": + return _context7.stop(); + } + } + }, null, this, [[0, 7]], Promise); + } + }, { + key: "_toggleModal", + value: function _toggleModal() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + this.setState({ + modal: state + }); + } + }, { + key: "_onTextChange", + value: function _onTextChange(text) { + this._updateInput(text); + + if (text.length > 2) { + this._filterData(text); + } + } + }, { + key: "_onSelectItem", + value: function _onSelectItem(item) { + var onSelect = this.props.onSelect; + this.selected = item; + + this._updateInput(item.city + ", " + item.state); + + if (onSelect) { + onSelect(); + } + + this._toggleModal(false); + } + }, { + key: "_onSwitchChange", + value: function _onSwitchChange(value) { + this._manageLocation(value); + + this._updateSwitch(value); + } + }, { + key: "_onLayout", + value: function _onLayout() { + this.inputWidth = "100%"; + } + }, { + key: "_renderItem", + value: function _renderItem(_ref2) { + var _this2 = this; + + var item = _ref2.item, + index = _ref2.index; + var switchValue = this.state.switchValue; + return _react.default.createElement(_reactNative.TouchableWithoutFeedback, { + key: index, + onPress: function onPress() { + return _this2.onSelectItem(item); + } + }, !switchValue ? _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[20]).styles.listItem] + }, _react.default.createElement(_reactNative.Text, { + style: [_$$_REQUIRE(_dependencyMap[20]).styles.text, _$$_REQUIRE(_dependencyMap[20]).styles.textCity, { + color: _$$_REQUIRE(_dependencyMap[18]).colors.md_black_1000 + }] + }, (item.city || "") + ", " + (item.state || "")), _react.default.createElement(_reactNative.Text, { + style: [_$$_REQUIRE(_dependencyMap[20]).styles.text, _$$_REQUIRE(_dependencyMap[20]).styles.textZip] + }, item.zip)) : _react.default.createElement(_reactNative.View, null)); + } + }, { + key: "_getModal", + value: function _getModal() { + var hint = this.props.hint; + var borderColor = this.borderColor; + var _this$state2 = this.state, + input = _this$state2.input, + data = _this$state2.data; + var modal = this.state.modal; + var inputWidth = this.inputWidth ? this.inputWidth : _deviceUtils.default.screenDimensions.width - _$$_REQUIRE(_dependencyMap[21]).filterStyles.MARGIN * 2; + return _react.default.createElement(_modal.default, { + transparent: true, + visible: modal, + containerStyle: { + padding: 0 + } + }, _react.default.createElement(_reactNative.View, { + style: [{ + width: inputWidth + }] + }, _react.default.createElement(_fontTextInput.default, { + autoFocus: true, + style: [_$$_REQUIRE(_dependencyMap[20]).styles.textInput, _$$_REQUIRE(_dependencyMap[20]).styles.textInputModal, { + borderColor: borderColor, + color: _$$_REQUIRE(_dependencyMap[18]).colors.md_black_1000 + }], + underlineColorAndroid: borderColor, + onChangeText: this.onTextChange, + value: input, + returnKeyType: "search", + placeholder: hint, + placeholderTextColor: _$$_REQUIRE(_dependencyMap[18]).colors.grey + }), data && data.length ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[20]).styles.list + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[22]).TecnaviaFlatList, { + data: data, + renderItem: this.renderItem + })) : null)); + } + }, { + key: "render", + value: function render() { + var borderColor = this.borderColor, + textColor = this.textColor; + var _this$props = this.props, + hint = _this$props.hint, + style = _this$props.style, + onPopulateSelect = _this$props.onPopulateSelect; + var _this$state3 = this.state, + input = _this$state3.input, + switchValue = _this$state3.switchValue, + data = _this$state3.data; + + if (onPopulateSelect) { + onPopulateSelect(data && data.length); + } + + return _react.default.createElement(_reactNative.View, { + style: [{ + flexDirection: "column" + }, style] + }, this._getModal(), _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[20]).styles.parent, { + borderColor: borderColor + }] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[20]).styles.parentMyLocation, { + backgroundColor: borderColor + }] + }, _react.default.createElement(_reactNative.Text, { + style: [_$$_REQUIRE(_dependencyMap[20]).styles.text, _$$_REQUIRE(_dependencyMap[20]).styles.textMyLocation, { + color: textColor + }] + }, global.strings("my_location")), _react.default.createElement(_reactNative.Switch, { + style: _$$_REQUIRE(_dependencyMap[20]).styles.switchMyLocation, + onValueChange: this.onSwitchChange, + value: switchValue, + ios_backgroundColor: _$$_REQUIRE(_dependencyMap[18]).colors.grey200 + })), _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: this.toggleModal + }, _react.default.createElement(_reactNative.View, { + pointerEvents: "none" + }, _react.default.createElement(_fontTextInput.default, { + onLayout: this.onLayout, + style: [_$$_REQUIRE(_dependencyMap[20]).styles.textInput, { + padding: 5, + color: _$$_REQUIRE(_dependencyMap[18]).colors.md_black_1000 + }], + underlineColorAndroid: borderColor, + value: input, + returnKeyType: "search", + placeholder: hint || global.strings("filter_text"), + placeholderTextColor: _$$_REQUIRE(_dependencyMap[18]).colors.grey, + editable: false + }))))); + } + }]); + return FilterLocation; + }(_react.default.Component); + + exports.FilterLocation = FilterLocation; + FilterLocation.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.number]), + textColor: _propTypes.default.string, + borderColor: _propTypes.default.string, + hint: _propTypes.default.string, + onPopulateSelect: _propTypes.default.func, + onSelect: _propTypes.default.func, + latitude: _propTypes.default.string, + longitude: _propTypes.default.string, + useLocation: _propTypes.default.bool, + onDisableSwitch: _propTypes.default.func + }; +},2500,[5,80,7,8,15,12,14,16,6,108,17,201,28,2044,431,458,2257,1882,462,1889,2501,2487,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + flexDirection: "column", + marginTop: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginBottom: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_WIDTH * 2, + marginStart: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginEnd: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + borderWidth: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_WIDTH, + borderRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS + }, + text: { + padding: _$$_REQUIRE(_dependencyMap[1]).filterStyles.TEXT_PADDING + }, + textMyLocation: { + flex: 3 + }, + switchMyLocation: { + marginRight: 20 + }, + parentMyLocation: { + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + flexDirection: "row", + justifyContent: "center", + alignItems: "center" + }, + textCity: { + flex: 3 + }, + textZip: { + flex: 1, + textAlign: "right" + }, + textInput: { + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.white, + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + borderBottomLeftRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS, + borderBottomRightRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS + }, + modal: { + flex: 1, + alignItems: "center", + justifyContent: "center", + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.transparent200 + }, + modalBackground: { + margin: 0 + }, + parentModal: { + flexDirection: "column", + marginTop: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginStart: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginEnd: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN + }, + textInputModal: { + opacity: 1, + margin: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + padding: 5, + borderTopLeftRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS, + borderTopRightRadius: _$$_REQUIRE(_dependencyMap[1]).filterStyles.BORDER_RADIUS + }, + list: { + marginTop: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginBottom: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + padding: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN + }, + listItem: { + flexDirection: "row", + height: _$$_REQUIRE(_dependencyMap[1]).filterStyles.LINE_HEIGHT, + justifyContent: "center", + alignItems: "center" + } + }); + + exports.styles = styles; +},2501,[28,2487,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2502,[2503]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.JobSearchScreen = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var JobSearchScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(JobSearchScreen, _NavigationBaseScreen); + + var _super = _createSuper(JobSearchScreen); + + function JobSearchScreen() { + (0, _classCallCheck2.default)(this, JobSearchScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(JobSearchScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(JobSearchScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getTag", + value: function getTag() { + return "Job Search"; + } + }, { + key: "getBaseSearchString", + value: function getBaseSearchString(_ref) { + var city = _ref.city, + job_status = _ref.job_status, + job_type = _ref.job_type; + var string = ""; + + if (city) { + string += city + " "; + } + + if (job_status) { + string += (0, _$$_REQUIRE(_dependencyMap[12]).getJobDuration)(job_status) + " "; + } + + if (job_type) { + string += "" + (0, _$$_REQUIRE(_dependencyMap[12]).getJobType)(job_type); + } + + return string; + } + }, { + key: "getAdvanceSearchString", + value: function getAdvanceSearchString(_ref2) { + var salary_min = _ref2.salary_min, + salary_max = _ref2.salary_max, + day_published = _ref2.day_published; + var string = ""; + + if (day_published) { + string += "from " + day_published + " "; + } + + if (salary_min && salary_max) { + string += "with salary between " + salary_min + " and " + salary_max; + } else if (salary_min) { + string += "with salary greater than " + salary_min; + } else if (salary_max) { + string += "with salary lower than " + salary_min; + } + + return string; + } + }, { + key: "render", + value: function render() { + var _this = this; + + var navigation = this.props.navigation; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).VerticalSearchesList, { + eventName: _events.default.TOGGLE_JOB_SEARCH, + color: (0, _$$_REQUIRE(_dependencyMap[12]).getJobColor)(), + totalKey: "total_searches", + searchVerticalManager: global.getVerticalsConfig().getJob(), + onItemPress: function onItemPress(item) { + navigation.navigate("VerticalListScreen", { + filters: (0, _extends2.default)({}, item) + }); + }, + renderItem: function renderItem(item) { + var title = item.term || global.strings("all_jobs"); + + var base = _this.getBaseSearchString(item); + + var advance = _this.getAdvanceSearchString(item); + + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.line + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.title, + type: _fontText.Type.bold + }, title), base ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.subtitle, + type: _fontText.Type.medium + }, base) : null, advance ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.subtitle, + type: _fontText.Type.medium + }, advance) : null); + }, + onEmptyPress: function onEmptyPress() { + navigation.navigate("VerticalFiltersScreen"); + } + }); + } + }]); + return JobSearchScreen; + }(_$$_REQUIRE(_dependencyMap[15]).NavigationBaseScreen); + + exports.JobSearchScreen = JobSearchScreen; +},2503,[5,6,7,8,90,12,14,16,17,28,460,1879,2474,2504,2507,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2504,[2505]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.VerticalSearchesList = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var VerticalSearchesList = function (_React$Component) { + (0, _inherits2.default)(VerticalSearchesList, _React$Component); + + var _super = _createSuper(VerticalSearchesList); + + function VerticalSearchesList(props) { + var _this; + + (0, _classCallCheck2.default)(this, VerticalSearchesList); + _this = _super.call(this, props); + _this.state = { + items: [], + loading: true + }; + return _this; + } + + (0, _createClass2.default)(VerticalSearchesList, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var eventName = this.props.eventName; + this.toggleSearch = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(eventName, function () { + _this2._retrieveData(); + }); + + this._retrieveData(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.toggleSearch); + } + }, { + key: "_retrieveData", + value: function _retrieveData() { + var searchVerticalManager, items, defaultSearch, lastSearch, searches; + return _regenerator.default.async(function _retrieveData$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + searchVerticalManager = this.props.searchVerticalManager; + items = []; + defaultSearch = searchVerticalManager.getDefaultSearch(); + + if (defaultSearch) { + items.push({ + title: global.strings("default_search"), + data: [defaultSearch] + }); + } + + lastSearch = searchVerticalManager.getLastSearch(); + + if (lastSearch) { + items.push({ + title: global.strings("last_search"), + data: [lastSearch] + }); + } + + searches = searchVerticalManager.getSearches(); + + if (searches) { + items.push({ + title: global.strings("saved_searches"), + data: searches + }); + } + + this.setState({ + items: items, + loading: false + }); + + case 9: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getEmpty", + value: function _getEmpty() { + var onEmptyPress = this.props.onEmptyPress; + return this._getIconView("surprise", global.strings("msg_empty_searches"), onEmptyPress); + } + }, { + key: "_getIconView", + value: function _getIconView(icon, message, callback) { + var color = this.props.color; + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + if (callback) { + callback(); + } + }, + style: _$$_REQUIRE(_dependencyMap[13]).styles.message + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[13]).styles.message + }, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: icon, + size: 70, + color: color + }), _react.default.createElement(_fontText.default, { + style: [_$$_REQUIRE(_dependencyMap[13]).styles.messageText, { + color: color + }] + }, message))); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + _renderItem = _this$props.renderItem, + color = _this$props.color, + onItemPress = _this$props.onItemPress, + totalKey = _this$props.totalKey; + var _this$state = this.state, + items = _this$state.items, + loading = _this$state.loading; + + if (loading) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ProgressCircle, { + spinnerColor: color + }); + } + + if (!items || !items.length) { + return this._getEmpty(); + } + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "column" + } + }, totalKey ? _react.default.createElement(_reactNative.View, { + style: { + backgroundColor: color, + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + padding: 5 + } + }, _react.default.createElement(_fontText.default, { + style: { + fontSize: 15, + textAlign: "center", + color: _$$_REQUIRE(_dependencyMap[15]).colors.white + } + }, global.strings(totalKey, { + total: items.find(function (el) { + return el.title === global.strings("saved_searches"); + }).data.length + }))) : null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).TecnaviaSectionList, { + style: { + flex: 1 + }, + sections: items, + extraData: items, + keyExtractor: function keyExtractor(item) { + return item.id; + }, + renderItem: function renderItem(_ref) { + var item = _ref.item, + index = _ref.index; + + if (_renderItem) { + return _react.default.createElement(_reactNative.TouchableWithoutFeedback, { + style: { + width: 200 + }, + onPress: function onPress() { + if (onItemPress) { + onItemPress(item); + } + } + }, _renderItem(item, index)); + } + + return null; + }, + renderSectionHeader: function renderSectionHeader(section) { + var title = ""; + + if (section && section.section && section.section.title) { + title = section.section.title; + } + + return _react.default.createElement(_reactNative.View, { + style: { + height: 40, + flexDirection: "row", + justifyContent: "flex-start", + backgroundColor: color + } + }, _react.default.createElement(_reactNative.Text, { + style: { + fontSize: 18, + fontWeight: "bold", + color: _$$_REQUIRE(_dependencyMap[15]).colors.white, + padding: 10 + } + }, title)); + } + })); + } + }]); + return VerticalSearchesList; + }(_react.default.Component); + + exports.VerticalSearchesList = VerticalSearchesList; + VerticalSearchesList.propTypes = { + color: _propTypes.default.string.isRequired, + totalKey: _propTypes.default.string.isRequired, + renderItem: _propTypes.default.func.isRequired, + eventName: _propTypes.default.string.isRequired, + searchVerticalManager: _propTypes.default.shape({ + getSearches: _propTypes.default.func.isRequired, + getLastSearch: _propTypes.default.func + }).isRequired, + onEmptyPress: _propTypes.default.func, + onItemPress: _propTypes.default.func + }; +},2505,[5,80,7,8,12,14,16,17,201,28,1879,1806,572,2506,1953,462,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + message: { + flex: 1, + justifyContent: "center", + alignItems: "center", + flexDirection: "column" + }, + messageText: { + paddingVertical: 20, + paddingHorizontal: 50, + textAlign: "center" + }, + loading: { + position: "absolute", + bottom: 0, + start: 0, + end: 0, + height: 50, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + actionButtonImage: { + height: 20, + width: 20 + }, + actionButtonIcon: { + fontSize: 20, + height: 22, + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.styles = styles; +},2506,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + line: { + flexDirection: "column", + padding: 10, + borderBottomWidth: 0.5, + borderColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + justifyContent: "center" + }, + title: { + fontSize: 20, + flex: 1 + }, + subtitle: { + fontSize: 20, + flex: 1 + } + }); + + exports.styles = styles; +},2507,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2508,[2509]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.JobFavoritesScreen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var JobFavoritesScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(JobFavoritesScreen, _NavigationBaseScreen); + + var _super = _createSuper(JobFavoritesScreen); + + function JobFavoritesScreen() { + (0, _classCallCheck2.default)(this, JobFavoritesScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(JobFavoritesScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(JobFavoritesScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getTag", + value: function getTag() { + return "Job Favorites"; + } + }, { + key: "render", + value: function render() { + var navigation = this.props.navigation; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).VerticalFavoritesList, { + eventName: _events.default.TOGGLE_JOB_FAVORITE, + color: (0, _$$_REQUIRE(_dependencyMap[10]).getJobColor)(), + totalKey: "total_favorites", + searchVerticalManager: global.getVerticalsConfig().getJob(), + renderItem: function renderItem(item) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).JobListItem, { + item: item, + onItemPress: function onItemPress(clicked) { + navigation.navigate("VerticalDetailScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getJobUrlPageById)(clicked.id) + }); + }, + manager: global.getVerticalsConfig().getJob(), + color: (0, _$$_REQUIRE(_dependencyMap[10]).getJobColor)() + }); + }, + onEmptyPress: function onEmptyPress() { + navigation.navigate("VerticalFiltersScreen"); + } + }); + } + }]); + return JobFavoritesScreen; + }(_$$_REQUIRE(_dependencyMap[12]).NavigationBaseScreen); + + exports.JobFavoritesScreen = JobFavoritesScreen; +},2509,[5,7,8,90,12,14,16,17,460,2510,2474,2513,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2510,[2511]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.VerticalFavoritesList = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var VerticalFavoritesList = function (_React$Component) { + (0, _inherits2.default)(VerticalFavoritesList, _React$Component); + + var _super = _createSuper(VerticalFavoritesList); + + function VerticalFavoritesList(props) { + var _this; + + (0, _classCallCheck2.default)(this, VerticalFavoritesList); + _this = _super.call(this, props); + _this.state = { + items: [], + loading: true + }; + return _this; + } + + (0, _createClass2.default)(VerticalFavoritesList, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var eventName = this.props.eventName; + this.toggleFavorite = _$$_REQUIRE(_dependencyMap[12]).EventRegister.on(eventName, function () { + _this2._retrieveData(); + }); + + this._retrieveData(); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[12]).EventRegister.rm(this.toggleFavorite); + } + }, { + key: "_retrieveData", + value: function _retrieveData() { + var searchVerticalManager; + return _regenerator.default.async(function _retrieveData$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + searchVerticalManager = this.props.searchVerticalManager; + this.setState({ + items: searchVerticalManager.getFavorites(), + loading: false + }); + + case 2: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getEmpty", + value: function _getEmpty() { + var onEmptyPress = this.props.onEmptyPress; + return this._getIconView("surprise", global.strings("msg_empty_favorites"), onEmptyPress); + } + }, { + key: "_getIconView", + value: function _getIconView(icon, message, callback) { + var color = this.props.color; + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + if (callback) { + callback(); + } + }, + style: _$$_REQUIRE(_dependencyMap[13]).styles.message + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[13]).styles.message + }, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: icon, + size: 70, + color: color + }), _react.default.createElement(_fontText.default, { + style: [_$$_REQUIRE(_dependencyMap[13]).styles.messageText, { + color: color + }] + }, message))); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + _renderItem = _this$props.renderItem, + color = _this$props.color, + onItemPress = _this$props.onItemPress, + totalKey = _this$props.totalKey; + var itemKey = this.props.itemKey; + var _this$state = this.state, + items = _this$state.items, + loading = _this$state.loading; + + if (!itemKey) { + itemKey = "id"; + } + + if (loading) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ProgressCircle, { + spinnerColor: color + }); + } + + if (!items || !items.length) { + return this._getEmpty(); + } + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "column" + } + }, totalKey ? _react.default.createElement(_reactNative.View, { + style: { + backgroundColor: color, + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + padding: 5 + } + }, _react.default.createElement(_fontText.default, { + style: { + fontSize: 15, + textAlign: "center", + color: _$$_REQUIRE(_dependencyMap[15]).colors.white + } + }, global.strings(totalKey, { + total: items.length + }))) : null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).TecnaviaFlatList, { + style: { + flex: 1 + }, + data: items, + extraData: this.state, + keyExtractor: function keyExtractor(item) { + return item[itemKey]; + }, + renderItem: function renderItem(_ref) { + var item = _ref.item, + index = _ref.index; + + if (_renderItem) { + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + if (onItemPress) { + onItemPress(item); + } + } + }, _renderItem(item, index)); + } + + return null; + } + })); + } + }]); + return VerticalFavoritesList; + }(_react.default.Component); + + exports.VerticalFavoritesList = VerticalFavoritesList; + VerticalFavoritesList.propTypes = { + color: _propTypes.default.string.isRequired, + totalKey: _propTypes.default.string.isRequired, + renderItem: _propTypes.default.func.isRequired, + eventName: _propTypes.default.string.isRequired, + onEmptyPress: _propTypes.default.func, + onItemPress: _propTypes.default.func.isRequired, + searchVerticalManager: _propTypes.default.shape({ + getFavorites: _propTypes.default.func.isRequired + }).isRequired, + itemKey: _propTypes.default.string + }; +},2511,[5,80,7,8,12,14,16,17,201,28,1879,1806,572,2512,1953,462,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + message: { + flex: 1, + justifyContent: "center", + alignItems: "center", + flexDirection: "column" + }, + messageText: { + paddingVertical: 20, + paddingHorizontal: 50, + textAlign: "center" + }, + loading: { + position: "absolute", + bottom: 0, + start: 0, + end: 0, + height: 50, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + actionButtonImage: { + height: 20, + width: 20 + }, + actionButtonIcon: { + fontSize: 20, + height: 22, + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.styles = styles; +},2512,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.JobListItem = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _reactNativeShare = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _iconTile = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var JobListItem = function (_React$Component) { + (0, _inherits2.default)(JobListItem, _React$Component); + + var _super = _createSuper(JobListItem); + + function JobListItem() { + (0, _classCallCheck2.default)(this, JobListItem); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(JobListItem, [{ + key: "shouldComponentUpdate", + value: function shouldComponentUpdate() { + return false; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + item = _this$props.item, + manager = _this$props.manager, + color = _this$props.color, + onItemPress = _this$props.onItemPress; + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + if (onItemPress) { + onItemPress(item); + } + } + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.line + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.header + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.title, + type: _fontText.Type.bold + }, item.heading), _react.default.createElement(_iconTile.default, { + parentStyle: { + position: "relative", + top: 0 + }, + icons: [{ + title: global.strings("action_share"), + component: function component(style) { + return _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS, + name: "share", + style: style + }); + }, + onPress: function onPress(clicked) { + var shareOptions = { + url: (0, _$$_REQUIRE(_dependencyMap[15]).getJobUrlPageById)(clicked.item.id), + message: clicked.item.heading + }; + + _reactNativeShare.default.open(shareOptions); + } + }, { + title: !manager.favoriteIsStored(item) ? global.strings("action_save_for_later") : global.strings("action_remove_from_favorites"), + component: function component(style) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).IconFavorite, { + item: item, + size: 20, + style: style, + eventToggleItemChecker: function eventToggleItemChecker(currentItem, params) { + return currentItem.id === params.id; + }, + toggleFavoritesEventName: _events.default.TOGGLE_JOB_FAVORITE, + isFavoriteChecker: function isFavoriteChecker(toCheck) { + return manager.favoriteIsStored(toCheck); + } + }); + }, + onPress: function onPress(clicked) { + manager.toggleFavorite(clicked); + } + }], + tintColor: color, + item: item, + availableSpace: _$$_REQUIRE(_dependencyMap[17]).PlatformUtils.isTablet() ? 2 : 1, + border: true + })), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.subline + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.make, + type: _fontText.Type.medium + }, item.make), item.dateentered ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.date, + type: _fontText.Type.medium + }, _$$_REQUIRE(_dependencyMap[17]).DateUtils.getMomentDate(item.dateentered, "MM/DD/YYYY").fromNow()) : null), _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.description + }, item.description), _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[14]).styles.salary, + type: _fontText.Type.medium + }, item.price ? global.strings("salary", { + salary: item.price + }) : global.strings("unknown_salary")))); + } + }]); + return JobListItem; + }(_react.default.Component); + + exports.JobListItem = JobListItem; + JobListItem.propTypes = { + item: _propTypes.default.shape({ + heading: _propTypes.default.string, + subline: _propTypes.default.string, + make: _propTypes.default.string, + description: _propTypes.default.string, + dateentered: _propTypes.default.string, + price: _propTypes.default.number + }).isRequired, + manager: _propTypes.default.shape({ + favoriteIsStored: _propTypes.default.func.isRequired, + toggleFavorite: _propTypes.default.func.isRequired + }).isRequired, + onItemPress: _propTypes.default.func, + color: _propTypes.default.string.isRequired + }; +},2513,[5,7,8,12,14,16,17,201,28,575,1879,2093,460,1806,2514,2474,1969,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + header: { + flexDirection: "row" + }, + line: { + flexDirection: "column", + padding: 10, + borderBottomWidth: 0.5, + borderBottomColor: _$$_REQUIRE(_dependencyMap[1]).colors.black + }, + title: { + flex: 1, + fontSize: 20 + }, + subline: { + flexDirection: "row", + paddingTop: 10, + paddingBottom: 10 + }, + make: { + flex: 1, + fontSize: 16 + }, + salary: { + flex: 1, + fontSize: 16, + paddingVertical: 10 + }, + date: { + textAlign: "right", + fontSize: 16 + }, + description: { + flex: 2, + textAlign: "justify" + }, + icon: { + height: 30, + width: 30, + marginStart: 5, + marginEnd: 5 + } + }); + + exports.styles = styles; +},2514,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2515,[2516]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.JobListScreen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var JobListScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(JobListScreen, _NavigationBaseScreen); + + var _super = _createSuper(JobListScreen); + + function JobListScreen() { + (0, _classCallCheck2.default)(this, JobListScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(JobListScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(JobListScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getTag", + value: function getTag() { + return "Job List"; + } + }, { + key: "keyExtractor", + value: function keyExtractor(item, index) { + return item.id; + } + }, { + key: "render", + value: function render() { + var navigation = this.props.navigation; + + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[9]).getNavigationParams)(this.props), + _getNavigationParams$ = _getNavigationParams.filters, + filters = _getNavigationParams$ === undefined ? { + action: "jobs", + view: "filtered" + } : _getNavigationParams$; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).VerticalList, { + color: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)(), + api: _Api.default.baseUrl(), + totalKey: "total_jobs", + params: filters, + normalizeResults: function normalizeResults(res) { + return res.result; + }, + keyExtractor: this.keyExtractor, + getFilterNames: function getFilterNames(rows, sort, currentPage) { + return { + rows: rows, + sort: sort, + start: currentPage + }; + }, + searchVerticalManager: global.getVerticalsConfig().getJob(), + renderItem: function renderItem(_ref) { + var item = _ref.item; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).JobListItem, { + item: item, + onItemPress: function onItemPress(clicked) { + var url = clicked.url || (0, _$$_REQUIRE(_dependencyMap[11]).getJobUrlPageById)(clicked.id); + navigation.navigate("VerticalDetailScreen", { + url: url + }); + }, + manager: global.getVerticalsConfig().getJob(), + color: (0, _$$_REQUIRE(_dependencyMap[11]).getJobColor)() + }); + }, + onErrorPress: function onErrorPress() { + navigation.navigate("VerticalFiltersScreen"); + }, + onEmptyPress: function onEmptyPress() { + navigation.navigate("VerticalFiltersScreen"); + } + }); + } + }]); + return JobListScreen; + }(_$$_REQUIRE(_dependencyMap[9]).NavigationBaseScreen); + + exports.JobListScreen = JobListScreen; +},2516,[5,7,8,90,12,14,16,17,431,2148,2517,2474,2513]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2517,[2518]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.VerticalList = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[11]); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _emptyComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _loadingMoreComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[17])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var VerticalList = function (_React$Component) { + (0, _inherits2.default)(VerticalList, _React$Component); + + var _super = _createSuper(VerticalList); + + function VerticalList(props) { + var _this; + + (0, _classCallCheck2.default)(this, VerticalList); + _this = _super.call(this, props); + _this.state = { + items: [], + firstLoading: true, + error: false, + errors: [], + mapVisible: props.startupComponent === VerticalList.Startup.map && props.map.enable + }; + _this.loadingMore = false; + _this.currentRadius = props.radius.start; + _this.currentPage = 1; + _this.totalPages = 1; + _this.sortValue = props.order.defaultSort; + _this.disableLoadMore = false; + _this.handleLoadMore = _this._handleLoadMore.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(VerticalList, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.firstLoad(); + } + }, { + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(nextProps) { + var params = this.props.params; + var newParams = nextProps.params; + + if (!_$$_REQUIRE(_dependencyMap[18]).JSUtils.equals(params, newParams)) { + this._update(); + } + } + }, { + key: "componentDidUpdate", + value: function componentDidUpdate(prevProps) { + var prevRadius = prevProps.radius, + prevOrder = prevProps.order; + var _this$props = this.props, + radius = _this$props.radius, + order = _this$props.order; + + if (prevRadius.start !== radius.start || prevOrder.defaultSort !== order.defaultSort) { + this._update(); + } + } + }, { + key: "_update", + value: function _update() { + var _this2 = this; + + this.setState({ + items: [], + firstLoading: true, + error: false, + errors: [] + }, function () { + var radius = _this2.props.radius; + _this2.currentRadius = radius.start; + _this2.currentPage = 1; + _this2.totalPages = 1; + + _this2.firstLoad(); + }); + } + }, { + key: "doAjaxCall", + value: function doAjaxCall(params) { + var _this$props2, api, config, normalizeResults, skipDefaultParams, uri, newParams, ajaxResult; + + return _regenerator.default.async(function doAjaxCall$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _this$props2 = this.props, api = _this$props2.api, config = _this$props2.config, normalizeResults = _this$props2.normalizeResults, skipDefaultParams = _this$props2.skipDefaultParams; + uri = _$$_REQUIRE(_dependencyMap[18]).StringUtils.segmentUrl(api); + newParams = (0, _extends2.default)({}, params, uri.getParams); + newParams = Object.keys(newParams).reduce(function (result, key) { + var param = newParams[key]; + + if (Array.isArray(param)) { + if (param.length) { + result[key] = param; + } + } else if (typeof param === "string") { + if (param.length) { + result[key] = param; + } + } else if (param !== undefined && !Number.isNaN(param)) { + result[key] = param; + } + + return result; + }, {}); + _context.prev = 4; + _context.next = 7; + return _regenerator.default.awrap(_Api.default.get(uri.baseUrl, config, newParams, skipDefaultParams)); + + case 7: + ajaxResult = _context.sent; + return _context.abrupt("return", normalizeResults(ajaxResult.data)); + + case 11: + _context.prev = 11; + _context.t0 = _context["catch"](4); + throw _context.t0; + + case 14: + case "end": + return _context.stop(); + } + } + }, null, this, [[4, 11]], Promise); + } + }, { + key: "firstLoad", + value: function firstLoad() { + var _this$props3, params, rows, radius, serverSidePaging, getFilterNames, currentPage, sortValue, filter, _await$this$doAjaxCal, total, page, pages, items; + + return _regenerator.default.async(function firstLoad$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _this$props3 = this.props, params = _this$props3.params, rows = _this$props3.rows, radius = _this$props3.radius, serverSidePaging = _this$props3.serverSidePaging, getFilterNames = _this$props3.getFilterNames; + currentPage = this.currentPage, sortValue = this.sortValue; + filter = (0, _extends2.default)({}, params, getFilterNames(rows, sortValue, currentPage)); + + if (radius.enable) { + filter.radius = this.currentRadius; + } + + _context2.prev = 4; + + case 5: + _context2.next = 7; + return _regenerator.default.awrap(this.doAjaxCall(filter)); + + case 7: + _await$this$doAjaxCal = _context2.sent; + total = _await$this$doAjaxCal.total; + page = _await$this$doAjaxCal.page; + pages = _await$this$doAjaxCal.pages; + items = _await$this$doAjaxCal.items; + + if (!((total === 0 || items.length === 0) && radius.enable)) { + _context2.next = 16; + break; + } + + this.currentRadius *= 2; + _context2.next = 21; + break; + + case 16: + if (!serverSidePaging) { + this.total = items.length || 0; + } else { + this.total = total || 0; + } + + this.currentPage = page || this.currentPage; + this.totalPages = pages || this.totalPages; + this.setState({ + items: items || [], + firstLoading: false, + error: false, + errors: [] + }); + return _context2.abrupt("break", 22); + + case 21: + if (this.currentRadius < radius.max) { + _context2.next = 5; + break; + } + + case 22: + _context2.next = 27; + break; + + case 24: + _context2.prev = 24; + _context2.t0 = _context2["catch"](4); + this.setState({ + firstLoading: false, + error: true + }); + + case 27: + case "end": + return _context2.stop(); + } + } + }, null, this, [[4, 24]], Promise); + } + }, { + key: "_handleLoadMore", + value: function _handleLoadMore() { + var _this$props4, params, rows, radius, getFilterNames, serverSidePaging, enableInfiniteScroll, items, currentPage, totalPages, sortValue, filter, _await$this$doAjaxCal2, results, page; + + return _regenerator.default.async(function _handleLoadMore$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _this$props4 = this.props, params = _this$props4.params, rows = _this$props4.rows, radius = _this$props4.radius, getFilterNames = _this$props4.getFilterNames, serverSidePaging = _this$props4.serverSidePaging, enableInfiniteScroll = _this$props4.enableInfiniteScroll; + items = this.state.items; + currentPage = this.currentPage, totalPages = this.totalPages, sortValue = this.sortValue; + + if (!(enableInfiniteScroll && !this.loadingMore && (serverSidePaging && currentPage < totalPages || !serverSidePaging && !this.disableLoadMore))) { + _context3.next = 22; + break; + } + + this.loadingMore = true; + this.loadingRef.show(); + filter = (0, _extends2.default)({}, params, getFilterNames(rows, sortValue, currentPage + 1)); + + if (radius.enable) { + filter.radius = this.currentRadius; + } + + _context3.prev = 8; + _context3.next = 11; + return _regenerator.default.awrap(this.doAjaxCall(filter)); + + case 11: + _await$this$doAjaxCal2 = _context3.sent; + results = _await$this$doAjaxCal2.items; + page = _await$this$doAjaxCal2.page; + + if (results) { + this.disableLoadMore = results.length < rows; + + if (!serverSidePaging) { + this.total += results.length; + } + + this.currentPage = page || this.currentPage + 1; + this.setState({ + items: items.concat(results), + errors: [] + }); + } else { + this.disableLoadMore = true; + this.setState({ + errors: [] + }); + } + + _context3.next = 20; + break; + + case 17: + _context3.prev = 17; + _context3.t0 = _context3["catch"](8); + this.setState({ + errors: [global.strings("error_on_load_more")] + }); + + case 20: + this.loadingMore = false; + this.loadingRef.hide(); + + case 22: + case "end": + return _context3.stop(); + } + } + }, null, this, [[8, 17]], Promise); + } + }, { + key: "_getError", + value: function _getError() { + var onErrorPress = this.props.onErrorPress; + return this._getIconView("frown", global.strings("msg_error_list"), onErrorPress); + } + }, { + key: "_getEmpty", + value: function _getEmpty() { + var onEmptyPress = this.props.onEmptyPress; + return this._getIconView("surprise", global.strings("msg_empty_list"), onEmptyPress); + } + }, { + key: "_getIconView", + value: function _getIconView(icon, message, callback) { + var color = this.props.color; + return _react.default.createElement(_emptyComponent.default, { + onPress: callback, + iconName: icon, + message: message, + color: color + }); + } + }, { + key: "_getActions", + value: function _getActions() { + var _this3 = this; + + var _this$props5 = this.props, + params = _this$props5.params, + color = _this$props5.color, + map = _this$props5.map, + order = _this$props5.order, + searchVerticalManager = _this$props5.searchVerticalManager; + var _this$state = this.state, + mapVisible = _this$state.mapVisible, + height = _this$state.height; + var actions = []; + + if (order.items) { + order.items.forEach(function (orderButtons) { + actions.push({ + values: orderButtons.map(function (_ref) { + var param = _ref.param, + source = _ref.source, + label = _ref.label, + Component = _ref.Component, + ActiveComponent = _ref.ActiveComponent; + return { + value: param, + Component: Component || _react.default.createElement(_imageComponent.default, { + source: source, + style: [_$$_REQUIRE(_dependencyMap[19]).styles.actionButtonImage, { + tintColor: _$$_REQUIRE(_dependencyMap[18]).colors.white + }], + resizeMode: "contain" + }), + ActiveComponent: ActiveComponent || _react.default.createElement(_imageComponent.default, { + source: source, + style: [_$$_REQUIRE(_dependencyMap[19]).styles.actionButtonImage, { + tintColor: _$$_REQUIRE(_dependencyMap[18]).colors.white + }], + resizeMode: "contain" + }), + title: label, + isActive: param === _this3.sortValue + }; + }), + current: _this3.sortValue, + callback: function callback(value) { + _this3.sortValue = value; + + _this3._update(); + } + }); + }); + } + + if (map.enable) { + actions.push({ + values: [{ + value: false, + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "list-ul", + style: _$$_REQUIRE(_dependencyMap[19]).styles.actionButtonIcon + }), + title: global.strings("toggle_list") + }, { + value: true, + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "map", + style: _$$_REQUIRE(_dependencyMap[19]).styles.actionButtonIcon + }), + title: global.strings("toggle_map") + }], + current: mapVisible, + callback: function callback(value) { + _this3.setState({ + mapVisible: value + }); + } + }); + } + + if (searchVerticalManager) { + actions.push({ + values: [{ + value: false, + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "bookmark", + style: _$$_REQUIRE(_dependencyMap[19]).styles.actionButtonIcon, + solid: true + }), + title: global.strings("unsave_search") + }, { + value: true, + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "bookmark", + style: _$$_REQUIRE(_dependencyMap[19]).styles.actionButtonIcon + }), + title: global.strings("save_search") + }], + current: searchVerticalManager.searchIsStored(params), + callback: function callback() { + searchVerticalManager.toggleSearch(params); + } + }); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).ActionButtonList, { + color: color, + buttons: actions, + availableHeight: height, + bgColor: _$$_REQUIRE(_dependencyMap[18]).colors.transparent200 + }); + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props6 = this.props, + renderItem = _this$props6.renderItem, + color = _this$props6.color, + totalKey = _this$props6.totalKey, + map = _this$props6.map, + _keyExtractor = _this$props6.keyExtractor, + getSections = _this$props6.getSections, + renderSectionHeader = _this$props6.renderSectionHeader; + var _this$state2 = this.state, + error = _this$state2.error, + errors = _this$state2.errors, + firstLoading = _this$state2.firstLoading, + mapVisible = _this$state2.mapVisible, + items = _this$state2.items; + + if (firstLoading) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).ProgressCircle, { + spinnerColor: color + }); + } + + if (error) { + return this._getError(); + } + + if (!items || !items.length) { + return this._getEmpty(); + } + + var sectionItems = getSections(items, this.sortValue); + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "column" + }, + onLayout: function onLayout(event) { + var height = event.nativeEvent.layout.height; + + _this4.setState({ + height: height + }); + } + }, this.total && totalKey ? _react.default.createElement(_reactNative.View, { + style: { + backgroundColor: color, + flexDirection: "row", + justifyContent: "center", + alignItems: "center" + } + }, _react.default.createElement(_fontText.default, { + style: { + fontSize: 15, + textAlign: "center", + color: _$$_REQUIRE(_dependencyMap[18]).colors.white + }, + type: _fontText.Type.medium + }, global.strings(totalKey, { + total: this.total + }))) : null, mapVisible ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[22]).VerticalMap, (0, _extends2.default)({ + style: { + flex: 1 + }, + data: items + }, map)) : _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).TecnaviaSectionList, { + removeClippedSubviews: true, + sections: sectionItems, + stickySectionHeadersEnabled: true, + extraData: this.state, + keyExtractor: function keyExtractor(item, index) { + if (typeof _keyExtractor === "function") { + return _keyExtractor(item, index); + } + + return "" + index; + }, + renderSectionHeader: renderSectionHeader, + renderItem: renderItem, + onEndReached: this.handleLoadMore, + onEndReachedThreshold: 3 + }), this._getActions(), errors ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Error, { + style: { + position: "absolute", + bottom: 0, + start: 0, + end: 0 + }, + errors: errors, + autoHide: true + }) : null, _react.default.createElement(_loadingMoreComponent.default, { + ref: function ref(_ref2) { + _this4.loadingRef = _ref2; + }, + style: _$$_REQUIRE(_dependencyMap[19]).styles.loading, + color: color + })); + } + }]); + return VerticalList; + }(_react.default.Component); + + exports.VerticalList = VerticalList; + VerticalList.Startup = { + list: "list", + map: "map" + }; + VerticalList.propTypes = { + color: _propTypes.default.string.isRequired, + api: _propTypes.default.string.isRequired, + config: _propTypes.default.object, + params: _propTypes.default.object.isRequired, + getSections: _propTypes.default.func, + renderSectionHeader: _propTypes.default.func, + normalizeResults: _propTypes.default.func.isRequired, + serverSidePaging: _propTypes.default.bool, + skipDefaultParams: _propTypes.default.bool, + getFilterNames: _propTypes.default.func.isRequired, + keyExtractor: _propTypes.default.func, + totalKey: _propTypes.default.string, + rows: _propTypes.default.number, + radius: _propTypes.default.shape({ + enable: _propTypes.default.bool, + max: _propTypes.default.number, + start: _propTypes.default.number + }), + startupComponent: _propTypes.default.oneOf([VerticalList.Startup.list, VerticalList.Startup.map]), + map: _propTypes.default.shape({ + enable: _propTypes.default.bool, + renderItem: _propTypes.default.func, + renderCallout: _propTypes.default.func, + itemKey: _propTypes.default.func, + latitudeKey: _propTypes.default.string, + longitudeKey: _propTypes.default.string, + titleKey: _propTypes.default.string, + getMarkerIcon: _propTypes.default.func, + onItemPress: _propTypes.default.func.isRequired + }), + enableInfiniteScroll: _propTypes.default.bool, + order: _propTypes.default.shape({ + items: _propTypes.default.arrayOf(_propTypes.default.arrayOf(_propTypes.default.shape({ + label: _propTypes.default.string, + Component: _propTypes.default.node, + param: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]), + source: _propTypes.default.any + }))), + defaultSort: _propTypes.default.string + }), + renderItem: _propTypes.default.func.isRequired, + onErrorPress: _propTypes.default.func, + onEmptyPress: _propTypes.default.func, + searchVerticalManager: _propTypes.default.shape({ + searchIsStored: _propTypes.default.func.isRequired, + toggleSearch: _propTypes.default.func.isRequired + }), + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]) + }; + VerticalList.defaultProps = { + rows: 25, + radius: { + enable: false, + start: 5, + max: 32 + }, + startupComponent: VerticalList.Startup.list, + map: { + enable: false + }, + enableInfiniteScroll: true, + order: { + items: [], + defaultSort: "" + }, + config: {}, + serverSidePaging: true, + skipDefaultParams: false, + getSections: function getSections(items) { + return [{ + title: "", + data: items || [] + }]; + }, + renderSectionHeader: function renderSectionHeader() { + return null; + } + }; +},2518,[5,80,6,7,8,15,12,14,16,17,201,28,431,1879,2220,2519,588,1806,462,2520,2521,1953,2526,1910,2171]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var LoadingMore = function (_React$Component) { + (0, _inherits2.default)(LoadingMore, _React$Component); + + var _super = _createSuper(LoadingMore); + + function LoadingMore(props) { + var _this; + + (0, _classCallCheck2.default)(this, LoadingMore); + _this = _super.call(this, props); + _this.state = { + visible: props.visible + }; + return _this; + } + + (0, _createClass2.default)(LoadingMore, [{ + key: "show", + value: function show() { + this.setState({ + visible: true + }); + } + }, { + key: "hide", + value: function hide() { + this.setState({ + visible: false + }); + } + }, { + key: "render", + value: function render() { + var visible = this.state.visible; + var _this$props = this.props, + color = _this$props.color, + style = _this$props.style; + + if (visible) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[8]).ProgressCircle, { + parentStyle: style, + text: global.strings("msg_loading_more"), + showText: true, + spinnerColor: color + }); + } + + return null; + } + }]); + return LoadingMore; + }(_react.default.Component); + + exports.default = LoadingMore; + LoadingMore.propTypes = { + visible: _propTypes.default.bool, + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object, _propTypes.default.array]), + color: _propTypes.default.string + }; + LoadingMore.defaultProps = { + visible: false + }; +},2519,[5,7,8,12,14,16,17,201,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + loading: { + position: "absolute", + bottom: 0, + start: 0, + end: 0, + height: 50, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.white + }, + actionButtonImage: { + height: 20, + width: 20 + }, + actionButtonIcon: { + fontSize: 20, + height: 22, + color: _$$_REQUIRE(_dependencyMap[1]).colors.white + } + }); + + exports.styles = styles; +},2520,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2521,[2522]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ActionButtonList = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNativeActionButton = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SPACING_TO_SIZE_RATIO = 4; + var MINIMUM_BUTTON_SIZE = 30; + var MAXIMUM_BUTTON_SIZE = 56; + var OFFSET_Y = 30; + + var ActionButtonList = function (_React$Component) { + (0, _inherits2.default)(ActionButtonList, _React$Component); + + var _super = _createSuper(ActionButtonList); + + function ActionButtonList() { + (0, _classCallCheck2.default)(this, ActionButtonList); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(ActionButtonList, [{ + key: "render", + value: function render() { + var _this = this; + + var _this$props = this.props, + availableHeight = _this$props.availableHeight, + offsetY = _this$props.offsetY, + rest = (0, _objectWithoutProperties2.default)(_this$props, ["availableHeight", "offsetY"]); + var _this$props2 = this.props, + buttons = _this$props2.buttons, + color = _this$props2.color; + + if (buttons && buttons.length) { + var size = Math.max(Math.min((availableHeight - offsetY * 2) / ((1 + buttons.length) * 1.25), MAXIMUM_BUTTON_SIZE), MINIMUM_BUTTON_SIZE); + var spacing = size / SPACING_TO_SIZE_RATIO; + return _react.default.createElement(_reactNativeActionButton.default, (0, _extends2.default)({ + buttonColor: color, + spacing: spacing, + size: size, + offsetY: offsetY + }, rest), buttons.map(function (item, key) { + var index = item.values.findIndex(function (_ref) { + var value = _ref.value; + return value === item.current; + }); + var button = item.values[index]; + var nextButton = index + 1 === item.values.length ? item.values[0] : item.values[index + 1]; + var title = nextButton.title, + Component = nextButton.Component, + ActiveComponent = nextButton.ActiveComponent, + isActive = nextButton.isActive; + return _react.default.createElement(_reactNativeActionButton.default.Item, { + size: size, + key: key, + buttonColor: isActive ? _$$_REQUIRE(_dependencyMap[11]).colors.md_white_1000 : color, + title: title, + onPress: function onPress() { + if (item.callback) { + item.callback(nextButton.value); + } + + if (nextButton) { + item.current = nextButton.value; + + _this.forceUpdate(); + } + } + }, isActive ? ActiveComponent : Component); + })); + } + + return null; + } + }]); + return ActionButtonList; + }(_react.default.Component); + + exports.ActionButtonList = ActionButtonList; + ActionButtonList.propTypes = (0, _extends2.default)({ + buttons: _propTypes.default.arrayOf(_propTypes.default.shape({ + values: _propTypes.default.arrayOf(_propTypes.default.shape({ + Component: _propTypes.default.node.isRequired, + title: _propTypes.default.string.isRequired, + value: _propTypes.default.any + })), + callback: _propTypes.default.func.isRequired, + current: _propTypes.default.any + })), + color: _propTypes.default.string.isRequired, + availableHeight: _propTypes.default.number, + offsetY: _propTypes.default.number + }, _reactNativeActionButton.ActionButtonProperties); + ActionButtonList.defaultProps = { + offsetY: OFFSET_Y, + availableHeight: 0 + }; +},2522,[5,6,108,7,8,12,14,16,17,201,2523,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _ActionButtonItem = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ActionButton = function (_Component) { + (0, _inherits2.default)(ActionButton, _Component); + + var _super = _createSuper(ActionButton); + + function ActionButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, ActionButton); + _this = _super.call(this, props); + _this.state = { + resetToken: props.resetToken, + active: props.active + }; + _this.anim = new _reactNative.Animated.Value(props.active ? 1 : 0); + _this.timeout = null; + return _this; + } + + (0, _createClass2.default)(ActionButton, [{ + key: "componentDidMount", + value: function componentDidMount() { + this.mounted = true; + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.mounted = false; + clearTimeout(this.timeout); + } + }, { + key: "componentWillReceiveProps", + value: function componentWillReceiveProps(nextProps) { + var _this2 = this; + + if (nextProps.resetToken !== this.state.resetToken) { + if (nextProps.active === false && this.state.active === true) { + if (this.props.onReset) this.props.onReset(); + + _reactNative.Animated.spring(this.anim, { + toValue: 0 + }).start(); + + setTimeout(function () { + return _this2.setState({ + active: false, + resetToken: nextProps.resetToken + }); + }, 250); + return; + } + + if (nextProps.active === true && this.state.active === false) { + _reactNative.Animated.spring(this.anim, { + toValue: 1 + }).start(); + + this.setState({ + active: true, + resetToken: nextProps.resetToken + }); + return; + } + + this.setState({ + resetToken: nextProps.resetToken, + active: nextProps.active + }); + } + } + }, { + key: "getOrientation", + value: function getOrientation() { + return { + alignItems: _$$_REQUIRE(_dependencyMap[11]).alignItemsMap[this.props.position] + }; + } + }, { + key: "getOffsetXY", + value: function getOffsetXY() { + return { + paddingVertical: this.props.offsetY + }; + } + }, { + key: "getOverlayStyles", + value: function getOverlayStyles() { + return [styles.overlay, { + elevation: this.props.elevation, + zIndex: this.props.zIndex, + justifyContent: this.props.verticalOrientation === "up" ? "flex-end" : "flex-start" + }]; + } + }, { + key: "render", + value: function render() { + return _react.default.createElement(_reactNative.View, { + pointerEvents: "box-none", + style: [this.getOverlayStyles(), this.props.style] + }, _react.default.createElement(_reactNative.Animated.View, { + pointerEvents: "none", + style: [this.getOverlayStyles(), { + backgroundColor: this.props.bgColor, + opacity: this.anim.interpolate({ + inputRange: [0, 1], + outputRange: [0, this.props.bgOpacity] + }) + }] + }, this.props.backdrop), _react.default.createElement(_reactNative.View, { + pointerEvents: "box-none", + style: [this.getOverlayStyles(), this.getOrientation(), this.getOffsetXY()] + }, this.state.active && !this.props.backgroundTappable && this._renderTappableBackground(), this.props.verticalOrientation === "up" && this.props.children && this._renderActions(), this._renderMainButton(), this.props.verticalOrientation === "down" && this.props.children && this._renderActions())); + } + }, { + key: "_renderMainButton", + value: function _renderMainButton() { + var _this3 = this; + + var animatedViewStyle = { + transform: [{ + scale: this.anim.interpolate({ + inputRange: [0, 1], + outputRange: [1, this.props.outRangeScale] + }) + }, { + rotate: this.anim.interpolate({ + inputRange: [0, 1], + outputRange: ["0deg", this.props.degrees + "deg"] + }) + }] + }; + var wrapperStyle = { + backgroundColor: this.anim.interpolate({ + inputRange: [0, 1], + outputRange: [this.props.buttonColor, this.props.btnOutRange || this.props.buttonColor] + }), + width: this.props.size, + height: this.props.size, + borderRadius: this.props.size / 2 + }; + var buttonStyle = { + width: this.props.size, + height: this.props.size, + borderRadius: this.props.size / 2, + alignItems: "center", + justifyContent: "center" + }; + var Touchable = (0, _$$_REQUIRE(_dependencyMap[11]).getTouchableComponent)(this.props.useNativeFeedback); + var parentStyle = _$$_REQUIRE(_dependencyMap[11]).isAndroid && this.props.fixNativeFeedbackRadius ? { + right: this.props.offsetX, + zIndex: this.props.zIndex, + borderRadius: this.props.size / 2, + width: this.props.size + } : { + marginHorizontal: this.props.offsetX, + zIndex: this.props.zIndex + }; + return _react.default.createElement(_reactNative.View, { + style: [parentStyle, !this.props.hideShadow && _$$_REQUIRE(_dependencyMap[11]).shadowStyle, !this.props.hideShadow && this.props.shadowStyle] + }, _react.default.createElement(Touchable, { + testID: this.props.testID, + accessible: this.props.accessible, + accessibilityLabel: this.props.accessibilityLabel, + background: (0, _$$_REQUIRE(_dependencyMap[11]).touchableBackground)(this.props.nativeFeedbackRippleColor, this.props.fixNativeFeedbackRadius), + activeOpacity: this.props.activeOpacity, + onLongPress: this.props.onLongPress, + onPress: function onPress() { + _this3.props.onPress(); + + if (_this3.props.children) _this3.animateButton(); + }, + onPressIn: this.props.onPressIn, + onPressOut: this.props.onPressOut + }, _react.default.createElement(_reactNative.Animated.View, { + style: wrapperStyle + }, _react.default.createElement(_reactNative.Animated.View, { + style: [buttonStyle, animatedViewStyle] + }, this._renderButtonIcon())))); + } + }, { + key: "_renderButtonIcon", + value: function _renderButtonIcon() { + var _this$props = this.props, + icon = _this$props.icon, + renderIcon = _this$props.renderIcon, + btnOutRangeTxt = _this$props.btnOutRangeTxt, + buttonTextStyle = _this$props.buttonTextStyle, + buttonText = _this$props.buttonText; + if (renderIcon) return renderIcon(this.state.active); + + if (icon) { + console.warn('react-native-action-button: The `icon` prop is deprecated! Use `renderIcon` instead.'); + return icon; + } + + var textColor = buttonTextStyle.color || "rgba(255,255,255,1)"; + return _react.default.createElement(_reactNative.Animated.Text, { + style: [styles.btnText, buttonTextStyle, { + color: this.anim.interpolate({ + inputRange: [0, 1], + outputRange: [textColor, btnOutRangeTxt || textColor] + }) + }] + }, buttonText); + } + }, { + key: "_renderActions", + value: function _renderActions() { + var _this4 = this; + + var _this$props2 = this.props, + children = _this$props2.children, + verticalOrientation = _this$props2.verticalOrientation; + if (!this.state.active) return null; + var actionButtons = !Array.isArray(children) ? [children] : children; + actionButtons = actionButtons.filter(function (actionButton) { + return typeof actionButton == 'object'; + }); + var actionStyle = { + flex: 1, + alignSelf: "stretch", + justifyContent: verticalOrientation === "up" ? "flex-end" : "flex-start", + paddingTop: this.props.verticalOrientation === "down" ? this.props.spacing : 0, + zIndex: this.props.zIndex + }; + return _react.default.createElement(_reactNative.View, { + style: actionStyle, + pointerEvents: "box-none" + }, actionButtons.map(function (_ActionButton, idx) { + return _react.default.createElement(_ActionButtonItem.default, (0, _extends2.default)({ + key: idx, + anim: _this4.anim + }, _this4.props, _ActionButton.props, { + parentSize: _this4.props.size, + btnColor: _this4.props.btnOutRange, + onPress: function onPress() { + if (_this4.props.autoInactive) { + _this4.timeout = setTimeout(_this4.reset.bind(_this4), 200); + } + + _ActionButton.props.onPress(); + } + })); + })); + } + }, { + key: "_renderTappableBackground", + value: function _renderTappableBackground() { + return _react.default.createElement(_reactNative.TouchableOpacity, { + activeOpacity: 1, + style: this.getOverlayStyles(), + onPress: this.reset.bind(this) + }); + } + }, { + key: "animateButton", + value: function animateButton() { + var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + if (this.state.active) return this.reset(); + + if (animate) { + _reactNative.Animated.spring(this.anim, { + toValue: 1 + }).start(); + } else { + this.anim.setValue(1); + } + + this.setState({ + active: true, + resetToken: this.state.resetToken + }); + } + }, { + key: "reset", + value: function reset() { + var _this5 = this; + + var animate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + if (this.props.onReset) this.props.onReset(); + + if (animate) { + _reactNative.Animated.spring(this.anim, { + toValue: 0 + }).start(); + } else { + this.anim.setValue(0); + } + + setTimeout(function () { + if (_this5.mounted) { + _this5.setState({ + active: false, + resetToken: _this5.state.resetToken + }); + } + }, 250); + } + }]); + return ActionButton; + }(_react.Component); + + exports.default = ActionButton; + ActionButton.Item = _ActionButtonItem.default; + ActionButton.propTypes = { + resetToken: _propTypes.default.any, + active: _propTypes.default.bool, + position: _propTypes.default.string, + elevation: _propTypes.default.number, + zIndex: _propTypes.default.number, + hideShadow: _propTypes.default.bool, + shadowStyle: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array, _propTypes.default.number]), + renderIcon: _propTypes.default.func, + bgColor: _propTypes.default.string, + bgOpacity: _propTypes.default.number, + buttonColor: _propTypes.default.string, + buttonTextStyle: _reactNative.Text.propTypes.style, + buttonText: _propTypes.default.string, + offsetX: _propTypes.default.number, + offsetY: _propTypes.default.number, + spacing: _propTypes.default.number, + size: _propTypes.default.number, + autoInactive: _propTypes.default.bool, + onPress: _propTypes.default.func, + onPressIn: _propTypes.default.func, + onPressOut: _propTypes.default.func, + backdrop: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]), + degrees: _propTypes.default.number, + verticalOrientation: _propTypes.default.oneOf(["up", "down"]), + backgroundTappable: _propTypes.default.bool, + activeOpacity: _propTypes.default.number, + useNativeFeedback: _propTypes.default.bool, + fixNativeFeedbackRadius: _propTypes.default.bool, + nativeFeedbackRippleColor: _propTypes.default.string, + testID: _propTypes.default.string, + accessibilityLabel: _propTypes.default.string, + accessible: _propTypes.default.bool + }; + ActionButton.defaultProps = { + resetToken: null, + active: false, + bgColor: "transparent", + bgOpacity: 1, + buttonColor: "rgba(0,0,0,1)", + buttonTextStyle: {}, + buttonText: "+", + spacing: 20, + outRangeScale: 1, + autoInactive: true, + onPress: function onPress() {}, + onPressIn: function onPressIn() {}, + onPressOn: function onPressOn() {}, + backdrop: false, + degrees: 45, + position: "right", + offsetX: 30, + offsetY: 30, + size: 56, + verticalOrientation: "up", + backgroundTappable: false, + useNativeFeedback: true, + activeOpacity: _$$_REQUIRE(_dependencyMap[11]).DEFAULT_ACTIVE_OPACITY, + fixNativeFeedbackRadius: false, + nativeFeedbackRippleColor: "rgba(255,255,255,0.75)", + testID: undefined, + accessibilityLabel: undefined, + accessible: undefined + }; + + var styles = _reactNative.StyleSheet.create({ + overlay: { + position: "absolute", + bottom: 0, + left: 0, + right: 0, + top: 0, + backgroundColor: "transparent" + }, + btnText: { + marginTop: -4, + fontSize: 24, + backgroundColor: "transparent" + } + }); +},2523,[5,6,7,8,12,14,16,17,201,28,2524,2525]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _Dimensions$get = _reactNative.Dimensions.get("window"), + WIDTH = _Dimensions$get.width; + + var SHADOW_SPACE = 10; + var TEXT_HEIGHT = 22; + var TextTouchable = _$$_REQUIRE(_dependencyMap[10]).isAndroid ? _reactNative.TouchableNativeFeedback : _reactNative.TouchableWithoutFeedback; + + var ActionButtonItem = function (_Component) { + (0, _inherits2.default)(ActionButtonItem, _Component); + + var _super = _createSuper(ActionButtonItem); + + function ActionButtonItem() { + (0, _classCallCheck2.default)(this, ActionButtonItem); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(ActionButtonItem, [{ + key: "render", + value: function render() { + var _this$props = this.props, + size = _this$props.size, + position = _this$props.position, + verticalOrientation = _this$props.verticalOrientation, + hideShadow = _this$props.hideShadow, + spacing = _this$props.spacing; + if (!this.props.active) return null; + var animatedViewStyle = { + marginBottom: -10, + alignItems: _$$_REQUIRE(_dependencyMap[10]).alignItemsMap[position], + opacity: this.props.anim, + transform: [{ + translateY: this.props.anim.interpolate({ + inputRange: [0, 1], + outputRange: [verticalOrientation === "down" ? -40 : 40, 0] + }) + }] + }; + var buttonStyle = { + justifyContent: "center", + alignItems: "center", + width: size, + height: size, + borderRadius: size / 2, + backgroundColor: this.props.buttonColor || this.props.btnColor + }; + if (position !== "center") buttonStyle[position] = (this.props.parentSize - size) / 2; + var Touchable = (0, _$$_REQUIRE(_dependencyMap[10]).getTouchableComponent)(this.props.useNativeFeedback); + var parentStyle = _$$_REQUIRE(_dependencyMap[10]).isAndroid && this.props.fixNativeFeedbackRadius ? { + height: size, + marginBottom: spacing, + right: this.props.offsetX, + borderRadius: this.props.size / 2 + } : { + paddingHorizontal: this.props.offsetX, + height: size + SHADOW_SPACE + spacing + }; + return _react.default.createElement(_reactNative.Animated.View, { + pointerEvents: "box-none", + style: [animatedViewStyle, parentStyle] + }, _react.default.createElement(_reactNative.View, null, _react.default.createElement(Touchable, { + testID: this.props.testID, + accessibilityLabel: this.props.accessibilityLabel, + background: (0, _$$_REQUIRE(_dependencyMap[10]).touchableBackground)(this.props.nativeFeedbackRippleColor, this.props.fixNativeFeedbackRadius), + activeOpacity: this.props.activeOpacity || _$$_REQUIRE(_dependencyMap[10]).DEFAULT_ACTIVE_OPACITY, + onPress: this.props.onPress + }, _react.default.createElement(_reactNative.View, { + style: [buttonStyle, !hideShadow ? (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[10]).shadowStyle, this.props.shadowStyle) : null] + }, this.props.children))), this._renderTitle()); + } + }, { + key: "_renderTitle", + value: function _renderTitle() { + if (!this.props.title) return null; + var _this$props2 = this.props, + textContainerStyle = _this$props2.textContainerStyle, + hideLabelShadow = _this$props2.hideLabelShadow, + offsetX = _this$props2.offsetX, + parentSize = _this$props2.parentSize, + size = _this$props2.size, + position = _this$props2.position, + spaceBetween = _this$props2.spaceBetween; + var offsetTop = Math.max(size / 2 - 11, 0); + var positionStyles = { + top: offsetTop + }; + var hideShadow = hideLabelShadow === undefined ? this.props.hideShadow : hideLabelShadow; + + if (position !== "center") { + positionStyles[position] = offsetX + (parentSize - size) / 2 + size + spaceBetween; + } else { + positionStyles.right = WIDTH / 2 + size / 2 + spaceBetween; + } + + var textStyles = [styles.textContainer, positionStyles, !hideShadow && _$$_REQUIRE(_dependencyMap[10]).shadowStyle, textContainerStyle]; + var title = _react.default.isValidElement(this.props.title) ? this.props.title : _react.default.createElement(_reactNative.Text, { + allowFontScaling: false, + style: [styles.text, this.props.textStyle] + }, this.props.title); + return _react.default.createElement(TextTouchable, { + background: (0, _$$_REQUIRE(_dependencyMap[10]).touchableBackground)(this.props.nativeFeedbackRippleColor, this.props.fixNativeFeedbackRadius), + activeOpacity: this.props.activeOpacity || _$$_REQUIRE(_dependencyMap[10]).DEFAULT_ACTIVE_OPACITY, + onPress: this.props.onPress + }, _react.default.createElement(_reactNative.View, { + style: textStyles + }, title)); + } + }], [{ + key: "defaultProps", + get: function get() { + return { + active: true, + spaceBetween: 15, + useNativeFeedback: true, + activeOpacity: _$$_REQUIRE(_dependencyMap[10]).DEFAULT_ACTIVE_OPACITY, + fixNativeFeedbackRadius: false, + nativeFeedbackRippleColor: "rgba(255,255,255,0.75)" + }; + } + }, { + key: "propTypes", + get: function get() { + return { + active: _propTypes.default.bool, + useNativeFeedback: _propTypes.default.bool, + fixNativeFeedbackRadius: _propTypes.default.bool, + nativeFeedbackRippleColor: _propTypes.default.string, + activeOpacity: _propTypes.default.number + }; + } + }]); + return ActionButtonItem; + }(_react.Component); + + exports.default = ActionButtonItem; + + var styles = _reactNative.StyleSheet.create({ + textContainer: { + position: "absolute", + paddingVertical: _$$_REQUIRE(_dependencyMap[10]).isAndroid ? 2 : 3, + paddingHorizontal: 8, + borderRadius: 3, + borderWidth: _reactNative.StyleSheet.hairlineWidth, + borderColor: "#eee", + backgroundColor: "white", + height: TEXT_HEIGHT + }, + text: { + flex: 1, + fontSize: 12, + color: "#444" + } + }); +},2524,[5,6,7,8,12,14,16,17,201,28,2525]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getTouchableComponent = getTouchableComponent; + exports.touchableBackground = touchableBackground; + exports.isAndroid = exports.alignItemsMap = exports.shadowStyle = exports.DEFAULT_ACTIVE_OPACITY = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var DEFAULT_ACTIVE_OPACITY = 0.85; + exports.DEFAULT_ACTIVE_OPACITY = DEFAULT_ACTIVE_OPACITY; + var shadowStyle = { + shadowOpacity: 0.35, + shadowOffset: { + width: 0, + height: 5 + }, + shadowColor: "#000", + shadowRadius: 3, + elevation: 5 + }; + exports.shadowStyle = shadowStyle; + var alignItemsMap = { + center: "center", + left: "flex-start", + right: "flex-end" + }; + exports.alignItemsMap = alignItemsMap; + var isAndroid = _reactNative.Platform.OS === "android"; + exports.isAndroid = isAndroid; + + function getTouchableComponent(useNativeFeedback) { + if (useNativeFeedback === true && isAndroid === true) { + return _reactNative.TouchableNativeFeedback; + } + + return _reactNative.TouchableOpacity; + } + + function touchableBackground(color, fixRadius) { + if (isAndroid) { + if (_reactNative.Platform["Version"] >= 21) { + return _reactNative.TouchableNativeFeedback.Ripple(color || "rgba(255,255,255,0.75)", fixRadius); + } else { + _reactNative.TouchableNativeFeedback.SelectableBackground(); + } + } + + return undefined; + } +},2525,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.VerticalMap = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getMaps(), + MapView = _OptionalPackages$get.MapView, + Marker = _OptionalPackages$get.Marker, + Callout = _OptionalPackages$get.Callout; + + var VerticalMap = function (_React$Component) { + (0, _inherits2.default)(VerticalMap, _React$Component); + + var _super = _createSuper(VerticalMap); + + function VerticalMap(props) { + var _this; + + (0, _classCallCheck2.default)(this, VerticalMap); + _this = _super.call(this, props); + + var _global$getRssIndex = global.getRssIndex(), + latitude = _global$getRssIndex.latitude, + longitude = _global$getRssIndex.longitude; + + _this.defaultLatitude = parseFloat(latitude) || 41.578518; + _this.defaultLongitude = parseFloat(longitude) || -85.804958; + _this.state = { + data: props.data + }; + return _this; + } + + (0, _createClass2.default)(VerticalMap, [{ + key: "getValueByKeyPath", + value: function getValueByKeyPath(element, key) { + var tokens = key.split("."); + var result = element; + tokens.forEach(function (token) { + result = result ? result[token] : result; + }); + return result; + } + }, { + key: "getCenterRegionOnData", + value: function getCenterRegionOnData(markers) { + var _this2 = this; + + var _this$props = this.props, + latitudeKey = _this$props.latitudeKey, + longitudeKey = _this$props.longitudeKey; + var latitudes = markers.map(function (marker) { + return _this2.getValueByKeyPath(marker, latitudeKey); + }).sort(function (a, b) { + return a - b; + }); + var longitudes = markers.map(function (marker) { + return _this2.getValueByKeyPath(marker, longitudeKey); + }).sort(function (a, b) { + return a - b; + }); + var middleLatitude = (latitudes[0] + latitudes[latitudes.length - 1]) / 2; + var middleLongitude = (longitudes[0] + longitudes[longitudes.length - 1]) / 2; + var latitudeDelta = latitudes[latitudes.length - 1] - latitudes[0]; + var longitudeDelta = longitudes[longitudes.length - 1] - longitudes[0]; + return { + latitude: middleLatitude || this.defaultLatitude, + longitude: middleLongitude || this.defaultLongitude, + latitudeDelta: latitudeDelta || 0.015, + longitudeDelta: longitudeDelta || 0.0121 + }; + } + }, { + key: "removeItemWithoutLocation", + value: function removeItemWithoutLocation(data) { + var _this3 = this; + + var _this$props2 = this.props, + latitudeKey = _this$props2.latitudeKey, + longitudeKey = _this$props2.longitudeKey; + return data.reduce(function (result, item) { + if (_this3.getValueByKeyPath(item, latitudeKey) && _this3.getValueByKeyPath(item, longitudeKey)) { + result.push(item); + } + + return result; + }, []); + } + }, { + key: "render", + value: function render() { + var _this4 = this; + + var _this$props3 = this.props, + style = _this$props3.style, + renderItem = _this$props3.renderItem, + renderCallout = _this$props3.renderCallout, + onItemPress = _this$props3.onItemPress, + itemKey = _this$props3.itemKey, + latitudeKey = _this$props3.latitudeKey, + longitudeKey = _this$props3.longitudeKey, + titleKey = _this$props3.titleKey, + getMarkerIcon = _this$props3.getMarkerIcon; + var data = this.state.data; + var markers = this.removeItemWithoutLocation(data); + + if (_optionalPackageUtils.default.isMapsAvailable()) { + return _react.default.createElement(MapView, { + style: style, + region: this.getCenterRegionOnData(markers) + }, markers.map(function (marker, index) { + if (renderItem) { + return renderItem({ + item: marker, + index: index + }); + } + + var extraProp = {}; + + if (getMarkerIcon) { + extraProp.image = getMarkerIcon(marker); + } + + return _react.default.createElement(Marker, (0, _extends2.default)({ + key: _this4.getValueByKeyPath(marker, itemKey), + title: _this4.getValueByKeyPath(marker, titleKey), + coordinate: { + latitude: _this4.getValueByKeyPath(marker, latitudeKey), + longitude: _this4.getValueByKeyPath(marker, longitudeKey) + } + }, extraProp), _react.default.createElement(Callout, { + onPress: function onPress() { + if (onItemPress) { + onItemPress(marker); + } + } + }, renderCallout(marker))); + })); + } + + return null; + } + }], [{ + key: "getDerivedStateFromProps", + value: function getDerivedStateFromProps(nextProps, prevState) { + var prevData = prevState.data; + var data = nextProps.data; + + if (_$$_REQUIRE(_dependencyMap[10]).JSUtils.equals(prevData, data)) { + return { + data: data + }; + } + + return null; + } + }]); + return VerticalMap; + }(_react.default.Component); + + exports.VerticalMap = VerticalMap; + VerticalMap.propTypes = { + style: _propTypes.default.object.isRequired, + data: _propTypes.default.array.isRequired, + itemKey: _propTypes.default.func.isRequired, + renderItem: _propTypes.default.func, + renderCallout: _propTypes.default.func, + onItemPress: _propTypes.default.func, + latitudeKey: _propTypes.default.string, + longitudeKey: _propTypes.default.string, + titleKey: _propTypes.default.string, + getMarkerIcon: _propTypes.default.func + }; + VerticalMap.defaultProps = { + latitudeKey: "latitude", + longitudeKey: "longitude" + }; +},2526,[5,6,7,8,12,14,16,17,201,731,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/navigation/img", + "width": 2000, + "height": 394, + "scales": [1], + "hash": "f782f11b313b5c72922dfa380b1e9e2a", + "name": "monster_logo", + "type": "png" + }); +},2527,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.JobDetailScreen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var JobDetailScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(JobDetailScreen, _NavigationBaseScreen); + + var _super = _createSuper(JobDetailScreen); + + function JobDetailScreen() { + (0, _classCallCheck2.default)(this, JobDetailScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(JobDetailScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(JobDetailScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getTag", + value: function getTag() { + return "Job Details"; + } + }, { + key: "render", + value: function render() { + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[8]).getNavigationParams)(this.props), + url = _getNavigationParams.url; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).BaseWebView, { + source: { + uri: url + }, + progressColor: (0, _$$_REQUIRE(_dependencyMap[10]).getJobColor)(), + browser: true + }); + } + }]); + return JobDetailScreen; + }(_$$_REQUIRE(_dependencyMap[8]).NavigationBaseScreen); + + exports.JobDetailScreen = JobDetailScreen; +},2528,[5,7,8,90,12,14,16,17,2148,1894,2474]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = VerticalEventNavigator; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var Header = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var Stack = _NavigationService.default.navigator.createStack(); + + var Tab = _NavigationService.default.navigator.createBottomTab(); + + function VerticalTabNavigator(props) { + return _react.default.createElement(Tab.Navigator, { + screenOptions: function screenOptions(tabProps) { + return { + headerShown: false, + gesturesEnabled: false, + tabBarShowLabel: false, + swipeEnabled: false, + tabBarStyle: { + backgroundColor: _$$_REQUIRE(_dependencyMap[8]).colors.white + }, + tabBarIcon: function tabBarIcon(_ref) { + var focused = _ref.focused; + var routeName = tabProps.route.name; + var iconName; + + if (routeName === "VerticalHomeScreen") { + iconName = "home"; + } else if (routeName === "VerticalFiltersScreen") { + iconName = "user-cog"; + } else if (routeName === "VerticalListScreen") { + iconName = "home"; + } else if (routeName === "VerticalSavedSearchScreen") { + iconName = "search"; + } else if (routeName === "VerticalFavoritesScreen") { + iconName = "heart"; + } + + var filtersIcon = false; + + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[9]).getNavigationParams)(tabProps), + _getNavigationParams$ = _getNavigationParams.filters, + filters = _getNavigationParams$ === undefined ? {} : _getNavigationParams$, + apiHomeOverride = _getNavigationParams.apiHomeOverride; + + var getParams = {}; + + if (apiHomeOverride) { + var _StringUtils$segmentU = _$$_REQUIRE(_dependencyMap[8]).StringUtils.segmentUrl(apiHomeOverride); + + getParams = _StringUtils$segmentU.getParams; + } + + if (apiHomeOverride && _$$_REQUIRE(_dependencyMap[8]).JSUtils.equals(filters, getParams)) { + filtersIcon = false; + } else if (filters && Object.keys(filters).length) { + filtersIcon = true; + } + + return _react.default.createElement(_reactNative.View, null, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: iconName, + size: _$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isTablet() || !_deviceUtils.default.isPortrait() ? 20 : 25, + color: focused ? (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)() : _$$_REQUIRE(_dependencyMap[8]).colors.grey400 + }), filtersIcon ? _react.default.createElement(_reactNative.View, { + style: { + position: "absolute", + right: -5, + top: -5, + zIndex: 1 + } + }, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "filter", + size: 10, + color: focused ? _$$_REQUIRE(_dependencyMap[8]).colors.md_red_900 : _$$_REQUIRE(_dependencyMap[8]).colors.grey400 + })) : null); + } + }; + } + }, _react.default.createElement(Tab.Screen, { + name: "VerticalListScreen" + }, function (tabProps) { + var _getNavigationParams2 = (0, _$$_REQUIRE(_dependencyMap[9]).getNavigationParams)(props), + user = _getNavigationParams2.user, + pass = _getNavigationParams2.pass, + portal = _getNavigationParams2.portal, + apiHomeOverride = _getNavigationParams2.apiHomeOverride; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).EventListScreen, (0, _extends2.default)({ + apiHomeOverride: apiHomeOverride, + user: user, + pass: pass, + portal: portal + }, tabProps)); + }), _react.default.createElement(Tab.Screen, { + name: "VerticalFiltersScreen" + }, function (tabProps) { + var _getNavigationParams3 = (0, _$$_REQUIRE(_dependencyMap[9]).getNavigationParams)(props), + user = _getNavigationParams3.user, + pass = _getNavigationParams3.pass, + portal = _getNavigationParams3.portal, + extraSearchField = _getNavigationParams3.extraSearchField; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).EventFilterScreen, (0, _extends2.default)({ + user: user, + pass: pass, + portal: portal, + extraSearchField: extraSearchField + }, tabProps)); + }), _react.default.createElement(Tab.Screen, { + name: "VerticalFavoritesScreen" + }, function (tabProps) { + var _getNavigationParams4 = (0, _$$_REQUIRE(_dependencyMap[9]).getNavigationParams)(props), + user = _getNavigationParams4.user, + pass = _getNavigationParams4.pass, + portal = _getNavigationParams4.portal; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).EventFavoritesScreen, (0, _extends2.default)({ + user: user, + pass: pass, + portal: portal + }, tabProps)); + })); + } + + function VerticalEventNavigator() { + return _react.default.createElement(Stack.Navigator, { + screenOptions: _NavigationService.default.getStackScreenOptions(), + initialRouteName: "VerticalTabNavigator" + }, _react.default.createElement(Stack.Screen, { + name: "VerticalTabNavigator", + component: VerticalTabNavigator, + options: function options(_ref2) { + var navigation = _ref2.navigation; + return { + header: function header() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ActionBar, { + considerSafeAreaTop: true, + left: Header._getHeaderLeftButtonsBackButtonOnly(navigation, (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)()), + center: Header._getHeader(global.strings("local_events"), global.strings("powered_by_who", { + who: "" + }), function () { + navigation.navigate("VerticalWebScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkUrl)() + }); + }, (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkLogo)()), + right: Header._getHeaderRightButton(navigation, (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)(), "", global.strings("btn_add_event"), function () { + navigation.navigate("VerticalWebScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getNewEventUrl)() + }); + }) + }); + } + }; + } + }), _react.default.createElement(Stack.Screen, { + name: "VerticalDetailScreen", + component: _$$_REQUIRE(_dependencyMap[15]).EventDetailScreen, + options: function options(_ref3) { + var navigation = _ref3.navigation; + return { + header: function header() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ActionBar, { + considerSafeAreaTop: true, + left: Header._getHeaderLeftButtonsBackButtonOnly(navigation, (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)()), + center: Header._getHeader(global.strings("local_events"), global.strings("powered_by_who", { + who: "" + }), function () { + navigation.navigate("VerticalWebScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkUrl)() + }); + }, (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkLogo)()), + right: Header._getHeaderRightButton(navigation, (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)(), "", global.strings("btn_add_event"), function () { + navigation.navigate("VerticalWebScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getNewEventUrl)() + }); + }) + }); + } + }; + } + }), _react.default.createElement(Stack.Screen, { + name: "VerticalSavedSearchScreen", + options: function options(_ref4) { + var navigation = _ref4.navigation; + return { + header: function header() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ActionBar, { + considerSafeAreaTop: true, + left: Header._getHeaderLeftButtonsBackButtonOnly(navigation, (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)()), + center: Header._getHeader(global.strings("local_events"), global.strings("powered_by_who", { + who: "" + }), function () { + navigation.navigate("VerticalWebScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkUrl)() + }); + }, (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkLogo)()), + right: Header._getHeaderRightButton(navigation, (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)(), "", global.strings("btn_add_event"), function () { + navigation.navigate("VerticalWebScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getNewEventUrl)() + }); + }) + }); + }, + gesturesEnabled: false + }; + } + }, function (props) { + var _getNavigationParams5 = (0, _$$_REQUIRE(_dependencyMap[9]).getNavigationParams)(props), + user = _getNavigationParams5.user, + pass = _getNavigationParams5.pass, + portal = _getNavigationParams5.portal, + _getNavigationParams6 = _getNavigationParams5.labels, + labels = _getNavigationParams6 === undefined ? [] : _getNavigationParams6; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).EventSearchScreen, (0, _extends2.default)({ + user: user, + pass: pass, + portal: portal, + labels: labels + }, props)); + }), _react.default.createElement(Stack.Screen, { + name: "VerticalWebScreen", + component: _$$_REQUIRE(_dependencyMap[17]).EventWebScreen, + options: function options(_ref5) { + var navigation = _ref5.navigation; + return { + header: function header() { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).ActionBar, { + considerSafeAreaTop: true, + left: Header._getHeaderLeftButtonsBackButtonOnly(navigation, (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)()), + center: Header._getHeader(global.strings("local_events"), global.strings("powered_by_who", { + who: "" + }), function () { + navigation.navigate("VerticalWebScreen", { + url: (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkUrl)() + }); + }, (0, _$$_REQUIRE(_dependencyMap[10]).getCitySparkLogo)()) + }); + }, + gesturesEnabled: false + }; + } + })); + } +},2529,[5,6,17,28,458,2472,1806,1861,462,2148,2474,2530,2554,2570,2144,2573,2575,2578]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2530,[2531]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventListScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _eventBaseScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventListScreen = function (_EventBaseScreen) { + (0, _inherits2.default)(EventListScreen, _EventBaseScreen); + + var _super = _createSuper(EventListScreen); + + function EventListScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventListScreen); + _this = _super.call(this, props); + _this.state = { + searches: [], + loading: true + }; + return _this; + } + + (0, _createClass2.default)(EventListScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.prev = 0; + _context.next = 3; + return _regenerator.default.awrap(this.loadPromotions()); + + case 3: + this.setState({ + loading: false + }); + _context.next = 8; + break; + + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](0); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, this, [[0, 6]], Promise); + } + }, { + key: "didFocus", + value: function didFocus() { + (0, _get2.default)((0, _getPrototypeOf2.default)(EventListScreen.prototype), "didFocus", this).call(this); + + this._retrieveData(); + } + }, { + key: "_retrieveData", + value: function _retrieveData() { + var searchVerticalManager = global.getVerticalsConfig().getEvents(); + var result = searchVerticalManager.getSearches(); + this.setState({ + searches: result + }); + } + }, { + key: "render", + value: function render() { + var loading = this.state.loading; + var searchVerticalManager = global.getVerticalsConfig().getEvents(); + var _this$props = this.props, + portal = _this$props.portal, + apiHomeOverride = _this$props.apiHomeOverride; + var filters = (0, _$$_REQUIRE(_dependencyMap[10]).getNavigationParams)(this.props).filters || {}; + var apiToOverride; + + if (filters && (Object.keys(filters).length > 0 || !apiHomeOverride)) { + filters.includeLabels = true; + filters.portal = portal; + } else { + apiToOverride = apiHomeOverride; + } + + return !loading ? this.renderList(filters, searchVerticalManager, apiToOverride) : null; + } + }]); + return EventListScreen; + }(_eventBaseScreen.default); + + exports.EventListScreen = EventListScreen; + EventListScreen.propTypes = { + apiHomeOverride: _propTypes.default.string, + portal: _propTypes.default.string.isRequired, + pass: _propTypes.default.string.isRequired, + user: _propTypes.default.string.isRequired, + navigation: _propTypes.default.shape({ + getParam: _propTypes.default.func.isRequired + }) + }; +},2531,[5,80,7,8,90,12,14,16,201,2532,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _AdsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventBaseScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(EventBaseScreen, _NavigationBaseScreen); + + var _super = _createSuper(EventBaseScreen); + + function EventBaseScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventBaseScreen); + _this = _super.call(this, props); + _this.state = { + sortValue: 0 + }; + return _this; + } + + (0, _createClass2.default)(EventBaseScreen, [{ + key: "loadPromotions", + value: function loadPromotions() { + var _this2 = this; + + var portal, params, filter, _params$user, user, _params$pass, pass, username, password, config, featuredResults, model, ad; + + return _regenerator.default.async(function loadPromotions$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + portal = this.props.portal; + params = (0, _$$_REQUIRE(_dependencyMap[16]).getNavigationParams)(this.props); + filter = { + portal: portal, + numberOfDays: 365, + asOfDate: _$$_REQUIRE(_dependencyMap[17]).DateUtils.getDateString().substring(0, 10) + }; + _params$user = params.user, user = _params$user === undefined ? "" : _params$user, _params$pass = params.pass, pass = _params$pass === undefined ? "" : _params$pass; + username = user; + password = pass; + config = { + auth: { + username: username, + password: password + } + }; + this.featuredIds = []; + this.enhancedIds = []; + this.ads = []; + _context.prev = 10; + _context.next = 13; + return _regenerator.default.awrap(_Api.default.get((0, _$$_REQUIRE(_dependencyMap[18]).getFeaturedEventApi)(), config, filter)); + + case 13: + featuredResults = _context.sent; + model = global.getAdsConfig().getAdEvent(); + ad = global.getAdsConfig().getAdComponent(model); + this.notice = { + key: "notice", + data: ad + }; + featuredResults.data.forEach(function (event) { + if (event.eventId && event.type === "Featured" && !_this2.featuredIds.includes(event.eventId)) { + _this2.featuredIds.push(event.eventId); + } + + if (event.eventId && event.type === "Enhanced") { + _this2.enhancedIds.push(event.eventId); + } + + if (event.eventId && event.type === "Premium") { + _this2.featuredIds.push(event.eventId); + + _this2.enhancedIds.push(event.eventId); + } + + if (event.promoImage && event.type === "Display Ad") { + _this2.ads.push({ + isAd: true, + promoImage: event.promoImage, + destinationUrl: event.destinationUrl + }); + } + }); + this.ads.push({ + isAd: true + }); + _context.next = 23; + break; + + case 21: + _context.prev = 21; + _context.t0 = _context["catch"](10); + + case 23: + case "end": + return _context.stop(); + } + } + }, null, this, [[10, 21]], Promise); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(EventBaseScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getClosestEventDate", + value: function getClosestEventDate(event) { + var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date(); + var numberOfEventInstances = event.instances.length; + var startDate; + var outputResult = ""; + + var now = _$$_REQUIRE(_dependencyMap[17]).DateUtils.getMomentStartOfDay(start); + + for (var i = 0; i < numberOfEventInstances; i++) { + startDate = _$$_REQUIRE(_dependencyMap[17]).DateUtils.getMomentDate(event.instances[i].startDateTime); + + if (startDate >= now) { + outputResult += startDate.utc().format("dddd, MMMM D"); + return outputResult; + } + } + + return outputResult; + } + }, { + key: "getSortedSections", + value: function getSortedSections(items, sorting, filters) { + var _this3 = this; + + var sections = []; + var keys = []; + var eventsAdded = []; + items.forEach(function (item) { + var newSection = ""; + newSection = _this3.getClosestEventDate(item, filters.startDate); + + if (newSection) { + var eventId = String(item.eventId); + + if (!keys.includes(newSection)) { + keys.push(newSection); + sections.push({ + title: newSection, + data: [item] + }); + eventsAdded.push(eventId); + } else if (!eventsAdded.includes(eventId)) { + var index = sections.findIndex(function (section) { + return section.title === newSection; + }); + + if (index > -1) { + eventsAdded.push(eventId); + sections[index].data.push(item); + } + } + } + }); + var numberOfAds = this.ads.length; + + if (numberOfAds) { + var counter = 0; + var adIndex = 0; + + for (var i = 0; i < sections.length; i++) { + for (var k = 0; k < sections[i].data.length; k++) { + counter += 1; + + if (counter === 3 || (counter - 3) % 10 === 0) { + sections[i].data.splice(k, 0, this.ads[adIndex % numberOfAds]); + adIndex += 1; + } + } + } + + sections[0].data.splice(0, 0, this.notice); + } + + return sections; + } + }, { + key: "getMapProps", + value: function getMapProps() { + var _this$props = this.props, + navigation = _this$props.navigation, + user = _this$props.user, + pass = _this$props.pass, + portal = _this$props.portal; + return { + enable: true, + renderCallout: this.renderCallout, + titleKey: "name", + itemKey: "eventId", + latitudeKey: "location.latitude", + longitudeKey: "location.longitude", + getMarkerIcon: _$$_REQUIRE(_dependencyMap[19]).eventIcon, + onItemPress: function onItemPress(clicked) { + navigation.navigate("VerticalDetailScreen", { + id: clicked.eventId, + user: user, + pass: pass, + portal: portal + }); + } + }; + } + }, { + key: "getOrderProps", + value: function getOrderProps() { + var iconStyle = { + fontSize: 20, + height: 22, + color: _$$_REQUIRE(_dependencyMap[17]).colors.white + }; + var activeIconStyle = { + fontSize: 20, + height: 22, + color: (0, _$$_REQUIRE(_dependencyMap[18]).getEventColor)() + }; + return { + items: [[{ + label: global.strings("sort_by_popularity"), + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "star", + style: iconStyle + }), + ActiveComponent: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "star", + style: activeIconStyle + }), + param: EventBaseScreen.SORT_POPULARITY + }], [{ + label: global.strings("sort_by_date"), + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "calendar-alt", + style: iconStyle + }), + ActiveComponent: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "calendar-alt", + style: activeIconStyle + }), + param: EventBaseScreen.SORT_DATE + }], [{ + label: global.strings("sort_by_name"), + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "sort-alpha-down", + style: iconStyle + }), + ActiveComponent: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "sort-alpha-down", + style: activeIconStyle + }), + param: EventBaseScreen.SORT_NAME + "+asc" + }], [{ + label: global.strings("sort_by_name_reverse"), + Component: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "sort-alpha-up", + style: iconStyle + }), + ActiveComponent: _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "sort-alpha-up", + style: activeIconStyle + }), + param: EventBaseScreen.SORT_NAME + "+desc" + }]], + defaultSort: EventBaseScreen.SORT_POPULARITY + }; + } + }, { + key: "renderSectionHeader", + value: function renderSectionHeader(data) { + var title = ""; + + if (data && data.section && data.section.title) { + title = data.section.title; + } + + return _react.default.createElement(_reactNative.View, { + style: { + height: title ? 40 : 0, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "center", + padding: 0, + opacity: 0.9, + backgroundColor: (0, _$$_REQUIRE(_dependencyMap[18]).getEventColor)() + } + }, _react.default.createElement(_fontText.default, { + style: { + fontSize: 18, + fontWeight: "bold", + color: _$$_REQUIRE(_dependencyMap[17]).colors.md_white_1000, + paddingHorizontal: 10 + } + }, title)); + } + }, { + key: "renderItem", + value: function renderItem(item, filters) { + var _this$props2 = this.props, + navigation = _this$props2.navigation, + user = _this$props2.user, + pass = _this$props2.pass, + portal = _this$props2.portal; + var params = (0, _$$_REQUIRE(_dependencyMap[16]).getNavigationParams)(this.props); + var adWidth = parseInt(params.adWidth || "300", 10); + var adHeight = parseInt(params.adHeight || "250", 10); + var adFallback = params.adFallback; + + if (item.isAd) { + if (item.promoImage && item.destinationUrl) { + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + return _tecnaviaPlatformUtils.default.openURL(item.destinationUrl); + } + }, _react.default.createElement(_imageComponent.default, { + source: { + uri: item.promoImage + }, + forceProgressComponent: true, + style: { + marginTop: 20, + marginBottom: 20, + height: adWidth, + width: adWidth, + alignSelf: "center" + } + })); + } + + if (item.promoImage && !item.destinationUrl && item.eventId) { + return _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + navigation.navigate("VerticalDetailScreen", { + id: item.eventId, + user: user, + pass: pass, + portal: portal, + isVirtual: item.labels ? item.labels.includes("csVirtual") : false + }); + } + }, _react.default.createElement(_imageComponent.default, { + source: { + uri: item.promoImage + }, + forceProgressComponent: true, + style: { + marginTop: 20, + marginBottom: 20, + height: adWidth, + width: adWidth, + alignSelf: "center" + } + })); + } + + var adUnitId = params.adUnitId; + return _react.default.createElement(_reactNative.View, { + style: { + display: "flex", + flexDirection: "row", + justifyContent: "center", + marginTop: 20, + marginBottom: 20 + } + }, _AdsHelper.default.getNativeAdComponent({ + unitId: adUnitId, + width: adWidth, + height: adHeight, + fallback: adFallback + })); + } + + if (item.key === "notice") { + return _react.default.createElement(_reactNative.View, { + style: { + flexDirection: "row", + justifyContent: "center", + margin: 10 + } + }, item.data); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).EventListItem, { + item: item, + onItemPress: function onItemPress(clicked) { + navigation.navigate("VerticalDetailScreen", { + id: clicked.eventId, + user: user, + pass: pass, + portal: portal, + isVirtual: item.labels ? item.labels.includes("csVirtual") : false + }); + }, + manager: global.getVerticalsConfig().getEvents(), + color: (0, _$$_REQUIRE(_dependencyMap[18]).getEventColor)(), + startDate: filters.startDate, + endDate: filters.endDate, + baseLatitude: filters.latitude, + baseLongitude: filters.longitude, + enhanced: this.enhancedIds.includes(item.eventId), + portal: portal + }); + } + }, { + key: "renderCallout", + value: function renderCallout(item) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).EventCustomCallout, { + title: item.name, + image: item.primaryImage ? item.primaryImage.smallImageUrl : null, + description: item.eventId, + date: item.seriesStart + }); + } + }, { + key: "renderList", + value: function renderList(filters, manager, apiHomeOverride) { + var _this4 = this; + + var api = apiHomeOverride || (0, _$$_REQUIRE(_dependencyMap[18]).getEventApi)(); + var _this$props3 = this.props, + navigation = _this$props3.navigation, + user = _this$props3.user, + pass = _this$props3.pass, + portal = _this$props3.portal; + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[22]).EventFeaturedComponent, { + getItemById: _$$_REQUIRE(_dependencyMap[18]).getEventById, + featuredApi: (0, _$$_REQUIRE(_dependencyMap[18]).getFeaturedEventApi)(), + featuredEvents: this.featuredIds, + config: { + auth: { + username: user, + password: pass + } + }, + normalizeResults: function normalizeResults(res) { + return { + items: res.events + }; + }, + skipDefaultParams: true, + portal: portal, + onEventPress: function onEventPress(id) { + navigation.navigate("VerticalDetailScreen", { + id: id, + user: user, + pass: pass, + portal: portal + }); + } + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).VerticalList, { + color: (0, _$$_REQUIRE(_dependencyMap[18]).getEventColor)(), + api: api, + config: { + auth: { + username: user, + password: pass + } + }, + params: filters, + normalizeResults: function normalizeResults(res) { + return { + items: res.events + }; + }, + getFilterNames: function getFilterNames(rows, sort, currentPage) { + var sortValue = typeof sort === "string" ? sort.split("+") : undefined; + return { + limit: rows, + sortBy: sortValue ? sortValue[0] : sort, + page: currentPage, + sortAsc: sortValue && sortValue[1] === "desc" ? false : undefined + }; + }, + map: this.getMapProps(), + order: this.getOrderProps(), + enableInfiniteScroll: true, + skipDefaultParams: true, + serverSidePaging: false, + searchVerticalManager: manager, + renderItem: function renderItem(_ref) { + var item = _ref.item; + return _this4.renderItem(item, filters); + }, + getSections: function getSections(items, sorting) { + return _this4.getSortedSections(items, sorting, filters); + }, + renderSectionHeader: this.renderSectionHeader, + onErrorPress: function onErrorPress() { + navigation.navigate("VerticalFiltersScreen"); + }, + onEmptyPress: function onEmptyPress() { + navigation.navigate("VerticalFiltersScreen"); + }, + style: { + paddingVertical: 5 + } + })); + } + }]); + return EventBaseScreen; + }(_$$_REQUIRE(_dependencyMap[16]).NavigationBaseScreen); + + exports.default = EventBaseScreen; + EventBaseScreen.SORT_POPULARITY = 0; + EventBaseScreen.SORT_DATE = 1; + EventBaseScreen.SORT_NAME = 2; +},2532,[5,80,7,8,90,12,14,16,17,28,588,1879,431,2087,1806,1876,2148,462,2474,2533,2547,2549,2551,2517]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2533,[2534]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.eventIcon = eventIcon; + + function eventIcon(marker, filterCategory) { + var out; + var id = marker.categories[0] ? marker.categories[0].categoryId : -1; + + if (filterCategory) { + id = filterCategory; + } + + switch (id) { + case 2: + out = _$$_REQUIRE(_dependencyMap[0]); + break; + + case 3: + out = _$$_REQUIRE(_dependencyMap[1]); + break; + + case 4: + out = _$$_REQUIRE(_dependencyMap[2]); + break; + + case 5: + out = _$$_REQUIRE(_dependencyMap[3]); + break; + + case 6: + out = _$$_REQUIRE(_dependencyMap[4]); + break; + + case 7: + out = _$$_REQUIRE(_dependencyMap[5]); + break; + + case 8: + out = _$$_REQUIRE(_dependencyMap[6]); + break; + + case 10: + out = _$$_REQUIRE(_dependencyMap[7]); + break; + + case 14: + out = _$$_REQUIRE(_dependencyMap[8]); + break; + + case 15: + out = _$$_REQUIRE(_dependencyMap[9]); + break; + + case 76: + out = _$$_REQUIRE(_dependencyMap[10]); + break; + + case 390: + out = _$$_REQUIRE(_dependencyMap[11]); + break; + + default: + out = _$$_REQUIRE(_dependencyMap[11]); + break; + } + + return out; + } +},2534,[2535,2536,2537,2538,2539,2540,2541,2542,2543,2544,2545,2546]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "f6a5204893e0a85af94682d9020ed1dd", + "name": "2", + "type": "png" + }); +},2535,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "26beddc43143443aa67b230f273f9fb2", + "name": "3", + "type": "png" + }); +},2536,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "2f15106a97eca883b6cfaf85b1d5a9a7", + "name": "4", + "type": "png" + }); +},2537,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "f9bc7e630f61cb611aa95fb6d9d49282", + "name": "5", + "type": "png" + }); +},2538,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "3925bc3bb2e4ac320a5cbc3fd2c6e494", + "name": "6", + "type": "png" + }); +},2539,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "d27b56206d43f01cc144ebc65fc2efa5", + "name": "7", + "type": "png" + }); +},2540,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "41a839b11e9be3d93f8f023cd0628009", + "name": "8", + "type": "png" + }); +},2541,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "65a4d260cc3cf40a53b448cdfadf1b34", + "name": "10", + "type": "png" + }); +},2542,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 35, + "height": 44, + "scales": [1], + "hash": "b23a4381adba88f0a0a35e11e6906bb7", + "name": "14", + "type": "png" + }); +},2543,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "b88bdba86ef801b7adfa873d39827db9", + "name": "15", + "type": "png" + }); +},2544,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "cbb96fc80a91bdadbd5f0c09c706a68d", + "name": "76", + "type": "png" + }); +},2545,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + module.exports = _$$_REQUIRE(_dependencyMap[0]).registerAsset({ + "__packager_asset": true, + "httpServerLocation": "/assets/src/views/verticals/event-icons/icons", + "width": 33, + "height": 44, + "scales": [1], + "hash": "356463c16a6c2a9b77f7059c3a40f5e5", + "name": "390", + "type": "png" + }); +},2546,[1179]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventListItem = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNativeLinearGradient = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _iconTile = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _blurImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventListItem = function (_React$Component) { + (0, _inherits2.default)(EventListItem, _React$Component); + + var _super = _createSuper(EventListItem); + + function EventListItem() { + var _this; + + (0, _classCallCheck2.default)(this, EventListItem); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.onShare = function _callee(message, id) { + var portal; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + portal = _this.props.portal; + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_reactNative.Share.share({ + message: message, + url: global.strings("share_event_url", { + portal: portal, + id: id + }) + })); + + case 4: + _context.next = 8; + break; + + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](1); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 6]], Promise); + }; + + return _this; + } + + (0, _createClass2.default)(EventListItem, [{ + key: "shouldComponentUpdate", + value: function shouldComponentUpdate() { + return false; + } + }, { + key: "getDistanceString", + value: function getDistanceString(item) { + var baseLatitude = this.props.baseLatitude || global.getRssIndex().latitude; + var baseLongitude = this.props.baseLongitude || global.getRssIndex().longitude; + var manager = global.getVerticalsConfig().getEvents(); + var lastSearch = manager.getLastSearch(); + + if (!lastSearch || !item.location || !item.location.latitude || !item.location.longitude) { + return ""; + } + + var pi = Math.PI; + var lat1 = parseFloat(baseLatitude, 10) * pi / 180; + var lon1 = parseFloat(baseLongitude, 10) * pi / 180; + var lat2 = parseFloat(item.location.latitude, 10) * pi / 180; + var lon2 = parseFloat(item.location.longitude, 10) * pi / 180; + var R = 3958.75; + var x = (lon2 - lon1) * Math.cos((lat1 + lat2) / 2); + var y = lat2 - lat1; + var d = Math.sqrt(x * x + y * y) * R; + return "| " + d.toFixed(1) + " mi"; + } + }, { + key: "getClosestEventDate", + value: function getClosestEventDate(event) { + var start = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Date(); + var numberOfEventInstances = event.instances.length; + var startDate; + var endDate; + var outputResult = ""; + + var now = _$$_REQUIRE(_dependencyMap[16]).DateUtils.getMomentStartOfDay(start); + + for (var i = 0; i < numberOfEventInstances; i++) { + startDate = _$$_REQUIRE(_dependencyMap[16]).DateUtils.getMomentDate(event.instances[i].startDateTime); + endDate = event.instances[i].endDateTime ? _$$_REQUIRE(_dependencyMap[16]).DateUtils.getMomentDate(event.instances[i].endDateTime) : null; + + if (startDate >= now) { + outputResult += startDate.utc().format("LLLL"); + outputResult += endDate ? endDate.utc().format(" - hh:mm A") : ""; + return outputResult; + } + } + + now = _$$_REQUIRE(_dependencyMap[16]).DateUtils.getMomentStartOfDay(start).utc(); + startDate = _$$_REQUIRE(_dependencyMap[16]).DateUtils.getMomentDate(event.instances[numberOfEventInstances - 1].startDateTime).utc().format("YYYY MM DD, hh:mm a"); + + if (event.instances[numberOfEventInstances - 1].startDateTime) { + endDate = _$$_REQUIRE(_dependencyMap[16]).DateUtils.getMomentDate(event.instances[numberOfEventInstances - 1].endDateTime); + } + + if (endDate && endDate > now) { + outputResult += startDate; + outputResult += endDate.format(" - hh:mm a"); + } else { + outputResult = global.strings("msg_event_over"); + } + + return outputResult; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$props = this.props, + item = _this$props.item, + manager = _this$props.manager, + color = _this$props.color, + startDate = _this$props.startDate, + onItemPress = _this$props.onItemPress, + enhanced = _this$props.enhanced; + var location = item.location || {}; + var sep = location.locationName ? " | " : ""; + return _react.default.createElement(_reactNative.TouchableWithoutFeedback, { + onPress: function onPress() { + if (onItemPress) { + onItemPress(item); + } + } + }, _react.default.createElement(_reactNative.View, { + style: enhanced ? _$$_REQUIRE(_dependencyMap[17]).styles.enhanced : _$$_REQUIRE(_dependencyMap[17]).styles.line + }, _react.default.createElement(_reactNative.View, null, item.primaryImage ? _react.default.createElement(_reactNative.View, null, _react.default.createElement(_blurImageComponent.default, { + image: _$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isTablet() ? item.primaryImage.largeImageUrl : item.primaryImage.mediumImageUrl, + style: _$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isTablet() ? _$$_REQUIRE(_dependencyMap[17]).styles.tabletImage : _$$_REQUIRE(_dependencyMap[17]).styles.image + }), _react.default.createElement(_reactNativeLinearGradient.default, { + style: _$$_REQUIRE(_dependencyMap[16]).PlatformUtils.isTablet() ? _$$_REQUIRE(_dependencyMap[17]).styles.tabletGradient : _$$_REQUIRE(_dependencyMap[17]).styles.gradient, + colors: [_$$_REQUIRE(_dependencyMap[16]).colors.transparent, _$$_REQUIRE(_dependencyMap[16]).colors.transparent, _$$_REQUIRE(_dependencyMap[16]).colors.transparent200] + }), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[17]).styles.cardBottom + }, _react.default.createElement(_fontText.default, { + style: item.primaryImage ? _$$_REQUIRE(_dependencyMap[17]).styles.title : _$$_REQUIRE(_dependencyMap[17]).styles.titleNoImage, + type: _fontText.Type.medium + }, item.name), _react.default.createElement(_fontText.default, { + style: item.primaryImage ? _$$_REQUIRE(_dependencyMap[17]).styles.description : _$$_REQUIRE(_dependencyMap[17]).styles.descriptionNoImage + }, "" + (location.locationName || "") + sep + (location.city || "") + ", " + (location.state || "") + " " + this.getDistanceString(item)), _react.default.createElement(_fontText.default, { + style: item.primaryImage ? _$$_REQUIRE(_dependencyMap[17]).styles.description : _$$_REQUIRE(_dependencyMap[17]).styles.descriptionNoImage + }, "" + this.getClosestEventDate(item, startDate)))) : _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[17]).styles.noImageView + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[17]).styles.cardBottomNoImage + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[17]).styles.titleNoImage, + type: _fontText.Type.bold + }, item.name), _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[17]).styles.descriptionNoImage + }, "" + (location.locationName || "") + sep + (location.city || "") + ", " + (location.state || "") + " " + this.getDistanceString(item)), _react.default.createElement(_fontText.default, { + style: item.primaryImage ? _$$_REQUIRE(_dependencyMap[17]).styles.description : _$$_REQUIRE(_dependencyMap[17]).styles.descriptionNoImage + }, "" + this.getClosestEventDate(item, startDate))))), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[17]).styles.icons + }, _react.default.createElement(_iconTile.default, { + style: { + alignSelf: "flex-start" + }, + icons: [{ + title: global.strings("action_share"), + component: function component(style) { + return _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS, + name: "share", + style: style + }); + }, + onPress: function onPress(clicked) { + _this2.onShare(clicked.name, clicked.eventId); + } + }, { + title: !manager.favoriteIsStored(item) ? global.strings("action_save_for_later") : global.strings("action_remove_from_favorites"), + component: function component(style) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[18]).IconFavorite, { + item: item, + size: 20, + style: style, + eventToggleItemChecker: function eventToggleItemChecker(currentItem, params) { + return currentItem.eventId === params.eventId; + }, + toggleFavoritesEventName: _events.default.TOGGLE_EVENTS_FAVORITE, + isFavoriteChecker: function isFavoriteChecker(toCheck) { + return manager.favoriteIsStored(toCheck); + } + }); + }, + onPress: function onPress(clicked) { + manager.toggleFavorite(clicked); + } + }], + tintColor: color, + item: item, + availableSpace: 5 + })))); + } + }]); + return EventListItem; + }(_react.default.Component); + + exports.EventListItem = EventListItem; + EventListItem.propTypes = { + item: _propTypes.default.shape({ + name: _propTypes.default.string, + description: _propTypes.default.string, + instances: _propTypes.default.array, + location: _propTypes.default.object, + primaryImage: _propTypes.default.shape({ + mediumImageUrl: _propTypes.default.string + }), + seriesStart: _propTypes.default.string, + url: _propTypes.default.string, + handPicked: _propTypes.default.bool + }).isRequired, + manager: _propTypes.default.shape({ + favoriteIsStored: _propTypes.default.func.isRequired, + toggleFavorite: _propTypes.default.func.isRequired, + getLastSearch: _propTypes.default.func.isRequired + }).isRequired, + onItemPress: _propTypes.default.func, + color: _propTypes.default.string.isRequired, + startDate: _propTypes.default.any, + baseLatitude: _propTypes.default.number, + baseLongitude: _propTypes.default.number, + enhanced: _propTypes.default.bool, + portal: _propTypes.default.string.isRequired + }; +},2547,[5,80,7,8,12,14,16,17,28,201,1238,2093,2050,1879,460,1806,462,2548,1969]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + line: { + paddingHorizontal: 10, + paddingVertical: 5 + }, + enhanced: { + backgroundColor: (0, _$$_REQUIRE(_dependencyMap[1]).getEventColor)(), + paddingTop: 10, + paddingBottom: 10, + paddingHorizontal: 10, + paddingVertical: 5, + opacity: 0.9 + }, + title: { + flex: 1, + fontSize: 25, + margin: 10, + color: _$$_REQUIRE(_dependencyMap[2]).colors.white, + textShadowColor: _$$_REQUIRE(_dependencyMap[2]).colors.black, + textShadowOffset: { + width: -2, + height: 2 + }, + textShadowRadius: 2 + }, + titleNoImage: { + flex: 1, + fontSize: 25, + margin: 10, + marginTop: 30, + color: _$$_REQUIRE(_dependencyMap[2]).colors.black + }, + descriptionNoImage: { + flex: 2, + textAlign: "justify", + padding: 5, + paddingLeft: 10, + color: _$$_REQUIRE(_dependencyMap[2]).colors.black + }, + description: { + flex: 2, + textAlign: "justify", + padding: 5, + paddingLeft: 10, + color: _$$_REQUIRE(_dependencyMap[2]).colors.white, + textShadowColor: _$$_REQUIRE(_dependencyMap[2]).colors.black, + textShadowOffset: { + width: -2, + height: 2 + }, + textShadowRadius: 2 + }, + icon: { + height: 30, + width: 30, + marginStart: 5, + marginEnd: 5 + }, + icons: { + position: "absolute", + left: 0, + right: 10, + top: 30 + }, + image: { + borderRadius: 3, + height: 300, + width: "100%", + flex: 1 + }, + tabletImage: { + borderRadius: 3, + height: 500, + width: "100%", + flex: 1 + }, + gradient: { + borderRadius: 3, + height: 300, + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.transparent, + position: "absolute", + top: 0, + start: 0, + end: 0, + bottom: 0 + }, + tabletGradient: { + borderRadius: 3, + height: 500, + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.transparent, + position: "absolute", + top: 0, + start: 0, + end: 0, + bottom: 0 + }, + cardBottom: { + position: "absolute", + bottom: 0, + right: 0, + left: 0, + justifyContent: "flex-start", + alignItems: "flex-start" + }, + cardBottomNoImage: { + justifyContent: "flex-start", + alignItems: "flex-start" + }, + noImageView: { + borderWidth: 1, + borderColor: _$$_REQUIRE(_dependencyMap[2]).colors.grey400, + borderRadius: 3 + } + }); + + exports.styles = styles; +},2548,[28,2474,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2549,[2550]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventCustomCallout = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventCustomCallout; + exports.EventCustomCallout = EventCustomCallout; + + if (_optionalPackageUtils.default.isMapsAvailable()) { + var _class; + + var _OptionalPackages$get = _optionalPackageUtils.default.getMaps(), + Callout = _OptionalPackages$get.Callout; + + exports.EventCustomCallout = EventCustomCallout = (_class = function (_Callout) { + (0, _inherits2.default)(TaCallout, _Callout); + + var _super = _createSuper(TaCallout); + + function TaCallout() { + var _this; + + (0, _classCallCheck2.default)(this, TaCallout); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + + _this.dateFormatter = function (date) { + if (!date) { + return ""; + } + + var out = ""; + + for (var c = 0; c < date.length; c++) { + if (date[c] === "T" || date[c] === "Z") { + out += " "; + } else { + out += date[c]; + } + } + + return out.substring(0, 10); + }; + + return _this; + } + + (0, _createClass2.default)(TaCallout, [{ + key: "render", + value: function render() { + var _this$props = this.props, + title = _this$props.title, + date = _this$props.date; + return _react.default.createElement(_reactNative.View, null, title.length > 50 ? _react.default.createElement(_reactNative.View, null, _react.default.createElement(_reactNative.Text, { + style: { + fontWeight: "bold" + } + }, title.substring(0, 50)), _react.default.createElement(_reactNative.Text, { + style: { + fontWeight: "bold" + } + }, title.substring(50))) : _react.default.createElement(_reactNative.Text, { + style: { + fontWeight: "bold" + } + }, title), _react.default.createElement(_fontText.default, null, this.dateFormatter(date))); + } + }]); + return TaCallout; + }(Callout), _class.propTypes = { + title: _propTypes.default.string, + description: _propTypes.default.string, + image: _propTypes.default.string, + date: _propTypes.default.string + }, _class); + } else { + exports.EventCustomCallout = EventCustomCallout = function (_React$Component) { + (0, _inherits2.default)(TaCallout, _React$Component); + + var _super2 = _createSuper(TaCallout); + + function TaCallout() { + (0, _classCallCheck2.default)(this, TaCallout); + return _super2.apply(this, arguments); + } + + (0, _createClass2.default)(TaCallout, [{ + key: "render", + value: function render() { + return null; + } + }]); + return TaCallout; + }(_react.default.Component); + } +},2550,[5,7,8,12,14,16,17,28,201,1879,731]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventFeaturedComponent = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _eventFeaturedItemComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventFeaturedComponent = function (_Component) { + (0, _inherits2.default)(EventFeaturedComponent, _Component); + + var _super = _createSuper(EventFeaturedComponent); + + function EventFeaturedComponent(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventFeaturedComponent); + _this = _super.call(this, props); + _this.state = { + items: [], + firstLoading: true, + counter: 0 + }; + _this.mounted = false; + _this.animatedValue = new _reactNative.Animated.Value(0); + _this.featuredIds = props.featuredEvents; + return _this; + } + + (0, _createClass2.default)(EventFeaturedComponent, [{ + key: "componentDidMount", + value: function componentDidMount() { + var items; + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + this.mounted = true; + _context.next = 3; + return _regenerator.default.awrap(this.firstLoad()); + + case 3: + items = this.state.items; + + if (items.length > 2) { + this.animate(); + } + + case 5: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + this.mounted = false; + } + }, { + key: "doAjaxCall", + value: function doAjaxCall(params, start) { + var _this$props, getItemById, config, normalizeResults, skipDefaultParams, data, i, ajaxResult; + + return _regenerator.default.async(function doAjaxCall$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + _this$props = this.props, getItemById = _this$props.getItemById, config = _this$props.config, normalizeResults = _this$props.normalizeResults, skipDefaultParams = _this$props.skipDefaultParams; + data = { + events: [] + }; + _context2.prev = 2; + i = start; + + case 4: + if (!(i < Math.min(start + 4, this.featuredIds.length))) { + _context2.next = 12; + break; + } + + _context2.next = 7; + return _regenerator.default.awrap(_Api.default.get(getItemById(this.featuredIds[i]), config, params, skipDefaultParams)); + + case 7: + ajaxResult = _context2.sent; + data.events.push(ajaxResult.data); + + case 9: + i++; + _context2.next = 4; + break; + + case 12: + return _context2.abrupt("return", normalizeResults(data)); + + case 15: + _context2.prev = 15; + _context2.t0 = _context2["catch"](2); + throw _context2.t0; + + case 18: + case "end": + return _context2.stop(); + } + } + }, null, this, [[2, 15]], Promise); + } + }, { + key: "firstLoad", + value: function firstLoad() { + var items, _this$props2, portal, featuredApi, config, featuredEvents, filter, newItems; + + return _regenerator.default.async(function firstLoad$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + items = this.state.items; + _this$props2 = this.props, portal = _this$props2.portal, featuredApi = _this$props2.featuredApi, config = _this$props2.config, featuredEvents = _this$props2.featuredEvents; + filter = { + portal: portal + }; + _context3.prev = 3; + _context3.next = 6; + return _regenerator.default.awrap(this.doAjaxCall(filter, 0)); + + case 6: + newItems = _context3.sent; + this.setState({ + items: items.concat(newItems.items) || [], + firstLoading: false + }); + _context3.next = 13; + break; + + case 10: + _context3.prev = 10; + _context3.t0 = _context3["catch"](3); + this.setState({ + firstLoading: true + }); + + case 13: + case "end": + return _context3.stop(); + } + } + }, null, this, [[3, 10]], Promise); + } + }, { + key: "animate", + value: function animate() { + var _this2 = this; + + var items = this.state.items; + var portal = this.props.portal; + var filter = { + portal: portal + }; + var counter = this.state.counter; + this.animatedValue.setValue(0); + + _reactNative.Animated.timing(this.animatedValue, { + duration: 5000, + useNativeDriver: true + }).start(function () { + return _this2.animate(); + }); + + if (this.mounted) { + this.setState({ + counter: counter + 1 + }, function _callee() { + var newItems; + return _regenerator.default.async(function _callee$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + if (!((counter + 3) % 4 === 0)) { + _context4.next = 5; + break; + } + + _context4.next = 3; + return _regenerator.default.awrap(_this2.doAjaxCall(filter, counter + 3)); + + case 3: + newItems = _context4.sent; + + _this2.setState({ + items: items.concat(newItems.items) || [] + }); + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, null, null, Promise); + }); + } + } + }, { + key: "render", + value: function render() { + var onEventPress = this.props.onEventPress; + var _this$state = this.state, + items = _this$state.items, + firstLoading = _this$state.firstLoading, + counter = _this$state.counter; + var translateX = -_deviceUtils.default.getSafeArea().width / 2; + var itemsToLoad = Math.min(items.length, 3); + var featured = []; + + for (var i = 0; i < itemsToLoad; i++) { + var index = (counter + i) % items.length; + featured.push(_react.default.createElement(_eventFeaturedItemComponent.default, { + key: index, + item: { + key: index, + title: items[index].name, + image: items[index].primaryImage ? items[index].primaryImage.largeImageUrl : undefined, + id: items[index].eventId, + date: _$$_REQUIRE(_dependencyMap[13]).DateUtils.getClosestEventDate(items[index]) + }, + onEventPress: onEventPress + })); + } + + return !firstLoading && items.length ? _react.default.createElement(_reactNative.View, { + style: { + display: "flex", + flexDirection: "row", + justifyContent: items.length === 1 ? "center" : "flex-start", + backgroundColor: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)() + } + }, _react.default.createElement(_reactNative.Animated.View, { + style: { + width: items.length > 2 ? "150%" : items.length == 2 ? "100%" : "75%", + height: _$$_REQUIRE(_dependencyMap[13]).PlatformUtils.isTablet() ? 200 : 100, + display: "flex", + flexDirection: "row", + transform: [{ + translateX: this.animatedValue.interpolate({ + inputRange: [0, 0.7, 1], + outputRange: [0, 0, translateX] + }) + }] + } + }, featured)) : null; + } + }]); + return EventFeaturedComponent; + }(_react.Component); + + exports.EventFeaturedComponent = EventFeaturedComponent; + EventFeaturedComponent.propTypes = { + normalizeResults: _propTypes.default.func.isRequired, + skipDefaultParams: _propTypes.default.bool, + onEventPress: _propTypes.default.func.isRequired, + config: _propTypes.default.shape({ + auth: _propTypes.default.shape({ + username: _propTypes.default.string.isRequired, + password: _propTypes.default.string.isRequired + }) + }), + portal: _propTypes.default.string.isRequired, + featuredApi: _propTypes.default.string.isRequired, + getItemById: _propTypes.default.func.isRequired, + featuredEvents: _propTypes.default.arrayOf(_propTypes.default.number) + }; +},2551,[5,80,7,8,12,14,16,17,201,28,458,431,2552,462,2474]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _reactNativeLinearGradient = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _eventFeaturedItemComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TileGridImage = function (_React$Component) { + (0, _inherits2.default)(TileGridImage, _React$Component); + + var _super = _createSuper(TileGridImage); + + function TileGridImage() { + var _this; + + (0, _classCallCheck2.default)(this, TileGridImage); + + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + _this = _super.call.apply(_super, [this].concat(args)); + _this.NUMBER_OF_TITLE_LINES = 3; + return _this; + } + + (0, _createClass2.default)(TileGridImage, [{ + key: "_getContent", + value: function _getContent() { + var item = this.props.item; + var style = _eventFeaturedItemComponent.default.titleFull; + return _react.default.createElement(_reactNative.View, { + style: _eventFeaturedItemComponent.default.containerFull + }, _react.default.createElement(_reactNative.View, null, _react.default.createElement(_fontText.default, { + numberOfLines: this.NUMBER_OF_TITLE_LINES, + type: _fontText.Type.medium, + style: style + }, item.title), _react.default.createElement(_fontText.default, { + numberOfLines: 1, + type: _fontText.Type.medium, + style: style + }, item.date))); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + item = _this$props.item, + onEventPress = _this$props.onEventPress; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).TileParent, { + bgColor: _$$_REQUIRE(_dependencyMap[14]).colors.white, + style: _eventFeaturedItemComponent.default.tileParent, + hideBottomLine: true + }, _react.default.createElement(_imageComponent.default, { + style: [_eventFeaturedItemComponent.default.imageFull], + source: { + uri: item.image + } + }), item.image ? _react.default.createElement(_reactNativeLinearGradient.default, { + style: _eventFeaturedItemComponent.default.gradient, + colors: [_$$_REQUIRE(_dependencyMap[14]).colors.transparent, _$$_REQUIRE(_dependencyMap[14]).colors.transparent, _$$_REQUIRE(_dependencyMap[14]).colors.transparent200] + }) : undefined, _react.default.createElement(_reactNative.TouchableOpacity, { + style: _eventFeaturedItemComponent.default.parent, + onPress: function onPress() { + onEventPress(item.id); + } + }, this._getContent())); + } + }]); + return TileGridImage; + }(_react.default.Component); + + exports.default = TileGridImage; + TileGridImage.propTypes = { + item: _propTypes.default.shape({ + title: _propTypes.default.string.isRequired, + image: _propTypes.default.string, + id: _propTypes.default.number.isRequired + }), + onEventPress: _propTypes.default.func.isRequired + }; +},2552,[5,7,8,12,14,16,17,28,1238,201,1879,2553,588,2040,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + imageFull: { + position: "absolute", + top: 0, + start: 0, + end: 0, + bottom: 0, + margin: 0 + }, + containerFull: { + flexDirection: "column" + }, + titleFull: { + color: "white", + marginHorizontal: 8, + paddingVertical: 6, + textAlign: "left", + textShadowColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + textShadowOffset: { + width: -2, + height: 2 + }, + textShadowRadius: 2, + alignItems: "flex-end", + fontSize: 14 + }, + titleFullNoImage: { + color: "black", + marginHorizontal: 8, + paddingVertical: 8, + textAlign: "left", + alignItems: "flex-end", + fontSize: 14 + }, + gradient: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent, + position: "absolute", + top: 0, + start: 0, + end: 0, + bottom: 0 + }, + tileParent: { + display: "flex", + flexDirection: "row", + alignItems: "flex-end", + backgroundColor: (0, _$$_REQUIRE(_dependencyMap[2]).getEventColor)() + }, + parent: { + flexDirection: "row", + alignItems: "flex-end" + } + }); + + exports.default = _default; +},2553,[28,462,2474]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2554,[2555]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventFilterScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventFilterScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(EventFilterScreen, _NavigationBaseScreen); + + var _super = _createSuper(EventFilterScreen); + + function EventFilterScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventFilterScreen); + _this = _super.call(this, props); + + var defaultSearch = _this._getEventsManager().getDefaultSearch(); + + _this.state = (0, _extends2.default)({ + categories: [], + loading: true + }, _this._getFilterFromSearch(defaultSearch)); + _this.onFilterLocationRef = _this._onFilterLocationRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFilterCategoriesRef = _this._onFilterCategoriesRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFilterTimeRangeRef = _this._onFilterTimeRangeRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFilterRadiusRef = _this._onFilterRadiusRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onFilterTextRef = _this._onFilterTextRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onResetLocation = _this._onResetLocation.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSetAsDefaultPress = _this._onSetAsDefaultPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onResetPress = _this._onResetPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSearchPress = _this._onSearchPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSavedSearchesPress = _this._onSavedSearchesPress.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(EventFilterScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(EventFilterScreen.prototype), "componentDidMount", this).call(this); + + this._loading(); + } + }, { + key: "getTag", + value: function getTag() { + return "Event Filter"; + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(EventFilterScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "_getFilterFromSearch", + value: function _getFilterFromSearch() { + var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + return { + filterText: search.searchTerm, + filterRadius: search.radius || 35, + filterTimeRange: search.timeRange, + filterStartDate: search.startDate, + filterEndDate: search.endDate, + filterLatitude: search.latitude, + filterLongitude: search.longitude, + filterUseLocation: search.useLocation || false, + filterLabels: search.labels || [], + filterCategories: search.categories || [] + }; + } + }, { + key: "_onFilterTextRef", + value: function _onFilterTextRef(ref) { + this.filterTextRef = ref; + } + }, { + key: "_onFilterRadiusRef", + value: function _onFilterRadiusRef(ref) { + this.filterRadiusRef = ref; + } + }, { + key: "_onFilterTimeRangeRef", + value: function _onFilterTimeRangeRef(ref) { + this.filterTimeRangeRef = ref; + } + }, { + key: "_onFilterCategoriesRef", + value: function _onFilterCategoriesRef(ref) { + this.filterCategoriesRef = ref; + } + }, { + key: "_onFilterLocationRef", + value: function _onFilterLocationRef(ref) { + this.filterLocationRef = ref; + } + }, { + key: "_getFilterValue", + value: function _getFilterValue(filter, defaultValue) { + var value = defaultValue; + + if (filter) { + var filterValue = filter.getValue(); + + if (filterValue) { + value = filterValue; + } + } + + return value; + } + }, { + key: "_onResetLocation", + value: function _onResetLocation() { + var defaultSearch = this._getEventsManager().getDefaultSearch(); + + this.setState({ + filterLatitude: defaultSearch ? defaultSearch.latitude : undefined, + filterLongitude: defaultSearch ? defaultSearch.longitude : undefined + }); + } + }, { + key: "_onSearchPress", + value: function _onSearchPress() { + var navigation = this.props.navigation; + + var _this$_getFilterValue = this._getFilterValue(this.filterLocationRef, {}), + latitude = _this$_getFilterValue.latitude, + longitude = _this$_getFilterValue.longitude, + useLocation = _this$_getFilterValue.useLocation; + + var _this$_getFilterValue2 = this._getFilterValue(this.filterTimeRangeRef, {}), + startDate = _this$_getFilterValue2.startDate, + endDate = _this$_getFilterValue2.endDate, + timeRange = _this$_getFilterValue2.timeRange; + + var _this$_getFilterValue3 = this._getFilterValue(this.filterRadiusRef, {}), + radius = _this$_getFilterValue3.radius; + + var _this$_getFilterValue4 = this._getFilterValue(this.filterCategoriesRef, {}), + selectedCategories = _this$_getFilterValue4.selectedCategories, + selectedLabels = _this$_getFilterValue4.selectedLabels; + + var term = this._getFilterValue(this.filterTextRef, ""); + + var filters = { + startDate: startDate || _$$_REQUIRE(_dependencyMap[13]).DateUtils.getMomentDate().format("YYYY-MM-DD"), + endDate: endDate, + latitude: latitude, + longitude: longitude, + useLocation: useLocation, + radius: radius, + categories: selectedCategories, + searchTerm: term, + timeRange: timeRange, + labels: selectedLabels + }; + + this._getEventsManager().toggleLastSearch(filters); + + this.setState((0, _extends2.default)({}, this._getFilterFromSearch(this._getEventsManager().getLastSearch())), function () { + navigation.navigate("VerticalListScreen", { + filters: filters + }); + }); + return []; + } + }, { + key: "_onResetPress", + value: function _onResetPress() { + var _this2 = this; + + var navigation = this.props.navigation; + var resetted = { + filterText: "", + filterRadius: 35, + filterTimeRange: "", + filterLatitude: undefined, + filterLongitude: undefined, + filterUseLocation: false, + filterCategories: [], + filterLabels: [] + }; + this.setState((0, _extends2.default)({}, resetted), function () { + _this2._getEventsManager().toggleDefaultSearch(resetted, false); + + navigation.navigate("VerticalListScreen", { + filters: {} + }); + }); + } + }, { + key: "_onSavedSearchesPress", + value: function _onSavedSearchesPress() { + var _this$props = this.props, + navigation = _this$props.navigation, + user = _this$props.user, + pass = _this$props.pass, + portal = _this$props.portal; + navigation.navigate("VerticalSavedSearchScreen", { + user: user, + pass: pass, + portal: portal, + labels: this._getLabels() + }); + } + }, { + key: "_onSetAsDefaultPress", + value: function _onSetAsDefaultPress() { + var _this$_getFilterValue5 = this._getFilterValue(this.filterRadiusRef, {}), + radius = _this$_getFilterValue5.radius; + + var _this$_getFilterValue6 = this._getFilterValue(this.filterCategoriesRef, {}), + selectedCategories = _this$_getFilterValue6.selectedCategories, + selectedLabels = _this$_getFilterValue6.selectedLabels; + + var _this$_getFilterValue7 = this._getFilterValue(this.filterTimeRangeRef, {}), + startDate = _this$_getFilterValue7.startDate, + endDate = _this$_getFilterValue7.endDate, + timeRange = _this$_getFilterValue7.timeRange; + + var term = this._getFilterValue(this.filterTextRef, ""); + + var _this$_getFilterValue8 = this._getFilterValue(this.filterLocationRef), + latitude = _this$_getFilterValue8.latitude, + longitude = _this$_getFilterValue8.longitude, + useLocation = _this$_getFilterValue8.useLocation; + + var filters = { + startDate: startDate || _$$_REQUIRE(_dependencyMap[13]).DateUtils.getMomentDate().format("YYYY-MM-DD"), + endDate: endDate, + latitude: latitude, + longitude: longitude, + radius: radius, + categories: selectedCategories, + searchTerm: term, + timeRange: timeRange, + useLocation: useLocation, + labels: selectedLabels + }; + + this._getEventsManager().toggleDefaultSearch(filters, true); + + return []; + } + }, { + key: "_loading", + value: function _loading(callback) { + var _this3 = this; + + return _regenerator.default.async(function _loading$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + this.setState({ + loading: true + }, function _callee() { + var result; + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + result = {}; + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_this3._loadCategories()); + + case 4: + result = _context.sent; + _context.next = 9; + break; + + case 7: + _context.prev = 7; + _context.t0 = _context["catch"](1); + + case 9: + _this3.setState((0, _extends2.default)({ + loading: false + }, result)); + + case 10: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 7]], Promise); + }); + + case 1: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_loadCategories", + value: function _loadCategories() { + var _this$props2, user, pass, portal, config, categories, _await$API$get, data; + + return _regenerator.default.async(function _loadCategories$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _this$props2 = this.props, user = _this$props2.user, pass = _this$props2.pass, portal = _this$props2.portal; + config = { + auth: { + username: user, + password: pass + } + }; + categories = []; + _context3.next = 5; + return _regenerator.default.awrap(_Api.default.get((0, _$$_REQUIRE(_dependencyMap[14]).getEventCategories)(), config, { + portal: portal + })); + + case 5: + _await$API$get = _context3.sent; + data = _await$API$get.data; + data.forEach(function (category) { + if (!category.parentCategoryId) { + categories.push({ + name: category.name, + categoryId: category.categoryId, + content: [] + }); + } else { + var parent = categories.find(function (el) { + return el.categoryId === category.parentCategoryId; + }); + + if (parent) { + parent.content.push({ + name: category.name, + parentCategoryId: category.parentCategoryId, + categoryId: category.categoryId + }); + } + } + }); + return _context3.abrupt("return", { + categories: categories + }); + + case 9: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getLabels", + value: function _getLabels() { + var extraSearchField = this.props.extraSearchField; + + var defaultSearch = this._getEventsManager().getDefaultSearch(); + + var extraLabels; + + try { + extraLabels = JSON.parse(extraSearchField); + } catch (e) { + extraLabels = []; + } + + extraLabels.push({ + name: global.strings("str_editor_picks"), + label: "handPicked" + }); + var labels = []; + extraLabels.forEach(function (extraLabel) { + if (defaultSearch && defaultSearch.labels) { + var isSelected = defaultSearch.labels.find(function (item) { + return item.label === extraLabel.label; + }) !== undefined; + labels.push((0, _extends2.default)({}, extraLabel, { + selected: isSelected + })); + } else { + labels.push(extraLabel); + } + }); + return labels; + } + }, { + key: "_getEventsManager", + value: function _getEventsManager() { + return global.getVerticalsConfig().getEvents(); + } + }, { + key: "render", + value: function render() { + var _this$state = this.state, + categories = _this$state.categories, + loading = _this$state.loading, + filterText = _this$state.filterText, + filterRadius = _this$state.filterRadius, + filterStartDate = _this$state.filterStartDate, + filterEndDate = _this$state.filterEndDate, + filterTimeRange = _this$state.filterTimeRange, + filterLatitude = _this$state.filterLatitude, + filterLongitude = _this$state.filterLongitude, + filterUseLocation = _this$state.filterUseLocation, + filterCategories = _this$state.filterCategories, + filterLabels = _this$state.filterLabels; + var navigation = this.props.navigation; + + var defaultSearch = this._getEventsManager().getDefaultSearch(); + + var labels = this._getLabels(); + + return !loading ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).FilterParent, { + buttons: [{ + label: global.strings("btn_set_as_default"), + onPress: this.onSetAsDefaultPress + }, { + label: global.strings("saved_searches"), + onPress: this.onSavedSearchesPress + }, { + label: global.strings("btn_reset"), + onPress: this.onResetPress + }], + backgroundResizeMode: "cover", + backgroundUrl: (0, _$$_REQUIRE(_dependencyMap[14]).getEventBackground)(), + color: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)(), + onSearch: this.onSearchPress + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).FilterText, { + key: "filter_text", + style: _$$_REQUIRE(_dependencyMap[17]).styles.filter, + borderColor: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)(), + hint: global.strings("vertical_job_text_hint"), + ref: this.onFilterTextRef, + defaultSearch: filterText || null + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[18]).FilterLocation, { + latitude: filterLatitude, + longitude: filterLongitude, + useLocation: filterUseLocation, + key: "filter_location", + style: _$$_REQUIRE(_dependencyMap[17]).styles.filter, + hint: defaultSearch && defaultSearch.latitude && defaultSearch.longitude ? global.strings("change_location_hint") : global.strings("vertical_job_location_hint"), + borderColor: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)(), + textColor: _$$_REQUIRE(_dependencyMap[13]).colors.white, + ref: this.onFilterLocationRef, + onDisableSwitch: this.onResetLocation + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).EventRadiusSlider, { + style: _$$_REQUIRE(_dependencyMap[17]).styles.filter, + color: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)(), + maxValue: 100, + defaultValue: filterRadius, + label: global.strings("change_radius"), + ref: this.onFilterRadiusRef + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[20]).EventModalCategories, { + color: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)(), + label: global.strings("selected_categories"), + selectedLabels: filterLabels, + labels: labels, + selectedCategories: filterCategories, + categories: categories, + ref: this.onFilterCategoriesRef, + multiSelect: true, + navigation: navigation + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).EventModalTimeRange, { + data: [{ + value: "all" + }, { + value: "this_week", + intervalFunction: _$$_REQUIRE(_dependencyMap[13]).DateUtils.thisWeek + }, { + value: "next_week", + intervalFunction: _$$_REQUIRE(_dependencyMap[13]).DateUtils.nextWeek + }, { + value: "this_weekend", + intervalFunction: _$$_REQUIRE(_dependencyMap[13]).DateUtils.thisWeekend + }, { + value: "today", + intervalFunction: _$$_REQUIRE(_dependencyMap[13]).DateUtils.today + }, { + value: "tomorrow", + intervalFunction: _$$_REQUIRE(_dependencyMap[13]).DateUtils.tomorrow + }, { + value: "custom" + }], + color: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)(), + format: "YYYY-MM-DD", + label: global.strings("selected_time_range"), + ref: this.onFilterTimeRangeRef, + timeRange: filterTimeRange, + startDate: filterStartDate, + endDate: filterEndDate + })) : _react.default.createElement(_$$_REQUIRE(_dependencyMap[22]).ProgressCircle, { + parentStyle: _$$_REQUIRE(_dependencyMap[17]).styles.spinner, + text: global.strings("loading"), + spinnerColor: (0, _$$_REQUIRE(_dependencyMap[14]).getEventColor)(), + showText: true + }); + } + }]); + return EventFilterScreen; + }(_$$_REQUIRE(_dependencyMap[23]).NavigationBaseScreen); + + exports.EventFilterScreen = EventFilterScreen; + EventFilterScreen.propTypes = { + user: _propTypes.default.string, + pass: _propTypes.default.string, + portal: _propTypes.default.string, + navigation: _propTypes.default.object.isRequired + }; + EventFilterScreen.defaultProps = { + user: "", + pass: "", + portal: "" + }; +},2555,[5,80,6,7,8,15,90,12,14,16,17,201,431,462,2474,2477,2497,2556,2499,2557,2562,2567,1953,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + parent: { + justifyContent: "center", + alignItems: "center" + }, + background: { + width: "100%", + flex: 1, + flexDirection: "column", + justifyContent: "center", + alignItems: "center" + }, + filterViews: { + maxWidth: 500, + width: "100%", + flexDirection: "column", + justifyContent: "center", + alignItems: "center" + }, + filter: { + width: "100%" + }, + filterButton: {}, + text: { + color: _$$_REQUIRE(_dependencyMap[1]).colors.md_black_1000, + padding: _$$_REQUIRE(_dependencyMap[2]).filterStyles.TEXT_PADDING + } + }); + + exports.styles = styles; +},2556,[28,462,2487]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2557,[2558]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventRadiusSlider = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _slider = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventRadiusSlider = function (_React$Component) { + (0, _inherits2.default)(EventRadiusSlider, _React$Component); + + var _super = _createSuper(EventRadiusSlider); + + function EventRadiusSlider(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventRadiusSlider); + _this = _super.call(this, props); + _this.state = { + radius: props.defaultValue + }; + return _this; + } + + (0, _createClass2.default)(EventRadiusSlider, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + if (newProps.defaultValue !== undefined) { + this.setState({ + radius: newProps.defaultValue + }); + } + } + }, { + key: "getValue", + value: function getValue() { + var radius = this.state.radius; + return { + radius: radius + }; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var radius = this.state.radius; + var _this$props = this.props, + color = _this$props.color, + label = _this$props.label, + maxValue = _this$props.maxValue; + return _react.default.createElement(_reactNative.View, { + style: [{ + backgroundColor: color + }, _$$_REQUIRE(_dependencyMap[10]).styles.container] + }, _react.default.createElement(_reactNative.Text, { + style: _$$_REQUIRE(_dependencyMap[10]).styles.text + }, label), _react.default.createElement(_slider.default, { + minimumTrackTintColor: _$$_REQUIRE(_dependencyMap[11]).colors.white, + maximumTrackTintColor: _$$_REQUIRE(_dependencyMap[11]).colors.grey300, + thumbTintColor: _$$_REQUIRE(_dependencyMap[11]).colors.white, + style: _$$_REQUIRE(_dependencyMap[10]).styles.slider, + value: radius, + maximumValue: maxValue, + minimumValue: 1, + step: 1, + onValueChange: function onValueChange(r) { + return _this2.setState({ + radius: r + }); + } + }), _react.default.createElement(_reactNative.Text, { + style: _$$_REQUIRE(_dependencyMap[10]).styles.text + }, parseInt(radius, 10) + "mi")); + } + }]); + return EventRadiusSlider; + }(_react.default.Component); + + exports.EventRadiusSlider = EventRadiusSlider; + EventRadiusSlider.propTypes = { + label: _propTypes.default.string, + color: _propTypes.default.string, + maxValue: _propTypes.default.number.isRequired, + defaultValue: _propTypes.default.number.isRequired + }; +},2558,[5,7,8,12,14,16,17,28,2559,201,2561,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _RNCSliderNativeComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var SliderComponent = function SliderComponent(props, forwardedRef) { + var style = _reactNative.StyleSheet.compose(styles.slider, props.style); + + var onValueChange = props.onValueChange, + onSlidingStart = props.onSlidingStart, + onSlidingComplete = props.onSlidingComplete, + localProps = (0, _objectWithoutProperties2.default)(props, ["onValueChange", "onSlidingStart", "onSlidingComplete"]); + var onValueChangeEvent = onValueChange ? function (event) { + var userEvent = true; + + if (_reactNative.Platform.OS === 'android') { + userEvent = event.nativeEvent.fromUser != null && event.nativeEvent.fromUser; + } + + userEvent && onValueChange(event.nativeEvent.value); + } : null; + var onChangeEvent = onValueChangeEvent; + var onSlidingStartEvent = onSlidingStart ? function (event) { + onSlidingStart(event.nativeEvent.value); + } : null; + var onSlidingCompleteEvent = onSlidingComplete ? function (event) { + onSlidingComplete(event.nativeEvent.value); + } : null; + return _react.default.createElement(_RNCSliderNativeComponent.default, (0, _extends2.default)({}, localProps, { + thumbImage: _reactNative.Image.resolveAssetSource(props.thumbImage), + ref: forwardedRef, + style: style, + onChange: onChangeEvent, + onRNCSliderSlidingStart: onSlidingStartEvent, + onRNCSliderSlidingComplete: onSlidingCompleteEvent, + onRNCSliderValueChange: onValueChangeEvent, + enabled: !props.disabled, + onStartShouldSetResponder: function onStartShouldSetResponder() { + return true; + }, + onResponderTerminationRequest: function onResponderTerminationRequest() { + return false; + } + })); + }; + + var SliderWithRef = _react.default.forwardRef(SliderComponent); + + SliderWithRef.defaultProps = { + disabled: false, + value: 0, + minimumValue: 0, + maximumValue: 1, + step: 0, + inverted: false + }; + var styles; + + if (_reactNative.Platform.OS === 'ios') { + styles = _reactNative.StyleSheet.create({ + slider: { + height: 40 + } + }); + } else { + styles = _reactNative.StyleSheet.create({ + slider: {} + }); + } + + var Slider = SliderWithRef; + var _default = Slider; + exports.default = _default; +},2559,[5,6,108,17,28,2560]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var RNCSliderNativeComponent = (0, _reactNative.requireNativeComponent)('RNCSlider'); + var _default = RNCSliderNativeComponent; + exports.default = _default; +},2560,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + container: { + marginTop: 10, + height: 50, + borderRadius: 5, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "center", + marginRight: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginLeft: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN + }, + text: { + color: _$$_REQUIRE(_dependencyMap[2]).colors.white, + padding: _$$_REQUIRE(_dependencyMap[1]).filterStyles.TEXT_PADDING, + width: "25%" + }, + slider: { + width: "50%" + } + }); + + exports.styles = styles; +},2561,[28,2487,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2562,[2563]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventModalCategories = undefined; + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _modal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var _labelsStateFromProps = function _labelsStateFromProps(props) { + var labels = props.labels, + selectedLabels = props.selectedLabels; + return labels.map(function (item) { + var isSelected = selectedLabels.includes(item.label); + return (0, _extends2.default)({}, item, { + checked: item.selected || isSelected + }); + }); + }; + + var _categoriesStateFromProps = function _categoriesStateFromProps(props) { + var categories = props.categories, + selectedCategories = props.selectedCategories; + return categories.map(function (category) { + category.checked = selectedCategories && selectedCategories.includes(category.categoryId); + category.content.map(function (el) { + el.checked = selectedCategories && selectedCategories.includes(el.categoryId); + return el; + }); + return category; + }); + }; + + var _getNumberOfCheckedInList = function _getNumberOfCheckedInList() { + var list = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var counter = 0; + list.forEach(function (item) { + if (item.checked) { + counter += 1; + } + }); + return counter; + }; + + var _getNumberOfChecked = function _getNumberOfChecked() { + var labels = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var categories = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + + var counter = _getNumberOfCheckedInList(labels); + + counter += _getNumberOfCheckedInList(categories); + categories.forEach(function (category) { + counter += _getNumberOfCheckedInList(category.content); + }); + return counter || "All"; + }; + + var EventModalCategories = (0, _react.forwardRef)(function (props, ref) { + var color = props.color, + title = props.label, + multiSelect = props.multiSelect; + + var _useState = (0, _react.useState)(false), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + modalVisible = _useState2[0], + setModalVisible = _useState2[1]; + + var _useState3 = (0, _react.useState)([]), + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), + labels = _useState4[0], + setLabels = _useState4[1]; + + var _useState5 = (0, _react.useState)([]), + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), + categories = _useState6[0], + setCategories = _useState6[1]; + + var _resetLabels = function _resetLabels() { + return setLabels(_labelsStateFromProps(props)); + }; + + var _resetCategories = function _resetCategories() { + return setCategories(_categoriesStateFromProps(props)); + }; + + var _reset = function _reset() { + _resetLabels(); + + _resetCategories(); + }; + + var _getValue = function _getValue() { + var selectedCategories = []; + categories.forEach(function (category) { + if (category.checked) { + selectedCategories.push(category.categoryId); + } + + if (category.content) { + category.content.forEach(function (categoryChild) { + if (categoryChild.checked) { + selectedCategories.push(categoryChild.categoryId); + } + }); + } + }); + var selectedLabels = []; + labels.forEach(function (_ref) { + var label = _ref.label, + checked = _ref.checked; + + if (checked) { + selectedLabels.push(label); + } + }); + return { + selectedCategories: selectedCategories, + selectedLabels: selectedLabels + }; + }; + + (0, _react.useEffect)(function () { + _resetCategories(); + }, [props.categories, props.selectedCategories]); + (0, _react.useEffect)(function () { + _resetLabels(); + }, [props.labels, props.selectedLabels]); + (0, _react.useImperativeHandle)(ref, function () { + return { + getValue: function getValue() { + return _getValue(); + } + }; + }); + return _react.default.createElement(_reactNative.View, null, _react.default.createElement(_modal.default, { + visible: modalVisible, + onClose: function onClose() { + return setModalVisible(false); + }, + foregroundColor: color, + hasFooter: true, + onConfirm: function onConfirm() { + setModalVisible(false); + return true; + }, + onCancel: function onCancel() { + _reset(); + + setModalVisible(false); + return true; + }, + containerStyle: { + padding: 20, + flex: 1, + flexDirection: "column", + justifyContent: "flex-end" + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).Labels, { + labels: labels, + onChange: function onChange(updated) { + return setLabels((0, _toConsumableArray2.default)(updated)); + } + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Categories, { + categories: categories, + color: color, + multiSelect: multiSelect, + onChange: function onChange(updated) { + return setCategories((0, _toConsumableArray2.default)(updated)); + } + })), _react.default.createElement(_reactNative.TouchableOpacity, { + style: [{ + backgroundColor: color + }, _$$_REQUIRE(_dependencyMap[11]).styles.container], + onPress: function onPress() { + setModalVisible(true); + } + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[11]).styles.text + }, title + ": " + _getNumberOfChecked(labels, categories)))); + }); + exports.EventModalCategories = EventModalCategories; + EventModalCategories.propTypes = { + selectedCategories: _propTypes.default.arrayOf(_propTypes.default.string), + categories: _propTypes.default.arrayOf(_propTypes.default.shape({ + name: _propTypes.default.string.isRequired, + categoryId: _propTypes.default.number.isRequired, + parentCategoryId: _propTypes.default.number + })), + selectedLabels: _propTypes.default.arrayOf(_propTypes.default.string), + labels: _propTypes.default.arrayOf(_propTypes.default.shape({ + name: _propTypes.default.string.isRequired, + label: _propTypes.default.string.isRequired, + selected: _propTypes.default.bool + })), + label: _propTypes.default.string.isRequired, + color: _propTypes.default.string.isRequired, + multiSelect: _propTypes.default.bool + }; + EventModalCategories.defaultProps = { + labels: [], + categories: [], + selectedCategories: [], + selectedLabels: [] + }; +},2563,[5,21,41,6,17,28,201,1879,1882,2564,2566,2565]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Labels = Labels; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function Label(props) { + var label = props.label, + onChange = props.onChange; + + var _useState = (0, _react.useState)(label.checked), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + checked = _useState2[0], + setChecked = _useState2[1]; + + (0, _react.useEffect)(function () { + label.checked = checked; + + if (typeof onChange === "function") { + onChange(label); + } + }, [checked]); + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[6]).styles.categoryContainer, _$$_REQUIRE(_dependencyMap[6]).styles.labelsContainer] + }, _react.default.createElement(_fontText.default, { + type: "medium" + }, label.name), _react.default.createElement(_reactNative.Switch, { + onValueChange: function onValueChange(value) { + return setChecked(value); + }, + value: checked, + ios_backgroundColor: _$$_REQUIRE(_dependencyMap[7]).colors.grey200 + })); + } + + Label.propTypes = { + label: _propTypes.default.shape({ + name: _propTypes.default.string.isRequired, + checked: _propTypes.default.bool.isRequired + }).isRequired, + onChange: _propTypes.default.func.isRequired + }; + + function Labels(props) { + var _onChange = props.onChange, + labelsProp = props.labels; + var labels = (0, _react.useRef)(labelsProp); + return labels.current.map(function (item, index) { + return _react.default.createElement(Label, { + key: index, + label: item, + onChange: function onChange(label) { + if (typeof _onChange === "function") { + labels.current[index].checked = label.checked; + + _onChange(labels.current); + } + } + }); + }); + } + + Labels.propTypes = { + labels: _propTypes.default.array.isRequired, + onChange: _propTypes.default.func.isRequired + }; +},2564,[5,41,17,201,28,1879,2565,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + container: { + marginTop: 15, + height: 50, + borderRadius: 5, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "center", + marginLeft: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginRight: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN + }, + text: { + padding: 5, + color: _$$_REQUIRE(_dependencyMap[2]).colors.white, + margin: 0 + }, + categoryContainer: { + flexDirection: "row", + alignItems: "center", + padding: 10 + }, + labelsContainer: { + justifyContent: "space-between" + }, + subCategoryContainer: { + flexDirection: "row", + alignItems: "center", + padding: 12, + margin: 2, + marginLeft: 25 + }, + lineContainer: { + flexDirection: "row", + alignItems: "center", + padding: 10 + }, + line: { + flex: 1, + paddingHorizontal: 10, + paddingVertical: 5 + }, + category: { + flex: 1, + paddingHorizontal: 10, + paddingVertical: 5 + }, + icon: { + fontSize: 15, + height: 15, + width: 15 + } + }); + + exports.styles = styles; +},2565,[28,2487,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Categories = Categories; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[5]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _accordionComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[8])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function Line(props) { + var style = props.style, + onPress = props.onPress, + checked = props.checked, + color = props.color, + text = props.text, + children = props.children; + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[10]).styles.lineContainer, style] + }, children, _react.default.createElement(_reactNative.TouchableOpacity, { + style: { + flex: 1 + }, + onPress: onPress + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[10]).styles.line + }, "" + text)), checked ? _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "check", + style: [{ + color: color + }, _$$_REQUIRE(_dependencyMap[10]).styles.icon] + }) : null); + } + + function Category(props) { + var category = props.category, + color = props.color, + hasChildren = props.hasChildren, + checked = props.checked, + onCheck = props.onCheck, + subListStyle = props.subListStyle, + onChange = props.onChange; + + if (hasChildren) { + var hasChildrenChecked = category.content.findIndex(function (el) { + return el.checked; + }) > -1; + return _react.default.createElement(_accordionComponent.default, { + sections: [category], + renderHeader: function renderHeader(section, _, expanded) { + return _react.default.createElement(Line, { + onPress: onCheck, + checked: checked, + text: section.name + }, _react.default.createElement(_iconComponent.default, { + style: (0, _extends2.default)({ + fontSize: 18 + }, hasChildrenChecked ? { + color: color + } : {}), + name: expanded ? "chevron-up" : "chevron-down", + type: _iconComponent.TecnaviaIconType.MATERIAL_COMMUNITY_ICONS + })); + }, + renderContent: function renderContent(section) { + return _react.default.createElement(Categories, { + categories: section.content, + color: color, + multiSelect: false, + style: subListStyle, + onChange: onChange + }); + } + }); + } + + return _react.default.createElement(Line, { + onPress: onCheck, + checked: checked, + text: category.name + }); + } + + function Categories(props) { + var color = props.color, + multiSelect = props.multiSelect, + categoriesProp = props.categories, + style = props.style, + _onChange = props.onChange; + var categories = (0, _react.useRef)((0, _toConsumableArray2.default)(categoriesProp)); + + var _useState = (0, _react.useState)(categories.current.map(function (item, _i) { + return item.checked ? _i : -1; + }).filter(function (_i) { + return _i > -1; + })), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + checkedIndexes = _useState2[0], + setCheckedIndexes = _useState2[1]; + + var _handleCheck = function _handleCheck(index) { + if (!multiSelect) { + categories.current.forEach(function (el) { + el.checked = false; + }); + checkedIndexes.splice(0, checkedIndexes.length); + checkedIndexes.push(index); + categories.current[index].checked = true; + } else { + if (checkedIndexes.includes(index)) { + checkedIndexes.splice(checkedIndexes.indexOf(index), 1); + categories.current[index].checked = false; + } else { + checkedIndexes.push(index); + categories.current[index].checked = true; + } + } + + setCheckedIndexes((0, _toConsumableArray2.default)(checkedIndexes)); + }; + + (0, _react.useEffect)(function () { + if (typeof _onChange === "function") { + _onChange(categories.current); + } + }, [checkedIndexes]); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).TecnaviaFlatList, { + style: style, + data: categories.current, + keyExtractor: function keyExtractor(_, index) { + return "categories_" + index; + }, + renderItem: function renderItem(_ref) { + var item = _ref.item, + index = _ref.index; + var hasChildren = item.content && item.content.length > 0; + return _react.default.createElement(Category, { + category: item, + color: color, + hasChildren: hasChildren, + onCheck: function onCheck() { + return _handleCheck(index); + }, + checked: checkedIndexes.includes(index), + subListStyle: { + marginLeft: 20 + }, + onChange: function onChange(selectedItems) { + categories.current[index].content = selectedItems; + + if (typeof _onChange === "function") { + _onChange(categories.current); + } + } + }); + } + }); + } + + Categories.propTypes = { + color: _propTypes.default.string, + style: _propTypes.default.any, + categories: _propTypes.default.arrayOf(_propTypes.default.shape({ + name: _propTypes.default.string, + checked: _propTypes.default.bool, + content: _propTypes.default.arrayOf(_propTypes.default.shape({ + name: _propTypes.default.string, + checked: _propTypes.default.bool + })) + })), + multiSelect: _propTypes.default.bool, + onChange: _propTypes.default.func + }; +},2566,[5,41,21,6,17,28,201,2482,1806,1879,2565,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2567,[2568]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventModalTimeRange = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _rangepickerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _modal = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventModalTimeRange = function (_Component) { + (0, _inherits2.default)(EventModalTimeRange, _Component); + + var _super = _createSuper(EventModalTimeRange); + + function EventModalTimeRange(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventModalTimeRange); + _this = _super.call(this, props); + _this.state = { + modalVisible: false, + timeRange: props.timeRange || "all", + selectedIndex: props.data.findIndex(function (el) { + return el.value === props.timeRange; + }), + rangePickerIsVisible: false + }; + return _this; + } + + (0, _createClass2.default)(EventModalTimeRange, [{ + key: "UNSAFE_componentWillReceiveProps", + value: function UNSAFE_componentWillReceiveProps(newProps) { + var data = this.props.data; + + if (newProps.timeRange !== undefined) { + this.setState({ + selectedIndex: data.findIndex(function (el) { + return el.value === newProps.timeRange; + }), + rangePickerIsVisible: false, + timeRange: newProps.timeRange + }); + } + } + }, { + key: "setModalVisible", + value: function setModalVisible(visible) { + this.setState({ + modalVisible: visible + }); + } + }, { + key: "getValue", + value: function getValue() { + var selectedIndex = this.state.selectedIndex; + var _this$props = this.props, + data = _this$props.data, + format = _this$props.format; + + if (selectedIndex > 0) { + if (data[selectedIndex].intervalFunction) { + return { + startDate: data[selectedIndex].intervalFunction().begin.format(format), + endDate: data[selectedIndex].intervalFunction().end.format(format), + timeRange: data[selectedIndex].value + }; + } + + return { + startDate: _$$_REQUIRE(_dependencyMap[13]).DateUtils.getDateString(this.start, format), + endDate: _$$_REQUIRE(_dependencyMap[13]).DateUtils.getDateString(this.end, format), + timeRange: data[selectedIndex].value + }; + } + + return {}; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _this$state = this.state, + modalVisible = _this$state.modalVisible, + timeRange = _this$state.timeRange, + selectedIndex = _this$state.selectedIndex, + rangePickerIsVisible = _this$state.rangePickerIsVisible; + var _this$props2 = this.props, + label = _this$props2.label, + color = _this$props2.color, + data = _this$props2.data; + return _react.default.createElement(_reactNative.View, null, _react.default.createElement(_modal.default, { + visible: modalVisible, + onClose: function onClose() { + return _this2.setModalVisible(false); + }, + foregroundColor: color, + hasFooter: true, + onConfirm: function onConfirm() { + _this2.setModalVisible(false); + + return true; + }, + onCancel: function onCancel() { + _this2.setModalVisible(false); + + _this2.setState({ + selectedIndex: 0, + timeRange: "", + rangePickerIsVisible: false + }); + + return true; + }, + containerStyle: { + padding: 20 + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).TecnaviaFlatList, { + data: data, + keyExtractor: function keyExtractor(item, index) { + return "time_range_" + index; + }, + renderItem: function renderItem(_ref) { + var item = _ref.item, + index = _ref.index; + var checked = index === selectedIndex ? _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "check", + style: [{ + color: color + }, _$$_REQUIRE(_dependencyMap[15]).styles.icon] + }) : null; + return _react.default.createElement(_reactNative.TouchableOpacity, { + style: _$$_REQUIRE(_dependencyMap[15]).styles.itemContainer, + onPress: function onPress() { + var dateInterval = data[index].intervalFunction; + + if (selectedIndex === index) { + _this2.setState({ + selectedIndex: 0, + rangePickerIsVisible: false, + timeRange: "" + }); + } else { + _this2.setState({ + selectedIndex: index, + rangePickerIsVisible: !dateInterval && index !== 0, + timeRange: data[index].value + }); + } + } + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[15]).styles.itemText + }, _$$_REQUIRE(_dependencyMap[13]).DateUtils.getTimeRangeString(item.value)), checked); + } + }), rangePickerIsVisible ? _react.default.createElement(_rangepickerComponent.default, { + showText: false, + color: color, + onRangeChange: function onRangeChange(start, end) { + _this2.start = start; + _this2.end = end; + }, + containerStyle: _$$_REQUIRE(_dependencyMap[15]).styles.pickerContainer, + pickerProps: { + locale: global.getLocaleConfig().getCurrentLocale() + }, + pickerStartProps: { + style: { + marginStart: 0 + } + }, + pickerEndProps: { + style: { + marginEnd: 0 + } + } + }) : null), _react.default.createElement(_reactNative.TouchableOpacity, { + style: [{ + backgroundColor: color + }, _$$_REQUIRE(_dependencyMap[15]).styles.container], + onPress: function onPress() { + return _this2.setModalVisible(true); + } + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[15]).styles.text + }, label + ": " + (_$$_REQUIRE(_dependencyMap[13]).DateUtils.getTimeRangeString(timeRange) || global.strings("all"))))); + } + }]); + return EventModalTimeRange; + }(_react.Component); + + exports.EventModalTimeRange = EventModalTimeRange; + EventModalTimeRange.propTypes = { + label: _propTypes.default.string.isRequired, + color: _propTypes.default.string.isRequired, + timeRange: _propTypes.default.string, + format: _propTypes.default.string.isRequired, + data: _propTypes.default.arrayOf(_propTypes.default.shape({ + intervalFunction: Function, + title: String, + value: String + })) + }; +},2568,[5,7,8,12,14,16,17,28,201,2264,1806,1882,1879,462,1910,2569]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + container: { + marginTop: 15, + height: 50, + borderRadius: 5, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "center", + marginLeft: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginRight: _$$_REQUIRE(_dependencyMap[1]).filterStyles.MARGIN, + marginBottom: 10 + }, + pickerContainer: { + flexDirection: "row", + width: "100%", + height: 50, + padding: 10 + }, + icon: { + fontSize: 15, + height: 15, + width: 15 + }, + itemContainer: { + height: 50, + justifyContent: "center", + flexDirection: "row", + padding: 10 + }, + itemText: { + flex: 1 + }, + text: { + padding: 5, + color: _$$_REQUIRE(_dependencyMap[2]).colors.white + } + }); + + exports.styles = styles; +},2569,[28,2487,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2570,[2571]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventFavoritesScreen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventFavoritesScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(EventFavoritesScreen, _NavigationBaseScreen); + + var _super = _createSuper(EventFavoritesScreen); + + function EventFavoritesScreen() { + (0, _classCallCheck2.default)(this, EventFavoritesScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(EventFavoritesScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(EventFavoritesScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getTag", + value: function getTag() { + return "Event Favorites"; + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + navigation = _this$props.navigation, + user = _this$props.user, + pass = _this$props.pass, + portal = _this$props.portal; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).VerticalFavoritesList, { + eventName: _events.default.TOGGLE_EVENTS_FAVORITE, + color: (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)(), + searchVerticalManager: global.getVerticalsConfig().getEvents(), + onItemPress: function onItemPress(item) { + navigation.navigate("VerticalDetailScreen", { + id: item.eventId, + user: user, + pass: pass, + portal: portal + }); + }, + renderItem: function renderItem(item) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).EventListItem, { + onItemPress: function onItemPress(clicked) { + navigation.navigate("VerticalDetailScreen", { + id: clicked.eventId, + user: user, + pass: pass, + portal: portal + }); + }, + item: item, + manager: global.getVerticalsConfig().getEvents(), + color: (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)(), + portal: portal + }); + }, + onEmptyPress: function onEmptyPress() { + navigation.navigate("VerticalFiltersScreen"); + }, + itemKey: "eventId" + }); + } + }]); + return EventFavoritesScreen; + }(_$$_REQUIRE(_dependencyMap[12]).NavigationBaseScreen); + + exports.EventFavoritesScreen = EventFavoritesScreen; +},2571,[5,7,8,90,12,14,16,17,460,2510,2474,2572,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2572,[2547]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventDetailScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _iconTile = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _fontTextInput = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[16])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventDetailScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(EventDetailScreen, _NavigationBaseScreen); + + var _super = _createSuper(EventDetailScreen); + + function EventDetailScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventDetailScreen); + _this = _super.call(this, props); + + _this.onShare = function _callee(message, id) { + var _getNavigationParams, _getNavigationParams$, portal; + + return _regenerator.default.async(function _callee$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[18]).getNavigationParams)(_this.props), _getNavigationParams$ = _getNavigationParams.portal, portal = _getNavigationParams$ === undefined ? "" : _getNavigationParams$; + _context.prev = 1; + _context.next = 4; + return _regenerator.default.awrap(_reactNative.Share.share({ + message: message, + url: global.strings("share_event_url", { + portal: portal, + id: id + }) + })); + + case 4: + _context.next = 8; + break; + + case 6: + _context.prev = 6; + _context.t0 = _context["catch"](1); + + case 8: + case "end": + return _context.stop(); + } + } + }, null, null, [[1, 6]], Promise); + }; + + _this.state = { + loading: true, + data: {} + }; + return _this; + } + + (0, _createClass2.default)(EventDetailScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(EventDetailScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "componentDidMount", + value: function componentDidMount() { + this.firstLoad(); + } + }, { + key: "getTag", + value: function getTag() { + return "Event Details"; + } + }, { + key: "filterInstances", + value: function filterInstances(data) { + var instances = []; + + if (!data.instances) { + return instances; + } + + var today = _$$_REQUIRE(_dependencyMap[19]).DateUtils.getMomentStartOfDay(); + + data.instances.forEach(function (instance) { + if (_$$_REQUIRE(_dependencyMap[19]).DateUtils.getMomentDate(instance.startDateTime) >= today) { + instances.push({ + start: _$$_REQUIRE(_dependencyMap[19]).DateUtils.getMomentDate(instance.startDateTime).utc(), + end: instance.endDateTime ? _$$_REQUIRE(_dependencyMap[19]).DateUtils.getMomentDate(instance.endDateTime).utc() : null + }); + } + }); + return instances; + } + }, { + key: "firstLoad", + value: function firstLoad() { + var _this2 = this; + + return _regenerator.default.async(function firstLoad$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + this.setState({ + loading: true, + data: {} + }, function _callee2() { + var params, _params$id, id, _params$user, user, _params$pass, pass, _params$portal, portal, username, password, api, config, result; + + return _regenerator.default.async(function _callee2$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + params = (0, _$$_REQUIRE(_dependencyMap[18]).getNavigationParams)(_this2.props); + _params$id = params.id, id = _params$id === undefined ? "" : _params$id, _params$user = params.user, user = _params$user === undefined ? "" : _params$user, _params$pass = params.pass, pass = _params$pass === undefined ? "" : _params$pass, _params$portal = params.portal, portal = _params$portal === undefined ? "" : _params$portal; + username = user; + password = pass; + api = (0, _$$_REQUIRE(_dependencyMap[20]).getEventById)(id); + config = { + auth: { + username: username, + password: password + } + }; + _context2.next = 8; + return _regenerator.default.awrap(_Api.default.get(api, config, { + portal: portal + })); + + case 8: + result = _context2.sent; + + _this2.setState({ + loading: false, + data: result.data + }); + + case 10: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + }); + + case 1: + case "end": + return _context3.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "render", + value: function render() { + var _this3 = this; + + var _this$state = this.state, + data = _this$state.data, + loading = _this$state.loading; + var categories = global.strings("str_no_categories"); + var description = ""; + + var _getNavigationParams2 = (0, _$$_REQUIRE(_dependencyMap[18]).getNavigationParams)(this.props), + _getNavigationParams3 = _getNavigationParams2.isVirtual, + isVirtual = _getNavigationParams3 === undefined ? "" : _getNavigationParams3; + + var filteredInstances = this.filterInstances(data); + var manager = global.getVerticalsConfig().getEvents(); + + if (data.description) { + for (var i = 0; i < data.description.length; i++) { + description += data.description[i] === "\n" ? "\n\n" : data.description[i]; + } + } else { + description = ""; + } + + if (data.categories && data.categories.length) { + categories = ""; + var len = data.categories.length; + + for (var _i = 0; _i < len - 1; _i++) { + categories += data.categories[_i].name + ", "; + } + + categories += data.categories[len - 1].name; + } + + if (!loading) { + var _data$price = data.price, + free = _data$price.free, + lowerPrice = _data$price.lowerPrice, + upperPrice = _data$price.upperPrice; + var priceString; + + if (free) { + priceString = global.strings("str_free"); + } else if (lowerPrice && upperPrice && lowerPrice === upperPrice) { + priceString = "$" + lowerPrice; + } else if (lowerPrice && upperPrice) { + priceString = "$" + lowerPrice + " - $" + upperPrice; + } else { + priceString = global.strings("str_not_available"); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[21]).TecnaviaScrollView, { + showsVerticalScrollIndicator: false + }, data.primaryImage ? _react.default.createElement(_imageComponent.default, { + source: { + uri: data.primaryImage.largeImageUrl + }, + style: _$$_REQUIRE(_dependencyMap[22]).styles.image + }) : null, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.title + }, _react.default.createElement(_fontText.default, { + style: { + fontSize: 16, + color: _$$_REQUIRE(_dependencyMap[19]).colors.white + }, + type: _fontText.Type.bold + }, data.name)), _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, filteredInstances.map(function (element, index) { + return index < 7 ? _react.default.createElement(_fontText.default, { + key: index, + type: index === 0 && filteredInstances.length > 1 ? "bold" : "regular" + }, filteredInstances[index].start.format("dddd, MMMM D, YYYY: hh-mmA"), filteredInstances[index].end ? " - " + filteredInstances[0].end.format("h:mmA") : "") : null; + })), data.location ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.map + }, _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.location, + type: _fontText.Type.bold + }, global.strings("str_location")), _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.location + }, data.location.locationName), data.location.address ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.location + }, data.location.address) : null, data.location.city && data.location.state ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.location + }, data.location.city, ", ", data.location.state) : null) : null, isVirtual ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold + }, "Virtual Event URL: "), data.links.length && data.links[0].name && data.links[0].linkUrl ? _react.default.createElement(_fontText.default, { + style: { + color: _$$_REQUIRE(_dependencyMap[19]).colors.md_blue_600 + }, + onPress: function onPress() { + _tecnaviaPlatformUtils.default.openURL(data.links[0].linkUrl); + } + }, data.links[0].linkUrl) : _react.default.createElement(_fontText.default, { + type: _fontText.Type.regular + }, "No website has been specified for this event.")) : null, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold + }, "Price:"), _react.default.createElement(_fontText.default, null, priceString)), data.description ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, _react.default.createElement(_fontText.default, { + style: { + color: _$$_REQUIRE(_dependencyMap[19]).colors.black + }, + type: _fontText.Type.bold + }, global.strings("str_description")), _react.default.createElement(_fontTextInput.default, { + multiline: true, + editable: false, + dataDetectorTypes: "all" + }, description)) : null, data.categories.length > 0 ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, _react.default.createElement(_fontText.default, { + style: { + color: _$$_REQUIRE(_dependencyMap[19]).colors.black + }, + type: _fontText.Type.bold + }, global.strings("categories"), ":"), _react.default.createElement(_fontText.default, null, categories)) : null, data.contact && (data.contact.organization || data.contact.name || data.contact.email || data.contact.phone) ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, _react.default.createElement(_fontText.default, { + type: "bold" + }, "Contact info:"), data.contact.organization ? _react.default.createElement(_fontTextInput.default, { + editable: false, + dataDetectorTypes: "all", + multiline: true + }, data.contact.organization) : null, data.contact.name ? _react.default.createElement(_fontTextInput.default, { + editable: false, + dataDetectorTypes: "all", + multiline: true + }, data.contact.name) : null, data.contact.email ? _react.default.createElement(_fontTextInput.default, { + editable: false, + dataDetectorTypes: "all", + multiline: true + }, data.contact.email) : null, data.contact.phone ? _react.default.createElement(_fontTextInput.default, { + editable: false, + dataDetectorTypes: "all", + multiline: true + }, data.contact.phone) : null) : null, data.media && data.media.length ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, _react.default.createElement(_fontText.default, { + type: "bold" + }, "Media:"), data.media.map(function (url) { + return _react.default.createElement(_fontText.default, { + style: { + color: _$$_REQUIRE(_dependencyMap[19]).colors.md_blue_600 + }, + onPress: function onPress() { + _tecnaviaPlatformUtils.default.openURL(url); + } + }, url); + })) : null, data.links.length && data.links[0].name && data.links[0].linkUrl ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.section + }, _react.default.createElement(_fontText.default, { + type: "bold" + }, "More info:"), _react.default.createElement(_fontText.default, { + style: { + color: _$$_REQUIRE(_dependencyMap[19]).colors.md_blue_600 + }, + onPress: function onPress() { + _tecnaviaPlatformUtils.default.openURL(data.links[0].linkUrl); + } + }, data.links[0].name)) : null, data.location ? _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.map + }, _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + var scheme = _reactNative.Platform.select({ + ios: "maps:0,0?q=", + android: "geo:0,0?q=" + }); + + var latLng = data.location.latitude + "," + data.location.longitude; + var label = data.name; + + var url = _reactNative.Platform.select({ + ios: "" + scheme + label + "@" + latLng, + android: "" + scheme + latLng + "(" + label + ")" + }); + + _tecnaviaPlatformUtils.default.openURL(url); + } + }, _react.default.createElement(_imageComponent.default, { + source: { + uri: "https://maps.googleapis.com/maps/api/staticmap?size=800x600&zoom=15¢er=" + data.location.latitude + "," + data.location.longitude + "&markers=color:blue%7C" + data.location.latitude + "," + data.location.longitude + "&key=AIzaSyCOsXayiWmGzfoIxTM6BQYa0HY7Z89h0Aw" + }, + style: _$$_REQUIRE(_dependencyMap[22]).styles.image + }))) : null, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[22]).styles.icons + }, _react.default.createElement(_iconTile.default, { + icons: [{ + title: global.strings("action_share"), + component: function component(style) { + return _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.MATERIAL_ICONS, + name: "share", + style: style + }); + }, + onPress: function onPress(clicked) { + _this3.onShare(clicked.name, clicked.eventId); + } + }, { + title: !manager.favoriteIsStored(data) ? global.strings("action_save_for_later") : global.strings("action_remove_from_favorites"), + component: function component(style) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).IconFavorite, { + item: data, + size: 20, + style: style, + eventToggleItemChecker: function eventToggleItemChecker(currentItem, params) { + return currentItem.eventId === params.eventId; + }, + toggleFavoritesEventName: _events.default.TOGGLE_EVENTS_FAVORITE, + isFavoriteChecker: function isFavoriteChecker(toCheck) { + return manager.favoriteIsStored(toCheck); + } + }); + }, + onPress: function onPress(clicked) { + manager.toggleFavorite(clicked); + } + }], + tintColor: (0, _$$_REQUIRE(_dependencyMap[20]).getEventColor)(), + item: data, + availableSpace: 5 + }))); + } + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).ProgressCircle, { + parentStyle: _$$_REQUIRE(_dependencyMap[22]).styles.spinner, + text: global.strings("loading"), + spinnerColor: (0, _$$_REQUIRE(_dependencyMap[20]).getEventColor)(), + showText: true + }); + } + }]); + return EventDetailScreen; + }(_$$_REQUIRE(_dependencyMap[18]).NavigationBaseScreen); + + exports.EventDetailScreen = EventDetailScreen; +},2573,[5,80,7,8,90,12,14,16,17,28,460,2093,431,588,1806,2257,1879,1876,2148,462,2474,1909,2574,1969,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + title: { + flexDirection: "row", + justifyContent: "center", + alignItems: "center", + backgroundColor: (0, _$$_REQUIRE(_dependencyMap[1]).getEventColor)(), + minHeight: 50, + padding: 3 + }, + map: { + flexDirection: "column", + marginTop: 10 + }, + section: { + flexDirection: "column", + margin: 10, + marginTop: 20 + }, + bold: { + color: _$$_REQUIRE(_dependencyMap[2]).colors.black + }, + category: { + flex: 95, + color: _$$_REQUIRE(_dependencyMap[2]).colors.black + }, + check: { + flex: 5, + color: (0, _$$_REQUIRE(_dependencyMap[1]).getEventColor)() + }, + image: { + width: "100%", + height: 300 + }, + spinner: { + position: "absolute", + bottom: "50%", + start: 0, + end: 0, + height: 50, + backgroundColor: _$$_REQUIRE(_dependencyMap[2]).colors.white + }, + location: { + marginLeft: 10, + marginBottom: 5 + }, + icons: { + position: "absolute", + left: 0, + right: 10, + top: 25 + } + }); + + exports.styles = styles; +},2574,[28,2474,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2575,[2576]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventSearchScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventSearchScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(EventSearchScreen, _NavigationBaseScreen); + + var _super = _createSuper(EventSearchScreen); + + function EventSearchScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, EventSearchScreen); + _this = _super.call(this, props, { + loading: true + }); + _this.categories = []; + return _this; + } + + (0, _createClass2.default)(EventSearchScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this$props, username, password, portal, api, config; + + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _this$props = this.props, username = _this$props.user, password = _this$props.pass, portal = _this$props.portal; + api = (0, _$$_REQUIRE(_dependencyMap[16]).getEventCategories)(); + config = { + auth: { + username: username, + password: password + } + }; + _context.prev = 3; + _context.next = 6; + return _regenerator.default.awrap(_Api.default.get(api, config, { + portal: portal + })); + + case 6: + this.categories = _context.sent.data; + _context.next = 11; + break; + + case 9: + _context.prev = 9; + _context.t0 = _context["catch"](3); + + case 11: + this.setState({ + loading: false + }); + + case 12: + case "end": + return _context.stop(); + } + } + }, null, this, [[3, 9]], Promise); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(EventSearchScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getTag", + value: function getTag() { + return "Event Search"; + } + }, { + key: "getZoomLevel", + value: function getZoomLevel(radius) { + return 14 - Math.log(radius) / Math.log(2); + } + }, { + key: "GMapCircle", + value: function GMapCircle(lat, lng, rad) { + var detail = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 8; + var color = (0, _$$_REQUIRE(_dependencyMap[16]).getEventColor)(); + var uri = "https://maps.googleapis.com/maps/api/staticmap"; + var staticMapSrc = "key=AIzaSyCOsXayiWmGzfoIxTM6BQYa0HY7Z89h0Aw"; + staticMapSrc += "&markers=color:blue|" + lat + "," + lng; + staticMapSrc += "¢er=" + lat + "," + lng; + staticMapSrc += "&size=800x600"; + staticMapSrc += "&zoom=" + this.getZoomLevel(rad); + staticMapSrc += "&path=fillcolor:0x" + color.substring(1) + "33|color:0xFFFFFF00|weight:1"; + var circle = ""; + var r = 3959.87; + var pi = Math.PI; + + var _lat = lat * pi / 180; + + var _lng = lng * pi / 180; + + var d = rad / r; + var i = 0; + + for (i = 0; i <= 360; i += detail) { + var brng = i * pi / 180; + var pLat = Math.asin(Math.sin(_lat) * Math.cos(d) + Math.cos(_lat) * Math.sin(d) * Math.cos(brng)); + var pLng = (_lng + Math.atan2(Math.sin(brng) * Math.sin(d) * Math.cos(_lat), Math.cos(d) - Math.sin(_lat) * Math.sin(pLat))) * 180 / pi; + pLat = pLat * 180 / pi; + circle += "|" + pLat + "," + pLng; + } + + return "https://maps.googleapis.com/maps/api/staticmap?" + staticMapSrc + circle; + } + }, { + key: "formatCategories", + value: function formatCategories(item) { + if (this.categories && item.categories) { + var categoriesText = this.categories.filter(function (_ref) { + var categoryId = _ref.categoryId, + name = _ref.name; + return item.categories.includes(categoryId); + }).map(function (_ref2) { + var name = _ref2.name; + return name; + }); + return categoriesText.join(","); + } + + return undefined; + } + }, { + key: "formatLabels", + value: function formatLabels(item) { + var labels = this.props.labels; + + if (labels && item.labels) { + var labelsText = labels.filter(function (_ref3) { + var label = _ref3.label; + return item.labels.includes(label); + }).map(function (_ref4) { + var name = _ref4.name; + return name; + }); + return labelsText.join(","); + } + + return undefined; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var FORMAT = "YYYY-MM-DD"; + var navigation = this.props.navigation; + var loading = this.state.loading; + + if (loading) { + return null; + } + + var manager = global.getVerticalsConfig().getEvents(); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).VerticalSearchesList, { + eventName: _events.default.TOGGLE_EVENTS_SEARCH, + color: (0, _$$_REQUIRE(_dependencyMap[16]).getEventColor)(), + searchVerticalManager: manager, + onItemPress: function onItemPress(item) { + var lastSearch = manager.getLastSearch(); + + if (item !== lastSearch) { + manager.toggleLastSearch(item); + } + + if (item.timeRange) { + var result = _$$_REQUIRE(_dependencyMap[18]).DateUtils.getTimeRange(item.timeRange); + + if (result) { + var begin = result.begin, + end = result.end; + + if (begin && end) { + item.startDate = begin.format(FORMAT); + item.endDate = end.format(FORMAT); + } + } + } + + navigation.navigate("VerticalListScreen", { + filters: (0, _extends2.default)({}, item) + }); + }, + renderItem: function renderItem(item) { + var startDate = item.startDate, + endDate = item.endDate, + searchTerm = item.searchTerm, + timeRange = item.timeRange; + var location = item.latitude || item.longitude ? global.strings("custom_location") : ""; + + var categories = _this2.formatCategories(item); + + var labels = _this2.formatLabels(item); + + var isDefault = manager.searchIsDefault(item); + var isLastSearch = manager.searchIsLastSearch(item); + var allEvents = !startDate && !endDate && !location && !categories && !searchTerm ? global.strings("all_events") : null; + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.line + }, _react.default.createElement(_reactNative.View, { + style: { + flexDirection: "row" + } + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 93 + } + }, timeRange && timeRange !== "custom" ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.text, + type: _fontText.Type.medium + }, global.strings("str_time_range") + ": " + _$$_REQUIRE(_dependencyMap[18]).DateUtils.getTimeRangeString(timeRange)) : null, startDate && timeRange === "custom" ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.text, + type: _fontText.Type.medium + }, global.strings("str_from") + ": " + startDate) : null, endDate && timeRange === "custom" ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.text, + type: _fontText.Type.medium + }, global.strings("str_to") + ": " + endDate) : null, categories ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.text, + type: _fontText.Type.medium + }, global.strings("categories") + ": " + categories) : null, labels ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.text, + type: _fontText.Type.medium + }, global.strings("labels") + ": " + labels) : null, searchTerm ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.text, + type: _fontText.Type.medium + }, global.strings("search_term") + ": " + searchTerm) : null, allEvents ? _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[19]).styles.title, + type: _fontText.Type.medium + }, "" + allEvents) : null), _react.default.createElement(_reactNative.View, { + style: { + flex: 7, + justifyContent: "center" + } + }, !isLastSearch ? _react.default.createElement(_reactNative.TouchableOpacity, { + onPress: function onPress() { + if (isDefault) { + manager.toggleDefaultSearch(item, false); + } else { + manager.toggleSearch(item); + } + } + }, _react.default.createElement(_iconComponent.default, { + type: _iconComponent.TecnaviaIconType.FONT_AWESOME_5, + name: "trash", + color: (0, _$$_REQUIRE(_dependencyMap[16]).getEventColor)(), + size: 18 + })) : null)), location ? _react.default.createElement(_reactNative.View, { + style: { + justifyContent: "center", + alignItems: "center" + } + }, _react.default.createElement(_imageComponent.default, { + style: { + width: "100%", + height: 280, + margin: 10 + }, + source: { + uri: _this2.GMapCircle(item.latitude, item.longitude, item.radius) + } + })) : null); + }, + onEmptyPress: function onEmptyPress() { + navigation.navigate("VerticalFiltersScreen"); + } + }); + } + }]); + return EventSearchScreen; + }(_$$_REQUIRE(_dependencyMap[20]).NavigationBaseScreen); + + exports.EventSearchScreen = EventSearchScreen; +},2576,[5,80,6,7,8,90,12,14,16,17,28,460,1879,588,1806,431,2474,2504,462,2577,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + line: { + flexDirection: "column", + padding: 10, + borderBottomWidth: 0.5, + borderColor: (0, _$$_REQUIRE(_dependencyMap[1]).getEventColor)(), + justifyContent: "center" + }, + title: { + fontSize: 20, + flex: 1 + }, + text: { + fontSize: 14, + flex: 1 + }, + subtitle: { + fontSize: 20, + flex: 1 + } + }); + + exports.styles = styles; +},2577,[28,2474]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2578,[2579]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EventWebScreen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var EventWebScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(EventWebScreen, _NavigationBaseScreen); + + var _super = _createSuper(EventWebScreen); + + function EventWebScreen() { + (0, _classCallCheck2.default)(this, EventWebScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(EventWebScreen, [{ + key: "handleBackButton", + value: function handleBackButton() { + var navigation = this.props.navigation; + navigation.goBack(null); + return (0, _get2.default)((0, _getPrototypeOf2.default)(EventWebScreen.prototype), "handleBackButton", this).call(this); + } + }, { + key: "getTag", + value: function getTag() { + return "Event WebView"; + } + }, { + key: "render", + value: function render() { + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[8]).getNavigationParams)(this.props), + url = _getNavigationParams.url; + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).BaseWebView, { + source: { + uri: url + }, + progressColor: (0, _$$_REQUIRE(_dependencyMap[10]).getEventColor)(), + browser: true + }); + } + }]); + return EventWebScreen; + }(_$$_REQUIRE(_dependencyMap[8]).NavigationBaseScreen); + + exports.EventWebScreen = EventWebScreen; +},2579,[5,7,8,90,12,14,16,17,2148,1894,2474]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useIsPortrait = useIsPortrait; + exports.useDidUpdate = useDidUpdate; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function useIsPortrait() { + var _React$useState = _react.default.useState(_deviceUtils.default.isPortrait()), + _React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2), + isPortrait = _React$useState2[0], + setIsPortrait = _React$useState2[1]; + + var onOrientationChange; + + _react.default.useEffect(function () { + onOrientationChange = _$$_REQUIRE(_dependencyMap[5]).EventRegister.on(_events.default.ON_ORIENTATION_CHANGE, function (_ref) { + var orientation = _ref.orientation; + setIsPortrait(_deviceUtils.default.isPortrait(orientation)); + }); + return function () { + _$$_REQUIRE(_dependencyMap[5]).EventRegister.rm(onOrientationChange); + }; + }, []); + + return isPortrait; + } + + function useDidUpdate(onDidUpdate) { + var watcher = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var didMountRef = (0, _react.useRef)(false); + (0, _react.useEffect)(function () { + if (didMountRef.current) { + onDidUpdate(); + } + + didMountRef.current = true; + }, watcher); + } +},2580,[5,41,17,460,458,572]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2581,[2582]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.TutorialScreen = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _RssIndexConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _viewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var TutorialScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(TutorialScreen, _NavigationBaseScreen); + + var _super = _createSuper(TutorialScreen); + + function TutorialScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, TutorialScreen); + + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA.top; + + _this = _super.call(this, props, { + marginTop: top + }); + + var _global$getRssIndex = global.getRssIndex(), + tutorials = _global$getRssIndex.tutorials; + + _this.onSkipPress = _this._onSkipPress.bind((0, _assertThisInitialized2.default)(_this)); + + if (tutorials && tutorials.length > 0) { + _this.urls = tutorials; + } else { + _this.onSkipPress(); + } + + return _this; + } + + (0, _createClass2.default)(TutorialScreen, [{ + key: "orientationListener", + value: function orientationListener(orientation) { + var marginTop = this.state.marginTop; + (0, _get2.default)((0, _getPrototypeOf2.default)(TutorialScreen.prototype), "orientationListener", this).call(this, orientation); + + var _DeviceUtils$getSafeA2 = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA2.top; + + if (top !== marginTop) { + this.setState({ + marginTop: top + }); + } + } + }, { + key: "getTag", + value: function getTag() { + return "Live News Tutorial"; + } + }, { + key: "_onSkipPress", + value: function _onSkipPress() { + var navigation = this.props.navigation; + + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[17]).getNavigationParams)(this.props), + _getNavigationParams$ = _getNavigationParams.goBack, + goBack = _getNavigationParams$ === undefined ? false : _getNavigationParams$; + + if (goBack) { + navigation.goBack(null); + } else { + _NavigationService.default.default.reset(navigation, "DrawerNavigator"); + } + } + }, { + key: "render", + value: function render() { + if (!this.urls || this.urls.length === 0) { + return null; + } + + var marginTop = this.state.marginTop; + + var _global$getRssIndex2 = global.getRssIndex(), + actionBarBackgroundColor = _global$getRssIndex2.actionBarBackgroundColor, + supportColor = _global$getRssIndex2.supportColor; + + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[18]).styles.container, { + marginTop: marginTop + }] + }, _react.default.createElement(_viewPagerComponent.default, { + containerStyle: _$$_REQUIRE(_dependencyMap[18]).styles.swiper, + showIndicators: true, + indicatorsActiveColor: supportColor, + indicatorsColor: actionBarBackgroundColor, + data: this.urls, + renderPage: function renderPage(url, index) { + return _react.default.createElement(_imageComponent.default, { + key: index, + forceProgressComponent: true, + source: { + uri: url + }, + indicator: _$$_REQUIRE(_dependencyMap[19]).ProgressCircle, + indicatorProps: { + color: actionBarBackgroundColor + }, + style: _$$_REQUIRE(_dependencyMap[18]).styles.pageParent, + imageStyle: { + resizeMode: "contain" + } + }); + } + }), _react.default.createElement(_fontText.default, { + style: _$$_REQUIRE(_dependencyMap[18]).styles.text, + onPress: this.onSkipPress + }, global.strings("btn_skip"))); + } + }]); + return TutorialScreen; + }(_$$_REQUIRE(_dependencyMap[17]).NavigationBaseScreen); + + exports.TutorialScreen = TutorialScreen; + TutorialScreen.propTypes = { + navigation: _propTypes.default.object + }; +},2582,[5,7,8,15,90,12,14,16,17,28,201,1879,2044,2360,588,458,1861,2148,2583,1953]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + container: { + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + flex: 1 + }, + swiper: { + position: "absolute", + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black, + top: 0, + end: 0, + bottom: 0, + start: 0, + justifyContent: "center" + }, + text: { + position: "absolute", + bottom: 0, + end: 0, + padding: 10, + fontSize: 20, + color: "white", + textShadowColor: _$$_REQUIRE(_dependencyMap[1]).colors.textShadow, + textShadowOffset: { + width: -1, + height: 1 + }, + textShadowRadius: 10 + }, + pageParent: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.black + } + }); + + exports.styles = styles; +},2583,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2584,[2585]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SettingsScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _settingButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _settingText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _settingDebug = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _rssBaseStyle = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[19])); + + var _tecnaviaPlatformUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SettingsScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(SettingsScreen, _NavigationBaseScreen); + + var _super = _createSuper(SettingsScreen); + + function SettingsScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, SettingsScreen); + _this = _super.call(this, props); + _this.state = { + items: [] + }; + _this.toggleLayout = _this._toggleLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleStartWith = _this._toggleStartWith.bind((0, _assertThisInitialized2.default)(_this)); + _this.toggleAllowFontScaling = _this._toggleAllowFontScaling.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearFavorites = _this._clearFavorites.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearCache = _this._clearCache.bind((0, _assertThisInitialized2.default)(_this)); + _this.clearDatabase = _this._clearDatabase.bind((0, _assertThisInitialized2.default)(_this)); + _this.openPushSettings = _this._openPushSettings.bind((0, _assertThisInitialized2.default)(_this)); + _this.showTutorial = _this._showTutorial.bind((0, _assertThisInitialized2.default)(_this)); + _this.onForceLayoutSubStyle = _this._onForceLayoutSubStyle.bind((0, _assertThisInitialized2.default)(_this)); + _this.openUrl = _this._openUrl.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SettingsScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + return _regenerator.default.async(function componentDidMount$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + (0, _get2.default)((0, _getPrototypeOf2.default)(SettingsScreen.prototype), "componentDidMount", this).call(this); + _context.t0 = this; + _context.next = 4; + return _regenerator.default.awrap(this._getItems()); + + case 4: + _context.t1 = _context.sent; + _context.t2 = { + items: _context.t1 + }; + + _context.t0.setState.call(_context.t0, _context.t2); + + case 7: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getTag", + value: function getTag() { + return "Live News Settings"; + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(SettingsScreen.prototype), "handleBackButton", this).call(this); + this.props.navigation.pop(); + return true; + } + }, { + key: "_openUrl", + value: function _openUrl() { + var poweredByURL, url; + return _regenerator.default.async(function _openUrl$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + poweredByURL = global.getMainPSetup(); + url = poweredByURL && poweredByURL.length ? poweredByURL : "https://www.newsmemory.com/"; + _context2.next = 4; + return _regenerator.default.awrap(_tecnaviaPlatformUtils.default.openURL(url)); + + case 4: + case "end": + return _context2.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_retrieveCacheSize", + value: function _retrieveCacheSize() { + var cacheSize; + return _regenerator.default.async(function _retrieveCacheSize$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + _context3.next = 2; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.getCacheSize()); + + case 2: + cacheSize = _context3.sent; + return _context3.abrupt("return", _$$_REQUIRE(_dependencyMap[21]).StringUtils.sizeToString(cacheSize)); + + case 4: + case "end": + return _context3.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "_retrieveFavorites", + value: function _retrieveFavorites() { + var favoritesConfig = global.getRssFavoritesConfig(); + return favoritesConfig.getCount(); + } + }, { + key: "_onForceLayoutSubStyle", + value: function _onForceLayoutSubStyle() { + this._displayToast(global.strings("msg_available_next_startup")); + } + }, { + key: "_toggleLayout", + value: function _toggleLayout() { + return global.getUserSettings().toggleLayout().text; + } + }, { + key: "_fontScalingLabel", + value: function _fontScalingLabel() { + return global.getUserSettings().allowFontScaling ? global.strings("btn_yes") : global.strings("btn_no"); + } + }, { + key: "_toggleAllowFontScaling", + value: function _toggleAllowFontScaling() { + global.getUserSettings().toggleAllowFontScaling(); + return this._fontScalingLabel(); + } + }, { + key: "_startupLabel", + value: function _startupLabel() { + var params = (0, _$$_REQUIRE(_dependencyMap[22]).getNavigationParams)(this.props); + var epaperLabel = params.epaperLabel || global.strings("settings_startup_epaper"); + return global.getUserSettings().startInRss ? global.strings("settings_startup_rss") : epaperLabel; + } + }, { + key: "_toggleStartWith", + value: function _toggleStartWith() { + if (global.getUserSettings().startInRss) { + global.getUserSettings().setNewsmemoryAsStartupMode(); + } else { + global.getUserSettings().setRssAsStartupMode(); + } + + this._displayToast(global.strings("msg_available_next_startup")); + + return this._startupLabel(); + } + }, { + key: "_clearFavorites", + value: function _clearFavorites() { + try { + var favoritesConfig = global.getRssFavoritesConfig(); + favoritesConfig.clearFavorites(); + } catch (err) { + this._displayToast(global.strings("err_clear_favorites")); + } + + return this._retrieveFavorites(); + } + }, { + key: "_clearCache", + value: function _clearCache() { + return _regenerator.default.async(function _clearCache$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + _context4.prev = 0; + _context4.next = 3; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.clearCache()); + + case 3: + _context4.next = 8; + break; + + case 5: + _context4.prev = 5; + _context4.t0 = _context4["catch"](0); + + this._displayToast(global.strings("err_clear_cache")); + + case 8: + return _context4.abrupt("return", this._retrieveCacheSize()); + + case 9: + case "end": + return _context4.stop(); + } + } + }, null, this, [[0, 5]], Promise); + } + }, { + key: "_clearDatabase", + value: function _clearDatabase() { + var _await$global$getRssI, success; + + return _regenerator.default.async(function _clearDatabase$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + _context5.prev = 0; + _context5.next = 3; + return _regenerator.default.awrap(_RssContentHelper.default.deleteDatabase()); + + case 3: + _LiveConfig.default.setRssDbDeleted(true); + + this._displayToast(global.strings("database_deleted")); + + _context5.next = 7; + return _regenerator.default.awrap(global.getRssIndexManager().init()); + + case 7: + _await$global$getRssI = _context5.sent; + success = _await$global$getRssI.success; + + if (success) { + _context5.next = 11; + break; + } + + throw new Error("Unable to reset RSS configuration"); + + case 11: + _context5.next = 16; + break; + + case 13: + _context5.prev = 13; + _context5.t0 = _context5["catch"](0); + + this._displayToast(global.strings("err_clear_database")); + + case 16: + case "end": + return _context5.stop(); + } + } + }, null, this, [[0, 13]], Promise); + } + }, { + key: "_openPushSettings", + value: function _openPushSettings() { + _$$_REQUIRE(_dependencyMap[23]).NativeSettingsNavigation.appNotificationSettings(); + } + }, { + key: "_showTutorial", + value: function _showTutorial() { + var navigation = this.props.navigation; + navigation.navigate("TutorialScreen", { + goBack: true + }); + } + }, { + key: "_renderSeparator", + value: function _renderSeparator() { + return _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[24]).styles.separator + }); + } + }, { + key: "_displayToast", + value: function _displayToast(msg) { + _$$_REQUIRE(_dependencyMap[25]).Toast.show(msg, { + position: "top" + }); + } + }, { + key: "_getItems", + value: function _getItems() { + var _global$getActivePSet, newsMemoryIsEnabled, showToggleLayout, items; + + return _regenerator.default.async(function _getItems$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + _global$getActivePSet = global.getActivePSetup(), newsMemoryIsEnabled = _global$getActivePSet.newsMemoryIsEnabled; + showToggleLayout = global.getRssIndex().needToShowLayoutButton(); + items = [showToggleLayout ? _react.default.createElement(_settingButton.default, { + key: "0", + label: global.strings("layout"), + value: global.getUserSettings().layout.text, + button: global.strings("toggle"), + onChange: this.toggleLayout + }) : undefined, newsMemoryIsEnabled ? _react.default.createElement(_settingButton.default, { + key: "1", + label: global.strings("start_with"), + value: this._startupLabel(), + button: global.strings("toggle"), + onChange: this.toggleStartWith + }) : undefined, _react.default.createElement(_settingButton.default, { + key: "2", + label: global.strings("settings_allow_font_scaling"), + value: this._fontScalingLabel(), + button: global.strings("toggle"), + onChange: this.toggleAllowFontScaling + }), _react.default.createElement(_settingButton.default, { + key: "3", + label: global.strings("favorites"), + button: global.strings("clear"), + value: this._retrieveFavorites(), + onChange: this.clearFavorites, + alert: { + title: global.strings("msg_clear_favorites"), + message: global.strings("alert_message") + } + }), _react.default.createElement(_settingButton.default, { + key: "4", + label: global.strings("cache_size"), + button: global.strings("clear"), + value: this._retrieveCacheSize, + onChange: this.clearCache, + alert: { + title: global.strings("msg_clear_cache"), + message: global.strings("alert_message") + } + }), _react.default.createElement(_settingButton.default, { + key: "5", + label: global.strings("database"), + button: global.strings("clear"), + onChange: this.clearDatabase, + alert: { + title: global.strings("msg_database_deleted"), + message: global.strings("alert_message") + } + }), _react.default.createElement(_settingButton.default, { + key: "6", + label: global.strings("push_notification"), + button: global.strings("change"), + onChange: this.openPushSettings + }), _react.default.createElement(_settingButton.default, { + key: "7", + label: global.strings("tutorial"), + button: global.strings("show"), + onChange: this.showTutorial + }), _react.default.createElement(_settingDebug.default, { + key: "8", + numberOfTapToDebug: 3, + label: global.strings("version"), + value: _deviceUtils.default.getTextVersionName(), + onSublayoutChange: this.onForceLayoutSubStyle + }), _react.default.createElement(_settingText.default, { + key: "9", + label: global.getMainPSetup().poweredBy || global.strings("powered_by"), + onPress: this.openUrl + })]; + return _context6.abrupt("return", items.filter(function (item) { + return item !== undefined; + })); + + case 4: + case "end": + return _context6.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "render", + value: function render() { + var items = this.state.items; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[26]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[24]).styles.root, { + paddingHorizontal: (0, _rssBaseStyle.getRssHorizontalpadding)() + }] + }, _react.default.createElement(_reactNative.View, { + style: [_rssBaseStyle.default.shadow, { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[21]).PlatformUtils.isIOS() ? _$$_REQUIRE(_dependencyMap[21]).colors.transparent : _$$_REQUIRE(_dependencyMap[21]).colors.white + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[27]).TecnaviaFlatList, { + ItemSeparatorComponent: this._renderSeparator, + data: items, + renderItem: function renderItem(_ref) { + var item = _ref.item; + return item; + }, + style: { + backgroundColor: backgroundColor + } + }))); + } + }]); + return SettingsScreen; + }(_$$_REQUIRE(_dependencyMap[22]).NavigationBaseScreen); + + exports.SettingsScreen = SettingsScreen; + SettingsScreen.propTypes = { + navigation: _propTypes.default.shape({ + navigate: _propTypes.default.func.isRequired + }).isRequired + }; +},2585,[5,80,7,8,15,90,12,14,16,17,28,201,458,1872,574,2207,2236,2252,2256,2039,1876,462,2148,2009,2238,1889,699,1910]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2586,[2587]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ArticleScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[12]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _articleContent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _articleContentTablet = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _articleScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _AdsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _InterstitialsHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _Paywall = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _viewPagerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var InterstitialsKeysAndValues = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[22])); + + var _articleContentBase = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[24])); + + var _player = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[25])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[26])); + + var _keyboardAvoidingComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[27])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getNativoAds(), + NativoSDK = _OptionalPackages$get.NativoSDK; + + var ArticleScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(ArticleScreen, _NavigationBaseScreen); + + var _super = _createSuper(ArticleScreen); + + function ArticleScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleScreen); + + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[28]).getNavigationParams)(props), + _getNavigationParams$ = _getNavigationParams.items, + items = _getNavigationParams$ === undefined ? [] : _getNavigationParams$, + _getNavigationParams$2 = _getNavigationParams.orientation, + orientation = _getNavigationParams$2 === undefined ? "" : _getNavigationParams$2, + _getNavigationParams$3 = _getNavigationParams.settings, + settings = _getNavigationParams$3 === undefined ? {} : _getNavigationParams$3, + _getNavigationParams$4 = _getNavigationParams.item, + item = _getNavigationParams$4 === undefined ? {} : _getNavigationParams$4; + + _this = _super.call(this, props, { + orientation: orientation + }); + _this.settings = settings; + _this.getTopBanner = _this._getTopBanner.bind((0, _assertThisInitialized2.default)(_this)); + _this.getInsideBanner = _this._getInsideBanner.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleRef = _this._onArticleRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onSwipe = _this._onSwipe.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleLoadStart = _this._onArticleLoadStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleLoadEnd = _this._onArticleLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onArticleUnmount = _this._onArticleUnmount.bind((0, _assertThisInitialized2.default)(_this)); + _this.sendAnalytics = _this._sendAnalytics.bind((0, _assertThisInitialized2.default)(_this)); + _this.getArticleViews = _this._getArticleViews.bind((0, _assertThisInitialized2.default)(_this)); + _this.articlesRefs = new Array(items.length); + _this.articles = items; + _this.currentIndex = _this._getArticleIndex(item); + _this.nativoAdsMOAP = _this._getNativoAdsMOAP("inside"); + _this.nativoAdsMOAPExtra = _this._getNativoAdsMOAP("extra"); + _this.delayedNativoSetup = false; + _this.articleFullscreenTimer = undefined; + return _this; + } + + (0, _createClass2.default)(ArticleScreen, [{ + key: "componentWillUnmount", + value: function componentWillUnmount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(ArticleScreen.prototype), "componentWillUnmount", this).call(this); + global.getAudio().ttsDestroy(); + + if (this.interstitialTimer) { + _InterstitialsHelper.default.resetTimer(this.interstitialTimer); + } + + _$$_REQUIRE(_dependencyMap[29]).EventRegister.rm(this._onPaywallGoBackHomeListener); + } + }, { + key: "getTag", + value: function getTag() { + return "Live News Article"; + } + }, { + key: "trackScreen", + value: function trackScreen() {} + }, { + key: "didFocus", + value: function didFocus() { + (0, _get2.default)((0, _getPrototypeOf2.default)(ArticleScreen.prototype), "didFocus", this).call(this); + this.sendAnalytics(this.articles[this.currentIndex]); + } + }, { + key: "orientationListener", + value: function orientationListener(orientation) { + (0, _get2.default)((0, _getPrototypeOf2.default)(ArticleScreen.prototype), "orientationListener", this).call(this, orientation); + this.setState({ + orientation: orientation + }); + } + }, { + key: "_sendAnalytics", + value: function _sendAnalytics(article) { + var _this2 = this; + + if (this.articleFullscreenTimer) { + clearTimeout(this.articleFullscreenTimer); + } + + this.articleFullscreenTimer = setTimeout(function () { + (0, _$$_REQUIRE(_dependencyMap[30]).sendToAnalytics)((0, _extends2.default)({ + event_action: "fullscreen", + screen_name: _this2.getTag() + }, article)); + _this2.articleFullscreenTimer = undefined; + }, _$$_REQUIRE(_dependencyMap[31]).ARTICLE_READ_ANALYTICS_COOL_DOWN); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(ArticleScreen.prototype), "handleBackButton", this).call(this); + var navigation = this.props.navigation; + navigation.pop(); + return true; + } + }, { + key: "_getNativoAdsMOAP", + value: function _getNativoAdsMOAP() { + var position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "inside"; + + if (this.settings && this.settings.adUnitId) { + var configuration = { + screen: "article", + position: position, + type: "native", + provider: "nativo", + caller: this.getTag() + }; + + var model = _AdsHelper.default.getModelFromConfiguration(this.settings.adUnitId, configuration); + + if (model) { + var unitId = model.unitId, + provider = model.provider; + + if (provider === InterstitialsKeysAndValues.values.provider.nativo) { + return unitId; + } + } + } + + return undefined; + } + }, { + key: "_getArticleViews", + value: function _getArticleViews(article, index) { + var navigation = this.props.navigation; + var orientation = this.state.orientation; + + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeArea(), + width = _DeviceUtils$getSafeA.width; + + var articleProps = { + key: article.feedId, + isCurrentPage: index === this.currentIndex, + index: index, + onRef: this.onArticleRef, + item: article, + size: this.articles.length, + orientation: orientation, + navigation: navigation, + onBackPress: this.onHandleBackButton, + loadUrlInArticle: article.action.hasPropertyLoadUrlInArticle(), + renderInsideBanner: this.getInsideBanner, + renderTopBanner: this.getTopBanner, + nativoAdsMOAP: this.nativoAdsMOAP, + onLoadStart: this.onArticleLoadStart, + onLoadEnd: this.onArticleLoadEnd, + onUnmount: this.onArticleUnmount + }; + + var _global$getRssIndex = global.getRssIndex(), + hasColumnizer = _global$getRssIndex.hasColumnizer, + usePhoneArticleStyleOnTablet = _global$getRssIndex.usePhoneArticleStyleOnTablet; + + if (_$$_REQUIRE(_dependencyMap[32]).PlatformUtils.isTablet() && !usePhoneArticleStyleOnTablet) { + return _react.default.createElement(_articleContentTablet.default, (0, _extends2.default)({ + hasColumnizer: hasColumnizer + }, articleProps)); + } + + var adJSON; + + if (this.settings) { + adJSON = this.settings.adUnitId; + } + + var bottom = 0; + + var model = _AdsHelper.default.getModelFromConfiguration(adJSON, { + screen: "article", + position: "bottom" + }); + + if (model && model.collapsable) { + bottom = 30; + } + + var insideAdModels = _AdsHelper.default.getModelsFromConfiguration(adJSON, { + screen: "article", + position: "inside" + }); + + return _react.default.createElement(_articleContent.default, (0, _extends2.default)({ + width: width, + bottom: bottom, + insideAdModels: insideAdModels + }, articleProps)); + } + }, { + key: "_getArticleIndex", + value: function _getArticleIndex(current) { + if (current) { + return this.articles.findIndex(function (article) { + return article.feedId === current.feedId; + }); + } + + return 0; + } + }, { + key: "_getBanner", + value: function _getBanner(configuration, _onLayout) { + var adJSON; + + if (this.settings) { + adJSON = this.settings.adUnitId; + } + + var backgroundColor = global.getAdsConfig().getBackgroundColor(); + return _react.default.createElement(_reactNative.View, { + style: { + alignItems: "center", + backgroundColor: backgroundColor + }, + onLayout: function onLayout(e) { + if (_onLayout) { + _onLayout(e); + } + } + }, _AdsHelper.default.getAdComponentFromConfiguration(adJSON, configuration)); + } + }, { + key: "_onArticleRef", + value: function _onArticleRef(ref, index) { + this.articlesRefs[index] = ref; + + if (index === this.currentIndex && this.delayedNativoSetup) { + this._updateNativeIds(index); + + this.delayedNativoSetup = false; + } + } + }, { + key: "_onArticleLoadStart", + value: function _onArticleLoadStart(index) {} + }, { + key: "_onArticleLoadEnd", + value: function _onArticleLoadEnd(index) { + if (index === this.currentIndex && this.articlesRefs[index]) { + if (this.nativoAdsMOAP) { + this._placeNativoMOAPAd(this.nativoAdsMOAP); + } else if (this.nativoAdsMOAPExtra && this.articlesRefs[index].nativoMOAPWebView) { + this._placeNativoMOAPAd(this.nativoAdsMOAPExtra); + } + } + } + }, { + key: "_onArticleUnmount", + value: function _onArticleUnmount(index) { + this.articlesRefs[index] = undefined; + } + }, { + key: "_getInsideBanner", + value: function _getInsideBanner(ad) { + return _AdsHelper.default.getNativeAdComponent(ad); + } + }, { + key: "_getTopBanner", + value: function _getTopBanner(onLayout) { + return this._getBanner({ + screen: "article", + position: "top", + caller: this.getTag() + }, onLayout); + } + }, { + key: "_getBottomBanner", + value: function _getBottomBanner(onLayout) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[33]).FooterBanner, { + item: this.settings, + configuration: { + screen: "article", + position: "bottom", + caller: this.getTag() + }, + onLayout: onLayout + }); + } + }, { + key: "_onSwipe", + value: function _onSwipe(index) { + var _this3 = this; + + if (this.articles && this.articles.length > index) { + var article = this.articles[index]; + var source = article.source; + + if (this.currentIndex !== index) { + this.sendAnalytics(article); + global.getAudio().ttsStop(); + + if (this._onPaywallGoBackHomeListener === undefined) { + this._onPaywallGoBackHomeListener = _$$_REQUIRE(_dependencyMap[29]).EventRegister.on(_events.default.PAYWALL_GO_BACK_HOME, function () { + _NavigationService.default.default.reset(_this3.props.navigation, "DrawerNavigator"); + }); + } + + _Paywall.default.validate(source); + } + } + + if (this.currentIndex !== index) { + _InterstitialsHelper.default.getInterstitial(function (timer) { + _this3.interstitialTimer = timer; + }); + } + + this.articlesRefs.forEach(function (ref) { + if (ref && typeof ref.updateCurrent === "function") { + ref.updateCurrent(index); + } + }); + + this._updateNativeIds(index); + + this.currentIndex = index; + } + }, { + key: "_updateNativeIds", + value: function _updateNativeIds(index) { + var articlesSet, i, ref, _i, _ref; + + return _regenerator.default.async(function _updateNativeIds$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (!_optionalPackageUtils.default.isNativoSDKAvailable()) { + _context.next = 35; + break; + } + + if (!this.articlesRefs) { + _context.next = 35; + break; + } + + this.delayedNativoSetup = false; + articlesSet = this.articlesRefs.filter(function (article) { + return !!article; + }); + this.delayedNativoSetup = articlesSet.length === 0; + + if (!this.nativoAdsMOAP) { + _context.next = 21; + break; + } + + i = 0; + + case 7: + if (!(i < this.articlesRefs.length)) { + _context.next = 15; + break; + } + + ref = this.articlesRefs[i]; + + if (!ref) { + _context.next = 12; + break; + } + + _context.next = 12; + return _regenerator.default.awrap(ref.setNativeID("article_" + i)); + + case 12: + i++; + _context.next = 7; + break; + + case 15: + if (!this.articlesRefs[index]) { + _context.next = 19; + break; + } + + _context.next = 18; + return _regenerator.default.awrap(this.articlesRefs[index].setNativeID("nativoMoapAdView")); + + case 18: + if (this.articlesRefs[index].pageLoaded) { + this._placeNativoMOAPAd(this.nativoAdsMOAP, true); + } + + case 19: + _context.next = 35; + break; + + case 21: + if (!this.nativoAdsMOAPExtra) { + _context.next = 35; + break; + } + + _i = 0; + + case 23: + if (!(_i < this.articlesRefs.length)) { + _context.next = 31; + break; + } + + _ref = this.articlesRefs[_i]; + + if (!(_ref && _ref.nativoMOAPWebView)) { + _context.next = 28; + break; + } + + _context.next = 28; + return _regenerator.default.awrap(_ref.nativoMOAPWebView.setNativeID("article_" + _i)); + + case 28: + _i++; + _context.next = 23; + break; + + case 31: + if (!(this.articlesRefs[index] && this.articlesRefs[index].nativoMOAPWebView)) { + _context.next = 35; + break; + } + + _context.next = 34; + return _regenerator.default.awrap(this.articlesRefs[index].nativoMOAPWebView.setNativeID("nativoMoapAdView")); + + case 34: + if (this.articlesRefs[index].pageLoaded) { + this._placeNativoMOAPAd(this.nativoAdsMOAPExtra, true); + } + + case 35: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_placeNativoMOAPAd", + value: function _placeNativoMOAPAd(sectionURL, delayed) { + if (_optionalPackageUtils.default.isNativoSDKAvailable()) { + if (global.isDebug && !sectionURL.includes("ntv_tm=tout")) { + sectionURL += "/?ntv_tm=tout"; + } + + if (delayed) { + setTimeout(function () { + NativoSDK.placeAdInWebView(sectionURL); + }, 500); + } else { + NativoSDK.placeAdInWebView(sectionURL); + } + } + } + }, { + key: "render", + value: function render() { + var keyboardProps = {}; + + if (_$$_REQUIRE(_dependencyMap[32]).PlatformUtils.isIOS()) { + var _DeviceUtils$getSafeA2 = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA2.top; + + keyboardProps = { + behavior: "position", + contentContainerStyle: { + flex: 1 + }, + keyboardVerticalOffset: top + }; + } + + return _react.default.createElement(_reactNative.View, { + style: _articleScreen.default.root + }, _react.default.createElement(_keyboardAvoidingComponent.default, keyboardProps, _react.default.createElement(_$$_REQUIRE(_dependencyMap[34]).Css, { + classes: ["article-pager"] + }, _react.default.createElement(_viewPagerComponent.default, { + containerStyle: [_articleScreen.default.swiper, { + backgroundColor: _$$_REQUIRE(_dependencyMap[34]).Css.getDefaultBackgroundColor() + }], + data: this.articles, + startPage: this.currentIndex, + onPageChange: this.onSwipe, + renderPage: this.getArticleViews + })), this._getBottomBanner(), global.getAudio() ? _react.default.createElement(_player.default, global.getAudio().ttsPlayerProps()) : null)); + } + }]); + return ArticleScreen; + }(_$$_REQUIRE(_dependencyMap[28]).NavigationBaseScreen); + + exports.ArticleScreen = ArticleScreen; + ArticleScreen.propTypes = { + renderInsideBanner: _propTypes.default.func, + navigation: _propTypes.default.shape({ + state: _propTypes.default.shape({ + params: _propTypes.default.shape({ + items: _propTypes.default.array, + item: _propTypes.default.object, + orientation: _propTypes.default.string, + settings: _propTypes.default.object + }) + }) + }) + }; +},2587,[5,80,6,7,8,15,90,12,14,16,17,201,28,460,2588,2605,2609,458,2087,2321,1862,2360,1973,2589,731,1996,1861,1870,2148,572,2210,1892,462,2084,699]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[9]); + + var _articleContentBase = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var getHeaderHeight = function getHeaderHeight() { + var style = _$$_REQUIRE(_dependencyMap[11]).Css.getStyleObjByCssClasses(["article-header"]); + + return style.height || (0, _$$_REQUIRE(_dependencyMap[12]).HEADER_HEIGHT)(); + }; + + var ArticleContent = function (_ArticleContentBase) { + (0, _inherits2.default)(ArticleContent, _ArticleContentBase); + + var _super = _createSuper(ArticleContent); + + function ArticleContent(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleContent); + _this = _super.call(this, props, { + parallaxHeight: props.item.image ? getHeaderHeight() : 0 + }); + _this.getHeader = _this._getHeader.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(ArticleContent, [{ + key: "_getHeader", + value: function _getHeader() { + var _this2 = this; + + var _this$props = this.props, + item = _this$props.item, + width = _this$props.width; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).ArticleContentHeader, { + item: item, + onImagePress: this.onPress, + onImageError: function onImageError() { + _this2.setState({ + parallaxHeight: 0 + }); + }, + width: width, + height: getHeaderHeight() + }); + } + }, { + key: "render", + value: function render() { + var startDegree = _$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isRTL() ? 270 : 180; + var endDegree = _$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isRTL() ? 0 : 270; + var _this$props2 = this.props, + item = _this$props2.item, + width = _this$props2.width, + bottom = _this$props2.bottom; + var parallaxHeight = this.state.parallaxHeight; + + var _global$getRssIndex = global.getRssIndex(), + floatingButtonColor = _global$getRssIndex.floatingButtonColor; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[11]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).Css, { + classes: ["article-container"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).ParallaxScroll, { + onLayout: this.onScrollLayout, + onScroll: this.onScroll, + width: width, + parallaxHeight: parallaxHeight, + renderParallaxBackground: this.getHeader + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).ArticleContentHeadline, { + date: item.date, + title: item.title, + kicker: item.kicker, + byline: item.byline, + renderTopBanner: this.getTopBanner, + onBylinePress: this.onBylinePress + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).Css, { + classes: ["article-body"] + }, _react.default.createElement(_reactNative.View, { + style: { + flexDirection: "column", + backgroundColor: backgroundColor + } + }, this._getWebViewWithContent(item), this._getResources(item), this._getNativeAds(), this._getPaywallContainer())))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).CircularFloatingActionMenu, { + style: { + bottom: bottom, + justifyContent: "flex-end" + }, + startDegree: startDegree, + endDegree: endDegree, + itemSize: 50, + buttonColor: floatingButtonColor, + innerText: this.getInnerText, + item: item + })); + } + }]); + return ArticleContent; + }(_articleContentBase.default); + + ArticleContent.propTypes = { + item: _propTypes.default.object, + width: _propTypes.default.number, + bottom: _propTypes.default.number + }; + var _default = ArticleContent; + exports.default = _default; +},2588,[5,7,8,15,12,14,16,17,201,28,2589,699,2217,2593,462,2595,2597,2600]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _reactNativeMail = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _iconGallery = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var parser = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _articleAdContainer = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Resource = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[16])); + + var InterstitialsKeysAndValues = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[17])); + + var _Paywall = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _autoheightRssOptionspageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ViafouraWebView = _optionalPackageUtils.default.getViafouraWebView(); + + var ArticleContentBase = function (_React$PureComponent) { + (0, _inherits2.default)(ArticleContentBase, _React$PureComponent); + + var _super = _createSuper(ArticleContentBase); + + function ArticleContentBase(props) { + var _this; + + var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + (0, _classCallCheck2.default)(this, ArticleContentBase); + _this = _super.call(this, props); + var source = props.item.source; + _this.state = (0, _extends2.default)({}, state, { + truncate: _Paywall.default.needToAppendPaywall(source) + }); + _this.scrollHeight = 0; + _this.innerText = ""; + _this.scrollEventThrottle = 16; + _this.pageLoaded = false; + _this.isCurrentPage = props.isCurrentPage; + _this.onPress = _this._onPress.bind((0, _assertThisInitialized2.default)(_this)); + _this.onBylinePress = _this._onBylinePress.bind((0, _assertThisInitialized2.default)(_this)); + _this.getIcon = _this._getIcon.bind((0, _assertThisInitialized2.default)(_this)); + _this.getInnerText = _this._getInnerText.bind((0, _assertThisInitialized2.default)(_this)); + _this.getTopBanner = _this._getTopBanner.bind((0, _assertThisInitialized2.default)(_this)); + _this.onHeightChange = _this._onHeightChange.bind((0, _assertThisInitialized2.default)(_this)); + _this.openLink = _this._openLink.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLocal = _this._onLocal.bind((0, _assertThisInitialized2.default)(_this)); + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoadStart = _this._onLoadStart.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoadEnd = _this._onLoadEnd.bind((0, _assertThisInitialized2.default)(_this)); + _this.onRef = _this._onRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onViafouraRef = _this._onViafouraRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onNativoMOAPRef = _this._onNativoMOAPRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onNativoMOAPContainerRef = _this._onNativoMOAPContainerRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onTopStoryRef = _this._onTopStoryRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onPaywallWebViewRef = _this._onPaywallWebViewRef.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScrollLayout = _this._onScrollLayout.bind((0, _assertThisInitialized2.default)(_this)); + _this.onScroll = _this._onScroll.bind((0, _assertThisInitialized2.default)(_this)); + _this.onLoad = _this._onLoad.bind((0, _assertThisInitialized2.default)(_this)); + _this.onBaseWebViewRef = _this._onBaseWebViewRef.bind((0, _assertThisInitialized2.default)(_this)); + + if (typeof props.onRef === "function") { + props.onRef((0, _assertThisInitialized2.default)(_this), props.index); + } + + return _this; + } + + (0, _createClass2.default)(ArticleContentBase, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + this.toggleFont = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.TOGGLE_FULLSCREEN_FONT_SIZE, function () { + _this2._updateWebviewFontSize(); + }); + this.systemFontSizeChanged = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.SYSTEM_FONT_SIZE_CHANGED, function () { + _this2._updateWebviewFontSize(); + }); + this.orientationListener = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.ON_ORIENTATION_CHANGE, function () { + _this2._getLoadedAds(); + }); + this.paywallReload = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.PAYWALL_USER_STATUS_UPDATE, function () { + var item = _this2.props.item; + var source = item.source; + + _this2.setState({ + truncate: _Paywall.default.needToAppendPaywall(source) + }); + }); + this.paywallValidate = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.PAYWALL_VALIDATE, function (_ref) { + var ACI = _ref.ACI, + validated = _ref.validated; + var item = _this2.props.item; + var source = item.source; + + if (source === ACI) { + _this2.setState({ + truncate: !validated + }); + } + }); + this.changeAdsVisibility = _$$_REQUIRE(_dependencyMap[22]).EventRegister.on(_events.default.CHANGE_ADS_VISIBILITY, function (_ref2) { + var hideAds = _ref2.hideAds; + + _this2._changeAdsVisibility(hideAds); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + var _this$props = this.props, + onUnmount = _this$props.onUnmount, + index = _this$props.index; + + if (onUnmount) { + onUnmount(index); + } + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.toggleFont); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.systemFontSizeChanged); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.orientationListener); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.paywallReload); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.paywallValidate); + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.rm(this.changeAdsVisibility); + } + }, { + key: "_onScroll", + value: function _onScroll(_ref3) { + var nativeEvent = _ref3.nativeEvent; + var item = this.props.item; + var yOffset = nativeEvent.contentOffset.y; + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.ARTICLE_SCROLL, { + id: item.feedId, + scrollYOffset: yOffset + }); + } + }, { + key: "_onScrollLayout", + value: function _onScrollLayout(_ref4) { + var nativeEvent = _ref4.nativeEvent; + var item = this.props.item; + var height = nativeEvent.layout.height; + + if (this.articleWebView && this.articleWebView.getHeight() === 0) { + this.articleWebView.updateHeight(height); + } + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.ARTICLE_SCROLL_LAYOUT, { + id: item.feedId, + scrollHeight: height + }); + } + }, { + key: "_handleAutoHeightWebViewsCheck", + value: function _handleAutoHeightWebViewsCheck(webViews) { + var _this3 = this; + + webViews.forEach(function (webview) { + if (webview) { + if (_this3.isCurrentPage) { + webview.startHeightCheck(); + } else { + webview.stopHeightCheck(); + } + } + }); + } + }, { + key: "updateCurrent", + value: function updateCurrent(currentIndex) { + var index = this.props.index; + this.isCurrentPage = currentIndex === index; + + if (this.viafouraRef) { + if (this.isCurrentPage && this.pageLoaded) { + this.viafouraRef.show(); + } else if (this.viafouraRef) { + this.viafouraRef.hide(); + } + } + + this._handleAutoHeightWebViewsCheck([this.articleWebView, this.topStoryWebView, this.nativoMOAPAutoHeightWebView, this.paywallWebView]); + } + }, { + key: "setNativeID", + value: function setNativeID(id) { + var nativoAdsMOAP; + return _regenerator.default.async(function setNativeID$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + nativoAdsMOAP = this.props.nativoAdsMOAP; + + if (!(this.webView && nativoAdsMOAP)) { + _context.next = 3; + break; + } + + return _context.abrupt("return", this.webView.setNativeID(id)); + + case 3: + return _context.abrupt("return", Promise.resolve()); + + case 4: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "getNativeID", + value: function getNativeID() { + if (this.webView) { + return this.webView.getNativeID(); + } + + return undefined; + } + }, { + key: "_getHtmlSummary", + value: function _getHtmlSummary(summary) { + var _global$getRssIndex = global.getRssIndex(), + summaryInArticleBody = _global$getRssIndex.summaryInArticleBody; + + if (summaryInArticleBody && summary) { + return "<div class='summary'>" + summary + "</div>"; + } + + return ""; + } + }, { + key: "_getCustomFontFace", + value: function _getCustomFontFace() { + var _global$getFontsConfi = global.getFontsConfig(), + fontRegular = _global$getFontsConfi.fontRegular, + fontBold = _global$getFontsConfi.fontBold, + dynamicFonts = _global$getFontsConfi.mappedDynamicFonts; + + return (0, _$$_REQUIRE(_dependencyMap[23]).generateAssetsFontCss)(fontRegular, fontBold, dynamicFonts); + } + }, { + key: "_getCommonCss", + value: function _getCommonCss(fontSize) { + var _global$getRssIndex2 = global.getRssIndex(), + articleBgColor = _global$getRssIndex2.articleBgColor; + + var articleBodyStyle = _$$_REQUIRE(_dependencyMap[24]).Css.getStyleObjByCssClasses(["article-body"]); + + var backgroundColor = articleBodyStyle.backgroundColor || _styleUtils.default.fixColorForDarkTheme(articleBgColor); + + var foregroundColor = articleBodyStyle.color || _$$_REQUIRE(_dependencyMap[25]).colors.grey1000; + + var _global$getRSSActiveP = global.getRSSActivePSetup(), + enableArticleTextSelection = _global$getRSSActiveP.enableArticleTextSelection; + + var css = "table { font-size: 100%; }.author { font-weight: bold; border-bottom: 1px solid #7F7F7F; padding-left:80px; padding-bottom:10px; margin-bottom:10px; color:#262626; }.author, .ar_number{ text-align:right; font-weight:normal; margin:0; color:#262626; padding-top:5px }.real_text { margin-right:10px; text-align:justify; }.native_ad { margin-bottom: 10px; }" + ("#content { font-size: " + fontSize + "%; padding: 20px; background-color: " + backgroundColor + "; }") + ("#content p { margin:0; color: " + foregroundColor + "; }") + ("#content div { color: " + foregroundColor + "; }") + "a.moreLink { margin: 0px 25px; }" + "body { margin: 0 !important; background-color: transparent !important }" + "p:not(:empty) { margin: 0 0 7px; padding-bottom:10px; }"; + + if (!enableArticleTextSelection) { + css += "#content { -webkit-user-select: none; }"; + } + + return css; + } + }, { + key: "_getContent", + value: function _getContent(html, fontSize, title) { + var hasColumnizer = this.props.hasColumnizer; + var truncate = this.state.truncate; + + var _global$getActivePSet = global.getActivePSetup(), + enableInStoryAdMarker = _global$getActivePSet.enableInStoryAdMarker; + + var cssTheme = _$$_REQUIRE(_dependencyMap[24]).Css.getThemeInUse(); + + var themeClass = ""; + + if (cssTheme) { + themeClass = " class='" + cssTheme + "'"; + } + + if (hasColumnizer) { + return "\n <html dir='auto'>\n <head>\n " + this._getTagTitle(title) + "\n <meta name='viewport' content='initial-scale=1.0,maximum-scale=1.0'/> \n <script src=\"data:text/javascript;base64," + _$$_REQUIRE(_dependencyMap[26]).jQueryBase64 + "\"></script>\n <script src=\"data:text/javascript;base64," + _$$_REQUIRE(_dependencyMap[26]).columnizerBase64 + "\"></script>\n <script src=\"data:text/javascript;base64," + _$$_REQUIRE(_dependencyMap[26]).letteringBase64 + "\"></script>\n <style>\n " + this._getCustomFontFace() + "\n .column {\n margin-top:50px;\n }\n .column > div {\n margin:0 25px;\n text-align:justify;\n overflow:hidden;\n }\n .wide, .thin {\n clear:both;\n }\n img {\n width:180px;\n }\n #wrapper {\n margin: 0px 15px;\n }\n " + this._getCommonCss(fontSize) + "\n </style>\n <script type='text/javascript'>\n " + (0, _$$_REQUIRE(_dependencyMap[23]).getArticleTruncateFunctions)() + "\n </script>\n <script type='text/javascript'>\n var getLoadedAds = " + (0, _$$_REQUIRE(_dependencyMap[23]).retrieveAdPlaceholders)(enableInStoryAdMarker) + ";\n " + (0, _$$_REQUIRE(_dependencyMap[23]).onLoadFunctions)(true, truncate) + "\n </script>\n </head> \n <body " + themeClass + ">\n <div id='wrapper'>\n <div id='content' style='padding:10px; max-width:100%;'>\n " + html + "\n </div>\n </div>\n <script type='text/javascript'>\n window.ReactNativeWebView.postMessage(JSON.stringify((" + _$$_REQUIRE(_dependencyMap[23]).retrieveInnerText + ")()));\n </script>\n </body>\n </html>"; + } + + return "\n <html dir='auto'>\n <head>\n " + this._getTagTitle(title) + "\n <meta name='viewport' content='initial-scale=1.0,maximum-scale=1.0'/> \n <script src=\"data:text/javascript;base64," + _$$_REQUIRE(_dependencyMap[26]).jQueryBase64 + "\"></script>\n <script type='text/javascript'>\n var getLoadedAds = " + (0, _$$_REQUIRE(_dependencyMap[23]).retrieveAdPlaceholders)(enableInStoryAdMarker) + ";\n </script>\n <script type='text/javascript'>\n " + (0, _$$_REQUIRE(_dependencyMap[23]).getArticleTruncateFunctions)() + "\n " + (0, _$$_REQUIRE(_dependencyMap[23]).onLoadFunctions)(false, truncate) + "\n </script>\n <style>\n " + this._getCustomFontFace() + "\n img{\n max-width:100%\n }\n " + this._getCommonCss(fontSize) + "\n </style>\n </head>\n <body " + themeClass + ">\n <!--* DIVS for Nativo debug \"<main>\n <div class='content'><div>\n </div>\n <div>\n </div>\n </div>\n </main>\" -->\n <div id='content'>" + html + "</div>\n <script type='text/javascript'>\n window.ReactNativeWebView.postMessage(JSON.stringify((" + _$$_REQUIRE(_dependencyMap[23]).retrieveInnerText + ")()));\n </script>\n </body>\n </html>"; + } + }, { + key: "_replacePlaceholder", + value: function _replacePlaceholder(html) { + var newHtml = html; + + if (newHtml.includes("##width##")) { + newHtml = newHtml.replace(/##width##px/g, "100%"); + } + + if (newHtml.includes("##height##")) { + newHtml = newHtml.replace(/##height##/g, "500"); + } + + return newHtml; + } + }, { + key: "_getTagTitle", + value: function _getTagTitle(title) { + return "<title>" + title + ""; + } + }, { + key: "_getHtmlContent", + value: function _getHtmlContent(item) { + var summary = item.summary, + html = item.html, + title = item.title; + + var content = this._getHtmlSummary(summary); + + content = this._getContent(content + html, this._getFontSize(), title); + content = this._replacePlaceholder(content); + content = (0, _$$_REQUIRE(_dependencyMap[23]).removeWebAdsFromString)(content); + return content; + } + }, { + key: "_getHtmlSource", + value: function _getHtmlSource(item) { + var loadUrlInArticle = this.props.loadUrlInArticle; + return loadUrlInArticle ? { + uri: item.html + } : { + html: this._getHtmlContent(item), + baseUrl: _$$_REQUIRE(_dependencyMap[27]).WEBVIEW_BASE_URL + }; + } + }, { + key: "_updateInnerText", + value: function _updateInnerText(innerText) { + this.innerText = innerText; + } + }, { + key: "_updateWebviewFontSizeScript", + value: function _updateWebviewFontSizeScript() { + var fontSize = global.getUserSettings().getFontSize(); + return "\n try{ \n document.getElementById('content').style.fontSize = \"" + fontSize + "%\";\n }catch(e){}"; + } + }, { + key: "_updateWebviewFontSize", + value: function _updateWebviewFontSize() { + var loadUrlInArticle = this.props.loadUrlInArticle; + + if (this.articleWebView && !loadUrlInArticle) { + this.articleWebView.injectJavaScript(this._updateWebviewFontSizeScript()); + this.articleWebView.recheckContentHeight(); + } + } + }, { + key: "_getFontSize", + value: function _getFontSize() { + return global.getUserSettings().getFontSize(); + } + }, { + key: "_getInnerText", + value: function _getInnerText() { + var item = this.props.item; + var title = item.title, + byline = item.byline; + var textToRead = ""; + + if (title) { + textToRead += title + "\n"; + } + + if (byline) { + textToRead += byline + "\n"; + } + + if (this.innerText) { + textToRead += this.innerText; + } + + return textToRead; + } + }, { + key: "_getIcon", + value: function _getIcon() { + var item = this.props.item; + return _react.default.createElement(_iconGallery.default, { + item: item, + position: _iconGallery.PositionType.article + }); + } + }, { + key: "_onPress", + value: function _onPress() { + var _this$props2 = this.props, + item = _this$props2.item, + navigation = _this$props2.navigation; + var category = item.category, + gallery = item.gallery, + title = item.title; + + if (gallery.length > 0) { + navigation.navigate("GalleryScreen", { + items: gallery, + category: category, + title: title, + caller: "live_news" + }); + } + } + }, { + key: "_onBylinePress", + value: function _onBylinePress() { + var byline = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ""; + + if (byline) { + var regex = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}/g; + var matches = byline.match(regex); + + if (matches && matches.length > 0) { + _reactNativeMail.default.mail({ + recipients: matches, + isHTML: false + }, function (error) {}); + } + } + } + }, { + key: "_getTopBanner", + value: function _getTopBanner(onLayout) { + var renderTopBanner = this.props.renderTopBanner; + return renderTopBanner(onLayout); + } + }, { + key: "_setNativeAdsCallback", + value: function _setNativeAdsCallback(data) { + if (data && data.length) { + var nativeAds = data.filter(function (ad) { + return ad.provider !== InterstitialsKeysAndValues.values.provider.nativo; + }); + var item = this.props.item; + + _$$_REQUIRE(_dependencyMap[22]).EventRegister.emit(_events.default.LOAD_NATIVE_ADS, { + id: item.feedId, + nativeAds: nativeAds + }); + } + } + }, { + key: "_getNativeAds", + value: function _getNativeAds() { + var _this$props3 = this.props, + item = _this$props3.item, + insideAdModels = _this$props3.insideAdModels; + return _react.default.createElement(_articleAdContainer.default, { + articleId: item.feedId, + adModels: insideAdModels + }); + } + }, { + key: "_getPaywallContainer", + value: function _getPaywallContainer() { + var commonProps = { + autoHeightWebViewProps: { + ref: this.onPaywallWebViewRef, + disableStartAutoHeightEvaluation: !this.isCurrentPage + } + }; + + if (_Paywall.default.needToAppendHardPaywall()) { + return _react.default.createElement(_autoheightRssOptionspageComponent.default, (0, _extends2.default)({ + tab: _$$_REQUIRE(_dependencyMap[28]).tabs.account + }, commonProps)); + } + + var truncate = this.state.truncate; + var item = this.props.item; + var source = item.source; + + if (truncate && _Paywall.default.needToAppendPaywallPopup(source)) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[29]).PaywallPopup, (0, _extends2.default)({ + initialRender: false, + type: _$$_REQUIRE(_dependencyMap[30]).popupTypes.blocking, + ACI: source, + isAutoHeight: true + }, commonProps)); + } + + return null; + } + }, { + key: "_onHeightChange", + value: function _onHeightChange() { + this._getLoadedAds(); + } + }, { + key: "_getLoadedAds", + value: function _getLoadedAds() { + if (this.articleWebView) { + this.articleWebView.injectJavaScript("if (typeof getLoadedAds === 'function') getLoadedAds();"); + } + } + }, { + key: "_changeAdsVisibility", + value: function _changeAdsVisibility(hide) { + if (this.articleWebView) { + this.articleWebView.injectJavaScript("$(\"div[id^='mobileRectangle_atf']\")." + (hide ? "hide" : "show") + "();"); + } + } + }, { + key: "_openLink", + value: function _openLink(url) { + var navigation = this.props.navigation; + return navigation.navigate("WebScreen", { + url: url + }); + } + }, { + key: "_onLocal", + value: function _onLocal(_ref5) { + var domain = _ref5.domain, + getParams = _ref5.getParams; + var _this$props4 = this.props, + navigation = _this$props4.navigation, + orientation = _this$props4.orientation; + + switch (domain) { + case "openMostPopularArticle": + var parsed = []; + + try { + parsed = JSON.parse(getParams.data); + } catch (e) {} + + if (parsed.length > 0) { + var articles = (0, _$$_REQUIRE(_dependencyMap[31]).formatArticlesToDTO)(parsed); + var clickedPosition = articles[getParams.position]; + navigation.push("ArticleScreen", { + items: articles, + item: clickedPosition, + orientation: orientation + }); + } else { + _$$_REQUIRE(_dependencyMap[32]).Toast.show(global.strings("error_on_load_more"), { + position: "top" + }); + } + + break; + + case "openMostPopularGallery": + var parseGallery = parser.rssGallery(getParams.data); + + if (parseGallery) { + navigation.navigate("GalleryScreen", { + items: parseGallery, + caller: "live_news" + }); + } else { + _$$_REQUIRE(_dependencyMap[32]).Toast.show(global.strings("msg_empty_gallery"), { + position: "top" + }); + } + + break; + + case "loadGpsCoordinate": + break; + + case "goToCategory": + navigation.pop(); + navigation.navigate(getParams.message); + break; + } + } + }, { + key: "_onMessage", + value: function _onMessage(data) { + if (data.type === "INNER_TEXT") { + this._updateInnerText(data.content); + } else if (data.type === "GET_NATIVE_ADS_PLACEHOLDER") { + this._setNativeAdsCallback(data.content); + } + } + }, { + key: "_onLoad", + value: function _onLoad() {} + }, { + key: "_onLoadStart", + value: function _onLoadStart() { + var _this$props5 = this.props, + onLoadStart = _this$props5.onLoadStart, + index = _this$props5.index; + this.pageLoaded = false; + + if (this.viafouraRef) { + this.viafouraRef.hide(); + } + + if (onLoadStart) { + onLoadStart(index); + } + } + }, { + key: "_onLoadEnd", + value: function _onLoadEnd() { + var _this$props6 = this.props, + onLoadEnd = _this$props6.onLoadEnd, + index = _this$props6.index; + + if (this.viafouraRef && this.isCurrentPage) { + this.viafouraRef.show(); + } + + this.pageLoaded = true; + var isUserAdDisabled = global.getAdsConfig().isUserAdDisabled(); + + if (isUserAdDisabled) { + this._changeAdsVisibility(true); + } + + if (onLoadEnd) { + onLoadEnd(index); + } + } + }, { + key: "_onRef", + value: function _onRef(ref) { + this.articleWebView = ref; + } + }, { + key: "_onBaseWebViewRef", + value: function _onBaseWebViewRef(ref) { + this.webView = ref; + } + }, { + key: "_onViafouraRef", + value: function _onViafouraRef(ref) { + this.viafouraRef = ref; + } + }, { + key: "_onNativoMOAPContainerRef", + value: function _onNativoMOAPContainerRef(ref) { + this.nativoMOAPAutoHeightWebView = ref; + } + }, { + key: "_onNativoMOAPRef", + value: function _onNativoMOAPRef(ref) { + this.nativoMOAPWebView = ref; + } + }, { + key: "_onTopStoryRef", + value: function _onTopStoryRef(ref) { + this.topStoryWebView = ref; + } + }, { + key: "_onPaywallWebViewRef", + value: function _onPaywallWebViewRef(ref) { + this.paywallWebView = ref; + } + }, { + key: "_getResources", + value: function _getResources(item) { + var _this4 = this; + + var resources = item.getResources() || []; + var views = resources.map(function (resource, index) { + switch (resource.getType()) { + case _Resource.ResourceType.VIAFOURA: + return ViafouraWebView ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["article-resource-viafoura"], + key: "resource_" + index + }, _react.default.createElement(ViafouraWebView, { + autoHeightJs: "(" + _$$_REQUIRE(_dependencyMap[33]).checkContentHeight + ")();", + LoadingComponent: _react.default.createElement(_$$_REQUIRE(_dependencyMap[34]).ProgressCircle, { + showText: true, + text: global.strings("msg_loading_comments") + }), + ref: _this4.onViafouraRef, + url: resource.getValue(), + onLoadingUrl: function onLoadingUrl(_ref6) { + var url = _ref6.url; + + _this4._openLink(url); + } + })) : null; + + case _Resource.ResourceType.TOP_STORY: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["article-resource-top-stories"], + key: "resource_" + index + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[35]).AutoHeightWebView, { + ref: _this4.onTopStoryRef, + onLocal: _this4.onLocal, + source: { + uri: resource.getValue() + }, + disableStartAutoHeightEvaluation: !_this4.isCurrentPage + })); + + case _Resource.ResourceType.NATIVO_MOAP_AD: + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["article-resource-nativo-moap"], + key: "resource_" + index + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[35]).AutoHeightWebView, { + ref: _this4.onNativoMOAPContainerRef, + innerRef: _this4.onNativoMOAPRef, + source: { + html: resource.getValue() + }, + disableStartAutoHeightEvaluation: !_this4.isCurrentPage + })); + + default: + return null; + } + }); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[24]).Css, { + classes: ["article-resources"] + }, views); + } + }, { + key: "_getWebViewWithContent", + value: function _getWebViewWithContent(item) { + var loadUrlInArticle = this.props.loadUrlInArticle; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[35]).AutoHeightWebView, { + keyToShow: item.title, + htmlContentId: "content", + ref: this.onRef, + innerRef: this.onBaseWebViewRef, + onLoad: this.onLoad, + onLoadStart: this.onLoadStart, + onLoadEnd: this.onLoadEnd, + browser: loadUrlInArticle, + onLocal: this.onLocal, + source: this._getHtmlSource(item), + onHeightChange: this.onHeightChange, + onMessage: this.onMessage, + onLinkClicked: this.openLink, + focusableInTouchMode: false, + focusable: false, + disableStartAutoHeightEvaluation: !this.isCurrentPage + }); + } + }]); + return ArticleContentBase; + }(_react.default.PureComponent); + + exports.default = ArticleContentBase; + ArticleContentBase.propTypes = { + index: _propTypes.default.number.isRequired, + onRef: _propTypes.default.func.isRequired, + item: _propTypes.default.object, + isCurrentPage: _propTypes.default.bool.isRequired, + loadUrlInArticle: _propTypes.default.bool, + hasColumnizer: _propTypes.default.bool, + navigation: _propTypes.default.shape({ + state: _propTypes.default.shape({ + params: _propTypes.default.shape({ + items: _propTypes.default.array, + item: _propTypes.default.object + }) + }), + push: _propTypes.default.func, + pop: _propTypes.default.func, + navigate: _propTypes.default.func + }), + renderTopBanner: _propTypes.default.func, + orientation: _propTypes.default.string, + nativoAdsMOAP: _propTypes.default.string, + onLoadStart: _propTypes.default.func, + onLoadEnd: _propTypes.default.func, + onUnmount: _propTypes.default.func, + insideAdModels: _propTypes.default.arrayOf(_propTypes.default.object) + }; + ArticleContentBase.defaultProps = { + hasColumnizer: false, + insideAdModels: [] + }; +},2589,[5,80,6,7,8,15,12,14,16,17,201,2152,2028,460,2052,2177,1974,1973,1862,2590,731,2147,572,2185,699,462,2188,719,730,1868,1865,2051,1889,1903,1953,1901]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _IAPHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _newsmemoryUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _optionspageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var AutoHeightRssOptionspage = function (_RssOptionspage) { + (0, _inherits2.default)(AutoHeightRssOptionspage, _RssOptionspage); + + var _super = _createSuper(AutoHeightRssOptionspage); + + function AutoHeightRssOptionspage() { + (0, _classCallCheck2.default)(this, AutoHeightRssOptionspage); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(AutoHeightRssOptionspage, [{ + key: "_handleLocals", + value: function _handleLocals(_ref) { + var domain, getParams; + return _regenerator.default.async(function _handleLocals$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + domain = _ref.domain, getParams = _ref.getParams; + + if (domain.includes(_optionspageUtils.locals.INITPAGE_SET_NEWSPAPER_AND_READ)) { + _$$_REQUIRE(_dependencyMap[15]).EventRegister.emit(_events.default.PAYWALL_USER_STATUS_UPDATE, { + loggedIn: true, + caption: global.strings("btn_logout") + }); + } else { + (0, _get2.default)((0, _getPrototypeOf2.default)(AutoHeightRssOptionspage.prototype), "_handleLocals", this).call(this, { + domain: domain, + getParams: getParams + }); + } + + case 2: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "render", + value: function render() { + var _this = this; + + var autoHeightWebViewProps = this.props.autoHeightWebViewProps; + var uri = this.state.uri; + + _IAPHelper.default.resetServerCallback(); + + if (!uri) { + this._onClose(); + + return null; + } + + this._onOpen(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).AutoHeightWebView, (0, _extends2.default)({ + innerRef: function innerRef(ref) { + _this.baseRef = ref; + }, + webviewRef: function webviewRef(ref) { + _this.webview = ref; + }, + source: { + uri: uri + }, + defaultHeight: 500, + browser: true, + progressColor: _newsmemoryUtils.default.getSpinnerColor(), + onLocal: this.handleLocals, + onLoading: this.onLoading, + onLoadEnd: function onLoadEnd() { + var currentTab = _optionspageUtils.default.getTabByURL(_this.currentUrl); + + if (currentTab) { + _this.postMessage("{title: $('#myNavbar li.active a').html()}"); + } + }, + onMessage: this.onMessage, + automaticallyAdjustContentInsets: true, + scalesPageToFit: false, + onNavigationStateChange: function onNavigationStateChange(navState) { + _this.canGoBack = navState.canGoBack; + _this.currentUrl = navState.url; + }, + enableKeyboardResize: _$$_REQUIRE(_dependencyMap[17]).PlatformUtils.isAndroid(), + startInLoadingState: _$$_REQUIRE(_dependencyMap[18]).BaseWebView.LoadingStatePosition.none, + userAgent: _$$_REQUIRE(_dependencyMap[17]).PlatformUtils.getUserAgent() + }, autoHeightWebViewProps)); + } + }]); + return AutoHeightRssOptionspage; + }(_$$_REQUIRE(_dependencyMap[19]).RssOptionspage); + + AutoHeightRssOptionspage.propTypes = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[19]).RssOptionspage.propTypes, { + autoHeightWebViewProps: _propTypes.default.object + }); + + var _default = function _default(props) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[20]).useNavigation)(); + return _react.default.createElement(AutoHeightRssOptionspage, (0, _extends2.default)({}, props, { + navigation: navigation + })); + }; + + exports.default = _default; +},2590,[5,80,6,7,8,90,12,14,16,17,201,1934,603,730,460,572,1901,462,1894,2591,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.RssOptionspage = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _LoginManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var RssOptionspage = function (_SingleTabOptionspage) { + (0, _inherits2.default)(RssOptionspage, _SingleTabOptionspage); + + var _super = _createSuper(RssOptionspage); + + function RssOptionspage() { + (0, _classCallCheck2.default)(this, RssOptionspage); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(RssOptionspage, [{ + key: "_appendOthersParams", + value: function _appendOthersParams() { + var getParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var params = (0, _get2.default)((0, _getPrototypeOf2.default)(RssOptionspage.prototype), "_appendOthersParams", this).call(this, getParams); + return (0, _extends2.default)({}, params, { + isRss: 1 + }); + } + }, { + key: "_close", + value: function _close(force) { + var onUserClose = this.props.onUserClose; + + if (force || !onUserClose || typeof onUserClose !== "function") { + this.setState({ + uri: null + }); + } else { + this.setState({ + uri: null + }, onUserClose); + } + } + }, { + key: "_goBack", + value: function _goBack() { + this._close(); + } + }, { + key: "_handleLocals", + value: function _handleLocals(_ref) { + var domain, getParams, navigation; + return _regenerator.default.async(function _handleLocals$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + domain = _ref.domain, getParams = _ref.getParams; + + if (!domain.includes(_$$_REQUIRE(_dependencyMap[14]).locals.INITPAGE_SET_NEWSPAPER_AND_READ)) { + _context.next = 6; + break; + } + + this._close(true); + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.emit(_events.default.PAYWALL_USER_STATUS_UPDATE, { + loggedIn: true, + caption: global.strings("btn_logout") + }); + + _context.next = 13; + break; + + case 6: + if (!domain.includes(_$$_REQUIRE(_dependencyMap[14]).locals.LOGOUT)) { + _context.next = 12; + break; + } + + _context.next = 9; + return _regenerator.default.awrap(_LoginManager.default.logout()); + + case 9: + _$$_REQUIRE(_dependencyMap[15]).EventRegister.emit(_events.default.PAYWALL_USER_STATUS_UPDATE, { + loggedIn: false + }); + + _context.next = 13; + break; + + case 12: + if (domain.includes(_$$_REQUIRE(_dependencyMap[14]).locals.OPEN_NATIVE_SETTINGS_SCREEN)) { + navigation = this.props.navigation; + + if (navigation) { + navigation.navigate("GeneralSettingsScreen", { + module: _$$_REQUIRE(_dependencyMap[16]).GeneralSettingsModules.RSS + }); + + this._close(); + } + } else { + (0, _get2.default)((0, _getPrototypeOf2.default)(RssOptionspage.prototype), "_handleLocals", this).call(this, { + domain: domain, + getParams: getParams + }); + } + + case 13: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getCustomStyle", + value: function _getCustomStyle() { + var style = this.props.style; + + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA.top; + + return (0, _extends2.default)({ + top: top + }, style); + } + }]); + return RssOptionspage; + }(_$$_REQUIRE(_dependencyMap[17]).SingleTabOptionspage); + + exports.RssOptionspage = RssOptionspage; + RssOptionspage.propTypes = (0, _extends2.default)({}, _$$_REQUIRE(_dependencyMap[17]).SingleTabOptionspage.propTypes, { + onUserClose: _propTypes.default.func + }); + + var _default = function _default(props) { + var navigation = (0, _$$_REQUIRE(_dependencyMap[18]).useNavigation)(); + return _react.default.createElement(RssOptionspage, (0, _extends2.default)({}, props, { + navigation: navigation + })); + }; + + exports.default = _default; +},2591,[5,80,6,7,8,90,12,14,16,17,201,2057,460,458,730,572,2232,2592,1002]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SingleTabOptionspage = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _optionspageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SingleTabOptionspage = function (_BaseOptionspage) { + (0, _inherits2.default)(SingleTabOptionspage, _BaseOptionspage); + + var _super = _createSuper(SingleTabOptionspage); + + function SingleTabOptionspage() { + (0, _classCallCheck2.default)(this, SingleTabOptionspage); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(SingleTabOptionspage, [{ + key: "_appendOthersParams", + value: function _appendOthersParams() { + var getParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var params = (0, _get2.default)((0, _getPrototypeOf2.default)(SingleTabOptionspage.prototype), "_appendOthersParams", this).call(this, getParams); + return (0, _extends2.default)({}, params, { + hideTabs: 1 + }); + } + }, { + key: "_openTab", + value: function _openTab(_ref) { + var tab = _ref.tab, + getParams = _ref.getParams, + url = _ref.url, + closeType = _ref.closeType, + forceFullscreen = _ref.forceFullscreen; + + var isOnline = _$$_REQUIRE(_dependencyMap[9]).NetworkUtils.isOnline(); + + if (isOnline) { + var uri = _optionspageUtils.default.getTabUrl(tab, this._appendOthersParams(getParams)); + + this.setState({ + uri: uri, + closeType: closeType, + forceFullscreen: forceFullscreen + }); + } else { + (0, _get2.default)((0, _getPrototypeOf2.default)(SingleTabOptionspage.prototype), "_openTab", this).call(this, { + tab: tab, + getParams: getParams, + url: url, + closeType: closeType, + forceFullscreen: forceFullscreen + }); + } + } + }]); + return SingleTabOptionspage; + }(_$$_REQUIRE(_dependencyMap[10]).BaseOptionspage); + + exports.SingleTabOptionspage = SingleTabOptionspage; +},2592,[5,6,7,8,90,12,14,16,730,462,2297]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ArticleContentHeader = ArticleContentHeader; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _blurImageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _iconGallery = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _dailymotionVideoPlayerComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function ArticleHeaderOverlay(props) { + var item = props.item, + hasImage = props.hasImage, + hasVideo = props.hasVideo; + var gallery = item.gallery; + var galleryItem = gallery.find(function (gItem) { + return !!gItem.caption; + }); + + var _global$getRssIndex = global.getRssIndex(), + supportColor = _global$getRssIndex.supportColor; + + var overlayBgColor = hasImage || hasVideo ? _$$_REQUIRE(_dependencyMap[9]).colors.transparent600 : supportColor; + var hideIcon = hasVideo && gallery && gallery.length === 1; + return _react.default.createElement(_react.default.Fragment, null, galleryItem ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["article-header-image-description"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[11]).styles.captionContainer, { + backgroundColor: overlayBgColor + }] + }, galleryItem && galleryItem.caption ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["article-header-image-caption"] + }, _react.default.createElement(_fontText.default, { + numberOfLines: 2, + style: _$$_REQUIRE(_dependencyMap[11]).styles.caption + }, galleryItem.caption)) : null)) : null, !hideIcon ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["article-fixed-header"] + }, _react.default.createElement(_iconGallery.default, { + parentStyle: { + position: "absolute", + height: 40, + width: 40, + margin: 2 + }, + item: item, + position: _iconGallery.PositionType.article + })) : null); + } + + function HeaderImage(props) { + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["article-header-image"] + }, _react.default.createElement(_blurImageComponent.default, props)); + } + + function ArticleContentHeader(props) { + var item = props.item, + onRendered = props.onRendered, + onImagePress = props.onImagePress, + onImageError = props.onImageError, + width = props.width, + height = props.height; + var image = item.image, + gallery = item.gallery; + + var _global$getRssIndex2 = global.getRssIndex(), + articleBgColor = _global$getRssIndex2.articleBgColor; + + var backgroundColor = _styleUtils.default.fixColorForDarkTheme(articleBgColor); + + var hasVideo = (0, _$$_REQUIRE(_dependencyMap[12]).galleryHasDailymotionVideo)(gallery); + var hasImage = !hasVideo && !!image; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["article-header"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[11]).styles.container, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).Css, { + classes: ["article-header-no-image"] + }, _react.default.createElement(_reactNative.View, null, hasVideo ? _react.default.createElement(_reactNative.View, { + style: { + width: width, + height: height + } + }, _react.default.createElement(_dailymotionVideoPlayerComponent.default, { + video: gallery[0], + style: { + width: "100%", + flex: 1 + } + })) : null, hasImage ? _react.default.createElement(HeaderImage, { + width: width, + height: height, + onRendered: onRendered, + onImagePress: onImagePress, + onImageError: onImageError, + image: image + }) : null, _react.default.createElement(ArticleHeaderOverlay, { + item: item, + hasImage: hasImage, + hasVideo: hasVideo + }))))); + } + + ArticleContentHeader.propTypes = { + width: _propTypes.default.number, + height: _propTypes.default.number, + item: _propTypes.default.shape({ + image: _propTypes.default.string, + gallery: _propTypes.default.array + }), + onRendered: _propTypes.default.func, + onImagePress: _propTypes.default.func, + onImageError: _propTypes.default.func + }; +},2593,[5,17,28,201,1879,2050,2028,2129,2147,462,699,2594,1975]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + container: { + flex: 1, + flexDirection: "column" + }, + captionContainer: { + position: "absolute", + bottom: 0, + start: 0, + end: 0, + backgroundColor: _$$_REQUIRE(_dependencyMap[1]).colors.transparent600 + }, + caption: { + color: "white", + padding: 10 + } + }); + + exports.styles = styles; +},2594,[28,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2595,[2596]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ParallaxScroll = ParallaxScroll; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function ParallaxScroll(props) { + var onScroll = props.onScroll, + wrapperStyle = props.style, + width = props.width, + height = props.height, + children = props.children, + parallaxHeight = props.parallaxHeight, + contentContainerStyle = props.contentContainerStyle, + renderParallaxBackground = props.renderParallaxBackground, + parallaxBackgroundScrollSpeed = props.parallaxBackgroundScrollSpeed, + scrollViewProps = (0, _objectWithoutProperties2.default)(props, ["onScroll", "style", "width", "height", "children", "parallaxHeight", "contentContainerStyle", "renderParallaxBackground", "parallaxBackgroundScrollSpeed"]); + var scrollY = (0, _react.useRef)(new _reactNative.Animated.Value(0)); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).TecnaviaAnimatedScrollView, (0, _extends2.default)({ + style: [{ + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[7]).colors.white + }, wrapperStyle], + bounces: false, + scrollEventThrottle: 16 + }, scrollViewProps, { + onScroll: _reactNative.Animated.event([{ + nativeEvent: { + contentOffset: { + y: scrollY.current + } + } + }], { + listener: function listener(e) { + return onScroll && onScroll(e); + }, + useNativeDriver: true + }), + onMoveShouldSetResponder: function onMoveShouldSetResponder() { + return false; + }, + onStartShouldSetResponderCapture: function onStartShouldSetResponderCapture() { + return false; + } + }), _react.default.createElement(_reactNative.View, { + style: { + height: parallaxHeight + } + }), _react.default.createElement(_reactNative.Animated.View, { + style: { + position: "absolute", + width: width, + height: parallaxHeight, + transform: [{ + translateY: !parallaxHeight ? 0 : scrollY.current.interpolate({ + inputRange: [0, parallaxHeight], + outputRange: [0, parallaxHeight / parallaxBackgroundScrollSpeed], + extrapolate: "extend" + }) + }] + } + }, renderParallaxBackground && renderParallaxBackground()), children); + } + + ParallaxScroll.propTypes = { + style: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.object]), + width: _propTypes.default.number.isRequired, + height: _propTypes.default.number, + onScroll: _propTypes.default.func, + contentContainerStyle: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.number, _propTypes.default.object]), + renderParallaxBackground: _propTypes.default.func, + parallaxHeight: _propTypes.default.number.isRequired, + parallaxBackgroundScrollSpeed: _propTypes.default.number, + children: _propTypes.default.any + }; + ParallaxScroll.defaultProps = { + style: {}, + height: window.height, + children: null, + onScroll: null, + contentContainerStyle: {}, + renderParallaxBackground: null, + parallaxBackgroundScrollSpeed: 2 + }; +},2596,[5,6,108,17,28,201,1909,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2597,[2598]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ArticleContentHeadline = ArticleContentHeadline; + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function ArticleContentHeadline(props) { + var date = props.date, + title = props.title, + kicker = props.kicker, + byline = props.byline, + renderTopBanner = props.renderTopBanner, + onBylinePress = props.onBylinePress; + + var _global$getRssIndex = global.getRssIndex(), + articleBgColor = _global$getRssIndex.articleBgColor; + + var backgroundColor = _styleUtils.default.fixColorForDarkTheme(articleBgColor); + + var color = _$$_REQUIRE(_dependencyMap[6]).Css.getDefaultForegroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["article-top-content"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[7]).styles.container, { + backgroundColor: backgroundColor + }] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["article-description"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[7]).styles.description + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["article-header-image-date"] + }, _react.default.createElement(_fontText.default, { + numberOfLines: 1, + style: [_$$_REQUIRE(_dependencyMap[7]).styles.time, { + color: color + }] + }, date)), _react.default.createElement(_reactNative.View, null, kicker ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["article-kicker"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: [_$$_REQUIRE(_dependencyMap[7]).styles.kicker, { + color: color + }] + }, kicker)) : null, title ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["article-title"] + }, _react.default.createElement(_fontText.default, { + type: _fontText.Type.bold, + style: [_$$_REQUIRE(_dependencyMap[7]).styles.title, { + color: color + }] + }, title)) : null), byline ? _react.default.createElement(_reactNative.View, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[6]).Css, { + classes: ["article-byline"] + }, _react.default.createElement(_fontText.default, { + style: [_$$_REQUIRE(_dependencyMap[7]).styles.byline, { + color: color + }], + onPress: function onPress() { + if (typeof onBylinePress === "function") { + onBylinePress(byline); + } + } + }, byline))) : null)), renderTopBanner && renderTopBanner())); + } + + ArticleContentHeadline.propTypes = { + date: _propTypes.default.string, + title: _propTypes.default.string, + kicker: _propTypes.default.string, + byline: _propTypes.default.string, + renderTopBanner: _propTypes.default.func, + onBylinePress: _propTypes.default.func + }; + ArticleContentHeadline.defaultProps = { + date: "" + }; +},2598,[5,17,28,201,1879,2147,699,2599]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + container: { + flex: 1, + flexDirection: "column" + }, + description: { + flexDirection: "column", + justifyContent: "space-between", + paddingHorizontal: 15, + paddingTop: 15 + }, + kicker: { + padding: 4, + fontSize: 20 + }, + title: { + padding: 4, + fontSize: 24 + }, + byline: { + fontSize: 16, + padding: 4 + }, + time: { + paddingHorizontal: 4 + } + }); + + exports.styles = styles; +},2599,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2600,[2601]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.CircularFloatingActionMenu = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _reactNativeShare = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _ActionButton = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _Paywall = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _circularFloatingActionMenu = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var _imageIconChooserComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var CircularFloatingActionMenu = function (_React$Component) { + (0, _inherits2.default)(CircularFloatingActionMenu, _React$Component); + + var _super = _createSuper(CircularFloatingActionMenu); + + function CircularFloatingActionMenu(props) { + var _this; + + (0, _classCallCheck2.default)(this, CircularFloatingActionMenu); + _this = _super.call(this, props); + _this.state = { + isSpeaking: global.getAudio().ttsIsSpeaking() + }; + return _this; + } + + (0, _createClass2.default)(CircularFloatingActionMenu, [{ + key: "componentDidMount", + value: function componentDidMount() { + var _this2 = this; + + var item = this.props.item; + + var _global$getRSSActiveP = global.getRSSActivePSetup(), + paperName = _global$getRSSActiveP.paperName; + + var _global$getRssIndex = global.getRssIndex(), + subject = _global$getRssIndex.customSubject; + + if (subject) { + subject = subject.replace("##paper##", paperName); + subject = subject.replace("##title##", item.title); + } + + this.setState({ + subject: subject + }); + this.ttsStart = _$$_REQUIRE(_dependencyMap[15]).EventRegister.on(_events.default.TTS_ENGINE_STARTED, function () { + _this2.setState({ + isSpeaking: true + }); + }); + this.ttsStop = _$$_REQUIRE(_dependencyMap[15]).EventRegister.on(_events.default.TTS_ENGINE_STOPPED, function () { + _this2.setState({ + isSpeaking: false + }); + }); + this.userStatusUpdate = _$$_REQUIRE(_dependencyMap[15]).EventRegister.on(_events.default.PAYWALL_USER_STATUS_UPDATE, function (_ref) { + var caption = _ref.caption, + loggedIn = _ref.loggedIn; + + _this2.forceUpdate(); + }); + } + }, { + key: "componentWillUnmount", + value: function componentWillUnmount() { + _$$_REQUIRE(_dependencyMap[15]).EventRegister.rm(this.ttsStart); + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.rm(this.ttsStop); + + _$$_REQUIRE(_dependencyMap[15]).EventRegister.rm(this.userStatusUpdate); + } + }, { + key: "_getFavoriteItem", + value: function _getFavoriteItem() { + var item = this.props.item; + + var _global$getRssIndex2 = global.getRssIndex(), + supportColor = _global$getRssIndex2.supportColor; + + var favoritesConfig = global.getRssFavoritesConfig(); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[16]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_ActionButton.default.Item, { + buttonColor: backgroundColor, + onPress: function onPress() { + favoritesConfig.toggleFavorite(item); + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["article-floating-button-favorite"] + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).IconFavorite, { + item: item, + color: supportColor, + eventToggleItemChecker: function eventToggleItemChecker(currentItem, params) { + return currentItem.feedId === params.feedId; + }, + clearFavoritesEventName: _events.default.CLEAR_FAVORITES, + toggleFavoritesEventName: _events.default.TOGGLE_FAVORITE, + isFavoriteChecker: function isFavoriteChecker(favorite) { + return favoritesConfig.isFavorite(favorite); + } + }))); + } + }, { + key: "_getFontItem", + value: function _getFontItem() { + var _global$getRssIndex3 = global.getRssIndex(), + supportColor = _global$getRssIndex3.supportColor; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[16]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_ActionButton.default.Item, { + buttonColor: backgroundColor, + onPress: function onPress() { + global.getUserSettings().toggleFontSize(false, true); + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["article-floating-button-font"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + name: "format-size", + type: _$$_REQUIRE(_dependencyMap[18]).TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + iconStyle: [_circularFloatingActionMenu.default.icon, { + color: supportColor + }] + }))); + } + }, { + key: "_getTTSItem", + value: function _getTTSItem() { + var _this3 = this; + + var item = this.props.item; + + var _global$getRSSActiveP2 = global.getRSSActivePSetup(), + enableTextToSpeech = _global$getRSSActiveP2.enableTextToSpeech; + + if (!enableTextToSpeech || item && _Paywall.default.shouldShowPaywall(item.source)) { + return null; + } + + var isSpeaking = this.state.isSpeaking; + + var _global$getRssIndex4 = global.getRssIndex(), + supportColor = _global$getRssIndex4.supportColor; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[16]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_ActionButton.default.Item, { + buttonColor: backgroundColor, + onPress: function onPress() { + return _this3._tts(); + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["article-floating-button-tts"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + name: isSpeaking ? "volume-high" : "volume-mute", + type: _$$_REQUIRE(_dependencyMap[18]).TecnaviaIconType.MATERIAL_COMMUNITY_ICONS, + iconStyle: [_circularFloatingActionMenu.default.icon, { + color: supportColor + }] + }))); + } + }, { + key: "_tts", + value: function _tts() { + var innerText, isSpeaking; + return _regenerator.default.async(function _tts$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + innerText = this.props.innerText; + isSpeaking = this.state.isSpeaking; + + if (innerText) { + if (isSpeaking) { + global.getAudio().ttsStop(); + } else { + global.getAudio().ttsStart(innerText()); + } + } + + case 3: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_getShareItem", + value: function _getShareItem() { + var _this4 = this; + + var _global$getRssIndex5 = global.getRssIndex(), + supportColor = _global$getRssIndex5.supportColor; + + var backgroundColor = _$$_REQUIRE(_dependencyMap[16]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_ActionButton.default.Item, { + buttonColor: backgroundColor, + onPress: function onPress() { + return _this4._share(); + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["article-floating-button-share"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + name: "share", + type: _$$_REQUIRE(_dependencyMap[18]).TecnaviaIconType.MATERIAL_ICONS, + iconStyle: [_circularFloatingActionMenu.default.icon, { + color: supportColor + }] + }))); + } + }, { + key: "_share", + value: function _share() { + var item = this.props.item; + var source = item.source, + title = item.title; + var subject = this.state.subject; + + _reactNativeShare.default.open({ + url: source, + title: "Share", + subject: subject || title, + message: title + }).then(function (result) {}).catch(function (error) {}); + } + }, { + key: "_getButtonColor", + value: function _getButtonColor() { + var buttonColor = this.props.buttonColor; + return _$$_REQUIRE(_dependencyMap[16]).Css.isDarkTheme() ? _$$_REQUIRE(_dependencyMap[16]).Css.getDefaultBackgroundColor() : buttonColor || _$$_REQUIRE(_dependencyMap[16]).Css.getDefaultBackgroundColor(); + } + }, { + key: "_getTextColor", + value: function _getTextColor() { + var buttonTextColor = this.props.buttonTextColor; + + var _global$getRssIndex6 = global.getRssIndex(), + supportColor = _global$getRssIndex6.supportColor; + + var bgColor = this._getButtonColor(); + + var bgIsClear = _$$_REQUIRE(_dependencyMap[19]).ColorUtils.isClearColor(bgColor); + + var supportIsClear = _$$_REQUIRE(_dependencyMap[19]).ColorUtils.isClearColor(supportColor); + + if (bgIsClear !== supportIsClear) { + return supportColor; + } + + if (buttonTextColor) { + var buttonTextColorIsClear = _$$_REQUIRE(_dependencyMap[19]).ColorUtils.isClearColor(buttonTextColor); + + if (bgIsClear !== buttonTextColorIsClear) { + return buttonTextColorIsClear; + } + } + + if (_$$_REQUIRE(_dependencyMap[16]).Css.isDarkTheme()) { + return supportColor; + } + + return _$$_REQUIRE(_dependencyMap[19]).ColorUtils.determineTextColor(bgColor); + } + }, { + key: "_getPlusIcon", + value: function _getPlusIcon() { + var color = this._getTextColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["article-floating-button-plus"] + }, _react.default.createElement(_imageIconChooserComponent.default, { + name: "add", + type: _$$_REQUIRE(_dependencyMap[18]).TecnaviaIconType.MATERIAL_ICONS, + size: 24, + style: { + color: color + } + })); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + startDegree = _this$props.startDegree, + endDegree = _this$props.endDegree, + itemSize = _this$props.itemSize, + buttonTextColor = _this$props.buttonTextColor, + style = _this$props.style; + + var buttonColor = this._getButtonColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).Css, { + classes: ["article-floating-button"] + }, _react.default.createElement(_ActionButton.default, { + radius: 120, + size: 45, + itemSize: itemSize, + startDegree: startDegree, + endDegree: endDegree, + bgColor: _$$_REQUIRE(_dependencyMap[19]).colors.modalBackground, + buttonColor: buttonColor, + btnOutRange: buttonColor, + buttonTextColor: buttonTextColor, + btnOutRangeTxt: buttonTextColor, + style: [{ + alignItems: "flex-end" + }, style], + icon: this._getPlusIcon() + }, this._getShareItem(), this._getFavoriteItem(), this._getFontItem(), this._getTTSItem())); + } + }]); + return CircularFloatingActionMenu; + }(_react.default.Component); + + exports.CircularFloatingActionMenu = CircularFloatingActionMenu; + CircularFloatingActionMenu.propTypes = { + startDegree: _propTypes.default.number, + endDegree: _propTypes.default.number, + itemSize: _propTypes.default.number, + buttonTextColor: _propTypes.default.string, + buttonColor: _propTypes.default.string, + item: _propTypes.default.object, + innerText: _propTypes.default.func, + style: _propTypes.default.any + }; +},2601,[5,80,7,8,12,14,16,17,201,575,2602,460,1862,1971,1970,572,699,2604,1806,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _ActionButtonItem = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var alignMap = { + center: { + alignItems: "center", + justifyContent: "flex-end", + startDegree: 180, + endDegree: 360 + }, + left: { + alignItems: "flex-start", + justifyContent: "flex-end", + startDegree: 270, + endDegree: 360 + }, + right: { + alignItems: "flex-end", + justifyContent: "flex-end", + startDegree: 180, + endDegree: 270 + } + }; + + var styles = _reactNative.StyleSheet.create({ + overlay: { + position: "absolute", + bottom: 0, + left: 0, + right: 0, + top: 0, + backgroundColor: "transparent" + }, + actionContainer: { + flexDirection: "column", + padding: 10 + }, + actionBarItem: { + alignItems: "center", + justifyContent: "center", + backgroundColor: "transparent" + }, + btn: { + justifyContent: "center", + alignItems: "center", + shadowOpacity: 0.3, + shadowOffset: { + width: 0, + height: 1 + }, + shadowColor: "#444", + shadowRadius: 1 + }, + btnText: { + marginTop: -4, + fontSize: 24, + backgroundColor: "transparent", + position: "relative" + } + }); + + var ActionButton = function (_Component) { + (0, _inherits2.default)(ActionButton, _Component); + + var _super = _createSuper(ActionButton); + + function ActionButton(props) { + var _this; + + (0, _classCallCheck2.default)(this, ActionButton); + _this = _super.call(this, props); + _this.state = { + active: props.active, + anim: new _reactNative.Animated.Value(props.active ? 1 : 0) + }; + _this.timeout = null; + return _this; + } + + (0, _createClass2.default)(ActionButton, [{ + key: "componentWillUnmount", + value: function componentWillUnmount() { + clearTimeout(this.timeout); + } + }, { + key: "getActionButtonStyle", + value: function getActionButtonStyle() { + return [styles.actionBarItem, this.getButtonSize()]; + } + }, { + key: "getActionContainerStyle", + value: function getActionContainerStyle() { + var style = this.props.style; + var actionContainer = styles.actionContainer, + overlay = styles.overlay; + return [overlay, actionContainer, style]; + } + }, { + key: "getActionsStyle", + value: function getActionsStyle() { + return [this.getButtonSize()]; + } + }, { + key: "getButtonSize", + value: function getButtonSize() { + var size = this.props.size; + return { + width: size, + height: size + }; + } + }, { + key: "animateButton", + value: function animateButton() { + var _this$state = this.state, + active = _this$state.active, + anim = _this$state.anim; + + if (active) { + this.reset(); + return; + } + + _reactNative.Animated.spring(anim, { + toValue: 1, + duration: 250 + }).start(); + + this.setState({ + active: true + }); + } + }, { + key: "reset", + value: function reset() { + var _this2 = this; + + var anim = this.state.anim; + + _reactNative.Animated.spring(anim, { + toValue: 0, + duration: 250 + }).start(); + + setTimeout(function () { + _this2.setState({ + active: false + }); + }, 250); + } + }, { + key: "renderButton", + value: function renderButton() { + var _this3 = this; + + var _this$props = this.props, + size = _this$props.size, + _onPress = _this$props.onPress, + children = _this$props.children, + onLongPress = _this$props.onLongPress, + buttonColor = _this$props.buttonColor, + btnOutRange = _this$props.btnOutRange, + degrees = _this$props.degrees, + outRangeScale = _this$props.outRangeScale; + var anim = this.state.anim; + return _react.default.createElement(_reactNative.View, { + style: this.getActionButtonStyle() + }, _react.default.createElement(_reactNative.TouchableOpacity, { + activeOpacity: 0.85, + onLongPress: onLongPress, + onPress: function onPress() { + _onPress(); + + if (children) { + _this3.animateButton(); + } + } + }, _react.default.createElement(_reactNative.Animated.View, { + style: [styles.btn, { + width: size, + height: size, + borderRadius: size / 2, + backgroundColor: anim.interpolate({ + inputRange: [0, 1], + outputRange: [buttonColor, btnOutRange] + }), + transform: [{ + scale: anim.interpolate({ + inputRange: [0, 1], + outputRange: [1, outRangeScale] + }) + }, { + rotate: anim.interpolate({ + inputRange: [0, 1], + outputRange: ["0deg", degrees + "deg"] + }) + }] + }] + }, this.renderButtonIcon()))); + } + }, { + key: "renderButtonIcon", + value: function renderButtonIcon() { + var _this$props2 = this.props, + icon = _this$props2.icon, + buttonTextColor = _this$props2.buttonTextColor, + btnOutRangeTxt = _this$props2.btnOutRangeTxt; + var anim = this.state.anim; + + if (icon) { + return icon; + } + + return _react.default.createElement(_reactNative.Animated.Text, { + style: [styles.btnText, { + color: anim.interpolate({ + inputRange: [0, 1], + outputRange: [buttonTextColor, btnOutRangeTxt] + }) + }] + }, "+"); + } + }, { + key: "renderActions", + value: function renderActions() { + var _this4 = this; + + var _this$props3 = this.props, + position = _this$props3.position, + itemSize = _this$props3.itemSize, + radius = _this$props3.radius, + btnOutRange = _this$props3.btnOutRange, + autoInactive = _this$props3.autoInactive; + var _this$props4 = this.props, + children = _this$props4.children, + startDegree = _this$props4.startDegree, + endDegree = _this$props4.endDegree; + var _this$state2 = this.state, + active = _this$state2.active, + anim = _this$state2.anim; + if (!active) return null; + startDegree = startDegree || alignMap[position].startDegree; + endDegree = endDegree || alignMap[position].endDegree; + var startRadian = startDegree * Math.PI / 180; + var endRadian = endDegree * Math.PI / 180; + children = children.filter(function (button) { + return button; + }); + + var childrenCount = _react.default.Children.count(children); + + var offset = 0; + + if (childrenCount !== 1) { + offset = (endRadian - startRadian) / (childrenCount - 1); + } + + return _react.default.Children.map(children, function (button, index) { + return _react.default.createElement(_reactNative.View, { + pointerEvents: "box-none", + style: _this4.getActionContainerStyle() + }, _react.default.createElement(_ActionButtonItem.default, (0, _extends2.default)({ + key: index, + position: position, + anim: anim, + size: itemSize, + radius: radius, + angle: startRadian + index * offset, + btnColor: btnOutRange + }, button.props, { + onPress: function onPress() { + if (autoInactive) { + _this4.timeout = setTimeout(function () { + _this4.reset(); + }, 200); + } + + button.props.onPress(); + } + }))); + }); + } + }, { + key: "render", + value: function render() { + var _this5 = this; + + var _this$props5 = this.props, + children = _this$props5.children, + onOverlayPress = _this$props5.onOverlayPress, + bgColor = _this$props5.bgColor, + backdropProp = _this$props5.backdrop; + var _this$state3 = this.state, + active = _this$state3.active, + anim = _this$state3.anim; + var backdrop; + + if (active) { + backdrop = _react.default.createElement(_reactNative.TouchableWithoutFeedback, { + style: styles.overlay, + onPress: function onPress() { + _this5.reset(); + + onOverlayPress(); + } + }, _react.default.createElement(_reactNative.Animated.View, { + style: { + backgroundColor: bgColor, + opacity: anim, + flex: 1 + } + }, backdropProp)); + } + + return _react.default.createElement(_reactNative.View, { + pointerEvents: "box-none", + style: styles.overlay + }, backdrop, children && this.renderActions(), _react.default.createElement(_reactNative.View, { + pointerEvents: "box-none", + style: this.getActionContainerStyle() + }, this.renderButton())); + } + }]); + return ActionButton; + }(_react.Component); + + exports.default = ActionButton; + ActionButton.Item = _ActionButtonItem.default; + ActionButton.propTypes = { + active: _propTypes.default.bool, + bgColor: _propTypes.default.string, + buttonColor: _propTypes.default.string, + buttonTextColor: _propTypes.default.string, + btnOutRange: _propTypes.default.string, + btnOutRangeTxt: _propTypes.default.string, + size: _propTypes.default.number, + itemSize: _propTypes.default.number, + autoInactive: _propTypes.default.bool, + onPress: _propTypes.default.func, + onOverlayPress: _propTypes.default.func, + onLongPress: _propTypes.default.func, + backdrop: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.object]), + degrees: _propTypes.default.number, + startDegree: _propTypes.default.number, + endDegree: _propTypes.default.number, + radius: _propTypes.default.number, + outRangeScale: _propTypes.default.number, + icon: _propTypes.default.node, + children: _propTypes.default.node, + position: _propTypes.default.oneOf(["left", "center", "right"]), + style: _propTypes.default.oneOfType([_propTypes.default.object, _propTypes.default.array, _propTypes.default.number]) + }; + ActionButton.defaultProps = { + active: false, + bgColor: _$$_REQUIRE(_dependencyMap[11]).colors.transparent, + buttonColor: _$$_REQUIRE(_dependencyMap[11]).colors.black, + buttonTextColor: _$$_REQUIRE(_dependencyMap[11]).colors.white, + position: "center", + outRangeScale: 1, + autoInactive: true, + onPress: function onPress() {}, + onOverlayPress: function onOverlayPress() {}, + backdrop: false, + degrees: 135, + size: 63, + itemSize: 36, + radius: 100, + btnOutRange: _$$_REQUIRE(_dependencyMap[11]).colors.black, + btnOutRangeTxt: _$$_REQUIRE(_dependencyMap[11]).colors.white + }; +},2602,[5,6,7,8,12,14,16,17,28,201,2603,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var styles = _reactNative.StyleSheet.create({ + actionButton: { + justifyContent: "center", + alignItems: "center", + flexDirection: "row", + paddingTop: 2, + shadowOpacity: 0.3, + shadowOffset: { + width: 0, + height: 1 + }, + shadowColor: "#444", + shadowRadius: 1, + backgroundColor: "red", + position: "absolute" + } + }); + + var ActionButtonItem = function (_Component) { + (0, _inherits2.default)(ActionButtonItem, _Component); + + var _super = _createSuper(ActionButtonItem); + + function ActionButtonItem() { + (0, _classCallCheck2.default)(this, ActionButtonItem); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(ActionButtonItem, [{ + key: "render", + value: function render() { + var offsetX = this.props.radius * Math.cos(this.props.angle); + var offsetY = this.props.radius * Math.sin(this.props.angle); + return _react.default.createElement(_reactNative.Animated.View, { + style: [{ + opacity: this.props.anim, + width: this.props.size, + height: this.props.size, + transform: [{ + translateY: this.props.anim.interpolate({ + inputRange: [0, 1], + outputRange: [0, offsetY] + }) + }, { + translateX: this.props.anim.interpolate({ + inputRange: [0, 1], + outputRange: [0, offsetX] + }) + }, { + rotate: this.props.anim.interpolate({ + inputRange: [0, 1], + outputRange: [this.props.startDegree + "deg", this.props.endDegree + "deg"] + }) + }, { + scale: this.props.anim.interpolate({ + inputRange: [0, 1], + outputRange: [0, 1] + }) + }] + }] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + style: { + flex: 1 + }, + activeOpacity: this.props.activeOpacity || 0.85, + onPress: this.props.onPress + }, _react.default.createElement(_reactNative.View, { + style: [styles.actionButton, { + width: this.props.size, + height: this.props.size, + borderRadius: this.props.size / 2, + backgroundColor: this.props.buttonColor + }] + }, this.props.children))); + } + }]); + return ActionButtonItem; + }(_react.Component); + + exports.default = ActionButtonItem; + ActionButtonItem.propTypes = { + angle: _propTypes.default.number, + radius: _propTypes.default.number, + buttonColor: _propTypes.default.string, + onPress: _propTypes.default.func, + children: _propTypes.default.node.isRequired, + startDegree: _propTypes.default.number, + endDegree: _propTypes.default.number + }; + ActionButtonItem.defaultProps = { + onPress: function onPress() {}, + startDegree: 0, + endDegree: 720 + }; +},2603,[5,7,8,12,14,16,17,28,201]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2604,[1969]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _articleContentTablet = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + var _articleContentBase = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _styleUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ArticleContentTablet = function (_ArticleContentBase) { + (0, _inherits2.default)(ArticleContentTablet, _ArticleContentBase); + + var _super = _createSuper(ArticleContentTablet); + + function ArticleContentTablet() { + (0, _classCallCheck2.default)(this, ArticleContentTablet); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(ArticleContentTablet, [{ + key: "_getBottomContentHTML", + value: function _getBottomContentHTML(item) { + var _global$getRssIndex = global.getRssIndex(), + articleBgColor = _global$getRssIndex.articleBgColor; + + var backgroundColor = _styleUtils.default.fixColorForDarkTheme(articleBgColor); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).TecnaviaScrollView, { + onLayout: this.onScrollLayout, + backgroundColor: backgroundColor, + contentBackgroundColor: backgroundColor, + onScroll: this.onScroll, + scrollEventThrottle: this.scrollEventThrottle + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["article-body"] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "column" + }, + pointerEvents: "box-none" + }, this.getTopBanner(), _react.default.createElement(_reactNative.View, { + style: { + flexDirection: "column" + } + }, this._getWebViewWithContent(item), this._getResources(item), this._getNativeAds(), this._getPaywallContainer())))); + } + }, { + key: "render", + value: function render() { + var _this$props = this.props, + item = _this$props.item, + index = _this$props.index, + totalItems = _this$props.size; + + var _global$getRssIndex2 = global.getRssIndex(), + hasSquaredImage = _global$getRssIndex2.hasSquaredImage, + articleTopColor = _global$getRssIndex2.articleTopColor; + + var startDegree = _$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isRTL() ? 360 : 180; + var endDegree = _$$_REQUIRE(_dependencyMap[14]).PlatformUtils.isRTL() ? 450 : 90; + + var headerStyle = _$$_REQUIRE(_dependencyMap[13]).Css.getStyleObjByCssClasses(["article-header"]); + + var headerHeight = headerStyle.height || _articleContentTablet.TOP_CONTENT_HEIGHT; + return _react.default.createElement(_reactNative.View, { + style: [_articleContentTablet.default.root, { + backgroundColor: _$$_REQUIRE(_dependencyMap[13]).Css.getDefaultBackgroundColor() + }] + }, _react.default.createElement(_reactNative.View, { + style: _articleContentTablet.default.body + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).ArticleContentTabletHeader, { + total: totalItems, + size: headerHeight, + index: index, + image: item.image, + date: item.date, + category: item.category, + kicker: item.kicker, + title: item.title, + byline: item.byline, + hasSquaredImage: hasSquaredImage, + rootStyle: { + height: headerHeight, + backgroundColor: articleTopColor, + paddingHorizontal: (0, _$$_REQUIRE(_dependencyMap[16]).getRssHorizontalpadding)() + }, + onImagePress: this.onPress, + onBylinePress: this.onBylinePress, + renderIcon: this.getIcon + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).Css, { + classes: ["article-body-parent"] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + paddingHorizontal: (0, _$$_REQUIRE(_dependencyMap[16]).getRssHorizontalpadding)() + } + }, this._getBottomContentHTML(item)))), _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).CircularFloatingActionMenu, { + style: { + top: headerHeight - _articleContentTablet.CIRCULAR_ACTION_MENU_SIZE - 15, + right: (0, _$$_REQUIRE(_dependencyMap[16]).getRssHorizontalpadding)(), + justifyContent: "flex-start" + }, + startDegree: startDegree, + endDegree: endDegree, + itemSize: _articleContentTablet.CIRCULAR_ACTION_MENU_SIZE, + innerText: this.getInnerText, + item: item + })); + } + }]); + return ArticleContentTablet; + }(_articleContentBase.default); + + exports.default = ArticleContentTablet; + ArticleContentTablet.propTypes = { + size: _propTypes.default.number, + item: _propTypes.default.object, + onBylinePress: _propTypes.default.func + }; +},2605,[5,7,8,12,14,16,17,201,28,2606,2589,2147,1909,699,462,2607,2039,2600]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = exports.CIRCULAR_ACTION_MENU_SIZE = exports.TOP_CONTENT_HEIGHT = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var TOP_CONTENT_HEIGHT = 200; + exports.TOP_CONTENT_HEIGHT = TOP_CONTENT_HEIGHT; + var CIRCULAR_ACTION_MENU_SIZE = 50; + exports.CIRCULAR_ACTION_MENU_SIZE = CIRCULAR_ACTION_MENU_SIZE; + + var _default = _reactNative.StyleSheet.create({ + root: { + flex: 1, + minHeight: 0 + }, + body: { + flex: 1, + minHeight: 0 + } + }); + + exports.default = _default; +},2606,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.ArticleContentTabletHeader = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _fontText = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[10])); + + var _imageComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _navigationUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var _doubleTextAutoMeasured = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var ArticleContentTabletHeader = function (_React$Component) { + (0, _inherits2.default)(ArticleContentTabletHeader, _React$Component); + + var _super = _createSuper(ArticleContentTabletHeader); + + function ArticleContentTabletHeader(props) { + var _this; + + (0, _classCallCheck2.default)(this, ArticleContentTabletHeader); + _this = _super.call(this, props); + _this.handleTextWrap = _this._handleTextWrap.bind((0, _assertThisInitialized2.default)(_this)); + _this.state = { + hideBylineArea: false + }; + return _this; + } + + (0, _createClass2.default)(ArticleContentTabletHeader, [{ + key: "_getForegroundColor", + value: function _getForegroundColor() { + return _$$_REQUIRE(_dependencyMap[14]).Css.isDarkTheme() ? _$$_REQUIRE(_dependencyMap[14]).Css.getDefaultForegroundColor() : _$$_REQUIRE(_dependencyMap[15]).colors.white; + } + }, { + key: "_getImage", + value: function _getImage(uri) { + var _this$props = this.props, + onImagePress = _this$props.onImagePress, + renderIcon = _this$props.renderIcon, + size = _this$props.size, + hasSquaredImage = _this$props.hasSquaredImage; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-header-image-parent"] + }, _react.default.createElement(_reactNative.TouchableOpacity, { + style: { + width: size, + height: size + }, + onPress: function onPress() { + if (typeof onImagePress === "function") { + onImagePress(); + } + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-header-image"] + }, _react.default.createElement(_imageComponent.default, { + style: hasSquaredImage ? _$$_REQUIRE(_dependencyMap[16]).styles.squaredImage : [_$$_REQUIRE(_dependencyMap[16]).styles.roundedImage, { + borderRadius: size / 2 - 5 + }, { + borderColor: this._getForegroundColor() + }], + source: { + uri: uri + } + })), typeof renderIcon === "function" ? renderIcon() : null)); + } + }, { + key: "_getDescription", + value: function _getDescription(category, date, index) { + var total = this.props.total; + var categoryName = _navigationUtils.default.isHiddenCategory(category) ? category.substring(1) : category; + var dateTime = category && date ? date + " " + _$$_REQUIRE(_dependencyMap[15]).StringUtils.BULLET + " " + categoryName : ""; + var detail = global.strings("counter", { + total: total, + current: index + }); + + var color = this._getForegroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-description"] + }, _react.default.createElement(_reactNative.View, { + style: _$$_REQUIRE(_dependencyMap[16]).styles.description + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-description-date"] + }, _react.default.createElement(_fontText.default, { + numberOfLines: 1, + style: [_$$_REQUIRE(_dependencyMap[16]).styles.descriptionField, { + color: color + }] + }, dateTime)), _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-description-counter"] + }, _react.default.createElement(_fontText.default, { + numberOfLines: 1, + style: [_$$_REQUIRE(_dependencyMap[16]).styles.descriptionField, { + color: color + }] + }, detail)))); + } + }, { + key: "_handleTextWrap", + value: function _handleTextWrap() { + var byline = this.props.byline; + var hideBylineArea = this.state.hideBylineArea; + + if (!byline && !hideBylineArea) { + this.setState({ + hideBylineArea: true + }); + return true; + } + + return false; + } + }, { + key: "render", + value: function render() { + var _this$props2 = this.props, + image = _this$props2.image, + date = _this$props2.date, + category = _this$props2.category, + kicker = _this$props2.kicker, + title = _this$props2.title, + byline = _this$props2.byline, + index = _this$props2.index, + rootStyle = _this$props2.rootStyle, + onBylinePress = _this$props2.onBylinePress; + var hideBylineArea = this.state.hideBylineArea; + + var color = this._getForegroundColor(); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-top-content"] + }, _react.default.createElement(_reactNative.View, { + style: [_$$_REQUIRE(_dependencyMap[16]).styles.topContentContainer, rootStyle] + }, image ? this._getImage(image) : null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-description-parent"] + }, _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + flexDirection: "column", + padding: 8 + } + }, this._getDescription(category, date, index + 1), _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-title-parent"] + }, _react.default.createElement(_doubleTextAutoMeasured.default, { + top: kicker ? { + disablePadding: true, + text: kicker, + classes: ["article-kicker"], + style: [_$$_REQUIRE(_dependencyMap[16]).styles.kicker, { + color: color + }], + props: { + type: _fontText.Type.regular + } + } : { + disablePadding: true, + text: title, + classes: ["article-title"], + style: [_$$_REQUIRE(_dependencyMap[16]).styles.title, { + color: color + }] + }, + bottom: kicker ? { + text: title, + classes: ["article-title"], + style: [_$$_REQUIRE(_dependencyMap[16]).styles.title, { + color: color + }], + props: { + type: _fontText.Type.bold + } + } : undefined, + containerStyle: _$$_REQUIRE(_dependencyMap[16]).styles.titleContainer, + handleTextWrap: this.handleTextWrap + })), !hideBylineArea ? _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).Css, { + classes: ["article-byline"] + }, _react.default.createElement(_fontText.default, { + style: [_$$_REQUIRE(_dependencyMap[16]).styles.byline, { + color: color + }], + onPress: function onPress() { + if (typeof onBylinePress === "function") { + onBylinePress(byline); + } + } + }, byline)) : null)))); + } + }]); + return ArticleContentTabletHeader; + }(_react.default.Component); + + exports.ArticleContentTabletHeader = ArticleContentTabletHeader; + ArticleContentTabletHeader.propTypes = { + size: _propTypes.default.number.isRequired, + total: _propTypes.default.number, + index: _propTypes.default.number, + image: _propTypes.default.string, + date: _propTypes.default.string, + category: _propTypes.default.string, + kicker: _propTypes.default.string, + title: _propTypes.default.string, + byline: _propTypes.default.string, + renderIcon: _propTypes.default.func, + onBylinePress: _propTypes.default.func, + onImagePress: _propTypes.default.func, + hasSquaredImage: _propTypes.default.bool, + rootStyle: _propTypes.default.any + }; +},2607,[5,7,8,15,12,14,16,17,28,201,1879,588,2045,2036,699,462,2608]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.styles = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var styles = _reactNative.StyleSheet.create({ + description: { + flexDirection: "row", + justifyContent: "space-between" + }, + descriptionField: { + fontSize: 16 + }, + titleContainer: { + flex: 1, + flexDirection: "column", + justifyContent: "center", + marginHorizontal: 0, + marginRight: 50, + marginVertical: 5 + }, + titleParent: { + backgroundColor: "red", + justifyContent: "flex-start" + }, + title: { + fontSize: 26 + }, + kicker: { + fontSize: 22 + }, + byline: { + fontSize: 16, + textAlign: "left" + }, + topContentContainer: { + flexDirection: "row" + }, + roundedImage: { + flex: 1, + borderWidth: 2, + margin: 5 + }, + squaredImage: { + flex: 1 + } + }); + + exports.styles = styles; +},2608,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.StyleSheet.create({ + root: { + position: "absolute", + top: 0, + bottom: 0, + left: 0, + right: 0, + width: null, + height: null + }, + swiper: { + flex: 1 + } + }); + + exports.default = _default; +},2609,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _safeAreaWebview = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SelectionScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(SelectionScreen, _NavigationBaseScreen); + + var _super = _createSuper(SelectionScreen); + + function SelectionScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, SelectionScreen); + _this = _super.call(this, props); + _this.remember = false; + _this.onMessage = _this._onMessage.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SelectionScreen, [{ + key: "_rssClicked", + value: function _rssClicked() { + return _regenerator.default.async(function _rssClicked$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + if (this.remember) { + global.getUserSettings().setRssAsStartupMode(); + } + + this._select("RssNavigator"); + + case 2: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_editionClicked", + value: function _editionClicked() { + return _regenerator.default.async(function _editionClicked$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + if (this.remember) { + global.getUserSettings().setNewsmemoryAsStartupMode(); + } + + this._select("NewsmemoryNavigator"); + + case 2: + case "end": + return _context2.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_select", + value: function _select(navigator) { + var navigation = this.props.navigation; + + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[12]).getNavigationParams)(this.props), + onSelect = _getNavigationParams.onSelect; + + if (typeof onSelect === "function") { + onSelect(navigation, navigator); + } + } + }, { + key: "_onMessage", + value: function _onMessage(data) { + var mode = data.mode, + remember = data.remember; + + if (mode) { + if (mode === "rss") { + this._rssClicked(); + } else if (mode === "epaper") { + this._editionClicked(); + } + } + + if (remember !== undefined) { + this.remember = remember; + } + } + }, { + key: "getTag", + value: function getTag() { + return "App Mode Selection"; + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(SelectionScreen.prototype), "handleBackButton", this).call(this); + this.closeApp(); + return true; + } + }, { + key: "render", + value: function render() { + var _global$getActivePSet = global.getActivePSetup(), + appModeSelectionPageURL = _global$getActivePSet.appModeSelectionPageURL; + + var uri = _$$_REQUIRE(_dependencyMap[13]).NetworkUtils.addDefaultProtocol(appModeSelectionPageURL); + + return _react.default.createElement(_safeAreaWebview.default, { + source: { + uri: uri + }, + onLocal: function onLocal() {}, + onMessage: this.onMessage + }); + } + }]); + return SelectionScreen; + }(_$$_REQUIRE(_dependencyMap[12]).NavigationBaseScreen); + + exports.default = SelectionScreen; + SelectionScreen.propTypes = { + navigation: _propTypes.default.object + }; +},2610,[5,80,7,8,15,90,12,14,16,17,201,2611,2148,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = SafeAreaWebView; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[3]); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _barsComponent = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _webUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function SafeAreaWebView(props) { + var source = props.source, + onRef = props.onRef, + innerRef = props.innerRef, + onLocal = props.onLocal, + onMessage = props.onMessage; + var showTopBar = true; + var setShowTopBar; + + var _global$getActivePSet = global.getActivePSetup(), + deviceDpi = _global$getActivePSet.deviceDpi; + + if (_$$_REQUIRE(_dependencyMap[8]).PlatformUtils.isiPadMini8dot3(deviceDpi)) { + var _useState = (0, _react.useState)(!_deviceUtils.default.isPortrait()); + + var _useState2 = (0, _slicedToArray2.default)(_useState, 2); + + showTopBar = _useState2[0]; + setShowTopBar = _useState2[1]; + var orientationChange; + (0, _react.useEffect)(function () { + orientationChange = _$$_REQUIRE(_dependencyMap[9]).EventRegister.on(_events.default.ON_ORIENTATION_CHANGE, function (_ref) { + var orientation = _ref.orientation; + setShowTopBar(!_deviceUtils.default.isPortrait(orientation)); + }); + return function () { + _$$_REQUIRE(_dependencyMap[9]).EventRegister.rm(orientationChange); + }; + }, []); + } + + var statusBarCss = _$$_REQUIRE(_dependencyMap[10]).Css.getStyleObjByCssClasses(["system-webview-status-bar"]); + + var statusBarColor = statusBarCss.backgroundColor || _$$_REQUIRE(_dependencyMap[8]).colors.transparent600; + + _$$_REQUIRE(_dependencyMap[8]).PlatformUtils.colorBars(statusBarColor); + + var _DeviceUtils$getSafeA = _deviceUtils.default.getSafeAreaInsets(), + top = _DeviceUtils$getSafeA.top; + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + backgroundColor: _$$_REQUIRE(_dependencyMap[8]).colors.white + } + }, _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).BaseWebView, { + ref: onRef, + innerRef: innerRef, + onLocal: onLocal, + onMessage: onMessage, + source: source, + progressType: _$$_REQUIRE(_dependencyMap[11]).BaseWebView.ProgressTypes.bar, + progressBarStyle: { + top: top + }, + injectedJavaScript: _webUtils.default.addSafeAreaToWebView() + }), showTopBar ? _react.default.createElement(_barsComponent.default, { + edges: ["top"], + statusBarColor: statusBarColor + }) : null); + } +},2611,[5,41,17,28,460,458,2145,719,462,572,699,1894]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[8]); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var _OptionalPackages$get = _optionalPackageUtils.default.getNativoAds(), + NativoWebContent = _OptionalPackages$get.NativoWebContent; + + var styles = _reactNative.StyleSheet.create({ + container: { + flex: 1, + flexDirection: "column" + }, + title: { + fontSize: 30, + margin: 10 + }, + authorName: { + fontSize: 18 + }, + authorImage: { + width: 50, + height: 50 + }, + authorView: { + height: 50, + flexDirection: "row", + justifyContent: "flex-start", + alignItems: "center" + }, + sponsoredContent: { + fontWeight: "bold", + flex: 1 + } + }); + + var NativoLandingPageScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(NativoLandingPageScreen, _NavigationBaseScreen); + + var _super = _createSuper(NativoLandingPageScreen); + + function NativoLandingPageScreen(props, context) { + var _this; + + (0, _classCallCheck2.default)(this, NativoLandingPageScreen); + _this = _super.call(this, props, context); + _this.state = { + height: 700 + }; + return _this; + } + + (0, _createClass2.default)(NativoLandingPageScreen, [{ + key: "getTag", + value: function getTag() { + return "Nativo Ads Landing Page"; + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var height = this.state.height; + var navigation = this.props.navigation; + var params = (0, _$$_REQUIRE(_dependencyMap[10]).getNavigationParams)(this.props); + var index = params.index, + sectionUrl = params.sectionUrl, + containerHash = params.containerHash; + var adTitle = params.adTitle, + adDescription = params.adDescription, + adImgUrl = params.adImgUrl, + adAuthorName = params.adAuthorName, + adAuthorImgUrl = params.adAuthorImgUrl, + adDate = params.adDate, + adShareUrl = params.adShareUrl; + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).TecnaviaScrollView, { + style: styles.container + }, _react.default.createElement(_reactNative.Text, { + style: styles.sponsoredContent + }, global.strings("sponsored_content")), adTitle ? _react.default.createElement(_reactNative.Text, { + style: styles.title + }, adTitle) : null, adAuthorImgUrl || adAuthorName ? _react.default.createElement(_reactNative.View, { + style: styles.authorView + }, adAuthorImgUrl ? _react.default.createElement(_reactNative.Image, { + source: { + uri: adAuthorImgUrl + }, + style: styles.authorImage, + resizeMode: "contain" + }) : null, adAuthorName ? _react.default.createElement(_reactNative.Text, { + style: styles.authorName + }, adAuthorName) : null) : null, _optionalPackageUtils.default.isNativoSDKAvailable() ? _react.default.createElement(NativoWebContent, { + style: { + height: height + }, + index: index, + sectionUrl: sectionUrl, + containerHash: containerHash, + onClickExternalLink: function onClickExternalLink(event) { + navigation.navigate("WebScreen", { + url: event.url + }); + }, + onFinishLoading: function onFinishLoading(event) { + if (event.error) {} else { + _this2.setState({ + height: event.contentHeight + }); + } + } + }) : null); + } + }]); + return NativoLandingPageScreen; + }(_$$_REQUIRE(_dependencyMap[10]).NavigationBaseScreen); + + exports.default = NativoLandingPageScreen; + NativoLandingPageScreen.propTypes = { + navigation: _propTypes.default.object.isRequired + }; +},2612,[5,7,8,12,14,16,17,201,28,731,2148,1909]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _safeAreaWebview = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var MigratePageScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(MigratePageScreen, _NavigationBaseScreen); + + var _super = _createSuper(MigratePageScreen); + + function MigratePageScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, MigratePageScreen); + _this = _super.call(this, props); + _this.onLocal = _this._onLocal.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(MigratePageScreen, [{ + key: "getTag", + value: function getTag() { + return "Migrate Page"; + } + }, { + key: "_onLocal", + value: function _onLocal(_ref) { + var domain = _ref.domain; + + switch (domain) { + case "xc_close": + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[11]).getNavigationParams)(this.props), + onClose = _getNavigationParams.onClose; + + if (onClose) { + onClose(); + } + + break; + } + } + }, { + key: "render", + value: function render() { + var _getNavigationParams2 = (0, _$$_REQUIRE(_dependencyMap[11]).getNavigationParams)(this.props), + pSetup = _getNavigationParams2.pSetup, + machine = _getNavigationParams2.machine; + + var params = (0, _extends2.default)({}, _Api.default.getDefaultParams(), { + pSetup: pSetup, + action: "migrate" + }); + + var uri = _$$_REQUIRE(_dependencyMap[12]).StringUtils.appendParams(_Api.default.baseUrl(machine), params); + + return _react.default.createElement(_safeAreaWebview.default, { + source: { + uri: uri + }, + onLocal: this.onLocal + }); + } + }]); + return MigratePageScreen; + }(_$$_REQUIRE(_dependencyMap[11]).NavigationBaseScreen); + + exports.default = MigratePageScreen; +},2613,[5,6,7,8,15,12,14,16,17,431,2611,2148,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _safeAreaWebview = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _optionspageUtils = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[12])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[13])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[14])); + + var _PublicationsManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _Publication = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _RssContentHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PublicationsPageScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(PublicationsPageScreen, _NavigationBaseScreen); + + var _super = _createSuper(PublicationsPageScreen); + + function PublicationsPageScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, PublicationsPageScreen); + _this = _super.call(this, props); + _this.onLocal = _this._onLocal.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(PublicationsPageScreen, [{ + key: "getTag", + value: function getTag() { + return "Publications Page"; + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(PublicationsPageScreen.prototype), "handleBackButton", this).call(this); + this.closeApp(); + } + }, { + key: "_close", + value: function _close(force) { + return _regenerator.default.async(function _close$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.t0 = force; + + if (_context.t0) { + _context.next = 5; + break; + } + + _context.next = 4; + return _regenerator.default.awrap(global.getCurrentPublication()); + + case 4: + _context.t0 = _context.sent; + + case 5: + if (!_context.t0) { + _context.next = 9; + break; + } + + _NavigationService.default.restart(); + + _context.next = 10; + break; + + case 9: + this.handleBackButton(); + + case 10: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_execJavaScript", + value: function _execJavaScript(jsToExec) { + if (this.webview) { + this.webview.injectJavaScript("try { " + jsToExec + " } catch (e) { };"); + } + } + }, { + key: "_onLocal", + value: function _onLocal(_ref) { + var domain, getParams, pSetup, machine, paperDomain, machineToUse, _global$getActivePSet, currentPSetup, _global$getRSSActiveP, rssIsEnabled, _await$global$loadPSe, config, fromServer, publicationsManager, publications, _publicationsManager, _pSetup, _publicationsManager2, _pSetup2; + + return _regenerator.default.async(function _onLocal$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + domain = _ref.domain, getParams = _ref.getParams; + + if (!domain.includes(_optionspageUtils.locals.CLOSE_WINDOW)) { + _context2.next = 5; + break; + } + + this._close(); + + _context2.next = 42; + break; + + case 5: + if (!domain.includes(_optionspageUtils.locals.INITPAGE_SET_NEWSPAPER_AND_READ)) { + _context2.next = 41; + break; + } + + if (this.progressCircleRef) { + this.progressCircleRef.show(); + } + + pSetup = getParams.pSetup, machine = getParams.machine, paperDomain = getParams.paperDomain; + machineToUse = paperDomain || machine; + _global$getActivePSet = global.getActivePSetup(), currentPSetup = _global$getActivePSet.pSetup; + _global$getRSSActiveP = global.getRSSActivePSetup(), rssIsEnabled = _global$getRSSActiveP.rssIsEnabled; + _context2.next = 13; + return _regenerator.default.awrap(global.loadPSetup(pSetup, machineToUse)); + + case 13: + _await$global$loadPSe = _context2.sent; + config = _await$global$loadPSe.config; + fromServer = _await$global$loadPSe.fromServer; + + if (!config) { + _context2.next = 37; + break; + } + + if (!fromServer && _$$_REQUIRE(_dependencyMap[20]).NetworkUtils.isOnline()) { + _$$_REQUIRE(_dependencyMap[21]).EventRegister.emit(_events.default.CONFIG_UPDATE_CHECK, { + config: config + }); + } + + if (!(currentPSetup !== pSetup)) { + _context2.next = 34; + break; + } + + if (!rssIsEnabled) { + _context2.next = 29; + break; + } + + _LiveConfig.default.resetLastRssCategory(); + + _context2.prev = 21; + _context2.next = 24; + return _regenerator.default.awrap(_RssContentHelper.default.deleteDatabase()); + + case 24: + _context2.next = 28; + break; + + case 26: + _context2.prev = 26; + _context2.t0 = _context2["catch"](21); + + case 28: + _LiveConfig.default.setRssDbDeleted(true); + + case 29: + _context2.next = 31; + return _regenerator.default.awrap(_GlobalConfig.default.initAds()); + + case 31: + _context2.next = 33; + return _regenerator.default.awrap(_GlobalConfig.default.initEpaperLayoutConfig(true)); + + case 33: + Analytics.updateAnalyticsClientList(); + + case 34: + this._close(true); + + _context2.next = 38; + break; + + case 37: + _$$_REQUIRE(_dependencyMap[22]).Toast.show(global.strings("err_download_psetup")); + + case 38: + if (this.progressCircleRef) { + this.progressCircleRef.hide(); + } + + _context2.next = 42; + break; + + case 41: + if (domain.includes(_optionspageUtils.locals.GET_PUBLICATIONS_STORED)) { + publicationsManager = global.getPublicationsManager(); + publications = publicationsManager.getPublications(); + + this._execJavaScript("xcj_getPublicationStoredResults('" + JSON.stringify(publications) + "');"); + } else if (domain.includes(_optionspageUtils.locals.SET_PUBLICATION)) { + _publicationsManager = global.getPublicationsManager(); + + _publicationsManager.addPublication(getParams); + + _pSetup = getParams.pSetup; + + this._execJavaScript("xcj_setPublication('" + _pSetup + "');"); + } else if (domain.includes(_optionspageUtils.locals.DELETE_PUBLICATION)) { + _publicationsManager2 = global.getPublicationsManager(); + + _publicationsManager2.deletePublication(getParams); + + _pSetup2 = getParams.pSetup; + + this._execJavaScript("xcj_deletePublication('" + _pSetup2 + "');"); + } + + case 42: + case "end": + return _context2.stop(); + } + } + }, null, this, [[21, 26]], Promise); + } + }, { + key: "_requestFocus", + value: function _requestFocus() { + if (_$$_REQUIRE(_dependencyMap[20]).PlatformUtils.isAndroid() && this.webview && typeof this.webview.requestFocus === "function") { + this.webview.requestFocus(); + } + } + }, { + key: "render", + value: function render() { + var _this2 = this; + + var _global$getMainPSetup = global.getMainPSetup(), + pSetup = _global$getMainPSetup.pSetup, + publicationsPageURL = _global$getMainPSetup.publicationsPageURL; + + var _global$getActivePSet2 = global.getActivePSetup(), + activePSetup = _global$getActivePSet2.pSetup; + + var extraParams = { + pSetup: pSetup + }; + + if (activePSetup !== pSetup) { + extraParams.activePSetup = activePSetup; + } + + var uri = _optionspageUtils.default.getCustomUrl(publicationsPageURL, extraParams); + + return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_safeAreaWebview.default, { + innerRef: function innerRef(ref) { + _this2.webview = ref; + + _this2._requestFocus(); + }, + source: { + uri: uri + }, + onLocal: this.onLocal + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[23]).ProgressCircle, { + ref: function ref(_ref2) { + _this2.progressCircleRef = _ref2; + }, + spinnerStyle: _$$_REQUIRE(_dependencyMap[24]).styles.absolute, + hidden: true + })); + } + }]); + return PublicationsPageScreen; + }(_$$_REQUIRE(_dependencyMap[25]).NavigationBaseScreen); + + exports.default = PublicationsPageScreen; +},2614,[5,80,7,8,15,90,12,14,16,17,460,2611,730,2154,1871,1722,1723,1861,1872,2207,462,572,1889,1953,1897,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _NewsmemoryAJAX = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _Api = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[10])); + + var _safeAreaWebview = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var PreAppTrackingTransparencyMessageScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(PreAppTrackingTransparencyMessageScreen, _NavigationBaseScreen); + + var _super = _createSuper(PreAppTrackingTransparencyMessageScreen); + + function PreAppTrackingTransparencyMessageScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, PreAppTrackingTransparencyMessageScreen); + _this = _super.call(this, props); + _this.onLocal = _this._onLocal.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(PreAppTrackingTransparencyMessageScreen, [{ + key: "getTag", + value: function getTag() { + return "Pre App Tracking Transparency Message"; + } + }, { + key: "_onLocal", + value: function _onLocal(_ref) { + var domain = _ref.domain, + getParams = _ref.getParams; + + switch (domain) { + case "xc_close": + var _getNavigationParams = (0, _$$_REQUIRE(_dependencyMap[12]).getNavigationParams)(this.props), + onClose = _getNavigationParams.onClose; + + if (onClose) { + var proceed = getParams.proceed; + onClose(proceed === "1"); + } + + break; + } + } + }, { + key: "render", + value: function render() { + var _getNavigationParams2 = (0, _$$_REQUIRE(_dependencyMap[12]).getNavigationParams)(this.props), + userChoiceDenied = _getNavigationParams2.userChoiceDenied; + + var params = (0, _extends2.default)({}, _Api.default.getDefaultParams(), _NewsmemoryAJAX.default.getDefaultGETParams(), { + action: "preATTMessage", + denied: userChoiceDenied ? "1" : undefined + }); + + var uri = _$$_REQUIRE(_dependencyMap[13]).StringUtils.appendParams(_NewsmemoryAJAX.default.baseUrl(), params); + + return _react.default.createElement(_safeAreaWebview.default, { + source: { + uri: uri + }, + onLocal: this.onLocal + }); + } + }]); + return PreAppTrackingTransparencyMessageScreen; + }(_$$_REQUIRE(_dependencyMap[12]).NavigationBaseScreen); + + exports.default = PreAppTrackingTransparencyMessageScreen; +},2615,[5,6,7,8,15,12,14,16,17,430,431,2611,2148,462]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[7]); + + var _fontText = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _iconComponent = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[9])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var UnauthorizedScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(UnauthorizedScreen, _NavigationBaseScreen); + + var _super = _createSuper(UnauthorizedScreen); + + function UnauthorizedScreen() { + (0, _classCallCheck2.default)(this, UnauthorizedScreen); + return _super.apply(this, arguments); + } + + (0, _createClass2.default)(UnauthorizedScreen, [{ + key: "render", + value: function render() { + var color = _$$_REQUIRE(_dependencyMap[10]).Css.getDefaultForegroundColor(); + + var backgroundColor = _$$_REQUIRE(_dependencyMap[10]).Css.getDefaultBackgroundColor(); + + return _react.default.createElement(_reactNative.View, { + style: { + flex: 1, + backgroundColor: backgroundColor, + alignItems: "center", + justifyContent: "center" + } + }, _react.default.createElement(_iconComponent.default, { + name: "exclamation-triangle", + type: _iconComponent.TecnaviaIconType.FONT_AWESOME, + style: { + fontSize: 30, + color: color + } + }), _react.default.createElement(_fontText.default, { + style: { + color: color + } + }, "401 UNAUTHORIZED"), _react.default.createElement(_fontText.default, { + style: { + color: color + } + }, global.apiKey ? "Invalid API key: " + global.apiKey : "Missing API key")); + } + }]); + return UnauthorizedScreen; + }(_$$_REQUIRE(_dependencyMap[11]).NavigationBaseScreen); + + exports.default = UnauthorizedScreen; +},2616,[5,7,8,12,14,16,17,28,1879,1806,699,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); +},2617,[2618]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.SplashScreen = undefined; + + var _regenerator = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _createClass2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _assertThisInitialized2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + var _get2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[7])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[8])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[9])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[10]); + + var _reactNativeSplashScreen = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[11])); + + var _events = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[12])); + + var Analytics = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[13])); + + var _LiveConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[14])); + + var _PushHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[15])); + + var _IAPHelper = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[16])); + + var _tecnaviaFileUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[17])); + + var _appUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[18])); + + var _GlobalConfig = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[19])); + + var _PurgeManager = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[20])); + + var _NavigationService = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[21])); + + var _Publication = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[22])); + + var _cmpUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[23])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var SplashScreen = function (_NavigationBaseScreen) { + (0, _inherits2.default)(SplashScreen, _NavigationBaseScreen); + + var _super = _createSuper(SplashScreen); + + function SplashScreen(props) { + var _this; + + (0, _classCallCheck2.default)(this, SplashScreen); + _this = _super.call(this, props); + _this.setup = _this._setup.bind((0, _assertThisInitialized2.default)(_this)); + _this.startToNavigator = _this._startToNavigator.bind((0, _assertThisInitialized2.default)(_this)); + return _this; + } + + (0, _createClass2.default)(SplashScreen, [{ + key: "componentDidMount", + value: function componentDidMount() { + (0, _get2.default)((0, _getPrototypeOf2.default)(SplashScreen.prototype), "componentDidMount", this).call(this); + + _reactNativeSplashScreen.default.hide(); + } + }, { + key: "didFocus", + value: function didFocus() { + var _this2 = this; + + var notificationEmail; + return _regenerator.default.async(function didFocus$(_context) { + while (1) { + switch (_context.prev = _context.next) { + case 0: + _context.next = 2; + return _regenerator.default.awrap(global.getUserSettings().retrieveNotificationEmail()); + + case 2: + notificationEmail = _context.sent; + + if (notificationEmail) { + _reactNative.Alert.alert(global.strings("msg_notification_email_warning"), notificationEmail, [{ + text: global.strings("btn_ok"), + onPress: this.setup + }, { + text: global.strings("err_reset_notification_email"), + onPress: function onPress() { + global.getUserSettings().resetNotificationEmail(); + + _this2.setup(); + } + }]); + } else { + this.setup(); + } + + case 4: + case "end": + return _context.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_setup", + value: function _setup() { + var _this3 = this; + + var appState, _global$getMainPSetup, rssIsEnabled, newsMemoryIsEnabled, preventScreenshots, isAppUpgraded, purgeTask, navigation, attUserChoice; + + return _regenerator.default.async(function _setup$(_context2) { + while (1) { + switch (_context2.prev = _context2.next) { + case 0: + appState = _appUtils.default.STATE.UNKNOWN; + _context2.prev = 1; + _context2.next = 4; + return _regenerator.default.awrap(this._manageStorage()); + + case 4: + appState = _context2.sent; + _context2.next = 10; + break; + + case 7: + _context2.prev = 7; + _context2.t0 = _context2["catch"](1); + return _context2.abrupt("return"); + + case 10: + _context2.prev = 10; + _context2.next = 13; + return _regenerator.default.awrap(_IAPHelper.default.init()); + + case 13: + _context2.next = 17; + break; + + case 15: + _context2.prev = 15; + _context2.t1 = _context2["catch"](10); + + case 17: + _global$getMainPSetup = global.getMainPSetup(), rssIsEnabled = _global$getMainPSetup.rssIsEnabled, newsMemoryIsEnabled = _global$getMainPSetup.newsMemoryIsEnabled, preventScreenshots = _global$getMainPSetup.preventScreenshots; + + if (!(!rssIsEnabled && !newsMemoryIsEnabled)) { + _context2.next = 24; + break; + } + + if (this.errorShown) { + _context2.next = 22; + break; + } + + _context2.next = 22; + return _regenerator.default.awrap(this._handleForceExit()); + + case 22: + _context2.next = 60; + break; + + case 24: + _LiveConfig.default.init(); + + _context2.next = 27; + return _regenerator.default.awrap(_GlobalConfig.default.initConfigurations()); + + case 27: + isAppUpgraded = _appUtils.default.isAppUpgraded(appState); + + if (!isAppUpgraded) { + _context2.next = 39; + break; + } + + _context2.next = 31; + return _regenerator.default.awrap(global.getUserSettings().migrateSelectedMyHomeCategories()); + + case 31: + _context2.prev = 31; + purgeTask = new _PurgeManager.default(); + _context2.next = 35; + return _regenerator.default.awrap(purgeTask.purgeZombie()); + + case 35: + _context2.next = 39; + break; + + case 37: + _context2.prev = 37; + _context2.t2 = _context2["catch"](31); + + case 39: + _context2.next = 41; + return _regenerator.default.awrap(_appUtils.default.preventScreenshots(preventScreenshots)); + + case 41: + navigation = this.props.navigation; + _context2.next = 44; + return _regenerator.default.awrap(_cmpUtils.default.init(navigation, isAppUpgraded)); + + case 44: + attUserChoice = _context2.sent; + + if (_$$_REQUIRE(_dependencyMap[24]).PlatformUtils.isIOS() && attUserChoice) { + Analytics.trackATTPermission(attUserChoice); + } + + _context2.prev = 46; + _context2.next = 49; + return _regenerator.default.awrap(_PushHelper.default.init()); + + case 49: + _context2.next = 53; + break; + + case 51: + _context2.prev = 51; + _context2.t3 = _context2["catch"](46); + + case 53: + _context2.next = 55; + return _regenerator.default.awrap(_PushHelper.default.checkIfAppIsOpenedByNotification(function (navigator) { + _this3.setStartupNavigator(navigator); + })); + + case 55: + if (_context2.sent) { + _context2.next = 60; + break; + } + + if (!(_$$_REQUIRE(_dependencyMap[24]).PlatformUtils.hasNotDefaultFontScale() && !global.getUserSettings().userAlreadySetAllowFontScale)) { + _context2.next = 59; + break; + } + + _context2.next = 59; + return _regenerator.default.awrap(global.getUserSettings().showAllowFontScalingModal()); + + case 59: + this.startup(); + + case 60: + case "end": + return _context2.stop(); + } + } + }, null, this, [[1, 7], [10, 15], [31, 37], [46, 51]], Promise); + } + }, { + key: "_checkBundleUpdate", + value: function _checkBundleUpdate() { + try { + var navigation = this.props.navigation; + return new Promise(function (resolve) { + navigation.navigate("UpdaterScreen", { + onBack: resolve + }); + }); + } catch (e) {} + + return Promise.resolve(); + } + }, { + key: "startup", + value: function startup() { + var _this4 = this; + + var skipMigrate, + skipActiveMigrate, + navigation, + _global$getMainPSetup2, + pSetup, + machine, + migrate, + bundleUpdateAvailable, + resetAppBundle, + startupParams, + _await$OurBridge$getB, + bundleName, + currentPublication, + _global$getActivePSet, + activePSetup, + activeMachine, + activePSetupMigrate, + _global$getRSSActiveP, + rssIsEnabled, + forceNewsmemory, + shouldOpenRss, + _args3 = arguments; + + return _regenerator.default.async(function startup$(_context3) { + while (1) { + switch (_context3.prev = _context3.next) { + case 0: + skipMigrate = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : false; + skipActiveMigrate = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : false; + navigation = this.props.navigation; + _global$getMainPSetup2 = global.getMainPSetup(), pSetup = _global$getMainPSetup2.pSetup, machine = _global$getMainPSetup2.machine, migrate = _global$getMainPSetup2.migrate, bundleUpdateAvailable = _global$getMainPSetup2.bundleUpdateAvailable, resetAppBundle = _global$getMainPSetup2.resetAppBundle, startupParams = _global$getMainPSetup2.startupParams; + + if (!_$$_REQUIRE(_dependencyMap[24]).JSUtils.isEmpty(startupParams)) { + global.updateNewsmemoryStartupParams(startupParams); + } + + if (!(_$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline() && migrate && !skipMigrate)) { + _context3.next = 9; + break; + } + + navigation.navigate("MigratePageScreen", { + pSetup: pSetup, + machine: machine, + onClose: function onClose() { + _this4.startup(true); + } + }); + _context3.next = 53; + break; + + case 9: + if (!resetAppBundle) { + _context3.next = 34; + break; + } + + _context3.prev = 10; + _context3.next = 13; + return _regenerator.default.awrap(_tecnaviaFileUtils.default.unlink(_tecnaviaFileUtils.default.getBundlesDirectory())); + + case 13: + _context3.next = 17; + break; + + case 15: + _context3.prev = 15; + _context3.t0 = _context3["catch"](10); + + case 17: + _context3.prev = 17; + _context3.next = 20; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[25]).OurBridge.getBundleName()); + + case 20: + _await$OurBridge$getB = _context3.sent; + bundleName = _await$OurBridge$getB.bundleName; + + if (!bundleName) { + _context3.next = 28; + break; + } + + _context3.next = 25; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[25]).OurBridge.resetBundleName()); + + case 25: + _context3.next = 27; + return _regenerator.default.awrap(_$$_REQUIRE(_dependencyMap[25]).OurBridge.restartReactContext()); + + case 27: + return _context3.abrupt("return"); + + case 28: + _context3.next = 32; + break; + + case 30: + _context3.prev = 30; + _context3.t1 = _context3["catch"](17); + + case 32: + _context3.next = 37; + break; + + case 34: + if (!bundleUpdateAvailable) { + _context3.next = 37; + break; + } + + _context3.next = 37; + return _regenerator.default.awrap(this._checkBundleUpdate()); + + case 37: + _context3.next = 39; + return _regenerator.default.awrap(global.getCurrentPublication()); + + case 39: + currentPublication = _context3.sent; + + if (!(_$$_REQUIRE(_dependencyMap[26]).PaperSetupManager.isGenericAppConfigured() && !currentPublication)) { + _context3.next = 50; + break; + } + + if (!_$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline()) { + _context3.next = 45; + break; + } + + _NavigationService.default.default.navigate(navigation, "PublicationsPageScreen"); + + _context3.next = 48; + break; + + case 45: + if (this.errorShown) { + _context3.next = 48; + break; + } + + _context3.next = 48; + return _regenerator.default.awrap(this._handleForceExit()); + + case 48: + _context3.next = 53; + break; + + case 50: + _global$getActivePSet = global.getActivePSetup(), activePSetup = _global$getActivePSet.pSetup, activeMachine = _global$getActivePSet.machine, activePSetupMigrate = _global$getActivePSet.migrate; + _global$getRSSActiveP = global.getRSSActivePSetup(), rssIsEnabled = _global$getRSSActiveP.rssIsEnabled; + + if (_$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline() && pSetup !== activePSetup && activePSetupMigrate && !skipActiveMigrate) { + navigation.navigate("MigratePageScreen", { + pSetup: activePSetup, + machine: activeMachine, + onClose: function onClose() { + _this4.startup(true, true); + } + }); + } else { + forceNewsmemory = global.shouldForceNewsmemoryWithStartupParams(); + + if (_$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline() && global.getUserSettings().shouldShowSelectionScreen && !forceNewsmemory) { + _NavigationService.default.default.navigate(navigation, "SelectionScreen", { + onSelect: this.startToNavigator + }); + } else { + shouldOpenRss = global.lastAppSide ? _LiveConfig.default.isRssSide(global.lastAppSide) : global.getUserSettings().startInRss; + this.startToNavigator(navigation, shouldOpenRss && rssIsEnabled && !forceNewsmemory ? "RssNavigator" : "NewsmemoryNavigator"); + } + } + + case 53: + case "end": + return _context3.stop(); + } + } + }, null, this, [[10, 15], [17, 30]], Promise); + } + }, { + key: "setStartupNavigator", + value: function setStartupNavigator(navigator) { + _LiveConfig.default.setStartUpNavigator(navigator); + + if (navigator === "RssNavigator") { + _LiveConfig.default.setRssSide(); + } else { + _LiveConfig.default.setEpaperSide(); + } + + Analytics.trackStartup(); + } + }, { + key: "_startToNavigator", + value: function _startToNavigator(navigation, navigator) { + var feedback; + return _regenerator.default.async(function _startToNavigator$(_context4) { + while (1) { + switch (_context4.prev = _context4.next) { + case 0: + this.setStartupNavigator(navigator); + feedback = new (_$$_REQUIRE(_dependencyMap[27]).Feedback)(); + _context4.next = 4; + return _regenerator.default.awrap(feedback.check()); + + case 4: + this.navigate(navigation, navigator); + + case 5: + case "end": + return _context4.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "navigate", + value: function navigate(navigation, routeName) { + var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + _NavigationService.default.default.reset(navigation, routeName, params); + } + }, { + key: "_loadPSetup", + value: function _loadPSetup(pSetup, machine, params, external) { + var success, _await$global$loadPSe, config, fromServer; + + return _regenerator.default.async(function _loadPSetup$(_context5) { + while (1) { + switch (_context5.prev = _context5.next) { + case 0: + success = false; + _context5.prev = 1; + _context5.next = 4; + return _regenerator.default.awrap(global.loadPSetup(pSetup, machine, params, external)); + + case 4: + _await$global$loadPSe = _context5.sent; + config = _await$global$loadPSe.config; + fromServer = _await$global$loadPSe.fromServer; + + if (!config) { + _context5.next = 20; + break; + } + + if (!fromServer && _$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline()) { + _$$_REQUIRE(_dependencyMap[28]).EventRegister.emit(_events.default.CONFIG_UPDATE_CHECK, { + config: config + }); + } + + _context5.next = 11; + return _regenerator.default.awrap(_GlobalConfig.default.initNewsmemoryConfig()); + + case 11: + if (!_$$_REQUIRE(_dependencyMap[26]).PaperSetupManager.isGenericAppConfigured()) { + _context5.next = 14; + break; + } + + _context5.next = 14; + return _regenerator.default.awrap(_GlobalConfig.default.initAds()); + + case 14: + if (!external) { + _context5.next = 17; + break; + } + + _context5.next = 17; + return _regenerator.default.awrap(_GlobalConfig.default.initCustomFonts(config)); + + case 17: + success = true; + _context5.next = 20; + break; + + case 20: + _context5.next = 24; + break; + + case 22: + _context5.prev = 22; + _context5.t0 = _context5["catch"](1); + + case 24: + return _context5.abrupt("return", success); + + case 25: + case "end": + return _context5.stop(); + } + } + }, null, null, [[1, 22]], Promise); + } + }, { + key: "_checkStartupParams", + value: function _checkStartupParams() { + var success, _global$getNewsmemory, startupPSetup, startupMachine, paperName, preview, oneTimeToken; + + return _regenerator.default.async(function _checkStartupParams$(_context6) { + while (1) { + switch (_context6.prev = _context6.next) { + case 0: + success = false; + _global$getNewsmemory = global.getNewsmemoryStartupParams(), startupPSetup = _global$getNewsmemory.pSetup, startupMachine = _global$getNewsmemory.machine, paperName = _global$getNewsmemory.paperName, preview = _global$getNewsmemory.preview, oneTimeToken = _global$getNewsmemory.onetimetoken; + + if (!(startupPSetup && startupMachine)) { + _context6.next = 6; + break; + } + + _context6.next = 5; + return _regenerator.default.awrap(this._loadPSetup(startupPSetup, startupMachine, { + preview: preview, + oneTimeToken: oneTimeToken, + paperName: paperName + })); + + case 5: + success = _context6.sent; + + case 6: + return _context6.abrupt("return", success); + + case 7: + case "end": + return _context6.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_checkPublications", + value: function _checkPublications() { + var success, currentPublication, _global$getMainPSetup3, externalXPapers, mainPSetup, _global$getActivePSet2, pSetup, paper, currentPSetup, currentIsExternal, currentMachine, currentPaper, currentXPaper, considerCurrentPublication, paperSetupManager; + + return _regenerator.default.async(function _checkPublications$(_context7) { + while (1) { + switch (_context7.prev = _context7.next) { + case 0: + success = false; + _context7.next = 3; + return _regenerator.default.awrap(global.loadPublications()); + + case 3: + _context7.next = 5; + return _regenerator.default.awrap(global.getCurrentPublication()); + + case 5: + currentPublication = _context7.sent; + + if (!currentPublication) { + _context7.next = 37; + break; + } + + _global$getMainPSetup3 = global.getMainPSetup(), externalXPapers = _global$getMainPSetup3.externalXPapers, mainPSetup = _global$getMainPSetup3.pSetup; + _global$getActivePSet2 = global.getActivePSetup(), pSetup = _global$getActivePSet2.pSetup, paper = _global$getActivePSet2.paper; + currentPSetup = currentPublication.getPSetup(); + currentIsExternal = currentPublication.isExternal(); + + if (!(pSetup !== currentPSetup)) { + _context7.next = 29; + break; + } + + currentMachine = currentPublication.getMachine(); + currentPaper = currentPublication.getPaper(); + currentXPaper = currentPublication.getXPaper(); + considerCurrentPublication = false; + + if (!_$$_REQUIRE(_dependencyMap[26]).PaperSetupManager.isGenericAppConfigured()) { + _context7.next = 20; + break; + } + + considerCurrentPublication = true; + _context7.next = 23; + break; + + case 20: + if (currentIsExternal && externalXPapers) { + considerCurrentPublication = externalXPapers.split(",").includes(currentPSetup); + } else { + considerCurrentPublication = currentPaper && currentXPaper && paper === currentPaper && currentPaper !== currentXPaper; + } + + _context7.next = 23; + return _regenerator.default.awrap(global.getPublicationsManager().deletePublication({ + pSetup: currentPSetup + })); + + case 23: + if (!considerCurrentPublication) { + _context7.next = 27; + break; + } + + _context7.next = 26; + return _regenerator.default.awrap(this._loadPSetup(currentPSetup, currentMachine, {}, currentIsExternal)); + + case 26: + success = _context7.sent; + + case 27: + _context7.next = 37; + break; + + case 29: + if (!(currentIsExternal && externalXPapers && !externalXPapers.split(",").includes(currentPSetup))) { + _context7.next = 37; + break; + } + + _context7.next = 32; + return _regenerator.default.awrap(global.getPublicationsManager().deletePublication({ + pSetup: currentPSetup + })); + + case 32: + paperSetupManager = global.getPaperSetupManager(); + + if (paperSetupManager) { + paperSetupManager.resetActivePSetup(); + } + + _context7.next = 36; + return _regenerator.default.awrap(this._loadPSetup(mainPSetup)); + + case 36: + success = _context7.sent; + + case 37: + return _context7.abrupt("return", success); + + case 38: + case "end": + return _context7.stop(); + } + } + }, null, this, null, Promise); + } + }, { + key: "_manageStorage", + value: function _manageStorage() { + var appState, firstInstall, isAppUpgraded, _await$GlobalConfig$i, success, fromServer, mainPSetupConfig, activePSetupConfig, activePaper, rssActivePSetupConfig, rssIsEnabled, _await$GlobalConfig$i2, rssIndexSuccess; + + return _regenerator.default.async(function _manageStorage$(_context8) { + while (1) { + switch (_context8.prev = _context8.next) { + case 0: + _context8.next = 2; + return _regenerator.default.awrap(_appUtils.default.checkUpdate()); + + case 2: + appState = _context8.sent; + firstInstall = _appUtils.default.isAppNewInstall(appState); + isAppUpgraded = _appUtils.default.isAppUpgraded(appState); + + if (!firstInstall) { + _context8.next = 8; + break; + } + + _context8.next = 8; + return _regenerator.default.awrap(_GlobalConfig.default.initSSLCertificates()); + + case 8: + this.errorShown = false; + _context8.prev = 9; + _context8.next = 12; + return _regenerator.default.awrap(_GlobalConfig.default.initMainPSetup(firstInstall, isAppUpgraded)); + + case 12: + _await$GlobalConfig$i = _context8.sent; + success = _await$GlobalConfig$i.success; + fromServer = _await$GlobalConfig$i.fromServer; + + if (!success) { + _context8.next = 19; + break; + } + + if (_$$_REQUIRE(_dependencyMap[24]).NetworkUtils.isOnline() && global.startup && !fromServer) { + global.startup = false; + + _$$_REQUIRE(_dependencyMap[28]).EventRegister.emit(_events.default.CONFIG_UPDATE_CHECK); + } + + _context8.next = 22; + break; + + case 19: + _context8.next = 21; + return _regenerator.default.awrap(this._handleForceExit()); + + case 21: + this.errorShown = true; + + case 22: + _context8.next = 30; + break; + + case 24: + _context8.prev = 24; + _context8.t0 = _context8["catch"](9); + + if (!(_context8.t0.response && _context8.t0.response.status === _$$_REQUIRE(_dependencyMap[29]).HTTP_CODES.UNAUTHORIZED)) { + _context8.next = 30; + break; + } + + global.unauthorized = true; + + _NavigationService.default.main.navigate("UnauthorizedScreen"); + + throw _context8.t0; + + case 30: + _context8.next = 32; + return _regenerator.default.awrap(this._checkStartupParams()); + + case 32: + if (_context8.sent) { + _context8.next = 35; + break; + } + + _context8.next = 35; + return _regenerator.default.awrap(this._checkPublications()); + + case 35: + mainPSetupConfig = global.getMainPSetup(); + activePSetupConfig = global.getActivePSetup(); + activePaper = activePSetupConfig.paper; + _context8.next = 40; + return _regenerator.default.awrap(_GlobalConfig.default.initLocale(mainPSetupConfig)); + + case 40: + if (!(activePaper !== mainPSetupConfig.paper)) { + _context8.next = 43; + break; + } + + _context8.next = 43; + return _regenerator.default.awrap(_GlobalConfig.default.initLocale(activePSetupConfig)); + + case 43: + rssActivePSetupConfig = global.getRSSActivePSetup(); + rssIsEnabled = rssActivePSetupConfig.rssIsEnabled; + + if (!rssIsEnabled) { + _context8.next = 54; + break; + } + + _context8.next = 48; + return _regenerator.default.awrap(_GlobalConfig.default.initRssIndex(rssActivePSetupConfig, isAppUpgraded)); + + case 48: + _await$GlobalConfig$i2 = _context8.sent; + rssIndexSuccess = _await$GlobalConfig$i2.success; + + if (!(!rssIndexSuccess && !this.errorShown)) { + _context8.next = 54; + break; + } + + rssActivePSetupConfig.setModeEnabled(_$$_REQUIRE(_dependencyMap[30]).DEFAULT, true); + _context8.next = 54; + return _regenerator.default.awrap(this._handleForceExit()); + + case 54: + global.startup = false; + return _context8.abrupt("return", appState); + + case 56: + case "end": + return _context8.stop(); + } + } + }, null, this, [[9, 24]], Promise); + } + }, { + key: "getTag", + value: function getTag() { + return "Startup"; + } + }, { + key: "_handleForceExit", + value: function _handleForceExit() { + var _this5 = this; + + return _regenerator.default.async(function _handleForceExit$(_context9) { + while (1) { + switch (_context9.prev = _context9.next) { + case 0: + return _context9.abrupt("return", new Promise(function (resolve, reject) { + var _global$getUserSettin = global.getUserSettings(), + notificationEmail = _global$getUserSettin.notificationEmail, + resetNotificationEmail = _global$getUserSettin.resetNotificationEmail; + + if (notificationEmail) { + _reactNative.Alert.alert("", global.strings("err_internet_connection"), [{ + text: global.strings("err_reset_notification_email"), + onPress: function onPress() { + resetNotificationEmail(); + + _reactNative.Alert.alert("", global.strings("msg_reset_notification_email"), [{ + text: global.strings("restart"), + onPress: function onPress() { + reject(new Error("Restart after notification email reset")); + + _this5.setup(); + } + }]); + } + }]); + } else { + _this5.showAlert({ + message: global.strings("err_internet_connection"), + resolve: resolve + }); + } + })); + + case 1: + case "end": + return _context9.stop(); + } + } + }, null, null, null, Promise); + } + }, { + key: "handleBackButton", + value: function handleBackButton() { + (0, _get2.default)((0, _getPrototypeOf2.default)(SplashScreen.prototype), "handleBackButton", this).call(this); + this.closeAlert(); + } + }, { + key: "render", + value: function render() { + var backgroundColor = _$$_REQUIRE(_dependencyMap[31]).WallpaperLoading.getBackground(); + + _$$_REQUIRE(_dependencyMap[24]).PlatformUtils.colorBars(backgroundColor, backgroundColor); + + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[31]).WallpaperLoading, { + retryEvent: _events.default.PAPER_SETUP_API_RETRY + }); + } + }]); + return SplashScreen; + }(_$$_REQUIRE(_dependencyMap[32]).NavigationBaseScreen); + + exports.SplashScreen = SplashScreen; +},2618,[5,80,7,8,15,90,12,14,16,17,28,2619,460,1871,1872,2134,1934,574,2150,2154,2316,1861,1723,1875,462,582,1849,2151,572,431,717,2427,2148]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var _default = _reactNative.NativeModules.SplashScreen; + exports.default = _default; +},2619,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = RootBase; + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _propTypes = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var _deviceUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[5])); + + var _optionalPackageUtils = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[6])); + + var _OptionalPackages$get = _optionalPackageUtils.default.getIubenda(), + IubendaContainer = _OptionalPackages$get.Container; + + function RootBase(props) { + var contentRef = null; + var insets = (0, _$$_REQUIRE(_dependencyMap[7]).useTecnaviaSafeAreaInsets)(); + var frame = (0, _$$_REQUIRE(_dependencyMap[7]).useTecnaviaSafeAreaFrame)(); + + if (!_$$_REQUIRE(_dependencyMap[8]).JSUtils.isEmpty(insets) && !_$$_REQUIRE(_dependencyMap[8]).JSUtils.isEmpty(frame)) { + _deviceUtils.default.setSafeArea(insets, frame); + } + + function onContentRef(ref) { + contentRef = ref; + } + + function onPaywallRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[9]).PaywallContainer.paywallInstance = ref; + } + } + + function onInterstitialRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[10]).InterstitialContainer.interstitialInstance = ref; + } + } + + function onBottomSheetRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[11]).MyBottomSheet.bottomSheetInstance = ref; + } + } + + function onToastRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[12]).Toast.toastInstance = ref; + } + } + + function onModalRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[13]).ModalOverlay.instance = ref; + } + } + + function onLoadingRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[14]).LoadingOverlay.loadingInstance = ref; + } + } + + function onPaywallOpened() { + if (contentRef) { + contentRef.setNativeProps({ + pointerEvents: "none" + }); + } + } + + function onPaywallClosed() { + if (contentRef) { + contentRef.setNativeProps({ + pointerEvents: "auto" + }); + } + } + + function onHintRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[15]).HintOverlay.instance = ref; + } + } + + function onVoiceRef(ref) { + if (ref) { + _$$_REQUIRE(_dependencyMap[16]).VoiceOverlay.instance = ref; + } + } + + var children = props.children, + rest = (0, _objectWithoutProperties2.default)(props, ["children"]); + return _react.default.createElement(_$$_REQUIRE(_dependencyMap[17]).Css.Provider, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[18]).FontContext.Provider, null, _react.default.createElement(_$$_REQUIRE(_dependencyMap[19]).RootSizedView, rest, _react.default.createElement(_reactNative.View, { + style: { + flex: 1 + }, + ref: onContentRef + }, children), _react.default.createElement(_$$_REQUIRE(_dependencyMap[9]).PaywallContainer, { + ref: onPaywallRef, + onOpen: onPaywallOpened, + onClose: onPaywallClosed + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[10]).InterstitialContainer, { + ref: onInterstitialRef + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[11]).MyBottomSheet, { + ref: onBottomSheetRef + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[14]).LoadingOverlay, { + ref: onLoadingRef + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[15]).HintOverlay, { + ref: onHintRef + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[13]).ModalOverlay, { + ref: onModalRef + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[16]).VoiceOverlay, { + ref: onVoiceRef + }), _react.default.createElement(_$$_REQUIRE(_dependencyMap[12]).Toast, { + ref: onToastRef + }), _react.default.createElement(IubendaContainer, { + considerSafeArea: global.appNeedsSafeArea() + })))); + } + + RootBase.propTypes = { + children: _propTypes.default.any + }; +},2620,[5,108,17,201,28,458,731,2146,462,1867,2322,1904,1889,1877,1950,2003,2007,699,1880,2621]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.RootSizedView = undefined; + + var _extends2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _react = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[4]); + + var RootSizedView = function RootSizedView(_ref) { + var style = _ref.style, + rest = (0, _objectWithoutProperties2.default)(_ref, ["style"]); + return _react.default.createElement(_reactNative.View, (0, _extends2.default)({ + style: [style, { + flex: 1 + }] + }, rest)); + }; + + exports.RootSizedView = RootSizedView; +},2621,[5,6,108,17,28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.keys(_$$_REQUIRE(_dependencyMap[0])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[0])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[0])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[1])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[1])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[1])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[2])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[2])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[2])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[3])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[3])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[3])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[4])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[4])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[4])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[5])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[5])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[5])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[6])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[6])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[6])[key]; + } + }); + }); + Object.keys(_$$_REQUIRE(_dependencyMap[7])).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[7])[key]) return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _$$_REQUIRE(_dependencyMap[7])[key]; + } + }); + }); +},2622,[2623,2629,2630,2624,2627,2631,2632,2633]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DarkModeProvider = DarkModeProvider; + exports.useDarkModeContext = useDarkModeContext; + exports.DarkModeContext = undefined; + + var _slicedToArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _react = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2])); + + function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); } + + function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) { if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } } return n.default = e, t && t.set(e, n), n; } + + var DarkModeContext = (0, _react.createContext)('current'); + exports.DarkModeContext = DarkModeContext; + DarkModeContext.displayName = 'DarkModeContext'; + + function useCurrentMode(forcedMode) { + var _useState = (0, _react.useState)(_$$_REQUIRE(_dependencyMap[3]).eventEmitter.currentMode), + _useState2 = (0, _slicedToArray2.default)(_useState, 2), + currentMode = _useState2[0], + setCurrentMode = _useState2[1]; + + (0, _react.useEffect)(function () { + if (forcedMode) return; + + if (currentMode !== _$$_REQUIRE(_dependencyMap[3]).eventEmitter.currentMode) { + setCurrentMode(_$$_REQUIRE(_dependencyMap[3]).eventEmitter.currentMode); + } + + function handler(mode) { + setCurrentMode(mode); + } + + _$$_REQUIRE(_dependencyMap[3]).eventEmitter.on('currentModeChanged', handler); + + return function () { + _$$_REQUIRE(_dependencyMap[3]).eventEmitter.off('currentModeChanged', handler); + }; + }, [currentMode, forcedMode]); + return currentMode; + } + + function DarkModeProvider(_ref) { + var children = _ref.children, + mode = _ref.mode; + var currentMode = useCurrentMode(mode); + return _react.default.createElement(DarkModeContext.Provider, { + value: mode || currentMode + }, children); + } + + function useDarkModeContext() { + var context = (0, _react.useContext)(DarkModeContext); + var currentMode = useCurrentMode(context === 'current' ? undefined : context); + + if (context === 'current') { + return currentMode; + } + + return context; + } +},2623,[5,41,17,2624]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.eventEmitter = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var nativeEventEmitter = new _reactNative.NativeEventEmitter(_$$_REQUIRE(_dependencyMap[1]).NativeModule); + var eventEmitter = new (_$$_REQUIRE(_dependencyMap[2]).DarkModeEventEmitter)(); + exports.eventEmitter = eventEmitter; + nativeEventEmitter.addListener('currentModeChanged', function (newStyle) { + eventEmitter.emit('currentModeChanged', newStyle); + }); +},2624,[28,2625,2626]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NativeModule = undefined; + + var _reactNative = _$$_REQUIRE(_dependencyMap[0]); + + var NativeModule = _reactNative.NativeModules.RNDarkMode; + exports.NativeModule = NativeModule; +},2625,[28]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DarkModeEventEmitter = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _inherits2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2])); + + var _possibleConstructorReturn2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[3])); + + var _getPrototypeOf2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[4])); + + function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } + + function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } + + var DarkModeEventEmitter = function (_EventEmitter) { + (0, _inherits2.default)(DarkModeEventEmitter, _EventEmitter); + + var _super = _createSuper(DarkModeEventEmitter); + + function DarkModeEventEmitter() { + var _this; + + (0, _classCallCheck2.default)(this, DarkModeEventEmitter); + _this = _super.call(this); + _this.currentMode = _$$_REQUIRE(_dependencyMap[5]).initialMode; + + _this.on('currentModeChanged', function (mode) { + _this.currentMode = mode; + }); + + return _this; + } + + return DarkModeEventEmitter; + }(_$$_REQUIRE(_dependencyMap[6]).EventEmitter); + + exports.DarkModeEventEmitter = DarkModeEventEmitter; +},2626,[5,7,12,14,16,2627,2628]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.supportsDarkMode = exports.initialMode = undefined; + + var initialMode = _$$_REQUIRE(_dependencyMap[0]).NativeModule.initialMode; + + exports.initialMode = initialMode; + + var supportsDarkMode = _$$_REQUIRE(_dependencyMap[0]).NativeModule.supportsDarkMode; + + exports.supportsDarkMode = supportsDarkMode; +},2627,[2625]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + 'use strict'; + + var R = typeof Reflect === 'object' ? Reflect : null; + var ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + }; + var ReflectOwnKeys; + + if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys; + } else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target)); + }; + } else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; + } + + function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); + } + + var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; + }; + + function EventEmitter() { + EventEmitter.init.call(this); + } + + module.exports = EventEmitter; + module.exports.once = once; + EventEmitter.EventEmitter = EventEmitter; + EventEmitter.prototype._events = undefined; + EventEmitter.prototype._eventsCount = 0; + EventEmitter.prototype._maxListeners = undefined; + var defaultMaxListeners = 10; + + function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + } + + Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function get() { + return defaultMaxListeners; + }, + set: function set(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + + defaultMaxListeners = arg; + } + }); + + EventEmitter.init = function () { + if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; + }; + + EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + + this._maxListeners = n; + return this; + }; + + function _getMaxListeners(that) { + if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners; + return that._maxListeners; + } + + EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); + }; + + EventEmitter.prototype.emit = function emit(type) { + var args = []; + + for (var i = 1; i < arguments.length; i++) { + args.push(arguments[i]); + } + + var doError = type === 'error'; + var events = this._events; + if (events !== undefined) doError = doError && events.error === undefined;else if (!doError) return false; + + if (doError) { + var er; + if (args.length > 0) er = args[0]; + + if (er instanceof Error) { + throw er; + } + + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; + } + + var handler = events[type]; + if (handler === undefined) return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + + for (var i = 0; i < len; ++i) { + ReflectApply(listeners[i], this, args); + } + } + + return true; + }; + + function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + checkListener(listener); + events = target._events; + + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + if (events.newListener !== undefined) { + target.emit('newListener', type, listener.listener ? listener.listener : listener); + events = target._events; + } + + existing = events[type]; + } + + if (existing === undefined) { + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + existing = events[type] = prepend ? [listener, existing] : [existing, listener]; + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + m = _getMaxListeners(target); + + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; + } + + EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); + }; + + EventEmitter.prototype.on = EventEmitter.prototype.addListener; + + EventEmitter.prototype.prependListener = function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } + } + + function _onceWrap(target, type, listener) { + var state = { + fired: false, + wrapFn: undefined, + target: target, + type: type, + listener: listener + }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; + } + + EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; + }; + + EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + + EventEmitter.prototype.removeListener = function removeListener(type, listener) { + var list, events, position, i, originalListener; + checkListener(listener); + events = this._events; + if (events === undefined) return this; + list = events[type]; + if (list === undefined) return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) this._events = Object.create(null);else { + delete events[type]; + if (events.removeListener) this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) return this; + if (position === 0) list.shift();else { + spliceOne(list, position); + } + if (list.length === 1) events[type] = list[0]; + if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + + EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { + var listeners, events, i; + events = this._events; + if (events === undefined) return this; + + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) this._events = Object.create(null);else delete events[type]; + } + + return this; + } + + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + + function _listeners(target, type, unwrap) { + var events = target._events; + if (events === undefined) return []; + var evlistener = events[type]; + if (evlistener === undefined) return []; + if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); + } + + EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); + }; + + EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); + }; + + EventEmitter.listenerCount = function (emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } + }; + + EventEmitter.prototype.listenerCount = listenerCount; + + function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; + } + + EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; + }; + + function arrayClone(arr, n) { + var copy = new Array(n); + + for (var i = 0; i < n; ++i) { + copy[i] = arr[i]; + } + + return copy; + } + + function spliceOne(list, index) { + for (; index + 1 < list.length; index++) { + list[index] = list[index + 1]; + } + + list.pop(); + } + + function unwrapListeners(arr) { + var ret = new Array(arr.length); + + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + + return ret; + } + + function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === 'function') { + emitter.removeListener('error', errorListener); + } + + resolve([].slice.call(arguments)); + } + + ; + eventTargetAgnosticAddListener(emitter, name, resolver, { + once: true + }); + + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { + once: true + }); + } + }); + } + + function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } + } + + function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + emitter.addEventListener(name, function wrapListener(arg) { + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } + } +},2628,[]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DynamicStyleSheet = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var _reactNative = _$$_REQUIRE(_dependencyMap[2]); + + function parseStylesFor(styles, mode) { + var newStyles = {}; + + for (var i in styles) { + var style = styles[i]; + var newStyle = {}; + + for (var _i in style) { + var value = style[_i]; + newStyle[_i] = value instanceof _$$_REQUIRE(_dependencyMap[3]).DynamicValue ? value[mode] : value; + } + + newStyles[i] = newStyle; + } + + return newStyles; + } + + var DynamicStyleSheet = function DynamicStyleSheet(styles) { + (0, _classCallCheck2.default)(this, DynamicStyleSheet); + this.dark = _reactNative.StyleSheet.create(parseStylesFor(styles, 'dark')); + this.light = _reactNative.StyleSheet.create(parseStylesFor(styles, 'light')); + }; + + exports.DynamicStyleSheet = DynamicStyleSheet; +},2629,[5,7,28,2630]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.DynamicValue = undefined; + + var _classCallCheck2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1])); + + var DynamicValue = function DynamicValue(light, dark) { + (0, _classCallCheck2.default)(this, DynamicValue); + this.light = light; + this.dark = dark; + }; + + exports.DynamicValue = DynamicValue; +},2630,[5,7]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useDarkMode = useDarkMode; + + function useDarkMode() { + return (0, _$$_REQUIRE(_dependencyMap[0]).useDarkModeContext)() === 'dark'; + } +},2631,[2623]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useDynamicStyleSheet = useDynamicStyleSheet; + + function useDynamicStyleSheet(dynamicStyleSheet) { + var mode = (0, _$$_REQUIRE(_dependencyMap[0]).useDarkModeContext)(); + return dynamicStyleSheet[mode]; + } +},2632,[2623]); +__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) { + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.useDynamicValue = useDynamicValue; + + function useDynamicValue(light, dark) { + var mode = (0, _$$_REQUIRE(_dependencyMap[0]).useDarkModeContext)(); + + if (light instanceof _$$_REQUIRE(_dependencyMap[1]).DynamicValue) { + return light[mode]; + } else { + return mode === 'dark' ? dark : light; + } + } +},2633,[2623,2630]); +__r(57); +__r(0); \ No newline at end of file diff --git a/Other/Resources/fonts/AntDesign.ttf b/Other/Resources/fonts/AntDesign.ttf new file mode 100644 index 0000000..2abf035 Binary files /dev/null and b/Other/Resources/fonts/AntDesign.ttf differ diff --git a/Other/Resources/fonts/DroidKufi-Bold.ttf b/Other/Resources/fonts/DroidKufi-Bold.ttf new file mode 100644 index 0000000..650919e Binary files /dev/null and b/Other/Resources/fonts/DroidKufi-Bold.ttf differ diff --git a/Other/Resources/fonts/DroidKufi-Regular.ttf b/Other/Resources/fonts/DroidKufi-Regular.ttf new file mode 100644 index 0000000..af85975 Binary files /dev/null and b/Other/Resources/fonts/DroidKufi-Regular.ttf differ diff --git a/Other/Resources/fonts/Entypo.ttf b/Other/Resources/fonts/Entypo.ttf new file mode 100644 index 0000000..1c8f5e9 Binary files /dev/null and b/Other/Resources/fonts/Entypo.ttf differ diff --git a/Other/Resources/fonts/EvilIcons.ttf b/Other/Resources/fonts/EvilIcons.ttf new file mode 100644 index 0000000..6868f7b Binary files /dev/null and b/Other/Resources/fonts/EvilIcons.ttf differ diff --git a/Other/Resources/fonts/Feather.ttf b/Other/Resources/fonts/Feather.ttf new file mode 100644 index 0000000..a3c58c5 Binary files /dev/null and b/Other/Resources/fonts/Feather.ttf differ diff --git a/Other/Resources/fonts/FontAwesome.ttf b/Other/Resources/fonts/FontAwesome.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/Other/Resources/fonts/FontAwesome.ttf differ diff --git a/Other/Resources/fonts/FontAwesome5_Brands.ttf b/Other/Resources/fonts/FontAwesome5_Brands.ttf new file mode 100644 index 0000000..948a2a6 Binary files /dev/null and b/Other/Resources/fonts/FontAwesome5_Brands.ttf differ diff --git a/Other/Resources/fonts/FontAwesome5_Regular.ttf b/Other/Resources/fonts/FontAwesome5_Regular.ttf new file mode 100644 index 0000000..abe99e2 Binary files /dev/null and b/Other/Resources/fonts/FontAwesome5_Regular.ttf differ diff --git a/Other/Resources/fonts/FontAwesome5_Solid.ttf b/Other/Resources/fonts/FontAwesome5_Solid.ttf new file mode 100644 index 0000000..5b97903 Binary files /dev/null and b/Other/Resources/fonts/FontAwesome5_Solid.ttf differ diff --git a/Other/Resources/fonts/Fontisto.ttf b/Other/Resources/fonts/Fontisto.ttf new file mode 100755 index 0000000..96e2e81 Binary files /dev/null and b/Other/Resources/fonts/Fontisto.ttf differ diff --git a/Other/Resources/fonts/Foundation.ttf b/Other/Resources/fonts/Foundation.ttf new file mode 100644 index 0000000..6cce217 Binary files /dev/null and b/Other/Resources/fonts/Foundation.ttf differ diff --git a/Other/Resources/fonts/Ionicons.ttf b/Other/Resources/fonts/Ionicons.ttf new file mode 100644 index 0000000..719442d Binary files /dev/null and b/Other/Resources/fonts/Ionicons.ttf differ diff --git a/Other/Resources/fonts/MaterialCommunityIcons.ttf b/Other/Resources/fonts/MaterialCommunityIcons.ttf new file mode 100644 index 0000000..522dc31 Binary files /dev/null and b/Other/Resources/fonts/MaterialCommunityIcons.ttf differ diff --git a/Other/Resources/fonts/MaterialIcons.ttf b/Other/Resources/fonts/MaterialIcons.ttf new file mode 100644 index 0000000..e50801b Binary files /dev/null and b/Other/Resources/fonts/MaterialIcons.ttf differ diff --git a/Other/Resources/fonts/Merriweather-Bold.otf b/Other/Resources/fonts/Merriweather-Bold.otf new file mode 100644 index 0000000..fb3652d Binary files /dev/null and b/Other/Resources/fonts/Merriweather-Bold.otf differ diff --git a/Other/Resources/fonts/Merriweather-Light.otf b/Other/Resources/fonts/Merriweather-Light.otf new file mode 100644 index 0000000..2df7b54 Binary files /dev/null and b/Other/Resources/fonts/Merriweather-Light.otf differ diff --git a/Other/Resources/fonts/Merriweather-Regular.otf b/Other/Resources/fonts/Merriweather-Regular.otf new file mode 100644 index 0000000..f8d16bd Binary files /dev/null and b/Other/Resources/fonts/Merriweather-Regular.otf differ diff --git a/Other/Resources/fonts/Nunito-Bold.ttf b/Other/Resources/fonts/Nunito-Bold.ttf new file mode 100755 index 0000000..c27166f Binary files /dev/null and b/Other/Resources/fonts/Nunito-Bold.ttf differ diff --git a/Other/Resources/fonts/Nunito-Light.ttf b/Other/Resources/fonts/Nunito-Light.ttf new file mode 100644 index 0000000..a39e408 Binary files /dev/null and b/Other/Resources/fonts/Nunito-Light.ttf differ diff --git a/Other/Resources/fonts/Nunito-Medium.ttf b/Other/Resources/fonts/Nunito-Medium.ttf new file mode 100755 index 0000000..edb5fc7 Binary files /dev/null and b/Other/Resources/fonts/Nunito-Medium.ttf differ diff --git a/Other/Resources/fonts/Nunito-Regular.ttf b/Other/Resources/fonts/Nunito-Regular.ttf new file mode 100755 index 0000000..3b0f067 Binary files /dev/null and b/Other/Resources/fonts/Nunito-Regular.ttf differ diff --git a/Other/Resources/fonts/Octicons.ttf b/Other/Resources/fonts/Octicons.ttf new file mode 100644 index 0000000..ceac75d Binary files /dev/null and b/Other/Resources/fonts/Octicons.ttf differ diff --git a/Other/Resources/fonts/OpenSans-Bold.ttf b/Other/Resources/fonts/OpenSans-Bold.ttf new file mode 100644 index 0000000..fd79d43 Binary files /dev/null and b/Other/Resources/fonts/OpenSans-Bold.ttf differ diff --git a/Other/Resources/fonts/OpenSans-Light.ttf b/Other/Resources/fonts/OpenSans-Light.ttf new file mode 100644 index 0000000..0d38189 Binary files /dev/null and b/Other/Resources/fonts/OpenSans-Light.ttf differ diff --git a/Other/Resources/fonts/OpenSans-Regular.ttf b/Other/Resources/fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..db43334 Binary files /dev/null and b/Other/Resources/fonts/OpenSans-Regular.ttf differ diff --git a/Other/Resources/fonts/Roboto.ttf b/Other/Resources/fonts/Roboto.ttf new file mode 100644 index 0000000..3e6e2e7 Binary files /dev/null and b/Other/Resources/fonts/Roboto.ttf differ diff --git a/Other/Resources/fonts/Roboto_medium.ttf b/Other/Resources/fonts/Roboto_medium.ttf new file mode 100644 index 0000000..aa00de0 Binary files /dev/null and b/Other/Resources/fonts/Roboto_medium.ttf differ diff --git a/Other/Resources/fonts/SimpleLineIcons.ttf b/Other/Resources/fonts/SimpleLineIcons.ttf new file mode 100644 index 0000000..6ecb686 Binary files /dev/null and b/Other/Resources/fonts/SimpleLineIcons.ttf differ diff --git a/Other/Resources/fonts/Zocial.ttf b/Other/Resources/fonts/Zocial.ttf new file mode 100644 index 0000000..e4ae46c Binary files /dev/null and b/Other/Resources/fonts/Zocial.ttf differ diff --git a/Other/Resources/fonts/rubicon-icon-font.ttf b/Other/Resources/fonts/rubicon-icon-font.ttf new file mode 100644 index 0000000..25e7d92 Binary files /dev/null and b/Other/Resources/fonts/rubicon-icon-font.ttf differ diff --git a/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon.png b/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon.png new file mode 100644 index 0000000..b23a391 Binary files /dev/null and b/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon.png differ diff --git a/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon@2x.png b/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon@2x.png new file mode 100644 index 0000000..2c4aa30 Binary files /dev/null and b/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon@2x.png differ diff --git a/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon@3x.png b/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon@3x.png new file mode 100644 index 0000000..5b31261 Binary files /dev/null and b/Other/assets/node_modules/@react-navigation/drawer/src/views/assets/toggle-drawer-icon@3x.png differ diff --git a/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon-mask.png b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon-mask.png new file mode 100644 index 0000000..9de7242 Binary files /dev/null and b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon-mask.png differ diff --git a/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon.png b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon.png new file mode 100644 index 0000000..8ed2ec4 Binary files /dev/null and b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon.png differ diff --git a/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon@2x.png b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon@2x.png new file mode 100644 index 0000000..63de0e3 Binary files /dev/null and b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon@2x.png differ diff --git a/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon@3x.png b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon@3x.png new file mode 100644 index 0000000..2320fd7 Binary files /dev/null and b/Other/assets/node_modules/@react-navigation/elements/src/assets/back-icon@3x.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/calendar/img/next@2x.png b/Other/assets/node_modules/react-native-calendars/src/calendar/img/next@2x.png new file mode 100644 index 0000000..b589a4a Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/calendar/img/next@2x.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/calendar/img/previous@2x.png b/Other/assets/node_modules/react-native-calendars/src/calendar/img/previous@2x.png new file mode 100644 index 0000000..368b33d Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/calendar/img/previous@2x.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/img/down.png b/Other/assets/node_modules/react-native-calendars/src/img/down.png new file mode 100644 index 0000000..9695442 Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/img/down.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/img/down@2x.png b/Other/assets/node_modules/react-native-calendars/src/img/down@2x.png new file mode 100644 index 0000000..3c6728c Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/img/down@2x.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/img/down@3x.png b/Other/assets/node_modules/react-native-calendars/src/img/down@3x.png new file mode 100644 index 0000000..bbe1e7c Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/img/down@3x.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/img/up.png b/Other/assets/node_modules/react-native-calendars/src/img/up.png new file mode 100644 index 0000000..5c7116a Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/img/up.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/img/up@2x.png b/Other/assets/node_modules/react-native-calendars/src/img/up@2x.png new file mode 100644 index 0000000..1584de2 Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/img/up@2x.png differ diff --git a/Other/assets/node_modules/react-native-calendars/src/img/up@3x.png b/Other/assets/node_modules/react-native-calendars/src/img/up@3x.png new file mode 100644 index 0000000..5e4c785 Binary files /dev/null and b/Other/assets/node_modules/react-native-calendars/src/img/up@3x.png differ diff --git a/Other/assets/src/navigation/img/text_banner.png b/Other/assets/src/navigation/img/text_banner.png new file mode 100644 index 0000000..b1ec6d9 Binary files /dev/null and b/Other/assets/src/navigation/img/text_banner.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ar.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ar.png new file mode 100644 index 0000000..fc73d16 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ar.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/bs.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/bs.png new file mode 100644 index 0000000..06d006f Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/bs.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/cn.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/cn.png new file mode 100644 index 0000000..ac82169 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/cn.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/da.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/da.png new file mode 100644 index 0000000..ede26bd Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/da.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/de.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/de.png new file mode 100644 index 0000000..73243be Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/de.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/el.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/el.png new file mode 100644 index 0000000..39c0543 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/el.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/en.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/en.png new file mode 100644 index 0000000..3ca4fe2 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/en.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/es.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/es.png new file mode 100644 index 0000000..da617b9 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/es.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/fr.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/fr.png new file mode 100644 index 0000000..5cee5a5 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/fr.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/hr.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/hr.png new file mode 100644 index 0000000..55cfe3d Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/hr.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-accessibility.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-accessibility.png new file mode 100644 index 0000000..986491c Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-accessibility.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-archive.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-archive.png new file mode 100644 index 0000000..d797647 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-archive.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-browse.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-browse.png new file mode 100644 index 0000000..3d427fc Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-browse.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-calendar.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-calendar.png new file mode 100644 index 0000000..a34983a Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-calendar.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-car-mode.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-car-mode.png new file mode 100644 index 0000000..953870c Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-car-mode.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-accessibility.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-accessibility.png new file mode 100644 index 0000000..b55c962 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-accessibility.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-back.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-back.png new file mode 100644 index 0000000..086985f Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-back.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-car-mode.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-car-mode.png new file mode 100644 index 0000000..7e20221 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-car-mode.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-clear-search.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-clear-search.png new file mode 100644 index 0000000..03e9d17 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-clear-search.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-close.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-close.png new file mode 100644 index 0000000..8069cc9 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-close.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-collapse.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-collapse.png new file mode 100644 index 0000000..938d3ed Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-collapse.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-expand.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-expand.png new file mode 100644 index 0000000..a67937c Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-expand.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-eye-off.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-eye-off.png new file mode 100644 index 0000000..cb422bc Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-eye-off.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-eye.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-eye.png new file mode 100644 index 0000000..e540c46 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-eye.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-font-decrease.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-font-decrease.png new file mode 100644 index 0000000..9f47859 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-font-decrease.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-font-increase.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-font-increase.png new file mode 100644 index 0000000..9fbe239 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-font-increase.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-graph-decrease.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-graph-decrease.png new file mode 100644 index 0000000..4a669cd Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-graph-decrease.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-graph-increase.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-graph-increase.png new file mode 100644 index 0000000..9f48333 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-graph-increase.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-next.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-next.png new file mode 100644 index 0000000..af16ae6 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-next.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-print.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-print.png new file mode 100644 index 0000000..b174af6 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-print.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-search.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-search.png new file mode 100644 index 0000000..4446d8e Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-search.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-share.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-share.png new file mode 100644 index 0000000..7e94a9d Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-share.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-toggle-graphic.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-toggle-graphic.png new file mode 100644 index 0000000..da5e09b Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-toggle-graphic.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-toggle-text.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-toggle-text.png new file mode 100644 index 0000000..242894c Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-toggle-text.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-translate.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-translate.png new file mode 100644 index 0000000..382d356 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-translate.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-tts-off.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-tts-off.png new file mode 100644 index 0000000..98d15be Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-tts-off.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-tts-on.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-tts-on.png new file mode 100644 index 0000000..92d0217 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-tts-on.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-up.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-up.png new file mode 100644 index 0000000..8a351e8 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-up.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-zoom-fit-out.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-zoom-fit-out.png new file mode 100644 index 0000000..fb0c4d1 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-circle-zoom-fit-out.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-contact.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-contact.png new file mode 100644 index 0000000..4d21d1f Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-contact.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-down.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-down.png new file mode 100644 index 0000000..3ee79ed Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-down.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-download.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-download.png new file mode 100644 index 0000000..fdc2b4e Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-download.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-fit.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-fit.png new file mode 100644 index 0000000..50c5106 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-fit.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-help.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-help.png new file mode 100644 index 0000000..1598b30 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-help.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-index.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-index.png new file mode 100644 index 0000000..aaffb74 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-index.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-language.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-language.png new file mode 100644 index 0000000..e9a0715 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-language.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-login.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-login.png new file mode 100644 index 0000000..e0a0169 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-login.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-more.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-more.png new file mode 100644 index 0000000..af7431b Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-more.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-next.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-next.png new file mode 100644 index 0000000..0e2006f Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-next.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-prev.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-prev.png new file mode 100644 index 0000000..ceb5c7a Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-prev.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-read.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-read.png new file mode 100644 index 0000000..5a6f070 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-read.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-rss.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-rss.png new file mode 100644 index 0000000..54b27b3 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-rss.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-search.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-search.png new file mode 100644 index 0000000..de5bc22 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-search.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-settings.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-settings.png new file mode 100644 index 0000000..5039e1e Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-settings.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-email.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-email.png new file mode 100644 index 0000000..80add5f Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-email.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-facebook.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-facebook.png new file mode 100644 index 0000000..f975784 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-facebook.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-reddit.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-reddit.png new file mode 100644 index 0000000..d1c2911 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-reddit.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-twitter.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-twitter.png new file mode 100644 index 0000000..c4972a7 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share-twitter.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share.png new file mode 100644 index 0000000..e248817 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-share.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-store.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-store.png new file mode 100644 index 0000000..804b0c7 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-store.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-supplements.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-supplements.png new file mode 100644 index 0000000..9e34d13 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-supplements.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-thumbnail.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-thumbnail.png new file mode 100644 index 0000000..5d41f31 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-thumbnail.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-unfit.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-unfit.png new file mode 100644 index 0000000..b6769b6 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-unfit.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-up.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-up.png new file mode 100644 index 0000000..97c1aa9 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-up.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-warning.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-warning.png new file mode 100644 index 0000000..f1d694a Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ic-warning.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/it.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/it.png new file mode 100644 index 0000000..eb918e7 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/it.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ja.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ja.png new file mode 100644 index 0000000..e66a01d Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ja.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ko.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ko.png new file mode 100644 index 0000000..263c9ea Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ko.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ms.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ms.png new file mode 100644 index 0000000..13e501f Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ms.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/nl.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/nl.png new file mode 100644 index 0000000..e0266b9 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/nl.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/no.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/no.png new file mode 100644 index 0000000..74276b1 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/no.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/pt.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/pt.png new file mode 100644 index 0000000..3be752b Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/pt.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ru.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ru.png new file mode 100644 index 0000000..3bf1092 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/ru.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sl.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sl.png new file mode 100644 index 0000000..a0d6656 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sl.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sq.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sq.png new file mode 100644 index 0000000..150054e Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sq.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sr.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sr.png new file mode 100644 index 0000000..09c7bef Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sr.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sv.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sv.png new file mode 100644 index 0000000..c565536 Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/sv.png differ diff --git a/Other/assets/src/views/newsmemory/buttons-json-manager/icons/us.png b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/us.png new file mode 100644 index 0000000..893466a Binary files /dev/null and b/Other/assets/src/views/newsmemory/buttons-json-manager/icons/us.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-back-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-back-button.png new file mode 100644 index 0000000..9675e47 Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-back-button.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-back-section-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-back-section-button.png new file mode 100644 index 0000000..8ed69d3 Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-back-section-button.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-forward-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-forward-button.png new file mode 100644 index 0000000..77235b4 Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-forward-button.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-forward-section-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-forward-section-button.png new file mode 100644 index 0000000..d41e92d Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v1/ic-forward-section-button.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-button.png new file mode 100644 index 0000000..9db5afd Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-button.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-section-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-section-button.png new file mode 100644 index 0000000..6bc229c Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-section-button.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-to-paper.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-to-paper.png new file mode 100644 index 0000000..0f7e9d5 Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-back-to-paper.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-forward-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-forward-button.png new file mode 100644 index 0000000..bc3b45d Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-forward-button.png differ diff --git a/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-forward-section-button.png b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-forward-section-button.png new file mode 100644 index 0000000..8c8fa48 Binary files /dev/null and b/Other/assets/src/views/newsmemory/pages-layout-manager/icons/v2/ic-forward-section-button.png differ diff --git a/Other/assets/src/views/rss/icon-gallery/img/ic_gallery_white.png b/Other/assets/src/views/rss/icon-gallery/img/ic_gallery_white.png new file mode 100644 index 0000000..39e5f75 Binary files /dev/null and b/Other/assets/src/views/rss/icon-gallery/img/ic_gallery_white.png differ diff --git a/Other/assets/src/views/shared/eink/icons/ic-left-button.png b/Other/assets/src/views/shared/eink/icons/ic-left-button.png new file mode 100644 index 0000000..fa10b0a Binary files /dev/null and b/Other/assets/src/views/shared/eink/icons/ic-left-button.png differ diff --git a/Other/assets/src/views/shared/eink/icons/ic-right-button.png b/Other/assets/src/views/shared/eink/icons/ic-right-button.png new file mode 100644 index 0000000..cfbf1ff Binary files /dev/null and b/Other/assets/src/views/shared/eink/icons/ic-right-button.png differ diff --git a/Other/assets/src/views/shared/gallery-thumbnail-component/ic_not_available.png b/Other/assets/src/views/shared/gallery-thumbnail-component/ic_not_available.png new file mode 100644 index 0000000..8995b79 Binary files /dev/null and b/Other/assets/src/views/shared/gallery-thumbnail-component/ic_not_available.png differ diff --git a/Other/assets/src/views/shared/settings-screen/images/download_full.png b/Other/assets/src/views/shared/settings-screen/images/download_full.png new file mode 100644 index 0000000..8a53645 Binary files /dev/null and b/Other/assets/src/views/shared/settings-screen/images/download_full.png differ diff --git a/Other/assets/src/views/shared/settings-screen/images/download_low.png b/Other/assets/src/views/shared/settings-screen/images/download_low.png new file mode 100644 index 0000000..1f87517 Binary files /dev/null and b/Other/assets/src/views/shared/settings-screen/images/download_low.png differ diff --git a/Other/assets/src/views/shared/settings-screen/images/download_medium.png b/Other/assets/src/views/shared/settings-screen/images/download_medium.png new file mode 100644 index 0000000..d1b806f Binary files /dev/null and b/Other/assets/src/views/shared/settings-screen/images/download_medium.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/10.png b/Other/assets/src/views/verticals/event-icons/icons/10.png new file mode 100644 index 0000000..3499d9d Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/10.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/14.png b/Other/assets/src/views/verticals/event-icons/icons/14.png new file mode 100644 index 0000000..52d83b6 Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/14.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/15.png b/Other/assets/src/views/verticals/event-icons/icons/15.png new file mode 100644 index 0000000..f01a148 Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/15.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/2.png b/Other/assets/src/views/verticals/event-icons/icons/2.png new file mode 100644 index 0000000..c913716 Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/2.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/3.png b/Other/assets/src/views/verticals/event-icons/icons/3.png new file mode 100644 index 0000000..2b78dfc Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/3.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/390.png b/Other/assets/src/views/verticals/event-icons/icons/390.png new file mode 100644 index 0000000..d740193 Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/390.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/4.png b/Other/assets/src/views/verticals/event-icons/icons/4.png new file mode 100644 index 0000000..7a7180f Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/4.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/5.png b/Other/assets/src/views/verticals/event-icons/icons/5.png new file mode 100644 index 0000000..029f39e Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/5.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/6.png b/Other/assets/src/views/verticals/event-icons/icons/6.png new file mode 100644 index 0000000..018c44f Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/6.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/7.png b/Other/assets/src/views/verticals/event-icons/icons/7.png new file mode 100644 index 0000000..5e0a598 Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/7.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/76.png b/Other/assets/src/views/verticals/event-icons/icons/76.png new file mode 100644 index 0000000..7e3ea9d Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/76.png differ diff --git a/Other/assets/src/views/verticals/event-icons/icons/8.png b/Other/assets/src/views/verticals/event-icons/icons/8.png new file mode 100644 index 0000000..d71fbc0 Binary files /dev/null and b/Other/assets/src/views/verticals/event-icons/icons/8.png differ diff --git a/Other/assets/src/views/verticals/navigation/img/monster_logo.png b/Other/assets/src/views/verticals/navigation/img/monster_logo.png new file mode 100644 index 0000000..d0db5c5 Binary files /dev/null and b/Other/assets/src/views/verticals/navigation/img/monster_logo.png differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..233fb10 --- /dev/null +++ b/README.md @@ -0,0 +1,532 @@ +# Tecnavia Newsmemory SDK Integration + +This document describes how to integrate in your existing Xcode project the Tecnavia Newsmemory ePaper solution. + +--- + +## Table of Contents + +- [System requirements](#system) +- [Installation](#installation) + - [Cocoapods](#cocoapods) + - [Manual](#manual) + - [Package contents](#contents) +- [Changes to the Info.plist](#changes) +- [Code integration](#integration) + - [Delegate callbacks](#callbacks) + - [Tracking](#tracking) +- [Troubleshooting](#troubleshooting) +- [Authors](#authors) + +--- + + + +## System requirements + +| | Version | +| ------------------------- | ------------- | +| Xcode | 14.0 or above | +| Minimum deployment target | iOS 11 | + +--- + + + +## Installation + +If you are not using Cocoapods in your project, follow the instruction of the section [`'Manual'`](#manual) + + + +### Cocoapods + +#### Get the SDK thru Xcode Cloud + +1. Add the following lines inside your target declaration in your `Podfile`. + + Remember to: + + - add the source to our specs repo + - replace `X.Y.Z` with the pod version provided (ex. ##VERSION##) + +``` +... +source 'https://github.com/tecnaviapress/Private-Specs.git' +... + +target '' do + +... + +pod 'NewsmemorySDK', 'X.Y.Z' + +... + +end +``` + +2. In the Xcode Cloud console the first build will fail, as Tecnavia repositories are private. A warning message should appear in your `App Store Connect` Xcode Cloud console. In order to proceed with the builds you should grant access to the following Github repositories in the Xcode Cloud settings page: + +- `tecnaviapress/Private-Specs` +- `tecnaviapress/newsmemory-ios-sdk` + +3. After the access have been granted, relaunch the build and this time it should succeed. + +#### Get the SDK thru GitHub + +1. Create a new SSH key and name it `id_tecnavia_deploy_key`, put the key files in folder `~/.ssh/`(see this article for reference https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). Then, in order to be able to download the software from Tecnavia repository, you should provide to Tecnavia your public key. + +2. Edit your SSH config file `~/.ssh/config` and add the following lines: + +``` +#GitHub Tecnavia Repo +Host tecnavia-repo-sdk + HostName github.com + AddKeysToAgent yes + PreferredAuthentications publickey + IdentityFile ~/.ssh/id_tecnavia_deploy_key +``` + +3. Add the following lines inside your target declaration in your `Podfile`. + + Remember to: + + - add the source to our specs repo + - replace `X.Y.Z` with the pod version provided (ex. ##VERSION##) + +``` +... +source 'https://github.com/tecnaviapress/Specs.git' +... + +target '' do + +... + +pod 'NewsmemorySDK', 'X.Y.Z' + +... + +end +``` + +4. Run `pod install`. If you upgrade from a previous version of NewsmemorySDK run `pod install --repo-update` + +#### Get the SDK thru zip file + +Tecnavia provides you a zip package named `ta-newsmemory-sdk_XYZ`, where XYZ stands for the package version (ex. ##VERSION_NO_DOTS##, means that the SDK version is ##VERSION##). + +1. Unzip the package and copy the `ta-newsmemory-sdk_XYZ` folder in the folder containing your project's `Podfile` file. + +2. Add the following lines inside your target declaration in your `Podfile`. + Notice that `XYZ` stands for the package version (ex. ##VERSION_NO_DOTS##) + +``` +... + +target '' do + +... + +pod 'NewsmemorySDK', path: 'ta-newsmemory-sdk_XYZ' + +... + +end +``` + +3. Run `pod install`. + + + +### Manual + + + +#### Package contents + +Tecnavia provides you a zip package named `ta-newsmemory-sdk_XYZ`, where XYZ stands for the package version (ex. ##VERSION_NO_DOTS##, means that the SDK version is ##VERSION##). + +Unzip the package and copy the `ta-newsmemory-sdk_XYZ` folder in the folder containing your project's `.xcodeproj` file (i.e. the SDK folder must be at the same level of the project file). + +The unzipped folder named `ta-newsmemory-sdk_XYZ` has the following subfolders structure: + +``` + . + ├── Headers # headers files imported by the .xcconfig file + ├── Libraries # libraries imported by the .xcconfig file + ├── Device # arm64 libraries + ├── Simulator # simulator x86_64 libraries + ├── Other # images and resources to manully import in the project + ├── assets # set of default icons/images used by the ePaper + ├── Resources + ├── fonts # set of base fonts supported by the ePaper (*.otf, *.ttf files) + ├── Newsmemory.js # the minified javascript bundle file, core of Tecnavia ePaper solution + ├── AccessibilityResources.bundle # a bundle required by React Native framework + ├── ta-newsmemory-sdk.debug.xcconfig # the .xcconfig file with debug settings + ├── ta-newsmemory-sdk.release.xcconfig # the .xcconfig file with release settings + ├── LICENSE + └── README.md + └── img # set of images for the README file +``` + +--- + +1. Drag the `assets` inside `Other` folder and drop it in the project navigator. +2. Select `'Create folder references'` option + +![Assets import](img/assets.gif) + +3. Drag the `Resources` inside `Other` folder and drop it in the project navigator. +4. Select `'Create groups'` option + +![Resources import](img/resources.gif) + +5. Drag and drop `ta-newsmemory-sdk.debug.xcconfig` and `ta-newsmemory-sdk.release.xcconfig` in the project navigator +6. Select `'Create groups'` option +7. Select your project in the project navigator and select `Info` +8. Under `Configurations` expand the `Debug` line and select your Target +9. Click on `None` and select `ta-newsmemory-sdk.debug.xcconfig` +10. Do the same for the `Release` configuration this time selecting the `ta-newsmemory-sdk.release.xcconfig` configuration file. + +![xcconfig import](img/xcconfig.gif) + +11. if your project already includes a `.xcconfig` file for your target configuration add this line at the end of the file + +- your-debug-xconfig-file.xcconfig + +``` +... + +#include "ta-newsmemory-sdk.debug.xcconfig" +``` + +- your-release-xconfig-file.xcconfig + +``` +... + +#include "ta-newsmemory-sdk.release.xcconfig" +``` + +--- + + + +## Changes to the Info.plist + +### Fonts + +In order to make ePaper fonts available inside your app you'll need to add the font file name lines to your app's `Info.plist`. +The key were to add the font names is `UIAppFonts` + +``` + UIAppFonts + + Roboto_medium.ttf + Roboto.ttf + rubicon-icon-font.ttf + Merriweather-Bold.otf + Merriweather-Light.otf + Merriweather-Regular.otf + OpenSans-Bold.ttf + OpenSans-Light.ttf + OpenSans-Regular.ttf + DroidKufi-Bold.ttf + DroidKufi-Regular.ttf + AntDesign.ttf + Entypo.ttf + EvilIcons.ttf + Feather.ttf + FontAwesome.ttf + FontAwesome5_Brands.ttf + FontAwesome5_Regular.ttf + FontAwesome5_Solid.ttf + Fontisto.ttf + Foundation.ttf + Ionicons.ttf + MaterialCommunityIcons.ttf + MaterialIcons.ttf + Octicons.ttf + SimpleLineIcons.ttf + Zocial.ttf + Nunito-Bold.ttf + Nunito-Medium.ttf + Nunito-Regular.ttf + Nunito-Light.ttf + +``` + +### Other Info.plist values + +The ePaper usually works with the key `UIViewControllerBasedStatusBarAppearance` set to `NO` + +``` +UIViewControllerBasedStatusBarAppearance + +``` + +If your app requires `UIViewControllerBasedStatusBarAppearance` to be `YES` ensure that your View Controller sets the Status bar style to `.lightContent`, as the default background color for the ePaper is `black`. + +``` +override var preferredStatusBarStyle: UIStatusBarStyle { + return .lightContent +} +``` + +### HTTP support + +If your ePaper app needs to load resources from non-HTTPS domains ensure that the Info.plist allows arbitrary loads: + +``` +NSAppTransportSecurity + + NSAllowsArbitraryLoads + + ... + +``` + +--- + + + +## Code integration + +### Setup + +Tecnavia provides also the couple "PAPER_SETUP" - "SERVER" which allows you to load the epaper for a specific publication. + +Before displaying the ePaper View Controller (ex. during the your app setup), call the `Newsmemory` singleton to set the startup parameters. + +1. Import the following header file + +``` +... +#import +... +``` + +2. Make the class that will control the ePaper implement the `NewsmemoryDelegate` interface (the below code shows how you could do it in the `AppDelegate.h`) + +``` +... +@interface AppDelegate : UIResponder +... +``` + +2. Before loading the ePaper view (e.g. you could put in your `didFinishLaunchingWithOptions` method in your `AppDelegate.m`), set the publication parameters provided (i.e. PAPER_SETUP, SERVER and API_KEY) and set the delegate + +``` +... +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + ... + [Newsmemory setPSetup:@"PAPER_SETUP"]; + [Newsmemory setServer:@"SERVER"]; + [Newsmemory setDelegate:self]; + //if provided set also the API key + [Newsmemory setAPIkey:@"API_KEY"]; + + return YES; +} +... +``` + +3. Show the TANewsmemoryViewController + +If you are using Storyboards you could simply create a `ViewController` element and set `TANewsmemoryViewController` as `'Class'` + +![Storyboard setup](img/storyboard.png) + +## Swift integration + +If you are using Swift in your app and you are using the `use_frameworks!` attribute you need to take additional steps: + +1. add the following lines to your `Podfile`: + +``` +... +### PODS ### +... + +static_libraries = ['NewsmemorySDK'] # <- static libraries names +# Make frameworks in the list static frameworks by overriding the static_framework?function to return true +pre_install do |installer| + installer.pod_targets.each do |pod| + if static_libraries.include?(pod.name) + puts "Overriding the static_framework? method for #{pod.name}" + def pod.static_framework?; + true + end + def pod.build_type; + Pod::BuildType.static_library + end + end + end +end + +``` + +2. run again `pod install` + +3. Add to you project a `-Bridging-Header.h` file and add there the import of the `Newsmemory` module: + +``` +#import +``` + +4. Remove the import of the `Newsmemory` module from your `.swift` files + + ~~import Newsmemory~~ + +5. Go to `Project`-> `Build Settings`-> `Objective-C Bridging Header` and add the path to the bridging header file. The path should be relative to your project, similar to the way your Info.plist path is specified in Build Settings (see https://developer.apple.com/documentation/swift/importing-objective-c-into-swift for more details). + +## Available Newsmemory methods + +| Method name | Default | Description | +| ------------------- | ---------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| setPSetup | (required) | the configuration to load for a publication | +| setServer | (required) | the Tecnavia endpoint for the publication | +| setToken | none | the auto login token to pass the ePaper | +| setDelegate | none | pass the object that will implement the supported method [callbacks](#callbacks) | +| setNeedsCloseButton | `NO` | adds a button to the ePaper buttons bar to send to the enclosing app a message to close the ePaper +| setNeedsSafeArea | `NO` | delegates to the SDK the handling of the device safe area | +| setDebugMode | `NO` | enables debug mode to increase logging and use development backend versions, it must be set to `NO` when building for Release | + +--- + + + +## Delegate Callbacks + +| Method name | Params | Return value | Is synchronous? | Description | +| ----------------------- | --------------------- | ------------ | --------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| onNewsmemoryClose | none | none | `NO` | Called when the user presses the button to close the ePaper see (`setNeedsCloseButton` method) | +| newsmemoryWillOpenURL | (NSString \*)url | BOOL | `YES` | This callback if called when the ePaper tries to open an URL, if this method returns `NO` the URL wuill be opened inside the Tecnavia ePaper solution, if the method returns `YES` the ePaper won't open the URL and the enclosing app should manage the opening itself. `IMPORTANT:` As this is a synchronous method is the decision can be made within 2 seconds the ePaper will open the URL internally. | +| onNewsmemoryTrackAction | (NSDictionary \*)data | none | `NO` | Each action/event in the app will cause this callback to be called. The data dictionary contains the info regarding the user action. This callback can be used to collect data and send it to the analytics platform your app uses. For more details about the data sent by the app see paragraph [Tracking](#tracking) | +| onNewsmemoryReload | none | none | `NO` | This callback is invoked when a JS bundle update takes place in the SDK | + +Example: + +``` +- (void)onNewsmemoryClose { + ... +} + +- (BOOL)newsmemoryWillOpenURL:(NSString *)url { + //TODO: handle the opening of the URL locally in your app + return YES; +} + +- (void)onNewsmemoryTrackAction:(NSDictionary *)data { + ... +} +``` + +--- + + + +## Tracking + +By implementing the callback `onNewsmemoryTrackAction` your app will receive data about user actions and events occurring inside the ePaper. + +In the following table we will describe the format of the data: + +| Key | Type | Value | +| --------- | --------------- | ----------------------- | +| trackType | NSString \* | `"screen"` or `"event"` | +| data | NSDictionary \* | (see below) | + +### Common data + +| Key | Type | Value | +| ------- | ----------- | ------------------------------------------------- | +| paper | NSString \* | the sanitized paper name, ex: `usatoday` | +| edition | NSString \* | the edition currently open, ex: `USA Today` | +| issue | NSString \* | the issue currently open, ex: `20230218` | +| page | NSString \* | the page the user is currently on, ex: `A1` | +| section | NSString \* | the section the user is currently on, ex: `World` | + +When article mode is open there are other values available: + +| Key | Type | Value | +| ----- | ----------- | ----------------------------------------------------------------- | +| title | NSString \* | the title of the article the user is currently on | +| type | NSString \* | the type of the article the user is currently on, ex: `Editorial` | +| mode | NSString \* | the mode the user is using to read an article, `text`/`graphic` | + +### Screen specific data + +A `screen` represents something that is displayed on the screen, such as an ePaper page or article. + +The `data` dictionary can contain the following values: + +| Key | Type | Value | +| ------ | ----------- | ------------------------------------------------------------------------------------------------------------------------ | +| screen | NSString \* | an URL-like string containing all the info about what is shown onto screen. Ex: `/iPhone/20230218/USA Today/scrolled/A1` | +| action | NSString \* | the action associated to the screen, ex: `scrolled` | + +When article mode is open there are other values available: + +| Key | Type | Value | +| ---------- | ---- | --------------------------------------- | +| article_id | int | the Tecnavia id of the article, ex: `8` | + +### Event specific data + +An `event` represents an action performed by the user on the ePaper, such as the activation of the Text-to-speech feature or the sharing of an article on Facebook. + +The `data` dictionary can contain the following values: + +| Key | Type | Value | +| -------- | ----------- | ---------------------------------------- | +| action | NSString \* | the event name, ex: `tts_start` | +| category | NSString \* | the event category, ex: `text_to_speech` | + +--- + + + +## Troubleshooting + +#### - `error build: Library not found for -l` at build stage + +Check that you copied the SDK folder in the same folder of your `.xcodeproj` file. +Check that you imported the `.xcconfig` file in your project `Configurations` settings + +#### - `[native] No bundle URL present. Make sure you're running a packager server or have included a .jsbundle file in your application bundle.` in the logs and crash at runtime + +Ensure that the you imported the file `Newsmemory.js` within the SDK resources (see `Installation` step `4`). + +#### - `rpath/libswiftCore.dylib not loaded` at runtime + +This might mean that xCode is not including the required Swift packages. +To fix simply add a blank .swift file and let xCode generate the corresponding bridging header. + +#### - `CocoaPods could not find compatible versions for pod "NewsmemorySDK"` when running `pod install` + +``` +[!] CocoaPods could not find compatible versions for pod "NewsmemorySDK": + In Podfile: + NewsmemorySDK (= ##VERSION##) + +None of your spec sources contain a spec satisfying the dependency: `NewsmemorySDK (= ##VERSION##)`. + +You have either: + * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`. + * mistyped the name or version. + * not added the source repo that hosts the Podspec to your Podfile. +``` + +Simply run `pod install --repo-update` + +--- + + + +## Authors + +- Nicolò Aquilini, iOS Software developer, Tecnavia +- Andrea Mauri, Android Software developer, Tecnavia diff --git a/img/assets.gif b/img/assets.gif new file mode 100644 index 0000000..d43b060 Binary files /dev/null and b/img/assets.gif differ diff --git a/img/resources.gif b/img/resources.gif new file mode 100644 index 0000000..c3568b8 Binary files /dev/null and b/img/resources.gif differ diff --git a/img/storyboard.png b/img/storyboard.png new file mode 100644 index 0000000..1c6b89e Binary files /dev/null and b/img/storyboard.png differ diff --git a/img/xcconfig.gif b/img/xcconfig.gif new file mode 100644 index 0000000..221a9bd Binary files /dev/null and b/img/xcconfig.gif differ diff --git a/ta-newsmemory-sdk.debug.xcconfig b/ta-newsmemory-sdk.debug.xcconfig new file mode 100644 index 0000000..904d2a1 --- /dev/null +++ b/ta-newsmemory-sdk.debug.xcconfig @@ -0,0 +1,17 @@ +TECNAVIA_SDK_VERSION = /ta-ios-sdk +EXCLUDED_ARCHS[sdk=iphonesimulator*] = arm64 +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +FRAMEWORK_SEARCH_PATHS = $(inherited) "${TECNAVIA_FRAMEWORKS_DIR}/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleAppMeasurement/Frameworks" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleUserMessagingPlatform/Frameworks/Release" "${TECNAVIA_FRAMEWORKS_DIR}/Google-Mobile-Ads-SDK" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleAppMeasurement/AdIdSupport" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleAppMeasurement/WithoutAdIdSupport" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleUserMessagingPlatform" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SD_WEBP=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +HEADER_SEARCH_PATHS = $(inherited) "${TECNAVIA_HEADERS_DIR}" "${TECNAVIA_HEADERS_DIR}/BVLinearGradient" "${TECNAVIA_HEADERS_DIR}/DoubleConversion" "${TECNAVIA_HEADERS_DIR}/DynamicFonts" "${TECNAVIA_HEADERS_DIR}/FBLazyVector" "${TECNAVIA_HEADERS_DIR}/FBReactNativeSpec" "${TECNAVIA_HEADERS_DIR}/GoogleUtilities" "${TECNAVIA_HEADERS_DIR}/Newsmemory" "${TECNAVIA_HEADERS_DIR}/PromisesObjC" "${TECNAVIA_HEADERS_DIR}/RCTRequired" "${TECNAVIA_HEADERS_DIR}/RCTTypeSafety" "${TECNAVIA_HEADERS_DIR}/RNCAsyncStorage" "${TECNAVIA_HEADERS_DIR}/RNColorMatrixImageFilters" "${TECNAVIA_HEADERS_DIR}/RNDateTimePicker" "${TECNAVIA_HEADERS_DIR}/RNDefaultPreference" "${TECNAVIA_HEADERS_DIR}/RNDeviceInfo" "${TECNAVIA_HEADERS_DIR}/RNFS" "${TECNAVIA_HEADERS_DIR}/RNFastImage" "${TECNAVIA_HEADERS_DIR}/RNGestureHandler" "${TECNAVIA_HEADERS_DIR}/RNIap" "${TECNAVIA_HEADERS_DIR}/RNOpenAppSettings" "${TECNAVIA_HEADERS_DIR}/RNReanimated" "${TECNAVIA_HEADERS_DIR}/RNSVG" "${TECNAVIA_HEADERS_DIR}/RNScreens" "${TECNAVIA_HEADERS_DIR}/RNShare" "${TECNAVIA_HEADERS_DIR}/RNTextSize" "${TECNAVIA_HEADERS_DIR}/RNVectorIcons" "${TECNAVIA_HEADERS_DIR}/RNVolumeController" "${TECNAVIA_HEADERS_DIR}/React-Core" "${TECNAVIA_HEADERS_DIR}/React-RCTBlob" "${TECNAVIA_HEADERS_DIR}/React-RCTText" "${TECNAVIA_HEADERS_DIR}/React-callinvoker" "${TECNAVIA_HEADERS_DIR}/React-cxxreact" "${TECNAVIA_HEADERS_DIR}/React-jsi" "${TECNAVIA_HEADERS_DIR}/React-jsiexecutor" "${TECNAVIA_HEADERS_DIR}/React-jsinspector" "${TECNAVIA_HEADERS_DIR}/React-logger" "${TECNAVIA_HEADERS_DIR}/React-perflogger" "${TECNAVIA_HEADERS_DIR}/React-runtimeexecutor" "${TECNAVIA_HEADERS_DIR}/ReactCommon" "${TECNAVIA_HEADERS_DIR}/ReactNativeART" "${TECNAVIA_HEADERS_DIR}/ReactNativeDarkMode" "${TECNAVIA_HEADERS_DIR}/SDWebImage" "${TECNAVIA_HEADERS_DIR}/SDWebImageWebPCoder" "${TECNAVIA_HEADERS_DIR}/TextToSpeech" "${TECNAVIA_HEADERS_DIR}/Yoga" "${TECNAVIA_HEADERS_DIR}/fmt" "${TECNAVIA_HEADERS_DIR}/glog" "${TECNAVIA_HEADERS_DIR}/libwebp" "${TECNAVIA_HEADERS_DIR}/nanopb" "${TECNAVIA_HEADERS_DIR}/react-native-bridge" "${TECNAVIA_HEADERS_DIR}/react-native-cookies" "${TECNAVIA_HEADERS_DIR}/react-native-dfp" "${TECNAVIA_HEADERS_DIR}/react-native-geolocation" "${TECNAVIA_HEADERS_DIR}/react-native-html-to-pdf" "${TECNAVIA_HEADERS_DIR}/react-native-idle-timer" "${TECNAVIA_HEADERS_DIR}/react-native-image-editor" "${TECNAVIA_HEADERS_DIR}/react-native-image-marker" "${TECNAVIA_HEADERS_DIR}/react-native-mail" "${TECNAVIA_HEADERS_DIR}/react-native-netinfo" "${TECNAVIA_HEADERS_DIR}/react-native-pager-view" "${TECNAVIA_HEADERS_DIR}/react-native-pdf" "${TECNAVIA_HEADERS_DIR}/react-native-photo-view-ex" "${TECNAVIA_HEADERS_DIR}/react-native-print" "${TECNAVIA_HEADERS_DIR}/react-native-safe-area-context" "${TECNAVIA_HEADERS_DIR}/react-native-slider" "${TECNAVIA_HEADERS_DIR}/react-native-splash-screen" "${TECNAVIA_HEADERS_DIR}/react-native-sqlite-storage" "${TECNAVIA_HEADERS_DIR}/react-native-uuid-generator" "${TECNAVIA_HEADERS_DIR}/react-native-video" "${TECNAVIA_HEADERS_DIR}/react-native-webview" "${TECNAVIA_HEADERS_DIR}/react-native-zip-archive" "${TECNAVIA_HEADERS_DIR}/rn-fetch-blob" "${TECNAVIA_HEADERS_DIR}/DoubleConversion" "${TECNAVIA_HEADERS_DIR}/boost" "${TECNAVIA_HEADERS_DIR}/React-Core" +LIBRARY_SEARCH_PATHS = $(inherited) "${TECNAVIA_BUILD_DIR}/BVLinearGradient" "${TECNAVIA_BUILD_DIR}/DoubleConversion" "${TECNAVIA_BUILD_DIR}/DynamicFonts" "${TECNAVIA_BUILD_DIR}/FBReactNativeSpec" "${TECNAVIA_BUILD_DIR}/GoogleUtilities" "${TECNAVIA_BUILD_DIR}/Newsmemory" "${TECNAVIA_BUILD_DIR}/PromisesObjC" "${TECNAVIA_BUILD_DIR}/RCT-Folly" "${TECNAVIA_BUILD_DIR}/RCTTypeSafety" "${TECNAVIA_BUILD_DIR}/RNCAsyncStorage" "${TECNAVIA_BUILD_DIR}/RNColorMatrixImageFilters" "${TECNAVIA_BUILD_DIR}/RNDateTimePicker" "${TECNAVIA_BUILD_DIR}/RNDefaultPreference" "${TECNAVIA_BUILD_DIR}/RNDeviceInfo" "${TECNAVIA_BUILD_DIR}/RNFS" "${TECNAVIA_BUILD_DIR}/RNFastImage" "${TECNAVIA_BUILD_DIR}/RNGestureHandler" "${TECNAVIA_BUILD_DIR}/RNIap" "${TECNAVIA_BUILD_DIR}/RNOpenAppSettings" "${TECNAVIA_BUILD_DIR}/RNReanimated" "${TECNAVIA_BUILD_DIR}/RNSVG" "${TECNAVIA_BUILD_DIR}/RNScreens" "${TECNAVIA_BUILD_DIR}/RNShare" "${TECNAVIA_BUILD_DIR}/RNTextSize" "${TECNAVIA_BUILD_DIR}/RNVectorIcons" "${TECNAVIA_BUILD_DIR}/RNVolumeController" "${TECNAVIA_BUILD_DIR}/React-Core" "${TECNAVIA_BUILD_DIR}/React-CoreModules" "${TECNAVIA_BUILD_DIR}/React-RCTAnimation" "${TECNAVIA_BUILD_DIR}/React-RCTBlob" "${TECNAVIA_BUILD_DIR}/React-RCTImage" "${TECNAVIA_BUILD_DIR}/React-RCTLinking" "${TECNAVIA_BUILD_DIR}/React-RCTNetwork" "${TECNAVIA_BUILD_DIR}/React-RCTSettings" "${TECNAVIA_BUILD_DIR}/React-RCTText" "${TECNAVIA_BUILD_DIR}/React-RCTVibration" "${TECNAVIA_BUILD_DIR}/React-cxxreact" "${TECNAVIA_BUILD_DIR}/React-jsi" "${TECNAVIA_BUILD_DIR}/React-jsiexecutor" "${TECNAVIA_BUILD_DIR}/React-jsinspector" "${TECNAVIA_BUILD_DIR}/React-logger" "${TECNAVIA_BUILD_DIR}/React-perflogger" "${TECNAVIA_BUILD_DIR}/ReactCommon" "${TECNAVIA_BUILD_DIR}/ReactNativeART" "${TECNAVIA_BUILD_DIR}/ReactNativeDarkMode" "${TECNAVIA_BUILD_DIR}/SDWebImage" "${TECNAVIA_BUILD_DIR}/SDWebImageWebPCoder" "${TECNAVIA_BUILD_DIR}/TextToSpeech" "${TECNAVIA_BUILD_DIR}/Yoga" "${TECNAVIA_BUILD_DIR}/fmt" "${TECNAVIA_BUILD_DIR}/glog" "${TECNAVIA_BUILD_DIR}/libwebp" "${TECNAVIA_BUILD_DIR}/nanopb" "${TECNAVIA_BUILD_DIR}/react-native-bridge" "${TECNAVIA_BUILD_DIR}/react-native-cookies" "${TECNAVIA_BUILD_DIR}/react-native-dfp" "${TECNAVIA_BUILD_DIR}/react-native-geolocation" "${TECNAVIA_BUILD_DIR}/react-native-html-to-pdf" "${TECNAVIA_BUILD_DIR}/react-native-idle-timer" "${TECNAVIA_BUILD_DIR}/react-native-image-editor" "${TECNAVIA_BUILD_DIR}/react-native-image-marker" "${TECNAVIA_BUILD_DIR}/react-native-mail" "${TECNAVIA_BUILD_DIR}/react-native-netinfo" "${TECNAVIA_BUILD_DIR}/react-native-pager-view" "${TECNAVIA_BUILD_DIR}/react-native-pdf" "${TECNAVIA_BUILD_DIR}/react-native-photo-view-ex" "${TECNAVIA_BUILD_DIR}/react-native-print" "${TECNAVIA_BUILD_DIR}/react-native-safe-area-context" "${TECNAVIA_BUILD_DIR}/react-native-slider" "${TECNAVIA_BUILD_DIR}/react-native-splash-screen" "${TECNAVIA_BUILD_DIR}/react-native-sqlite-storage" "${TECNAVIA_BUILD_DIR}/react-native-uuid-generator" "${TECNAVIA_BUILD_DIR}/react-native-video" "${TECNAVIA_BUILD_DIR}/react-native-webview" "${TECNAVIA_BUILD_DIR}/react-native-zip-archive" "${TECNAVIA_BUILD_DIR}/rn-fetch-blob" "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +OTHER_CFLAGS = $(inherited) -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/RNIap/RNIap.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/FBLPromises/PromisesObjC.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/GoogleUtilities/GoogleUtilities.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/Newsmemory/Newsmemory.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/React/React-Core.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/nanopb/nanopb.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/yoga/Yoga.modulemap" +OTHER_LDFLAGS = $(inherited) -ObjC -l"BVLinearGradient" -l"DoubleConversion" -l"DynamicFonts" -l"FBReactNativeSpec" -l"GoogleUtilities" -l"Newsmemory" -l"PromisesObjC" -l"RCT-Folly" -l"RCTTypeSafety" -l"RNCAsyncStorage" -l"RNColorMatrixImageFilters" -l"RNDateTimePicker" -l"RNDefaultPreference" -l"RNDeviceInfo" -l"RNFS" -l"RNFastImage" -l"RNGestureHandler" -l"RNIap" -l"RNOpenAppSettings" -l"RNReanimated" -l"RNSVG" -l"RNScreens" -l"RNShare" -l"RNTextSize" -l"RNVectorIcons" -l"RNVolumeController" -l"React-Core" -l"React-CoreModules" -l"React-RCTAnimation" -l"React-RCTBlob" -l"React-RCTImage" -l"React-RCTLinking" -l"React-RCTNetwork" -l"React-RCTSettings" -l"React-RCTText" -l"React-RCTVibration" -l"React-cxxreact" -l"React-jsi" -l"React-jsiexecutor" -l"React-jsinspector" -l"React-logger" -l"React-perflogger" -l"ReactCommon" -l"ReactNativeART" -l"ReactNativeDarkMode" -l"SDWebImage" -l"SDWebImageWebPCoder" -l"TextToSpeech" -l"Yoga" -l"c++" -l"c++abi" -l"fmt" -l"glog" -l"iconv" -l"libwebp" -l"nanopb" -l"react-native-bridge" -l"react-native-cookies" -l"react-native-dfp" -l"react-native-geolocation" -l"react-native-html-to-pdf" -l"react-native-idle-timer" -l"react-native-image-editor" -l"react-native-image-marker" -l"react-native-mail" -l"react-native-netinfo" -l"react-native-pager-view" -l"react-native-pdf" -l"react-native-photo-view-ex" -l"react-native-print" -l"react-native-safe-area-context" -l"react-native-slider" -l"react-native-splash-screen" -l"react-native-sqlite-storage" -l"react-native-uuid-generator" -l"react-native-video" -l"react-native-webview" -l"react-native-zip-archive" -l"rn-fetch-blob" -l"sqlite3" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreText" -framework "CoreVideo" -framework "Foundation" -framework "GoogleAppMeasurement" -framework "GoogleAppMeasurementIdentitySupport" -framework "GoogleMobileAds" -framework "ImageIO" -framework "JavaScriptCore" -framework "MediaPlayer" -framework "MessageUI" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration" -framework "UIKit" -framework "UserMessagingPlatform" -framework "WebKit" -weak_framework "AdSupport" -weak_framework "JavaScriptCore" -weak_framework "LinkPresentation" -weak_framework "SafariServices" -weak_framework "WebKit" +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/RNIap/RNIap.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/FBLPromises/PromisesObjC.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/GoogleUtilities/GoogleUtilities.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/Newsmemory/Newsmemory.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/React/React-Core.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/nanopb/nanopb.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/yoga/Yoga.modulemap" +TECNAVIA_BUILD_DIR = ${SRCROOT}/${TECNAVIA_SDK_VERSION}/Libraries/Simulator +TECNAVIA_HEADERS_DIR = ${SRCROOT}/${TECNAVIA_SDK_VERSION}/Headers +TECNAVIA_FRAMEWORKS_DIR = ${SRCROOT}/${TECNAVIA_SDK_VERSION}/Frameworks +SWIFT_INCLUDE_PATHS = $(inherited) "${TECNAVIA_BUILD_DIR}/RNIap" +USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/libwebp/src +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES diff --git a/ta-newsmemory-sdk.release.xcconfig b/ta-newsmemory-sdk.release.xcconfig new file mode 100644 index 0000000..09c1c83 --- /dev/null +++ b/ta-newsmemory-sdk.release.xcconfig @@ -0,0 +1,16 @@ +TECNAVIA_SDK_VERSION = /ta-ios-sdk +ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES +CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = NO +FRAMEWORK_SEARCH_PATHS = $(inherited) "${TECNAVIA_FRAMEWORKS_DIR}/Google-Mobile-Ads-SDK/Frameworks/GoogleMobileAdsFramework" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleAppMeasurement/Frameworks" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleUserMessagingPlatform/Frameworks/Release" "${TECNAVIA_FRAMEWORKS_DIR}/Google-Mobile-Ads-SDK" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleAppMeasurement/AdIdSupport" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleAppMeasurement/WithoutAdIdSupport" "${TECNAVIA_FRAMEWORKS_DIR}/GoogleUserMessagingPlatform" +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 $(inherited) SD_WEBP=1 $(inherited) PB_FIELD_32BIT=1 PB_NO_PACKED_STRUCTS=1 PB_ENABLE_MALLOC=1 +HEADER_SEARCH_PATHS = $(inherited) "${TECNAVIA_HEADERS_DIR}" "${TECNAVIA_HEADERS_DIR}/BVLinearGradient" "${TECNAVIA_HEADERS_DIR}/DoubleConversion" "${TECNAVIA_HEADERS_DIR}/DynamicFonts" "${TECNAVIA_HEADERS_DIR}/FBLazyVector" "${TECNAVIA_HEADERS_DIR}/FBReactNativeSpec" "${TECNAVIA_HEADERS_DIR}/GoogleUtilities" "${TECNAVIA_HEADERS_DIR}/Newsmemory" "${TECNAVIA_HEADERS_DIR}/PromisesObjC" "${TECNAVIA_HEADERS_DIR}/RCTRequired" "${TECNAVIA_HEADERS_DIR}/RCTTypeSafety" "${TECNAVIA_HEADERS_DIR}/RNCAsyncStorage" "${TECNAVIA_HEADERS_DIR}/RNColorMatrixImageFilters" "${TECNAVIA_HEADERS_DIR}/RNDateTimePicker" "${TECNAVIA_HEADERS_DIR}/RNDefaultPreference" "${TECNAVIA_HEADERS_DIR}/RNDeviceInfo" "${TECNAVIA_HEADERS_DIR}/RNFS" "${TECNAVIA_HEADERS_DIR}/RNFastImage" "${TECNAVIA_HEADERS_DIR}/RNGestureHandler" "${TECNAVIA_HEADERS_DIR}/RNIap" "${TECNAVIA_HEADERS_DIR}/RNOpenAppSettings" "${TECNAVIA_HEADERS_DIR}/RNReanimated" "${TECNAVIA_HEADERS_DIR}/RNSVG" "${TECNAVIA_HEADERS_DIR}/RNScreens" "${TECNAVIA_HEADERS_DIR}/RNShare" "${TECNAVIA_HEADERS_DIR}/RNTextSize" "${TECNAVIA_HEADERS_DIR}/RNVectorIcons" "${TECNAVIA_HEADERS_DIR}/RNVolumeController" "${TECNAVIA_HEADERS_DIR}/React-Core" "${TECNAVIA_HEADERS_DIR}/React-RCTBlob" "${TECNAVIA_HEADERS_DIR}/React-RCTText" "${TECNAVIA_HEADERS_DIR}/React-callinvoker" "${TECNAVIA_HEADERS_DIR}/React-cxxreact" "${TECNAVIA_HEADERS_DIR}/React-jsi" "${TECNAVIA_HEADERS_DIR}/React-jsiexecutor" "${TECNAVIA_HEADERS_DIR}/React-jsinspector" "${TECNAVIA_HEADERS_DIR}/React-logger" "${TECNAVIA_HEADERS_DIR}/React-perflogger" "${TECNAVIA_HEADERS_DIR}/React-runtimeexecutor" "${TECNAVIA_HEADERS_DIR}/ReactCommon" "${TECNAVIA_HEADERS_DIR}/ReactNativeART" "${TECNAVIA_HEADERS_DIR}/ReactNativeDarkMode" "${TECNAVIA_HEADERS_DIR}/SDWebImage" "${TECNAVIA_HEADERS_DIR}/SDWebImageWebPCoder" "${TECNAVIA_HEADERS_DIR}/TextToSpeech" "${TECNAVIA_HEADERS_DIR}/Yoga" "${TECNAVIA_HEADERS_DIR}/fmt" "${TECNAVIA_HEADERS_DIR}/glog" "${TECNAVIA_HEADERS_DIR}/libwebp" "${TECNAVIA_HEADERS_DIR}/nanopb" "${TECNAVIA_HEADERS_DIR}/react-native-bridge" "${TECNAVIA_HEADERS_DIR}/react-native-cookies" "${TECNAVIA_HEADERS_DIR}/react-native-dfp" "${TECNAVIA_HEADERS_DIR}/react-native-geolocation" "${TECNAVIA_HEADERS_DIR}/react-native-html-to-pdf" "${TECNAVIA_HEADERS_DIR}/react-native-idle-timer" "${TECNAVIA_HEADERS_DIR}/react-native-image-editor" "${TECNAVIA_HEADERS_DIR}/react-native-image-marker" "${TECNAVIA_HEADERS_DIR}/react-native-mail" "${TECNAVIA_HEADERS_DIR}/react-native-netinfo" "${TECNAVIA_HEADERS_DIR}/react-native-pager-view" "${TECNAVIA_HEADERS_DIR}/react-native-pdf" "${TECNAVIA_HEADERS_DIR}/react-native-photo-view-ex" "${TECNAVIA_HEADERS_DIR}/react-native-print" "${TECNAVIA_HEADERS_DIR}/react-native-safe-area-context" "${TECNAVIA_HEADERS_DIR}/react-native-slider" "${TECNAVIA_HEADERS_DIR}/react-native-splash-screen" "${TECNAVIA_HEADERS_DIR}/react-native-sqlite-storage" "${TECNAVIA_HEADERS_DIR}/react-native-uuid-generator" "${TECNAVIA_HEADERS_DIR}/react-native-video" "${TECNAVIA_HEADERS_DIR}/react-native-webview" "${TECNAVIA_HEADERS_DIR}/react-native-zip-archive" "${TECNAVIA_HEADERS_DIR}/rn-fetch-blob" "${TECNAVIA_HEADERS_DIR}/React-Core" +LIBRARY_SEARCH_PATHS = $(inherited) "${TECNAVIA_BUILD_DIR}/BVLinearGradient" "${TECNAVIA_BUILD_DIR}/DoubleConversion" "${TECNAVIA_BUILD_DIR}/DynamicFonts" "${TECNAVIA_BUILD_DIR}/FBReactNativeSpec" "${TECNAVIA_BUILD_DIR}/GoogleUtilities" "${TECNAVIA_BUILD_DIR}/Newsmemory" "${TECNAVIA_BUILD_DIR}/PromisesObjC" "${TECNAVIA_BUILD_DIR}/RCT-Folly" "${TECNAVIA_BUILD_DIR}/RCTTypeSafety" "${TECNAVIA_BUILD_DIR}/RNCAsyncStorage" "${TECNAVIA_BUILD_DIR}/RNColorMatrixImageFilters" "${TECNAVIA_BUILD_DIR}/RNDateTimePicker" "${TECNAVIA_BUILD_DIR}/RNDefaultPreference" "${TECNAVIA_BUILD_DIR}/RNDeviceInfo" "${TECNAVIA_BUILD_DIR}/RNFS" "${TECNAVIA_BUILD_DIR}/RNFastImage" "${TECNAVIA_BUILD_DIR}/RNGestureHandler" "${TECNAVIA_BUILD_DIR}/RNIap" "${TECNAVIA_BUILD_DIR}/RNOpenAppSettings" "${TECNAVIA_BUILD_DIR}/RNReanimated" "${TECNAVIA_BUILD_DIR}/RNSVG" "${TECNAVIA_BUILD_DIR}/RNScreens" "${TECNAVIA_BUILD_DIR}/RNShare" "${TECNAVIA_BUILD_DIR}/RNTextSize" "${TECNAVIA_BUILD_DIR}/RNVectorIcons" "${TECNAVIA_BUILD_DIR}/RNVolumeController" "${TECNAVIA_BUILD_DIR}/React-Core" "${TECNAVIA_BUILD_DIR}/React-CoreModules" "${TECNAVIA_BUILD_DIR}/React-RCTAnimation" "${TECNAVIA_BUILD_DIR}/React-RCTBlob" "${TECNAVIA_BUILD_DIR}/React-RCTImage" "${TECNAVIA_BUILD_DIR}/React-RCTLinking" "${TECNAVIA_BUILD_DIR}/React-RCTNetwork" "${TECNAVIA_BUILD_DIR}/React-RCTSettings" "${TECNAVIA_BUILD_DIR}/React-RCTText" "${TECNAVIA_BUILD_DIR}/React-RCTVibration" "${TECNAVIA_BUILD_DIR}/React-cxxreact" "${TECNAVIA_BUILD_DIR}/React-jsi" "${TECNAVIA_BUILD_DIR}/React-jsiexecutor" "${TECNAVIA_BUILD_DIR}/React-jsinspector" "${TECNAVIA_BUILD_DIR}/React-logger" "${TECNAVIA_BUILD_DIR}/React-perflogger" "${TECNAVIA_BUILD_DIR}/ReactCommon" "${TECNAVIA_BUILD_DIR}/ReactNativeART" "${TECNAVIA_BUILD_DIR}/ReactNativeDarkMode" "${TECNAVIA_BUILD_DIR}/SDWebImage" "${TECNAVIA_BUILD_DIR}/SDWebImageWebPCoder" "${TECNAVIA_BUILD_DIR}/TextToSpeech" "${TECNAVIA_BUILD_DIR}/Yoga" "${TECNAVIA_BUILD_DIR}/fmt" "${TECNAVIA_BUILD_DIR}/glog" "${TECNAVIA_BUILD_DIR}/libwebp" "${TECNAVIA_BUILD_DIR}/nanopb" "${TECNAVIA_BUILD_DIR}/react-native-bridge" "${TECNAVIA_BUILD_DIR}/react-native-cookies" "${TECNAVIA_BUILD_DIR}/react-native-dfp" "${TECNAVIA_BUILD_DIR}/react-native-geolocation" "${TECNAVIA_BUILD_DIR}/react-native-html-to-pdf" "${TECNAVIA_BUILD_DIR}/react-native-idle-timer" "${TECNAVIA_BUILD_DIR}/react-native-image-editor" "${TECNAVIA_BUILD_DIR}/react-native-image-marker" "${TECNAVIA_BUILD_DIR}/react-native-mail" "${TECNAVIA_BUILD_DIR}/react-native-netinfo" "${TECNAVIA_BUILD_DIR}/react-native-pager-view" "${TECNAVIA_BUILD_DIR}/react-native-pdf" "${TECNAVIA_BUILD_DIR}/react-native-photo-view-ex" "${TECNAVIA_BUILD_DIR}/react-native-print" "${TECNAVIA_BUILD_DIR}/react-native-safe-area-context" "${TECNAVIA_BUILD_DIR}/react-native-slider" "${TECNAVIA_BUILD_DIR}/react-native-splash-screen" "${TECNAVIA_BUILD_DIR}/react-native-sqlite-storage" "${TECNAVIA_BUILD_DIR}/react-native-uuid-generator" "${TECNAVIA_BUILD_DIR}/react-native-video" "${TECNAVIA_BUILD_DIR}/react-native-webview" "${TECNAVIA_BUILD_DIR}/react-native-zip-archive" "${TECNAVIA_BUILD_DIR}/rn-fetch-blob" "${TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" /usr/lib/swift +OTHER_CFLAGS = $(inherited) -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/RNIap/RNIap.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/FBLPromises/PromisesObjC.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/GoogleUtilities/GoogleUtilities.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/Newsmemory/Newsmemory.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/React/React-Core.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/nanopb/nanopb.modulemap" -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/yoga/Yoga.modulemap" +OTHER_LDFLAGS = $(inherited) -ObjC -l"BVLinearGradient" -l"DoubleConversion" -l"DynamicFonts" -l"FBReactNativeSpec" -l"GoogleUtilities" -l"Newsmemory" -l"PromisesObjC" -l"RCT-Folly" -l"RCTTypeSafety" -l"RNCAsyncStorage" -l"RNColorMatrixImageFilters" -l"RNDateTimePicker" -l"RNDefaultPreference" -l"RNDeviceInfo" -l"RNFS" -l"RNFastImage" -l"RNGestureHandler" -l"RNIap" -l"RNOpenAppSettings" -l"RNReanimated" -l"RNSVG" -l"RNScreens" -l"RNShare" -l"RNTextSize" -l"RNVectorIcons" -l"RNVolumeController" -l"React-Core" -l"React-CoreModules" -l"React-RCTAnimation" -l"React-RCTBlob" -l"React-RCTImage" -l"React-RCTLinking" -l"React-RCTNetwork" -l"React-RCTSettings" -l"React-RCTText" -l"React-RCTVibration" -l"React-cxxreact" -l"React-jsi" -l"React-jsiexecutor" -l"React-jsinspector" -l"React-logger" -l"React-perflogger" -l"ReactCommon" -l"ReactNativeART" -l"ReactNativeDarkMode" -l"SDWebImage" -l"SDWebImageWebPCoder" -l"TextToSpeech" -l"Yoga" -l"c++" -l"c++abi" -l"fmt" -l"glog" -l"iconv" -l"libwebp" -l"nanopb" -l"react-native-bridge" -l"react-native-cookies" -l"react-native-dfp" -l"react-native-geolocation" -l"react-native-html-to-pdf" -l"react-native-idle-timer" -l"react-native-image-editor" -l"react-native-image-marker" -l"react-native-mail" -l"react-native-netinfo" -l"react-native-pager-view" -l"react-native-pdf" -l"react-native-photo-view-ex" -l"react-native-print" -l"react-native-safe-area-context" -l"react-native-slider" -l"react-native-splash-screen" -l"react-native-sqlite-storage" -l"react-native-uuid-generator" -l"react-native-video" -l"react-native-webview" -l"react-native-zip-archive" -l"rn-fetch-blob" -l"sqlite3" -l"z" -framework "AVFoundation" -framework "AudioToolbox" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreMedia" -framework "CoreTelephony" -framework "CoreText" -framework "CoreVideo" -framework "Foundation" -framework "GoogleAppMeasurement" -framework "GoogleAppMeasurementIdentitySupport" -framework "GoogleMobileAds" -framework "ImageIO" -framework "JavaScriptCore" -framework "MediaPlayer" -framework "MessageUI" -framework "MobileCoreServices" -framework "QuartzCore" -framework "Security" -framework "StoreKit" -framework "SystemConfiguration" -framework "UIKit" -framework "UserMessagingPlatform" -framework "WebKit" -weak_framework "AdSupport" -weak_framework "JavaScriptCore" -weak_framework "LinkPresentation" -weak_framework "SafariServices" -weak_framework "WebKit" +OTHER_SWIFT_FLAGS = $(inherited) -D COCOAPODS -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/RNIap/RNIap.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/FBLPromises/PromisesObjC.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/GoogleUtilities/GoogleUtilities.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/Newsmemory/Newsmemory.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/React/React-Core.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/nanopb/nanopb.modulemap" -Xcc -fmodule-map-file="${TECNAVIA_HEADERS_DIR}/yoga/Yoga.modulemap" +TECNAVIA_BUILD_DIR = ${SRCROOT}/${TECNAVIA_SDK_VERSION}/Libraries/Device +TECNAVIA_HEADERS_DIR = ${SRCROOT}/${TECNAVIA_SDK_VERSION}/Headers +TECNAVIA_FRAMEWORKS_DIR = ${SRCROOT}/${TECNAVIA_SDK_VERSION}/Frameworks +SWIFT_INCLUDE_PATHS = $(inherited) "${TECNAVIA_BUILD_DIR}/RNIap" +USER_HEADER_SEARCH_PATHS = $(inherited) $(SRCROOT)/libwebp/src +USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES